summaryrefslogtreecommitdiffstats
path: root/providers/implementations
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations')
-rw-r--r--providers/implementations/encode_decode/decode_der2key.c82
-rw-r--r--providers/implementations/encode_decode/encode_key2any.c4
-rw-r--r--providers/implementations/encode_decode/encode_key2text.c4
-rw-r--r--providers/implementations/exchange/build.info6
-rw-r--r--providers/implementations/include/prov/implementations.h2
-rw-r--r--providers/implementations/kem/build.info5
-rw-r--r--providers/implementations/keymgmt/build.info6
-rw-r--r--providers/implementations/signature/build.info5
8 files changed, 67 insertions, 47 deletions
diff --git a/providers/implementations/encode_decode/decode_der2key.c b/providers/implementations/encode_decode/decode_der2key.c
index d8231fdbc3..2657760a62 100644
--- a/providers/implementations/encode_decode/decode_der2key.c
+++ b/providers/implementations/encode_decode/decode_der2key.c
@@ -417,6 +417,7 @@ static void ec_adjust(void *key, struct der2key_ctx_st *ctx)
ossl_ec_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
}
+# ifndef OPENSSL_NO_ECX
/*
* ED25519, ED448, X25519, X448 only implement PKCS#8 and SubjectPublicKeyInfo,
* so no d2i functions to be had.
@@ -434,45 +435,46 @@ static void ecx_key_adjust(void *key, struct der2key_ctx_st *ctx)
ossl_ecx_key_set0_libctx(key, PROV_LIBCTX_OF(ctx->provctx));
}
-# define ed25519_evp_type EVP_PKEY_ED25519
-# define ed25519_d2i_private_key NULL
-# define ed25519_d2i_public_key NULL
-# define ed25519_d2i_key_params NULL
-# define ed25519_d2i_PKCS8 ecx_d2i_PKCS8
-# define ed25519_d2i_PUBKEY (d2i_of_void *)ossl_d2i_ED25519_PUBKEY
-# define ed25519_free (free_key_fn *)ossl_ecx_key_free
-# define ed25519_check NULL
-# define ed25519_adjust ecx_key_adjust
-
-# define ed448_evp_type EVP_PKEY_ED448
-# define ed448_d2i_private_key NULL
-# define ed448_d2i_public_key NULL
-# define ed448_d2i_key_params NULL
-# define ed448_d2i_PKCS8 ecx_d2i_PKCS8
-# define ed448_d2i_PUBKEY (d2i_of_void *)ossl_d2i_ED448_PUBKEY
-# define ed448_free (free_key_fn *)ossl_ecx_key_free
-# define ed448_check NULL
-# define ed448_adjust ecx_key_adjust
-
-# define x25519_evp_type EVP_PKEY_X25519
-# define x25519_d2i_private_key NULL
-# define x25519_d2i_public_key NULL
-# define x25519_d2i_key_params NULL
-# define x25519_d2i_PKCS8 ecx_d2i_PKCS8
-# define x25519_d2i_PUBKEY (d2i_of_void *)ossl_d2i_X25519_PUBKEY
-# define x25519_free (free_key_fn *)ossl_ecx_key_free
-# define x25519_check NULL
-# define x25519_adjust ecx_key_adjust
-
-# define x448_evp_type EVP_PKEY_X448
-# define x448_d2i_private_key NULL
-# define x448_d2i_public_key NULL
-# define x448_d2i_key_params NULL
-# define x448_d2i_PKCS8 ecx_d2i_PKCS8
-# define x448_d2i_PUBKEY (d2i_of_void *)ossl_d2i_X448_PUBKEY
-# define x448_free (free_key_fn *)ossl_ecx_key_free
-# define x448_check NULL
-# define x448_adjust ecx_key_adjust
+# define ed25519_evp_type EVP_PKEY_ED25519
+# define ed25519_d2i_private_key NULL
+# define ed25519_d2i_public_key NULL
+# define ed25519_d2i_key_params NULL
+# define ed25519_d2i_PKCS8 ecx_d2i_PKCS8
+# define ed25519_d2i_PUBKEY (d2i_of_void *)ossl_d2i_ED25519_PUBKEY
+# define ed25519_free (free_key_fn *)ossl_ecx_key_free
+# define ed25519_check NULL
+# define ed25519_adjust ecx_key_adjust
+
+# define ed448_evp_type EVP_PKEY_ED448
+# define ed448_d2i_private_key NULL
+# define ed448_d2i_public_key NULL
+# define ed448_d2i_key_params NULL
+# define ed448_d2i_PKCS8 ecx_d2i_PKCS8
+# define ed448_d2i_PUBKEY (d2i_of_void *)ossl_d2i_ED448_PUBKEY
+# define ed448_free (free_key_fn *)ossl_ecx_key_free
+# define ed448_check NULL
+# define ed448_adjust ecx_key_adjust
+
+# define x25519_evp_type EVP_PKEY_X25519
+# define x25519_d2i_private_key NULL
+# define x25519_d2i_public_key NULL
+# define x25519_d2i_key_params NULL
+# define x25519_d2i_PKCS8 ecx_d2i_PKCS8
+# define x25519_d2i_PUBKEY (d2i_of_void *)ossl_d2i_X25519_PUBKEY
+# define x25519_free (free_key_fn *)ossl_ecx_key_free
+# define x25519_check NULL
+# define x25519_adjust ecx_key_adjust
+
+# define x448_evp_type EVP_PKEY_X448
+# define x448_d2i_private_key NULL
+# define x448_d2i_public_key NULL
+# define x448_d2i_key_params NULL
+# define x448_d2i_PKCS8 ecx_d2i_PKCS8
+# define x448_d2i_PUBKEY (d2i_of_void *)ossl_d2i_X448_PUBKEY
+# define x448_free (free_key_fn *)ossl_ecx_key_free
+# define x448_check NULL
+# define x448_adjust ecx_key_adjust
+# endif /* OPENSSL_NO_ECX */
# ifndef OPENSSL_NO_SM2
# define sm2_evp_type EVP_PKEY_SM2
@@ -773,6 +775,7 @@ MAKE_DECODER("EC", ec, ec, PrivateKeyInfo);
MAKE_DECODER("EC", ec, ec, SubjectPublicKeyInfo);
MAKE_DECODER("EC", ec, ec, type_specific_no_pub);
MAKE_DECODER("EC", ec, ec, EC);
+# ifndef OPENSSL_NO_ECX
MAKE_DECODER("X25519", x25519, ecx, PrivateKeyInfo);
MAKE_DECODER("X25519", x25519, ecx, SubjectPublicKeyInfo);
MAKE_DECODER("X448", x448, ecx, PrivateKeyInfo);
@@ -781,6 +784,7 @@ MAKE_DECODER("ED25519", ed25519, ecx, PrivateKeyInfo);
MAKE_DECODER("ED25519", ed25519, ecx, SubjectPublicKeyInfo);
MAKE_DECODER("ED448", ed448, ecx, PrivateKeyInfo);
MAKE_DECODER("ED448", ed448, ecx, SubjectPublicKeyInfo);
+# endif
# ifndef OPENSSL_NO_SM2
MAKE_DECODER("SM2", sm2, ec, PrivateKeyInfo);
MAKE_DECODER("SM2", sm2, ec, SubjectPublicKeyInfo);
diff --git a/providers/implementations/encode_decode/encode_key2any.c b/providers/implementations/encode_decode/encode_key2any.c
index 55b2b56766..df0b0fd608 100644
--- a/providers/implementations/encode_decode/encode_key2any.c
+++ b/providers/implementations/encode_decode/encode_key2any.c
@@ -748,7 +748,7 @@ static int ec_pki_priv_to_der(const void *veckey, unsigned char **pder)
/* ---------------------------------------------------------------------- */
-#ifndef OPENSSL_NO_EC
+#ifndef OPENSSL_NO_ECX
# define prepare_ecx_params NULL
static int ecx_spki_pub_to_der(const void *vecxkey, unsigned char **pder)
@@ -1391,6 +1391,7 @@ MAKE_ENCODER(sm2, ec, EVP_PKEY_EC, PrivateKeyInfo, pem);
MAKE_ENCODER(sm2, ec, EVP_PKEY_EC, SubjectPublicKeyInfo, der);
MAKE_ENCODER(sm2, ec, EVP_PKEY_EC, SubjectPublicKeyInfo, pem);
# endif
+# ifndef OPENSSL_NO_ECX
MAKE_ENCODER(ed25519, ecx, EVP_PKEY_ED25519, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(ed25519, ecx, EVP_PKEY_ED25519, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(ed25519, ecx, EVP_PKEY_ED25519, PrivateKeyInfo, der);
@@ -1415,6 +1416,7 @@ MAKE_ENCODER(x448, ecx, EVP_PKEY_ED448, PrivateKeyInfo, der);
MAKE_ENCODER(x448, ecx, EVP_PKEY_ED448, PrivateKeyInfo, pem);
MAKE_ENCODER(x448, ecx, EVP_PKEY_ED448, SubjectPublicKeyInfo, der);
MAKE_ENCODER(x448, ecx, EVP_PKEY_ED448, SubjectPublicKeyInfo, pem);
+# endif
#endif
/*
diff --git a/providers/implementations/encode_decode/encode_key2text.c b/providers/implementations/encode_decode/encode_key2text.c
index ff4de1926f..1692c1da64 100644
--- a/providers/implementations/encode_decode/encode_key2text.c
+++ b/providers/implementations/encode_decode/encode_key2text.c
@@ -566,7 +566,7 @@ err:
/* ---------------------------------------------------------------------- */
-#ifndef OPENSSL_NO_EC
+#ifndef OPENSSL_NO_ECX
static int ecx_to_text(BIO *out, const void *key, int selection)
{
const ECX_KEY *ecx = key;
@@ -882,10 +882,12 @@ MAKE_TEXT_ENCODER(ec, ec);
# ifndef OPENSSL_NO_SM2
MAKE_TEXT_ENCODER(sm2, ec);
# endif
+# ifndef OPENSSL_NO_ECX
MAKE_TEXT_ENCODER(ed25519, ecx);
MAKE_TEXT_ENCODER(ed448, ecx);
MAKE_TEXT_ENCODER(x25519, ecx);
MAKE_TEXT_ENCODER(x448, ecx);
+# endif
#endif
MAKE_TEXT_ENCODER(rsa, rsa);
MAKE_TEXT_ENCODER(rsapss, rsa);
diff --git a/providers/implementations/exchange/build.info b/providers/implementations/exchange/build.info
index 3c1e5c58f1..0333c9f49c 100644
--- a/providers/implementations/exchange/build.info
+++ b/providers/implementations/exchange/build.info
@@ -21,8 +21,10 @@ IF[{- !$disabled{asm} -}]
ENDIF
IF[{- !$disabled{ec} -}]
- SOURCE[$ECX_GOAL]=ecx_exch.c
- DEFINE[$ECX_GOAL]=$ECDEF
+ IF[{- !$disabled{ecx} -}]
+ SOURCE[$ECX_GOAL]=ecx_exch.c
+ DEFINE[$ECX_GOAL]=$ECDEF
+ ENDIF
SOURCE[$ECDH_GOAL]=ecdh_exch.c
ENDIF
diff --git a/providers/implementations/include/prov/implementations.h b/providers/implementations/include/prov/implementations.h
index 804763159a..2c3c54155f 100644
--- a/providers/implementations/include/prov/implementations.h
+++ b/providers/implementations/include/prov/implementations.h
@@ -300,10 +300,12 @@ extern const OSSL_DISPATCH ossl_dhx_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_dsa_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_rsa_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_rsapss_keymgmt_functions[];
+#ifndef OPENSSL_NO_ECX
extern const OSSL_DISPATCH ossl_x25519_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_x448_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_ed25519_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_ed448_keymgmt_functions[];
+#endif
extern const OSSL_DISPATCH ossl_ec_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_kdf_keymgmt_functions[];
extern const OSSL_DISPATCH ossl_mac_legacy_keymgmt_functions[];
diff --git a/providers/implementations/kem/build.info b/providers/implementations/kem/build.info
index 6addb9b2c7..d6a6698da1 100644
--- a/providers/implementations/kem/build.info
+++ b/providers/implementations/kem/build.info
@@ -7,5 +7,8 @@ $EC_KEM_GOAL=../../libdefault.a
SOURCE[$RSA_KEM_GOAL]=rsa_kem.c
IF[{- !$disabled{ec} -}]
- SOURCE[$EC_KEM_GOAL]=ecx_kem.c kem_util.c ec_kem.c
+ SOURCE[$EC_KEM_GOAL]=kem_util.c ec_kem.c
+ IF[{- !$disabled{ecx} -}]
+ SOURCE[$EC_KEM_GOAL]=ecx_kem.c
+ ENDIF
ENDIF
diff --git a/providers/implementations/keymgmt/build.info b/providers/implementations/keymgmt/build.info
index 0d86907aed..6fb506b5a9 100644
--- a/providers/implementations/keymgmt/build.info
+++ b/providers/implementations/keymgmt/build.info
@@ -30,8 +30,10 @@ IF[{- !$disabled{asm} -}]
ENDIF
IF[{- !$disabled{ec} -}]
- SOURCE[$ECX_GOAL]=ecx_kmgmt.c
- DEFINE[$ECX_GOAL]=$ECDEF
+ IF[{- !$disabled{ecx} -}]
+ SOURCE[$ECX_GOAL]=ecx_kmgmt.c
+ DEFINE[$ECX_GOAL]=$ECDEF
+ ENDIF
ENDIF
SOURCE[$RSA_GOAL]=rsa_kmgmt.c
diff --git a/providers/implementations/signature/build.info b/providers/implementations/signature/build.info
index fd3be7f3b9..6987a12250 100644
--- a/providers/implementations/signature/build.info
+++ b/providers/implementations/signature/build.info
@@ -12,7 +12,10 @@ IF[{- !$disabled{dsa} -}]
ENDIF
IF[{- !$disabled{ec} -}]
- SOURCE[$EC_GOAL]=eddsa_sig.c ecdsa_sig.c
+ SOURCE[$EC_GOAL]=ecdsa_sig.c
+ IF[{- !$disabled{ecx} -}]
+ SOURCE[$EC_GOAL]=eddsa_sig.c
+ ENDIF
ENDIF
IF[{- !$disabled{sm2} -}]