From 6a3113095858092cc29a28e73f6984dd847b7b91 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Sun, 7 Apr 2024 13:25:45 +0200 Subject: [PATCH] Move test keys into tests --- src/lib.rs | 34 ++++++++++++------ {src/test_keys => tests/keys}/edd25519_v2.der | Bin {src/test_keys => tests/keys}/eddsakey.der | Bin {src/test_keys => tests/keys}/nistp256key.der | Bin .../keys}/nistp256key.pkcs8.der | Bin {src/test_keys => tests/keys}/nistp384key.der | Bin .../keys}/nistp384key.pkcs8.der | Bin {src/test_keys => tests/keys}/nistp521key.der | Bin .../keys}/nistp521key.pkcs8.der | Bin .../keys}/rsa2048key.pkcs1.der | Bin .../keys}/rsa2048key.pkcs8.der | Bin .../keys}/rsa4096key.pkcs8.der | Bin 12 files changed, 23 insertions(+), 11 deletions(-) rename {src/test_keys => tests/keys}/edd25519_v2.der (100%) rename {src/test_keys => tests/keys}/eddsakey.der (100%) rename {src/test_keys => tests/keys}/nistp256key.der (100%) rename {src/test_keys => tests/keys}/nistp256key.pkcs8.der (100%) rename {src/test_keys => tests/keys}/nistp384key.der (100%) rename {src/test_keys => tests/keys}/nistp384key.pkcs8.der (100%) rename {src/test_keys => tests/keys}/nistp521key.der (100%) rename {src/test_keys => tests/keys}/nistp521key.pkcs8.der (100%) rename {src/test_keys => tests/keys}/rsa2048key.pkcs1.der (100%) rename {src/test_keys => tests/keys}/rsa2048key.pkcs8.der (100%) rename {src/test_keys => tests/keys}/rsa4096key.pkcs8.der (100%) diff --git a/src/lib.rs b/src/lib.rs index 2509e1f..c44148b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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() { diff --git a/src/test_keys/edd25519_v2.der b/tests/keys/edd25519_v2.der similarity index 100% rename from src/test_keys/edd25519_v2.der rename to tests/keys/edd25519_v2.der diff --git a/src/test_keys/eddsakey.der b/tests/keys/eddsakey.der similarity index 100% rename from src/test_keys/eddsakey.der rename to tests/keys/eddsakey.der diff --git a/src/test_keys/nistp256key.der b/tests/keys/nistp256key.der similarity index 100% rename from src/test_keys/nistp256key.der rename to tests/keys/nistp256key.der diff --git a/src/test_keys/nistp256key.pkcs8.der b/tests/keys/nistp256key.pkcs8.der similarity index 100% rename from src/test_keys/nistp256key.pkcs8.der rename to tests/keys/nistp256key.pkcs8.der diff --git a/src/test_keys/nistp384key.der b/tests/keys/nistp384key.der similarity index 100% rename from src/test_keys/nistp384key.der rename to tests/keys/nistp384key.der diff --git a/src/test_keys/nistp384key.pkcs8.der b/tests/keys/nistp384key.pkcs8.der similarity index 100% rename from src/test_keys/nistp384key.pkcs8.der rename to tests/keys/nistp384key.pkcs8.der diff --git a/src/test_keys/nistp521key.der b/tests/keys/nistp521key.der similarity index 100% rename from src/test_keys/nistp521key.der rename to tests/keys/nistp521key.der diff --git a/src/test_keys/nistp521key.pkcs8.der b/tests/keys/nistp521key.pkcs8.der similarity index 100% rename from src/test_keys/nistp521key.pkcs8.der rename to tests/keys/nistp521key.pkcs8.der diff --git a/src/test_keys/rsa2048key.pkcs1.der b/tests/keys/rsa2048key.pkcs1.der similarity index 100% rename from src/test_keys/rsa2048key.pkcs1.der rename to tests/keys/rsa2048key.pkcs1.der diff --git a/src/test_keys/rsa2048key.pkcs8.der b/tests/keys/rsa2048key.pkcs8.der similarity index 100% rename from src/test_keys/rsa2048key.pkcs8.der rename to tests/keys/rsa2048key.pkcs8.der diff --git a/src/test_keys/rsa4096key.pkcs8.der b/tests/keys/rsa4096key.pkcs8.der similarity index 100% rename from src/test_keys/rsa4096key.pkcs8.der rename to tests/keys/rsa4096key.pkcs8.der