mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
Various build fixes:
* Fix api.c build error with `NO_FILESYSTEM` and `WOLFSSL_CERT_EXT`. * Fix for building tests/suites.c with static memory (missing `LARGEST_MEM_BUCKET`). * Always expose `wc_ecc_set_rng` for compatibility.
This commit is contained in:
@@ -31414,8 +31414,8 @@ static int test_wc_CertPemToDer(void)
|
|||||||
|
|
||||||
static int test_wc_PubKeyPemToDer(void)
|
static int test_wc_PubKeyPemToDer(void)
|
||||||
{
|
{
|
||||||
#ifdef WOLFSSL_PEM_TO_DER
|
#if defined(WOLFSSL_PEM_TO_DER) && !defined(NO_FILESYSTEM) && \
|
||||||
#if defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER)
|
(defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER))
|
||||||
int ret;
|
int ret;
|
||||||
const char* key = "./certs/ecc-client-keyPub.pem";
|
const char* key = "./certs/ecc-client-keyPub.pem";
|
||||||
byte* cert_buf = NULL;
|
byte* cert_buf = NULL;
|
||||||
@@ -31446,7 +31446,6 @@ static int test_wc_PubKeyPemToDer(void)
|
|||||||
free(cert_buf);
|
free(cert_buf);
|
||||||
|
|
||||||
printf(resultFmt, passed);
|
printf(resultFmt, passed);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -31454,7 +31453,8 @@ static int test_wc_PubKeyPemToDer(void)
|
|||||||
|
|
||||||
static int test_wc_PemPubKeyToDer(void)
|
static int test_wc_PemPubKeyToDer(void)
|
||||||
{
|
{
|
||||||
#if defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER)
|
#if !defined(NO_FILESYSTEM) && \
|
||||||
|
(defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER))
|
||||||
int ret;
|
int ret;
|
||||||
const char* key = "./certs/ecc-client-keyPub.pem";
|
const char* key = "./certs/ecc-client-keyPub.pem";
|
||||||
size_t cert_dersz = 1024;
|
size_t cert_dersz = 1024;
|
||||||
|
@@ -43,6 +43,7 @@
|
|||||||
#include <wolfssl/wolfcrypt/ecc.h>
|
#include <wolfssl/wolfcrypt/ecc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/memory.h> /* for LARGEST_MEM_BUCKET */
|
||||||
|
|
||||||
#define MAX_ARGS 40
|
#define MAX_ARGS 40
|
||||||
#define MAX_COMMAND_SZ 240
|
#define MAX_COMMAND_SZ 240
|
||||||
|
@@ -12785,21 +12785,25 @@ void wc_ecc_fp_free(void)
|
|||||||
|
|
||||||
#endif /* FP_ECC */
|
#endif /* FP_ECC */
|
||||||
|
|
||||||
#ifdef ECC_TIMING_RESISTANT
|
|
||||||
int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng)
|
int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
#ifdef ECC_TIMING_RESISTANT
|
||||||
if (key == NULL) {
|
if (key == NULL) {
|
||||||
err = BAD_FUNC_ARG;
|
err = BAD_FUNC_ARG;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
key->rng = rng;
|
key->rng = rng;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)key;
|
||||||
|
(void)rng;
|
||||||
|
/* report success, not an error if ECC_TIMING_RESISTANT is not defined */
|
||||||
|
#endif
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_ECC_ENCRYPT
|
#ifdef HAVE_ECC_ENCRYPT
|
||||||
|
|
||||||
|
@@ -2719,7 +2719,7 @@ static THREAD_LS_T int myVerifyAction = VERIFY_OVERRIDE_ERROR;
|
|||||||
* --enable-opensslextra is defined because it sets WOLFSSL_ALWAYS_VERIFY_CB and
|
* --enable-opensslextra is defined because it sets WOLFSSL_ALWAYS_VERIFY_CB and
|
||||||
* WOLFSSL_VERIFY_CB_ALL_CERTS.
|
* WOLFSSL_VERIFY_CB_ALL_CERTS.
|
||||||
* Normal cases of the verify callback only occur on certificate failures when the
|
* Normal cases of the verify callback only occur on certificate failures when the
|
||||||
* wolfSSL_set_verify(ssl, SSL_VERIFY_PEER, myVerifyCb); is called
|
* wolfSSL_set_verify(ssl, SSL_VERIFY_PEER, myVerify); is called
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static WC_INLINE int myVerify(int preverify, WOLFSSL_X509_STORE_CTX* store)
|
static WC_INLINE int myVerify(int preverify, WOLFSSL_X509_STORE_CTX* store)
|
||||||
@@ -2734,7 +2734,6 @@ static WC_INLINE int myVerify(int preverify, WOLFSSL_X509_STORE_CTX* store)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
(void)preverify;
|
|
||||||
|
|
||||||
/* Verify Callback Arguments:
|
/* Verify Callback Arguments:
|
||||||
* preverify: 1=Verify Okay, 0=Failure
|
* preverify: 1=Verify Okay, 0=Failure
|
||||||
|
@@ -666,10 +666,8 @@ WOLFSSL_ABI WOLFSSL_API
|
|||||||
void wc_ecc_fp_free(void);
|
void wc_ecc_fp_free(void);
|
||||||
WOLFSSL_LOCAL
|
WOLFSSL_LOCAL
|
||||||
void wc_ecc_fp_init(void);
|
void wc_ecc_fp_init(void);
|
||||||
#ifdef ECC_TIMING_RESISTANT
|
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng);
|
int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng);
|
||||||
#endif
|
|
||||||
|
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id);
|
int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id);
|
||||||
|
Reference in New Issue
Block a user