aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeradius2/freeradius.inc
diff options
context:
space:
mode:
authorAlexander Wilke <nachtfalkeaw@web.de>2012-12-17 22:11:17 +0100
committerAlexander Wilke <nachtfalkeaw@web.de>2012-12-17 22:11:17 +0100
commit77781d958bb576c302bcf7d527aa4cd476dd8d73 (patch)
treeea67a6f729a0bb43b0590de862dc5673a6e658c7 /config/freeradius2/freeradius.inc
parent899177caeab1e294f061b1b8b0b09d9856034d96 (diff)
downloadpfsense-packages-77781d958bb576c302bcf7d527aa4cd476dd8d73.tar.gz
pfsense-packages-77781d958bb576c302bcf7d527aa4cd476dd8d73.tar.bz2
pfsense-packages-77781d958bb576c302bcf7d527aa4cd476dd8d73.zip
freeradius2 user password encryption
Diffstat (limited to 'config/freeradius2/freeradius.inc')
-rw-r--r--config/freeradius2/freeradius.inc16
1 files changed, 14 insertions, 2 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc
index 2a6594f7..60ccbdf4 100644
--- a/config/freeradius2/freeradius.inc
+++ b/config/freeradius2/freeradius.inc
@@ -390,6 +390,18 @@ if (is_array($arrusers) && !empty($arrusers)) {
$varusersusername = $users['varusersusername'];
$varuserspassword = $users['varuserspassword'];
+
+ // Check password encryption
+ $varuserspasswordencryption = ($users['varuserspasswordencryption']?$users['varuserspasswordencryption']:'Cleartext-Password');
+ switch ($varuserspasswordencryption) {
+ case "MD5-Password":
+ $varuserspassword = md5($varuserspassword);
+ break;
+ default:
+ $varuserspassword = $users['varuserspassword'];
+ }
+
+
$varusersmotpinitsecret = $users['varusersmotpinitsecret'];
$varusersmotppin = $users['varusersmotppin'];
$varusersmotpoffset = ($users['varusersmotpoffset']?$users['varusersmotpoffset']:'0');
@@ -467,7 +479,7 @@ if (is_array($arrusers) && !empty($arrusers)) {
}
else {
// Add the user attributes to each user.
- $varuserscheckitem = '"' . $varusersusername . '"' . " Cleartext-Password := " . '"' . $varuserspassword .'"';
+ $varuserscheckitem = '"' . $varusersusername . '"' . " $varuserspasswordencryption := " . '"' . $varuserspassword .'"';
}
} // end of check if otp is enabled
@@ -4189,4 +4201,4 @@ EOD;
}
-?> \ No newline at end of file
+?>