Skip to content

Commit

Permalink
Alter the check
Browse files Browse the repository at this point in the history
Alter the check since 0 md size is an error.

Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from #23940)
  • Loading branch information
JiangJias authored and nhorman committed Apr 2, 2024
1 parent 165797c commit e53a7cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static int dane_tlsa_add(SSL_DANE *dane,

if (md != NULL) {
mdsize = EVP_MD_get_size(md);
if (mdsize < 0 || dlen != (size_t)mdsize) {
if (mdsize <= 0 || dlen != (size_t)mdsize) {
ERR_raise(ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH);
return 0;
}
Expand Down

0 comments on commit e53a7cc

Please sign in to comment.