Skip to content

Commit 63cfad2

Browse files
committed
Rename invalid CSR signature error variant
1 parent 6bbe775 commit 63cfad2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

rcgen/src/csr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl CertificateSigningRequestParams {
9292
/// - `Extended Key Usage` (see [`ExtendedKeyUsagePurpose`])
9393
///
9494
/// On encountering other extensions, this function will return [`Error::UnsupportedExtension`].
95-
/// If the request's signature is invalid, it will return [`Error::InvalidRequestSignature`].
95+
/// If the request's signature is invalid, it will return
96+
/// [`Error::InvalidCertificationRequestSignature`].
9697
///
9798
/// The [`PemObject`] trait is often used to obtain a [`CertificateSigningRequestDer`] from
9899
/// PEM input. If you already have a byte slice containing DER, it can trivially be converted
@@ -107,7 +108,7 @@ impl CertificateSigningRequestParams {
107108
.map_err(|_| Error::CouldNotParseCertificationRequest)?
108109
.1;
109110
csr.verify_signature()
110-
.map_err(|_| Error::InvalidRequestSignature)?;
111+
.map_err(|_| Error::InvalidCertificationRequestSignature)?;
111112
let alg_oid = csr
112113
.signature_algorithm
113114
.algorithm

rcgen/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub enum Error {
1212
CouldNotParseKeyPair,
1313
/// The CSR signature is invalid
1414
#[cfg(feature = "x509-parser")]
15-
InvalidRequestSignature,
15+
InvalidCertificationRequestSignature,
1616
#[cfg(feature = "x509-parser")]
1717
/// Invalid subject alternative name type
1818
InvalidNameType,
@@ -65,7 +65,7 @@ impl fmt::Display for Error {
6565
)?,
6666
CouldNotParseKeyPair => write!(f, "Could not parse key pair")?,
6767
#[cfg(feature = "x509-parser")]
68-
InvalidRequestSignature => write!(f, "Invalid CSR signature")?,
68+
InvalidCertificationRequestSignature => write!(f, "Invalid CSR signature")?,
6969
#[cfg(feature = "x509-parser")]
7070
InvalidNameType => write!(f, "Invalid subject alternative name type")?,
7171
InvalidAsn1String(e) => write!(f, "{e}")?,

0 commit comments

Comments
 (0)