EVP_PKEY_get_int_param is not getting degree from EC key

Tomas Mraz tomas at openssl.org
Tue Jan 4 16:50:21 UTC 2022


On Tue, 2022-01-04 at 16:46 +0000, Blumenthal, Uri - 0553 - MITLL
wrote:
> On 1/4/22, 11:23, "Tomas Mraz" <tomas at openssl.org> wrote:
> 
> >  > Theoretically, shouldn’t
> >  > 
> >  > EVP_PKEY_get_int_param(pkey, OSSL_PARAM_EC_ORDER, &(unsigned
> > int)order)
> >  > 
> >  > work? I verified that it does not seem to work, at least in the
> >  > obvious context. 
> > 
> >  OSSL_PARAM_EC_ORDER is an unsigned integer (also a bignum) and it
> > won't
> >  fit into int. So that's the reason why that call fails.
> 
> In other words, the man page says it's unsigned int, but in fact it's
> BIGNUM? Because the pointer I gave was to "unsigned int", like in the
> OP's code.

The param is too big to fit into int. If you were using some
ridiculously small EC curve the call would succeed. The parameter types
!= C types and the manual page does not say "unsigned int" but
"unsigned integer" for a reason.

-- 
Tomáš Mráz, OpenSSL




More information about the openssl-users mailing list