Skip to content

Commit 8b7246a

Browse files
author
Hans Zandbelt
committed
correct printout in hash comparison function and use apr_strnatcmp
1 parent 24c8b1d commit 8b7246a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/proto.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,9 +1015,10 @@ static apr_byte_t oidc_proto_validate_hash(request_rec *r, const char *alg,
10151015
enc_len--;
10161016
if (encoded[enc_len - 1] == ',')
10171017
enc_len--;
1018+
encoded[enc_len] = '\0';
10181019

10191020
/* compare the calculated hash against the provided hash */
1020-
if ((strncmp(encoded, hash, enc_len) != 0)) {
1021+
if ((apr_strnatcmp(encoded, hash) != 0)) {
10211022
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
10221023
"oidc_proto_validate_hash: provided \"%s\" hash value (%s) does not match the calculated value (%s)",
10231024
type, hash, encoded);

0 commit comments

Comments
 (0)