diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-08-11 15:38:37 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-08-13 14:11:05 +0100 |
commit | 3bca6c27317958f30f8bbfe67814a7ab9a07f4a3 (patch) | |
tree | 86bf09dcbdd6ffa25d9e2ec7f40838f642305a5c /crypto/ec/ec_ameth.c | |
parent | c06f2aaa08dec00cda6a3c3c063de7827b379797 (diff) |
Add encoded points to other EC curves too.
Add encoded point ctrl support for other curves: this makes it possible
to handle X25519 and other EC curve point encoding in a similar way
for TLS.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ec/ec_ameth.c')
-rw-r--r-- | crypto/ec/ec_ameth.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c index b1dc011953..f6a3f5c15f 100644 --- a/crypto/ec/ec_ameth.c +++ b/crypto/ec/ec_ameth.c @@ -496,6 +496,13 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) *(int *)arg2 = NID_sha256; return 2; + case ASN1_PKEY_CTRL_SET1_TLS_ENCPT: + return EC_KEY_oct2key(EVP_PKEY_get0_EC_KEY(pkey), arg2, arg1, NULL); + + case ASN1_PKEY_CTRL_GET1_TLS_ENCPT: + return EC_KEY_key2buf(EVP_PKEY_get0_EC_KEY(pkey), + POINT_CONVERSION_UNCOMPRESSED, arg2, NULL); + default: return -2; |