MCPcopy Create free account
hub / github.com/SecurityInnovation/PGPy / test_encrypt_bad_cipher

Method test_encrypt_bad_cipher

tests/test_10_exceptions.py:228–234  ·  view source on GitHub ↗
(self, rsa_pub, recwarn)

Source from the content-addressed store, hash-verified

226 rsa_sec.del_uid("ASDFDSGSAJGKSAJG")
227
228 def test_encrypt_bad_cipher(self, rsa_pub, recwarn):
229 rsa_pub.subkeys['EEE097A017B979CA'].encrypt(PGPMessage.new('asdf'),
230 cipher=SymmetricKeyAlgorithm.CAST5)
231
232 relevant_warning_messages = [ str(w.message) for w in recwarn if w.category is UserWarning ]
233 assert "Selected symmetric algorithm not in key preferences" in relevant_warning_messages
234 assert "Selected compression algorithm not in key preferences" in relevant_warning_messages
235
236 def test_sign_bad_prefs(self, rsa_sec, recwarn):
237 rsa_sec.subkeys['2A834D8E5918E886'].sign(PGPMessage.new('asdf'), hash=HashAlgorithm.MD5)

Callers

nothing calls this directly

Calls 2

encryptMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected