From 7055fe86b576de9465d4d61dd913ff7f30e53e46 Mon Sep 17 00:00:00 2001 From: Benjy Weinberger Date: Fri, 7 May 2021 10:16:43 -0700 Subject: [PATCH] Demonstrate an issue with a cert rewritten by SSL inspection. --- tests/integration.rs | 15 +++++++++++++++ tests/rewritten_cert.der | Bin 0 -> 1288 bytes 2 files changed, 15 insertions(+) create mode 100644 tests/rewritten_cert.der diff --git a/tests/integration.rs b/tests/integration.rs index 598641d3..f3adc124 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -53,6 +53,21 @@ pub fn netflix() { ); } +#[test] +pub fn rewritten_cert() { + // This cert is a rewritten version of github.com's end entity cert, generated by an + // SSL inspection system (https://www.forcepoint.com/product/ngfw-next-generation-firewall). + // We believe the cert should be considered valid: + // - It can be parsed by OpenSSL, e.g., these both work: + // `openssl x509 -inform der -in tests/rewritten_cert.der -text -noout` + // `openssl asn1parse -i -inform der -in tests/rewritten_cert.der` + // - It's generated by a robust real-world system that works in practice... + // We encountered an issue where rustls cannot handle this rewritten cert. We traced this + // back to webpki, and specifically to the code exercised by this test. + let ee: &[u8] = include_bytes!("rewritten_cert.der"); + webpki::EndEntityCert::try_from(ee).unwrap(); +} + #[test] pub fn ed25519() { let ee: &[u8] = include_bytes!("ed25519/ee.der"); diff --git a/tests/rewritten_cert.der b/tests/rewritten_cert.der new file mode 100644 index 0000000000000000000000000000000000000000..7d0cd40c2633a24c8ff0d19302f65b50c1b5c53c GIT binary patch literal 1288 zcmXqLVr4OCVt%uLnTe5!N#KB;s(IV*V2x$gD|zc?W``K?vT{NoPi8TH?y#)mq(~$fR93Ou#bXgUU5Nca!F=>o`IY= zuaTjFv5~0(7(@ZNMh3>l21drFmZp|b25G2{5jGG68OI^a<(!z4nU-IamziiNW*`C* zWEbWQPRvtqD@x2u&MZ#OHxxAxhPa%^J+s84G)V_&ak8Ev)C^`}uJp{3jM5~%Ae5*()JlM`y-qEE?#nsGC0~Ve%t7p z!5l4%8Aflp9r#oom^t@ee){3uf-7%=Z}iTYpc#3<|1!trnP#cdw@U8)3I6k<%2e>B zv*T)Y>o>yZzFWtBv<*&rwP4C-)jwO4y47Faxy-Yunu(c_fpKvY<8ok#EH+RDhO4X~ z3ovqksZ;ifM&BWUaMqcVPa|g#?tti;UhyCgJ$Kv5A!T76+eU( z&re=j{&Zh>?VJRzA3uF#)nZg*kGC)|Fji#k-z&wyz{1SnZs5wK$T06&hfDn*6W2LL zzVla4X=7V=H(B@5*ZAb=Ze83;A^_>#s#K)_gkg?j++{`7!tqGk<=}HI3s5Jh3}gp({Zt?QYA?-N9nN%{ENxIaRx=-26p+i^k$5f2XNb zBtE!h`};<)@rISwQXPUWcltIw6g`*wQQ@EMlXsk#zG*(+%wVh+;(J&B;qSJxm(O-h s%1zSV?``;v{pj2!oS$}HUh#DoUxbQ_tHOs;_k+5*OBhT;gn3!x0ly~o{{R30 literal 0 HcmV?d00001