# HG changeset patch # User Chris Cannam # Date 1341306142 -3600 # Node ID 92929d26b8db010c293a60b4a56ed2a8d1a75f08 # Parent 2985c2a9014605a9d4c29ad653b1f9bca682903c Fix failure to provide default initialisation vector for AES CBC mode (I'm surprised pycrypto allowed this previously, but it doesn't now, thus catching my error). Also make debug output a bit more helpful diff -r 2985c2a90146 -r 92929d26b8db easyhg.py --- a/easyhg.py Fri May 18 09:34:12 2012 +0100 +++ b/easyhg.py Tue Jul 03 10:02:22 2012 +0100 @@ -53,12 +53,18 @@ # "remember this password") feature without them # easyhg_authfile_imports_ok = True + try: from Crypto.Cipher import AES +except ImportError: + print "EasyHg: Failed to import Crypto.Cipher module required for authfile support (try installing PyCrypto?)" + easyhg_authfile_imports_ok = False + +try: import ConfigParser # Mercurial version won't write files import base64 except ImportError: - print "EasyHg: Failed to import required modules for authfile support" + print "EasyHg: Failed to import modules (ConfigParser, base64) required for authfile support" easyhg_authfile_imports_ok = False @@ -83,7 +89,8 @@ self.remember = False if self.use_auth_file: - self.auth_cipher = AES.new(self.auth_key, AES.MODE_CBC) + self.auth_cipher = AES.new(self.auth_key, AES.MODE_CBC, + os.urandom(16)) self.auth_file = os.path.expanduser(self.auth_file) self.load_auth_data()