Botan 3.14.1
Crypto and TLS for C&
Botan::Cert_Extension::NoRevocationAvailable Class Referencefinal

#include <x509_ext.h>

Inheritance diagram for Botan::Cert_Extension::NoRevocationAvailable:
Botan::Certificate_Extension

Public Member Functions

std::unique_ptr< Certificate_Extension > copy () const override
 NoRevocationAvailable ()=default
OID oid_of () const override
void validate (const X509_Certificate &subject, const std::optional< X509_Certificate > &issuer, const std::vector< X509_Certificate > &cert_path, std::vector< std::set< Certificate_Status_Code > > &cert_status, size_t pos) const override

Static Public Member Functions

static OID static_oid ()

Detailed Description

No Revocation Available Extension

RFC 9608 Section 2

The noRevAvail extension, defined in [X.509-2019-TC2], allows a CA to indicate that no revocation information will be made available for this certificate.

This extension MUST NOT be present in CA public key certificates.

Conforming CAs MUST include this extension in certificates for which no revocation information will be published. When present, conforming CAs MUST mark this extension as non-critical.

Definition at line 833 of file x509_ext.h.

Constructor & Destructor Documentation

◆ NoRevocationAvailable()

Botan::Cert_Extension::NoRevocationAvailable::NoRevocationAvailable ( )
default

Member Function Documentation

◆ copy()

std::unique_ptr< Certificate_Extension > Botan::Cert_Extension::NoRevocationAvailable::copy ( ) const
inlineoverridevirtual

Make a copy of this extension

Returns
copy of this

Implements Botan::Certificate_Extension.

Definition at line 837 of file x509_ext.h.

837{ return std::make_unique<NoRevocationAvailable>(); }

◆ oid_of()

OID Botan::Cert_Extension::NoRevocationAvailable::oid_of ( ) const
inlineoverridevirtual

Return object identifier for this extension

Returns
OID representing this extension

Implements Botan::Certificate_Extension.

Definition at line 841 of file x509_ext.h.

841{ return static_oid(); }

References static_oid().

◆ static_oid()

OID Botan::Cert_Extension::NoRevocationAvailable::static_oid ( )
inlinestatic

Definition at line 839 of file x509_ext.h.

839{ return OID({2, 5, 29, 56}); }

Referenced by oid_of().

◆ validate()

void Botan::Cert_Extension::NoRevocationAvailable::validate ( const X509_Certificate & subject,
const std::optional< X509_Certificate > & issuer,
const std::vector< X509_Certificate > & cert_path,
std::vector< std::set< Certificate_Status_Code > > & cert_status,
size_t pos ) const
overridevirtual

Callback visited during path validation.

An extension can implement this callback to inspect the path during path validation.

If an error occurs during validation of this extension, an appropriate status code shall be added to cert_status.

Parameters
subjectSubject certificate that contains this extension
issuerIssuer certificate. nullopt for certificates with no available issuer (e.g. non self-signed trust anchors).
cert_pathCertificate path which is currently validated
cert_statusCertificate validation status codes for subject certificate
posPosition of subject certificate in cert_path

Reimplemented from Botan::Certificate_Extension.

Definition at line 2945 of file x509_ext.cpp.

2949 {
2950 // RFC 9608 Section 2:
2951 // This extension MUST NOT be present in CA public key certificates.
2952 //
2953 // RFC 9608 Section 3:
2954 // Certificates that include the noRevAvail extension MUST NOT include
2955 // certificate extensions that point to CRL repositories or provide
2956 // locations of OCSP responders.
2957 //
2958 // Additionally (and unusually) the requirements of RFC 9608 Section 3
2959 // are not just on issuing parties but also on verifiers:
2960 //
2961 // If any of the above are violated in a certificate, then the relying
2962 // party MUST consider the certificate invalid.
2963
2964 const Extensions& exts = subject.v3_extensions();
2965
2966 if(const auto* bc = exts.get_extension_object_as<Basic_Constraints>(); bc != nullptr && bc->is_ca()) {
2967 // RFC 9608 Section 3:
2968 // The certificate MUST NOT also include the basic constraints
2969 // certificate extension with the cA BOOLEAN set to TRUE
2970 cert_status.at(pos).insert(Certificate_Status_Code::NO_REV_AVAIL_INVALID_USE);
2971 }
2972
2973 // RFC 9608 Section 3:
2974 // The certificate MUST NOT also include the CRL Distribution Points
2975 // certificate extension
2976 if(exts.extension_set(CRL_Distribution_Points::static_oid())) {
2977 cert_status.at(pos).insert(Certificate_Status_Code::NO_REV_AVAIL_INVALID_USE);
2978 }
2979
2980 // RFC 9608 Section 3:
2981 // The certificate MUST NOT also include the Freshest CRL certificate
2982 // extension
2983 if(exts.extension_set(OID({2, 5, 29, 46}))) {
2984 cert_status.at(pos).insert(Certificate_Status_Code::NO_REV_AVAIL_INVALID_USE);
2985 }
2986
2987 // RFC 9608 Section 3:
2988 // The Authority Information Access certificate extension, if
2989 // present, MUST NOT include an id-ad-ocsp accessMethod
2990 //
2991 // Walk the raw AccessDescription list rather than the URI-only typed
2992 // accessor so a non-URI OCSP accessLocation also triggers the rejection.
2993 if(const auto* aia = exts.get_extension_object_as<Authority_Information_Access>(); aia != nullptr) {
2994 const OID id_ad_ocsp = OID::from_string("PKIX.OCSP");
2995 const bool has_ocsp = !aia->ocsp_responder_uris().empty() ||
2996 std::ranges::any_of(aia->access_descriptions(),
2997 [&](const auto& ad) { return ad.access_method() == id_ad_ocsp; });
2998 if(has_ocsp) {
2999 cert_status.at(pos).insert(Certificate_Status_Code::NO_REV_AVAIL_INVALID_USE);
3000 }
3001 }
3002}
static OID from_string(std::string_view str)
Definition asn1_oid.cpp:80

References Botan::Extensions::extension_set(), Botan::Certificate_Extension::Extensions, Botan::OID::from_string(), Botan::Extensions::get_extension_object_as(), Botan::Cert_Extension::Basic_Constraints::is_ca(), Botan::NO_REV_AVAIL_INVALID_USE, Botan::Cert_Extension::CRL_Distribution_Points::static_oid(), and Botan::X509_Certificate::v3_extensions().


The documentation for this class was generated from the following files: