mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
[test][pkey_check] Add more invalid SM2 key tests
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13359)
This commit is contained in:
parent
9e49aff2aa
commit
1330093b9c
@ -46,7 +46,9 @@ push(@tests, (
|
||||
|
||||
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)
|
||||
"sm2_bad_neg1.pem", # `k` set to `n-1` (invalid, because SM2 range)
|
||||
"sm2_bad_0.pem", # `k` set to `n` (equivalent to `0 mod n`, invalid)
|
||||
"sm2_bad_1.pem", # `k` set to `n+1` (equivalent to `1 mod n`, invalid)
|
||||
)) unless disabled("sm2");
|
||||
|
||||
plan skip_all => "No tests within the current enabled feature set"
|
||||
|
4
test/recipes/91-test_pkey_check_data/sm2_bad_0.pem
Normal file
4
test/recipes/91-test_pkey_check_data/sm2_bad_0.pem
Normal file
@ -0,0 +1,4 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////
|
||||
////cgPfayHGBStTu/QJOdVBIw==
|
||||
-----END PRIVATE KEY-----
|
4
test/recipes/91-test_pkey_check_data/sm2_bad_1.pem
Normal file
4
test/recipes/91-test_pkey_check_data/sm2_bad_1.pem
Normal file
@ -0,0 +1,4 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////
|
||||
////cgPfayHGBStTu/QJOdVBJA==
|
||||
-----END PRIVATE KEY-----
|
Loading…
Reference in New Issue
Block a user