<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Matt,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
your suggestion was very helpful, with your help I moved little forward and blocked again.<br>
<br>
Below code snippet I'm working on, </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">PEM_read_bio_DHparams and <span style="background-color:rgb(255, 255, 255);display:inline !important">PEM_read_bio_DSAparams <span style="background-color:rgb(255, 255, 255);display:inline !important">reading
 DH params and DSA params separately, how do I read <span style="background-color:rgb(255, 255, 255);display:inline !important">separately with PEM_read_bio_Parameters_ex.</span></span></span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
or <br>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">Can I modify the code to read bio in one Strech using PEM_read_bio_Parameters_ex and update  SSL_set_tmp_dh directly. </span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
<span style="color:rgb(36, 36, 36);font-family:"Segoe UI", sans-serif;font-size:14px;background-color:rgb(255, 255, 255);display:inline !important">Please let me know your views.</span> <br>
</span><br>
Thanks,
<div>Shivakumar</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
////////////////////////////////////////////////////////////////</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
#ifdef OPENSSL_NO_DH
<div>if (dh_file == NULL)</div>
<div>return 0;</div>
<div>wpa_printf(MSG_ERROR, "TLS: openssl does not include DH support, but "</div>
<div>  "dh_file specified");</div>
<div>return -1;</div>
<div>#else /* OPENSSL_NO_DH */</div>
<div>DH *dh;</div>
<div>BIO *bio;</div>
<div><br>
</div>
<div>/* TODO: add support for dh_blob */</div>
<div>if (dh_file == NULL)</div>
<div>return 0;</div>
<div>if (conn == NULL)</div>
<div>return -1;</div>
<div><br>
</div>
<div>bio = BIO_new_file(dh_file, "r");</div>
<div>if (bio == NULL) {</div>
<div>wpa_printf(MSG_INFO, "TLS: Failed to open DH file '%s': %s",</div>
<div>  dh_file, ERR_error_string(ERR_get_error(), NULL));</div>
<div>return -1;</div>
<div>}</div>
<div>dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);</div>
<div>BIO_free(bio);</div>
<div>#ifndef OPENSSL_NO_DSA</div>
<div>while (dh == NULL) {</div>
<div>DSA *dsa;</div>
<div>wpa_printf(MSG_DEBUG, "TLS: Failed to parse DH file '%s': %s -"</div>
<div>  " trying to parse as DSA params", dh_file,</div>
<div>  ERR_error_string(ERR_get_error(), NULL));</div>
<div>bio = BIO_new_file(dh_file, "r");</div>
<div>if (bio == NULL)</div>
<div>break;</div>
<div>dsa = PEM_read_bio_DSAparams(bio, NULL, NULL, NULL);</div>
<div>BIO_free(bio);</div>
<div>if (!dsa) {</div>
<div>wpa_printf(MSG_DEBUG, "TLS: Failed to parse DSA file "</div>
<div>  "'%s': %s", dh_file,</div>
<div>  ERR_error_string(ERR_get_error(), NULL));</div>
<div>break;</div>
<div>}</div>
<div><br>
</div>
<div>wpa_printf(MSG_DEBUG, "TLS: DH file in DSA param format");</div>
<div>dh = DSA_dup_DH(dsa);</div>
<div>DSA_free(dsa);</div>
<div>if (dh == NULL) {</div>
<div>wpa_printf(MSG_INFO, "TLS: Failed to convert DSA "</div>
<div>  "params into DH params");</div>
<div>break;</div>
<div>}</div>
<div>break;</div>
<div>}</div>
<div>#endif /* !OPENSSL_NO_DSA */</div>
<div>if (dh == NULL) {</div>
<div>wpa_printf(MSG_INFO, "TLS: Failed to read/parse DH/DSA file "</div>
<div>  "'%s'", dh_file);</div>
return -1;<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
////////////////////////////////////////////////////////////////</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> openssl-users <openssl-users-bounces@openssl.org> on behalf of Matt Caswell <matt@openssl.org><br>
<b>Sent:</b> Monday, November 29, 2021 8:40 PM<br>
<b>To:</b> openssl-users@openssl.org <openssl-users@openssl.org><br>
<b>Subject:</b> [EXTERNAL] Re: Need Replacement for Deprecated function.</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
On 29/11/2021 12:35, Shivakumar Poojari wrote:<br>
> Hi All,<br>
> <br>
> We are upgrading our code to openssl 3.0.<br>
> <br>
> Need Replacement for below Deprecated function.<br>
> <br>
> SSL_use_RSAPrivateKey_ASN1();<br>
<br>
Use SSL_use_PrivateKey_ASN1();<br>
<br>
<br>
> PEM_read_bio_DHparams();<br>
> PEM_read_bio_DSAparams();<br>
<br>
Use PEM_read_bio_Parameters_ex() for these two.<br>
<br>
> DSA_dup_DH();<br>
<br>
There is no replacement for this. Why do you need it? Generally this is <br>
a bad idea.<br>
<br>
If you really need to do it there is a workaround:<br>
<br>
<a href="https://clicktime.symantec.com/3RFqPpzm8EUTsqiRi1524Xo6H2?u=https%3A%2F%2Fgithub.com%2Fopenssl%2Fopenssl%2Fblob%2Fbc42cf51c8b2a22282bb3cdf6303e230dc7b7873%2Fapps%2Fdhparam.c%23L352-L400">https://clicktime.symantec.com/3RFqPpzm8EUTsqiRi1524Xo6H2?u=https%3A%2F%2Fgithub.com%2Fopenssl%2Fopenssl%2Fblob%2Fbc42cf51c8b2a22282bb3cdf6303e230dc7b7873%2Fapps%2Fdhparam.c%23L352-L400</a><br>
<br>
<br>
> DSA_free();<br>
<br>
You shouldn't need to call this anymore because you shouldn't have any <br>
DSA objects anymore. Instead you should only be using EVP_PKEY objects. <br>
To free those you use EVP_PKEY_free();<br>
<br>
<br>
> SSL_set_tmp_dh();<br>
<br>
SSL_set0_tmp_dh_pkey(). Although you might be able to just remove it <br>
completely. These functions set the DH parameters to a specific set of <br>
values. Mostly you can instead just use the default built-in ones.<br>
<br>
> DH_free();<br>
<br>
As per DSA_free();<br>
<br>
> SSL_CTX_set_tmp_dh();<br>
<br>
SSL_CTX_set0_tmp_dh_pkey() - but same comments as for SSL_set_tmp_dh() <br>
apply.<br>
<br>
<br>
Matt<br>
<br>
> <br>
> I'm not able to find proper replacement, Please help me out<br>
> <br>
> Thanks,<br>
> Shiva Kumar<br>
> <br>
> <br>
> <br>
> <br>
> Notice: This e-mail together with any attachments may contain <br>
> information of Ribbon Communications Inc. and its Affiliates that is <br>
> confidential and/or proprietary for the sole use of the intended <br>
> recipient. Any review, disclosure, reliance or distribution by others or <br>
> forwarding without express permission is strictly prohibited. If you are <br>
> not the intended recipient, please notify the sender immediately and <br>
> then delete all copies, including any attachments.<br>
</div>
</span></font></div>
<br clear="both">
Notice: This e-mail together with any attachments may contain information of Ribbon Communications Inc. and its Affiliates that is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies, including any attachments.<BR>
</body>
</html>