Skip to content

Commit

Permalink
Add missing error UnknownRevocationStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz authored and cpu committed Jul 30, 2024
1 parent 311fba1 commit e73f307
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -228,6 +229,7 @@ impl rustls_result {
| CertRevoked
| CertUnhandledCriticalExtension
| CertUnknownIssuer
| CertUnknownRevocationStatus
| CertBadSignature
| CertNotValidForName
| CertInvalidPurpose
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/rustls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e73f307

Please sign in to comment.