diff --git a/CHANGELOG.md b/CHANGELOG.md index 40c4ddcd..3db0b080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +## [v0.2.12] + +### Fixed + +* Remove unneeded private key check for PKCS#8 + ## [v0.2.11] ### Fixed diff --git a/Cargo.toml b/Cargo.toml index f63b0223..d47a9024 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "native-tls" -version = "0.2.11" +version = "0.2.12" authors = ["Steven Fackler "] license = "MIT OR Apache-2.0" description = "A wrapper over a platform's native TLS implementation" diff --git a/src/imp/openssl.rs b/src/imp/openssl.rs index 3b69e673..d2e56644 100644 --- a/src/imp/openssl.rs +++ b/src/imp/openssl.rs @@ -171,10 +171,6 @@ impl Identity { } pub fn from_pkcs8(buf: &[u8], key: &[u8]) -> Result { - if !key.starts_with(b"-----BEGIN PRIVATE KEY-----") { - return Err(Error::NotPkcs8); - } - let pkey = PKey::private_key_from_pem(key)?; let mut cert_chain = X509::stack_from_pem(buf)?.into_iter(); let cert = cert_chain.next().ok_or(Error::EmptyChain)?; diff --git a/src/imp/schannel.rs b/src/imp/schannel.rs index 62e5042f..285b2b6d 100644 --- a/src/imp/schannel.rs +++ b/src/imp/schannel.rs @@ -96,10 +96,6 @@ impl Identity { } pub fn from_pkcs8(pem: &[u8], key: &[u8]) -> Result { - if !key.starts_with(b"-----BEGIN PRIVATE KEY-----") { - return Err(io::Error::new(io::ErrorKind::InvalidInput, "not a PKCS#8 key").into()); - } - let mut store = Memory::new()?.into_store(); let mut cert_iter = pem::PemBlock::new(pem).into_iter(); let leaf = cert_iter.next().ok_or_else(|| {