[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:
Nicola Tuveri 2020-11-10 12:28:52 +02:00
parent 9e49aff2aa
commit 1330093b9c
4 changed files with 11 additions and 1 deletions

View File

@ -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"

View File

@ -0,0 +1,4 @@
-----BEGIN PRIVATE KEY-----
MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////
////cgPfayHGBStTu/QJOdVBIw==
-----END PRIVATE KEY-----

View File

@ -0,0 +1,4 @@
-----BEGIN PRIVATE KEY-----
MEECAQAwEwYHKoZIzj0CAQYIKoEcz1UBgi0EJzAlAgEBBCD////+////////////
////cgPfayHGBStTu/QJOdVBJA==
-----END PRIVATE KEY-----