Loading apps/req.c +2 −2 Original line number Diff line number Diff line Loading @@ -1069,7 +1069,7 @@ start: /* add object plus value */ if ((xa=X509_ATTRIBUTE_new()) == NULL) goto err; if ((xa->value.set=sk_new_null()) == NULL) if ((xa->value.set=sk_ASN1_TYPE_new_null()) == NULL) goto err; xa->set=1; Loading @@ -1095,7 +1095,7 @@ start: { BIO_printf(bio_err,"Malloc failure\n"); goto err; } ASN1_TYPE_set(at,bs->type,(char *)bs); sk_push(xa->value.set,(char *)at); sk_ASN1_TYPE_push(xa->value.set,at); bs=NULL; at=NULL; /* only one item per attribute */ Loading crypto/asn1/a_type.c +2 −0 Original line number Diff line number Diff line Loading @@ -344,3 +344,5 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a) } } IMPLEMENT_STACK_OF(ASN1_TYPE) IMPLEMENT_ASN1_SET_OF(ASN1_TYPE) crypto/asn1/asn1.h +31 −27 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ extern "C" { #include <time.h> #include <openssl/bn.h> #include <openssl/stack.h> #include <openssl/safestack.h> #define V_ASN1_UNIVERSAL 0x00 #define V_ASN1_APPLICATION 0x40 Loading Loading @@ -127,6 +128,33 @@ extern "C" { #define B_ASN1_UNKNOWN 0x1000 #define B_ASN1_UTF8STRING 0x2000 #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, \ int ex_class, int is_set); \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class); #define IMPLEMENT_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, \ int ex_class, int is_set) \ { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class) \ { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \ (char *(*)())func, \ (void (*)())free_func, \ ex_tag,ex_class); } typedef struct asn1_ctx_st { unsigned char *p;/* work char pointer */ Loading Loading @@ -233,6 +261,9 @@ typedef struct asn1_type_st } value; } ASN1_TYPE; DECLARE_STACK_OF(ASN1_TYPE) DECLARE_ASN1_SET_OF(ASN1_TYPE) typedef struct asn1_method_st { int (*i2d)(); Loading Loading @@ -553,33 +584,6 @@ STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, char *(*func)(), void (*free_func)(), int ex_tag, int ex_class); #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, \ int ex_class, int is_set); \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class); #define IMPLEMENT_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, \ int ex_class, int is_set) \ { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class) \ { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \ (char *(*)())func, \ (void (*)())free_func, \ ex_tag,ex_class); } #ifdef HEADER_BIO_H int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); Loading crypto/asn1/t_req.c +2 −2 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) if (a->set) { ii=0; count=sk_num(a->value.set); count=sk_ASN1_TYPE_num(a->value.set); get_next: at=(ASN1_TYPE *)sk_value(a->value.set,ii); at=sk_ASN1_TYPE_value(a->value.set,ii); type=at->type; bs=at->value.asn1_string; } Loading crypto/asn1/x_attrib.c +6 −5 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **pp) ret+=i2d_ASN1_OBJECT(a->object,p); if (a->set) ret+=i2d_ASN1_SET(a->value.set,p,i2d_ASN1_TYPE, ret+=i2d_ASN1_SET_OF_ASN1_TYPE(a->value.set,p,i2d_ASN1_TYPE, V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); else ret+=i2d_ASN1_TYPE(a->value.single,p); Loading @@ -105,7 +105,8 @@ X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, unsigned char **pp, (M_ASN1_next == (V_ASN1_CONSTRUCTED|V_ASN1_UNIVERSAL|V_ASN1_SET))) { ret->set=1; M_ASN1_D2I_get_set(ret->value.set,d2i_ASN1_TYPE,ASN1_TYPE_free); M_ASN1_D2I_get_set_type(ASN1_TYPE,ret->value.set,d2i_ASN1_TYPE, ASN1_TYPE_free); } else { Loading @@ -125,9 +126,9 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, char *value) return(NULL); ret->object=OBJ_nid2obj(nid); ret->set=1; if ((ret->value.set=sk_new_null()) == NULL) goto err; if ((ret->value.set=sk_ASN1_TYPE_new_null()) == NULL) goto err; if ((val=ASN1_TYPE_new()) == NULL) goto err; if (!sk_push(ret->value.set,(char *)val)) goto err; if (!sk_ASN1_TYPE_push(ret->value.set,val)) goto err; ASN1_TYPE_set(val,atrtype,value); return(ret); Loading Loading @@ -155,7 +156,7 @@ void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) if (a == NULL) return; ASN1_OBJECT_free(a->object); if (a->set) sk_pop_free(a->value.set,ASN1_TYPE_free); sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free); else ASN1_TYPE_free(a->value.single); Free((char *)a); Loading Loading
apps/req.c +2 −2 Original line number Diff line number Diff line Loading @@ -1069,7 +1069,7 @@ start: /* add object plus value */ if ((xa=X509_ATTRIBUTE_new()) == NULL) goto err; if ((xa->value.set=sk_new_null()) == NULL) if ((xa->value.set=sk_ASN1_TYPE_new_null()) == NULL) goto err; xa->set=1; Loading @@ -1095,7 +1095,7 @@ start: { BIO_printf(bio_err,"Malloc failure\n"); goto err; } ASN1_TYPE_set(at,bs->type,(char *)bs); sk_push(xa->value.set,(char *)at); sk_ASN1_TYPE_push(xa->value.set,at); bs=NULL; at=NULL; /* only one item per attribute */ Loading
crypto/asn1/a_type.c +2 −0 Original line number Diff line number Diff line Loading @@ -344,3 +344,5 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a) } } IMPLEMENT_STACK_OF(ASN1_TYPE) IMPLEMENT_ASN1_SET_OF(ASN1_TYPE)
crypto/asn1/asn1.h +31 −27 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ extern "C" { #include <time.h> #include <openssl/bn.h> #include <openssl/stack.h> #include <openssl/safestack.h> #define V_ASN1_UNIVERSAL 0x00 #define V_ASN1_APPLICATION 0x40 Loading Loading @@ -127,6 +128,33 @@ extern "C" { #define B_ASN1_UNKNOWN 0x1000 #define B_ASN1_UTF8STRING 0x2000 #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, \ int ex_class, int is_set); \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class); #define IMPLEMENT_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, \ int ex_class, int is_set) \ { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class) \ { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \ (char *(*)())func, \ (void (*)())free_func, \ ex_tag,ex_class); } typedef struct asn1_ctx_st { unsigned char *p;/* work char pointer */ Loading Loading @@ -233,6 +261,9 @@ typedef struct asn1_type_st } value; } ASN1_TYPE; DECLARE_STACK_OF(ASN1_TYPE) DECLARE_ASN1_SET_OF(ASN1_TYPE) typedef struct asn1_method_st { int (*i2d)(); Loading Loading @@ -553,33 +584,6 @@ STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, char *(*func)(), void (*free_func)(), int ex_tag, int ex_class); #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, \ int ex_class, int is_set); \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class); #define IMPLEMENT_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, \ int ex_class, int is_set) \ { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \ STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \ long length, \ type *(*func)(type **, \ unsigned char **,long), \ void (*free_func)(type *), \ int ex_tag,int ex_class) \ { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \ (char *(*)())func, \ (void (*)())free_func, \ ex_tag,ex_class); } #ifdef HEADER_BIO_H int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); Loading
crypto/asn1/t_req.c +2 −2 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) if (a->set) { ii=0; count=sk_num(a->value.set); count=sk_ASN1_TYPE_num(a->value.set); get_next: at=(ASN1_TYPE *)sk_value(a->value.set,ii); at=sk_ASN1_TYPE_value(a->value.set,ii); type=at->type; bs=at->value.asn1_string; } Loading
crypto/asn1/x_attrib.c +6 −5 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **pp) ret+=i2d_ASN1_OBJECT(a->object,p); if (a->set) ret+=i2d_ASN1_SET(a->value.set,p,i2d_ASN1_TYPE, ret+=i2d_ASN1_SET_OF_ASN1_TYPE(a->value.set,p,i2d_ASN1_TYPE, V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); else ret+=i2d_ASN1_TYPE(a->value.single,p); Loading @@ -105,7 +105,8 @@ X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, unsigned char **pp, (M_ASN1_next == (V_ASN1_CONSTRUCTED|V_ASN1_UNIVERSAL|V_ASN1_SET))) { ret->set=1; M_ASN1_D2I_get_set(ret->value.set,d2i_ASN1_TYPE,ASN1_TYPE_free); M_ASN1_D2I_get_set_type(ASN1_TYPE,ret->value.set,d2i_ASN1_TYPE, ASN1_TYPE_free); } else { Loading @@ -125,9 +126,9 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, char *value) return(NULL); ret->object=OBJ_nid2obj(nid); ret->set=1; if ((ret->value.set=sk_new_null()) == NULL) goto err; if ((ret->value.set=sk_ASN1_TYPE_new_null()) == NULL) goto err; if ((val=ASN1_TYPE_new()) == NULL) goto err; if (!sk_push(ret->value.set,(char *)val)) goto err; if (!sk_ASN1_TYPE_push(ret->value.set,val)) goto err; ASN1_TYPE_set(val,atrtype,value); return(ret); Loading Loading @@ -155,7 +156,7 @@ void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) if (a == NULL) return; ASN1_OBJECT_free(a->object); if (a->set) sk_pop_free(a->value.set,ASN1_TYPE_free); sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free); else ASN1_TYPE_free(a->value.single); Free((char *)a); Loading