[Nym3-commit] r293 - trunk/nym3/Client

jr at conuropsis.org jr at conuropsis.org
Sat Jun 11 15:49:54 CEST 2005


Author: jr
Date: 2005-06-11 15:49:53 +0200 (Sat, 11 Jun 2005)
New Revision: 293

Modified:
   trunk/nym3/Client/Account.py
   trunk/nym3/Client/Main.py
Log:
debug Account.record and adapt list_journal to the encrypted journal format


Modified: trunk/nym3/Client/Account.py
===================================================================
--- trunk/nym3/Client/Account.py	2005-06-11 13:23:52 UTC (rev 292)
+++ trunk/nym3/Client/Account.py	2005-06-11 13:49:53 UTC (rev 293)
@@ -288,11 +288,11 @@
         h.fromData(self.data['username'], seqno, sig)
         return str(h)
 
-    def record(self, config, seqno, msg):
+    def record(self, seqno, msg):
 	"""Store a control message in the journal"""
 	if self.journal_status == 'unloaded': self._load_journal()
 	clear = pickle.dumps((msg, int(time.time())))
-	pubring = Keyring.Keyring(config.pubring_path, create = False)
+	pubring = Keyring.Keyring(self.config.pubring_path, create = False)
 	pubring.decrypt("nym3")
 	key = pubring.get_key(self.journalKey)
 	self.journal[seqno] = _cr.pk_encrypt(clear, key)

Modified: trunk/nym3/Client/Main.py
===================================================================
--- trunk/nym3/Client/Main.py	2005-06-11 13:23:52 UTC (rev 292)
+++ trunk/nym3/Client/Main.py	2005-06-11 13:49:53 UTC (rev 293)
@@ -576,12 +576,12 @@
     account = get_account_from_nickname(ui, config, nickname,
 	    "No nickname given, abort\nUse -n <nickname>")
     journal = account.get_journal()
-    #TODO do we need encryption?
-    #secring = decode_secring(config, ui)
+    secring = decode_secring(config, ui)
+    key = secring.get_key(account['journalKey'])
     l = []
     for seqno in journal.keys():
-	#clear = decipher_string(mbox[mid], secring, account['encKeys'])
-	m, t = journal[seqno]
+	clear = _cr.pk_decrypt(journal[seqno], key)
+	m, t = pickle.loads(clear)
 	l.append((seqno, m, t))
     l.sort(journal_time_cmp)
     for i, (s, m, t) in enumerate(l):



More information about the Nym3-commit mailing list