summaryrefslogtreecommitdiffstats
path: root/providers/encoders.inc
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-09-14 09:31:36 +0200
committerRichard Levitte <levitte@openssl.org>2020-09-20 17:31:22 +0200
commit111dc4b0f1e961afd6fc998ef443d9004356c046 (patch)
tree59712229b3ebf6ea2d967b43b07ad55f2a1bcb08 /providers/encoders.inc
parentb8975c68b1a7796993759db22905d0ef05f7e077 (diff)
ENCODER: Refactor our provider encoder implementations
This only refactors them for the changed API, there's not yet a separate DER to PEM encoder and therefore no chaining possibility yet. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12873)
Diffstat (limited to 'providers/encoders.inc')
-rw-r--r--providers/encoders.inc174
1 files changed, 30 insertions, 144 deletions
diff --git a/providers/encoders.inc b/providers/encoders.inc
index 284703c6e8..fcb1bfe3ec 100644
--- a/providers/encoders.inc
+++ b/providers/encoders.inc
@@ -11,161 +11,47 @@
# error Macro ENCODER undefined
#endif
- ENCODER("RSA", "yes", "text", "private",
- rsa_priv_to_text_encoder_functions),
- ENCODER("RSA", "yes", "text", "public",
- rsa_pub_to_text_encoder_functions),
- ENCODER("RSA", "yes", "der", "private",
- rsa_priv_to_der_encoder_functions),
- ENCODER("RSA", "yes", "der", "public",
- rsa_pub_to_der_encoder_functions),
- ENCODER("RSA", "yes", "pem", "private",
- rsa_priv_to_pem_encoder_functions),
- ENCODER("RSA", "yes", "pem", "public",
- rsa_pub_to_pem_encoder_functions),
- ENCODER("RSA-PSS", "yes", "text", "private",
- rsa_priv_to_text_encoder_functions),
- ENCODER("RSA-PSS", "yes", "text", "public",
- rsa_pub_to_text_encoder_functions),
- ENCODER("RSA-PSS", "yes", "der", "private",
- rsa_priv_to_der_encoder_functions),
- ENCODER("RSA-PSS", "yes", "der", "public",
- rsa_pub_to_der_encoder_functions),
- ENCODER("RSA-PSS", "yes", "pem", "private",
- rsa_priv_to_pem_encoder_functions),
- ENCODER("RSA-PSS", "yes", "pem", "public",
- rsa_pub_to_pem_encoder_functions),
+ ENCODER("RSA", "yes", "text", rsa_to_text_encoder_functions),
+ ENCODER("RSA", "yes", "der", rsa_to_der_encoder_functions),
+ ENCODER("RSA", "yes", "pem", rsa_to_pem_encoder_functions),
+ ENCODER("RSA-PSS", "yes", "text", rsapss_to_text_encoder_functions),
+ ENCODER("RSA-PSS", "yes", "der", rsapss_to_der_encoder_functions),
+ ENCODER("RSA-PSS", "yes", "pem", rsapss_to_pem_encoder_functions),
#ifndef OPENSSL_NO_DH
- ENCODER("DH", "yes", "text", "private",
- dh_priv_to_text_encoder_functions),
- ENCODER("DH", "yes", "text", "public",
- dh_pub_to_text_encoder_functions),
- ENCODER("DH", "yes", "text", "parameters",
- dh_param_to_text_encoder_functions),
- ENCODER("DH", "yes", "der", "private",
- dh_priv_to_der_encoder_functions),
- ENCODER("DH", "yes", "der", "public",
- dh_pub_to_der_encoder_functions),
- ENCODER("DH", "yes", "der", "parameters",
- dh_param_to_der_encoder_functions),
- ENCODER("DH", "yes", "pem", "private",
- dh_priv_to_pem_encoder_functions),
- ENCODER("DH", "yes", "pem", "public",
- dh_pub_to_pem_encoder_functions),
- ENCODER("DH", "yes", "pem", "parameters",
- dh_param_to_pem_encoder_functions),
+ ENCODER("DH", "yes", "text", dh_to_text_encoder_functions),
+ ENCODER("DH", "yes", "der", dh_to_der_encoder_functions),
+ ENCODER("DH", "yes", "pem", dh_to_pem_encoder_functions),
- ENCODER("DHX", "yes", "text", "private",
- dh_priv_to_text_encoder_functions),
- ENCODER("DHX", "yes", "text", "public",
- dh_pub_to_text_encoder_functions),
- ENCODER("DHX", "yes", "text", "parameters",
- dh_param_to_text_encoder_functions),
- ENCODER("DHX", "yes", "der", "private",
- dh_priv_to_der_encoder_functions),
- ENCODER("DHX", "yes", "der", "public",
- dh_pub_to_der_encoder_functions),
- ENCODER("DHX", "yes", "der", "parameters",
- dh_param_to_der_encoder_functions),
- ENCODER("DHX", "yes", "pem", "private",
- dh_priv_to_pem_encoder_functions),
- ENCODER("DHX", "yes", "pem", "public",
- dh_pub_to_pem_encoder_functions),
- ENCODER("DHX", "yes", "pem", "parameters",
- dh_param_to_pem_encoder_functions),
+ ENCODER("DHX", "yes", "text", dhx_to_text_encoder_functions),
+ ENCODER("DHX", "yes", "der", dhx_to_der_encoder_functions),
+ ENCODER("DHX", "yes", "pem", dhx_to_pem_encoder_functions),
#endif
#ifndef OPENSSL_NO_DSA
- ENCODER("DSA", "yes", "text", "private",
- dsa_priv_to_text_encoder_functions),
- ENCODER("DSA", "yes", "text", "public",
- dsa_pub_to_text_encoder_functions),
- ENCODER("DSA", "yes", "text", "parameters",
- dsa_param_to_text_encoder_functions),
- ENCODER("DSA", "yes", "der", "private",
- dsa_priv_to_der_encoder_functions),
- ENCODER("DSA", "yes", "der", "public",
- dsa_pub_to_der_encoder_functions),
- ENCODER("DSA", "yes", "der", "parameters",
- dsa_param_to_der_encoder_functions),
- ENCODER("DSA", "yes", "pem", "private",
- dsa_priv_to_pem_encoder_functions),
- ENCODER("DSA", "yes", "pem", "public",
- dsa_pub_to_pem_encoder_functions),
- ENCODER("DSA", "yes", "pem", "parameters",
- dsa_param_to_pem_encoder_functions),
+ ENCODER("DSA", "yes", "text", dsa_to_text_encoder_functions),
+ ENCODER("DSA", "yes", "der", dsa_to_der_encoder_functions),
+ ENCODER("DSA", "yes", "pem", dsa_to_pem_encoder_functions),
#endif
#ifndef OPENSSL_NO_EC
- ENCODER("X25519", "yes", "text", "private",
- x25519_priv_to_text_encoder_functions),
- ENCODER("X25519", "yes", "text", "public",
- x25519_pub_to_text_encoder_functions),
- ENCODER("X25519", "yes", "der", "private",
- x25519_priv_to_der_encoder_functions),
- ENCODER("X25519", "yes", "der", "public",
- x25519_pub_to_der_encoder_functions),
- ENCODER("X25519", "yes", "pem", "private",
- x25519_priv_to_pem_encoder_functions),
- ENCODER("X25519", "yes", "pem", "public",
- x25519_pub_to_pem_encoder_functions),
+ ENCODER("X25519", "yes", "text", x25519_to_text_encoder_functions),
+ ENCODER("X25519", "yes", "der", x25519_to_der_encoder_functions),
+ ENCODER("X25519", "yes", "pem", x25519_to_pem_encoder_functions),
- ENCODER("X448", "yes", "text", "private",
- x448_priv_to_text_encoder_functions),
- ENCODER("X448", "yes", "text", "public",
- x448_pub_to_text_encoder_functions),
- ENCODER("X448", "yes", "der", "private",
- x448_priv_to_der_encoder_functions),
- ENCODER("X448", "yes", "der", "public",
- x448_pub_to_der_encoder_functions),
- ENCODER("X448", "yes", "pem", "private",
- x448_priv_to_pem_encoder_functions),
- ENCODER("X448", "yes", "pem", "public",
- x448_pub_to_pem_encoder_functions),
+ ENCODER("X448", "yes", "text", x448_to_text_encoder_functions),
+ ENCODER("X448", "yes", "der", x448_to_der_encoder_functions),
+ ENCODER("X448", "yes", "pem", x448_to_pem_encoder_functions),
- ENCODER("ED25519", "yes", "text", "private",
- ed25519_priv_to_text_encoder_functions),
- ENCODER("ED25519", "yes", "text", "public",
- ed25519_pub_to_text_encoder_functions),
- ENCODER("ED25519", "yes", "der", "private",
- ed25519_priv_to_der_encoder_functions),
- ENCODER("ED25519", "yes", "der", "public",
- ed25519_pub_to_der_encoder_functions),
- ENCODER("ED25519", "yes", "pem", "private",
- ed25519_priv_to_pem_encoder_functions),
- ENCODER("ED25519", "yes", "pem", "public",
- ed25519_pub_to_pem_encoder_functions),
+ ENCODER("ED25519", "yes", "text", ed25519_to_text_encoder_functions),
+ ENCODER("ED25519", "yes", "der", ed25519_to_der_encoder_functions),
+ ENCODER("ED25519", "yes", "pem", ed25519_to_pem_encoder_functions),
- ENCODER("ED448", "yes", "text", "private",
- ed448_priv_to_text_encoder_functions),
- ENCODER("ED448", "yes", "text", "public",
- ed448_pub_to_text_encoder_functions),
- ENCODER("ED448", "yes", "der", "private",
- ed448_priv_to_der_encoder_functions),
- ENCODER("ED448", "yes", "der", "public",
- ed448_pub_to_der_encoder_functions),
- ENCODER("ED448", "yes", "pem", "private",
- ed448_priv_to_pem_encoder_functions),
- ENCODER("ED448", "yes", "pem", "public",
- ed448_pub_to_pem_encoder_functions),
+ ENCODER("ED448", "yes", "text", ed448_to_text_encoder_functions),
+ ENCODER("ED448", "yes", "der", ed448_to_der_encoder_functions),
+ ENCODER("ED448", "yes", "pem", ed448_to_pem_encoder_functions),
- ENCODER("EC", "yes", "text", "private",
- ec_priv_to_text_encoder_functions),
- ENCODER("EC", "yes", "text", "public",
- ec_pub_to_text_encoder_functions),
- ENCODER("EC", "yes", "text", "parameters",
- ec_param_to_text_encoder_functions),
- ENCODER("EC", "yes", "der", "private",
- ec_priv_to_der_encoder_functions),
- ENCODER("EC", "yes", "der", "public",
- ec_pub_to_der_encoder_functions),
- ENCODER("EC", "yes", "der", "parameters",
- ec_param_to_der_encoder_functions),
- ENCODER("EC", "yes", "pem", "private",
- ec_priv_to_pem_encoder_functions),
- ENCODER("EC", "yes", "pem", "public",
- ec_pub_to_pem_encoder_functions),
- ENCODER("EC", "yes", "pem", "parameters",
- ec_param_to_pem_encoder_functions),
+ ENCODER("EC", "yes", "text", ec_to_text_encoder_functions),
+ ENCODER("EC", "yes", "der", ec_to_der_encoder_functions),
+ ENCODER("EC", "yes", "pem", ec_to_pem_encoder_functions),
#endif