Commit Graph

15 Commits

Author SHA1 Message Date
Tobias Brunner 73cbce6013 libradius: Pad received MSK to at least 64 bytes
According to RFC 3748 MSKs must be at least 64 bytes, however, that's
not the case for the MSK derived via EAP-MSCHAPv2.  The two key parts
received are only 16 bytes each (derived according to RFC 3079,
section 3.3), so we end up with an MSK of only 32 bytes. The eap-mschapv2
plugin, on the other hand, pads these two parts with 32 zeros.

Interestingly, this is not a problem in many cases as the SHA1/2 based
PRFs used later use a block size that's >= 64 bytes, so the shorter MSK
is just padded with zeros then.  However, with AES-XCBC-PRF-128, for
instance, which uses a block size of 16 bytes, the different MSKs are an
issue as XCBC is applied to both to shorten them, with different results.
This eventually causes the authentication to fail if the client uses a
zero-padded MSK produced by the eap-mschapv2 plugin and the server the 32
byte MSK received via RADIUS.
2018-02-09 10:44:52 +01:00
Andreas Steffen b12c53ce77 Use standard unsigned integer types 2016-03-24 18:52:48 +01:00
Thom Troy ac36ede93c eap-radius: Add ability to configure RADIUS retransmission behavior
Closes strongswan/strongswan#19.
2015-11-17 14:25:08 +01:00
Tobias Brunner d079f6a4f7 libradius: Verify message ID of RADIUS responses
If we sent retransmits for a message and didn't receive a response it might
still arrive later.  Such a message will be queued on the socket.  The next
read will then return not the expected response but the one for the earlier
request.  For this message the verification will fail and the message gets
discarded.  But with the earlier code the actual response was never received.
Instead, a subsequent request resulted in the same failure and so on.

Fixes #838.
2015-05-21 14:30:11 +02:00
Martin Willi 1abaff6a3c libradius: Use poll(2) to wait for RADIUS responses 2014-11-21 11:16:48 +01:00
Martin Willi 15483a6223 libradius: refactor generic RADIUS en-/decryption function to a message method 2013-07-29 09:00:48 +02:00
Tobias Brunner f05b427265 Moved debug.[ch] to utils folder 2012-10-24 16:00:51 +02:00
Martin Willi 8bd6a30af1 Add a return value to hasher_t.get_hash() 2012-07-16 14:55:06 +02:00
Martin Willi 2d56575d52 Add a return value to signer_t.set_key() 2012-07-16 14:53:33 +02:00
Martin Willi 5fb719e0de Add a return value to radius_message_t.sign() 2012-07-16 14:53:33 +02:00
Andreas Steffen 6fd612913e implemented MS_MPPE encryption 2012-03-13 23:26:15 +01:00
Andreas Steffen 5fdb849293 use predefined Microsoft PEN 2012-03-13 19:23:35 +01:00
Andreas Steffen b3ec652192 added msg_auth flag in radius_message_t sign() method 2012-03-13 16:27:17 +01:00
Andreas Steffen 4fc6c7d442 allow debug of raw RADIUS data 2012-03-13 16:27:17 +01:00
Martin Willi f0f94e2ce6 Moved generic RADIUS protocol support to a dedicated libradius 2012-03-05 18:08:04 +01:00