diff options
author | Tim Taubert <ttaubert@mozilla.com> | 2017-02-10 16:23:22 +0100 |
---|---|---|
committer | Tim Taubert <ttaubert@mozilla.com> | 2017-02-10 16:23:22 +0100 |
commit | ff78450919bdcbc3444ca02642b45d24859ea7ff (patch) | |
tree | 4b847121aa2fce01604e7a3fb30b63851c1c2f72 /nss-tool | |
parent | 2df7bf838163ff4bd104dc77f6cd375579decd27 (diff) | |
download | nss-hg-ff78450919bdcbc3444ca02642b45d24859ea7ff.tar.gz |
Bug 1330557 - Add basic TLS client fuzzer r=mt,franziskus
Differential Revision: https://nss-review.dev.mozaws.net/D145
Diffstat (limited to 'nss-tool')
-rw-r--r-- | nss-tool/common/scoped_ptrs.h | 57 | ||||
-rw-r--r-- | nss-tool/nss_tool.gyp | 3 |
2 files changed, 2 insertions, 58 deletions
diff --git a/nss-tool/common/scoped_ptrs.h b/nss-tool/common/scoped_ptrs.h deleted file mode 100644 index 6752a32b4..000000000 --- a/nss-tool/common/scoped_ptrs.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef scoped_ptrs_h__ -#define scoped_ptrs_h__ - -#include <memory> -#include "cert.h" -#include "keyhi.h" -#include "pk11pub.h" - -struct ScopedDelete { - void operator()(CERTCertificate* cert) { CERT_DestroyCertificate(cert); } - void operator()(CERTCertificateList* list) { - CERT_DestroyCertificateList(list); - } - void operator()(CERTSubjectPublicKeyInfo* spki) { - SECKEY_DestroySubjectPublicKeyInfo(spki); - } - void operator()(PK11SlotInfo* slot) { PK11_FreeSlot(slot); } - void operator()(PK11SymKey* key) { PK11_FreeSymKey(key); } - void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); } - void operator()(SECItem* item) { SECITEM_FreeItem(item, true); } - void operator()(SECKEYPublicKey* key) { SECKEY_DestroyPublicKey(key); } - void operator()(SECKEYPrivateKey* key) { SECKEY_DestroyPrivateKey(key); } - - void operator()(CERTCertList* list) { CERT_DestroyCertList(list); } -}; - -template <class T> -struct ScopedMaybeDelete { - void operator()(T* ptr) { - if (ptr) { - ScopedDelete del; - del(ptr); - } - } -}; - -#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> > Scoped##x - -SCOPED(CERTCertificate); -SCOPED(CERTCertificateList); -SCOPED(CERTSubjectPublicKeyInfo); -SCOPED(PK11SlotInfo); -SCOPED(PK11SymKey); -SCOPED(SECAlgorithmID); -SCOPED(SECItem); -SCOPED(SECKEYPublicKey); -SCOPED(SECKEYPrivateKey); - -SCOPED(CERTCertList); - -#undef SCOPED - -#endif diff --git a/nss-tool/nss_tool.gyp b/nss-tool/nss_tool.gyp index 2882b70be..26eecfe0c 100644 --- a/nss-tool/nss_tool.gyp +++ b/nss-tool/nss_tool.gyp @@ -19,8 +19,9 @@ 'common', ], 'dependencies' : [ + '<(DEPTH)/cpputil/cpputil.gyp:cpputil', '<(DEPTH)/exports.gyp:dbm_exports', - '<(DEPTH)/exports.gyp:nss_exports' + '<(DEPTH)/exports.gyp:nss_exports', ], } ], |