Add tests for -ve and zero serials in roots

I agree to license my contributions to each file under the
terms given at the top of each file I changed.
This commit is contained in:
Joseph Birr-Pixton 2016-06-18 16:18:23 +01:00 committed by Brian Smith
parent 8d3309988d
commit 8fd9a8975b
3 changed files with 16 additions and 0 deletions

View File

@ -57,3 +57,19 @@ pub fn netflix()
cert.verify_is_valid_tls_server_cert(ALL_SIGALGS, &anchors, &inter_vec,
time::get_time()) .unwrap();
}
#[test]
fn read_root_with_zero_serial() {
let ca = include_bytes!("misc/serial_zero.der");
trust_anchor_util::cert_der_as_trust_anchor(
Input::from(ca)
).expect("godaddy cert should parse as anchor");
}
#[test]
fn read_root_with_neg_serial() {
let ca = include_bytes!("misc/serial_neg.der");
trust_anchor_util::cert_der_as_trust_anchor(
Input::from(ca)
).expect("idcat cert should parse as anchor");
}

BIN
tests/misc/serial_neg.der Normal file

Binary file not shown.

BIN
tests/misc/serial_zero.der Normal file

Binary file not shown.