Repository navigation
openssl: map Android 14 keylog labels by endpoint role - #1106
Conversation
The fallback needs the server-role field to distinguish client and server application secrets. Android 14 omitted that confirmed field offset.
📄 Knowledge review✏️ Suggested updates1 page suggestion needs review.
|
There was a problem hiding this comment.
🔵 Needs a closer look
Maintainer review is needed because the ABI offset controlling TLS secret labels was validated only on Linux x86-64, leaving Android/arm64 layout compatibility and the required non-CO-RE build unverified.
No open issues 🎉
What changed in this PR
Fixes swapped client/server application-secret labels in the Android 14 BoringSSL SSL_do_handshake fallback by enabling the existing endpoint-role mapping.
Changes:
- Defines the Android 14 server-role bit offset as
0xa4, without introducing a new extraction path. - Adds an offset regression test for Android 14, with Android 17 as a control.
| File | Description |
|---|---|
test/offsets/boringssl_offsets_test.go |
Checks that Android 14 and 17 define the expected endpoint-role offset. |
kern/boringssl_a_14_kern.c |
Adds the role offset used to select the correct application-secret labels. |
Review effort: Balanced
|
Follow-up validation for
This supplies the missing build evidence and an Android x86-64 runtime check. The AArch64 disassembly checks this Debian library's role offset; Android arm64 runtime validation remains untested. These CI runs use kernel eBPF and do not extend the separate rootless bpftime acceptance claim. |
Use the offsets generated from each Android release so the TLS 1.3 handshake fallback labels application secrets by endpoint role on Android 15 and 16. Refresh Android 14 from the same generator and cover the two additional versions in the existing offset regression.
Keep the Android 15 offsets explicit so the only change to its original header is the endpoint role used to label application secrets.
Problem
The Android 14 BoringSSL header omits
BSSL__SSL_ST_SERVER. The sharedSSL_do_handshakefallback therefore takes its historical server mapping for both endpoint roles. On a client, the emittedCLIENT_TRAFFIC_SECRET_0carries the server application secret andSERVER_TRAFFIC_SECRET_0the client application secret. The exporter is unaffected.Change
Supply the server-role bit offset (
0xa4) in the Android 14 header so the existing role-aware mapping is used. No new extraction path.The Android 14 BoringSSL x86-64 build packaged by Debian (
android-libboringssl14.0.0+r45-2,libssl.so.0SHA256b86b018e…) implementsSSL_is_serverasmovzbl 0xa4(%rdi),%eax; and $0x1,%eax, bit zero at that offset. The Android 17 header already uses the same role field.Validation
go test -race -count=1 ./test/offsets/passes.make build_core) of master9c00018and this branch,tls -m keylog --ssl_version boringssl_a_14against that library, which carries no.gnu_debugdata, so the fallback is used. The TLS 1.3 client logs its reference keys withSSL_CTX_set_keylog_callback:Remaining limitation
The
SSL_do_handshakefallback still emits no handshake-secret records: the client's own log has five records, this path three. That is a property of the fallback hook; #1107 lets libraries with symbols use the label-based hook, which reports all five.