Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit fb90125

Browse files
authored
Correctly map GENERIC to UNKNOWN when using BoringSSL (#816)
Motivation: BoringSSL returns GENERIC when using TLS1.3 but the JDK TrustManager implementation expect UNKNOWN. We need to map it the expected value as otherwise we will see failures. Modifications: Compare and adjust if needed Result: Correctly map auth method name
1 parent 878eb06 commit fb90125

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

codec-native-quic/src/main/c/netty_quic_boringssl.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#define STATICALLY_CLASSNAME "io/netty/incubator/codec/quic/BoringSSLNativeStaticallyReferencedJniMethods"
3535
#define CLASSNAME "io/netty/incubator/codec/quic/BoringSSL"
36-
36+
#define AUTH_UNKNOWN "UNKNOWN"
3737
#define ERR_LEN 256
3838

3939
// For encoding of keys see BoringSSLSessionTicketCallback.setSessionTicketKeys(...)
@@ -359,11 +359,17 @@ enum ssl_verify_result_t quic_SSL_cert_custom_verify(SSL* ssl, uint8_t *out_aler
359359
const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl);
360360
if (cipher == NULL) {
361361
// No cipher available so return UNKNOWN.
362-
authentication_method = "UNKNOWN";
362+
authentication_method = AUTH_UNKNOWN;
363363
} else {
364364
authentication_method = SSL_CIPHER_get_kx_name(cipher);
365365
if (authentication_method == NULL) {
366-
authentication_method = "UNKNOWN";
366+
authentication_method = AUTH_UNKNOWN;
367+
} else if (strcmp(authentication_method, "GENERIC") == 0) {
368+
// Only TLS 1.3 will report the kx name as generic.
369+
// Map this UNKNOWN, which will signal to Java to validate that
370+
// the certificate's keyUsage has at least the digitalSignature bit set.
371+
// (Per the SunJCE implementation).
372+
authentication_method = AUTH_UNKNOWN;
367373
}
368374
}
369375

0 commit comments

Comments
 (0)