From: Stephen Gran Date: Thu, 9 Jun 2011 17:17:46 +0000 (+0000) Subject: get rid of most uses of sha module X-Git-Tag: userdir-ldap-0.3.85~101 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=cf8a9d82834b84ac13fc1f807a97c11fe0182d22 get rid of most uses of sha module Signed-off-by: Stephen Gran --- diff --git a/misc/ud-update-sudopasswords b/misc/ud-update-sudopasswords index 8e7fea8..292b282 100755 --- a/misc/ud-update-sudopasswords +++ b/misc/ud-update-sudopasswords @@ -20,7 +20,7 @@ # the hmac also includes purpose ("sudo") and userid that owns the # entry. This little script updates an ldap from old to new. -import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, sha, shutil, errno, tarfile, grp +import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, shutil, errno, tarfile, grp from userdir_ldap import *; UUID_FORMAT = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}' diff --git a/ud-generate b/ud-generate index 2721888..6c69928 100755 --- a/ud-generate +++ b/ud-generate @@ -28,7 +28,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, sha, shutil, errno, tarfile, grp +import string, re, time, ldap, getopt, sys, os, pwd, posix, socket, base64, hashlib, shutil, errno, tarfile, grp import lockfile from userdir_ldap import * from userdir_exceptions import * @@ -781,7 +781,7 @@ def ExtractDNSInfo(x): Algorithm = 2 if Algorithm == None: continue - Fingerprint = sha.new(base64.decodestring(Split[1])).hexdigest() + Fingerprint = hashlib.new('sha1', base64.decodestring(Split[1])).hexdigest() DNSInfo.append("%sIN\tSSHFP\t%u 1 %s" % (TTLprefix, Algorithm, Fingerprint)) if 'architecture' in x[1]: