early-access version 2698

This commit is contained in:
pineappleEA
2022-04-24 22:29:35 +02:00
parent c96f949832
commit caa0c2911b
486 changed files with 37806 additions and 14362 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: ec_ameth.c,v 1.28 2019/09/09 20:26:16 tb Exp $ */
/* $OpenBSD: ec_ameth.c,v 1.31 2022/01/10 12:10:26 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
@@ -67,6 +67,8 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
#include "ec_lcl.h"
#include "evp_locl.h"
#ifndef OPENSSL_NO_CMS
static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
@@ -619,6 +621,41 @@ ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2)
}
static int
ec_pkey_check(const EVP_PKEY *pkey)
{
EC_KEY *eckey = pkey->pkey.ec;
if (eckey->priv_key == NULL) {
ECerror(EC_R_MISSING_PRIVATE_KEY);
return 0;
}
return EC_KEY_check_key(eckey);
}
static int
ec_pkey_public_check(const EVP_PKEY *pkey)
{
EC_KEY *eckey = pkey->pkey.ec;
/* This also checks the private key, but oh, well... */
return EC_KEY_check_key(eckey);
}
static int
ec_pkey_param_check(const EVP_PKEY *pkey)
{
EC_KEY *eckey = pkey->pkey.ec;
if (eckey->group == NULL) {
ECerror(EC_R_MISSING_PARAMETERS);
return 0;
}
return EC_GROUP_check(eckey->group, NULL);
}
#ifndef OPENSSL_NO_CMS
static int
@@ -980,5 +1017,9 @@ const EVP_PKEY_ASN1_METHOD eckey_asn1_meth = {
.pkey_free = int_ec_free,
.pkey_ctrl = ec_pkey_ctrl,
.old_priv_decode = old_ec_priv_decode,
.old_priv_encode = old_ec_priv_encode
.old_priv_encode = old_ec_priv_encode,
.pkey_check = ec_pkey_check,
.pkey_public_check = ec_pkey_public_check,
.pkey_param_check = ec_pkey_param_check,
};