Stub out a PGPPacket._key_size dictionary
authorW. Trevor King <wking@tremily.us>
Sat, 21 Dec 2013 18:10:00 +0000 (10:10 -0800)
committerW. Trevor King <wking@tremily.us>
Mon, 23 Dec 2013 21:41:05 +0000 (13:41 -0800)
The string-to-key algorithm needs to know the key size, so record an
algorithm's key size (in bits) for easy lookup.  The AES key sizes
seem pretty obvious ;).

gpg-migrate.py

index f8c1fd488934357da431f9f17940c46d0486ed6f..d8ae5ac12bd967e52f17d866a4a0a739642a0231 100755 (executable)
@@ -123,6 +123,12 @@ class PGPPacket (dict):
         'tripledes': _crypto_cipher_des3,
         }
 
         'tripledes': _crypto_cipher_des3,
         }
 
+    _key_size = {  # in bits
+        'aes with 128-bit key': 128,
+        'aes with 192-bit key': 192,
+        'aes with 256-bit key': 256,
+        }
+
     _compression_algorithms = {
         0: 'uncompressed',
         1: 'zip',
     _compression_algorithms = {
         0: 'uncompressed',
         1: 'zip',