summaryrefslogtreecommitdiff
path: root/crypto/asn1
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2000-05-16 19:53:50 +0000
committerBen Laurie <ben@openssl.org>2000-05-16 19:53:50 +0000
commitf2716dada0527bcf200e628fd572514bd395fbfb (patch)
tree553848697e188489bedef2341b6f1889503cfe73 /crypto/asn1
parentb4604683fa66963af4596aff7517c3a009ba7087 (diff)
Typesafety Thought Police Part 2.
Diffstat (limited to 'crypto/asn1')
-rw-r--r--crypto/asn1/asn1.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h
index f340ed41df..1e45aefc7a 100644
--- a/crypto/asn1/asn1.h
+++ b/crypto/asn1/asn1.h
@@ -140,6 +140,8 @@ extern "C" {
#define MBSTRING_UNIV (MBSTRING_FLAG|3)
#define MBSTRING_UTF8 (MBSTRING_FLAG|4)
+struct X509_algor_st;
+
#define DECLARE_ASN1_SET_OF(type) \
int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
int (*func)(type *,unsigned char **), int ex_tag, \
@@ -149,7 +151,14 @@ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
type *(*func)(type **, \
unsigned char **,long), \
void (*free_func)(type *), \
- int ex_tag,int ex_class);
+ int ex_tag,int ex_class); \
+unsigned char *ASN1_seq_pack_##type(STACK_OF(type) *st, \
+ int (*i2d)(type *,unsigned char **), \
+ unsigned char **buf,int *len); \
+STACK_OF(type) *ASN1_seq_unpack_##type(unsigned char *buf,int len, \
+ type *(*d2i)(type **,unsigned char **, \
+ long), \
+ void (*free_func)(type *));
#define IMPLEMENT_ASN1_SET_OF(type) \
int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
@@ -165,7 +174,17 @@ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
{ return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \
(char *(*)())func, \
(void (*)())free_func, \
- ex_tag,ex_class); }
+ ex_tag,ex_class); } \
+unsigned char *ASN1_seq_pack_##type(STACK_OF(type) *st, \
+ int (*i2d)(type *,unsigned char **), \
+ unsigned char **buf,int *len) \
+ { return ASN1_seq_pack((STACK *)st,i2d,buf,len); } \
+STACK_OF(type) *ASN1_seq_unpack_##type(unsigned char *buf,int len, \
+ type *(*d2i)(type **,unsigned char **, \
+ long), \
+ void (*free_func)(type *)) \
+ { return (STACK_OF(type) *)ASN1_seq_unpack(buf,len,(char *(*)())d2i, \
+ (void(*)(void *))free_func); }
typedef struct asn1_ctx_st
{
@@ -771,7 +790,7 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
void (*free_func)() );
unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
- int *len );
+ int *len );
void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct);