2003-08-13 01:53:07 +00:00
/*
Unix SMB / CIFS implementation .
simple ASN1 code
Copyright ( C ) Andrew Tridgell 2001
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2003-08-13 01:53:07 +00:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-08-13 01:53:07 +00:00
*/
# ifndef _ASN_1_H
# define _ASN_1_H
struct nesting {
off_t start ;
size_t taglen ; /* for parsing */
struct nesting * next ;
} ;
2004-11-02 06:42:15 +00:00
struct asn1_data {
2004-05-25 17:50:17 +00:00
uint8_t * data ;
2003-08-13 01:53:07 +00:00
size_t length ;
off_t ofs ;
struct nesting * nesting ;
2007-08-27 18:10:19 +00:00
bool has_error ;
2004-11-02 06:42:15 +00:00
} ;
2003-08-13 01:53:07 +00:00
# define ASN1_APPLICATION(x) ((x)+0x60)
2004-08-12 04:55:59 +00:00
# define ASN1_APPLICATION_SIMPLE(x) ((x)+0x40)
2003-08-13 01:53:07 +00:00
# define ASN1_SEQUENCE(x) ((x)+0x30)
# define ASN1_CONTEXT(x) ((x)+0xa0)
2004-08-12 04:55:59 +00:00
# define ASN1_CONTEXT_SIMPLE(x) ((x)+0x80)
2003-08-13 01:53:07 +00:00
# define ASN1_GENERAL_STRING 0x1b
# define ASN1_OCTET_STRING 0x4
# define ASN1_OID 0x6
# define ASN1_BOOLEAN 0x1
# define ASN1_INTEGER 0x2
# define ASN1_ENUMERATED 0xa
# define ASN1_SET 0x31
# define ASN1_MAX_OIDS 20
2008-01-15 01:04:38 +01:00
# include "lib/util/asn1_proto.h"
2006-03-25 18:47:47 +00:00
2003-08-13 01:53:07 +00:00
# endif /* _ASN_1_H */