Alan T. DeKok [Tue, 4 Aug 2026 15:00:26 +0000 (11:00 -0400)]
set packet->socket->af to AF_FR_VIRTUAL_SERVER on subrequest alloc
and use that in unlang_interpret_virtual_server().
When used with frame->prev.frame_call, it should significantly
shorten process to find the virtual server. Instead of walking
back up all parent requests, and then walking back up the stack
for each request, it becomes largely an O(1) process most of
the time.
process/eap_psk: find Password.PSK with the nested pair search
Password.PSK is a child of the Password container pair, so the
top-level fr_pair_find_by_da() never saw the pair policy had just
added, and every authentication was discarded with "No
control.Password.PSK". The old module used password_find(), which
walks the tree.
process/eap_psk: initialise the analyzer-flagged test outputs
The static analyzer does not model acutest_check_()'s return value
(variadic, so never inlined), so TEST_ASSERT on the producing calls
did not remove the garbage-value path. Initialise the two outputs;
if a producing call ever fails to write, the comparison against the
known-answer value still fails.
EAP-PSK now requires the eap-psk virtual server, which is not enabled
by default, so an installed system failed config validation. Comment
out the type entries and psk sections in the eap and eap_inner
modules; the enable instructions point at sites-available/eap-psk.
The eap_inner psk section also still set the removed 'identity'
config item; the commented-out replacement uses virtual_server.
The supplicant authenticates with the wrong pre-shared key, so MAC_P
verification fails and eapol_test must not succeed, while the server
must survive the exchange.
process/eap_psk: use TEST_ASSERT for the calls which produce compared values
The static analyzer follows the error return of the crypto functions,
where the out-parameters are never written, into the comparisons, and
reports garbage-value reads. Aborting the test when a producing call
fails removes the path, and comparing an output whose producing call
failed was never informative.
process/eap_psk: keep the module target out of the all.mk that lists SUBMAKEFILES
boiler.mk generates the install rule for a fragment's target after
recursing into its SUBMAKEFILES, so the TGT_INSTALLDIR := set by
eap_psk_tests.mk leaked into the install rule for process_eap_psk,
and the module was built but never installed. Same mechanism CI
diagnosed on d5e3f21e3b for rlm_eap_psk before the module moved.
Follow the existing convention: the all.mk lists only SUBMAKEFILES,
and the module target lives in its own fragment.
rlm_eap_psk: select the PSK by peer identity via an eap-psk virtual server
Implement full RFC 4764 credential-selection semantics: the peer's
asserted identity (ID_P) drives the PSK lookup, in a virtual server
with per-message policy sections, mirroring the EAP-AKA architecture.
The protocol state machine, message parsing, and cryptography move to
a new eap_psk process module. The rlm_eap_psk submodule shrinks to
deriving the next Packet-Type from the session state, pushing the
request into the virtual server, and translating the reply Packet-Type
back into an EAP result. Nothing happens in the outer server.
Sections: send Identity-Request (may override Server-Identity, same
pattern as EAP-AKA' network_name), recv Identity-Response (supplies
control.Password.PSK for the asserted Identity, capped at the RFC's
966 bytes), send Result-Indication, recv Result-Acknowledgement, and
send Success / send Failure.
Invalid messages are not processed (RFC 4764 Section 4.1); as a true
silent discard cannot be expressed through the EAP module, the session
ends with an EAP-Failure like every other EAP method.
rlm_eap_psk: add known-answer tests for the EAP-PSK crypto primitives
RFC 4764 publishes no test vectors, so the CMAC core is checked
against the RFC 4493 Section 4 vectors, and the EAP-PSK derivations
and EAX protected channel are checked against values computed with
hostap's independent implementation (commit f541de4). Negative tests
cover tag, ciphertext, nonce, and header tampering.
tls/bio: detach both dbuffs from the shared buffer in one helper
The in/out dbuffs are bound to the same talloc buffer. finalise,
finalise_bstr, and thread_local_clear each hand-rolled clearing the
buff pointers; a single helper now enforces the invariant that both
dbuffs forget the buffer together.
Alan T. DeKok [Mon, 3 Aug 2026 00:00:52 +0000 (20:00 -0400)]
add stack short-cuts for break, continue, return, and load-balance
so that we don't have to walk back up the stack to find them.
Instead, we can just examine the current stack frame to see where
those frames are.
For now. we just set the return frames and assert that their values
are correct. We do not (as yet) skip the loop over the frames,
to just find the correct frame.
During connection establishement, MariaDB Connector/C can close the fd
and potentially open a new one without any callbacks to notify of that
happening.
If we have events registered for the fd that has now been closed,
potentially events fire for that fd when it has been re-used for a
different purpose.
Using dup() to create our own fd for the socket, we remain in control of
the fd which has registered events.