<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<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" 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; -webkit-text-stroke-width: 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;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Hello everyone,</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">i am having some issues understanding the RSA_sign function:</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></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 style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">As far as I know, the signing is a four step process:</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">- Calculate hash with digest algorithm <type> (given as argument to this function -> m)</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">- Encapsulate hash in a DigestInfo structure (X509_SIG)</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">- Structure padding (in RSA_private_encrypt)</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">- Private key operation on this padded structure<span class="Apple-converted-space"> </span><span class="">(in RSA_private_encrypt)</span><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Is that correct?</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">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 id="ms-rterangepaste-start" class=""></span><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 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br 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; -webkit-text-stroke-width: 0px;" class="">
<span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">openssl-users
 mailing list</span><br 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; -webkit-text-stroke-width: 0px;" class="">
<span 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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">To
 unsubscribe:<span class="Apple-converted-space"> </span></span><a href="https://mta.openssl.org/mailman/listinfo/openssl-users" 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; -webkit-text-stroke-width: 0px;" class="">https://mta.openssl.org/mailman/listinfo/openssl-users</a></div>
</blockquote>
</div>
<br class="">
</body>
</html>