Hi Matt, I created a Pull request for the second change on master, 1.0.2 and 1.1.0. I am creating PR in github for the first time, so if anything else I missed please update me.
https://github.com/openssl/openssl/pull/3124 https://github.com/openssl/openssl/pull/3123 https://github.com/openssl/openssl/pull/3122 Regards, Ashok Raja Ashok V K Huawei Technologies Bangalore, India http://www.huawei.com 本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁 止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中 的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件! This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! -----Original Message----- From: openssl-dev [mailto:openssl-dev-boun...@openssl.org] On Behalf Of Matt Caswell Sent: 03 April 2017 14:40 To: openssl-dev@openssl.org Subject: Re: [openssl-dev] In ssl3_write_bytes, some checks related to hanlding write failure are missing On 31/03/17 18:54, Raja ashok wrote: > Hi All, > > > > In ssl3_write_bytes, if (len < tot) we are returning failure with > SSL_R_BAD_LENGTH error. In this place I hope we should set “tot” back > to “s->s3->wnum”. Otherwise when application calls back SSL_write with > correct buffer, it causes serious problem (“tot” is 0 and iLeft is not > NULL). I hope we should do like below. > > > > if (len < tot) { > > s->s3->wnum = tot; > > SSLerr(SSL_F_SSL3_WRITE_BYTES, SSL_R_BAD_LENGTH); > > return (-1); > > } This is 1.0.2 code. The check appears to be earlier in master/1.1.0 (before wnum is reset) and so this isn't an issue there. Really, if an application passes a bad len value, then this is an application bug and shouldn't ever happen in a well-behaved application. I'm not sure you could really describe this as an OpenSSL bug (its a bit border line) so I'm not sure it justifies a patch to 1.0.2 (which only takes bug fixes). > > And also we should do one additional check for “len” as mentioned in > my previous mail. > > > > if ((len < tot) || ((tot != 0) && (len < (tot + > s->s3->wpend_tot)))){ > > s->s3->wnum = tot; > > SSLerr(SSL_F_SSL3_WRITE_BYTES, SSL_R_BAD_LENGTH); > > return (-1); > > } Please could you raise a github pull request for this suggestion? You will probably need two versions: one targeting master and one targeting 1.0.2 as the the code looks a little different in this area. Matt -- openssl-dev mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev -- openssl-dev mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev