diff options
author | Kenny Root <kroot@google.com> | 2014-11-17 12:32:25 -0800 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2014-11-17 12:40:18 -0800 |
commit | e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b (patch) | |
tree | 665e17c92927180ffa7d6b0b75482651389d9d37 | |
parent | 9a9c59af7f1003f6e35ce060482eefda40b380f1 (diff) | |
download | libcore-e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b.zip libcore-e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b.tar.gz libcore-e9795c29b377a5c5b51b87c4f2fcdbf7ae0cd83b.tar.bz2 |
SSLSocketTest: add error message test for fallback_scsv
The upgrade to OpenSSL 1.0.1j caused a regression for the error message
produced by inappropriate fallback protection mechanism. Add a test to
make sure this doesn't happen again.
(cherry picked from commit cce4d86d447d0e86f94035dd0285726c4025fae6)
Bug: 18018599
Change-Id: If8896d8f644095c13cbe44dd8ba7d4ef235385cf
-rw-r--r-- | luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java index 4681877..ff055b2 100644 --- a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java +++ b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java @@ -1667,6 +1667,10 @@ public class SSLSocketTest extends TestCase { server.startHandshake(); fail("Should result in inappropriate fallback"); } catch (SSLHandshakeException expected) { + Throwable cause = expected.getCause(); + assertEquals(SSLProtocolException.class, cause.getClass()); + assertTrue(cause.getMessage(), + cause.getMessage().contains("inappropriate fallback")); } return null; } @@ -1679,6 +1683,10 @@ public class SSLSocketTest extends TestCase { client.startHandshake(); fail("Should receive TLS alert inappropriate fallback"); } catch (SSLHandshakeException expected) { + Throwable cause = expected.getCause(); + assertEquals(SSLProtocolException.class, cause.getClass()); + assertTrue(cause.getMessage(), + cause.getMessage().contains("inappropriate fallback")); } return null; } |