summaryrefslogtreecommitdiffstats
path: root/src/etc/inc/openvpn.auth-user.php
diff options
context:
space:
mode:
authorKacper <kacper.bostrom@combitech.se>2016-07-13 23:18:04 +0200
committerKacper <kacper.bostrom@combitech.se>2016-07-13 23:18:04 +0200
commita409a857a2abba81388298bb44ea8f9fb2ab4cf4 (patch)
tree385efed21faca59c175dfabb450347a47c4290dd /src/etc/inc/openvpn.auth-user.php
parent0d9fc91cbf6167f58ad8f39460b2a1ba26287b4b (diff)
downloadpfsense-a409a857a2abba81388298bb44ea8f9fb2ab4cf4.zip
pfsense-a409a857a2abba81388298bb44ea8f9fb2ab4cf4.tar.gz
Added and modified functions to send correct Radius attributes to the Radius authenticator.
Diffstat (limited to 'src/etc/inc/openvpn.auth-user.php')
-rw-r--r--src/etc/inc/openvpn.auth-user.php44
1 files changed, 36 insertions, 8 deletions
diff --git a/src/etc/inc/openvpn.auth-user.php b/src/etc/inc/openvpn.auth-user.php
index 9c6c5ac..54a0fe5 100644
--- a/src/etc/inc/openvpn.auth-user.php
+++ b/src/etc/inc/openvpn.auth-user.php
@@ -67,17 +67,11 @@ require_once("interfaces.inc");
/**
* Get the NAS-Identifier
*
- * We will use our local hostname to make up the nas_id
+ * We will return "openVPN" so that connections can be distinguished by the Radius
*/
if (!function_exists("getNasID")) {
function getNasID() {
- global $g;
-
- $nasId = gethostname();
- if (empty($nasId)) {
- $nasId = $g['product_name'];
- }
- return $nasId;
+ return "openVPN";
}
}
@@ -96,6 +90,40 @@ function getNasIP() {
return $nasIp;
}
}
+
+/**
+ * Set the NAS-Port-Type
+ *
+ * Should be "Virtual" since that denotes VPN connections
+ */
+if (!function_exists("getNasPortType")) {
+function getNasPortType() {
+ return RADIUS_VIRTUAL;
+}
+}
+
+/**
+ * Set the NAS-Port
+ *
+ * We will return the port the client connected to
+ */
+if (!function_exists("getNasPort")) {
+function getNasPort() {
+ return $_GET['nas_port'];
+}
+}
+
+/**
+ * Set the Called-Station-ID
+ *
+ * We will return the IP and port the client connected to
+ */
+if (!function_exists("getCalledStationId")) {
+function getCalledStationId() {
+ return get_interface_ip() . ":" . getNasPort();
+}
+}
+
/* setup syslog logging */
openlog("openvpn", LOG_ODELAY, LOG_AUTH);
OpenPOWER on IntegriCloud