From: Stephen Gran Date: Thu, 9 Jun 2011 17:47:12 +0000 (+0000) Subject: more sha module X-Git-Tag: userdir-ldap-0.3.85~100 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=e81f32047e089d96ada62a737e41e08de799d069 more sha module Signed-off-by: Stephen Gran --- diff --git a/userdir_ldap.py b/userdir_ldap.py index c76992c..9e99899 100644 --- a/userdir_ldap.py +++ b/userdir_ldap.py @@ -22,7 +22,7 @@ import termios, re, imp, ldap, sys, crypt, rfc822, pwd, os, getpass import userdir_gpg import hmac -import sha as sha1_module +import hashlib try: File = open("/etc/userdir-ldap/userdir-ldap.conf"); @@ -438,7 +438,7 @@ 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() + return hmac.new(HmacKey, str, hashlib.sha1).hexdigest() def make_passwd_hmac(status, purpose, uid, uuid, hosts, cryptedpass): return make_hmac(':'.join([status, purpose, uid, uuid, hosts, cryptedpass]))