projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
603d84b
)
sha512 crypt() export
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 30 Nov 2017 23:11:34 +0000
(15:11 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 30 Nov 2017 23:11:34 +0000
(15:11 -0800)
FS/FS/part_export/passwdfile.pm
patch
|
blob
|
history
FS/FS/part_export/shellcommands.pm
patch
|
blob
|
history
FS/FS/part_export/shellcommands_withdomain.pm
patch
|
blob
|
history
FS/FS/svc_acct.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/passwdfile.pm
b/FS/FS/part_export/passwdfile.pm
index
2978d25
..
6713c8d
100644
(file)
--- a/
FS/FS/part_export/passwdfile.pm
+++ b/
FS/FS/part_export/passwdfile.pm
@@
-9,8
+9,8
@@
use FS::part_export::null;
tie %options, 'Tie::IxHash',
'crypt' => { label=>'Password encryption',
tie %options, 'Tie::IxHash',
'crypt' => { label=>'Password encryption',
- type=>'select', options=>[qw(crypt md5)],
- default=>'
crypt
',
+ type=>'select', options=>[qw(crypt md5
sha512
)],
+ default=>'
md5
',
},
;
},
;
diff --git
a/FS/FS/part_export/shellcommands.pm
b/FS/FS/part_export/shellcommands.pm
index
775af17
..
7c280e5
100644
(file)
--- a/
FS/FS/part_export/shellcommands.pm
+++ b/
FS/FS/part_export/shellcommands.pm
@@
-97,8
+97,8
@@
tie my %options, 'Tie::IxHash',
},
'crypt' => { label => 'Default password encryption',
},
'crypt' => { label => 'Default password encryption',
- type=>'select', options=>[qw(crypt md5)],
- default => '
crypt
',
+ type=>'select', options=>[qw(crypt md5
sha512
)],
+ default => '
md5
',
},
'groups_susp_reason' => { label =>
'Radius group mapping to reason (via template user)',
},
'groups_susp_reason' => { label =>
'Radius group mapping to reason (via template user)',
diff --git
a/FS/FS/part_export/shellcommands_withdomain.pm
b/FS/FS/part_export/shellcommands_withdomain.pm
index
29715b7
..
b307133
100644
(file)
--- a/
FS/FS/part_export/shellcommands_withdomain.pm
+++ b/
FS/FS/part_export/shellcommands_withdomain.pm
@@
-63,8
+63,8
@@
tie my %options, 'Tie::IxHash',
type => 'checkbox',
},
'crypt' => { label => 'Default password encryption',
type => 'checkbox',
},
'crypt' => { label => 'Default password encryption',
- type=>'select', options=>[qw(crypt md5)],
- default => '
crypt
',
+ type=>'select', options=>[qw(crypt md5
sha512
)],
+ default => '
md5
',
},
'fail_on_output' => {
label => 'Treat any output from the command as an error',
},
'fail_on_output' => {
label => 'Treat any output from the command as an error',
diff --git
a/FS/FS/svc_acct.pm
b/FS/FS/svc_acct.pm
index
0894980
..
de9199d
100644
(file)
--- a/
FS/FS/svc_acct.pm
+++ b/
FS/FS/svc_acct.pm
@@
-2542,6
+2542,11
@@
sub crypt_password {
);
} elsif ( $encryption eq 'md5' ) {
return unix_md5_crypt( $self->_password );
);
} elsif ( $encryption eq 'md5' ) {
return unix_md5_crypt( $self->_password );
+ } elsif ( $encryption eq 'sha512' ) {
+ return crypt(
+ $self->_password,
+ '$6$rounds=15420$'. join('', map $saltset[int(rand(64))], (1..16) )
+ );
} elsif ( $encryption eq 'sha1_base64' ) { #for acct_sql
my $pass = sha1_base64( $self->_password );
$pass .= '=' x (4 - length($pass) % 4); #properly padded base64
} elsif ( $encryption eq 'sha1_base64' ) { #for acct_sql
my $pass = sha1_base64( $self->_password );
$pass .= '=' x (4 - length($pass) % 4); #properly padded base64