summaryrefslogtreecommitdiff
path: root/cpputil
diff options
context:
space:
mode:
authorKevin Jacobs <kjacobs@mozilla.com>2020-01-06 21:26:20 +0000
committerKevin Jacobs <kjacobs@mozilla.com>2020-01-06 21:26:20 +0000
commit1a9015776d73205f7808c27a96dc47f1637bc3f7 (patch)
tree3af5a6045c9265c3f68da81367375f97978b568c /cpputil
parent8ee7dfd77a639eb627b61d125ba638ce4252fc6a (diff)
downloadnss-hg-1a9015776d73205f7808c27a96dc47f1637bc3f7.tar.gz
Bug 1599514 - Update DTLS 1.3 support to draft-30 r=mt
This patch updates the DTLS 1.3 implementation to draft version 30, including unified header format and sequence number encryption. Also added are new `SSL_CreateMask` experimental functions. Differential Revision: https://phabricator.services.mozilla.com/D51014
Diffstat (limited to 'cpputil')
-rw-r--r--cpputil/databuffer.h1
-rw-r--r--cpputil/scoped_ptrs_ssl.h2
-rw-r--r--cpputil/tls_parser.h5
3 files changed, 8 insertions, 0 deletions
diff --git a/cpputil/databuffer.h b/cpputil/databuffer.h
index e981a7c22..4bedd075d 100644
--- a/cpputil/databuffer.h
+++ b/cpputil/databuffer.h
@@ -23,6 +23,7 @@ class DataBuffer {
DataBuffer(const DataBuffer& other) : data_(nullptr), len_(0) {
Assign(other);
}
+ explicit DataBuffer(size_t l) : data_(nullptr), len_(0) { Allocate(l); }
~DataBuffer() { delete[] data_; }
DataBuffer& operator=(const DataBuffer& other) {
diff --git a/cpputil/scoped_ptrs_ssl.h b/cpputil/scoped_ptrs_ssl.h
index 474187540..682ebab82 100644
--- a/cpputil/scoped_ptrs_ssl.h
+++ b/cpputil/scoped_ptrs_ssl.h
@@ -12,6 +12,7 @@
struct ScopedDeleteSSL {
void operator()(SSLAeadContext* ctx) { SSL_DestroyAead(ctx); }
+ void operator()(SSLMaskingContext* ctx) { SSL_DestroyMaskingContext(ctx); }
void operator()(SSLAntiReplayContext* ctx) {
SSL_ReleaseAntiReplayContext(ctx);
}
@@ -34,6 +35,7 @@ struct ScopedMaybeDeleteSSL {
SCOPED(SSLAeadContext);
SCOPED(SSLAntiReplayContext);
+SCOPED(SSLMaskingContext);
SCOPED(SSLResumptionTokenInfo);
#undef SCOPED
diff --git a/cpputil/tls_parser.h b/cpputil/tls_parser.h
index 05dd99fc8..6636b3c6a 100644
--- a/cpputil/tls_parser.h
+++ b/cpputil/tls_parser.h
@@ -74,6 +74,11 @@ const uint8_t kTlsFakeChangeCipherSpec[] = {
0x01 // Value
};
+const uint8_t kCtDtlsCiphertext = 0x20;
+const uint8_t kCtDtlsCiphertextMask = 0xE0;
+const uint8_t kCtDtlsCiphertext16bSeqno = 0x08;
+const uint8_t kCtDtlsCiphertextLengthPresent = 0x04;
+
static const uint8_t kTls13PskKe = 0;
static const uint8_t kTls13PskDhKe = 1;
static const uint8_t kTls13PskAuth = 0;