b/2522132 Native crash in sslRead()

Summary:
- the small_records.patch finished code review today, importing final version
- the native crash reflected an underling openssl issue, so we have a new patch for this

Details:

    Adding new patch for b/2522132 crash
	patches/bad_version.patch

    Syncing small_records.patch with reviewed version
	patches/small_records.patch

    Adding new patch to the list of active patches
	openssl.config

    Adding description of the new bad_version.patch
	patches/README

    Minor test script changes
    - Added adb remount
    - Simplified /mnt/sdcard to /sdcard
	patches/testssl.sh

    Added trace message as each patch is applied so I could more
    easily confirm that the newly added bad_version.patch was applied.
	import_openssl.sh

    Automatically generated files:
	android.testssl/testssl.sh
	ssl/d1_pkt.c
	ssl/s3_both.c
	ssl/s3_pkt.c

Change-Id: I1ca1b69d612ef425203074c58c031d6a681b92fe
diff --git a/ssl/s3_both.c b/ssl/s3_both.c
index 3f22bfd..73f6002 100644
--- a/ssl/s3_both.c
+++ b/ssl/s3_both.c
@@ -625,9 +625,9 @@
 	size_t len;
 
 	if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER)
-		headerlen = DTLS1_RT_HEADER_LENGTH + 256; /* extra space for empty fragment */
+		headerlen = DTLS1_RT_HEADER_LENGTH;
 	else
-		headerlen = SSL3_RT_DEFAULT_WRITE_OVERHEAD;
+		headerlen = SSL3_RT_HEADER_LENGTH;
 
 	if (s->s3->rbuf.buf == NULL)
 		{
@@ -659,7 +659,9 @@
 			{
 			len = SSL3_RT_MAX_PACKET_SIZE;
 			}
-		len += headerlen;
+		len += SSL3_RT_DEFAULT_WRITE_OVERHEAD; /* extra space for empty
+                                                          fragment, header, MAC
+                                                          and padding */
 		if ((p=OPENSSL_malloc(len)) == NULL)
 			goto err;
 		s->s3->wbuf.buf = p;