mirror of https://github.com/openbsd/src.git
acme-client: drop ecdsa.h, fix spacing and a typo in error message
While here drop EC_KEY_set_asn1_flag(OPENSSL_EC_NAMED_CURVE). EC_KEY_new_by_curve_name() ends up calling EC_GROUP_new() which already sets the OPENSSL_EC_NAMED_CURVE flag on the group. (suggested by tb@) ok tb@
This commit is contained in:
parent
8d87014689
commit
06cb0e1175
|
@ -1,4 +1,4 @@
|
|||
/* $Id: acctproc.c,v 1.31 2022/12/19 11:16:52 tb Exp $ */
|
||||
/* $Id: acctproc.c,v 1.32 2023/08/29 14:44:53 op Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
*
|
||||
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/ecdsa.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/err.h>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: key.c,v 1.7 2022/12/18 12:08:49 tb Exp $ */
|
||||
/* $Id: key.c,v 1.8 2023/08/29 14:44:53 op Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2019 Renaud Allard <renaud@allard.it>
|
||||
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
|
||||
|
@ -23,7 +23,6 @@
|
|||
#include <openssl/evp.h>
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/rsa.h>
|
||||
#include <openssl/ecdsa.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/obj_mac.h>
|
||||
|
||||
|
@ -80,7 +79,7 @@ ec_key_create(FILE *f, const char *fname)
|
|||
EC_KEY *eckey = NULL;
|
||||
EVP_PKEY *pkey = NULL;
|
||||
|
||||
if ((eckey = EC_KEY_new_by_curve_name(NID_secp384r1)) == NULL ) {
|
||||
if ((eckey = EC_KEY_new_by_curve_name(NID_secp384r1)) == NULL) {
|
||||
warnx("EC_KEY_new_by_curve_name");
|
||||
goto err;
|
||||
}
|
||||
|
@ -90,10 +89,6 @@ ec_key_create(FILE *f, const char *fname)
|
|||
goto err;
|
||||
}
|
||||
|
||||
/* set OPENSSL_EC_NAMED_CURVE to be able to load the key */
|
||||
|
||||
EC_KEY_set_asn1_flag(eckey, OPENSSL_EC_NAMED_CURVE);
|
||||
|
||||
/* Serialise the key to the disc in EC format */
|
||||
|
||||
if (!PEM_write_ECPrivateKey(f, eckey, NULL, NULL, 0, NULL, NULL)) {
|
||||
|
@ -108,7 +103,7 @@ ec_key_create(FILE *f, const char *fname)
|
|||
goto err;
|
||||
}
|
||||
if (!EVP_PKEY_set1_EC_KEY(pkey, eckey)) {
|
||||
warnx("EVP_PKEY_assign_EC_KEY");
|
||||
warnx("EVP_PKEY_set1_EC_KEY");
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@ -122,8 +117,6 @@ out:
|
|||
return pkey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
EVP_PKEY *
|
||||
key_load(FILE *f, const char *fname)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue