Skip to content

Commit 4f0e2ab

Browse files
committed
Add CMAC cleanup and RSA TLS bounds check
1 parent 1d0fb43 commit 4f0e2ab

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/wp_cmac.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ static wp_CmacCtx* wp_cmac_new(WOLFPROV_CTX* provCtx)
9090
static void wp_cmac_free(wp_CmacCtx* macCtx)
9191
{
9292
if (macCtx != NULL) {
93+
#ifndef HAVE_FIPS
94+
wc_CmacFree(&macCtx->cmac);
95+
#endif
9396
OPENSSL_cleanse(macCtx->key, macCtx->keyLen);
9497
OPENSSL_clear_free(macCtx, sizeof(*macCtx));
9598
}

src/wp_rsa_asym.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,9 @@ static int wp_rsaa_decrypt(wp_RsaAsymCtx* ctx, unsigned char* out,
463463
if (ctx->clientVersion <= 0) {
464464
ok = 0;
465465
}
466+
if (ok && (outSize < WOLFSSL_MAX_MASTER_KEY_LENGTH)) {
467+
ok = 0;
468+
}
466469
if (ok) {
467470
byte mask;
468471
byte negMask;

0 commit comments

Comments
 (0)