Skip to content

Commit 0b033db

Browse files
committed
implemented additional changes requested in the pr
1 parent c54c80c commit 0b033db

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

common/src/jni/main/cpp/conscrypt/native_crypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11869,7 +11869,7 @@ static jbyteArray NativeCrypto_SSL_get0_ech_retry_configs(JNIEnv* env, jclass, j
1186911869
}
1187011870
env->SetByteArrayRegion(result, 0, static_cast<jsize>(retry_configs_len),
1187111871
reinterpret_cast<const jbyte*>(retry_configs));
11872-
JNI_TRACE("ssl=%p NativeCrypto_SSL_get0_ech_retry_configs(%p) => %p", ssl, ssl, result);
11872+
JNI_TRACE("ssl=%p NativeCrypto_SSL_get0_ech_retry_configs() => %p", ssl, result);
1187311873
return result;
1187411874
}
1187511875

openjdk/src/test/java/org/conscrypt/NativeCryptoTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,6 @@ public long beforeHandshake(long c) throws SSLException {
524524
@Override
525525
public void afterHandshake(long session, long ssl, long context, Socket socket,
526526
FileDescriptor fd, SSLHandshakeCallbacks callback) throws Exception {
527-
assertFalse(NativeCrypto.SSL_ech_accepted(ssl, null));
528-
assertNull(NativeCrypto.SSL_get0_ech_name_override(ssl, null));
529527
byte[] retryConfigs = NativeCrypto.SSL_get0_ech_retry_configs(ssl, null);
530528
assertEquals(5, retryConfigs.length); // should be the invalid ECH Config List
531529
super.afterHandshake(session, ssl, context, socket, fd, callback);
@@ -748,12 +746,19 @@ public void test_SSL_set_enable_ech_grease() throws Exception {
748746
}
749747

750748
@Test
751-
public void test_SSL_set1_ech_config_list() throws Exception {
749+
public void test_SSL_set1_ech_valid_config_list() throws Exception {
752750
long c = NativeCrypto.SSL_CTX_new();
753751
long s = NativeCrypto.SSL_new(c, null);
754752

755753
final byte[] configList = readTestFile("boringssl-ech-config-list.bin");
756754
assertTrue(NativeCrypto.SSL_set1_ech_config_list(s, null, configList));
755+
}
756+
757+
@Test
758+
public void test_SSL_set1_ech_invalid_config_list() throws Exception {
759+
long c = NativeCrypto.SSL_CTX_new();
760+
long s = NativeCrypto.SSL_new(c, null);
761+
757762
byte[] badConfigList = {
758763
0x00, 0x05, (byte) 0xfe, 0x0d, (byte) 0xff, (byte) 0xff, (byte) 0xff
759764
};

0 commit comments

Comments
 (0)