<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style><style type="text/css"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I have to do some testing tomorrow and I'll post my results and a packet capture .. N<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF850230" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>From:</b> openssl-users [openssl-users-bounces@openssl.org] on behalf of Jayalakshmi bhat [bhat.jayalakshmi@gmail.com]<br>
<b>Sent:</b> December 6, 2015 9:18 PM<br>
<b>To:</b> openssl-users@openssl.org<br>
<b>Subject:</b> Re: [openssl-users] CBC ciphers + TLS 1.0 protocol does not work in OpenSSL 1.0.2d<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi All,
<div><br>
</div>
<div>Is there inputs or suggestions.</div>
<div><br>
</div>
<div>Thanks and Regards</div>
<div>Jaya</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Dec 4, 2015 at 11:37 AM, Jayalakshmi bhat <span dir="ltr">
<<a href="mailto:bhat.jayalakshmi@gmail.com" target="_blank">bhat.jayalakshmi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr"><span style="font-size:12.8px">Hi Matt,</span><span>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px"><br>
</span></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px">s3_cbc.c uses the function constant_time_eq_8. I pulled only this function definition from OpenSSL 1.0.1e </span></font><span style="font-family:Arial,sans-serif; font-size:13.3333px">into
 OpenSSL 1.0.2d. I renamed this function as </span><span style="font-family:Arial,sans-serif; font-size:13.3333px">constant_time_eq_8_local and used it in s3_cbc.c instead of </span><span style="font-family:Arial,sans-serif; font-size:13.3333px">constant_time_eq_8</span><font face="Arial, sans-serif"><span style="font-size:13.3333px">.
 This renaming was just to avoid multiple definitions. </span></font></div>
<div><span style="font-family:Arial,sans-serif; font-size:13.3333px"><br>
</span></div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px">OpenSSL 1.0.1e has the function </span><span style="font-family:Arial,sans-serif; font-size:13.3333px">constant_time_eq_8 </span><span style="font-family:Arial,sans-serif; font-size:13.3333px">defined
 as below: </span></div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px"><b><br>
</b></span></div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px"><b>
<div style="font-size:12.8px">#define DUPLICATE_MSB_TO_ALL(x) ( (unsigned)( (int)(x) >> (sizeof(int)*8-1) ) )</div>
<div style="font-size:12.8px">#define DUPLICATE_MSB_TO_ALL_8(x) ((unsigned char)(DUPLICATE_MSB_TO_ALL(x)))</div>
</b></span></div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px"><b><br>
</b></span></div>
<div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><b>static unsigned char constant_time_eq_8(unsigned a, unsigned b)</b></span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><b><span style="white-space:pre-wrap"></span>{</b></span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><b><span style="white-space:pre-wrap"></span>unsigned c = a ^ b;</b></span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><b><span style="white-space:pre-wrap"></span>c--;</b></span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><b><span style="white-space:pre-wrap"></span>return DUPLICATE_MSB_TO_ALL_8(c);</b></span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><b><span style="white-space:pre-wrap"></span>}</b></span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><br>
</span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px">OpenSSL 1.0.2d has the function </span></font><span style="font-family:Arial,sans-serif; font-size:13.3333px">constant_time_eq_8 </span><span style="font-size:13.3333px; font-family:Arial,sans-serif">defined
 as below.</span></div>
<div><span style="font-size:13.3333px; font-family:Arial,sans-serif"><br>
</span></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px">
<div>static inline unsigned int constant_time_msb(unsigned int a)</div>
<div>{</div>
<div>    return 0 - (a >> (sizeof(a) * 8 - 1));</div>
<div>}</div>
</span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><br>
</span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px">
<div>static inline unsigned int constant_time_is_zero(unsigned int a)</div>
<div>{</div>
<div>    return constant_time_msb(~a & (a - 1));</div>
<div>}</div>
</span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px"><br>
</span></font></div>
<div><font face="Arial, sans-serif"><span style="font-size:13.3333px">
<div>static inline unsigned int constant_time_eq(unsigned int a, unsigned int b)</div>
<div>{</div>
<div>    return constant_time_is_zero(a ^ b);</div>
<div>}</div>
<div><br>
</div>
<div>static inline unsigned char constant_time_eq_8(unsigned int a, unsigned int b)</div>
<div>{</div>
<div>    return (unsigned char)(constant_time_eq(a, b));</div>
<div>}</div>
</span></font></div>
</div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px"><br>
</span></div>
</span>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px"><br>
</span></div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px">Regards</span></div>
<div style="font-size:12.8px"><span style="font-family:Arial,sans-serif; font-size:13.3333px">Jaya</span></div>
</div>
<div class="HOEnZb">
<div class="h5">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Dec 4, 2015 at 7:04 PM, Matt Caswell <span dir="ltr">
<<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<span><br>
<br>
On 04/12/15 11:31, Jayalakshmi bhat wrote:<br>
> Hi Matt,<br>
><br>
> Thanks a lot for the response.<br>
><br>
> Is your application a client or a server? Are both ends using<br>
> OpenSSL 1.0.2d? If not, what is the other end using?<br>
>>>Our device has both TLS client,server apps. As client, device communicates with radius server, LDAP server etc.As<br>
> server device is accessed using various web browsers.<br>
> Hence both the end will not be OpenSSL 1.0.2d.<br>
><br>
> How exactly are you doing that? Which specific cipher are you seeing fail?<br>
>>> We have provided user option to select TLS protocol versions similar to the browsers. Depending upon the user configurations we set the protocol flags (SSL_OP_NO_TLSv1,SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2) in the SSL context using SSL_CTX_clear_options/SSL_CTX_set_options.<br>
>>> We have provided user option to chose ciphers as well.<br>
> All these are in the application space,no changes have been done and<br>
> they have been working good with OpenSSL 1.0.1c. Only the library is<br>
> upgraded to OpenSSL 1.0.2d.I have used AES256-CBC and AES128 CBC ciphers<br>
> and with both the ciphers issue is seen.<br>
><br>
> Are you able to provide a packet capture?<br>
>>> Please find the attached traces for server mode.<br>
> What O/S is this on?<br>
>>>This is built for WinCE and Vxworks<br>
<br>
</span>Thanks. Please could you also send the exact patch that you applied that<br>
resolved the issue?<br>
<div>
<div><br>
Matt<br>
_______________________________________________<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">
https://mta.openssl.org/mailman/listinfo/openssl-users</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>