44 for (i = 0; i < HASHLEN; i++)
46 j = (Bin[i] >> 4) & 0xf;
53 Hex[i*2] = (j +
'a' - 10);
58 Hex[i*2+1] = (j +
'0');
62 Hex[i*2+1] = (j +
'a' - 10);
65 Hex[HASHHEXLEN] =
'\0';
77 OUT HASHHEX SessionKey
84 md_ctx_update(md5_ctx, (
const uint8_t *) pszUserName, strlen(pszUserName));
86 md_ctx_update(md5_ctx, (
const uint8_t *) pszRealm, strlen(pszRealm));
88 md_ctx_update(md5_ctx, (
const uint8_t *) pszPassword, strlen(pszPassword));
90 if (pszAlg && strcasecmp(pszAlg,
"md5-sess") == 0)
95 md_ctx_update(md5_ctx, (
const uint8_t *) pszNonce, strlen(pszNonce));
97 md_ctx_update(md5_ctx, (
const uint8_t *) pszCNonce, strlen(pszCNonce));
110 IN
char *pszNonceCount,
114 IN
char *pszDigestUri,
127 md_ctx_update(md5_ctx, (
const uint8_t *) pszMethod, strlen(pszMethod));
129 md_ctx_update(md5_ctx, (
const uint8_t *) pszDigestUri, strlen(pszDigestUri));
130 if (strcasecmp(pszQop,
"auth-int") == 0)
142 md_ctx_update(md5_ctx, (
const uint8_t *) pszNonce, strlen(pszNonce));
146 md_ctx_update(md5_ctx, (
const uint8_t *) pszNonceCount, strlen(pszNonceCount));
148 md_ctx_update(md5_ctx, (
const uint8_t *) pszCNonce, strlen(pszCNonce));
150 md_ctx_update(md5_ctx, (
const uint8_t *) pszQop, strlen(pszQop));
157 CvtHex(RespHash, Response);