Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing error UnknownRevocationStatus #449

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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