diff --git a/digestauth.c b/digestauth.c index 7b3d669..d84b145 100644 --- a/digestauth.c +++ b/digestauth.c @@ -396,7 +396,7 @@ int http_digest_auth_check(const char *http_method, const char *url, const char } if (nonce_privacy_key == NULL) { if (generate_nonce_priv_key() != CWMP_OK) - return MHD_NO; + return MHD_INVALID_NONCE; } nonce_key_len = strlen(nonce_privacy_key); calculate_nonce(nonce_time, http_method, nonce_privacy_key, nonce_key_len, url, realm, noncehashexp); @@ -413,7 +413,7 @@ int http_digest_auth_check(const char *http_method, const char *url, const char if (0 != strcmp(nonce, noncehashexp)) { CWMP_LOG(ERROR, "Nonce value is valid and possibly fabricated"); - return MHD_INVALID_NONCE; + return MHD_NO; } if ((0 == lookup_sub_value(cnonce, sizeof(cnonce), header, "cnonce")) || (0 == lookup_sub_value(qop, sizeof(qop), header, "qop")) || ((0 != strcmp(qop, "auth")) && (0 != strcmp(qop, ""))) || (0 == lookup_sub_value(nc, sizeof(nc), header, "nc")) ||