From: Shane Lontis Date: Thu, 3 Jun 2021 00:54:13 +0000 (+1000) Subject: Document missing EC/SM2 params X-Git-Tag: openssl-3.0.0-beta1~174 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5135a9bd9280301a24640a6bf5125c144e28cfdd;p=thirdparty%2Fopenssl.git Document missing EC/SM2 params Fixes #15548 Document OSSL_PKEY_PARAM_EC_PUB_X, OSSL_PKEY_PARAM_EC_PUB_Y and OSSL_PKEY_PARAM_DEFAULT_DIGEST Added a section related to parameters for SM2. Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15601) --- diff --git a/doc/man7/EVP_PKEY-EC.pod b/doc/man7/EVP_PKEY-EC.pod index 82892492e3e..31d92bf8a19 100644 --- a/doc/man7/EVP_PKEY-EC.pod +++ b/doc/man7/EVP_PKEY-EC.pod @@ -122,6 +122,19 @@ Used for getting and setting the encoding of an EC public key. The public key is expected to be a point conforming to Sec. 2.3.4 of the SECG SEC 1 ("Elliptic Curve Cryptography") standard. +=item "qx" (B) + +Used for getting the EC public key X component. + +=item "qy" (B) + +Used for getting the EC public key Y component. + +=item (B) + +Getter that returns the default digest name. +(Currently returns "SHA256" as of OpenSSL 3.0). + =back The following Gettable types are also available for the built-in EC algorithm: diff --git a/doc/man7/EVP_PKEY-SM2.pod b/doc/man7/EVP_PKEY-SM2.pod index bb6258c8732..4f0e240f3f3 100644 --- a/doc/man7/EVP_PKEY-SM2.pod +++ b/doc/man7/EVP_PKEY-SM2.pod @@ -15,6 +15,24 @@ both signature and encryption schemes via the EVP interface. When doing the B signature algorithm, it requires a distinguishing identifier to form the message prefix which is hashed before the real message is hashed. +=head2 Common SM2 parameters + +SM2 uses the parameters defined in L. +The following parameters are different: + +=over 4 + +=item "cofactor" (B) + +This parameter is ignored for B. + +=item (B) + +Getter that returns the default digest name. +(Currently returns "SM3" as of OpenSSL 3.0). + +=back + =head1 NOTES B signatures can be generated by using the 'DigestSign' series of APIs, for @@ -63,7 +81,7 @@ L =head1 COPYRIGHT -Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c index 6cd9aa3d38b..24d4df543b8 100644 --- a/providers/implementations/keymgmt/ec_kmgmt.c +++ b/providers/implementations/keymgmt/ec_kmgmt.c @@ -763,8 +763,8 @@ static const OSSL_PARAM ec_known_gettable_params[] = { EC_IMEXPORTABLE_DOM_PARAMETERS, EC2M_GETTABLE_DOM_PARAMS EC_IMEXPORTABLE_PUBLIC_KEY, - OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0), - OSSL_PARAM_octet_string(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0), + OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_X, NULL, 0), + OSSL_PARAM_BN(OSSL_PKEY_PARAM_EC_PUB_Y, NULL, 0), EC_IMEXPORTABLE_PRIVATE_KEY, EC_IMEXPORTABLE_OTHER_PARAMETERS, OSSL_PARAM_END