sync up with 2.2
[Samba/gbeck.git] / source / include / asn1.h
blobae3cd22dde9841466cc714d80d19f93c7f4f02bc
1 /*
2 Unix SMB/Netbios implementation.
3 Version 3.0
4 simple ASN1 code
5 Copyright (C) Andrew Tridgell 2001
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 struct nesting {
24 off_t start;
25 size_t taglen; /* for parsing */
26 struct nesting *next;
29 typedef struct {
30 uint8 *data;
31 size_t length;
32 off_t ofs;
33 struct nesting *nesting;
34 BOOL has_error;
35 } ASN1_DATA;
38 #define ASN1_APPLICATION(x) ((x)+0x60)
39 #define ASN1_SEQUENCE(x) ((x)+0x30)
40 #define ASN1_CONTEXT(x) ((x)+0xa0)
41 #define ASN1_GENERAL_STRING 0x1b
42 #define ASN1_OCTET_STRING 0x4
43 #define ASN1_OID 0x6
44 #define ASN1_BOOLEAN 0x1
45 #define ASN1_INTEGER 0x2
46 #define ASN1_ENUMERATED 0xa
48 #define ASN1_MAX_OIDS 20
50 /* some well known object IDs */
51 #define OID_SPNEGO "1 3 6 1 5 5 2"
52 #define OID_NTLMSSP "1 3 6 1 4 1 311 2 2 10"
53 #define OID_KERBEROS5_OLD "1 2 840 48018 1 2 2"
54 #define OID_KERBEROS5 "1 2 840 113554 1 2 2"