diff --git a/openmls/src/credentials/errors.rs b/openmls/src/credentials/errors.rs index f3cab97472..f0788eb260 100644 --- a/openmls/src/credentials/errors.rs +++ b/openmls/src/credentials/errors.rs @@ -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}")] diff --git a/x509_credential/src/lib.rs b/x509_credential/src/lib.rs index c2b884fbd5..194030c404 100644 --- a/x509_credential/src/lib.rs +++ b/x509_credential/src/lib.rs @@ -22,7 +22,7 @@ impl CertificateKeyPair { /// Constructs the `CertificateKeyPair` from a private key and a der encoded /// certificate chain pub fn new(sk: Vec, cert_chain: Vec>) -> Result { - if cert_chain.len() < 2 { + if cert_chain.is_empty() { return Err(CryptoError::IncompleteCertificateChain); } let pki_path = cert_chain.into_iter().try_fold(