[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

Blumenthal, Uri - 0553 - MITLL uri at ll.mit.edu
Mon Apr 25 17:41:32 UTC 2016


>There isn't much difference between this:
>
>    RSA_set0_key(rsa, n, NULL, NULL);
>    RSA_set0_key(rsa, NULL, e, NULL);
>    RSA_set0_key(rsa, NULL, NULL, d);
>
>and something like this:
>
>    RSA_set0_n(rsa, n);
>    RSA_set0_e(rsa, e);
>    RSA_set0_d(rsa, d);

The attractiveness of RSA_set0_key(rsa, n, NULL, NULL); is that you can
provide whatever many (from 1 to 3 :) parameters using the same single
function call, rather than learning three different (albeit quite simple
:) independent functions.

>The only difference is that with the former, you get two-in-one, as it
>also works as a function to set all three numbers in one go.

Yes, but this difference adds convenience, IMHO. My preference is this:
RSA_set0_key(rsa, n, e, d); with any parameter (except for rsa :)
potentially NULL.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4324 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160425/f33dc801/attachment.bin>


More information about the openssl-dev mailing list