Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-02-16 12:54:08 +0300
committerShane Lontis <shane.lontis@oracle.com>2020-03-04 00:48:45 +0300
commitf552d900459cbacd82433b688b237cd6870663cd (patch)
tree8fca1cf5a0274525e750cf74e890a3ac7f7eb671 /test/recipes/30-test_evp_pkey_provided
parent4a98ad086a6db9a8646244bd6e6517f9fff11762 (diff)
Add Serializers for EC
Provide EC serializers for text, pem and der. EC parameters use ANS1 'CHOICE' - which means they are more embedded than other parameters used by other KEY types (which normally have a SEQUENCE at the top level). For this reason the ANS1_STRING type that was being passed around has been changed to a void so that the code can still be shared with EC. The EC serializer only supports named curves currently. NOTE the serializer code assumes PKCS8 format - if the older encode methods are needed they will need to be added in another PR. (Probably when deserialization is considered). EVP_PKEY_key_fromdata_init was changed from using a keypair selection to all bits of a key. A side effect of this was that the very restrictive checks in the ecx code needed to be relaxed as it was assuming all selection flags were non optional. As this is not the case for any other key the code has been modified. Fixed a bug in legacy_ctrl_str_to_params() - "ecdh_cofactor_mode" was being incorrectly converted to the wrong keyname. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11107)
Diffstat (limited to 'test/recipes/30-test_evp_pkey_provided')
-rw-r--r--test/recipes/30-test_evp_pkey_provided/EC.priv.derbin0 -> 138 bytes
-rw-r--r--test/recipes/30-test_evp_pkey_provided/EC.priv.pem5
-rw-r--r--test/recipes/30-test_evp_pkey_provided/EC.priv.txt13
-rw-r--r--test/recipes/30-test_evp_pkey_provided/EC.pub.derbin0 -> 91 bytes
-rw-r--r--test/recipes/30-test_evp_pkey_provided/EC.pub.pem4
-rw-r--r--test/recipes/30-test_evp_pkey_provided/EC.pub.txt9
6 files changed, 31 insertions, 0 deletions
diff --git a/test/recipes/30-test_evp_pkey_provided/EC.priv.der b/test/recipes/30-test_evp_pkey_provided/EC.priv.der
new file mode 100644
index 0000000000..2f74cfc1ae
--- /dev/null
+++ b/test/recipes/30-test_evp_pkey_provided/EC.priv.der
Binary files differ
diff --git a/test/recipes/30-test_evp_pkey_provided/EC.priv.pem b/test/recipes/30-test_evp_pkey_provided/EC.priv.pem
new file mode 100644
index 0000000000..953b7a619c
--- /dev/null
+++ b/test/recipes/30-test_evp_pkey_provided/EC.priv.pem
@@ -0,0 +1,5 @@
+-----BEGIN PRIVATE KEY-----
+MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgM9BDg6mJVgPS1/5r
+AW/kWcwNmiRshhsu3EtNNUPhG62hRANCAAQbk2dVHFWfY9EipNjRCmBtAqV3V8ij
+R3M6aggoOb3J0oDs6acIKXEvyVaC7pqFD21/WV+M0ZYL3yk+SQeIP5op
+-----END PRIVATE KEY-----
diff --git a/test/recipes/30-test_evp_pkey_provided/EC.priv.txt b/test/recipes/30-test_evp_pkey_provided/EC.priv.txt
new file mode 100644
index 0000000000..9360d892af
--- /dev/null
+++ b/test/recipes/30-test_evp_pkey_provided/EC.priv.txt
@@ -0,0 +1,13 @@
+Private-Key: (256 bit)
+priv:
+ 33:d0:43:83:a9:89:56:03:d2:d7:fe:6b:01:6f:e4:
+ 59:cc:0d:9a:24:6c:86:1b:2e:dc:4b:4d:35:43:e1:
+ 1b:ad
+pub:
+ 04:1b:93:67:55:1c:55:9f:63:d1:22:a4:d8:d1:0a:
+ 60:6d:02:a5:77:57:c8:a3:47:73:3a:6a:08:28:39:
+ bd:c9:d2:80:ec:e9:a7:08:29:71:2f:c9:56:82:ee:
+ 9a:85:0f:6d:7f:59:5f:8c:d1:96:0b:df:29:3e:49:
+ 07:88:3f:9a:29
+ASN1 OID: prime256v1
+NIST CURVE: P-256
diff --git a/test/recipes/30-test_evp_pkey_provided/EC.pub.der b/test/recipes/30-test_evp_pkey_provided/EC.pub.der
new file mode 100644
index 0000000000..b08f9a745f
--- /dev/null
+++ b/test/recipes/30-test_evp_pkey_provided/EC.pub.der
Binary files differ
diff --git a/test/recipes/30-test_evp_pkey_provided/EC.pub.pem b/test/recipes/30-test_evp_pkey_provided/EC.pub.pem
new file mode 100644
index 0000000000..16ec838271
--- /dev/null
+++ b/test/recipes/30-test_evp_pkey_provided/EC.pub.pem
@@ -0,0 +1,4 @@
+-----BEGIN PUBLIC KEY-----
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG5NnVRxVn2PRIqTY0QpgbQKld1fI
+o0dzOmoIKDm9ydKA7OmnCClxL8lWgu6ahQ9tf1lfjNGWC98pPkkHiD+aKQ==
+-----END PUBLIC KEY-----
diff --git a/test/recipes/30-test_evp_pkey_provided/EC.pub.txt b/test/recipes/30-test_evp_pkey_provided/EC.pub.txt
new file mode 100644
index 0000000000..612ba89bb6
--- /dev/null
+++ b/test/recipes/30-test_evp_pkey_provided/EC.pub.txt
@@ -0,0 +1,9 @@
+Public-Key: (256 bit)
+pub:
+ 04:1b:93:67:55:1c:55:9f:63:d1:22:a4:d8:d1:0a:
+ 60:6d:02:a5:77:57:c8:a3:47:73:3a:6a:08:28:39:
+ bd:c9:d2:80:ec:e9:a7:08:29:71:2f:c9:56:82:ee:
+ 9a:85:0f:6d:7f:59:5f:8c:d1:96:0b:df:29:3e:49:
+ 07:88:3f:9a:29
+ASN1 OID: prime256v1
+NIST CURVE: P-256