diff options
author | Richard Levitte <levitte@openssl.org> | 2021-01-28 08:22:09 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-02-01 23:02:20 +0100 |
commit | f2db0528d8d7015ba39faca78a16e5e820db9df6 (patch) | |
tree | 4301c6eb84f21f3fc19e71876589c5fb8c462af4 /providers/encoders.inc | |
parent | Fix some odd names in our provider source code (diff) | |
download | openssl-f2db0528d8d7015ba39faca78a16e5e820db9df6.tar.xz openssl-f2db0528d8d7015ba39faca78a16e5e820db9df6.zip |
PROV: Add SM2 encoders and decoders, as well as support functionality
The EC KEYMGMT implementation handled SM2 as well, except what's
needed to support decoding: loading functions for both EC and SM2 that
checks for the presence or absence of the SM2 curve the same way as
the EC / SM2 import functions.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14028)
Diffstat (limited to 'providers/encoders.inc')
-rw-r--r-- | providers/encoders.inc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/providers/encoders.inc b/providers/encoders.inc index c8032799b8..f2b59e0846 100644 --- a/providers/encoders.inc +++ b/providers/encoders.inc @@ -60,6 +60,9 @@ ENCODER_TEXT("ED25519", ed25519, yes), ENCODER_TEXT("ED448", ed448, yes), ENCODER_TEXT("X25519", x25519, yes), ENCODER_TEXT("X448", x448, yes), +# ifndef OPENSSL_NO_SM2 +ENCODER_TEXT("SM2", sm2, yes), +# endif #endif /* @@ -104,6 +107,10 @@ ENCODER_w_structure("DSA", dsa, yes, pem, type_specific), /* EC only supports keypair and parameters output. */ ENCODER_w_structure("EC", ec, yes, der, type_specific_no_pub), ENCODER_w_structure("EC", ec, yes, pem, type_specific_no_pub), +# ifndef OPENSSL_NO_SM2 +ENCODER_w_structure("SM2", sm2, yes, der, type_specific_no_pub), +ENCODER_w_structure("SM2", sm2, yes, pem, type_specific_no_pub), +# endif #endif /* @@ -177,6 +184,13 @@ ENCODER_w_structure("ED448", ed448, yes, der, PKCS8), ENCODER_w_structure("ED448", ed448, yes, pem, PKCS8), ENCODER_w_structure("ED448", ed448, yes, der, SubjectPublicKeyInfo), ENCODER_w_structure("ED448", ed448, yes, pem, SubjectPublicKeyInfo), + +# ifndef OPENSSL_NO_SM2 +ENCODER_w_structure("SM2", sm2, yes, der, PKCS8), +ENCODER_w_structure("SM2", sm2, yes, pem, PKCS8), +ENCODER_w_structure("SM2", sm2, yes, der, SubjectPublicKeyInfo), +ENCODER_w_structure("SM2", sm2, yes, pem, SubjectPublicKeyInfo), +# endif #endif /* |