Re: openssl 3.0.0 get ECC public key modulus from EVP_PKEY

2021-10-14 Thread Tomas Mraz
On Thu, 2021-10-14 at 17:36 -0400, Ken Goldman wrote: > On 10/14/2021 6:39 AM, Matt Caswell wrote: > > > > "priv" (OSSL_PKEY_PARAM_PRIV_KEY) > > > > The private key value. > > > > Since its an integer using EVP_PKEY_get_bn_param() would be > > appropriate here, but not EVP_PKEY_get_octet_string

Re: openssl 3.0.0 get ECC public key modulus from EVP_PKEY

2021-10-14 Thread Ken Goldman
On 10/14/2021 6:39 AM, Matt Caswell wrote: "priv" (OSSL_PKEY_PARAM_PRIV_KEY) The private key value. Since its an integer using EVP_PKEY_get_bn_param() would be appropriate here, but not EVP_PKEY_get_octet_string_param(). Basically you need to know the type of the parameter you are attemptin

Re: openssl 3.0.0 get ECC public key modulus from EVP_PKEY

2021-10-14 Thread Matt Caswell
On 13/10/2021 21:12, Ken Goldman wrote: I tried     irc = EVP_PKEY_get_octet_string_param(eccKey, OSSL_PKEY_PARAM_PRIV_KEY,   *priv, 256, (size_t *)privLen); which failed. In your original email you were attempting to access OSSL_PKEY_PARAM_PUB_KEY as a B

Re: openssl 3.0.0 get ECC public key modulus from EVP_PKEY

2021-10-13 Thread Ken Goldman
On 10/13/2021 12:06 PM, Matt Caswell wrote: On 12/10/2021 23:37, Ken Goldman wrote: In pre-3.0.0, I used this, omitting the error checking, malloc, ... ecPoint = EC_KEY_get0_public_key(ecKey); ecGroup = EC_KEY_get0_group(ecKey); EC_POINT_point2oct(ecGroup, ecPoint,    P

Re: openssl 3.0.0 get ECC public key modulus from EVP_PKEY

2021-10-13 Thread Matt Caswell
On 12/10/2021 23:37, Ken Goldman wrote: In pre-3.0.0, I used this, omitting the error checking, malloc, ... ecPoint = EC_KEY_get0_public_key(ecKey); ecGroup = EC_KEY_get0_group(ecKey); EC_POINT_point2oct(ecGroup, ecPoint,    POINT_CONVERSION_UNCOMPRESSED,   

openssl 3.0.0 get ECC public key modulus from EVP_PKEY

2021-10-12 Thread Ken Goldman
In pre-3.0.0, I used this, omitting the error checking, malloc, ... ecPoint = EC_KEY_get0_public_key(ecKey); ecGroup = EC_KEY_get0_group(ecKey); EC_POINT_point2oct(ecGroup, ecPoint, POINT_CONVERSION_UNCOMPRESSED, *modul