[Pettycoin-dev] [PATCH] dumbwallet: better error messages for generating key

Rusty Russell rusty at rustcorp.com.au
Thu Aug 21 00:41:17 EST 2014


Tero Roponen <tero.roponen at gmail.com> writes:

> Running 'dumbwallet setup' on Fedora 21 gave me error
> "Coud not generate key". The reason is that Fedora's
> OpenSSL does not currently support secp256k1.
>
> This patch fixes the above typo and explains the user
> why the key generation failed.
>
> Signed-off-by: Tero Roponen <tero.roponen at gmail.com>

Thanks, applied!

Hmm, I wonder what the real solution to that is.  dumbwallet is
just the problem you hit; the rest of the code will fail similarly
too.

Cheers,
Rusty.

> diff --git a/dumbwallet.c b/dumbwallet.c
> index 0653859..0c9cf6e 100644
> --- a/dumbwallet.c
> +++ b/dumbwallet.c
> @@ -68,8 +68,10 @@ static void create_wallet(const char *privkey)
>  		EC_KEY_set_conv_form(priv, POINT_CONVERSION_COMPRESSED);
>  	} else {
>  		priv = EC_KEY_new_by_curve_name(NID_secp256k1);
> +		if (!priv)
> +			errx(1, "OpenSSL in use misses support for secp256k1");
>  		if (EC_KEY_generate_key(priv) != 1)
> -			errx(1, "Coud not generate key");
> +			errx(1, "Could not generate key");
>  	}
>  	keystr = key_to_base58(NULL, true, priv, false);
>  


More information about the Pettycoin-dev mailing list