Use OSSL_PARAM types. Limits are explained in the description where appropriate.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10011)
This commit is contained in:
Pauli 2019-09-25 20:42:42 +10:00
parent 560ac83b0b
commit 72c162abb0
3 changed files with 15 additions and 12 deletions

View File

@ -227,9 +227,10 @@ parameters are relevant to, or are understood by all digests:
=over 4
=item B<OSSL_DIGEST_PARAM_XOFLEN> (size_t)
=item B<OSSL_DIGEST_PARAM_XOFLEN> (unsigned integer)
Sets the digest length for extendable output functions.
The length of the "xoflen" parameter should not exceed that of a B<size_t>.
=item B<OSSL_DIGEST_PARAM_SSL3_MS> (octet string)
@ -243,7 +244,7 @@ section 5.6.8.
The next call after setting this parameter will be OP_digest_final().
This is only relevant for implementations of SHA1 or MD5_SHA1.
=item B<OSSL_DIGEST_PARAM_PAD_TYPE> (uint)
=item B<OSSL_DIGEST_PARAM_PAD_TYPE> (unsigned integer)
Sets the pad type to be used.
The only built-in digest that uses this is MDC2.
@ -251,7 +252,7 @@ Normally the final MDC2 block is padded with 0s.
If the pad type is set to 2 then the final block is padded with 0x80 followed by
0s.
=item B<OSSL_DIGEST_PARAM_MICALG> (utf8 string)
=item B<OSSL_DIGEST_PARAM_MICALG> (UTF8 string)
Gets the digest Message Integrity Check algorithm string.
This is used when creating S/MIME multipart/signed messages, as specified in

View File

@ -159,7 +159,7 @@ Sets the key in the associated MAC ctx.
Sets the IV of the underlying cipher, when applicable.
=item B<OSSL_MAC_PARAM_CUSTOM> (utf8 string)
=item B<OSSL_MAC_PARAM_CUSTOM> (UTF8 string)
Sets the custom string in the associated MAC ctx.
@ -167,31 +167,31 @@ Sets the custom string in the associated MAC ctx.
Sets the salt of the underlying cipher, when applicable.
=item B<OSSL_MAC_PARAM_BLOCK_XOF> (int)
=item B<OSSL_MAC_PARAM_BLOCK_XOF> (integer)
Sets XOF mode in the associated MAC ctx.
0 means no XOF mode, 1 means XOF mode.
=item B<OSSL_MAC_PARAM_FLAGS> (int)
=item B<OSSL_MAC_PARAM_FLAGS> (integer)
Gets flags associated with the MAC.
=for comment We need to investigate if this is the right approach
=item B<OSSL_MAC_PARAM_CIPHER> (utf8 string)
=item B<OSSL_MAC_PARAM_CIPHER> (UTF8 string)
=item B<OSSL_MAC_PARAM_DIGEST> (utf8 string)
=item B<OSSL_MAC_PARAM_DIGEST> (UTF8 string)
Sets the name of the underlying cipher or digest to be used.
It must name a suitable algorithm for the MAC that's being used.
=item B<OSSL_MAC_PARAM_PROPERTIES> (utf8 string)
=item B<OSSL_MAC_PARAM_PROPERTIES> (UTF8 string)
Sets the properties to be queried when trying to fetch the underlying algorithm.
This must be given together with the algorithm naming parameter to be
considered valid.
=item B<OSSL_MAC_PARAM_SIZE> (int)
=item B<OSSL_MAC_PARAM_SIZE> (integer)
Can be used to get the resulting MAC size.

View File

@ -194,15 +194,17 @@ algorithms:
=over 4
=item "digest" (B<OSSL_SIGNATURE_PARAM_DIGEST>) <utf8 string>
=item "digest" (B<OSSL_SIGNATURE_PARAM_DIGEST>) <UTF8 string>
Get or sets the name of the digest algorithm used for the input to the signature
functions.
=item "digest-size" (B<OSSL_SIGNATURE_PARAM_DIGEST_SIZE>) <size_t>
=item "digest-size" (B<OSSL_SIGNATURE_PARAM_DIGEST_SIZE>) <unsigned integer>
Gets or sets the output size of the digest algorithm used for the input to the
signature functions.
The length of the "digest-size" parameter should not exceed that of a B<size_t>.
=back