eap
EAP byte-packing helpers shared by sync and async RADIUS clients.
Currently covers the EAP-MD5 challenge/response flow defined in
RFC 3748 ยง5.4. The helpers operate on raw bytes so they can be
called from both the synchronous Client and the asyncio
ClientAsync without dragging packet objects through the helper.
build_eap_identity(password)
Build an EAP-Identity Response payload from a password.
Matches the sync client's historic behaviour: the EAP identifier is
taken from the module-level packet.CURRENT_ID rolling counter.
Source code in pyrad2/eap.py
build_eap_md5_challenge(eap_id, password, eap_md5)
Build an EAP-Type-MD5-Challenge response payload.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eap_id
|
int
|
EAP identifier copied from the Access-Challenge. |
required |
password
|
bytes
|
User password (used as the MD5 secret). |
required |
eap_md5
|
bytes
|
Raw EAP-MD5 attribute payload from the challenge, starting with the length-prefix byte the server sent. |
required |
Source code in pyrad2/eap.py
password_from_packet(pkt)
Extract the user password from an AuthPacket for EAP framing.
inject_eap_identity(pkt)
apply_eap_md5_challenge(pkt, reply)
Mutate pkt in place to answer an EAP-MD5 Access-Challenge.