summaryrefslogtreecommitdiff
path: root/cpputil/tls_parser.cc
diff options
context:
space:
mode:
authorEKR <ekr@rtfm.com>2018-03-15 12:01:09 +0000
committerEKR <ekr@rtfm.com>2018-03-15 12:01:09 +0000
commitb34ee8106923683ccb5128a5560a3b1dae105687 (patch)
tree0cc1d5408f92385e50ee0f7cf9cac92d58c679ee /cpputil/tls_parser.cc
parent55d71b1f51ce7063c661bb38495e894fb8ed7cea (diff)
downloadnss-hg-b34ee8106923683ccb5128a5560a3b1dae105687.tar.gz
Bug 1446643 - Update to TLS 1.3 draft-26. r=mt
- Update version number - Forbid negotiating < TLS 1.3 with supported_versions - Change to version number 0303 after HRR. Plus test - Update AAD. https://phabricator.services.mozilla.com/D753
Diffstat (limited to 'cpputil/tls_parser.cc')
-rw-r--r--cpputil/tls_parser.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/cpputil/tls_parser.cc b/cpputil/tls_parser.cc
index e4c06aa91..efedd7a65 100644
--- a/cpputil/tls_parser.cc
+++ b/cpputil/tls_parser.cc
@@ -46,6 +46,21 @@ bool TlsParser::Read(DataBuffer* val, size_t len) {
return true;
}
+bool TlsParser::ReadFromMark(DataBuffer* val, size_t len, size_t mark) {
+ auto saved = offset_;
+ offset_ = mark;
+
+ if (remaining() < len) {
+ offset_ = saved;
+ return false;
+ }
+
+ val->Assign(ptr(), len);
+
+ offset_ = saved;
+ return true;
+}
+
bool TlsParser::ReadVariable(DataBuffer* val, size_t len_size) {
uint32_t len;
if (!Read(&len, len_size)) {