forked from mirrors/gecko-dev
2019-09-27 Daiki Ueno <dueno@redhat.com> * cmd/lib/Makefile, cmd/lib/lib.gyp, cmd/lib/manifest.mn, cmd/lib/secutil.c, cmd/lib/secutil.h, cmd/platlibs.mk, cmd/selfserv/selfserv.c, cmd/tstclnt/tstclnt.c, tests/ssl/ssl.sh: Bug 1494063, add -x option to tstclnt/selfserv to export keying material, r=mt Reviewers: rrelyea, mt Reviewed By: mt Subscribers: HubertKario Bug #: 1494063 [be9c48ad76cb] [tip] 2019-02-25 Martin Thomson <martin.thomson@gmail.com> * gtests/pk11_gtest/manifest.mn, gtests/pk11_gtest/pk11_gtest.gyp, gtests/pk11_gtest/pk11_import_unittest.cc, gtests/pk11_gtest/pk11_key_unittest.cc, gtests/pk11_gtest/pk11_keygen.cc, gtests/pk11_gtest/pk11_keygen.h: Bug 1515342 - Tests for invalid DH public keys, r=jcj Summary: This prevents crashes on invalid, particularly NULL, keys for DH and ECDH. I factored out test code already landed for this. [7e3476b7a912] 2019-09-27 Martin Thomson <martin.thomson@gmail.com> * cpputil/nss_scoped_ptrs.h, cpputil/scoped_ptrs_util.h, gtests/common/testvectors/curve25519-vectors.h, gtests/der_gtest/der_quickder_unittest.cc, lib/util/quickder.c: Bug 1515342 - Checks for invalid bit strings, r=jcj [f4fe0da73446] 2019-09-27 Martin Thomson <mt@lowentropy.net> * cmd/lib/derprint.c: Bug 1581024 - Fix pointer comparisons, a=bustage [062bc5e9859a] 2019-09-24 Kevin Jacobs <kjacobs@mozilla.com> * cmd/lib/derprint.c: Bug 1581024 - fixup pointer wrap check to prevent it from being optimized out. r=jcj [f7fef2487a60] 2019-09-26 Deian Stefan <deian@cs.ucsd.edu> * lib/softoken/pkcs11c.c, lib/softoken/tlsprf.c: Bug 1582343 - Use constant time memcmp in more places r=kjacobs,jcj [86ef6ba1f1d7] 2019-09-26 Marcus Burghardt <mburghardt@mozilla.com> * gtests/pk11_gtest/pk11_aes_gcm_unittest.cc, lib/freebl/gcm.c, lib/freebl/intel-gcm-wrap.c: Bug 1578238 - Validate tag size in AES_GCM. r=kjacobs,jcj Validate tag size in AES_GCM. [4e3971fd992c] * gtests/pk11_gtest/manifest.mn, gtests/pk11_gtest/pk11_gtest.gyp, gtests/pk11_gtest/pk11_seed_cbc_unittest.cc, lib/freebl/seed.c: Bug 1576295 - SEED_CBC encryption check input arguments. r=kjacobs,jcj,mt Ensure the arguments passed to these functions are valid. [7580a5a212c7] Differential Revision: https://phabricator.services.mozilla.com/D47494 --HG-- extra : moz-landing-system : lando
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=2 et sw=2 tw=80: */
|
|
/* 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_util_h__
|
|
#define scoped_ptrs_util_h__
|
|
|
|
#include <memory>
|
|
#include "pkcs11uri.h"
|
|
#include "secoid.h"
|
|
|
|
struct ScopedDelete {
|
|
void operator()(SECAlgorithmID* id) { SECOID_DestroyAlgorithmID(id, true); }
|
|
void operator()(SECItem* item) { SECITEM_FreeItem(item, true); }
|
|
void operator()(PK11URI* uri) { PK11URI_DestroyURI(uri); }
|
|
void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
|
|
};
|
|
|
|
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(SECAlgorithmID);
|
|
SCOPED(SECItem);
|
|
SCOPED(PK11URI);
|
|
SCOPED(PLArenaPool);
|
|
|
|
#undef SCOPED
|
|
|
|
struct StackSECItem : public SECItem {
|
|
StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}
|
|
~StackSECItem() { SECITEM_FreeItem(this, PR_FALSE); }
|
|
};
|
|
|
|
#endif // scoped_ptrs_util_h__
|