summaryrefslogtreecommitdiff
path: root/radmsg.c
diff options
context:
space:
mode:
authorvenaas <venaas>2008-09-18 11:10:44 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-09-18 11:10:44 +0000
commite153afc401ccb9256385a0a3da10bf412d87fe1f (patch)
treec8396299971af9241c237b2d62ebcc945e376c77 /radmsg.c
parent4f7c11c9ea5795ac0dd32540e5045d3fc10f0a89 (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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/radmsg.c b/radmsg.c
index 422186d..0ea6ee7 100644
--- a/radmsg.c
+++ b/radmsg.c
@@ -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;
}