From 54c0480dac6c25f262d537048503a660aaa4b568 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 13 Jul 2021 17:59:37 +0200 Subject: [PATCH] doc: Document that incomplete certificates return error Fixes #16065 Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/16070) --- doc/man3/X509_check_ca.pod | 3 ++- doc/man3/X509_check_issued.pod | 3 ++- doc/man3/X509_check_purpose.pod | 3 ++- doc/man3/X509_verify.pod | 7 ++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/man3/X509_check_ca.pod b/doc/man3/X509_check_ca.pod index e070fb403a8..6cf122ddfcd 100644 --- a/doc/man3/X509_check_ca.pod +++ b/doc/man3/X509_check_ca.pod @@ -13,7 +13,8 @@ X509_check_ca - check if given certificate is CA certificate =head1 DESCRIPTION This function checks if given certificate is CA certificate (can be used -to sign other certificates). +to sign other certificates). The certificate must be a complete certificate +otherwise an error is returned. =head1 RETURN VALUES diff --git a/doc/man3/X509_check_issued.pod b/doc/man3/X509_check_issued.pod index fe37cd48586..c8d627ebba0 100644 --- a/doc/man3/X509_check_issued.pod +++ b/doc/man3/X509_check_issued.pod @@ -21,7 +21,8 @@ but also compares all sub-fields of the B extension of I, as far as present, with the respective B, serial number, and issuer fields of I, as far as present. It also checks if the B field (if present) of I allows certificate signing. -It does not actually check the certificate signature. +It does not actually check the certificate signature. An error is returned +if the I or the I are incomplete certificates. =head1 RETURN VALUES diff --git a/doc/man3/X509_check_purpose.pod b/doc/man3/X509_check_purpose.pod index 619ed7831a4..d1447c3c873 100644 --- a/doc/man3/X509_check_purpose.pod +++ b/doc/man3/X509_check_purpose.pod @@ -15,7 +15,8 @@ X509_check_purpose - Check the purpose of a certificate This function checks if certificate I was created with the purpose represented by I. If I is nonzero, then certificate I is checked to determine if it's a possible CA with various levels of certainty -possibly returned. +possibly returned. The certificate I must be a complete certificate +otherwise the function returns an error. Below are the potential ID's that can be checked: diff --git a/doc/man3/X509_verify.pod b/doc/man3/X509_verify.pod index 65e41977bd7..6033804b8d6 100644 --- a/doc/man3/X509_verify.pod +++ b/doc/man3/X509_verify.pod @@ -25,7 +25,7 @@ X509_verify() verifies the signature of certificate I using public key I. Only the signature is checked: no other checks (such as certificate chain validity) are performed. -X509_self_signed() checks whether a certificate is self-signed. +X509_self_signed() checks whether certificate I is self-signed. For success the issuer and subject names must match, the components of the authority key identifier (if present) must match the subject key identifier etc. The signature itself is actually verified only if B is 1, as @@ -39,8 +39,9 @@ verify the signatures of certificate requests and CRLs, respectively. 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 ill-formed -or some other error occurred then -1 is returned. +If the signature could not be checked at all because it was ill-formed, +the certificate or the request was not complete or some other error occurred +then -1 is returned. X509_self_signed() returns the same values but also returns 1 if all respective fields match and B is 0. -- 2.47.2