|  | Home | Documentation | httpda.c File Reference updated by Robert van Engelen |

Macros | Functions | Variables
httpda.c File Reference
`#include "httpda.h"`
Include dependency graph for httpda.c:

## Macros

#define | HTTP_DA_NONCELEN (21)
#define | HTTP_DA_OPAQUELEN (9)

## Functions

static int | http_da_init (struct soap *soap, struct http_da_data *data, int *arg)
static int | http_da_copy (struct soap *soap, struct soap_plugin *dst, struct soap_plugin *src)
static void | http_da_delete (struct soap *soap, struct soap_plugin *p)
static int | http_da_post_header (struct soap *soap, const char *key, const char *val)
static int | http_da_parse (struct soap *soap)
static int | http_da_parse_header (struct soap *soap, const char *key, const char *val)
static int | http_da_prepareinitsend (struct soap *soap)
static int | http_da_prepareinitrecv (struct soap *soap)
static int | http_da_preparesend (struct soap *soap, const char *buf, size_t len)
static int | http_da_preparerecv (struct soap *soap, const char *buf, size_t len)
static int | http_da_preparefinalrecv (struct soap *soap)
static void | http_da_session_start (const char *realm, const char *nonce, const char *opaque)
static int | http_da_session_update (const char *realm, const char *nonce, const char *opaque, const char *cnonce, const char *ncount)
static void | http_da_session_cleanup ()
static void | http_da_calc_nonce (struct soap *soap, char nonce[HTTP_DA_NONCELEN])
static void | http_da_calc_opaque (struct soap *soap, char opaque[HTTP_DA_OPAQUELEN])
static int | http_da_calc_HA1 (struct soap *soap, struct soap_smd_data *smd_data, const char *alg, const char *userid, const char *realm, const char *passwd, const char *nonce, const char *cnonce, char HA1hex[65])
static int | http_da_calc_response (struct soap *soap, struct soap_smd_data *smd_data, const char *alg, char HA1hex[65], const char *nonce, const char *ncount, const char *cnonce, const char *qop, const char *method, const char *uri, char entityHAhex[65], char response[65], char responseHA[32])
SOAP_FMAC1 int SOAP_FMAC2 | http_da (struct soap *soap, struct soap_plugin *p, void *arg)
SOAP_FMAC1 void *SOAP_FMAC2 | http_da_md5 ()
| Use soap_register_plugin_arg(soap, http_da, http_da_md5()) for MD5 server-side challenge algorithm (not recommended).
SOAP_FMAC1 void *SOAP_FMAC2 | http_da_md5_sess ()
| Use soap_register_plugin_arg(soap, http_da, http_da_md5_sess()) for MD5-sess server-side challenge algorithm (not recommended).
SOAP_FMAC1 void *SOAP_FMAC2 | http_da_sha256 ()
| Use soap_register_plugin_arg(soap, http_da, http_da_sha256()) for MD5 server-side challenge algorithm (recommended).
SOAP_FMAC1 void *SOAP_FMAC2 | http_da_sha256_sess ()
| Use soap_register_plugin_arg(soap, http_da, http_da_sha256_sess()) for MD5-sess server-side challenge algorithm (recommended).
SOAP_FMAC1 void *SOAP_FMAC2 | http_da_sha512_256 ()
| Use soap_register_plugin_arg(soap, http_da, http_da_sha512_256()) for MD5 server-side challenge algorithm (not yet supported).
SOAP_FMAC1 void *SOAP_FMAC2 | http_da_sha512_256_sess ()
| Use soap_register_plugin_arg(soap, http_da, http_da_sha512_256_sess()) for MD5-sess server-side challenge algorithm (not yet supported).
SOAP_FMAC1 void SOAP_FMAC2 | http_da_save (struct soap *soap, struct http_da_info *info, const char *realm, const char *userid, const char *passwd)
| Saves the credentials to the digest store to use repeatedly for authentication.
SOAP_FMAC1 void SOAP_FMAC2 | http_da_proxy_save (struct soap *soap, struct http_da_info *info, const char *realm, const char *userid, const char *passwd)
| Saves the credentials to the digest store to use repeatedly for proxy authentication.
SOAP_FMAC1 void SOAP_FMAC2 | http_da_restore (struct soap *soap, struct http_da_info *info)
| Retrieves the credentials from the digest store to use for authentication.
SOAP_FMAC1 void SOAP_FMAC2 | http_da_proxy_restore (struct soap *soap, struct http_da_info *info)
| Retrieves the credentials from the digest store to use for proxy authentication.
SOAP_FMAC1 void SOAP_FMAC2 | http_da_release (struct soap *soap, struct http_da_info *info)
| Releases the digest store and frees memory.
SOAP_FMAC1 void SOAP_FMAC2 | http_da_proxy_release (struct soap *soap, struct http_da_info *info)
| Releases the digest store for proxy authentication and frees memory.
SOAP_FMAC1 int SOAP_FMAC2 | http_da_verify_post (struct soap *soap, const char *passwd)
| Verifies the password credentials at the server side when used in an HTTP POST service operation.
SOAP_FMAC1 int SOAP_FMAC2 | http_da_verify_get (struct soap *soap, const char *passwd)
| Verifies the password credentials at the server side when used in an HTTP GET service operation.
SOAP_FMAC1 int SOAP_FMAC2 | http_da_verify_put (struct soap *soap, const char *passwd)
| Verifies the password credentials at the server side when used in an HTTP PUT service operation.
SOAP_FMAC1 int SOAP_FMAC2 | http_da_verify_patch (struct soap *soap, const char *passwd)
| Verifies the password credentials at the server side when used in an HTTP PATCH service operation.
SOAP_FMAC1 int SOAP_FMAC2 | http_da_verify_del (struct soap *soap, const char *passwd)
| Verifies the password credentials at the server side when used in an HTTP DELETE service operation.
SOAP_FMAC1 int SOAP_FMAC2 | http_da_verify_method (struct soap *soap, const char *method, const char *passwd)
| Verifies the password credentials at the server side when used in the specified HTTP method.

## Variables

const char | http_da_id [] = HTTP_DA_ID
static struct http_da_session * | http_da_session = NULL
static MUTEX_TYPE | http_da_session_lock = MUTEX_INITIALIZER

## Macro Definition Documentation

## ◆ HTTP_DA_NONCELEN

#define HTTP_DA_NONCELEN (21)

## ◆ HTTP_DA_OPAQUELEN

#define HTTP_DA_OPAQUELEN (9)

## Function Documentation

## ◆ http_da()

SOAP_FMAC1 int SOAP_FMAC2 http_da | ( | struct soap * | soap,
|  | struct soap_plugin * | p,
|  | void * | arg )

Plugin registry function, use with soap_register_plugin_arg(soap, http_da, ...)

## ◆ http_da_calc_HA1()

int http_da_calc_HA1 | ( | struct soap * | soap,
|  | struct soap_smd_data * | smd_data,
|  | const char * | alg,
|  | const char * | userid,
|  | const char * | realm,
|  | const char * | passwd,
|  | const char * | nonce,
|  | const char * | cnonce,
|  | char | HA1hex[65] )

static

## ◆ http_da_calc_nonce()

void http_da_calc_nonce | ( | struct soap * | soap,
|  | char | nonce[HTTP_DA_NONCELEN] )

static

## ◆ http_da_calc_opaque()

void http_da_calc_opaque | ( | struct soap * | soap,
|  | char | opaque[HTTP_DA_OPAQUELEN] )

static

## ◆ http_da_calc_response()

int http_da_calc_response | ( | struct soap * | soap,
|  | struct soap_smd_data * | smd_data,
|  | const char * | alg,
|  | char | HA1hex[65],
|  | const char * | nonce,
|  | const char * | ncount,
|  | const char * | cnonce,
|  | const char * | qop,
|  | const char * | method,
|  | const char * | uri,
|  | char | entityHAhex[65],
|  | char | response[65],
|  | char | responseHA[32] )

static

## ◆ http_da_copy()

int http_da_copy | ( | struct soap * | soap,
|  | struct soap_plugin * | dst,
|  | struct soap_plugin * | src )

static

## ◆ http_da_delete()

void http_da_delete | ( | struct soap * | soap,
|  | struct soap_plugin * | p )

static

## ◆ http_da_init()

int http_da_init | ( | struct soap * | soap,
|  | struct http_da_data * | data,
|  | int * | arg )

static

## ◆ http_da_md5()

SOAP_FMAC1 void *SOAP_FMAC2 http_da_md5 | ( |  | ) |

Use soap_register_plugin_arg(soap, http_da, http_da_md5()) for MD5 server-side challenge algorithm (not recommended).

Use MD5 for server-side configuration with soap_register_plugin_arg() not recommended

## ◆ http_da_md5_sess()

SOAP_FMAC1 void *SOAP_FMAC2 http_da_md5_sess | ( |  | ) |

Use soap_register_plugin_arg(soap, http_da, http_da_md5_sess()) for MD5-sess server-side challenge algorithm (not recommended).

Use MD5-sess for server-side configuration with soap_register_plugin_arg() not recommended

## ◆ http_da_parse()

int http_da_parse | ( | struct soap * | soap | ) |

static

## ◆ http_da_parse_header()

int http_da_parse_header | ( | struct soap * | soap,
|  | const char * | key,
|  | const char * | val )

static

## ◆ http_da_post_header()

int http_da_post_header | ( | struct soap * | soap,
|  | const char * | key,
|  | const char * | val )

static

## ◆ http_da_preparefinalrecv()

int http_da_preparefinalrecv | ( | struct soap * | soap | ) |

static

## ◆ http_da_prepareinitrecv()

int http_da_prepareinitrecv | ( | struct soap * | soap | ) |

static

## ◆ http_da_prepareinitsend()

int http_da_prepareinitsend | ( | struct soap * | soap | ) |

static

## ◆ http_da_preparerecv()

int http_da_preparerecv | ( | struct soap * | soap,
|  | const char * | buf,
|  | size_t | len )

static

## ◆ http_da_preparesend()

int http_da_preparesend | ( | struct soap * | soap,
|  | const char * | buf,
|  | size_t | len )

static

## ◆ http_da_proxy_release()

SOAP_FMAC1 void SOAP_FMAC2 http_da_proxy_release | ( | struct soap * | soap,
|  | struct http_da_info * | info )

Releases the digest store for proxy authentication and frees memory.

Parameters

  soap | context
  info | a pointer to the digest store

## ◆ http_da_proxy_restore()

SOAP_FMAC1 void SOAP_FMAC2 http_da_proxy_restore | ( | struct soap * | soap,
|  | struct http_da_info * | info )

Retrieves the credentials from the digest store to use for proxy authentication.

Parameters

  soap | context
  info | a pointer to the digest store

## ◆ http_da_proxy_save()

SOAP_FMAC1 void SOAP_FMAC2 http_da_proxy_save | ( | struct soap * | soap,
|  | struct http_da_info * | info,
|  | const char * | realm,
|  | const char * | userid,
|  | const char * | passwd )

Saves the credentials to the digest store to use repeatedly for proxy authentication.

Parameters

  soap | context
  info | a pointer to the digest store
  realm | string (e.g. use soap->authrealm) of the server
  userid | the user ID string
  passwd | the user password string

## ◆ http_da_release()

SOAP_FMAC1 void SOAP_FMAC2 http_da_release | ( | struct soap * | soap,
|  | struct http_da_info * | info )

Releases the digest store and frees memory.

Parameters

  soap | context
  info | a pointer to the digest store

## ◆ http_da_restore()

SOAP_FMAC1 void SOAP_FMAC2 http_da_restore | ( | struct soap * | soap,
|  | struct http_da_info * | info )

Retrieves the credentials from the digest store to use for authentication.

Parameters

  soap | context
  info | a pointer to the digest store

## ◆ http_da_save()

SOAP_FMAC1 void SOAP_FMAC2 http_da_save | ( | struct soap * | soap,
|  | struct http_da_info * | info,
|  | const char * | realm,
|  | const char * | userid,
|  | const char * | passwd )

Saves the credentials to the digest store to use repeatedly for authentication.

Parameters

  soap | context
  info | a pointer to the digest store
  realm | string (e.g. use soap->authrealm) of the server
  userid | the user ID string
  passwd | the user password string

## ◆ http_da_session_cleanup()

void http_da_session_cleanup | ( |  | ) |

static

## ◆ http_da_session_start()

void http_da_session_start | ( | const char * | realm,
|  | const char * | nonce,
|  | const char * | opaque )

static

## ◆ http_da_session_update()

int http_da_session_update | ( | const char * | realm,
|  | const char * | nonce,
|  | const char * | opaque,
|  | const char * | cnonce,
|  | const char * | ncount )

static

## ◆ http_da_sha256()

SOAP_FMAC1 void *SOAP_FMAC2 http_da_sha256 | ( |  | ) |

Use soap_register_plugin_arg(soap, http_da, http_da_sha256()) for MD5 server-side challenge algorithm (recommended).

Use SHA-256 for server-side configuration with soap_register_plugin_arg()

## ◆ http_da_sha256_sess()

SOAP_FMAC1 void *SOAP_FMAC2 http_da_sha256_sess | ( |  | ) |

Use soap_register_plugin_arg(soap, http_da, http_da_sha256_sess()) for MD5-sess server-side challenge algorithm (recommended).

Use SHA-256-sess for server-side configuration with soap_register_plugin_arg()

## ◆ http_da_sha512_256()

SOAP_FMAC1 void *SOAP_FMAC2 http_da_sha512_256 | ( |  | ) |

Use soap_register_plugin_arg(soap, http_da, http_da_sha512_256()) for MD5 server-side challenge algorithm (not yet supported).

Use SHA-512-256 for server-side configuration with soap_register_plugin_arg()

## ◆ http_da_sha512_256_sess()

SOAP_FMAC1 void *SOAP_FMAC2 http_da_sha512_256_sess | ( |  | ) |

Use soap_register_plugin_arg(soap, http_da, http_da_sha512_256_sess()) for MD5-sess server-side challenge algorithm (not yet supported).

Use SHA-512-256-sess for server-side configuration with soap_register_plugin_arg()

## ◆ http_da_verify_del()

SOAP_FMAC1 int SOAP_FMAC2 http_da_verify_del | ( | struct soap * | soap,
|  | const char * | passwd )

Verifies the password credentials at the server side when used in an HTTP DELETE service operation.

Parameters

  soap | context
  passwd | the user password string

Returns
  SOAP_OK or error when verification failed

## ◆ http_da_verify_get()

SOAP_FMAC1 int SOAP_FMAC2 http_da_verify_get | ( | struct soap * | soap,
|  | const char * | passwd )

Verifies the password credentials at the server side when used in an HTTP GET service operation.

Parameters

  soap | context
  passwd | the user password string

Returns
  SOAP_OK or error when verification failed

## ◆ http_da_verify_method()

SOAP_FMAC1 int SOAP_FMAC2 http_da_verify_method | ( | struct soap * | soap,
|  | const char * | method,
|  | const char * | passwd )

Verifies the password credentials at the server side when used in the specified HTTP method.

Parameters

  soap | context
  method | the HTTP method, e.g. "POST", "GET", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"
  passwd | the user password string

Returns
  SOAP_OK or error when verification failed

## ◆ http_da_verify_patch()

SOAP_FMAC1 int SOAP_FMAC2 http_da_verify_patch | ( | struct soap * | soap,
|  | const char * | passwd )

Verifies the password credentials at the server side when used in an HTTP PATCH service operation.

Parameters

  soap | context
  passwd | the user password string

Returns
  SOAP_OK or error when verification failed

## ◆ http_da_verify_post()

SOAP_FMAC1 int SOAP_FMAC2 http_da_verify_post | ( | struct soap * | soap,
|  | const char * | passwd )

Verifies the password credentials at the server side when used in an HTTP POST service operation.

Parameters

  soap | context
  passwd | the user password string

Returns
  SOAP_OK or error when verification failed

## ◆ http_da_verify_put()

SOAP_FMAC1 int SOAP_FMAC2 http_da_verify_put | ( | struct soap * | soap,
|  | const char * | passwd )

Verifies the password credentials at the server side when used in an HTTP PUT service operation.

Parameters

  soap | context
  passwd | the user password string

Returns
  SOAP_OK or error when verification failed

## Variable Documentation

## ◆ http_da_id

const char http_da_id[] = HTTP_DA_ID

plugin identification for plugin registry

## ◆ http_da_session

struct http_da_session* http_da_session = NULL

static

HTTP DA session database

## ◆ http_da_session_lock

MUTEX_TYPE http_da_session_lock = MUTEX_INITIALIZER

static

HTTP DA session database lock