Skip to content

Commit

Permalink
fix: Allow single cert in X.509 credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
OtaK committed Jan 19, 2024
1 parent 19c3d7a commit 92a2a1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openmls/src/credentials/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub enum CredentialError {
#[error("Invalid signature.")]
InvalidSignature,
/// Incomplete x509 certificate chain
#[error("x509 certificate chain is either empty or contains a single self-signed certificate which is not allowed.")]
#[error("x509 certificate chain is empty")]
IncompleteCertificateChain,
/// Failed to decode certificate data
#[error("Failed to decode certificate data: {0}")]
Expand Down
2 changes: 1 addition & 1 deletion x509_credential/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl CertificateKeyPair {
/// Constructs the `CertificateKeyPair` from a private key and a der encoded
/// certificate chain
pub fn new(sk: Vec<u8>, cert_chain: Vec<Vec<u8>>) -> Result<Self, CryptoError> {
if cert_chain.len() < 2 {
if cert_chain.is_empty() {
return Err(CryptoError::IncompleteCertificateChain);
}
let pki_path = cert_chain.into_iter().try_fold(
Expand Down

0 comments on commit 92a2a1c

Please sign in to comment.