]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
x509_vfy: Clarify relevance of ctx->error also on successful verification
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Mon, 8 Feb 2021 07:17:23 +0000 (08:17 +0100)
committerDr. David von Oheimb <dev@ddvo.net>
Tue, 9 Feb 2021 14:18:19 +0000 (15:18 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14127)

doc/man3/X509_STORE_CTX_get_error.pod
doc/man3/X509_verify_cert.pod

index 479b02503bf0e9fee3ac84300b0bc53c4598e924..91e65f4af659dffe6b96fb343cffdac8b0e25cee 100644 (file)
@@ -31,8 +31,10 @@ These functions are typically called after certificate or chain verification
 using L<X509_verify_cert(3)> or L<X509_STORE_CTX_verify(3)> has indicated
 an error or in a verification callback to determine the nature of an error.
 
-X509_STORE_CTX_get_error() returns the error code of B<ctx>, see
-the B<ERROR CODES> section for a full description of all error codes.
+X509_STORE_CTX_get_error() returns the error code of I<ctx>.
+See the L</ERROR CODES> section for a full description of all error codes.
+It may return a code != X509_V_OK even if X509_verify_cert() did not indicate
+an error, likely because a verification callback function has waived the error.
 
 X509_STORE_CTX_set_error() sets the error code of I<ctx> to I<s>. For example
 it might be used in a verification callback to set an error based on additional
index 13854f5ed68604b4b853efd6d42ba86f280cfcbd..2f9cfa385819a7e0e794b60760030e0d3117f48b 100644 (file)
@@ -49,7 +49,9 @@ otherwise they return 0, and in exceptional circumstances (such as malloc
 failure and internal errors) they can also return a negative code.
 
 On error or failure additional error information can be obtained by
-examining I<ctx> using, for example, L<X509_STORE_CTX_get_error(3)>.
+examining I<ctx> using, for example, L<X509_STORE_CTX_get_error(3)>.  Even if
+verification indicated success, the stored error code may be different from
+X509_V_OK, likely because a verification callback function has waived the error.
 
 =head1 SEE ALSO