summaryrefslogtreecommitdiff
path: root/accel-pptpd/radius/auth.c
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-09-14 15:56:31 +0400
committerKozlov Dmitry <dima@server>2010-09-14 16:05:10 +0400
commitd860a4beaf5f99d5045d03b931b4829426a2f7b0 (patch)
tree377f0cf851020786f5e40f70644a3dafbc63ce14 /accel-pptpd/radius/auth.c
parenta670641cc3c420bfd9026d3711501663aef88287 (diff)
downloadaccel-ppp-xebd-d860a4beaf5f99d5045d03b931b4829426a2f7b0.tar.gz
accel-ppp-xebd-d860a4beaf5f99d5045d03b931b4829426a2f7b0.zip
extra: implemented module 'pppd_compat' which starts pppd compatible scripts ip-up, ip-down,
and newly introduced - ip-change, when radius CoA request received, also this module manages pppd compatible radattr.pppX files core: implemented module 'sigchld' which handles SIGCHLD signal, waits child processes to terminate and manages pid terminate handlers
Diffstat (limited to 'accel-pptpd/radius/auth.c')
-rw-r--r--accel-pptpd/radius/auth.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/accel-pptpd/radius/auth.c b/accel-pptpd/radius/auth.c
index 29c6efd..92406b3 100644
--- a/accel-pptpd/radius/auth.c
+++ b/accel-pptpd/radius/auth.c
@@ -2,10 +2,12 @@
#include <string.h>
#include <openssl/md5.h>
+#include "triton.h"
+#include "events.h"
#include "log.h"
#include "pwdb.h"
-#include "radius.h"
+#include "radius_p.h"
static uint8_t* encrypt_password(const char *passwd, const char *secret, const uint8_t *RA, int *epasswd_len)
@@ -97,7 +99,15 @@ int rad_auth_pap(struct radius_pd_t *rpd, const char *username, va_list args)
free(epasswd);
- rad_auth_send(req);
+ r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ }
out:
rad_req_free(req);
@@ -134,6 +144,14 @@ int rad_auth_chap_md5(struct radius_pd_t *rpd, const char *username, va_list arg
goto out;
r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ }
out:
rad_req_free(req);
@@ -154,7 +172,7 @@ int rad_auth_mschap_v1(struct radius_pd_t *rpd, const char *username, va_list ar
const uint8_t *nt_response = va_arg(args, const uint8_t *);
int flags = va_arg(args, int);
- req = rad_req_alloc(rpd, CODE_ACCESS_REQUEST, username);
+ req = rad_req_alloc(rpd, CODE_ACCESS_ACCEPT, username);
if (!req)
return PWDB_DENIED;
@@ -170,6 +188,14 @@ int rad_auth_mschap_v1(struct radius_pd_t *rpd, const char *username, va_list ar
goto out;
r = rad_auth_send(req);
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ }
out:
rad_req_free(req);
@@ -217,6 +243,14 @@ int rad_auth_mschap_v2(struct radius_pd_t *rpd, const char *username, va_list ar
} else
memcpy(authenticator, ra->val.octets + 3, 40);
}
+ if (r == PWDB_SUCCESS) {
+ struct ev_radius_t ev = {
+ .ppp = rpd->ppp,
+ .request = req->pack,
+ .reply = req->reply,
+ };
+ triton_event_fire(EV_RADIUS_ACCESS_ACCEPT, &ev);
+ }
out:
rad_req_free(req);