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/pkcs12 | |
parent | 3edd7ed15de229230f74c79c3d71e7c9c674cf4f (diff) |
Change functions to ANSI C.
Diffstat (limited to 'crypto/pkcs12')
-rw-r--r-- | crypto/pkcs12/p12_add.c | 39 | ||||
-rw-r--r-- | crypto/pkcs12/p12_attr.c | 29 | ||||
-rw-r--r-- | crypto/pkcs12/p12_bags.c | 15 | ||||
-rw-r--r-- | crypto/pkcs12/p12_crpt.c | 15 | ||||
-rw-r--r-- | crypto/pkcs12/p12_crt.c | 15 | ||||
-rw-r--r-- | crypto/pkcs12/p12_decr.c | 33 | ||||
-rw-r--r-- | crypto/pkcs12/p12_init.c | 3 | ||||
-rw-r--r-- | crypto/pkcs12/p12_key.c | 18 | ||||
-rw-r--r-- | crypto/pkcs12/p12_kiss.c | 41 | ||||
-rw-r--r-- | crypto/pkcs12/p12_lib.c | 14 | ||||
-rw-r--r-- | crypto/pkcs12/p12_mac.c | 15 | ||||
-rw-r--r-- | crypto/pkcs12/p12_mutl.c | 31 | ||||
-rw-r--r-- | crypto/pkcs12/p12_sbag.c | 15 | ||||
-rw-r--r-- | crypto/pkcs12/p12_utl.c | 24 | ||||
-rw-r--r-- | crypto/pkcs12/pk12err.c | 2 |
15 files changed, 85 insertions, 224 deletions
diff --git a/crypto/pkcs12/p12_add.c b/crypto/pkcs12/p12_add.c index 1a8eadd011..58f4d1f4be 100644 --- a/crypto/pkcs12/p12_add.c +++ b/crypto/pkcs12/p12_add.c @@ -62,12 +62,8 @@ /* Pack an object into an OCTET STRING and turn into a safebag */ -PKCS12_SAFEBAG *PKCS12_pack_safebag (obj, i2d, nid1, nid2) -char *obj; -int (*i2d)(); -int nid1; -int nid2; - +PKCS12_SAFEBAG *PKCS12_pack_safebag (char *obj, int (*i2d)(), int nid1, + int nid2) { PKCS12_BAGS *bag; PKCS12_SAFEBAG *safebag; @@ -91,8 +87,7 @@ int nid2; /* Turn PKCS8 object into a keybag */ -PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG (p8) -PKCS8_PRIV_KEY_INFO *p8; +PKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG (PKCS8_PRIV_KEY_INFO *p8) { PKCS12_SAFEBAG *bag; if (!(bag = PKCS12_SAFEBAG_new())) { @@ -106,8 +101,7 @@ PKCS8_PRIV_KEY_INFO *p8; /* Turn PKCS8 object into a shrouded keybag */ -PKCS12_SAFEBAG - *PKCS12_MAKE_SHKEYBAG (pbe_nid, pass, passlen, salt, saltlen, iter, p8)int pbe_nid; +PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG (pbe_nid, pass, passlen, salt, saltlen, iter, p8)int pbe_nid; unsigned char *pass; int passlen; unsigned char *salt; @@ -134,8 +128,7 @@ PKCS8_PRIV_KEY_INFO *p8; } /* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */ -PKCS7 *PKCS12_pack_p7data (sk) -STACK *sk; +PKCS7 *PKCS12_pack_p7data (STACK *sk) { PKCS7 *p7; if (!(p7 = PKCS7_new())) { @@ -158,15 +151,8 @@ STACK *sk; /* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */ -PKCS7 *PKCS12_pack_p7encdata (pbe_nid, pass, passlen, salt, saltlen, iter, - bags) -int pbe_nid; -unsigned char *pass; -int passlen; -unsigned char *salt; -int saltlen; -int iter; -STACK *bags; +PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, unsigned char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, STACK *bags) { PKCS7 *p7; X509_ALGOR *pbe; @@ -198,14 +184,9 @@ STACK *bags; return p7; } -X509_SIG *PKCS8_encrypt (pbe_nid, pass, passlen, salt, saltlen, iter, p8inf) -int pbe_nid; -unsigned char *pass; -int passlen; -unsigned char *salt; -int saltlen; -int iter; -PKCS8_PRIV_KEY_INFO *p8inf; +X509_SIG *PKCS8_encrypt (int pbe_nid, unsigned char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, + PKCS8_PRIV_KEY_INFO *p8inf) { X509_SIG *p8; X509_ALGOR *pbe; diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c index f534745dc9..6247fdb766 100644 --- a/crypto/pkcs12/p12_attr.c +++ b/crypto/pkcs12/p12_attr.c @@ -62,10 +62,8 @@ /* Add a local keyid to a safebag */ -int PKCS12_add_localkeyid (bag, name, namelen) -PKCS12_SAFEBAG *bag; -unsigned char *name; -int namelen; +int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name, + int namelen) { X509_ATTRIBUTE *attrib; ASN1_BMPSTRING *oct; @@ -105,9 +103,7 @@ int namelen; /* Add key usage to PKCS#8 structure */ -int PKCS8_add_keyusage (p8, usage) -PKCS8_PRIV_KEY_INFO *p8; -int usage; +int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage) { X509_ATTRIBUTE *attrib; ASN1_BIT_STRING *bstr; @@ -149,10 +145,8 @@ int usage; /* Add a friendlyname to a safebag */ -int PKCS12_add_friendlyname_asc (bag, name, namelen) -PKCS12_SAFEBAG *bag; -unsigned char *name; -int namelen; +int PKCS12_add_friendlyname_asc (PKCS12_SAFEBAG *bag, unsigned char *name, + int namelen) { unsigned char *uniname; int ret, unilen; @@ -166,10 +160,8 @@ int namelen; } -int PKCS12_add_friendlyname_uni (bag, name, namelen) -PKCS12_SAFEBAG *bag; -unsigned char *name; -int namelen; +int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag, unsigned char *name, + int namelen) { X509_ATTRIBUTE *attrib; ASN1_BMPSTRING *bmp; @@ -211,9 +203,7 @@ int namelen; return PKCS12_OK; } -ASN1_TYPE *PKCS12_get_attr_gen (attrs, attr_nid) -STACK *attrs; -int attr_nid; +ASN1_TYPE *PKCS12_get_attr_gen (STACK *attrs, int attr_nid) { X509_ATTRIBUTE *attrib; int i; @@ -230,8 +220,7 @@ int attr_nid; return NULL; } -char *PKCS12_get_friendlyname(bag) -PKCS12_SAFEBAG *bag; +char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag) { ASN1_TYPE *atype; if (!(atype = PKCS12_get_attr(bag, NID_friendlyName))) return NULL; diff --git a/crypto/pkcs12/p12_bags.c b/crypto/pkcs12/p12_bags.c index 38729b6d1c..9a31502e35 100644 --- a/crypto/pkcs12/p12_bags.c +++ b/crypto/pkcs12/p12_bags.c @@ -66,9 +66,7 @@ *ASN1err(ASN1_F_D2I_PKCS12_BAGS,ASN1_R_DECODE_ERROR) */ -int i2d_PKCS12_BAGS(a,pp) -PKCS12_BAGS *a; -unsigned char **pp; +int i2d_PKCS12_BAGS(PKCS12_BAGS *a, unsigned char **pp) { int bagnid, v = 0; M_ASN1_I2D_vars(a); @@ -126,7 +124,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS12_BAGS *PKCS12_BAGS_new() +PKCS12_BAGS *PKCS12_BAGS_new(void) { PKCS12_BAGS *ret=NULL; ASN1_CTX c; @@ -137,10 +135,8 @@ PKCS12_BAGS *PKCS12_BAGS_new() M_ASN1_New_Error(ASN1_F_PKCS12_BAGS_NEW); } -PKCS12_BAGS *d2i_PKCS12_BAGS(a,pp,length) -PKCS12_BAGS **a; -unsigned char **pp; -long length; +PKCS12_BAGS *d2i_PKCS12_BAGS(PKCS12_BAGS **a, unsigned char **pp, + long length) { int bagnid; M_ASN1_D2I_vars(a,PKCS12_BAGS *,PKCS12_BAGS_new); @@ -174,8 +170,7 @@ long length; M_ASN1_D2I_Finish(a, PKCS12_BAGS_free, ASN1_F_D2I_PKCS12_BAGS); } -void PKCS12_BAGS_free (a) -PKCS12_BAGS *a; +void PKCS12_BAGS_free (PKCS12_BAGS *a) { if (a == NULL) return; switch (OBJ_obj2nid(a->type)) { diff --git a/crypto/pkcs12/p12_crpt.c b/crypto/pkcs12/p12_crpt.c index 7d3a94dc33..8623cde6c4 100644 --- a/crypto/pkcs12/p12_crpt.c +++ b/crypto/pkcs12/p12_crpt.c @@ -62,7 +62,7 @@ /* PKCS#12 specific PBE functions */ -void PKCS12_PBE_add() +void PKCS12_PBE_add(void) { EVP_PBE_alg_add(NID_pbe_WithSHA1And128BitRC4, EVP_rc4(), EVP_sha1(), PKCS12_PBE_keyivgen); @@ -78,16 +78,9 @@ EVP_PBE_alg_add(NID_pbe_WithSHA1And40BitRC2_CBC, EVP_rc2_40_cbc(), EVP_sha1(), PKCS12_PBE_keyivgen); } -int PKCS12_PBE_keyivgen (pass, passlen, salt, saltlen, iter, cipher, - md, key, iv) -unsigned char *pass; -int passlen; -unsigned char *salt; -int saltlen; -int iter; -EVP_CIPHER *cipher; -EVP_MD *md; -unsigned char *key, *iv; +int PKCS12_PBE_keyivgen (unsigned char *pass, int passlen, unsigned char *salt, + int saltlen, int iter, EVP_CIPHER *cipher, EVP_MD *md, + unsigned char *key, unsigned char *iv) { if (!PKCS12_key_gen (pass, passlen, salt, saltlen, PKCS12_KEY_ID, iter, EVP_CIPHER_key_length(cipher), key, md)) { diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c index 63a65e1522..f7592a5767 100644 --- a/crypto/pkcs12/p12_crt.c +++ b/crypto/pkcs12/p12_crt.c @@ -60,18 +60,9 @@ #include "cryptlib.h" #include "pkcs12.h" -PKCS12 *PKCS12_create(pass, name, pkey, cert, ca, nid_key, nid_cert, iter, - mac_iter, keytype) -char *pass; -char *name; -EVP_PKEY *pkey; -X509 *cert; -STACK *ca; -int nid_key; -int nid_cert; -int iter; -int mac_iter; -int keytype; +PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, + STACK *ca, int nid_key, int nid_cert, int iter, int mac_iter, + int keytype) { PKCS12 *p12; STACK *bags, *safes; diff --git a/crypto/pkcs12/p12_decr.c b/crypto/pkcs12/p12_decr.c index 5dee184c7b..b96f119b7a 100644 --- a/crypto/pkcs12/p12_decr.c +++ b/crypto/pkcs12/p12_decr.c @@ -68,16 +68,9 @@ * Malloc'ed buffer */ -unsigned char * PKCS12_pbe_crypt (algor, pass, passlen, in, inlen, - data, datalen, en_de) -X509_ALGOR *algor; -unsigned char *pass; -int passlen; -unsigned char *in; -int inlen; -unsigned char **data; -int *datalen; -int en_de; +unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, unsigned char *pass, + int passlen, unsigned char *in, int inlen, unsigned char **data, + int *datalen, int en_de) { unsigned char *out; int outlen, i; @@ -113,14 +106,9 @@ int en_de; * as a sequence. */ -char * PKCS12_decrypt_d2i (algor, d2i, free_func, pass, passlen, oct, seq) -X509_ALGOR *algor; -char * (*d2i)(); -void (*free_func)(); -unsigned char *pass; -int passlen; -ASN1_OCTET_STRING *oct; -int seq; +char * PKCS12_decrypt_d2i (X509_ALGOR *algor, char * (*d2i)(), + void (*free_func)(), unsigned char *pass, int passlen, + ASN1_OCTET_STRING *oct, int seq) { unsigned char *out, *p; char *ret; @@ -158,13 +146,8 @@ int seq; * as a sequence */ -ASN1_OCTET_STRING *PKCS12_i2d_encrypt (algor, i2d, pass, passlen, obj, seq) -X509_ALGOR *algor; -int (*i2d)(); -unsigned char *pass; -int passlen; -char *obj; -int seq; +ASN1_OCTET_STRING *PKCS12_i2d_encrypt (X509_ALGOR *algor, int (*i2d)(), + unsigned char *pass, int passlen, char *obj, int seq) { ASN1_OCTET_STRING *oct; unsigned char *in, *p; diff --git a/crypto/pkcs12/p12_init.c b/crypto/pkcs12/p12_init.c index 6ec6fb478b..5301bd63f0 100644 --- a/crypto/pkcs12/p12_init.c +++ b/crypto/pkcs12/p12_init.c @@ -62,8 +62,7 @@ /* Initialise a PKCS12 structure to take data */ -PKCS12 *PKCS12_init (mode) -int mode; +PKCS12 *PKCS12_init (int mode) { PKCS12 *pkcs12; if (!(pkcs12 = PKCS12_new())) { diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index 3bef1fa38a..eb774e45f0 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -74,10 +74,9 @@ void h__dump (unsigned char *p, int len); #define min(a,b) ((a) < (b) ? (a) : (b)) #endif -int PKCS12_key_gen_asc (pass, passlen, salt, saltlen, id, iter, n, out, md_type) -unsigned char *pass, *salt, *out; -int passlen, saltlen, id, iter, n; -const EVP_MD *md_type; +int PKCS12_key_gen_asc (unsigned char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, unsigned char *out, + const EVP_MD *md_type) { int ret; unsigned char *unipass; @@ -93,10 +92,9 @@ const EVP_MD *md_type; return ret; } -int PKCS12_key_gen_uni (pass, passlen, salt, saltlen, id, iter, n, out, md_type) -unsigned char *pass, *salt, *out; -int passlen, saltlen, id, iter, n; -const EVP_MD *md_type; +int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt, + int saltlen, int id, int iter, int n, unsigned char *out, + const EVP_MD *md_type) { unsigned char *B, *D, *I, *p, *Ai; int Slen, Plen, Ilen; @@ -177,9 +175,7 @@ const EVP_MD *md_type; return 0; /* This can't happen */ } #ifdef DEBUG_KEYGEN -void h__dump (p, len) -unsigned char *p; -int len; +void h__dump (unsigned char *p, int len) { for (; len --; p++) BIO_printf (bio_err, "%02X", *p); BIO_printf (bio_err, "\n"); diff --git a/crypto/pkcs12/p12_kiss.c b/crypto/pkcs12/p12_kiss.c index ef42060380..b4e3cc88f7 100644 --- a/crypto/pkcs12/p12_kiss.c +++ b/crypto/pkcs12/p12_kiss.c @@ -78,12 +78,8 @@ static int parse_bag(); * passed unitialised. */ -int PKCS12_parse (p12, pass, pkey, cert, ca) -PKCS12 *p12; -char *pass; -EVP_PKEY **pkey; -X509 **cert; -STACK **ca; +int PKCS12_parse (PKCS12 *p12, char *pass, EVP_PKEY **pkey, X509 **cert, + STACK **ca) { /* Check for NULL PKCS12 structure */ @@ -129,13 +125,8 @@ return 0; /* Parse the outer PKCS#12 structure */ -static int parse_pk12 (p12, pass, passlen, pkey, cert, ca) -PKCS12 *p12; -unsigned char *pass; -int passlen; -EVP_PKEY **pkey; -X509 **cert; -STACK **ca; +static int parse_pk12 (PKCS12 *p12, unsigned char *pass, int passlen, + EVP_PKEY **pkey, X509 **cert, STACK **ca) { STACK *asafes, *bags; int i, bagnid; @@ -169,15 +160,9 @@ STACK **ca; } -static int parse_bags (bags, pass, passlen, pkey, cert, ca, keyid, keymatch) -STACK *bags; -unsigned char *pass; -int passlen; -EVP_PKEY **pkey; -X509 **cert; -STACK **ca; -ASN1_OCTET_STRING **keyid; -char *keymatch; +static int parse_bags (STACK *bags, unsigned char *pass, int passlen, + EVP_PKEY **pkey, X509 **cert, STACK **ca, ASN1_OCTET_STRING **keyid, + char *keymatch) { int i; for (i = 0; i < sk_num (bags); i++) { @@ -192,15 +177,9 @@ char *keymatch; #define MATCH_CERT 0x2 #define MATCH_ALL 0x3 -static int parse_bag (bag, pass, passlen, pkey, cert, ca, keyid, keymatch) -PKCS12_SAFEBAG *bag; -unsigned char *pass; -int passlen; -EVP_PKEY **pkey; -X509 **cert; -STACK **ca; -ASN1_OCTET_STRING **keyid; -char *keymatch; +static int parse_bag (PKCS12_SAFEBAG *bag, unsigned char *pass, int passlen, + EVP_PKEY **pkey, X509 **cert, STACK **ca, ASN1_OCTET_STRING **keyid, + char *keymatch) { PKCS8_PRIV_KEY_INFO *p8; X509 *x509; diff --git a/crypto/pkcs12/p12_lib.c b/crypto/pkcs12/p12_lib.c index e5bc2daf74..bb8e671694 100644 --- a/crypto/pkcs12/p12_lib.c +++ b/crypto/pkcs12/p12_lib.c @@ -66,9 +66,7 @@ *ASN1err(ASN1_F_D2I_PKCS12,ASN1_R_DECODE_ERROR) */ -int i2d_PKCS12(a,pp) -PKCS12 *a; -unsigned char **pp; +int i2d_PKCS12(PKCS12 *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -85,10 +83,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS12 *d2i_PKCS12(a,pp,length) -PKCS12 **a; -unsigned char **pp; -long length; +PKCS12 *d2i_PKCS12(PKCS12 **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS12 *,PKCS12_new); M_ASN1_D2I_Init(); @@ -99,7 +94,7 @@ long length; M_ASN1_D2I_Finish(a, PKCS12_free, ASN1_F_D2I_PKCS12); } -PKCS12 *PKCS12_new() +PKCS12 *PKCS12_new(void) { PKCS12 *ret=NULL; ASN1_CTX c; @@ -111,8 +106,7 @@ PKCS12 *PKCS12_new() M_ASN1_New_Error(ASN1_F_PKCS12_NEW); } -void PKCS12_free (a) -PKCS12 *a; +void PKCS12_free (PKCS12 *a) { if (a == NULL) return; ASN1_INTEGER_free (a->version); diff --git a/crypto/pkcs12/p12_mac.c b/crypto/pkcs12/p12_mac.c index acb0c5f00b..22497b9c98 100644 --- a/crypto/pkcs12/p12_mac.c +++ b/crypto/pkcs12/p12_mac.c @@ -65,9 +65,7 @@ *ASN1err(ASN1_F_D2I_PKCS12_MAC_DATA,ASN1_R_DECODE_ERROR) */ -int i2d_PKCS12_MAC_DATA(a,pp) -PKCS12_MAC_DATA *a; -unsigned char **pp; +int i2d_PKCS12_MAC_DATA(PKCS12_MAC_DATA *a, unsigned char **pp) { M_ASN1_I2D_vars(a); M_ASN1_I2D_len (a->dinfo, i2d_X509_SIG); @@ -82,7 +80,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS12_MAC_DATA *PKCS12_MAC_DATA_new() +PKCS12_MAC_DATA *PKCS12_MAC_DATA_new(void) { PKCS12_MAC_DATA *ret=NULL; ASN1_CTX c; @@ -94,10 +92,8 @@ PKCS12_MAC_DATA *PKCS12_MAC_DATA_new() M_ASN1_New_Error(ASN1_F_PKCS12_MAC_DATA_NEW); } -PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(a,pp,length) -PKCS12_MAC_DATA **a; -unsigned char **pp; -long length; +PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,PKCS12_MAC_DATA *,PKCS12_MAC_DATA_new); M_ASN1_D2I_Init(); @@ -108,8 +104,7 @@ long length; M_ASN1_D2I_Finish(a, PKCS12_MAC_DATA_free, ASN1_F_D2I_PKCS12_MAC_DATA); } -void PKCS12_MAC_DATA_free (a) -PKCS12_MAC_DATA *a; +void PKCS12_MAC_DATA_free (PKCS12_MAC_DATA *a) { if (a == NULL) return; X509_SIG_free (a->dinfo); diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c index d860c21b52..2d16e610d2 100644 --- a/crypto/pkcs12/p12_mutl.c +++ b/crypto/pkcs12/p12_mutl.c @@ -63,12 +63,8 @@ #include "pkcs12.h" /* Generate a MAC */ -int PKCS12_gen_mac (p12, pass, passlen, mac, maclen) -PKCS12 *p12; -unsigned char *pass; -int passlen; -unsigned char *mac; -unsigned int *maclen; +int PKCS12_gen_mac (PKCS12 *p12, unsigned char *pass, int passlen, + unsigned char *mac, unsigned int *maclen) { const EVP_MD *md_type; HMAC_CTX hmac; @@ -96,10 +92,7 @@ unsigned int *maclen; } /* Verify the mac */ -int PKCS12_verify_mac (p12, pass, passlen) -PKCS12 *p12; -unsigned char *pass; -int passlen; +int PKCS12_verify_mac (PKCS12 *p12, unsigned char *pass, int passlen) { unsigned char mac[EVP_MAX_MD_SIZE]; unsigned int maclen; @@ -121,14 +114,8 @@ int passlen; /* Set a mac */ -int PKCS12_set_mac (p12, pass, passlen, salt, saltlen, iter, md_type) -PKCS12 *p12; -unsigned char *pass; -int passlen; -unsigned char *salt; -int saltlen; -int iter; -EVP_MD *md_type; +int PKCS12_set_mac (PKCS12 *p12, unsigned char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, EVP_MD *md_type) { unsigned char mac[EVP_MAX_MD_SIZE]; int maclen; @@ -150,12 +137,8 @@ EVP_MD *md_type; } /* Set up a mac structure */ -int PKCS12_setup_mac (p12, iter, salt, saltlen, md_type) -PKCS12 *p12; -int iter; -unsigned char *salt; -int saltlen; -EVP_MD *md_type; +int PKCS12_setup_mac (PKCS12 *p12, int iter, unsigned char *salt, int saltlen, + EVP_MD *md_type) { if (!(p12->mac = PKCS12_MAC_DATA_new ())) return PKCS12_ERROR; if (iter > 1) { diff --git a/crypto/pkcs12/p12_sbag.c b/crypto/pkcs12/p12_sbag.c index d39ffe4ff9..4a2a32c721 100644 --- a/crypto/pkcs12/p12_sbag.c +++ b/crypto/pkcs12/p12_sbag.c @@ -66,9 +66,7 @@ *ASN1err(ASN1_F_D2I_PKCS12_SAFEBAG,ASN1_R_DECODE_ERROR) */ -int i2d_PKCS12_SAFEBAG(a,pp) -PKCS12_SAFEBAG *a; -unsigned char **pp; +int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp) { int bagnid, v = 0; M_ASN1_I2D_vars(a); @@ -146,7 +144,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS12_SAFEBAG *PKCS12_SAFEBAG_new() +PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void) { PKCS12_SAFEBAG *ret=NULL; ASN1_CTX c; @@ -159,10 +157,8 @@ PKCS12_SAFEBAG *PKCS12_SAFEBAG_new() M_ASN1_New_Error(ASN1_F_PKCS12_SAFEBAG_NEW); } -PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(a,pp,length) -PKCS12_SAFEBAG **a; -unsigned char **pp; -long length; +PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp, + long length) { int bagnid; M_ASN1_D2I_vars(a,PKCS12_SAFEBAG *,PKCS12_SAFEBAG_new); @@ -206,8 +202,7 @@ long length; M_ASN1_D2I_Finish(a, PKCS12_SAFEBAG_free, ASN1_F_D2I_PKCS12_SAFEBAG); } -void PKCS12_SAFEBAG_free (a) -PKCS12_SAFEBAG *a; +void PKCS12_SAFEBAG_free (PKCS12_SAFEBAG *a) { if (a == NULL) return; switch (OBJ_obj2nid(a->type)) { diff --git a/crypto/pkcs12/p12_utl.c b/crypto/pkcs12/p12_utl.c index 990fb7c469..1300ef0dea 100644 --- a/crypto/pkcs12/p12_utl.c +++ b/crypto/pkcs12/p12_utl.c @@ -62,9 +62,7 @@ /* Cheap and nasty Unicode stuff */ -unsigned char *asc2uni (asc, uni, unilen) -unsigned char *asc, **uni; -int *unilen; +unsigned char *asc2uni (unsigned char *asc, unsigned char **uni, int *unilen) { int ulen, i; unsigned char *unitmp; @@ -79,9 +77,7 @@ int *unilen; return unitmp; } -char *uni2asc (uni, unilen) -unsigned char *uni; -int unilen; +char *uni2asc (unsigned char *uni, int unilen) { int asclen, i; char *asctmp; @@ -95,30 +91,22 @@ int unilen; return asctmp; } -int i2d_PKCS12_bio(bp, p12) -BIO *bp; -PKCS12 *p12; +int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12) { return ASN1_i2d_bio((int(*)())i2d_PKCS12, bp, (unsigned char *)p12); } -int i2d_PKCS12_fp(fp, p12) -FILE *fp; -PKCS12 *p12; +int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12) { return ASN1_i2d_fp((int(*)())i2d_PKCS12, fp, (unsigned char *)p12); } -PKCS12 *d2i_PKCS12_bio(bp, p12) -BIO *bp; -PKCS12 **p12; +PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12) { return (PKCS12 *)ASN1_d2i_bio((char *(*)())PKCS12_new, (char *(*)())d2i_PKCS12, bp, (unsigned char **)p12); } -PKCS12 *d2i_PKCS12_fp(fp, p12) -FILE *fp; -PKCS12 **p12; +PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12) { return (PKCS12 *)ASN1_d2i_fp((char *(*)())PKCS12_new, (char *(*)())d2i_PKCS12, fp, (unsigned char **)(p12)); diff --git a/crypto/pkcs12/pk12err.c b/crypto/pkcs12/pk12err.c index 185d4e184a..336ed2cebd 100644 --- a/crypto/pkcs12/pk12err.c +++ b/crypto/pkcs12/pk12err.c @@ -120,7 +120,7 @@ static ERR_STRING_DATA PKCS12_str_reasons[]= #endif -void ERR_load_PKCS12_strings() +void ERR_load_PKCS12_strings(void) { static int init=1; |