From: Tomas Mraz Date: Thu, 22 Jul 2021 07:32:56 +0000 (+0200) Subject: ECDSA_SIG_set0(): Clarify documentation and fix formatting errors X-Git-Tag: openssl-3.0.0-beta2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7e62fbdf89b9bbaac85826020c1033b35a67d52;p=thirdparty%2Fopenssl.git ECDSA_SIG_set0(): Clarify documentation and fix formatting errors Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/16129) --- diff --git a/doc/man3/ECDSA_SIG_new.pod b/doc/man3/ECDSA_SIG_new.pod index 6b31cbaf0aa..dd4c16f57ee 100644 --- a/doc/man3/ECDSA_SIG_new.pod +++ b/doc/man3/ECDSA_SIG_new.pod @@ -46,26 +46,25 @@ L: =head1 DESCRIPTION B is an opaque structure consisting of two BIGNUMs for the -B and B value of an ECDSA signature (see X9.62 or FIPS 186-2). +I and I value of an ECDSA signature (see X9.62 or FIPS 186-2). ECDSA_SIG_new() allocates an empty B structure. Note: before -OpenSSL 1.1.0 the: the B and B components were initialised. +OpenSSL 1.1.0 the: the I and I components were initialised. -ECDSA_SIG_free() frees the B structure B. +ECDSA_SIG_free() frees the B structure I. -ECDSA_SIG_get0() returns internal pointers the B and B values contained -in B and stores them in B<*pr> and B<*ps>, respectively. -The pointer B or B can be NULL, in which case the corresponding value +ECDSA_SIG_get0() returns internal pointers the I and I values contained +in I and stores them in I<*pr> and I<*ps>, respectively. +The pointer I or I can be NULL, in which case the corresponding value is not returned. -The values B, B can also be retrieved separately by the corresponding +The values I, I can also be retrieved separately by the corresponding function ECDSA_SIG_get0_r() and ECDSA_SIG_get0_s(), respectively. -The B and B values can be set by calling ECDSA_SIG_set0() and passing the -new values for B and B as parameters to the function. Calling this -function transfers the memory management of the values to the ECDSA_SIG object, -and therefore the values that have been passed in should not be freed directly -after this function has been called. +Non-NULL I and I values can be set on the I by calling +ECDSA_SIG_set0(). Calling this function transfers the memory management of the +values to the B object, and therefore the values that have been +passed in should not be freed by the caller. See L and L for information about encoding and decoding ECDSA signatures to/from DER. @@ -75,43 +74,43 @@ use the higher level B interface such as L or L instead. ECDSA_size() returns the maximum length of a DER encoded ECDSA signature -created with the private EC key B. To obtain the actual signature -size use L with a NULL B parameter. +created with the private EC key I. To obtain the actual signature +size use L with a NULL I parameter. -ECDSA_sign() computes a digital signature of the B bytes hash value -B using the private EC key B. The DER encoded signatures is -stored in B and its length is returned in B. Note: B must -point to ECDSA_size(eckey) bytes of memory. The parameter B is currently -ignored. ECDSA_sign() is wrapper function for ECDSA_sign_ex() with B -and B set to NULL. +ECDSA_sign() computes a digital signature of the I bytes hash value +I using the private EC key I. The DER encoded signatures is +stored in I and its length is returned in I. Note: I must +point to ECDSA_size(eckey) bytes of memory. The parameter I is currently +ignored. ECDSA_sign() is wrapper function for ECDSA_sign_ex() with I +and I set to NULL. ECDSA_do_sign() is similar to ECDSA_sign() except the signature is returned as a newly allocated B structure (or NULL on error). ECDSA_do_sign() -is a wrapper function for ECDSA_do_sign_ex() with B and B set to +is a wrapper function for ECDSA_do_sign_ex() with I and I set to NULL. -ECDSA_verify() verifies that the signature in B of size B is a -valid ECDSA signature of the hash value B of size B using the -public key B. The parameter B is ignored. +ECDSA_verify() verifies that the signature in I of size I is a +valid ECDSA signature of the hash value I of size I using the +public key I. The parameter I is ignored. ECDSA_do_verify() is similar to ECDSA_verify() except the signature is presented in the form of a pointer to an B structure. -The remaining functions utilise the internal B and B values used +The remaining functions utilise the internal I and I values used during signature computation. Most applications will never need to call these and some external ECDSA ENGINE implementations may not support them at all if -either B or B is not B. +either I or I is not NULL. ECDSA_sign_setup() may be used to precompute parts of the signing operation. -B is the private EC key and B is a pointer to B structure -(or NULL). The precomputed values or returned in B and B and can be +I is the private EC key and I is a pointer to B structure +(or NULL). The precomputed values or returned in I and I and can be used in a later call to ECDSA_sign_ex() or ECDSA_do_sign_ex(). -ECDSA_sign_ex() computes a digital signature of the B bytes hash value -B using the private EC key B and the optional pre-computed values -B and B. The DER encoded signature is stored in B and its -length is returned in B. Note: B must point to ECDSA_size(eckey) -bytes of memory. The parameter B is ignored. +ECDSA_sign_ex() computes a digital signature of the I bytes hash value +I using the private EC key I and the optional pre-computed values +I and I. The DER encoded signature is stored in I and its +length is returned in I. Note: I must point to ECDSA_size(eckey) +bytes of memory. The parameter I is ignored. ECDSA_do_sign_ex() is similar to ECDSA_sign_ex() except the signature is returned as a newly allocated B structure (or NULL on error).