summaryrefslogtreecommitdiffstats
path: root/test/recipes
diff options
context:
space:
mode:
Diffstat (limited to 'test/recipes')
-rw-r--r--test/recipes/91-test_pkey_check.t5
-rw-r--r--test/recipes/91-test_pkey_check_data/sm2_bad_max.pem4
2 files changed, 9 insertions, 0 deletions
diff --git a/test/recipes/91-test_pkey_check.t b/test/recipes/91-test_pkey_check.t
index f06f3bd22a..c85ab5c377 100644
--- a/test/recipes/91-test_pkey_check.t
+++ b/test/recipes/91-test_pkey_check.t
@@ -44,6 +44,11 @@ push(@tests, (
"ec_p256_bad_1.pem", # `k` set to `n+1` (equivalent to `1 mod n`, invalid)
)) unless disabled("ec");
+push(@tests, (
+ # For SM2 keys the range for the secret scalar `k` is `1 <= k < n-1`
+ "sm2_bad_max.pem", # `k` set to `n-1` (invalid, because SM2 range)
+ )) unless disabled("sm2");
+
plan skip_all => "No tests within the current enabled feature set"
unless @tests;
diff --git a/test/recipes/91-test_pkey_check_data/sm2_bad_max.pem b/test/recipes/91-test_pkey_check_data/sm2_bad_max.pem
new file mode 100644
index 0000000000..36adb93fb9
--- /dev/null
+++ b/test/recipes/91-test_pkey_check_data/sm2_bad_max.pem
@@ -0,0 +1,4 @@
+-----BEGIN PRIVATE KEY-----
+MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////////cgPfayHG
+BStTu/QJOdVBIg==
+-----END PRIVATE KEY-----