@@ -843,8 +843,6 @@ fn decode_cert() {
843843
844844#[ test]
845845fn decode_idp ( ) {
846- use der:: TagNumber ;
847-
848846 // IDP from 04A8739769B3C090A11DCDFABA3CF33F4BEF21F3.crl in PKITS 2048 in ficam-scvp-testing repo
849847 let idp = IssuingDistributionPoint :: from_der ( & hex ! ( "30038201FF" ) ) . unwrap ( ) ;
850848 assert_eq ! ( idp. only_contains_ca_certs, true ) ;
@@ -1112,7 +1110,11 @@ fn decode_idp() {
11121110 panic ! ( "Expected FullName" )
11131111 }
11141112 }
1113+ }
11151114
1115+ #[ test]
1116+ fn decode_idp_negative ( ) {
1117+ use der:: TagNumber ;
11161118 //---------------------------------
11171119 // Negative tests
11181120 //---------------------------------
@@ -1143,7 +1145,7 @@ fn decode_idp() {
11431145 "3067A060A05EA45C305A310B3009060355040613025553311F301D060355040A131654657374204365727469666963617465732032303137311C301A060355040B13136F6E6C79536F6D65526561736F6E7320434133310C300A0603550403130343524C8304079F80"
11441146 ) ) ;
11451147 let err = idp. err ( ) . unwrap ( ) ;
1146- assert_eq ! ( err. position( ) . unwrap( ) , 103u8 . into( ) ) ;
1148+ assert_eq ! ( err. position( ) . unwrap( ) , 105u8 . into( ) ) ;
11471149 assert_eq ! (
11481150 ErrorKind :: Incomplete {
11491151 expected_len: 106u8 . into( ) ,
@@ -1197,7 +1199,13 @@ fn decode_idp() {
11971199 "30820168A0820161A082015DA4753073310B3009060355040613025553311F301D060355040A13165465737420436572746966696361746573203230313731183016060355040B130F696E64697265637443524C204341353129302706035504031320696E6469726563742043524C20666F7220696E64697265637443524C20434136A4753073310B3009060355040613025553311F301D060355040A13165465737420436572746966696361746573203230313731183016060355040B130F696E64697265637443524C204341353129302706035504031320696E6469726563742043524C20666F7220696E64697265637443524C20434137A46D306B310B3009060355040613025553311F301D060355040A13165465737420436572746966696361746573203230313731183016060355040B130F696E64697265637443524C204341353121301F0603550403131843524C3120666F7220696E64697265637443524C204341358402FFFF"
11981200 ) ) ;
11991201 let err = idp. err ( ) . unwrap ( ) ;
1200- assert_eq ! ( ErrorKind :: Length { tag: Tag :: Boolean } , err. kind( ) ) ;
1202+ assert_eq ! (
1203+ ErrorKind :: Incomplete {
1204+ expected_len: Length :: new( 365 ) ,
1205+ actual_len: Length :: new( 364 )
1206+ } ,
1207+ err. kind( )
1208+ ) ;
12011209
12021210 // Boolean value is neither 0x00 nor 0xFF
12031211 let idp = IssuingDistributionPoint :: from_der ( & hex ! (
0 commit comments