diff --git a/crypto/asn1/a_d2i_fp.c b/crypto/asn1/a_d2i_fp.c index 40baeb16a..1356a0a26 100644 --- a/crypto/asn1/a_d2i_fp.c +++ b/crypto/asn1/a_d2i_fp.c @@ -66,9 +66,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb); #ifndef NO_OLD_ASN1 #ifndef OPENSSL_NO_FP_API -void *ASN1_d2i_fp(void *(*xnew)(void), - void *(*d2i)(void **,const unsigned char **,long), FILE *in, - void **x) +void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x) { BIO *b; void *ret; @@ -85,9 +83,7 @@ void *ASN1_d2i_fp(void *(*xnew)(void), } #endif -char *ASN1_d2i_bio(void *(*xnew)(void), - void *(*d2i)(void **,const unsigned char **,long), BIO *in, - void **x) +void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x) { BUF_MEM *b = NULL; const unsigned char *p; diff --git a/crypto/asn1/a_dup.c b/crypto/asn1/a_dup.c index 867926337..09f5f7ad8 100644 --- a/crypto/asn1/a_dup.c +++ b/crypto/asn1/a_dup.c @@ -62,23 +62,23 @@ #ifndef NO_OLD_ASN1 -void *ASN1_dup(int (*i2d)(char *,void *), - char *(*d2i)(void *,unsigned char **,long), char *x) +void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x) { unsigned char *b,*p; - long i; + const unsigned char *p2; + int i; char *ret; if (x == NULL) return(NULL); - i=(long)i2d(x,NULL); - b=(unsigned char *)OPENSSL_malloc((unsigned int)i+10); + i=i2d(x,NULL); + b=OPENSSL_malloc(i+10); if (b == NULL) { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } p= b; i=i2d(x,&p); - p= b; - ret=d2i(NULL,&p,i); + p2= b; + ret=d2i(NULL,&p2,i); OPENSSL_free(b); return(ret); } diff --git a/crypto/asn1/a_i2d_fp.c b/crypto/asn1/a_i2d_fp.c index 159c05097..925897c82 100644 --- a/crypto/asn1/a_i2d_fp.c +++ b/crypto/asn1/a_i2d_fp.c @@ -64,8 +64,7 @@ #ifndef NO_OLD_ASN1 #ifndef OPENSSL_NO_FP_API -int ASN1_i2d_fp(int (*i2d)(void *, unsigned char **), FILE *out, - void *x) +int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x) { BIO *b; int ret; @@ -82,8 +81,7 @@ int ASN1_i2d_fp(int (*i2d)(void *, unsigned char **), FILE *out, } #endif -int ASN1_i2d_bio(int (*i2d)(void *, unsigned char **), BIO *out, - unsigned char *x) +int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x) { char *b; unsigned char *p; diff --git a/crypto/asn1/a_set.c b/crypto/asn1/a_set.c index 921871975..958558c20 100644 --- a/crypto/asn1/a_set.c +++ b/crypto/asn1/a_set.c @@ -85,8 +85,8 @@ static int SetBlobCmp(const void *elem1, const void *elem2 ) } /* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ -int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(void *,unsigned char **), int ex_tag, - int ex_class, int is_set) +int i2d_ASN1_SET(STACK *a, unsigned char **pp, i2d_of_void *i2d, int ex_tag, + int ex_class, int is_set) { int ret=0,r; int i; @@ -97,7 +97,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(void *,unsigned char if (a == NULL) return(0); for (i=sk_num(a)-1; i>=0; i--) - ret+=func(sk_value(a,i),NULL); + ret+=i2d(sk_value(a,i),NULL); r=ASN1_object_size(1,ret,ex_tag); if (pp == NULL) return(r); @@ -111,7 +111,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(void *,unsigned char if(!is_set || (sk_num(a) < 2)) { for (i=0; i