38 RCSID(
"$Id: 79af590918024558d0fd3814c02fae534c68a517 $")
45 #include <freeradius-devel/md5.h>
54 unsigned short name_len;
68 ERROR(
"rlm_eap_md5: corrupted data");
73 if (!packet)
return NULL;
101 if (!packet->
value) {
113 packet->
name = talloc_array(packet,
char, name_len + 1);
120 packet->
name[name_len] = 0;
142 ERROR(
"rlm_eap_md5: Expected 16 bytes of response to challenge, got %d", packet->
value_size);
154 memcpy(ptr, password->vp_strvalue, password->vp_length);
155 ptr += password->vp_length;
156 len += password->vp_length;
183 unsigned short name_len;
189 if (reply->
code < 3) {
214 if (name_len && reply->
name) {
216 memcpy(ptr, reply->
name, name_len);
void fr_md5_calc(uint8_t *out, uint8_t const *in, size_t inlen)
Calculate the MD5 hash of the contents of a buffer.
int eapmd5_verify(MD5_PACKET *packet, VALUE_PAIR *password, uint8_t *challenge)
eap_packet_t * request
Packet we will send to the peer.
MD5_PACKET * eapmd5_extract(eap_round_t *eap_round)
Stores an attribute, a value and various bits of other data.
Contains a pair of request and response packets.
int fr_radius_digest_cmp(uint8_t const *a, uint8_t const *b, size_t length)
Do a comparison of two authentication digests by comparing the FULL digest.
#define MD5_CHALLENGE_LEN
int eapmd5_compose(eap_round_t *eap_round, MD5_PACKET *reply)
eap_packet_t * response
Packet we received from the peer.