]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/evp/p_lib.c
EVP_PKEY_assign_EC_KEY(): detect SM2 curve and set EVP_PKEY type accordingly
authorRichard Levitte <levitte@openssl.org>
Fri, 24 Jan 2020 16:51:39 +0000 (17:51 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 2 Feb 2020 11:04:00 +0000 (12:04 +0100)
commitf4e4382cae1fb85fec6e9aa26f65fc729a40a039
tree638ed2fd087c24cf6c960a0e4ef606ea7bc99531
parent658608c471a6e1f9b6d7f88c060a7adb77d7d334
EVP_PKEY_assign_EC_KEY(): detect SM2 curve and set EVP_PKEY type accordingly

This means that when loaded or created, EC EVP_PKEYs with the SM2
curve will be regarded as EVP_PKEY_SM2 type keys by default.
Applications are no longer forced to check and fix this.

It's still possible, for those who want this, to set the key type to
EVP_PKEY_EC and thereby run the normal EC computations with the SM2
curve.  This has to be done explicitly.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10942)
crypto/evp/p_lib.c
doc/man3/EVP_PKEY_set1_RSA.pod
doc/man7/SM2.pod