From c45c55142164afa11a224c759a9381758fdd920e Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 11 May 2021 15:14:56 +0000 Subject: [PATCH] Merge documentation for EVP_DigestSign from OpenSSL 1.1.1. --- lib/libcrypto/man/EVP_DigestSignInit.3 | 43 +++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/lib/libcrypto/man/EVP_DigestSignInit.3 b/lib/libcrypto/man/EVP_DigestSignInit.3 index 4d12e9f3c48..8f5f99f940a 100644 --- a/lib/libcrypto/man/EVP_DigestSignInit.3 +++ b/lib/libcrypto/man/EVP_DigestSignInit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EVP_DigestSignInit.3,v 1.7 2019/06/10 14:58:48 schwarze Exp $ +.\" $OpenBSD: EVP_DigestSignInit.3,v 1.8 2021/05/11 15:14:56 tb Exp $ .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 .\" .\" This file was written by Dr. Stephen Henson . @@ -49,13 +49,14 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: June 10 2019 $ +.Dd $Mdocdate: May 11 2021 $ .Dt EVP_DIGESTSIGNINIT 3 .Os .Sh NAME .Nm EVP_DigestSignInit , .Nm EVP_DigestSignUpdate , -.Nm EVP_DigestSignFinal +.Nm EVP_DigestSignFinal , +.Nm EVP_DigestSign .Nd EVP signing functions .Sh SYNOPSIS .In openssl/evp.h @@ -79,6 +80,14 @@ .Fa "unsigned char *sig" .Fa "size_t *siglen" .Fc +.Ft int +.Fo EVP_DigestSign +.Fa "EVP_MD_CTX *ctx" +.Fa "unsigned char *sigret" +.Fa "size_t *siglen" +.Fa "const unsigned char *tbs" +.Fa "size_t tbslen" +.Fc .Sh DESCRIPTION The EVP signature routines are a high level interface to digital signatures. @@ -144,6 +153,28 @@ If the call is successful, the signature is written to and the amount of data written to .Fa siglen . .Pp +.Fn EVP_DigestSign +signs +.Fa tbslen +bytes of data at +.Fa tbs +and places the signature in +.Fa sigret +and its length in +.Fa siglen +in a similar way to +.Fn EVP_DigestSignFinal . +.Fn EVP_DigestSign +is a one shot operation which signs a single block of data +with one function call. +For algorithms that support streaming it is equivalent to calling +.Fn EVP_DigestSignUpdate +and +.Fn EVP_DigestSignFinal . +.\" For algorithms which do not support streaming +.\" (e.g. PureEdDSA) +.\" it is the only way to sign data. +.Pp The EVP interface to digital signatures should almost always be used in preference to the low level interfaces. This is because the code then becomes transparent to the algorithm used @@ -182,8 +213,9 @@ signature for any set of parameters. .Sh RETURN VALUES .Fn EVP_DigestSignInit , .Fn EVP_DigestSignUpdate , +.Fn EVP_DigestSignFinal , and -.Fn EVP_DigestSignFinal +.Fn EVP_DigestSign return 1 for success and 0 or a negative value for failure. In particular, a return value of -2 indicates the operation is not supported by the public key algorithm. @@ -202,3 +234,6 @@ and .Fn EVP_DigestSignFinal first appeared in OpenSSL 1.0.0 and have been available since .Ox 4.9 . +.Fn EVP_DigestSign +first appeared in OpenSSL 1.1.1 and has been available since +.Ox 7.0 . -- 2.20.1