diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index c645e2666..ae3c5d86c 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -384,6 +384,7 @@ static int SetASNNull(byte* output) return 2; } +#ifndef NO_CERTS /* Get the DER/BER encoding of an ASN.1 BOOLEAN. * * input Buffer holding DER/BER encoded data. @@ -413,7 +414,7 @@ static int GetBoolean(const byte* input, word32* inOutIdx, word32 maxIdx) *inOutIdx = idx; return b; } - +#endif /* !NO_CERTS*/ #ifdef ASN1_SET_BOOLEAN /* Set the DER/BER encoding of the ASN.1 NULL element. * Note: Function not required as yet. @@ -497,6 +498,7 @@ static int GetASNInt(const byte* input, word32* inOutIdx, int* len, return 0; } +#ifndef NO_CERTS /* Get the DER/BER encoding of an ASN.1 INTEGER that has a value of no more than * 7 bits. * @@ -526,7 +528,7 @@ static int GetInteger7Bit(const byte* input, word32* inOutIdx, word32 maxIdx) *inOutIdx = idx; return b; } - +#endif /* !NO_CERTS */ #if !defined(NO_DSA) && !defined(NO_SHA) static const char sigSha1wDsaName[] = "SHAwDSA"; @@ -6792,6 +6794,7 @@ int DecodeToKey(DecodedCert* cert, int verify) return ret; } +#ifndef NO_CERTS static int GetSignature(DecodedCert* cert) { int length; @@ -6811,6 +6814,7 @@ static int GetSignature(DecodedCert* cert) return 0; } +#endif static word32 SetOctetString8Bit(word32 len, byte* output) { diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c index 0e7ba1132..2aefcab2e 100644 --- a/wolfcrypt/src/sp_int.c +++ b/wolfcrypt/src/sp_int.c @@ -2996,8 +2996,8 @@ int sp_cmp_d(sp_int* a, sp_int_digit d) #endif #if defined(WOLFSSL_SP_INT_NEGATIVE) || !defined(NO_PWDBASED) || \ - defined(WOLFSSL_KEY_GEN) || !defined(NO_DH) || (!defined(NO_RSA) && \ - !defined(WOLFSSL_RSA_VERIFY_ONLY)) + defined(WOLFSSL_KEY_GEN) || !defined(NO_DH) || defined(HAVE_ECC) || \ + (!defined(NO_RSA) && !defined(WOLFSSL_RSA_VERIFY_ONLY)) /* Add a one digit number to the multi-precision number. * * @param [in] a SP integer be added to. diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 20339a7f7..4be5bff6a 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -11821,9 +11821,11 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) static const char* certEccRsaPemFile = CERT_WRITE_TEMP_DIR "certeccrsa.pem"; static const char* certEccRsaDerFile = CERT_WRITE_TEMP_DIR "certeccrsa.der"; #endif + #if defined(HAVE_ECC_KEY_EXPORT) static const char* eccCaKeyPemFile = CERT_WRITE_TEMP_DIR "ecc-key.pem"; static const char* eccPubKeyDerFile = CERT_WRITE_TEMP_DIR "ecc-public-key.der"; static const char* eccCaKeyTempFile = CERT_WRITE_TEMP_DIR "ecc-key.der"; + #endif #ifdef HAVE_PKCS8 static const char* eccPkcs8KeyDerFile = CERT_WRITE_TEMP_DIR "ecc-key-pkcs8.der"; #endif @@ -20648,7 +20650,10 @@ static int ecc_test_make_pub(WC_RNG* rng) byte tmp[ECC_BUFSIZE]; #endif const byte* msg = (const byte*)"test wolfSSL ECC public gen"; - word32 x, tmpSz; +#if defined(HAVE_ECC_KEY_EXPORT) + word32 x; +#endif + word32 tmpSz; int ret = 0; ecc_point* pubPoint = NULL; #ifdef HAVE_ECC_VERIFY