Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wp_aes_aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ static int wp_aead_set_param_iv_len(wp_AeadCtx* ctx,
if (!OSSL_PARAM_get_size_t(p, &sz)) {
ok = 0;
}
if (ok & ((sz == 0) || (sz > sizeof(ctx->aes.reg)))) {
if (ok && ((sz == 0) || (sz > sizeof(ctx->aes.reg)))) {
ok = 0;
}
if (ok) {
Expand Down
1 change: 1 addition & 0 deletions src/wp_aes_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ static int wp_aes_wrap_update(wp_AesWrapCtx *ctx, unsigned char *out,
WOLFPROV_MSG_DEBUG_RETCODE(WP_LOG_LEVEL_DEBUG, "wc_AesKeyUnWrap", rc);
ok = 0;
}
}
#endif

if (ok) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp_dh_kmgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int wp_dh_get_priv(wp_Dh* dh, unsigned char** priv, word32* privSz)

WOLFPROV_ENTER(WP_LOG_COMP_DH, "wp_dh_get_priv");

if (privSz == 0) {
if (dh == NULL || priv == NULL || privSz == NULL) {
ok = 0;
}
else {
Expand Down Expand Up @@ -366,7 +366,7 @@ int wp_dh_get_pub(wp_Dh* dh, unsigned char** pub, word32* pubSz)

WOLFPROV_ENTER(WP_LOG_COMP_DH, "wp_dh_get_pub");

if (pubSz == 0) {
if (dh == NULL || pub == NULL || pubSz == NULL) {
ok = 0;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion src/wp_ecc_kmgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ static int wp_ecc_import(wp_Ecc* ecc, int selection, const OSSL_PARAM params[])
if (ok && ((selection & WP_ECC_POSSIBLE_SELECTIONS) == 0)) {
ok = 0;
}
if (ok & ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)) {
if (ok && ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) == 0)) {
ok = 0;
}
if (ok && (!wp_ecc_import_group(ecc, params))) {
Expand Down
10 changes: 6 additions & 4 deletions src/wp_kdf_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ static wp_KdfCtx* wp_kdf_ctx_new(WOLFPROV_CTX* provCtx, const char* name)
*/
static void wp_kdf_ctx_free(wp_KdfCtx* ctx)
{
wp_kdf_free(ctx->key);
EVP_KDF_CTX_free(ctx->kdfCtx);
OPENSSL_free(ctx);
if (ctx != NULL) {
wp_kdf_free(ctx->key);
EVP_KDF_CTX_free(ctx->kdfCtx);
OPENSSL_free(ctx);
}
}

/**
Expand Down Expand Up @@ -133,7 +135,7 @@ static wp_KdfCtx* wp_kdf_ctx_dup(wp_KdfCtx* src)
}

if (!ok) {
OPENSSL_free(dst);
wp_kdf_ctx_free(dst);
dst = NULL;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void WOLFPROV_BUFFER(int component, const unsigned char* buffer,
}
}

wolfprovider_msg(WP_LOG_LEVEL_VERBOSE, component, line);
wolfprovider_msg(component, WP_LOG_LEVEL_VERBOSE, line);
buffer += WOLFPROV_LINE_LEN;
buflen -= WOLFPROV_LINE_LEN;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp_mac_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int wp_mac_digest_sign_final(wp_MacSigCtx *ctx, unsigned char *sig,
if (!wolfssl_prov_is_running()) {
ok = 0;
}
if (ok & (sigSize == MAX_SIZE_T) && (ctx->type == WP_MAC_TYPE_CMAC)) {
if (ok && (sigSize == MAX_SIZE_T) && (ctx->type == WP_MAC_TYPE_CMAC)) {
sigSize = AES_BLOCK_SIZE;
}
if (ok && (!EVP_MAC_final(ctx->macCtx, sig, sigLen, sigSize))) {
Expand Down
Loading