| r.@gosympatico.ca> |
timer.cancel() # XXX this can hang on exit
</span><span class="add">+ self.timer.cancel()
</span><span class="cx"> del self._password
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 22 Feb, 04:55 |
| r.@gosympatico.ca> |
timer.cancel() # XXX this can hang on exit
</span><span class="add">+ self.timer.cancel()
</span><span class="cx"> del self._password
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 22 Feb, 04:55 |
| r.@gosympatico.ca> |
timer.cancel() # XXX this can hang on exit
</span><span class="add">+ self.timer.cancel()
</span><span class="cx"> del self._password
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 22 Feb, 04:55 |
| r.@gosympatico.ca> |
timer.cancel() # XXX this can hang on exit
</span><span class="add">+ self.timer.cancel()
</span><span class="cx"> del self._password
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 22 Feb, 04:55 |
| r.@gosympatico.ca> |
timer.cancel() # XXX this can hang on exit
</span><span class="add">+ self.timer.cancel()
</span><span class="cx"> del self._password
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 22 Feb, 04:55 |
|
17:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 14 Jun, 16:51 |
|
s="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 14 Jun, 16:51 |
|
s="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 14 Jun, 16:51 |
|
17:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 14 Jun, 16:51 |
|
17:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 14 Jun, 16:51 |
| tts |
def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Fri, 31 Jan, 12:47 |
| tts |
self.timer.cancel() # XXX this can hang on exit
</span><span class="add">+ self.timer.cancel()
</span><span class="cx"> del self._password
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Fri, 31 Jan, 12:47 |
| s Skinner |
lt;span class="add&qmport schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 07 Apr, 02:32 |
| rogerea...@earthlink.net |
uforthedock//-----------------------------øi¦) |
Fri, 31 Jan, 03:47 |
| od |
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Sat, 17 Aug, 17:33 |
| n |
="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Thu, 11 Aug, 20:00 |
| m |
ssword, timeout):
</span><span class="add&qmport schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Fri, 17 Sep, 18:43 |
| <tbmuel...@libero.it> |
:
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Mon, 10 Jan, 10:14 |
| <tbmuel...@libero.it> |
:
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Mon, 10 Jan, 10:14 |
| list...@clarux.com> |
12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"&#iimporthexlify,unhexlify</span><spanclass="lines">@@-35,7+47,7@@</span><spanclass="cx">fromapplicationimportschemafromutilimprandom(16)])&516,7+521,7@@</span><spanclass="cx">#"Mozilla/5.0(compatible;Yahoo!Slurp;http://help.yahoo.com/help/us/ysearch/slurp)"d"> |
Sun, 16 May, 03:01 |
| list...@clarux.com> |
12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"&#iimporthexlify,unhexlify</span><spanclass="lines">@@-35,7+47,7@@</span><spanclass="cx">fromapplicationimportschemafromutilimprandom(16)])&516,7+521,7@@</span><spanclass="cx">#"Mozilla/5.0(compatible;Yahoo!Slurp;http://help.yahoo.com/help/us/ysearch/slurp)"d"> |
Sun, 16 May, 03:01 |
| y...@mac.com> |
d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 23 Nov, 06:21 |
| n@stardecisions.com |
d
</span><span class="rem">- del self.timer
-
</span><span class="add">+ del self.timer
+
+ def _clear(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add&qmport schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Thu, 06 Apr, 05:45 |
| <...@pobox.com> |
/release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 06 Jun, 02:39 |
| <...@pobox.com> |
own hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 06 Jun, 02:39 |
| <...@pobox.com> |
own hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Tue, 06 Jun, 02:39 |
| win |
.org> |
Wed, 17 May, 10:16 |
| le |
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Wed, 03 Jun, 08:06 |
| y |
(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, prefs):
</span><span class="lines">@@ -188,14 +192,14 @@
</span><span class="cx"> again = False
for item in password.Password.iterItems(view):
try:
</span><span class="rem">- oldPassword = item.decryptPassword(masterPassword=oldMaster) # safe: supplying master password
</span><span class="add">+ oldPassword = waitForDeferred(item.decryptPassword(masterPassword=oldMaster))
</span><span class="cx"> except password.UninitializedPassword:
continue
except password.DecryptionError:
log.exception('Wrong old master password?')
again = True
break
</span><span class="rem">- item.encryptPassword(oldPassword, masterPassword=newMaster) # safe: supplying master password
</span><span class="add">+ waitForDeferred(item.encryptPassword(oldPassword, masterPassword=newMaster))
</span><span class="cx">
if again:
return False
</span><span class="lines">@@ -212,6 +216,7 @@
</span><span class="cx">
return True
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def changeMasterPassword(self, view, window=None):
&quot;&quot;&quot;
Change or set the master password.
</span><span class="lines">@@ -516,7 +521,7 @@
</span><squot;>
# the crypto algorithms are unicode unfriendly
if isinstance(password, unicode):
</span><span class="lines">@@ -178,6 +192,7 @@
</span><span class="cx"> # encrypt using AES (Rijndael)
self.ciphertext = _encrypt(plaintext, encKey, self.iv)
</span><span class="add">+ @runInUIThread
</span><span class="cx"> def clear(self):
try:
del self.ciphertext
</span><span class="lines">@@ -227,6 +242,6 @@
</span><span class="cx">
password = ''.join([string.printable[ord(c) % len(string.printable)] \
for c in os.urandom(16)])
</span><span class="rem">- dummyPassword.encryptPassword(password, masterPassword='') # safe: supplying master password
</span><span class="add">+ waitForrem">- &lt;preclass="diff"&gt;&lt;spanclass="info"&gt;---trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2104:15:49UTC(rev8786)+++trunk/internal/wx/tests/archive/archivetest.cpp2005-12-2117:48:59UTC(rev8787)&lt;/span&gt;&lt;spanclass="lines"&gt;@@-2,7+2,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;//Name:tests/archive/archive.cpp//Purpose:Testthearchiveclasses//Author:MikeWetherell&lt;/span&gt;&lt;spanclass="rem"&gt;-//RCS-ID:$Id:archivetest.cpp,v1.142005/12/1813:58:55MWExp$&lt;/span&gt;&lt;spanclass="add"&gt;+//RCS-ID:$Id:archivetest.cpp,v1.152005/12/2101:23:17VZExp$&lt;/span&gt;&lt;spanclass="cx"&gt;//Copyright:(c)2004MikeWetherell//Licence:wxWindowslicence///////////////////////////////////////////////////////////////////////////////&lt;/span&gt;&lt;spanclass="lines"&gt;@@-1177,7+1177,7@@&lt;/span&gt;&lt;spanclass="cx"&gt;stringTestId::MakeId(){m_seed=(m_seed*171)%30269;&lt;/span&gt;&lt;spanclass="rem"&gt;-returnwxString::Format(_T(&amp;quot;%-6d&amp;quot;),m_seed).mb_str();&lt;/span&gt;&lt;spanclass="add"& #i import hexlify, unhexlify
</span><span class="lines">@@ -35,7 +47,7 @@
</span><span class="cx"> from application import schema
from util imprandom(16)])
&516,7 +521,7 @@
</span><span class="cx"> # "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"
d"> |
Mon, 21 Aug, 11:42 |
| y |
(self):
+ d = self.clearMasterPassword()
+ d.addCallback(lambda: True)
+
</span><span class="cx"> def _setTimedPassword(self, password, timeout):
</span><span class="add">+ if hasattr(self, 'timer'):
+ self.timer.cancel()
</span><span class="cx"> self._password = password
</span><span class="rem">- self.timer = threading.Timer(timeout, self.clearMasterPassword)
-
- # XXX Other threads can exit without waiting for this; seems to solve shutdown hang.
- # XXX However, this leads to a shutdown crash about 50% of the time (for some reason still successful exit value):
- #Exception in thread Thread-1 (most likely raised during interpreter shutdown):
- #Traceback (most recent call last):
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 460, in __bootstrap
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 623, in run
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 364, in wait
- # File &quot;.../release/lib/python2.5/threading.py&quot;, line 229, in wait
- #&lt;type 'exceptions.TypeError'&gt;: 'NoneType' object is not callable
- self.timer.setDaemon(True)
-
</span><span class="add">+ self.timer = threading.Timer(timeout, self._clear)
+ #self.timer.setDaemon(True) # Exception in thread Thread-1 (most likely raised during interpreter shutdown)
</span><span class="cx"> self.timer.start()
def _change(self, oldMaster, newMaster, view, pr |