summaryrefslogtreecommitdiff
path: root/cpputil
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2017-05-12 16:29:32 +1000
committerMartin Thomson <martin.thomson@gmail.com>2017-05-12 16:29:32 +1000
commitdb8a3f33216622dc3a0471123105d6210f84ca1e (patch)
treeeb81b8ab332d99b2b54cf8be46f8295a62a4887c /cpputil
parentfb8aad6f2c292af76464265ba28a4ae2b10dcdae (diff)
parent68e45894059ee980a6b931dfbecb2d7b8cfc6700 (diff)
downloadnss-hg-db8a3f33216622dc3a0471123105d6210f84ca1e.tar.gz
Merge NSS tip, a=merge
Diffstat (limited to 'cpputil')
-rw-r--r--cpputil/scoped_ptrs.h2
-rw-r--r--cpputil/tls_parser.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/cpputil/scoped_ptrs.h b/cpputil/scoped_ptrs.h
index a2351984d..39a5e1f05 100644
--- a/cpputil/scoped_ptrs.h
+++ b/cpputil/scoped_ptrs.h
@@ -17,6 +17,7 @@ struct ScopedDelete {
void operator()(CERTCertificateList* list) {
CERT_DestroyCertificateList(list);
}
+ void operator()(CERTName* name) { CERT_DestroyName(name); }
void operator()(CERTCertList* list) { CERT_DestroyCertList(list); }
void operator()(CERTSubjectPublicKeyInfo* spki) {
SECKEY_DestroySubjectPublicKeyInfo(spki);
@@ -48,6 +49,7 @@ struct ScopedMaybeDelete {
SCOPED(CERTCertificate);
SCOPED(CERTCertificateList);
SCOPED(CERTCertList);
+SCOPED(CERTName);
SCOPED(CERTSubjectPublicKeyInfo);
SCOPED(PK11SlotInfo);
SCOPED(PK11SymKey);
diff --git a/cpputil/tls_parser.h b/cpputil/tls_parser.h
index 5ee9812b7..c6bc43b32 100644
--- a/cpputil/tls_parser.h
+++ b/cpputil/tls_parser.h
@@ -16,6 +16,7 @@
#include <arpa/inet.h>
#endif
#include "databuffer.h"
+#include "sslt.h"
namespace nss_test {
@@ -76,6 +77,10 @@ static const uint8_t kTls13PskDhKe = 1;
static const uint8_t kTls13PskAuth = 0;
static const uint8_t kTls13PskSignAuth = 1;
+inline std::ostream& operator<<(std::ostream& os, SSLProtocolVariant v) {
+ return os << ((v == ssl_variant_stream) ? "TLS" : "DTLS");
+}
+
inline bool IsDtls(uint16_t version) { return (version & 0x8000) == 0x8000; }
inline uint16_t NormalizeTlsVersion(uint16_t version) {