]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Document missing EC/SM2 params
authorShane Lontis <shane.lontis@oracle.com>
Thu, 3 Jun 2021 00:54:13 +0000 (10:54 +1000)
committerPauli <pauli@openssl.org>
Tue, 8 Jun 2021 05:15:01 +0000 (15:15 +1000)
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 <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15601)

doc/man7/EVP_PKEY-EC.pod
doc/man7/EVP_PKEY-SM2.pod
providers/implementations/keymgmt/ec_kmgmt.c

index 82892492e3e322d3a62b27b088931a847a3b10c8..31d92bf8a19482e9317773e4541d74e70705da76 100644 (file)
@@ -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<OSSL_PKEY_PARAM_EC_PUB_X>) <unsigned integer>
+
+Used for getting the EC public key X component.
+
+=item "qy" (B<OSSL_PKEY_PARAM_EC_PUB_Y>) <unsigned integer>
+
+Used for getting the EC public key Y component.
+
+=item (B<OSSL_PKEY_PARAM_DEFAULT_DIGEST>) <UTF8 string>
+
+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:
index bb6258c8732032e3d37fde2c03d64c8d70af1b40..4f0e240f3f339560582030feb6e386ce91ce8d9f 100644 (file)
@@ -15,6 +15,24 @@ both signature and encryption schemes via the EVP interface.
 When doing the B<SM2> 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<EVP_PKEY-EC(7)/Common EC parameters>.
+The following parameters are different:
+
+=over 4
+
+=item "cofactor" (B<OSSL_PKEY_PARAM_EC_COFACTOR>) <unsigned integer>
+
+This parameter is ignored for B<SM2>.
+
+=item (B<OSSL_PKEY_PARAM_DEFAULT_DIGEST>) <UTF8 string>
+
+Getter that returns the default digest name.
+(Currently returns "SM3" as of OpenSSL 3.0).
+
+=back
+
 =head1 NOTES
 
 B<SM2> signatures can be generated by using the 'DigestSign' series of APIs, for
@@ -63,7 +81,7 @@ L<EVP_MD_CTX_set_pkey_ctx(3)>
 
 =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
index 6cd9aa3d38bcee7a5cf35d9c08ea01045fd86548..24d4df543b8b7efcd773a6b496a411e7625ed43d 100644 (file)
@@ -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