[openssl-dev] [openssl.org #4518] OpenSSL-1.1.0-pre5 RSA_set0_key and related RSA_get0_*, RSA_set0_*, DSA_set0_* and DSA_get0_* problems
Douglas E Engert
deengert at gmail.com
Thu Apr 28 10:04:29 UTC 2016
OK, Thanks.
On 4/27/2016 11:31 PM, Richard Levitte wrote:
> In message <5720FD7D.3050900 at gmail.com> on Wed, 27 Apr 2016 12:57:17 -0500, Douglas E Engert <deengert at gmail.com> said:
>
> deengert> You can call it a documentation problem. The problem only showed up
> deengert> with trying to update d
> deengert> in an existing rsa key. RSA_set0_key requires n, e, and d == NULL OR
> deengert> n, e, and d to all be set at the same time.
>
> Not any more, just the first time (and then only n and e, d can be
> left NULL). So that makes this particular sequence perfectly legal:
>
> RSA_set0_key(rsa, n, e, NULL);
> /* calculate d */
> RSA_set0_key(rsa, NULL, NULL, d);
>
> (sloppy code, btw... return codes should really be checked)
>
> Cheers,
> Richard
>
--
Douglas E. Engert <DEEngert at gmail.com>
More information about the openssl-dev
mailing list