File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,8 @@ impl CertificateRevocationList {
453453 pub fn from_pem ( pem : & [ u8 ] ) -> crate :: Result < CertificateRevocationList > {
454454 Ok ( CertificateRevocationList {
455455 #[ cfg( feature = "__rustls" ) ]
456- inner : rustls_pki_types:: CertificateRevocationListDer :: from ( pem. to_vec ( ) ) ,
456+ inner : rustls_pki_types:: CertificateRevocationListDer :: from_pem_slice ( pem)
457+ . map_err ( |_| crate :: error:: builder ( "invalid crl encoding" ) ) ?,
457458 } )
458459 }
459460
@@ -868,6 +869,12 @@ mod tests {
868869 CertificateRevocationList :: from_pem ( pem) . unwrap ( ) ;
869870 }
870871
872+ #[ cfg( feature = "__rustls" ) ]
873+ #[ test]
874+ fn invalid_crl_from_pem ( ) {
875+ CertificateRevocationList :: from_pem ( b"Invalid" ) . unwrap_err ( ) ;
876+ }
877+
871878 #[ cfg( feature = "__rustls" ) ]
872879 #[ test]
873880 fn crl_from_pem_bundle ( ) {
You can’t perform that action at this time.
0 commit comments