diff options
author | Luiz Eduardo Gava <luiz.gava@procempa.com.br> | 2015-11-26 16:24:04 +0300 |
---|---|---|
committer | Luiz Eduardo Gava <luiz.gava@procempa.com.br> | 2015-11-26 16:24:04 +0300 |
commit | c34b751db0f14d5f0176113de92df079ab8e1710 (patch) | |
tree | 0c51414c5efac0b0606d25247a875283f152af9f /src | |
parent | d3a1b26413acf3b387475f9ec5c4cbd93c5ffffe (diff) |
Adding Radius AVP Called-Station-Id
Diffstat (limited to 'src')
-rw-r--r-- | src/Cedar/Radius.c | 8 | ||||
-rw-r--r-- | src/Cedar/Radius.h | 2 | ||||
-rw-r--r-- | src/Cedar/Sam.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/Cedar/Radius.c b/src/Cedar/Radius.c index bff039d0..8fe9dcd4 100644 --- a/src/Cedar/Radius.c +++ b/src/Cedar/Radius.c @@ -1702,7 +1702,7 @@ LABEL_ERROR: ////////// Classical implementation
// Attempts Radius authentication (with specifying retry interval and multiple server)
-bool RadiusLogin(CONNECTION *c, char *server, UINT port, UCHAR *secret, UINT secret_size, wchar_t *username, char *password, UINT interval, UCHAR *mschap_v2_server_response_20,
+bool RadiusLogin(CONNECTION *c, char *hubname, char *server, UINT port, UCHAR *secret, UINT secret_size, wchar_t *username, char *password, UINT interval, UCHAR *mschap_v2_server_response_20,
RADIUS_LOGIN_OPTION *opt)
{
UCHAR random[MD5_SIZE];
@@ -1881,6 +1881,9 @@ bool RadiusLogin(CONNECTION *c, char *server, UINT port, UCHAR *secret, UINT sec ui = Endian32(1);
RadiusAddValue(p, 65, 0, 0, &ui, sizeof(ui));
+ // Called-Station-Id
+ RadiusAddValue(p, 30, 0, 0, hubname, StrLen(hubname));
+
// Calling-Station-Id
RadiusAddValue(p, 31, 0, 0, client_ip_str, StrLen(client_ip_str));
@@ -1931,6 +1934,9 @@ bool RadiusLogin(CONNECTION *c, char *server, UINT port, UCHAR *secret, UINT sec ui = Endian32(1);
RadiusAddValue(p, 65, 0, 0, &ui, sizeof(ui));
+ // Called-Station-Id
+ RadiusAddValue(p, 30, 0, 0, hubname, StrLen(hubname));
+
// Calling-Station-Id
RadiusAddValue(p, 31, 0, 0, client_ip_str, StrLen(client_ip_str));
diff --git a/src/Cedar/Radius.h b/src/Cedar/Radius.h index 31b041bd..372c9492 100644 --- a/src/Cedar/Radius.h +++ b/src/Cedar/Radius.h @@ -374,7 +374,7 @@ struct RADIUS_LOGIN_OPTION };
// Function prototype
-bool RadiusLogin(CONNECTION *c, char *server, UINT port, UCHAR *secret, UINT secret_size, wchar_t *username, char *password, UINT interval, UCHAR *mschap_v2_server_response_20,
+bool RadiusLogin(CONNECTION *c, char *hubname, char *server, UINT port, UCHAR *secret, UINT secret_size, wchar_t *username, char *password, UINT interval, UCHAR *mschap_v2_server_response_20,
RADIUS_LOGIN_OPTION *opt);
BUF *RadiusEncryptPassword(char *password, UCHAR *random, UCHAR *secret, UINT secret_size);
BUF *RadiusCreateUserName(wchar_t *username);
diff --git a/src/Cedar/Sam.c b/src/Cedar/Sam.c index d9872163..17aff9e8 100644 --- a/src/Cedar/Sam.c +++ b/src/Cedar/Sam.c @@ -265,7 +265,7 @@ bool SamAuthUserByPlainPassword(CONNECTION *c, HUB *hub, char *username, char *p if (UniIsEmptyStr(suffix_filter_w) || UniEndWith(name, suffix_filter_w))
{
// Attempt to login
- b = RadiusLogin(c, radius_server_addr, radius_server_port,
+ b = RadiusLogin(c, hub->Name, radius_server_addr, radius_server_port,
radius_secret, StrLen(radius_secret),
name, password, interval, mschap_v2_server_response_20, opt);
|