summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_ameth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_ameth.c')
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 8316683f8f..86f509b736 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.30 2022/01/10 11:52:43 tb Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.31 2022/01/10 12:10:26 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -634,6 +634,28 @@ ec_pkey_check(const EVP_PKEY *pkey)
634 return EC_KEY_check_key(eckey); 634 return EC_KEY_check_key(eckey);
635} 635}
636 636
637static int
638ec_pkey_public_check(const EVP_PKEY *pkey)
639{
640 EC_KEY *eckey = pkey->pkey.ec;
641
642 /* This also checks the private key, but oh, well... */
643 return EC_KEY_check_key(eckey);
644}
645
646static int
647ec_pkey_param_check(const EVP_PKEY *pkey)
648{
649 EC_KEY *eckey = pkey->pkey.ec;
650
651 if (eckey->group == NULL) {
652 ECerror(EC_R_MISSING_PARAMETERS);
653 return 0;
654 }
655
656 return EC_GROUP_check(eckey->group, NULL);
657}
658
637#ifndef OPENSSL_NO_CMS 659#ifndef OPENSSL_NO_CMS
638 660
639static int 661static int
@@ -998,4 +1020,6 @@ const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = {
998 .old_priv_encode = old_ec_priv_encode, 1020 .old_priv_encode = old_ec_priv_encode,
999 1021
1000 .pkey_check = ec_pkey_check, 1022 .pkey_check = ec_pkey_check,
1023 .pkey_public_check = ec_pkey_public_check,
1024 .pkey_param_check = ec_pkey_param_check,
1001}; 1025};