Skip to content

Commit

Permalink
sopgpy encrypt: add profile "rfc4880" which only uses SEIPDv1
Browse files Browse the repository at this point in the history
  • Loading branch information
dkg committed Aug 10, 2023
1 parent 1f3d57b commit 1a6a207
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pgpy/sopgpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def encrypt_profiles(self) -> List[sop.SOPProfile]:
return [
sop.SOPProfile('default', 'passwords: Use CFB (SEIPDv1); pubkeys: determine from key features'),
sop.SOPProfile('draft-ietf-openpgp-crypto-refresh-10', 'passwords: Use AEAD (SEIPDv2); pubkeys: determine from key features'),
sop.SOPProfile('rfc4880', 'Always use CFB (SEIPDv1)'),
]

# implemented ciphers that we are willing to use to encrypt, in
Expand Down Expand Up @@ -352,6 +353,9 @@ def encrypt(self,

ciphers = set(self._cipherprefs)
max_featureset: pgpy.constants.Features = pgpy.constants.Features.pgpy_features
if profile is not None and profile.name == 'rfc4880':
max_featureset &= ~pgpy.constants.Features.SEIPDv2

for handle, cert in certs.items():
f: Optional[pgpy.constants.Features] = cert.features
if f is not None:
Expand Down

0 comments on commit 1a6a207

Please sign in to comment.