[Da-tools-commits] ./debian/userdir-ldap r461: Reading the hmac key only once is too troublesome

Peter Palfrader peter at palfrader.org
Sun Sep 14 23:12:41 UTC 2008


------------------------------------------------------------
revno: 461
committer: Peter Palfrader <peter at palfrader.org>
branch nick: userdir-ldap
timestamp: Mon 2008-09-15 01:12:41 +0200
message:
  Reading the hmac key only once is too troublesome
modified:
  debian/changelog
  userdir_ldap.py
-------------- next part --------------
=== modified file 'debian/changelog'
--- a/debian/changelog	2008-09-14 22:40:37 +0000
+++ b/debian/changelog	2008-09-14 23:12:41 +0000
@@ -1,3 +1,9 @@
+userdir-ldap (0.3.40) unstable; urgency=low
+
+  * Reading the hmac key only once is too troublesome.
+
+ -- Peter Palfrader <weasel at debian.org>  Mon, 15 Sep 2008 01:12:23 +0200
+
 userdir-ldap (0.3.39) unstable; urgency=low
 
   * Lowercasing hashed sudo passwords in ud-mailgate not considered smart.

=== modified file 'userdir_ldap.py'
--- a/userdir_ldap.py	2008-09-14 22:18:51 +0000
+++ b/userdir_ldap.py	2008-09-14 23:12:41 +0000
@@ -43,10 +43,6 @@
 Ech_ErrorLog = ConfModule.ech_errorlog;
 Ech_MainLog = ConfModule.ech_mainlog;
 
-File = open(PassDir+"/key-hmac-"+pwd.getpwuid(os.getuid())[0],"r");
-HmacKey = File.readline().strip()
-File.close();
-
 # For backwards compatibility, we default to the old behaviour
 MultipleSSHFiles = getattr(ConfModule, 'multiplesshfiles', False)
 SingleSSHFile = getattr(ConfModule, 'singlesshfile', True)
@@ -458,6 +454,9 @@
    return -1
 
 def make_hmac(str):
+   File = open(PassDir+"/key-hmac-"+pwd.getpwuid(os.getuid())[0],"r");
+   HmacKey = File.readline().strip()
+   File.close();
    return hmac.new(HmacKey, str, sha1_module).hexdigest()
 
 def make_sudopasswd_hmac(purpose, uuid, hosts, cryptedpass):



More information about the Da-tools-commits mailing list