[Python-modules-commits] r33394 - in packages/python-keyring/trunk/debian (3 files)

mitya57 at users.alioth.debian.org mitya57 at users.alioth.debian.org
Sun Jul 19 09:32:33 UTC 2015


    Date: Sunday, July 19, 2015 @ 09:32:29
  Author: mitya57
Revision: 33394

Drop convert-crypto-keyring script, no longer needed.

Modified:
  packages/python-keyring/trunk/debian/changelog
Deleted:
  packages/python-keyring/trunk/debian/NEWS
  packages/python-keyring/trunk/debian/convert-crypto-keyring

Deleted: packages/python-keyring/trunk/debian/NEWS
===================================================================
--- packages/python-keyring/trunk/debian/NEWS	2015-07-19 09:26:15 UTC (rev 33393)
+++ packages/python-keyring/trunk/debian/NEWS	2015-07-19 09:32:29 UTC (rev 33394)
@@ -1,12 +0,0 @@
-python-keyring (1.4-1) unstable; urgency=low
-
-  This version no longer supports the conversion of pre-0.9 Crypto-based
-  keyring files. The version in wheezy (0.7.1-1+deb7u1) automatically converts
-  these files when you use it, so if you were using python-keyring in wheezy,
-  you are not affected.
-
-  Otherwise, if you used the Crypto backend, you should convert these files
-  manually using /usr/share/python-keyring/convert-crypto-keyring script from
-  the python-keyring package.
-
- -- Dmitry Shachnev <mitya57 at gmail.com>  Sat, 22 Jun 2013 11:03:11 +0400

Modified: packages/python-keyring/trunk/debian/changelog
===================================================================
--- packages/python-keyring/trunk/debian/changelog	2015-07-19 09:26:15 UTC (rev 33393)
+++ packages/python-keyring/trunk/debian/changelog	2015-07-19 09:32:29 UTC (rev 33394)
@@ -3,6 +3,7 @@
   * New upstream release.
   * Update URLs for move from BitBucket to GitHub.
   * Rebase no_hgtools.diff for the new version.
+  * Drop convert-crypto-keyring script, no longer needed.
 
  -- Dmitry Shachnev <mitya57 at debian.org>  Sun, 19 Jul 2015 12:22:27 +0300
 

Deleted: packages/python-keyring/trunk/debian/convert-crypto-keyring
===================================================================
--- packages/python-keyring/trunk/debian/convert-crypto-keyring	2015-07-19 09:26:15 UTC (rev 33393)
+++ packages/python-keyring/trunk/debian/convert-crypto-keyring	2015-07-19 09:32:29 UTC (rev 33394)
@@ -1,64 +0,0 @@
-#!/usr/bin/python
-
-# This script is based on code in python-keyring < 1.0
-# Original authors: Jason R. Coombs, Kang Zhang, Sebastian Ramacher
-# Adopted to use as a stand-alone script by Dmitry Shachnev
-
-"""
-Convert keyring from the 0.9.0 and earlier format to the current
-format.
-"""
-
-import getpass
-import crypt
-import sys
-
-try:
-    from configparser import RawConfigParser
-except ImportError:
-    from ConfigParser import RawConfigParser
-
-from Crypto.Cipher import AES
-from keyring.backends.file import EncryptedKeyring
-from keyring.util.escape import unescape
-
-KEYRING_SETTING = 'keyring-setting'
-CRYPTED_PASSWORD = 'crypted-password'
-
-if len(sys.argv) > 1:
-    file_path = sys.argv[1]
-else:
-    sys.exit('Usage: %s [file name]' % sys.argv[0])
-
-config = RawConfigParser()
-config.read(file_path)
-config.get(KEYRING_SETTING, CRYPTED_PASSWORD)
-
-keyring = EncryptedKeyring()
-keyring.file_path = file_path
-keyring_password = getpass.getpass(
-    "Please enter your password for the old keyring: ")
-
-hashed = crypt.crypt(keyring_password, keyring_password)
-if config.get(KEYRING_SETTING, CRYPTED_PASSWORD) != hashed:
-    sys.stderr.write("Wrong password for the keyring.\n")
-    raise ValueError("Wrong password")
-
-config.remove_option(KEYRING_SETTING, CRYPTED_PASSWORD)
-with open(file_path, 'w') as f:
-    config.write(f)
-
-password = keyring_password + (
-    keyring.block_size - len(keyring_password) % keyring.block_size
-    ) * keyring.pad_char
-
-for service in config.sections():
-    for user in config.options(service):
-        cipher = AES.new(password, AES.MODE_CFB, '\0' * AES.block_size)
-        password_c = config.get(service, user).decode('base64')
-        service = unescape(service)
-        user = unescape(user)
-        password_p = cipher.decrypt(password_c)
-        keyring.set_password(service, user, password_p)
-
-print("File upgraded successfully")




More information about the Python-modules-commits mailing list