From 7525c930304c7814b3176d0724f271d2bbb1a09e Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 9 Apr 2020 14:26:25 +0100 Subject: [PATCH] Document X509_verify_ex() and X509_REQ_verify_ex() Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11507) --- doc/man3/X509_sign.pod | 48 ++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/doc/man3/X509_sign.pod b/doc/man3/X509_sign.pod index ffc4441397..dca5c3cd72 100644 --- a/doc/man3/X509_sign.pod +++ b/doc/man3/X509_sign.pod @@ -2,9 +2,10 @@ =head1 NAME -X509_sign, X509_sign_ctx, X509_verify, X509_REQ_sign, X509_REQ_sign_ctx, -X509_REQ_verify, X509_CRL_sign, X509_CRL_sign_ctx, X509_CRL_verify - -sign or verify certificate, certificate request or CRL signature +X509_sign, X509_sign_ctx, X509_verify_ex, X509_verify, X509_REQ_sign, +X509_REQ_sign_ctx, X509_REQ_verify_ex, X509_REQ_verify, X509_CRL_sign, +X509_CRL_sign_ctx, X509_CRL_verify +- sign or verify certificate, certificate request or CRL signature =head1 SYNOPSIS @@ -12,27 +13,35 @@ sign or verify certificate, certificate request or CRL signature int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); - int X509_verify(X509 *a, EVP_PKEY *r); + int X509_verify_ex(X509 *x, EVP_PKEY *pkey, OPENSSL_CTX *libctx, const char *propq); + int X509_verify(X509 *x, EVP_PKEY *pkey; int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); - int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); + int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *pkey, OPENSSL_CTX *libctx, + const char *propq); + int X509_REQ_verify(X509_REQ *a, EVP_PKEY *pkey); int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); - int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); + int X509_CRL_verify(X509_CRL *a, EVP_PKEY *pkey); =head1 DESCRIPTION -X509_sign() signs certificate B using private key B and message -digest B and sets the signature in B. X509_sign_ctx() also signs -certificate B but uses the parameters contained in digest context B. +X509_sign() signs certificate I using private key I and message +digest I and sets the signature in I. X509_sign_ctx() also signs +certificate I but uses the parameters contained in digest context I. -X509_verify() verifies the signature of certificate B using public key -B. Only the signature is checked: no other checks (such as certificate -chain validity) are performed. +X509_verify_ex() verifies the signature of certificate I using public key +I. Any cryptographic algorithms required for the verification are fetched +using the library context I and the property query string I. Only +the signature is checked: no other checks (such as certificate chain validity) +are performed. -X509_REQ_sign(), X509_REQ_sign_ctx(), X509_REQ_verify(), +X509_verify() is the same as X509_verify_ex() except that the default library +context and property query string are used. + +X509_REQ_sign(), X509_REQ_sign_ctx(), X509_REQ_verify_ex(), X509_REQ_verify(), X509_CRL_sign(), X509_CRL_sign_ctx() and X509_CRL_verify() sign and verify certificate requests and CRLs respectively. @@ -55,10 +64,10 @@ X509_sign(), X509_sign_ctx(), X509_REQ_sign(), X509_REQ_sign_ctx(), X509_CRL_sign() and X509_CRL_sign_ctx() return the size of the signature in bytes for success and zero for failure. -X509_verify(), X509_REQ_verify() and X509_CRL_verify() return 1 if the -signature is valid and 0 if the signature check fails. If the signature -could not be checked at all because it was invalid or some other error -occurred then -1 is returned. +X509_verify_ex(), X509_verify(), X509_REQ_verify_ex(), X509_REQ_verify() and +X509_CRL_verify() return 1 if the signature is valid and 0 if the signature +check fails. If the signature could not be checked at all because it was invalid +or some other error occurred then -1 is returned. =head1 SEE ALSO @@ -77,7 +86,8 @@ L, L, L, L, -L +L, +L =head1 HISTORY @@ -87,6 +97,8 @@ available in all versions of OpenSSL. The X509_sign_ctx(), X509_REQ_sign_ctx() and X509_CRL_sign_ctx() functions were added OpenSSL 1.0.1. +X509_verify_ex() and X509_REQ_verify_ex() were added in OpenSSL 3.0. + =head1 COPYRIGHT Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. -- 2.25.1