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
5 changes: 3 additions & 2 deletions src/wp_des.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ static int wp_des3_block_init(wp_Des3BlockCtx *ctx, const unsigned char *key,
ok = 0;
}
if (ok) {
int rc = wc_Des3_SetKey(&ctx->des3, key, iv,
int rc = wc_Des3_SetKey(&ctx->des3, key,
(ctx->ivSet && (ctx->mode == EVP_CIPH_CBC_MODE)) ?
ctx->iv : NULL,
enc ? DES_ENCRYPTION : DES_DECRYPTION);
if (rc != 0) {
WOLFPROV_MSG_DEBUG_RETCODE(WP_LOG_LEVEL_DEBUG, "wc_Des3_SetKey", rc);
Expand Down Expand Up @@ -941,4 +943,3 @@ IMPLEMENT_DES3_BLOCK_NULL(cbc)

#endif
#endif /* WP_HAVE_DES3CBC */

13 changes: 6 additions & 7 deletions src/wp_digests.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static CTX* name##_newctx(WOLFPROV_CTX* provCtx) \
static void name##_freectx(CTX* ctx) \
{ \
free(ctx); \
OPENSSL_free(ctx); \
OPENSSL_clear_free(ctx, sizeof(*ctx)); \
}

/** Implement duplicating a digest object. */
Expand All @@ -96,13 +96,13 @@ static CTX* name##_dupctx(CTX* src) \
{ \
CTX* dst = NULL; \
if (wolfssl_prov_is_running()) { \
dst = OPENSSL_malloc(sizeof(*src)); \
dst = OPENSSL_zalloc(sizeof(*dst)); \
} \
if (dst != NULL) { \
int rc; \
rc = copy(src, dst); \
if (rc != 0) { \
OPENSSL_free(dst); \
OPENSSL_clear_free(dst, sizeof(*dst)); \
dst = NULL; \
} \
} \
Expand Down Expand Up @@ -670,7 +670,7 @@ static int name##_final(CTX* ctx, unsigned char* out, size_t* outLen, \
static void name##_freectx(CTX* ctx) \
{ \
free(&ctx->obj); \
OPENSSL_free(ctx); \
OPENSSL_clear_free(ctx, sizeof(*ctx)); \
}

/** Implement duplicating an XOF object. */
Expand All @@ -686,14 +686,14 @@ static CTX* name##_dupctx(CTX* src) \
{ \
CTX* dst = NULL; \
if (wolfssl_prov_is_running()) { \
dst = OPENSSL_malloc(sizeof(*src)); \
dst = OPENSSL_zalloc(sizeof(*dst)); \
} \
if (dst != NULL) { \
int rc; \
rc = copy(&src->obj, &dst->obj); \
if (rc != 0) { \
WOLFPROV_MSG_DEBUG_RETCODE(WP_LOG_LEVEL_DEBUG, #copy, rc); \
OPENSSL_free(dst); \
OPENSSL_clear_free(dst, sizeof(*dst)); \
dst = NULL; \
} \
else { \
Expand Down Expand Up @@ -807,4 +807,3 @@ IMPLEMENT_XOF(shake, wp_shake_256, wc_Shake, wp_ShakeCtx,
wc_Shake256_Copy, wc_Shake256_Free)

#endif

Loading
Loading