OpenSSL: Mark crypto_ec_key_gen() key compressed

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
This commit is contained in:
Cedric Izoard 2021-06-28 18:25:21 +02:00 committed by Jouni Malinen
parent 86cde01cbd
commit 63bf3d25ab

View file

@ -2245,7 +2245,7 @@ fail:
struct crypto_ec_key * crypto_ec_key_gen(int group)
{
EVP_PKEY_CTX *kctx = NULL;
EC_KEY *ec_params = NULL;
EC_KEY *ec_params = NULL, *eckey;
EVP_PKEY *params = NULL, *key = NULL;
int nid;
@ -2278,6 +2278,13 @@ struct crypto_ec_key * crypto_ec_key_gen(int group)
goto fail;
}
eckey = EVP_PKEY_get0_EC_KEY(key);
if (!eckey) {
key = NULL;
goto fail;
}
EC_KEY_set_conv_form(eckey, POINT_CONVERSION_COMPRESSED);
fail:
EC_KEY_free(ec_params);
EVP_PKEY_free(params);