diff options
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 0c5baffb..33352bc7 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -112,12 +112,12 @@ digest_calc_ha1_from_digest (const char *alg, | |||
112 | char sessionkey[HASH_MD5_HEX_LEN + 1]) | 112 | char sessionkey[HASH_MD5_HEX_LEN + 1]) |
113 | { | 113 | { |
114 | struct MD5Context md5; | 114 | struct MD5Context md5; |
115 | 115 | ||
116 | if (MHD_str_equal_caseless_(alg, | 116 | if (MHD_str_equal_caseless_(alg, |
117 | "md5-sess")) | 117 | "md5-sess")) |
118 | { | 118 | { |
119 | unsigned char ha1[MHD_MD5_DIGEST_SIZE]; | 119 | unsigned char ha1[MHD_MD5_DIGEST_SIZE]; |
120 | 120 | ||
121 | MD5Init (&md5); | 121 | MD5Init (&md5); |
122 | MD5Update (&md5, | 122 | MD5Update (&md5, |
123 | digest, | 123 | digest, |
@@ -680,7 +680,9 @@ check_argument_match (struct MHD_Connection *connection, | |||
680 | &num_headers); | 680 | &num_headers); |
681 | free (argb); | 681 | free (argb); |
682 | if (MHD_YES != ret) | 682 | if (MHD_YES != ret) |
683 | return MHD_NO; | 683 | { |
684 | return MHD_NO; | ||
685 | } | ||
684 | /* also check that the number of headers matches */ | 686 | /* also check that the number of headers matches */ |
685 | for (pos = connection->headers_received; NULL != pos; pos = pos->next) | 687 | for (pos = connection->headers_received; NULL != pos; pos = pos->next) |
686 | { | 688 | { |
@@ -690,7 +692,7 @@ check_argument_match (struct MHD_Connection *connection, | |||
690 | } | 692 | } |
691 | if (0 != num_headers) | 693 | if (0 != num_headers) |
692 | { | 694 | { |
693 | /* argument count mismatch */ | 695 | /* argument count missmatch */ |
694 | return MHD_NO; | 696 | return MHD_NO; |
695 | } | 697 | } |
696 | return MHD_YES; | 698 | return MHD_YES; |
@@ -978,8 +980,8 @@ digest_auth_check_all (struct MHD_Connection *connection, | |||
978 | } | 980 | } |
979 | } | 981 | } |
980 | free (uri); | 982 | free (uri); |
981 | return (0 == strcmp(response, | 983 | return (0 == strcmp (response, |
982 | respexp)) | 984 | respexp)) |
983 | ? MHD_YES | 985 | ? MHD_YES |
984 | : MHD_NO; | 986 | : MHD_NO; |
985 | } | 987 | } |
@@ -1006,12 +1008,12 @@ MHD_digest_auth_check (struct MHD_Connection *connection, | |||
1006 | const char *password, | 1008 | const char *password, |
1007 | unsigned int nonce_timeout) | 1009 | unsigned int nonce_timeout) |
1008 | { | 1010 | { |
1009 | return digest_auth_check_all(connection, | 1011 | return digest_auth_check_all (connection, |
1010 | realm, | 1012 | realm, |
1011 | username, | 1013 | username, |
1012 | password, | 1014 | password, |
1013 | NULL, | 1015 | NULL, |
1014 | nonce_timeout); | 1016 | nonce_timeout); |
1015 | } | 1017 | } |
1016 | 1018 | ||
1017 | 1019 | ||