]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Mark crypto_ec_key_gen() key compressed
authorCedric Izoard <cedric.izoard@ceva-dsp.com>
Mon, 28 Jun 2021 16:25:21 +0000 (18:25 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 26 Oct 2021 13:51:49 +0000 (16:51 +0300)
Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
src/crypto/crypto_openssl.c

index 9ba7fc50ce815afab6bedf39fc9389a9fceefbb3..dd70ffc9a26217df23ca2d0fd94e756d8131b5ab 100644 (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);