summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2017-03-08 11:19:04 -0800
committerKenny Root <kroot@google.com>2017-03-09 11:36:09 -0800
commit039b20086fa05ea9b2fa10f508c20afab34663df (patch)
tree87e75f59e80a7454fe575ef81d608d3fcd8311c4
parent87b15f87f9e01e8e8d8350aa3fc74a08599ad6e8 (diff)
Update assertion in SSLEngineTest
Before this was receiving an SSLEngineStatus of BUFFER_OVERFLOW but the test was not checking it. Make sure the assertion for when 0 bytes are produced is checking NEED_WRAP. However, now Conscrypt eagerly wraps instead of needing two calls to .wrap(...) to actually start sending data. Amend the test to account for this possibility as well by asserting that NEED_UNWRAP is the status if more than 0 bytes were produced. Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a Change-Id: I7ff88005cffff479deb6c933d58ab2813ea69ea8
-rw-r--r--harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/SSLEngineTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/SSLEngineTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/SSLEngineTest.java
index f0b591b052..f8d2847cf7 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/SSLEngineTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/javax/net/ssl/SSLEngineTest.java
@@ -1013,7 +1013,11 @@ public class SSLEngineTest extends TestCase {
SSLEngineResult res = sse.wrap(bbA, bb);
assertEquals(0, res.bytesConsumed());
- assertEquals(0, res.bytesProduced());
+ if (res.bytesProduced() == 0) {
+ assertEquals(HandshakeStatus.NEED_WRAP, res.getHandshakeStatus());
+ } else {
+ assertEquals(HandshakeStatus.NEED_UNWRAP, res.getHandshakeStatus());
+ }
}
private SSLEngine getEngine() throws Exception {