mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-08 20:10:48 +02:00
free md5/sha before returning error
This commit is contained in:
@@ -24468,6 +24468,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
/* in buffer */
|
||||
ret |= wc_Md5Update(&md5, in, sz);
|
||||
if (ret != 0) {
|
||||
wc_Md5Free(&md5);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24479,6 +24480,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
}
|
||||
#endif
|
||||
if (ret != 0) {
|
||||
wc_Md5Free(&md5);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24488,6 +24490,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
ret |= wc_Md5Update(&md5, PAD2, padSz);
|
||||
ret |= wc_Md5Update(&md5, result, digestSz);
|
||||
if (ret != 0) {
|
||||
wc_Md5Free(&md5);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24499,6 +24502,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
}
|
||||
#endif
|
||||
if (ret != 0) {
|
||||
wc_Md5Free(&md5);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24518,6 +24522,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
/* in buffer */
|
||||
ret |= wc_ShaUpdate(&sha, in, sz);
|
||||
if (ret != 0) {
|
||||
wc_ShaFree(&sha);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24529,6 +24534,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
}
|
||||
#endif
|
||||
if (ret != 0) {
|
||||
wc_ShaFree(&sha);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24538,6 +24544,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
ret |= wc_ShaUpdate(&sha, PAD2, padSz);
|
||||
ret |= wc_ShaUpdate(&sha, result, digestSz);
|
||||
if (ret != 0) {
|
||||
wc_ShaFree(&sha);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
@@ -24549,6 +24556,7 @@ static int SSL_hmac(WOLFSSL* ssl, byte* digest, const byte* in, word32 sz,
|
||||
}
|
||||
#endif
|
||||
if (ret != 0) {
|
||||
wc_ShaFree(&sha);
|
||||
WOLFSSL_ERROR_VERBOSE(VERIFY_MAC_ERROR);
|
||||
return VERIFY_MAC_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user