acme-client(1): allocate EC_KEY only once

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

acme-client(1): allocate EC_KEY only once

Florian Obser-2
OK?

diff --git key.c key.c
index 02c04a03419..b701cf85467 100644
--- key.c
+++ key.c
@@ -81,11 +81,8 @@ ec_key_create(FILE *f, const char *fname)
  EC_KEY *eckey = NULL;
  EVP_PKEY *pkey = NULL;
 
- if ((eckey = EC_KEY_new()) == NULL ) {
- warnx("EC_KEY_new");
- goto err;
- } else if ((eckey = EC_KEY_new_by_curve_name(ECCTYPE)) == NULL ) {
- warnx("EC_GROUP_new_by_curve_name");
+ if ((eckey = EC_KEY_new_by_curve_name(ECCTYPE)) == NULL ) {
+ warnx("EC_KEY_new_by_curve_name");
  goto err;
  }
 


--
I'm not entirely sure you are real.

Reply | Threaded
Open this post in threaded view
|

Re: acme-client(1): allocate EC_KEY only once

Sebastian Benoit-3
Florian Obser([hidden email]) on 2019.06.17 17:36:28 +0200:
> OK?

after reading the manpage, it seems to be ok.
 

> diff --git key.c key.c
> index 02c04a03419..b701cf85467 100644
> --- key.c
> +++ key.c
> @@ -81,11 +81,8 @@ ec_key_create(FILE *f, const char *fname)
>   EC_KEY *eckey = NULL;
>   EVP_PKEY *pkey = NULL;
>  
> - if ((eckey = EC_KEY_new()) == NULL ) {
> - warnx("EC_KEY_new");
> - goto err;
> - } else if ((eckey = EC_KEY_new_by_curve_name(ECCTYPE)) == NULL ) {
> - warnx("EC_GROUP_new_by_curve_name");
> + if ((eckey = EC_KEY_new_by_curve_name(ECCTYPE)) == NULL ) {
> + warnx("EC_KEY_new_by_curve_name");
>   goto err;
>   }
>  
>
>
> --
> I'm not entirely sure you are real.
>