summaryrefslogtreecommitdiff
path: root/test/cmake/nx_secure/coverage.sh
AgeCommit message (Collapse)Author
2026-08-13Stopped the TLS 1.3 server sending an unusable NewSessionTicket (#403)Edouard Malot
* Fix TLS 1.3 server: don't send NewSessionTicket (resumption is unsupported) _nx_secure_tls_1_3_server_handshake.c sent a NewSessionTicket after every Client Finished, advertising session resumption to the client. But _nx_secure_tls_process_clienthello_psk_extension explicitly rejects any PSK with age != 0 (i.e. every real resumption attempt) with NX_SECURE_TLS_BAD_CLIENTHELLO_PSK_EXTENSION — the existing implementation only supports external PSKs. Net effect on clients that act on the advertised ticket (Java JSSE in particular): every other handshake fails. Conn N succeeds + caches the ticket; conn N+1 replays the ticket → server sends Alert(internal_error) → JSSE invalidates the cache; conn N+2 succeeds; loop. Fix: skip the NewSessionTicket send. The PSK consumer code stays as-is so any future external-PSK use case is unaffected. * Trim the source comment left by the NewSessionTicket removal The comment that replaced the removed block ended up carrying the whole incident story: the JSSE trigger, the alert path, why the stub was harmful. That belongs in the commit that made the change, not in a comment future readers will hit out of context. Keep only what the code is now. No ticket is sent because resumption is not implemented. RFC 8446 §4.6.1 makes the message optional. The PSK extension handler is the place resumption would also need to change. * Document why send_newsessionticket is now uncalled After the previous fix, this function has no callers in the library. That is deliberate: it stays as a starting point for real TLS 1.3 session resumption when someone gets to it. Without a note, the next dead-code sweep will find an unreferenced global and reasonably propose deleting it. Add a NOTE in the header block spelling out three things. The function is kept on purpose, not by accident. The ticket it builds is a placeholder — no server state, fixed identity string — so it cannot be used as is. And the reasoning for not calling it lives in the server handshake, with the RFC 8446 pointer for the fact that the message is optional. CALLED BY is updated to match. * Exclude send_newsessionticket from coverage reports The previous fix left this file with no callers. Under any coverage config that compiles TLS 1.3 — tls_1_3_enable_build_coverage and sesip_build_coverage — it now reports 0% across the board. CI does not enforce a threshold, so nothing fails, but the project aims for 100% and a file going to zero is not the shape we want. Add a small common exclude list, applied to every coverage run, containing just this file. The reason it is dead is documented in its own header block, and referencing that keeps the two pieces of information in sync. The default_build_coverage block is unchanged. * Add regression test asserting no NewSessionTicket after handshake Locks in the previous fix. The test completes a full TLS 1.3 handshake between a NetX client and a NetX server, gives the server one periodic tick to flush anything queued after client Finished, then peeks the client's raw TCP receive queue with NX_NO_WAIT. In the fixed server nothing arrives. In the pre-fix server the stub NewSessionTicket record lands there and the peek returns NX_SUCCESS instead of NX_NO_PACKET. The peek runs on the raw socket rather than through nx_secure_tls_session_receive, because the TLS layer would consume a post-handshake NewSessionTicket silently and we could not tell the difference. A semaphore holds the server side open until the client has done its check, so the server's close_notify does not pollute the peek. The half of the maintainer's ask that needs a crafted PSK-carrying ClientHello is left for the PSK-handler follow-up, per the review.
2026-06-06Added copyright headers to files missing themFrédéric Desbiens
Applied the standard MIT license header to all project-owned C, header, assembly, shell, and Python files that were missing a copyright notice. Third-party, toolchain startup, and auto-generated files were excluded. Co-authored-by: Copilot <[email protected]>
2023-12-14Add secure and crypto regression test. (#218)Wenhui Xie