diff options
author | venaas <venaas> | 2008-09-18 11:10:44 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-09-18 11:10:44 +0000 |
commit | e153afc401ccb9256385a0a3da10bf412d87fe1f (patch) | |
tree | c8396299971af9241c237b2d62ebcc945e376c77 /radmsg.c | |
parent | 4f7c11c9ea5795ac0dd32540e5045d3fc10f0a89 (diff) |
fixed some bugs, improved duplicate detection
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@391 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radmsg.c')
-rw-r--r-- | radmsg.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -225,9 +225,13 @@ uint8_t *radmsg2buf(struct radmsg *msg, uint8_t *secret) { free(buf); return NULL; } - if (secret && (msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject || msg->code == RAD_Access_Challenge || msg->code == RAD_Accounting_Response || msg->code == RAD_Accounting_Request) && !_radsign(buf, secret)) { - free(buf); - return NULL; + if (secret) { + if ((msg->code == RAD_Access_Accept || msg->code == RAD_Access_Reject || msg->code == RAD_Access_Challenge || msg->code == RAD_Accounting_Response || msg->code == RAD_Accounting_Request) && !_radsign(buf, secret)) { + free(buf); + return NULL; + } + if (msg->code == RAD_Accounting_Request) + memcpy(msg->auth, buf + 4, 16); } return buf; } |