From 7ce8f6a9d9206532c2b36ea6cdab4b3cb41f3541 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 20 Dec 2013 09:59:58 -0800 Subject: [PATCH] Add simple S2K parsing to PGPPacket._parse_string_to_key_specifier From RFC 4880 [1]: Octet 0: 0x00 Octet 1: hash algorithm [1]: http://tools.ietf.org/search/rfc4880#section-3.7.1.1 --- gpg-migrate.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gpg-migrate.py b/gpg-migrate.py index 9fa25da..359ceb4 100755 --- a/gpg-migrate.py +++ b/gpg-migrate.py @@ -226,8 +226,14 @@ class PGPPacket (dict): def _parse_string_to_key_specifier(self, data): self['string-to-key-type'] = self._string_to_key_types[data[0]] offset = 1 - raise NotImplementedError( - 'string-to-key type {}'.format(self['string-to-key-type'])) + if self['string-to-key-type'] == 'simple': + self['string-to-key-hash-algorithm'] = self._hash_algorithms[ + data[offset]] + offset += 1 + else: + raise NotImplementedError( + 'string-to-key type {}'.format(self['string-to-key-type'])) + return offset def _parse_public_key_packet(self, data): self._parse_generic_public_key_packet(data=data) -- 2.26.2