diff options
Diffstat (limited to 'crypto/asn1')
82 files changed, 382 insertions, 951 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index 275de43eb6..cd4d835003 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -64,9 +64,7 @@ * ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,ASN1_R_EXPECTING_A_BIT_STRING); */ -int i2d_ASN1_BIT_STRING(a,pp) -ASN1_BIT_STRING *a; -unsigned char **pp; +int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) { int ret,j,r,bits,len; unsigned char *p,*d; @@ -116,10 +114,8 @@ unsigned char **pp; return(r); } -ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(a, pp, length) -ASN1_BIT_STRING **a; -unsigned char **pp; -long length; +ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, + long length) { ASN1_BIT_STRING *ret=NULL; unsigned char *p,*s; @@ -187,10 +183,7 @@ err: /* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de> */ -int ASN1_BIT_STRING_set_bit(a,n,value) -ASN1_BIT_STRING *a; -int n; -int value; +int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) { int w,v,iv; unsigned char *c; @@ -220,9 +213,7 @@ int value; return(1); } -int ASN1_BIT_STRING_get_bit(a,n) -ASN1_BIT_STRING *a; -int n; +int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n) { int w,v; diff --git a/crypto/asn1/a_bmp.c b/crypto/asn1/a_bmp.c index 32a4fc2158..2cb322ab43 100644 --- a/crypto/asn1/a_bmp.c +++ b/crypto/asn1/a_bmp.c @@ -63,18 +63,14 @@ /* ASN1err(ASN1_F_D2I_ASN1_BMPSTRING,ASN1_R_EXPECTING_AN_INTEGER); */ -int i2d_ASN1_BMPSTRING(a, pp) -ASN1_BMPSTRING *a; -unsigned char **pp; +int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp) { return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, V_ASN1_BMPSTRING,V_ASN1_UNIVERSAL)); } -ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(a, pp, length) -ASN1_BMPSTRING **a; -unsigned char **pp; -long length; +ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp, + long length) { ASN1_BMPSTRING *ret=NULL; diff --git a/crypto/asn1/a_bool.c b/crypto/asn1/a_bool.c index 41a95aa278..fc55a92f48 100644 --- a/crypto/asn1/a_bool.c +++ b/crypto/asn1/a_bool.c @@ -64,9 +64,7 @@ * ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,ASN1_R_BOOLEAN_IS_WRONG_LENGTH); */ -int i2d_ASN1_BOOLEAN(a,pp) -int a; -unsigned char **pp; +int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) { int r; unsigned char *p; @@ -81,10 +79,7 @@ unsigned char **pp; return(r); } -int d2i_ASN1_BOOLEAN(a, pp, length) -int *a; -unsigned char **pp; -long length; +int d2i_ASN1_BOOLEAN(int *a, unsigned char **pp, long length) { int ret= -1; unsigned char *p; diff --git a/crypto/asn1/a_bytes.c b/crypto/asn1/a_bytes.c index 9828a55b33..fdfe9ea8ef 100644 --- a/crypto/asn1/a_bytes.c +++ b/crypto/asn1/a_bytes.c @@ -83,11 +83,8 @@ static int asn1_collate_primative(); /* type is a 'bitmap' of acceptable string types. */ -ASN1_STRING *d2i_ASN1_type_bytes(a, pp, length, type) -ASN1_STRING **a; -unsigned char **pp; -long length; -int type; +ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp, + long length, int type) { ASN1_STRING *ret=NULL; unsigned char *p,*s; @@ -150,11 +147,7 @@ err: return(NULL); } -int i2d_ASN1_bytes(a, pp, tag, xclass) -ASN1_STRING *a; -unsigned char **pp; -int tag; -int xclass; +int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass) { int ret,r,constructed; unsigned char *p; @@ -180,12 +173,8 @@ int xclass; return(r); } -ASN1_STRING *d2i_ASN1_bytes(a, pp, length, Ptag, Pclass) -ASN1_STRING **a; -unsigned char **pp; -long length; -int Ptag; -int Pclass; +ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length, + int Ptag, int Pclass) { ASN1_STRING *ret=NULL; unsigned char *p,*s; @@ -277,9 +266,7 @@ err: * them into the one struture that is then returned */ /* There have been a few bug fixes for this function from * Paul Keogh <paul.keogh@sse.ie>, many thanks to him */ -static int asn1_collate_primative(a,c) -ASN1_STRING *a; -ASN1_CTX *c; +static int asn1_collate_primative(ASN1_STRING *a, ASN1_CTX *c) { ASN1_STRING *os=NULL; BUF_MEM b; diff --git a/crypto/asn1/a_d2i_fp.c b/crypto/asn1/a_d2i_fp.c index d952836a91..465986eb63 100644 --- a/crypto/asn1/a_d2i_fp.c +++ b/crypto/asn1/a_d2i_fp.c @@ -64,11 +64,8 @@ #define HEADER_SIZE 8 #ifndef NO_FP_API -char *ASN1_d2i_fp(xnew,d2i,in,x) -char *(*xnew)(); -char *(*d2i)(); -FILE *in; -unsigned char **x; +char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in, + unsigned char **x) { BIO *b; char *ret; @@ -85,11 +82,8 @@ unsigned char **x; } #endif -char *ASN1_d2i_bio(xnew,d2i,in,x) -char *(*xnew)(); -char *(*d2i)(); -BIO *in; -unsigned char **x; +char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in, + unsigned char **x) { BUF_MEM *b; unsigned char *p; diff --git a/crypto/asn1/a_digest.c b/crypto/asn1/a_digest.c index 8ddb65b0dc..20cde71f03 100644 --- a/crypto/asn1/a_digest.c +++ b/crypto/asn1/a_digest.c @@ -66,12 +66,8 @@ #include "x509.h" #include "buffer.h" -int ASN1_digest(i2d,type,data,md,len) -int (*i2d)(); -EVP_MD *type; -char *data; -unsigned char *md; -unsigned int *len; +int ASN1_digest(int (*i2d)(), EVP_MD *type, char *data, unsigned char *md, + unsigned int *len) { EVP_MD_CTX ctx; int i; diff --git a/crypto/asn1/a_dup.c b/crypto/asn1/a_dup.c index 961b4cb069..cf5748296c 100644 --- a/crypto/asn1/a_dup.c +++ b/crypto/asn1/a_dup.c @@ -62,10 +62,7 @@ #define READ_CHUNK 2048 -char *ASN1_dup(i2d,d2i,x) -int (*i2d)(); -char *(*d2i)(); -char *x; +char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) { unsigned char *b,*p; long i; diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index c369317473..0f8ad843c0 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -65,9 +65,7 @@ /* ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,ASN1_R_EXPECTING_AN_ENUMERATED); */ -int i2d_ASN1_ENUMERATED(a,pp) -ASN1_ENUMERATED *a; -unsigned char **pp; +int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp) { int pad=0,ret,r,i,t; unsigned char *p,*pt,*n,pb=0; @@ -118,10 +116,8 @@ unsigned char **pp; return(r); } -ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(a, pp, length) -ASN1_ENUMERATED **a; -unsigned char **pp; -long length; +ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp, + long length) { ASN1_ENUMERATED *ret=NULL; unsigned char *p,*to,*s; @@ -196,9 +192,7 @@ err: return(NULL); } -int ASN1_ENUMERATED_set(a,v) -ASN1_ENUMERATED *a; -long v; +int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) { int i,j,k; unsigned char buf[sizeof(long)+1]; @@ -238,8 +232,7 @@ long v; return(1); } -long ASN1_ENUMERATED_get(a) -ASN1_ENUMERATED *a; +long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) { int neg=0,i; long r=0; @@ -268,9 +261,7 @@ ASN1_ENUMERATED *a; return(r); } -ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(bn,ai) -BIGNUM *bn; -ASN1_ENUMERATED *ai; +ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai) { ASN1_ENUMERATED *ret; int len,j; @@ -295,9 +286,7 @@ err: return(NULL); } -BIGNUM *ASN1_ENUMERATED_to_BN(ai,bn) -ASN1_ENUMERATED *ai; -BIGNUM *bn; +BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn) { BIGNUM *ret; diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 3d37e9de71..7992739cad 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -67,19 +67,15 @@ * ASN1err(ASN1_F_D2I_ASN1_GENERALIZEDTIME,ASN1_R_EXPECTING_A_GENERALIZEDTIME); */ -int i2d_ASN1_GENERALIZEDTIME(a,pp) -ASN1_GENERALIZEDTIME *a; -unsigned char **pp; +int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp) { return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, V_ASN1_GENERALIZEDTIME,V_ASN1_UNIVERSAL)); } -ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(a, pp, length) -ASN1_GENERALIZEDTIME **a; -unsigned char **pp; -long length; +ASN1_GENERALIZEDTIME *d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a, + unsigned char **pp, long length) { ASN1_GENERALIZEDTIME *ret=NULL; @@ -103,8 +99,7 @@ err: return(NULL); } -int ASN1_GENERALIZEDTIME_check(d) -ASN1_GENERALIZEDTIME *d; +int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) { static int min[9]={ 0, 0, 1, 1, 0, 0, 0, 0, 0}; static int max[9]={99, 99,12,31,23,59,59,12,59}; @@ -157,9 +152,7 @@ err: return(0); } -int ASN1_GENERALIZEDTIME_set_string(s,str) -ASN1_GENERALIZEDTIME *s; -char *str; +int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str) { ASN1_GENERALIZEDTIME t; @@ -179,9 +172,8 @@ char *str; return(0); } -ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(s, t) -ASN1_GENERALIZEDTIME *s; -time_t t; +ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, + time_t t) { char *p; struct tm *ts; diff --git a/crypto/asn1/a_hdr.c b/crypto/asn1/a_hdr.c index e9de2838d0..d1bf08af4b 100644 --- a/crypto/asn1/a_hdr.c +++ b/crypto/asn1/a_hdr.c @@ -68,9 +68,7 @@ * ASN1err(ASN1_F_ASN1_HEADER_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL); */ -int i2d_ASN1_HEADER(a,pp) -ASN1_HEADER *a; -unsigned char **pp; +int i2d_ASN1_HEADER(ASN1_HEADER *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -85,10 +83,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -ASN1_HEADER *d2i_ASN1_HEADER(a,pp,length) -ASN1_HEADER **a; -unsigned char **pp; -long length; +ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,ASN1_HEADER *,ASN1_HEADER_new); @@ -107,7 +103,7 @@ long length; M_ASN1_D2I_Finish(a,ASN1_HEADER_free,ASN1_F_D2I_ASN1_HEADER); |