mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-09 00:37:32 +09:00
nss: update nss to hg rev e5e10a46b9ad with vc2013 hackfix
This commit is contained in:
parent
ed1b356dfa
commit
dcdc5d70e0
133 changed files with 8084 additions and 2038 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "cert.h"
|
||||
#include "keyhi.h"
|
||||
#include "p12.h"
|
||||
#include "pk11pqg.h"
|
||||
#include "pk11pub.h"
|
||||
#include "pkcs11uri.h"
|
||||
|
||||
|
|
@ -41,6 +42,7 @@ struct ScopedDelete {
|
|||
void operator()(PLArenaPool* arena) { PORT_FreeArena(arena, PR_FALSE); }
|
||||
void operator()(PK11Context* context) { PK11_DestroyContext(context, true); }
|
||||
void operator()(PK11GenericObject* obj) { PK11_DestroyGenericObject(obj); }
|
||||
void operator()(PQGParams* pqg) { PK11_PQG_DestroyParams(pqg); }
|
||||
void operator()(SEC_PKCS12DecoderContext* dcx) {
|
||||
SEC_PKCS12DecoderFinish(dcx);
|
||||
}
|
||||
|
|
@ -66,6 +68,7 @@ SCOPED(CERTName);
|
|||
SCOPED(CERTSubjectPublicKeyInfo);
|
||||
SCOPED(PK11SlotInfo);
|
||||
SCOPED(PK11SymKey);
|
||||
SCOPED(PQGParams);
|
||||
SCOPED(PRFileDesc);
|
||||
SCOPED(SECAlgorithmID);
|
||||
SCOPED(SECKEYEncryptedPrivateKeyInfo);
|
||||
|
|
@ -82,4 +85,9 @@ SCOPED(CERTDistNames);
|
|||
|
||||
#undef SCOPED
|
||||
|
||||
struct StackSECItem : public SECItem {
|
||||
StackSECItem() : SECItem({siBuffer, nullptr, 0}) {}
|
||||
~StackSECItem() { SECITEM_FreeItem(this, PR_FALSE); }
|
||||
};
|
||||
|
||||
#endif // nss_scoped_ptrs_h__
|
||||
|
|
|
|||
34
security/nss/cpputil/scoped_ptrs_smime.h
Normal file
34
security/nss/cpputil/scoped_ptrs_smime.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* -*- 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_smime_h__
|
||||
#define scoped_ptrs_smime_h__
|
||||
|
||||
#include <memory>
|
||||
#include "smime.h"
|
||||
|
||||
struct ScopedDeleteSmime {
|
||||
void operator()(NSSCMSMessage* id) { NSS_CMSMessage_Destroy(id); }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct ScopedMaybeDeleteSmime {
|
||||
void operator()(T* ptr) {
|
||||
if (ptr) {
|
||||
ScopedDeleteSmime del;
|
||||
del(ptr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#define SCOPED(x) \
|
||||
typedef std::unique_ptr<x, ScopedMaybeDeleteSmime<x> > Scoped##x
|
||||
|
||||
SCOPED(NSSCMSMessage);
|
||||
|
||||
#undef SCOPED
|
||||
|
||||
#endif // scoped_ptrs_smime_h__
|
||||
|
|
@ -14,6 +14,7 @@ struct ScopedDeleteSSL {
|
|||
void operator()(SSLResumptionTokenInfo* token) {
|
||||
SSL_DestroyResumptionTokenInfo(token);
|
||||
}
|
||||
void operator()(SSLAeadContext* ctx) { SSL_DestroyAead(ctx); }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
|
@ -29,6 +30,7 @@ struct ScopedMaybeDeleteSSL {
|
|||
#define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDeleteSSL<x> > Scoped##x
|
||||
|
||||
SCOPED(SSLResumptionTokenInfo);
|
||||
SCOPED(SSLAeadContext);
|
||||
|
||||
#undef SCOPED
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ struct ScopedMaybeDelete {
|
|||
SCOPED(SECAlgorithmID);
|
||||
SCOPED(SECItem);
|
||||
SCOPED(PK11URI);
|
||||
SCOPED(PLArenaPool);
|
||||
|
||||
#undef SCOPED
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,32 @@ inline std::ostream& operator<<(std::ostream& os, SSLProtocolVariant v) {
|
|||
return os << ((v == ssl_variant_stream) ? "TLS" : "DTLS");
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, SSLContentType v) {
|
||||
switch (v) {
|
||||
case ssl_ct_change_cipher_spec:
|
||||
return os << "CCS";
|
||||
case ssl_ct_alert:
|
||||
return os << "alert";
|
||||
case ssl_ct_handshake:
|
||||
return os << "handshake";
|
||||
case ssl_ct_application_data:
|
||||
return os << "application data";
|
||||
case ssl_ct_ack:
|
||||
return os << "ack";
|
||||
}
|
||||
return os << "UNKNOWN content type " << static_cast<int>(v);
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, SSLSecretDirection v) {
|
||||
switch (v) {
|
||||
case ssl_secret_read:
|
||||
return os << "read";
|
||||
case ssl_secret_write:
|
||||
return os << "write";
|
||||
}
|
||||
return os << "UNKNOWN secret direction " << static_cast<int>(v);
|
||||
}
|
||||
|
||||
inline bool IsDtls(uint16_t version) { return (version & 0x8000) == 0x8000; }
|
||||
|
||||
inline uint16_t NormalizeTlsVersion(uint16_t version) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue