forked from wolfSSL/wolfssl
Fixes for building with --disable-ecc
and --disable-dh
.
This commit is contained in:
@ -48359,12 +48359,15 @@ int wolfSSL_PEM_write_bio_PKCS8PrivateKey(WOLFSSL_BIO* bio,
|
|||||||
}
|
}
|
||||||
if (ret == 0 && enc == NULL) {
|
if (ret == 0 && enc == NULL) {
|
||||||
type = PKCS8_PRIVATEKEY_TYPE;
|
type = PKCS8_PRIVATEKEY_TYPE;
|
||||||
|
#ifdef HAVE_ECC
|
||||||
if (pkey->type == EVP_PKEY_EC) {
|
if (pkey->type == EVP_PKEY_EC) {
|
||||||
algId = ECDSAk;
|
algId = ECDSAk;
|
||||||
ret = wc_ecc_get_oid(pkey->ecc->group->curve_oid, &curveOid,
|
ret = wc_ecc_get_oid(pkey->ecc->group->curve_oid, &curveOid,
|
||||||
&oidSz);
|
&oidSz);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
algId = RSAk;
|
algId = RSAk;
|
||||||
curveOid = NULL;
|
curveOid = NULL;
|
||||||
oidSz = 0;
|
oidSz = 0;
|
||||||
|
12
tests/api.c
12
tests/api.c
@ -22146,7 +22146,9 @@ static int test_wc_SetSubjectKeyIdFromPublicKey_ex (void)
|
|||||||
RsaKey rsaKey;
|
RsaKey rsaKey;
|
||||||
int bits = 2048;
|
int bits = 2048;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_ECC)
|
||||||
ecc_key eccKey;
|
ecc_key eccKey;
|
||||||
|
#endif
|
||||||
#if defined(HAVE_ED448)
|
#if defined(HAVE_ED448)
|
||||||
ed448_key ed448Key;
|
ed448_key ed448Key;
|
||||||
#endif
|
#endif
|
||||||
@ -22185,6 +22187,7 @@ static int test_wc_SetSubjectKeyIdFromPublicKey_ex (void)
|
|||||||
wc_FreeRsaKey(&rsaKey);
|
wc_FreeRsaKey(&rsaKey);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_ECC)
|
||||||
if (ret == 0) { /*ECC*/
|
if (ret == 0) { /*ECC*/
|
||||||
ret = wc_ecc_init(&eccKey);
|
ret = wc_ecc_init(&eccKey);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
@ -22195,6 +22198,7 @@ static int test_wc_SetSubjectKeyIdFromPublicKey_ex (void)
|
|||||||
}
|
}
|
||||||
wc_ecc_free(&eccKey);
|
wc_ecc_free(&eccKey);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if defined(HAVE_ED448) && (defined(WOLFSSL_CERT_GEN) || \
|
#if defined(HAVE_ED448) && (defined(WOLFSSL_CERT_GEN) || \
|
||||||
defined(WOLFSSL_KEY_GEN))
|
defined(WOLFSSL_KEY_GEN))
|
||||||
|
|
||||||
@ -22233,7 +22237,9 @@ static int test_wc_SetAuthKeyIdFromPublicKey_ex (void)
|
|||||||
RsaKey rsaKey;
|
RsaKey rsaKey;
|
||||||
int bits = 2048;
|
int bits = 2048;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_ECC)
|
||||||
ecc_key eccKey;
|
ecc_key eccKey;
|
||||||
|
#endif
|
||||||
#if defined(HAVE_ED448)
|
#if defined(HAVE_ED448)
|
||||||
ed448_key ed448Key;
|
ed448_key ed448Key;
|
||||||
#endif
|
#endif
|
||||||
@ -22272,6 +22278,7 @@ static int test_wc_SetAuthKeyIdFromPublicKey_ex (void)
|
|||||||
wc_FreeRsaKey(&rsaKey);
|
wc_FreeRsaKey(&rsaKey);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(HAVE_ECC)
|
||||||
if (ret == 0) { /*ECC*/
|
if (ret == 0) { /*ECC*/
|
||||||
ret = wc_ecc_init(&eccKey);
|
ret = wc_ecc_init(&eccKey);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
@ -22282,6 +22289,7 @@ static int test_wc_SetAuthKeyIdFromPublicKey_ex (void)
|
|||||||
}
|
}
|
||||||
wc_ecc_free(&eccKey);
|
wc_ecc_free(&eccKey);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#if defined(HAVE_ED448) && (defined(WOLFSSL_CERT_GEN) || \
|
#if defined(HAVE_ED448) && (defined(WOLFSSL_CERT_GEN) || \
|
||||||
defined(WOLFSSL_KEY_GEN))
|
defined(WOLFSSL_KEY_GEN))
|
||||||
|
|
||||||
@ -29249,7 +29257,9 @@ static void test_wolfSSL_PKCS8_d2i(void)
|
|||||||
XFILE file;
|
XFILE file;
|
||||||
#ifndef NO_BIO
|
#ifndef NO_BIO
|
||||||
BIO* bio;
|
BIO* bio;
|
||||||
|
#if defined(HAVE_ECC)
|
||||||
WOLFSSL_EVP_PKEY* evpPkey = NULL;
|
WOLFSSL_EVP_PKEY* evpPkey = NULL;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef NO_RSA
|
#ifndef NO_RSA
|
||||||
@ -34759,6 +34769,7 @@ static void test_wolfSSL_EVP_PKEY_derive(void)
|
|||||||
EVP_PKEY *pkey, *peerkey;
|
EVP_PKEY *pkey, *peerkey;
|
||||||
const unsigned char* key;
|
const unsigned char* key;
|
||||||
|
|
||||||
|
#ifndef NO_DH
|
||||||
/* DH */
|
/* DH */
|
||||||
key = dh_key_der_2048;
|
key = dh_key_der_2048;
|
||||||
AssertNotNull((pkey = d2i_PrivateKey(EVP_PKEY_DH, NULL, &key,
|
AssertNotNull((pkey = d2i_PrivateKey(EVP_PKEY_DH, NULL, &key,
|
||||||
@ -34779,6 +34790,7 @@ static void test_wolfSSL_EVP_PKEY_derive(void)
|
|||||||
EVP_PKEY_free(peerkey);
|
EVP_PKEY_free(peerkey);
|
||||||
EVP_PKEY_free(pkey);
|
EVP_PKEY_free(pkey);
|
||||||
XFREE(skey, NULL, DYNAMIC_TYPE_OPENSSL);
|
XFREE(skey, NULL, DYNAMIC_TYPE_OPENSSL);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
/* ECDH */
|
/* ECDH */
|
||||||
|
@ -1432,7 +1432,7 @@ int wolfSSL_EVP_PKEY_derive_set_peer(WOLFSSL_EVP_PKEY_CTX *ctx, WOLFSSL_EVP_PKEY
|
|||||||
return WOLFSSL_SUCCESS;
|
return WOLFSSL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NO_DH) && defined(HAVE_ECC)
|
#if !defined(NO_DH) || defined(HAVE_ECC)
|
||||||
#if !defined(HAVE_FIPS) || (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION!=2))
|
#if !defined(HAVE_FIPS) || (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION!=2))
|
||||||
int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
|
int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)
|
||||||
{
|
{
|
||||||
@ -1542,7 +1542,7 @@ int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_
|
|||||||
return WOLFSSL_SUCCESS;
|
return WOLFSSL_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif /* !HAVE_FIPS || HAVE_FIPS_VERSION > 2 */
|
#endif /* !HAVE_FIPS || HAVE_FIPS_VERSION > 2 */
|
||||||
#endif
|
#endif /* !NO_DH || HAVE_ECC */
|
||||||
|
|
||||||
/* Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer.
|
/* Uses the WOLFSSL_EVP_PKEY_CTX to decrypt a buffer.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user