diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-08-09 03:04:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:31:33 -0500 |
commit | c0e8144c5d1e402b36ebe04b843eba62e7ab9958 (patch) | |
tree | 1b885ceee1a88e8cb2822051690b023c8f8acb78 /source4/heimdal/lib/asn1/asn1-common.h | |
parent | 4b93e377cd9809199487e20fa53d8a2c98ad32ea (diff) | |
download | samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.tar.gz samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.tar.bz2 samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.zip |
r9221: Try to merge Heimdal across from lorikeet-heimdal to samba4.
This is my first attempt at this, so there may be a few rough edges.
Andrew Bartlett
(This used to be commit 9a1d2f2fec67930975da856a2d365345cec46216)
Diffstat (limited to 'source4/heimdal/lib/asn1/asn1-common.h')
-rw-r--r-- | source4/heimdal/lib/asn1/asn1-common.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/source4/heimdal/lib/asn1/asn1-common.h b/source4/heimdal/lib/asn1/asn1-common.h index 4560b1b29c..01411b384a 100644 --- a/source4/heimdal/lib/asn1/asn1-common.h +++ b/source4/heimdal/lib/asn1/asn1-common.h @@ -1,4 +1,4 @@ -/* $Id: asn1-common.h,v 1.4 2003/07/15 13:57:31 lha Exp $ */ +/* $Id: asn1-common.h,v 1.5 2005/07/12 06:27:14 lha Exp $ */ #include <stddef.h> #include <time.h> @@ -6,6 +6,12 @@ #ifndef __asn1_common_definitions__ #define __asn1_common_definitions__ +typedef struct heim_integer { + size_t length; + void *data; + int negative; +} heim_integer; + typedef struct heim_octet_string { size_t length; void *data; @@ -13,10 +19,44 @@ typedef struct heim_octet_string { typedef char *heim_general_string; typedef char *heim_utf8_string; +typedef char *heim_printable_string; +typedef char *heim_ia5_string; + +typedef struct heim_bmp_string { + size_t length; + uint16_t *data; +} heim_bmp_string; + +typedef struct heim_universal_string { + size_t length; + uint32_t *data; +} heim_universal_string; + typedef struct heim_oid { size_t length; unsigned *components; } heim_oid; +typedef struct heim_bit_string { + size_t length; + void *data; +} heim_bit_string; + +#define ASN1_MALLOC_ENCODE(T, B, BL, S, L, R) \ + do { \ + (BL) = length_##T((S)); \ + (B) = malloc((BL)); \ + if((B) == NULL) { \ + (R) = ENOMEM; \ + } else { \ + (R) = encode_##T(((unsigned char*)(B)) + (BL) - 1, (BL), \ + (S), (L)); \ + if((R) != 0) { \ + free((B)); \ + (B) = NULL; \ + } \ + } \ + } while (0) + #endif |