diff options
Diffstat (limited to 'src/ssl/s3_enc.c')
-rw-r--r-- | src/ssl/s3_enc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ssl/s3_enc.c b/src/ssl/s3_enc.c index aa0d717..f1924c0 100644 --- a/src/ssl/s3_enc.c +++ b/src/ssl/s3_enc.c @@ -334,7 +334,7 @@ int ssl3_final_finish_mac(SSL *s, const char *sender, int len, uint8_t *p) { static int ssl3_handshake_mac(SSL *s, int md_nid, const char *sender, int len, uint8_t *p) { unsigned int ret; - size_t npad, n; + int npad, n; unsigned int i; uint8_t md_buf[EVP_MAX_MD_SIZE]; EVP_MD_CTX ctx; @@ -357,6 +357,9 @@ static int ssl3_handshake_mac(SSL *s, int md_nid, const char *sender, int len, } n = EVP_MD_CTX_size(&ctx); + if (n < 0) { + return 0; + } npad = (48 / n) * n; if (sender != NULL) { |