53 #if CRAM_MD5_DIGEST_LEN != 2*GC_MD5_DIGEST_SIZE
54 # error MD5 length mismatch
57 #define HEXCHAR(c) ((c & 0x0F) > 9 ? 'a' + (c & 0x0F) - 10 : '0' + (c & 0x0F))
65 char hash[GC_MD5_DIGEST_SIZE];
68 gc_hmac_md5 (secret, secretlen ? secretlen : strlen (secret),
69 challenge, challengelen ? challengelen : strlen (challenge),
72 for (i = 0; i < GC_MD5_DIGEST_SIZE; i++)
74 *response++ =
HEXCHAR (hash[i] >> 4);
75 *response++ =
HEXCHAR (hash[i]);
void cram_md5_digest(const char *challenge, size_t challengelen, const char *secret, size_t secretlen, char response[CRAM_MD5_DIGEST_LEN])
#define CRAM_MD5_DIGEST_LEN