diff --git a/tuf/src/metadata.rs b/tuf/src/metadata.rs index d8aa7e3..77165ce 100644 --- a/tuf/src/metadata.rs +++ b/tuf/src/metadata.rs @@ -66,7 +66,6 @@ static PATH_ILLEGAL_STRINGS: &[&str] = &[ "\"", "|", "?", - "*", // control characters, all illegal in FAT "\u{000}", "\u{001}", @@ -2314,6 +2313,23 @@ mod test { } } + #[test] + fn allow_asterisk_in_target_path() { + let good_paths = &[ + "*", + "*/some/path", + "*/some/path/", + "some/*/path", + "some/*/path/*", + ]; + + for path in good_paths.iter() { + assert!(safe_path(path).is_ok()); + assert!(TargetPath::new(path.to_string()).is_ok()); + assert!(MetadataPath::new(path.to_string()).is_ok()); + } + } + #[test] fn path_matches_chain() { let test_cases: &[(bool, &str, &[&[&str]])] = &[