@@ -843,8 +843,6 @@ fn decode_cert() {
843
843
844
844
#[ test]
845
845
fn decode_idp ( ) {
846
- use der:: TagNumber ;
847
-
848
846
// IDP from 04A8739769B3C090A11DCDFABA3CF33F4BEF21F3.crl in PKITS 2048 in ficam-scvp-testing repo
849
847
let idp = IssuingDistributionPoint :: from_der ( & hex ! ( "30038201FF" ) ) . unwrap ( ) ;
850
848
assert_eq ! ( idp. only_contains_ca_certs, true ) ;
@@ -1112,7 +1110,11 @@ fn decode_idp() {
1112
1110
panic ! ( "Expected FullName" )
1113
1111
}
1114
1112
}
1113
+ }
1115
1114
1115
+ #[ test]
1116
+ fn decode_idp_negative ( ) {
1117
+ use der:: TagNumber ;
1116
1118
//---------------------------------
1117
1119
// Negative tests
1118
1120
//---------------------------------
@@ -1143,7 +1145,7 @@ fn decode_idp() {
1143
1145
"3067A060A05EA45C305A310B3009060355040613025553311F301D060355040A131654657374204365727469666963617465732032303137311C301A060355040B13136F6E6C79536F6D65526561736F6E7320434133310C300A0603550403130343524C8304079F80"
1144
1146
) ) ;
1145
1147
let err = idp. err ( ) . unwrap ( ) ;
1146
- assert_eq ! ( err. position( ) . unwrap( ) , 103u8 . into( ) ) ;
1148
+ assert_eq ! ( err. position( ) . unwrap( ) , 105u8 . into( ) ) ;
1147
1149
assert_eq ! (
1148
1150
ErrorKind :: Incomplete {
1149
1151
expected_len: 106u8 . into( ) ,
@@ -1197,7 +1199,13 @@ fn decode_idp() {
1197
1199
"30820168A0820161A082015DA4753073310B3009060355040613025553311F301D060355040A13165465737420436572746966696361746573203230313731183016060355040B130F696E64697265637443524C204341353129302706035504031320696E6469726563742043524C20666F7220696E64697265637443524C20434136A4753073310B3009060355040613025553311F301D060355040A13165465737420436572746966696361746573203230313731183016060355040B130F696E64697265637443524C204341353129302706035504031320696E6469726563742043524C20666F7220696E64697265637443524C20434137A46D306B310B3009060355040613025553311F301D060355040A13165465737420436572746966696361746573203230313731183016060355040B130F696E64697265637443524C204341353121301F0603550403131843524C3120666F7220696E64697265637443524C204341358402FFFF"
1198
1200
) ) ;
1199
1201
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
+ ) ;
1201
1209
1202
1210
// Boolean value is neither 0x00 nor 0xFF
1203
1211
let idp = IssuingDistributionPoint :: from_der ( & hex ! (
0 commit comments