From 990a15fe73b059d78d06c351e902115a30f02e70 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Mon, 8 Feb 2021 08:17:23 +0100 Subject: [PATCH] x509_vfy: Clarify relevance of ctx->error also on successful verification Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/14127) --- doc/man3/X509_STORE_CTX_get_error.pod | 6 ++++-- doc/man3/X509_verify_cert.pod | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/man3/X509_STORE_CTX_get_error.pod b/doc/man3/X509_STORE_CTX_get_error.pod index 479b02503b..91e65f4af6 100644 --- a/doc/man3/X509_STORE_CTX_get_error.pod +++ b/doc/man3/X509_STORE_CTX_get_error.pod @@ -31,8 +31,10 @@ These functions are typically called after certificate or chain verification using L or L 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, see -the B section for a full description of all error codes. +X509_STORE_CTX_get_error() returns the error code of I. +See the L 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 to I. For example it might be used in a verification callback to set an error based on additional diff --git a/doc/man3/X509_verify_cert.pod b/doc/man3/X509_verify_cert.pod index 13854f5ed6..2f9cfa3858 100644 --- a/doc/man3/X509_verify_cert.pod +++ b/doc/man3/X509_verify_cert.pod @@ -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 using, for example, L. +examining I using, for example, L. 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