Skip to content
Browse files

exception!

  • Loading branch information...
1 parent 9ec95db commit d346e71c1a7c065beaeb67e5e603762bc4059a7b @rep committed Oct 10, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 pwrtls.py
View
4 pwrtls.py
@@ -173,7 +173,9 @@ def do_handshake(self):
# receive verification message for authenticating the short-term key
data = self._recv_frame()
- opened = nacl.crypto_box_open(data, snonce(3), self.remote_shortpub, self.shortpriv)
+ try: opened = nacl.crypto_box_open(data, snonce(3), self.remote_shortpub, self.shortpriv)
+ except ValueError:
+ raise pwrtls_exception('Could not open client_verify message.')
self.remote_longpub, vbox, vnonce, pskv, cav = from_bson(opened, 'lpub', 'v', 'vn', 'pskv', 'cav')
# check verifybox

0 comments on commit d346e71

Please sign in to comment.
Something went wrong with that request. Please try again.