@@ -422,7 +422,7 @@ impl Cert {
422
422
}
423
423
424
424
// 4.4 Issuer: must have certain format.
425
- Name :: validate_router ( & self . issuer , strict) ?;
425
+ Name :: validate_rpki ( & self . issuer , strict) ?;
426
426
427
427
// 4.5 Subject: same as 4.4.
428
428
Name :: validate_router ( & self . subject , strict) ?;
@@ -1310,6 +1310,7 @@ impl TbsCert {
1310
1310
let subject = Name :: take_from ( cons) ?;
1311
1311
let subject_public_key_info = PublicKey :: take_from ( cons) ?;
1312
1312
1313
+
1313
1314
// issuerUniqueID and subjectUniqueID must not be present in
1314
1315
// resource certificates. So extension is next.
1315
1316
@@ -1945,15 +1946,15 @@ where F: FnMut(Bytes) -> Result<T, E> {
1945
1946
let uri = Ia5String :: from_content ( content) ?;
1946
1947
if let Ok ( uri) = op ( uri. into_bytes ( ) ) {
1947
1948
if res. is_some ( ) {
1948
- return Err ( decode:: Malformed . into ( ) )
1949
+ xerr ! ( return Err ( decode:: Malformed . into( ) ) )
1949
1950
}
1950
1951
res = Some ( uri)
1951
1952
}
1952
1953
Ok ( ( ) )
1953
1954
} ) ? { }
1954
1955
match res {
1955
1956
Some ( res) => Ok ( res) ,
1956
- None => Err ( decode:: Malformed . into ( ) )
1957
+ None => xerr ! ( Err ( decode:: Malformed . into( ) ) )
1957
1958
}
1958
1959
}
1959
1960
@@ -2188,12 +2189,21 @@ mod test {
2188
2189
use super :: * ;
2189
2190
2190
2191
#[ test]
2191
- fn decode_certs ( ) {
2192
+ fn decode_and_inspect_certs ( ) {
2192
2193
Cert :: decode (
2193
2194
include_bytes ! ( "../../test-data/ta.cer" ) . as_ref ( )
2195
+ ) . unwrap ( ) . inspect_ta_at (
2196
+ true , Time :: utc ( 2020 , 11 , 01 , 12 , 00 , 00 )
2194
2197
) . unwrap ( ) ;
2195
2198
Cert :: decode (
2196
2199
include_bytes ! ( "../../test-data/ca1.cer" ) . as_ref ( )
2200
+ ) . unwrap ( ) . inspect_ca_at (
2201
+ true , Time :: utc ( 2020 , 05 , 01 , 12 , 00 , 00 )
2202
+ ) . unwrap ( ) ;
2203
+ Cert :: decode (
2204
+ include_bytes ! ( "../../test-data/router.cer" ) . as_ref ( )
2205
+ ) . unwrap ( ) . inspect_router_at (
2206
+ true , Time :: utc ( 2020 , 11 , 01 , 12 , 00 , 00 )
2197
2207
) . unwrap ( ) ;
2198
2208
}
2199
2209
0 commit comments