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

fix: Allow single cert in X.509 credentials #76

Merged
merged 1 commit into from
Jan 23, 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
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
Loading