Merge tag 'android-4.3_r2.1' into cm-10.2

Android 4.3 release 2.1
Merge tag 'android-4.4_r1' into cm-11.0

Android 4.4 Release 1.0
Add heartbeat extension bounds check.

A missing bounds check in the handling of the TLS heartbeat extension
can be used to reveal up to 64k of memory to a connected client or
server.

Thanks for Neel Mehta of Google Security for discovering this bug and to
Adam Langley <agl@chromium.org> and Bodo Moeller <bmoeller@acm.org> for
preparing the fix (CVE-2014-0160)

Change-Id: I177a2d47857a6747d9462f868e4292ff347d6f82
Fix CVE-2014-3470

Check session_cert is not NULL before dereferencing it.
(cherry picked from commit 8011cd56e39a433b1837465259a9bd24a38727fb)

Change-Id: If19c9037d3fb086bb913704e5e440ec7bc6e1e22
Fix CVE-2014-0221

Unnecessary recursion when receiving a DTLS hello request can be used to
crash a DTLS client. Fixed by handling DTLS hello request without recursion.

Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
(cherry picked from commit d3152655d5319ce883c8e3ac4b99f8de4c59d846)

Change-Id: I88ea85e2f3e166bc9eba1fef2127e1e0bb8c13c2
Additional CVE-2014-0224 protection.

Return a fatal error if an attempt is made to use a zero length
master secret.
(cherry picked from commit 006cd7083f76ed5cb0d9a914857e9231ef1bc317)

Change-Id: Ib8febeb063915563b86cee741bfea0125248abbd
Fix for CVE-2014-0224

Only accept change cipher spec when it is expected instead of at any
time. This prevents premature setting of session keys before the master
secret is determined which an attacker could use as a MITM attack.

Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for reporting this issue
and providing the initial fix this patch is based on.
(cherry picked from commit bc8923b1ec9c467755cd86f7848c50ee8812e441)

Conflicts:
	ssl/s3_srvr.c

Change-Id: I259216c5859b8c3a21bf9cf345d465a7ec905ce7
Fix for CVE-2014-0195

A buffer overrun attack can be triggered by sending invalid DTLS fragments
to an OpenSSL DTLS client or server. This is potentially exploitable to
run arbitrary code on a vulnerable client or server.

Fixed by adding consistency check for DTLS fragments.

Thanks to Jüri Aedla for reporting this issue.
(cherry picked from commit 1632ef744872edc2aa2a53d487d3e79c965a4ad3)

Change-Id: Ie0b8939a71a6772616822df643f2168954b991ad
Merge tag 'android-4.4.4_r1' into HEAD

Android 4.4.4 Release 1

Change-Id: Ic9cc24af8c3b38bca4d44235245888a4761e144e