]> git.proxmox.com Git - pve-access-control.git/commitdiff
use new PVE::Tools::encrypt_pw, bump version to 5.0-3
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 30 Mar 2017 15:54:38 +0000 (17:54 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 30 Mar 2017 15:54:38 +0000 (17:54 +0200)
Makefile
PVE/Auth/PAM.pm
PVE/Auth/PVE.pm
PVE/Auth/Plugin.pm
changelog.Debian

index f4e87fc3376c3b8186f8abc9ee8deab8f8dadc6f..b0045bd4fb8e6fafe31f066ed0842a0046510762 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION=5.0
 PACKAGE=libpve-access-control
-PKGREL=2
+PKGREL=3
 
 DESTDIR=
 PREFIX=/usr
index d8459783db452dca16f298d261a6c2cdaea6eaf3..42feba8cae9092b81ca79a2b35c69675164f2257 100755 (executable)
@@ -66,7 +66,7 @@ sub store_password {
 
     my $cmd = ['usermod'];
 
-    my $epw = PVE::Auth::Plugin::encrypt_pw($password);
+    my $epw = PVE::Tools::encrypt_pw($password);
 
     push @$cmd, '-p', $epw, $username;
 
index 8714a6b6a5131a47ab65942c9402d9025736f20f..6065df08411eb7e0d5c716b43abc78284821b428 100755 (executable)
@@ -3,6 +3,7 @@ package PVE::Auth::PVE;
 use strict;
 use warnings;
 
+use PVE::Tools;
 use PVE::Auth::Plugin;
 use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
 
@@ -92,7 +93,7 @@ sub store_password {
 
     lock_shadow_config(sub {
        my $shadow_cfg = cfs_read_file($shadowconfigfile);
-       my $epw = PVE::Auth::Plugin::encrypt_pw($password);
+       my $epw = PVE::Tools::encrypt_pw($password);
        $shadow_cfg->{users}->{$username}->{shadow} = $epw;
        cfs_write_file($shadowconfigfile, $shadow_cfg);
     });
index 3356f691c55d1b5ff8bc3e1b5c5a54e63ac57a8e..b5f474b3ffc06e71b51383c3cb3b5bd273e16e57 100755 (executable)
@@ -130,20 +130,6 @@ sub parse_tfa_config {
     return $res;
 }
 
-my $salt_starter = time();
-
-sub encrypt_pw {
-    my ($pw) = @_;
-
-    $salt_starter++;
-    my $salt = substr(Digest::SHA::sha1_base64(time() + $salt_starter + $$), 0, 8);
-
-    # crypt does not want '+' in salt (see 'man crypt')
-    $salt =~ s/\+/X/g;
-
-    return crypt(encode("utf8", $pw), "\$5\$$salt\$");
-}
-
 my $defaultData = {
     propertyList => {
        type => { description => "Realm type." },
index 4372f6512f38af14395d175779f0d6c25fae2502..6c1455c08d394e17037e08a9013093f5134c725c 100644 (file)
@@ -1,3 +1,11 @@
+libpve-access-control (5.0-3) unstable; urgency=medium
+
+  * use new PVE::OTP class from pve-common
+
+  * use new PVE::Tools::encrypt_pw from pve-common
+
+ -- Proxmox Support Team <support@proxmox.com>  Thu, 30 Mar 2017 17:45:55 +0200
+
 libpve-access-control (5.0-2) unstable; urgency=medium
 
   * encrypt_pw: avoid '+' for crypt salt