|
@@ -73,11 +73,6 @@ void calc_HA1(ha_alg_t _alg, str* _username, str* _realm, str* _password,
|
|
MD5_CTX Md5Ctx;
|
|
MD5_CTX Md5Ctx;
|
|
HASH HA1;
|
|
HASH HA1;
|
|
|
|
|
|
- DEBUG("calc_HA1: alg=%d, username=%.*s, realm=%.*s, password=%.*s, "
|
|
|
|
- "nonce=%.*s, cnonce=%.*s\n",
|
|
|
|
- _alg, _username->len, _username->s, _realm->len, _realm->s, _password->len, _password->s,
|
|
|
|
- _nonce->len, _nonce->s, _cnonce->len, _cnonce->s);
|
|
|
|
-
|
|
|
|
MD5Init(&Md5Ctx);
|
|
MD5Init(&Md5Ctx);
|
|
MD5Update(&Md5Ctx, _username->s, _username->len);
|
|
MD5Update(&Md5Ctx, _username->s, _username->len);
|
|
MD5Update(&Md5Ctx, ":", 1);
|
|
MD5Update(&Md5Ctx, ":", 1);
|
|
@@ -87,7 +82,6 @@ void calc_HA1(ha_alg_t _alg, str* _username, str* _realm, str* _password,
|
|
MD5Final(HA1, &Md5Ctx);
|
|
MD5Final(HA1, &Md5Ctx);
|
|
|
|
|
|
if (_alg == HA_MD5_SESS) {
|
|
if (_alg == HA_MD5_SESS) {
|
|
- DEBUG("calc_HA1: HA_MD5_SESS\n");
|
|
|
|
MD5Init(&Md5Ctx);
|
|
MD5Init(&Md5Ctx);
|
|
MD5Update(&Md5Ctx, HA1, HASHLEN);
|
|
MD5Update(&Md5Ctx, HA1, HASHLEN);
|
|
MD5Update(&Md5Ctx, ":", 1);
|
|
MD5Update(&Md5Ctx, ":", 1);
|
|
@@ -98,7 +92,6 @@ void calc_HA1(ha_alg_t _alg, str* _username, str* _realm, str* _password,
|
|
};
|
|
};
|
|
|
|
|
|
cvt_hex(HA1, _sess_key);
|
|
cvt_hex(HA1, _sess_key);
|
|
- DEBUG("calc_HA1: H(A1) = %.*s\n", HASHHEXLEN, _sess_key);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -121,11 +114,6 @@ void calc_response(HASHHEX _ha1, /* H(A1) */
|
|
HASH RespHash;
|
|
HASH RespHash;
|
|
HASHHEX HA2Hex;
|
|
HASHHEX HA2Hex;
|
|
|
|
|
|
- DEBUG("calc_response: H(A1)=%.*s, nonce=%.*s, nc=%.*s, cnonce=%.*s, "
|
|
|
|
- "qop=%.*s, auth_int=%d, method=%.*s, uri=%.*s\n",
|
|
|
|
- HASHHEXLEN, _ha1, _nonce->len, _nonce->s, _nc->len, _nc->s, _cnonce->len, _cnonce->s,
|
|
|
|
- _qop->len, _qop->s, _auth_int, _method->len, _method->s, _uri->len, _uri->s);
|
|
|
|
-
|
|
|
|
/* calculate H(A2) */
|
|
/* calculate H(A2) */
|
|
MD5Init(&Md5Ctx);
|
|
MD5Init(&Md5Ctx);
|
|
MD5Update(&Md5Ctx, _method->s, _method->len);
|
|
MD5Update(&Md5Ctx, _method->s, _method->len);
|
|
@@ -140,8 +128,6 @@ void calc_response(HASHHEX _ha1, /* H(A1) */
|
|
MD5Final(HA2, &Md5Ctx);
|
|
MD5Final(HA2, &Md5Ctx);
|
|
cvt_hex(HA2, HA2Hex);
|
|
cvt_hex(HA2, HA2Hex);
|
|
|
|
|
|
- DEBUG("calc_response: H(A2)=%.*s\n", HASHHEXLEN, HA2Hex);
|
|
|
|
-
|
|
|
|
/* calculate response */
|
|
/* calculate response */
|
|
MD5Init(&Md5Ctx);
|
|
MD5Init(&Md5Ctx);
|
|
MD5Update(&Md5Ctx, _ha1, HASHHEXLEN);
|
|
MD5Update(&Md5Ctx, _ha1, HASHHEXLEN);
|
|
@@ -160,5 +146,4 @@ void calc_response(HASHHEX _ha1, /* H(A1) */
|
|
MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN);
|
|
MD5Update(&Md5Ctx, HA2Hex, HASHHEXLEN);
|
|
MD5Final(RespHash, &Md5Ctx);
|
|
MD5Final(RespHash, &Md5Ctx);
|
|
cvt_hex(RespHash, _response);
|
|
cvt_hex(RespHash, _response);
|
|
- DEBUG("calc_response: response=%.*s\n", HASHHEXLEN, _response);
|
|
|
|
}
|
|
}
|