From 06cb0e1175b49d6567d2080fe42b0d5e5258e3e7 Mon Sep 17 00:00:00 2001 From: op Date: Tue, 29 Aug 2023 14:44:53 +0000 Subject: [PATCH] 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@ --- usr.sbin/acme-client/acctproc.c | 3 +-- usr.sbin/acme-client/key.c | 13 +++---------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/usr.sbin/acme-client/acctproc.c b/usr.sbin/acme-client/acctproc.c index e3a0eb64dec..da3d49107ae 100644 --- a/usr.sbin/acme-client/acctproc.c +++ b/usr.sbin/acme-client/acctproc.c @@ -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 * @@ -27,7 +27,6 @@ #include #include -#include #include #include #include diff --git a/usr.sbin/acme-client/key.c b/usr.sbin/acme-client/key.c index a6fc437f863..af8cc7d5c96 100644 --- a/usr.sbin/acme-client/key.c +++ b/usr.sbin/acme-client/key.c @@ -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 * Copyright (c) 2016 Kristaps Dzonsons @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -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) { -- 2.20.1