Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 6 additions and 5 deletions.
  1. +3 −4 README
  2. +3 −1 pwrtls.py
View
7 README
@@ -53,15 +53,14 @@ server_hello_msg:
------------------------------
client_verify_msg:
-{
- box: crypto_box({
+crypto_box({
lpub: long-term public key,
v: crypto_box(short-term public key),
vn: verifybox_nonce,
OPTIONAL pskv: crypto_secretbox(server short-term public key)
OPTIONAL cav: crypto_sign(long-term public key)
- })
-}
+ OPTIONAL msg: data
+})
-> v is verifybox, long-term to long-term key
-> box authenticated with short-term key, encrypted for server short-term key
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

No commit comments for this range

Something went wrong with that request. Please try again.