Skip to content

Commit

Permalink
Proper fix for calculating encoded session-key length
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Oct 29, 2013
1 parent 6c729c4 commit 4203125
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/include/libradius.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ int rad_pwencode(char *encpw, size_t *len, char const *secret,
uint8_t const *vector);
int rad_pwdecode(char *encpw, size_t len, char const *secret,
uint8_t const *vector);

#define FR_TUNNEL_PW_ENC_LENGTH(_x) (2 + 1 + _x + PAD(_x + 1, AUTH_PASS_LEN))
int rad_tunnel_pwencode(char *encpw, size_t *len, char const *secret,
uint8_t const *vector);
int rad_tunnel_pwdecode(uint8_t *encpw, size_t *len,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_eap/types/rlm_eap_leap/eap_leap.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ leap_packet_t *eapleap_stage6(REQUEST *request, leap_packet_t *packet, VALUE_PAI
*/
fr_md5_calc(hash, buffer, 16 + 8 + 24 + 8 + 24);

q = talloc_array(vp, char, 64 + sizeof("leap:session-key="));
q = talloc_array(vp, char, FR_TUNNEL_PW_ENC_LENGTH(16) + sizeof("leap:session-key="));
strcpy(q, "leap:session-key=");

memcpy(q + 17, hash, 16);
Expand Down

0 comments on commit 4203125

Please sign in to comment.