<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hello Erwann,</p>
<p><br>
</p>
<p>Merci <span>beaucoup</span>!</p>
<p>It has worked but with "-sigalgs RSA+SHA256" instead of "sigalgs SHA256+RSA" <br>
</p>
<p><br>
</p>
<p>Finding this option was driving me crazy because I could not find it in the wiki page of s_server:</p>
<p><a href="https://wiki.openssl.org/index.php/Manual:S_server(1)" class="OWAAutoLink" id="LPlnk327739">https://wiki.openssl.org/index.php/Manual:S_server(1)</a></p>
<div id="LPBorder_GT_14973344957380.6477042551242994" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14973344957330.08440895549183647" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_14973344957350.1698323476723882" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_14973344957350.9137541762955371"></div>
<div id="LPTitle_14973344957350.7342599559577521" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light","Segoe UI Light","Segoe WP Light","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14973344957360.22479815826475757" style="text-decoration: none;" href="https://wiki.openssl.org/index.php/Manual:S_server(1)" target="_blank">Manual:S server(1) - OpenSSLWiki</a></div>
<div id="LPMetadata_14973344957370.42825831956327487" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size: 14px; line-height: 14px;">
wiki.openssl.org</div>
<div id="LPDescription_14973344957370.3413125029582563" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal","Segoe UI","Segoe WP",Tahoma,Arial,sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
NAME. s_server - SSL/TLS server program SYNOPSIS. openssl s_server [-accept port] [-naccept count] [-context id] [-verify depth] [-Verify depth] [-crl_check] [-crl ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<p><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>De:</b> openssl-users <openssl-users-bounces@openssl.org> en nombre de Erwann Abalea <Erwann.Abalea@docusign.com><br>
<b>Enviado:</b> lunes, 12 de junio de 2017 10:42<br>
<b>Para:</b> openssl-users@openssl.org<br>
<b>Asunto:</b> Re: [openssl-users] Understanding RSA_sign and type argument</font>
<div> </div>
</div>
<div>
<div class="">Bonjour,</div>
<div class=""><br class="">
</div>
<div class="">Add « -sigalgs SHA256+RSA » to one of your command lines.</div>
<br class="">
<div class="">
<div class="">Cordialement,</div>
<div class="">Erwann Abalea</div>
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">Le 9 juin 2017 à 09:45, Ignacio Alamo Corsino <<a href="mailto:nacao2001@hotmail.com" class="">nacao2001@hotmail.com</a>> a écrit :</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" dir="ltr" class="" style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; font-size:12pt; font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,'Apple Color Emoji','Segoe UI Emoji',NotoColorEmoji,'Segoe UI Symbol','Android Emoji',EmojiSymbols">
<div class="" style="margin-top:0px; margin-bottom:0px">Hello everyone,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">i am having some issues understanding the RSA_sign function:</div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="">RSA_sign(int type, const unsigned char *m, unsigned int m_len, unsigned char *sigret, unsigned int *siglen, RSA *rsa);</div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">As far as I know, the signing is a four step process:</div>
<div class="" style="margin-top:0px; margin-bottom:0px">- Calculate hash with digest algorithm <type> (given as argument to this function -> m)</div>
<div class="" style="margin-top:0px; margin-bottom:0px">- Encapsulate hash in a DigestInfo structure (X509_SIG)</div>
<div class="" style="margin-top:0px; margin-bottom:0px">- Structure padding (in RSA_private_encrypt)</div>
<div class="" style="margin-top:0px; margin-bottom:0px">- Private key operation on this padded structure<span class="Apple-converted-space"> </span><span class="">(in RSA_private_encrypt)</span><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">Is that correct?</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">So, during the TLS handshake, the RSA_sign function is called in the CertificateVerify step.<span class="Apple-converted-space"> </span><br class="">
</div>
For my tests, everytime this function is called, the hashing type is SHA512 even though I specify to use a SHA256 hash.<br class="">
<br class="">
These are the commands that I use to test TLS:<br class="">
<br class="">
<div class="">#<span class="">openssl s_server -accept 443 -cert cert.pem -key key.pem  -Verify 1 -msg -debug -cipher eNULL:aRSA:!SHA512:SHA256 -serverpref</span></div>
<div class="">#openssl s_client -connect localhost:443 -cert client_cert.pem   -key client.key -state -cipher eNULL:aRSA:!SHA512:SHA256</div>
<span class=""></span><br class="">
How can I force TLS to use a SHA256 digest for DH?<br class="">
</div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">--<span class="Apple-converted-space"> </span></span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">openssl-users
 mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; float:none; display:inline!important">To
 unsubscribe:<span class="Apple-converted-space"> </span></span><a href="https://mta.openssl.org/mailman/listinfo/openssl-users" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://mta.openssl.org/mailman/listinfo/openssl-users</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>