Skip to content

Commit 6690321

Browse files
committed
Don't attempt to compile DES3-CBC code if wolfSSL defines NO_DES3.
Additionally, fix some warning about using an uninitialized variable in we_dh.c.
1 parent f4b5a8a commit 6690321

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

include/wolfengine/we_internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
#include <wolfssl/wolfcrypt/kdf.h>
8686
#endif
8787

88+
/* The DES3-CBC code won't compile unless wolfCrypt has support for it. */
89+
#if defined(NO_DES3) && defined(WE_HAVE_DES3CBC)
90+
#undef WE_HAVE_DES3CBC
91+
#endif
92+
8893
#include <wolfengine/we_openssl_bc.h>
8994
#include <wolfengine/we_logging.h>
9095
#include <wolfengine/we_fips.h>

src/we_dh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,9 +1115,9 @@ static int we_dh_pkey_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,
11151115
/* Set named DH parameters. */
11161116
if (XSTRNCMP(type, "dh_param", 9) == 0) {
11171117
#ifndef HAVE_WC_DHSETNAMEDKEY
1118-
const DhParams *params;
1118+
const DhParams *params = NULL;
11191119
#else
1120-
int params;
1120+
int params = 0;
11211121
#endif
11221122

11231123
#ifdef HAVE_PUBLIC_FFDHE

test/unit.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
#include <wolfssl/wolfcrypt/wc_port.h>
3636
#include <wolfssl/wolfcrypt/rsa.h>
3737

38+
/* The DES3-CBC code won't compile unless wolfCrypt has support for it. */
39+
#if defined(NO_DES3) && defined(WE_HAVE_DES3CBC)
40+
#undef WE_HAVE_DES3CBC
41+
#endif
42+
3843
#include <openssl/engine.h>
3944
#include <openssl/evp.h>
4045
#include <openssl/ec.h>

0 commit comments

Comments
 (0)