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
10 changes: 5 additions & 5 deletions include/wolfprovider/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@
#ifdef HAVE_ECC
#define WP_HAVE_ECC
#ifndef NO_ECC_SECP
#if defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES)
#if (defined(HAVE_ECC192) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 192
#define WP_HAVE_EC_P192
#endif
#if defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES)
#if (defined(HAVE_ECC224) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 224
#define WP_HAVE_EC_P224
#endif
#if defined(HAVE_ECC256) || defined(HAVE_ALL_CURVES)
#if (!defined(NO_ECC256) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 256
#define WP_HAVE_EC_P256
#endif
#if defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES)
#if (defined(HAVE_ECC384) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 384
#define WP_HAVE_EC_P384
#endif
#if defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)
#if (defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)) && ECC_MIN_KEY_SZ <= 521
#define WP_HAVE_EC_P521
#endif
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/wp_aes_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,11 @@ static int wp_aes_stream_init(wp_AesStreamCtx *ctx, const unsigned char *key,
/* TODO: don't reach in under the covers.
* Setting the key will reset this.
*/
#if defined(WOLFSSL_AES_COUNTER) || defined(WOLFSSL_AES_CFB) || \
defined(WOLFSSL_AES_OFB) || defined(WOLFSSL_AES_XTS) || \
defined(WOLFSSL_AES_CTS)
ctx->aes.left = 0;
#endif
}

if (ok) {
Expand Down
4 changes: 4 additions & 0 deletions test/test_dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,12 @@ static int test_dh_krb5_keygen_ex(OSSL_LIB_CTX *libCtx)
OSSL_DECODER_CTX *dctx = NULL;
const unsigned char *inptr = dh_2048;
size_t inlen = sizeof(dh_2048);
#ifdef WOLFSSL_DH_EXTRA
unsigned char *spki = NULL;
size_t spki_len = 0;
unsigned char *der = NULL;
size_t der_len;
#endif /* WOLFSSL_DH_EXTRA */

PRINT_MSG("Testing DH key generation with krb5 parameters");

Expand All @@ -584,6 +586,7 @@ static int test_dh_krb5_keygen_ex(OSSL_LIB_CTX *libCtx)
err = EVP_PKEY_keygen(ctx, &key) != 1;
}

#ifdef WOLFSSL_DH_EXTRA
if (err == 0) {
/* Get the size of the encoded public key */
err = i2d_PUBKEY(key, NULL) <= 0;
Expand Down Expand Up @@ -618,6 +621,7 @@ static int test_dh_krb5_keygen_ex(OSSL_LIB_CTX *libCtx)
if (spki) {
OPENSSL_free(spki);
}
#endif /* WOLFSSL_DH_EXTRA */
EVP_PKEY_free(key);
EVP_PKEY_free(params);
EVP_PKEY_CTX_free(ctx);
Expand Down
6 changes: 4 additions & 2 deletions test/test_rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "unit.h"
#include <wolfprovider/wp_fips.h>
#include <wolfssl/wolfcrypt/asn.h>

#include <openssl/store.h>
#include <openssl/core_names.h>
Expand Down Expand Up @@ -1063,7 +1064,8 @@ int test_rsa_pkey_keygen(void *data)
BIGNUM *eCmd = NULL;
BIGNUM *n = NULL;
BIGNUM *eKey = NULL;
#if defined(HAVE_FIPS) || defined(HAVE_FIPS_VERSION)
#if defined(HAVE_FIPS) || defined(HAVE_FIPS_VERSION) || \
(defined(RSA_MIN_SIZE) && RSA_MIN_SIZE >= 2048)
/* Generating a 3072-bit key is slow, so only do it if we have to because
* we're using wolfCrypt FIPS. Can't do 2048 because that's the default. */
const int newKeySize = 3072;
Expand Down Expand Up @@ -1096,7 +1098,7 @@ int test_rsa_pkey_keygen(void *data)
err = BN_set_word(eCmd, 3) != 1;
}
if (err == 0) {
PRINT_MSG("Change the public exponent w/ ctrl command");
PRINT_MSG("Change the public exponent w/ ctrl command");
err = EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN,
EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, eCmd) <= 0;
}
Expand Down
Loading