From a86be44b08fe0935fe77d90948b9baad85af3624 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Nov 2008 23:02:29 -0500 Subject: Apply Heiko Rommel's patch for hashlib deprecation warnings for bug 293178. I've modified the patch to improve some of the stylistic issues. --- bin/export.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bin/export.py') diff --git a/bin/export.py b/bin/export.py index c8d890eb..122ce8de 100644 --- a/bin/export.py +++ b/bin/export.py @@ -1,6 +1,6 @@ #! @PYTHON@ # -# Copyright (C) 2006-2007 by the Free Software Foundation, Inc. +# Copyright (C) 2006-2008 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -21,7 +21,6 @@ import os import sys -import sha import base64 import codecs import datetime @@ -289,13 +288,13 @@ def plaintext_password(password): def sha_password(password): - h = sha.new(password) + h = Utils.sha_new(password) return '{SHA}' + base64.b64encode(h.digest()) def ssha_password(password): salt = os.urandom(SALT_LENGTH) - h = sha.new(password) + h = Utils.sha_new(password) h.update(salt) return '{SSHA}' + base64.b64encode(h.digest() + salt) -- cgit v1.2.3