diff options
author | Andy Polyakov <appro@openssl.org> | 2018-09-02 13:07:58 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2018-10-12 21:01:53 +0200 |
commit | 7d0effeacbb50b12bfc24df7614d7cf5c8686f51 (patch) | |
tree | 6240b07ae368c430c57afe5e7d191e9053ab788c /ssl/s3_enc.c | |
parent | sha/asm/keccak1600-s390x.pl: resolve -march=z900 portability issue. (diff) | |
download | openssl-7d0effeacbb50b12bfc24df7614d7cf5c8686f51.tar.xz openssl-7d0effeacbb50b12bfc24df7614d7cf5c8686f51.zip |
ssl/s3_enc.c: fix logical errors in ssl3_final_finish_mac.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7085)
Diffstat (limited to '')
-rw-r--r-- | ssl/s3_enc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index 5f403817b4..fca84ef99a 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -442,15 +442,16 @@ size_t ssl3_final_finish_mac(SSL *s, const char *sender, size_t len, if (!EVP_MD_CTX_copy_ex(ctx, s->s3->handshake_dgst)) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_FINAL_FINISH_MAC, ERR_R_INTERNAL_ERROR); - return 0; + ret = 0; + goto err; } ret = EVP_MD_CTX_size(ctx); if (ret < 0) { SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_FINAL_FINISH_MAC, ERR_R_INTERNAL_ERROR); - EVP_MD_CTX_reset(ctx); - return 0; + ret = 0; + goto err; } if ((sender != NULL && EVP_DigestUpdate(ctx, sender, len) <= 0) @@ -463,6 +464,7 @@ size_t ssl3_final_finish_mac(SSL *s, const char *sender, size_t len, ret = 0; } + err: EVP_MD_CTX_free(ctx); return ret; |