From e73f30768a1f48b8784145df25ea1257bc3ffd8f Mon Sep 17 00:00:00 2001 From: Joe Birr-Pixton Date: Tue, 30 Jul 2024 15:37:42 +0100 Subject: [PATCH] Add missing error `UnknownRevocationStatus` --- src/error.rs | 8 +++++++- src/rustls.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 9a03e2c8..706505e4 100644 --- a/src/error.rs +++ b/src/error.rs @@ -93,6 +93,7 @@ u32_enum_builder! { CertInvalidPurpose => 7129, CertApplicationVerificationFailure => 7130, CertOtherError => 7131, + CertUnknownRevocationStatus => 7154, // Last added. // From InvalidMessage, with fields that get flattened. // https://docs.rs/rustls/0.21.0/rustls/enum.Error.html#variant.InvalidMessage @@ -116,7 +117,7 @@ u32_enum_builder! { MessageUnsupportedCompression => 7150, MessageUnsupportedCurveType => 7151, MessageUnsupportedKeyExchangeAlgorithm => 7152, - MessageInvalidOther => 7153, // Last added. + MessageInvalidOther => 7153, // From Error, with fields that get dropped. PeerIncompatibleError => 7107, @@ -228,6 +229,7 @@ impl rustls_result { | CertRevoked | CertUnhandledCriticalExtension | CertUnknownIssuer + | CertUnknownRevocationStatus | CertBadSignature | CertNotValidForName | CertInvalidPurpose @@ -346,6 +348,7 @@ pub(crate) fn map_error(input: Error) -> rustls_result { CertificateError::Revoked => CertRevoked, CertificateError::UnhandledCriticalExtension => CertUnhandledCriticalExtension, CertificateError::UnknownIssuer => CertUnknownIssuer, + CertificateError::UnknownRevocationStatus => CertUnknownRevocationStatus, CertificateError::BadSignature => CertBadSignature, CertificateError::NotValidForName => CertNotValidForName, CertificateError::InvalidPurpose => CertInvalidPurpose, @@ -493,6 +496,9 @@ impl Display for rustls_result { CertApplicationVerificationFailure => { Error::InvalidCertificate(CertificateError::ApplicationVerificationFailure).fmt(f) } + CertUnknownRevocationStatus => { + Error::InvalidCertificate(CertificateError::UnknownRevocationStatus).fmt(f) + } CertOtherError => write!(f, "unknown certificate error"), // These variants correspond to a rustls::Error variant with a field, diff --git a/src/rustls.h b/src/rustls.h index 1b0c9d0c..35e72f88 100644 --- a/src/rustls.h +++ b/src/rustls.h @@ -44,6 +44,7 @@ enum rustls_result { RUSTLS_RESULT_CERT_INVALID_PURPOSE = 7129, RUSTLS_RESULT_CERT_APPLICATION_VERIFICATION_FAILURE = 7130, RUSTLS_RESULT_CERT_OTHER_ERROR = 7131, + RUSTLS_RESULT_CERT_UNKNOWN_REVOCATION_STATUS = 7154, RUSTLS_RESULT_MESSAGE_HANDSHAKE_PAYLOAD_TOO_LARGE = 7133, RUSTLS_RESULT_MESSAGE_INVALID_CCS = 7134, RUSTLS_RESULT_MESSAGE_INVALID_CONTENT_TYPE = 7135,