Fix OSSL_DECODER_new_for_pkey() selection parameter documentation
authorShane Lontis <shane.lontis@oracle.com>
Thu, 13 May 2021 08:03:42 +0000 (18:03 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Sun, 16 May 2021 23:29:29 +0000 (09:29 +1000)
Fixes #14518

EVP_PKEY_fromdata() already defines this value so we link to this
documentation, 0 is also added as a possible input value.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15260)

doc/man3/OSSL_DECODER_CTX_new_for_pkey.pod
doc/man3/OSSL_ENCODER_CTX_new_for_pkey.pod

index 695cdf78ed61d91c73fe6c71d73121c5322ab755..5a01a19ebe2a466e0946f6fb07074f4fd13d2869 100644 (file)
@@ -108,6 +108,13 @@ C<type-specific>.  This is the structure used for keys encoded
 according to key type specific specifications.  For example, RSA keys
 encoded according to PKCS#1.
 
+=head2 Selections
+
+I<selection> can be any one of the values described in
+L<EVP_PKEY_fromdata(3)/Selections>.
+Additionally I<selection> can also be set to B<0> to indicate that the code will
+auto detect the selection.
+
 =head1 RETURN VALUES
 
 OSSL_DECODER_CTX_new_for_pkey() returns a pointer to a
index 674b5c3799476609b3a8c4d1bc42af1f5e0791cf..9db6e3d2a4f2d6209921c7418464e4aa552b0e8d 100644 (file)
@@ -108,38 +108,10 @@ The output is the I<selection> of the I<pkey> in PEM format.
 
 =head2 Selections
 
-=begin comment
+I<selection> can be any one of the values described in
+L<EVP_PKEY_fromdata(3)/Selections>.
 
-These constants should really be documented among the EVP manuals, but this
-will have to do for now.
-
-=end comment
-
-The following constants can be used for standard I<selection>:
-
-=over 4
-
-=item B<EVP_PKEY_KEY_PARAMETERS>
-
-Indicates that only the key parameters should be included in the output.
-Where it matters, the data type in the output will indicate that the data is
-parameters, not a key.
-
-=item B<EVP_PKEY_PUBLIC_KEY>
-
-Indicates that the public key and eventual key parameters will be included
-in the output.  Where it matters, the data type in the output will indicate
-that the data is a public key.
-
-=item B<EVP_PKEY_KEYPAIR>
-
-Indicates that the private key, the public key and eventual key parameters
-should be included in the output.  Where it matters, the data type in the
-output will indicate that the data is a private key.
-
-=back
-
-These are only indications, the encoder implementations are free to
+These are only 'hints' since the encoder implementations are free to
 determine what makes sense to include in the output, and this may depend on
 the desired output.  For example, an EC key in a PKCS#8 structure doesn't
 usually include the public key.