Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test keys into tests #44

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,35 +774,47 @@ mod non_std_tests {
}

let test_cases: &[(&[u8], fn(&PrivateKeyDer<'_>) -> bool); 11] = &[
(&include_bytes!("test_keys/eddsakey.der")[..], is_pkcs8),
(&include_bytes!("test_keys/nistp256key.der")[..], is_sec1),
(&include_bytes!("../tests/keys/eddsakey.der")[..], is_pkcs8),
(
&include_bytes!("test_keys/nistp256key.pkcs8.der")[..],
&include_bytes!("../tests/keys/nistp256key.der")[..],
is_sec1,
),
(
&include_bytes!("../tests/keys/nistp256key.pkcs8.der")[..],
is_pkcs8,
),
(&include_bytes!("test_keys/nistp384key.der")[..], is_sec1),
(
&include_bytes!("test_keys/nistp384key.pkcs8.der")[..],
&include_bytes!("../tests/keys/nistp384key.der")[..],
is_sec1,
),
(
&include_bytes!("../tests/keys/nistp384key.pkcs8.der")[..],
is_pkcs8,
),
(&include_bytes!("test_keys/nistp521key.der")[..], is_sec1),
(
&include_bytes!("test_keys/nistp521key.pkcs8.der")[..],
&include_bytes!("../tests/keys/nistp521key.der")[..],
is_sec1,
),
(
&include_bytes!("../tests/keys/nistp521key.pkcs8.der")[..],
is_pkcs8,
),
(
&include_bytes!("test_keys/rsa2048key.pkcs1.der")[..],
&include_bytes!("../tests/keys/rsa2048key.pkcs1.der")[..],
is_pkcs1,
),
(
&include_bytes!("test_keys/rsa2048key.pkcs8.der")[..],
&include_bytes!("../tests/keys/rsa2048key.pkcs8.der")[..],
is_pkcs8,
),
(
&include_bytes!("../tests/keys/rsa4096key.pkcs8.der")[..],
is_pkcs8,
),
(
&include_bytes!("test_keys/rsa4096key.pkcs8.der")[..],
&include_bytes!("../tests/keys/edd25519_v2.der")[..],
is_pkcs8,
),
(&include_bytes!("test_keys/edd25519_v2.der")[..], is_pkcs8),
];

for (key_bytes, expected_check_fn) in test_cases.iter() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading