security/nss/lib/pki/pki3hack.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #ifndef PKINSS3HACK_H
michael@0 6 #define PKINSS3HACK_H
michael@0 7
michael@0 8 #ifndef NSSDEVT_H
michael@0 9 #include "nssdevt.h"
michael@0 10 #endif /* NSSDEVT_H */
michael@0 11
michael@0 12 #ifndef DEVT_H
michael@0 13 #include "devt.h"
michael@0 14 #endif /* DEVT_H */
michael@0 15
michael@0 16 #ifndef NSSPKIT_H
michael@0 17 #include "nsspkit.h"
michael@0 18 #endif /* NSSPKIT_H */
michael@0 19
michael@0 20 #include "base.h"
michael@0 21
michael@0 22 #include "cert.h"
michael@0 23
michael@0 24 PR_BEGIN_EXTERN_C
michael@0 25
michael@0 26 #define NSSITEM_FROM_SECITEM(nssit, secit) \
michael@0 27 (nssit)->data = (void *)(secit)->data; \
michael@0 28 (nssit)->size = (PRUint32)(secit)->len;
michael@0 29
michael@0 30 #define SECITEM_FROM_NSSITEM(secit, nssit) \
michael@0 31 (secit)->data = (unsigned char *)(nssit)->data; \
michael@0 32 (secit)->len = (unsigned int)(nssit)->size;
michael@0 33
michael@0 34 NSS_EXTERN NSSTrustDomain *
michael@0 35 STAN_GetDefaultTrustDomain();
michael@0 36
michael@0 37 NSS_EXTERN NSSCryptoContext *
michael@0 38 STAN_GetDefaultCryptoContext();
michael@0 39
michael@0 40 NSS_EXTERN PRStatus
michael@0 41 STAN_InitTokenForSlotInfo(NSSTrustDomain *td, PK11SlotInfo *slot);
michael@0 42
michael@0 43 NSS_EXTERN PRStatus
michael@0 44 STAN_ResetTokenInterator(NSSTrustDomain *td);
michael@0 45
michael@0 46 NSS_EXTERN PRStatus
michael@0 47 STAN_LoadDefaultNSS3TrustDomain(void);
michael@0 48
michael@0 49 NSS_EXTERN PRStatus
michael@0 50 STAN_Shutdown();
michael@0 51
michael@0 52 NSS_EXTERN SECStatus
michael@0 53 STAN_AddModuleToDefaultTrustDomain(SECMODModule *module);
michael@0 54
michael@0 55 NSS_EXTERN SECStatus
michael@0 56 STAN_RemoveModuleFromDefaultTrustDomain(SECMODModule *module);
michael@0 57
michael@0 58 NSS_EXTERN CERTCertificate *
michael@0 59 STAN_ForceCERTCertificateUpdate(NSSCertificate *c);
michael@0 60
michael@0 61 NSS_EXTERN CERTCertificate *
michael@0 62 STAN_GetCERTCertificate(NSSCertificate *c);
michael@0 63
michael@0 64 NSS_EXTERN CERTCertificate *
michael@0 65 STAN_GetCERTCertificateOrRelease(NSSCertificate *c);
michael@0 66
michael@0 67 NSS_EXTERN NSSCertificate *
michael@0 68 STAN_GetNSSCertificate(CERTCertificate *c);
michael@0 69
michael@0 70 NSS_EXTERN CERTCertTrust *
michael@0 71 nssTrust_GetCERTCertTrustForCert(NSSCertificate *c, CERTCertificate *cc);
michael@0 72
michael@0 73 NSS_EXTERN PRStatus
michael@0 74 STAN_DeleteCertTrustMatchingSlot(NSSCertificate *c);
michael@0 75
michael@0 76 NSS_EXTERN PRStatus
michael@0 77 STAN_ChangeCertTrust(CERTCertificate *cc, CERTCertTrust *trust);
michael@0 78
michael@0 79 NSS_EXTERN PRStatus
michael@0 80 nssPKIX509_GetIssuerAndSerialFromDER(NSSDER *der, NSSArena *arena,
michael@0 81 NSSDER *issuer, NSSDER *serial);
michael@0 82
michael@0 83 NSS_EXTERN char *
michael@0 84 STAN_GetCERTCertificateName(PLArenaPool *arenaOpt, NSSCertificate *c);
michael@0 85
michael@0 86 NSS_EXTERN char *
michael@0 87 STAN_GetCERTCertificateNameForInstance(PLArenaPool *arenaOpt,
michael@0 88 NSSCertificate *c,
michael@0 89 nssCryptokiInstance *instance);
michael@0 90
michael@0 91 /* exposing this */
michael@0 92 NSS_EXTERN NSSCertificate *
michael@0 93 NSSCertificate_Create
michael@0 94 (
michael@0 95 NSSArena *arenaOpt
michael@0 96 );
michael@0 97
michael@0 98 /* This function is being put here because it is a hack for
michael@0 99 * PK11_FindCertFromNickname.
michael@0 100 */
michael@0 101 NSS_EXTERN NSSCertificate *
michael@0 102 nssTrustDomain_FindBestCertificateByNicknameForToken
michael@0 103 (
michael@0 104 NSSTrustDomain *td,
michael@0 105 NSSToken *token,
michael@0 106 NSSUTF8 *name,
michael@0 107 NSSTime *timeOpt, /* NULL for "now" */
michael@0 108 NSSUsage *usage,
michael@0 109 NSSPolicies *policiesOpt /* NULL for none */
michael@0 110 );
michael@0 111
michael@0 112 /* This function is being put here because it is a hack for
michael@0 113 * PK11_FindCertsFromNickname.
michael@0 114 */
michael@0 115 NSS_EXTERN NSSCertificate **
michael@0 116 nssTrustDomain_FindCertificatesByNicknameForToken
michael@0 117 (
michael@0 118 NSSTrustDomain *td,
michael@0 119 NSSToken *token,
michael@0 120 NSSUTF8 *name,
michael@0 121 NSSCertificate *rvOpt[],
michael@0 122 PRUint32 maximumOpt, /* 0 for no max */
michael@0 123 NSSArena *arenaOpt
michael@0 124 );
michael@0 125
michael@0 126 /* CERT_TraversePermCertsForSubject */
michael@0 127 NSS_EXTERN PRStatus
michael@0 128 nssTrustDomain_TraverseCertificatesBySubject
michael@0 129 (
michael@0 130 NSSTrustDomain *td,
michael@0 131 NSSDER *subject,
michael@0 132 PRStatus (*callback)(NSSCertificate *c, void *arg),
michael@0 133 void *arg
michael@0 134 );
michael@0 135
michael@0 136 /* CERT_TraversePermCertsForNickname */
michael@0 137 NSS_EXTERN PRStatus
michael@0 138 nssTrustDomain_TraverseCertificatesByNickname
michael@0 139 (
michael@0 140 NSSTrustDomain *td,
michael@0 141 NSSUTF8 *nickname,
michael@0 142 PRStatus (*callback)(NSSCertificate *c, void *arg),
michael@0 143 void *arg
michael@0 144 );
michael@0 145
michael@0 146 /* SEC_TraversePermCerts */
michael@0 147 NSS_EXTERN PRStatus
michael@0 148 nssTrustDomain_TraverseCertificates
michael@0 149 (
michael@0 150 NSSTrustDomain *td,
michael@0 151 PRStatus (*callback)(NSSCertificate *c, void *arg),
michael@0 152 void *arg
michael@0 153 );
michael@0 154
michael@0 155 /* CERT_AddTempCertToPerm */
michael@0 156 NSS_EXTERN PRStatus
michael@0 157 nssTrustDomain_AddTempCertToPerm
michael@0 158 (
michael@0 159 NSSCertificate *c
michael@0 160 );
michael@0 161
michael@0 162 PR_END_EXTERN_C
michael@0 163
michael@0 164 #endif /* PKINSS3HACK_H */

mercurial