-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error::UnsupportedCertVersion instead of BadDER on certificate v1
- Loading branch information
1 parent
082a744
commit 1803ae7
Showing
4 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use std::convert::TryFrom; | ||
|
||
// Check with `openssl x509 -text -noout -in cert_v1.der -inform DER` | ||
// to verify this is a correct 1 certificate. | ||
const CERT_V1_DER: &[u8] = include_bytes!("cert_v1.der"); | ||
|
||
#[test] | ||
fn error() { | ||
assert_eq!( | ||
Some(webpki::Error::UnsupportedCertVersion), | ||
webpki::EndEntityCert::try_from(CERT_V1_DER).err() | ||
); | ||
} |