[gnome-keysign: 71/75] tests: mks: Free some variables from the context



commit ae81aa2a7a792aa423eeab25c77024da71e60747
Author: Tobias Mueller <muelli cryptobitch de>
Date:   Fri Sep 22 15:30:17 2017 +0200

    tests: mks: Free some variables from the context
    
    To make it a little bit easier to comprehend what is happening.

 tests/test_gpgmks.py | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/tests/test_gpgmks.py b/tests/test_gpgmks.py
index 1992af2..2688d63 100644
--- a/tests/test_gpgmks.py
+++ b/tests/test_gpgmks.py
@@ -248,14 +248,21 @@ class TestSignAndEncrypt:
         pass
 
     def test_sign_and_encrypt(self):
+        # Let's imagine we've just got sent the key from the key-sending side
         keydata = open(self.sender_key, "rb").read()
         # for some reason pgpy does not like the stray data before
         # https://github.com/SecurityInnovation/PGPy/issues/218
         keydata = keydata[keydata.index('-----'):]
+        
+        # We find out what UIDs the sender key has
         keys = get_usable_keys(homedir=self.sender_homedir)
         assert_equals(1, len(keys))
         key = keys[0]
         uids = key.uidslist
+        del key
+        del keys
+        
+        # We are the receiver and we sign the sender's key.
         # This is a tuple (uid, encrypted)
         uid_encrypted = list(sign_keydata_and_encrypt(keydata,
             error_cb=None, homedir=self.receiver_homedir))
@@ -281,6 +288,7 @@ class TestSignAndEncrypt:
 
             # Decrypt...
             from monkeysign.gpg import Keyring
+            # We sent back the key to the key-sending side
             kr = Keyring(homedir=self.sender_homedir)
             log.info("encrypted UID: %r", enc_uid)
             decrypted = kr.decrypt_data(signed_uid)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]