summaryrefslogtreecommitdiff
path: root/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_common.h
blob: e1cb0283a4eb2658c9c7232aea9526e69f503cbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/* 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/. */
/*
 * pkix_pl_common.h
 *
 * Common central header file included by all PL source files
 *
 */

#ifndef _PKIX_PL_COMMON_H
#define _PKIX_PL_COMMON_H

/* PKIX HEADERS */
#include "pkix_tools.h"

/* NSS headers */
#include "nss.h"
#include "secport.h"
#include "secasn1.h"
#include "secerr.h"
#include "base64.h"
#include "cert.h"
#include "certdb.h"
#include "genname.h"
#include "xconst.h"
#include "keyhi.h"
#include "ocsp.h"
#include "ocspt.h"
#include "pk11pub.h"
#include "pkcs11.h"
#include "pkcs11t.h"
#include "prio.h"

/* NSPR headers */
#include "nspr.h"

/* private PKIX_PL_NSS system headers */
#include "pkix_pl_object.h"
#include "pkix_pl_string.h"
#include "pkix_pl_ldapt.h"
#include "pkix_pl_aiamgr.h"
#include "pkix_pl_bigint.h"
#include "pkix_pl_oid.h"
#include "pkix_pl_x500name.h"
#include "pkix_pl_generalname.h"
#include "pkix_pl_publickey.h"
#include "pkix_pl_bytearray.h"
#include "pkix_pl_date.h"
#include "pkix_pl_primhash.h"
#include "pkix_pl_basicconstraints.h"
#include "pkix_pl_bytearray.h"
#include "pkix_pl_cert.h"
#include "pkix_pl_certpolicyinfo.h"
#include "pkix_pl_certpolicymap.h"
#include "pkix_pl_certpolicyqualifier.h"
#include "pkix_pl_crldp.h"
#include "pkix_pl_crl.h"
#include "pkix_pl_crlentry.h"
#include "pkix_pl_nameconstraints.h"
#include "pkix_pl_ocsprequest.h"
#include "pkix_pl_ocspresponse.h"
#include "pkix_pl_pk11certstore.h"
#include "pkix_pl_socket.h"
#include "pkix_pl_ldapcertstore.h"
#include "pkix_pl_ldaprequest.h"
#include "pkix_pl_ldapresponse.h"
#include "pkix_pl_nsscontext.h"
#include "pkix_pl_httpcertstore.h"
#include "pkix_pl_httpdefaultclient.h"
#include "pkix_pl_infoaccess.h"
#include "pkix_sample_modules.h"

#define MAX_DIGITS_32 (PKIX_UInt32) 10

#define PKIX_PL_NSSCALL(type, func, args)  \
        PKIX_ ## type ## _DEBUG_ARG("( Calling %s).\n", #func); \
        (func args)

#define PKIX_PL_NSSCALLRV(type, lvalue, func, args)  \
        PKIX_ ## type ## _DEBUG_ARG("( Calling %s).\n", #func); \
        lvalue = (func args)

/* see source file for function documentation */

PKIX_Error *
pkix_LockObject(
        PKIX_PL_Object *object,
        void *plContext);

PKIX_Error *
pkix_UnlockObject(
        PKIX_PL_Object *object,
        void *plContext);

PKIX_Boolean
pkix_pl_UInt32_Overflows(char *string);

PKIX_Error *
pkix_pl_helperBytes2Ascii(
        PKIX_UInt32 *tokens,
        PKIX_UInt32 numTokens,
        char **pAscii,
        void *plContext);

PKIX_Error *
pkix_pl_ipAddrBytes2Ascii(
        SECItem *secItem,
        char **pAscii,
        void *plContext);

PKIX_Error *
pkix_pl_oidBytes2Ascii(
        SECItem *secItem,
        char **pAscii,
        void *plContext);

/* --String-Encoding-Conversion-Functions------------------------ */

PKIX_Error *
pkix_UTF16_to_EscASCII(
        const void *utf16String,
        PKIX_UInt32 utf16Length,
        PKIX_Boolean debug,
        char **pDest,
        PKIX_UInt32 *pLength,
        void *plContext);

PKIX_Error *
pkix_EscASCII_to_UTF16(
        const char *escAsciiString,
        PKIX_UInt32 escAsciiLen,
        PKIX_Boolean debug,
        void **pDest,
        PKIX_UInt32 *pLength,
        void *plContext);

PKIX_Error *
pkix_UTF16_to_UTF8(
        const void *utf16String,
        PKIX_UInt32 utf16Length,
        PKIX_Boolean null_Term,
        void **pDest,
        PKIX_UInt32 *pLength,
        void *plContext);

PKIX_Error *
pkix_UTF8_to_UTF16(
        const void *utf8Source,
        PKIX_UInt32 utf8Length,
        void **pDest,
        PKIX_UInt32 *pLength,
        void *plContext);

#endif /* _PKIX_PL_COMMON_H */