Re: OpenSSL 3 ECC Key use question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What do you need the NID for? Maybe the code could be changed to use
names instead of NIDs? The NIDs are somehow legacy thing that might
eventually be completely internal at some point.

However, if you need the NID, you should be able to use OBJ_sn2nid() to
obtain the NID if the curve name is in the object database.

Tomas Mraz

On Sun, 2022-10-23 at 13:46 -0400, Martin via openssl-users wrote:
> Hi,
>  
> How can I get the nid from the curve name for a EC key in OpenSSL 3?
> I’m porting code from OpenSSL 1.0.2.
>  
> I’m converting this:
>  
> ecc_curve_type = EC_GROUP_get_curve_name(EC_KEY_get0_group((const
> EC_KEY *)eckey));
> if(ecc_curve_type == NID_undef)
> {
>  
> to
>  
> EVP_PKEY_get_utf8_string_param(pkey, OSSL_PKEY_PARAM_GROUP_NAME,
> curve_name, sizeof(curve_name), &out_len);
> ecc_curve_type = ossl_ec_curve_name2nid(curve_name);
>  
> but ossl_ec_curve_name2nid() is internal and it is not defined in
> /include/openssl/ec.h but in /include/crypto/ec.h
>  
> Thanks,
>  
> Martin

-- 
Tomáš Mráz, OpenSSL





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux