summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-08-09 13:31:20 +0100
committerMatt Caswell <matt@openssl.org>2018-08-22 16:35:54 +0100
commitaabbc24e424382bb44ed6f88a134e50c2ef6d897 (patch)
treea4fada1e17a245190aab306f6038736f3e6d8e06 /crypto/ec
parent2fe3e2b68272e803a6e35259a49919d57205418b (diff)
Improve the usability of the ca app using EdDSA
Previously you had to supply "null" as the digest to use EdDSA. This changes things so that any digest is ignored. Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6901)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ecx_meth.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index e75e07b052..b76bfdb6dc 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -331,8 +331,18 @@ static int ecx_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
}
return 0;
+ default:
+ return -2;
+
+ }
+}
+
+static int ecd_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
+{
+ switch (op) {
case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
- *(int *)arg2 = NID_sha256;
+ /* We currently only support Pure EdDSA which takes no digest */
+ *(int *)arg2 = NID_undef;
return 2;
default:
@@ -579,7 +589,7 @@ const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = {
0, 0,
ecx_free,
- 0,
+ ecd_ctrl,
NULL,
NULL,
ecd_item_verify,
@@ -621,7 +631,7 @@ const EVP_PKEY_ASN1_METHOD ed448_asn1_meth = {
0, 0,
ecx_free,
- 0,
+ ecd_ctrl,
NULL,
NULL,
ecd_item_verify,