X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=src%2Fec%2Fecdsa_i31_sign_raw.c;h=df20c244970d73bfd84fbf6e0c0a03903449f944;hp=38495458cd632415208807ebae9e6d2e67c40785;hb=b42bd5972f935ffc32019acac6f8a07ae08ae9c2;hpb=3210f38e0491b39aec1ef419cb4114e9483089fb diff --git a/src/ec/ecdsa_i31_sign_raw.c b/src/ec/ecdsa_i31_sign_raw.c index 3849545..df20c24 100644 --- a/src/ec/ecdsa_i31_sign_raw.c +++ b/src/ec/ecdsa_i31_sign_raw.c @@ -50,6 +50,13 @@ br_ecdsa_i31_sign_raw(const br_ec_impl *impl, uint32_t n0i, ctl; br_hmac_drbg_context drbg; + /* + * If the curve is not supported, then exit with an error. + */ + if (((impl->supported_curves >> sk->curve) & 1) == 0) { + return 0; + } + /* * Get the curve parameters (generator and order). */