[package] cyassl: add a patch to better check legacy SSLv2 client hello records
[openwrt/svn-archive/archive.git] / package / libs / cyassl / patches / 200-SSL_accept-handle-hello-garbage.patch
1 --- a/src/cyassl_int.c
2 +++ b/src/cyassl_int.c
3 @@ -1588,6 +1588,10 @@
4 b1 =
5 ssl->buffers.inputBuffer.buffer[ssl->buffers.inputBuffer.idx++];
6 ssl->curSize = ((b0 & 0x7f) << 8) | b1;
7 +
8 + /* does not appear to a be a SSLv2 client hello */
9 + if ( ssl->buffers.inputBuffer.buffer[ssl->buffers.inputBuffer.idx] != 1 )
10 + return UNKNOWN_HANDSHAKE_TYPE;
11 }
12 else {
13 ssl->options.processReply = getRecordLayerHeader;