With the introduction of public key cryptography into the Network Time Protocol (NTP v4, cf. http://www.ntp.org/), the current version of NTP became a heavy user of OpenSSL.
NTP developers strive to keep the sources warning-free with gcc (using -Wall -Wcast-qual -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes). Without OpenSSL, we've been fairly successfull, but the introduction of OpenSSL worsened the situation alot. This is primarily due to the -Wmissing-prototypes -Wstrict-prototypes switches above. The following patch (relative to OpenSSL 0.9.6g) fixes this and introduces function prototypes where they used to be missing. It consists mainly of introducing typedefs for the various function pointer arguments and structure members that were declared without any arguments. Many of those functions have one (leading) arg of varying pointer type: I've chosen the corresponding void * (or void **) to represent those. To avoid warnings, I needed to cast functions to this generic type in assignments and functions calls. Most of this stuff should be obvious, with two exceptions where this effort pointed out real errors, so this patch clearly has it's merrits: * In crypto/pem/pem_lib.c (PEM_ASN1_read_bio), the d2i function argument is called with four arguments in one place, but with only three (as the prototype suggests) in another. Removing the last argument in the first two calls allowed the testsuite to complete successfully, but the types don't match the prototype, so this is clearly wrong. Someone really familiar with this code needs to have a look. * The other mismatch occurs in crypto/asn1/a_set.c (d2i_ASN1_SET) where d2i is called with a superfluous fourth argument. Besides, x509.h declared an X509_OBJECTS structure with two function pointer members. This type isn't used anywhere, so I have no idea what parameter lists those functions should have. To remove the warning, I've commented this definition for the time being. Rainer =================================================================== RCS file: apps/RCS/openssl.c,v retrieving revision 1.1 diff -up -r1.1 apps/openssl.c --- apps/openssl.c 2002/04/06 18:59:43 1.1 +++ apps/openssl.c 2002/08/16 19:07:01 @@ -350,7 +350,8 @@ static LHASH *prog_init(void) ; qsort(functions,i,sizeof *functions,SortFnByName); - if ((ret=lh_new(hash,cmp)) == NULL) return(NULL); + if ((ret=lh_new((LHASH_HASH *)hash,(LHASH_COMP *)cmp)) == NULL) + return(NULL); for (f=functions; f->name != NULL; f++) lh_insert(ret,f); =================================================================== RCS file: apps/RCS/x509.c,v retrieving revision 1.1 diff -up -r1.1 apps/x509.c --- apps/x509.c 2002/08/08 21:13:58 1.1 +++ apps/x509.c 2002/08/16 18:33:21 @@ -931,7 +931,8 @@ bad: ah.meth=X509_asn1_meth(); /* no macro for this one yet */ - i=ASN1_i2d_bio(i2d_ASN1_HEADER,out,(unsigned char *)&ah); + i=ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_ASN1_HEADER, + out,(unsigned char *)&ah); } else { BIO_printf(bio_err,"bad output format specified for outfile\n"); =================================================================== RCS file: crypto/asn1/RCS/a_d2i_fp.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/a_d2i_fp.c --- crypto/asn1/a_d2i_fp.c 1999/04/23 22:08:07 1.1 +++ crypto/asn1/a_d2i_fp.c 2002/08/15 18:01:44 @@ -64,7 +64,7 @@ #define HEADER_SIZE 8 #ifndef NO_FP_API -char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in, +char *ASN1_d2i_fp(ASN1_METHOD_CREATE *xnew, ASN1_METHOD_D2I *d2i, FILE *in, unsigned char **x) { BIO *b; @@ -82,7 +82,7 @@ char *ASN1_d2i_fp(char *(*xnew)(), char } #endif -char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in, +char *ASN1_d2i_bio(ASN1_METHOD_CREATE *xnew, ASN1_METHOD_D2I *d2i, BIO *in, unsigned char **x) { BUF_MEM *b; =================================================================== RCS file: crypto/asn1/RCS/a_dup.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/a_dup.c --- crypto/asn1/a_dup.c 2000/06/01 22:16:27 1.1 +++ crypto/asn1/a_dup.c 2002/08/15 17:41:29 @@ -62,7 +62,7 @@ #define READ_CHUNK 2048 -char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) +char *ASN1_dup(ASN1_METHOD_I2D *i2d, ASN1_METHOD_D2I *d2i, char *x) { unsigned char *b,*p; long i; =================================================================== RCS file: crypto/asn1/RCS/a_i2d_fp.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/a_i2d_fp.c --- crypto/asn1/a_i2d_fp.c 2000/06/01 22:16:28 1.1 +++ crypto/asn1/a_i2d_fp.c 2002/08/15 23:07:08 @@ -62,7 +62,7 @@ #include <openssl/asn1_mac.h> #ifndef NO_FP_API -int ASN1_i2d_fp(int (*i2d)(), FILE *out, unsigned char *x) +int ASN1_i2d_fp(ASN1_METHOD_I2D *i2d, FILE *out, unsigned char *x) { BIO *b; int ret; @@ -79,7 +79,7 @@ int ASN1_i2d_fp(int (*i2d)(), FILE *out, } #endif -int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x) +int ASN1_i2d_bio(ASN1_METHOD_I2D *i2d, BIO *out, unsigned char *x) { char *b; unsigned char *p; =================================================================== RCS file: crypto/asn1/RCS/a_meth.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/a_meth.c --- crypto/asn1/a_meth.c 1999/07/24 03:09:01 1.1 +++ crypto/asn1/a_meth.c 2002/08/15 16:49:46 @@ -62,16 +62,16 @@ #include <openssl/asn1.h> static ASN1_METHOD ia5string_meth={ - (int (*)()) i2d_ASN1_IA5STRING, - (char *(*)()) d2i_ASN1_IA5STRING, - (char *(*)()) ASN1_STRING_new, - (void (*)()) ASN1_STRING_free}; + (ASN1_METHOD_I2D *) i2d_ASN1_IA5STRING, + (ASN1_METHOD_D2I *) d2i_ASN1_IA5STRING, + (ASN1_METHOD_CREATE *) ASN1_STRING_new, + (ASN1_METHOD_DESTROY *) ASN1_STRING_free}; static ASN1_METHOD bit_string_meth={ - (int (*)()) i2d_ASN1_BIT_STRING, - (char *(*)()) d2i_ASN1_BIT_STRING, - (char *(*)()) ASN1_STRING_new, - (void (*)()) ASN1_STRING_free}; + (ASN1_METHOD_I2D *) i2d_ASN1_BIT_STRING, + (ASN1_METHOD_D2I *) d2i_ASN1_BIT_STRING, + (ASN1_METHOD_CREATE *) ASN1_STRING_new, + (ASN1_METHOD_DESTROY *) ASN1_STRING_free}; ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void) { =================================================================== RCS file: crypto/asn1/RCS/a_set.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/a_set.c --- crypto/asn1/a_set.c 2002/08/08 21:14:32 1.1 +++ crypto/asn1/a_set.c 2002/08/15 18:35:21 @@ -83,8 +83,8 @@ static int SetBlobCmp(const void *elem1, } /* 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)(), int ex_tag, - int ex_class, int is_set) +int i2d_ASN1_SET(STACK *a, unsigned char **pp, ASN1_METHOD_I2D *func, + int ex_tag, int ex_class, int is_set) { int ret=0,r; int i; @@ -152,7 +152,7 @@ SetBlob } STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, - char *(*func)(), void (*free_func)(void *), int ex_tag, int ex_class) + ASN1_METHOD_D2I *func, void (*free_func)(void *), int ex_tag, int +ex_class) { ASN1_CTX c; STACK *ret=NULL; @@ -193,7 +193,7 @@ STACK *d2i_ASN1_SET(STACK **a, unsigned char *s; if (M_ASN1_D2I_end_sequence()) break; - if ((s=func(NULL,&c.p,c.slen,c.max-c.p)) == NULL) + if ((s=func(NULL,&c.p,c.slen)) == NULL) { ASN1err(ASN1_F_D2I_ASN1_SET,ASN1_R_ERROR_PARSING_SET_ELEMENT); asn1_add_error(*pp,(int)(c.q- *pp)); =================================================================== RCS file: crypto/asn1/RCS/asn1.h,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/asn1.h --- crypto/asn1/asn1.h 2001/12/17 19:23:13 1.1 +++ crypto/asn1/asn1.h 2002/08/15 23:04:42 @@ -372,12 +372,17 @@ typedef struct asn1_type_st DECLARE_STACK_OF(ASN1_TYPE) DECLARE_ASN1_SET_OF(ASN1_TYPE) +typedef int (ASN1_METHOD_I2D)(void *, unsigned char **); +typedef char *(ASN1_METHOD_D2I)(void **, unsigned char **, long); +typedef char *(ASN1_METHOD_CREATE)(void); +typedef void (ASN1_METHOD_DESTROY)(void *); + typedef struct asn1_method_st { - int (*i2d)(); - char *(*d2i)(); - char *(*create)(); - void (*destroy)(); + ASN1_METHOD_I2D *i2d; + ASN1_METHOD_D2I *d2i; + ASN1_METHOD_CREATE *create; + ASN1_METHOD_DESTROY *destroy; } ASN1_METHOD; /* This is used when parsing some Netscape objects */ @@ -750,9 +755,9 @@ ASN1_TIME * d2i_ASN1_TIME(ASN1_TIME **a, ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); int i2d_ASN1_SET(STACK *a, unsigned char **pp, - int (*func)(), int ex_tag, int ex_class, int is_set); + ASN1_METHOD_I2D *func, int ex_tag, int ex_class, int is_set); STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, - char *(*func)(), void (*free_func)(void *), + ASN1_METHOD_D2I *func, void (*free_func)(void *), int ex_tag, int ex_class); #ifndef NO_BIO @@ -803,19 +808,19 @@ void ASN1_put_object(unsigned char **pp, int ASN1_object_size(int constructed, int length, int tag); /* Used to implement other functions */ -char *ASN1_dup(int (*i2d)(),char *(*d2i)(),char *x); +char *ASN1_dup(ASN1_METHOD_I2D *i2d, ASN1_METHOD_D2I *d2i, char *x); #ifndef NO_FP_API -char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x); -int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x); +char *ASN1_d2i_fp(ASN1_METHOD_CREATE *xnew,ASN1_METHOD_D2I *d2i,FILE *fp,unsigned +char **x); +int ASN1_i2d_fp(ASN1_METHOD_I2D *i2d,FILE *out,unsigned char *x); int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); #endif int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); #ifndef NO_BIO -char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x); -int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x); +char *ASN1_d2i_bio(ASN1_METHOD_CREATE *xnew,ASN1_METHOD_D2I *d2i,BIO *bp,unsigned +char **x); +int ASN1_i2d_bio(ASN1_METHOD_I2D *i2d,BIO *out,unsigned char *x); int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); @@ -849,12 +854,12 @@ int ASN1_TYPE_set_int_octetstring(ASN1_T int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num, unsigned char *data, int max_len); -STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), - void (*free_func)(void *) ); -unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, - int *len ); -void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)()); -ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct); +STACK *ASN1_seq_unpack(unsigned char *buf, int len, + ASN1_METHOD_D2I *d2i, ASN1_METHOD_DESTROY *free_func); +unsigned char *ASN1_seq_pack(STACK *safes, ASN1_METHOD_I2D *i2d, + unsigned char **buf, int *len ); +void *ASN1_unpack_string(ASN1_STRING *oct, ASN1_METHOD_D2I *d2i); +ASN1_STRING *ASN1_pack_string(void *obj, ASN1_METHOD_I2D *i2d, ASN1_OCTET_STRING +**oct); void ASN1_STRING_set_default_mask(unsigned long mask); int ASN1_STRING_set_default_mask_asc(char *p); =================================================================== RCS file: crypto/asn1/RCS/asn1_mac.h,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/asn1_mac.h --- crypto/asn1/asn1_mac.h 2001/01/28 14:18:20 1.1 +++ crypto/asn1/asn1_mac.h 2002/08/15 19:38:36 @@ -370,14 +370,16 @@ err:\ #define M_ASN1_I2D_len_IMP_opt(a,f) if (a != NULL) M_ASN1_I2D_len(a,f) #define M_ASN1_I2D_len_SET(a,f) \ - ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); + ret+=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,\ + V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); #define M_ASN1_I2D_len_SET_type(type,a,f) \ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \ V_ASN1_UNIVERSAL,IS_SET); #define M_ASN1_I2D_len_SEQUENCE(a,f) \ - ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ + ret+=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f, \ + V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \ IS_SEQUENCE); #define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \ @@ -396,7 +398,8 @@ err:\ if (a) M_ASN1_I2D_len_SEQUENCE_type(type,a,f); #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); + ret+=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,x, \ + V_ASN1_CONTEXT_SPECIFIC,IS_SET); #define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \ ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \ @@ -404,8 +407,8 @@ err:\ #define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \ if ((a != NULL) && (sk_num(a) != 0)) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); + ret+=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,x, \ + V_ASN1_CONTEXT_SPECIFIC, IS_SET); #define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \ if ((a != NULL) && (sk_##type##_num(a) != 0)) \ @@ -413,13 +416,13 @@ err:\ V_ASN1_CONTEXT_SPECIFIC,IS_SET); #define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); + ret+=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,x, \ + V_ASN1_CONTEXT_SPECIFIC, IS_SEQUENCE); #define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \ if ((a != NULL) && (sk_num(a) != 0)) \ - ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SEQUENCE); + ret+=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,x, \ + V_ASN1_CONTEXT_SPECIFIC, IS_SEQUENCE); #define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \ if ((a != NULL) && (sk_##type##_num(a) != 0)) \ @@ -437,15 +440,16 @@ err:\ #define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \ if ((a != NULL) && (sk_num(a) != 0))\ { \ - v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ + v=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,tag, \ + V_ASN1_UNIVERSAL,IS_SET); \ ret+=ASN1_object_size(1,v,mtag); \ } #define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ if ((a != NULL) && (sk_num(a) != 0))\ { \ - v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \ - IS_SEQUENCE); \ + v=i2d_ASN1_SET(a,NULL,(ASN1_METHOD_I2D *)f,tag, \ + V_ASN1_UNIVERSAL, IS_SEQUENCE); \ ret+=ASN1_object_size(1,v,mtag); \ } @@ -478,18 +482,20 @@ err:\ *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\ } -#define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\ - V_ASN1_UNIVERSAL,IS_SET) +#define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f, \ + V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) #define M_ASN1_I2D_put_SET_type(type,a,f) \ i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET) -#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ +#define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f,x,\ V_ASN1_CONTEXT_SPECIFIC,IS_SET) #define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \ i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET) -#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\ +#define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p, \ + (ASN1_METHOD_I2D *)f,x,\ V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE) -#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\ +#define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f,\ + V_ASN1_SEQUENCE,\ V_ASN1_UNIVERSAL,IS_SEQUENCE) #define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \ @@ -502,8 +508,8 @@ err:\ #define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \ if ((a != NULL) && (sk_num(a) != 0)) \ - { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ - IS_SET); } + { i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f,x, \ + V_ASN1_CONTEXT_SPECIFIC, IS_SET); } #define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \ if ((a != NULL) && (sk_##type##_num(a) != 0)) \ @@ -513,7 +519,8 @@ err:\ #define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \ if ((a != NULL) && (sk_num(a) != 0)) \ - { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \ + { i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f,x, \ + V_ASN1_CONTEXT_SPECIFIC, \ IS_SEQUENCE); } #define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \ @@ -533,14 +540,16 @@ err:\ if ((a != NULL) && (sk_num(a) != 0)) \ { \ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \ + i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f,tag, \ + V_ASN1_UNIVERSAL,IS_SET); \ } #define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \ if ((a != NULL) && (sk_num(a) != 0)) \ { \ ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ - i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \ + i2d_ASN1_SET(a,&p,(ASN1_METHOD_I2D *)f,tag, \ + V_ASN1_UNIVERSAL,IS_SEQUENCE); \ } #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \ =================================================================== RCS file: crypto/asn1/RCS/asn_pack.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/asn_pack.c --- crypto/asn1/asn_pack.c 2000/06/21 02:25:08 1.1 +++ crypto/asn1/asn_pack.c 2002/08/15 18:00:20 @@ -64,8 +64,8 @@ /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ -STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), - void (*free_func)(void *)) +STACK *ASN1_seq_unpack(unsigned char *buf, int len, ASN1_METHOD_D2I *d2i, + ASN1_METHOD_DESTROY *free_func) { STACK *sk; unsigned char *pbuf; @@ -80,8 +80,8 @@ STACK *ASN1_seq_unpack(unsigned char *bu * OPENSSL_malloc'ed buffer */ -unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, - int *len) +unsigned char *ASN1_seq_pack(STACK *safes, ASN1_METHOD_I2D *i2d, + unsigned char **buf, int *len) { int safelen; unsigned char *safe, *p; @@ -104,7 +104,7 @@ unsigned char *ASN1_seq_pack(STACK *safe /* Extract an ASN1 object from an ASN1_STRING */ -void *ASN1_unpack_string (ASN1_STRING *oct, char *(*d2i)()) +void *ASN1_unpack_string (ASN1_STRING *oct, ASN1_METHOD_D2I *d2i) { unsigned char *p; char *ret; @@ -117,7 +117,7 @@ void *ASN1_unpack_string (ASN1_STRING *o /* Pack an ASN1 object into an ASN1_STRING */ -ASN1_STRING *ASN1_pack_string (void *obj, int (*i2d)(), ASN1_STRING **oct) +ASN1_STRING *ASN1_pack_string (void *obj, ASN1_METHOD_I2D *i2d, ASN1_STRING **oct) { unsigned char *p; ASN1_STRING *octmp; =================================================================== RCS file: crypto/asn1/RCS/d2i_r_pr.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/d2i_r_pr.c --- crypto/asn1/d2i_r_pr.c 2002/08/08 21:14:35 1.1 +++ crypto/asn1/d2i_r_pr.c 2002/08/15 16:50:54 @@ -65,10 +65,10 @@ #include <openssl/asn1_mac.h> static ASN1_METHOD method={ - (int (*)()) i2d_RSAPrivateKey, - (char *(*)())d2i_RSAPrivateKey, - (char *(*)())RSA_new, - (void (*)()) RSA_free}; + (ASN1_METHOD_I2D *) i2d_RSAPrivateKey, + (ASN1_METHOD_D2I *) d2i_RSAPrivateKey, + (ASN1_METHOD_CREATE *) RSA_new, + (ASN1_METHOD_DESTROY *) RSA_free}; ASN1_METHOD *RSAPrivateKey_asn1_meth(void) { =================================================================== RCS file: crypto/asn1/RCS/n_pkey.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/n_pkey.c --- crypto/asn1/n_pkey.c 2000/06/15 23:47:56 1.1 +++ crypto/asn1/n_pkey.c 2002/08/15 14:59:45 @@ -80,12 +80,14 @@ static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY( static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void); static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *); -int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()) +int i2d_Netscape_RSA(RSA *a, unsigned char **pp, + int (*cb)(char *, int, const char *, int)) { return i2d_RSA_NET(a, pp, cb, 0); } -int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey) +int i2d_RSA_NET(RSA *a, unsigned char **pp, + int (*cb)(char *, int, const char *, int), int sgckey) { int i,j,l[6]; NETSCAPE_PKEY *pkey; @@ -205,12 +207,14 @@ err: } -RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()) +RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, + int (*cb)(char *, int, const char *, int)) { return d2i_RSA_NET(a, pp, length, cb, 0); } -RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey) +RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, + int (*cb)(char *, int, const char *, int), int sgckey) { RSA *ret=NULL; ASN1_OCTET_STRING *os=NULL; @@ -242,13 +246,13 @@ RSA *d2i_RSA_NET(RSA **a, unsigned char } RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, - int (*cb)()) + int (*cb)(char *, int, const char *, int)) { return d2i_RSA_NET_2(a, pp, length, cb, 0); } RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, - int (*cb)(), int sgckey) + int (*cb)(char *, int, const char *, int), int sgckey) { NETSCAPE_PKEY *pkey=NULL; RSA *ret=NULL; =================================================================== RCS file: crypto/asn1/RCS/p5_pbe.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/p5_pbe.c --- crypto/asn1/p5_pbe.c 2000/06/01 22:16:30 1.1 +++ crypto/asn1/p5_pbe.c 2002/08/15 19:40:58 @@ -138,7 +138,8 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int i } astype->type = V_ASN1_SEQUENCE; - if(!ASN1_pack_string(pbe, i2d_PBEPARAM, &astype->value.sequence)) { + if(!ASN1_pack_string(pbe, (ASN1_METHOD_I2D *)i2d_PBEPARAM, + &astype->value.sequence)) { ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE); return NULL; } =================================================================== RCS file: crypto/asn1/RCS/p5_pbev2.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/p5_pbev2.c --- crypto/asn1/p5_pbev2.c 2000/06/01 22:16:30 1.1 +++ crypto/asn1/p5_pbev2.c 2002/08/15 19:43:10 @@ -241,7 +241,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIP if(!(pbe2->keyfunc->parameter = ASN1_TYPE_new())) goto merr; - if(!ASN1_pack_string(kdf, i2d_PBKDF2PARAM, + if(!ASN1_pack_string(kdf, (ASN1_METHOD_I2D *)i2d_PBKDF2PARAM, &pbe2->keyfunc->parameter->value.sequence)) goto merr; pbe2->keyfunc->parameter->type = V_ASN1_SEQUENCE; @@ -257,7 +257,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIP /* Encode PBE2PARAM into parameter */ - if(!ASN1_pack_string(pbe2, i2d_PBE2PARAM, + if(!ASN1_pack_string(pbe2, (ASN1_METHOD_I2D *)i2d_PBE2PARAM, &ret->parameter->value.sequence)) goto merr; ret->parameter->type = V_ASN1_SEQUENCE; =================================================================== RCS file: crypto/asn1/RCS/x_x509.c,v retrieving revision 1.1 diff -up -r1.1 crypto/asn1/x_x509.c --- crypto/asn1/x_x509.c 2000/09/05 17:53:48 1.1 +++ crypto/asn1/x_x509.c 2002/08/15 16:52:40 @@ -67,10 +67,10 @@ static int x509_meth_num = 0; static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL; static ASN1_METHOD meth={ - (int (*)()) i2d_X509, - (char *(*)())d2i_X509, - (char *(*)())X509_new, - (void (*)()) X509_free}; + (ASN1_METHOD_I2D *) i2d_X509, + (ASN1_METHOD_D2I *) d2i_X509, + (ASN1_METHOD_CREATE *) X509_new, + (ASN1_METHOD_DESTROY *) X509_free}; ASN1_METHOD *X509_asn1_meth(void) { =================================================================== RCS file: crypto/conf/RCS/conf.h,v retrieving revision 1.1 diff -up -r1.1 crypto/conf/conf.h --- crypto/conf/conf.h 2002/02/21 16:38:09 1.1 +++ crypto/conf/conf.h 2002/08/16 17:49:38 @@ -119,8 +119,8 @@ struct conf_st }; CONF *NCONF_new(CONF_METHOD *meth); -CONF_METHOD *NCONF_default(); -CONF_METHOD *NCONF_WIN32(); +CONF_METHOD *NCONF_default(void); +CONF_METHOD *NCONF_WIN32(void); #if 0 /* Just to give you an idea of what I have in mind */ CONF_METHOD *NCONF_XML(); #endif =================================================================== RCS file: crypto/conf/RCS/conf_api.c,v retrieving revision 1.1 diff -up -r1.1 crypto/conf/conf_api.c --- crypto/conf/conf_api.c 2002/05/09 23:06:37 1.1 +++ crypto/conf/conf_api.c 2002/08/16 18:23:45 @@ -178,7 +178,8 @@ int _CONF_new_data(CONF *conf) return 0; } if (conf->data == NULL) - if ((conf->data = lh_new(hash,cmp_conf)) == NULL) + if ((conf->data = lh_new((LHASH_HASH *)hash, + (LHASH_COMP *)cmp_conf)) == NULL) { return 0; } =================================================================== RCS file: crypto/conf/RCS/conf_def.c,v retrieving revision 1.1 diff -up -r1.1 crypto/conf/conf_def.c --- crypto/conf/conf_def.c 2002/08/08 21:15:09 1.1 +++ crypto/conf/conf_def.c 2002/08/16 17:50:29 @@ -113,11 +113,11 @@ static CONF_METHOD WIN32_method = { def_to_int }; -CONF_METHOD *NCONF_default() +CONF_METHOD *NCONF_default(void) { return &default_method; } -CONF_METHOD *NCONF_WIN32() +CONF_METHOD *NCONF_WIN32(void) { return &WIN32_method; } =================================================================== RCS file: crypto/dh/RCS/dh.h,v retrieving revision 1.1 diff -up -r1.1 crypto/dh/dh.h --- crypto/dh/dh.h 2002/03/20 16:01:28 1.1 +++ crypto/dh/dh.h 2002/08/16 19:06:11 @@ -136,16 +136,16 @@ struct dh_st (char *(*)())d2i_DHparams,(char *)(x)) #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -#define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) +#define i2d_DHparams_fp(fp,x) ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_DHparams, \ + (fp), (unsigned char *)(x)) #define d2i_DHparams_bio(bp,x) (DH *)ASN1_d2i_bio((char *(*)())DH_new, \ (char *(*)())d2i_DHparams,(bp),(unsigned char **)(x)) #ifdef __cplusplus #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio((int (*)())i2d_DHparams,(bp), \ (unsigned char *)(x)) #else -#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio(i2d_DHparams,(bp), \ - (unsigned char *)(x)) +#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_DHparams, \ + (bp), (unsigned char *)(x)) #endif DH_METHOD *DH_OpenSSL(void); =================================================================== RCS file: crypto/dsa/RCS/dsa.h,v retrieving revision 1.1 diff -up -r1.1 crypto/dsa/dsa.h --- crypto/dsa/dsa.h 2001/12/17 19:23:44 1.1 +++ crypto/dsa/dsa.h 2002/08/16 18:32:01 @@ -144,8 +144,8 @@ struct dsa_st (unsigned char *)(x)) #define d2i_DSAparams_bio(bp,x) (DSA *)ASN1_d2i_bio((char *(*)())DSA_new, \ (char *(*)())d2i_DSAparams,(bp),(unsigned char **)(x)) -#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio(i2d_DSAparams,(bp), \ - (unsigned char *)(x)) +#define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_DSAparams, \ + (bp), (unsigned char *)(x)) DSA_SIG * DSA_SIG_new(void); =================================================================== RCS file: crypto/err/RCS/err.c,v retrieving revision 1.1 diff -up -r1.1 crypto/err/err.c --- crypto/err/err.c 2001/09/24 15:06:44 1.1 +++ crypto/err/err.c 2002/08/16 18:14:26 @@ -314,7 +314,8 @@ void ERR_load_strings(int lib, ERR_STRIN if (error_hash == NULL) { CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH); - error_hash=lh_new(err_hash,err_cmp); + error_hash=lh_new((LHASH_HASH *)err_hash, + (LHASH_COMP *)err_cmp); if (error_hash == NULL) { CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH); @@ -709,7 +710,8 @@ ERR_STATE *ERR_get_state(void) /* no entry yet in thread_hash for current thread - * thus, it may have changed since we last looked at it */ if (thread_hash == NULL) - thread_hash = lh_new(pid_hash, pid_cmp); + thread_hash = lh_new((LHASH_HASH *)pid_hash, + (LHASH_COMP *)pid_cmp); if (thread_hash == NULL) thread_state_exists = 0; /* allocation error */ else =================================================================== RCS file: crypto/evp/RCS/evp.h,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/evp.h --- crypto/evp/evp.h 2002/08/08 21:15:49 1.1 +++ crypto/evp/evp.h 2002/08/15 15:59:41 @@ -259,17 +259,25 @@ typedef struct evp_pkey_method_st #endif #ifndef EVP_MD +typedef void (EVP_MD_INIT)(void *); +typedef void (EVP_MD_UPDATE)(void *, const void *, unsigned long); +typedef void (EVP_MD_FINAL)(unsigned char *, void *); +typedef int (EVP_MD_SIGN)(int, unsigned char *, unsigned int, unsigned char *, + unsigned int *, void *); +typedef int (EVP_MD_VERIFY)(int, unsigned char *, unsigned int, unsigned char *, + unsigned int, void *); + typedef struct env_md_st { int type; int pkey_type; int md_size; - void (*init)(); - void (*update)(); - void (*final)(); + EVP_MD_INIT *init; + EVP_MD_UPDATE *update; + EVP_MD_FINAL *final; - int (*sign)(); - int (*verify)(); + EVP_MD_SIGN *sign; + EVP_MD_VERIFY *verify; int required_pkey_type[5]; /*EVP_PKEY_xxx */ int block_size; int ctx_size; /* how big does the ctx need to be */ @@ -280,7 +288,8 @@ typedef struct env_md_st #define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} #ifndef NO_DSA -#define EVP_PKEY_DSA_method DSA_sign,DSA_verify, \ +#define EVP_PKEY_DSA_method (EVP_MD_SIGN *)DSA_sign, \ + (EVP_MD_VERIFY *)DSA_verify, \ {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \ EVP_PKEY_DSA4,0} #else @@ -288,11 +297,12 @@ typedef struct env_md_st #endif #ifndef NO_RSA -#define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \ +#define EVP_PKEY_RSA_method (EVP_MD_SIGN *)RSA_sign, \ + (EVP_MD_VERIFY *)RSA_verify, \ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} #define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \ - RSA_sign_ASN1_OCTET_STRING, \ - RSA_verify_ASN1_OCTET_STRING, \ + (EVP_MD_SIGN *)RSA_sign_ASN1_OCTET_STRING, \ + (EVP_MD_VERIFY *)RSA_verify_ASN1_OCTET_STRING, \ {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0} #else #define EVP_PKEY_RSA_method EVP_PKEY_NULL_method =================================================================== RCS file: crypto/evp/RCS/evp_pkey.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/evp_pkey.c --- crypto/evp/evp_pkey.c 2000/06/01 22:18:09 1.1 +++ crypto/evp/evp_pkey.c 2002/08/15 19:19:08 @@ -246,7 +246,8 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_brok p8->pkeyalg->algorithm = OBJ_nid2obj(NID_rsaEncryption); p8->pkeyalg->parameter->type = V_ASN1_NULL; - if (!ASN1_pack_string ((char *)pkey, i2d_PrivateKey, + if (!ASN1_pack_string ((char *)pkey, + (ASN1_METHOD_I2D *)i2d_PrivateKey, &p8->pkey->value.octet_string)) { EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); PKCS8_PRIV_KEY_INFO_free (p8); @@ -329,7 +330,8 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY case PKCS8_OK: case PKCS8_NO_OCTET: - if (!ASN1_pack_string((char *)prkey, i2d_ASN1_INTEGER, + if (!ASN1_pack_string((char *)prkey, + (ASN1_METHOD_I2D *)i2d_ASN1_INTEGER, &p8->pkey->value.octet_string)) { EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); M_ASN1_INTEGER_free (prkey); @@ -363,7 +365,8 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY p8->pkey->value.octet_string = ASN1_OCTET_STRING_new(); - if (!ASN1_seq_pack_ASN1_TYPE(ndsa, i2d_ASN1_TYPE, + if (!ASN1_seq_pack_ASN1_TYPE(ndsa, + (ASN1_METHOD_I2D *)i2d_ASN1_TYPE, &p8->pkey->value.octet_string->data, &p8->pkey->value.octet_string->length)) { @@ -391,7 +394,8 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY p8->pkey->value.octet_string = ASN1_OCTET_STRING_new(); - if (!ASN1_seq_pack_ASN1_TYPE(ndsa, i2d_ASN1_TYPE, + if (!ASN1_seq_pack_ASN1_TYPE(ndsa, + (ASN1_METHOD_I2D *)i2d_ASN1_TYPE, &p8->pkey->value.octet_string->data, &p8->pkey->value.octet_string->length)) { =================================================================== RCS file: crypto/evp/RCS/m_dss.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_dss.c --- crypto/evp/m_dss.c 1999/04/27 04:18:10 1.1 +++ crypto/evp/m_dss.c 2002/08/15 15:50:21 @@ -68,9 +68,9 @@ static EVP_MD dsa_md= NID_dsaWithSHA, NID_dsaWithSHA, SHA_DIGEST_LENGTH, - SHA1_Init, - SHA1_Update, - SHA1_Final, + (EVP_MD_INIT *)SHA1_Init, + (EVP_MD_UPDATE *)SHA1_Update, + (EVP_MD_FINAL *)SHA1_Final, EVP_PKEY_DSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX), =================================================================== RCS file: crypto/evp/RCS/m_dss1.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_dss1.c --- crypto/evp/m_dss1.c 1999/04/27 04:18:10 1.1 +++ crypto/evp/m_dss1.c 2002/08/15 15:53:42 @@ -68,9 +68,9 @@ static EVP_MD dss1_md= NID_dsa, NID_dsaWithSHA1, SHA_DIGEST_LENGTH, - SHA1_Init, - SHA1_Update, - SHA1_Final, + (EVP_MD_INIT *)SHA1_Init, + (EVP_MD_UPDATE *)SHA1_Update, + (EVP_MD_FINAL *)SHA1_Final, EVP_PKEY_DSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX), =================================================================== RCS file: crypto/evp/RCS/m_md2.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_md2.c --- crypto/evp/m_md2.c 1999/04/27 04:18:10 1.1 +++ crypto/evp/m_md2.c 2002/08/15 15:53:46 @@ -68,9 +68,9 @@ static EVP_MD md2_md= NID_md2, NID_md2WithRSAEncryption, MD2_DIGEST_LENGTH, - MD2_Init, - MD2_Update, - MD2_Final, + (EVP_MD_INIT *)MD2_Init, + (EVP_MD_UPDATE *)MD2_Update, + (EVP_MD_FINAL *)MD2_Final, EVP_PKEY_RSA_method, MD2_BLOCK, sizeof(EVP_MD *)+sizeof(MD2_CTX), =================================================================== RCS file: crypto/evp/RCS/m_md4.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_md4.c --- crypto/evp/m_md4.c 2001/10/10 21:50:56 1.1 +++ crypto/evp/m_md4.c 2002/08/15 15:53:50 @@ -68,9 +68,9 @@ static EVP_MD md4_md= NID_md4, NID_md4WithRSAEncryption, MD4_DIGEST_LENGTH, - MD4_Init, - MD4_Update, - MD4_Final, + (EVP_MD_INIT *)MD4_Init, + (EVP_MD_UPDATE *)MD4_Update, + (EVP_MD_FINAL *)MD4_Final, EVP_PKEY_RSA_method, MD4_CBLOCK, sizeof(EVP_MD *)+sizeof(MD4_CTX), =================================================================== RCS file: crypto/evp/RCS/m_md5.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_md5.c --- crypto/evp/m_md5.c 1999/04/27 04:18:11 1.1 +++ crypto/evp/m_md5.c 2002/08/15 15:53:54 @@ -68,9 +68,9 @@ static EVP_MD md5_md= NID_md5, NID_md5WithRSAEncryption, MD5_DIGEST_LENGTH, - MD5_Init, - MD5_Update, - MD5_Final, + (EVP_MD_INIT *)MD5_Init, + (EVP_MD_UPDATE *)MD5_Update, + (EVP_MD_FINAL *)MD5_Final, EVP_PKEY_RSA_method, MD5_CBLOCK, sizeof(EVP_MD *)+sizeof(MD5_CTX), =================================================================== RCS file: crypto/evp/RCS/m_mdc2.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_mdc2.c --- crypto/evp/m_mdc2.c 1999/04/27 04:18:11 1.1 +++ crypto/evp/m_mdc2.c 2002/08/15 15:53:57 @@ -68,9 +68,9 @@ static EVP_MD mdc2_md= NID_mdc2, NID_mdc2WithRSA, MDC2_DIGEST_LENGTH, - MDC2_Init, - MDC2_Update, - MDC2_Final, + (EVP_MD_INIT *)MDC2_Init, + (EVP_MD_UPDATE *)MDC2_Update, + (EVP_MD_FINAL *)MDC2_Final, EVP_PKEY_RSA_ASN1_OCTET_STRING_method, MDC2_BLOCK, sizeof(EVP_MD *)+sizeof(MDC2_CTX), =================================================================== RCS file: crypto/evp/RCS/m_null.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_null.c --- crypto/evp/m_null.c 1999/04/23 22:10:21 1.1 +++ crypto/evp/m_null.c 2002/08/15 15:54:01 @@ -71,9 +71,9 @@ static EVP_MD null_md= NID_undef, NID_undef, 0, - function, - function, - function, + (EVP_MD_INIT *)function, + (EVP_MD_UPDATE *)function, + (EVP_MD_FINAL *)function, EVP_PKEY_NULL_method, 0, =================================================================== RCS file: crypto/evp/RCS/m_ripemd.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_ripemd.c --- crypto/evp/m_ripemd.c 1999/06/29 23:52:07 1.1 +++ crypto/evp/m_ripemd.c 2002/08/15 15:54:04 @@ -69,9 +69,9 @@ static EVP_MD ripemd160_md= NID_ripemd160, NID_ripemd160WithRSA, RIPEMD160_DIGEST_LENGTH, - RIPEMD160_Init, - RIPEMD160_Update, - RIPEMD160_Final, + (EVP_MD_INIT *)RIPEMD160_Init, + (EVP_MD_UPDATE *)RIPEMD160_Update, + (EVP_MD_FINAL *)RIPEMD160_Final, EVP_PKEY_RSA_method, RIPEMD160_CBLOCK, sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), =================================================================== RCS file: crypto/evp/RCS/m_sha.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_sha.c --- crypto/evp/m_sha.c 1999/04/27 04:18:11 1.1 +++ crypto/evp/m_sha.c 2002/08/15 15:54:08 @@ -68,9 +68,9 @@ static EVP_MD sha_md= NID_sha, NID_shaWithRSAEncryption, SHA_DIGEST_LENGTH, - SHA_Init, - SHA_Update, - SHA_Final, + (EVP_MD_INIT *)SHA_Init, + (EVP_MD_UPDATE *)SHA_Update, + (EVP_MD_FINAL *)SHA_Final, EVP_PKEY_RSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX), =================================================================== RCS file: crypto/evp/RCS/m_sha1.c,v retrieving revision 1.1 diff -up -r1.1 crypto/evp/m_sha1.c --- crypto/evp/m_sha1.c 1999/04/27 04:18:11 1.1 +++ crypto/evp/m_sha1.c 2002/08/15 15:54:12 @@ -68,9 +68,9 @@ static EVP_MD sha1_md= NID_sha1, NID_sha1WithRSAEncryption, SHA_DIGEST_LENGTH, - SHA1_Init, - SHA1_Update, - SHA1_Final, + (EVP_MD_INIT *)SHA1_Init, + (EVP_MD_UPDATE *)SHA1_Update, + (EVP_MD_FINAL *)SHA1_Final, EVP_PKEY_RSA_method, SHA_CBLOCK, sizeof(EVP_MD *)+sizeof(SHA_CTX), =================================================================== RCS file: crypto/lhash/RCS/lhash.c,v retrieving revision 1.1 diff -up -r1.1 crypto/lhash/lhash.c --- crypto/lhash/lhash.c 2000/06/01 22:18:19 1.1 +++ crypto/lhash/lhash.c 2002/08/16 17:57:50 @@ -111,7 +111,7 @@ static void expand(LHASH *lh); static void contract(LHASH *lh); static LHASH_NODE **getrn(LHASH *lh, void *data, unsigned long *rhash); -LHASH *lh_new(unsigned long (*h)(), int (*c)()) +LHASH *lh_new(LHASH_HASH *h, LHASH_COMP *c) { LHASH *ret; int i; @@ -267,12 +267,12 @@ void *lh_retrieve(LHASH *lh, void *data) return(ret); } -void lh_doall(LHASH *lh, void (*func)()) +void lh_doall(LHASH *lh, LHASH_DOALL *func) { - lh_doall_arg(lh,func,NULL); + lh_doall_arg(lh,(LHASH_DOALL_ARG *)func,NULL); } -void lh_doall_arg(LHASH *lh, void (*func)(), void *arg) +void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG *func, void *arg) { int i; LHASH_NODE *a,*n; =================================================================== RCS file: crypto/lhash/RCS/lhash.h,v retrieving revision 1.1 diff -up -r1.1 crypto/lhash/lhash.h --- crypto/lhash/lhash.h 2000/06/09 10:41:25 1.1 +++ crypto/lhash/lhash.h 2002/08/16 17:52:49 @@ -84,11 +84,16 @@ typedef struct lhash_node_st #endif } LHASH_NODE; +typedef int (LHASH_COMP)(const void *, const void *); +typedef unsigned long (LHASH_HASH)(const void *); +typedef void (LHASH_DOALL)(const void *); +typedef void (LHASH_DOALL_ARG)(const void *, const void *); + typedef struct lhash_st { LHASH_NODE **b; - int (*comp)(); - unsigned long (*hash)(); + LHASH_COMP *comp; + LHASH_HASH *hash; unsigned int num_nodes; unsigned int num_alloc_nodes; unsigned int p; @@ -120,13 +125,13 @@ typedef struct lhash_st * in lh_insert(). */ #define lh_error(lh) ((lh)->error) -LHASH *lh_new(unsigned long (*h)(/* void *a */), int (*c)(/* void *a,void *b */)); +LHASH *lh_new(LHASH_HASH *h, LHASH_COMP *c); void lh_free(LHASH *lh); void *lh_insert(LHASH *lh, void *data); void *lh_delete(LHASH *lh, void *data); void *lh_retrieve(LHASH *lh, void *data); - void lh_doall(LHASH *lh, void (*func)(/*void *b*/)); -void lh_doall_arg(LHASH *lh, void (*func)(/*void *a,void *b*/),void *arg); +void lh_doall(LHASH *lh, LHASH_DOALL *func); +void lh_doall_arg(LHASH *lh, LHASH_DOALL_ARG *func,void *arg); unsigned long lh_strhash(const char *c); unsigned long lh_num_items(LHASH *lh); =================================================================== RCS file: crypto/RCS/mem_dbg.c,v retrieving revision 1.1 diff -up -r1.1 crypto/mem_dbg.c --- crypto/mem_dbg.c 2001/02/19 10:30:13 1.1 +++ crypto/mem_dbg.c 2002/08/16 17:56:02 @@ -318,7 +318,8 @@ int CRYPTO_push_info_(const char *info, } if (amih == NULL) { - if ((amih=lh_new(app_info_hash,app_info_cmp)) == NULL) + if ((amih=lh_new((LHASH_HASH *)app_info_hash, + (LHASH_COMP *)app_info_cmp)) == NULL) { OPENSSL_free(ami); ret=0; @@ -411,7 +412,8 @@ void CRYPTO_dbg_malloc(void *addr, int n } if (mh == NULL) { - if ((mh=lh_new(mem_hash,mem_cmp)) == NULL) + if ((mh=lh_new((LHASH_HASH *)mem_hash, + (LHASH_COMP *)mem_cmp)) == NULL) { OPENSSL_free(addr); OPENSSL_free(m); =================================================================== RCS file: crypto/objects/RCS/o_names.c,v retrieving revision 1.1 diff -up -r1.1 crypto/objects/o_names.c --- crypto/objects/o_names.c 2002/08/08 21:16:00 1.1 +++ crypto/objects/o_names.c 2002/08/16 18:43:43 @@ -31,7 +31,7 @@ int OBJ_NAME_init(void) { if (names_lh != NULL) return(1); MemCheck_off(); - names_lh=lh_new(obj_name_hash,obj_name_cmp); + names_lh=lh_new((LHASH_HASH *)obj_name_hash,(LHASH_COMP *)obj_name_cmp); MemCheck_on(); return(names_lh != NULL); } @@ -255,7 +255,7 @@ void OBJ_NAME_cleanup(int type) down_load=names_lh->down_load; names_lh->down_load=0; - lh_doall(names_lh,names_lh_free); + lh_doall(names_lh,(LHASH_DOALL *)names_lh_free); if (type < 0) { lh_free(names_lh); =================================================================== RCS file: crypto/objects/RCS/obj_dat.c,v retrieving revision 1.1 diff -up -r1.1 crypto/objects/obj_dat.c --- crypto/objects/obj_dat.c 2002/08/08 21:16:01 1.1 +++ crypto/objects/obj_dat.c 2002/08/16 18:43:54 @@ -177,7 +177,7 @@ static int add_cmp(ADDED_OBJ *ca, ADDED_ static int init_added(void) { if (added != NULL) return(1); - added=lh_new(add_hash,add_cmp); + added=lh_new((LHASH_HASH *)add_hash,(LHASH_COMP *)add_cmp); return(added != NULL); } @@ -203,9 +203,9 @@ void OBJ_cleanup(void) { if (added == NULL) return; added->down_load=0; - lh_doall(added,cleanup1); /* zero counters */ - lh_doall(added,cleanup2); /* set counters */ - lh_doall(added,cleanup3); /* free objects */ + lh_doall(added,(LHASH_DOALL *)cleanup1); /* zero counters */ + lh_doall(added,(LHASH_DOALL *)cleanup2); /* set counters */ + lh_doall(added,(LHASH_DOALL *)cleanup3); /* free objects */ lh_free(added); added=NULL; } =================================================================== RCS file: crypto/pem/RCS/pem.h,v retrieving revision 1.1 diff -up -r1.1 crypto/pem/pem.h --- crypto/pem/pem.h 2001/12/17 19:24:02 1.1 +++ crypto/pem/pem.h 2002/08/16 19:57:49 @@ -488,11 +488,11 @@ int PEM_read_bio(BIO *bp, char **name, c unsigned char **data,long *len); int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data, long len); -char * PEM_ASN1_read_bio(char *(*d2i)(),const char *name,BIO *bp,char **x, - pem_password_cb *cb, void *u); -int PEM_ASN1_write_bio(int (*i2d)(),const char *name,BIO *bp,char *x, - const EVP_CIPHER *enc,unsigned char *kstr,int klen, - pem_password_cb *cb, void *u); +char * PEM_ASN1_read_bio(ASN1_METHOD_D2I *d2i,const char *name,BIO *bp, + char **x, pem_password_cb *cb, void *u); +int PEM_ASN1_write_bio(ASN1_METHOD_I2D *i2d,const char *name,BIO *bp, + char *x,const EVP_CIPHER *enc,unsigned char *kstr, + int klen,pem_password_cb *cb, void *u); STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); @@ -502,9 +502,9 @@ int PEM_X509_INFO_write_bio(BIO *bp,X509 int PEM_read(FILE *fp, char **name, char **header, unsigned char **data,long *len); int PEM_write(FILE *fp,char *name,char *hdr,unsigned char *data,long len); -char * PEM_ASN1_read(char *(*d2i)(),const char *name,FILE *fp,char **x, +char * PEM_ASN1_read(ASN1_METHOD_D2I *d2i,const char *name,FILE *fp,char **x, pem_password_cb *cb, void *u); -int PEM_ASN1_write(int (*i2d)(),const char *name,FILE *fp,char *x, +int PEM_ASN1_write(ASN1_METHOD_I2D *i2d,const char *name,FILE *fp,char *x, const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *callback, void *u); STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, =================================================================== RCS file: crypto/pem/RCS/pem_lib.c,v retrieving revision 1.1 diff -up -r1.1 crypto/pem/pem_lib.c --- crypto/pem/pem_lib.c 2002/08/08 21:16:06 1.1 +++ crypto/pem/pem_lib.c 2002/08/16 21:13:52 @@ -165,7 +165,7 @@ void PEM_dek_info(char *buf, const char } #ifndef NO_FP_API -char *PEM_ASN1_read(char *(*d2i)(), const char *name, FILE *fp, char **x, +char *PEM_ASN1_read(ASN1_METHOD_D2I *d2i, const char *name, FILE *fp, char **x, pem_password_cb *cb, void *u) { BIO *b; @@ -224,8 +224,8 @@ static int check_pem(const char *nm, con return 0; } -char *PEM_ASN1_read_bio(char *(*d2i)(), const char *name, BIO *bp, char **x, - pem_password_cb *cb, void *u) +char *PEM_ASN1_read_bio(ASN1_METHOD_D2I *d2i, const char *name, BIO *bp, + char **x, pem_password_cb *cb, void *u) { EVP_CIPHER_INFO cipher; char *nm=NULL,*header=NULL; @@ -251,9 +251,9 @@ char *PEM_ASN1_read_bio(char *(*d2i)(), p=data; if (strcmp(name,PEM_STRING_EVP_PKEY) == 0) { if (strcmp(nm,PEM_STRING_RSA) == 0) - ret=d2i(EVP_PKEY_RSA,x,&p,len); + ret=d2i(EVP_PKEY_RSA,x,&p); else if (strcmp(nm,PEM_STRING_DSA) == 0) - ret=d2i(EVP_PKEY_DSA,x,&p,len); + ret=d2i(EVP_PKEY_DSA,x,&p); else if (strcmp(nm,PEM_STRING_PKCS8INF) == 0) { PKCS8_PRIV_KEY_INFO *p8inf; p8inf=d2i_PKCS8_PRIV_KEY_INFO( @@ -297,7 +297,7 @@ err: } #ifndef NO_FP_API -int PEM_ASN1_write(int (*i2d)(), const char *name, FILE *fp, char *x, +int PEM_ASN1_write(ASN1_METHOD_I2D *i2d, const char *name, FILE *fp, char *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *callback, void *u) { @@ -316,8 +316,8 @@ int PEM_ASN1_write(int (*i2d)(), const c } #endif -int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x, - const EVP_CIPHER *enc, unsigned char *kstr, int klen, +int PEM_ASN1_write_bio(ASN1_METHOD_I2D *i2d, const char *name, BIO *bp, + char *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *callback, void *u) { EVP_CIPHER_CTX ctx; =================================================================== RCS file: crypto/pkcs12/RCS/p12_add.c,v retrieving revision 1.1 diff -up -r1.1 crypto/pkcs12/p12_add.c --- crypto/pkcs12/p12_add.c 2000/05/16 19:53:37 1.1 +++ crypto/pkcs12/p12_add.c 2002/08/15 19:52:58 @@ -138,7 +138,7 @@ PKCS7 *PKCS12_pack_p7data (STACK_OF(PKCS return NULL; } - if (!ASN1_seq_pack_PKCS12_SAFEBAG(sk, i2d_PKCS12_SAFEBAG, + if (!ASN1_seq_pack_PKCS12_SAFEBAG(sk, (ASN1_METHOD_I2D *)i2d_PKCS12_SAFEBAG, &p7->d.data->data, &p7->d.data->length)) { PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE); =================================================================== RCS file: crypto/pkcs12/RCS/pkcs12.h,v retrieving revision 1.1 diff -up -r1.1 crypto/pkcs12/pkcs12.h --- crypto/pkcs12/pkcs12.h 2002/08/08 21:16:14 1.1 +++ crypto/pkcs12/pkcs12.h 2002/08/15 19:54:22 @@ -167,7 +167,7 @@ ASN1_seq_unpack_PKCS12_SAFEBAG((p7)->d.d d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free) #define M_PKCS12_pack_authsafes(p12, safes) \ -ASN1_seq_pack_PKCS7((safes), i2d_PKCS7,\ +ASN1_seq_pack_PKCS7((safes), (ASN1_METHOD_I2D *)i2d_PKCS7,\ &(p12)->authsafes->d.data->data, &(p12)->authsafes->d.data->length) #define M_PKCS12_unpack_authsafes(p12) \ =================================================================== RCS file: crypto/pkcs7/RCS/pk7_lib.c,v retrieving revision 1.1 diff -up -r1.1 crypto/pkcs7/pk7_lib.c --- crypto/pkcs7/pk7_lib.c 2000/02/22 18:45:11 1.1 +++ crypto/pkcs7/pk7_lib.c 2002/08/15 19:51:33 @@ -415,7 +415,7 @@ int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INF M_ASN1_INTEGER_dup(X509_get_serialNumber(x509)); X509_ALGOR_free(p7i->key_enc_algor); - p7i->key_enc_algor=(X509_ALGOR *)ASN1_dup(i2d_X509_ALGOR, + p7i->key_enc_algor=(X509_ALGOR *)ASN1_dup((ASN1_METHOD_I2D *)i2d_X509_ALGOR, (char *(*)())d2i_X509_ALGOR, (char *)x509->cert_info->key->algor); =================================================================== RCS file: crypto/rsa/RCS/rsa.h,v retrieving revision 1.1 diff -up -r1.1 crypto/rsa/rsa.h --- crypto/rsa/rsa.h 2002/02/14 15:36:11 1.1 +++ crypto/rsa/rsa.h 2002/08/15 14:56:59 @@ -219,15 +219,20 @@ int RSA_print_fp(FILE *fp, RSA *r,int of int RSA_print(BIO *bp, RSA *r,int offset); #endif -int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey); -RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey); -RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey); +int i2d_RSA_NET(RSA *a, unsigned char **pp, + int (*cb)(char *, int, const char *, int), int sgckey); +RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, + int (*cb)(char *, int, const char *, int), int sgckey); +RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, + int (*cb)(char *, int, const char *, int), int sgckey); -int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); -RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); +int i2d_Netscape_RSA(RSA *a, unsigned char **pp, + int (*cb)(char *, int, const char *, int)); +RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)(char *, +int, const char *, int)); /* Naughty internal function required elsewhere, to handle a MS structure * that is the same as the netscape one :-) */ -RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, int (*cb)()); +RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, + int (*cb)(char *, int, const char *, int)); /* The following 2 functions sign and verify a X509_SIG ASN1 object * inside PKCS#1 padded RSA encryption */ =================================================================== RCS file: crypto/stack/RCS/safestack.h,v retrieving revision 1.1 diff -up -r1.1 crypto/stack/safestack.h --- crypto/stack/safestack.h 2000/09/05 17:53:50 1.1 +++ crypto/stack/safestack.h 2002/08/15 20:24:17 @@ -122,7 +122,7 @@ STACK_OF(type) \ #define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ ((int (*)(STACK_OF(type) *,unsigned char **, \ int (*)(type *,unsigned char **), int , int , int)) i2d_ASN1_SET) \ - (st,pp,i2d_func,ex_tag,ex_class,is_set) + (st,pp,(ASN1_METHOD_I2D +*)i2d_func,ex_tag,ex_class,is_set) #define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ ((unsigned char *(*)(STACK_OF(type) *, \ @@ -191,7 +191,7 @@ STACK_OF(type) \ #define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ d2i_ASN1_SET(st,pp,length, (char *(*)())d2i_func, (void (*)(void *))free_func, ex_tag,ex_class) #define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \ - i2d_ASN1_SET(st,pp,i2d_func,ex_tag,ex_class,is_set) + i2d_ASN1_SET(st,pp,(ASN1_METHOD_I2D *)i2d_func,ex_tag,ex_class,is_set) #define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \ ASN1_seq_pack(st, i2d_func, buf, len) =================================================================== RCS file: crypto/x509/RCS/x509.h,v retrieving revision 1.1 diff -up -r1.1 crypto/x509/x509.h --- crypto/x509/x509.h 2001/12/17 19:24:26 1.1 +++ crypto/x509/x509.h 2002/08/16 17:40:43 @@ -116,12 +116,15 @@ extern "C" { #define X509v3_KU_DECIPHER_ONLY 0x8000 #define X509v3_KU_UNDEF 0xffff +#if 0 +/* FIXME: Currently unused, disable to avoid missing prototype warnings. */ typedef struct X509_objects_st { int nid; int (*a2i)(); int (*i2a)(); } X509_OBJECTS; +#endif typedef struct X509_algor_st { @@ -963,13 +966,13 @@ X509_INFO * X509_INFO_new(void); void X509_INFO_free(X509_INFO *a); char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); -int ASN1_verify(int (*i2d)(), X509_ALGOR *algor1, +int ASN1_verify(ASN1_METHOD_I2D *i2d, X509_ALGOR *algor1, ASN1_BIT_STRING *signature,char *data,EVP_PKEY *pkey); -int ASN1_digest(int (*i2d)(),const EVP_MD *type,char *data, +int ASN1_digest(ASN1_METHOD_I2D *i2d,const EVP_MD *type,char *data, unsigned char *md,unsigned int *len); -int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, +int ASN1_sign(ASN1_METHOD_I2D *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, ASN1_BIT_STRING *signature, char *data,EVP_PKEY *pkey, const EVP_MD *type); #endif =================================================================== RCS file: crypto/x509/RCS/x_all.c,v retrieving revision 1.1 diff -up -r1.1 crypto/x509/x_all.c --- crypto/x509/x_all.c 2000/09/03 23:13:44 1.1 +++ crypto/x509/x_all.c 2002/08/16 19:03:36 @@ -141,7 +141,7 @@ X509 *d2i_X509_fp(FILE *fp, X509 **x509) int i2d_X509_fp(FILE *fp, X509 *x509) { - return(ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_X509,fp,(unsigned char *)x509)); } #endif @@ -153,7 +153,7 @@ X509 *d2i_X509_bio(BIO *bp, X509 **x509) int i2d_X509_bio(BIO *bp, X509 *x509) { - return(ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_X509,bp,(unsigned char *)x509)); } X509_CRL *X509_CRL_dup(X509_CRL *crl) @@ -172,7 +172,7 @@ X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509 int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) { - return(ASN1_i2d_fp(i2d_X509_CRL,fp,(unsigned char *)crl)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_X509_CRL,fp,(unsigned char *)crl)); } #endif @@ -185,7 +185,7 @@ X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509 int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) { - return(ASN1_i2d_bio(i2d_X509_CRL,bp,(unsigned char *)crl)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_X509_CRL,bp,(unsigned char +*)crl)); } PKCS7 *PKCS7_dup(PKCS7 *p7) @@ -204,7 +204,7 @@ PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7 int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7) { - return(ASN1_i2d_fp(i2d_PKCS7,fp,(unsigned char *)p7)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_PKCS7,fp,(unsigned char *)p7)); } #endif @@ -217,7 +217,7 @@ PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7 int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7) { - return(ASN1_i2d_bio(i2d_PKCS7,bp,(unsigned char *)p7)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_PKCS7,bp,(unsigned char *)p7)); } X509_REQ *X509_REQ_dup(X509_REQ *req) @@ -236,7 +236,7 @@ X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509 int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) { - return(ASN1_i2d_fp(i2d_X509_REQ,fp,(unsigned char *)req)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_X509_REQ,fp,(unsigned char *)req)); } #endif @@ -249,7 +249,7 @@ X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509 int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) { - return(ASN1_i2d_bio(i2d_X509_REQ,bp,(unsigned char *)req)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_X509_REQ,bp,(unsigned char *)req)); } #ifndef NO_RSA @@ -275,7 +275,7 @@ RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa) { - return(ASN1_i2d_fp(i2d_RSAPrivateKey,fp,(unsigned char *)rsa)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_RSAPrivateKey,fp,(unsigned char +*)rsa)); } RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa) @@ -294,12 +294,12 @@ RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **r int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) { - return(ASN1_i2d_fp(i2d_RSAPublicKey,fp,(unsigned char *)rsa)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_RSAPublicKey,fp,(unsigned char +*)rsa)); } int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa) { - return(ASN1_i2d_fp(i2d_RSA_PUBKEY,fp,(unsigned char *)rsa)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_RSA_PUBKEY,fp,(unsigned char *)rsa)); } #endif @@ -312,7 +312,7 @@ RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa) { - return(ASN1_i2d_bio(i2d_RSAPrivateKey,bp,(unsigned char *)rsa)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_RSAPrivateKey,bp,(unsigned char +*)rsa)); } RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa) @@ -331,12 +331,12 @@ RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **r int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) { - return(ASN1_i2d_bio(i2d_RSAPublicKey,bp,(unsigned char *)rsa)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_RSAPublicKey,bp,(unsigned char +*)rsa)); } int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa) { - return(ASN1_i2d_bio(i2d_RSA_PUBKEY,bp,(unsigned char *)rsa)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_RSA_PUBKEY,bp,(unsigned char +*)rsa)); } #endif @@ -351,7 +351,7 @@ DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa) { - return(ASN1_i2d_fp(i2d_DSAPrivateKey,fp,(unsigned char *)dsa)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_DSAPrivateKey,fp,(unsigned char +*)dsa)); } DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa) @@ -363,7 +363,7 @@ DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **d int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa) { - return(ASN1_i2d_fp(i2d_DSA_PUBKEY,fp,(unsigned char *)dsa)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_DSA_PUBKEY,fp,(unsigned char *)dsa)); } #endif @@ -376,7 +376,7 @@ DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa) { - return(ASN1_i2d_bio(i2d_DSAPrivateKey,bp,(unsigned char *)dsa)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_DSAPrivateKey,bp,(unsigned char +*)dsa)); } DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa) @@ -388,7 +388,7 @@ DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **d int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa) { - return(ASN1_i2d_bio(i2d_DSA_PUBKEY,bp,(unsigned char *)dsa)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_DSA_PUBKEY,bp,(unsigned char +*)dsa)); } #endif @@ -452,7 +452,7 @@ X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SI int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8) { - return(ASN1_i2d_fp(i2d_X509_SIG,fp,(unsigned char *)p8)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_X509_SIG,fp,(unsigned char *)p8)); } #endif @@ -464,7 +464,7 @@ X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SI int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8) { - return(ASN1_i2d_bio(i2d_X509_SIG,bp,(unsigned char *)p8)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_X509_SIG,bp,(unsigned char *)p8)); } #ifndef NO_FP_API @@ -479,7 +479,7 @@ PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_ int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf) { - return(ASN1_i2d_fp(i2d_PKCS8_PRIV_KEY_INFO,fp,(unsigned char *)p8inf)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_PKCS8_PRIV_KEY_INFO,fp,(unsigned +char *)p8inf)); } int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key) @@ -495,7 +495,7 @@ int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey) { - return(ASN1_i2d_fp(i2d_PrivateKey,fp,(unsigned char *)pkey)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_PrivateKey,fp,(unsigned char +*)pkey)); } EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a) @@ -506,7 +506,7 @@ EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EV int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey) { - return(ASN1_i2d_fp(i2d_PUBKEY,fp,(unsigned char *)pkey)); + return(ASN1_i2d_fp((ASN1_METHOD_I2D *)i2d_PUBKEY,fp,(unsigned char *)pkey)); } EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a) @@ -528,7 +528,7 @@ PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_ int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf) { - return(ASN1_i2d_bio(i2d_PKCS8_PRIV_KEY_INFO,bp,(unsigned char *)p8inf)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_PKCS8_PRIV_KEY_INFO,bp,(unsigned +char *)p8inf)); } int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key) @@ -544,7 +544,7 @@ int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey) { - return(ASN1_i2d_bio(i2d_PrivateKey,bp,(unsigned char *)pkey)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_PrivateKey,bp,(unsigned char +*)pkey)); } EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a) @@ -555,7 +555,7 @@ EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EV int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey) { - return(ASN1_i2d_bio(i2d_PUBKEY,bp,(unsigned char *)pkey)); + return(ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_PUBKEY,bp,(unsigned char *)pkey)); } EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a) =================================================================== RCS file: ssl/RCS/ssl.h,v retrieving revision 1.1 diff -up -r1.1 ssl/ssl.h --- ssl/ssl.h 2002/08/08 21:18:03 1.1 +++ ssl/ssl.h 2002/08/16 18:34:46 @@ -851,7 +851,7 @@ size_t SSL_get_peer_finished(SSL *s, voi #define d2i_SSL_SESSION_bio(bp,s_id) (SSL_SESSION *)ASN1_d2i_bio( \ (char *(*)())SSL_SESSION_new,(char *(*)())d2i_SSL_SESSION, \ (bp),(unsigned char **)(s_id)) -#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio(i2d_SSL_SESSION, \ +#define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio((ASN1_METHOD_I2D *)i2d_SSL_SESSION, +\ bp,(unsigned char *)s_id) #define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) =================================================================== RCS file: ssl/RCS/ssl_lib.c,v retrieving revision 1.1 diff -up -r1.1 ssl/ssl_lib.c --- ssl/ssl_lib.c 2002/02/27 11:26:20 1.1 +++ ssl/ssl_lib.c 2002/08/16 18:25:30 @@ -1177,7 +1177,8 @@ SSL_CTX *SSL_CTX_new(SSL_METHOD *meth) ret->default_passwd_callback_userdata=NULL; ret->client_cert_cb=NULL; - ret->sessions=lh_new(SSL_SESSION_hash,SSL_SESSION_cmp); + ret->sessions=lh_new((LHASH_HASH *)SSL_SESSION_hash, + (LHASH_COMP *)SSL_SESSION_cmp); if (ret->sessions == NULL) goto err; ret->cert_store=X509_STORE_new(); if (ret->cert_store == NULL) goto err; ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]