diff options
author | lloyd <[email protected]> | 2011-12-30 15:33:58 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-12-30 15:33:58 +0000 |
commit | ca850112360e48a3a140f08fa07f02806d61393b (patch) | |
tree | 5142a368b4fb5e414e6fcc41691a3b519311e1ff | |
parent | 97a274401167ea68b6284d6abb30351ee3243460 (diff) |
Reset the sequence numbers when we activate a connection state. This
meant up until this point, renegotiation never worked. :(
-rw-r--r-- | src/tls/rec_read.cpp | 1 | ||||
-rw-r--r-- | src/tls/rec_wri.cpp | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/tls/rec_read.cpp b/src/tls/rec_read.cpp index 84a96f508..63c08cad5 100644 --- a/src/tls/rec_read.cpp +++ b/src/tls/rec_read.cpp @@ -50,6 +50,7 @@ void Record_Reader::set_keys(const CipherSuite& suite, const SessionKeys& keys, cipher.reset(); delete mac; mac = 0; + seq_no = 0; SymmetricKey mac_key, cipher_key; InitializationVector iv; diff --git a/src/tls/rec_wri.cpp b/src/tls/rec_wri.cpp index 3f6f9b7f1..a0c332c58 100644 --- a/src/tls/rec_wri.cpp +++ b/src/tls/rec_wri.cpp @@ -69,6 +69,14 @@ void Record_Writer::set_keys(const CipherSuite& suite, delete mac; mac = 0; + /* + RFC 4346: + A sequence number is incremented after each record: specifically, + the first record transmitted under a particular connection state + MUST use sequence number 0 + */ + seq_no = 0; + SymmetricKey mac_key, cipher_key; InitializationVector iv; |