Lines Matching refs:digest
364 unsigned char digest[MD5_DIGEST_LEN]; in Curl_auth_create_digest_md5_message() local
418 Curl_MD5_final(ctxt, digest); in Curl_auth_create_digest_md5_message()
424 Curl_MD5_update(ctxt, (const unsigned char *) digest, MD5_DIGEST_LEN); in Curl_auth_create_digest_md5_message()
431 Curl_MD5_final(ctxt, digest); in Curl_auth_create_digest_md5_message()
435 msnprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]); in Curl_auth_create_digest_md5_message()
455 Curl_MD5_final(ctxt, digest); in Curl_auth_create_digest_md5_message()
458 msnprintf(&HA2_hex[2 * i], 3, "%02x", digest[i]); in Curl_auth_create_digest_md5_message()
485 Curl_MD5_final(ctxt, digest); in Curl_auth_create_digest_md5_message()
488 msnprintf(&resp_hash_hex[2 * i], 3, "%02x", digest[i]); in Curl_auth_create_digest_md5_message()
522 struct digestdata *digest) in Curl_auth_decode_digest_http_message() argument
531 if(digest->nonce) in Curl_auth_decode_digest_http_message()
535 Curl_auth_digest_cleanup(digest); in Curl_auth_decode_digest_http_message()
548 free(digest->nonce); in Curl_auth_decode_digest_http_message()
549 digest->nonce = strdup(content); in Curl_auth_decode_digest_http_message()
550 if(!digest->nonce) in Curl_auth_decode_digest_http_message()
555 digest->stale = TRUE; in Curl_auth_decode_digest_http_message()
556 digest->nc = 1; /* we make a new nonce now */ in Curl_auth_decode_digest_http_message()
560 free(digest->realm); in Curl_auth_decode_digest_http_message()
561 digest->realm = strdup(content); in Curl_auth_decode_digest_http_message()
562 if(!digest->realm) in Curl_auth_decode_digest_http_message()
566 free(digest->opaque); in Curl_auth_decode_digest_http_message()
567 digest->opaque = strdup(content); in Curl_auth_decode_digest_http_message()
568 if(!digest->opaque) in Curl_auth_decode_digest_http_message()
594 free(digest->qop); in Curl_auth_decode_digest_http_message()
595 digest->qop = strdup(DIGEST_QOP_VALUE_STRING_AUTH); in Curl_auth_decode_digest_http_message()
596 if(!digest->qop) in Curl_auth_decode_digest_http_message()
600 free(digest->qop); in Curl_auth_decode_digest_http_message()
601 digest->qop = strdup(DIGEST_QOP_VALUE_STRING_AUTH_INT); in Curl_auth_decode_digest_http_message()
602 if(!digest->qop) in Curl_auth_decode_digest_http_message()
607 free(digest->algorithm); in Curl_auth_decode_digest_http_message()
608 digest->algorithm = strdup(content); in Curl_auth_decode_digest_http_message()
609 if(!digest->algorithm) in Curl_auth_decode_digest_http_message()
613 digest->algo = CURLDIGESTALGO_MD5SESS; in Curl_auth_decode_digest_http_message()
615 digest->algo = CURLDIGESTALGO_MD5; in Curl_auth_decode_digest_http_message()
617 digest->algo = CURLDIGESTALGO_SHA256; in Curl_auth_decode_digest_http_message()
619 digest->algo = CURLDIGESTALGO_SHA256SESS; in Curl_auth_decode_digest_http_message()
621 digest->algo = CURLDIGESTALGO_SHA512_256; in Curl_auth_decode_digest_http_message()
623 digest->algo = CURLDIGESTALGO_SHA512_256SESS; in Curl_auth_decode_digest_http_message()
629 digest->userhash = TRUE; in Curl_auth_decode_digest_http_message()
651 if(before && !digest->stale) in Curl_auth_decode_digest_http_message()
655 if(!digest->nonce) in Curl_auth_decode_digest_http_message()
687 struct digestdata *digest, in _Curl_auth_create_digest_http_message() argument
705 if(!digest->nc) in _Curl_auth_create_digest_http_message()
706 digest->nc = 1; in _Curl_auth_create_digest_http_message()
708 if(!digest->cnonce) { in _Curl_auth_create_digest_http_message()
720 digest->cnonce = cnonce; in _Curl_auth_create_digest_http_message()
723 if(digest->userhash) { in _Curl_auth_create_digest_http_message()
724 hashthis = (unsigned char *) aprintf("%s:%s", userp, digest->realm); in _Curl_auth_create_digest_http_message()
746 aprintf("%s:%s:%s", digest->userhash ? userh : userp, in _Curl_auth_create_digest_http_message()
747 digest->realm, passwdp); in _Curl_auth_create_digest_http_message()
756 if(digest->algo == CURLDIGESTALGO_MD5SESS || in _Curl_auth_create_digest_http_message()
757 digest->algo == CURLDIGESTALGO_SHA256SESS || in _Curl_auth_create_digest_http_message()
758 digest->algo == CURLDIGESTALGO_SHA512_256SESS) { in _Curl_auth_create_digest_http_message()
760 tmp = aprintf("%s:%s:%s", ha1, digest->nonce, digest->cnonce); in _Curl_auth_create_digest_http_message()
787 if(digest->qop && strcasecompare(digest->qop, "auth-int")) { in _Curl_auth_create_digest_http_message()
809 if(digest->qop) { in _Curl_auth_create_digest_http_message()
812 digest->nonce, in _Curl_auth_create_digest_http_message()
813 digest->nc, in _Curl_auth_create_digest_http_message()
814 digest->cnonce, in _Curl_auth_create_digest_http_message()
815 digest->qop, in _Curl_auth_create_digest_http_message()
821 digest->nonce, in _Curl_auth_create_digest_http_message()
846 userp_quoted = auth_digest_string_quoted(digest->userhash ? userh : userp); in _Curl_auth_create_digest_http_message()
850 if(digest->qop) { in _Curl_auth_create_digest_http_message()
860 digest->realm, in _Curl_auth_create_digest_http_message()
861 digest->nonce, in _Curl_auth_create_digest_http_message()
863 digest->cnonce, in _Curl_auth_create_digest_http_message()
864 digest->nc, in _Curl_auth_create_digest_http_message()
865 digest->qop, in _Curl_auth_create_digest_http_message()
868 if(strcasecompare(digest->qop, "auth")) in _Curl_auth_create_digest_http_message()
869 digest->nc++; /* The nc (from RFC) has to be a 8 hex digit number 0 in _Curl_auth_create_digest_http_message()
880 digest->realm, in _Curl_auth_create_digest_http_message()
881 digest->nonce, in _Curl_auth_create_digest_http_message()
890 if(digest->opaque) { in _Curl_auth_create_digest_http_message()
892 tmp = aprintf("%s, opaque=\"%s\"", response, digest->opaque); in _Curl_auth_create_digest_http_message()
900 if(digest->algorithm) { in _Curl_auth_create_digest_http_message()
902 tmp = aprintf("%s, algorithm=\"%s\"", response, digest->algorithm); in _Curl_auth_create_digest_http_message()
910 if(digest->userhash) { in _Curl_auth_create_digest_http_message()
952 struct digestdata *digest, in Curl_auth_create_digest_http_message() argument
955 switch(digest->algo) { in Curl_auth_create_digest_http_message()
959 request, uripath, digest, in Curl_auth_create_digest_http_message()
969 request, uripath, digest, in Curl_auth_create_digest_http_message()
989 void Curl_auth_digest_cleanup(struct digestdata *digest) in Curl_auth_digest_cleanup() argument
991 Curl_safefree(digest->nonce); in Curl_auth_digest_cleanup()
992 Curl_safefree(digest->cnonce); in Curl_auth_digest_cleanup()
993 Curl_safefree(digest->realm); in Curl_auth_digest_cleanup()
994 Curl_safefree(digest->opaque); in Curl_auth_digest_cleanup()
995 Curl_safefree(digest->qop); in Curl_auth_digest_cleanup()
996 Curl_safefree(digest->algorithm); in Curl_auth_digest_cleanup()
998 digest->nc = 0; in Curl_auth_digest_cleanup()
999 digest->algo = CURLDIGESTALGO_MD5; /* default algorithm */ in Curl_auth_digest_cleanup()
1000 digest->stale = FALSE; /* default means normal, not stale */ in Curl_auth_digest_cleanup()
1001 digest->userhash = FALSE; in Curl_auth_digest_cleanup()