diff options
author | Ulf Möller <ulf@openssl.org> | 1999-04-19 21:31:43 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-04-19 21:31:43 +0000 |
commit | 6b691a5c85ddc4e407e32781841fee5c029506cd (patch) | |
tree | 436f1127406e1cacfe83dfcbfff824d89c47d834 /crypto/pem | |
parent | 3edd7ed15de229230f74c79c3d71e7c9c674cf4f (diff) |
Change functions to ANSI C.
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pem_all.c | 230 | ||||
-rw-r--r-- | crypto/pem/pem_err.c | 2 | ||||
-rw-r--r-- | crypto/pem/pem_info.c | 19 | ||||
-rw-r--r-- | crypto/pem/pem_lib.c | 102 | ||||
-rw-r--r-- | crypto/pem/pem_seal.c | 29 | ||||
-rw-r--r-- | crypto/pem/pem_sign.c | 17 |
6 files changed, 94 insertions, 305 deletions
diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c index cd33a9c801..c2bf6eb909 100644 --- a/crypto/pem/pem_all.c +++ b/crypto/pem/pem_all.c @@ -67,38 +67,28 @@ #ifndef NO_FP_API /* The X509 functions */ -X509 *PEM_read_X509(fp,x,cb) -FILE *fp; -X509 **x; -int (*cb)(); +X509 *PEM_read_X509(FILE *fp, X509 **x, int (*cb)()) { return((X509 *)PEM_ASN1_read((char *(*)())d2i_X509, PEM_STRING_X509,fp,(char **)x,cb)); } #endif -X509 *PEM_read_bio_X509(bp,x,cb) -BIO *bp; -X509 **x; -int (*cb)(); +X509 *PEM_read_bio_X509(BIO *bp, X509 **x, int (*cb)()) { return((X509 *)PEM_ASN1_read_bio((char *(*)())d2i_X509, PEM_STRING_X509,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_X509(fp,x) -FILE *fp; -X509 *x; +int PEM_write_X509(FILE *fp, X509 *x) { return(PEM_ASN1_write((int (*)())i2d_X509,PEM_STRING_X509,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_X509(bp,x) -BIO *bp; -X509 *x; +int PEM_write_bio_X509(BIO *bp, X509 *x) { return(PEM_ASN1_write_bio((int (*)())i2d_X509,PEM_STRING_X509,bp, (char *)x, NULL,NULL,0,NULL)); @@ -106,38 +96,28 @@ X509 *x; #ifndef NO_FP_API /* The X509_REQ functions */ -X509_REQ *PEM_read_X509_REQ(fp,x,cb) -FILE *fp; -X509_REQ **x; -int (*cb)(); +X509_REQ *PEM_read_X509_REQ(FILE *fp, X509_REQ **x, int (*cb)()) { return((X509_REQ *)PEM_ASN1_read((char *(*)())d2i_X509_REQ, PEM_STRING_X509_REQ,fp,(char **)x,cb)); } #endif -X509_REQ *PEM_read_bio_X509_REQ(bp,x,cb) -BIO *bp; -X509_REQ **x; -int (*cb)(); +X509_REQ *PEM_read_bio_X509_REQ(BIO *bp, X509_REQ **x, int (*cb)()) { return((X509_REQ *)PEM_ASN1_read_bio((char *(*)())d2i_X509_REQ, PEM_STRING_X509_REQ,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_X509_REQ(fp,x) -FILE *fp; -X509_REQ *x; +int PEM_write_X509_REQ(FILE *fp, X509_REQ *x) { return(PEM_ASN1_write((int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_X509_REQ(bp,x) -BIO *bp; -X509_REQ *x; +int PEM_write_bio_X509_REQ(BIO *bp, X509_REQ *x) { return(PEM_ASN1_write_bio((int (*)())i2d_X509_REQ,PEM_STRING_X509_REQ, bp,(char *)x, NULL,NULL,0,NULL)); @@ -145,38 +125,28 @@ X509_REQ *x; #ifndef NO_FP_API /* The X509_CRL functions */ -X509_CRL *PEM_read_X509_CRL(fp,x,cb) -FILE *fp; -X509_CRL **x; -int (*cb)(); +X509_CRL *PEM_read_X509_CRL(FILE *fp, X509_CRL **x, int (*cb)()) { return((X509_CRL *)PEM_ASN1_read((char *(*)())d2i_X509_CRL, PEM_STRING_X509_CRL,fp,(char **)x,cb)); } #endif -X509_CRL *PEM_read_bio_X509_CRL(bp,x,cb) -BIO *bp; -X509_CRL **x; -int (*cb)(); +X509_CRL *PEM_read_bio_X509_CRL(BIO *bp, X509_CRL **x, int (*cb)()) { return((X509_CRL *)PEM_ASN1_read_bio((char *(*)())d2i_X509_CRL, PEM_STRING_X509_CRL,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_X509_CRL(fp,x) -FILE *fp; -X509_CRL *x; +int PEM_write_X509_CRL(FILE *fp, X509_CRL *x) { return(PEM_ASN1_write((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_X509_CRL(bp,x) -BIO *bp; -X509_CRL *x; +int PEM_write_bio_X509_CRL(BIO *bp, X509_CRL *x) { return(PEM_ASN1_write_bio((int (*)())i2d_X509_CRL,PEM_STRING_X509_CRL, bp,(char *)x, NULL,NULL,0,NULL)); @@ -185,59 +155,40 @@ X509_CRL *x; #ifndef NO_RSA #ifndef NO_FP_API /* The RSAPrivateKey functions */ -RSA *PEM_read_RSAPrivateKey(fp,x,cb) -FILE *fp; -RSA **x; -int (*cb)(); +RSA *PEM_read_RSAPrivateKey(FILE *fp, RSA **x, int (*cb)()) { return((RSA *)PEM_ASN1_read((char *(*)())d2i_RSAPrivateKey, PEM_STRING_RSA,fp,(char **)x,cb)); } -RSA *PEM_read_RSAPublicKey(fp,x,cb) -FILE *fp; -RSA **x; -int (*cb)(); +RSA *PEM_read_RSAPublicKey(FILE *fp, RSA **x, int (*cb)()) { return((RSA *)PEM_ASN1_read((char *(*)())d2i_RSAPublicKey, PEM_STRING_RSA_PUBLIC,fp,(char **)x,cb)); } #endif -RSA *PEM_read_bio_RSAPrivateKey(bp,x,cb) -BIO *bp; -RSA **x; -int (*cb)(); +RSA *PEM_read_bio_RSAPrivateKey(BIO *bp, RSA **x, int (*cb)()) { return((RSA *)PEM_ASN1_read_bio((char *(*)())d2i_RSAPrivateKey, PEM_STRING_RSA,bp,(char **)x,cb)); } -RSA *PEM_read_bio_RSAPublicKey(bp,x,cb) -BIO *bp; -RSA **x; -int (*cb)(); +RSA *PEM_read_bio_RSAPublicKey(BIO *bp, RSA **x, int (*cb)()) { return((RSA *)PEM_ASN1_read_bio((char *(*)())d2i_RSAPublicKey, PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb) -FILE *fp; -RSA *x; -EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_write_RSAPrivateKey(FILE *fp, RSA *x, EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { return(PEM_ASN1_write((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA,fp, (char *)x,enc,kstr,klen,cb)); } -int PEM_write_RSAPublicKey(fp,x) -FILE *fp; -RSA *x; +int PEM_write_RSAPublicKey(FILE *fp, RSA *x) { return(PEM_ASN1_write((int (*)())i2d_RSAPublicKey, PEM_STRING_RSA_PUBLIC,fp, @@ -245,21 +196,14 @@ RSA *x; } #endif -int PEM_write_bio_RSAPrivateKey(bp,x,enc,kstr,klen,cb) -BIO *bp; -RSA *x; -const EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_write_bio_RSAPrivateKey(BIO *bp, RSA *x, const EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { return(PEM_ASN1_write_bio((int (*)())i2d_RSAPrivateKey,PEM_STRING_RSA, bp,(char *)x,enc,kstr,klen,cb)); } -int PEM_write_bio_RSAPublicKey(bp,x) -BIO *bp; -RSA *x; +int PEM_write_bio_RSAPublicKey(BIO *bp, RSA *x) { return(PEM_ASN1_write_bio((int (*)())i2d_RSAPublicKey, PEM_STRING_RSA_PUBLIC, @@ -270,46 +214,30 @@ RSA *x; #ifndef NO_DSA #ifndef NO_FP_API /* The DSAPrivateKey functions */ -DSA *PEM_read_DSAPrivateKey(fp,x,cb) -FILE *fp; -DSA **x; -int (*cb)(); +DSA *PEM_read_DSAPrivateKey(FILE *fp, DSA **x, int (*cb)()) { return((DSA *)PEM_ASN1_read((char *(*)())d2i_DSAPrivateKey, PEM_STRING_DSA,fp,(char **)x,cb)); } #endif -DSA *PEM_read_bio_DSAPrivateKey(bp,x,cb) -BIO *bp; -DSA **x; -int (*cb)(); +DSA *PEM_read_bio_DSAPrivateKey(BIO *bp, DSA **x, int (*cb)()) { return((DSA *)PEM_ASN1_read_bio((char *(*)())d2i_DSAPrivateKey, PEM_STRING_DSA,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb) -FILE *fp; -DSA *x; -const EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_write_DSAPrivateKey(FILE *fp, DSA *x, const EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { return(PEM_ASN1_write((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA,fp, (char *)x,enc,kstr,klen,cb)); } #endif -int PEM_write_bio_DSAPrivateKey(bp,x,enc,kstr,klen,cb) -BIO *bp; -DSA *x; -const EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_write_bio_DSAPrivateKey(BIO *bp, DSA *x, const EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { return(PEM_ASN1_write_bio((int (*)())i2d_DSAPrivateKey,PEM_STRING_DSA, bp,(char *)x,enc,kstr,klen,cb)); @@ -318,33 +246,22 @@ int (*cb)(); #ifndef NO_FP_API /* The PrivateKey functions */ -EVP_PKEY *PEM_read_PrivateKey(fp,x,cb) -FILE *fp; -EVP_PKEY **x; -int (*cb)(); +EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, int (*cb)()) { return((EVP_PKEY *)PEM_ASN1_read((char *(*)())d2i_PrivateKey, PEM_STRING_EVP_PKEY,fp,(char **)x,cb)); } #endif -EVP_PKEY *PEM_read_bio_PrivateKey(bp,x,cb) -BIO *bp; -EVP_PKEY **x; -int (*cb)(); +EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, int (*cb)()) { return((EVP_PKEY *)PEM_ASN1_read_bio((char *(*)())d2i_PrivateKey, PEM_STRING_EVP_PKEY,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_PrivateKey(fp,x,enc,kstr,klen,cb) -FILE *fp; -EVP_PKEY *x; -EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { return(PEM_ASN1_write((int (*)())i2d_PrivateKey, ((x->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA), @@ -352,13 +269,8 @@ int (*cb)(); } #endif -int PEM_write_bio_PrivateKey(bp,x,enc,kstr,klen,cb) -BIO *bp; -EVP_PKEY *x; -EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { return(PEM_ASN1_write_bio((int (*)())i2d_PrivateKey, ((x->type == EVP_PKEY_DSA)?PEM_STRING_DSA:PEM_STRING_RSA), @@ -367,38 +279,28 @@ int (*cb)(); #ifndef NO_FP_API /* The PKCS7 functions */ -PKCS7 *PEM_read_PKCS7(fp,x,cb) -FILE *fp; -PKCS7 **x; -int (*cb)(); +PKCS7 *PEM_read_PKCS7(FILE *fp, PKCS7 **x, int (*cb)()) { return((PKCS7 *)PEM_ASN1_read((char *(*)())d2i_PKCS7, PEM_STRING_PKCS7,fp,(char **)x,cb)); } #endif -PKCS7 *PEM_read_bio_PKCS7(bp,x,cb) -BIO *bp; -PKCS7 **x; -int (*cb)(); +PKCS7 *PEM_read_bio_PKCS7(BIO *bp, PKCS7 **x, int (*cb)()) { return((PKCS7 *)PEM_ASN1_read_bio((char *(*)())d2i_PKCS7, PEM_STRING_PKCS7,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_PKCS7(fp,x) -FILE *fp; -PKCS7 *x; +int PEM_write_PKCS7(FILE *fp, PKCS7 *x) { return(PEM_ASN1_write((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_PKCS7(bp,x) -BIO *bp; -PKCS7 *x; +int PEM_write_bio_PKCS7(BIO *bp, PKCS7 *x) { return(PEM_ASN1_write_bio((int (*)())i2d_PKCS7,PEM_STRING_PKCS7,bp, (char *)x, NULL,NULL,0,NULL)); @@ -407,38 +309,28 @@ PKCS7 *x; #ifndef NO_DH #ifndef NO_FP_API /* The DHparams functions */ -DH *PEM_read_DHparams(fp,x,cb) -FILE *fp; -DH **x; -int (*cb)(); +DH *PEM_read_DHparams(FILE *fp, DH **x, int (*cb)()) { return((DH *)PEM_ASN1_read((char *(*)())d2i_DHparams, PEM_STRING_DHPARAMS,fp,(char **)x,cb)); } #endif -DH *PEM_read_bio_DHparams(bp,x,cb) -BIO *bp; -DH **x; -int (*cb)(); +DH *PEM_read_bio_DHparams(BIO *bp, DH **x, int (*cb)()) { return((DH *)PEM_ASN1_read_bio((char *(*)())d2i_DHparams, PEM_STRING_DHPARAMS,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_DHparams(fp,x) -FILE *fp; -DH *x; +int PEM_write_DHparams(FILE *fp, DH *x) { return(PEM_ASN1_write((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_DHparams(bp,x) -BIO *bp; -DH *x; +int PEM_write_bio_DHparams(BIO *bp, DH *x) { return(PEM_ASN1_write_bio((int (*)())i2d_DHparams,PEM_STRING_DHPARAMS, bp,(char *)x, NULL,NULL,0,NULL)); @@ -448,38 +340,28 @@ DH *x; #ifndef NO_DSA #ifndef NO_FP_API /* The DSAparams functions */ -DSA *PEM_read_DSAparams(fp,x,cb) -FILE *fp; -DSA **x; -int (*cb)(); +DSA *PEM_read_DSAparams(FILE *fp, DSA **x, int (*cb)()) { return((DSA *)PEM_ASN1_read((char *(*)())d2i_DSAparams, PEM_STRING_DSAPARAMS,fp,(char **)x,cb)); } #endif -DSA *PEM_read_bio_DSAparams(bp,x,cb) -BIO *bp; -DSA **x; -int (*cb)(); +DSA *PEM_read_bio_DSAparams(BIO *bp, DSA **x, int (*cb)()) { return((DSA *)PEM_ASN1_read_bio((char *(*)())d2i_DSAparams, PEM_STRING_DSAPARAMS,bp,(char **)x,cb)); } #ifndef NO_FP_API -int PEM_write_DSAparams(fp,x) -FILE *fp; -DSA *x; +int PEM_write_DSAparams(FILE *fp, DSA *x) { return(PEM_ASN1_write((int (*)())i2d_DSAparams,PEM_STRING_DSAPARAMS,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_DSAparams(bp,x) -BIO *bp; -DSA *x; +int PEM_write_bio_DSAparams(BIO *bp, DSA *x) { return(PEM_ASN1_write_bio((int (*)())i2d_DSAparams,PEM_STRING_DSAPARAMS, bp,(char *)x, NULL,NULL,0,NULL)); @@ -489,10 +371,8 @@ DSA *x; /* The Netscape Certificate sequence functions */ #ifndef NO_FP_API -NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(fp,x,cb) -FILE *fp; -NETSCAPE_CERT_SEQUENCE **x; -int (*cb)(); +NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp, + NETSCAPE_CERT_SEQUENCE **x, int (*cb)()) { return((NETSCAPE_CERT_SEQUENCE *) PEM_ASN1_read((char *(*)())d2i_NETSCAPE_CERT_SEQUENCE, @@ -500,10 +380,8 @@ int (*cb)(); } #endif -NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(bp,x,cb) -BIO *bp; -NETSCAPE_CERT_SEQUENCE **x; -int (*cb)(); +NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp, + NETSCAPE_CERT_SEQUENCE **x, int (*cb)()) { return((NETSCAPE_CERT_SEQUENCE *) PEM_ASN1_read_bio((char *(*)())d2i_NETSCAPE_CERT_SEQUENCE, @@ -511,18 +389,14 @@ int (*cb)(); } #ifndef NO_FP_API -int PEM_write_NETSCAPE_CERT_SEQUENCE(fp,x) -FILE *fp; -NETSCAPE_CERT_SEQUENCE *x; +int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp, NETSCAPE_CERT_SEQUENCE *x) { return(PEM_ASN1_write((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, PEM_STRING_X509,fp, (char *)x, NULL,NULL,0,NULL)); } #endif -int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(bp,x) -BIO *bp; -NETSCAPE_CERT_SEQUENCE *x; +int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp, NETSCAPE_CERT_SEQUENCE *x) { return(PEM_ASN1_write_bio((int (*)())i2d_NETSCAPE_CERT_SEQUENCE, PEM_STRING_X509,bp, (char *)x, NULL,NULL,0,NULL)); diff --git a/crypto/pem/pem_err.c b/crypto/pem/pem_err.c index 1bd5c16c84..bffc99f588 100644 --- a/crypto/pem/pem_err.c +++ b/crypto/pem/pem_err.c @@ -106,7 +106,7 @@ static ERR_STRING_DATA PEM_str_reasons[]= #endif -void ERR_load_PEM_strings() +void ERR_load_PEM_strings(void) { static int init=1; diff --git a/crypto/pem/pem_info.c b/crypto/pem/pem_info.c index bb56aa4e4e..7051c099f1 100644 --- a/crypto/pem/pem_info.c +++ b/crypto/pem/pem_info.c @@ -65,10 +65,7 @@ #include "pem.h" #ifndef NO_FP_API -STACK *PEM_X509_INFO_read(fp,sk,cb) -FILE *fp; -STACK *sk; -int (*cb)(); +STACK *PEM_X509_INFO_read(FILE *fp, STACK *sk, int (*cb)()) { BIO *b; STACK *ret; @@ -85,10 +82,7 @@ int (*cb)(); } #endif -STACK *PEM_X509_INFO_read_bio(bp,sk,cb) -BIO *bp; -STACK *sk; -int (*cb)(); +STACK *PEM_X509_INFO_read_bio(BIO *bp, STACK *sk, int (*cb)()) { X509_INFO *xi=NULL; char *name=NULL,*header=NULL,**pp; @@ -271,13 +265,8 @@ err: /* A TJH addition */ -int PEM_X509_INFO_write_bio(bp,xi,enc,kstr,klen,cb) -BIO *bp; -X509_INFO *xi; -EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*cb)(); +int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, + unsigned char *kstr, int klen, int (*cb)()) { EVP_CIPHER_CTX ctx; int i,ret=0; diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 780e20e1e6..7d9a8de2b0 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -84,10 +84,7 @@ static int def_callback(); static int load_iv(); #endif -static int def_callback(buf, num, w) -char *buf; -int num; -int w; +static int def_callback(char *buf, int num, int w) { #ifdef NO_FP_API /* We should not ever call the default callback routine from @@ -123,9 +120,7 @@ int w; #endif } -void PEM_proc_type(buf, type) -char *buf; -int type; +void PEM_proc_type(char *buf, int type) { const char *str; @@ -143,11 +138,7 @@ int type; strcat(buf,"\n"); } -void PEM_dek_info(buf, type, len, str) -char *buf; -const char *type; -int len; -char *str; +void PEM_dek_info(char *buf, const char *type, int len, char *str) { static unsigned char map[17]="0123456789ABCDEF"; long i; @@ -167,12 +158,8 @@ char *str; } #ifndef NO_FP_API -char *PEM_ASN1_read(d2i,name,fp, x, cb) -char *(*d2i)(); -const char *name; -FILE *fp; -char **x; -int (*cb)(); +char *PEM_ASN1_read(char *(*d2i)(), const char *name, FILE *fp, char **x, + int (*cb)()) { BIO *b; char *ret; @@ -189,12 +176,8 @@ int (*cb)(); } #endif -char *PEM_ASN1_read_bio(d2i,name,bp, x, cb) -char *(*d2i)(); -const char *name; -BIO *bp; -char **x; -int (*cb)(); +char *PEM_ASN1_read_bio(char *(*d2i)(), const char *name, BIO *bp, char **x, + int (*cb)()) { EVP_CIPHER_INFO cipher; char *nm=NULL,*header=NULL; @@ -242,15 +225,9 @@ err: } #ifndef NO_FP_API -int PEM_ASN1_write(i2d,name,fp, x, enc, kstr, klen, callback) -int (*i2d)(); -const char *name; -FILE *fp; -char *x; -const EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*callback)(); +int PEM_ASN1_write(int (*i2d)(), const char *name, FILE *fp, char *x, + const EVP_CIPHER *enc, unsigned char *kstr, int klen, + int (*callback)()) { BIO *b; int ret; @@ -267,15 +244,9 @@ int (*callback)(); } #endif -int PEM_ASN1_write_bio(i2d,name,bp, x, enc, kstr, klen, callback) -int (*i2d)(); -const char *name; -BIO *bp; -char *x; -const EVP_CIPHER *enc; -unsigned char *kstr; -int klen; -int (*callback)(); +int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x, + const EVP_CIPHER *enc, unsigned char *kstr, int klen, + int (*callback)()) { EVP_CIPHER_CTX ctx; int dsize=0,i,j,ret=0; @@ -363,11 +334,8 @@ err: return(ret); } -int PEM_do_header(cipher, data, plen, callback) -EVP_CIPHER_INFO *cipher; -unsigned char *data; -long *plen; -int (*callback)(); +int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, + int (*callback)()) { int i,j,o,klen; long len; @@ -407,9 +375,7 @@ int (*callback)(); return(1); } -int PEM_get_EVP_CIPHER_INFO(header,cipher) -char *header; -EVP_CIPHER_INFO *cipher; +int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) { int o; const EVP_CIPHER *enc=NULL; @@ -459,9 +425,7 @@ EVP_CIPHER_INFO *cipher; return(1); } -static int load_iv(fromp,to,num) -unsigned char **fromp,*to; -int num; +static int load_iv(unsigned char **fromp, unsigned char *to, int num) { int v,i; unsigned char *from; @@ -491,12 +455,8 @@ int num; } #ifndef NO_FP_API -int PEM_write(fp, name, header, data,len) -FILE *fp; -char *name; -char *header; -unsigned char *data; -long len; +int PEM_write(FILE *fp, char *name, char *header, unsigned char *data, + long len) { BIO *b; int ret; @@ -513,12 +473,8 @@ long len; } #endif -int PEM_write_bio(bp, name, header, data,len) -BIO *bp; -const char *name; -char *header; -unsigned char *data; -long len; +int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data, + long len) { int nlen,n,i,j,outl; unsigned char *buf; @@ -573,12 +529,8 @@ err: } #ifndef NO_FP_API -int PEM_read(fp, name, header, data,len) -FILE *fp; -char **name; -char **header; -unsigned char **data; -long *len; +int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, + long *len) { BIO *b; int ret; @@ -595,12 +547,8 @@ long *len; } #endif -int PEM_read_bio(bp, name, header, data, len) -BIO *bp; -char **name; -char **header; -unsigned char **data; -long *len; +int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, + long *len) { EVP_ENCODE_CTX ctx; int end=0,i,k,bl=0,hl=0,nohead=0; diff --git a/crypto/pem/pem_seal.c b/crypto/pem/pem_seal.c index b4b36df453..fd493e5251 100644 --- a/crypto/pem/pem_seal.c +++ b/crypto/pem/pem_seal.c @@ -64,15 +64,9 @@ #include "x509.h" #include "pem.h" -int PEM_SealInit(ctx,type,md_type,ek,ekl,iv,pubk,npubk) -PEM_ENCODE_SEAL_CTX *ctx; -EVP_CIPHER *type; -EVP_MD *md_type; -unsigned char **ek; -int *ekl; -unsigned char *iv; -EVP_PKEY **pubk; -int npubk; +int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, + unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, + int npubk) { unsigned char key[EVP_MAX_KEY_LENGTH]; int ret= -1; @@ -118,12 +112,8 @@ err: return(ret); } -void PEM_SealUpdate(ctx,out,outl,in,inl) -PEM_ENCODE_SEAL_CTX *ctx; -unsigned char *out; -int *outl; -unsigned char *in; -int inl; +void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl) { unsigned char buffer[1600]; int i,j; @@ -146,13 +136,8 @@ int inl; } } -int PEM_SealFinal(ctx,sig,sigl,out,outl,priv) -PEM_ENCODE_SEAL_CTX *ctx; -unsigned char *sig; -int *sigl; -unsigned char *out; -int *outl; -EVP_PKEY *priv; +int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, + unsigned char *out, int *outl, EVP_PKEY *priv) { unsigned char *s=NULL; int ret=0,j; diff --git a/crypto/pem/pem_sign.c b/crypto/pem/pem_sign.c index d56f9f9e14..e370758574 100644 --- a/crypto/pem/pem_sign.c +++ b/crypto/pem/pem_sign.c @@ -64,26 +64,19 @@ #include "x509.h" #include "pem.h" -void PEM_SignInit(ctx,type) -EVP_MD_CTX *ctx; -EVP_MD *type; +void PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) { EVP_DigestInit(ctx,type); } -void PEM_SignUpdate(ctx,data,count) -EVP_MD_CTX *ctx; -unsigned char *data; -unsigned int count; +void PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, + unsigned int count) { EVP_DigestUpdate(ctx,data,count); } -int PEM_SignFinal(ctx,sigret,siglen,pkey) -EVP_MD_CTX *ctx; -unsigned char *sigret; -unsigned int *siglen; -EVP_PKEY *pkey; +int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, + EVP_PKEY *pkey) { unsigned char *m; int i,ret=0; |