gpg: improve flags selection

This commit is contained in:
Roman Zeyde
2016-06-03 20:17:53 +03:00
parent a6660fd5c5
commit 29a984eebb

View File

@@ -173,9 +173,10 @@ class Factory(object):
unhashed_subpackets=unhashed_subpackets)
# Subkey Binding Signature
flags = 2 # key flags (certify & sign)
if self.ecdh:
flags = 4 | 8
# Key flags: https://tools.ietf.org/html/rfc4880#section-5.2.3.21
# (certify & sign) (encrypt)
flags = (2) if (not self.ecdh) else (4 | 8)
hashed_subpackets = [
proto.subpacket_time(self.pubkey.created), # signature time