Skip to content
Merged
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
3 changes: 0 additions & 3 deletions src/wp_aes_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,9 +507,6 @@ static int wp_aes_block_update(wp_AesBlockCtx *ctx, unsigned char *out,
(ctx->tls_version == 0)) {
nextBlocks -= AES_BLOCK_SIZE;
}
if (outSize < oLen) {
ok = 0;
}
}
if (ok && (nextBlocks > 0)) {
if (!wp_aes_block_doit(ctx, out, in, nextBlocks)) {
Expand Down
3 changes: 0 additions & 3 deletions src/wp_des.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,6 @@ static int wp_des3_block_update(wp_Des3BlockCtx *ctx, unsigned char *out,
(ctx->tls_version == 0)) {
nextBlocks -= DES_BLOCK_SIZE;
}
if (outSize < oLen) {
ok = 0;
}
}
if (ok && (nextBlocks > 0)) {
if (!wp_des3_block_doit(ctx, out, in, nextBlocks)) {
Expand Down
3 changes: 2 additions & 1 deletion src/wp_dh_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ static wp_DhCtx* wp_dh_dupctx(wp_DhCtx* src)
wp_dh_free(dst->peer);
wp_dh_free(dst->key);
OPENSSL_free(dst);
dst = NULL;
}
}

Expand Down Expand Up @@ -369,7 +370,7 @@ static int wp_dh_derive(wp_DhCtx* ctx, unsigned char* secret,
}
}

if ((!done) && ok) {
if ((!done) && ok && (out != NULL)) {
/* DH key exchange derivation using wolfSSL. */
ok = wp_dh_derive_secret(ctx, out, &outLen, maxLen);
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp_dh_kmgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ static int wp_dh_get_params(wp_Dh* dh, OSSL_PARAM params[])
if (p != NULL) {
/* When buffer is NULL, return the size irrespective of type */
if (p->data == NULL) {
ok = wp_params_set_mp(params, OSSL_PKEY_PARAM_FFC_P, &dh->key.g, 1);
ok = wp_params_set_mp(params, OSSL_PKEY_PARAM_FFC_P, &dh->key.p, 1);
}
/* When buffer is non-NULL, type must be int or uint */
else
Expand Down
1 change: 1 addition & 0 deletions src/wp_ecdh_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ static wp_EcdhCtx* wp_ecdh_dup(wp_EcdhCtx* src)
wp_ecc_free(src->peer);
wp_ecc_free(src->key);
OPENSSL_free(dst);
dst = NULL;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/wp_ecx_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ static wp_EcxCtx* wp_ecx_dupctx(wp_EcxCtx* src)
if (!ok) {
wp_ecx_free(src->key);
OPENSSL_free(dst);
dst = NULL;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/wp_kdf_exch.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static wp_KdfCtx* wp_kdf_ctx_dup(wp_KdfCtx* src)

if (!ok) {
OPENSSL_free(dst);
dst = NULL;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/wp_mac_kmgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int wp_mac_has(const wp_Mac* mac, int selection)
if (mac == NULL) {
ok = 0;
}
if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
if (ok && ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)) {
ok &= mac->key != NULL;
}

Expand Down Expand Up @@ -387,7 +387,7 @@ static int wp_mac_import(wp_Mac *mac, int selection, const OSSL_PARAM params[])
ok = 0;
}
p = OSSL_PARAM_locate_const(params, OSSL_PKEY_PARAM_PROPERTIES);
if (p != NULL) {
if (ok && (p != NULL)) {
OPENSSL_free(mac->properties);
mac->properties = NULL;
if (!OSSL_PARAM_get_utf8_string(p, &mac->properties, 0)) {
Expand Down Expand Up @@ -495,7 +495,7 @@ static int wp_mac_export(wp_Mac *mac, int selection, OSSL_CALLBACK *paramCb,
ok = 0;
}
}
if (ok && !wp_mac_export_priv_key(mac, params, &paramsSz, data, &idx)) {
if (ok && (data != NULL) && !wp_mac_export_priv_key(mac, params, &paramsSz, data, &idx)) {
ok = 0;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/wp_mac_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static wp_MacSigCtx* wp_mac_ctx_new(WOLFPROV_CTX* provCtx,
if (propQuery != NULL) {
p = OPENSSL_strdup(propQuery);
if (p == NULL) {
OPENSSL_free(ctx);
ctx = NULL;
ok = 0;
}
Expand Down Expand Up @@ -342,7 +343,7 @@ static const OSSL_PARAM *wp_mac_settable_ctx_params(wp_MacSigCtx *ctx,
OSSL_PARAM_int(OSSL_MAC_PARAM_DIGEST_ONESHOT, NULL),
OSSL_PARAM_size_t(OSSL_MAC_PARAM_TLS_DATA_SIZE, NULL),
OSSL_PARAM_END
};
};
return settable_ctx_params;
}

Expand Down
Loading