summaryrefslogtreecommitdiff
path: root/FS/FS/Password_Mixin.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-11-19 14:52:42 -0800
committerMark Wells <mark@freeside.biz>2015-11-20 14:53:00 -0800
commit9867909c4592db1331712af78c772c1f1a8d2090 (patch)
treef4aba164e49c93b5174f2fbe47b809d8f5325a6f /FS/FS/Password_Mixin.pm
parent5d96e15a61121e8e0c4479363d6a612e702a10da (diff)
password policy enforcement for contacts, #32456
Diffstat (limited to 'FS/FS/Password_Mixin.pm')
-rw-r--r--FS/FS/Password_Mixin.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/FS/FS/Password_Mixin.pm b/FS/FS/Password_Mixin.pm
index c4549c7..9d5421b 100644
--- a/FS/FS/Password_Mixin.pm
+++ b/FS/FS/Password_Mixin.pm
@@ -105,7 +105,16 @@ sub insert_password_history {
my $password = $self->_password;
my $auth;
- if ( $encoding eq 'bcrypt' or $encoding eq 'crypt' ) {
+ if ( $encoding eq 'bcrypt' ) {
+ # our format, used for contact and access_user passwords
+ my ($cost, $salt, $hash) = split(',', $password);
+ $auth = Authen::Passphrase::BlowfishCrypt->new(
+ cost => $cost,
+ salt_base64 => $salt,
+ hash_base64 => $hash,
+ );
+
+ } elsif ( $encoding eq 'crypt' ) {
# it's smart enough to figure this out
$auth = Authen::Passphrase->from_crypt($password);