49 #define NONCE_ENTROPY_BYTES 16
83 state = calloc (1,
sizeof (*state));
102 _gsasl_digest_md5_hexdigit_to_char (
char hexdigit)
107 if (hexdigit >=
'0' && hexdigit <=
'9')
108 return hexdigit -
'0';
109 if (hexdigit >=
'a' && hexdigit <=
'z')
110 return hexdigit -
'a' + 10;
116 _gsasl_digest_md5_hex_to_char (
char u,
char l)
118 return (
char) (((
unsigned char) _gsasl_digest_md5_hexdigit_to_char (u)) *
119 16 + _gsasl_digest_md5_hexdigit_to_char (l));
123 _gsasl_digest_md5_set_hashed_secret (
char *
secret,
const char *hex_secret)
136 *s = _gsasl_digest_md5_hex_to_char (p[0], p[1]);
150 char **output,
size_t *output_len)
207 *output_len = strlen (*output);
264 const char *hashed_passwd;
273 rc = _gsasl_digest_md5_set_hashed_secret (state->
secret,
291 rc = gc_md5 (tmp, strlen (tmp), state->
secret);
334 *output_len = strlen (*output);
369 char **output,
size_t *output_len)
393 char **output,
size_t *output_len)
int gsasl_base64_to(const char *in, size_t inlen, char **out, size_t *outlen)
int gsasl_nonce(char *data, size_t datalen)
void digest_md5_free_finish(digest_md5_finish *f)
void digest_md5_free_response(digest_md5_response *r)
void digest_md5_free_challenge(digest_md5_challenge *c)
int digest_md5_parse_response(const char *response, size_t len, digest_md5_response *out)
char * digest_md5_print_finish(digest_md5_finish *finish)
char * digest_md5_print_challenge(digest_md5_challenge *c)
int _gsasl_digest_md5_server_start(Gsasl_session *sctx _GL_UNUSED, void **mech_data)
int _gsasl_digest_md5_server_step(Gsasl_session *sctx, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
int _gsasl_digest_md5_server_decode(Gsasl_session *sctx _GL_UNUSED, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
#define NONCE_ENTROPY_BYTES
void _gsasl_digest_md5_server_finish(Gsasl_session *sctx _GL_UNUSED, void *mech_data)
int _gsasl_digest_md5_server_encode(Gsasl_session *sctx _GL_UNUSED, void *mech_data, const char *input, size_t input_len, char **output, size_t *output_len)
@ DIGEST_MD5_QOP_AUTH_CONF
#define DIGEST_MD5_RESPONSE_LENGTH
#define DIGEST_MD5_LENGTH
int digest_md5_validate(digest_md5_challenge *c, digest_md5_response *r)
int digest_md5_hmac(char *output, char secret[MD5LEN], const char *nonce, unsigned long nc, const char *cnonce, digest_md5_qop qop, const char *authzid, const char *digesturi, int rspauth, digest_md5_cipher cipher, char *kic, char *kis, char *kcc, char *kcs)
@ GSASL_AUTHENTICATION_ERROR
@ GSASL_MECHANISM_CALLED_TOO_MANY_TIMES
@ GSASL_MECHANISM_PARSE_ERROR
_GSASL_API int gsasl_property_set(Gsasl_session *sctx, Gsasl_property prop, const char *data)
_GSASL_API const char * gsasl_property_get(Gsasl_session *sctx, Gsasl_property prop)
@ GSASL_DIGEST_MD5_HASHED_PASSWORD
char * latin1toutf8(const char *str)
char * utf8tolatin1ifpossible(const char *passwd)
int digest_md5_qopstr2qops(const char *qopstr)
int digest_md5_decode(const char *input, size_t input_len, char **output, size_t *output_len, digest_md5_qop qop, unsigned long readseqnum, char key[DIGEST_MD5_LENGTH])
int digest_md5_encode(const char *input, size_t input_len, char **output, size_t *output_len, digest_md5_qop qop, unsigned long sendseqnum, char key[DIGEST_MD5_LENGTH])
char kis[DIGEST_MD5_LENGTH]
char kcs[DIGEST_MD5_LENGTH]
char kcc[DIGEST_MD5_LENGTH]
char secret[DIGEST_MD5_LENGTH]
char kic[DIGEST_MD5_LENGTH]
digest_md5_challenge challenge
digest_md5_response response
char rspauth[DIGEST_MD5_RESPONSE_LENGTH+1]
char response[DIGEST_MD5_RESPONSE_LENGTH+1]