OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 /* | 5 /* |
6 * Types for encoding/decoding of ASN.1 using BER/DER (Basic/Distinguished | 6 * Types for encoding/decoding of ASN.1 using BER/DER (Basic/Distinguished |
7 * Encoding Rules). | 7 * Encoding Rules). |
8 * | 8 * |
9 * $Id: secasn1t.h,v 1.11 2012/04/25 14:50:16 gerv%gerv.net Exp $ | 9 * $Id: secasn1t.h,v 1.12 2013/01/08 16:19:09 kaie%kuix.de Exp $ |
10 */ | 10 */ |
11 | 11 |
12 #ifndef _SECASN1T_H_ | 12 #ifndef _SECASN1T_H_ |
13 #define _SECASN1T_H_ | 13 #define _SECASN1T_H_ |
14 | 14 |
15 #include "utilrename.h" | 15 #include "utilrename.h" |
16 | 16 |
17 /* | 17 /* |
18 ** An array of these structures defines a BER/DER encoding for an object. | 18 ** An array of these structures defines a BER/DER encoding for an object. |
19 ** | 19 ** |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 #define SEC_ASN1D_MAX_DEPTH 32 | 176 #define SEC_ASN1D_MAX_DEPTH 32 |
177 | 177 |
178 /* | 178 /* |
179 ** Function used for SEC_ASN1_DYNAMIC. | 179 ** Function used for SEC_ASN1_DYNAMIC. |
180 ** "arg" is a pointer to the structure being encoded/decoded | 180 ** "arg" is a pointer to the structure being encoded/decoded |
181 ** "enc", when true, means that we are encoding (false means decoding) | 181 ** "enc", when true, means that we are encoding (false means decoding) |
182 */ | 182 */ |
183 typedef const SEC_ASN1Template * SEC_ASN1TemplateChooser(void *arg, PRBool enc); | 183 typedef const SEC_ASN1Template * SEC_ASN1TemplateChooser(void *arg, PRBool enc); |
184 typedef SEC_ASN1TemplateChooser * SEC_ASN1TemplateChooserPtr; | 184 typedef SEC_ASN1TemplateChooser * SEC_ASN1TemplateChooserPtr; |
185 | 185 |
186 #if defined(_WIN32) | 186 #if defined(_WIN32) || defined(ANDROID) |
187 #define SEC_ASN1_GET(x) NSS_Get_##x(NULL, PR_FALSE) | 187 #define SEC_ASN1_GET(x) NSS_Get_##x(NULL, PR_FALSE) |
188 #define SEC_ASN1_SUB(x) &p_NSS_Get_##x | 188 #define SEC_ASN1_SUB(x) &p_NSS_Get_##x |
189 #define SEC_ASN1_XTRN SEC_ASN1_DYNAMIC | 189 #define SEC_ASN1_XTRN SEC_ASN1_DYNAMIC |
190 #define SEC_ASN1_MKSUB(x) \ | 190 #define SEC_ASN1_MKSUB(x) \ |
191 static const SEC_ASN1TemplateChooserPtr p_NSS_Get_##x = &NSS_Get_##x; | 191 static const SEC_ASN1TemplateChooserPtr p_NSS_Get_##x = &NSS_Get_##x; |
192 #else | 192 #else |
193 #define SEC_ASN1_GET(x) x | 193 #define SEC_ASN1_GET(x) x |
194 #define SEC_ASN1_SUB(x) x | 194 #define SEC_ASN1_SUB(x) x |
195 #define SEC_ASN1_XTRN 0 | 195 #define SEC_ASN1_XTRN 0 |
196 #define SEC_ASN1_MKSUB(x) | 196 #define SEC_ASN1_MKSUB(x) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 * - "depth" is how deep in a nested encoding we are (it is not usually | 261 * - "depth" is how deep in a nested encoding we are (it is not usually |
262 * valuable, but can be useful sometimes so I included it) | 262 * valuable, but can be useful sometimes so I included it) |
263 * - "data_kind" tells you if these bytes are part of the ASN.1 encoded | 263 * - "data_kind" tells you if these bytes are part of the ASN.1 encoded |
264 * octets for identifier, length, contents, or end-of-contents | 264 * octets for identifier, length, contents, or end-of-contents |
265 */ | 265 */ |
266 typedef void (* SEC_ASN1WriteProc)(void *arg, | 266 typedef void (* SEC_ASN1WriteProc)(void *arg, |
267 const char *data, unsigned long len, | 267 const char *data, unsigned long len, |
268 int depth, SEC_ASN1EncodingPart data_kind); | 268 int depth, SEC_ASN1EncodingPart data_kind); |
269 | 269 |
270 #endif /* _SECASN1T_H_ */ | 270 #endif /* _SECASN1T_H_ */ |
OLD | NEW |