From 6b691a5c85ddc4e407e32781841fee5c029506cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ulf=20M=C3=B6ller?= Date: Mon, 19 Apr 1999 21:31:43 +0000 Subject: [PATCH] Change functions to ANSI C. --- CHANGES | 3 + apps/apps.c | 31 ++--- apps/asn1pars.c | 4 +- apps/ca.c | 136 ++++++---------------- apps/ciphers.c | 4 +- apps/crl.c | 8 +- apps/crl2p7.c | 8 +- apps/dgst.c | 9 +- apps/dh.c | 4 +- apps/dsa.c | 4 +- apps/dsaparam.c | 9 +- apps/enc.c | 9 +- apps/errstr.c | 4 +- apps/gendh.c | 12 +- apps/gendsa.c | 7 +- apps/genrsa.c | 12 +- apps/nseq.c | 8 +- apps/openssl.c | 20 +--- apps/pem_mail.c | 4 +- apps/pkcs12.c | 54 +++------ apps/pkcs7.c | 4 +- apps/req.c | 46 ++------ apps/rsa.c | 4 +- apps/s_cb.c | 23 +--- apps/s_client.c | 11 +- apps/s_server.c | 40 ++----- apps/s_socket.c | 73 +++--------- apps/s_time.c | 20 +--- apps/sc.c | 6 +- apps/sess_id.c | 8 +- apps/speed.c | 23 +--- apps/verify.c | 12 +- apps/version.c | 4 +- apps/x509.c | 35 ++---- crypto/asn1/a_bitstr.c | 19 +-- crypto/asn1/a_bmp.c | 10 +- crypto/asn1/a_bool.c | 9 +- crypto/asn1/a_bytes.c | 25 +--- crypto/asn1/a_d2i_fp.c | 14 +-- crypto/asn1/a_digest.c | 8 +- crypto/asn1/a_dup.c | 5 +- crypto/asn1/a_enum.c | 25 ++-- crypto/asn1/a_gentm.c | 22 ++-- crypto/asn1/a_hdr.c | 15 +-- crypto/asn1/a_i2d_fp.c | 10 +- crypto/asn1/a_int.c | 25 ++-- crypto/asn1/a_meth.c | 4 +- crypto/asn1/a_object.c | 37 ++---- crypto/asn1/a_octet.c | 10 +- crypto/asn1/a_print.c | 62 ++++------ crypto/asn1/a_set.c | 21 +--- crypto/asn1/a_sign.c | 11 +- crypto/asn1/a_time.c | 13 +-- crypto/asn1/a_type.c | 25 ++-- crypto/asn1/a_utctm.c | 21 +--- crypto/asn1/a_utf8.c | 10 +- crypto/asn1/a_verify.c | 8 +- crypto/asn1/a_vis.c | 10 +- crypto/asn1/asn1_err.c | 2 +- crypto/asn1/asn1_lib.c | 65 +++-------- crypto/asn1/asn1_par.c | 23 +--- crypto/asn1/asn_pack.c | 23 +--- crypto/asn1/d2i_dhp.c | 5 +- crypto/asn1/d2i_dsap.c | 5 +- crypto/asn1/d2i_pr.c | 7 +- crypto/asn1/d2i_pu.c | 7 +- crypto/asn1/d2i_r_pr.c | 7 +- crypto/asn1/d2i_r_pu.c | 5 +- crypto/asn1/d2i_s_pr.c | 5 +- crypto/asn1/d2i_s_pu.c | 5 +- crypto/asn1/evp_asn1.c | 27 ++--- crypto/asn1/f_enum.c | 10 +- crypto/asn1/f_int.c | 10 +- crypto/asn1/f_string.c | 11 +- crypto/asn1/i2d_dhp.c | 4 +- crypto/asn1/i2d_dsap.c | 4 +- crypto/asn1/i2d_pr.c | 4 +- crypto/asn1/i2d_pu.c | 4 +- crypto/asn1/i2d_r_pr.c | 4 +- crypto/asn1/i2d_r_pu.c | 4 +- crypto/asn1/i2d_s_pr.c | 4 +- crypto/asn1/i2d_s_pu.c | 4 +- crypto/asn1/n_pkey.c | 33 ++---- crypto/asn1/nsseq.c | 15 +-- crypto/asn1/p5_pbe.c | 21 +--- crypto/asn1/p5_pbev2.c | 29 ++--- crypto/asn1/p7_dgst.c | 15 +-- crypto/asn1/p7_enc.c | 15 +-- crypto/asn1/p7_enc_c.c | 15 +-- crypto/asn1/p7_evp.c | 15 +-- crypto/asn1/p7_i_s.c | 15 +-- crypto/asn1/p7_lib.c | 17 +-- crypto/asn1/p7_recip.c | 15 +-- crypto/asn1/p7_s_e.c | 15 +-- crypto/asn1/p7_signd.c | 15 +-- crypto/asn1/p7_signi.c | 15 +-- crypto/asn1/p8_pkey.c | 15 +-- crypto/asn1/pkcs8.c | 14 +-- crypto/asn1/t_crl.c | 12 +- crypto/asn1/t_pkey.c | 44 ++----- crypto/asn1/t_req.c | 8 +- crypto/asn1/t_x509.c | 29 ++--- crypto/asn1/x_algor.c | 14 +-- crypto/asn1/x_attrib.c | 20 +--- crypto/asn1/x_cinf.c | 14 +-- crypto/asn1/x_crl.c | 50 +++----- crypto/asn1/x_exten.c | 15 +-- crypto/asn1/x_info.c | 5 +- crypto/asn1/x_name.c | 36 ++---- crypto/asn1/x_pkey.c | 14 +-- crypto/asn1/x_pubkey.c | 22 ++-- crypto/asn1/x_req.c | 29 ++--- crypto/asn1/x_sig.c | 14 +-- crypto/asn1/x_spki.c | 30 ++--- crypto/asn1/x_val.c | 14 +-- crypto/asn1/x_x509.c | 16 +-- crypto/bf/bf_cbc.c | 9 +- crypto/bf/bf_cfb64.c | 10 +- crypto/bf/bf_ecb.c | 9 +- crypto/bf/bf_enc.c | 19 +-- crypto/bf/bf_ofb64.c | 9 +- crypto/bf/bf_opts.c | 10 +- crypto/bf/bf_skey.c | 5 +- crypto/bf/bfspeed.c | 10 +- crypto/bf/bftest.c | 8 +- crypto/bio/b_dump.c | 5 +- crypto/bio/b_sock.c | 54 +++------ crypto/bio/bf_buff.c | 33 ++---- crypto/bio/bf_nbio.c | 33 ++---- crypto/bio/bf_null.c | 33 ++---- crypto/bio/bio_cb.c | 9 +- crypto/bio/bio_err.c | 2 +- crypto/bio/bio_lib.c | 89 ++++---------- crypto/bio/bss_acpt.c | 43 ++----- crypto/bio/bss_conn.c | 43 ++----- crypto/bio/bss_file.c | 41 ++----- crypto/bio/bss_log.c | 23 +--- crypto/bio/bss_mem.c | 33 ++---- crypto/bio/bss_null.c | 33 ++---- crypto/bio/bss_rtcp.c | 33 ++---- crypto/bio/bss_sock.c | 63 ++++------ crypto/bn/bn_add.c | 20 +--- crypto/bn/bn_asm.c | 70 +++-------- crypto/bn/bn_blind.c | 22 +--- crypto/bn/bn_comba.c | 12 +- crypto/bn/bn_div.c | 21 +--- crypto/bn/bn_err.c | 2 +- crypto/bn/bn_exp.c | 46 ++------ crypto/bn/bn_exp2.c | 11 +- crypto/bn/bn_gcd.c | 13 +-- crypto/bn/bn_lib.c | 93 +++++---------- crypto/bn/bn_m.c | 14 +-- crypto/bn/bn_mont.c | 29 ++--- crypto/bn/bn_mpi.c | 9 +- crypto/bn/bn_mul.c | 38 ++---- crypto/bn/bn_opts.c | 36 ++---- crypto/bn/bn_prime.c | 50 ++------ crypto/bn/bn_print.c | 22 +--- crypto/bn/bn_rand.c | 6 +- crypto/bn/bn_recp.c | 35 ++---- crypto/bn/bn_shift.c | 18 +-- crypto/bn/bn_sqr.c | 16 +-- crypto/bn/bn_word.c | 20 +--- crypto/bn/bnspeed.c | 13 +-- crypto/bn/bntest.c | 59 +++------- crypto/bn/expspeed.c | 14 +-- crypto/bn/exptest.c | 4 +- crypto/bn/old/b_sqr.c | 10 +- crypto/bn/old/bn_high.c | 4 +- crypto/bn/old/bn_ka.c | 29 ++--- crypto/bn/old/bn_low.c | 13 +-- crypto/bn/old/bn_m.c | 7 +- crypto/bn/old/bn_wmul.c | 14 +-- crypto/bn/test.c | 21 +--- crypto/buffer/buf_err.c | 2 +- crypto/buffer/buffer.c | 12 +- crypto/cast/c_cfb64.c | 10 +- crypto/cast/c_ecb.c | 7 +- crypto/cast/c_enc.c | 17 +-- crypto/cast/c_ofb64.c | 9 +- crypto/cast/c_skey.c | 5 +- crypto/cast/cast_spd.c | 10 +- crypto/cast/castopts.c | 10 +- crypto/cast/casttest.c | 4 +- crypto/comp/c_rle.c | 18 +-- crypto/comp/c_zlib.c | 25 ++-- crypto/comp/comp_err.c | 2 +- crypto/comp/comp_lib.c | 22 +--- crypto/conf/cnf_save.c | 3 +- crypto/conf/conf.c | 61 +++------- crypto/conf/conf_err.c | 2 +- crypto/cpt_err.c | 2 +- crypto/cryptlib.c | 31 ++--- crypto/cversion.c | 5 +- crypto/des/cbc3_enc.c | 12 +- crypto/des/cbc_cksm.c | 8 +- crypto/des/cbc_enc.c | 9 +- crypto/des/cfb64ede.c | 22 +--- crypto/des/cfb64enc.c | 11 +- crypto/des/cfb_enc.c | 10 +- crypto/des/des.c | 39 ++----- crypto/des/des_enc.c | 45 ++------ crypto/des/des_opts.c | 10 +- crypto/des/destest.c | 17 +-- crypto/des/ecb3_enc.c | 10 +- crypto/des/ecb_enc.c | 7 +- crypto/des/ede_cbcm_enc.c | 13 +-- crypto/des/ede_enc.c | 23 +--- crypto/des/enc_read.c | 8 +- crypto/des/enc_writ.c | 8 +- crypto/des/fcrypt.c | 12 +- crypto/des/fcrypt_b.c | 7 +- crypto/des/ncbc_enc.c | 9 +- crypto/des/ofb64ede.c | 20 +--- crypto/des/ofb64enc.c | 10 +- crypto/des/ofb_enc.c | 9 +- crypto/des/pcbc_enc.c | 9 +- crypto/des/qud_cksm.c | 8 +- crypto/des/rand_key.c | 6 +- crypto/des/read2pwd.c | 12 +- crypto/des/read_pwd.c | 37 ++---- crypto/des/rpc_enc.c | 5 +- crypto/des/rpw.c | 4 +- crypto/des/set_key.c | 17 +-- crypto/des/speed.c | 10 +- crypto/des/str2key.c | 9 +- crypto/des/supp.c | 6 +- crypto/des/xcbc_enc.c | 18 +-- crypto/dh/dh_check.c | 4 +- crypto/dh/dh_err.c | 2 +- crypto/dh/dh_gen.c | 7 +- crypto/dh/dh_key.c | 8 +- crypto/dh/dh_lib.c | 8 +- crypto/dh/dhtest.c | 9 +- crypto/dsa/dsa_asn1.c | 12 +- crypto/dsa/dsa_err.c | 2 +- crypto/dsa/dsa_gen.c | 17 +-- crypto/dsa/dsa_key.c | 3 +- crypto/dsa/dsa_lib.c | 8 +- crypto/dsa/dsa_sign.c | 22 +--- crypto/dsa/dsa_vrf.c | 15 +-- crypto/dsa/dsagen.c | 3 +- crypto/dsa/dsatest.c | 9 +- crypto/err/err.c | 103 ++++++----------- crypto/err/err_all.c | 2 +- crypto/err/err_prn.c | 6 +- crypto/evp/bio_b64.c | 24 +--- crypto/evp/bio_enc.c | 32 ++---- crypto/evp/bio_md.c | 29 ++--- crypto/evp/bio_ok.c | 24 +--- crypto/evp/c_all.c | 6 +- crypto/evp/digest.c | 15 +-- crypto/evp/e_cbc_3d.c | 25 ++-- crypto/evp/e_cbc_bf.c | 16 +-- crypto/evp/e_cbc_c.c | 16 +-- crypto/evp/e_cbc_d.c | 16 +-- crypto/evp/e_cbc_i.c | 16 +-- crypto/evp/e_cbc_r2.c | 34 ++---- crypto/evp/e_cbc_r5.c | 16 +-- crypto/evp/e_cfb_3d.c | 25 ++-- crypto/evp/e_cfb_bf.c | 16 +-- crypto/evp/e_cfb_c.c | 16 +-- crypto/evp/e_cfb_d.c | 16 +-- crypto/evp/e_cfb_i.c | 16 +-- crypto/evp/e_cfb_r2.c | 16 +-- crypto/evp/e_cfb_r5.c | 16 +-- crypto/evp/e_ecb_3d.c | 25 ++-- crypto/evp/e_ecb_bf.c | 16 +-- crypto/evp/e_ecb_c.c | 16 +-- crypto/evp/e_ecb_d.c | 16 +-- crypto/evp/e_ecb_i.c | 16 +-- crypto/evp/e_ecb_r2.c | 16 +-- crypto/evp/e_ecb_r5.c | 16 +-- crypto/evp/e_null.c | 16 +-- crypto/evp/e_ofb_3d.c | 25 ++-- crypto/evp/e_ofb_bf.c | 16 +-- crypto/evp/e_ofb_c.c | 16 +-- crypto/evp/e_ofb_d.c | 16 +-- crypto/evp/e_ofb_i.c | 16 +-- crypto/evp/e_ofb_r2.c | 16 +-- crypto/evp/e_ofb_r5.c | 16 +-- crypto/evp/e_rc4.c | 18 +-- crypto/evp/e_xcbc_d.c | 16 +-- crypto/evp/encode.c | 44 ++----- crypto/evp/evp_enc.c | 67 +++-------- crypto/evp/evp_err.c | 2 +- crypto/evp/evp_key.c | 23 +--- crypto/evp/evp_lib.c | 16 +-- crypto/evp/evp_pbe.c | 29 ++--- crypto/evp/evp_pkey.c | 10 +- crypto/evp/m_dss.c | 2 +- crypto/evp/m_dss1.c | 2 +- crypto/evp/m_md2.c | 2 +- crypto/evp/m_md5.c | 2 +- crypto/evp/m_mdc2.c | 2 +- crypto/evp/m_null.c | 4 +- crypto/evp/m_ripemd.c | 2 +- crypto/evp/m_sha.c | 2 +- crypto/evp/m_sha1.c | 2 +- crypto/evp/names.c | 14 +-- crypto/evp/p_dec.c | 7 +- crypto/evp/p_enc.c | 7 +- crypto/evp/p_lib.c | 35 ++---- crypto/evp/p_open.c | 14 +-- crypto/evp/p_seal.c | 15 +-- crypto/evp/p_sign.c | 17 +-- crypto/evp/p_verify.c | 7 +- crypto/ex_data.c | 34 ++---- crypto/hmac/hmac.c | 29 +---- crypto/hmac/hmactest.c | 7 +- crypto/idea/i_cbc.c | 13 +-- crypto/idea/i_cfb64.c | 11 +- crypto/idea/i_ecb.c | 8 +- crypto/idea/i_ofb64.c | 9 +- crypto/idea/i_skey.c | 11 +- crypto/idea/idea_spd.c | 10 +- crypto/idea/ideatest.c | 10 +- crypto/lhash/lh_stats.c | 36 ++---- crypto/lhash/lhash.c | 42 ++----- crypto/md2/md2.c | 10 +- crypto/md2/md2_dgst.c | 18 +-- crypto/md2/md2_one.c | 5 +- crypto/md2/md2test.c | 7 +- crypto/md5/md5.c | 10 +- crypto/md5/md5_dgst.c | 24 +--- crypto/md5/md5_one.c | 5 +- crypto/md5/md5test.c | 7 +- crypto/mdc2/mdc2_one.c | 5 +- crypto/mdc2/mdc2dgst.c | 17 +-- crypto/mdc2/mdc2test.c | 4 +- crypto/mem.c | 84 ++++---------- crypto/objects/o_names.c | 36 ++---- crypto/objects/obj_dat.c | 77 ++++--------- crypto/objects/obj_err.c | 2 +- crypto/objects/obj_lib.c | 7 +- crypto/pem/pem_all.c | 230 +++++++++---------------------------- crypto/pem/pem_err.c | 2 +- crypto/pem/pem_info.c | 19 +-- crypto/pem/pem_lib.c | 102 ++++------------ crypto/pem/pem_seal.c | 29 ++--- crypto/pem/pem_sign.c | 17 +-- crypto/pkcs12/p12_add.c | 39 ++----- crypto/pkcs12/p12_attr.c | 29 ++--- crypto/pkcs12/p12_bags.c | 15 +-- crypto/pkcs12/p12_crpt.c | 15 +-- crypto/pkcs12/p12_crt.c | 15 +-- crypto/pkcs12/p12_decr.c | 33 ++---- crypto/pkcs12/p12_init.c | 3 +- crypto/pkcs12/p12_key.c | 18 ++- crypto/pkcs12/p12_kiss.c | 41 ++----- crypto/pkcs12/p12_lib.c | 14 +-- crypto/pkcs12/p12_mac.c | 15 +-- crypto/pkcs12/p12_mutl.c | 31 ++--- crypto/pkcs12/p12_sbag.c | 15 +-- crypto/pkcs12/p12_utl.c | 24 +--- crypto/pkcs12/pk12err.c | 2 +- crypto/pkcs7/bio_ber.c | 36 ++---- crypto/pkcs7/dec.c | 4 +- crypto/pkcs7/example.c | 52 +++------ crypto/pkcs7/pk7_doit.c | 70 +++-------- crypto/pkcs7/pk7_lib.c | 67 +++-------- crypto/pkcs7/pkcs7err.c | 2 +- crypto/pkcs7/verify.c | 4 +- crypto/rand/md_rand.c | 12 +- crypto/rand/rand_lib.c | 15 +-- crypto/rand/randfile.c | 11 +- crypto/rc2/rc2_cbc.c | 17 +-- crypto/rc2/rc2_ecb.c | 7 +- crypto/rc2/rc2_skey.c | 6 +- crypto/rc2/rc2cfb64.c | 10 +- crypto/rc2/rc2ofb64.c | 9 +- crypto/rc2/rc2speed.c | 10 +- crypto/rc2/rc2test.c | 10 +- crypto/rc4/rc4.c | 4 +- crypto/rc4/rc4_enc.c | 7 +- crypto/rc4/rc4_skey.c | 7 +- crypto/rc4/rc4speed.c | 10 +- crypto/rc4/rc4test.c | 4 +- crypto/rc5/rc5_ecb.c | 7 +- crypto/rc5/rc5_enc.c | 17 +-- crypto/rc5/rc5_skey.c | 7 +- crypto/rc5/rc5cfb64.c | 10 +- crypto/rc5/rc5ofb64.c | 9 +- crypto/rc5/rc5speed.c | 10 +- crypto/rc5/rc5test.c | 10 +- crypto/ripemd/rmd160.c | 10 +- crypto/ripemd/rmd_dgst.c | 25 ++-- crypto/ripemd/rmd_one.c | 6 +- crypto/ripemd/rmdtest.c | 7 +- crypto/rsa/rsa_eay.c | 45 ++------ crypto/rsa/rsa_err.c | 2 +- crypto/rsa/rsa_gen.c | 7 +- crypto/rsa/rsa_lib.c | 76 ++++-------- crypto/rsa/rsa_none.c | 15 +-- crypto/rsa/rsa_oaep.c | 20 +--- crypto/rsa/rsa_oaep_test.c | 2 +- crypto/rsa/rsa_pk1.c | 30 ++--- crypto/rsa/rsa_saos.c | 19 +-- crypto/rsa/rsa_sign.c | 18 +-- crypto/rsa/rsa_ssl.c | 15 +-- crypto/sha/sha.c | 10 +- crypto/sha/sha1.c | 10 +- crypto/sha/sha1_one.c | 5 +- crypto/sha/sha1dgst.c | 22 +--- crypto/sha/sha1test.c | 7 +- crypto/sha/sha_dgst.c | 21 +--- crypto/sha/sha_one.c | 5 +- crypto/sha/shatest.c | 7 +- crypto/stack/stack.c | 51 +++----- crypto/threads/mttest.c | 84 +++++--------- crypto/threads/th-lock.c | 47 +++----- crypto/tmdiff.c | 14 +-- crypto/txt_db/txt_db.c | 28 ++--- crypto/x509/by_dir.c | 28 ++--- crypto/x509/by_file.c | 20 +--- crypto/x509/x509_cmp.c | 58 +++------- crypto/x509/x509_d2.c | 8 +- crypto/x509/x509_def.c | 12 +- crypto/x509/x509_err.c | 2 +- crypto/x509/x509_ext.c | 94 ++++----------- crypto/x509/x509_lu.c | 98 +++++----------- crypto/x509/x509_obj.c | 5 +- crypto/x509/x509_r2x.c | 5 +- crypto/x509/x509_req.c | 8 +- crypto/x509/x509_set.c | 28 ++--- crypto/x509/x509_txt.c | 3 +- crypto/x509/x509_v3.c | 66 +++-------- crypto/x509/x509_vfy.c | 73 ++++-------- crypto/x509/x509name.c | 75 ++++-------- crypto/x509/x509rset.c | 12 +- crypto/x509/x509type.c | 4 +- crypto/x509/x_all.c | 202 +++++++++----------------------- crypto/x509v3/v3_akey.c | 27 ++--- crypto/x509v3/v3_alt.c | 43 +++---- crypto/x509v3/v3_bcons.c | 27 ++--- crypto/x509v3/v3_bitst.c | 14 +-- crypto/x509v3/v3_conf.c | 95 +++++---------- crypto/x509v3/v3_cpols.c | 107 ++++++----------- crypto/x509v3/v3_enum.c | 7 +- crypto/x509v3/v3_extku.c | 26 ++--- crypto/x509v3/v3_genn.c | 29 ++--- crypto/x509v3/v3_ia5.c | 11 +- crypto/x509v3/v3_int.c | 2 +- crypto/x509v3/v3_lib.c | 28 ++--- crypto/x509v3/v3_pku.c | 22 ++-- crypto/x509v3/v3_prn.c | 18 +-- crypto/x509v3/v3_skey.c | 17 +-- crypto/x509v3/v3_sxnet.c | 74 ++++-------- crypto/x509v3/v3_utl.c | 62 +++------- crypto/x509v3/v3conf.c | 4 +- crypto/x509v3/v3err.c | 2 +- crypto/x509v3/v3prin.c | 4 +- perl/openssl_cb.c | 24 +--- rsaref/rsar_err.c | 2 +- rsaref/rsaref.c | 69 ++++------- ssl/bio_ssl.c | 44 ++----- ssl/s23_clnt.c | 14 +-- ssl/s23_lib.c | 26 ++--- ssl/s23_meth.c | 5 +- ssl/s23_pkt.c | 7 +- ssl/s23_srvr.c | 11 +- ssl/s2_clnt.c | 43 +++---- ssl/s2_enc.c | 13 +-- ssl/s2_lib.c | 53 +++------ ssl/s2_meth.c | 5 +- ssl/s2_pkt.c | 43 ++----- ssl/s2_srvr.c | 37 ++---- ssl/s3_both.c | 37 ++---- ssl/s3_clnt.c | 41 +++---- ssl/s3_enc.c | 63 +++------- ssl/s3_lib.c | 78 ++++--------- ssl/s3_meth.c | 5 +- ssl/s3_pkt.c | 56 +++------ ssl/s3_srvr.c | 38 +++--- ssl/ssl_algs.c | 2 +- ssl/ssl_asn1.c | 10 +- ssl/ssl_cert.c | 7 +- ssl/ssl_ciph.c | 50 +++----- ssl/ssl_err.c | 2 +- ssl/ssl_err2.c | 2 +- ssl/ssl_lib.c | 2 +- ssl/ssl_rsa.c | 95 ++++----------- ssl/ssl_sess.c | 86 ++++---------- ssl/ssl_stat.c | 24 ++-- ssl/ssl_txt.c | 8 +- ssl/ssltest.c | 21 +--- ssl/t1_clnt.c | 5 +- ssl/t1_enc.c | 68 +++-------- ssl/t1_lib.c | 19 +-- ssl/t1_meth.c | 5 +- ssl/t1_srvr.c | 5 +- 491 files changed, 2835 insertions(+), 7416 deletions(-) diff --git a/CHANGES b/CHANGES index 4e58f2d357..beb3e62d78 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,9 @@ Changes between 0.9.2b and 0.9.3 + *) Change functions to ANSI C. + [Ulf Möller] + *) Fix typos in error codes. [Martin Kraemer , Ulf Möller] diff --git a/apps/apps.c b/apps/apps.c index 5f0c8fa539..ba07016e83 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -76,10 +76,7 @@ int app_init(); #endif #ifdef undef /* never finished - probably never will be :-) */ -int args_from_file(file,argc,argv) -char *file; -int *argc; -char **argv[]; +int args_from_file(char *file, int *argc, char **argv[]) { FILE *fp; int num,i; @@ -157,8 +154,7 @@ char **argv[]; } #endif -int str2fmt(s) -char *s; +int str2fmt(char *s) { if ((*s == 'D') || (*s == 'd')) return(FORMAT_ASN1); @@ -173,10 +169,7 @@ char *s; } #if defined(MSDOS) || defined(WIN32) || defined(WIN16) -void program_name(in,out,size) -char *in; -char *out; -int size; +void program_name(char *in, char *out, int size) { int i,n; char *p=NULL; @@ -213,10 +206,7 @@ int size; out[n]='\0'; } #else -void program_name(in,out,size) -char *in; -char *out; -int size; +void program_name(char *in, char *out, int size) { char *p; @@ -231,9 +221,7 @@ int size; #endif #ifdef WIN32 -int WIN32_rename(from,to) -char *from; -char *to; +int WIN32_rename(char *from, char *to) { int ret; @@ -242,11 +230,7 @@ char *to; } #endif -int chopup_args(arg,buf,argc,argv) -ARGS *arg; -char *buf; -int *argc; -char **argv[]; +int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[]) { int num,len,i; char *p; @@ -312,8 +296,7 @@ char **argv[]; } #ifndef APP_INIT -int app_init(mesgwin) -long mesgwin; +int app_init(long mesgwin) { return(1); } diff --git a/apps/asn1pars.c b/apps/asn1pars.c index cf9a3bf2bc..39e97887af 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -80,9 +80,7 @@ #undef PROG #define PROG asn1parse_main -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int i,badops=0,offset=0,ret=1,j; unsigned int length=0; diff --git a/apps/ca.c b/apps/ca.c index 467188079a..7cdf14d7ca 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -215,9 +215,7 @@ static char *section=NULL; static int preserve=0; static int msie_hack=0; -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int total=0; int total_done=0; @@ -1179,16 +1177,12 @@ err: EXIT(ret); } -static void lookup_fail(name,tag) -char *name; -char *tag; +static void lookup_fail(char *name, char *tag) { BIO_printf(bio_err,"variable lookup failed for %s::%s\n",name,tag); } -static int MS_CALLBACK key_callback(buf,len,verify) -char *buf; -int len,verify; +static int MS_CALLBACK key_callback(char *buf, int len, int verify) { int i; @@ -1199,8 +1193,7 @@ int len,verify; return(i); } -static unsigned long index_serial_hash(a) -char **a; +static unsigned long index_serial_hash(char **a) { char *n; @@ -1209,9 +1202,7 @@ char **a; return(lh_strhash(n)); } -static int index_serial_cmp(a,b) -char **a; -char **b; +static int index_serial_cmp(char **a, char **b) { char *aa,*bb; @@ -1220,21 +1211,17 @@ char **b; return(strcmp(aa,bb)); } -static unsigned long index_name_hash(a) -char **a; +static unsigned long index_name_hash(char **a) { return(lh_strhash(a[DB_name])); } -static int index_name_qual(a) -char **a; +static int index_name_qual(char **a) { return(a[0][0] == 'V'); } -static int index_name_cmp(a,b) -char **a; -char **b; - { return(strcmp(a[DB_name],b[DB_name])); } +static int index_name_cmp(char **a, char **b) + { return(strcmp(a[DB_name], + b[DB_name])); } -static BIGNUM *load_serial(serialfile) -char *serialfile; +static BIGNUM *load_serial(char *serialfile) { BIO *in=NULL; BIGNUM *ret=NULL; @@ -1272,9 +1259,7 @@ err: return(ret); } -static int save_serial(serialfile,serial) -char *serialfile; -BIGNUM *serial; +static int save_serial(char *serialfile, BIGNUM *serial) { BIO *out; int ret=0; @@ -1306,22 +1291,10 @@ err: return(ret); } -static int certify(xret,infile,pkey,x509,dgst,policy,db,serial,startdate,days, - batch,ext_sect,lconf,verbose) -X509 **xret; -char *infile; -EVP_PKEY *pkey; -X509 *x509; -const EVP_MD *dgst; -STACK *policy; -TXT_DB *db; -BIGNUM *serial; -char *startdate; -int days; -int batch; -char *ext_sect; -LHASH *lconf; -int verbose; +static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, + const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial, + char *startdate, int days, int batch, char *ext_sect, LHASH *lconf, + int verbose) { X509_REQ *req=NULL; BIO *in=NULL; @@ -1377,22 +1350,11 @@ err: return(ok); } -static int certify_cert(xret,infile,pkey,x509,dgst,policy,db,serial,startdate, - days,batch,ext_sect,lconf,verbose) -X509 **xret; -char *infile; -EVP_PKEY *pkey; -X509 *x509; -const EVP_MD *dgst; -STACK *policy; -TXT_DB *db; -BIGNUM *serial; -char *startdate; -int days; -int batch; -char *ext_sect; -LHASH *lconf; -int verbose; +static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, + const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial, + char *startdate, int days, int batch, char *ext_sect, LHASH *lconf, + int verbose) + { X509 *req=NULL; X509_REQ *rreq=NULL; @@ -1452,22 +1414,9 @@ err: return(ok); } -static int do_body(xret,pkey,x509,dgst,policy,db,serial,startdate,days, - batch,verbose,req,ext_sect,lconf) -X509 **xret; -EVP_PKEY *pkey; -X509 *x509; -const EVP_MD *dgst; -STACK *policy; -TXT_DB *db; -BIGNUM *serial; -char *startdate; -int days; -int batch; -int verbose; -X509_REQ *req; -char *ext_sect; -LHASH *lconf; +static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst, + STACK *policy, TXT_DB *db, BIGNUM *serial, char *startdate, int days, + int batch, int verbose, X509_REQ *req, char *ext_sect, LHASH *lconf) { X509_NAME *name=NULL,*CAname=NULL,*subject=NULL; ASN1_UTCTIME *tm,*tmptm; @@ -1895,10 +1844,7 @@ err: return(ok); } -static void write_new_certificate(bp,x, output_der) -BIO *bp; -X509 *x; -int output_der; +static void write_new_certificate(BIO *bp, X509 *x, int output_der) { char *f; char buf[256]; @@ -1924,21 +1870,9 @@ int output_der; BIO_puts(bp,"\n"); } -static int certify_spkac(xret,infile,pkey,x509,dgst,policy,db,serial, - startdate,days,ext_sect,lconf,verbose) -X509 **xret; -char *infile; -EVP_PKEY *pkey; -X509 *x509; -const EVP_MD *dgst; -STACK *policy; -TXT_DB *db; -BIGNUM *serial; -char *startdate; -int days; -char *ext_sect; -LHASH *lconf; -int verbose; +static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, + const EVP_MD *dgst, STACK *policy, TXT_DB *db, BIGNUM *serial, + char *startdate, int days, char *ext_sect, LHASH *lconf, int verbose) { STACK *sk=NULL; LHASH *parms=NULL; @@ -2094,9 +2028,7 @@ err: return(ok); } -static int fix_data(nid,type) -int nid; -int *type; +static int fix_data(int nid, int *type) { if (nid == NID_pkcs9_emailAddress) *type=V_ASN1_IA5STRING; @@ -2111,8 +2043,7 @@ int *type; return(1); } -static int check_time_format(str) -char *str; +static int check_time_format(char *str) { ASN1_UTCTIME tm; @@ -2122,8 +2053,7 @@ char *str; return(ASN1_UTCTIME_check(&tm)); } -static int add_oid_section(hconf) -LHASH *hconf; +static int add_oid_section(LHASH *hconf) { char *p; STACK *sktmp; @@ -2145,9 +2075,7 @@ LHASH *hconf; return 1; } -static int do_revoke(x509,db) -X509 *x509; -TXT_DB *db; +static int do_revoke(X509 *x509, TXT_DB *db) { ASN1_UTCTIME *tm=NULL; char *row[DB_NUMBER],**rrow,**irow; diff --git a/apps/ciphers.c b/apps/ciphers.c index 146527790e..b02b64b5df 100644 --- a/apps/ciphers.c +++ b/apps/ciphers.c @@ -77,9 +77,7 @@ static char *ciphers_usage[]={ NULL }; -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int ret=1,i; int verbose=0; diff --git a/apps/crl.c b/apps/crl.c index 3bb7aae11e..0c03f5fb6c 100644 --- a/apps/crl.c +++ b/apps/crl.c @@ -96,9 +96,7 @@ static X509_CRL *load_crl(); static BIO *bio_out=NULL; -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { X509_CRL *x=NULL; int ret=1,i,num,badops=0; @@ -262,9 +260,7 @@ end: EXIT(ret); } -static X509_CRL *load_crl(infile, format) -char *infile; -int format; +static X509_CRL *load_crl(char *infile, int format) { X509_CRL *x=NULL; BIO *in=NULL; diff --git a/apps/crl2p7.c b/apps/crl2p7.c index beadc96caf..aa407b7098 100644 --- a/apps/crl2p7.c +++ b/apps/crl2p7.c @@ -87,9 +87,7 @@ static int add_certs_from_file(); * -out arg - output file - default stdout */ -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int i,badops=0; BIO *in=NULL,*out=NULL; @@ -288,9 +286,7 @@ end: * number of certs added if successful, -1 if not. *---------------------------------------------------------------------- */ -static int add_certs_from_file(stack,certfile) -STACK_OF(X509) *stack; -char *certfile; +static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile) { struct stat st; BIO *in=NULL; diff --git a/apps/dgst.c b/apps/dgst.c index eb7462d0b1..2926e5514f 100644 --- a/apps/dgst.c +++ b/apps/dgst.c @@ -79,9 +79,7 @@ void do_fp(unsigned char *buf,BIO *f,int sep); void do_fp(); #endif -int MAIN(argc,argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { unsigned char *buf=NULL; int i,err=0; @@ -203,10 +201,7 @@ end: EXIT(err); } -void do_fp(buf,bp,sep) -unsigned char *buf; -BIO *bp; -int sep; +void do_fp(unsigned char *buf, BIO *bp, int sep) { int len; int i; diff --git a/apps/dh.c b/apps/dh.c index 462570c1ba..0b548ef570 100644 --- a/apps/dh.c +++ b/apps/dh.c @@ -81,9 +81,7 @@ * -C */ -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { DH *dh=NULL; int i,badops=0,text=0; diff --git a/apps/dsa.c b/apps/dsa.c index 1f57c46005..312ed31798 100644 --- a/apps/dsa.c +++ b/apps/dsa.c @@ -82,9 +82,7 @@ * -modulus - print the DSA public key */ -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int ret=1; DSA *dsa=NULL; diff --git a/apps/dsaparam.c b/apps/dsaparam.c index e01f939748..085e4845c1 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -89,9 +89,7 @@ static void MS_CALLBACK dsa_cb(int p, int n, char *arg); static void MS_CALLBACK dsa_cb(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { DSA *dsa=NULL; int i,badops=0,text=0; @@ -342,10 +340,7 @@ end: EXIT(ret); } -static void MS_CALLBACK dsa_cb(p, n, arg) -int p; -int n; -char *arg; +static void MS_CALLBACK dsa_cb(int p, int n, char *arg) { char c='*'; diff --git a/apps/enc.c b/apps/enc.c index 00cc336177..b561326733 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -84,9 +84,7 @@ int set_hex(); #define BSIZE (8*1024) #define PROG enc_main -int MAIN(argc,argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { char *strbuf=NULL; unsigned char *buff=NULL,*bufsize=NULL; @@ -521,10 +519,7 @@ end: EXIT(ret); } -int set_hex(in,out,size) -char *in; -unsigned char *out; -int size; +int set_hex(char *in, unsigned char *out, int size) { int i,n; unsigned char j; diff --git a/apps/errstr.c b/apps/errstr.c index d2b2b3fcea..ee51abaf34 100644 --- a/apps/errstr.c +++ b/apps/errstr.c @@ -68,9 +68,7 @@ #undef PROG #define PROG errstr_main -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int i,ret=0; char buf[256]; diff --git a/apps/gendh.c b/apps/gendh.c index 2790f179fd..8900b4f1af 100644 --- a/apps/gendh.c +++ b/apps/gendh.c @@ -81,9 +81,7 @@ static void MS_CALLBACK dh_cb(); static long dh_load_rand(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { char buffer[200]; DH *dh=NULL; @@ -191,10 +189,7 @@ end: EXIT(ret); } -static void MS_CALLBACK dh_cb(p,n,arg) -int p; -int n; -char *arg; +static void MS_CALLBACK dh_cb(int p, int n, char *arg) { char c='*'; @@ -209,8 +204,7 @@ char *arg; #endif } -static long dh_load_rand(name) -char *name; +static long dh_load_rand(char *name) { char *p,*n; int last; diff --git a/apps/gendsa.c b/apps/gendsa.c index 311d95020b..3e198a24f9 100644 --- a/apps/gendsa.c +++ b/apps/gendsa.c @@ -79,9 +79,7 @@ static long dsa_load_rand(char *names); static long dsa_load_rand(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { char buffer[200]; DSA *dsa=NULL; @@ -214,8 +212,7 @@ end: EXIT(ret); } -static long dsa_load_rand(name) -char *name; +static long dsa_load_rand(char *name) { char *p,*n; int last; diff --git a/apps/genrsa.c b/apps/genrsa.c index cdba6189ad..f83bafc7f1 100644 --- a/apps/genrsa.c +++ b/apps/genrsa.c @@ -82,9 +82,7 @@ static void MS_CALLBACK genrsa_cb(); static long gr_load_rand(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int ret=1; char buffer[200]; @@ -234,10 +232,7 @@ err: EXIT(ret); } -static void MS_CALLBACK genrsa_cb(p, n, arg) -int p; -int n; -char *arg; +static void MS_CALLBACK genrsa_cb(int p, int n, char *arg) { char c='*'; @@ -252,8 +247,7 @@ char *arg; #endif } -static long gr_load_rand(name) -char *name; +static long gr_load_rand(char *name) { char *p,*n; int last; diff --git a/apps/nseq.c b/apps/nseq.c index e87c6c77a7..3c70e4d2be 100644 --- a/apps/nseq.c +++ b/apps/nseq.c @@ -70,9 +70,7 @@ static int dump_cert_text(BIO *out, X509 *x); static int dump_cert_text(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { char **args, *infile = NULL, *outfile = NULL; BIO *in = NULL, *out = NULL; @@ -163,9 +161,7 @@ end: EXIT(ret); } -static int dump_cert_text(out, x) -BIO *out; -X509 *x; +static int dump_cert_text(BIO *out, X509 *x) { char buf[256]; X509_NAME_oneline(X509_get_subject_name(x),buf,256); diff --git a/apps/openssl.c b/apps/openssl.c index dd22aa78af..21724201d6 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -99,8 +99,7 @@ LHASH *config=NULL; char *default_config_file=NULL; #ifdef DEBUG -static void sig_stop(i) -int i; +static void sig_stop(int i) { char *a=NULL; @@ -113,9 +112,7 @@ int i; BIO *bio_err=NULL; #endif -int main(Argc,Argv) -int Argc; -char *Argv[]; +int main(int Argc, char *Argv[]) { ARGS arg; #define PROG_NAME_SIZE 16 @@ -258,10 +255,7 @@ end: #define LIST_MESSAGE_DIGEST_COMMANDS "list-message-digest-commands" #define LIST_CIPHER_COMMANDS "list-cipher-commands" -static int do_cmd(prog,argc,argv) -LHASH *prog; -int argc; -char *argv[]; +static int do_cmd(LHASH *prog, int argc, char *argv[]) { FUNCTION f,*fp; int i,ret=1,tp,nl; @@ -354,7 +348,7 @@ static int SortFnByName(const void *_f1,const void *_f2) return strcmp(f1->name,f2->name); } -static LHASH *prog_init() +static LHASH *prog_init(void) { LHASH *ret; FUNCTION *f; @@ -372,14 +366,12 @@ static LHASH *prog_init() return(ret); } -static int MS_CALLBACK cmp(a,b) -FUNCTION *a,*b; +static int MS_CALLBACK cmp(FUNCTION *a, FUNCTION *b) { return(strncmp(a->name,b->name,8)); } -static unsigned long MS_CALLBACK hash(a) -FUNCTION *a; +static unsigned long MS_CALLBACK hash(FUNCTION *a) { return(lh_strhash(a->name)); } diff --git a/apps/pem_mail.c b/apps/pem_mail.c index 64e04acb52..acbf7bd9a0 100644 --- a/apps/pem_mail.c +++ b/apps/pem_mail.c @@ -87,9 +87,7 @@ typedef struct lines_St struct lines_st *next; } LINES; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { FILE *in; RSA *rsa=NULL; diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 96e0379fad..266bfa89ab 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -96,9 +96,7 @@ int alg_print(); int cert_load(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { char *infile=NULL, *outfile=NULL, *keyname = NULL; char *certfile=NULL; @@ -440,9 +438,7 @@ if (export_cert) { EXIT(ret); } -int dump_cert_text (out, x) -BIO *out; -X509 *x; +int dump_cert_text (BIO *out, X509 *x) { char buf[256]; X509_NAME_oneline(X509_get_subject_name(x),buf,256); @@ -456,12 +452,8 @@ X509 *x; return 0; } -int dump_certs_keys_p12 (out, p12, pass, passlen, options) -BIO *out; -PKCS12 *p12; -unsigned char *pass; -int passlen; -int options; +int dump_certs_keys_p12 (BIO *out, PKCS12 *p12, unsigned char *pass, + int passlen, int options) { STACK *asafes, *bags; int i, bagnid; @@ -493,12 +485,8 @@ int options; return 1; } -int dump_certs_pkeys_bags (out, bags, pass, passlen, options) -BIO *out; -STACK *bags; -unsigned char *pass; -int passlen; -int options; +int dump_certs_pkeys_bags (BIO *out, STACK *bags, unsigned char *pass, + int passlen, int options) { int i; for (i = 0; i < sk_num (bags); i++) { @@ -509,12 +497,8 @@ int options; return 1; } -int dump_certs_pkeys_bag (out, bag, pass, passlen, options) -BIO *out; -PKCS12_SAFEBAG *bag; -unsigned char *pass; -int passlen; -int options; +int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, unsigned char *pass, + int passlen, int options) { EVP_PKEY *pkey; PKCS8_PRIV_KEY_INFO *p8; @@ -584,9 +568,7 @@ int options; /* Hope this is OK .... */ -int get_cert_chain (cert, chain) -X509 *cert; -STACK **chain; +int get_cert_chain (X509 *cert, STACK **chain) { X509_STORE *store; X509_STORE_CTX store_ctx; @@ -614,9 +596,7 @@ err: return i; } -int alg_print (x, alg) -BIO *x; -X509_ALGOR *alg; +int alg_print (BIO *x, X509_ALGOR *alg) { PBEPARAM *pbe; unsigned char *p; @@ -630,9 +610,7 @@ X509_ALGOR *alg; /* Load all certificates from a given file */ -int cert_load(in, sk) -BIO *in; -STACK *sk; +int cert_load(BIO *in, STACK *sk) { int ret; X509 *cert; @@ -647,10 +625,7 @@ STACK *sk; /* Generalised attribute print: handle PKCS#8 and bag attributes */ -int print_attribs (out, attrlst, name) -BIO *out; -STACK *attrlst; -char *name; +int print_attribs (BIO *out, STACK *attrlst, char *name) { X509_ATTRIBUTE *attr; ASN1_TYPE *av; @@ -705,10 +680,7 @@ char *name; return 1; } -void hex_prin(out, buf, len) -BIO *out; -unsigned char *buf; -int len; +void hex_prin(BIO *out, unsigned char *buf, int len) { int i; for (i = 0; i < len; i++) BIO_printf (out, "%02X ", buf[i]); diff --git a/apps/pkcs7.c b/apps/pkcs7.c index cac75f48b2..ece2cd7d68 100644 --- a/apps/pkcs7.c +++ b/apps/pkcs7.c @@ -81,9 +81,7 @@ * -print_certs */ -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { PKCS7 *p7=NULL; int i,badops=0; diff --git a/apps/req.c b/apps/req.c index bb3a65a5bc..ce7e318777 100644 --- a/apps/req.c +++ b/apps/req.c @@ -137,9 +137,7 @@ static LHASH *req_conf=NULL; #define TYPE_DSA 2 #define TYPE_DH 3 -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { #ifndef NO_DSA DSA *dsa_params=NULL; @@ -825,10 +823,7 @@ end: EXIT(ex); } -static int make_REQ(req,pkey,attribs) -X509_REQ *req; -EVP_PKEY *pkey; -int attribs; +static int make_REQ(X509_REQ *req, EVP_PKEY *pkey, int attribs) { int ret=0,i; unsigned char *p,*q; @@ -984,14 +979,8 @@ err: return(ret); } -static int add_DN_object(n,text,def,value,nid,min,max) -X509_NAME *n; -char *text; -char *def; -char *value; -int nid; -int min; -int max; +static int add_DN_object(X509_NAME *n, char *text, char *def, char *value, + int nid, int min, int max) { int i,j,ret=0; X509_NAME_ENTRY *ne=NULL; @@ -1044,14 +1033,8 @@ err: return(ret); } -static int add_attribute_object(n,text,def,value,nid,min,max) -STACK *n; -char *text; -char *def; -char *value; -int nid; -int min; -int max; +static int add_attribute_object(STACK *n, char *text, char *def, char *value, + int nid, int min, int max) { int i,z; X509_ATTRIBUTE *xa=NULL; @@ -1135,10 +1118,7 @@ err: return(0); } -static void MS_CALLBACK req_cb(p,n,arg) -int p; -int n; -char *arg; +static void MS_CALLBACK req_cb(int p, int n, char *arg) { char c='*'; @@ -1153,10 +1133,7 @@ char *arg; #endif } -static int req_fix_data(nid,type,len,min,max) -int nid; -int *type; -int len,min,max; +static int req_fix_data(int nid, int *type, int len, int min, int max) { if (nid == NID_pkcs9_emailAddress) *type=V_ASN1_IA5STRING; @@ -1189,9 +1166,7 @@ int len,min,max; } /* Check if the end of a string matches 'end' */ -static int check_end(str, end) -char *str; -char *end; +static int check_end(char *str, char *end) { int elen, slen; char *tmp; @@ -1202,8 +1177,7 @@ char *end; return strcmp(tmp, end); } -static int add_oid_section(conf) -LHASH *conf; +static int add_oid_section(LHASH *conf) { char *p; STACK *sktmp; diff --git a/apps/rsa.c b/apps/rsa.c index c8473d9558..e09eeda16e 100644 --- a/apps/rsa.c +++ b/apps/rsa.c @@ -82,9 +82,7 @@ * -modulus - print the RSA key modulus */ -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int ret=1; RSA *rsa=NULL; diff --git a/apps/s_cb.c b/apps/s_cb.c index c18ecc3a18..ad5bc26e31 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -71,9 +71,7 @@ int verify_depth=0; int verify_error=X509_V_OK; -int MS_CALLBACK verify_callback(ok, ctx) -int ok; -X509_STORE_CTX *ctx; +int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx) { char buf[256]; X509 *err_cert; @@ -123,10 +121,7 @@ X509_STORE_CTX *ctx; return(ok); } -int set_cert_stuff(ctx, cert_file, key_file) -SSL_CTX *ctx; -char *cert_file; -char *key_file; +int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file) { if (cert_file != NULL) { @@ -181,13 +176,8 @@ char *key_file; return(1); } -long MS_CALLBACK bio_dump_cb(bio,cmd,argp,argi,argl,ret) -BIO *bio; -int cmd; -const char *argp; -int argi; -long argl; -long ret; +long MS_CALLBACK bio_dump_cb(BIO *bio, int cmd, const char *argp, int argi, + long argl, long ret) { BIO *out; @@ -210,10 +200,7 @@ long ret; return(ret); } -void MS_CALLBACK apps_ssl_info_callback(s,where,ret) -SSL *s; -int where; -int ret; +void MS_CALLBACK apps_ssl_info_callback(SSL *s, int where, int ret) { char *str; int w; diff --git a/apps/s_client.c b/apps/s_client.c index ffe2d70d88..20e581ec20 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -103,7 +103,7 @@ static void print_stuff(); static BIO *bio_c_out=NULL; static int c_quiet=0; -static void sc_usage() +static void sc_usage(void) { BIO_printf(bio_err,"usage: s_client args\n"); BIO_printf(bio_err,"\n"); @@ -137,9 +137,7 @@ static void sc_usage() } -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int off=0; SSL *con=NULL,*con2=NULL; @@ -657,10 +655,7 @@ end: } -static void print_stuff(bio,s,full) -BIO *bio; -SSL *s; -int full; +static void print_stuff(BIO *bio, SSL *s, int full) { X509 *peer=NULL; char *p; diff --git a/apps/s_server.c b/apps/s_server.c index 8edd8e79bf..1257ac527e 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -120,7 +120,7 @@ static unsigned char dh512_g[]={ 0x02, }; -static DH *get_dh512() +static DH *get_dh512(void) { DH *dh=NULL; @@ -164,7 +164,7 @@ static int s_debug=0; static int s_quiet=0; #if 0 -static void s_server_init() +static void s_server_init(void) { cipher=NULL; s_server_verify=SSL_VERIFY_NONE; @@ -185,7 +185,7 @@ static void s_server_init() } #endif -static void sv_usage() +static void sv_usage(void) { BIO_printf(bio_err,"usage: s_server [args ...]\n"); BIO_printf(bio_err,"\n"); @@ -226,9 +226,7 @@ static int local_argc=0; static char **local_argv; static int hack=0; -int MAIN(argc, argv) -int argc; -char *argv[]; +int MAIN(int argc, char *argv[]) { short port=PORT; char *CApath=NULL,*CAfile=NULL; @@ -533,9 +531,7 @@ end: EXIT(ret); } -static void print_stats(bio,ssl_ctx) -BIO *bio; -SSL_CTX *ssl_ctx; +static void print_stats(BIO *bio, SSL_CTX *ssl_ctx) { BIO_printf(bio,"%4ld items in the session cache\n", SSL_CTX_sess_number(ssl_ctx)); @@ -560,10 +556,7 @@ SSL_CTX *ssl_ctx; SSL_CTX_sess_get_cache_size(ssl_ctx)); } -static int sv_body(hostname, s, context) -char *hostname; -int s; -char *context; +static int sv_body(char *hostname, int s, char *context) { char *buf=NULL; fd_set readfds; @@ -779,7 +772,7 @@ err: return(ret); } -static void close_accept_socket() +static void close_accept_socket(void) { BIO_printf(bio_err,"shutdown accept socket\n"); if (accept_socket >= 0) @@ -788,8 +781,7 @@ static void close_accept_socket() } } -static int init_ssl_connection(con) -SSL *con; +static int init_ssl_connection(SSL *con) { int i; const char *str; @@ -844,7 +836,7 @@ SSL *con; } #ifndef NO_DH -static DH *load_dh_param() +static DH *load_dh_param(void) { DH *ret=NULL; BIO *bio; @@ -859,9 +851,7 @@ err: #endif #if 0 -static int load_CA(ctx,file) -SSL_CTX *ctx; -char *file; +static int load_CA(SSL_CTX *ctx, char *file) { FILE *in; X509 *x=NULL; @@ -881,10 +871,7 @@ char *file; } #endif -static int www_body(hostname, s, context) -char *hostname; -int s; -char *context; +static int www_body(char *hostname, int s, char *context) { char *buf=NULL; int ret=1; @@ -1226,10 +1213,7 @@ err: return(ret); } -static RSA MS_CALLBACK *tmp_rsa_cb(s,export,keylength) -SSL *s; -int export; -int keylength; +static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength) { static RSA *rsa_tmp=NULL; diff --git a/apps/s_socket.c b/apps/s_socket.c index 158014094f..19b9abbba6 100644 --- a/apps/s_socket.c +++ b/apps/s_socket.c @@ -93,11 +93,8 @@ static FARPROC lpTopWndProc=NULL; static FARPROC lpTopHookProc=NULL; extern HINSTANCE _hInstance; /* nice global CRT provides */ -static LONG FAR PASCAL topHookProc(hwnd,message,wParam,lParam) -HWND hwnd; -UINT message; -WPARAM wParam; -LPARAM lParam; +static LONG FAR PASCAL topHookProc(HWND hwnd, UINT message, WPARAM wParam, + LPARAM lParam) { if (hwnd == topWnd) { @@ -122,7 +119,7 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam) #endif /* WIN32 */ #endif /* WINDOWS */ -void sock_cleanup() +void sock_cleanup(void) { #ifdef WINDOWS if (wsa_init_done) @@ -134,7 +131,7 @@ void sock_cleanup() #endif } -int sock_init() +int sock_init(void) { #ifdef WINDOWS if (!wsa_init_done) @@ -165,10 +162,7 @@ int sock_init() return(1); } -int init_client(sock, host, port) -int *sock; -char *host; -int port; +int init_client(int *sock, char *host, int port) { unsigned char ip[4]; short p=0; @@ -181,10 +175,7 @@ int port; return(init_client_ip(sock,ip,port)); } -int init_client_ip(sock, ip, port) -int *sock; -unsigned char ip[4]; -int port; +int init_client_ip(int *sock, unsigned char ip[4], int port) { unsigned long addr; struct sockaddr_in them; @@ -215,8 +206,7 @@ int port; return(1); } -int nbio_sock_error(sock) -int sock; +int nbio_sock_error(int sock) { int j,i,size; @@ -228,10 +218,7 @@ int sock; return(j); } -int nbio_init_client_ip(sock, ip, port) -int *sock; -unsigned char ip[4]; -int port; +int nbio_init_client_ip(int *sock, unsigned char ip[4], int port) { unsigned long addr; struct sockaddr_in them; @@ -280,11 +267,7 @@ int port; return(1); } -int do_server(port, ret, cb, context) -int port; -int *ret; -int (*cb)(); -char *context; +int do_server(int port, int *ret, int (*cb)(), char *context) { int sock; char *name; @@ -316,10 +299,7 @@ char *context; } } -int init_server_long(sock, port, ip) -int *sock; -int port; -char *ip; +int init_server_long(int *sock, int port, char *ip) { int ret=0; struct sockaddr_in server; @@ -369,17 +349,12 @@ err: return(ret); } -int init_server(sock,port) -int *sock; -int port; +int init_server(int *sock, int port) { return(init_server_long(sock, port, NULL)); } -int do_accept(acc_sock, sock, host) -int acc_sock; -int *sock; -char **host; +int do_accept(int acc_sock, int *sock, char **host) { int ret,i; struct hostent *h1,*h2; @@ -465,11 +440,8 @@ end: return(1); } -int extract_host_port(str,host_ptr,ip,port_ptr) -char *str; -char **host_ptr; -unsigned char *ip; -short *port_ptr; +int extract_host_port(char *str, char **host_ptr, unsigned char *ip, + short *port_ptr) { char *h,*p; @@ -493,9 +465,7 @@ err: return(0); } -int host_ip(str,ip) -char *str; -unsigned char ip[4]; +int host_ip(char *str, unsigned char ip[4]) { unsigned int in[4]; int i; @@ -541,9 +511,7 @@ err: return(0); } -int extract_port(str,port_ptr) -char *str; -short *port_ptr; +int extract_port(char *str, short *port_ptr) { int i; struct servent *s; @@ -575,8 +543,7 @@ static struct ghbn_cache_st static unsigned long ghbn_hits=0L; static unsigned long ghbn_miss=0L; -static struct hostent *GetHostByName(name) -char *name; +static struct hostent *GetHostByName(char *name) { struct hostent *ret; int i,lowi=0; @@ -616,11 +583,7 @@ char *name; } #ifndef MSDOS -int spawn(argc, argv, in, out) -int argc; -char **argv; -int *in; -int *out; +int spawn(int argc, char **argv, int *in, int *out) { int pid; #define CHILD_READ p1[0] diff --git a/apps/s_time.c b/apps/s_time.c index 0d4d509dc8..1e335ef4b2 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -190,7 +190,7 @@ static int t_nbio=0; static int exitNow = 0; /* Set when it's time to exit main */ #endif -static void s_time_init() +static void s_time_init(void) { host=SSL_CONNECT_NAME; t_cert_file=NULL; @@ -218,7 +218,7 @@ static void s_time_init() /*********************************************************************** * usage - display usage message */ -static void s_time_usage() +static void s_time_usage(void) { static char umsg[] = "\ -time arg - max number of seconds to collect data, default %d\n\ @@ -250,9 +250,7 @@ static void s_time_usage() * * Returns 0 if ok, -1 on bad args */ -static int parseArgs(argc,argv) -int argc; -char **argv; +static int parseArgs(int argc, char **argv) { int badop = 0; @@ -377,8 +375,7 @@ bad: #define START 0 #define STOP 1 -static double tm_Time_F(s) -int s; +static double tm_Time_F(int s) { static double ret; #ifdef TIMES @@ -412,10 +409,7 @@ int s; * MAIN - main processing area for client * real name depends on MONOLITH */ -int -MAIN(argc,argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { double totalTime = 0.0; int nConn = 0; @@ -639,9 +633,7 @@ end: * Returns: * SSL * = the connection pointer. */ -static SSL * -doConnection(scon) -SSL *scon; +static SSL *doConnection(SSL *scon) { BIO *conn; SSL *serverCon; diff --git a/apps/sc.c b/apps/sc.c index fccd805921..816040d28a 100644 --- a/apps/sc.c +++ b/apps/sc.c @@ -110,7 +110,7 @@ static void print_stuff(); static BIO *bio_c_out=NULL; static int c_quiet=0; -static void sc_usage() +static void sc_usage(void) { BIO_printf(bio_err,"usage: client args\n"); BIO_printf(bio_err,"\n"); @@ -143,9 +143,7 @@ static void sc_usage() } -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int off=0; SSL *con=NULL,*con2=NULL; diff --git a/apps/sess_id.c b/apps/sess_id.c index 4a1860d080..c1b497981e 100644 --- a/apps/sess_id.c +++ b/apps/sess_id.c @@ -89,9 +89,7 @@ static SSL_SESSION *load_sess_id(char *file, int format); static SSL_SESSION *load_sess_id(); #endif -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { SSL_SESSION *x=NULL; int ret=1,i,num,badops=0; @@ -271,9 +269,7 @@ end: EXIT(ret); } -static SSL_SESSION *load_sess_id(infile, format) -char *infile; -int format; +static SSL_SESSION *load_sess_id(char *infile, int format) { SSL_SESSION *x=NULL; BIO *in=NULL; diff --git a/apps/speed.c b/apps/speed.c index 4a337be0ae..6c88a1c3d1 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -204,8 +204,7 @@ static SIGRETTYPE sig_done(int sig); static SIGRETTYPE sig_done(); #endif -static SIGRETTYPE sig_done(sig) -int sig; +static SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -218,8 +217,7 @@ int sig; #define START 0 #define STOP 1 -static double Time_F(s) -int s; +static double Time_F(int s) { double ret; #ifdef TIMES @@ -255,9 +253,7 @@ int s; #endif } -int MAIN(argc,argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { unsigned char *buf=NULL,*buf2=NULL; int ret=1; @@ -1183,10 +1179,7 @@ end: EXIT(ret); } -static void print_message(s,num,length) -char *s; -long num; -int length; +static void print_message(char *s, long num, int length) { #ifdef SIGALRM BIO_printf(bio_err,"Doing %s for %ds on %d size blocks: ",s,SECONDS,length); @@ -1201,12 +1194,8 @@ int length; #endif } -static void pkey_print_message(str,str2,num,bits,tm) -char *str; -char *str2; -long num; -int bits; -int tm; +static void pkey_print_message(char *str, char *str2, long num, int bits, + int tm) { #ifdef SIGALRM BIO_printf(bio_err,"Doing %d bit %s %s's for %ds: ",bits,str,str2,tm); diff --git a/apps/verify.c b/apps/verify.c index 2179110d37..1a324c3da9 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -78,9 +78,7 @@ static int check(); static int v_verbose=0; -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int i,ret=1; char *CApath=NULL,*CAfile=NULL; @@ -154,9 +152,7 @@ end: EXIT(ret); } -static int check(ctx,file) -X509_STORE *ctx; -char *file; +static int check(X509_STORE *ctx, char *file) { X509 *x=NULL; BIO *in=NULL; @@ -210,9 +206,7 @@ end: return(ret); } -static int MS_CALLBACK cb(ok,ctx) -int ok; -X509_STORE_CTX *ctx; +static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx) { char buf[256]; diff --git a/apps/version.c b/apps/version.c index 0de9c495a8..fd46e17688 100644 --- a/apps/version.c +++ b/apps/version.c @@ -66,9 +66,7 @@ #undef PROG #define PROG version_main -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int i,ret=0; int cflags=0,version=0,date=0,options=0,platform=0; diff --git a/apps/x509.c b/apps/x509.c index 2a7188f121..f1975dca9d 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -135,9 +135,7 @@ static int x509_certify (); static int reqfile=0; -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { int ret=1; X509_REQ *req=NULL; @@ -704,16 +702,9 @@ end: EXIT(ret); } -static int x509_certify(ctx,CAfile,digest,x,xca,pkey,serialfile,create,days) -X509_STORE *ctx; -char *CAfile; -const EVP_MD *digest; -X509 *x; -X509 *xca; -EVP_PKEY *pkey; -char *serialfile; -int create; -int days; +static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, + X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create, + int days) { int ret=0; BIO *io=NULL; @@ -859,9 +850,7 @@ end: return(ret); } -static int MS_CALLBACK callb(ok, ctx) -int ok; -X509_STORE_CTX *ctx; +static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx) { char buf[256]; int err; @@ -894,9 +883,7 @@ X509_STORE_CTX *ctx; } } -static EVP_PKEY *load_key(file, format) -char *file; -int format; +static EVP_PKEY *load_key(char *file, int format) { BIO *key=NULL; EVP_PKEY *pkey=NULL; @@ -949,9 +936,7 @@ end: return(pkey); } -static X509 *load_cert(file, format) -char *file; -int format; +static X509 *load_cert(char *file, int format) { ASN1_HEADER *ah=NULL; BUF_MEM *buf=NULL; @@ -1038,11 +1023,7 @@ end: } /* self sign */ -static int sign(x, pkey, days, digest) -X509 *x; -EVP_PKEY *pkey; -int days; -const EVP_MD *digest; +static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest) { EVP_PKEY *pktmp; 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 */ -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 , 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); } -ASN1_HEADER *ASN1_HEADER_new() +ASN1_HEADER *ASN1_HEADER_new(void) { ASN1_HEADER *ret=NULL; ASN1_CTX c; @@ -120,8 +116,7 @@ ASN1_HEADER *ASN1_HEADER_new() M_ASN1_New_Error(ASN1_F_ASN1_HEADER_NEW); } -void ASN1_HEADER_free(a) -ASN1_HEADER *a; +void ASN1_HEADER_free(ASN1_HEADER *a) { if (a == NULL) return; ASN1_OCTET_STRING_free(a->header); diff --git a/crypto/asn1/a_i2d_fp.c b/crypto/asn1/a_i2d_fp.c index 66c3df68d5..f010ec1272 100644 --- a/crypto/asn1/a_i2d_fp.c +++ b/crypto/asn1/a_i2d_fp.c @@ -62,10 +62,7 @@ #include "asn1_mac.h" #ifndef NO_FP_API -int ASN1_i2d_fp(i2d,out,x) -int (*i2d)(); -FILE *out; -unsigned char *x; +int ASN1_i2d_fp(int (*i2d)(), FILE *out, unsigned char *x) { BIO *b; int ret; @@ -82,10 +79,7 @@ unsigned char *x; } #endif -int ASN1_i2d_bio(i2d,out,x) -int (*i2d)(); -BIO *out; -unsigned char *x; +int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x) { char *b; unsigned char *p; diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index e847efee85..acfc855261 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -63,9 +63,7 @@ /* ASN1err(ASN1_F_D2I_ASN1_INTEGER,ASN1_R_EXPECTING_AN_INTEGER); */ -int i2d_ASN1_INTEGER(a,pp) -ASN1_INTEGER *a; -unsigned char **pp; +int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) { int pad=0,ret,r,i,t; unsigned char *p,*pt,*n,pb=0; @@ -116,10 +114,8 @@ unsigned char **pp; return(r); } -ASN1_INTEGER *d2i_ASN1_INTEGER(a, pp, length) -ASN1_INTEGER **a; -unsigned char **pp; -long length; +ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, + long length) { ASN1_INTEGER *ret=NULL; unsigned char *p,*to,*s; @@ -194,9 +190,7 @@ err: return(NULL); } -int ASN1_INTEGER_set(a,v) -ASN1_INTEGER *a; -long v; +int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) { int i,j,k; unsigned char buf[sizeof(long)+1]; @@ -236,8 +230,7 @@ long v; return(1); } -long ASN1_INTEGER_get(a) -ASN1_INTEGER *a; +long ASN1_INTEGER_get(ASN1_INTEGER *a) { int neg=0,i; long r=0; @@ -266,9 +259,7 @@ ASN1_INTEGER *a; return(r); } -ASN1_INTEGER *BN_to_ASN1_INTEGER(bn,ai) -BIGNUM *bn; -ASN1_INTEGER *ai; +ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai) { ASN1_INTEGER *ret; int len,j; @@ -293,9 +284,7 @@ err: return(NULL); } -BIGNUM *ASN1_INTEGER_to_BN(ai,bn) -ASN1_INTEGER *ai; -BIGNUM *bn; +BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai, BIGNUM *bn) { BIGNUM *ret; diff --git a/crypto/asn1/a_meth.c b/crypto/asn1/a_meth.c index 513625c305..961085578e 100644 --- a/crypto/asn1/a_meth.c +++ b/crypto/asn1/a_meth.c @@ -73,12 +73,12 @@ static ASN1_METHOD bit_string_meth={ (char *(*)()) ASN1_STRING_new, (void (*)()) ASN1_STRING_free}; -ASN1_METHOD *ASN1_IA5STRING_asn1_meth() +ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void) { return(&ia5string_meth); } -ASN1_METHOD *ASN1_BIT_STRING_asn1_meth() +ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void) { return(&bit_string_meth); } diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index 9eff09509c..ef77bb0d2d 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -67,9 +67,7 @@ * ASN1err(ASN1_F_I2T_ASN1_OBJECT,ASN1_R_BAD_OBJECT_HEADER); */ -int i2d_ASN1_OBJECT(a, pp) -ASN1_OBJECT *a; -unsigned char **pp; +int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) { unsigned char *p; @@ -87,11 +85,7 @@ unsigned char **pp; return(a->length); } -int a2d_ASN1_OBJECT(out,olen,buf,num) -unsigned char *out; -int olen; -const char *buf; -int num; +int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) { int i,first,len=0,c; char tmp[24]; @@ -181,10 +175,7 @@ err: return(0); } -int i2t_ASN1_OBJECT(buf,buf_len,a) -char *buf; -int buf_len; -ASN1_OBJECT *a; +int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a) { int i,idx=0,n=0,len,nid; unsigned long l; @@ -257,9 +248,7 @@ ASN1_OBJECT *a; return(n); } -int i2a_ASN1_OBJECT(bp,a) -BIO *bp; -ASN1_OBJECT *a; +int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a) { char buf[80]; int i; @@ -272,10 +261,8 @@ ASN1_OBJECT *a; return(i); } -ASN1_OBJECT *d2i_ASN1_OBJECT(a, pp, length) -ASN1_OBJECT **a; -unsigned char **pp; -long length; +ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp, + long length) { ASN1_OBJECT *ret=NULL; unsigned char *p; @@ -331,7 +318,7 @@ err: return(NULL); } -ASN1_OBJECT *ASN1_OBJECT_new() +ASN1_OBJECT *ASN1_OBJECT_new(void) { ASN1_OBJECT *ret; @@ -350,8 +337,7 @@ ASN1_OBJECT *ASN1_OBJECT_new() return(ret); } -void ASN1_OBJECT_free(a) -ASN1_OBJECT *a; +void ASN1_OBJECT_free(ASN1_OBJECT *a) { if (a == NULL) return; if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) @@ -372,11 +358,8 @@ ASN1_OBJECT *a; Free(a); } -ASN1_OBJECT *ASN1_OBJECT_create(nid,data,len,sn,ln) -int nid; -unsigned char *data; -int len; -char *sn,*ln; +ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, + char *sn, char *ln) { ASN1_OBJECT o; diff --git a/crypto/asn1/a_octet.c b/crypto/asn1/a_octet.c index 5954c7bee0..2509175185 100644 --- a/crypto/asn1/a_octet.c +++ b/crypto/asn1/a_octet.c @@ -63,18 +63,14 @@ /* ASN1err(ASN1_F_D2I_ASN1_OCTET_STRING,ASN1_R_EXPECTING_AN_OCTET_STRING); */ -int i2d_ASN1_OCTET_STRING(a, pp) -ASN1_OCTET_STRING *a; -unsigned char **pp; +int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **pp) { return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL)); } -ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(a, pp, length) -ASN1_OCTET_STRING **a; -unsigned char **pp; -long length; +ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, + unsigned char **pp, long length) { ASN1_OCTET_STRING *ret=NULL; diff --git a/crypto/asn1/a_print.c b/crypto/asn1/a_print.c index 9fa75616ae..babb571c5b 100644 --- a/crypto/asn1/a_print.c +++ b/crypto/asn1/a_print.c @@ -64,43 +64,30 @@ * ASN1err(ASN1_F_D2I_ASN1_PRINT_TYPE,ASN1_R_TAG_VALUE_TOO_HIGH); */ -int i2d_ASN1_IA5STRING(a,pp) -ASN1_IA5STRING *a; -unsigned char **pp; +int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **pp) { return(M_i2d_ASN1_IA5STRING(a,pp)); } -ASN1_IA5STRING *d2i_ASN1_IA5STRING(a,pp,l) -ASN1_IA5STRING **a; -unsigned char **pp; -long l; +ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, unsigned char **pp, + long l) { return(M_d2i_ASN1_IA5STRING(a,pp,l)); } -ASN1_T61STRING *d2i_ASN1_T61STRING(a,pp,l) -ASN1_T61STRING **a; -unsigned char **pp; -long l; +ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, unsigned char **pp, + long l) { return(M_d2i_ASN1_T61STRING(a,pp,l)); } -ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(a,pp,l) -ASN1_PRINTABLESTRING **a; -unsigned char **pp; -long l; - { return(M_d2i_ASN1_PRINTABLESTRING(a,pp,l)); } +ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, + unsigned char **pp, long l) + { return(M_d2i_ASN1_PRINTABLESTRING(a,pp, + l)); } -int i2d_ASN1_PRINTABLE(a,pp) -ASN1_STRING *a; -unsigned char **pp; +int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **pp) { return(M_i2d_ASN1_PRINTABLE(a,pp)); } -ASN1_STRING *d2i_ASN1_PRINTABLE(a,pp,l) -ASN1_STRING **a; -unsigned char **pp; -long l; +ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, unsigned char **pp, + long l) { return(M_d2i_ASN1_PRINTABLE(a,pp,l)); } -int ASN1_PRINTABLE_type(s,len) -unsigned char *s; -int len; +int ASN1_PRINTABLE_type(unsigned char *s, int len) { int c; int ia5=0; @@ -131,8 +118,7 @@ int len; return(V_ASN1_PRINTABLESTRING); } -int ASN1_UNIVERSALSTRING_to_string(s) -ASN1_UNIVERSALSTRING *s; +int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) { int i; unsigned char *p; @@ -160,24 +146,16 @@ ASN1_UNIVERSALSTRING *s; } -int i2d_DIRECTORYSTRING(a,pp) -ASN1_STRING *a; -unsigned char **pp; +int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **pp) { return(M_i2d_DIRECTORYSTRING(a,pp)); } -ASN1_STRING *d2i_DIRECTORYSTRING(a,pp,l) -ASN1_STRING **a; -unsigned char **pp; -long l; +ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp, + long l) { return(M_d2i_DIRECTORYSTRING(a,pp,l)); } -int i2d_DISPLAYTEXT(a,pp) -ASN1_STRING *a; -unsigned char **pp; +int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **pp) { return(M_i2d_DISPLAYTEXT(a,pp)); } -ASN1_STRING *d2i_DISPLAYTEXT(a,pp,l) -ASN1_STRING **a; -unsigned char **pp; -long l; +ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp, + long l) { return(M_d2i_DISPLAYTEXT(a,pp,l)); } diff --git a/crypto/asn1/a_set.c b/crypto/asn1/a_set.c index 34000ecf7d..406c68face 100644 --- a/crypto/asn1/a_set.c +++ b/crypto/asn1/a_set.c @@ -84,14 +84,9 @@ static int SetBlobCmp(const void *elem1, const void *elem2 ) return b1->cbData-b2->cbData; } -int i2d_ASN1_SET(a,pp,func,ex_tag,ex_class,is_set) -STACK *a; -unsigned char **pp; -int (*func)(); -int ex_tag; -int ex_class; -int is_set; /* if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */ - +/* 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 ret=0,r; int i; @@ -158,14 +153,8 @@ SetBlob return(r); } -STACK *d2i_ASN1_SET(a,pp,length,func,free_func,ex_tag,ex_class) -STACK **a; -unsigned char **pp; -long length; -char *(*func)(); -void (*free_func)(); -int ex_tag; -int ex_class; +STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, + char *(*func)(), void (*free_func)(), int ex_tag, int ex_class) { ASN1_CTX c; STACK *ret=NULL; diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c index d3ae78b7b4..7ce246c7cf 100644 --- a/crypto/asn1/a_sign.c +++ b/crypto/asn1/a_sign.c @@ -68,14 +68,9 @@ #include "objects.h" #include "buffer.h" -int ASN1_sign(i2d,algor1,algor2,signature,data,pkey,type) -int (*i2d)(); -X509_ALGOR *algor1; -X509_ALGOR *algor2; -ASN1_BIT_STRING *signature; -char *data; -EVP_PKEY *pkey; -const EVP_MD *type; +int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, + const EVP_MD *type) { EVP_MD_CTX ctx; unsigned char *p,*buf_in=NULL,*buf_out=NULL; diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index 953ed6088d..495f0814a3 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -66,9 +66,7 @@ #include "cryptlib.h" #include "asn1.h" -int i2d_ASN1_TIME(a,pp) -ASN1_TIME *a; -unsigned char **pp; +int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) { if(a->type == V_ASN1_UTCTIME || a->type == V_ASN1_GENERALIZEDTIME) return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, @@ -78,10 +76,7 @@ unsigned char **pp; } -ASN1_TIME *d2i_ASN1_TIME(a, pp, length) -ASN1_TIME **a; -unsigned char **pp; -long length; +ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length) { unsigned char tag; tag = **pp & ~V_ASN1_CONSTRUCTED; @@ -94,9 +89,7 @@ long length; } -ASN1_TIME *ASN1_TIME_set(s, t) -ASN1_TIME *s; -time_t t; +ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) { struct tm *ts; #if defined(THREADS) && !defined(WIN32) diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c index 2f8a16174e..5ccd5de00e 100644 --- a/crypto/asn1/a_type.c +++ b/crypto/asn1/a_type.c @@ -70,9 +70,7 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a); static void ASN1_TYPE_component_free(); #endif -int i2d_ASN1_TYPE(a,pp) -ASN1_TYPE *a; -unsigned char **pp; +int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp) { int r=0; @@ -150,10 +148,7 @@ unsigned char **pp; return(r); } -ASN1_TYPE *d2i_ASN1_TYPE(a,pp,length) -ASN1_TYPE **a; -unsigned char **pp; -long length; +ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length) { ASN1_TYPE *ret=NULL; unsigned char *q,*p,*max; @@ -280,7 +275,7 @@ err: return(NULL); } -ASN1_TYPE *ASN1_TYPE_new() +ASN1_TYPE *ASN1_TYPE_new(void) { ASN1_TYPE *ret=NULL; ASN1_CTX c; @@ -292,16 +287,14 @@ ASN1_TYPE *ASN1_TYPE_new() M_ASN1_New_Error(ASN1_F_ASN1_TYPE_NEW); } -void ASN1_TYPE_free(a) -ASN1_TYPE *a; +void ASN1_TYPE_free(ASN1_TYPE *a) { if (a == NULL) return; ASN1_TYPE_component_free(a); Free((char *)(char *)a); } -int ASN1_TYPE_get(a) -ASN1_TYPE *a; +int ASN1_TYPE_get(ASN1_TYPE *a) { if (a->value.ptr != NULL) return(a->type); @@ -309,10 +302,7 @@ ASN1_TYPE *a; return(0); } -void ASN1_TYPE_set(a,type,value) -ASN1_TYPE *a; -int type; -char *value; +void ASN1_TYPE_set(ASN1_TYPE *a, int type, char *value) { if (a->value.ptr != NULL) ASN1_TYPE_component_free(a); @@ -320,8 +310,7 @@ char *value; a->value.ptr=value; } -static void ASN1_TYPE_component_free(a) -ASN1_TYPE *a; +static void ASN1_TYPE_component_free(ASN1_TYPE *a) { if (a == NULL) return; diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index ddd1a4016b..291c0fda69 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -65,19 +65,15 @@ * ASN1err(ASN1_F_D2I_ASN1_UTCTIME,ASN1_R_EXPECTING_A_UTCTIME); */ -int i2d_ASN1_UTCTIME(a,pp) -ASN1_UTCTIME *a; -unsigned char **pp; +int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp) { return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, V_ASN1_UTCTIME,V_ASN1_UNIVERSAL)); } -ASN1_UTCTIME *d2i_ASN1_UTCTIME(a, pp, length) -ASN1_UTCTIME **a; -unsigned char **pp; -long length; +ASN1_UTCTIME *d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp, + long length) { ASN1_UTCTIME *ret=NULL; @@ -101,8 +97,7 @@ err: return(NULL); } -int ASN1_UTCTIME_check(d) -ASN1_UTCTIME *d; +int ASN1_UTCTIME_check(ASN1_UTCTIME *d) { static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0}; static int max[8]={99,12,31,23,59,59,12,59}; @@ -152,9 +147,7 @@ err: return(0); } -int ASN1_UTCTIME_set_string(s,str) -ASN1_UTCTIME *s; -char *str; +int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str) { ASN1_UTCTIME t; @@ -174,9 +167,7 @@ char *str; return(0); } -ASN1_UTCTIME *ASN1_UTCTIME_set(s, t) -ASN1_UTCTIME *s; -time_t t; +ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) { char *p; struct tm *ts; diff --git a/crypto/asn1/a_utf8.c b/crypto/asn1/a_utf8.c index 2657abae41..2babbe712d 100644 --- a/crypto/asn1/a_utf8.c +++ b/crypto/asn1/a_utf8.c @@ -63,18 +63,14 @@ /* ASN1err(ASN1_F_D2I_ASN1_UTF8STRING,ERR_R_MALLOC_FAILURE); */ -int i2d_ASN1_UTF8STRING(a, pp) -ASN1_UTF8STRING *a; -unsigned char **pp; +int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **pp) { return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, V_ASN1_UTF8STRING,V_ASN1_UNIVERSAL)); } -ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(a, pp, length) -ASN1_UTF8STRING **a; -unsigned char **pp; -long length; +ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, unsigned char **pp, + long length) { ASN1_UTF8STRING *ret=NULL; diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c index dc5db9288b..fc2711058b 100644 --- a/crypto/asn1/a_verify.c +++ b/crypto/asn1/a_verify.c @@ -68,12 +68,8 @@ #include "buffer.h" #include "evp.h" -int ASN1_verify(i2d,a,signature,data,pkey) -int (*i2d)(); -X509_ALGOR *a; -ASN1_BIT_STRING *signature; -char *data; -EVP_PKEY *pkey; +int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, + char *data, EVP_PKEY *pkey) { EVP_MD_CTX ctx; const EVP_MD *type; diff --git a/crypto/asn1/a_vis.c b/crypto/asn1/a_vis.c index 288be17049..2e5a709016 100644 --- a/crypto/asn1/a_vis.c +++ b/crypto/asn1/a_vis.c @@ -63,18 +63,14 @@ /* ASN1err(ASN1_F_D2I_ASN1_VISIBLESTRING,ERR_R_MALLOC_FAILURE); */ -int i2d_ASN1_VISIBLESTRING(a, pp) -ASN1_VISIBLESTRING *a; -unsigned char **pp; +int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a, unsigned char **pp) { return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, V_ASN1_VISIBLESTRING,V_ASN1_UNIVERSAL)); } -ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(a, pp, length) -ASN1_VISIBLESTRING **a; -unsigned char **pp; -long length; +ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, + unsigned char **pp, long length) { ASN1_VISIBLESTRING *ret=NULL; diff --git a/crypto/asn1/asn1_err.c b/crypto/asn1/asn1_err.c index c5a898f02d..7d8217036b 100644 --- a/crypto/asn1/asn1_err.c +++ b/crypto/asn1/asn1_err.c @@ -306,7 +306,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]= #endif -void ERR_load_ASN1_strings() +void ERR_load_ASN1_strings(void) { static int init=1; diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index a18c7e7075..8c5d2d80ed 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -71,9 +71,7 @@ static void asn1_put_length(); const char *ASN1_version="ASN.1" OPENSSL_VERSION_PTEXT; -int ASN1_check_infinite_end(p,len) -unsigned char **p; -long len; +int ASN1_check_infinite_end(unsigned char **p, long len) { /* If there is 0 or 1 byte left, the length check should pick * things up */ @@ -88,12 +86,8 @@ long len; } -int ASN1_get_object(pp, plength, ptag, pclass, omax) -unsigned char **pp; -long *plength; -int *ptag; -int *pclass; -long omax; +int ASN1_get_object(unsigned char **pp, long *plength, int *ptag, int *pclass, + long omax) { int i,ret; long l; @@ -152,11 +146,7 @@ err: return(0x80); } -static int asn1_get_length(pp,inf,rl,max) -unsigned char **pp; -int *inf; -long *rl; -int max; +static int asn1_get_length(unsigned char **pp, int *inf, long *rl, int max) { unsigned char *p= *pp; long ret=0; @@ -193,12 +183,8 @@ int max; /* class 0 is constructed * constructed == 2 for indefinitle length constructed */ -void ASN1_put_object(pp,constructed,length,tag,xclass) -unsigned char **pp; -int constructed; -int length; -int tag; -int xclass; +void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, + int xclass) { unsigned char *p= *pp; int i; @@ -224,9 +210,7 @@ int xclass; *pp=p; } -static void asn1_put_length(pp, length) -unsigned char **pp; -int length; +static void asn1_put_length(unsigned char **pp, int length) { unsigned char *p= *pp; int i,l; @@ -249,10 +233,7 @@ int length; *pp=p; } -int ASN1_object_size(constructed, length, tag) -int constructed; -int length; -int tag; +int ASN1_object_size(int constructed, int length, int tag) { int ret; @@ -280,8 +261,7 @@ int tag; return(ret); } -int asn1_Finish(c) -ASN1_CTX *c; +int asn1_Finish(ASN1_CTX *c) { if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos)) { @@ -300,9 +280,7 @@ ASN1_CTX *c; return(1); } -int asn1_GetSequence(c,length) -ASN1_CTX *c; -long *length; +int asn1_GetSequence(ASN1_CTX *c, long *length) { unsigned char *q; @@ -331,8 +309,7 @@ long *length; return(1); } -ASN1_STRING *ASN1_STRING_dup(str) -ASN1_STRING *str; +ASN1_STRING *ASN1_STRING_dup(ASN1_STRING *str) { ASN1_STRING *ret; @@ -347,10 +324,7 @@ ASN1_STRING *str; return(ret); } -int ASN1_STRING_set(str,data,len) -ASN1_STRING *str; -unsigned char *data; -int len; +int ASN1_STRING_set(ASN1_STRING *str, unsigned char *data, int len) { char *c; @@ -385,14 +359,13 @@ int len; return(1); } -ASN1_STRING *ASN1_STRING_new() +ASN1_STRING *ASN1_STRING_new(void) { return(ASN1_STRING_type_new(V_ASN1_OCTET_STRING)); } -ASN1_STRING *ASN1_STRING_type_new(type) -int type; +ASN1_STRING *ASN1_STRING_type_new(int type) { ASN1_STRING *ret; @@ -409,16 +382,14 @@ int type; return(ret); } -void ASN1_STRING_free(a) -ASN1_STRING *a; +void ASN1_STRING_free(ASN1_STRING *a) { if (a == NULL) return; if (a->data != NULL) Free((char *)a->data); Free((char *)a); } -int ASN1_STRING_cmp(a,b) -ASN1_STRING *a,*b; +int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b) { int i; @@ -435,9 +406,7 @@ ASN1_STRING *a,*b; return(i); } -void asn1_add_error(address,offset) -unsigned char *address; -int offset; +void asn1_add_error(unsigned char *address, int offset) { char buf1[16],buf2[16]; diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c index d62be7dbe2..ab5521a7b3 100644 --- a/crypto/asn1/asn1_par.c +++ b/crypto/asn1/asn1_par.c @@ -72,12 +72,8 @@ static int asn1_print_info(); static int asn1_parse2(); #endif -static int asn1_print_info(bp, tag, xclass, constructed,indent) -BIO *bp; -int tag; -int xclass; -int constructed; -int indent; +static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, + int indent) { static const char fmt[]="%-18s"; static const char fmt2[]="%2d %-15s"; @@ -165,22 +161,13 @@ err: return(0); } -int ASN1_parse(bp, pp, len, indent) -BIO *bp; -unsigned char *pp; -long len; -int indent; +int ASN1_parse(BIO *bp, unsigned char *pp, long len, int indent) { return(asn1_parse2(bp,&pp,len,0,0,indent)); } -static int asn1_parse2(bp, pp, length, offset, depth, indent) -BIO *bp; -unsigned char **pp; -long length; -int offset; -int depth; -int indent; +static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset, + int depth, int indent) { unsigned char *p,*ep,*tot,*op,*opp; long len; diff --git a/crypto/asn1/asn_pack.c b/crypto/asn1/asn_pack.c index 6e0dd95622..c094d64e1c 100644 --- a/crypto/asn1/asn_pack.c +++ b/crypto/asn1/asn_pack.c @@ -64,11 +64,8 @@ /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ -STACK *ASN1_seq_unpack(buf, len, d2i, free_func) -unsigned char *buf; -int len; -char *(*d2i)(); -void (*free_func)(); +STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), + void (*free_func)()) { STACK *sk; unsigned char *pbuf; @@ -83,11 +80,8 @@ void (*free_func)(); * Malloc'ed buffer */ -unsigned char *ASN1_seq_pack(safes, i2d, buf, len) -STACK *safes; -int (*i2d)(); -unsigned char **buf; -int *len; +unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, + int *len) { int safelen; unsigned char *safe, *p; @@ -110,9 +104,7 @@ int *len; /* Extract an ASN1 object from an ASN1_STRING */ -char *ASN1_unpack_string (oct, d2i) -ASN1_STRING *oct; -char *(*d2i)(); +char *ASN1_unpack_string (ASN1_STRING *oct, char *(*d2i)()) { unsigned char *p; char *ret; @@ -125,10 +117,7 @@ char *(*d2i)(); /* Pack an ASN1 object into an ASN1_STRING */ -ASN1_STRING *ASN1_pack_string (obj, i2d, oct) -char *obj; -int (*i2d)(); -ASN1_STRING **oct; +ASN1_STRING *ASN1_pack_string (char *obj, int (*i2d)(), ASN1_STRING **oct) { unsigned char *p; ASN1_STRING *octmp; diff --git a/crypto/asn1/d2i_dhp.c b/crypto/asn1/d2i_dhp.c index f2236fc2e2..4fea5af8e3 100644 --- a/crypto/asn1/d2i_dhp.c +++ b/crypto/asn1/d2i_dhp.c @@ -68,10 +68,7 @@ * ASN1err(ASN1_F_I2D_DHPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -DH *d2i_DHparams(a,pp,length) -DH **a; -unsigned char **pp; -long length; +DH *d2i_DHparams(DH **a, unsigned char **pp, long length) { int i=ERR_R_NESTED_ASN1_ERROR; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_dsap.c b/crypto/asn1/d2i_dsap.c index fc2961b3a4..2f3b6b6a57 100644 --- a/crypto/asn1/d2i_dsap.c +++ b/crypto/asn1/d2i_dsap.c @@ -68,10 +68,7 @@ * ASN1err(ASN1_F_I2D_DSAPARAMS,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -DSA *d2i_DSAparams(a,pp,length) -DSA **a; -unsigned char **pp; -long length; +DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length) { int i=ERR_R_NESTED_ASN1_ERROR; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c index 677403564b..0fee334e77 100644 --- a/crypto/asn1/d2i_pr.c +++ b/crypto/asn1/d2i_pr.c @@ -63,11 +63,8 @@ #include "objects.h" #include "x509.h" -EVP_PKEY *d2i_PrivateKey(type,a,pp,length) -int type; -EVP_PKEY **a; -unsigned char **pp; -long length; +EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, + long length) { EVP_PKEY *ret; diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c index eb572acb0f..d89c6e287c 100644 --- a/crypto/asn1/d2i_pu.c +++ b/crypto/asn1/d2i_pu.c @@ -63,11 +63,8 @@ #include "objects.h" #include "x509.h" -EVP_PKEY *d2i_PublicKey(type,a,pp,length) -int type; -EVP_PKEY **a; -unsigned char **pp; -long length; +EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, + long length) { EVP_PKEY *ret; diff --git a/crypto/asn1/d2i_r_pr.c b/crypto/asn1/d2i_r_pr.c index a276a1d4c5..3a4267bf97 100644 --- a/crypto/asn1/d2i_r_pr.c +++ b/crypto/asn1/d2i_r_pr.c @@ -75,15 +75,12 @@ static ASN1_METHOD method={ (char *(*)())RSA_new, (void (*)()) RSA_free}; -ASN1_METHOD *RSAPrivateKey_asn1_meth() +ASN1_METHOD *RSAPrivateKey_asn1_meth(void) { return(&method); } -RSA *d2i_RSAPrivateKey(a,pp,length) -RSA **a; -unsigned char **pp; -long length; +RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length) { int i=ASN1_R_PARSING; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_r_pu.c b/crypto/asn1/d2i_r_pu.c index a4e2c22f36..5a98e55930 100644 --- a/crypto/asn1/d2i_r_pu.c +++ b/crypto/asn1/d2i_r_pu.c @@ -68,10 +68,7 @@ * ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -RSA *d2i_RSAPublicKey(a,pp,length) -RSA **a; -unsigned char **pp; -long length; +RSA *d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length) { int i=ASN1_R_PARSING; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_s_pr.c b/crypto/asn1/d2i_s_pr.c index 8499702c9c..b318b1e3b5 100644 --- a/crypto/asn1/d2i_s_pr.c +++ b/crypto/asn1/d2i_s_pr.c @@ -71,10 +71,7 @@ * ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_PARSING); */ -DSA *d2i_DSAPrivateKey(a,pp,length) -DSA **a; -unsigned char **pp; -long length; +DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length) { int i=ASN1_R_PARSING; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_s_pu.c b/crypto/asn1/d2i_s_pu.c index ecf6407eab..c7b7ad0a43 100644 --- a/crypto/asn1/d2i_s_pu.c +++ b/crypto/asn1/d2i_s_pu.c @@ -70,10 +70,7 @@ * ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -DSA *d2i_DSAPublicKey(a,pp,length) -DSA **a; -unsigned char **pp; -long length; +DSA *d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length) { int i=ASN1_R_PARSING; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c index 4153d1b57f..8197fcd8f7 100644 --- a/crypto/asn1/evp_asn1.c +++ b/crypto/asn1/evp_asn1.c @@ -61,10 +61,7 @@ #include "asn1.h" #include "asn1_mac.h" -int ASN1_TYPE_set_octetstring(a,data,len) -ASN1_TYPE *a; -unsigned char *data; -int len; +int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len) { ASN1_STRING *os; @@ -74,10 +71,9 @@ int len; return(1); } -int ASN1_TYPE_get_octetstring(a,data,max_len) -ASN1_TYPE *a; -unsigned char *data; -int max_len; /* for returned value */ +/* int max_len: for returned value */ +int ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, + int max_len) { int ret,num; unsigned char *p; @@ -97,11 +93,8 @@ int max_len; /* for returned value */ return(ret); } -int ASN1_TYPE_set_int_octetstring(a,num,data,len) -ASN1_TYPE *a; -long num; -unsigned char *data; -int len; +int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, unsigned char *data, + int len) { int n,size; ASN1_OCTET_STRING os,*osp; @@ -137,11 +130,9 @@ int len; /* we return the actual length..., num may be missing, in which * case, set it to zero */ -int ASN1_TYPE_get_int_octetstring(a,num,data,max_len) -ASN1_TYPE *a; -long *num; -unsigned char *data; -int max_len; /* for returned value */ +/* int max_len: for returned value */ +int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data, + int max_len) { int ret= -1,n; ASN1_INTEGER *ai=NULL; diff --git a/crypto/asn1/f_enum.c b/crypto/asn1/f_enum.c index 515f1dc42d..392e6b0184 100644 --- a/crypto/asn1/f_enum.c +++ b/crypto/asn1/f_enum.c @@ -63,9 +63,7 @@ /* Based on a_int.c: equivalent ENUMERATED functions */ -int i2a_ASN1_ENUMERATED(bp, a) -BIO *bp; -ASN1_ENUMERATED *a; +int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a) { int i,n=0; static const char *h="0123456789ABCDEF"; @@ -98,11 +96,7 @@ err: return(-1); } -int a2i_ASN1_ENUMERATED(bp,bs,buf,size) -BIO *bp; -ASN1_ENUMERATED *bs; -char *buf; -int size; +int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) { int ret=0; int i,j,k,m,n,again,bufsize; diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c index a877e0cd52..85ec6cec66 100644 --- a/crypto/asn1/f_int.c +++ b/crypto/asn1/f_int.c @@ -61,9 +61,7 @@ #include "buffer.h" #include "x509.h" -int i2a_ASN1_INTEGER(bp, a) -BIO *bp; -ASN1_INTEGER *a; +int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) { int i,n=0; static const char *h="0123456789ABCDEF"; @@ -96,11 +94,7 @@ err: return(-1); } -int a2i_ASN1_INTEGER(bp,bs,buf,size) -BIO *bp; -ASN1_INTEGER *bs; -char *buf; -int size; +int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) { int ret=0; int i,j,k,m,n,again,bufsize; diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c index e7ca97f9eb..ab7a7b1f6b 100644 --- a/crypto/asn1/f_string.c +++ b/crypto/asn1/f_string.c @@ -61,10 +61,7 @@ #include "buffer.h" #include "x509.h" -int i2a_ASN1_STRING(bp, a, type) -BIO *bp; -ASN1_STRING *a; -int type; +int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) { int i,n=0; static const char *h="0123456789ABCDEF"; @@ -97,11 +94,7 @@ err: return(-1); } -int a2i_ASN1_STRING(bp,bs,buf,size) -BIO *bp; -ASN1_STRING *bs; -char *buf; -int size; +int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) { int ret=0; int i,j,k,m,n,again,bufsize; diff --git a/crypto/asn1/i2d_dhp.c b/crypto/asn1/i2d_dhp.c index a1afa46c86..690ba1ab8f 100644 --- a/crypto/asn1/i2d_dhp.c +++ b/crypto/asn1/i2d_dhp.c @@ -67,9 +67,7 @@ * ASN1err(ASN1_F_X509_DHPARAMS_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_DHparams(a,pp) -DH *a; -unsigned char **pp; +int i2d_DHparams(DH *a, unsigned char **pp) { BIGNUM *num[3]; ASN1_INTEGER bs; diff --git a/crypto/asn1/i2d_dsap.c b/crypto/asn1/i2d_dsap.c index 0b7d5543f3..402ed199dc 100644 --- a/crypto/asn1/i2d_dsap.c +++ b/crypto/asn1/i2d_dsap.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_DSAPARAMS,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_DSAparams(a,pp) -DSA *a; -unsigned char **pp; +int i2d_DSAparams(DSA *a, unsigned char **pp) { BIGNUM *num[3]; ASN1_INTEGER bs; diff --git a/crypto/asn1/i2d_pr.c b/crypto/asn1/i2d_pr.c index b6b821d73c..f173c9a5c1 100644 --- a/crypto/asn1/i2d_pr.c +++ b/crypto/asn1/i2d_pr.c @@ -62,9 +62,7 @@ #include "evp.h" #include "objects.h" -int i2d_PrivateKey(a,pp) -EVP_PKEY *a; -unsigned char **pp; +int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) { #ifndef NO_RSA if (a->type == EVP_PKEY_RSA) diff --git a/crypto/asn1/i2d_pu.c b/crypto/asn1/i2d_pu.c index 1b854252b7..8139175e18 100644 --- a/crypto/asn1/i2d_pu.c +++ b/crypto/asn1/i2d_pu.c @@ -62,9 +62,7 @@ #include "evp.h" #include "objects.h" -int i2d_PublicKey(a,pp) -EVP_PKEY *a; -unsigned char **pp; +int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) { switch (a->type) { diff --git a/crypto/asn1/i2d_r_pr.c b/crypto/asn1/i2d_r_pr.c index 78312dbf2f..cfd1fc74f5 100644 --- a/crypto/asn1/i2d_r_pr.c +++ b/crypto/asn1/i2d_r_pr.c @@ -68,9 +68,7 @@ * ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -int i2d_RSAPrivateKey(a,pp) -RSA *a; -unsigned char **pp; +int i2d_RSAPrivateKey(RSA *a, unsigned char **pp) { BIGNUM *num[9]; unsigned char data[1]; diff --git a/crypto/asn1/i2d_r_pu.c b/crypto/asn1/i2d_r_pu.c index 4bcebaa1ba..4f0a022317 100644 --- a/crypto/asn1/i2d_r_pu.c +++ b/crypto/asn1/i2d_r_pu.c @@ -68,9 +68,7 @@ * ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -int i2d_RSAPublicKey(a,pp) -RSA *a; -unsigned char **pp; +int i2d_RSAPublicKey(RSA *a, unsigned char **pp) { BIGNUM *num[2]; ASN1_INTEGER bs; diff --git a/crypto/asn1/i2d_s_pr.c b/crypto/asn1/i2d_s_pr.c index 6e95305548..7374f7e9b5 100644 --- a/crypto/asn1/i2d_s_pr.c +++ b/crypto/asn1/i2d_s_pr.c @@ -67,9 +67,7 @@ * ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -int i2d_DSAPrivateKey(a,pp) -DSA *a; -unsigned char **pp; +int i2d_DSAPrivateKey(DSA *a, unsigned char **pp) { BIGNUM *num[6]; unsigned char data[1]; diff --git a/crypto/asn1/i2d_s_pu.c b/crypto/asn1/i2d_s_pu.c index 5cf2877069..bfa40f3e62 100644 --- a/crypto/asn1/i2d_s_pu.c +++ b/crypto/asn1/i2d_s_pu.c @@ -67,9 +67,7 @@ * ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ASN1_R_UNKNOWN_ATTRIBUTE_TYPE); */ -int i2d_DSAPublicKey(a,pp) -DSA *a; -unsigned char **pp; +int i2d_DSAPublicKey(DSA *a, unsigned char **pp) { BIGNUM *num[4]; ASN1_INTEGER bs; diff --git a/crypto/asn1/n_pkey.c b/crypto/asn1/n_pkey.c index d9bf417738..edab9feeab 100644 --- a/crypto/asn1/n_pkey.c +++ b/crypto/asn1/n_pkey.c @@ -92,10 +92,7 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new(); static void NETSCAPE_PKEY_free(); #endif -int i2d_Netscape_RSA(a,pp,cb) -RSA *a; -unsigned char **pp; -int (*cb)(); +int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()) { int i,j,l[6]; NETSCAPE_PKEY *pkey; @@ -204,11 +201,7 @@ err: return(ret); } -RSA *d2i_Netscape_RSA(a,pp,length,cb) -RSA **a; -unsigned char **pp; -long length; -int (*cb)(); +RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()) { RSA *ret=NULL; ASN1_OCTET_STRING *os=NULL; @@ -235,11 +228,8 @@ int (*cb)(); M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA); } -RSA *d2i_Netscape_RSA_2(a,pp,length,cb) -RSA **a; -unsigned char **pp; -long length; -int (*cb)(); +RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, + int (*cb)()) { NETSCAPE_PKEY *pkey=NULL; RSA *ret=NULL; @@ -306,9 +296,7 @@ err: return(ret); } -static int i2d_NETSCAPE_PKEY(a,pp) -NETSCAPE_PKEY *a; -unsigned char **pp; +static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -326,10 +314,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(a,pp,length) -NETSCAPE_PKEY **a; -unsigned char **pp; -long length; +static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,NETSCAPE_PKEY *,NETSCAPE_PKEY_new); @@ -341,7 +327,7 @@ long length; M_ASN1_D2I_Finish(a,NETSCAPE_PKEY_free,ASN1_F_D2I_NETSCAPE_PKEY); } -static NETSCAPE_PKEY *NETSCAPE_PKEY_new() +static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void) { NETSCAPE_PKEY *ret=NULL; ASN1_CTX c; @@ -354,8 +340,7 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new() M_ASN1_New_Error(ASN1_F_NETSCAPE_PKEY_NEW); } -static void NETSCAPE_PKEY_free(a) -NETSCAPE_PKEY *a; +static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/nsseq.c b/crypto/asn1/nsseq.c index 5f95cfd69f..ba43be59b2 100644 --- a/crypto/asn1/nsseq.c +++ b/crypto/asn1/nsseq.c @@ -70,9 +70,7 @@ * ASN1err(ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE,ERR_R_MALLOC_FAILURE); */ -int i2d_NETSCAPE_CERT_SEQUENCE(a,pp) -NETSCAPE_CERT_SEQUENCE *a; -unsigned char **pp; +int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp) { int v = 0; M_ASN1_I2D_vars(a); @@ -89,7 +87,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new() +NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void) { NETSCAPE_CERT_SEQUENCE *ret=NULL; ASN1_CTX c; @@ -101,10 +99,8 @@ NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new() M_ASN1_New_Error(ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW); } -NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(a,pp,length) -NETSCAPE_CERT_SEQUENCE **a; -unsigned char **pp; -long length; +NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,NETSCAPE_CERT_SEQUENCE *, NETSCAPE_CERT_SEQUENCE_new); @@ -116,8 +112,7 @@ long length; M_ASN1_D2I_Finish(a, NETSCAPE_CERT_SEQUENCE_free, ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE); } -void NETSCAPE_CERT_SEQUENCE_free (a) -NETSCAPE_CERT_SEQUENCE *a; +void NETSCAPE_CERT_SEQUENCE_free (NETSCAPE_CERT_SEQUENCE *a) { if (a == NULL) return; ASN1_OBJECT_free(a->type); diff --git a/crypto/asn1/p5_pbe.c b/crypto/asn1/p5_pbe.c index 5396a5a47b..b0de0d843b 100644 --- a/crypto/asn1/p5_pbe.c +++ b/crypto/asn1/p5_pbe.c @@ -70,9 +70,7 @@ *ASN1err(ASN1_F_D2I_PBEPARAM,ASN1_R_DECODE_ERROR) */ -int i2d_PBEPARAM(a, pp) -PBEPARAM *a; -unsigned char **pp; +int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp) { M_ASN1_I2D_vars(a); M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING); @@ -85,7 +83,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PBEPARAM *PBEPARAM_new() +PBEPARAM *PBEPARAM_new(void) { PBEPARAM *ret=NULL; ASN1_CTX c; @@ -96,10 +94,7 @@ PBEPARAM *PBEPARAM_new() M_ASN1_New_Error(ASN1_F_PBEPARAM_NEW); } -PBEPARAM *d2i_PBEPARAM(a,pp,length) -PBEPARAM **a; -unsigned char **pp; -long length; +PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PBEPARAM *,PBEPARAM_new); M_ASN1_D2I_Init(); @@ -109,8 +104,7 @@ long length; M_ASN1_D2I_Finish(a, PBEPARAM_free, ASN1_F_D2I_PBEPARAM); } -void PBEPARAM_free (a) -PBEPARAM *a; +void PBEPARAM_free (PBEPARAM *a) { if(a==NULL) return; ASN1_OCTET_STRING_free(a->salt); @@ -120,11 +114,8 @@ PBEPARAM *a; /* Return an algorithm identifier for a PKCS#5 PBE algorithm */ -X509_ALGOR *PKCS5_pbe_set(alg, iter, salt, saltlen) -int alg; -int iter; -unsigned char *salt; -int saltlen; +X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt, + int saltlen) { unsigned char *pdata, *ptmp; int plen; diff --git a/crypto/asn1/p5_pbev2.c b/crypto/asn1/p5_pbev2.c index b81703e5cb..2e496022de 100644 --- a/crypto/asn1/p5_pbev2.c +++ b/crypto/asn1/p5_pbev2.c @@ -70,9 +70,7 @@ *ASN1err(ASN1_F_D2I_PBKDF2PARAM,ASN1_R_DECODE_ERROR) */ -int i2d_PBE2PARAM(a, pp) -PBE2PARAM *a; -unsigned char **pp; +int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp) { M_ASN1_I2D_vars(a); M_ASN1_I2D_len (a->keyfunc, i2d_X509_ALGOR); @@ -86,7 +84,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PBE2PARAM *PBE2PARAM_new() +PBE2PARAM *PBE2PARAM_new(void) { PBE2PARAM *ret=NULL; ASN1_CTX c; @@ -97,10 +95,7 @@ PBE2PARAM *PBE2PARAM_new() M_ASN1_New_Error(ASN1_F_PBE2PARAM_NEW); } -PBE2PARAM *d2i_PBE2PARAM(a,pp,length) -PBE2PARAM **a; -unsigned char **pp; -long length; +PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PBE2PARAM *,PBE2PARAM_new); M_ASN1_D2I_Init(); @@ -110,8 +105,7 @@ long length; M_ASN1_D2I_Finish(a, PBE2PARAM_free, ASN1_F_D2I_PBE2PARAM); } -void PBE2PARAM_free (a) -PBE2PARAM *a; +void PBE2PARAM_free (PBE2PARAM *a) { if(a==NULL) return; X509_ALGOR_free(a->keyfunc); @@ -119,9 +113,7 @@ PBE2PARAM *a; Free ((char *)a); } -int i2d_PBKDF2PARAM(a, pp) -PBKDF2PARAM *a; -unsigned char **pp; +int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp) { M_ASN1_I2D_vars(a); M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING); @@ -139,7 +131,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PBKDF2PARAM *PBKDF2PARAM_new() +PBKDF2PARAM *PBKDF2PARAM_new(void) { PBKDF2PARAM *ret=NULL; ASN1_CTX c; @@ -152,10 +144,8 @@ PBKDF2PARAM *PBKDF2PARAM_new() M_ASN1_New_Error(ASN1_F_PBKDF2PARAM_NEW); } -PBKDF2PARAM *d2i_PBKDF2PARAM(a,pp,length) -PBKDF2PARAM **a; -unsigned char **pp; -long length; +PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,PBKDF2PARAM *,PBKDF2PARAM_new); M_ASN1_D2I_Init(); @@ -167,8 +157,7 @@ long length; M_ASN1_D2I_Finish(a, PBKDF2PARAM_free, ASN1_F_D2I_PBKDF2PARAM); } -void PBKDF2PARAM_free (a) -PBKDF2PARAM *a; +void PBKDF2PARAM_free (PBKDF2PARAM *a) { if(a==NULL) return; ASN1_OCTET_STRING_free(a->salt); diff --git a/crypto/asn1/p7_dgst.c b/crypto/asn1/p7_dgst.c index bf7b8e2f43..516746b104 100644 --- a/crypto/asn1/p7_dgst.c +++ b/crypto/asn1/p7_dgst.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_DIGEST,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_DIGEST(a,pp) -PKCS7_DIGEST *a; -unsigned char **pp; +int i2d_PKCS7_DIGEST(PKCS7_DIGEST *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -87,10 +85,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_DIGEST *d2i_PKCS7_DIGEST(a,pp,length) -PKCS7_DIGEST **a; -unsigned char **pp; -long length; +PKCS7_DIGEST *d2i_PKCS7_DIGEST(PKCS7_DIGEST **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,PKCS7_DIGEST *,PKCS7_DIGEST_new); @@ -104,7 +100,7 @@ long length; M_ASN1_D2I_Finish(a,PKCS7_DIGEST_free,ASN1_F_D2I_PKCS7_DIGEST); } -PKCS7_DIGEST *PKCS7_DIGEST_new() +PKCS7_DIGEST *PKCS7_DIGEST_new(void) { PKCS7_DIGEST *ret=NULL; ASN1_CTX c; @@ -118,8 +114,7 @@ PKCS7_DIGEST *PKCS7_DIGEST_new() M_ASN1_New_Error(ASN1_F_PKCS7_DIGEST_NEW); } -void PKCS7_DIGEST_free(a) -PKCS7_DIGEST *a; +void PKCS7_DIGEST_free(PKCS7_DIGEST *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p7_enc.c b/crypto/asn1/p7_enc.c index 56e27fa112..f5ebbf776d 100644 --- a/crypto/asn1/p7_enc.c +++ b/crypto/asn1/p7_enc.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_ENCRYPT,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_ENCRYPT(a,pp) -PKCS7_ENCRYPT *a; -unsigned char **pp; +int i2d_PKCS7_ENCRYPT(PKCS7_ENCRYPT *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -83,10 +81,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(a,pp,length) -PKCS7_ENCRYPT **a; -unsigned char **pp; -long length; +PKCS7_ENCRYPT *d2i_PKCS7_ENCRYPT(PKCS7_ENCRYPT **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,PKCS7_ENCRYPT *,PKCS7_ENCRYPT_new); @@ -98,7 +94,7 @@ long length; M_ASN1_D2I_Finish(a,PKCS7_ENCRYPT_free,ASN1_F_D2I_PKCS7_ENCRYPT); } -PKCS7_ENCRYPT *PKCS7_ENCRYPT_new() +PKCS7_ENCRYPT *PKCS7_ENCRYPT_new(void) { PKCS7_ENCRYPT *ret=NULL; ASN1_CTX c; @@ -110,8 +106,7 @@ PKCS7_ENCRYPT *PKCS7_ENCRYPT_new() M_ASN1_New_Error(ASN1_F_PKCS7_ENCRYPT_NEW); } -void PKCS7_ENCRYPT_free(a) -PKCS7_ENCRYPT *a; +void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p7_enc_c.c b/crypto/asn1/p7_enc_c.c index f98afb51b8..8914d87402 100644 --- a/crypto/asn1/p7_enc_c.c +++ b/crypto/asn1/p7_enc_c.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_ENC_CONTENT,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_ENC_CONTENT(a,pp) -PKCS7_ENC_CONTENT *a; -unsigned char **pp; +int i2d_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -85,10 +83,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(a,pp,length) -PKCS7_ENC_CONTENT **a; -unsigned char **pp; -long length; +PKCS7_ENC_CONTENT *d2i_PKCS7_ENC_CONTENT(PKCS7_ENC_CONTENT **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS7_ENC_CONTENT *,PKCS7_ENC_CONTENT_new); @@ -103,7 +99,7 @@ long length; ASN1_F_D2I_PKCS7_ENC_CONTENT); } -PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new() +PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new(void) { PKCS7_ENC_CONTENT *ret=NULL; ASN1_CTX c; @@ -117,8 +113,7 @@ PKCS7_ENC_CONTENT *PKCS7_ENC_CONTENT_new() M_ASN1_New_Error(ASN1_F_PKCS7_ENC_CONTENT_NEW); } -void PKCS7_ENC_CONTENT_free(a) -PKCS7_ENC_CONTENT *a; +void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a) { if (a == NULL) return; ASN1_OBJECT_free(a->content_type); diff --git a/crypto/asn1/p7_evp.c b/crypto/asn1/p7_evp.c index 7879a66848..babb9b2752 100644 --- a/crypto/asn1/p7_evp.c +++ b/crypto/asn1/p7_evp.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_ENVELOPE(a,pp) -PKCS7_ENVELOPE *a; -unsigned char **pp; +int i2d_PKCS7_ENVELOPE(PKCS7_ENVELOPE *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -85,10 +83,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(a,pp,length) -PKCS7_ENVELOPE **a; -unsigned char **pp; -long length; +PKCS7_ENVELOPE *d2i_PKCS7_ENVELOPE(PKCS7_ENVELOPE **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,PKCS7_ENVELOPE *,PKCS7_ENVELOPE_new); @@ -102,7 +98,7 @@ long length; M_ASN1_D2I_Finish(a,PKCS7_ENVELOPE_free,ASN1_F_D2I_PKCS7_ENVELOPE); } -PKCS7_ENVELOPE *PKCS7_ENVELOPE_new() +PKCS7_ENVELOPE *PKCS7_ENVELOPE_new(void) { PKCS7_ENVELOPE *ret=NULL; ASN1_CTX c; @@ -115,8 +111,7 @@ PKCS7_ENVELOPE *PKCS7_ENVELOPE_new() M_ASN1_New_Error(ASN1_F_PKCS7_ENVELOPE_NEW); } -void PKCS7_ENVELOPE_free(a) -PKCS7_ENVELOPE *a; +void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p7_i_s.c b/crypto/asn1/p7_i_s.c index 9bae647feb..11ebfcadc9 100644 --- a/crypto/asn1/p7_i_s.c +++ b/crypto/asn1/p7_i_s.c @@ -66,9 +66,8 @@ * ASN1err(ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_ISSUER_AND_SERIAL(a,pp) -PKCS7_ISSUER_AND_SERIAL *a; -unsigned char **pp; +int i2d_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL *a, + unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -83,10 +82,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(a,pp,length) -PKCS7_ISSUER_AND_SERIAL **a; -unsigned char **pp; -long length; +PKCS7_ISSUER_AND_SERIAL *d2i_PKCS7_ISSUER_AND_SERIAL(PKCS7_ISSUER_AND_SERIAL **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS7_ISSUER_AND_SERIAL *,PKCS7_ISSUER_AND_SERIAL_new); @@ -98,7 +94,7 @@ long length; ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL); } -PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new() +PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new(void) { PKCS7_ISSUER_AND_SERIAL *ret=NULL; ASN1_CTX c; @@ -110,8 +106,7 @@ PKCS7_ISSUER_AND_SERIAL *PKCS7_ISSUER_AND_SERIAL_new() M_ASN1_New_Error(ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW); } -void PKCS7_ISSUER_AND_SERIAL_free(a) -PKCS7_ISSUER_AND_SERIAL *a; +void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a) { if (a == NULL) return; X509_NAME_free(a->issuer); diff --git a/crypto/asn1/p7_lib.c b/crypto/asn1/p7_lib.c index 4ab64777b3..560f63ddba 100644 --- a/crypto/asn1/p7_lib.c +++ b/crypto/asn1/p7_lib.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_PKCS7_NEW,ASN1_R_BAD_PKCS7_TYPE); */ -int i2d_PKCS7(a,pp) -PKCS7 *a; -unsigned char **pp; +int i2d_PKCS7(PKCS7 *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -150,10 +148,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7 *d2i_PKCS7(a,pp,length) -PKCS7 **a; -unsigned char **pp; -long length; +PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS7 *,PKCS7_new); @@ -236,7 +231,7 @@ long length; M_ASN1_D2I_Finish(a,PKCS7_free,ASN1_F_D2I_PKCS7); } -PKCS7 *PKCS7_new() +PKCS7 *PKCS7_new(void) { PKCS7 *ret=NULL; ASN1_CTX c; @@ -251,8 +246,7 @@ PKCS7 *PKCS7_new() M_ASN1_New_Error(ASN1_F_PKCS7_NEW); } -void PKCS7_free(a) -PKCS7 *a; +void PKCS7_free(PKCS7 *a) { if (a == NULL) return; @@ -264,8 +258,7 @@ PKCS7 *a; Free((char *)(char *)a); } -void PKCS7_content_free(a) -PKCS7 *a; +void PKCS7_content_free(PKCS7 *a) { if(a == NULL) return; diff --git a/crypto/asn1/p7_recip.c b/crypto/asn1/p7_recip.c index 2516d7b193..f6d121731a 100644 --- a/crypto/asn1/p7_recip.c +++ b/crypto/asn1/p7_recip.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_RECIP_INFO,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_RECIP_INFO(a,pp) -PKCS7_RECIP_INFO *a; -unsigned char **pp; +int i2d_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -87,10 +85,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(a,pp,length) -PKCS7_RECIP_INFO **a; -unsigned char **pp; -long length; +PKCS7_RECIP_INFO *d2i_PKCS7_RECIP_INFO(PKCS7_RECIP_INFO **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS7_RECIP_INFO *,PKCS7_RECIP_INFO_new); @@ -104,7 +100,7 @@ long length; M_ASN1_D2I_Finish(a,PKCS7_RECIP_INFO_free,ASN1_F_D2I_PKCS7_RECIP_INFO); } -PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new() +PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new(void) { PKCS7_RECIP_INFO *ret=NULL; ASN1_CTX c; @@ -119,8 +115,7 @@ PKCS7_RECIP_INFO *PKCS7_RECIP_INFO_new() M_ASN1_New_Error(ASN1_F_PKCS7_RECIP_INFO_NEW); } -void PKCS7_RECIP_INFO_free(a) -PKCS7_RECIP_INFO *a; +void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p7_s_e.c b/crypto/asn1/p7_s_e.c index 8271c8f8e3..c4d0eef4d7 100644 --- a/crypto/asn1/p7_s_e.c +++ b/crypto/asn1/p7_s_e.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_SIGN_ENVELOPE,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_SIGN_ENVELOPE(a,pp) -PKCS7_SIGN_ENVELOPE *a; -unsigned char **pp; +int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -93,10 +91,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(a,pp,length) -PKCS7_SIGN_ENVELOPE **a; -unsigned char **pp; -long length; +PKCS7_SIGN_ENVELOPE *d2i_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS7_SIGN_ENVELOPE *,PKCS7_SIGN_ENVELOPE_new); @@ -116,7 +112,7 @@ long length; ASN1_F_D2I_PKCS7_SIGN_ENVELOPE); } -PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new() +PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void) { PKCS7_SIGN_ENVELOPE *ret=NULL; ASN1_CTX c; @@ -133,8 +129,7 @@ PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new() M_ASN1_New_Error(ASN1_F_PKCS7_SIGN_ENVELOPE_NEW); } -void PKCS7_SIGN_ENVELOPE_free(a) -PKCS7_SIGN_ENVELOPE *a; +void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p7_signd.c b/crypto/asn1/p7_signd.c index f4d03f8b89..c7e78cd3a3 100644 --- a/crypto/asn1/p7_signd.c +++ b/crypto/asn1/p7_signd.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_SIGNED,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_SIGNED(a,pp) -PKCS7_SIGNED *a; -unsigned char **pp; +int i2d_PKCS7_SIGNED(PKCS7_SIGNED *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -91,10 +89,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_SIGNED *d2i_PKCS7_SIGNED(a,pp,length) -PKCS7_SIGNED **a; -unsigned char **pp; -long length; +PKCS7_SIGNED *d2i_PKCS7_SIGNED(PKCS7_SIGNED **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,PKCS7_SIGNED *,PKCS7_SIGNED_new); @@ -111,7 +107,7 @@ long length; M_ASN1_D2I_Finish(a,PKCS7_SIGNED_free,ASN1_F_D2I_PKCS7_SIGNED); } -PKCS7_SIGNED *PKCS7_SIGNED_new() +PKCS7_SIGNED *PKCS7_SIGNED_new(void) { PKCS7_SIGNED *ret=NULL; ASN1_CTX c; @@ -127,8 +123,7 @@ PKCS7_SIGNED *PKCS7_SIGNED_new() M_ASN1_New_Error(ASN1_F_PKCS7_SIGNED_NEW); } -void PKCS7_SIGNED_free(a) -PKCS7_SIGNED *a; +void PKCS7_SIGNED_free(PKCS7_SIGNED *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p7_signi.c b/crypto/asn1/p7_signi.c index 2a5dcb39fa..3ca11d9fc0 100644 --- a/crypto/asn1/p7_signi.c +++ b/crypto/asn1/p7_signi.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_PKCS7_SIGNER_INFO,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_PKCS7_SIGNER_INFO(a,pp) -PKCS7_SIGNER_INFO *a; -unsigned char **pp; +int i2d_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -93,10 +91,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(a,pp,length) -PKCS7_SIGNER_INFO **a; -unsigned char **pp; -long length; +PKCS7_SIGNER_INFO *d2i_PKCS7_SIGNER_INFO(PKCS7_SIGNER_INFO **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS7_SIGNER_INFO *,PKCS7_SIGNER_INFO_new); @@ -116,7 +112,7 @@ long length; ASN1_F_D2I_PKCS7_SIGNER_INFO); } -PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new() +PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new(void) { PKCS7_SIGNER_INFO *ret=NULL; ASN1_CTX c; @@ -134,8 +130,7 @@ PKCS7_SIGNER_INFO *PKCS7_SIGNER_INFO_new() M_ASN1_New_Error(ASN1_F_PKCS7_SIGNER_INFO_NEW); } -void PKCS7_SIGNER_INFO_free(a) -PKCS7_SIGNER_INFO *a; +void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/p8_pkey.c b/crypto/asn1/p8_pkey.c index 360009422f..455ee884b0 100644 --- a/crypto/asn1/p8_pkey.c +++ b/crypto/asn1/p8_pkey.c @@ -65,9 +65,7 @@ *ASN1err(ASN1_F_D2I_PKCS8_PRIV_KEY_INFO,ASN1_R_DECODE_ERROR) */ -int i2d_PKCS8_PRIV_KEY_INFO (a,pp) -PKCS8_PRIV_KEY_INFO *a; -unsigned char **pp; +int i2d_PKCS8_PRIV_KEY_INFO (PKCS8_PRIV_KEY_INFO *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -87,7 +85,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new() +PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void) { PKCS8_PRIV_KEY_INFO *ret=NULL; ASN1_CTX c; @@ -101,10 +99,8 @@ PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new() M_ASN1_New_Error(ASN1_F_PKCS8_PRIV_KEY_INFO_NEW); } -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(a,pp,length) -PKCS8_PRIV_KEY_INFO **a; -unsigned char **pp; -long length; +PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKCS8_PRIV_KEY_INFO *,PKCS8_PRIV_KEY_INFO_new); M_ASN1_D2I_Init(); @@ -119,8 +115,7 @@ long length; M_ASN1_D2I_Finish(a, PKCS8_PRIV_KEY_INFO_free, ASN1_F_D2I_PKCS8_PRIV_KEY_INFO); } -void PKCS8_PRIV_KEY_INFO_free (a) -PKCS8_PRIV_KEY_INFO *a; +void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a) { if (a == NULL) return; ASN1_INTEGER_free (a->version); diff --git a/crypto/asn1/pkcs8.c b/crypto/asn1/pkcs8.c index d2bc9ce134..c9e94a276e 100644 --- a/crypto/asn1/pkcs8.c +++ b/crypto/asn1/pkcs8.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_X509_KEY_NEW,ERR_R_BAD_GET_ASN1_OBJECT_CALL); */ -int i2d_X509_KEY(a,pp) -X509 *a; -unsigned char **pp; +int i2d_X509_KEY(X509 *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -85,10 +83,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509 *d2i_X509_KEY(a,pp,length) -X509 **a; -unsigned char **pp; -long length; +X509 *d2i_X509_KEY(X509 **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509 *,X509_new); @@ -100,7 +95,7 @@ long length; M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); } -X509 *X509_KEY_new() +X509 *X509_KEY_new(void) { X509_KEY *ret=NULL; @@ -114,8 +109,7 @@ X509 *X509_KEY_new() M_ASN1_New_Error(ASN1_F_X509_NEW); } -void X509_KEY_free(a) -X509 *a; +void X509_KEY_free(X509 *a) { int i; diff --git a/crypto/asn1/t_crl.c b/crypto/asn1/t_crl.c index eb0ab2e323..e919893265 100644 --- a/crypto/asn1/t_crl.c +++ b/crypto/asn1/t_crl.c @@ -71,9 +71,7 @@ static void ext_print(); #endif #ifndef NO_FP_API -int X509_CRL_print_fp(fp,x) -FILE *fp; -X509_CRL *x; +int X509_CRL_print_fp(FILE *fp, X509_CRL *x) { BIO *b; int ret; @@ -90,9 +88,7 @@ X509_CRL *x; } #endif -int X509_CRL_print(out, x) -BIO *out; -X509_CRL *x; +int X509_CRL_print(BIO *out, X509_CRL *x) { char buf[256]; unsigned char *s; @@ -157,9 +153,7 @@ X509_CRL *x; } -static void ext_print(out, ex) -BIO *out; -X509_EXTENSION *ex; +static void ext_print(BIO *out, X509_EXTENSION *ex) { ASN1_OBJECT *obj; int j; diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c index 8a960f9cb2..fde4a37902 100644 --- a/crypto/asn1/t_pkey.c +++ b/crypto/asn1/t_pkey.c @@ -83,10 +83,7 @@ static int print(); #ifndef NO_RSA #ifndef NO_FP_API -int RSA_print_fp(fp,x,off) -FILE *fp; -RSA *x; -int off; +int RSA_print_fp(FILE *fp, RSA *x, int off) { BIO *b; int ret; @@ -103,10 +100,7 @@ int off; } #endif -int RSA_print(bp,x,off) -BIO *bp; -RSA *x; -int off; +int RSA_print(BIO *bp, RSA *x, int off) { char str[128]; const char *s; @@ -155,10 +149,7 @@ err: #ifndef NO_DSA #ifndef NO_FP_API -int DSA_print_fp(fp,x,off) -FILE *fp; -DSA *x; -int off; +int DSA_print_fp(FILE *fp, DSA *x, int off) { BIO *b; int ret; @@ -175,10 +166,7 @@ int off; } #endif -int DSA_print(bp,x,off) -BIO *bp; -DSA *x; -int off; +int DSA_print(BIO *bp, DSA *x, int off) { char str[128]; unsigned char *m=NULL; @@ -230,12 +218,8 @@ err: } #endif /* !NO_DSA */ -static int print(bp,number,num,buf,off) -BIO *bp; -const char *number; -BIGNUM *num; -unsigned char *buf; -int off; +static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, + int off) { int n,i; char str[128]; @@ -286,9 +270,7 @@ int off; #ifndef NO_DH #ifndef NO_FP_API -int DHparams_print_fp(fp,x) -FILE *fp; -DH *x; +int DHparams_print_fp(FILE *fp, DH *x) { BIO *b; int ret; @@ -305,9 +287,7 @@ DH *x; } #endif -int DHparams_print(bp,x) -BIO *bp; -DH *x; +int DHparams_print(BIO *bp, DH *x) { unsigned char *m=NULL; int reason=ERR_R_BUF_LIB,i,ret=0; @@ -343,9 +323,7 @@ err: #ifndef NO_DSA #ifndef NO_FP_API -int DSAparams_print_fp(fp,x) -FILE *fp; -DSA *x; +int DSAparams_print_fp(FILE *fp, DSA *x) { BIO *b; int ret; @@ -362,9 +340,7 @@ DSA *x; } #endif -int DSAparams_print(bp,x) -BIO *bp; -DSA *x; +int DSAparams_print(BIO *bp, DSA *x) { unsigned char *m=NULL; int reason=ERR_R_BUF_LIB,i,ret=0; diff --git a/crypto/asn1/t_req.c b/crypto/asn1/t_req.c index bc05ff6c0e..1079fe643d 100644 --- a/crypto/asn1/t_req.c +++ b/crypto/asn1/t_req.c @@ -64,9 +64,7 @@ #include "x509.h" #ifndef NO_FP_API -int X509_REQ_print_fp(fp,x) -FILE *fp; -X509_REQ *x; +int X509_REQ_print_fp(FILE *fp, X509_REQ *x) { BIO *b; int ret; @@ -83,9 +81,7 @@ X509_REQ *x; } #endif -int X509_REQ_print(bp,x) -BIO *bp; -X509_REQ *x; +int X509_REQ_print(BIO *bp, X509_REQ *x) { unsigned long l; int i,n; diff --git a/crypto/asn1/t_x509.c b/crypto/asn1/t_x509.c index 1ab2caef19..e804635be2 100644 --- a/crypto/asn1/t_x509.c +++ b/crypto/asn1/t_x509.c @@ -71,9 +71,7 @@ #include "x509v3.h" #ifndef NO_FP_API -int X509_print_fp(fp,x) -FILE *fp; -X509 *x; +int X509_print_fp(FILE *fp, X509 *x) { BIO *b; int ret; @@ -90,9 +88,7 @@ X509 *x; } #endif -int X509_print(bp,x) -BIO *bp; -X509 *x; +int X509_print(BIO *bp, X509 *x) { long l; int ret=0,i,j,n; @@ -233,9 +229,7 @@ err: return(ret); } -int ASN1_STRING_print(bp,v) -BIO *bp; -ASN1_STRING *v; +int ASN1_STRING_print(BIO *bp, ASN1_STRING *v) { int i,n; char buf[80],*p;; @@ -264,9 +258,7 @@ ASN1_STRING *v; return(1); } -int ASN1_TIME_print(bp, tm) -BIO *bp; -ASN1_TIME *tm; +int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm) { if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm); if(tm->type == V_ASN1_GENERALIZEDTIME) @@ -281,9 +273,7 @@ static const char *mon[12]= "Jul","Aug","Sep","Oct","Nov","Dec" }; -int ASN1_GENERALIZEDTIME_print(bp,tm) -BIO *bp; -ASN1_GENERALIZEDTIME *tm; +int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm) { char *v; int gmt=0; @@ -317,9 +307,7 @@ err: return(0); } -int ASN1_UTCTIME_print(bp,tm) -BIO *bp; -ASN1_UTCTIME *tm; +int ASN1_UTCTIME_print(BIO *bp, ASN1_UTCTIME *tm) { char *v; int gmt=0; @@ -354,10 +342,7 @@ err: return(0); } -int X509_NAME_print(bp,name,obase) -BIO *bp; -X509_NAME *name; -int obase; +int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) { char *s,*c; int ret=0,l,ll,i,first=1; diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c index 01aa0cb6fc..70b3779947 100644 --- a/crypto/asn1/x_algor.c +++ b/crypto/asn1/x_algor.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_D2I_X509_ALGOR,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_X509_ALGOR(a,pp) -X509_ALGOR *a; -unsigned char **pp; +int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -84,10 +82,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_ALGOR *d2i_X509_ALGOR(a,pp,length) -X509_ALGOR **a; -unsigned char **pp; -long length; +X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509_ALGOR *,X509_ALGOR_new); @@ -104,7 +99,7 @@ long length; M_ASN1_D2I_Finish(a,X509_ALGOR_free,ASN1_F_D2I_X509_ALGOR); } -X509_ALGOR *X509_ALGOR_new() +X509_ALGOR *X509_ALGOR_new(void) { X509_ALGOR *ret=NULL; ASN1_CTX c; @@ -116,8 +111,7 @@ X509_ALGOR *X509_ALGOR_new() M_ASN1_New_Error(ASN1_F_X509_ALGOR_NEW); } -void X509_ALGOR_free(a) -X509_ALGOR *a; +void X509_ALGOR_free(X509_ALGOR *a) { if (a == NULL) return; ASN1_OBJECT_free(a->algorithm); diff --git a/crypto/asn1/x_attrib.c b/crypto/asn1/x_attrib.c index 68b2648af3..ab8777a79f 100644 --- a/crypto/asn1/x_attrib.c +++ b/crypto/asn1/x_attrib.c @@ -68,9 +68,7 @@ */ /* sequence */ -int i2d_X509_ATTRIBUTE(a,pp) -X509_ATTRIBUTE *a; -unsigned char **pp; +int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **pp) { int k=0; int r=0,ret=0; @@ -100,10 +98,8 @@ unsigned char **pp; } } -X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(a,pp,length) -X509_ATTRIBUTE **a; -unsigned char **pp; -long length; +X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,X509_ATTRIBUTE *,X509_ATTRIBUTE_new); @@ -126,10 +122,7 @@ long length; M_ASN1_D2I_Finish(a,X509_ATTRIBUTE_free,ASN1_F_D2I_X509_ATTRIBUTE); } -X509_ATTRIBUTE *X509_ATTRIBUTE_create(nid,atrtype,value) -int nid; -int atrtype; -char *value; +X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, char *value) { X509_ATTRIBUTE *ret=NULL; ASN1_TYPE *val=NULL; @@ -150,7 +143,7 @@ err: return(NULL); } -X509_ATTRIBUTE *X509_ATTRIBUTE_new() +X509_ATTRIBUTE *X509_ATTRIBUTE_new(void) { X509_ATTRIBUTE *ret=NULL; ASN1_CTX c; @@ -163,8 +156,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_new() M_ASN1_New_Error(ASN1_F_X509_ATTRIBUTE_NEW); } -void X509_ATTRIBUTE_free(a) -X509_ATTRIBUTE *a; +void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) { if (a == NULL) return; ASN1_OBJECT_free(a->object); diff --git a/crypto/asn1/x_cinf.c b/crypto/asn1/x_cinf.c index 88099ea9f7..41939334be 100644 --- a/crypto/asn1/x_cinf.c +++ b/crypto/asn1/x_cinf.c @@ -65,9 +65,7 @@ * ASN1err(ASN1_F_X509_CINF_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_X509_CINF(a,pp) -X509_CINF *a; -unsigned char **pp; +int i2d_X509_CINF(X509_CINF *a, unsigned char **pp) { int v1=0,v2=0; M_ASN1_I2D_vars(a); @@ -99,10 +97,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_CINF *d2i_X509_CINF(a,pp,length) -X509_CINF **a; -unsigned char **pp; -long length; +X509_CINF *d2i_X509_CINF(X509_CINF **a, unsigned char **pp, long length) { int ver=0; M_ASN1_D2I_vars(a,X509_CINF *,X509_CINF_new); @@ -166,7 +161,7 @@ long length; M_ASN1_D2I_Finish(a,X509_CINF_free,ASN1_F_D2I_X509_CINF); } -X509_CINF *X509_CINF_new() +X509_CINF *X509_CINF_new(void) { X509_CINF *ret=NULL; ASN1_CTX c; @@ -186,8 +181,7 @@ X509_CINF *X509_CINF_new() M_ASN1_New_Error(ASN1_F_X509_CINF_NEW); } -void X509_CINF_free(a) -X509_CINF *a; +void X509_CINF_free(X509_CINF *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); diff --git a/crypto/asn1/x_crl.c b/crypto/asn1/x_crl.c index 1dd651b3ec..e8f8ebd76c 100644 --- a/crypto/asn1/x_crl.c +++ b/crypto/asn1/x_crl.c @@ -78,9 +78,7 @@ static int X509_REVOKED_cmp(); static int X509_REVOKED_seq_cmp(); #endif -int i2d_X509_REVOKED(a,pp) -X509_REVOKED *a; -unsigned char **pp; +int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -97,10 +95,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_REVOKED *d2i_X509_REVOKED(a,pp,length) -X509_REVOKED **a; -unsigned char **pp; -long length; +X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,X509_REVOKED *,X509_REVOKED_new); @@ -113,9 +109,7 @@ long length; M_ASN1_D2I_Finish(a,X509_REVOKED_free,ASN1_F_D2I_X509_REVOKED); } -int i2d_X509_CRL_INFO(a,pp) -X509_CRL_INFO *a; -unsigned char **pp; +int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **pp) { int v1=0; long l=0; @@ -155,10 +149,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_CRL_INFO *d2i_X509_CRL_INFO(a,pp,length) -X509_CRL_INFO **a; -unsigned char **pp; -long length; +X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, unsigned char **pp, + long length) { int i,ver=0; M_ASN1_D2I_vars(a,X509_CRL_INFO *,X509_CRL_INFO_new); @@ -220,9 +212,7 @@ long length; M_ASN1_D2I_Finish(a,X509_CRL_INFO_free,ASN1_F_D2I_X509_CRL_INFO); } -int i2d_X509_CRL(a,pp) -X509_CRL *a; -unsigned char **pp; +int i2d_X509_CRL(X509_CRL *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -239,10 +229,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_CRL *d2i_X509_CRL(a,pp,length) -X509_CRL **a; -unsigned char **pp; -long length; +X509_CRL *d2i_X509_CRL(X509_CRL **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509_CRL *,X509_CRL_new); @@ -256,7 +243,7 @@ long length; } -X509_REVOKED *X509_REVOKED_new() +X509_REVOKED *X509_REVOKED_new(void) { X509_REVOKED *ret=NULL; ASN1_CTX c; @@ -269,7 +256,7 @@ X509_REVOKED *X509_REVOKED_new() M_ASN1_New_Error(ASN1_F_X509_REVOKED_NEW); } -X509_CRL_INFO *X509_CRL_INFO_new() +X509_CRL_INFO *X509_CRL_INFO_new(void) { X509_CRL_INFO *ret=NULL; ASN1_CTX c; @@ -287,7 +274,7 @@ X509_CRL_INFO *X509_CRL_INFO_new() M_ASN1_New_Error(ASN1_F_X509_CRL_INFO_NEW); } -X509_CRL *X509_CRL_new() +X509_CRL *X509_CRL_new(void) { X509_CRL *ret=NULL; ASN1_CTX c; @@ -301,8 +288,7 @@ X509_CRL *X509_CRL_new() M_ASN1_New_Error(ASN1_F_X509_CRL_NEW); } -void X509_REVOKED_free(a) -X509_REVOKED *a; +void X509_REVOKED_free(X509_REVOKED *a) { if (a == NULL) return; ASN1_INTEGER_free(a->serialNumber); @@ -311,8 +297,7 @@ X509_REVOKED *a; Free((char *)a); } -void X509_CRL_INFO_free(a) -X509_CRL_INFO *a; +void X509_CRL_INFO_free(X509_CRL_INFO *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); @@ -326,8 +311,7 @@ X509_CRL_INFO *a; Free((char *)a); } -void X509_CRL_free(a) -X509_CRL *a; +void X509_CRL_free(X509_CRL *a) { int i; @@ -352,16 +336,14 @@ X509_CRL *a; Free((char *)a); } -static int X509_REVOKED_cmp(a,b) -X509_REVOKED **a,**b; +static int X509_REVOKED_cmp(X509_REVOKED **a, X509_REVOKED **b) { return(ASN1_STRING_cmp( (ASN1_STRING *)(*a)->serialNumber, (ASN1_STRING *)(*b)->serialNumber)); } -static int X509_REVOKED_seq_cmp(a,b) -X509_REVOKED **a,**b; +static int X509_REVOKED_seq_cmp(X509_REVOKED **a, X509_REVOKED **b) { return((*a)->sequence-(*b)->sequence); } diff --git a/crypto/asn1/x_exten.c b/crypto/asn1/x_exten.c index f5e3ece226..15c46e3526 100644 --- a/crypto/asn1/x_exten.c +++ b/crypto/asn1/x_exten.c @@ -66,9 +66,7 @@ * ASN1err(ASN1_F_X509_EXTENSION_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_X509_EXTENSION(a,pp) -X509_EXTENSION *a; -unsigned char **pp; +int i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **pp) { int k=0; int r=0,ret=0; @@ -96,10 +94,8 @@ unsigned char **pp; } } -X509_EXTENSION *d2i_X509_EXTENSION(a,pp,length) -X509_EXTENSION **a; -unsigned char **pp; -long length; +X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a, unsigned char **pp, + long length) { int i; M_ASN1_D2I_vars(a,X509_EXTENSION *,X509_EXTENSION_new); @@ -127,7 +123,7 @@ long length; M_ASN1_D2I_Finish(a,X509_EXTENSION_free,ASN1_F_D2I_X509_EXTENSION); } -X509_EXTENSION *X509_EXTENSION_new() +X509_EXTENSION *X509_EXTENSION_new(void) { X509_EXTENSION *ret=NULL; ASN1_CTX c; @@ -144,8 +140,7 @@ X509_EXTENSION *X509_EXTENSION_new() M_ASN1_New_Error(ASN1_F_X509_EXTENSION_NEW); } -void X509_EXTENSION_free(a) -X509_EXTENSION *a; +void X509_EXTENSION_free(X509_EXTENSION *a) { if (a == NULL) return; if ((a->argp != NULL) && (a->ex_free != NULL)) diff --git a/crypto/asn1/x_info.c b/crypto/asn1/x_info.c index b55f0ce77a..03bc38cdf7 100644 --- a/crypto/asn1/x_info.c +++ b/crypto/asn1/x_info.c @@ -62,7 +62,7 @@ #include "asn1_mac.h" #include "x509.h" -X509_INFO *X509_INFO_new() +X509_INFO *X509_INFO_new(void) { X509_INFO *ret=NULL; @@ -84,8 +84,7 @@ X509_INFO *X509_INFO_new() return(ret); } -void X509_INFO_free(x) -X509_INFO *x; +void X509_INFO_free(X509_INFO *x) { int i; diff --git a/crypto/asn1/x_name.c b/crypto/asn1/x_name.c index 3af14c8e6c..939b1699d6 100644 --- a/crypto/asn1/x_name.c +++ b/crypto/asn1/x_name.c @@ -74,9 +74,7 @@ static int i2d_X509_NAME_entries(X509_NAME *a); static int i2d_X509_NAME_entries(); #endif -int i2d_X509_NAME_ENTRY(a,pp) -X509_NAME_ENTRY *a; -unsigned char **pp; +int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -91,10 +89,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(a,pp,length) -X509_NAME_ENTRY **a; -unsigned char **pp; -long length; +X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,X509_NAME_ENTRY *,X509_NAME_ENTRY_new); @@ -106,9 +102,7 @@ long length; M_ASN1_D2I_Finish(a,X509_NAME_ENTRY_free,ASN1_F_D2I_X509_NAME_ENTRY); } -int i2d_X509_NAME(a,pp) -X509_NAME *a; -unsigned char **pp; +int i2d_X509_NAME(X509_NAME *a, unsigned char **pp) { int ret; @@ -128,8 +122,7 @@ unsigned char **pp; return(ret); } -static int i2d_X509_NAME_entries(a) -X509_NAME *a; +static int i2d_X509_NAME_entries(X509_NAME *a) { X509_NAME_ENTRY *ne,*fe=NULL; STACK *sk; @@ -190,10 +183,7 @@ err: return(-1); } -X509_NAME *d2i_X509_NAME(a,pp,length) -X509_NAME **a; -unsigned char **pp; -long length; +X509_NAME *d2i_X509_NAME(X509_NAME **a, unsigned char **pp, long length) { int set=0,i; int idx=0; @@ -232,7 +222,7 @@ long length; M_ASN1_D2I_Finish(a,X509_NAME_free,ASN1_F_D2I_X509_NAME); } -X509_NAME *X509_NAME_new() +X509_NAME *X509_NAME_new(void) { X509_NAME *ret=NULL; ASN1_CTX c; @@ -246,7 +236,7 @@ X509_NAME *X509_NAME_new() M_ASN1_New_Error(ASN1_F_X509_NAME_NEW); } -X509_NAME_ENTRY *X509_NAME_ENTRY_new() +X509_NAME_ENTRY *X509_NAME_ENTRY_new(void) { X509_NAME_ENTRY *ret=NULL; ASN1_CTX c; @@ -260,8 +250,7 @@ X509_NAME_ENTRY *X509_NAME_ENTRY_new() M_ASN1_New_Error(ASN1_F_X509_NAME_ENTRY_NEW); } -void X509_NAME_free(a) -X509_NAME *a; +void X509_NAME_free(X509_NAME *a) { if(a == NULL) return; @@ -271,8 +260,7 @@ X509_NAME *a; Free((char *)a); } -void X509_NAME_ENTRY_free(a) -X509_NAME_ENTRY *a; +void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) { if (a == NULL) return; ASN1_OBJECT_free(a->object); @@ -280,9 +268,7 @@ X509_NAME_ENTRY *a; Free((char *)a); } -int X509_NAME_set(xn,name) -X509_NAME **xn; -X509_NAME *name; +int X509_NAME_set(X509_NAME **xn, X509_NAME *name) { X509_NAME *in; diff --git a/crypto/asn1/x_pkey.c b/crypto/asn1/x_pkey.c index 3a359cce9e..2e677f0b24 100644 --- a/crypto/asn1/x_pkey.c +++ b/crypto/asn1/x_pkey.c @@ -66,17 +66,12 @@ /* ASN1err(ASN1_F_X509_PKEY_NEW,ASN1_R_IV_TOO_LARGE); */ /* need to implement */ -int i2d_X509_PKEY(a,pp) -X509_PKEY *a; -unsigned char **pp; +int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp) { return(0); } -X509_PKEY *d2i_X509_PKEY(a,pp,length) -X509_PKEY **a; -unsigned char **pp; -long length; +X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, unsigned char **pp, long length) { int i; M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new); @@ -111,7 +106,7 @@ long length; M_ASN1_D2I_Finish(a,X509_PKEY_free,ASN1_F_D2I_X509_PKEY); } -X509_PKEY *X509_PKEY_new() +X509_PKEY *X509_PKEY_new(void) { X509_PKEY *ret=NULL; ASN1_CTX c; @@ -131,8 +126,7 @@ X509_PKEY *X509_PKEY_new() M_ASN1_New_Error(ASN1_F_X509_PKEY_NEW); } -void X509_PKEY_free(x) -X509_PKEY *x; +void X509_PKEY_free(X509_PKEY *x) { int i; diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index 2177ebd6ed..9711f98da1 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -65,9 +65,7 @@ * ASN1err(ASN1_F_X509_PUBKEY_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_X509_PUBKEY(a,pp) -X509_PUBKEY *a; -unsigned char **pp; +int i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -82,10 +80,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_PUBKEY *d2i_X509_PUBKEY(a,pp,length) -X509_PUBKEY **a; -unsigned char **pp; -long length; +X509_PUBKEY *d2i_X509_PUBKEY(X509_PUBKEY **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,X509_PUBKEY *,X509_PUBKEY_new); @@ -101,7 +97,7 @@ long length; M_ASN1_D2I_Finish(a,X509_PUBKEY_free,ASN1_F_D2I_X509_PUBKEY); } -X509_PUBKEY *X509_PUBKEY_new() +X509_PUBKEY *X509_PUBKEY_new(void) { X509_PUBKEY *ret=NULL; ASN1_CTX c; @@ -114,8 +110,7 @@ X509_PUBKEY *X509_PUBKEY_new() M_ASN1_New_Error(ASN1_F_X509_PUBKEY_NEW); } -void X509_PUBKEY_free(a) -X509_PUBKEY *a; +void X509_PUBKEY_free(X509_PUBKEY *a) { if (a == NULL) return; X509_ALGOR_free(a->algor); @@ -124,9 +119,7 @@ X509_PUBKEY *a; Free((char *)a); } -int X509_PUBKEY_set(x,pkey) -X509_PUBKEY **x; -EVP_PKEY *pkey; +int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) { int ok=0; X509_PUBKEY *pk; @@ -209,8 +202,7 @@ err: return(ok); } -EVP_PKEY *X509_PUBKEY_get(key) -X509_PUBKEY *key; +EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) { EVP_PKEY *ret=NULL; long j; diff --git a/crypto/asn1/x_req.c b/crypto/asn1/x_req.c index 949632c325..4bb604e5a4 100644 --- a/crypto/asn1/x_req.c +++ b/crypto/asn1/x_req.c @@ -68,9 +68,7 @@ * ASN1err(ASN1_F_X509_REQ_INFO_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_X509_REQ_INFO(a,pp) -X509_REQ_INFO *a; -unsigned char **pp; +int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -117,10 +115,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_REQ_INFO *d2i_X509_REQ_INFO(a,pp,length) -X509_REQ_INFO **a; -unsigned char **pp; -long length; +X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,X509_REQ_INFO *,X509_REQ_INFO_new); @@ -148,7 +144,7 @@ long length; M_ASN1_D2I_Finish(a,X509_REQ_INFO_free,ASN1_F_D2I_X509_REQ_INFO); } -X509_REQ_INFO *X509_REQ_INFO_new() +X509_REQ_INFO *X509_REQ_INFO_new(void) { X509_REQ_INFO *ret=NULL; ASN1_CTX c; @@ -163,8 +159,7 @@ X509_REQ_INFO *X509_REQ_INFO_new() M_ASN1_New_Error(ASN1_F_X509_REQ_INFO_NEW); } -void X509_REQ_INFO_free(a) -X509_REQ_INFO *a; +void X509_REQ_INFO_free(X509_REQ_INFO *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); @@ -174,9 +169,7 @@ X509_REQ_INFO *a; Free((char *)a); } -int i2d_X509_REQ(a,pp) -X509_REQ *a; -unsigned char **pp; +int i2d_X509_REQ(X509_REQ *a, unsigned char **pp) { M_ASN1_I2D_vars(a); M_ASN1_I2D_len(a->req_info, i2d_X509_REQ_INFO); @@ -192,10 +185,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_REQ *d2i_X509_REQ(a,pp,length) -X509_REQ **a; -unsigned char **pp; -long length; +X509_REQ *d2i_X509_REQ(X509_REQ **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509_REQ *,X509_REQ_new); @@ -207,7 +197,7 @@ long length; M_ASN1_D2I_Finish(a,X509_REQ_free,ASN1_F_D2I_X509_REQ); } -X509_REQ *X509_REQ_new() +X509_REQ *X509_REQ_new(void) { X509_REQ *ret=NULL; ASN1_CTX c; @@ -221,8 +211,7 @@ X509_REQ *X509_REQ_new() M_ASN1_New_Error(ASN1_F_X509_REQ_NEW); } -void X509_REQ_free(a) -X509_REQ *a; +void X509_REQ_free(X509_REQ *a) { int i; diff --git a/crypto/asn1/x_sig.c b/crypto/asn1/x_sig.c index 245a76b0f0..b0675b74c3 100644 --- a/crypto/asn1/x_sig.c +++ b/crypto/asn1/x_sig.c @@ -65,9 +65,7 @@ * ASN1err(ASN1_F_X509_SIG_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_X509_SIG(a,pp) -X509_SIG *a; -unsigned char **pp; +int i2d_X509_SIG(X509_SIG *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -82,10 +80,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_SIG *d2i_X509_SIG(a,pp,length) -X509_SIG **a; -unsigned char **pp; -long length; +X509_SIG *d2i_X509_SIG(X509_SIG **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509_SIG *,X509_SIG_new); @@ -96,7 +91,7 @@ long length; M_ASN1_D2I_Finish(a,X509_SIG_free,ASN1_F_D2I_X509_SIG); } -X509_SIG *X509_SIG_new() +X509_SIG *X509_SIG_new(void) { X509_SIG *ret=NULL; ASN1_CTX c; @@ -108,8 +103,7 @@ X509_SIG *X509_SIG_new() M_ASN1_New_Error(ASN1_F_X509_SIG_NEW); } -void X509_SIG_free(a) -X509_SIG *a; +void X509_SIG_free(X509_SIG *a) { if (a == NULL) return; X509_ALGOR_free(a->algor); diff --git a/crypto/asn1/x_spki.c b/crypto/asn1/x_spki.c index 5600d305a3..8cb1aaee33 100644 --- a/crypto/asn1/x_spki.c +++ b/crypto/asn1/x_spki.c @@ -72,9 +72,7 @@ * ASN1err(ASN1_F_NETSCAPE_SPKI_NEW,ERR_R_ASN1_LENGTH_MISMATCH); */ -int i2d_NETSCAPE_SPKAC(a,pp) -NETSCAPE_SPKAC *a; -unsigned char **pp; +int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -89,10 +87,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(a,pp,length) -NETSCAPE_SPKAC **a; -unsigned char **pp; -long length; +NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,NETSCAPE_SPKAC *,NETSCAPE_SPKAC_new); @@ -103,7 +99,7 @@ long length; M_ASN1_D2I_Finish(a,NETSCAPE_SPKAC_free,ASN1_F_D2I_NETSCAPE_SPKAC); } -NETSCAPE_SPKAC *NETSCAPE_SPKAC_new() +NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void) { NETSCAPE_SPKAC *ret=NULL; ASN1_CTX c; @@ -115,8 +111,7 @@ NETSCAPE_SPKAC *NETSCAPE_SPKAC_new() M_ASN1_New_Error(ASN1_F_NETSCAPE_SPKAC_NEW); } -void NETSCAPE_SPKAC_free(a) -NETSCAPE_SPKAC *a; +void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a) { if (a == NULL) return; X509_PUBKEY_free(a->pubkey); @@ -124,9 +119,7 @@ NETSCAPE_SPKAC *a; Free((char *)a); } -int i2d_NETSCAPE_SPKI(a,pp) -NETSCAPE_SPKI *a; -unsigned char **pp; +int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -143,10 +136,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -NETSCAPE_SPKI *d2i_NETSCAPE_SPKI(a,pp,length) -NETSCAPE_SPKI **a; -unsigned char **pp; -long length; +NETSCAPE_SPKI *d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,NETSCAPE_SPKI *,NETSCAPE_SPKI_new); @@ -158,7 +149,7 @@ long length; M_ASN1_D2I_Finish(a,NETSCAPE_SPKI_free,ASN1_F_D2I_NETSCAPE_SPKI); } -NETSCAPE_SPKI *NETSCAPE_SPKI_new() +NETSCAPE_SPKI *NETSCAPE_SPKI_new(void) { NETSCAPE_SPKI *ret=NULL; ASN1_CTX c; @@ -171,8 +162,7 @@ NETSCAPE_SPKI *NETSCAPE_SPKI_new() M_ASN1_New_Error(ASN1_F_NETSCAPE_SPKI_NEW); } -void NETSCAPE_SPKI_free(a) -NETSCAPE_SPKI *a; +void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a) { if (a == NULL) return; NETSCAPE_SPKAC_free(a->spkac); diff --git a/crypto/asn1/x_val.c b/crypto/asn1/x_val.c index f6534a6a5c..9ffa8671d5 100644 --- a/crypto/asn1/x_val.c +++ b/crypto/asn1/x_val.c @@ -65,9 +65,7 @@ * ASN1err(ASN1_F_D2I_X509_VAL,ERR_R_MALLOC_FAILURE); */ -int i2d_X509_VAL(a,pp) -X509_VAL *a; -unsigned char **pp; +int i2d_X509_VAL(X509_VAL *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -82,10 +80,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509_VAL *d2i_X509_VAL(a,pp,length) -X509_VAL **a; -unsigned char **pp; -long length; +X509_VAL *d2i_X509_VAL(X509_VAL **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509_VAL *,X509_VAL_new); @@ -96,7 +91,7 @@ long length; M_ASN1_D2I_Finish(a,X509_VAL_free,ASN1_F_D2I_X509_VAL); } -X509_VAL *X509_VAL_new() +X509_VAL *X509_VAL_new(void) { X509_VAL *ret=NULL; ASN1_CTX c; @@ -108,8 +103,7 @@ X509_VAL *X509_VAL_new() M_ASN1_New_Error(ASN1_F_X509_VAL_NEW); } -void X509_VAL_free(a) -X509_VAL *a; +void X509_VAL_free(X509_VAL *a) { if (a == NULL) return; ASN1_TIME_free(a->notBefore); diff --git a/crypto/asn1/x_x509.c b/crypto/asn1/x_x509.c index 8e7d214d21..f1459a7989 100644 --- a/crypto/asn1/x_x509.c +++ b/crypto/asn1/x_x509.c @@ -72,14 +72,12 @@ static ASN1_METHOD meth={ (char *(*)())X509_new, (void (*)()) X509_free}; -ASN1_METHOD *X509_asn1_meth() +ASN1_METHOD *X509_asn1_meth(void) { return(&meth); } -int i2d_X509(a,pp) -X509 *a; -unsigned char **pp; +int i2d_X509(X509 *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -96,10 +94,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -X509 *d2i_X509(a,pp,length) -X509 **a; -unsigned char **pp; -long length; +X509 *d2i_X509(X509 **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,X509 *,X509_new); @@ -114,7 +109,7 @@ long length; M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); } -X509 *X509_new() +X509 *X509_new(void) { X509 *ret=NULL; ASN1_CTX c; @@ -130,8 +125,7 @@ X509 *X509_new() M_ASN1_New_Error(ASN1_F_X509_NEW); } -void X509_free(a) -X509 *a; +void X509_free(X509 *a) { int i; diff --git a/crypto/bf/bf_cbc.c b/crypto/bf/bf_cbc.c index e0fa9ad763..90f1ffef2b 100644 --- a/crypto/bf/bf_cbc.c +++ b/crypto/bf/bf_cbc.c @@ -59,13 +59,8 @@ #include "blowfish.h" #include "bf_locl.h" -void BF_cbc_encrypt(in, out, length, ks, iv, encrypt) -unsigned char *in; -unsigned char *out; -long length; -BF_KEY *ks; -unsigned char *iv; -int encrypt; +void BF_cbc_encrypt(unsigned char *in, unsigned char *out, long length, + BF_KEY *ks, unsigned char *iv, int encrypt) { register BF_LONG tin0,tin1; register BF_LONG tout0,tout1,xor0,xor1; diff --git a/crypto/bf/bf_cfb64.c b/crypto/bf/bf_cfb64.c index f9c66e7ced..308b965867 100644 --- a/crypto/bf/bf_cfb64.c +++ b/crypto/bf/bf_cfb64.c @@ -64,14 +64,8 @@ * 64bit block we have used is contained in *num; */ -void BF_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) -unsigned char *in; -unsigned char *out; -long length; -BF_KEY *schedule; -unsigned char *ivec; -int *num; -int encrypt; +void BF_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + BF_KEY *schedule, unsigned char *ivec, int *num, int encrypt) { register BF_LONG v0,v1,t; register int n= *num; diff --git a/crypto/bf/bf_ecb.c b/crypto/bf/bf_ecb.c index efceae6e20..7abe20979d 100644 --- a/crypto/bf/bf_ecb.c +++ b/crypto/bf/bf_ecb.c @@ -67,7 +67,7 @@ const char *BF_version="BlowFish" OPENSSL_VERSION_PTEXT; -const char *BF_options() +const char *BF_options(void) { #ifdef BF_PTR return("blowfish(ptr)"); @@ -78,11 +78,8 @@ const char *BF_options() #endif } -void BF_ecb_encrypt(in, out, ks, encrypt) -unsigned char *in; -unsigned char *out; -BF_KEY *ks; -int encrypt; +void BF_ecb_encrypt(unsigned char *in, unsigned char *out, BF_KEY *ks, + int encrypt) { BF_LONG l,d[2]; diff --git a/crypto/bf/bf_enc.c b/crypto/bf/bf_enc.c index 66a8604c59..9ae52425ae 100644 --- a/crypto/bf/bf_enc.c +++ b/crypto/bf/bf_enc.c @@ -65,13 +65,11 @@ */ #if (BF_ROUNDS != 16) && (BF_ROUNDS != 20) -If you set BF_ROUNDS to some value other than 16 or 20, you will have +#error If you set BF_ROUNDS to some value other than 16 or 20, you will have \ to modify the code. #endif -void BF_encrypt(data,key) -BF_LONG *data; -BF_KEY *key; +void BF_encrypt(BF_LONG *data, BF_KEY *key) { register BF_LONG l,r,*p,*s; @@ -111,9 +109,7 @@ BF_KEY *key; #ifndef BF_DEFAULT_OPTIONS -void BF_decrypt(data,key) -BF_LONG *data; -BF_KEY *key; +void BF_decrypt(BF_LONG *data, BF_KEY *key) { register BF_LONG l,r,*p,*s; @@ -151,13 +147,8 @@ BF_KEY *key; data[0]=r&0xffffffffL; } -void BF_cbc_encrypt(in, out, length, ks, iv, encrypt) -unsigned char *in; -unsigned char *out; -long length; -BF_KEY *ks; -unsigned char *iv; -int encrypt; +void BF_cbc_encrypt(unsigned char *in, unsigned char *out, long length, + BF_KEY *ks, unsigned char *iv, int encrypt) { register BF_LONG tin0,tin1; register BF_LONG tout0,tout1,xor0,xor1; diff --git a/crypto/bf/bf_ofb64.c b/crypto/bf/bf_ofb64.c index 5d844ac760..381f6a2a9c 100644 --- a/crypto/bf/bf_ofb64.c +++ b/crypto/bf/bf_ofb64.c @@ -63,13 +63,8 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void BF_ofb64_encrypt(in, out, length, schedule, ivec, num) -unsigned char *in; -unsigned char *out; -long length; -BF_KEY *schedule; -unsigned char *ivec; -int *num; +void BF_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, + BF_KEY *schedule, unsigned char *ivec, int *num) { register BF_LONG v0,v1,t; register int n= *num; diff --git a/crypto/bf/bf_opts.c b/crypto/bf/bf_opts.c index 735d16b764..e818b76e5d 100644 --- a/crypto/bf/bf_opts.c +++ b/crypto/bf/bf_opts.c @@ -162,8 +162,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -176,8 +175,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -238,9 +236,7 @@ int s; fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \ tm[index]*8,1.0e6/tm[index]); -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/bf/bf_skey.c b/crypto/bf/bf_skey.c index 86574c0acc..f6c45535e1 100644 --- a/crypto/bf/bf_skey.c +++ b/crypto/bf/bf_skey.c @@ -62,10 +62,7 @@ #include "bf_locl.h" #include "bf_pi.h" -void BF_set_key(key,len,data) -BF_KEY *key; -int len; -unsigned char *data; +void BF_set_key(BF_KEY *key, int len, unsigned char *data) { int i; BF_LONG *p,ri,in[2]; diff --git a/crypto/bf/bfspeed.c b/crypto/bf/bfspeed.c index 30db62b234..983eba52f0 100644 --- a/crypto/bf/bfspeed.c +++ b/crypto/bf/bfspeed.c @@ -135,8 +135,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +148,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +184,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/bf/bftest.c b/crypto/bf/bftest.c index 9266cf813a..e66ca044e2 100644 --- a/crypto/bf/bftest.c +++ b/crypto/bf/bftest.c @@ -260,9 +260,7 @@ static int test(); static int print_test_data(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int ret; @@ -275,7 +273,7 @@ char *argv[]; return(0); } -static int print_test_data() +static int print_test_data(void) { unsigned int i,j; @@ -342,7 +340,7 @@ static int print_test_data() return(0); } -static int test() +static int test(void) { unsigned char cbc_in[40],cbc_out[40],iv[8]; int i,n,err=0; diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c index 5e05af5b0c..839dfeb15e 100644 --- a/crypto/bio/b_dump.c +++ b/crypto/bio/b_dump.c @@ -67,10 +67,7 @@ #define TRUNCATE #define DUMP_WIDTH 16 -int BIO_dump(bio,s,len) -BIO *bio; -const char *s; -int len; +int BIO_dump(BIO *bio, const char *s, int len) { int ret=0; char buf[160+1],tmp[20]; diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index a1a37605e3..d14a7797fd 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -106,9 +106,7 @@ static void ghbn_free(); static struct hostent *ghbn_dup(); #endif -int BIO_get_host_ip(str,ip) -const char *str; -unsigned char *ip; +int BIO_get_host_ip(const char *str, unsigned char *ip) { int i; struct hostent *he; @@ -146,9 +144,7 @@ unsigned char *ip; return(1); } -int BIO_get_port(str,port_ptr) -const char *str; -unsigned short *port_ptr; +int BIO_get_port(const char *str, unsigned short *port_ptr) { int i; struct servent *s; @@ -197,8 +193,7 @@ unsigned short *port_ptr; return(1); } -int BIO_sock_error(sock) -int sock; +int BIO_sock_error(int sock) { int j,i,size; @@ -211,10 +206,7 @@ int sock; return(j); } -long BIO_ghbn_ctrl(cmd,iarg,parg) -int cmd; -int iarg; -char *parg; +long BIO_ghbn_ctrl(int cmd, int iarg, char *parg) { int i; char **p; @@ -252,8 +244,7 @@ char *parg; return(1); } -static struct hostent *ghbn_dup(a) -struct hostent *a; +static struct hostent *ghbn_dup(struct hostent *a) { struct hostent *ret; int i,j; @@ -305,8 +296,7 @@ err: return(ret); } -static void ghbn_free(a) -struct hostent *a; +static void ghbn_free(struct hostent *a) { int i; @@ -329,8 +319,7 @@ struct hostent *a; Free(a); } -struct hostent *BIO_gethostbyname(name) -const char *name; +struct hostent *BIO_gethostbyname(const char *name) { struct hostent *ret; int i,lowi=0,j; @@ -385,7 +374,7 @@ const char *name; return(ret); } -int BIO_sock_init() +int BIO_sock_init(void) { #ifdef WINDOWS static struct WSAData wsa_state; @@ -411,7 +400,7 @@ int BIO_sock_init() return(1); } -void BIO_sock_cleanup() +void BIO_sock_cleanup(void) { #ifdef WINDOWS if (wsa_init_done) @@ -423,10 +412,7 @@ void BIO_sock_cleanup() #endif } -int BIO_socket_ioctl(fd,type,arg) -int fd; -long type; -unsigned long *arg; +int BIO_socket_ioctl(int fd, long type, unsigned long *arg) { int i; @@ -438,9 +424,7 @@ unsigned long *arg; /* The reason I have implemented this instead of using sscanf is because * Visual C 1.52c gives an unresolved external when linking a DLL :-( */ -static int get_ip(str,ip) -const char *str; -unsigned char ip[4]; +static int get_ip(const char *str, unsigned char ip[4]) { unsigned int tmp[4]; int num=0,c,ok=0; @@ -475,9 +459,7 @@ unsigned char ip[4]; return(1); } -int BIO_get_accept_socket(host,bind_mode) -char *host; -int bind_mode; +int BIO_get_accept_socket(char *host, int bind_mode) { int ret=0; struct sockaddr_in server,client; @@ -604,9 +586,7 @@ err: return(s); } -int BIO_accept(sock,addr) -int sock; -char **addr; +int BIO_accept(int sock, char **addr) { int ret=INVALID_SOCKET; static struct sockaddr_in from; @@ -648,9 +628,7 @@ end: return(ret); } -int BIO_set_tcp_ndelay(s,on) -int s; -int on; +int BIO_set_tcp_ndelay(int s, int on) { int ret=0; #if defined(TCP_NODELAY) && (defined(IPPROTO_TCP) || defined(SOL_TCP)) @@ -670,9 +648,7 @@ int on; } #endif -int BIO_socket_nbio(s,mode) -int s; -int mode; +int BIO_socket_nbio(int s, int mode) { int ret= -1; unsigned long l; diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c index afa9cd27b7..c0f591880c 100644 --- a/crypto/bio/bf_buff.c +++ b/crypto/bio/bf_buff.c @@ -95,13 +95,12 @@ static BIO_METHOD methods_buffer= buffer_free, }; -BIO_METHOD *BIO_f_buffer() +BIO_METHOD *BIO_f_buffer(void) { return(&methods_buffer); } -static int buffer_new(bi) -BIO *bi; +static int buffer_new(BIO *bi) { BIO_F_BUFFER_CTX *ctx; @@ -124,8 +123,7 @@ BIO *bi; return(1); } -static int buffer_free(a) -BIO *a; +static int buffer_free(BIO *a) { BIO_F_BUFFER_CTX *b; @@ -140,10 +138,7 @@ BIO *a; return(1); } -static int buffer_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int buffer_read(BIO *b, char *out, int outl) { int i,num=0; BIO_F_BUFFER_CTX *ctx; @@ -209,10 +204,7 @@ start: goto start; } -static int buffer_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int buffer_write(BIO *b, char *in, int inl) { int i,num=0; BIO_F_BUFFER_CTX *ctx; @@ -285,11 +277,7 @@ start: goto start; } -static long buffer_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long buffer_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO *dbio; BIO_F_BUFFER_CTX *ctx; @@ -450,10 +438,7 @@ malloc_error: return(0); } -static int buffer_gets(b,buf,size) -BIO *b; -char *buf; -int size; +static int buffer_gets(BIO *b, char *buf, int size) { BIO_F_BUFFER_CTX *ctx; int num=0,i,flag; @@ -504,9 +489,7 @@ int size; } } -static int buffer_puts(b,str) -BIO *b; -char *str; +static int buffer_puts(BIO *b, char *str) { return(BIO_write(b,str,strlen(str))); } diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c index 034b3024df..502973808c 100644 --- a/crypto/bio/bf_nbio.c +++ b/crypto/bio/bf_nbio.c @@ -104,13 +104,12 @@ static BIO_METHOD methods_nbiof= nbiof_free, }; -BIO_METHOD *BIO_f_nbio_test() +BIO_METHOD *BIO_f_nbio_test(void) { return(&methods_nbiof); } -static int nbiof_new(bi) -BIO *bi; +static int nbiof_new(BIO *bi) { NBIO_TEST *nt; @@ -123,8 +122,7 @@ BIO *bi; return(1); } -static int nbiof_free(a) -BIO *a; +static int nbiof_free(BIO *a) { if (a == NULL) return(0); if (a->ptr != NULL) @@ -135,10 +133,7 @@ BIO *a; return(1); } -static int nbiof_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int nbiof_read(BIO *b, char *out, int outl) { NBIO_TEST *nt; int ret=0; @@ -173,10 +168,7 @@ int outl; return(ret); } -static int nbiof_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int nbiof_write(BIO *b, char *in, int inl) { NBIO_TEST *nt; int ret=0; @@ -221,11 +213,7 @@ int inl; return(ret); } -static long nbiof_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long nbiof_ctrl(BIO *b, int cmd, long num, char *ptr) { long ret; @@ -247,19 +235,14 @@ char *ptr; return(ret); } -static int nbiof_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int nbiof_gets(BIO *bp, char *buf, int size) { if (bp->next_bio == NULL) return(0); return(BIO_gets(bp->next_bio,buf,size)); } -static int nbiof_puts(bp,str) -BIO *bp; -char *str; +static int nbiof_puts(BIO *bp, char *str) { if (bp->next_bio == NULL) return(0); return(BIO_puts(bp->next_bio,str)); diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c index a47a65741a..8bbf353146 100644 --- a/crypto/bio/bf_null.c +++ b/crypto/bio/bf_null.c @@ -96,13 +96,12 @@ static BIO_METHOD methods_nullf= nullf_free, }; -BIO_METHOD *BIO_f_null() +BIO_METHOD *BIO_f_null(void) { return(&methods_nullf); } -static int nullf_new(bi) -BIO *bi; +static int nullf_new(BIO *bi) { bi->init=1; bi->ptr=NULL; @@ -110,8 +109,7 @@ BIO *bi; return(1); } -static int nullf_free(a) -BIO *a; +static int nullf_free(BIO *a) { if (a == NULL) return(0); /* a->ptr=NULL; @@ -120,10 +118,7 @@ BIO *a; return(1); } -static int nullf_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int nullf_read(BIO *b, char *out, int outl) { int ret=0; @@ -135,10 +130,7 @@ int outl; return(ret); } -static int nullf_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int nullf_write(BIO *b, char *in, int inl) { int ret=0; @@ -150,11 +142,7 @@ int inl; return(ret); } -static long nullf_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr) { long ret; @@ -175,19 +163,14 @@ char *ptr; return(ret); } -static int nullf_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int nullf_gets(BIO *bp, char *buf, int size) { if (bp->next_bio == NULL) return(0); return(BIO_gets(bp->next_bio,buf,size)); } -static int nullf_puts(bp,str) -BIO *bp; -char *str; +static int nullf_puts(BIO *bp, char *str) { if (bp->next_bio == NULL) return(0); return(BIO_puts(bp->next_bio,str)); diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c index 32ae7be499..a37d8b4c29 100644 --- a/crypto/bio/bio_cb.c +++ b/crypto/bio/bio_cb.c @@ -63,13 +63,8 @@ #include "bio.h" #include "err.h" -long MS_CALLBACK BIO_debug_callback(bio,cmd,argp,argi,argl,ret) -BIO *bio; -int cmd; -const char *argp; -int argi; -long argl; -long ret; +long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp, + int argi, long argl, long ret) { BIO *b; MS_STATIC char buf[256]; diff --git a/crypto/bio/bio_err.c b/crypto/bio/bio_err.c index 8fad0ff730..78c41fdbef 100644 --- a/crypto/bio/bio_err.c +++ b/crypto/bio/bio_err.c @@ -116,7 +116,7 @@ static ERR_STRING_DATA BIO_str_reasons[]= #endif -void ERR_load_BIO_strings() +void ERR_load_BIO_strings(void) { static int init=1; diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index fc18409e1d..9b2577d7a9 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -66,8 +66,7 @@ static STACK *bio_meth=NULL; static int bio_meth_num=0; -BIO *BIO_new(method) -BIO_METHOD *method; +BIO *BIO_new(BIO_METHOD *method) { BIO *ret=NULL; @@ -85,9 +84,7 @@ BIO_METHOD *method; return(ret); } -int BIO_set(bio,method) -BIO *bio; -BIO_METHOD *method; +int BIO_set(BIO *bio, BIO_METHOD *method) { bio->method=method; bio->callback=NULL; @@ -110,8 +107,7 @@ BIO_METHOD *method; return(1); } -int BIO_free(a) -BIO *a; +int BIO_free(BIO *a) { int ret=0,i; @@ -141,10 +137,7 @@ BIO *a; return(1); } -int BIO_read(b,out,outl) -BIO *b; -char *out; -int outl; +int BIO_read(BIO *b, char *out, int outl) { int i; long (*cb)(); @@ -176,10 +169,7 @@ int outl; return(i); } -int BIO_write(b,in,inl) -BIO *b; -const char *in; -int inl; +int BIO_write(BIO *b, const char *in, int inl) { int i; long (*cb)(); @@ -220,9 +210,7 @@ int inl; return(i); } -int BIO_puts(b,in) -BIO *b; -const char *in; +int BIO_puts(BIO *b, const char *in) { int i; long (*cb)(); @@ -253,10 +241,7 @@ const char *in; return(i); } -int BIO_gets(b,in,inl) -BIO *b; -char *in; -int inl; +int BIO_gets(BIO *b, char *in, int inl) { int i; long (*cb)(); @@ -287,11 +272,7 @@ int inl; return(i); } -long BIO_int_ctrl(b,cmd,larg,iarg) -BIO *b; -int cmd; -long larg; -int iarg; +long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg) { int i; @@ -299,10 +280,7 @@ int iarg; return(BIO_ctrl(b,cmd,larg,(char *)&i)); } -char *BIO_ptr_ctrl(b,cmd,larg) -BIO *b; -int cmd; -long larg; +char *BIO_ptr_ctrl(BIO *b, int cmd, long larg) { char *p=NULL; @@ -312,11 +290,7 @@ long larg; return(p); } -long BIO_ctrl(b,cmd,larg,parg) -BIO *b; -int cmd; -long larg; -char *parg; +long BIO_ctrl(BIO *b, int cmd, long larg, char *parg) { long ret; long (*cb)(); @@ -344,8 +318,7 @@ char *parg; } /* put the 'bio' on the end of b's list of operators */ -BIO *BIO_push(b,bio) -BIO *b,*bio; +BIO *BIO_push(BIO *b, BIO *bio) { BIO *lb; @@ -362,8 +335,7 @@ BIO *b,*bio; } /* Remove the first and return the rest */ -BIO *BIO_pop(b) -BIO *b; +BIO *BIO_pop(BIO *b) { BIO *ret; @@ -381,9 +353,7 @@ BIO *b; return(ret); } -BIO *BIO_get_retry_BIO(bio,reason) -BIO *bio; -int *reason; +BIO *BIO_get_retry_BIO(BIO *bio, int *reason) { BIO *b,*last; @@ -399,15 +369,12 @@ int *reason; return(last); } -int BIO_get_retry_reason(bio) -BIO *bio; +int BIO_get_retry_reason(BIO *bio) { return(bio->retry_reason); } -BIO *BIO_find_type(bio,type) -BIO *bio; -int type; +BIO *BIO_find_type(BIO *bio, int type) { int mt,mask; @@ -429,8 +396,7 @@ int type; return(NULL); } -void BIO_free_all(bio) -BIO *bio; +void BIO_free_all(BIO *bio) { BIO *b; int ref; @@ -446,8 +412,7 @@ BIO *bio; } } -BIO *BIO_dup_chain(in) -BIO *in; +BIO *BIO_dup_chain(BIO *in) { BIO *ret=NULL,*eoc=NULL,*bio,*new; @@ -491,36 +456,26 @@ err: return(NULL); } -void BIO_copy_next_retry(b) -BIO *b; +void BIO_copy_next_retry(BIO *b) { BIO_set_flags(b,BIO_get_retry_flags(b->next_bio)); b->retry_reason=b->next_bio->retry_reason; } -int BIO_get_ex_new_index(argl,argp,new_func,dup_func,free_func) -long argl; -char *argp; -int (*new_func)(); -int (*dup_func)(); -void (*free_func)(); +int BIO_get_ex_new_index(long argl, char *argp, int (*new_func)(), + int (*dup_func)(), void (*free_func)()) { bio_meth_num++; return(CRYPTO_get_ex_new_index(bio_meth_num-1,&bio_meth, argl,argp,new_func,dup_func,free_func)); } -int BIO_set_ex_data(bio,idx,data) -BIO *bio; -int idx; -char *data; +int BIO_set_ex_data(BIO *bio, int idx, char *data) { return(CRYPTO_set_ex_data(&(bio->ex_data),idx,data)); } -char *BIO_get_ex_data(bio,idx) -BIO *bio; -int idx; +char *BIO_get_ex_data(BIO *bio, int idx) { return(CRYPTO_get_ex_data(&(bio->ex_data),idx)); } diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index ecdd1709d1..a179dfa3dd 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -136,13 +136,12 @@ static BIO_METHOD methods_acceptp= acpt_free, }; -BIO_METHOD *BIO_s_accept() +BIO_METHOD *BIO_s_accept(void) { return(&methods_acceptp); } -static int acpt_new(bi) -BIO *bi; +static int acpt_new(BIO *bi) { BIO_ACCEPT *ba; @@ -157,7 +156,7 @@ BIO *bi; return(1); } -BIO_ACCEPT *BIO_ACCEPT_new() +BIO_ACCEPT *BIO_ACCEPT_new(void) { BIO_ACCEPT *ret; @@ -170,8 +169,7 @@ BIO_ACCEPT *BIO_ACCEPT_new() return(ret); } -void BIO_ACCEPT_free(a) -BIO_ACCEPT *a; +void BIO_ACCEPT_free(BIO_ACCEPT *a) { if(a == NULL) return; @@ -182,8 +180,7 @@ BIO_ACCEPT *a; Free(a); } -static void acpt_close_socket(bio) -BIO *bio; +static void acpt_close_socket(BIO *bio) { BIO_ACCEPT *c; @@ -197,8 +194,7 @@ BIO *bio; } } -static int acpt_free(a) -BIO *a; +static int acpt_free(BIO *a) { BIO_ACCEPT *data; @@ -216,9 +212,7 @@ BIO *a; return(1); } -static int acpt_state(b,c) -BIO *b; -BIO_ACCEPT *c; +static int acpt_state(BIO *b, BIO_ACCEPT *c) { BIO *bio=NULL,*dbio; int s= -1; @@ -309,10 +303,7 @@ err: } -static int acpt_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int acpt_read(BIO *b, char *out, int outl) { int ret=0; BIO_ACCEPT *data; @@ -331,10 +322,7 @@ int outl; return(ret); } -static int acpt_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int acpt_write(BIO *b, char *in, int inl) { int ret; BIO_ACCEPT *data; @@ -353,11 +341,7 @@ int inl; return(ret); } -static long acpt_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO *dbio; int *ip; @@ -471,9 +455,7 @@ char *ptr; return(ret); } -static int acpt_puts(bp,str) -BIO *bp; -char *str; +static int acpt_puts(BIO *bp, char *str) { int n,ret; @@ -482,8 +464,7 @@ char *str; return(ret); } -BIO *BIO_new_accept(str) -char *str; +BIO *BIO_new_accept(char *str) { BIO *ret; diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 9c84057e1b..4c5c3c67a3 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -139,9 +139,7 @@ static BIO_METHOD methods_connectp= conn_free, }; -static int conn_state(b,c) -BIO *b; -BIO_CONNECT *c; +static int conn_state(BIO *b, BIO_CONNECT *c) { int ret= -1,i; unsigned long l; @@ -334,7 +332,7 @@ end: return(ret); } -BIO_CONNECT *BIO_CONNECT_new() +BIO_CONNECT *BIO_CONNECT_new(void) { BIO_CONNECT *ret; @@ -354,8 +352,7 @@ BIO_CONNECT *BIO_CONNECT_new() return(ret); } -void BIO_CONNECT_free(a) -BIO_CONNECT *a; +void BIO_CONNECT_free(BIO_CONNECT *a) { if(a == NULL) return; @@ -367,13 +364,12 @@ BIO_CONNECT *a; Free(a); } -BIO_METHOD *BIO_s_connect() +BIO_METHOD *BIO_s_connect(void) { return(&methods_connectp); } -static int conn_new(bi) -BIO *bi; +static int conn_new(BIO *bi) { bi->init=0; bi->num=INVALID_SOCKET; @@ -384,8 +380,7 @@ BIO *bi; return(1); } -static void conn_close_socket(bio) -BIO *bio; +static void conn_close_socket(BIO *bio) { BIO_CONNECT *c; @@ -400,8 +395,7 @@ BIO *bio; } } -static int conn_free(a) -BIO *a; +static int conn_free(BIO *a) { BIO_CONNECT *data; @@ -419,10 +413,7 @@ BIO *a; return(1); } -static int conn_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int conn_read(BIO *b, char *out, int outl) { int ret=0; BIO_CONNECT *data; @@ -449,10 +440,7 @@ int outl; return(ret); } -static int conn_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int conn_write(BIO *b, char *in, int inl) { int ret; BIO_CONNECT *data; @@ -475,11 +463,7 @@ int inl; return(ret); } -static long conn_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long conn_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO *dbio; int *ip; @@ -622,9 +606,7 @@ char *ptr; return(ret); } -static int conn_puts(bp,str) -BIO *bp; -char *str; +static int conn_puts(BIO *bp, char *str) { int n,ret; @@ -633,8 +615,7 @@ char *str; return(ret); } -BIO *BIO_new_connect(str) -char *str; +BIO *BIO_new_connect(char *str) { BIO *ret; diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 5068a7ca0d..3ed5dab904 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -104,9 +104,7 @@ static BIO_METHOD methods_filep= file_free, }; -BIO *BIO_new_file(filename,mode) -char *filename; -char *mode; +BIO *BIO_new_file(char *filename, char *mode) { BIO *ret; FILE *file; @@ -125,9 +123,7 @@ char *mode; return(ret); } -BIO *BIO_new_fp(stream,close_flag) -FILE *stream; -int close_flag; +BIO *BIO_new_fp(FILE *stream, int close_flag) { BIO *ret; @@ -138,13 +134,12 @@ int close_flag; return(ret); } -BIO_METHOD *BIO_s_file() +BIO_METHOD *BIO_s_file(void) { return(&methods_filep); } -static int MS_CALLBACK file_new(bi) -BIO *bi; +static int MS_CALLBACK file_new(BIO *bi) { bi->init=0; bi->num=0; @@ -152,8 +147,7 @@ BIO *bi; return(1); } -static int MS_CALLBACK file_free(a) -BIO *a; +static int MS_CALLBACK file_free(BIO *a) { if (a == NULL) return(0); if (a->shutdown) @@ -168,10 +162,7 @@ BIO *a; return(1); } -static int MS_CALLBACK file_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int MS_CALLBACK file_read(BIO *b, char *out, int outl) { int ret=0; @@ -182,10 +173,7 @@ int outl; return(ret); } -static int MS_CALLBACK file_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int MS_CALLBACK file_write(BIO *b, char *in, int inl) { int ret=0; @@ -201,11 +189,7 @@ int inl; return(ret); } -static long MS_CALLBACK file_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, char *ptr) { long ret=1; FILE *fp=(FILE *)b->ptr; @@ -309,10 +293,7 @@ char *ptr; return(ret); } -static int MS_CALLBACK file_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size) { int ret=0; @@ -323,9 +304,7 @@ int size; return(ret); } -static int MS_CALLBACK file_puts(bp,str) -BIO *bp; -char *str; +static int MS_CALLBACK file_puts(BIO *bp, char *str) { int n,ret; diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 89afb0e11c..b89e6e09e1 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -105,13 +105,12 @@ static BIO_METHOD methods_slg= slg_free, }; -BIO_METHOD *BIO_s_log() +BIO_METHOD *BIO_s_log(void) { return(&methods_slg); } -static int MS_CALLBACK slg_new(bi) -BIO *bi; +static int MS_CALLBACK slg_new(BIO *bi) { bi->init=1; bi->num=0; @@ -124,18 +123,14 @@ BIO *bi; return(1); } -static int MS_CALLBACK slg_free(a) -BIO *a; +static int MS_CALLBACK slg_free(BIO *a) { if (a == NULL) return(0); xcloselog(a); return(1); } -static int MS_CALLBACK slg_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) { int ret= inl; char* buf= in; @@ -192,11 +187,7 @@ int inl; return(ret); } -static long MS_CALLBACK slg_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, char *ptr) { switch (cmd) { @@ -210,9 +201,7 @@ char *ptr; return(0); } -static int MS_CALLBACK slg_puts(bp,str) -BIO *bp; -char *str; +static int MS_CALLBACK slg_puts(BIO *bp, char *str) { int n,ret; diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c index 8a2efb938c..893664777c 100644 --- a/crypto/bio/bss_mem.c +++ b/crypto/bio/bss_mem.c @@ -95,13 +95,12 @@ static BIO_METHOD mem_method= /* bio->num is used to hold the value to return on 'empty', if it is * 0, should_retry is not set */ -BIO_METHOD *BIO_s_mem() +BIO_METHOD *BIO_s_mem(void) { return(&mem_method); } -static int mem_new(bi) -BIO *bi; +static int mem_new(BIO *bi) { BUF_MEM *b; @@ -114,8 +113,7 @@ BIO *bi; return(1); } -static int mem_free(a) -BIO *a; +static int mem_free(BIO *a) { if (a == NULL) return(0); if (a->shutdown) @@ -129,10 +127,7 @@ BIO *a; return(1); } -static int mem_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int mem_read(BIO *b, char *out, int outl) { int ret= -1; BUF_MEM *bm; @@ -161,10 +156,7 @@ int outl; return(ret); } -static int mem_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int mem_write(BIO *b, char *in, int inl) { int ret= -1; int blen; @@ -187,11 +179,7 @@ end: return(ret); } -static long mem_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long mem_ctrl(BIO *b, int cmd, long num, char *ptr) { long ret=1; char **pptr; @@ -257,10 +245,7 @@ char *ptr; return(ret); } -static int mem_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int mem_gets(BIO *bp, char *buf, int size) { int i,j; int ret= -1; @@ -290,9 +275,7 @@ int size; return(ret); } -static int mem_puts(bp,str) -BIO *bp; -char *str; +static int mem_puts(BIO *bp, char *str) { int n,ret; diff --git a/crypto/bio/bss_null.c b/crypto/bio/bss_null.c index 0791a2471a..52f5da8b12 100644 --- a/crypto/bio/bss_null.c +++ b/crypto/bio/bss_null.c @@ -92,13 +92,12 @@ static BIO_METHOD null_method= null_free, }; -BIO_METHOD *BIO_s_null() +BIO_METHOD *BIO_s_null(void) { return(&null_method); } -static int null_new(bi) -BIO *bi; +static int null_new(BIO *bi) { bi->init=1; bi->num=0; @@ -106,34 +105,23 @@ BIO *bi; return(1); } -static int null_free(a) -BIO *a; +static int null_free(BIO *a) { if (a == NULL) return(0); return(1); } -static int null_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int null_read(BIO *b, char *out, int outl) { return(0); } -static int null_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int null_write(BIO *b, char *in, int inl) { return(inl); } -static long null_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long null_ctrl(BIO *b, int cmd, long num, char *ptr) { long ret=1; @@ -159,17 +147,12 @@ char *ptr; return(ret); } -static int null_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int null_gets(BIO *bp, char *buf, int size) { return(0); } -static int null_puts(bp,str) -BIO *bp; -char *str; +static int null_puts(BIO *bp, char *str) { if (str == NULL) return(0); return(strlen(str)); diff --git a/crypto/bio/bss_rtcp.c b/crypto/bio/bss_rtcp.c index 6eb434dee8..e07958cd77 100644 --- a/crypto/bio/bss_rtcp.c +++ b/crypto/bio/bss_rtcp.c @@ -107,7 +107,7 @@ static BIO_METHOD rtcp_method= rtcp_free, }; -BIO_METHOD *BIO_s_rtcp() +BIO_METHOD *BIO_s_rtcp(void) { return(&rtcp_method); } @@ -136,8 +136,7 @@ static int put ( io_channel chan, char *buffer, int length ) } /***************************************************************************/ -static int rtcp_new(bi) -BIO *bi; +static int rtcp_new(BIO *bi) { struct rpc_ctx *ctx; bi->init=1; @@ -150,8 +149,7 @@ BIO *bi; return(1); } -static int rtcp_free(a) -BIO *a; +static int rtcp_free(BIO *a) { if (a == NULL) return(0); if ( a->ptr ) Free ( a->ptr ); @@ -159,10 +157,7 @@ BIO *a; return(1); } -static int rtcp_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int rtcp_read(BIO *b, char *out, int outl) { int status, length; struct rpc_ctx *ctx; @@ -209,10 +204,7 @@ int outl; return length; } -static int rtcp_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int rtcp_write(BIO *b, char *in, int inl) { int status, i, segment, length; struct rpc_ctx *ctx; @@ -241,11 +233,7 @@ int inl; return(i); } -static long rtcp_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long rtcp_ctrl(BIO *b, int cmd, long num, char *ptr) { long ret=1; @@ -276,17 +264,12 @@ char *ptr; return(ret); } -static int rtcp_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int rtcp_gets(BIO *bp, char *buf, int size) { return(0); } -static int rtcp_puts(bp,str) -BIO *bp; -char *str; +static int rtcp_puts(BIO *bp, char *str) { int length; if (str == NULL) return(0); diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c index cfd2f11992..049606ee5d 100644 --- a/crypto/bio/bss_sock.c +++ b/crypto/bio/bss_sock.c @@ -118,7 +118,7 @@ static BIO_METHOD methods_sockp= sock_free, }; -BIO_METHOD *BIO_s_socket() +BIO_METHOD *BIO_s_socket(void) { return(&methods_sockp); } @@ -135,19 +135,17 @@ static BIO_METHOD methods_fdp= fd_free, }; -BIO_METHOD *BIO_s_fd() +BIO_METHOD *BIO_s_fd(void) { return(&methods_fdp); } #endif #ifndef BIO_FD -BIO *BIO_new_socket(fd,close_flag) +BIO *BIO_new_socket(int fd, int close_flag) #else -BIO *BIO_new_fd(fd,close_flag) +BIO *BIO_new_fd(int fd,int close_flag) #endif -int fd; -int close_flag; { BIO *ret; @@ -162,11 +160,10 @@ int close_flag; } #ifndef BIO_FD -static int sock_new(bi) +static int sock_new(BIO *bi) #else -static int fd_new(bi) +static int fd_new(BIO *bi) #endif -BIO *bi; { bi->init=0; bi->num=0; @@ -176,11 +173,10 @@ BIO *bi; } #ifndef BIO_FD -static int sock_free(a) +static int sock_free(BIO *a) #else -static int fd_free(a) +static int fd_free(BIO *a) #endif -BIO *a; { if (a == NULL) return(0); if (a->shutdown) @@ -202,13 +198,10 @@ BIO *a; } #ifndef BIO_FD -static int sock_read(b,out,outl) +static int sock_read(BIO *b, char *out, int outl) #else -static int fd_read(b,out,outl) +static int fd_read(BIO *b, char *out,int outl) #endif -BIO *b; -char *out; -int outl; { int ret=0; @@ -236,13 +229,10 @@ int outl; } #ifndef BIO_FD -static int sock_write(b,in,inl) +static int sock_write(BIO *b, char *in, int inl) #else -static int fd_write(b,in,inl) +static int fd_write(BIO *b, char *in, int inl) #endif -BIO *b; -char *in; -int inl; { int ret; @@ -267,14 +257,10 @@ int inl; } #ifndef BIO_FD -static long sock_ctrl(b,cmd,num,ptr) +static long sock_ctrl(BIO *b, int cmd, long num, char *ptr) #else -static long fd_ctrl(b,cmd,num,ptr) +static long fd_ctrl(BIO *b, int cmd, long num, char *ptr) #endif -BIO *b; -int cmd; -long num; -char *ptr; { long ret=1; int *ip; @@ -340,22 +326,17 @@ char *ptr; } #ifdef undef -static int sock_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int sock_gets(BIO *bp, char *buf,int size) { return(-1); } #endif #ifndef BIO_FD -static int sock_puts(bp,str) +static int sock_puts(BIO *bp, char *str) #else -static int fd_puts(bp,str) +static int fd_puts(BIO *bp, char *str) #endif -BIO *bp; -char *str; { int n,ret; @@ -369,11 +350,10 @@ char *str; } #ifndef BIO_FD -int BIO_sock_should_retry(i) +int BIO_sock_should_retry(int i) #else -int BIO_fd_should_retry(i) +int BIO_fd_should_retry(int i) #endif -int i; { int err; @@ -400,11 +380,10 @@ int i; } #ifndef BIO_FD -int BIO_sock_non_fatal_error(err) +int BIO_sock_non_fatal_error(int err) #else -int BIO_fd_non_fatal_error(err) +int BIO_fd_non_fatal_error(int err) #endif -int err; { switch (err) { diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c index caea96f3b5..cd7d48d71e 100644 --- a/crypto/bn/bn_add.c +++ b/crypto/bn/bn_add.c @@ -61,10 +61,7 @@ #include "bn_lcl.h" /* r can == a or b */ -int BN_add(r, a, b) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; +int BN_add(BIGNUM *r, BIGNUM *a, BIGNUM *b) { BIGNUM *tmp; @@ -107,10 +104,7 @@ BIGNUM *b; } /* unsigned add of b to a, r must be large enough */ -int BN_uadd(r,a,b) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; +int BN_uadd(BIGNUM *r, BIGNUM *a, BIGNUM *b) { register int i; int max,min; @@ -170,10 +164,7 @@ BIGNUM *b; } /* unsigned subtraction of b from a, a must be larger than b. */ -int BN_usub(r, a, b) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; +int BN_usub(BIGNUM *r, BIGNUM *a, BIGNUM *b) { int max,min; register BN_ULONG t1,t2,*ap,*bp,*rp; @@ -264,10 +255,7 @@ BIGNUM *b; return(1); } -int BN_sub(r, a, b) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; +int BN_sub(BIGNUM *r, BIGNUM *a, BIGNUM *b) { int max; int add=0,neg=0; diff --git a/crypto/bn/bn_asm.c b/crypto/bn/bn_asm.c index cdf20efa4f..05ede3b250 100644 --- a/crypto/bn/bn_asm.c +++ b/crypto/bn/bn_asm.c @@ -62,10 +62,7 @@ #ifdef BN_LLONG -BN_ULONG bn_mul_add_words(rp,ap,num,w) -BN_ULONG *rp,*ap; -int num; -BN_ULONG w; +BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w) { BN_ULONG c1=0; @@ -89,10 +86,7 @@ BN_ULONG w; return(c1); } -BN_ULONG bn_mul_words(rp,ap,num,w) -BN_ULONG *rp,*ap; -int num; -BN_ULONG w; +BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w) { BN_ULONG c1=0; @@ -115,9 +109,7 @@ BN_ULONG w; return(c1); } -void bn_sqr_words(r,a,n) -BN_ULONG *r,*a; -int n; +void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n) { bn_check_num(n); if (n <= 0) return; @@ -148,10 +140,7 @@ int n; #else -BN_ULONG bn_mul_add_words(rp,ap,num,w) -BN_ULONG *rp,*ap; -int num; -BN_ULONG w; +BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w) { BN_ULONG c=0; BN_ULONG bl,bh; @@ -178,10 +167,7 @@ BN_ULONG w; return(c); } -BN_ULONG bn_mul_words(rp,ap,num,w) -BN_ULONG *rp,*ap; -int num; -BN_ULONG w; +BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w) { BN_ULONG carry=0; BN_ULONG bl,bh; @@ -208,9 +194,7 @@ BN_ULONG w; return(carry); } -void bn_sqr_words(r,a,n) -BN_ULONG *r,*a; -int n; +void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n) { bn_check_num(n); if (n <= 0) return; @@ -237,8 +221,7 @@ int n; #if defined(BN_LLONG) && defined(BN_DIV2W) -BN_ULONG bn_div_words(h,l,d) -BN_ULONG h,l,d; +BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) { return((BN_ULONG)(((((BN_ULLONG)h)<A,b->mod,ctx)); } -int BN_BLINDING_invert(n,b,ctx) -BIGNUM *n; -BN_BLINDING *b; -BN_CTX *ctx; +int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) { int ret; diff --git a/crypto/bn/bn_comba.c b/crypto/bn/bn_comba.c index 30357cf5fb..7ad09b4a6d 100644 --- a/crypto/bn/bn_comba.c +++ b/crypto/bn/bn_comba.c @@ -70,8 +70,7 @@ void bn_mul_comba44(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); void bn_sqr_comba88(BN_ULONG *r,BN_ULONG *a); void bn_sqr_comba44(BN_ULONG *r,BN_ULONG *a); -void bn_mul_comba88(r,a,b) -BN_ULONG *r,*a,*b; +void bn_mul_comba88(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) { #ifdef BN_LLONG BN_ULLONG t; @@ -180,8 +179,7 @@ BN_ULONG *r,*a,*b; r[15]=c1; } -void bn_mul_comba44(r,a,b) -BN_ULONG *r,*a,*b; +void bn_mul_comba44(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b) { #ifdef BN_LLONG BN_ULLONG t; @@ -226,8 +224,7 @@ BN_ULONG *r,*a,*b; r[7]=c2; } -void bn_sqr_comba88(r,a) -BN_ULONG *r,*a; +void bn_sqr_comba88(BN_ULONG *r, BN_ULONG *a) { #ifdef BN_LLONG BN_ULLONG t,tt; @@ -308,8 +305,7 @@ BN_ULONG *r,*a; r[15]=c1; } -void bn_sqr_comba44(r,a) -BN_ULONG *r,*a; +void bn_sqr_comba44(BN_ULONG *r, BN_ULONG *a) { #ifdef BN_LLONG BN_ULLONG t,tt; diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c index c7bc04d0b4..bffa9f3e61 100644 --- a/crypto/bn/bn_div.c +++ b/crypto/bn/bn_div.c @@ -62,12 +62,7 @@ /* The old slow way */ #if 0 -int BN_div(dv, rem, m, d,ctx) -BIGNUM *dv; -BIGNUM *rem; -BIGNUM *m; -BIGNUM *d; -BN_CTX *ctx; +int BN_div(BIGNUM *dv, BIGNUM *rem, BIGNUM *m, BIGNUM *d, BN_CTX *ctx) { int i,nm,nd; BIGNUM *D; @@ -122,12 +117,8 @@ BN_CTX *ctx; #else -int BN_div(dv, rm, num, divisor,ctx) -BIGNUM *dv; -BIGNUM *rm; -BIGNUM *num; -BIGNUM *divisor; -BN_CTX *ctx; +int BN_div(BIGNUM *dv, BIGNUM *rm, BIGNUM *num, BIGNUM *divisor, + BN_CTX *ctx) { int norm_shift,i,j,loop; BIGNUM *tmp,wnum,*snum,*sdiv,*res; @@ -292,11 +283,7 @@ err: #endif /* rem != m */ -int BN_mod(rem, m, d,ctx) -BIGNUM *rem; -BIGNUM *m; -BIGNUM *d; -BN_CTX *ctx; +int BN_mod(BIGNUM *rem, BIGNUM *m, BIGNUM *d, BN_CTX *ctx) { #if 0 /* The old slow way */ int i,nm,nd; diff --git a/crypto/bn/bn_err.c b/crypto/bn/bn_err.c index 626502a0e3..2041b018ea 100644 --- a/crypto/bn/bn_err.c +++ b/crypto/bn/bn_err.c @@ -98,7 +98,7 @@ static ERR_STRING_DATA BN_str_reasons[]= #endif -void ERR_load_BN_strings() +void ERR_load_BN_strings(void) { static int init=1; diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c index cc4528247e..9833037384 100644 --- a/crypto/bn/bn_exp.c +++ b/crypto/bn/bn_exp.c @@ -63,12 +63,7 @@ #define TABLE_SIZE 16 /* slow but works */ -int BN_mod_mul(ret, a, b, m, ctx) -BIGNUM *ret; -BIGNUM *a; -BIGNUM *b; -BIGNUM *m; -BN_CTX *ctx; +int BN_mod_mul(BIGNUM *ret, BIGNUM *a, BIGNUM *b, BIGNUM *m, BN_CTX *ctx) { BIGNUM *t; int r=0; @@ -91,9 +86,7 @@ err: #if 0 /* this one works - simple but works */ -int BN_mod_exp(r,a,p,m,ctx) -BIGNUM *r,*a,*p,*m; -BN_CTX *ctx; +int BN_mod_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, BN_CTX *ctx) { int i,bits,ret=0; BIGNUM *v,*tmp; @@ -127,9 +120,7 @@ err: #endif /* this one works - simple but works */ -int BN_exp(r,a,p,ctx) -BIGNUM *r,*a,*p; -BN_CTX *ctx; +int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx) { int i,bits,ret=0,tos; BIGNUM *v,*rr; @@ -163,12 +154,7 @@ err: return(ret); } -int BN_mod_exp(r,a,p,m,ctx) -BIGNUM *r; -BIGNUM *a; -BIGNUM *p; -BIGNUM *m; -BN_CTX *ctx; +int BN_mod_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, BN_CTX *ctx) { int ret; @@ -197,12 +183,7 @@ BN_CTX *ctx; } /* #ifdef RECP_MUL_MOD */ -int BN_mod_exp_recp(r,a,p,m,ctx) -BIGNUM *r; -BIGNUM *a; -BIGNUM *p; -BIGNUM *m; -BN_CTX *ctx; +int BN_mod_exp_recp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, BN_CTX *ctx) { int i,j,bits,ret=0,wstart,wend,window,wvalue; int start=1,ts=0; @@ -315,13 +296,8 @@ err: /* #endif */ /* #ifdef MONT_MUL_MOD */ -int BN_mod_exp_mont(rr,a,p,m,ctx,in_mont) -BIGNUM *rr; -BIGNUM *a; -BIGNUM *p; -BIGNUM *m; -BN_CTX *ctx; -BN_MONT_CTX *in_mont; +int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, BIGNUM *p, BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *in_mont) { int i,j,bits,ret=0,wstart,wend,window,wvalue; int start=1,ts=0; @@ -461,12 +437,8 @@ err: /* #endif */ /* The old fallback, simple version :-) */ -int BN_mod_exp_simple(r,a,p,m,ctx) -BIGNUM *r; -BIGNUM *a; -BIGNUM *p; -BIGNUM *m; -BN_CTX *ctx; +int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, + BN_CTX *ctx) { int i,j,bits,ret=0,wstart,wend,window,wvalue,ts=0; int start=1; diff --git a/crypto/bn/bn_exp2.c b/crypto/bn/bn_exp2.c index eface739b3..1132d53365 100644 --- a/crypto/bn/bn_exp2.c +++ b/crypto/bn/bn_exp2.c @@ -15,15 +15,8 @@ #define EXP2_TABLE_BITS 2 /* 1 2 3 4 5 */ #define EXP2_TABLE_SIZE 4 /* 2 4 8 16 32 */ -int BN_mod_exp2_mont(rr,a1,p1,a2,p2,m,ctx,in_mont) -BIGNUM *rr; -BIGNUM *a1; -BIGNUM *p1; -BIGNUM *a2; -BIGNUM *p2; -BIGNUM *m; -BN_CTX *ctx; -BN_MONT_CTX *in_mont; +int BN_mod_exp2_mont(BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2, + BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) { int i,j,k,bits,bits1,bits2,ret=0,wstart,wend,window,xvalue,yvalue; int start=1,ts=0,x,y; diff --git a/crypto/bn/bn_gcd.c b/crypto/bn/bn_gcd.c index c80cecdc8d..833d2a8e40 100644 --- a/crypto/bn/bn_gcd.c +++ b/crypto/bn/bn_gcd.c @@ -66,9 +66,7 @@ static BIGNUM *euclid(BIGNUM *a, BIGNUM *b); static BIGNUM *euclid(); #endif -int BN_gcd(r,in_a,in_b,ctx) -BIGNUM *r,*in_a,*in_b; -BN_CTX *ctx; +int BN_gcd(BIGNUM *r, BIGNUM *in_a, BIGNUM *in_b, BN_CTX *ctx) { BIGNUM *a,*b,*t; int ret=0; @@ -92,8 +90,7 @@ err: return(ret); } -static BIGNUM *euclid(a,b) -BIGNUM *a,*b; +static BIGNUM *euclid(BIGNUM *a, BIGNUM *b) { BIGNUM *t; int shifts=0; @@ -148,11 +145,7 @@ err: } /* solves ax == 1 (mod n) */ -BIGNUM *BN_mod_inverse(in, a, n, ctx) -BIGNUM *in; -BIGNUM *a; -BIGNUM *n; -BN_CTX *ctx; +BIGNUM *BN_mod_inverse(BIGNUM *in, BIGNUM *a, BIGNUM *n, BN_CTX *ctx) { BIGNUM *A,*B,*X,*Y,*M,*D,*R; BIGNUM *T,*ret=NULL; diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index ed5a76d027..00693bc5c3 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -80,8 +80,7 @@ int bn_limit_num_high=8; /* (1<= 0) { @@ -113,8 +112,7 @@ int mult,high,low,mont; } } -int BN_get_params(which) -int which; +int BN_get_params(int which) { if (which == 0) return(bn_limit_bits); else if (which == 1) return(bn_limit_bits_high); @@ -123,7 +121,7 @@ int which; else return(0); } -BIGNUM *BN_value_one() +BIGNUM *BN_value_one(void) { static BN_ULONG data_one=1L; static BIGNUM const_one={&data_one,1,1,0}; @@ -131,7 +129,7 @@ BIGNUM *BN_value_one() return(&const_one); } -char *BN_options() +char *BN_options(void) { static int init=0; static char data[16]; @@ -150,8 +148,7 @@ char *BN_options() return(data); } -int BN_num_bits_word(l) -BN_ULONG l; +int BN_num_bits_word(BN_ULONG l) { static char bits[256]={ 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4, @@ -238,8 +235,7 @@ BN_ULONG l; } } -int BN_num_bits(a) -BIGNUM *a; +int BN_num_bits(BIGNUM *a) { BN_ULONG l; int i; @@ -259,8 +255,7 @@ BIGNUM *a; return(i+BN_num_bits_word(l)); } -void BN_clear_free(a) -BIGNUM *a; +void BN_clear_free(BIGNUM *a) { int i; @@ -277,8 +272,7 @@ BIGNUM *a; Free(a); } -void BN_free(a) -BIGNUM *a; +void BN_free(BIGNUM *a) { if (a == NULL) return; if ((a->d != NULL) && !(BN_get_flags(a,BN_FLG_STATIC_DATA))) @@ -288,13 +282,12 @@ BIGNUM *a; Free(a); } -void BN_init(a) -BIGNUM *a; +void BN_init(BIGNUM *a) { memset(a,0,sizeof(BIGNUM)); } -BIGNUM *BN_new() +BIGNUM *BN_new(void) { BIGNUM *ret; @@ -312,7 +305,7 @@ BIGNUM *BN_new() } -BN_CTX *BN_CTX_new() +BN_CTX *BN_CTX_new(void) { BN_CTX *ret; @@ -328,16 +321,14 @@ BN_CTX *BN_CTX_new() return(ret); } -void BN_CTX_init(ctx) -BN_CTX *ctx; +void BN_CTX_init(BN_CTX *ctx) { memset(ctx,0,sizeof(BN_CTX)); ctx->tos=0; ctx->flags=0; } -void BN_CTX_free(c) -BN_CTX *c; +void BN_CTX_free(BN_CTX *c) { int i; @@ -350,9 +341,7 @@ BN_CTX *c; Free(c); } -BIGNUM *bn_expand2(b, words) -BIGNUM *b; -int words; +BIGNUM *bn_expand2(BIGNUM *b, int words) { BN_ULONG *A,*B,*a; int i,j; @@ -451,8 +440,7 @@ memset(A,0x5c,sizeof(BN_ULONG)*(words+1)); return(b); } -BIGNUM *BN_dup(a) -BIGNUM *a; +BIGNUM *BN_dup(BIGNUM *a) { BIGNUM *r; @@ -463,9 +451,7 @@ BIGNUM *a; return((BIGNUM *)BN_copy(r,a)); } -BIGNUM *BN_copy(a, b) -BIGNUM *a; -BIGNUM *b; +BIGNUM *BN_copy(BIGNUM *a, BIGNUM *b) { int i; BN_ULONG *A,*B; @@ -532,8 +518,7 @@ BIGNUM *b; return(a); } -void BN_clear(a) -BIGNUM *a; +void BN_clear(BIGNUM *a) { if (a->d != NULL) memset(a->d,0,a->max*sizeof(a->d[0])); @@ -541,8 +526,7 @@ BIGNUM *a; a->neg=0; } -BN_ULONG BN_get_word(a) -BIGNUM *a; +BN_ULONG BN_get_word(BIGNUM *a) { int i,n; BN_ULONG ret=0; @@ -561,9 +545,7 @@ BIGNUM *a; return(ret); } -int BN_set_word(a,w) -BIGNUM *a; -BN_ULONG w; +int BN_set_word(BIGNUM *a, BN_ULONG w) { int i,n; if (bn_expand(a,sizeof(BN_ULONG)*8) == NULL) return(0); @@ -589,10 +571,7 @@ BN_ULONG w; } /* ignore negative */ -BIGNUM *BN_bin2bn(s, len, ret) -unsigned char *s; -int len; -BIGNUM *ret; +BIGNUM *BN_bin2bn(unsigned char *s, int len, BIGNUM *ret) { unsigned int i,m; unsigned int n; @@ -629,9 +608,7 @@ BIGNUM *ret; } /* ignore negative */ -int BN_bn2bin(a, to) -BIGNUM *a; -unsigned char *to; +int BN_bn2bin(BIGNUM *a, unsigned char *to) { int n,i; BN_ULONG l; @@ -645,9 +622,7 @@ unsigned char *to; return(n); } -int BN_ucmp(a, b) -BIGNUM *a; -BIGNUM *b; +int BN_ucmp(BIGNUM *a, BIGNUM *b) { int i; BN_ULONG t1,t2,*ap,*bp; @@ -669,9 +644,7 @@ BIGNUM *b; return(0); } -int BN_cmp(a, b) -BIGNUM *a; -BIGNUM *b; +int BN_cmp(BIGNUM *a, BIGNUM *b) { int i; int gt,lt; @@ -712,9 +685,7 @@ BIGNUM *b; return(0); } -int BN_set_bit(a, n) -BIGNUM *a; -int n; +int BN_set_bit(BIGNUM *a, int n) { int i,j,k; @@ -732,9 +703,7 @@ int n; return(1); } -int BN_clear_bit(a, n) -BIGNUM *a; -int n; +int BN_clear_bit(BIGNUM *a, int n) { int i,j; @@ -747,9 +716,7 @@ int n; return(1); } -int BN_is_bit_set(a, n) -BIGNUM *a; -int n; +int BN_is_bit_set(BIGNUM *a, int n) { int i,j; @@ -760,9 +727,7 @@ int n; return((a->d[i]&(((BN_ULONG)1)<used-=num; } -int BN_m(r,a,b) -BIGNUM *r,*a,*b; +int BN_m(BIGNUM *r, BIGNUM *a, BIGNUM *b) { static BN_POOL bp; static init=1; @@ -114,9 +110,7 @@ BIGNUM *r,*a,*b; } /* r must be different to a and b */ -int BN_mm(m, A, B, bp) -BIGNUM *m,*A,*B; -BN_POOL *bp; +int BN_mm(BIGNUM *m, BIGNUM *A, BIGNUM *B, BN_POOL *bp) { int i,num; int an,bn; diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index 4ed433e05c..5bdac17e6c 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -68,10 +68,8 @@ #define MONT_WORD -int BN_mod_mul_montgomery(r,a,b,mont,ctx) -BIGNUM *r,*a,*b; -BN_MONT_CTX *mont; -BN_CTX *ctx; +int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_MONT_CTX *mont, + BN_CTX *ctx) { BIGNUM *tmp,*tmp2; @@ -107,11 +105,8 @@ err: return(0); } -int BN_from_montgomery(ret,a,mont,ctx) -BIGNUM *ret; -BIGNUM *a; -BN_MONT_CTX *mont; -BN_CTX *ctx; +int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont, + BN_CTX *ctx) { #ifdef BN_RECURSION_MONT if (mont->use_word) @@ -269,7 +264,7 @@ printf("number BN_from_montgomery\n"); #endif } -BN_MONT_CTX *BN_MONT_CTX_new() +BN_MONT_CTX *BN_MONT_CTX_new(void) { BN_MONT_CTX *ret; @@ -281,8 +276,7 @@ BN_MONT_CTX *BN_MONT_CTX_new() return(ret); } -void BN_MONT_CTX_init(ctx) -BN_MONT_CTX *ctx; +void BN_MONT_CTX_init(BN_MONT_CTX *ctx) { ctx->use_word=0; ctx->ri=0; @@ -292,8 +286,7 @@ BN_MONT_CTX *ctx; ctx->flags=0; } -void BN_MONT_CTX_free(mont) -BN_MONT_CTX *mont; +void BN_MONT_CTX_free(BN_MONT_CTX *mont) { if(mont == NULL) return; @@ -305,10 +298,7 @@ BN_MONT_CTX *mont; Free(mont); } -int BN_MONT_CTX_set(mont,mod,ctx) -BN_MONT_CTX *mont; -BIGNUM *mod; -BN_CTX *ctx; +int BN_MONT_CTX_set(BN_MONT_CTX *mont, BIGNUM *mod, BN_CTX *ctx) { BIGNUM Ri,*R; @@ -402,8 +392,7 @@ err: return(0); } -BN_MONT_CTX *BN_MONT_CTX_copy(to, from) -BN_MONT_CTX *to, *from; +BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from) { if (to == from) return(to); diff --git a/crypto/bn/bn_mpi.c b/crypto/bn/bn_mpi.c index 84b0317081..5d786d7b15 100644 --- a/crypto/bn/bn_mpi.c +++ b/crypto/bn/bn_mpi.c @@ -60,9 +60,7 @@ #include "cryptlib.h" #include "bn_lcl.h" -int BN_bn2mpi(a,d) -BIGNUM *a; -unsigned char *d; +int BN_bn2mpi(BIGNUM *a, unsigned char *d) { int bits; int num=0; @@ -90,10 +88,7 @@ unsigned char *d; return(num+4+ext); } -BIGNUM *BN_mpi2bn(d,n,a) -unsigned char *d; -int n; -BIGNUM *a; +BIGNUM *BN_mpi2bn(unsigned char *d, int n, BIGNUM *a) { long len; int neg=0; diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c index 0af6e96d7a..4b19c9f043 100644 --- a/crypto/bn/bn_mul.c +++ b/crypto/bn/bn_mul.c @@ -71,10 +71,8 @@ * a[0]*b[0]+a[1]*b[1]+(a[0]-a[1])*(b[1]-b[0]) * a[1]*b[1] */ -void bn_mul_recursive(r,a,b,n2,t) -BN_ULONG *r,*a,*b; -int n2; -BN_ULONG *t; +void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, + BN_ULONG *t) { int n=n2/2,c1,c2; unsigned int neg,zero; @@ -217,10 +215,8 @@ printf(" bn_mul_recursive %d * %d\n",n2,n2); /* n+tn is the word length * t needs to be n*4 is size, as does r */ -void bn_mul_part_recursive(r,a,b,tn,n,t) -BN_ULONG *r,*a,*b; -int tn,n; -BN_ULONG *t; +void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn, + int n, BN_ULONG *t) { int i,j,n2=n*2; unsigned int c1; @@ -344,10 +340,8 @@ printf(" bn_mul_part_recursive %d * %d\n",tn+n,tn+n); /* a and b must be the same size, which is n2. * r needs to be n2 words and t needs to be n2*2 */ -void bn_mul_low_recursive(r,a,b,n2,t) -BN_ULONG *r,*a,*b; -int n2; -BN_ULONG *t; +void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, + BN_ULONG *t) { int n=n2/2; @@ -377,10 +371,8 @@ printf(" bn_mul_low_recursive %d * %d\n",n2,n2); * l is the low words of the output. * t needs to be n2*3 */ -void bn_mul_high(r,a,b,l,n2,t) -BN_ULONG *r,*a,*b,*l; -int n2; -BN_ULONG *t; +void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2, + BN_ULONG *t) { int i,n; int c1,c2; @@ -565,9 +557,7 @@ printf(" bn_mul_high %d * %d\n",n2,n2); } #endif -int BN_mul(r,a,b,ctx) -BIGNUM *r,*a,*b; -BN_CTX *ctx; +int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) { int top,al,bl; BIGNUM *rr; @@ -706,11 +696,7 @@ end: return(1); } -void bn_mul_normal(r,a,na,b,nb) -BN_ULONG *r,*a; -int na; -BN_ULONG *b; -int nb; +void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) { BN_ULONG *rr; @@ -746,9 +732,7 @@ printf(" bn_mul_normal %d * %d\n",na,nb); } } -void bn_mul_low_normal(r,a,b,n) -BN_ULONG *r,*a,*b; -int n; +void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n) { #ifdef BN_COUNT printf(" bn_mul_low_normal %d * %d\n",n,n); diff --git a/crypto/bn/bn_opts.c b/crypto/bn/bn_opts.c index 86a03e2423..2d04184c88 100644 --- a/crypto/bn/bn_opts.c +++ b/crypto/bn/bn_opts.c @@ -102,9 +102,7 @@ void do_it(int sec, PARMS *p); #define P_MULH 5 #define P_MRED 6 -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { PARMS p; BN_MONT_CTX *mont; @@ -203,9 +201,7 @@ char **argv; do_it(num,&p); } -void do_it(num,p) -int num; -PARMS *p; +void do_it(int num, PARMS *p) { char *start,*end; int i,j,number; @@ -240,9 +236,7 @@ PARMS *p; } } -int time_it(sec,p) -int sec; -PARMS *p; +int time_it(int sec, PARMS *p) { char *start,*end; int i,j; @@ -279,9 +273,7 @@ PARMS *p; return(i); } -void do_mul_exp(num,p) -int num; -PARMS *p; +void do_mul_exp(int num, PARMS *p) { int i; @@ -290,9 +282,7 @@ PARMS *p; p->ctx,p->mont); } -void do_mul(num,p) -int num; -PARMS *p; +void do_mul(int num, PARMS *p) { int i; @@ -300,9 +290,7 @@ PARMS *p; BN_mul(&(p->r),&(p->a),&(p->b),p->ctx); } -void do_sqr(num,p) -int num; -PARMS *p; +void do_sqr(int num, PARMS *p) { int i; @@ -310,9 +298,7 @@ PARMS *p; BN_sqr(&(p->r),&(p->a),p->ctx); } -void do_mul_low(num,p) -int num; -PARMS *p; +void do_mul_low(int num, PARMS *p) { int i; @@ -320,9 +306,7 @@ PARMS *p; BN_mul_low(&(p->r),&(p->a),&(p->b),p->w,p->ctx); } -void do_mul_high(num,p) -int num; -PARMS *p; +void do_mul_high(int num, PARMS *p) { int i; @@ -330,9 +314,7 @@ PARMS *p; BN_mul_low(&(p->r),&(p->a),&(p->b),&(p->low),p->w,p->ctx); } -void do_from_montgomery(num,p) -int num; -PARMS *p; +void do_from_montgomery(int num, PARMS *p) { int i; diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c index f915b6b46d..bd9900db4d 100644 --- a/crypto/bn/bn_prime.c +++ b/crypto/bn/bn_prime.c @@ -83,14 +83,8 @@ static int probable_prime_dh(); static int probable_prime_dh_strong(); #endif -BIGNUM *BN_generate_prime(ret,bits,strong,add,rem,callback,cb_arg) -BIGNUM *ret; -int bits; -int strong; -BIGNUM *add; -BIGNUM *rem; -void (*callback)(P_I_I_P); -char *cb_arg; +BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int strong, BIGNUM *add, + BIGNUM *rem, void (*callback)(P_I_I_P), char *cb_arg) { BIGNUM *rnd=NULL; BIGNUM t; @@ -165,12 +159,8 @@ err: return(ret); } -int BN_is_prime(a,checks,callback,ctx_passed,cb_arg) -BIGNUM *a; -int checks; -void (*callback)(P_I_I_P); -BN_CTX *ctx_passed; -char *cb_arg; +int BN_is_prime(BIGNUM *a, int checks, void (*callback)(P_I_I_P), + BN_CTX *ctx_passed, char *cb_arg) { int i,j,c2=0,ret= -1; BIGNUM *check; @@ -218,11 +208,8 @@ err: #define RECP_MUL_MOD -static int witness(a,n,ctx,ctx2,mont) -BIGNUM *a; -BIGNUM *n; -BN_CTX *ctx,*ctx2; -BN_MONT_CTX *mont; +static int witness(BIGNUM *a, BIGNUM *n, BN_CTX *ctx, BN_CTX *ctx2, + BN_MONT_CTX *mont) { int k,i,ret= -1,good; BIGNUM *d,*dd,*tmp,*d1,*d2,*n1; @@ -285,9 +272,7 @@ err: return(ret); } -static int probable_prime(rnd, bits) -BIGNUM *rnd; -int bits; +static int probable_prime(BIGNUM *rnd, int bits) { int i; MS_STATIC BN_ULONG mods[NUMPRIMES]; @@ -318,12 +303,8 @@ again: return(1); } -static int probable_prime_dh(rnd, bits, add, rem,ctx) -BIGNUM *rnd; -int bits; -BIGNUM *add; -BIGNUM *rem; -BN_CTX *ctx; +static int probable_prime_dh(BIGNUM *rnd, int bits, BIGNUM *add, BIGNUM *rem, + BN_CTX *ctx) { int i,ret=0; BIGNUM *t1; @@ -358,12 +339,8 @@ err: return(ret); } -static int probable_prime_dh_strong(p, bits, padd, rem,ctx) -BIGNUM *p; -int bits; -BIGNUM *padd; -BIGNUM *rem; -BN_CTX *ctx; +static int probable_prime_dh_strong(BIGNUM *p, int bits, BIGNUM *padd, + BIGNUM *rem, BN_CTX *ctx) { int i,ret=0; BIGNUM *t1,*qadd=NULL,*q=NULL; @@ -412,10 +389,7 @@ err: } #if 0 -static int witness(a, n,ctx) -BIGNUM *a; -BIGNUM *n; -BN_CTX *ctx; +static int witness(BIGNUM *a, BIGNUM *n, BN_CTX *ctx) { int k,i,nb,ret= -1; BIGNUM *d,*dd,*tmp; diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c index c473d6f941..9383ab2ae5 100644 --- a/crypto/bn/bn_print.c +++ b/crypto/bn/bn_print.c @@ -65,8 +65,7 @@ const static char *Hex="0123456789ABCDEF"; /* Must 'Free' the returned data */ -char *BN_bn2hex(a) -BIGNUM *a; +char *BN_bn2hex(BIGNUM *a) { int i,j,v,z=0; char *buf; @@ -101,8 +100,7 @@ err: } /* Must 'Free' the returned data */ -char *BN_bn2dec(a) -BIGNUM *a; +char *BN_bn2dec(BIGNUM *a) { int i=0,num; char *buf=NULL; @@ -156,9 +154,7 @@ err: return(buf); } -int BN_hex2bn(bn,a) -BIGNUM **bn; -char *a; +int BN_hex2bn(BIGNUM **bn, char *a) { BIGNUM *ret=NULL; BN_ULONG l=0; @@ -224,9 +220,7 @@ err: return(0); } -int BN_dec2bn(bn,a) -BIGNUM **bn; -char *a; +int BN_dec2bn(BIGNUM **bn, char *a) { BIGNUM *ret=NULL; BN_ULONG l=0; @@ -286,9 +280,7 @@ err: #ifndef NO_BIO #ifndef NO_FP_API -int BN_print_fp(fp, a) -FILE *fp; -BIGNUM *a; +int BN_print_fp(FILE *fp, BIGNUM *a) { BIO *b; int ret; @@ -302,9 +294,7 @@ BIGNUM *a; } #endif -int BN_print(bp, a) -BIO *bp; -BIGNUM *a; +int BN_print(BIO *bp, BIGNUM *a) { int i,j,v,z=0; int ret=0; diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c index 7b21821fe6..7d6f635b70 100644 --- a/crypto/bn/bn_rand.c +++ b/crypto/bn/bn_rand.c @@ -62,11 +62,7 @@ #include "bn_lcl.h" #include "rand.h" -int BN_rand(rnd, bits, top, bottom) -BIGNUM *rnd; -int bits; -int top; -int bottom; +int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { unsigned char *buf=NULL; int ret=0,bit,bytes,mask; diff --git a/crypto/bn/bn_recp.c b/crypto/bn/bn_recp.c index 3ace566b55..85b4ac8148 100644 --- a/crypto/bn/bn_recp.c +++ b/crypto/bn/bn_recp.c @@ -60,8 +60,7 @@ #include "cryptlib.h" #include "bn_lcl.h" -void BN_RECP_CTX_init(recp) -BN_RECP_CTX *recp; +void BN_RECP_CTX_init(BN_RECP_CTX *recp) { BN_init(&(recp->N)); BN_init(&(recp->Nr)); @@ -69,7 +68,7 @@ BN_RECP_CTX *recp; recp->flags=0; } -BN_RECP_CTX *BN_RECP_CTX_new() +BN_RECP_CTX *BN_RECP_CTX_new(void) { BN_RECP_CTX *ret; @@ -81,8 +80,7 @@ BN_RECP_CTX *BN_RECP_CTX_new() return(ret); } -void BN_RECP_CTX_free(recp) -BN_RECP_CTX *recp; +void BN_RECP_CTX_free(BN_RECP_CTX *recp) { if(recp == NULL) return; @@ -93,10 +91,7 @@ BN_RECP_CTX *recp; Free(recp); } -int BN_RECP_CTX_set(recp,d,ctx) -BN_RECP_CTX *recp; -BIGNUM *d; -BN_CTX *ctx; +int BN_RECP_CTX_set(BN_RECP_CTX *recp, BIGNUM *d, BN_CTX *ctx) { BN_copy(&(recp->N),d); BN_zero(&(recp->Nr)); @@ -105,12 +100,8 @@ BN_CTX *ctx; return(1); } -int BN_mod_mul_reciprocal(r, x, y, recp, ctx) -BIGNUM *r; -BIGNUM *x; -BIGNUM *y; -BN_RECP_CTX *recp; -BN_CTX *ctx; +int BN_mod_mul_reciprocal(BIGNUM *r, BIGNUM *x, BIGNUM *y, BN_RECP_CTX *recp, + BN_CTX *ctx) { int ret=0; BIGNUM *a; @@ -133,12 +124,8 @@ err: return(ret); } -int BN_div_recp(dv,rem,m,recp,ctx) -BIGNUM *dv; -BIGNUM *rem; -BIGNUM *m; -BN_RECP_CTX *recp; -BN_CTX *ctx; +int BN_div_recp(BIGNUM *dv, BIGNUM *rem, BIGNUM *m, BN_RECP_CTX *recp, + BN_CTX *ctx) { int i,j,tos,ret=0,ex; BIGNUM *a,*b,*d,*r; @@ -221,11 +208,7 @@ err: * We actually calculate with an extra word of precision, so * we can do faster division if the remainder is not required. */ -int BN_reciprocal(r,m,len,ctx) -BIGNUM *r; -BIGNUM *m; -int len; -BN_CTX *ctx; +int BN_reciprocal(BIGNUM *r, BIGNUM *m, int len, BN_CTX *ctx) { int ret= -1; BIGNUM t; diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c index 944bf1794b..6dbe77b50f 100644 --- a/crypto/bn/bn_shift.c +++ b/crypto/bn/bn_shift.c @@ -60,9 +60,7 @@ #include "cryptlib.h" #include "bn_lcl.h" -int BN_lshift1(r, a) -BIGNUM *r; -BIGNUM *a; +int BN_lshift1(BIGNUM *r, BIGNUM *a) { register BN_ULONG *ap,*rp,t,c; int i; @@ -94,9 +92,7 @@ BIGNUM *a; return(1); } -int BN_rshift1(r, a) -BIGNUM *r; -BIGNUM *a; +int BN_rshift1(BIGNUM *r, BIGNUM *a) { BN_ULONG *ap,*rp,t,c; int i; @@ -125,10 +121,7 @@ BIGNUM *a; return(1); } -int BN_lshift(r, a, n) -BIGNUM *r; -BIGNUM *a; -int n; +int BN_lshift(BIGNUM *r, BIGNUM *a, int n) { int i,nw,lb,rb; BN_ULONG *t,*f; @@ -160,10 +153,7 @@ int n; return(1); } -int BN_rshift(r, a, n) -BIGNUM *r; -BIGNUM *a; -int n; +int BN_rshift(BIGNUM *r, BIGNUM *a, int n) { int i,j,nw,lb,rb; BN_ULONG *t,*f; diff --git a/crypto/bn/bn_sqr.c b/crypto/bn/bn_sqr.c index bcd9c3b6af..12cce4d7ce 100644 --- a/crypto/bn/bn_sqr.c +++ b/crypto/bn/bn_sqr.c @@ -62,10 +62,7 @@ /* r must not be a */ /* I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 */ -int BN_sqr(r, a, ctx) -BIGNUM *r; -BIGNUM *a; -BN_CTX *ctx; +int BN_sqr(BIGNUM *r, BIGNUM *a, BN_CTX *ctx) { int max,al; BIGNUM *tmp,*rr; @@ -146,11 +143,7 @@ printf("BN_sqr %d * %d\n",a->top,a->top); } /* tmp must have 2*n words */ -void bn_sqr_normal(r, a, n, tmp) -BN_ULONG *r; -BN_ULONG *a; -int n; -BN_ULONG *tmp; +void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp) { int i,j,max; BN_ULONG *ap,*rp; @@ -197,10 +190,7 @@ BN_ULONG *tmp; * a[0]*b[0]+a[1]*b[1]+(a[0]-a[1])*(b[1]-b[0]) * a[1]*b[1] */ -void bn_sqr_recursive(r,a,n2,t) -BN_ULONG *r,*a; -int n2; -BN_ULONG *t; +void bn_sqr_recursive(BN_ULONG *r, BN_ULONG *a, int n2, BN_ULONG *t) { int n=n2/2; int zero,c1; diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c index 9c168e4f48..c0cfbc6797 100644 --- a/crypto/bn/bn_word.c +++ b/crypto/bn/bn_word.c @@ -60,9 +60,7 @@ #include "cryptlib.h" #include "bn_lcl.h" -BN_ULONG BN_mod_word(a, w) -BIGNUM *a; -BN_ULONG w; +BN_ULONG BN_mod_word(BIGNUM *a, BN_ULONG w) { #ifndef BN_LLONG BN_ULONG ret=0; @@ -85,9 +83,7 @@ BN_ULONG w; return((BN_ULONG)ret); } -BN_ULONG BN_div_word(a, w) -BIGNUM *a; -BN_ULONG w; +BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) { BN_ULONG ret; int i; @@ -109,9 +105,7 @@ BN_ULONG w; return(ret); } -int BN_add_word(a, w) -BIGNUM *a; -BN_ULONG w; +int BN_add_word(BIGNUM *a, BN_ULONG w) { BN_ULONG l; int i; @@ -142,9 +136,7 @@ BN_ULONG w; return(1); } -int BN_sub_word(a, w) -BIGNUM *a; -BN_ULONG w; +int BN_sub_word(BIGNUM *a, BN_ULONG w) { int i; @@ -183,9 +175,7 @@ BN_ULONG w; return(1); } -int BN_mul_word(a,w) -BIGNUM *a; -BN_ULONG w; +int BN_mul_word(BIGNUM *a, BN_ULONG w) { BN_ULONG ll; diff --git a/crypto/bn/bnspeed.c b/crypto/bn/bnspeed.c index 777212c1ba..af4ebe7986 100644 --- a/crypto/bn/bnspeed.c +++ b/crypto/bn/bnspeed.c @@ -133,8 +133,7 @@ static double Time_F(); #define START 0 #define STOP 1 -static double Time_F(s) -int s; +static double Time_F(int s) { double ret; #ifdef TIMES @@ -176,9 +175,7 @@ static int sizes[NUM_SIZES]={128,256,512,1024,2048}; void do_mul(BIGNUM *r,BIGNUM *a,BIGNUM *b,BN_CTX *ctx); -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { BN_CTX *ctx; BIGNUM a,b,c; @@ -191,11 +188,7 @@ char **argv; do_mul(&a,&b,&c,ctx); } -void do_mul(r,a,b,ctx) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; -BN_CTX *ctx; +void do_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx) { int i,j,k; double tm; diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c index e84cf250b2..ab93138de8 100644 --- a/crypto/bn/bntest.c +++ b/crypto/bn/bntest.c @@ -112,9 +112,7 @@ static int results=0; #include "bss_file.c" #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { BN_CTX *ctx; BIO *out; @@ -229,8 +227,7 @@ err: return(1); } -int test_add(bp) -BIO *bp; +int test_add(BIO *bp) { BIGNUM a,b,c; int i; @@ -269,8 +266,7 @@ BIO *bp; return(1); } -int test_sub(bp) -BIO *bp; +int test_sub(BIO *bp) { BIGNUM a,b,c; int i; @@ -309,9 +305,7 @@ BIO *bp; return(1); } -int test_div(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_div(BIO *bp, BN_CTX *ctx) { BIGNUM a,b,c,d; int i; @@ -362,9 +356,7 @@ BN_CTX *ctx; return(1); } -int test_div_recp(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_div_recp(BIO *bp, BN_CTX *ctx) { BIGNUM a,b,c,d; BN_RECP_CTX recp; @@ -419,8 +411,7 @@ BN_CTX *ctx; return(1); } -int test_mul(bp) -BIO *bp; +int test_mul(BIO *bp) { BIGNUM a,b,c; int i; @@ -464,9 +455,7 @@ BIO *bp; return(1); } -int test_sqr(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_sqr(BIO *bp, BN_CTX *ctx) { BIGNUM a,c; int i; @@ -501,9 +490,7 @@ BN_CTX *ctx; return(1); } -int test_mont(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_mont(BIO *bp, BN_CTX *ctx) { BIGNUM a,b,c,A,B; BIGNUM n; @@ -563,9 +550,7 @@ BN_num_bits(mont->N)); return(1); } -int test_mod(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_mod(BIO *bp, BN_CTX *ctx) { BIGNUM *a,*b,*c; int i; @@ -604,9 +589,7 @@ BN_CTX *ctx; return(1); } -int test_mod_mul(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_mod_mul(BIO *bp, BN_CTX *ctx) { BIGNUM *a,*b,*c,*d,*e; int i; @@ -660,9 +643,7 @@ BN_CTX *ctx; return(1); } -int test_mod_exp(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_mod_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a,*b,*c,*d,*e; int i; @@ -705,9 +686,7 @@ BN_CTX *ctx; return(1); } -int test_exp(bp,ctx) -BIO *bp; -BN_CTX *ctx; +int test_exp(BIO *bp, BN_CTX *ctx) { BIGNUM *a,*b,*d,*e; int i; @@ -745,8 +724,7 @@ BN_CTX *ctx; return(1); } -int test_lshift(bp) -BIO *bp; +int test_lshift(BIO *bp) { BIGNUM *a,*b,*c; int i; @@ -781,8 +759,7 @@ BIO *bp; return(1); } -int test_lshift1(bp) -BIO *bp; +int test_lshift1(BIO *bp) { BIGNUM *a,*b; int i; @@ -813,8 +790,7 @@ BIO *bp; return(1); } -int test_rshift(bp) -BIO *bp; +int test_rshift(BIO *bp) { BIGNUM *a,*b,*c; int i; @@ -849,8 +825,7 @@ BIO *bp; return(1); } -int test_rshift1(bp) -BIO *bp; +int test_rshift1(BIO *bp) { BIGNUM *a,*b; int i; @@ -881,7 +856,7 @@ BIO *bp; return(1); } -int rand_neg() +int rand_neg(void) { static unsigned int neg=0; static int sign[8]={0,0,0,1,1,0,1,1}; diff --git a/crypto/bn/expspeed.c b/crypto/bn/expspeed.c index fe00373246..7b7652d022 100644 --- a/crypto/bn/expspeed.c +++ b/crypto/bn/expspeed.c @@ -133,8 +133,7 @@ static double Time_F(); #define START 0 #define STOP 1 -static double Time_F(s) -int s; +static double Time_F(int s) { double ret; #ifdef TIMES @@ -177,9 +176,7 @@ static int mul_c[NUM_SIZES]={8*8*8*8*8,8*8*8*8,8*8*8,8*8,8,1}; void do_mul_exp(BIGNUM *r,BIGNUM *a,BIGNUM *b,BIGNUM *c,BN_CTX *ctx); -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { BN_CTX *ctx; BIGNUM *a,*b,*c,*r; @@ -193,12 +190,7 @@ char **argv; do_mul_exp(r,a,b,c,ctx); } -void do_mul_exp(r,a,b,c,ctx) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; -BIGNUM *c; -BN_CTX *ctx; +void do_mul_exp(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *c, BN_CTX *ctx) { int i,k; double tm; diff --git a/crypto/bn/exptest.c b/crypto/bn/exptest.c index 1ec61c2c87..4816344f56 100644 --- a/crypto/bn/exptest.c +++ b/crypto/bn/exptest.c @@ -69,9 +69,7 @@ #define NUM_BITS (BN_BITS*2) -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { BN_CTX *ctx; BIO *out=NULL; diff --git a/crypto/bn/old/b_sqr.c b/crypto/bn/old/b_sqr.c index e1a61b8471..715cb1c8ab 100644 --- a/crypto/bn/old/b_sqr.c +++ b/crypto/bn/old/b_sqr.c @@ -64,10 +64,7 @@ static int bn_mm(BIGNUM *m,BIGNUM *A,BIGNUM *B, BIGNUM *sk,BN_CTX *ctx); /* r must be different to a and b */ /* int BN_mmul(r, a, b) */ -int BN_mul(r, a, b) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; +int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b) { BN_ULONG *ap,*bp,*rp; BIGNUM *sk; @@ -132,10 +129,7 @@ printf("BN_mul(%d,%d)\n",a->top,b->top); #define blbh (sk[1]) /* r must be different to a and b */ -int bn_mm(m, A, B, sk,ctx) -BIGNUM *m,*A,*B; -BIGNUM *sk; -BN_CTX *ctx; +int bn_mm(BIGNUM *m, BIGNUM *A, BIGNUM *B, BIGNUM *sk, BN_CTX *ctx) { int n,num,sqr=0; int an,bn; diff --git a/crypto/bn/old/bn_high.c b/crypto/bn/old/bn_high.c index 90268fb31a..763bcb605b 100644 --- a/crypto/bn/old/bn_high.c +++ b/crypto/bn/old/bn_high.c @@ -15,9 +15,7 @@ int BN_mul_high(BIGNUM *r,BIGNUM *a,BIGNUM *b,BIGNUM *low, int words); #undef t1 #undef t2 -int BN_mul_high(r,a,b,low,words) -BIGNUM *r,*a,*b,*low; -int words; +int BN_mul_high(BIGNUM *r, BIGNUM *a, BIGNUM *b, BIGNUM *low, int words) { int w2,borrow=0,full=0; BIGNUM t1,t2,t3,h,ah,al,bh,bl,m,s0,s1; diff --git a/crypto/bn/old/bn_ka.c b/crypto/bn/old/bn_ka.c index b49a52aa73..378c94dc5a 100644 --- a/crypto/bn/old/bn_ka.c +++ b/crypto/bn/old/bn_ka.c @@ -13,10 +13,8 @@ * a[0]*b[0]+a[1]*b[1]+(a[0]-a[1])*(b[1]-b[0]) * a[1]*b[1] */ -void bn_mul_recursive(r,a,b,n2,t) -BN_ULONG *r,*a,*b; -int n2; -BN_ULONG *t; +void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, + BN_ULONG *t) { int n=n2/2; int neg,zero,c1,c2; @@ -145,10 +143,8 @@ printf(" bn_mul_recursive %d * %d\n",n2,n2); /* n+tn is the word length * t needs to be n*4 is size, as does r */ -void bn_mul_part_recursive(r,a,b,tn,n,t) -BN_ULONG *r,*a,*b; -int tn,n; -BN_ULONG *t; +void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int tn, + int n, BN_ULONG *t) { int n2=n*2,i,j; int c1; @@ -265,10 +261,7 @@ printf(" bn_mul_part_recursive %d * %d\n",tn+n,tn+n); * a[0]*b[0]+a[1]*b[1]+(a[0]-a[1])*(b[1]-b[0]) * a[1]*b[1] */ -void bn_sqr_recursive(r,a,n2,t) -BN_ULONG *r,*a; -int n2; -BN_ULONG *t; +void bn_sqr_recursive(BN_ULONG *r, BN_ULONG *a, int n2, BN_ULONG *t) { int n=n2/2; int zero,c1; @@ -367,10 +360,8 @@ printf(" bn_sqr_recursive %d * %d\n",n2,n2); /* a and b must be the same size, which is n2. * r needs to be n2 words and t needs to be n2*2 */ -void bn_mul_low_recursive(r,a,b,n2,t) -BN_ULONG *r,*a,*b; -int n2; -BN_ULONG *t; +void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, + BN_ULONG *t) { int n=n2/2; @@ -400,10 +391,8 @@ printf(" bn_mul_low_recursive %d * %d\n",n2,n2); * l is the low words of the output. * t needs to be n2*3 */ -void bn_mul_high(r,a,b,l,n2,t) -BN_ULONG *r,*a,*b,*l; -int n2; -BN_ULONG *t; +void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l, int n2, + BN_ULONG *t) { int j,i,n,c1,c2; int neg,oneg,zero; diff --git a/crypto/bn/old/bn_low.c b/crypto/bn/old/bn_low.c index 217c8c2f96..cbc406751c 100644 --- a/crypto/bn/old/bn_low.c +++ b/crypto/bn/old/bn_low.c @@ -65,11 +65,7 @@ static int bn_mm_low(BIGNUM *m,BIGNUM *A,BIGNUM *B, int num, int BN_mul_low(BIGNUM *r, BIGNUM *a, BIGNUM *b,int words); /* r must be different to a and b */ -int BN_mul_low(r, a, b, num) -BIGNUM *r; -BIGNUM *a; -BIGNUM *b; -int num; +int BN_mul_low(BIGNUM *r, BIGNUM *a, BIGNUM *b, int num) { BN_ULONG *ap,*bp,*rp; BIGNUM *sk; @@ -142,11 +138,8 @@ printf("BN_mul_low(%d,%d,%d)\n",a->top,b->top,num); #define t2 (sk[1]) /* r must be different to a and b */ -int bn_mm_low(m, A, B, num, sk,ctx) -BIGNUM *m,*A,*B; -int num; -BIGNUM *sk; -BN_CTX *ctx; +int bn_mm_low(BIGNUM *m, BIGNUM *A, BIGNUM *B, int num, BIGNUM *sk, + BN_CTX *ctx) { int n; /* ,sqr=0; */ int an,bn; diff --git a/crypto/bn/old/bn_m.c b/crypto/bn/old/bn_m.c index 1cf51e8e2a..522beb02bc 100644 --- a/crypto/bn/old/bn_m.c +++ b/crypto/bn/old/bn_m.c @@ -63,8 +63,7 @@ #define limit_bits 5 /* 2^5, or 32 words */ #define limit_num (1<%4d %s\n",ilen,(int)l,(clear)?"clear":"zlib"); return((int)l); } -static int zlib_expand_block(ctx,out,olen,in,ilen) -COMP_CTX *ctx; -unsigned char *out; -unsigned int olen; -unsigned char *in; -unsigned int ilen; +static int zlib_expand_block(COMP_CTX *ctx, unsigned char *out, + unsigned int olen, unsigned char *in, unsigned int ilen) { unsigned long l; int i; @@ -100,11 +92,8 @@ unsigned int ilen; return((int)l); } -static int zz_uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; +static int zz_uncompress (Bytef *dest, uLongf *destLen, const Bytef *source, + uLong sourceLen) { z_stream stream; int err; @@ -137,7 +126,7 @@ static int zz_uncompress (dest, destLen, source, sourceLen) #endif -COMP_METHOD *COMP_zlib() +COMP_METHOD *COMP_zlib(void) { return(&zlib_method); } diff --git a/crypto/comp/comp_err.c b/crypto/comp/comp_err.c index e6881591d4..3202068b0e 100644 --- a/crypto/comp/comp_err.c +++ b/crypto/comp/comp_err.c @@ -63,7 +63,7 @@ #ifndef NO_ERR #endif -void ERR_load__strings() +void ERR_load__strings(void) { static int init=1; diff --git a/crypto/comp/comp_lib.c b/crypto/comp/comp_lib.c index dcacb5557d..dec3b1fc77 100644 --- a/crypto/comp/comp_lib.c +++ b/crypto/comp/comp_lib.c @@ -4,8 +4,7 @@ #include "objects.h" #include "comp.h" -COMP_CTX *COMP_CTX_new(meth) -COMP_METHOD *meth; +COMP_CTX *COMP_CTX_new(COMP_METHOD *meth) { COMP_CTX *ret; @@ -28,8 +27,7 @@ COMP_METHOD *meth; return(ret); } -void COMP_CTX_free(ctx) -COMP_CTX *ctx; +void COMP_CTX_free(COMP_CTX *ctx) { /* CRYPTO_free_ex_data(rsa_meth,(char *)ctx,&ctx->ex_data); */ @@ -42,12 +40,8 @@ COMP_CTX *ctx; Free(ctx); } -int COMP_compress_block(ctx,out,olen,in,ilen) -COMP_CTX *ctx; -unsigned char *out; -int olen; -unsigned char *in; -int ilen; +int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen) { int ret; if (ctx->meth->compress == NULL) @@ -64,12 +58,8 @@ int ilen; return(ret); } -int COMP_expand_block(ctx,out,olen,in,ilen) -COMP_CTX *ctx; -unsigned char *out; -int olen; -unsigned char *in; -int ilen; +int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, + unsigned char *in, int ilen) { int ret; diff --git a/crypto/conf/cnf_save.c b/crypto/conf/cnf_save.c index da2cb84354..632d17e488 100644 --- a/crypto/conf/cnf_save.c +++ b/crypto/conf/cnf_save.c @@ -77,8 +77,7 @@ main() } -void print_conf(cv) -CONF_VALUE *cv; +void print_conf(CONF_VALUE *cv) { int i; CONF_VALUE *v; diff --git a/crypto/conf/conf.c b/crypto/conf/conf.c index 2d7972512c..532cc3ddbb 100644 --- a/crypto/conf/conf.c +++ b/crypto/conf/conf.c @@ -97,10 +97,7 @@ static CONF_VALUE *get_section(); const char *CONF_version="CONF" OPENSSL_VERSION_PTEXT; -LHASH *CONF_load(h,file,line) -LHASH *h; -char *file; -long *line; +LHASH *CONF_load(LHASH *h, char *file, long *line) { LHASH *ret=NULL; FILE *in=NULL; @@ -352,10 +349,7 @@ err: return(NULL); } -char *CONF_get_string(conf,section,name) -LHASH *conf; -char *section; -char *name; +char *CONF_get_string(LHASH *conf, char *section, char *name) { CONF_VALUE *v,vv; char *p; @@ -387,9 +381,7 @@ char *name; return(Getenv(name)); } -static CONF_VALUE *get_section(conf,section) -LHASH *conf; -char *section; +static CONF_VALUE *get_section(LHASH *conf, char *section) { CONF_VALUE *v,vv; @@ -400,9 +392,7 @@ char *section; return(v); } -STACK *CONF_get_section(conf,section) -LHASH *conf; -char *section; +STACK *CONF_get_section(LHASH *conf, char *section) { CONF_VALUE *v; @@ -413,10 +403,7 @@ char *section; return(NULL); } -long CONF_get_number(conf,section,name) -LHASH *conf; -char *section; -char *name; +long CONF_get_number(LHASH *conf, char *section, char *name) { char *str; long ret=0; @@ -433,8 +420,7 @@ char *name; } } -void CONF_free(conf) -LHASH *conf; +void CONF_free(LHASH *conf) { if (conf == NULL) return; @@ -449,9 +435,7 @@ LHASH *conf; lh_free(conf); } -static void value_free_hash(a,conf) -CONF_VALUE *a; -LHASH *conf; +static void value_free_hash(CONF_VALUE *a, LHASH *conf) { if (a->name != NULL) { @@ -459,9 +443,7 @@ LHASH *conf; } } -static void value_free_stack(a,conf) -CONF_VALUE *a; -LHASH *conf; +static void value_free_stack(CONF_VALUE *a, LHASH *conf) { CONF_VALUE *vv; STACK *sk; @@ -482,8 +464,7 @@ LHASH *conf; Free(a); } -static void clear_comments(p) -char *p; +static void clear_comments(char *p) { char *to; @@ -512,10 +493,7 @@ char *p; } } -static int str_copy(conf,section,pto,from) -LHASH *conf; -char *section; -char **pto,*from; +static int str_copy(LHASH *conf, char *section, char **pto, char *from) { int q,r,rr=0,to=0,len=0; char *s,*e,*rp,*p,*rrp,*np,*cp,v; @@ -629,16 +607,14 @@ err: return(0); } -static char *eat_ws(p) -char *p; +static char *eat_ws(char *p) { while (IS_WS(*p) && (!IS_EOF(*p))) p++; return(p); } -static char *eat_alpha_numeric(p) -char *p; +static char *eat_alpha_numeric(char *p) { for (;;) { @@ -653,14 +629,12 @@ char *p; } } -static unsigned long hash(v) -CONF_VALUE *v; +static unsigned long hash(CONF_VALUE *v) { return((lh_strhash(v->section)<<2)^lh_strhash(v->name)); } -static int cmp(a,b) -CONF_VALUE *a,*b; +static int cmp(CONF_VALUE *a, CONF_VALUE *b) { int i; @@ -681,8 +655,7 @@ CONF_VALUE *a,*b; return((a->name == NULL)?-1:1); } -static char *scan_quote(p) -char *p; +static char *scan_quote(char *p) { int q= *p; @@ -700,9 +673,7 @@ char *p; return(p); } -static CONF_VALUE *new_section(conf,section) -LHASH *conf; -char *section; +static CONF_VALUE *new_section(LHASH *conf, char *section) { STACK *sk=NULL; int ok=0,i; diff --git a/crypto/conf/conf_err.c b/crypto/conf/conf_err.c index c6929b99c5..ec4ab140a6 100644 --- a/crypto/conf/conf_err.c +++ b/crypto/conf/conf_err.c @@ -80,7 +80,7 @@ static ERR_STRING_DATA CONF_str_reasons[]= #endif -void ERR_load_CONF_strings() +void ERR_load_CONF_strings(void) { static int init=1; diff --git a/crypto/cpt_err.c b/crypto/cpt_err.c index 27652fca40..bea3274e3f 100644 --- a/crypto/cpt_err.c +++ b/crypto/cpt_err.c @@ -71,7 +71,7 @@ static ERR_STRING_DATA CRYPTO_str_functs[]= #endif -void ERR_load_CRYPTO_strings() +void ERR_load_CRYPTO_strings(void) { static int init=1; diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 920ff184e2..3285813a13 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -106,8 +106,7 @@ static int (MS_FAR *add_lock_callback)()=NULL; static unsigned long (MS_FAR *id_callback)()=NULL; #endif -int CRYPTO_get_new_lockid(name) -char *name; +int CRYPTO_get_new_lockid(char *name) { char *str; int i; @@ -164,13 +163,12 @@ unsigned long (*CRYPTO_get_id_callback(P_V))(P_V) return(id_callback); } -void CRYPTO_set_id_callback(func) -unsigned long (*func)(P_V); +void CRYPTO_set_id_callback(func) unsigned long (*func)(P_V); { id_callback=func; } -unsigned long CRYPTO_thread_id() +unsigned long CRYPTO_thread_id(void) { unsigned long ret=0; @@ -191,11 +189,7 @@ unsigned long CRYPTO_thread_id() return(ret); } -void CRYPTO_lock(mode,type,file,line) -int mode; -int type; -const char *file; -int line; +void CRYPTO_lock(int mode, int type, const char *file, int line) { #ifdef LOCK_DEBUG { @@ -224,12 +218,8 @@ int line; locking_callback(mode,type,file,line); } -int CRYPTO_add_lock(pointer,amount,type,file,line) -int *pointer; -int amount; -int type; -const char *file; -int line; +int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, + int line) { int ret; @@ -267,8 +257,7 @@ int line; return(ret); } -const char *CRYPTO_get_lock_name(type) -int type; +const char *CRYPTO_get_lock_name(int type) { if (type < 0) return("ERROR"); @@ -286,10 +275,8 @@ int type; /* All we really need to do is remove the 'error' state when a thread * detaches */ -BOOL WINAPI DLLEntryPoint(hinstDLL,fdwReason,lpvReserved) -HINSTANCE hinstDLL; -DWORD fdwReason; -LPVOID lpvReserved; +BOOL WINAPI DLLEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, + LPVOID lpvReserved) { switch(fdwReason) { diff --git a/crypto/cversion.c b/crypto/cversion.c index 3933a0c37a..8d18a95dfc 100644 --- a/crypto/cversion.c +++ b/crypto/cversion.c @@ -62,8 +62,7 @@ #include "crypto.h" #include "date.h" -const char *SSLeay_version(t) -int t; +const char *SSLeay_version(int t) { if (t == SSLEAY_VERSION) return OPENSSL_VERSION_TEXT; @@ -103,7 +102,7 @@ int t; return("not available"); } -unsigned long SSLeay() +unsigned long SSLeay(void) { return(SSLEAY_VERSION_NUMBER); } diff --git a/crypto/des/cbc3_enc.c b/crypto/des/cbc3_enc.c index 92a78b05d6..50ed156c7a 100644 --- a/crypto/des/cbc3_enc.c +++ b/crypto/des/cbc3_enc.c @@ -59,15 +59,9 @@ #include "des_locl.h" /* HAS BUGS? DON'T USE - this is only present for use in des.c */ -void des_3cbc_encrypt(input, output, length, ks1, ks2, iv1, iv2, enc) -des_cblock (*input); -des_cblock (*output); -long length; -des_key_schedule ks1; -des_key_schedule ks2; -des_cblock (*iv1); -des_cblock (*iv2); -int enc; +void des_3cbc_encrypt(des_cblock (*input), des_cblock (*output), long length, + des_key_schedule ks1, des_key_schedule ks2, des_cblock (*iv1), + des_cblock (*iv2), int enc) { int off=((int)length-1)/8; long l8=((length+7)/8)*8; diff --git a/crypto/des/cbc_cksm.c b/crypto/des/cbc_cksm.c index b7048c8a3f..aeb0a79df9 100644 --- a/crypto/des/cbc_cksm.c +++ b/crypto/des/cbc_cksm.c @@ -58,12 +58,8 @@ #include "des_locl.h" -DES_LONG des_cbc_cksum(in, out, length, schedule, iv) -const unsigned char *in; -des_cblock out; -long length; -des_key_schedule schedule; -const des_cblock iv; +DES_LONG des_cbc_cksum(const unsigned char *in, des_cblock out, long length, + des_key_schedule schedule, const des_cblock iv) { register DES_LONG tout0,tout1,tin0,tin1; register long l=length; diff --git a/crypto/des/cbc_enc.c b/crypto/des/cbc_enc.c index 96939f34df..c989a7fd34 100644 --- a/crypto/des/cbc_enc.c +++ b/crypto/des/cbc_enc.c @@ -60,13 +60,8 @@ /* Note that this is inconsistent with other DES functions, in that it doesn't update ivec */ -void des_cbc_encrypt(in, out, length, schedule, ivec, enc) -const unsigned char *in; -unsigned char *out; -long length; -des_key_schedule schedule; -des_cblock ivec; -int enc; +void des_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, + des_key_schedule schedule, des_cblock ivec, int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; diff --git a/crypto/des/cfb64ede.c b/crypto/des/cfb64ede.c index f19a55ef52..1f936fa74b 100644 --- a/crypto/des/cfb64ede.c +++ b/crypto/des/cfb64ede.c @@ -63,14 +63,9 @@ * 64bit block we have used is contained in *num; */ -void des_ede3_cfb64_encrypt(in, out, length, ks1,ks2,ks3, ivec, num, enc) -const unsigned char *in; -unsigned char *out; -long length; -des_key_schedule ks1,ks2,ks3; -des_cblock ivec; -int *num; -int enc; +void des_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, des_key_schedule ks1, des_key_schedule ks2, + des_key_schedule ks3, des_cblock ivec, int *num, int enc) { register DES_LONG v0,v1; register long l=length; @@ -137,14 +132,9 @@ int enc; } #ifdef undef /* MACRO */ -void des_ede2_cfb64_encrypt(in, out, length, ks1,ks2, ivec, num, enc) -unsigned char *in; -unsigned char *out; -long length; -des_key_schedule ks1,ks2; -des_cblock (*ivec); -int *num; -int enc; +void des_ede2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + des_key_schedule ks1, des_key_schedule ks2, des_cblock (*ivec), + int *num, int enc) { des_ede3_cfb64_encrypt(in,out,length,ks1,ks2,ks1,ivec,num,enc); } diff --git a/crypto/des/cfb64enc.c b/crypto/des/cfb64enc.c index 9434ddad9e..e2525a781a 100644 --- a/crypto/des/cfb64enc.c +++ b/crypto/des/cfb64enc.c @@ -63,14 +63,9 @@ * 64bit block we have used is contained in *num; */ -void des_cfb64_encrypt(in, out, length, schedule, ivec, num, enc) -const unsigned char *in; -unsigned char *out; -long length; -des_key_schedule schedule; -des_cblock ivec; -int *num; -int enc; +void des_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, des_key_schedule schedule, des_cblock ivec, int *num, + int enc) { register DES_LONG v0,v1; register long l=length; diff --git a/crypto/des/cfb_enc.c b/crypto/des/cfb_enc.c index df0c65ee82..12c1d5e500 100644 --- a/crypto/des/cfb_enc.c +++ b/crypto/des/cfb_enc.c @@ -64,14 +64,8 @@ * the second. The second 12 bits will come from the 3rd and half the 4th * byte. */ -void des_cfb_encrypt(in, out, numbits, length, schedule, ivec, enc) -const unsigned char *in; -unsigned char *out; -int numbits; -long length; -des_key_schedule schedule; -des_cblock ivec; -int enc; +void des_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, + long length, des_key_schedule schedule, des_cblock ivec, int enc) { register DES_LONG d0,d1,v0,v1,n=(numbits+7)/8; register DES_LONG mask0,mask1; diff --git a/crypto/des/des.c b/crypto/des/des.c index 9b47cb3465..7dc3b565ba 100644 --- a/crypto/des/des.c +++ b/crypto/des/des.c @@ -138,9 +138,7 @@ char cksumname[200]=""; int vflag,cflag,eflag,dflag,kflag,bflag,fflag,sflag,uflag,flag3,hflag,error; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int i; struct stat ins,outs; @@ -331,7 +329,7 @@ char **argv; EXIT(0); } -void usage() +void usage(void) { char **u; static const char *Usage[]={ @@ -369,7 +367,7 @@ NULL EXIT(1); } -void doencryption() +void doencryption(void) { #ifdef _LIBC extern int srandom(); @@ -696,15 +694,8 @@ problems: if (Exit) EXIT(Exit); } -int uufwrite(data, size, num, fp) -unsigned char *data; -int size; -unsigned int num; -FILE *fp; - - /* We ignore this parameter but it should be > ~50 I believe */ - - +/* We ignore this parameter but it should be > ~50 I believe */ +int uufwrite(unsigned char *data, int size, unsigned int num, FILE *fp) { int i,j,left,rem,ret=num; static int start=1; @@ -757,8 +748,7 @@ FILE *fp; return(ret); } -void uufwriteEnd(fp) -FILE *fp; +void uufwriteEnd(FILE *fp) { int j; static const char *end=" \nend\n"; @@ -774,11 +764,8 @@ FILE *fp; fwrite(end,1,strlen(end),fp); } -int uufread(out, size, num, fp) -unsigned char *out; -int size; /* should always be > ~ 60; I actually ignore this parameter :-) */ -unsigned int num; -FILE *fp; +/* int size: should always be > ~ 60; I actually ignore this parameter :-) */ +int uufread(unsigned char *out, int size, unsigned int num, FILE *fp) { int i,j,tot; static int done=0; @@ -850,10 +837,7 @@ FILE *fp; *((c)++)=(unsigned char)(((l) )&0xff)) -int uuencode(in, num, out) -unsigned char *in; -int num; -unsigned char *out; +int uuencode(unsigned char *in, int num, unsigned char *out) { int j,i,n,tot=0; DES_LONG l; @@ -883,10 +867,7 @@ unsigned char *out; return(tot); } -int uudecode(in, num, out) -unsigned char *in; -int num; -unsigned char *out; +int uudecode(unsigned char *in, int num, unsigned char *out) { int j,i,k; unsigned int n=0,space=0; diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c index 935e83ff8e..a0ecfbc6ec 100644 --- a/crypto/des/des_enc.c +++ b/crypto/des/des_enc.c @@ -58,10 +58,7 @@ #include "des_locl.h" -void des_encrypt(data, ks, enc) -DES_LONG *data; -des_key_schedule ks; -int enc; +void des_encrypt(DES_LONG *data, des_key_schedule ks, int enc) { register DES_LONG l,r,t,u; #ifdef DES_PTR @@ -159,10 +156,7 @@ int enc; l=r=t=u=0; } -void des_encrypt2(data, ks, enc) -DES_LONG *data; -des_key_schedule ks; -int enc; +void des_encrypt2(DES_LONG *data, des_key_schedule ks, int enc) { register DES_LONG l,r,t,u; #ifdef DES_PTR @@ -253,11 +247,8 @@ int enc; l=r=t=u=0; } -void des_encrypt3(data,ks1,ks2,ks3) -DES_LONG *data; -des_key_schedule ks1; -des_key_schedule ks2; -des_key_schedule ks3; +void des_encrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, + des_key_schedule ks3) { register DES_LONG l,r; @@ -276,11 +267,8 @@ des_key_schedule ks3; data[1]=r; } -void des_decrypt3(data,ks1,ks2,ks3) -DES_LONG *data; -des_key_schedule ks1; -des_key_schedule ks2; -des_key_schedule ks3; +void des_decrypt3(DES_LONG *data, des_key_schedule ks1, des_key_schedule ks2, + des_key_schedule ks3) { register DES_LONG l,r; @@ -301,13 +289,8 @@ des_key_schedule ks3; #ifndef DES_DEFAULT_OPTIONS -void des_ncbc_encrypt(in, out, length, schedule, ivec, enc) -const unsigned char *in; -unsigned char *out; -long length; -des_key_schedule schedule; -des_cblock ivec; -int enc; +void des_ncbc_encrypt(const unsigned char *in, unsigned char *out, long length, + des_key_schedule schedule, des_cblock ivec, int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; @@ -380,15 +363,9 @@ int enc; tin[0]=tin[1]=0; } -void des_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, enc) -const unsigned char *input; -unsigned char *output; -long length; -des_key_schedule ks1; -des_key_schedule ks2; -des_key_schedule ks3; -des_cblock ivec; -int enc; +void des_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, + long length, des_key_schedule ks1, des_key_schedule ks2, + des_key_schedule ks3, des_cblock ivec, int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; diff --git a/crypto/des/des_opts.c b/crypto/des/des_opts.c index 29d9461d29..7ef05c1876 100644 --- a/crypto/des/des_opts.c +++ b/crypto/des/des_opts.c @@ -353,8 +353,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -367,8 +366,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -426,9 +424,7 @@ int s; fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \ tm[index]*8,1.0e6/tm[index]); -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/des/destest.c b/crypto/des/destest.c index a2e4d13f4b..fb69b123d5 100644 --- a/crypto/des/destest.c +++ b/crypto/des/destest.c @@ -313,9 +313,7 @@ static int cfb64_test(); static int ede_cfb64_test(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,j,err=0; des_cblock in,out,outin,iv3,iv2; @@ -794,8 +792,7 @@ plain[8+4], plain[8+5], plain[8+6], plain[8+7]); return(0); } -static char *pt(p) -unsigned char *p; +static char *pt(unsigned char *p) { static char bufs[10][20]; static int bnum=0; @@ -816,9 +813,7 @@ unsigned char *p; #ifndef LIBDES_LIT -static int cfb_test(bits, cfb_cipher) -int bits; -unsigned char *cfb_cipher; +static int cfb_test(int bits, unsigned char *cfb_cipher) { des_key_schedule ks; int i,err=0; @@ -847,8 +842,7 @@ unsigned char *cfb_cipher; return(err); } -static int cfb64_test(cfb_cipher) -unsigned char *cfb_cipher; +static int cfb64_test(unsigned char *cfb_cipher) { des_key_schedule ks; int err=0,i,n; @@ -881,8 +875,7 @@ unsigned char *cfb_cipher; return(err); } -static int ede_cfb64_test(cfb_cipher) -unsigned char *cfb_cipher; +static int ede_cfb64_test(unsigned char *cfb_cipher) { des_key_schedule ks; int err=0,i,n; diff --git a/crypto/des/ecb3_enc.c b/crypto/des/ecb3_enc.c index 7a0dfd6dd3..16e784fe80 100644 --- a/crypto/des/ecb3_enc.c +++ b/crypto/des/ecb3_enc.c @@ -58,13 +58,9 @@ #include "des_locl.h" -void des_ecb3_encrypt(in, out, ks1, ks2, ks3, enc) -const unsigned char *in; -unsigned char *out; -des_key_schedule ks1; -des_key_schedule ks2; -des_key_schedule ks3; -int enc; +void des_ecb3_encrypt(const unsigned char *in, unsigned char *out, + des_key_schedule ks1, des_key_schedule ks2, des_key_schedule ks3, + int enc) { register DES_LONG l0,l1; DES_LONG ll[2]; diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c index 573a9f6bc9..6c0e5a4106 100644 --- a/crypto/des/ecb_enc.c +++ b/crypto/des/ecb_enc.c @@ -103,11 +103,8 @@ const char *des_options(void) } -void des_ecb_encrypt(in, out, ks, enc) -const des_cblock in; -des_cblock out; -des_key_schedule ks; -int enc; +void des_ecb_encrypt(const des_cblock in, des_cblock out, des_key_schedule ks, + int enc) { register DES_LONG l; DES_LONG ll[2]; diff --git a/crypto/des/ede_cbcm_enc.c b/crypto/des/ede_cbcm_enc.c index caaf6dacce..82ef96188c 100644 --- a/crypto/des/ede_cbcm_enc.c +++ b/crypto/des/ede_cbcm_enc.c @@ -70,16 +70,9 @@ http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-get.cgi/1998/CS/CS0928.ps.gz #include "des_locl.h" -void des_ede3_cbcm_encrypt(in, out, length, ks1, ks2, ks3, ivec1, ivec2, enc) -const unsigned char *in; -unsigned char *out; -long length; -des_key_schedule ks1; -des_key_schedule ks2; -des_key_schedule ks3; -des_cblock ivec1; -des_cblock ivec2; -int enc; +void des_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out, + long length, des_key_schedule ks1, des_key_schedule ks2, + des_key_schedule ks3, des_cblock ivec1, des_cblock ivec2, int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1,m0,m1; diff --git a/crypto/des/ede_enc.c b/crypto/des/ede_enc.c index 9f75dd1037..2d3ceae198 100644 --- a/crypto/des/ede_enc.c +++ b/crypto/des/ede_enc.c @@ -58,15 +58,9 @@ #include "des_locl.h" -void des_ede3_cbc_encrypt(input, output, length, ks1, ks2, ks3, ivec, enc) -des_cblock (*input); -des_cblock (*output); -long length; -des_key_schedule ks1; -des_key_schedule ks2; -des_key_schedule ks3; -des_cblock (*ivec); -int enc; +void des_ede3_cbc_encrypt(des_cblock (*input), des_cblock (*output), + long length, des_key_schedule ks1, des_key_schedule ks2, + des_key_schedule ks3, des_cblock (*ivec), int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; @@ -175,14 +169,9 @@ int enc; } #ifdef undef /* MACRO */ -void des_ede2_cbc_encrypt(input, output, length, ks1, ks2, ivec, enc) -des_cblock (*input); -des_cblock (*output); -long length; -des_key_schedule ks1; -des_key_schedule ks2; -des_cblock (*ivec); -int enc; +void des_ede2_cbc_encrypt(des_cblock (*input), des_cblock (*output), + long length, des_key_schedule ks1, des_key_schedule ks2, + des_cblock (*ivec), int enc) { des_ede3_cbc_encrypt(input,output,length,ks1,ks2,ks1,ivec,enc); } diff --git a/crypto/des/enc_read.c b/crypto/des/enc_read.c index 3e5ac09875..a33e2496b4 100644 --- a/crypto/des/enc_read.c +++ b/crypto/des/enc_read.c @@ -84,12 +84,8 @@ int des_rw_mode=DES_PCBC_MODE; */ -int des_enc_read(fd, buf, len, sched, iv) -int fd; -char *buf; -int len; -des_key_schedule sched; -des_cblock iv; +int des_enc_read(int fd, char *buf, int len, des_key_schedule sched, + des_cblock iv) { /* data to be unencrypted */ int net_num=0; diff --git a/crypto/des/enc_writ.c b/crypto/des/enc_writ.c index d40dc273c0..238c0a9c09 100644 --- a/crypto/des/enc_writ.c +++ b/crypto/des/enc_writ.c @@ -76,12 +76,8 @@ * - This code cannot handle non-blocking sockets. */ -int des_enc_write(fd, buf, len, sched, iv) -int fd; -const char *buf; -int len; -des_key_schedule sched; -des_cblock iv; +int des_enc_write(int fd, const char *buf, int len, des_key_schedule sched, + des_cblock iv) { #ifdef _LIBC extern int srandom(); diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c index e276a08653..87fe923eb3 100644 --- a/crypto/des/fcrypt.c +++ b/crypto/des/fcrypt.c @@ -70,12 +70,9 @@ char *crypt(); #endif #if defined(PERL5) || defined(__FreeBSD__) -char *des_crypt(buf,salt) +char *des_crypt(const char *buf, const char *salt) #else -char *crypt(buf,salt) -#endif -const char *buf; -const char *salt; +char *crypt(const char *buf, const char *salt) { static char buff[14]; @@ -83,10 +80,7 @@ const char *salt; } -char *des_fcrypt(buf,salt,ret) -const char *buf; -const char *salt; -char *ret; +char *des_fcrypt(const char *buf, const char *salt, char *ret) { unsigned int i,j,x,y; DES_LONG Eswap0,Eswap1; diff --git a/crypto/des/fcrypt_b.c b/crypto/des/fcrypt_b.c index 2197b98bf1..9cbea97c1f 100644 --- a/crypto/des/fcrypt_b.c +++ b/crypto/des/fcrypt_b.c @@ -77,11 +77,8 @@ #define HPERM_OP(a,t,n,m) ((t)=((((a)<<(16-(n)))^(a))&(m)),\ (a)=(a)^(t)^(t>>(16-(n))))\ -void fcrypt_body(out, ks, Eswap0, Eswap1) -DES_LONG *out; -des_key_schedule ks; -DES_LONG Eswap0; -DES_LONG Eswap1; +void fcrypt_body(DES_LONG *out, des_key_schedule ks, DES_LONG Eswap0, + DES_LONG Eswap1) { register DES_LONG l,r,t,u; #ifdef DES_PTR diff --git a/crypto/des/ncbc_enc.c b/crypto/des/ncbc_enc.c index 1d1a368c22..a13e4fc22b 100644 --- a/crypto/des/ncbc_enc.c +++ b/crypto/des/ncbc_enc.c @@ -58,13 +58,8 @@ #include "des_locl.h" -void des_ncbc_encrypt(input, output, length, schedule, ivec, enc) -des_cblock (*input); -des_cblock (*output); -long length; -des_key_schedule schedule; -des_cblock (*ivec); -int enc; +void des_ncbc_encrypt(des_cblock (*input), des_cblock (*output), long length, + des_key_schedule schedule, des_cblock (*ivec), int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; diff --git a/crypto/des/ofb64ede.c b/crypto/des/ofb64ede.c index 1fa20e6acf..36245de793 100644 --- a/crypto/des/ofb64ede.c +++ b/crypto/des/ofb64ede.c @@ -62,13 +62,9 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void des_ede3_ofb64_encrypt(in, out, length, k1,k2,k3, ivec, num) -register const unsigned char *in; -register unsigned char *out; -long length; -des_key_schedule k1,k2,k3; -des_cblock ivec; -int *num; +void des_ede3_ofb64_encrypt(register const unsigned char *in, + register unsigned char *out, long length, des_key_schedule k1, + des_key_schedule k2, des_key_schedule k3, des_cblock ivec, int *num) { register DES_LONG v0,v1; register int n= *num; @@ -118,13 +114,9 @@ int *num; } #ifdef undef /* MACRO */ -void des_ede2_ofb64_encrypt(in, out, length, k1,k2, ivec, num) -register unsigned char *in; -register unsigned char *out; -long length; -des_key_schedule k1,k2; -des_cblock (*ivec); -int *num; +void des_ede2_ofb64_encrypt(register unsigned char *in, + register unsigned char *out, long length, des_key_schedule k1, + des_key_schedule k2, des_cblock (*ivec), int *num) { des_ede3_ofb64_encrypt(in, out, length, k1,k2,k1, ivec, num); } diff --git a/crypto/des/ofb64enc.c b/crypto/des/ofb64enc.c index b6a2f639eb..545c749c55 100644 --- a/crypto/des/ofb64enc.c +++ b/crypto/des/ofb64enc.c @@ -62,13 +62,9 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void des_ofb64_encrypt(in, out, length, schedule, ivec, num) -register const unsigned char *in; -register unsigned char *out; -long length; -des_key_schedule schedule; -des_cblock ivec; -int *num; +void des_ofb64_encrypt(register const unsigned char *in, + register unsigned char *out, long length, des_key_schedule schedule, + des_cblock ivec, int *num) { register DES_LONG v0,v1,t; register int n= *num; diff --git a/crypto/des/ofb_enc.c b/crypto/des/ofb_enc.c index 75b32f06da..9ee221ea8f 100644 --- a/crypto/des/ofb_enc.c +++ b/crypto/des/ofb_enc.c @@ -64,13 +64,8 @@ * the second. The second 12 bits will come from the 3rd and half the 4th * byte. */ -void des_ofb_encrypt(in, out, numbits, length, schedule, ivec) -const unsigned char *in; -unsigned char *out; -int numbits; -long length; -des_key_schedule schedule; -des_cblock ivec; +void des_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits, + long length, des_key_schedule schedule, des_cblock ivec) { register DES_LONG d0,d1,vv0,vv1,v0,v1,n=(numbits+7)/8; register DES_LONG mask0,mask1; diff --git a/crypto/des/pcbc_enc.c b/crypto/des/pcbc_enc.c index 2d5bb40e5f..1880217560 100644 --- a/crypto/des/pcbc_enc.c +++ b/crypto/des/pcbc_enc.c @@ -58,13 +58,8 @@ #include "des_locl.h" -void des_pcbc_encrypt(input, output, length, schedule, ivec, enc) -const unsigned char *input; -unsigned char *output; -long length; -des_key_schedule schedule; -des_cblock ivec; -int enc; +void des_pcbc_encrypt(const unsigned char *input, unsigned char *output, + long length, des_key_schedule schedule, des_cblock ivec, int enc) { register DES_LONG sin0,sin1,xor0,xor1,tout0,tout1; DES_LONG tin[2]; diff --git a/crypto/des/qud_cksm.c b/crypto/des/qud_cksm.c index d5e38c952f..09797f2257 100644 --- a/crypto/des/qud_cksm.c +++ b/crypto/des/qud_cksm.c @@ -73,12 +73,8 @@ /* Got the value MIT uses via brute force :-) 2/10/90 eay */ #define NOISE ((DES_LONG)83653421L) -DES_LONG des_quad_cksum(input, output, length, out_count, seed) -const unsigned char *input; -des_cblocks output; -long length; -int out_count; -des_cblock seed; +DES_LONG des_quad_cksum(const unsigned char *input, des_cblocks output, + long length, int out_count, des_cblock seed) { DES_LONG z0,z1,t0,t1; int i; diff --git a/crypto/des/rand_key.c b/crypto/des/rand_key.c index 8259f1a849..00db2bef77 100644 --- a/crypto/des/rand_key.c +++ b/crypto/des/rand_key.c @@ -62,15 +62,13 @@ static int seed=0; static des_cblock init; -void des_random_seed(key) -des_cblock key; +void des_random_seed(des_cblock key) { memcpy(init,key,sizeof(des_cblock)); seed=1; } -void des_random_key(ret) -unsigned char *ret; +void des_random_key(unsigned char *ret) { des_key_schedule ks; static DES_LONG c=0; diff --git a/crypto/des/read2pwd.c b/crypto/des/read2pwd.c index 440173afdc..1534f79e65 100644 --- a/crypto/des/read2pwd.c +++ b/crypto/des/read2pwd.c @@ -58,10 +58,7 @@ #include "des_locl.h" -int des_read_password(key, prompt, verify) -des_cblock key; -const char *prompt; -int verify; +int des_read_password(des_cblock key, const char *prompt, int verify) { int ok; char buf[BUFSIZ],buff[BUFSIZ]; @@ -73,11 +70,8 @@ int verify; return(ok); } -int des_read_2passwords(key1, key2, prompt, verify) -des_cblock key1; -des_cblock key2; -const char *prompt; -int verify; +int des_read_2passwords(des_cblock key1, des_cblock key2, const char *prompt, + int verify) { int ok; char buf[BUFSIZ],buff[BUFSIZ]; diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c index ac6a548fc3..b44b937a49 100644 --- a/crypto/des/read_pwd.c +++ b/crypto/des/read_pwd.c @@ -198,11 +198,8 @@ static int noecho_fgets(); #endif static jmp_buf save; -int des_read_pw_string(buf, length, prompt, verify) -char *buf; -int length; -const char *prompt; -int verify; +int des_read_pw_string(char *buf, int length, const char *prompt, + int verify) { char buff[BUFSIZ]; int ret; @@ -214,8 +211,7 @@ int verify; #ifndef WIN16 -static void read_till_nl(in) -FILE *in; +static void read_till_nl(FILE *in) { #define SIZE 4 char buf[SIZE+1]; @@ -227,12 +223,8 @@ FILE *in; /* return 0 if ok, 1 (or -1) otherwise */ -int des_read_pw(buf, buff, size, prompt, verify) -char *buf; -char *buff; -int size; -const char *prompt; -int verify; +int des_read_pw(char *buf, char *buff, int size, const char *prompt, + int verify) { #ifdef VMS struct IOSB iosb; @@ -382,12 +374,7 @@ error: #else /* WIN16 */ -int des_read_pw(buf, buff, size, prompt, verify) -char *buf; -char *buff; -int size; -char *prompt; -int verify; +int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify) { memset(buf,0,size); memset(buff,0,size); @@ -396,7 +383,7 @@ int verify; #endif -static void pushsig() +static void pushsig(void) { int i; #ifdef SIGACTION @@ -428,7 +415,7 @@ static void pushsig() #endif } -static void popsig() +static void popsig(void) { int i; @@ -450,8 +437,7 @@ static void popsig() } } -static void recsig(i) -int i; +static void recsig(int i) { longjmp(save,1); #ifdef LINT @@ -460,10 +446,7 @@ int i; } #if defined(MSDOS) && !defined(WIN16) -static int noecho_fgets(buf,size,tty) -char *buf; -int size; -FILE *tty; +static int noecho_fgets(char *buf, int size, FILE *tty) { int i; char *p; diff --git a/crypto/des/rpc_enc.c b/crypto/des/rpc_enc.c index 9c1dbb29f2..51f560a84f 100644 --- a/crypto/des/rpc_enc.c +++ b/crypto/des/rpc_enc.c @@ -66,10 +66,7 @@ int _des_crypt(char *buf,int len,struct desparams *desp); int _des_crypt(); #endif -int _des_crypt(buf, len, desp) -char *buf; -int len; -struct desparams *desp; +int _des_crypt(char *buf, int len, struct desparams *desp) { des_key_schedule ks; int enc; diff --git a/crypto/des/rpw.c b/crypto/des/rpw.c index 6447ed9cf0..bf9d35ca33 100644 --- a/crypto/des/rpw.c +++ b/crypto/des/rpw.c @@ -59,9 +59,7 @@ #include #include "des.h" -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { des_cblock k,k1; int i; diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c index cdc3c19233..52f0f8aff9 100644 --- a/crypto/des/set_key.c +++ b/crypto/des/set_key.c @@ -75,8 +75,7 @@ static int check_parity(); int des_check_key=0; -void des_set_odd_parity(key) -des_cblock key; +void des_set_odd_parity(des_cblock key) { int i; @@ -84,8 +83,7 @@ des_cblock key; key[i]=odd_parity[key[i]]; } -static int check_parity(key) -const des_cblock key; +static int check_parity(const des_cblock key) { int i; @@ -127,8 +125,7 @@ static des_cblock weak_keys[NUM_WEAK_KEY]={ {0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1,0xFE}, {0xFE,0xE0,0xFE,0xE0,0xFE,0xF1,0xFE,0xF1}}; -int des_is_weak_key(key) -const des_cblock key; +int des_is_weak_key(const des_cblock key) { int i; @@ -157,9 +154,7 @@ const des_cblock key; * return -1 if key parity error, * return -2 if illegal weak key. */ -int des_set_key(key, schedule) -const des_cblock key; -des_key_schedule schedule; +int des_set_key(const des_cblock key, des_key_schedule schedule) { static int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; register DES_LONG c,d,t,s,t2; @@ -238,9 +233,7 @@ des_key_schedule schedule; return(0); } -int des_key_sched(key, schedule) -const des_cblock key; -des_key_schedule schedule; +int des_key_sched(const des_cblock key, des_key_schedule schedule) { return(des_set_key(key,schedule)); } diff --git a/crypto/des/speed.c b/crypto/des/speed.c index bac078e054..1384c9419e 100644 --- a/crypto/des/speed.c +++ b/crypto/des/speed.c @@ -139,8 +139,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -153,8 +152,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -190,9 +188,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c index 7701580a8d..40f706beb7 100644 --- a/crypto/des/str2key.c +++ b/crypto/des/str2key.c @@ -60,9 +60,7 @@ extern int des_check_key; -void des_string_to_key(str, key) -const char *str; -des_cblock key; +void des_string_to_key(const char *str, des_cblock key) { des_key_schedule ks; int i,length; @@ -99,10 +97,7 @@ des_cblock key; des_set_odd_parity(key); } -void des_string_to_2keys(str, key1, key2) -const char *str; -des_cblock key1; -des_cblock key2; +void des_string_to_2keys(const char *str, des_cblock key1, des_cblock key2) { des_key_schedule ks; int i,length; diff --git a/crypto/des/supp.c b/crypto/des/supp.c index 1d9effdd42..8fa0a3e8e4 100644 --- a/crypto/des/supp.c +++ b/crypto/des/supp.c @@ -87,15 +87,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: supp.c,v 1.3 1999/04/17 21:25:00 ben Exp $ + * $Id: supp.c,v 1.4 1999/04/19 21:28:07 ulf Exp $ */ #include #include "des_locl.h" -void des_cblock_print_file(cb, fp) - const des_cblock cb; - FILE *fp; +void des_cblock_print_file(const des_cblock cb, FILE *fp) { int i; const unsigned int *p = (const unsigned int *)cb; diff --git a/crypto/des/xcbc_enc.c b/crypto/des/xcbc_enc.c index 9a9480ec3a..0d3b6a4d04 100644 --- a/crypto/des/xcbc_enc.c +++ b/crypto/des/xcbc_enc.c @@ -79,10 +79,8 @@ static unsigned char desx_white_in2out[256]={ 0xA7,0x1C,0xC9,0x09,0x69,0x9A,0x83,0xCF,0x29,0x39,0xB9,0xE9,0x4C,0xFF,0x43,0xAB, }; -void des_xwhite_in2out(key,in,out) -const des_cblock key; -const des_cblock in; -des_cblock out; +void des_xwhite_in2out(const des_cblock key, const des_cblock in, + des_cblock out) { int out0,out1; int i; @@ -106,15 +104,9 @@ des_cblock out; } } -void des_xcbc_encrypt(in, out, length, schedule, ivec, inw,outw,enc) -const unsigned char *in; -unsigned char *out; -long length; -des_key_schedule schedule; -des_cblock ivec; -const des_cblock inw; -const des_cblock outw; -int enc; +void des_xcbc_encrypt(const unsigned char *in, unsigned char *out, long length, + des_key_schedule schedule, des_cblock ivec, const des_cblock inw, + const des_cblock outw, int enc) { register DES_LONG tin0,tin1; register DES_LONG tout0,tout1,xor0,xor1; diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c index 65602e494f..e631f60718 100644 --- a/crypto/dh/dh_check.c +++ b/crypto/dh/dh_check.c @@ -70,9 +70,7 @@ * should hold. */ -int DH_check(dh,ret) -DH *dh; -int *ret; +int DH_check(DH *dh, int *ret) { int ok=0; BN_CTX *ctx=NULL; diff --git a/crypto/dh/dh_err.c b/crypto/dh/dh_err.c index 83ad45fb04..5c1a129414 100644 --- a/crypto/dh/dh_err.c +++ b/crypto/dh/dh_err.c @@ -80,7 +80,7 @@ static ERR_STRING_DATA DH_str_reasons[]= #endif -void ERR_load_DH_strings() +void ERR_load_DH_strings(void) { static int init=1; diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c index 466f2bf06f..fc577af05d 100644 --- a/crypto/dh/dh_gen.c +++ b/crypto/dh/dh_gen.c @@ -83,11 +83,8 @@ * this generator function can take a very very long time to run. */ -DH *DH_generate_parameters(prime_len,generator,callback,cb_arg) -int prime_len; -int generator; -void (*callback)(P_I_I_P); -char *cb_arg; +DH *DH_generate_parameters(int prime_len, int generator, + void (*callback)(P_I_I_P), char *cb_arg) { BIGNUM *p=NULL,*t1,*t2; DH *ret=NULL; diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c index fa2c96082b..25cc635e6d 100644 --- a/crypto/dh/dh_key.c +++ b/crypto/dh/dh_key.c @@ -62,8 +62,7 @@ #include "rand.h" #include "dh.h" -int DH_generate_key(dh) -DH *dh; +int DH_generate_key(DH *dh) { int ok=0; unsigned int i; @@ -119,10 +118,7 @@ err: return(ok); } -int DH_compute_key(key,pub_key,dh) -unsigned char *key; -BIGNUM *pub_key; -DH *dh; +int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh) { BN_CTX ctx; BN_MONT_CTX *mont; diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index d18484cf41..12b40cd1a4 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -63,7 +63,7 @@ const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT; -DH *DH_new() +DH *DH_new(void) { DH *ret; @@ -85,8 +85,7 @@ DH *DH_new() return(ret); } -void DH_free(r) -DH *r; +void DH_free(DH *r) { if(r == NULL) return; if (r->p != NULL) BN_clear_free(r->p); @@ -98,8 +97,7 @@ DH *r; Free(r); } -int DH_size(dh) -DH *dh; +int DH_size(DH *dh) { return(BN_num_bytes(dh->p)); } diff --git a/crypto/dh/dhtest.c b/crypto/dh/dhtest.c index e8e1695edd..249a2ecc09 100644 --- a/crypto/dh/dhtest.c +++ b/crypto/dh/dhtest.c @@ -86,9 +86,7 @@ static void MS_CALLBACK cb(); BIO *out=NULL; -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { DH *a,*b; char buf[12]; @@ -170,10 +168,7 @@ err: return(ret); } -static void MS_CALLBACK cb(p, n,arg) -int p; -int n; -char *arg; +static void MS_CALLBACK cb(int p, int n, char *arg) { char c='*'; diff --git a/crypto/dsa/dsa_asn1.c b/crypto/dsa/dsa_asn1.c index b7fa7eda4f..97c37fb592 100644 --- a/crypto/dsa/dsa_asn1.c +++ b/crypto/dsa/dsa_asn1.c @@ -21,8 +21,7 @@ DSA_SIG *DSA_SIG_new(void) return(ret); } -void DSA_SIG_free(r) -DSA_SIG *r; +void DSA_SIG_free(DSA_SIG *r) { if (r == NULL) return; if (r->r) BN_clear_free(r->r); @@ -30,9 +29,7 @@ DSA_SIG *r; Free(r); } -int i2d_DSA_SIG(v,pp) -DSA_SIG *v; -unsigned char **pp; +int i2d_DSA_SIG(DSA_SIG *v, unsigned char **pp) { int t=0,len; ASN1_INTEGER rbs,sbs; @@ -72,10 +69,7 @@ unsigned char **pp; return(t); } -DSA_SIG *d2i_DSA_SIG(a,pp,length) -DSA_SIG **a; -unsigned char **pp; -long length; +DSA_SIG *d2i_DSA_SIG(DSA_SIG **a, unsigned char **pp, long length) { int i=ERR_R_NESTED_ASN1_ERROR; ASN1_INTEGER *bs=NULL; diff --git a/crypto/dsa/dsa_err.c b/crypto/dsa/dsa_err.c index c3a4f4d73b..d4cbe1d74b 100644 --- a/crypto/dsa/dsa_err.c +++ b/crypto/dsa/dsa_err.c @@ -88,7 +88,7 @@ static ERR_STRING_DATA DSA_str_reasons[]= #endif -void ERR_load_DSA_strings() +void ERR_load_DSA_strings(void) { static int init=1; diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index 8202b80292..4f677d5b93 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -72,15 +72,9 @@ #include "dsa.h" #include "rand.h" -DSA *DSA_generate_parameters(bits,seed_in,seed_len,counter_ret,h_ret,callback, - cb_arg) -int bits; -unsigned char *seed_in; -int seed_len; -int *counter_ret; -unsigned long *h_ret; -void (*callback)(); -char *cb_arg; +DSA *DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len, + int *counter_ret, unsigned long *h_ret, void (*callback)(), + char *cb_arg) { int ok=0; unsigned char seed[SHA_DIGEST_LENGTH]; @@ -255,10 +249,7 @@ err: return(ok?ret:NULL); } -int DSA_is_prime(w, callback,cb_arg) -BIGNUM *w; -void (*callback)(); -char *cb_arg; +int DSA_is_prime(BIGNUM *w, void (*callback)(), char *cb_arg) { int ok= -1,j,i,n; BN_CTX *ctx=NULL,*ctx2=NULL; diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c index d51ed9395f..21ed0f65e0 100644 --- a/crypto/dsa/dsa_key.c +++ b/crypto/dsa/dsa_key.c @@ -64,8 +64,7 @@ #include "dsa.h" #include "rand.h" -int DSA_generate_key(dsa) -DSA *dsa; +int DSA_generate_key(DSA *dsa) { int ok=0; unsigned int i; diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 9692670e80..1bd89ae4c3 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -66,7 +66,7 @@ const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT; -DSA *DSA_new() +DSA *DSA_new(void) { DSA *ret; @@ -95,8 +95,7 @@ DSA *DSA_new() return(ret); } -void DSA_free(r) -DSA *r; +void DSA_free(DSA *r) { int i; @@ -127,8 +126,7 @@ DSA *r; Free(r); } -int DSA_size(r) -DSA *r; +int DSA_size(DSA *r) { int ret,i; ASN1_INTEGER bs; diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c index 92098e2149..9ceaceb632 100644 --- a/crypto/dsa/dsa_sign.c +++ b/crypto/dsa/dsa_sign.c @@ -65,10 +65,7 @@ #include "rand.h" #include "asn1.h" -DSA_SIG * DSA_do_sign(dgst,dlen,dsa) -unsigned char *dgst; -int dlen; -DSA *dsa; +DSA_SIG * DSA_do_sign(unsigned char *dgst, int dlen, DSA *dsa) { BIGNUM *kinv=NULL,*r=NULL,*s=NULL; BIGNUM m; @@ -133,13 +130,10 @@ err: /* data has already been hashed (probably with SHA or SHA-1). */ -int DSA_sign(type,dgst,dlen,sig,siglen,dsa) -int type; -unsigned char *dgst; -int dlen; -unsigned char *sig; /* out */ -unsigned int *siglen; /* out */ -DSA *dsa; +/* unsigned char *sig: out */ +/* unsigned int *siglen: out */ +int DSA_sign(int type, unsigned char *dgst, int dlen, unsigned char *sig, + unsigned int *siglen, DSA *dsa) { DSA_SIG *s; s=DSA_do_sign(dgst,dlen,dsa); @@ -153,11 +147,7 @@ DSA *dsa; return(1); } -int DSA_sign_setup(dsa,ctx_in,kinvp,rp) -DSA *dsa; -BN_CTX *ctx_in; -BIGNUM **kinvp; -BIGNUM **rp; +int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) { BN_CTX *ctx; BIGNUM k,*kinv=NULL,*r=NULL; diff --git a/crypto/dsa/dsa_vrf.c b/crypto/dsa/dsa_vrf.c index 3b74c81a57..24ede6762e 100644 --- a/crypto/dsa/dsa_vrf.c +++ b/crypto/dsa/dsa_vrf.c @@ -66,11 +66,7 @@ #include "asn1.h" #include "asn1_mac.h" -int DSA_do_verify(dgst,dgst_len,sig,dsa) -unsigned char *dgst; -int dgst_len; -DSA_SIG *sig; -DSA *dsa; +int DSA_do_verify(unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa) { BN_CTX *ctx; BIGNUM u1,u2,t1; @@ -147,13 +143,8 @@ DSA *dsa; * 0: incorrect signature * -1: error */ -int DSA_verify(type,dgst,dgst_len,sigbuf,siglen,dsa) -int type; -unsigned char *dgst; -int dgst_len; -unsigned char *sigbuf; -int siglen; -DSA *dsa; +int DSA_verify(int type, unsigned char *dgst, int dgst_len, + unsigned char *sigbuf, int siglen, DSA *dsa) { DSA_SIG *s; int ret=-1; diff --git a/crypto/dsa/dsagen.c b/crypto/dsa/dsagen.c index 20335de250..ce08d10353 100644 --- a/crypto/dsa/dsagen.c +++ b/crypto/dsa/dsagen.c @@ -77,8 +77,7 @@ unsigned char seed[20]={ 0xe0,0x42,0x7d,LAST_VALUE}; #endif -int cb(p,n) -int p,n; +int cb(int p, int n) { char c='*'; diff --git a/crypto/dsa/dsatest.c b/crypto/dsa/dsatest.c index 924380a44b..4018f81862 100644 --- a/crypto/dsa/dsatest.c +++ b/crypto/dsa/dsatest.c @@ -117,9 +117,7 @@ static unsigned char out_g[]={ static BIO *bio_err=NULL; -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { DSA *dsa=NULL; int counter,ret=0,i,j; @@ -193,10 +191,7 @@ end: return(0); } -static void MS_CALLBACK dsa_cb(p, n, arg) -int p; -int n; -char *arg; +static void MS_CALLBACK dsa_cb(int p, int n, char *arg) { char c='*'; static int ok=0,num=0; diff --git a/crypto/err/err.c b/crypto/err/err.c index 46f69e187a..db78aa7879 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -173,8 +173,7 @@ static ERR_STRING_DATA ERR_str_reasons[]= } \ (p)->err_data_flags[i]=0; -static void ERR_STATE_free(s) -ERR_STATE *s; +static void ERR_STATE_free(ERR_STATE *s) { int i; @@ -188,7 +187,7 @@ ERR_STATE *s; Free(s); } -void ERR_load_ERR_strings() +void ERR_load_ERR_strings(void) { static int init=1; @@ -211,9 +210,7 @@ void ERR_load_ERR_strings() } } -void ERR_load_strings(lib,str) -int lib; -ERR_STRING_DATA *str; +void ERR_load_strings(int lib, ERR_STRING_DATA *str) { if (error_hash == NULL) { @@ -239,7 +236,7 @@ ERR_STRING_DATA *str; CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH); } -void ERR_free_strings() +void ERR_free_strings(void) { CRYPTO_w_lock(CRYPTO_LOCK_ERR); @@ -254,10 +251,8 @@ void ERR_free_strings() /********************************************************/ -void ERR_put_error(lib,func,reason,file,line) -int lib,func,reason; -const char *file; -int line; +void ERR_put_error(int lib, int func, int reason, const char *file, + int line) { ERR_STATE *es; @@ -272,7 +267,7 @@ int line; err_clear_data(es,es->top); } -void ERR_clear_error() +void ERR_clear_error(void) { ERR_STATE *es; @@ -292,42 +287,32 @@ void ERR_clear_error() } -unsigned long ERR_get_error() +unsigned long ERR_get_error(void) { return(get_error_values(1,NULL,NULL,NULL,NULL)); } -unsigned long ERR_get_error_line(file,line) -const char **file; -int *line; +unsigned long ERR_get_error_line(const char **file, + int *line) { return(get_error_values(1,file,line,NULL,NULL)); } -unsigned long ERR_get_error_line_data(file,line,data,flags) -const char **file; -int *line; -const char **data; -int *flags; - { return(get_error_values(1,file,line,data,flags)); } +unsigned long ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags) + { return(get_error_values(1,file,line, + data,flags)); } -unsigned long ERR_peek_error() +unsigned long ERR_peek_error(void) { return(get_error_values(0,NULL,NULL,NULL,NULL)); } -unsigned long ERR_peek_error_line(file,line) -const char **file; -int *line; +unsigned long ERR_peek_error_line(const char **file, + int *line) { return(get_error_values(0,file,line,NULL,NULL)); } -unsigned long ERR_peek_error_line_data(file,line,data,flags) -const char **file; -int *line; -const char **data; -int *flags; - { return(get_error_values(0,file,line,data,flags)); } - -static unsigned long get_error_values(inc,file,line,data,flags) -int inc; -const char **file; -int *line; -const char **data; -int *flags; +unsigned long ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags) + { return(get_error_values(0,file,line, + data,flags)); } + +static unsigned long get_error_values(int inc, const char **file, int *line, + const char **data, int *flags) { int i=0; ERR_STATE *es; @@ -376,9 +361,7 @@ int *flags; } /* BAD for multi-threaded, uses a local buffer if ret == NULL */ -char *ERR_error_string(e,ret) -unsigned long e; -char *ret; +char *ERR_error_string(unsigned long e, char *ret) { static char buf[256]; const char *ls,*fs,*rs; @@ -412,18 +395,17 @@ char *ret; return(ret); } -LHASH *ERR_get_string_table() +LHASH *ERR_get_string_table(void) { return(error_hash); } -LHASH *ERR_get_err_state_table() +LHASH *ERR_get_err_state_table(void) { return(thread_hash); } -const char *ERR_lib_error_string(e) -unsigned long e; +const char *ERR_lib_error_string(unsigned long e) { ERR_STRING_DATA d,*p=NULL; unsigned long l; @@ -443,8 +425,7 @@ unsigned long e; return((p == NULL)?NULL:p->string); } -const char *ERR_func_error_string(e) -unsigned long e; +const char *ERR_func_error_string(unsigned long e) { ERR_STRING_DATA d,*p=NULL; unsigned long l,f; @@ -465,8 +446,7 @@ unsigned long e; return((p == NULL)?NULL:p->string); } -const char *ERR_reason_error_string(e) -unsigned long e; +const char *ERR_reason_error_string(unsigned long e) { ERR_STRING_DATA d,*p=NULL; unsigned long l,r; @@ -493,8 +473,7 @@ unsigned long e; return((p == NULL)?NULL:p->string); } -static unsigned long err_hash(a) -ERR_STRING_DATA *a; +static unsigned long err_hash(ERR_STRING_DATA *a) { unsigned long ret,l; @@ -503,26 +482,22 @@ ERR_STRING_DATA *a; return(ret^ret%19*13); } -static int err_cmp(a,b) -ERR_STRING_DATA *a,*b; +static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b) { return((int)(a->error-b->error)); } -static unsigned long pid_hash(a) -ERR_STATE *a; +static unsigned long pid_hash(ERR_STATE *a) { return(a->pid*13); } -static int pid_cmp(a,b) -ERR_STATE *a,*b; +static int pid_cmp(ERR_STATE *a, ERR_STATE *b) { return((int)((long)a->pid - (long)b->pid)); } -void ERR_remove_state(pid) -unsigned long pid; +void ERR_remove_state(unsigned long pid) { ERR_STATE *p,tmp; @@ -538,7 +513,7 @@ unsigned long pid; if (p != NULL) ERR_STATE_free(p); } -ERR_STATE *ERR_get_state() +ERR_STATE *ERR_get_state(void) { static ERR_STATE fallback; ERR_STATE *ret=NULL,tmp,*tmpp; @@ -594,16 +569,14 @@ ERR_STATE *ERR_get_state() return(ret); } -int ERR_get_next_error_library() +int ERR_get_next_error_library(void) { static int value=ERR_LIB_USER; return(value++); } -void ERR_set_error_data(data,flags) -char *data; -int flags; +void ERR_set_error_data(char *data, int flags) { ERR_STATE *es; int i; diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c index 06076064f6..2479d6b41d 100644 --- a/crypto/err/err_all.c +++ b/crypto/err/err_all.c @@ -82,7 +82,7 @@ #include "pkcs12.h" #include "err.h" -void ERR_load_crypto_strings() +void ERR_load_crypto_strings(void) { static int done=0; diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c index e52a062eb6..c72713b6c4 100644 --- a/crypto/err/err_prn.c +++ b/crypto/err/err_prn.c @@ -65,8 +65,7 @@ #include "crypto.h" #ifndef NO_FP_API -void ERR_print_errors_fp(fp) -FILE *fp; +void ERR_print_errors_fp(FILE *fp) { unsigned long l; char buf[200]; @@ -83,8 +82,7 @@ FILE *fp; } #endif -void ERR_print_errors(bp) -BIO *bp; +void ERR_print_errors(BIO *bp) { unsigned long l; char buf[256]; diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c index 73172b9a07..a680064200 100644 --- a/crypto/evp/bio_b64.c +++ b/crypto/evp/bio_b64.c @@ -113,13 +113,12 @@ static BIO_METHOD methods_b64= b64_free, }; -BIO_METHOD *BIO_f_base64() +BIO_METHOD *BIO_f_base64(void) { return(&methods_b64); } -static int b64_new(bi) -BIO *bi; +static int b64_new(BIO *bi) { BIO_B64_CTX *ctx; @@ -140,8 +139,7 @@ BIO *bi; return(1); } -static int b64_free(a) -BIO *a; +static int b64_free(BIO *a) { if (a == NULL) return(0); Free(a->ptr); @@ -151,10 +149,7 @@ BIO *a; return(1); } -static int b64_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int b64_read(BIO *b, char *out, int outl) { int ret=0,i,ii,j,k,x,n,num,ret_code=0; BIO_B64_CTX *ctx; @@ -354,10 +349,7 @@ int outl; return((ret == 0)?ret_code:ret); } -static int b64_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int b64_write(BIO *b, char *in, int inl) { int ret=inl,n,i; BIO_B64_CTX *ctx; @@ -451,11 +443,7 @@ int inl; return(ret); } -static long b64_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long b64_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO_B64_CTX *ctx; long ret=1; diff --git a/crypto/evp/bio_enc.c b/crypto/evp/bio_enc.c index e1443d684d..d83e1fd137 100644 --- a/crypto/evp/bio_enc.c +++ b/crypto/evp/bio_enc.c @@ -105,13 +105,12 @@ static BIO_METHOD methods_enc= enc_free, }; -BIO_METHOD *BIO_f_cipher() +BIO_METHOD *BIO_f_cipher(void) { return(&methods_enc); } -static int enc_new(bi) -BIO *bi; +static int enc_new(BIO *bi) { BIO_ENC_CTX *ctx; @@ -131,8 +130,7 @@ BIO *bi; return(1); } -static int enc_free(a) -BIO *a; +static int enc_free(BIO *a) { BIO_ENC_CTX *b; @@ -147,10 +145,7 @@ BIO *a; return(1); } -static int enc_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int enc_read(BIO *b, char *out, int outl) { int ret=0,i; BIO_ENC_CTX *ctx; @@ -230,10 +225,7 @@ int outl; return((ret == 0)?ctx->cont:ret); } -static int enc_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int enc_write(BIO *b, char *in, int inl) { int ret=0,n,i; BIO_ENC_CTX *ctx; @@ -288,11 +280,7 @@ int inl; return(ret); } -static long enc_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long enc_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO *dbio; BIO_ENC_CTX *ctx,*dctx; @@ -403,12 +391,8 @@ EVP_CIPHER_ctx *c; } */ -void BIO_set_cipher(b,c,k,i,e) -BIO *b; -const EVP_CIPHER *c; -unsigned char *k; -unsigned char *i; -int e; +void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, unsigned char *k, + unsigned char *i, int e) { BIO_ENC_CTX *ctx; diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c index 51dd1aa0c9..78c4c1f4ed 100644 --- a/crypto/evp/bio_md.c +++ b/crypto/evp/bio_md.c @@ -95,13 +95,12 @@ static BIO_METHOD methods_md= md_free, }; -BIO_METHOD *BIO_f_md() +BIO_METHOD *BIO_f_md(void) { return(&methods_md); } -static int md_new(bi) -BIO *bi; +static int md_new(BIO *bi) { EVP_MD_CTX *ctx; @@ -114,8 +113,7 @@ BIO *bi; return(1); } -static int md_free(a) -BIO *a; +static int md_free(BIO *a) { if (a == NULL) return(0); Free(a->ptr); @@ -125,10 +123,7 @@ BIO *a; return(1); } -static int md_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int md_read(BIO *b, char *out, int outl) { int ret=0; EVP_MD_CTX *ctx; @@ -152,10 +147,7 @@ int outl; return(ret); } -static int md_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int md_write(BIO *b, char *in, int inl) { int ret=0; EVP_MD_CTX *ctx; @@ -178,11 +170,7 @@ int inl; return(ret); } -static long md_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long md_ctrl(BIO *b, int cmd, long num, char *ptr) { EVP_MD_CTX *ctx,*dctx,**pctx; const EVP_MD **ppmd; @@ -243,10 +231,7 @@ char *ptr; return(ret); } -static int md_gets(bp,buf,size) -BIO *bp; -char *buf; -int size; +static int md_gets(BIO *bp, char *buf, int size) { EVP_MD_CTX *ctx; unsigned int ret; diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c index 09ce86f3ce..183835b0b1 100644 --- a/crypto/evp/bio_ok.c +++ b/crypto/evp/bio_ok.c @@ -188,13 +188,12 @@ static BIO_METHOD methods_ok= ok_free, }; -BIO_METHOD *BIO_f_reliable() +BIO_METHOD *BIO_f_reliable(void) { return(&methods_ok); } -static int ok_new(bi) -BIO *bi; +static int ok_new(BIO *bi) { BIO_OK_CTX *ctx; @@ -216,8 +215,7 @@ BIO *bi; return(1); } -static int ok_free(a) -BIO *a; +static int ok_free(BIO *a) { if (a == NULL) return(0); memset(a->ptr,0,sizeof(BIO_OK_CTX)); @@ -228,10 +226,7 @@ BIO *a; return(1); } -static int ok_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int ok_read(BIO *b, char *out, int outl) { int ret=0,i,n; BIO_OK_CTX *ctx; @@ -302,10 +297,7 @@ int outl; return(ret); } -static int ok_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int ok_write(BIO *b, char *in, int inl) { int ret=0,n,i; BIO_OK_CTX *ctx; @@ -363,11 +355,7 @@ int inl; return(ret); } -static long ok_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long ok_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO_OK_CTX *ctx; EVP_MD *md; diff --git a/crypto/evp/c_all.c b/crypto/evp/c_all.c index 51f7aba805..edaeda8598 100644 --- a/crypto/evp/c_all.c +++ b/crypto/evp/c_all.c @@ -62,13 +62,13 @@ #include "pkcs12.h" #include "objects.h" -void SSLeay_add_all_algorithms() +void SSLeay_add_all_algorithms(void) { SSLeay_add_all_ciphers(); SSLeay_add_all_digests(); } -void SSLeay_add_all_ciphers() +void SSLeay_add_all_ciphers(void) { #ifndef NO_DES EVP_add_cipher(EVP_des_cfb()); @@ -153,7 +153,7 @@ void SSLeay_add_all_ciphers() } -void SSLeay_add_all_digests() +void SSLeay_add_all_digests(void) { #ifndef NO_MD2 EVP_add_digest(EVP_md2()); diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 0704827be1..c2c603ea63 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -61,26 +61,19 @@ #include "objects.h" #include "evp.h" -void EVP_DigestInit(ctx,type) -EVP_MD_CTX *ctx; -const EVP_MD *type; +void EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) { ctx->digest=type; type->init(&(ctx->md)); } -void EVP_DigestUpdate(ctx,data,count) -EVP_MD_CTX *ctx; -const unsigned char *data; -unsigned int count; +void EVP_DigestUpdate(EVP_MD_CTX *ctx, const unsigned char *data, + unsigned int count) { ctx->digest->update(&(ctx->md.base[0]),data,(unsigned long)count); } -void EVP_DigestFinal(ctx,md,size) -EVP_MD_CTX *ctx; -unsigned char *md; -unsigned int *size; +void EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) { ctx->digest->final(md,&(ctx->md.base[0])); if (size != NULL) diff --git a/crypto/evp/e_cbc_3d.c b/crypto/evp/e_cbc_3d.c index 907e2e94b0..f68f02b122 100644 --- a/crypto/evp/e_cbc_3d.c +++ b/crypto/evp/e_cbc_3d.c @@ -100,21 +100,18 @@ static EVP_CIPHER d_cbc_ede_cipher3= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_des_ede_cbc() +EVP_CIPHER *EVP_des_ede_cbc(void) { return(&d_cbc_ede_cipher2); } -EVP_CIPHER *EVP_des_ede3_cbc() +EVP_CIPHER *EVP_des_ede3_cbc(void) { return(&d_cbc_ede_cipher3); } -static void des_cbc_ede_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -130,11 +127,8 @@ int enc; } } -static void des_cbc_ede3_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -148,11 +142,8 @@ int enc; } } -static void des_cbc_ede_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_ede3_cbc_encrypt(in,out,inl, ctx->c.des_ede.ks1, ctx->c.des_ede.ks2,ctx->c.des_ede.ks3, diff --git a/crypto/evp/e_cbc_bf.c b/crypto/evp/e_cbc_bf.c index be605f4a13..1125ca5270 100644 --- a/crypto/evp/e_cbc_bf.c +++ b/crypto/evp/e_cbc_bf.c @@ -86,16 +86,13 @@ static EVP_CIPHER bfish_cbc_cipher= EVP_CIPHER_set_asn1_iv, }; -EVP_CIPHER *EVP_bf_cbc() +EVP_CIPHER *EVP_bf_cbc(void) { return(&bfish_cbc_cipher); } -static void bf_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -104,11 +101,8 @@ int enc; BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); } -static void bf_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { BF_cbc_encrypt( in,out,(long)inl, diff --git a/crypto/evp/e_cbc_c.c b/crypto/evp/e_cbc_c.c index b50c7874b3..8f0eb5aed7 100644 --- a/crypto/evp/e_cbc_c.c +++ b/crypto/evp/e_cbc_c.c @@ -86,16 +86,13 @@ static EVP_CIPHER cast5_cbc_cipher= EVP_CIPHER_set_asn1_iv, }; -EVP_CIPHER *EVP_cast5_cbc() +EVP_CIPHER *EVP_cast5_cbc(void) { return(&cast5_cbc_cipher); } -static void cast_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -104,11 +101,8 @@ int enc; CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); } -static void cast_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { CAST_cbc_encrypt( in,out,(long)inl, diff --git a/crypto/evp/e_cbc_d.c b/crypto/evp/e_cbc_d.c index f18c8c7e07..eb7a24f3cf 100644 --- a/crypto/evp/e_cbc_d.c +++ b/crypto/evp/e_cbc_d.c @@ -84,16 +84,13 @@ static EVP_CIPHER d_cbc_cipher= EVP_CIPHER_set_asn1_iv, }; -EVP_CIPHER *EVP_des_cbc() +EVP_CIPHER *EVP_des_cbc(void) { return(&d_cbc_cipher); } -static void des_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -102,11 +99,8 @@ int enc; des_set_key(key,ctx->c.des_ks); } -static void des_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_ncbc_encrypt(in,out,inl,ctx->c.des_ks,&(ctx->iv[0]),ctx->encrypt); } diff --git a/crypto/evp/e_cbc_i.c b/crypto/evp/e_cbc_i.c index 312ffcb721..be7461cda1 100644 --- a/crypto/evp/e_cbc_i.c +++ b/crypto/evp/e_cbc_i.c @@ -86,16 +86,13 @@ static EVP_CIPHER i_cbc_cipher= EVP_CIPHER_set_asn1_iv, }; -EVP_CIPHER *EVP_idea_cbc() +EVP_CIPHER *EVP_idea_cbc(void) { return(&i_cbc_cipher); } -static void idea_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -116,11 +113,8 @@ int enc; } } -static void idea_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { idea_cbc_encrypt( in,out,(long)inl, diff --git a/crypto/evp/e_cbc_r2.c b/crypto/evp/e_cbc_r2.c index 57d46129b6..b30ff66592 100644 --- a/crypto/evp/e_cbc_r2.c +++ b/crypto/evp/e_cbc_r2.c @@ -126,26 +126,23 @@ static EVP_CIPHER r2_40_cbc_cipher= rc2_get_asn1_type_and_iv, }; -EVP_CIPHER *EVP_rc2_cbc() +EVP_CIPHER *EVP_rc2_cbc(void) { return(&r2_cbc_cipher); } -EVP_CIPHER *EVP_rc2_64_cbc() +EVP_CIPHER *EVP_rc2_64_cbc(void) { return(&r2_64_cbc_cipher); } -EVP_CIPHER *EVP_rc2_40_cbc() +EVP_CIPHER *EVP_rc2_40_cbc(void) { return(&r2_40_cbc_cipher); } -static void rc2_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -155,11 +152,8 @@ int enc; key,EVP_CIPHER_CTX_key_length(ctx)*8); } -static void rc2_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC2_cbc_encrypt( in,out,(long)inl, @@ -167,8 +161,7 @@ unsigned int inl; ctx->encrypt); } -static int rc2_meth_to_magic(e) -const EVP_CIPHER *e; +static int rc2_meth_to_magic(const EVP_CIPHER *e) { int i; @@ -179,8 +172,7 @@ const EVP_CIPHER *e; else return(0); } -static EVP_CIPHER *rc2_magic_to_meth(i) -int i; +static EVP_CIPHER *rc2_magic_to_meth(int i) { if (i == RC2_128_MAGIC) return(EVP_rc2_cbc()); else if (i == RC2_64_MAGIC) return(EVP_rc2_64_cbc()); @@ -192,9 +184,7 @@ int i; } } -static int rc2_get_asn1_type_and_iv(c,type) -EVP_CIPHER_CTX *c; -ASN1_TYPE *type; +static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { long num=0; int i=0,l; @@ -220,9 +210,7 @@ ASN1_TYPE *type; return(i); } -static int rc2_set_asn1_type_and_iv(c,type) -EVP_CIPHER_CTX *c; -ASN1_TYPE *type; +static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { long num; int i=0,j; diff --git a/crypto/evp/e_cbc_r5.c b/crypto/evp/e_cbc_r5.c index f7d46ca91f..93aa22e457 100644 --- a/crypto/evp/e_cbc_r5.c +++ b/crypto/evp/e_cbc_r5.c @@ -86,16 +86,13 @@ static EVP_CIPHER rc5_32_12_16_cbc_cipher= NULL, }; -EVP_CIPHER *EVP_rc5_32_12_16_cbc() +EVP_CIPHER *EVP_rc5_32_12_16_cbc(void) { return(&rc5_32_12_16_cbc_cipher); } -static void r_32_12_16_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -105,11 +102,8 @@ int enc; key,RC5_12_ROUNDS); } -static void r_32_12_16_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC5_32_cbc_encrypt( in,out,(long)inl, diff --git a/crypto/evp/e_cfb_3d.c b/crypto/evp/e_cfb_3d.c index 88ace5c543..e1fc9751e4 100644 --- a/crypto/evp/e_cfb_3d.c +++ b/crypto/evp/e_cfb_3d.c @@ -100,21 +100,18 @@ static EVP_CIPHER d_ede3_cfb_cipher3= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_des_ede_cfb() +EVP_CIPHER *EVP_des_ede_cfb(void) { return(&d_ede_cfb_cipher2); } -EVP_CIPHER *EVP_des_ede3_cfb() +EVP_CIPHER *EVP_des_ede3_cfb(void) { return(&d_ede3_cfb_cipher3); } -static void des_ede_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -131,11 +128,8 @@ int enc; } } -static void des_ede3_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -150,11 +144,8 @@ int enc; } } -static void des_ede_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_ede3_cfb64_encrypt(in,out,(long)inl, ctx->c.des_ede.ks1, diff --git a/crypto/evp/e_cfb_bf.c b/crypto/evp/e_cfb_bf.c index 8aba2564b8..ca13c8b839 100644 --- a/crypto/evp/e_cfb_bf.c +++ b/crypto/evp/e_cfb_bf.c @@ -86,16 +86,13 @@ static EVP_CIPHER bfish_cfb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_bf_cfb() +EVP_CIPHER *EVP_bf_cfb(void) { return(&bfish_cfb_cipher); } -static void bf_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -106,11 +103,8 @@ int enc; BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); } -static void bf_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { BF_cfb64_encrypt( in,out, diff --git a/crypto/evp/e_cfb_c.c b/crypto/evp/e_cfb_c.c index 936df55fd8..3bfdeba403 100644 --- a/crypto/evp/e_cfb_c.c +++ b/crypto/evp/e_cfb_c.c @@ -86,16 +86,13 @@ static EVP_CIPHER cast5_cfb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_cast5_cfb() +EVP_CIPHER *EVP_cast5_cfb(void) { return(&cast5_cfb_cipher); } -static void cast_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -106,11 +103,8 @@ int enc; CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); } -static void cast_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { CAST_cfb64_encrypt( in,out, diff --git a/crypto/evp/e_cfb_d.c b/crypto/evp/e_cfb_d.c index 554815ec8a..08fad964a4 100644 --- a/crypto/evp/e_cfb_d.c +++ b/crypto/evp/e_cfb_d.c @@ -84,16 +84,13 @@ static EVP_CIPHER d_cfb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_des_cfb() +EVP_CIPHER *EVP_des_cfb(void) { return(&d_cfb_cipher); } -static void des_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -104,11 +101,8 @@ int enc; des_set_key(key,ctx->c.des_ks); } -static void des_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_cfb64_encrypt( in,out, diff --git a/crypto/evp/e_cfb_i.c b/crypto/evp/e_cfb_i.c index 9225efaa86..85e791fafe 100644 --- a/crypto/evp/e_cfb_i.c +++ b/crypto/evp/e_cfb_i.c @@ -86,16 +86,13 @@ static EVP_CIPHER i_cfb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_idea_cfb() +EVP_CIPHER *EVP_idea_cfb(void) { return(&i_cfb_cipher); } -static void idea_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -106,11 +103,8 @@ int enc; idea_set_encrypt_key(key,&(ctx->c.idea_ks)); } -static void idea_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { idea_cfb64_encrypt( in,out,(long)inl, diff --git a/crypto/evp/e_cfb_r2.c b/crypto/evp/e_cfb_r2.c index 849be7e638..78b9f4c147 100644 --- a/crypto/evp/e_cfb_r2.c +++ b/crypto/evp/e_cfb_r2.c @@ -86,16 +86,13 @@ static EVP_CIPHER r2_cfb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_rc2_cfb() +EVP_CIPHER *EVP_rc2_cfb(void) { return(&r2_cfb_cipher); } -static void rc2_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -107,11 +104,8 @@ int enc; key,EVP_CIPHER_CTX_key_length(ctx)*8); } -static void rc2_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC2_cfb64_encrypt( in,out, diff --git a/crypto/evp/e_cfb_r5.c b/crypto/evp/e_cfb_r5.c index a2fddaedc0..6031ffc769 100644 --- a/crypto/evp/e_cfb_r5.c +++ b/crypto/evp/e_cfb_r5.c @@ -86,16 +86,13 @@ static EVP_CIPHER rc5_cfb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_rc5_32_12_16_cfb() +EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) { return(&rc5_cfb_cipher); } -static void rc5_32_12_16_cfb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -107,11 +104,8 @@ int enc; RC5_12_ROUNDS); } -static void rc5_32_12_16_cfb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC5_32_cfb64_encrypt( in,out, diff --git a/crypto/evp/e_ecb_3d.c b/crypto/evp/e_ecb_3d.c index 13d7611bb3..bb4e1b3831 100644 --- a/crypto/evp/e_ecb_3d.c +++ b/crypto/evp/e_ecb_3d.c @@ -99,21 +99,18 @@ static EVP_CIPHER d_ede3_cipher3= NULL, }; -EVP_CIPHER *EVP_des_ede() +EVP_CIPHER *EVP_des_ede(void) { return(&d_ede_cipher2); } -EVP_CIPHER *EVP_des_ede3() +EVP_CIPHER *EVP_des_ede3(void) { return(&d_ede3_cipher3); } -static void des_ede_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) { @@ -125,11 +122,8 @@ int enc; } } -static void des_ede3_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) { @@ -139,11 +133,8 @@ int enc; } } -static void des_ede_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_ecb_bf.c b/crypto/evp/e_ecb_bf.c index 142a9d3123..09c8a8ba45 100644 --- a/crypto/evp/e_ecb_bf.c +++ b/crypto/evp/e_ecb_bf.c @@ -86,26 +86,20 @@ static EVP_CIPHER bfish_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_bf_ecb() +EVP_CIPHER *EVP_bf_ecb(void) { return(&bfish_ecb_cipher); } -static void bf_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); } -static void bf_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_ecb_c.c b/crypto/evp/e_ecb_c.c index 34e0c18296..bd408ce535 100644 --- a/crypto/evp/e_ecb_c.c +++ b/crypto/evp/e_ecb_c.c @@ -86,26 +86,20 @@ static EVP_CIPHER cast5_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_cast5_ecb() +EVP_CIPHER *EVP_cast5_ecb(void) { return(&cast5_ecb_cipher); } -static void cast_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); } -static void cast_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_ecb_d.c b/crypto/evp/e_ecb_d.c index de3aff5ce2..930bad5c8a 100644 --- a/crypto/evp/e_ecb_d.c +++ b/crypto/evp/e_ecb_d.c @@ -84,26 +84,20 @@ static EVP_CIPHER d_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_des_ecb() +EVP_CIPHER *EVP_des_ecb(void) { return(&d_ecb_cipher); } -static void des_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) des_set_key(key,ctx->c.des_ks); } -static void des_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_ecb_i.c b/crypto/evp/e_ecb_i.c index e24022a12c..28934917e1 100644 --- a/crypto/evp/e_ecb_i.c +++ b/crypto/evp/e_ecb_i.c @@ -86,16 +86,13 @@ static EVP_CIPHER i_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_idea_ecb() +EVP_CIPHER *EVP_idea_ecb(void) { return(&i_ecb_cipher); } -static void idea_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) { @@ -113,11 +110,8 @@ int enc; } } -static void idea_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_ecb_r2.c b/crypto/evp/e_ecb_r2.c index 4e74af96bd..f052b181d0 100644 --- a/crypto/evp/e_ecb_r2.c +++ b/crypto/evp/e_ecb_r2.c @@ -86,27 +86,21 @@ static EVP_CIPHER r2_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_rc2_ecb() +EVP_CIPHER *EVP_rc2_ecb(void) { return(&r2_ecb_cipher); } -static void rc2_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx), key,EVP_CIPHER_CTX_key_length(ctx)*8); } -static void rc2_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_ecb_r5.c b/crypto/evp/e_ecb_r5.c index 08f4a82651..2c3203d438 100644 --- a/crypto/evp/e_ecb_r5.c +++ b/crypto/evp/e_ecb_r5.c @@ -86,27 +86,21 @@ static EVP_CIPHER rc5_ecb_cipher= NULL, }; -EVP_CIPHER *EVP_rc5_32_12_16_ecb() +EVP_CIPHER *EVP_rc5_32_12_16_ecb(void) { return(&rc5_ecb_cipher); } -static void rc5_32_12_16_ecb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, RC5_12_ROUNDS); } -static void rc5_32_12_16_ecb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { unsigned int i; diff --git a/crypto/evp/e_null.c b/crypto/evp/e_null.c index e4e7ca7606..374b01c88b 100644 --- a/crypto/evp/e_null.c +++ b/crypto/evp/e_null.c @@ -83,25 +83,19 @@ static EVP_CIPHER n_cipher= NULL, }; -EVP_CIPHER *EVP_enc_null() +EVP_CIPHER *EVP_enc_null(void) { return(&n_cipher); } -static void null_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { memset(&(ctx->c),0,sizeof(ctx->c)); } -static void null_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { if (in != out) memcpy((char *)out,(char *)in,(int)inl); diff --git a/crypto/evp/e_ofb_3d.c b/crypto/evp/e_ofb_3d.c index a3981288f1..8d42f16719 100644 --- a/crypto/evp/e_ofb_3d.c +++ b/crypto/evp/e_ofb_3d.c @@ -100,21 +100,18 @@ static EVP_CIPHER d_ede3_ofb_cipher3= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_des_ede_ofb() +EVP_CIPHER *EVP_des_ede_ofb(void) { return(&d_ede_ofb_cipher2); } -EVP_CIPHER *EVP_des_ede3_ofb() +EVP_CIPHER *EVP_des_ede3_ofb(void) { return(&d_ede3_ofb_cipher3); } -static void des_ede_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -131,11 +128,8 @@ int enc; } } -static void des_ede3_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -150,11 +144,8 @@ int enc; } } -static void des_ede_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_ede3_ofb64_encrypt(in,out,inl,ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3, diff --git a/crypto/evp/e_ofb_bf.c b/crypto/evp/e_ofb_bf.c index 492f9b9082..b1753e60cd 100644 --- a/crypto/evp/e_ofb_bf.c +++ b/crypto/evp/e_ofb_bf.c @@ -86,16 +86,13 @@ static EVP_CIPHER bfish_ofb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_bf_ofb() +EVP_CIPHER *EVP_bf_ofb(void) { return(&bfish_ofb_cipher); } -static void bf_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -106,11 +103,8 @@ int enc; BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); } -static void bf_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { BF_ofb64_encrypt( in,out, diff --git a/crypto/evp/e_ofb_c.c b/crypto/evp/e_ofb_c.c index f1eef4469c..fb7b501fb6 100644 --- a/crypto/evp/e_ofb_c.c +++ b/crypto/evp/e_ofb_c.c @@ -86,16 +86,13 @@ static EVP_CIPHER cast5_ofb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_cast5_ofb() +EVP_CIPHER *EVP_cast5_ofb(void) { return(&cast5_ofb_cipher); } -static void cast_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -106,11 +103,8 @@ int enc; CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key); } -static void cast_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { CAST_ofb64_encrypt( in,out, diff --git a/crypto/evp/e_ofb_d.c b/crypto/evp/e_ofb_d.c index 30f6e0451c..ae0c793e59 100644 --- a/crypto/evp/e_ofb_d.c +++ b/crypto/evp/e_ofb_d.c @@ -84,16 +84,13 @@ static EVP_CIPHER d_ofb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_des_ofb() +EVP_CIPHER *EVP_des_ofb(void) { return(&d_ofb_cipher); } -static void des_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -104,11 +101,8 @@ int enc; des_set_key(key,ctx->c.des_ks); } -static void des_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_ofb64_encrypt(in,out,inl,ctx->c.des_ks,&(ctx->iv[0]),&ctx->num); } diff --git a/crypto/evp/e_ofb_i.c b/crypto/evp/e_ofb_i.c index 96c8afd9c8..7d68666189 100644 --- a/crypto/evp/e_ofb_i.c +++ b/crypto/evp/e_ofb_i.c @@ -86,16 +86,13 @@ static EVP_CIPHER i_ofb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_idea_ofb() +EVP_CIPHER *EVP_idea_ofb(void) { return(&i_ofb_cipher); } -static void idea_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -106,11 +103,8 @@ int enc; idea_set_encrypt_key(key,&(ctx->c.idea_ks)); } -static void idea_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { idea_ofb64_encrypt( in,out,(long)inl, diff --git a/crypto/evp/e_ofb_r2.c b/crypto/evp/e_ofb_r2.c index 4ed67eacd5..73590a296e 100644 --- a/crypto/evp/e_ofb_r2.c +++ b/crypto/evp/e_ofb_r2.c @@ -86,16 +86,13 @@ static EVP_CIPHER r2_ofb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_rc2_ofb() +EVP_CIPHER *EVP_rc2_ofb(void) { return(&r2_ofb_cipher); } -static void rc2_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -107,11 +104,8 @@ int enc; key,EVP_CIPHER_CTX_key_length(ctx)*8); } -static void rc2_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC2_ofb64_encrypt( in,out, diff --git a/crypto/evp/e_ofb_r5.c b/crypto/evp/e_ofb_r5.c index db28d6c317..8cf021988c 100644 --- a/crypto/evp/e_ofb_r5.c +++ b/crypto/evp/e_ofb_r5.c @@ -86,16 +86,13 @@ static EVP_CIPHER rc5_ofb_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_rc5_32_12_16_ofb() +EVP_CIPHER *EVP_rc5_32_12_16_ofb(void) { return(&rc5_ofb_cipher); } -static void rc5_32_12_16_ofb_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { ctx->num=0; @@ -107,11 +104,8 @@ int enc; RC5_12_ROUNDS); } -static void rc5_32_12_16_ofb_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC5_32_ofb64_encrypt( in,out, diff --git a/crypto/evp/e_rc4.c b/crypto/evp/e_rc4.c index 7e9790a94c..1552379a49 100644 --- a/crypto/evp/e_rc4.c +++ b/crypto/evp/e_rc4.c @@ -94,21 +94,18 @@ static EVP_CIPHER r4_40_cipher= rc4_cipher, }; -EVP_CIPHER *EVP_rc4() +EVP_CIPHER *EVP_rc4(void) { return(&r4_cipher); } -EVP_CIPHER *EVP_rc4_40() +EVP_CIPHER *EVP_rc4_40(void) { return(&r4_40_cipher); } -static void rc4_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (key != NULL) memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); @@ -116,11 +113,8 @@ int enc; ctx->c.rc4.key); } -static void rc4_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { RC4(&(ctx->c.rc4.ks),inl,in,out); } diff --git a/crypto/evp/e_xcbc_d.c b/crypto/evp/e_xcbc_d.c index b0bae80970..e697db73e7 100644 --- a/crypto/evp/e_xcbc_d.c +++ b/crypto/evp/e_xcbc_d.c @@ -84,16 +84,13 @@ static EVP_CIPHER d_xcbc_cipher= EVP_CIPHER_get_asn1_iv, }; -EVP_CIPHER *EVP_desx_cbc() +EVP_CIPHER *EVP_desx_cbc(void) { return(&d_xcbc_cipher); } -static void desx_cbc_init_key(ctx,key,iv,enc) -EVP_CIPHER_CTX *ctx; -unsigned char *key; -unsigned char *iv; -int enc; +static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, + unsigned char *iv, int enc) { if (iv != NULL) memcpy(&(ctx->oiv[0]),iv,8); @@ -106,11 +103,8 @@ int enc; } } -static void desx_cbc_cipher(ctx,out,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -unsigned char *in; -unsigned int inl; +static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + unsigned char *in, unsigned int inl) { des_xcbc_encrypt(in,out,inl,ctx->c.desx_cbc.ks, &(ctx->iv[0]), diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c index 14d47c1eed..0fd73f745a 100644 --- a/crypto/evp/encode.c +++ b/crypto/evp/encode.c @@ -110,20 +110,15 @@ static unsigned char data_ascii2bin[128]={ 0x31,0x32,0x33,0xFF,0xFF,0xFF,0xFF,0xFF, }; -void EVP_EncodeInit(ctx) -EVP_ENCODE_CTX *ctx; +void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) { ctx->length=48; ctx->num=0; ctx->line_num=0; } -void EVP_EncodeUpdate(ctx,out,outl,in,inl) -EVP_ENCODE_CTX *ctx; -unsigned char *out; -int *outl; -unsigned char *in; -int inl; +void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl) { int i,j; unsigned int total=0; @@ -165,10 +160,7 @@ int inl; *outl=total; } -void EVP_EncodeFinal(ctx,out,outl) -EVP_ENCODE_CTX *ctx; -unsigned char *out; -int *outl; +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) { unsigned int ret=0; @@ -182,9 +174,7 @@ int *outl; *outl=ret; } -int EVP_EncodeBlock(t,f,dlen) -unsigned char *t,*f; -int dlen; +int EVP_EncodeBlock(unsigned char *t, unsigned char *f, int dlen) { int i,ret=0; unsigned long l; @@ -218,8 +208,7 @@ int dlen; return(ret); } -void EVP_DecodeInit(ctx) -EVP_ENCODE_CTX *ctx; +void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) { ctx->length=30; ctx->num=0; @@ -231,12 +220,8 @@ EVP_ENCODE_CTX *ctx; * 0 for last line * 1 for full line */ -int EVP_DecodeUpdate(ctx,out,outl,in,inl) -EVP_ENCODE_CTX *ctx; -unsigned char *out; -int *outl; -unsigned char *in; -int inl; +int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl) { int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; unsigned char *d; @@ -341,9 +326,7 @@ end: return(rv); } -int EVP_DecodeBlock(t,f,n) -unsigned char *t,*f; -int n; +int EVP_DecodeBlock(unsigned char *t, unsigned char *f, int n) { int i,ret=0,a,b,c,d; unsigned long l; @@ -383,10 +366,7 @@ int n; return(ret); } -int EVP_DecodeFinal(ctx,out,outl) -EVP_ENCODE_CTX *ctx; -unsigned char *out; -int *outl; +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) { int i; @@ -404,9 +384,7 @@ int *outl; } #ifdef undef -int EVP_DecodeValid(buf,len) -unsigned char *buf; -int len; +int EVP_DecodeValid(unsigned char *buf, int len) { int i,num=0,bad=0; diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 2814e32455..cc7a38120f 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -62,19 +62,14 @@ const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; -void EVP_CIPHER_CTX_init(ctx) -EVP_CIPHER_CTX *ctx; +void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { memset(ctx,0,sizeof(EVP_CIPHER_CTX)); /* ctx->cipher=NULL; */ } -void EVP_CipherInit(ctx,data,key,iv,enc) -EVP_CIPHER_CTX *ctx; -const EVP_CIPHER *data; -unsigned char *key; -unsigned char *iv; -int enc; +void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *data, + unsigned char *key, unsigned char *iv, int enc) { if (enc) EVP_EncryptInit(ctx,data,key,iv); @@ -82,22 +77,15 @@ int enc; EVP_DecryptInit(ctx,data,key,iv); } -void EVP_CipherUpdate(ctx,out,outl,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; -unsigned char *in; -int inl; +void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl) { if (ctx->encrypt) EVP_EncryptUpdate(ctx,out,outl,in,inl); else EVP_DecryptUpdate(ctx,out,outl,in,inl); } -int EVP_CipherFinal(ctx,out,outl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; +int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { if (ctx->encrypt) { @@ -107,11 +95,8 @@ int *outl; else return(EVP_DecryptFinal(ctx,out,outl)); } -void EVP_EncryptInit(ctx,cipher,key,iv) -EVP_CIPHER_CTX *ctx; -const EVP_CIPHER *cipher; -unsigned char *key; -unsigned char *iv; +void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + unsigned char *key, unsigned char *iv) { if (cipher != NULL) ctx->cipher=cipher; @@ -120,11 +105,8 @@ unsigned char *iv; ctx->buf_len=0; } -void EVP_DecryptInit(ctx,cipher,key,iv) -EVP_CIPHER_CTX *ctx; -const EVP_CIPHER *cipher; -unsigned char *key; -unsigned char *iv; +void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + unsigned char *key, unsigned char *iv) { if (cipher != NULL) ctx->cipher=cipher; @@ -134,12 +116,8 @@ unsigned char *iv; } -void EVP_EncryptUpdate(ctx,out,outl,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; -unsigned char *in; -int inl; +void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl) { int i,j,bl; @@ -179,10 +157,7 @@ int inl; ctx->buf_len=i; } -void EVP_EncryptFinal(ctx,out,outl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; +void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { int i,n,b,bl; @@ -200,12 +175,8 @@ int *outl; *outl=b; } -void EVP_DecryptUpdate(ctx,out,outl,in,inl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; -unsigned char *in; -int inl; +void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, + unsigned char *in, int inl) { int b,bl,n; int keep_last=0; @@ -249,10 +220,7 @@ int inl; } } -int EVP_DecryptFinal(ctx,out,outl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; +int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { int i,b; int n; @@ -293,8 +261,7 @@ int *outl; return(1); } -void EVP_CIPHER_CTX_cleanup(c) -EVP_CIPHER_CTX *c; +void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) { if ((c->cipher != NULL) && (c->cipher->cleanup != NULL)) c->cipher->cleanup(c); diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index 2ba53c6baf..04a60881c3 100644 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -112,7 +112,7 @@ static ERR_STRING_DATA EVP_str_reasons[]= #endif -void ERR_load_EVP_strings() +void ERR_load_EVP_strings(void) { static int init=1; diff --git a/crypto/evp/evp_key.c b/crypto/evp/evp_key.c index b766f73ec1..fd3a3d12a8 100644 --- a/crypto/evp/evp_key.c +++ b/crypto/evp/evp_key.c @@ -65,8 +65,7 @@ /* should be init to zeros. */ static char prompt_string[80]; -void EVP_set_pw_prompt(prompt) -char *prompt; +void EVP_set_pw_prompt(char *prompt) { if (prompt == NULL) prompt_string[0]='\0'; @@ -74,7 +73,7 @@ char *prompt; strncpy(prompt_string,prompt,79); } -char *EVP_get_pw_prompt() +char *EVP_get_pw_prompt(void) { if (prompt_string[0] == '\0') return(NULL); @@ -86,26 +85,16 @@ char *EVP_get_pw_prompt() int des_read_pw_string(char *buf,int len,char *prompt,int verify); #endif -int EVP_read_pw_string(buf,len,prompt,verify) -char *buf; -int len; -const char *prompt; -int verify; +int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) { if ((prompt == NULL) && (prompt_string[0] != '\0')) prompt=prompt_string; return(des_read_pw_string(buf,len,prompt,verify)); } -int EVP_BytesToKey(type,md,salt,data,datal,count,key,iv) -const EVP_CIPHER *type; -EVP_MD *md; -unsigned char *salt; -unsigned char *data; -int datal; -int count; -unsigned char *key; -unsigned char *iv; +int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt, + unsigned char *data, int datal, int count, unsigned char *key, + unsigned char *iv) { EVP_MD_CTX c; unsigned char md_buf[EVP_MAX_MD_SIZE]; diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 729fc8f4e6..22ae261c80 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -61,9 +61,7 @@ #include "evp.h" #include "objects.h" -int EVP_CIPHER_param_to_asn1(c,type) -EVP_CIPHER_CTX *c; -ASN1_TYPE *type; +int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { int ret; @@ -74,9 +72,7 @@ ASN1_TYPE *type; return(ret); } -int EVP_CIPHER_asn1_to_param(c,type) -EVP_CIPHER_CTX *c; -ASN1_TYPE *type; +int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { int ret; @@ -87,9 +83,7 @@ ASN1_TYPE *type; return(ret); } -int EVP_CIPHER_get_asn1_iv(c,type) -EVP_CIPHER_CTX *c; -ASN1_TYPE *type; +int EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { int i=0,l; @@ -105,9 +99,7 @@ ASN1_TYPE *type; return(i); } -int EVP_CIPHER_set_asn1_iv(c,type) -EVP_CIPHER_CTX *c; -ASN1_TYPE *type; +int EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) { int i=0,j; diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c index a905573dec..1418921a04 100644 --- a/crypto/evp/evp_pbe.c +++ b/crypto/evp/evp_pbe.c @@ -74,12 +74,9 @@ EVP_MD *md; EVP_PBE_KEYGEN *keygen; } EVP_PBE_CTL; -int EVP_PBE_CipherInit (pbe_obj, pass, passlen, salt, saltlen, iter, ctx, en_de) -ASN1_OBJECT *pbe_obj; -int passlen, saltlen, iter; -unsigned char *pass, *salt; -EVP_CIPHER_CTX *ctx; -int en_de; +int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, unsigned char *pass, int passlen, + unsigned char *salt, int saltlen, int iter, EVP_CIPHER_CTX *ctx, + int en_de) { EVP_PBE_CTL *pbetmp, pbelu; @@ -112,12 +109,8 @@ int en_de; /* Setup a PBE algorithm but take most parameters from AlgorithmIdentifier */ -int EVP_PBE_ALGOR_CipherInit (algor, pass, passlen, ctx, en_de) -X509_ALGOR *algor; -unsigned char *pass; -int passlen; -EVP_CIPHER_CTX *ctx; -int en_de; +int EVP_PBE_ALGOR_CipherInit (X509_ALGOR *algor, unsigned char *pass, + int passlen, EVP_CIPHER_CTX *ctx, int en_de) { PBEPARAM *pbe; int saltlen, iter; @@ -147,19 +140,15 @@ int en_de; } -static int pbe_cmp (pbe1, pbe2) -EVP_PBE_CTL **pbe1, **pbe2; +static int pbe_cmp (EVP_PBE_CTL **pbe1, EVP_PBE_CTL **pbe2) { return ((*pbe1)->pbe_nid - (*pbe2)->pbe_nid); } /* Add a PBE algorithm */ -int EVP_PBE_alg_add (nid, cipher, md, keygen) -int nid; -EVP_CIPHER *cipher; -EVP_MD *md; -EVP_PBE_KEYGEN *keygen; +int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md, + EVP_PBE_KEYGEN *keygen) { EVP_PBE_CTL *pbe_tmp; if (!pbe_algs) pbe_algs = sk_new (pbe_cmp); @@ -175,7 +164,7 @@ EVP_PBE_KEYGEN *keygen; return 1; } -void EVP_PBE_cleanup() +void EVP_PBE_cleanup(void) { sk_pop_free(pbe_algs, FreeFunc); } diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index 0046d8e84b..7ca816823f 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -64,8 +64,7 @@ /* Extract a private key from a PKCS8 structure */ -EVP_PKEY *EVP_PKCS82PKEY (p8) -PKCS8_PRIV_KEY_INFO *p8; +EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8) { EVP_PKEY *pkey; RSA *rsa; @@ -189,8 +188,7 @@ PKCS8_PRIV_KEY_INFO *p8; /* Turn a private key into a PKCS8 structure */ -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(pkey) -EVP_PKEY *pkey; +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) { PKCS8_PRIV_KEY_INFO *p8; ASN1_INTEGER *dpkey; @@ -263,9 +261,7 @@ EVP_PKEY *pkey; return p8; } -PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(p8, broken) -PKCS8_PRIV_KEY_INFO *p8; -int broken; +PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken) { switch (broken) { diff --git a/crypto/evp/m_dss.c b/crypto/evp/m_dss.c index 3549b1699c..80b4eca136 100644 --- a/crypto/evp/m_dss.c +++ b/crypto/evp/m_dss.c @@ -75,7 +75,7 @@ static EVP_MD dsa_md= sizeof(EVP_MD *)+sizeof(SHA_CTX), }; -EVP_MD *EVP_dss() +EVP_MD *EVP_dss(void) { return(&dsa_md); } diff --git a/crypto/evp/m_dss1.c b/crypto/evp/m_dss1.c index ff256b7b20..2af70fdb60 100644 --- a/crypto/evp/m_dss1.c +++ b/crypto/evp/m_dss1.c @@ -75,7 +75,7 @@ static EVP_MD dss1_md= sizeof(EVP_MD *)+sizeof(SHA_CTX), }; -EVP_MD *EVP_dss1() +EVP_MD *EVP_dss1(void) { return(&dss1_md); } diff --git a/crypto/evp/m_md2.c b/crypto/evp/m_md2.c index 2209416142..fcd3d32de2 100644 --- a/crypto/evp/m_md2.c +++ b/crypto/evp/m_md2.c @@ -75,7 +75,7 @@ static EVP_MD md2_md= sizeof(EVP_MD *)+sizeof(MD2_CTX), }; -EVP_MD *EVP_md2() +EVP_MD *EVP_md2(void) { return(&md2_md); } diff --git a/crypto/evp/m_md5.c b/crypto/evp/m_md5.c index d65db9aa1d..df33608979 100644 --- a/crypto/evp/m_md5.c +++ b/crypto/evp/m_md5.c @@ -75,7 +75,7 @@ static EVP_MD md5_md= sizeof(EVP_MD *)+sizeof(MD5_CTX), }; -EVP_MD *EVP_md5() +EVP_MD *EVP_md5(void) { return(&md5_md); } diff --git a/crypto/evp/m_mdc2.c b/crypto/evp/m_mdc2.c index 64a853eb7f..94abbd4ef0 100644 --- a/crypto/evp/m_mdc2.c +++ b/crypto/evp/m_mdc2.c @@ -75,7 +75,7 @@ static EVP_MD mdc2_md= sizeof(EVP_MD *)+sizeof(MDC2_CTX), }; -EVP_MD *EVP_mdc2() +EVP_MD *EVP_mdc2(void) { return(&mdc2_md); } diff --git a/crypto/evp/m_null.c b/crypto/evp/m_null.c index 6d80560df2..d953672856 100644 --- a/crypto/evp/m_null.c +++ b/crypto/evp/m_null.c @@ -62,7 +62,7 @@ #include "objects.h" #include "x509.h" -static void function() +static void function(void) { } @@ -80,7 +80,7 @@ static EVP_MD null_md= sizeof(EVP_MD *), }; -EVP_MD *EVP_md_null() +EVP_MD *EVP_md_null(void) { return(&null_md); } diff --git a/crypto/evp/m_ripemd.c b/crypto/evp/m_ripemd.c index 04c5d8897b..c3d7492aab 100644 --- a/crypto/evp/m_ripemd.c +++ b/crypto/evp/m_ripemd.c @@ -75,7 +75,7 @@ static EVP_MD ripemd160_md= sizeof(EVP_MD *)+sizeof(RIPEMD160_CTX), }; -EVP_MD *EVP_ripemd160() +EVP_MD *EVP_ripemd160(void) { return(&ripemd160_md); } diff --git a/crypto/evp/m_sha.c b/crypto/evp/m_sha.c index af4e434a22..2b5da3411e 100644 --- a/crypto/evp/m_sha.c +++ b/crypto/evp/m_sha.c @@ -75,7 +75,7 @@ static EVP_MD sha_md= sizeof(EVP_MD *)+sizeof(SHA_CTX), }; -EVP_MD *EVP_sha() +EVP_MD *EVP_sha(void) { return(&sha_md); } diff --git a/crypto/evp/m_sha1.c b/crypto/evp/m_sha1.c index 87135a9cf2..6c4b6aa483 100644 --- a/crypto/evp/m_sha1.c +++ b/crypto/evp/m_sha1.c @@ -75,7 +75,7 @@ static EVP_MD sha1_md= sizeof(EVP_MD *)+sizeof(SHA_CTX), }; -EVP_MD *EVP_sha1() +EVP_MD *EVP_sha1(void) { return(&sha1_md); } diff --git a/crypto/evp/names.c b/crypto/evp/names.c index 124ff8fcd3..250356c844 100644 --- a/crypto/evp/names.c +++ b/crypto/evp/names.c @@ -62,8 +62,7 @@ #include "objects.h" #include "x509.h" -int EVP_add_cipher(c) -EVP_CIPHER *c; +int EVP_add_cipher(EVP_CIPHER *c) { int r; @@ -73,8 +72,7 @@ EVP_CIPHER *c; return(r); } -int EVP_add_digest(md) -EVP_MD *md; +int EVP_add_digest(EVP_MD *md) { int r; const char *name; @@ -96,8 +94,7 @@ EVP_MD *md; return(r); } -const EVP_CIPHER *EVP_get_cipherbyname(name) -const char *name; +const EVP_CIPHER *EVP_get_cipherbyname(const char *name) { const EVP_CIPHER *cp; @@ -105,8 +102,7 @@ const char *name; return(cp); } -const EVP_MD *EVP_get_digestbyname(name) -const char *name; +const EVP_MD *EVP_get_digestbyname(const char *name) { const EVP_MD *cp; @@ -114,7 +110,7 @@ const char *name; return(cp); } -void EVP_cleanup() +void EVP_cleanup(void) { OBJ_NAME_cleanup(OBJ_NAME_TYPE_CIPHER_METH); OBJ_NAME_cleanup(OBJ_NAME_TYPE_MD_METH); diff --git a/crypto/evp/p_dec.c b/crypto/evp/p_dec.c index fca333d78a..0533a84907 100644 --- a/crypto/evp/p_dec.c +++ b/crypto/evp/p_dec.c @@ -66,11 +66,8 @@ #include "objects.h" #include "x509.h" -int EVP_PKEY_decrypt(key,ek,ekl,priv) -unsigned char *key; -unsigned char *ek; -int ekl; -EVP_PKEY *priv; +int EVP_PKEY_decrypt(unsigned char *key, unsigned char *ek, int ekl, + EVP_PKEY *priv) { int ret= -1; diff --git a/crypto/evp/p_enc.c b/crypto/evp/p_enc.c index a902b5ebdf..8d54f1a2f5 100644 --- a/crypto/evp/p_enc.c +++ b/crypto/evp/p_enc.c @@ -66,11 +66,8 @@ #include "objects.h" #include "x509.h" -int EVP_PKEY_encrypt(ek,key,key_len,pubk) -unsigned char *ek; -unsigned char *key; -int key_len; -EVP_PKEY *pubk; +int EVP_PKEY_encrypt(unsigned char *ek, unsigned char *key, int key_len, + EVP_PKEY *pubk) { int ret=0; diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 581df867da..238dacccdc 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -72,8 +72,7 @@ static void EVP_PKEY_free_it(EVP_PKEY *x); static void EVP_PKEY_free_it(); #endif -int EVP_PKEY_bits(pkey) -EVP_PKEY *pkey; +int EVP_PKEY_bits(EVP_PKEY *pkey) { #ifndef NO_RSA if (pkey->type == EVP_PKEY_RSA) @@ -87,8 +86,7 @@ EVP_PKEY *pkey; return(0); } -int EVP_PKEY_size(pkey) -EVP_PKEY *pkey; +int EVP_PKEY_size(EVP_PKEY *pkey) { if (pkey == NULL) return(0); @@ -104,9 +102,7 @@ EVP_PKEY *pkey; return(0); } -int EVP_PKEY_save_parameters(pkey,mode) -EVP_PKEY *pkey; -int mode; +int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) { #ifndef NO_DSA if (pkey->type == EVP_PKEY_DSA) @@ -121,8 +117,7 @@ int mode; return(0); } -int EVP_PKEY_copy_parameters(to,from) -EVP_PKEY *to,*from; +int EVP_PKEY_copy_parameters(EVP_PKEY *to, EVP_PKEY *from) { if (to->type != from->type) { @@ -158,8 +153,7 @@ err: return(0); } -int EVP_PKEY_missing_parameters(pkey) -EVP_PKEY *pkey; +int EVP_PKEY_missing_parameters(EVP_PKEY *pkey) { #ifndef NO_DSA if (pkey->type == EVP_PKEY_DSA) @@ -174,8 +168,7 @@ EVP_PKEY *pkey; return(0); } -int EVP_PKEY_cmp_parameters(a,b) -EVP_PKEY *a,*b; +int EVP_PKEY_cmp_parameters(EVP_PKEY *a, EVP_PKEY *b) { #ifndef NO_DSA if ((a->type == EVP_PKEY_DSA) && (b->type == EVP_PKEY_DSA)) @@ -191,7 +184,7 @@ EVP_PKEY *a,*b; return(-1); } -EVP_PKEY *EVP_PKEY_new() +EVP_PKEY *EVP_PKEY_new(void) { EVP_PKEY *ret; @@ -209,10 +202,7 @@ EVP_PKEY *EVP_PKEY_new() return(ret); } -int EVP_PKEY_assign(pkey,type,key) -EVP_PKEY *pkey; -int type; -char *key; +int EVP_PKEY_assign(EVP_PKEY *pkey, int type, char *key) { if (pkey == NULL) return(0); if (pkey->pkey.ptr != NULL) @@ -223,8 +213,7 @@ char *key; return(1); } -int EVP_PKEY_type(type) -int type; +int EVP_PKEY_type(int type) { switch (type) { @@ -244,8 +233,7 @@ int type; } } -void EVP_PKEY_free(x) -EVP_PKEY *x; +void EVP_PKEY_free(EVP_PKEY *x) { int i; @@ -267,8 +255,7 @@ EVP_PKEY *x; Free((char *)x); } -static void EVP_PKEY_free_it(x) -EVP_PKEY *x; +static void EVP_PKEY_free_it(EVP_PKEY *x) { switch (x->type) { diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c index 28a8e02252..e6af915c01 100644 --- a/crypto/evp/p_open.c +++ b/crypto/evp/p_open.c @@ -62,13 +62,8 @@ #include "objects.h" #include "x509.h" -int EVP_OpenInit(ctx,type,ek,ekl,iv,priv) -EVP_CIPHER_CTX *ctx; -EVP_CIPHER *type; -unsigned char *ek; -int ekl; -unsigned char *iv; -EVP_PKEY *priv; +int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, + int ekl, unsigned char *iv, EVP_PKEY *priv) { unsigned char *key=NULL; int i,size=0,ret=0; @@ -106,10 +101,7 @@ err: return(ret); } -int EVP_OpenFinal(ctx,out,outl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; +int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { int i; diff --git a/crypto/evp/p_seal.c b/crypto/evp/p_seal.c index 09a408de35..618bdc10b6 100644 --- a/crypto/evp/p_seal.c +++ b/crypto/evp/p_seal.c @@ -64,14 +64,8 @@ #include "objects.h" #include "x509.h" -int EVP_SealInit(ctx,type,ek,ekl,iv,pubk,npubk) -EVP_CIPHER_CTX *ctx; -EVP_CIPHER *type; -unsigned char **ek; -int *ekl; -unsigned char *iv; -EVP_PKEY **pubk; -int npubk; +int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, + int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk) { unsigned char key[EVP_MAX_KEY_LENGTH]; int i; @@ -105,10 +99,7 @@ int inl; } */ -void EVP_SealFinal(ctx,out,outl) -EVP_CIPHER_CTX *ctx; -unsigned char *out; -int *outl; +void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) { EVP_EncryptFinal(ctx,out,outl); EVP_EncryptInit(ctx,NULL,NULL,NULL); diff --git a/crypto/evp/p_sign.c b/crypto/evp/p_sign.c index 4b34206083..2eeb4107d6 100644 --- a/crypto/evp/p_sign.c +++ b/crypto/evp/p_sign.c @@ -63,27 +63,20 @@ #include "x509.h" #ifdef undef -void EVP_SignInit(ctx,type) -EVP_MD_CTX *ctx; -EVP_MD *type; +void EVP_SignInit(EVP_MD_CTX *ctx, EVP_MD *type) { EVP_DigestInit(ctx,type); } -void EVP_SignUpdate(ctx,data,count) -EVP_MD_CTX *ctx; -unsigned char *data; -unsigned int count; +void EVP_SignUpdate(EVP_MD_CTX *ctx, unsigned char *data, + unsigned int count) { EVP_DigestUpdate(ctx,data,count); } #endif -int EVP_SignFinal(ctx,sigret,siglen,pkey) -EVP_MD_CTX *ctx; -unsigned char *sigret; -unsigned int *siglen; -EVP_PKEY *pkey; +int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, + EVP_PKEY *pkey) { unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c index 0a9bb05a74..0142ecbf0c 100644 --- a/crypto/evp/p_verify.c +++ b/crypto/evp/p_verify.c @@ -62,11 +62,8 @@ #include "objects.h" #include "x509.h" -int EVP_VerifyFinal(ctx,sigbuf,siglen,pkey) -EVP_MD_CTX *ctx; -unsigned char *sigbuf; -unsigned int siglen; -EVP_PKEY *pkey; +int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey) { unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; diff --git a/crypto/ex_data.c b/crypto/ex_data.c index 42b8b9d1ba..01d1e51693 100644 --- a/crypto/ex_data.c +++ b/crypto/ex_data.c @@ -63,14 +63,8 @@ #include "lhash.h" #include "cryptlib.h" -int CRYPTO_get_ex_new_index(idx,skp,argl,argp,new_func,dup_func,free_func) -int idx; -STACK **skp; -long argl; -char *argp; -int (*new_func)(); -int (*dup_func)(); -void (*free_func)(); +int CRYPTO_get_ex_new_index(int idx, STACK **skp, long argl, char *argp, + int (*new_func)(), int (*dup_func)(), void (*free_func)()) { int ret= -1; CRYPTO_EX_DATA_FUNCS *a; @@ -110,10 +104,7 @@ err: return(idx); } -int CRYPTO_set_ex_data(ad,idx,val) -CRYPTO_EX_DATA *ad; -int idx; -char *val; +int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, char *val) { int i; @@ -140,9 +131,7 @@ char *val; return(1); } -char *CRYPTO_get_ex_data(ad,idx) -CRYPTO_EX_DATA *ad; -int idx; +char *CRYPTO_get_ex_data(CRYPTO_EX_DATA *ad, int idx) { if (ad->sk == NULL) return(0); @@ -156,9 +145,8 @@ int idx; * being duplicated, a pointer to the * 'new' object to be inserted, the index, and the argi/argp */ -int CRYPTO_dup_ex_data(meth,to,from) -STACK *meth; -CRYPTO_EX_DATA *to,*from; +int CRYPTO_dup_ex_data(STACK *meth, CRYPTO_EX_DATA *to, + CRYPTO_EX_DATA *from) { int i,j,m,r; CRYPTO_EX_DATA_FUNCS *mm; @@ -184,10 +172,7 @@ CRYPTO_EX_DATA *to,*from; } /* Call each free callback */ -void CRYPTO_free_ex_data(meth,obj,ad) -STACK *meth; -char *obj; -CRYPTO_EX_DATA *ad; +void CRYPTO_free_ex_data(STACK *meth, char *obj, CRYPTO_EX_DATA *ad) { CRYPTO_EX_DATA_FUNCS *m; char *ptr; @@ -213,10 +198,7 @@ CRYPTO_EX_DATA *ad; } } -void CRYPTO_new_ex_data(meth,obj,ad) -STACK *meth; -char *obj; -CRYPTO_EX_DATA *ad; +void CRYPTO_new_ex_data(STACK *meth, char *obj, CRYPTO_EX_DATA *ad) { CRYPTO_EX_DATA_FUNCS *m; char *ptr; diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index ead5f649f8..64c5162130 100644 --- a/crypto/hmac/hmac.c +++ b/crypto/hmac/hmac.c @@ -60,11 +60,7 @@ #include #include "hmac.h" -void HMAC_Init(ctx,key,len,md) -HMAC_CTX *ctx; -unsigned char *key; -int len; -const EVP_MD *md; +void HMAC_Init(HMAC_CTX *ctx, unsigned char *key, int len, const EVP_MD *md) { int i,j,reset=0; unsigned char pad[HMAC_MAX_MD_CBLOCK]; @@ -112,18 +108,12 @@ const EVP_MD *md; memcpy(&ctx->md_ctx,&ctx->i_ctx,sizeof(ctx->i_ctx)); } -void HMAC_Update(ctx,data,len) -HMAC_CTX *ctx; -unsigned char *data; -int len; +void HMAC_Update(HMAC_CTX *ctx, unsigned char *data, int len) { EVP_DigestUpdate(&(ctx->md_ctx),data,len); } -void HMAC_Final(ctx,md,len) -HMAC_CTX *ctx; -unsigned char *md; -unsigned int *len; +void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) { int j; unsigned int i; @@ -137,20 +127,13 @@ unsigned int *len; EVP_DigestFinal(&(ctx->md_ctx),md,len); } -void HMAC_cleanup(ctx) -HMAC_CTX *ctx; +void HMAC_cleanup(HMAC_CTX *ctx) { memset(ctx,0,sizeof(HMAC_CTX)); } -unsigned char *HMAC(evp_md,key,key_len,d,n,md,md_len) -EVP_MD *evp_md; -unsigned char *key; -int key_len; -unsigned char *d; -int n; -unsigned char *md; -unsigned int *md_len; +unsigned char *HMAC(EVP_MD *evp_md, unsigned char *key, int key_len, + unsigned char *d, int n, unsigned char *md, unsigned int *md_len) { HMAC_CTX c; static unsigned char m[EVP_MAX_MD_SIZE]; diff --git a/crypto/hmac/hmactest.c b/crypto/hmac/hmactest.c index 5938e375dc..13b3946348 100644 --- a/crypto/hmac/hmactest.c +++ b/crypto/hmac/hmactest.c @@ -108,9 +108,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; char *p; @@ -135,8 +133,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; diff --git a/crypto/idea/i_cbc.c b/crypto/idea/i_cbc.c index 716ea3f474..13b255e948 100644 --- a/crypto/idea/i_cbc.c +++ b/crypto/idea/i_cbc.c @@ -59,13 +59,8 @@ #include "idea.h" #include "idea_lcl.h" -void idea_cbc_encrypt(in, out, length, ks, iv, encrypt) -unsigned char *in; -unsigned char *out; -long length; -IDEA_KEY_SCHEDULE *ks; -unsigned char *iv; -int encrypt; +void idea_cbc_encrypt(unsigned char *in, unsigned char *out, long length, + IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int encrypt) { register unsigned long tin0,tin1; register unsigned long tout0,tout1,xor0,xor1; @@ -138,9 +133,7 @@ int encrypt; tin[0]=tin[1]=0; } -void idea_encrypt(d,key) -unsigned long *d; -IDEA_KEY_SCHEDULE *key; +void idea_encrypt(unsigned long *d, IDEA_KEY_SCHEDULE *key) { register IDEA_INT *p; register unsigned long x1,x2,x3,x4,t0,t1,ul; diff --git a/crypto/idea/i_cfb64.c b/crypto/idea/i_cfb64.c index 8dfa7ece48..8dda0fbe70 100644 --- a/crypto/idea/i_cfb64.c +++ b/crypto/idea/i_cfb64.c @@ -64,14 +64,9 @@ * 64bit block we have used is contained in *num; */ -void idea_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) -unsigned char *in; -unsigned char *out; -long length; -IDEA_KEY_SCHEDULE *schedule; -unsigned char *ivec; -int *num; -int encrypt; +void idea_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + IDEA_KEY_SCHEDULE *schedule, unsigned char *ivec, int *num, + int encrypt) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/idea/i_ecb.c b/crypto/idea/i_ecb.c index 17d014a3f3..9ebaf40913 100644 --- a/crypto/idea/i_ecb.c +++ b/crypto/idea/i_ecb.c @@ -62,7 +62,7 @@ const char *IDEA_version="IDEA" OPENSSL_VERSION_PTEXT; -const char *idea_options() +const char *idea_options(void) { if (sizeof(short) != sizeof(IDEA_INT)) return("idea(int)"); @@ -70,10 +70,8 @@ const char *idea_options() return("idea(short)"); } -void idea_ecb_encrypt(in, out, ks) -unsigned char *in; -unsigned char *out; -IDEA_KEY_SCHEDULE *ks; +void idea_ecb_encrypt(unsigned char *in, unsigned char *out, + IDEA_KEY_SCHEDULE *ks) { unsigned long l0,l1,d[2]; diff --git a/crypto/idea/i_ofb64.c b/crypto/idea/i_ofb64.c index d687adb22d..cf60ff98e2 100644 --- a/crypto/idea/i_ofb64.c +++ b/crypto/idea/i_ofb64.c @@ -63,13 +63,8 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void idea_ofb64_encrypt(in, out, length, schedule, ivec, num) -unsigned char *in; -unsigned char *out; -long length; -IDEA_KEY_SCHEDULE *schedule; -unsigned char *ivec; -int *num; +void idea_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, + IDEA_KEY_SCHEDULE *schedule, unsigned char *ivec, int *num) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/idea/i_skey.c b/crypto/idea/i_skey.c index 00fcc1e586..3733be0b60 100644 --- a/crypto/idea/i_skey.c +++ b/crypto/idea/i_skey.c @@ -65,9 +65,7 @@ static IDEA_INT inverse(unsigned int xin); static IDEA_INT inverse(); #endif -void idea_set_encrypt_key(key, ks) -unsigned char *key; -IDEA_KEY_SCHEDULE *ks; +void idea_set_encrypt_key(unsigned char *key, IDEA_KEY_SCHEDULE *ks) { int i; register IDEA_INT *kt,*kf,r0,r1,r2; @@ -101,9 +99,7 @@ IDEA_KEY_SCHEDULE *ks; } } -void idea_set_decrypt_key(ek, dk) -IDEA_KEY_SCHEDULE *ek; -IDEA_KEY_SCHEDULE *dk; +void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk) { int r; register IDEA_INT *fp,*tp,t; @@ -133,8 +129,7 @@ IDEA_KEY_SCHEDULE *dk; } /* taken directly from the 'paper' I'll have a look at it later */ -static IDEA_INT inverse(xin) -unsigned int xin; +static IDEA_INT inverse(unsigned int xin) { long n1,n2,q,r,b1,b2,t; diff --git a/crypto/idea/idea_spd.c b/crypto/idea/idea_spd.c index 98060d9b8c..704538d41f 100644 --- a/crypto/idea/idea_spd.c +++ b/crypto/idea/idea_spd.c @@ -135,8 +135,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +148,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +184,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/idea/ideatest.c b/crypto/idea/ideatest.c index 6eff9029cc..542ece4aa3 100644 --- a/crypto/idea/ideatest.c +++ b/crypto/idea/ideatest.c @@ -103,9 +103,7 @@ static int cfb64_test(); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; IDEA_KEY_SCHEDULE key,dkey; @@ -171,8 +169,7 @@ char *argv[]; return(err); } -static int cfb64_test(cfb_cipher) -unsigned char *cfb_cipher; +static int cfb64_test(unsigned char *cfb_cipher) { IDEA_KEY_SCHEDULE eks,dks; int err=0,i,n; @@ -210,8 +207,7 @@ unsigned char *cfb_cipher; return(err); } -static char *pt(p) -unsigned char *p; +static char *pt(unsigned char *p) { static char bufs[10][20]; static int bnum=0; diff --git a/crypto/lhash/lh_stats.c b/crypto/lhash/lh_stats.c index 23fe82f777..44ddff56c4 100644 --- a/crypto/lhash/lh_stats.c +++ b/crypto/lhash/lh_stats.c @@ -67,9 +67,7 @@ #ifndef HEADER_BIO_H -void lh_stats(lh, out) -LHASH *lh; -FILE *out; +void lh_stats(LHASH *lh, FILE *out) { fprintf(out,"num_items = %lu\n",lh->num_items); fprintf(out,"num_nodes = %u\n",lh->num_nodes); @@ -95,9 +93,7 @@ FILE *out; #endif } -void lh_node_stats(lh, out) -LHASH *lh; -FILE *out; +void lh_node_stats(LHASH *lh, FILE *out) { LHASH_NODE *n; unsigned int i,num; @@ -110,9 +106,7 @@ FILE *out; } } -void lh_node_usage_stats(lh, out) -LHASH *lh; -FILE *out; +void lh_node_usage_stats(LHASH *lh, FILE *out) { LHASH_NODE *n; unsigned long num; @@ -142,9 +136,7 @@ FILE *out; #else #ifndef NO_FP_API -void lh_stats(lh,fp) -LHASH *lh; -FILE *fp; +void lh_stats(LHASH *lh, FILE *fp) { BIO *bp; @@ -156,9 +148,7 @@ FILE *fp; end:; } -void lh_node_stats(lh,fp) -LHASH *lh; -FILE *fp; +void lh_node_stats(LHASH *lh, FILE *fp) { BIO *bp; @@ -170,9 +160,7 @@ FILE *fp; end:; } -void lh_node_usage_stats(lh,fp) -LHASH *lh; -FILE *fp; +void lh_node_usage_stats(LHASH *lh, FILE *fp) { BIO *bp; @@ -186,9 +174,7 @@ end:; #endif -void lh_stats_bio(lh, out) -LHASH *lh; -BIO *out; +void lh_stats_bio(LHASH *lh, BIO *out) { char buf[128]; @@ -236,9 +222,7 @@ BIO *out; #endif } -void lh_node_stats_bio(lh, out) -LHASH *lh; -BIO *out; +void lh_node_stats_bio(LHASH *lh, BIO *out) { LHASH_NODE *n; unsigned int i,num; @@ -253,9 +237,7 @@ BIO *out; } } -void lh_node_usage_stats_bio(lh, out) -LHASH *lh; -BIO *out; +void lh_node_usage_stats_bio(LHASH *lh, BIO *out) { LHASH_NODE *n; unsigned long num; diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c index cd56515df7..29e091525c 100644 --- a/crypto/lhash/lhash.c +++ b/crypto/lhash/lhash.c @@ -125,9 +125,7 @@ static LHASH_NODE **getrn(); #endif -LHASH *lh_new(h, c) -unsigned long (*h)(); -int (*c)(); +LHASH *lh_new(unsigned long (*h)(), int (*c)()) { LHASH *ret; int i; @@ -170,8 +168,7 @@ err0: return(NULL); } -void lh_free(lh) -LHASH *lh; +void lh_free(LHASH *lh) { unsigned int i; LHASH_NODE *n,*nn; @@ -193,9 +190,7 @@ LHASH *lh; Free((char *)lh); } -char *lh_insert(lh, data) -LHASH *lh; -char *data; +char *lh_insert(LHASH *lh, char *data) { unsigned long hash; LHASH_NODE *nn,**rn; @@ -233,9 +228,7 @@ char *data; return(ret); } -char *lh_delete(lh, data) -LHASH *lh; -char *data; +char *lh_delete(LHASH *lh, char *data) { unsigned long hash; LHASH_NODE *nn,**rn; @@ -266,9 +259,7 @@ char *data; return(ret); } -char *lh_retrieve(lh, data) -LHASH *lh; -char *data; +char *lh_retrieve(LHASH *lh, char *data) { unsigned long hash; LHASH_NODE **rn; @@ -290,17 +281,12 @@ char *data; return(ret); } -void lh_doall(lh, func) -LHASH *lh; -void (*func)(); +void lh_doall(LHASH *lh, void (*func)()) { lh_doall_arg(lh,func,NULL); } -void lh_doall_arg(lh, func, arg) -LHASH *lh; -void (*func)(); -char *arg; +void lh_doall_arg(LHASH *lh, void (*func)(), char *arg) { int i; LHASH_NODE *a,*n; @@ -321,8 +307,7 @@ char *arg; } } -static void expand(lh) -LHASH *lh; +static void expand(LHASH *lh) { LHASH_NODE **n,**n1,**n2,*np; unsigned int p,i,j; @@ -378,8 +363,7 @@ LHASH *lh; } } -static void contract(lh) -LHASH *lh; +static void contract(LHASH *lh) { LHASH_NODE **n,*n1,*np; @@ -418,10 +402,7 @@ LHASH *lh; } } -static LHASH_NODE **getrn(lh, data, rhash) -LHASH *lh; -char *data; -unsigned long *rhash; +static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash) { LHASH_NODE **ret,*n1; unsigned long hash,nn; @@ -475,8 +456,7 @@ char *str; * no collisions on /usr/dict/words and it distributes on %2^n quite * well, not as good as MD5, but still good. */ -unsigned long lh_strhash(c) -const char *c; +unsigned long lh_strhash(const char *c) { unsigned long ret=0; long n; diff --git a/crypto/md2/md2.c b/crypto/md2/md2.c index 7f3ab64a43..8b34e1defb 100644 --- a/crypto/md2/md2.c +++ b/crypto/md2/md2.c @@ -74,9 +74,7 @@ int read(); void exit(); #endif -int main(argc, argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; FILE *IN; @@ -105,8 +103,7 @@ char *argv[]; return(err); } -void do_fp(f) -FILE *f; +void do_fp(FILE *f) { MD2_CTX c; unsigned char md[MD2_DIGEST_LENGTH]; @@ -125,8 +122,7 @@ FILE *f; pt(md); } -void pt(md) -unsigned char *md; +void pt(unsigned char *md) { int i; diff --git a/crypto/md2/md2_dgst.c b/crypto/md2/md2_dgst.c index a1eb553b35..c1a0b5e680 100644 --- a/crypto/md2/md2_dgst.c +++ b/crypto/md2/md2_dgst.c @@ -112,7 +112,7 @@ static MD2_INT S[256]={ 0xDB, 0x99, 0x8D, 0x33, 0x9F, 0x11, 0x83, 0x14, }; -const char *MD2_options() +const char *MD2_options(void) { if (sizeof(MD2_INT) == 1) return("md2(char)"); @@ -120,8 +120,7 @@ const char *MD2_options() return("md2(int)"); } -void MD2_Init(c) -MD2_CTX *c; +void MD2_Init(MD2_CTX *c) { c->num=0; memset(c->state,0,MD2_BLOCK*sizeof(MD2_INT)); @@ -129,10 +128,7 @@ MD2_CTX *c; memset(c->data,0,MD2_BLOCK); } -void MD2_Update(c, data, len) -MD2_CTX *c; -register unsigned char *data; -unsigned long len; +void MD2_Update(MD2_CTX *c, register unsigned char *data, unsigned long len) { register UCHAR *p; @@ -170,9 +166,7 @@ unsigned long len; c->num=(int)len; } -static void md2_block(c, d) -MD2_CTX *c; -unsigned char *d; +static void md2_block(MD2_CTX *c, unsigned char *d) { register MD2_INT t,*sp1,*sp2; register int i,j; @@ -208,9 +202,7 @@ unsigned char *d; memset(state,0,48*sizeof(MD2_INT)); } -void MD2_Final(md, c) -unsigned char *md; -MD2_CTX *c; +void MD2_Final(unsigned char *md, MD2_CTX *c) { int i,v; register UCHAR *cp; diff --git a/crypto/md2/md2_one.c b/crypto/md2/md2_one.c index 513bf62fdb..389c1f79f2 100644 --- a/crypto/md2/md2_one.c +++ b/crypto/md2/md2_one.c @@ -63,10 +63,7 @@ /* This is a separate file so that #defines in cryptlib.h can * map my MD functions to different names */ -unsigned char *MD2(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *MD2(unsigned char *d, unsigned long n, unsigned char *md) { MD2_CTX c; static unsigned char m[MD2_DIGEST_LENGTH]; diff --git a/crypto/md2/md2test.c b/crypto/md2/md2test.c index 55924d44cd..688815dcfe 100644 --- a/crypto/md2/md2test.c +++ b/crypto/md2/md2test.c @@ -88,9 +88,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; char **P,**R; @@ -118,8 +116,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; diff --git a/crypto/md5/md5.c b/crypto/md5/md5.c index 9d6f5a6003..d37db034aa 100644 --- a/crypto/md5/md5.c +++ b/crypto/md5/md5.c @@ -72,9 +72,7 @@ void pt(); int read(); #endif -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int i,err=0; FILE *IN; @@ -102,8 +100,7 @@ char **argv; exit(err); } -void do_fp(f) -FILE *f; +void do_fp(FILE *f) { MD5_CTX c; unsigned char md[MD5_DIGEST_LENGTH]; @@ -123,8 +120,7 @@ FILE *f; pt(md); } -void pt(md) -unsigned char *md; +void pt(unsigned char *md) { int i; diff --git a/crypto/md5/md5_dgst.c b/crypto/md5/md5_dgst.c index ba33a4f476..104918909a 100644 --- a/crypto/md5/md5_dgst.c +++ b/crypto/md5/md5_dgst.c @@ -86,8 +86,7 @@ char *MD5_version="MD5" OPENSSL_VERSION_PTEXT; # endif #endif -void MD5_Init(c) -MD5_CTX *c; +void MD5_Init(MD5_CTX *c) { c->A=INIT_DATA_A; c->B=INIT_DATA_B; @@ -98,10 +97,7 @@ MD5_CTX *c; c->num=0; } -void MD5_Update(c, _data, len) -MD5_CTX *c; -const void *_data; -unsigned long len; +void MD5_Update(MD5_CTX *c, const void *_data, unsigned long len) { register const unsigned char *data=_data; register ULONG *p; @@ -232,9 +228,7 @@ unsigned long len; } } -void MD5_Transform(c,b) -MD5_CTX *c; -unsigned char *b; +void MD5_Transform(MD5_CTX *c, unsigned char *b) { ULONG p[16]; #if !defined(L_ENDIAN) @@ -271,10 +265,7 @@ unsigned char *b; #ifndef MD5_ASM -static void md5_block(c, X, num) -MD5_CTX *c; -register ULONG *X; -int num; +static void md5_block(MD5_CTX *c, register ULONG *X, int num) { register ULONG A,B,C,D; @@ -368,9 +359,7 @@ int num; } #endif -void MD5_Final(md, c) -unsigned char *md; -MD5_CTX *c; +void MD5_Final(unsigned char *md, MD5_CTX *c) { register int i,j; register ULONG l; @@ -425,8 +414,7 @@ MD5_CTX *c; } #ifdef undef -int printit(l) -unsigned long *l; +int printit(unsigned long *l) { int i,ii; diff --git a/crypto/md5/md5_one.c b/crypto/md5/md5_one.c index ab6bb435f9..c761401160 100644 --- a/crypto/md5/md5_one.c +++ b/crypto/md5/md5_one.c @@ -59,10 +59,7 @@ #include #include "md5_locl.h" -unsigned char *MD5(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md) { MD5_CTX c; static unsigned char m[MD5_DIGEST_LENGTH]; diff --git a/crypto/md5/md5test.c b/crypto/md5/md5test.c index 74b84bc67f..33b204f8e6 100644 --- a/crypto/md5/md5test.c +++ b/crypto/md5/md5test.c @@ -88,9 +88,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; unsigned char **P,**R; @@ -118,8 +116,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; diff --git a/crypto/mdc2/mdc2_one.c b/crypto/mdc2/mdc2_one.c index aa055b66fd..0cfc9c6698 100644 --- a/crypto/mdc2/mdc2_one.c +++ b/crypto/mdc2/mdc2_one.c @@ -60,10 +60,7 @@ #include "cryptlib.h" #include "mdc2.h" -unsigned char *MDC2(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *MDC2(unsigned char *d, unsigned long n, unsigned char *md) { MDC2_CTX c; static unsigned char m[MDC2_DIGEST_LENGTH]; diff --git a/crypto/mdc2/mdc2dgst.c b/crypto/mdc2/mdc2dgst.c index f2803fb58c..193c1445bb 100644 --- a/crypto/mdc2/mdc2dgst.c +++ b/crypto/mdc2/mdc2dgst.c @@ -80,8 +80,7 @@ static void mdc2_body(MDC2_CTX *c, unsigned char *in, unsigned int len); static void mdc2_body(); #endif -void MDC2_Init(c) -MDC2_CTX *c; +void MDC2_Init(MDC2_CTX *c) { c->num=0; c->pad_type=1; @@ -89,10 +88,7 @@ MDC2_CTX *c; memset(&(c->hh[0]),0x25,MDC2_BLOCK); } -void MDC2_Update(c,in,len) -MDC2_CTX *c; -register unsigned char *in; -unsigned long len; +void MDC2_Update(MDC2_CTX *c, register unsigned char *in, unsigned long len) { int i,j; @@ -127,10 +123,7 @@ unsigned long len; } } -static void mdc2_body(c,in,len) -MDC2_CTX *c; -unsigned char *in; -unsigned int len; +static void mdc2_body(MDC2_CTX *c, unsigned char *in, unsigned int len) { register DES_LONG tin0,tin1; register DES_LONG ttin0,ttin1; @@ -168,9 +161,7 @@ unsigned int len; } } -void MDC2_Final(md,c) -unsigned char *md; -MDC2_CTX *c; +void MDC2_Final(unsigned char *md, MDC2_CTX *c) { int i,j; diff --git a/crypto/mdc2/mdc2test.c b/crypto/mdc2/mdc2test.c index 6e7c9a706e..0d42d14241 100644 --- a/crypto/mdc2/mdc2test.c +++ b/crypto/mdc2/mdc2test.c @@ -71,9 +71,7 @@ static unsigned char pad2[16]={ 0x35,0xD8,0x7A,0xFE,0xAB,0x33,0xBE,0xE2 }; -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int ret=0; unsigned char md[MDC2_DIGEST_LENGTH]; diff --git a/crypto/mem.c b/crypto/mem.c index f47ea6b4a2..83085fea07 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -81,8 +81,7 @@ typedef struct mem_st unsigned long order; } MEM; -int CRYPTO_mem_ctrl(mode) -int mode; +int CRYPTO_mem_ctrl(int mode) { int ret=mh_mode; @@ -109,14 +108,12 @@ int mode; return(ret); } -static int mem_cmp(a,b) -MEM *a,*b; +static int mem_cmp(MEM *a, MEM *b) { return(a->addr - b->addr); } -static unsigned long mem_hash(a) -MEM *a; +static unsigned long mem_hash(MEM *a) { unsigned long ret; @@ -132,10 +129,7 @@ static char *(*malloc_func)()= (char *(*)())malloc; static char *(*realloc_func)()= (char *(*)())realloc; static void (*free_func)()= (void (*)())free; -void CRYPTO_set_mem_functions(m,r,f) -char *(*m)(); -char *(*r)(); -void (*f)(); +void CRYPTO_set_mem_functions(char *(*m)(), char *(*r)(), void (*f)()) { if ((m == NULL) || (r == NULL) || (f == NULL)) return; malloc_func=m; @@ -145,69 +139,53 @@ void (*f)(); free_locked_func=f; } -void CRYPTO_set_locked_mem_functions(m,f) -char *(*m)(); -void (*f)(); +void CRYPTO_set_locked_mem_functions(char *(*m)(), void (*f)()) { if ((m == NULL) || (f == NULL)) return; malloc_locked_func=m; free_locked_func=f; } -void CRYPTO_get_mem_functions(m,r,f) -char *(**m)(); -char *(**r)(); -void (**f)(); +void CRYPTO_get_mem_functions(char *(**m)(), char *(**r)(), void (**f)()) { if (m != NULL) *m=malloc_func; if (r != NULL) *r=realloc_func; if (f != NULL) *f=free_func; } -void CRYPTO_get_locked_mem_functions(m,f) -char *(**m)(); -void (**f)(); +void CRYPTO_get_locked_mem_functions(char *(**m)(), void (**f)()) { if (m != NULL) *m=malloc_locked_func; if (f != NULL) *f=free_locked_func; } -void *CRYPTO_malloc_locked(num) -int num; +void *CRYPTO_malloc_locked(int num) { return(malloc_locked_func(num)); } -void CRYPTO_free_locked(str) -void *str; +void CRYPTO_free_locked(void *str) { free_locked_func(str); } -void *CRYPTO_malloc(num) -int num; +void *CRYPTO_malloc(int num) { return(malloc_func(num)); } -void *CRYPTO_realloc(str,num) -void *str; -int num; +void *CRYPTO_realloc(void *str, int num) { return(realloc_func(str,num)); } -void CRYPTO_free(str) -void *str; +void CRYPTO_free(void *str) { free_func(str); } static unsigned long break_order_num=0; -void *CRYPTO_dbg_malloc(num,file,line) -int num; -const char *file; -int line; +void *CRYPTO_dbg_malloc(int num, const char *file, int line) { char *ret; MEM *m,*mm; @@ -258,8 +236,7 @@ err: return(ret); } -void CRYPTO_dbg_free(addr) -void *addr; +void CRYPTO_dbg_free(void *addr) { MEM m,*mp; @@ -277,11 +254,7 @@ void *addr; free_func(addr); } -void *CRYPTO_dbg_realloc(addr,num,file,line) -void *addr; -int num; -const char *file; -int line; +void *CRYPTO_dbg_realloc(void *addr, int num, const char *file, int line) { char *ret; MEM m,*mp; @@ -307,20 +280,14 @@ int line; return(ret); } -void *CRYPTO_remalloc(a,n) -void *a; -int n; +void *CRYPTO_remalloc(void *a, int n) { if (a != NULL) Free(a); a=(char *)Malloc(n); return(a); } -void *CRYPTO_dbg_remalloc(a,n,file,line) -void *a; -int n; -const char *file; -int line; +void *CRYPTO_dbg_remalloc(void *a, int n, const char *file, int line) { if (a != NULL) CRYPTO_dbg_free(a); a=(char *)CRYPTO_dbg_malloc(n,file,line); @@ -335,9 +302,7 @@ typedef struct mem_leak_st long bytes; } MEM_LEAK; -static void print_leak(m,l) -MEM *m; -MEM_LEAK *l; +static void print_leak(MEM *m, MEM_LEAK *l) { char buf[128]; @@ -350,8 +315,7 @@ MEM_LEAK *l; l->bytes+=m->num; } -void CRYPTO_mem_leaks(b) -BIO *b; +void CRYPTO_mem_leaks(BIO *b) { MEM_LEAK ml; char buf[80]; @@ -379,16 +343,13 @@ BIO *b; static void (*mem_cb)()=NULL; -static void cb_leak(m,cb) -MEM *m; -char *cb; +static void cb_leak(MEM *m, char *cb) { void (*mem_callback)()=(void (*)())cb; mem_callback(m->order,m->file,m->line,m->num,m->addr); } -void CRYPTO_mem_leaks_cb(cb) -void (*cb)(); +void CRYPTO_mem_leaks_cb(void (*cb)()) { if (mh == NULL) return; CRYPTO_w_lock(CRYPTO_LOCK_MALLOC); @@ -399,8 +360,7 @@ void (*cb)(); } #ifndef NO_FP_API -void CRYPTO_mem_leaks_fp(fp) -FILE *fp; +void CRYPTO_mem_leaks_fp(FILE *fp) { BIO *b; diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c index c22530612b..8e5c2af964 100644 --- a/crypto/objects/o_names.c +++ b/crypto/objects/o_names.c @@ -17,7 +17,7 @@ static STACK *names_free=NULL; static unsigned long obj_name_hash(OBJ_NAME *a); static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b); -int OBJ_NAME_init() +int OBJ_NAME_init(void) { if (names_lh != NULL) return(1); MemCheck_off(); @@ -26,10 +26,8 @@ int OBJ_NAME_init() return(names_lh != NULL); } -int OBJ_NAME_new_index(hash_func,cmp_func,free_func) -unsigned long (*hash_func)(); -int (*cmp_func)(); -void (*free_func)(); +int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(), + void (*free_func)()) { int ret; int i; @@ -66,9 +64,7 @@ void (*free_func)(); return(ret); } -static int obj_name_cmp(a,b) -OBJ_NAME *a; -OBJ_NAME *b; +static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b) { int ret; int (*cmp)(); @@ -87,8 +83,7 @@ OBJ_NAME *b; return(ret); } -static unsigned long obj_name_hash(a) -OBJ_NAME *a; +static unsigned long obj_name_hash(OBJ_NAME *a) { unsigned long ret; unsigned long (*hash)(); @@ -106,9 +101,7 @@ OBJ_NAME *a; return(ret); } -const char *OBJ_NAME_get(name,type) -const char *name; -int type; +const char *OBJ_NAME_get(const char *name, int type) { OBJ_NAME on,*ret; int num=0,alias; @@ -138,10 +131,7 @@ int type; } } -int OBJ_NAME_add(name,type,data) -const char *name; -int type; -const char *data; +int OBJ_NAME_add(const char *name, int type, const char *data) { void (*f)(); OBJ_NAME *onp,*ret; @@ -186,9 +176,7 @@ const char *data; return(1); } -int OBJ_NAME_remove(name,type) -const char *name; -int type; +int OBJ_NAME_remove(const char *name, int type) { OBJ_NAME on,*ret; void (*f)(); @@ -216,9 +204,8 @@ int type; static int free_type; -static void names_lh_free(onp,type) -OBJ_NAME *onp; - { +static void names_lh_free(OBJ_NAME *onp, int type) +{ if(onp == NULL) return; @@ -228,8 +215,7 @@ OBJ_NAME *onp; } } -void OBJ_NAME_cleanup(type) -int type; +void OBJ_NAME_cleanup(int type) { unsigned long down_load; diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c index 0b572a110d..f42c462ac4 100644 --- a/crypto/objects/obj_dat.c +++ b/crypto/objects/obj_dat.c @@ -103,18 +103,13 @@ typedef struct added_obj_st static int new_nid=NUM_NID; static LHASH *added=NULL; -static int sn_cmp(ap,bp) -ASN1_OBJECT **ap; -ASN1_OBJECT **bp; +static int sn_cmp(ASN1_OBJECT **ap, ASN1_OBJECT **bp) { return(strcmp((*ap)->sn,(*bp)->sn)); } -static int ln_cmp(ap,bp) -ASN1_OBJECT **ap; -ASN1_OBJECT **bp; +static int ln_cmp(ASN1_OBJECT **ap, ASN1_OBJECT **bp) { return(strcmp((*ap)->ln,(*bp)->ln)); } -static unsigned long add_hash(ca) -ADDED_OBJ *ca; +static unsigned long add_hash(ADDED_OBJ *ca) { ASN1_OBJECT *a; int i; @@ -147,8 +142,7 @@ ADDED_OBJ *ca; return(ret); } -static int add_cmp(ca,cb) -ADDED_OBJ *ca,*cb; +static int add_cmp(ADDED_OBJ *ca, ADDED_OBJ *cb) { ASN1_OBJECT *a,*b; int i; @@ -179,15 +173,14 @@ ADDED_OBJ *ca,*cb; return(1); /* should not get here */ } -static int init_added() +static int init_added(void) { if (added != NULL) return(1); added=lh_new(add_hash,add_cmp); return(added != NULL); } -static void cleanup1(a) -ADDED_OBJ *a; +static void cleanup1(ADDED_OBJ *a) { a->obj->nid=0; a->obj->flags|=ASN1_OBJECT_FLAG_DYNAMIC| @@ -195,19 +188,17 @@ ADDED_OBJ *a; ASN1_OBJECT_FLAG_DYNAMIC_DATA; } -static void cleanup2(a) -ADDED_OBJ *a; +static void cleanup2(ADDED_OBJ *a) { a->obj->nid++; } -static void cleanup3(a) -ADDED_OBJ *a; +static void cleanup3(ADDED_OBJ *a) { if (--a->obj->nid == 0) ASN1_OBJECT_free(a->obj); Free(a); } -void OBJ_cleanup() +void OBJ_cleanup(void) { if (added == NULL) return; added->down_load=0; @@ -218,8 +209,7 @@ void OBJ_cleanup() added=NULL; } -int OBJ_new_nid(num) -int num; +int OBJ_new_nid(int num) { int i; @@ -228,8 +218,7 @@ int num; return(i); } -int OBJ_add_object(obj) -ASN1_OBJECT *obj; +int OBJ_add_object(ASN1_OBJECT *obj) { ASN1_OBJECT *o; ADDED_OBJ *ao[4],*aop; @@ -273,8 +262,7 @@ err: return(NID_undef); } -ASN1_OBJECT *OBJ_nid2obj(n) -int n; +ASN1_OBJECT *OBJ_nid2obj(int n) { ADDED_OBJ ad,*adp; ASN1_OBJECT ob; @@ -306,8 +294,7 @@ int n; } } -const char *OBJ_nid2sn(n) -int n; +const char *OBJ_nid2sn(int n) { ADDED_OBJ ad,*adp; ASN1_OBJECT ob; @@ -339,8 +326,7 @@ int n; } } -const char *OBJ_nid2ln(n) -int n; +const char *OBJ_nid2ln(int n) { ADDED_OBJ ad,*adp; ASN1_OBJECT ob; @@ -372,8 +358,7 @@ int n; } } -int OBJ_obj2nid(a) -ASN1_OBJECT *a; +int OBJ_obj2nid(ASN1_OBJECT *a) { ASN1_OBJECT **op; ADDED_OBJ ad,*adp; @@ -403,9 +388,7 @@ ASN1_OBJECT *a; * it can be used with any objects, not just registered ones. */ -ASN1_OBJECT *OBJ_txt2obj(s, no_name) -const char *s; -int no_name; +ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name) { int nid = NID_undef; ASN1_OBJECT *op=NULL; @@ -442,8 +425,7 @@ int no_name; return op; } -int OBJ_txt2nid(s) -char *s; +int OBJ_txt2nid(char *s) { ASN1_OBJECT *obj; int nid; @@ -453,8 +435,7 @@ char *s; return nid; } -int OBJ_ln2nid(s) -const char *s; +int OBJ_ln2nid(const char *s) { ASN1_OBJECT o,*oo= &o,**op; ADDED_OBJ ad,*adp; @@ -473,8 +454,7 @@ const char *s; return((*op)->nid); } -int OBJ_sn2nid(s) -const char *s; +int OBJ_sn2nid(const char *s) { ASN1_OBJECT o,*oo= &o,**op; ADDED_OBJ ad,*adp; @@ -493,9 +473,7 @@ const char *s; return((*op)->nid); } -static int obj_cmp(ap, bp) -ASN1_OBJECT **ap; -ASN1_OBJECT **bp; +static int obj_cmp(ASN1_OBJECT **ap, ASN1_OBJECT **bp) { int j; ASN1_OBJECT *a= *ap; @@ -506,12 +484,7 @@ ASN1_OBJECT **bp; return(memcmp(a->data,b->data,a->length)); } -char *OBJ_bsearch(key,base,num,size,cmp) -char *key; -char *base; -int num; -int size; -int (*cmp)(); +char *OBJ_bsearch(char *key, char *base, int num, int size, int (*cmp)()) { int l,h,i,c; char *p; @@ -534,8 +507,7 @@ int (*cmp)(); return(NULL); } -int OBJ_create_objects(in) -BIO *in; +int OBJ_create_objects(BIO *in) { MS_STATIC char buf[512]; int i,num=0; @@ -583,10 +555,7 @@ BIO *in; /* return(num); */ } -int OBJ_create(oid,sn,ln) -char *oid; -char *sn; -char *ln; +int OBJ_create(char *oid, char *sn, char *ln) { int ok=0; ASN1_OBJECT *op=NULL; diff --git a/crypto/objects/obj_err.c b/crypto/objects/obj_err.c index 5625306021..50d52060b7 100644 --- a/crypto/objects/obj_err.c +++ b/crypto/objects/obj_err.c @@ -80,7 +80,7 @@ static ERR_STRING_DATA OBJ_str_reasons[]= #endif -void ERR_load_OBJ_strings() +void ERR_load_OBJ_strings(void) { static int init=1; diff --git a/crypto/objects/obj_lib.c b/crypto/objects/obj_lib.c index ba30736dc7..1f0b906048 100644 --- a/crypto/objects/obj_lib.c +++ b/crypto/objects/obj_lib.c @@ -62,8 +62,7 @@ #include "objects.h" #include "buffer.h" -ASN1_OBJECT *OBJ_dup(o) -ASN1_OBJECT *o; +ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o) { ASN1_OBJECT *r; int i; @@ -117,9 +116,7 @@ err: return(NULL); } -int OBJ_cmp(a,b) -ASN1_OBJECT *a; -ASN1_OBJECT *b; +int OBJ_cmp(ASN1_OBJECT *a, ASN1_OBJECT *b) { int ret; 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; 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; diff --git a/crypto/pkcs7/bio_ber.c b/crypto/pkcs7/bio_ber.c index df4d9a5223..c765469eee 100644 --- a/crypto/pkcs7/bio_ber.c +++ b/crypto/pkcs7/bio_ber.c @@ -128,13 +128,12 @@ static BIO_METHOD methods_ber= ber_free, }; -BIO_METHOD *BIO_f_ber() +BIO_METHOD *BIO_f_ber(void) { return(&methods_ber); } -static int ber_new(bi) -BIO *bi; +static int ber_new(BIO *bi) { BIO_BER_CTX *ctx; @@ -149,8 +148,7 @@ BIO *bi; return(1); } -static int ber_free(a) -BIO *a; +static int ber_free(BIO *a) { BIO_BER_CTX *b; @@ -164,9 +162,7 @@ BIO *a; return(1); } -int bio_ber_get_header(bio,ctx) -BIO *bio; -BIO_BER_CTX *ctx; +int bio_ber_get_header(BIO *bio, BIO_BER_CTX *ctx) { char buf[64]; int i,j,n; @@ -236,10 +232,7 @@ BIO_BER_CTX *ctx; if (ret & V_ASN1_CONSTRUCTED) } -static int ber_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int ber_read(BIO *b, char *out, int outl) { int ret=0,i,n; BIO_BER_CTX *ctx; @@ -286,10 +279,7 @@ again: } } -static int ber_write(b,in,inl) -BIO *b; -char *in; -int inl; +static int ber_write(BIO *b, char *in, int inl) { int ret=0,n,i; BIO_ENC_CTX *ctx; @@ -344,11 +334,7 @@ int inl; return(ret); } -static long ber_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long ber_ctrl(BIO *b, int cmd, long num, char *ptr) { BIO *dbio; BIO_ENC_CTX *ctx,*dctx; @@ -454,12 +440,8 @@ EVP_CIPHER_ctx *c; } */ -void BIO_set_cipher(b,c,k,i,e) -BIO *b; -EVP_CIPHER *c; -unsigned char *k; -unsigned char *i; -int e; +void BIO_set_cipher(BIO *b, EVP_CIPHER *c, unsigned char *k, unsigned char *i, + int e) { BIO_ENC_CTX *ctx; diff --git a/crypto/pkcs7/dec.c b/crypto/pkcs7/dec.c index 2622cbd696..e02a8059c1 100644 --- a/crypto/pkcs7/dec.c +++ b/crypto/pkcs7/dec.c @@ -192,9 +192,7 @@ err: } /* should be X509 * but we can just have them as char *. */ -int verify_callback(ok, ctx) -int ok; -X509_STORE_CTX *ctx; +int verify_callback(int ok, X509_STORE_CTX *ctx) { char buf[256]; X509 *err_cert; diff --git a/crypto/pkcs7/example.c b/crypto/pkcs7/example.c index 7dd81e3023..70e6b6a023 100644 --- a/crypto/pkcs7/example.c +++ b/crypto/pkcs7/example.c @@ -3,8 +3,7 @@ #include #include "pkcs7.h" -int add_signed_time(si) -PKCS7_SIGNER_INFO *si; +int add_signed_time(PKCS7_SIGNER_INFO *si) { ASN1_UTCTIME *sign_time; @@ -16,8 +15,7 @@ PKCS7_SIGNER_INFO *si; return(1); } -ASN1_UTCTIME *get_signed_time(si) -PKCS7_SIGNER_INFO *si; +ASN1_UTCTIME *get_signed_time(PKCS7_SIGNER_INFO *si) { ASN1_TYPE *so; ASN1_UTCTIME *ut; @@ -32,9 +30,7 @@ PKCS7_SIGNER_INFO *si; static int signed_string_nid= -1; -int add_signed_string(si,str) -PKCS7_SIGNER_INFO *si; -char *str; +int add_signed_string(PKCS7_SIGNER_INFO *si, char *str) { ASN1_OCTET_STRING *os; @@ -49,10 +45,7 @@ char *str; V_ASN1_OCTET_STRING,(char *)os); } -int get_signed_string(si,buf,len) -PKCS7_SIGNER_INFO *si; -char *buf; -int len; +int get_signed_string(PKCS7_SIGNER_INFO *si, char *buf, int len) { ASN1_TYPE *so; ASN1_OCTET_STRING *os; @@ -80,13 +73,10 @@ int len; static signed_seq2string_nid= -1; /* ########################################### */ -int add_signed_seq2string(si,str1,str2) -PKCS7_SIGNER_INFO *si; -char *str1; -char *str2; +int add_signed_seq2string(PKCS7_SIGNER_INFO *si, char *str1, char *str2) + { /* To add an object of OID 1.9.999, which is a sequence containing * 2 octet strings */ - { unsigned char *p; ASN1_OCTET_STRING *os1,*os2; ASN1_STRING *seq; @@ -123,10 +113,7 @@ char *str2; } /* For this case, I will malloc the return strings */ -int get_signed_seq2string(si,str1,str2) -PKCS7_SIGNER_INFO *si; -char **str1; -char **str2; +int get_signed_seq2string(PKCS7_SIGNER_INFO *si, char **str1, char **str2) { ASN1_TYPE *so; @@ -178,7 +165,7 @@ err: * THE OTHER WAY TO DO THINGS * ####################################### */ -X509_ATTRIBUTE *create_time() +X509_ATTRIBUTE *create_time(void) { ASN1_UTCTIME *sign_time; X509_ATTRIBUTE *ret; @@ -191,8 +178,7 @@ X509_ATTRIBUTE *create_time() return(ret); } -ASN1_UTCTIME *sk_get_time(sk) -STACK *sk; +ASN1_UTCTIME *sk_get_time(STACK *sk) { ASN1_TYPE *so; ASN1_UTCTIME *ut; @@ -207,8 +193,7 @@ STACK *sk; return(ut); } -X509_ATTRIBUTE *create_string(si,str) -char *str; +X509_ATTRIBUTE *create_string(char *str) { ASN1_OCTET_STRING *os; X509_ATTRIBUTE *ret; @@ -225,10 +210,7 @@ char *str; return(ret); } -int sk_get_string(sk,buf,len) -STACK *sk; -char *buf; -int len; +int sk_get_string(STACK *sk, char *buf, int len) { ASN1_TYPE *so; ASN1_OCTET_STRING *os; @@ -257,13 +239,10 @@ int len; return(0); } -X509_ATTRIBUTE *add_seq2string(si,str1,str2) -PKCS7_SIGNER_INFO *si; -char *str1; -char *str2; +X509_ATTRIBUTE *add_seq2string(PKCS7_SIGNER_INFO *si, char *str1, char *str2) + { /* To add an object of OID 1.9.999, which is a sequence containing * 2 octet strings */ - { unsigned char *p; ASN1_OCTET_STRING *os1,*os2; ASN1_STRING *seq; @@ -301,10 +280,7 @@ char *str2; } /* For this case, I will malloc the return strings */ -int sk_get_seq2string(sk,str1,str2) -STACK *sk; -char **str1; -char **str2; +int sk_get_seq2string(STACK *sk, char **str1, char **str2) { ASN1_TYPE *so; PKCS7_SIGNER_INFO si; diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 7cb8ba3f49..61fd889bd9 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -66,9 +66,7 @@ static int add_attribute(STACK **sk, int nid, int atrtype, char *value); static ASN1_TYPE *get_attribute(STACK *sk, int nid); #if 1 -BIO *PKCS7_dataInit(p7,bio) -PKCS7 *p7; -BIO *bio; +BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio) { int i,j; BIO *out=NULL,*btmp=NULL; @@ -257,11 +255,8 @@ err: } /* int */ -BIO *PKCS7_dataDecode(p7,pkey,in_bio,xs) -PKCS7 *p7; -EVP_PKEY *pkey; -BIO *in_bio; -X509_STORE *xs; +BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, + X509_STORE *xs) { int i,j; BIO *out=NULL,*btmp=NULL,*etmp=NULL,*bio=NULL; @@ -470,9 +465,7 @@ err: } #endif -int PKCS7_dataFinal(p7,bio) -PKCS7 *p7; -BIO *bio; +int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) { int ret=0; int i,j; @@ -636,12 +629,8 @@ err: return(ret); } -int PKCS7_dataVerify(cert_store,ctx,bio,p7,si) -X509_STORE *cert_store; -X509_STORE_CTX *ctx; -BIO *bio; -PKCS7 *p7; -PKCS7_SIGNER_INFO *si; +int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, BIO *bio, + PKCS7 *p7, PKCS7_SIGNER_INFO *si) { /* PKCS7_SIGNED *s; */ ASN1_OCTET_STRING *os; @@ -782,9 +771,7 @@ err: return(ret); } -PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(p7,idx) -PKCS7 *p7; -int idx; +PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx) { STACK *rsk; PKCS7_RECIP_INFO *ri; @@ -799,23 +786,17 @@ int idx; return(ri->issuer_and_serial); } -ASN1_TYPE *PKCS7_get_signed_attribute(si,nid) -PKCS7_SIGNER_INFO *si; -int nid; +ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid) { return(get_attribute(si->auth_attr,nid)); } -ASN1_TYPE *PKCS7_get_attribute(si,nid) -PKCS7_SIGNER_INFO *si; -int nid; +ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid) { return(get_attribute(si->unauth_attr,nid)); } -static ASN1_TYPE *get_attribute(sk,nid) -STACK *sk; -int nid; +static ASN1_TYPE *get_attribute(STACK *sk, int nid) { int i; X509_ATTRIBUTE *xa; @@ -837,8 +818,7 @@ int nid; return(NULL); } -ASN1_OCTET_STRING *PKCS7_digest_from_attributes(sk) -STACK *sk; +ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK *sk) { X509_ATTRIBUTE *attr; ASN1_TYPE *astype; @@ -860,9 +840,7 @@ STACK *sk; return NULL; } -int PKCS7_set_signed_attributes(p7si,sk) -PKCS7_SIGNER_INFO *p7si; -STACK *sk; +int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, STACK *sk) { int i; @@ -878,9 +856,7 @@ STACK *sk; return(1); } -int PKCS7_set_attributes(p7si,sk) -PKCS7_SIGNER_INFO *p7si; -STACK *sk; +int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, STACK *sk) { int i; @@ -896,29 +872,19 @@ STACK *sk; return(1); } -int PKCS7_add_signed_attribute(p7si,nid,atrtype,value) -PKCS7_SIGNER_INFO *p7si; -int nid; -int atrtype; -char *value; +int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, + char *value) { return(add_attribute(&(p7si->auth_attr),nid,atrtype,value)); } -int PKCS7_add_attribute(p7si,nid,atrtype,value) -PKCS7_SIGNER_INFO *p7si; -int nid; -int atrtype; -char *value; +int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, + char *value) { return(add_attribute(&(p7si->unauth_attr),nid,atrtype,value)); } -static int add_attribute(sk, nid, atrtype, value) -STACK **sk; -int nid; -int atrtype; -char *value; +static int add_attribute(STACK **sk, int nid, int atrtype, char *value) { X509_ATTRIBUTE *attr=NULL; diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index d69f536ae8..a3f554f7c2 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -61,11 +61,7 @@ #include "objects.h" #include "x509.h" -long PKCS7_ctrl(p7,cmd,larg,parg) -PKCS7 *p7; -int cmd; -long larg; -char *parg; +long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg) { int nid; long ret; @@ -104,9 +100,7 @@ char *parg; return(ret); } -int PKCS7_content_new(p7,type) -PKCS7 *p7; -int type; +int PKCS7_content_new(PKCS7 *p7, int type) { PKCS7 *ret=NULL; @@ -120,9 +114,7 @@ err: return(0); } -int PKCS7_set_content(p7,p7_data) -PKCS7 *p7; -PKCS7 *p7_data; +int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data) { int i; @@ -148,9 +140,7 @@ err: return(0); } -int PKCS7_set_type(p7,type) -PKCS7 *p7; -int type; +int PKCS7_set_type(PKCS7 *p7, int type) { ASN1_OBJECT *obj; @@ -196,9 +186,7 @@ err: return(0); } -int PKCS7_add_signer(p7,psi) -PKCS7 *p7; -PKCS7_SIGNER_INFO *psi; +int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *psi) { int i,j,nid; X509_ALGOR *alg; @@ -245,9 +233,7 @@ PKCS7_SIGNER_INFO *psi; return(1); } -int PKCS7_add_certificate(p7,x509) -PKCS7 *p7; -X509 *x509; +int PKCS7_add_certificate(PKCS7 *p7, X509 *x509) { int i; STACK_OF(X509) **sk; @@ -273,9 +259,7 @@ X509 *x509; return(1); } -int PKCS7_add_crl(p7,crl) -PKCS7 *p7; -X509_CRL *crl; +int PKCS7_add_crl(PKCS7 *p7, X509_CRL *crl) { int i; STACK **sk; @@ -302,11 +286,8 @@ X509_CRL *crl; return(1); } -int PKCS7_SIGNER_INFO_set(p7i,x509,pkey,dgst) -PKCS7_SIGNER_INFO *p7i; -X509 *x509; -EVP_PKEY *pkey; -EVP_MD *dgst; +int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, + EVP_MD *dgst) { /* We now need to add another PKCS7_SIGNER_INFO entry */ ASN1_INTEGER_set(p7i->version,1); @@ -343,11 +324,8 @@ err: return(0); } -PKCS7_SIGNER_INFO *PKCS7_add_signature(p7,x509,pkey,dgst) -PKCS7 *p7; -X509 *x509; -EVP_PKEY *pkey; -EVP_MD *dgst; +PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, EVP_PKEY *pkey, + EVP_MD *dgst) { PKCS7_SIGNER_INFO *si; @@ -359,8 +337,7 @@ err: return(NULL); } -STACK *PKCS7_get_signer_info(p7) -PKCS7 *p7; +STACK *PKCS7_get_signer_info(PKCS7 *p7) { if (PKCS7_type_is_signed(p7)) { @@ -374,9 +351,7 @@ PKCS7 *p7; return(NULL); } -PKCS7_RECIP_INFO *PKCS7_add_recipient(p7,x509) -PKCS7 *p7; -X509 *x509; +PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509) { PKCS7_RECIP_INFO *ri; @@ -388,9 +363,7 @@ err: return(NULL); } -int PKCS7_add_recipient_info(p7,ri) -PKCS7 *p7; -PKCS7_RECIP_INFO *ri; +int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri) { int i; STACK *sk; @@ -413,9 +386,7 @@ PKCS7_RECIP_INFO *ri; return(1); } -int PKCS7_RECIP_INFO_set(p7i,x509) -PKCS7_RECIP_INFO *p7i; -X509 *x509; +int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509) { ASN1_INTEGER_set(p7i->version,0); X509_NAME_set(&p7i->issuer_and_serial->issuer, @@ -436,9 +407,7 @@ X509 *x509; return(1); } -X509 *PKCS7_cert_from_signer_info(p7,si) -PKCS7 *p7; -PKCS7_SIGNER_INFO *si; +X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si) { if (PKCS7_type_is_signed(p7)) return(X509_find_by_issuer_and_serial(p7->d.sign->cert, @@ -448,9 +417,7 @@ PKCS7_SIGNER_INFO *si; return(NULL); } -int PKCS7_set_cipher(p7,cipher) -PKCS7 *p7; -EVP_CIPHER *cipher; +int PKCS7_set_cipher(PKCS7 *p7, EVP_CIPHER *cipher) { int i; PKCS7_ENC_CONTENT *ec; diff --git a/crypto/pkcs7/pkcs7err.c b/crypto/pkcs7/pkcs7err.c index 03d942b09f..7982b5f06a 100644 --- a/crypto/pkcs7/pkcs7err.c +++ b/crypto/pkcs7/pkcs7err.c @@ -100,7 +100,7 @@ static ERR_STRING_DATA PKCS7_str_reasons[]= #endif -void ERR_load_PKCS7_strings() +void ERR_load_PKCS7_strings(void) { static int init=1; diff --git a/crypto/pkcs7/verify.c b/crypto/pkcs7/verify.c index 38b89b5080..d2d46d4aa4 100644 --- a/crypto/pkcs7/verify.c +++ b/crypto/pkcs7/verify.c @@ -204,9 +204,7 @@ err: } /* should be X509 * but we can just have them as char *. */ -int verify_callback(ok, ctx) -int ok; -X509_STORE_CTX *ctx; +int verify_callback(int ok, X509_STORE_CTX *ctx) { char buf[256]; X509 *err_cert; diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index e96c103a68..dbf13e686f 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -140,12 +140,12 @@ RAND_METHOD rand_ssleay_meth={ ssleay_rand_cleanup, }; -RAND_METHOD *RAND_SSLeay() +RAND_METHOD *RAND_SSLeay(void) { return(&rand_ssleay_meth); } -static void ssleay_rand_cleanup() +static void ssleay_rand_cleanup(void) { memset(state,0,sizeof(state)); state_num=0; @@ -155,9 +155,7 @@ static void ssleay_rand_cleanup() md_count[1]=0; } -static void ssleay_rand_seed(buf,num) -const void *buf; -int num; +static void ssleay_rand_seed(const void *buf, int num) { int i,j,k,st_idx,st_num; MD_CTX m; @@ -219,9 +217,7 @@ int num; memset((char *)&m,0,sizeof(m)); } -static void ssleay_rand_bytes(buf,num) -unsigned char *buf; -int num; +static void ssleay_rand_bytes(unsigned char *buf, int num) { int i,j,k,st_num,st_idx; MD_CTX m; diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index 6bea09211c..2eb5e12182 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -68,34 +68,29 @@ extern RAND_METHOD rand_ssleay_meth; static RAND_METHOD *rand_meth= &rand_ssleay_meth; #endif -void RAND_set_rand_method(meth) -RAND_METHOD *meth; +void RAND_set_rand_method(RAND_METHOD *meth) { rand_meth=meth; } -RAND_METHOD *RAND_get_rand_method() +RAND_METHOD *RAND_get_rand_method(void) { return(rand_meth); } -void RAND_cleanup() +void RAND_cleanup(void) { if (rand_meth != NULL) rand_meth->cleanup(); } -void RAND_seed(buf,num) -const void *buf; -int num; +void RAND_seed(const void *buf, int num) { if (rand_meth != NULL) rand_meth->seed(buf,num); } -void RAND_bytes(buf,num) -unsigned char *buf; -int num; +void RAND_bytes(unsigned char *buf, int num) { if (rand_meth != NULL) rand_meth->bytes(buf,num); diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index c8744318f6..1cea7696f9 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -71,9 +71,7 @@ /* #define RFILE ".rand" - defined in ../../e_os.h */ -int RAND_load_file(file,bytes) -const char *file; -long bytes; +int RAND_load_file(const char *file, long bytes) { MS_STATIC unsigned char buf[BUFSIZE]; struct stat sb; @@ -108,8 +106,7 @@ err: return(ret); } -int RAND_write_file(file) -const char *file; +int RAND_write_file(const char *file) { unsigned char buf[BUFSIZE]; int i,ret=0; @@ -140,9 +137,7 @@ err: return(ret); } -char *RAND_file_name(buf,size) -char *buf; -int size; +char *RAND_file_name(char *buf, int size) { char *s; char *ret=NULL; diff --git a/crypto/rc2/rc2_cbc.c b/crypto/rc2/rc2_cbc.c index 22e89f0441..a141975bac 100644 --- a/crypto/rc2/rc2_cbc.c +++ b/crypto/rc2/rc2_cbc.c @@ -59,13 +59,8 @@ #include "rc2.h" #include "rc2_locl.h" -void RC2_cbc_encrypt(in, out, length, ks, iv, encrypt) -unsigned char *in; -unsigned char *out; -long length; -RC2_KEY *ks; -unsigned char *iv; -int encrypt; +void RC2_cbc_encrypt(unsigned char *in, unsigned char *out, long length, + RC2_KEY *ks, unsigned char *iv, int encrypt) { register unsigned long tin0,tin1; register unsigned long tout0,tout1,xor0,xor1; @@ -138,9 +133,7 @@ int encrypt; tin[0]=tin[1]=0; } -void RC2_encrypt(d,key) -unsigned long *d; -RC2_KEY *key; +void RC2_encrypt(unsigned long *d, RC2_KEY *key) { int i,n; register RC2_INT *p0,*p1; @@ -185,9 +178,7 @@ RC2_KEY *key; d[1]=(unsigned long)(x2&0xffff)|((unsigned long)(x3&0xffff)<<16L); } -void RC2_decrypt(d,key) -unsigned long *d; -RC2_KEY *key; +void RC2_decrypt(unsigned long *d, RC2_KEY *key) { int i,n; register RC2_INT *p0,*p1; diff --git a/crypto/rc2/rc2_ecb.c b/crypto/rc2/rc2_ecb.c index d00070b309..3ac3a0f6aa 100644 --- a/crypto/rc2/rc2_ecb.c +++ b/crypto/rc2/rc2_ecb.c @@ -70,11 +70,8 @@ const char *RC2_version="RC2" OPENSSL_VERSION_PTEXT; * Date: 11 Feb 1996 06:45:03 GMT */ -void RC2_ecb_encrypt(in, out, ks, encrypt) -unsigned char *in; -unsigned char *out; -RC2_KEY *ks; -int encrypt; +void RC2_ecb_encrypt(unsigned char *in, unsigned char *out, RC2_KEY *ks, + int encrypt) { unsigned long l,d[2]; diff --git a/crypto/rc2/rc2_skey.c b/crypto/rc2/rc2_skey.c index 0f1f253395..7293873018 100644 --- a/crypto/rc2/rc2_skey.c +++ b/crypto/rc2/rc2_skey.c @@ -90,11 +90,7 @@ static unsigned char key_table[256]={ * BSAFE uses the 'retarded' version. What I previously shipped is * the same as specifying 1024 for the 'bits' parameter. Bsafe uses * a version where the bits parameter is the same as len*8 */ -void RC2_set_key(key,len,data,bits) -RC2_KEY *key; -int len; -unsigned char *data; -int bits; +void RC2_set_key(RC2_KEY *key, int len, unsigned char *data, int bits) { int i,j; unsigned char *k; diff --git a/crypto/rc2/rc2cfb64.c b/crypto/rc2/rc2cfb64.c index d409fb77e9..4c6a49ea14 100644 --- a/crypto/rc2/rc2cfb64.c +++ b/crypto/rc2/rc2cfb64.c @@ -64,14 +64,8 @@ * 64bit block we have used is contained in *num; */ -void RC2_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) -unsigned char *in; -unsigned char *out; -long length; -RC2_KEY *schedule; -unsigned char *ivec; -int *num; -int encrypt; +void RC2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + RC2_KEY *schedule, unsigned char *ivec, int *num, int encrypt) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/rc2/rc2ofb64.c b/crypto/rc2/rc2ofb64.c index 4f09167447..ef0e62fa1b 100644 --- a/crypto/rc2/rc2ofb64.c +++ b/crypto/rc2/rc2ofb64.c @@ -63,13 +63,8 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void RC2_ofb64_encrypt(in, out, length, schedule, ivec, num) -unsigned char *in; -unsigned char *out; -long length; -RC2_KEY *schedule; -unsigned char *ivec; -int *num; +void RC2_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, + RC2_KEY *schedule, unsigned char *ivec, int *num) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/rc2/rc2speed.c b/crypto/rc2/rc2speed.c index d02f9d812c..0d20480391 100644 --- a/crypto/rc2/rc2speed.c +++ b/crypto/rc2/rc2speed.c @@ -135,8 +135,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +148,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +184,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/rc2/rc2test.c b/crypto/rc2/rc2test.c index 9d0f8016ec..a243998077 100644 --- a/crypto/rc2/rc2test.c +++ b/crypto/rc2/rc2test.c @@ -135,9 +135,7 @@ static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,n,err=0; RC2_KEY key; @@ -208,8 +206,7 @@ char *argv[]; } #ifdef undef -static int cfb64_test(cfb_cipher) -unsigned char *cfb_cipher; +static int cfb64_test(unsigned char *cfb_cipher) { IDEA_KEY_SCHEDULE eks,dks; int err=0,i,n; @@ -247,8 +244,7 @@ unsigned char *cfb_cipher; return(err); } -static char *pt(p) -unsigned char *p; +static char *pt(unsigned char *p) { static char bufs[10][20]; static int bnum=0; diff --git a/crypto/rc4/rc4.c b/crypto/rc4/rc4.c index 127e8a5093..a1a66acf0c 100644 --- a/crypto/rc4/rc4.c +++ b/crypto/rc4/rc4.c @@ -70,9 +70,7 @@ char *usage[]={ NULL }; -int main(argc, argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { FILE *in=NULL,*out=NULL; char *infile=NULL,*outfile=NULL,*keystr=NULL; diff --git a/crypto/rc4/rc4_enc.c b/crypto/rc4/rc4_enc.c index 26da6d520c..589bf45083 100644 --- a/crypto/rc4/rc4_enc.c +++ b/crypto/rc4/rc4_enc.c @@ -67,11 +67,8 @@ * Date: Wed, 14 Sep 1994 06:35:31 GMT */ -void RC4(key, len, indata, outdata) -RC4_KEY *key; -unsigned long len; -unsigned char *indata; -unsigned char *outdata; +void RC4(RC4_KEY *key, unsigned long len, unsigned char *indata, + unsigned char *outdata) { register RC4_INT *d; register RC4_INT x,y,tx,ty; diff --git a/crypto/rc4/rc4_skey.c b/crypto/rc4/rc4_skey.c index e57810e143..ebdf4649e2 100644 --- a/crypto/rc4/rc4_skey.c +++ b/crypto/rc4/rc4_skey.c @@ -62,7 +62,7 @@ const char *RC4_version="RC4" OPENSSL_VERSION_PTEXT; -const char *RC4_options() +const char *RC4_options(void) { #ifdef RC4_INDEX if (sizeof(RC4_INT) == 1) @@ -85,10 +85,7 @@ const char *RC4_options() * Date: Wed, 14 Sep 1994 06:35:31 GMT */ -void RC4_set_key(key, len, data) -RC4_KEY *key; -int len; -register unsigned char *data; +void RC4_set_key(RC4_KEY *key, int len, register unsigned char *data) { register RC4_INT tmp; register int id1,id2; diff --git a/crypto/rc4/rc4speed.c b/crypto/rc4/rc4speed.c index f796f7b7be..892c53c985 100644 --- a/crypto/rc4/rc4speed.c +++ b/crypto/rc4/rc4speed.c @@ -135,8 +135,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +148,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +184,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/rc4/rc4test.c b/crypto/rc4/rc4test.c index 041e1aff95..147d0f0a81 100644 --- a/crypto/rc4/rc4test.c +++ b/crypto/rc4/rc4test.c @@ -101,9 +101,7 @@ unsigned char output[7][30]={ {0}, }; -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; int j; diff --git a/crypto/rc5/rc5_ecb.c b/crypto/rc5/rc5_ecb.c index 5506572aef..2305dd081b 100644 --- a/crypto/rc5/rc5_ecb.c +++ b/crypto/rc5/rc5_ecb.c @@ -62,11 +62,8 @@ char *RC5_version="RC5" OPENSSL_VERSION_PTEXT; -void RC5_32_ecb_encrypt(in, out, ks, encrypt) -unsigned char *in; -unsigned char *out; -RC5_32_KEY *ks; -int encrypt; +void RC5_32_ecb_encrypt(unsigned char *in, unsigned char *out, RC5_32_KEY *ks, + int encrypt) { unsigned long l,d[2]; diff --git a/crypto/rc5/rc5_enc.c b/crypto/rc5/rc5_enc.c index ee5f97eed1..ba79dd456a 100644 --- a/crypto/rc5/rc5_enc.c +++ b/crypto/rc5/rc5_enc.c @@ -60,13 +60,8 @@ #include "rc5.h" #include "rc5_locl.h" -void RC5_32_cbc_encrypt(in, out, length, ks, iv, encrypt) -unsigned char *in; -unsigned char *out; -long length; -RC5_32_KEY *ks; -unsigned char *iv; -int encrypt; +void RC5_32_cbc_encrypt(unsigned char *in, unsigned char *out, long length, + RC5_32_KEY *ks, unsigned char *iv, int encrypt) { register unsigned long tin0,tin1; register unsigned long tout0,tout1,xor0,xor1; @@ -139,9 +134,7 @@ int encrypt; tin[0]=tin[1]=0; } -void RC5_32_encrypt(d,key) -unsigned long *d; -RC5_32_KEY *key; +void RC5_32_encrypt(unsigned long *d, RC5_32_KEY *key) { RC5_32_INT a,b,*s; @@ -180,9 +173,7 @@ RC5_32_KEY *key; d[1]=b; } -void RC5_32_decrypt(d,key) -unsigned long *d; -RC5_32_KEY *key; +void RC5_32_decrypt(unsigned long *d, RC5_32_KEY *key) { RC5_32_INT a,b,*s; diff --git a/crypto/rc5/rc5_skey.c b/crypto/rc5/rc5_skey.c index 5753390d08..2f36531ffa 100644 --- a/crypto/rc5/rc5_skey.c +++ b/crypto/rc5/rc5_skey.c @@ -59,11 +59,8 @@ #include "rc5.h" #include "rc5_locl.h" -void RC5_32_set_key(key,len,data,rounds) -RC5_32_KEY *key; -int len; -unsigned char *data; -int rounds; +void RC5_32_set_key(RC5_32_KEY *key, int len, unsigned char *data, + int rounds) { RC5_32_INT L[64],l,ll,A,B,*S,k; int i,j,m,c,t,ii,jj; diff --git a/crypto/rc5/rc5cfb64.c b/crypto/rc5/rc5cfb64.c index fe245d0348..dbc7ae105b 100644 --- a/crypto/rc5/rc5cfb64.c +++ b/crypto/rc5/rc5cfb64.c @@ -64,14 +64,8 @@ * 64bit block we have used is contained in *num; */ -void RC5_32_cfb64_encrypt(in, out, length, schedule, ivec, num, encrypt) -unsigned char *in; -unsigned char *out; -long length; -RC5_32_KEY *schedule; -unsigned char *ivec; -int *num; -int encrypt; +void RC5_32_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, + RC5_32_KEY *schedule, unsigned char *ivec, int *num, int encrypt) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/rc5/rc5ofb64.c b/crypto/rc5/rc5ofb64.c index aa43b6a820..b52e14513f 100644 --- a/crypto/rc5/rc5ofb64.c +++ b/crypto/rc5/rc5ofb64.c @@ -63,13 +63,8 @@ * used. The extra state information to record how much of the * 64bit block we have used is contained in *num; */ -void RC5_32_ofb64_encrypt(in, out, length, schedule, ivec, num) -unsigned char *in; -unsigned char *out; -long length; -RC5_32_KEY *schedule; -unsigned char *ivec; -int *num; +void RC5_32_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, + RC5_32_KEY *schedule, unsigned char *ivec, int *num) { register unsigned long v0,v1,t; register int n= *num; diff --git a/crypto/rc5/rc5speed.c b/crypto/rc5/rc5speed.c index 29148dc494..54163b85e0 100644 --- a/crypto/rc5/rc5speed.c +++ b/crypto/rc5/rc5speed.c @@ -135,8 +135,7 @@ SIGRETTYPE sig_done(int sig); SIGRETTYPE sig_done(); #endif -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +148,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +184,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; diff --git a/crypto/rc5/rc5test.c b/crypto/rc5/rc5test.c index 14c321d7b8..5ca5195053 100644 --- a/crypto/rc5/rc5test.c +++ b/crypto/rc5/rc5test.c @@ -224,9 +224,7 @@ unsigned char rc5_cbc_iv[RC5_CBC_NUM][8]={ {0x7c,0xb3,0xf1,0xdf,0x34,0xf9,0x48,0x11}, }; -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,n,err=0; RC5_32_KEY key; @@ -317,8 +315,7 @@ char *argv[]; } #ifdef undef -static int cfb64_test(cfb_cipher) -unsigned char *cfb_cipher; +static int cfb64_test(unsigned char *cfb_cipher) { IDEA_KEY_SCHEDULE eks,dks; int err=0,i,n; @@ -356,8 +353,7 @@ unsigned char *cfb_cipher; return(err); } -static char *pt(p) -unsigned char *p; +static char *pt(unsigned char *p) { static char bufs[10][20]; static int bnum=0; diff --git a/crypto/ripemd/rmd160.c b/crypto/ripemd/rmd160.c index 3fa1b8096e..bee04ce69c 100644 --- a/crypto/ripemd/rmd160.c +++ b/crypto/ripemd/rmd160.c @@ -72,9 +72,7 @@ void pt(); int read(); #endif -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int i,err=0; FILE *IN; @@ -102,8 +100,7 @@ char **argv; exit(err); } -void do_fp(f) -FILE *f; +void do_fp(FILE *f) { RIPEMD160_CTX c; unsigned char md[RIPEMD160_DIGEST_LENGTH]; @@ -123,8 +120,7 @@ FILE *f; pt(md); } -void pt(md) -unsigned char *md; +void pt(unsigned char *md) { int i; diff --git a/crypto/ripemd/rmd_dgst.c b/crypto/ripemd/rmd_dgst.c index 0a64a87f1c..659828e5bf 100644 --- a/crypto/ripemd/rmd_dgst.c +++ b/crypto/ripemd/rmd_dgst.c @@ -78,8 +78,7 @@ char *RMD160_version="RIPE-MD160" OPENSSL_VERSION_PTEXT; # endif #endif -void RIPEMD160_Init(c) -RIPEMD160_CTX *c; +void RIPEMD160_Init(RIPEMD160_CTX *c) { c->A=RIPEMD160_A; c->B=RIPEMD160_B; @@ -91,10 +90,8 @@ RIPEMD160_CTX *c; c->num=0; } -void RIPEMD160_Update(c, data, len) -RIPEMD160_CTX *c; -register unsigned char *data; -unsigned long len; +void RIPEMD160_Update(RIPEMD160_CTX *c, register unsigned char *data, + unsigned long len) { register ULONG *p; int sw,sc; @@ -222,9 +219,7 @@ unsigned long len; } } -void RIPEMD160_Transform(c,b) -RIPEMD160_CTX *c; -unsigned char *b; +void RIPEMD160_Transform(RIPEMD160_CTX *c, unsigned char *b) { ULONG p[16]; #if !defined(L_ENDIAN) @@ -261,10 +256,7 @@ unsigned char *b; #ifndef RMD160_ASM -void ripemd160_block(ctx, X, num) -RIPEMD160_CTX *ctx; -register ULONG *X; -int num; +void ripemd160_block(RIPEMD160_CTX *ctx, register ULONG *X, int num) { register ULONG A,B,C,D,E; ULONG a,b,c,d,e; @@ -461,9 +453,7 @@ int num; } #endif -void RIPEMD160_Final(md, c) -unsigned char *md; -RIPEMD160_CTX *c; +void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c) { register int i,j; register ULONG l; @@ -519,8 +509,7 @@ RIPEMD160_CTX *c; } #ifdef undef -int printit(l) -unsigned long *l; +int printit(unsigned long *l) { int i,ii; diff --git a/crypto/ripemd/rmd_one.c b/crypto/ripemd/rmd_one.c index a7626dbcda..5b6ff14714 100644 --- a/crypto/ripemd/rmd_one.c +++ b/crypto/ripemd/rmd_one.c @@ -59,10 +59,8 @@ #include #include "rmd_locl.h" -unsigned char *RIPEMD160(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *RIPEMD160(unsigned char *d, unsigned long n, + unsigned char *md) { RIPEMD160_CTX c; static unsigned char m[RIPEMD160_DIGEST_LENGTH]; diff --git a/crypto/ripemd/rmdtest.c b/crypto/ripemd/rmdtest.c index 6a0297f975..4e5d87feaa 100644 --- a/crypto/ripemd/rmdtest.c +++ b/crypto/ripemd/rmdtest.c @@ -90,9 +90,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; unsigned char **P,**R; @@ -120,8 +118,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c index 609ec04a4c..c882738bf2 100644 --- a/crypto/rsa/rsa_eay.c +++ b/crypto/rsa/rsa_eay.c @@ -98,17 +98,13 @@ static RSA_METHOD rsa_pkcs1_eay_meth={ NULL, }; -RSA_METHOD *RSA_PKCS1_SSLeay() +RSA_METHOD *RSA_PKCS1_SSLeay(void) { return(&rsa_pkcs1_eay_meth); } -static int RSA_eay_public_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_public_encrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int i,j,k,num=0,r= -1; @@ -177,12 +173,8 @@ err: return(r); } -static int RSA_eay_private_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_private_encrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int i,j,k,num=0,r= -1; @@ -256,12 +248,8 @@ err: return(r); } -static int RSA_eay_private_decrypt(flen, from, to, rsa,padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_private_decrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int j,num=0,r= -1; @@ -350,12 +338,8 @@ err: return(r); } -static int RSA_eay_public_decrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_public_decrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int i,num=0,r= -1; @@ -426,10 +410,7 @@ err: return(r); } -static int RSA_eay_mod_exp(r0, I, rsa) -BIGNUM *r0; -BIGNUM *I; -RSA *rsa; +static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) { BIGNUM r1,m1; int ret=0; @@ -493,15 +474,13 @@ err: return(ret); } -static int RSA_eay_init(rsa) -RSA *rsa; +static int RSA_eay_init(RSA *rsa) { rsa->flags|=RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE; return(1); } -static int RSA_eay_finish(rsa) -RSA *rsa; +static int RSA_eay_finish(RSA *rsa) { if (rsa->_method_mod_n != NULL) BN_MONT_CTX_free(rsa->_method_mod_n); diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index cdb8a3334d..0d7e65670d 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c @@ -118,7 +118,7 @@ static ERR_STRING_DATA RSA_str_reasons[]= #endif -void ERR_load_RSA_strings() +void ERR_load_RSA_strings(void) { static int init=1; diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index 936db49515..b2569e508f 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -62,11 +62,8 @@ #include "bn.h" #include "rsa.h" -RSA *RSA_generate_key(bits, e_value, callback,cb_arg) -int bits; -unsigned long e_value; -void (*callback)(P_I_I_P); -char *cb_arg; +RSA *RSA_generate_key(int bits, unsigned long e_value, + void (*callback)(P_I_I_P), char *cb_arg) { RSA *rsa=NULL; BIGNUM *r0=NULL,*r1=NULL,*r2=NULL,*r3=NULL,*tmp; diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 951d18185f..6732e9832f 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -69,19 +69,17 @@ static RSA_METHOD *default_RSA_meth=NULL; static int rsa_meth_num=0; static STACK *rsa_meth=NULL; -RSA *RSA_new() +RSA *RSA_new(void) { return(RSA_new_method(NULL)); } -void RSA_set_default_method(meth) -RSA_METHOD *meth; +void RSA_set_default_method(RSA_METHOD *meth) { default_RSA_meth=meth; } -RSA *RSA_new_method(meth) -RSA_METHOD *meth; +RSA *RSA_new_method(RSA_METHOD *meth) { RSA *ret; @@ -132,8 +130,7 @@ RSA_METHOD *meth; return(ret); } -void RSA_free(r) -RSA *r; +void RSA_free(RSA *r) { int i; @@ -170,87 +167,59 @@ RSA *r; Free(r); } -int RSA_get_ex_new_index(argl,argp,new_func,dup_func,free_func) -long argl; -char *argp; -int (*new_func)(); -int (*dup_func)(); -void (*free_func)(); +int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), + int (*dup_func)(), void (*free_func)()) { rsa_meth_num++; return(CRYPTO_get_ex_new_index(rsa_meth_num-1, &rsa_meth,argl,argp,new_func,dup_func,free_func)); } -int RSA_set_ex_data(r,idx,arg) -RSA *r; -int idx; -char *arg; +int RSA_set_ex_data(RSA *r, int idx, char *arg) { return(CRYPTO_set_ex_data(&r->ex_data,idx,arg)); } -char *RSA_get_ex_data(r,idx) -RSA *r; -int idx; +char *RSA_get_ex_data(RSA *r, int idx) { return(CRYPTO_get_ex_data(&r->ex_data,idx)); } -int RSA_size(r) -RSA *r; +int RSA_size(RSA *r) { return(BN_num_bytes(r->n)); } -int RSA_public_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding)); } -int RSA_private_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_private_encrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding)); } -int RSA_private_decrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_private_decrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding)); } -int RSA_public_decrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_public_decrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding)); } -int RSA_flags(r) -RSA *r; +int RSA_flags(RSA *r) { return((r == NULL)?0:r->meth->flags); } -void RSA_blinding_off(rsa) -RSA *rsa; +void RSA_blinding_off(RSA *rsa) { if (rsa->blinding != NULL) { @@ -260,9 +229,7 @@ RSA *rsa; rsa->flags&= ~RSA_FLAG_BLINDING; } -int RSA_blinding_on(rsa,p_ctx) -RSA *rsa; -BN_CTX *p_ctx; +int RSA_blinding_on(RSA *rsa, BN_CTX *p_ctx) { BIGNUM *A,*Ai; BN_CTX *ctx; @@ -295,8 +262,7 @@ err: return(ret); } -int RSA_memory_lock(r) -RSA *r; +int RSA_memory_lock(RSA *r) { int i,j,k,off; char *p; diff --git a/crypto/rsa/rsa_none.c b/crypto/rsa/rsa_none.c index e944f84bec..6d43677a15 100644 --- a/crypto/rsa/rsa_none.c +++ b/crypto/rsa/rsa_none.c @@ -62,11 +62,8 @@ #include "rsa.h" #include "rand.h" -int RSA_padding_add_none(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_none(unsigned char *to, int tlen, unsigned char *from, + int flen) { if (flen > tlen) { @@ -84,12 +81,8 @@ int flen; return(1); } -int RSA_padding_check_none(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_none(unsigned char *to, int tlen, unsigned char *from, + int flen, int num) { if (flen > tlen) diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c index 6907ba9969..44732460b3 100644 --- a/crypto/rsa/rsa_oaep.c +++ b/crypto/rsa/rsa_oaep.c @@ -13,13 +13,8 @@ int MGF1(unsigned char *mask, long len, unsigned char *seed, long seedlen); -int RSA_padding_add_PKCS1_OAEP(to, tlen, from, flen, param, plen) - unsigned char *to; - int tlen; - unsigned char *from; - int flen; - unsigned char *param; - int plen; +int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, + unsigned char *from, int flen, unsigned char *param, int plen) { int i, emlen = tlen - 1; unsigned char *db, *seed; @@ -73,14 +68,9 @@ int RSA_padding_add_PKCS1_OAEP(to, tlen, from, flen, param, plen) return (1); } -int RSA_padding_check_PKCS1_OAEP(to, tlen, from, flen, num, param, plen) - unsigned char *to; - int tlen; - unsigned char *from; - int flen; - int num; - unsigned char *param; - int plen; +int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, + unsigned char *from, int flen, int num, unsigned char *param, + int plen) { int i, dblen, mlen = -1; unsigned char *maskeddb; diff --git a/crypto/rsa/rsa_oaep_test.c b/crypto/rsa/rsa_oaep_test.c index c18fd98b3a..c4b454a71a 100644 --- a/crypto/rsa/rsa_oaep_test.c +++ b/crypto/rsa/rsa_oaep_test.c @@ -184,7 +184,7 @@ int key3(RSA *key, unsigned char *c) SetKey; } -int pad_unknown() +int pad_unknown(void) { unsigned long l; while ((l = ERR_get_error()) != 0) diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c index 4638187970..7648b763a9 100644 --- a/crypto/rsa/rsa_pk1.c +++ b/crypto/rsa/rsa_pk1.c @@ -74,11 +74,8 @@ int RSA_padding_check_none(); #endif -int RSA_padding_add_PKCS1_type_1(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, + unsigned char *from, int flen) { int j; unsigned char *p; @@ -103,12 +100,8 @@ int flen; return(1); } -int RSA_padding_check_PKCS1_type_1(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, + unsigned char *from, int flen, int num) { int i,j; unsigned char *p; @@ -154,11 +147,8 @@ int num; return(j); } -int RSA_padding_add_PKCS1_type_2(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, + unsigned char *from, int flen) { int i,j; unsigned char *p; @@ -193,12 +183,8 @@ int flen; return(1); } -int RSA_padding_check_PKCS1_type_2(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, + unsigned char *from, int flen, int num) { int i,j; unsigned char *p; diff --git a/crypto/rsa/rsa_saos.c b/crypto/rsa/rsa_saos.c index fb0fae5a43..d73beb0491 100644 --- a/crypto/rsa/rsa_saos.c +++ b/crypto/rsa/rsa_saos.c @@ -63,13 +63,8 @@ #include "objects.h" #include "x509.h" -int RSA_sign_ASN1_OCTET_STRING(type,m,m_len,sigret,siglen,rsa) -int type; -unsigned char *m; -unsigned int m_len; -unsigned char *sigret; -unsigned int *siglen; -RSA *rsa; +int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len, + unsigned char *sigret, unsigned int *siglen, RSA *rsa) { ASN1_OCTET_STRING sig; int i,j,ret=1; @@ -105,13 +100,9 @@ RSA *rsa; return(ret); } -int RSA_verify_ASN1_OCTET_STRING(dtype, m, m_len, sigbuf, siglen, rsa) -int dtype; -unsigned char *m; -unsigned int m_len; -unsigned char *sigbuf; -unsigned int siglen; -RSA *rsa; +int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m, + unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, + RSA *rsa) { int i,ret=0; unsigned char *p,*s; diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index e38911146a..31cdb4a81a 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -63,13 +63,8 @@ #include "objects.h" #include "x509.h" -int RSA_sign(type,m,m_len,sigret,siglen,rsa) -int type; -unsigned char *m; -unsigned int m_len; -unsigned char *sigret; -unsigned int *siglen; -RSA *rsa; +int RSA_sign(int type, unsigned char *m, unsigned int m_len, + unsigned char *sigret, unsigned int *siglen, RSA *rsa) { X509_SIG sig; ASN1_TYPE parameter; @@ -124,13 +119,8 @@ RSA *rsa; return(ret); } -int RSA_verify(dtype, m, m_len, sigbuf, siglen, rsa) -int dtype; -unsigned char *m; -unsigned int m_len; -unsigned char *sigbuf; -unsigned int siglen; -RSA *rsa; +int RSA_verify(int dtype, unsigned char *m, unsigned int m_len, + unsigned char *sigbuf, unsigned int siglen, RSA *rsa) { int i,ret=0,sigtype; unsigned char *p,*s; diff --git a/crypto/rsa/rsa_ssl.c b/crypto/rsa/rsa_ssl.c index 42ee076800..e1bbbe7949 100644 --- a/crypto/rsa/rsa_ssl.c +++ b/crypto/rsa/rsa_ssl.c @@ -62,11 +62,8 @@ #include "rsa.h" #include "rand.h" -int RSA_padding_add_SSLv23(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_SSLv23(unsigned char *to, int tlen, unsigned char *from, + int flen) { int i,j; unsigned char *p; @@ -103,12 +100,8 @@ int flen; return(1); } -int RSA_padding_check_SSLv23(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_SSLv23(unsigned char *to, int tlen, unsigned char *from, + int flen, int num) { int i,j,k; unsigned char *p; diff --git a/crypto/sha/sha.c b/crypto/sha/sha.c index 713fec3610..486819d6f7 100644 --- a/crypto/sha/sha.c +++ b/crypto/sha/sha.c @@ -72,9 +72,7 @@ void pt(); int read(); #endif -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int i,err=0; FILE *IN; @@ -102,8 +100,7 @@ char **argv; exit(err); } -void do_fp(f) -FILE *f; +void do_fp(FILE *f) { SHA_CTX c; unsigned char md[SHA_DIGEST_LENGTH]; @@ -123,8 +120,7 @@ FILE *f; pt(md); } -void pt(md) -unsigned char *md; +void pt(unsigned char *md) { int i; diff --git a/crypto/sha/sha1.c b/crypto/sha/sha1.c index a4739ac9fd..b708dec06c 100644 --- a/crypto/sha/sha1.c +++ b/crypto/sha/sha1.c @@ -72,9 +72,7 @@ void pt(); int read(); #endif -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { int i,err=0; FILE *IN; @@ -102,8 +100,7 @@ char **argv; exit(err); } -void do_fp(f) -FILE *f; +void do_fp(FILE *f) { SHA_CTX c; unsigned char md[SHA_DIGEST_LENGTH]; @@ -123,8 +120,7 @@ FILE *f; pt(md); } -void pt(md) -unsigned char *md; +void pt(unsigned char *md) { int i; diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c index fe5770d601..07af9bf4da 100644 --- a/crypto/sha/sha1_one.c +++ b/crypto/sha/sha1_one.c @@ -60,10 +60,7 @@ #include #include "sha.h" -unsigned char *SHA1(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *SHA1(unsigned char *d, unsigned long n, unsigned char *md) { SHA_CTX c; static unsigned char m[SHA_DIGEST_LENGTH]; diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c index 344b3833d3..d7fb4d4dfa 100644 --- a/crypto/sha/sha1dgst.c +++ b/crypto/sha/sha1dgst.c @@ -111,8 +111,7 @@ char *SHA1_version="SHA1" OPENSSL_VERSION_PTEXT; # define M_nl2c nl2c #endif -void SHA1_Init(c) -SHA_CTX *c; +void SHA1_Init(SHA_CTX *c) { c->h0=INIT_DATA_h0; c->h1=INIT_DATA_h1; @@ -124,10 +123,8 @@ SHA_CTX *c; c->num=0; } -void SHA1_Update(c, data, len) -SHA_CTX *c; -register unsigned char *data; -unsigned long len; +void SHA1_Update(SHA_CTX *c, register unsigned char *data, + unsigned long len) { register ULONG *p; int ew,ec,sw,sc; @@ -257,9 +254,7 @@ unsigned long len; p[sw]=l; } -void SHA1_Transform(c,b) -SHA_CTX *c; -unsigned char *b; +void SHA1_Transform(SHA_CTX *c, unsigned char *b) { ULONG p[16]; #ifndef B_ENDIAN @@ -296,10 +291,7 @@ unsigned char *b; #ifndef SHA1_ASM -void sha1_block(c, W, num) -SHA_CTX *c; -register unsigned long *W; -int num; +void sha1_block(SHA_CTX *c, register unsigned long *W, int num) { register ULONG A,B,C,D,E,T; ULONG X[16]; @@ -416,9 +408,7 @@ int num; } #endif -void SHA1_Final(md, c) -unsigned char *md; -SHA_CTX *c; +void SHA1_Final(unsigned char *md, SHA_CTX *c) { register int i,j; register ULONG l; diff --git a/crypto/sha/sha1test.c b/crypto/sha/sha1test.c index 3c62a218b4..78c94f1aca 100644 --- a/crypto/sha/sha1test.c +++ b/crypto/sha/sha1test.c @@ -93,9 +93,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; unsigned char **P,**R; @@ -143,8 +141,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; diff --git a/crypto/sha/sha_dgst.c b/crypto/sha/sha_dgst.c index 15245e3b2c..e99cb1149d 100644 --- a/crypto/sha/sha_dgst.c +++ b/crypto/sha/sha_dgst.c @@ -92,8 +92,7 @@ char *SHA_version="SHA" OPENSSL_VERSION_PTEXT; #define M_p_c2nl_p p_c2nl_p #define M_nl2c nl2c -void SHA_Init(c) -SHA_CTX *c; +void SHA_Init(SHA_CTX *c) { c->h0=INIT_DATA_h0; c->h1=INIT_DATA_h1; @@ -105,10 +104,7 @@ SHA_CTX *c; c->num=0; } -void SHA_Update(c, data, len) -SHA_CTX *c; -register unsigned char *data; -unsigned long len; +void SHA_Update(SHA_CTX *c, register unsigned char *data, unsigned long len) { register ULONG *p; int ew,ec,sw,sc; @@ -238,9 +234,7 @@ unsigned long len; p[sw]=l; } -void SHA_Transform(c,b) -SHA_CTX *c; -unsigned char *b; +void SHA_Transform(SHA_CTX *c, unsigned char *b) { ULONG p[16]; #if !defined(B_ENDIAN) @@ -275,10 +269,7 @@ unsigned char *b; sha_block(c,p,64); } -void sha_block(c, W, num) -SHA_CTX *c; -register unsigned long *W; -int num; +void sha_block(SHA_CTX *c, register unsigned long *W, int num) { register ULONG A,B,C,D,E,T; ULONG X[16]; @@ -394,9 +385,7 @@ int num; } } -void SHA_Final(md, c) -unsigned char *md; -SHA_CTX *c; +void SHA_Final(unsigned char *md, SHA_CTX *c) { register int i,j; register ULONG l; diff --git a/crypto/sha/sha_one.c b/crypto/sha/sha_one.c index 18ab7f61bc..3e2751ec84 100644 --- a/crypto/sha/sha_one.c +++ b/crypto/sha/sha_one.c @@ -60,10 +60,7 @@ #include #include "sha.h" -unsigned char *SHA(d, n, md) -unsigned char *d; -unsigned long n; -unsigned char *md; +unsigned char *SHA(unsigned char *d, unsigned long n, unsigned char *md) { SHA_CTX c; static unsigned char m[SHA_DIGEST_LENGTH]; diff --git a/crypto/sha/shatest.c b/crypto/sha/shatest.c index 03816e9b39..5a1a99880f 100644 --- a/crypto/sha/shatest.c +++ b/crypto/sha/shatest.c @@ -93,9 +93,7 @@ static char *pt(unsigned char *md); static char *pt(); #endif -int main(argc,argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { int i,err=0; unsigned char **P,**R; @@ -143,8 +141,7 @@ char *argv[]; return(0); } -static char *pt(md) -unsigned char *md; +static char *pt(unsigned char *md) { int i; static char buf[80]; diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index 600ccfd2f3..f0e5921811 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -82,9 +82,7 @@ const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT; #include -int (*sk_set_cmp_func(sk,c))() -STACK *sk; -int (*c)(); +int (*sk_set_cmp_func(STACK *sk, int (*c)()))(void) { int (*old)()=sk->comp; @@ -95,8 +93,7 @@ int (*c)(); return old; } -STACK *sk_dup(sk) -STACK *sk; +STACK *sk_dup(STACK *sk) { STACK *ret; char **s; @@ -117,8 +114,7 @@ err: return(NULL); } -STACK *sk_new(c) -int (*c)(); +STACK *sk_new(int (*c)()) { STACK *ret; int i; @@ -140,10 +136,7 @@ err0: return(NULL); } -int sk_insert(st,data,loc) -STACK *st; -char *data; -int loc; +int sk_insert(STACK *st, char *data, int loc) { char **s; @@ -180,9 +173,7 @@ int loc; return(st->num); } -char *sk_delete_ptr(st,p) -STACK *st; -char *p; +char *sk_delete_ptr(STACK *st, char *p) { int i; @@ -192,9 +183,7 @@ char *p; return(NULL); } -char *sk_delete(st,loc) -STACK *st; -int loc; +char *sk_delete(STACK *st, int loc) { char *ret; int i,j; @@ -217,9 +206,7 @@ int loc; return(ret); } -int sk_find(st,data) -STACK *st; -char *data; +int sk_find(STACK *st, char *data) { char **r; int i; @@ -249,38 +236,31 @@ char *data; return(i); } -int sk_push(st,data) -STACK *st; -char *data; +int sk_push(STACK *st, char *data) { return(sk_insert(st,data,st->num)); } -int sk_unshift(st,data) -STACK *st; -char *data; +int sk_unshift(STACK *st, char *data) { return(sk_insert(st,data,0)); } -char *sk_shift(st) -STACK *st; +char *sk_shift(STACK *st) { if (st == NULL) return(NULL); if (st->num <= 0) return(NULL); return(sk_delete(st,0)); } -char *sk_pop(st) -STACK *st; +char *sk_pop(STACK *st) { if (st == NULL) return(NULL); if (st->num <= 0) return(NULL); return(sk_delete(st,st->num-1)); } -void sk_zero(st) -STACK *st; +void sk_zero(STACK *st) { if (st == NULL) return; if (st->num <= 0) return; @@ -288,9 +268,7 @@ STACK *st; st->num=0; } -void sk_pop_free(st,func) -STACK *st; -void (*func)(); +void sk_pop_free(STACK *st, void (*func)()) { int i; @@ -301,8 +279,7 @@ void (*func)(); sk_free(st); } -void sk_free(st) -STACK *st; +void sk_free(STACK *st) { if (st == NULL) return; if (st->data != NULL) Free((char *)st->data); diff --git a/crypto/threads/mttest.c b/crypto/threads/mttest.c index be395f2bc4..97f705dbc5 100644 --- a/crypto/threads/mttest.c +++ b/crypto/threads/mttest.c @@ -145,9 +145,7 @@ int doit(char *ctx[4]); int doit(); #endif -static void print_stats(fp,ctx) -FILE *fp; -SSL_CTX *ctx; +static void print_stats(FILE *fp, SSL_CTX *ctx) { fprintf(fp,"%4ld items in the session cache\n", SSL_CTX_sess_number(ctx)); @@ -164,7 +162,7 @@ SSL_CTX *ctx; fprintf(fp,"%4d session cache timeouts\n",SSL_CTX_sess_timeouts(ctx)); } -static void sv_usage() +static void sv_usage(void) { fprintf(stderr,"usage: ssltest [args ...]\n"); fprintf(stderr,"\n"); @@ -182,9 +180,7 @@ static void sv_usage() fprintf(stderr," -ssl3 - just SSLv3n\n"); } -int main(argc, argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { char *CApath=NULL,*CAfile=NULL; int badop=0; @@ -358,8 +354,7 @@ end: #define C_DONE 1 #define S_DONE 2 -int ndoit(ssl_ctx) -SSL_CTX *ssl_ctx[2]; +int ndoit(SSL_CTX *ssl_ctx[2]) { int i; int ret; @@ -405,8 +400,7 @@ SSL_CTX *ssl_ctx[2]; return(0); } -int doit(ctx) -char *ctx[4]; +int doit(char *ctx[4]) { SSL_CTX *s_ctx,*c_ctx; static char cbuf[200],sbuf[200]; @@ -681,13 +675,8 @@ err: return(0); } -int MS_CALLBACK verify_callback(ok, xs, xi, depth, error, arg) -int ok; -X509 *xs; -X509 *xi; -int depth; -int error; -char *arg; +int MS_CALLBACK verify_callback(int ok, X509 *xs, X509 *xi, int depth, + int error, char *arg) { char buf[256]; @@ -708,7 +697,7 @@ char *arg; static HANDLE lock_cs[CRYPTO_NUM_LOCKS]; -void thread_setup() +void thread_setup(void) { int i; @@ -721,7 +710,7 @@ void thread_setup() /* id callback defined */ } -void thread_cleanup() +void thread_cleanup(void) { int i; @@ -730,11 +719,7 @@ void thread_cleanup() CloseHandle(lock_cs[i]); } -void win32_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void win32_locking_callback(int mode, int type, char *file, int line) { if (mode & CRYPTO_LOCK) { @@ -746,8 +731,7 @@ int line; } } -void do_threads(s_ctx,c_ctx) -SSL_CTX *s_ctx,*c_ctx; +void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx) { double ret; SSL_CTX *ssl_ctx[2]; @@ -806,7 +790,7 @@ static mutex_t lock_cs[CRYPTO_NUM_LOCKS]; /*static rwlock_t lock_cs[CRYPTO_NUM_LOCKS]; */ static long lock_count[CRYPTO_NUM_LOCKS]; -void thread_setup() +void thread_setup(void) { int i; @@ -821,7 +805,7 @@ void thread_setup() CRYPTO_set_locking_callback((void (*)())solaris_locking_callback); } -void thread_cleanup() +void thread_cleanup(void) { int i; @@ -836,11 +820,7 @@ fprintf(stderr,"cleanup\n"); fprintf(stderr,"done cleanup\n"); } -void solaris_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void solaris_locking_callback(int mode, int type, char *file, int line) { #ifdef undef fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n", @@ -872,8 +852,7 @@ if (CRYPTO_LOCK_SSL_CERT == type) } } -void do_threads(s_ctx,c_ctx) -SSL_CTX *s_ctx,*c_ctx; +void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx) { SSL_CTX *ssl_ctx[2]; thread_t thread_ctx[MAX_THREAD_NUMBER]; @@ -902,7 +881,7 @@ SSL_CTX *s_ctx,*c_ctx; s_ctx->references,c_ctx->references); } -unsigned long solaris_thread_id() +unsigned long solaris_thread_id(void) { unsigned long ret; @@ -917,7 +896,7 @@ unsigned long solaris_thread_id() static usptr_t *arena; static usema_t *lock_cs[CRYPTO_NUM_LOCKS]; -void thread_setup() +void thread_setup(void) { int i; char filename[20]; @@ -941,7 +920,7 @@ void thread_setup() CRYPTO_set_locking_callback((void (*)())irix_locking_callback); } -void thread_cleanup() +void thread_cleanup(void) { int i; @@ -956,11 +935,7 @@ void thread_cleanup() } } -void irix_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void irix_locking_callback(int mode, int type, char *file, int line) { if (mode & CRYPTO_LOCK) { @@ -974,8 +949,7 @@ int line; } } -void do_threads(s_ctx,c_ctx) -SSL_CTX *s_ctx,*c_ctx; +void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx) { SSL_CTX *ssl_ctx[2]; int thread_ctx[MAX_THREAD_NUMBER]; @@ -1000,7 +974,7 @@ SSL_CTX *s_ctx,*c_ctx; s_ctx->references,c_ctx->references); } -unsigned long irix_thread_id() +unsigned long irix_thread_id(void) { unsigned long ret; @@ -1014,7 +988,7 @@ unsigned long irix_thread_id() static pthread_mutex_t lock_cs[CRYPTO_NUM_LOCKS]; static long lock_count[CRYPTO_NUM_LOCKS]; -void thread_setup() +void thread_setup(void) { int i; @@ -1028,7 +1002,7 @@ void thread_setup() CRYPTO_set_locking_callback((void (*)())pthreads_locking_callback); } -void thread_cleanup() +void thread_cleanup(void) { int i; @@ -1043,11 +1017,8 @@ void thread_cleanup() fprintf(stderr,"done cleanup\n"); } -void pthreads_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void pthreads_locking_callback(int mode, int type, char *file, + int line) { #ifdef undef fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n", @@ -1072,8 +1043,7 @@ int line; } } -void do_threads(s_ctx,c_ctx) -SSL_CTX *s_ctx,*c_ctx; +void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx) { SSL_CTX *ssl_ctx[2]; pthread_t thread_ctx[MAX_THREAD_NUMBER]; @@ -1101,7 +1071,7 @@ SSL_CTX *s_ctx,*c_ctx; s_ctx->references,c_ctx->references); } -unsigned long pthreads_thread_id() +unsigned long pthreads_thread_id(void) { unsigned long ret; diff --git a/crypto/threads/th-lock.c b/crypto/threads/th-lock.c index 039022446d..21293f20f0 100644 --- a/crypto/threads/th-lock.c +++ b/crypto/threads/th-lock.c @@ -122,7 +122,7 @@ static unsigned long pthreads_thread_id(); static HANDLE lock_cs[CRYPTO_NUM_LOCKS]; -int CRYPTO_thread_setup() +int CRYPTO_thread_setup(void) { int i; @@ -136,7 +136,7 @@ int CRYPTO_thread_setup() return(1); } -static void CRYPTO_thread_cleanup() +static void CRYPTO_thread_cleanup(void) { int i; @@ -145,11 +145,7 @@ static void CRYPTO_thread_cleanup() CloseHandle(lock_cs[i]); } -void win32_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void win32_locking_callback(int mode, int type, char *file, int line) { if (mode & CRYPTO_LOCK) { @@ -174,7 +170,7 @@ static long lock_count[CRYPTO_NUM_LOCKS]; static rwlock_t lock_cs[CRYPTO_NUM_LOCKS]; #endif -void CRYPTO_thread_setup() +void CRYPTO_thread_setup(void) { int i; @@ -192,7 +188,7 @@ void CRYPTO_thread_setup() CRYPTO_set_locking_callback((void (*)())solaris_locking_callback); } -void CRYPTO_thread_cleanup() +void CRYPTO_thread_cleanup(void) { int i; @@ -207,11 +203,7 @@ void CRYPTO_thread_cleanup() } } -void solaris_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void solaris_locking_callback(int mode, int type, char *file, int line) { #if 0 fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n", @@ -248,7 +240,7 @@ int line; } } -unsigned long solaris_thread_id() +unsigned long solaris_thread_id(void) { unsigned long ret; @@ -263,7 +255,7 @@ unsigned long solaris_thread_id() static usptr_t *arena; static usema_t *lock_cs[CRYPTO_NUM_LOCKS]; -void CRYPTO_thread_setup() +void CRYPTO_thread_setup(void) { int i; char filename[20]; @@ -287,7 +279,7 @@ void CRYPTO_thread_setup() CRYPTO_set_locking_callback((void (*)())irix_locking_callback); } -void CRYPTO_thread_cleanup() +void CRYPTO_thread_cleanup(void) { int i; @@ -302,11 +294,7 @@ void CRYPTO_thread_cleanup() } } -void irix_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void irix_locking_callback(int mode, int type, char *file, int line) { if (mode & CRYPTO_LOCK) { @@ -318,7 +306,7 @@ int line; } } -unsigned long irix_thread_id() +unsigned long irix_thread_id(void) { unsigned long ret; @@ -333,7 +321,7 @@ unsigned long irix_thread_id() static pthread_mutex_t lock_cs[CRYPTO_NUM_LOCKS]; static long lock_count[CRYPTO_NUM_LOCKS]; -void CRYPTO_thread_setup() +void CRYPTO_thread_setup(void) { int i; @@ -347,7 +335,7 @@ void CRYPTO_thread_setup() CRYPTO_set_locking_callback((void (*)())pthreads_locking_callback); } -void thread_cleanup() +void thread_cleanup(void) { int i; @@ -358,11 +346,8 @@ void thread_cleanup() } } -void pthreads_locking_callback(mode,type,file,line) -int mode; -int type; -char *file; -int line; +void pthreads_locking_callback(int mode, int type, char *file, + int line) { #if 0 fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n", @@ -387,7 +372,7 @@ int line; } } -unsigned long pthreads_thread_id() +unsigned long pthreads_thread_id(void) { unsigned long ret; diff --git a/crypto/tmdiff.c b/crypto/tmdiff.c index a5b1c8b6c3..9d625689e6 100644 --- a/crypto/tmdiff.c +++ b/crypto/tmdiff.c @@ -134,7 +134,7 @@ typedef struct ms_tm #endif } MS_TM; -char *ms_time_new() +char *ms_time_new(void) { MS_TM *ret; @@ -148,15 +148,13 @@ char *ms_time_new() return((char *)ret); } -void ms_time_free(a) -char *a; +void ms_time_free(char *a) { if (a != NULL) Free(a); } -void ms_time_get(a) -char *a; +void ms_time_get(char *a) { MS_TM *tm=(MS_TM *)a; #ifdef WIN32 @@ -174,8 +172,7 @@ char *a; #endif } -double ms_time_diff(ap,bp) -char *ap,*bp; +double ms_time_diff(char *ap, char *bp) { MS_TM *a=(MS_TM *)ap; MS_TM *b=(MS_TM *)bp; @@ -204,8 +201,7 @@ char *ap,*bp; return((ret < 0.0000001)?0.0000001:ret); } -int ms_time_cmp(ap,bp) -char *ap,*bp; +int ms_time_cmp(char *ap, char *bp) { MS_TM *a=(MS_TM *)ap,*b=(MS_TM *)bp; double d; diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c index 5f072cc04f..9e7813b692 100644 --- a/crypto/txt_db/txt_db.c +++ b/crypto/txt_db/txt_db.c @@ -68,9 +68,7 @@ const char *TXT_DB_version="TXT_DB" OPENSSL_VERSION_PTEXT; -TXT_DB *TXT_DB_read(in,num) -BIO *in; -int num; +TXT_DB *TXT_DB_read(BIO *in, int num) { TXT_DB *ret=NULL; int er=1; @@ -191,10 +189,7 @@ err: return(ret); } -char **TXT_DB_get_by_index(db,idx,value) -TXT_DB *db; -int idx; -char **value; +char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value) { char **ret; LHASH *lh; @@ -215,12 +210,8 @@ char **value; return(ret); } -int TXT_DB_create_index(db,field,qual,hash,cmp) -TXT_DB *db; -int field; -int (*qual)(); -unsigned long (*hash)(); -int (*cmp)(); +int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(), + unsigned long (*hash)(), int (*cmp)()) { LHASH *idx; char *r; @@ -256,9 +247,7 @@ int (*cmp)(); return(1); } -long TXT_DB_write(out,db) -BIO *out; -TXT_DB *db; +long TXT_DB_write(BIO *out, TXT_DB *db) { long i,j,n,nn,l,tot=0; char *p,**pp,*f; @@ -306,9 +295,7 @@ err: return(ret); } -int TXT_DB_insert(db,row) -TXT_DB *db; -char **row; +int TXT_DB_insert(TXT_DB *db, char **row) { int i; char **r; @@ -350,8 +337,7 @@ err: return(0); } -void TXT_DB_free(db) -TXT_DB *db; +void TXT_DB_free(TXT_DB *db) { int i,n; char **p,*max; diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 118d6e31bd..95c7aa92b0 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -104,17 +104,13 @@ X509_LOOKUP_METHOD x509_dir_lookup= NULL, /* get_by_alias */ }; -X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir() +X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void) { return(&x509_dir_lookup); } -static int dir_ctrl(ctx,cmd,argp,argl,retp) -X509_LOOKUP *ctx; -int cmd; -long argl; -char *argp; -char **retp; +static int dir_ctrl(X509_LOOKUP *ctx, int cmd, char *argp, long argl, + char **retp) { int ret=0; BY_DIR *ld; @@ -146,8 +142,7 @@ char **retp; return(ret); } -static int new_dir(lu) -X509_LOOKUP *lu; +static int new_dir(X509_LOOKUP *lu) { BY_DIR *a; @@ -166,8 +161,7 @@ X509_LOOKUP *lu; return(1); } -static void free_dir(lu) -X509_LOOKUP *lu; +static void free_dir(X509_LOOKUP *lu) { BY_DIR *a; int i; @@ -181,10 +175,7 @@ X509_LOOKUP *lu; Free(a); } -static int add_cert_dir(ctx,dir, type) -BY_DIR *ctx; -const char *dir; -int type; +static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) { int j,len; int *ip; @@ -246,11 +237,8 @@ int type; return(1); } -static int get_cert_by_subject(xl,type,name,ret) -X509_LOOKUP *xl; -int type; -X509_NAME *name; -X509_OBJECT *ret; +static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, + X509_OBJECT *ret) { BY_DIR *ctx; union { diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c index 991f04aad9..95d57df3c7 100644 --- a/crypto/x509/by_file.c +++ b/crypto/x509/by_file.c @@ -91,17 +91,13 @@ X509_LOOKUP_METHOD x509_file_lookup= NULL, /* get_by_alias */ }; -X509_LOOKUP_METHOD *X509_LOOKUP_file() +X509_LOOKUP_METHOD *X509_LOOKUP_file(void) { return(&x509_file_lookup); } -static int by_file_ctrl(ctx,cmd,argp,argl,ret) -X509_LOOKUP *ctx; -int cmd; -char *argp; -long argl; -char **ret; +static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, char *argp, long argl, + char **ret) { int ok=0,ok2=0; char *file; @@ -138,10 +134,7 @@ char **ret; return((ok && ok2)?ok:0); } -int X509_load_cert_file(ctx,file,type) -X509_LOOKUP *ctx; -const char *file; -int type; +int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) { int ret=0; BIO *in=NULL; @@ -208,10 +201,7 @@ err: return(ret); } -int X509_load_crl_file(ctx,file,type) -X509_LOOKUP *ctx; -const char *file; -int type; +int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) { int ret=0; BIO *in=NULL; diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index 7dec3199cd..899b00eb13 100644 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -64,9 +64,7 @@ #include "objects.h" #include "x509.h" -int X509_issuer_and_serial_cmp(a,b) -X509 *a; -X509 *b; +int X509_issuer_and_serial_cmp(X509 *a, X509 *b) { int i; X509_CINF *ai,*bi; @@ -79,8 +77,7 @@ X509 *b; } #ifndef NO_MD5 -unsigned long X509_issuer_and_serial_hash(a) -X509 *a; +unsigned long X509_issuer_and_serial_hash(X509 *a) { unsigned long ret=0; MD5_CTX ctx; @@ -101,60 +98,47 @@ X509 *a; } #endif -int X509_issuer_name_cmp(a, b) -X509 *a; -X509 *b; +int X509_issuer_name_cmp(X509 *a, X509 *b) { return(X509_NAME_cmp(a->cert_info->issuer,b->cert_info->issuer)); } -int X509_subject_name_cmp(a, b) -X509 *a; -X509 *b; +int X509_subject_name_cmp(X509 *a, X509 *b) { return(X509_NAME_cmp(a->cert_info->subject,b->cert_info->subject)); } -int X509_CRL_cmp(a, b) -X509_CRL *a; -X509_CRL *b; +int X509_CRL_cmp(X509_CRL *a, X509_CRL *b) { return(X509_NAME_cmp(a->crl->issuer,b->crl->issuer)); } -X509_NAME *X509_get_issuer_name(a) -X509 *a; +X509_NAME *X509_get_issuer_name(X509 *a) { return(a->cert_info->issuer); } -unsigned long X509_issuer_name_hash(x) -X509 *x; +unsigned long X509_issuer_name_hash(X509 *x) { return(X509_NAME_hash(x->cert_info->issuer)); } -X509_NAME *X509_get_subject_name(a) -X509 *a; +X509_NAME *X509_get_subject_name(X509 *a) { return(a->cert_info->subject); } -ASN1_INTEGER *X509_get_serialNumber(a) -X509 *a; +ASN1_INTEGER *X509_get_serialNumber(X509 *a) { return(a->cert_info->serialNumber); } -unsigned long X509_subject_name_hash(x) -X509 *x; +unsigned long X509_subject_name_hash(X509 *x) { return(X509_NAME_hash(x->cert_info->subject)); } -int X509_NAME_cmp(a, b) -X509_NAME *a; -X509_NAME *b; +int X509_NAME_cmp(X509_NAME *a, X509_NAME *b) { int i,j; X509_NAME_ENTRY *na,*nb; @@ -190,8 +174,7 @@ X509_NAME *b; #ifndef NO_MD5 /* I now DER encode the name and hash it. Since I cache the DER encoding, * this is reasonably effiecent. */ -unsigned long X509_NAME_hash(x) -X509_NAME *x; +unsigned long X509_NAME_hash(X509_NAME *x) { unsigned long ret=0; unsigned char md[16]; @@ -217,10 +200,8 @@ X509_NAME *x; #endif /* Search a stack of X509 for a match */ -X509 *X509_find_by_issuer_and_serial(sk,name,serial) -STACK_OF(X509) *sk; -X509_NAME *name; -ASN1_INTEGER *serial; +X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name, + ASN1_INTEGER *serial) { int i; X509_CINF cinf; @@ -239,9 +220,7 @@ ASN1_INTEGER *serial; return(NULL); } -X509 *X509_find_by_subject(sk,name) -STACK_OF(X509) *sk; -X509_NAME *name; +X509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name) { X509 *x509; int i; @@ -255,17 +234,14 @@ X509_NAME *name; return(NULL); } -EVP_PKEY *X509_get_pubkey(x) -X509 *x; +EVP_PKEY *X509_get_pubkey(X509 *x) { if ((x == NULL) || (x->cert_info == NULL)) return(NULL); return(X509_PUBKEY_get(x->cert_info->key)); } -int X509_check_private_key(x,k) -X509 *x; -EVP_PKEY *k; +int X509_check_private_key(X509 *x, EVP_PKEY *k) { EVP_PKEY *xk=NULL; int ok=0; diff --git a/crypto/x509/x509_d2.c b/crypto/x509/x509_d2.c index 01e22f4cb4..35c7157301 100644 --- a/crypto/x509/x509_d2.c +++ b/crypto/x509/x509_d2.c @@ -64,8 +64,7 @@ #include "x509.h" #ifndef NO_STDIO -int X509_STORE_set_default_paths(ctx) -X509_STORE *ctx; +int X509_STORE_set_default_paths(X509_STORE *ctx) { X509_LOOKUP *lookup; @@ -83,10 +82,7 @@ X509_STORE *ctx; return(1); } -int X509_STORE_load_locations(ctx,file,path) -X509_STORE *ctx; -char *file; -char *path; +int X509_STORE_load_locations(X509_STORE *ctx, char *file, char *path) { X509_LOOKUP *lookup; diff --git a/crypto/x509/x509_def.c b/crypto/x509/x509_def.c index 0646a6bc8f..e3126bf887 100644 --- a/crypto/x509/x509_def.c +++ b/crypto/x509/x509_def.c @@ -63,21 +63,21 @@ #include "crypto.h" #include "x509.h" -const char *X509_get_default_private_dir() +const char *X509_get_default_private_dir(void) { return(X509_PRIVATE_DIR); } -const char *X509_get_default_cert_area() +const char *X509_get_default_cert_area(void) { return(X509_CERT_AREA); } -const char *X509_get_default_cert_dir() +const char *X509_get_default_cert_dir(void) { return(X509_CERT_DIR); } -const char *X509_get_default_cert_file() +const char *X509_get_default_cert_file(void) { return(X509_CERT_FILE); } -const char *X509_get_default_cert_dir_env() +const char *X509_get_default_cert_dir_env(void) { return(X509_CERT_DIR_EVP); } -const char *X509_get_default_cert_file_env() +const char *X509_get_default_cert_file_env(void) { return(X509_CERT_FILE_EVP); } diff --git a/crypto/x509/x509_err.c b/crypto/x509/x509_err.c index 4eb2a4dd21..0b5ca59221 100644 --- a/crypto/x509/x509_err.c +++ b/crypto/x509/x509_err.c @@ -116,7 +116,7 @@ static ERR_STRING_DATA X509_str_reasons[]= #endif -void ERR_load_X509_strings() +void ERR_load_X509_strings(void) { static int init=1; diff --git a/crypto/x509/x509_ext.c b/crypto/x509/x509_ext.c index 1d76ecfcfd..723b1d4d54 100644 --- a/crypto/x509/x509_ext.c +++ b/crypto/x509/x509_ext.c @@ -64,158 +64,108 @@ #include "evp.h" #include "x509.h" -int X509_CRL_get_ext_count(x) -X509_CRL *x; +int X509_CRL_get_ext_count(X509_CRL *x) { return(X509v3_get_ext_count(x->crl->extensions)); } -int X509_CRL_get_ext_by_NID(x,nid,lastpos) -X509_CRL *x; -int nid; -int lastpos; +int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos) { return(X509v3_get_ext_by_NID(x->crl->extensions,nid,lastpos)); } -int X509_CRL_get_ext_by_OBJ(x,obj,lastpos) -X509_CRL *x; -ASN1_OBJECT *obj; -int lastpos; +int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos) { return(X509v3_get_ext_by_OBJ(x->crl->extensions,obj,lastpos)); } -int X509_CRL_get_ext_by_critical(x,crit,lastpos) -X509_CRL *x; -int crit; -int lastpos; +int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos) { return(X509v3_get_ext_by_critical(x->crl->extensions,crit,lastpos)); } -X509_EXTENSION *X509_CRL_get_ext(x,loc) -X509_CRL *x; -int loc; +X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc) { return(X509v3_get_ext(x->crl->extensions,loc)); } -X509_EXTENSION *X509_CRL_delete_ext(x,loc) -X509_CRL *x; -int loc; +X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) { return(X509v3_delete_ext(x->crl->extensions,loc)); } -int X509_CRL_add_ext(x,ex,loc) -X509_CRL *x; -X509_EXTENSION *ex; -int loc; +int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) { return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); } -int X509_get_ext_count(x) -X509 *x; +int X509_get_ext_count(X509 *x) { return(X509v3_get_ext_count(x->cert_info->extensions)); } -int X509_get_ext_by_NID(x,nid,lastpos) -X509 *x; -int nid; -int lastpos; +int X509_get_ext_by_NID(X509 *x, int nid, int lastpos) { return(X509v3_get_ext_by_NID(x->cert_info->extensions,nid,lastpos)); } -int X509_get_ext_by_OBJ(x,obj,lastpos) -X509 *x; -ASN1_OBJECT *obj; -int lastpos; +int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) { return(X509v3_get_ext_by_OBJ(x->cert_info->extensions,obj,lastpos)); } -int X509_get_ext_by_critical(x,crit,lastpos) -X509 *x; -int crit; -int lastpos; +int X509_get_ext_by_critical(X509 *x, int crit, int lastpos) { return(X509v3_get_ext_by_critical(x->cert_info->extensions,crit,lastpos)); } -X509_EXTENSION *X509_get_ext(x,loc) -X509 *x; -int loc; +X509_EXTENSION *X509_get_ext(X509 *x, int loc) { return(X509v3_get_ext(x->cert_info->extensions,loc)); } -X509_EXTENSION *X509_delete_ext(x,loc) -X509 *x; -int loc; +X509_EXTENSION *X509_delete_ext(X509 *x, int loc) { return(X509v3_delete_ext(x->cert_info->extensions,loc)); } -int X509_add_ext(x,ex,loc) -X509 *x; -X509_EXTENSION *ex; -int loc; +int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) { return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL); } -int X509_REVOKED_get_ext_count(x) -X509_REVOKED *x; +int X509_REVOKED_get_ext_count(X509_REVOKED *x) { return(X509v3_get_ext_count(x->extensions)); } -int X509_REVOKED_get_ext_by_NID(x,nid,lastpos) -X509_REVOKED *x; -int nid; -int lastpos; +int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos) { return(X509v3_get_ext_by_NID(x->extensions,nid,lastpos)); } -int X509_REVOKED_get_ext_by_OBJ(x,obj,lastpos) -X509_REVOKED *x; -ASN1_OBJECT *obj; -int lastpos; +int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj, + int lastpos) { return(X509v3_get_ext_by_OBJ(x->extensions,obj,lastpos)); } -int X509_REVOKED_get_ext_by_critical(x,crit,lastpos) -X509_REVOKED *x; -int crit; -int lastpos; +int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos) { return(X509v3_get_ext_by_critical(x->extensions,crit,lastpos)); } -X509_EXTENSION *X509_REVOKED_get_ext(x,loc) -X509_REVOKED *x; -int loc; +X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc) { return(X509v3_get_ext(x->extensions,loc)); } -X509_EXTENSION *X509_REVOKED_delete_ext(x,loc) -X509_REVOKED *x; -int loc; +X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc) { return(X509v3_delete_ext(x->extensions,loc)); } -int X509_REVOKED_add_ext(x,ex,loc) -X509_REVOKED *x; -X509_EXTENSION *ex; -int loc; +int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) { return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL); } diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index bb913c28ec..65b6bcd0d2 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -64,8 +64,7 @@ static STACK *x509_store_meth=NULL; static STACK *x509_store_ctx_meth=NULL; -X509_LOOKUP *X509_LOOKUP_new(method) -X509_LOOKUP_METHOD *method; +X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) { X509_LOOKUP *ret; @@ -85,8 +84,7 @@ X509_LOOKUP_METHOD *method; return(ret); } -void X509_LOOKUP_free(ctx) -X509_LOOKUP *ctx; +void X509_LOOKUP_free(X509_LOOKUP *ctx) { if (ctx == NULL) return; if ( (ctx->method != NULL) && @@ -95,8 +93,7 @@ X509_LOOKUP *ctx; Free(ctx); } -int X509_LOOKUP_init(ctx) -X509_LOOKUP *ctx; +int X509_LOOKUP_init(X509_LOOKUP *ctx) { if (ctx->method == NULL) return(0); if (ctx->method->init != NULL) @@ -105,8 +102,7 @@ X509_LOOKUP *ctx; return(1); } -int X509_LOOKUP_shutdown(ctx) -X509_LOOKUP *ctx; +int X509_LOOKUP_shutdown(X509_LOOKUP *ctx) { if (ctx->method == NULL) return(0); if (ctx->method->shutdown != NULL) @@ -115,12 +111,8 @@ X509_LOOKUP *ctx; return(1); } -int X509_LOOKUP_ctrl(ctx,cmd,argc,argl,ret) -X509_LOOKUP *ctx; -int cmd; -char *argc; -long argl; -char **ret; +int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, char *argc, long argl, + char **ret) { if (ctx->method == NULL) return(-1); if (ctx->method->ctrl != NULL) @@ -129,11 +121,8 @@ char **ret; return(1); } -int X509_LOOKUP_by_subject(ctx,type,name,ret) -X509_LOOKUP *ctx; -int type; -X509_NAME *name; -X509_OBJECT *ret; +int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, + X509_OBJECT *ret) { if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) return(X509_LU_FAIL); @@ -141,12 +130,8 @@ X509_OBJECT *ret; return(ctx->method->get_by_subject(ctx,type,name,ret)); } -int X509_LOOKUP_by_issuer_serial(ctx,type,name,serial,ret) -X509_LOOKUP *ctx; -int type; -X509_NAME *name; -ASN1_INTEGER *serial; -X509_OBJECT *ret; +int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, + ASN1_INTEGER *serial, X509_OBJECT *ret) { if ((ctx->method == NULL) || (ctx->method->get_by_issuer_serial == NULL)) @@ -154,32 +139,23 @@ X509_OBJECT *ret; return(ctx->method->get_by_issuer_serial(ctx,type,name,serial,ret)); } -int X509_LOOKUP_by_fingerprint(ctx,type,bytes,len,ret) -X509_LOOKUP *ctx; -int type; -unsigned char *bytes; -int len; -X509_OBJECT *ret; +int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, + unsigned char *bytes, int len, X509_OBJECT *ret) { if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) return(X509_LU_FAIL); return(ctx->method->get_by_fingerprint(ctx,type,bytes,len,ret)); } -int X509_LOOKUP_by_alias(ctx,type,str,len,ret) -X509_LOOKUP *ctx; -int type; -char *str; -int len; -X509_OBJECT *ret; +int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len, + X509_OBJECT *ret) { if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) return(X509_LU_FAIL); return(ctx->method->get_by_alias(ctx,type,str,len,ret)); } -static unsigned long x509_object_hash(a) -X509_OBJECT *a; +static unsigned long x509_object_hash(X509_OBJECT *a) { unsigned long h; @@ -197,8 +173,7 @@ X509_OBJECT *a; return(h); } -static int x509_object_cmp(a,b) -X509_OBJECT *a,*b; +static int x509_object_cmp(X509_OBJECT *a, X509_OBJECT *b) { int ret; @@ -218,7 +193,7 @@ X509_OBJECT *a,*b; return(ret); } -X509_STORE *X509_STORE_new() +X509_STORE *X509_STORE_new(void) { X509_STORE *ret; @@ -235,8 +210,7 @@ X509_STORE *X509_STORE_new() return(ret); } -static void cleanup(a) -X509_OBJECT *a; +static void cleanup(X509_OBJECT *a) { if (a->type == X509_LU_X509) { @@ -252,8 +226,7 @@ X509_OBJECT *a; Free(a); } -void X509_STORE_free(vfy) -X509_STORE *vfy; +void X509_STORE_free(X509_STORE *vfy) { int i; STACK *sk; @@ -277,9 +250,7 @@ X509_STORE *vfy; Free(vfy); } -X509_LOOKUP *X509_STORE_add_lookup(v,m) -X509_STORE *v; -X509_LOOKUP_METHOD *m; +X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) { int i; STACK *sk; @@ -311,11 +282,8 @@ X509_LOOKUP_METHOD *m; } } -int X509_STORE_get_by_subject(vs,type,name,ret) -X509_STORE_CTX *vs; -int type; -X509_NAME *name; -X509_OBJECT *ret; +int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name, + X509_OBJECT *ret) { X509_STORE *ctx=vs->ctx; X509_LOOKUP *lu; @@ -357,8 +325,7 @@ X509_OBJECT *ret; return(1); } -void X509_OBJECT_up_ref_count(a) -X509_OBJECT *a; +void X509_OBJECT_up_ref_count(X509_OBJECT *a) { switch (a->type) { @@ -371,8 +338,7 @@ X509_OBJECT *a; } } -void X509_OBJECT_free_contents(a) -X509_OBJECT *a; +void X509_OBJECT_free_contents(X509_OBJECT *a) { switch (a->type) { @@ -385,10 +351,8 @@ X509_OBJECT *a; } } -X509_OBJECT *X509_OBJECT_retrieve_by_subject(h,type,name) -LHASH *h; -int type; -X509_NAME *name; +X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h, int type, + X509_NAME *name) { X509_OBJECT stmp,*tmp; X509 x509_s; @@ -417,11 +381,8 @@ X509_NAME *name; return(tmp); } -void X509_STORE_CTX_init(ctx,store,x509,chain) -X509_STORE_CTX *ctx; -X509_STORE *store; -X509 *x509; -STACK_OF(X509) *chain; +void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, + STACK_OF(X509) *chain) { ctx->ctx=store; ctx->current_method=0; @@ -436,8 +397,7 @@ STACK_OF(X509) *chain; memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA)); } -void X509_STORE_CTX_cleanup(ctx) -X509_STORE_CTX *ctx; +void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) { if (ctx->chain != NULL) { diff --git a/crypto/x509/x509_obj.c b/crypto/x509/x509_obj.c index 5a16fd500a..dd6fdbb7f9 100644 --- a/crypto/x509/x509_obj.c +++ b/crypto/x509/x509_obj.c @@ -63,10 +63,7 @@ #include "x509.h" #include "buffer.h" -char *X509_NAME_oneline(a,buf,len) -X509_NAME *a; -char *buf; -int len; +char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) { X509_NAME_ENTRY *ne; unsigned int i; diff --git a/crypto/x509/x509_r2x.c b/crypto/x509/x509_r2x.c index 880e9f669e..f9c498a55d 100644 --- a/crypto/x509/x509_r2x.c +++ b/crypto/x509/x509_r2x.c @@ -65,10 +65,7 @@ #include "objects.h" #include "buffer.h" -X509 *X509_REQ_to_X509(r,days,pkey) -X509_REQ *r; -int days; -EVP_PKEY *pkey; +X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) { X509 *ret=NULL; X509_CINF *xi=NULL; diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index ce699bfa8d..1f9e232c6a 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -66,10 +66,7 @@ #include "buffer.h" #include "pem.h" -X509_REQ *X509_to_X509_REQ(x,pkey,md) -X509 *x; -EVP_PKEY *pkey; -EVP_MD *md; +X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, EVP_MD *md) { X509_REQ *ret; X509_REQ_INFO *ri; @@ -109,8 +106,7 @@ err: return(NULL); } -EVP_PKEY *X509_REQ_get_pubkey(req) -X509_REQ *req; +EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req) { if ((req == NULL) || (req->req_info == NULL)) return(NULL); diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c index 5d0a3a0c0e..da5299dcdb 100644 --- a/crypto/x509/x509_set.c +++ b/crypto/x509/x509_set.c @@ -63,9 +63,7 @@ #include "evp.h" #include "x509.h" -int X509_set_version(x,version) -X509 *x; -long version; +int X509_set_version(X509 *x, long version) { if (x == NULL) return(0); if (x->cert_info->version == NULL) @@ -76,9 +74,7 @@ long version; return(ASN1_INTEGER_set(x->cert_info->version,version)); } -int X509_set_serialNumber(x,serial) -X509 *x; -ASN1_INTEGER *serial; +int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial) { ASN1_INTEGER *in; @@ -96,25 +92,19 @@ ASN1_INTEGER *serial; return(in != NULL); } -int X509_set_issuer_name(x,name) -X509 *x; -X509_NAME *name; +int X509_set_issuer_name(X509 *x, X509_NAME *name) { if ((x == NULL) || (x->cert_info == NULL)) return(0); return(X509_NAME_set(&x->cert_info->issuer,name)); } -int X509_set_subject_name(x,name) -X509 *x; -X509_NAME *name; +int X509_set_subject_name(X509 *x, X509_NAME *name) { if ((x == NULL) || (x->cert_info == NULL)) return(0); return(X509_NAME_set(&x->cert_info->subject,name)); } -int X509_set_notBefore(x,tm) -X509 *x; -ASN1_UTCTIME *tm; +int X509_set_notBefore(X509 *x, ASN1_UTCTIME *tm) { ASN1_UTCTIME *in; @@ -132,9 +122,7 @@ ASN1_UTCTIME *tm; return(in != NULL); } -int X509_set_notAfter(x,tm) -X509 *x; -ASN1_UTCTIME *tm; +int X509_set_notAfter(X509 *x, ASN1_UTCTIME *tm) { ASN1_UTCTIME *in; @@ -152,9 +140,7 @@ ASN1_UTCTIME *tm; return(in != NULL); } -int X509_set_pubkey(x,pkey) -X509 *x; -EVP_PKEY *pkey; +int X509_set_pubkey(X509 *x, EVP_PKEY *pkey) { if ((x == NULL) || (x->cert_info == NULL)) return(0); return(X509_PUBKEY_set(&(x->cert_info->key),pkey)); diff --git a/crypto/x509/x509_txt.c b/crypto/x509/x509_txt.c index 2c401c134a..06f284b0a6 100644 --- a/crypto/x509/x509_txt.c +++ b/crypto/x509/x509_txt.c @@ -69,8 +69,7 @@ #include "x509.h" #include "objects.h" -const char *X509_verify_cert_error_string(n) -long n; +const char *X509_verify_cert_error_string(long n) { static char buf[100]; diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c index c8a07ff336..83988cf194 100644 --- a/crypto/x509/x509_v3.c +++ b/crypto/x509/x509_v3.c @@ -64,17 +64,13 @@ #include "evp.h" #include "x509.h" -int X509v3_get_ext_count(x) -STACK *x; +int X509v3_get_ext_count(STACK *x) { if (x == NULL) return(0); return(sk_num(x)); } -int X509v3_get_ext_by_NID(x,nid,lastpos) -STACK *x; -int nid; -int lastpos; +int X509v3_get_ext_by_NID(STACK *x, int nid, int lastpos) { ASN1_OBJECT *obj; @@ -83,10 +79,7 @@ int lastpos; return(X509v3_get_ext_by_OBJ(x,obj,lastpos)); } -int X509v3_get_ext_by_OBJ(sk,obj,lastpos) -STACK *sk; -ASN1_OBJECT *obj; -int lastpos; +int X509v3_get_ext_by_OBJ(STACK *sk, ASN1_OBJECT *obj, int lastpos) { int n; X509_EXTENSION *ex; @@ -105,10 +98,7 @@ int lastpos; return(-1); } -int X509v3_get_ext_by_critical(sk,crit,lastpos) -STACK *sk; -int crit; -int lastpos; +int X509v3_get_ext_by_critical(STACK *sk, int crit, int lastpos) { int n; X509_EXTENSION *ex; @@ -128,9 +118,7 @@ int lastpos; return(-1); } -X509_EXTENSION *X509v3_get_ext(x,loc) -STACK *x; -int loc; +X509_EXTENSION *X509v3_get_ext(STACK *x, int loc) { if ((x == NULL) || (sk_num(x) <= loc) || (loc < 0)) return(NULL); @@ -138,9 +126,7 @@ int loc; return((X509_EXTENSION *)sk_value(x,loc)); } -X509_EXTENSION *X509v3_delete_ext(x,loc) -STACK *x; -int loc; +X509_EXTENSION *X509v3_delete_ext(STACK *x, int loc) { X509_EXTENSION *ret; @@ -150,10 +136,7 @@ int loc; return(ret); } -STACK *X509v3_add_ext(x,ex,loc) -STACK **x; -X509_EXTENSION *ex; -int loc; +STACK *X509v3_add_ext(STACK **x, X509_EXTENSION *ex, int loc) { X509_EXTENSION *new_ex=NULL; int n; @@ -186,11 +169,8 @@ err2: return(NULL); } -X509_EXTENSION *X509_EXTENSION_create_by_NID(ex,nid,crit,data) -X509_EXTENSION **ex; -int nid; -int crit; -ASN1_OCTET_STRING *data; +X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, + int crit, ASN1_OCTET_STRING *data) { ASN1_OBJECT *obj; X509_EXTENSION *ret; @@ -206,11 +186,8 @@ ASN1_OCTET_STRING *data; return(ret); } -X509_EXTENSION *X509_EXTENSION_create_by_OBJ(ex,obj,crit,data) -X509_EXTENSION **ex; -ASN1_OBJECT *obj; -int crit; -ASN1_OCTET_STRING *data; +X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data) { X509_EXTENSION *ret; @@ -240,9 +217,7 @@ err: return(NULL); } -int X509_EXTENSION_set_object(ex,obj) -X509_EXTENSION *ex; -ASN1_OBJECT *obj; +int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj) { if ((ex == NULL) || (obj == NULL)) return(0); @@ -251,18 +226,14 @@ ASN1_OBJECT *obj; return(1); } -int X509_EXTENSION_set_critical(ex,crit) -X509_EXTENSION *ex; -int crit; +int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit) { if (ex == NULL) return(0); ex->critical=(crit)?0xFF:0; return(1); } -int X509_EXTENSION_set_data(ex,data) -X509_EXTENSION *ex; -ASN1_OCTET_STRING *data; +int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data) { int i; @@ -272,22 +243,19 @@ ASN1_OCTET_STRING *data; return(1); } -ASN1_OBJECT *X509_EXTENSION_get_object(ex) -X509_EXTENSION *ex; +ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex) { if (ex == NULL) return(NULL); return(ex->object); } -ASN1_OCTET_STRING *X509_EXTENSION_get_data(ex) -X509_EXTENSION *ex; +ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ex) { if (ex == NULL) return(NULL); return(ex->value); } -int X509_EXTENSION_get_critical(ex) -X509_EXTENSION *ex; +int X509_EXTENSION_get_critical(X509_EXTENSION *ex) { if (ex == NULL) return(0); return(ex->critical); diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 1b3a491930..a723851548 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -88,23 +88,19 @@ static int x509_store_num=1; static STACK *x509_store_method=NULL; #endif -static int null_callback(ok,e) -int ok; -X509_STORE_CTX *e; +static int null_callback(int ok, X509_STORE_CTX *e) { return(ok); } #if 0 -static int x509_subject_cmp(a,b) -X509 **a,**b; +static int x509_subject_cmp(X509 **a, X509 **b) { return(X509_subject_name_cmp(*a,*b)); } #endif -int X509_verify_cert(ctx) -X509_STORE_CTX *ctx; +int X509_verify_cert(X509_STORE_CTX *ctx) { X509 *x,*xtmp,*chain_ss=NULL; X509_NAME *xn; @@ -296,8 +292,7 @@ end: return(ok); } -static int internal_verify(ctx) -X509_STORE_CTX *ctx; +static int internal_verify(X509_STORE_CTX *ctx) { int i,ok=0,n; X509 *xs,*xi; @@ -409,8 +404,7 @@ end: return(ok); } -int X509_cmp_current_time(ctm) -ASN1_UTCTIME *ctm; +int X509_cmp_current_time(ASN1_UTCTIME *ctm) { char *str; ASN1_UTCTIME atm; @@ -463,9 +457,7 @@ ASN1_UTCTIME *ctm; return(i); } -ASN1_UTCTIME *X509_gmtime_adj(s, adj) -ASN1_UTCTIME *s; -long adj; +ASN1_UTCTIME *X509_gmtime_adj(ASN1_UTCTIME *s, long adj) { time_t t; @@ -474,9 +466,7 @@ long adj; return(ASN1_UTCTIME_set(s,t)); } -int X509_get_pubkey_parameters(pkey,chain) -EVP_PKEY *pkey; -STACK *chain; +int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK *chain) { EVP_PKEY *ktmp=NULL,*ktmp2; int i,j; @@ -518,9 +508,7 @@ STACK *chain; return(1); } -int X509_STORE_add_cert(ctx,x) -X509_STORE *ctx; -X509 *x; +int X509_STORE_add_cert(X509_STORE *ctx, X509 *x) { X509_OBJECT *obj,*r; int ret=1; @@ -555,9 +543,7 @@ X509 *x; return(ret); } -int X509_STORE_add_crl(ctx,x) -X509_STORE *ctx; -X509_CRL *x; +int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) { X509_OBJECT *obj,*r; int ret=1; @@ -592,12 +578,8 @@ X509_CRL *x; return(ret); } -int X509_STORE_CTX_get_ex_new_index(argl,argp,new_func,dup_func,free_func) -long argl; -char *argp; -int (*new_func)(); -int (*dup_func)(); -void (*free_func)(); +int X509_STORE_CTX_get_ex_new_index(long argl, char *argp, int (*new_func)(), + int (*dup_func)(), void (*free_func)()) { x509_store_ctx_num++; return(CRYPTO_get_ex_new_index(x509_store_ctx_num-1, @@ -605,62 +587,47 @@ void (*free_func)(); argl,argp,new_func,dup_func,free_func)); } -int X509_STORE_CTX_set_ex_data(ctx,idx,data) -X509_STORE_CTX *ctx; -int idx; -void *data; +int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data) { return(CRYPTO_set_ex_data(&ctx->ex_data,idx,data)); } -void *X509_STORE_CTX_get_ex_data(ctx,idx) -X509_STORE_CTX *ctx; -int idx; +void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx) { return(CRYPTO_get_ex_data(&ctx->ex_data,idx)); } -int X509_STORE_CTX_get_error(ctx) -X509_STORE_CTX *ctx; +int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx) { return(ctx->error); } -void X509_STORE_CTX_set_error(ctx,err) -X509_STORE_CTX *ctx; -int err; +void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int err) { ctx->error=err; } -int X509_STORE_CTX_get_error_depth(ctx) -X509_STORE_CTX *ctx; +int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx) { return(ctx->error_depth); } -X509 *X509_STORE_CTX_get_current_cert(ctx) -X509_STORE_CTX *ctx; +X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) { return(ctx->current_cert); } -STACK *X509_STORE_CTX_get_chain(ctx) -X509_STORE_CTX *ctx; +STACK *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) { return(ctx->chain); } -void X509_STORE_CTX_set_cert(ctx,x) -X509_STORE_CTX *ctx; -X509 *x; +void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) { ctx->cert=x; } -void X509_STORE_CTX_set_chain(ctx,sk) -X509_STORE_CTX *ctx; -STACK_OF(X509) *sk; +void X509_STORE_CTX_set_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) { ctx->untrusted=sk; } diff --git a/crypto/x509/x509name.c b/crypto/x509/x509name.c index f495d361b9..2bc5f29d08 100644 --- a/crypto/x509/x509name.c +++ b/crypto/x509/x509name.c @@ -64,11 +64,7 @@ #include "evp.h" #include "x509.h" -int X509_NAME_get_text_by_NID(name,nid,buf,len) -X509_NAME *name; -int nid; -char *buf; -int len; +int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len) { ASN1_OBJECT *obj; @@ -77,11 +73,8 @@ int len; return(X509_NAME_get_text_by_OBJ(name,obj,buf,len)); } -int X509_NAME_get_text_by_OBJ(name,obj,buf,len) -X509_NAME *name; -ASN1_OBJECT *obj; -char *buf; -int len; +int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf, + int len) { int i; ASN1_STRING *data; @@ -96,17 +89,13 @@ int len; return(i); } -int X509_NAME_entry_count(name) -X509_NAME *name; +int X509_NAME_entry_count(X509_NAME *name) { if (name == NULL) return(0); return(sk_num(name->entries)); } -int X509_NAME_get_index_by_NID(name,nid,lastpos) -X509_NAME *name; -int nid; -int lastpos; +int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) { ASN1_OBJECT *obj; @@ -116,10 +105,8 @@ int lastpos; } /* NOTE: you should be passsing -1, not 0 as lastpos */ -int X509_NAME_get_index_by_OBJ(name,obj,lastpos) -X509_NAME *name; -ASN1_OBJECT *obj; -int lastpos; +int X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, + int lastpos) { int n; X509_NAME_ENTRY *ne; @@ -139,9 +126,7 @@ int lastpos; return(-1); } -X509_NAME_ENTRY *X509_NAME_get_entry(name,loc) -X509_NAME *name; -int loc; +X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc) { if ( (name == NULL) || (sk_num(name->entries) <= loc) || (loc < 0)) return(NULL); @@ -149,9 +134,7 @@ int loc; return((X509_NAME_ENTRY *)sk_value(name->entries,loc)); } -X509_NAME_ENTRY *X509_NAME_delete_entry(name,loc) -X509_NAME *name; -int loc; +X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc) { X509_NAME_ENTRY *ret; int i,n,set_prev,set_next; @@ -188,11 +171,8 @@ int loc; /* if set is -1, append to previous set, 0 'a new one', and 1, * prepend to the guy we are about to stomp on. */ -int X509_NAME_add_entry(name,ne,loc,set) -X509_NAME *name; -X509_NAME_ENTRY *ne; -int loc; -int set; +int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, + int set) { X509_NAME_ENTRY *new_name=NULL; int n,i,inc; @@ -255,12 +235,8 @@ err: return(0); } -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(ne,nid,type,bytes,len) -X509_NAME_ENTRY **ne; -int nid; -int type; -unsigned char *bytes; -int len; +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type, unsigned char *bytes, int len) { ASN1_OBJECT *obj; @@ -273,12 +249,8 @@ int len; return(X509_NAME_ENTRY_create_by_OBJ(ne,obj,type,bytes,len)); } -X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(ne,obj,type,bytes,len) -X509_NAME_ENTRY **ne; -ASN1_OBJECT *obj; -int type; -unsigned char *bytes; -int len; +X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, + ASN1_OBJECT *obj, int type, unsigned char *bytes, int len) { X509_NAME_ENTRY *ret; @@ -303,9 +275,7 @@ err: return(NULL); } -int X509_NAME_ENTRY_set_object(ne,obj) -X509_NAME_ENTRY *ne; -ASN1_OBJECT *obj; +int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj) { if ((ne == NULL) || (obj == NULL)) { @@ -317,11 +287,8 @@ ASN1_OBJECT *obj; return((ne->object == NULL)?0:1); } -int X509_NAME_ENTRY_set_data(ne,type,bytes,len) -X509_NAME_ENTRY *ne; -int type; -unsigned char *bytes; -int len; +int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + unsigned char *bytes, int len) { int i; @@ -339,15 +306,13 @@ int len; return(1); } -ASN1_OBJECT *X509_NAME_ENTRY_get_object(ne) -X509_NAME_ENTRY *ne; +ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne) { if (ne == NULL) return(NULL); return(ne->object); } -ASN1_STRING *X509_NAME_ENTRY_get_data(ne) -X509_NAME_ENTRY *ne; +ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne) { if (ne == NULL) return(NULL); return(ne->value); diff --git a/crypto/x509/x509rset.c b/crypto/x509/x509rset.c index 323b25470a..9f8032da0e 100644 --- a/crypto/x509/x509rset.c +++ b/crypto/x509/x509rset.c @@ -63,25 +63,19 @@ #include "evp.h" #include "x509.h" -int X509_REQ_set_version(x,version) -X509_REQ *x; -long version; +int X509_REQ_set_version(X509_REQ *x, long version) { if (x == NULL) return(0); return(ASN1_INTEGER_set(x->req_info->version,version)); } -int X509_REQ_set_subject_name(x,name) -X509_REQ *x; -X509_NAME *name; +int X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name) { if ((x == NULL) || (x->req_info == NULL)) return(0); return(X509_NAME_set(&x->req_info->subject,name)); } -int X509_REQ_set_pubkey(x,pkey) -X509_REQ *x; -EVP_PKEY *pkey; +int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey) { if ((x == NULL) || (x->req_info == NULL)) return(0); return(X509_PUBKEY_set(&x->req_info->pubkey,pkey)); diff --git a/crypto/x509/x509type.c b/crypto/x509/x509type.c index 5274ded737..992cd483b1 100644 --- a/crypto/x509/x509type.c +++ b/crypto/x509/x509type.c @@ -62,9 +62,7 @@ #include "objects.h" #include "x509.h" -int X509_certificate_type(x,pkey) -X509 *x; -EVP_PKEY *pkey; +int X509_certificate_type(X509 *x, EVP_PKEY *pkey) { EVP_PKEY *pk; int ret=0,i; diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c index 582a7729e0..0e4302f64f 100644 --- a/crypto/x509/x_all.c +++ b/crypto/x509/x_all.c @@ -65,90 +65,67 @@ #include "evp.h" #include "x509.h" -int X509_verify(a,r) -X509 *a; -EVP_PKEY *r; +int X509_verify(X509 *a, EVP_PKEY *r) { return(ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg, a->signature,(char *)a->cert_info,r)); } -int X509_REQ_verify(a,r) -X509_REQ *a; -EVP_PKEY *r; +int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) { return( ASN1_verify((int (*)())i2d_X509_REQ_INFO, a->sig_alg,a->signature,(char *)a->req_info,r)); } -int X509_CRL_verify(a,r) -X509_CRL *a; -EVP_PKEY *r; +int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r) { return(ASN1_verify((int (*)())i2d_X509_CRL_INFO, a->sig_alg, a->signature,(char *)a->crl,r)); } -int NETSCAPE_SPKI_verify(a,r) -NETSCAPE_SPKI *a; -EVP_PKEY *r; +int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r) { return(ASN1_verify((int (*)())i2d_NETSCAPE_SPKAC, a->sig_algor,a->signature, (char *)a->spkac,r)); } -int X509_sign(x,pkey,md) -X509 *x; -EVP_PKEY *pkey; -const EVP_MD *md; +int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) { return(ASN1_sign((int (*)())i2d_X509_CINF, x->cert_info->signature, x->sig_alg, x->signature, (char *)x->cert_info,pkey,md)); } -int X509_REQ_sign(x,pkey,md) -X509_REQ *x; -EVP_PKEY *pkey; -const EVP_MD *md; +int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) { return(ASN1_sign((int (*)())i2d_X509_REQ_INFO,x->sig_alg, NULL, x->signature, (char *)x->req_info,pkey,md)); } -int X509_CRL_sign(x,pkey,md) -X509_CRL *x; -EVP_PKEY *pkey; -const EVP_MD *md; +int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) { return(ASN1_sign((int (*)())i2d_X509_CRL_INFO,x->crl->sig_alg, x->sig_alg, x->signature, (char *)x->crl,pkey,md)); } -int NETSCAPE_SPKI_sign(x,pkey,md) -NETSCAPE_SPKI *x; -EVP_PKEY *pkey; -const EVP_MD *md; +int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) { return(ASN1_sign((int (*)())i2d_NETSCAPE_SPKAC, x->sig_algor,NULL, x->signature, (char *)x->spkac,pkey,md)); } -X509_ATTRIBUTE *X509_ATTRIBUTE_dup(xa) -X509_ATTRIBUTE *xa; +X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa) { return((X509_ATTRIBUTE *)ASN1_dup((int (*)())i2d_X509_ATTRIBUTE, (char *(*)())d2i_X509_ATTRIBUTE,(char *)xa)); } -X509 *X509_dup(x509) -X509 *x509; +X509 *X509_dup(X509 *x509) { return((X509 *)ASN1_dup((int (*)())i2d_X509, (char *(*)())d2i_X509,(char *)x509)); } -X509_EXTENSION *X509_EXTENSION_dup(ex) -X509_EXTENSION *ex; +X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex) { return((X509_EXTENSION *)ASN1_dup( (int (*)())i2d_X509_EXTENSION, @@ -156,237 +133,184 @@ X509_EXTENSION *ex; } #ifndef NO_FP_API -X509 *d2i_X509_fp(fp,x509) -FILE *fp; -X509 *x509; +X509 *d2i_X509_fp(FILE *fp, X509 *x509) { return((X509 *)ASN1_d2i_fp((char *(*)())X509_new, (char *(*)())d2i_X509, (fp),(unsigned char **)(x509))); } -int i2d_X509_fp(fp,x509) -FILE *fp; -X509 *x509; +int i2d_X509_fp(FILE *fp, X509 *x509) { return(ASN1_i2d_fp(i2d_X509,fp,(unsigned char *)x509)); } #endif -X509 *d2i_X509_bio(bp,x509) -BIO *bp; -X509 *x509; +X509 *d2i_X509_bio(BIO *bp, X509 *x509) { return((X509 *)ASN1_d2i_bio((char *(*)())X509_new, (char *(*)())d2i_X509, (bp),(unsigned char **)(x509))); } -int i2d_X509_bio(bp,x509) -BIO *bp; -X509 *x509; +int i2d_X509_bio(BIO *bp, X509 *x509) { return(ASN1_i2d_bio(i2d_X509,bp,(unsigned char *)x509)); } -X509_CRL *X509_CRL_dup(crl) -X509_CRL *crl; +X509_CRL *X509_CRL_dup(X509_CRL *crl) { return((X509_CRL *)ASN1_dup((int (*)())i2d_X509_CRL, (char *(*)())d2i_X509_CRL,(char *)crl)); } #ifndef NO_FP_API -X509_CRL *d2i_X509_CRL_fp(fp,crl) -FILE *fp; -X509_CRL *crl; +X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL *crl) { return((X509_CRL *)ASN1_d2i_fp((char *(*)()) X509_CRL_new,(char *(*)())d2i_X509_CRL, (fp), (unsigned char **)(crl))); } -int i2d_X509_CRL_fp(fp,crl) -FILE *fp; -X509_CRL *crl; +int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) { return(ASN1_i2d_fp(i2d_X509_CRL,fp,(unsigned char *)crl)); } #endif -X509_CRL *d2i_X509_CRL_bio(bp,crl) -BIO *bp; -X509_CRL *crl; +X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL *crl) { return((X509_CRL *)ASN1_d2i_bio((char *(*)()) X509_CRL_new,(char *(*)())d2i_X509_CRL, (bp), (unsigned char **)(crl))); } -int i2d_X509_CRL_bio(bp,crl) -BIO *bp; -X509_CRL *crl; +int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) { return(ASN1_i2d_bio(i2d_X509_CRL,bp,(unsigned char *)crl)); } -PKCS7 *PKCS7_dup(p7) -PKCS7 *p7; +PKCS7 *PKCS7_dup(PKCS7 *p7) { return((PKCS7 *)ASN1_dup((int (*)())i2d_PKCS7, (char *(*)())d2i_PKCS7,(char *)p7)); } #ifndef NO_FP_API -PKCS7 *d2i_PKCS7_fp(fp,p7) -FILE *fp; -PKCS7 *p7; +PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 *p7) { return((PKCS7 *)ASN1_d2i_fp((char *(*)()) PKCS7_new,(char *(*)())d2i_PKCS7, (fp), (unsigned char **)(p7))); } -int i2d_PKCS7_fp(fp,p7) -FILE *fp; -PKCS7 *p7; +int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7) { return(ASN1_i2d_fp(i2d_PKCS7,fp,(unsigned char *)p7)); } #endif -PKCS7 *d2i_PKCS7_bio(bp,p7) -BIO *bp; -PKCS7 *p7; +PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 *p7) { return((PKCS7 *)ASN1_d2i_bio((char *(*)()) PKCS7_new,(char *(*)())d2i_PKCS7, (bp), (unsigned char **)(p7))); } -int i2d_PKCS7_bio(bp,p7) -BIO *bp; -PKCS7 *p7; +int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7) { return(ASN1_i2d_bio(i2d_PKCS7,bp,(unsigned char *)p7)); } -X509_REQ *X509_REQ_dup(req) -X509_REQ *req; +X509_REQ *X509_REQ_dup(X509_REQ *req) { return((X509_REQ *)ASN1_dup((int (*)())i2d_X509_REQ, (char *(*)())d2i_X509_REQ,(char *)req)); } #ifndef NO_FP_API -X509_REQ *d2i_X509_REQ_fp(fp,req) -FILE *fp; -X509_REQ *req; +X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ *req) { return((X509_REQ *)ASN1_d2i_fp((char *(*)()) X509_REQ_new, (char *(*)())d2i_X509_REQ, (fp), (unsigned char **)(req))); } -int i2d_X509_REQ_fp(fp,req) -FILE *fp; -X509_REQ *req; +int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) { return(ASN1_i2d_fp(i2d_X509_REQ,fp,(unsigned char *)req)); } #endif -X509_REQ *d2i_X509_REQ_bio(bp,req) -BIO *bp; -X509_REQ *req; +X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ *req) { return((X509_REQ *)ASN1_d2i_bio((char *(*)()) X509_REQ_new, (char *(*)())d2i_X509_REQ, (bp), (unsigned char **)(req))); } -int i2d_X509_REQ_bio(bp,req) -BIO *bp; -X509_REQ *req; +int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) { return(ASN1_i2d_bio(i2d_X509_REQ,bp,(unsigned char *)req)); } #ifndef NO_RSA -RSA *RSAPublicKey_dup(rsa) -RSA *rsa; +RSA *RSAPublicKey_dup(RSA *rsa) { return((RSA *)ASN1_dup((int (*)())i2d_RSAPublicKey, (char *(*)())d2i_RSAPublicKey,(char *)rsa)); } -RSA *RSAPrivateKey_dup(rsa) -RSA *rsa; +RSA *RSAPrivateKey_dup(RSA *rsa) { return((RSA *)ASN1_dup((int (*)())i2d_RSAPrivateKey, (char *(*)())d2i_RSAPrivateKey,(char *)rsa)); } #ifndef NO_FP_API -RSA *d2i_RSAPrivateKey_fp(fp,rsa) -FILE *fp; -RSA *rsa; +RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA *rsa) { return((RSA *)ASN1_d2i_fp((char *(*)()) RSA_new,(char *(*)())d2i_RSAPrivateKey, (fp), (unsigned char **)(rsa))); } -int i2d_RSAPrivateKey_fp(fp,rsa) -FILE *fp; -RSA *rsa; +int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa) { return(ASN1_i2d_fp(i2d_RSAPrivateKey,fp,(unsigned char *)rsa)); } -RSA *d2i_RSAPublicKey_fp(fp,rsa) -FILE *fp; -RSA *rsa; +RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA *rsa) { return((RSA *)ASN1_d2i_fp((char *(*)()) RSA_new,(char *(*)())d2i_RSAPublicKey, (fp), (unsigned char **)(rsa))); } -int i2d_RSAPublicKey_fp(fp,rsa) -FILE *fp; -RSA *rsa; +int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) { return(ASN1_i2d_fp(i2d_RSAPublicKey,fp,(unsigned char *)rsa)); } #endif -RSA *d2i_RSAPrivateKey_bio(bp,rsa) -BIO *bp; -RSA *rsa; +RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA *rsa) { return((RSA *)ASN1_d2i_bio((char *(*)()) RSA_new,(char *(*)())d2i_RSAPrivateKey, (bp), (unsigned char **)(rsa))); } -int i2d_RSAPrivateKey_bio(bp,rsa) -BIO *bp; -RSA *rsa; +int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa) { return(ASN1_i2d_bio(i2d_RSAPrivateKey,bp,(unsigned char *)rsa)); } -RSA *d2i_RSAPublicKey_bio(bp,rsa) -BIO *bp; -RSA *rsa; +RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA *rsa) { return((RSA *)ASN1_d2i_bio((char *(*)()) RSA_new,(char *(*)())d2i_RSAPublicKey, (bp), (unsigned char **)(rsa))); } -int i2d_RSAPublicKey_bio(bp,rsa) -BIO *bp; -RSA *rsa; +int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) { return(ASN1_i2d_bio(i2d_RSAPublicKey,bp,(unsigned char *)rsa)); } @@ -394,84 +318,64 @@ RSA *rsa; #ifndef NO_DSA #ifndef NO_FP_API -DSA *d2i_DSAPrivateKey_fp(fp,dsa) -FILE *fp; -DSA *dsa; +DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA *dsa) { return((DSA *)ASN1_d2i_fp((char *(*)()) DSA_new,(char *(*)())d2i_DSAPrivateKey, (fp), (unsigned char **)(dsa))); } -int i2d_DSAPrivateKey_fp(fp,dsa) -FILE *fp; -DSA *dsa; +int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa) { return(ASN1_i2d_fp(i2d_DSAPrivateKey,fp,(unsigned char *)dsa)); } #endif -DSA *d2i_DSAPrivateKey_bio(bp,dsa) -BIO *bp; -DSA *dsa; +DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA *dsa) { return((DSA *)ASN1_d2i_bio((char *(*)()) DSA_new,(char *(*)())d2i_DSAPrivateKey, (bp), (unsigned char **)(dsa))); } -int i2d_DSAPrivateKey_bio(bp,dsa) -BIO *bp; -DSA *dsa; +int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa) { return(ASN1_i2d_bio(i2d_DSAPrivateKey,bp,(unsigned char *)dsa)); } #endif -X509_ALGOR *X509_ALGOR_dup(xn) -X509_ALGOR *xn; +X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn) { return((X509_ALGOR *)ASN1_dup((int (*)())i2d_X509_ALGOR, (char *(*)())d2i_X509_ALGOR,(char *)xn)); } -X509_NAME *X509_NAME_dup(xn) -X509_NAME *xn; +X509_NAME *X509_NAME_dup(X509_NAME *xn) { return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME, (char *(*)())d2i_X509_NAME,(char *)xn)); } -X509_NAME_ENTRY *X509_NAME_ENTRY_dup(ne) -X509_NAME_ENTRY *ne; +X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne) { return((X509_NAME_ENTRY *)ASN1_dup((int (*)())i2d_X509_NAME_ENTRY, (char *(*)())d2i_X509_NAME_ENTRY,(char *)ne)); } -int X509_digest(data,type,md,len) -X509 *data; -EVP_MD *type; -unsigned char *md; -unsigned int *len; +int X509_digest(X509 *data, EVP_MD *type, unsigned char *md, + unsigned int *len) { return(ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)); } -int X509_NAME_digest(data,type,md,len) -X509_NAME *data; -EVP_MD *type; -unsigned char *md; -unsigned int *len; +int X509_NAME_digest(X509_NAME *data, EVP_MD *type, unsigned char *md, + unsigned int *len) { return(ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)); } -int PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) -PKCS7_ISSUER_AND_SERIAL *data; -EVP_MD *type; -unsigned char *md; -unsigned int *len; +int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, EVP_MD *type, + unsigned char *md, unsigned int *len) { return(ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type, (char *)data,md,len)); diff --git a/crypto/x509v3/v3_akey.c b/crypto/x509v3/v3_akey.c index 016a6a806c..7d54d0c235 100644 --- a/crypto/x509v3/v3_akey.c +++ b/crypto/x509v3/v3_akey.c @@ -93,9 +93,7 @@ NULL * ASN1err(ASN1_F_D2I_AUTHORITY_KEYID,ERR_R_MALLOC_FAILURE); */ -int i2d_AUTHORITY_KEYID(a,pp) -AUTHORITY_KEYID *a; -unsigned char **pp; +int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -112,7 +110,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -AUTHORITY_KEYID *AUTHORITY_KEYID_new() +AUTHORITY_KEYID *AUTHORITY_KEYID_new(void) { AUTHORITY_KEYID *ret=NULL; ASN1_CTX c; @@ -124,10 +122,8 @@ AUTHORITY_KEYID *AUTHORITY_KEYID_new() M_ASN1_New_Error(ASN1_F_AUTHORITY_KEYID_NEW); } -AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(a,pp,length) -AUTHORITY_KEYID **a; -unsigned char **pp; -long length; +AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,AUTHORITY_KEYID *,AUTHORITY_KEYID_new); M_ASN1_D2I_Init(); @@ -141,8 +137,7 @@ long length; M_ASN1_D2I_Finish(a, AUTHORITY_KEYID_free, ASN1_F_D2I_AUTHORITY_KEYID); } -void AUTHORITY_KEYID_free(a) -AUTHORITY_KEYID *a; +void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a) { if (a == NULL) return; ASN1_OCTET_STRING_free(a->keyid); @@ -151,10 +146,8 @@ AUTHORITY_KEYID *a; Free ((char *)a); } -static STACK *i2v_AUTHORITY_KEYID(method, akeyid, extlist) -X509V3_EXT_METHOD *method; -AUTHORITY_KEYID *akeyid; -STACK *extlist; +static STACK *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + AUTHORITY_KEYID *akeyid, STACK *extlist) { char *tmp; if(akeyid->keyid) { @@ -181,10 +174,8 @@ STACK *extlist; * this is always included. */ -static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(method, ctx, values) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *values; +static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK *values) { char keyid=0, issuer=0; int i; diff --git a/crypto/x509v3/v3_alt.c b/crypto/x509v3/v3_alt.c index 3adf509668..b8054eb636 100644 --- a/crypto/x509v3/v3_alt.c +++ b/crypto/x509v3/v3_alt.c @@ -95,10 +95,7 @@ NULL, NULL, NULL}, EXT_END }; -STACK *i2v_GENERAL_NAMES(method, gens, ret) -X509V3_EXT_METHOD *method; -STACK *gens; -STACK *ret; +STACK *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, STACK *gens, STACK *ret) { int i; GENERAL_NAME *gen; @@ -109,10 +106,8 @@ STACK *ret; return ret; } -STACK *i2v_GENERAL_NAME(method, gen, ret) -X509V3_EXT_METHOD *method; -GENERAL_NAME *gen; -STACK *ret; +STACK *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, + STACK *ret) { char oline[256]; unsigned char *p; @@ -166,10 +161,8 @@ STACK *ret; return ret; } -static STACK *v2i_issuer_alt(method, ctx, nval) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *nval; +static STACK *v2i_issuer_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK *nval) { STACK *gens = NULL; CONF_VALUE *cnf; @@ -198,9 +191,7 @@ STACK *nval; /* Append subject altname of issuer to issuer alt name of subject */ -static int copy_issuer(ctx, gens) -X509V3_CTX *ctx; -STACK *gens; +static int copy_issuer(X509V3_CTX *ctx, STACK *gens) { STACK *ialt; char *gen; @@ -235,10 +226,8 @@ STACK *gens; } -static STACK *v2i_subject_alt(method, ctx, nval) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *nval; +static STACK *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK *nval) { STACK *gens = NULL; CONF_VALUE *cnf; @@ -269,9 +258,7 @@ STACK *nval; * GENERAL_NAMES */ -static int copy_email(ctx, gens) -X509V3_CTX *ctx; -STACK *gens; +static int copy_email(X509V3_CTX *ctx, STACK *gens) { X509_NAME *nm; ASN1_IA5STRING *email = NULL; @@ -317,10 +304,8 @@ STACK *gens; } -STACK *v2i_GENERAL_NAMES(method, ctx, nval) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *nval; +STACK *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK *nval) { GENERAL_NAME *gen; STACK *gens = NULL; @@ -341,10 +326,8 @@ STACK *nval; return NULL; } -GENERAL_NAME *v2i_GENERAL_NAME(method, ctx, cnf) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -CONF_VALUE *cnf; +GENERAL_NAME *v2i_GENERAL_NAME(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + CONF_VALUE *cnf) { char is_string = 0; int type; diff --git a/crypto/x509v3/v3_bcons.c b/crypto/x509v3/v3_bcons.c index ddd5a66a20..6e2231f15c 100644 --- a/crypto/x509v3/v3_bcons.c +++ b/crypto/x509v3/v3_bcons.c @@ -94,9 +94,7 @@ NULL * ASN1err(ASN1_F_D2I_BASIC_CONSTRAINTS,ERR_R_MALLOC_FAILURE); */ -int i2d_BASIC_CONSTRAINTS(a,pp) -BASIC_CONSTRAINTS *a; -unsigned char **pp; +int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **pp) { M_ASN1_I2D_vars(a); if(a->ca) M_ASN1_I2D_len (a->ca, i2d_ASN1_BOOLEAN); @@ -109,7 +107,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new() +BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new(void) { BASIC_CONSTRAINTS *ret=NULL; ASN1_CTX c; @@ -120,10 +118,8 @@ BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new() M_ASN1_New_Error(ASN1_F_BASIC_CONSTRAINTS_NEW); } -BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(a,pp,length) -BASIC_CONSTRAINTS **a; -unsigned char **pp; -long length; +BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,BASIC_CONSTRAINTS *,BASIC_CONSTRAINTS_new); M_ASN1_D2I_Init(); @@ -136,28 +132,23 @@ long length; M_ASN1_D2I_Finish(a, BASIC_CONSTRAINTS_free, ASN1_F_D2I_BASIC_CONSTRAINTS); } -void BASIC_CONSTRAINTS_free(a) -BASIC_CONSTRAINTS *a; +void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a) { if (a == NULL) return; ASN1_INTEGER_free (a->pathlen); Free ((char *)a); } -static STACK *i2v_BASIC_CONSTRAINTS(method, bcons, extlist) -X509V3_EXT_METHOD *method; -BASIC_CONSTRAINTS *bcons; -STACK *extlist; +static STACK *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + BASIC_CONSTRAINTS *bcons, STACK *extlist) { X509V3_add_value_bool("CA", bcons->ca, &extlist); X509V3_add_value_int("pathlen", bcons->pathlen, &extlist); return extlist; } -static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(method, ctx, values) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *values; +static BASIC_CONSTRAINTS *v2i_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK *values) { BASIC_CONSTRAINTS *bcons=NULL; CONF_VALUE *val; diff --git a/crypto/x509v3/v3_bitst.c b/crypto/x509v3/v3_bitst.c index 67d865f180..b3b6c49af9 100644 --- a/crypto/x509v3/v3_bitst.c +++ b/crypto/x509v3/v3_bitst.c @@ -101,15 +101,13 @@ static BIT_STRING_BITNAME key_usage_type_table[] = { X509V3_EXT_METHOD v3_nscert = EXT_BITSTRING(NID_netscape_cert_type, ns_cert_type_table); X509V3_EXT_METHOD v3_key_usage = EXT_BITSTRING(NID_key_usage, key_usage_type_table); -static ASN1_BIT_STRING *asn1_bit_string_new() +static ASN1_BIT_STRING *asn1_bit_string_new(void) { return ASN1_BIT_STRING_new(); } -static STACK *i2v_ASN1_BIT_STRING(method, bits, ret) -X509V3_EXT_METHOD *method; -ASN1_BIT_STRING *bits; -STACK *ret; +static STACK *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, STACK *ret) { BIT_STRING_BITNAME *bnam; for(bnam =(BIT_STRING_BITNAME *)method->usr_data; bnam->lname; bnam++) { @@ -119,10 +117,8 @@ STACK *ret; return ret; } -static ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(method, ctx, nval) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *nval; +static ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK *nval) { CONF_VALUE *val; ASN1_BIT_STRING *bs; diff --git a/crypto/x509v3/v3_conf.c b/crypto/x509v3/v3_conf.c index 54ee2a53ca..59a24ef871 100644 --- a/crypto/x509v3/v3_conf.c +++ b/crypto/x509v3/v3_conf.c @@ -78,11 +78,11 @@ static X509_EXTENSION *do_ext_conf(); static X509V3_EXTENSION *v3_generic_extension(); #endif -X509_EXTENSION *X509V3_EXT_conf(conf, ctx, name, value) -LHASH *conf; /* Config file */ -X509V3_CTX *ctx; -char *name; /* Name */ -char *value; /* Value */ +/* LHASH *conf: Config file */ +/* char *name: Name */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_conf(LHASH *conf, X509V3_CTX *ctx, char *name, + char *value) { int crit; int ext_type; @@ -98,11 +98,10 @@ char *value; /* Value */ return ret; } -X509_EXTENSION *X509V3_EXT_conf_nid(conf, ctx, ext_nid, value) -LHASH *conf; /* Config file */ -X509V3_CTX *ctx; -int ext_nid; -char *value; /* Value */ +/* LHASH *conf: Config file */ +/* char *value: Value */ +X509_EXTENSION *X509V3_EXT_conf_nid(LHASH *conf, X509V3_CTX *ctx, int ext_nid, + char *value) { int crit; int ext_type; @@ -113,12 +112,10 @@ char *value; /* Value */ return do_ext_conf(conf, ctx, ext_nid, crit, value); } -static X509_EXTENSION *do_ext_conf(conf, ctx, ext_nid, crit, value) -LHASH *conf; /* Config file */ -X509V3_CTX *ctx; -int ext_nid; -int crit; -char *value; /* Value */ +/* LHASH *conf: Config file */ +/* char *value: Value */ +static X509_EXTENSION *do_ext_conf(LHASH *conf, X509V3_CTX *ctx, int ext_nid, + int crit, char *value) { X509_EXTENSION *ext = NULL; X509V3_EXT_METHOD *method; @@ -179,8 +176,7 @@ char *value; /* Value */ } /* Check the extension string for critical flag */ -static int v3_check_critical(value) -char **value; +static int v3_check_critical(char **value) { char *p = *value; if((strlen(p) < 9) || strncmp(p, "critical,", 9)) return 0; @@ -191,8 +187,7 @@ char **value; } /* Check extension string for generic extension and return the type */ -static int v3_check_generic(value) -char **value; +static int v3_check_generic(char **value) { char *p = *value; if((strlen(p) < 4) || strncmp(p, "RAW:,", 4)) return 0; @@ -203,11 +198,8 @@ char **value; } /* Create a generic extension: for now just handle RAW type */ -static X509_EXTENSION *v3_generic_extension(ext, value, crit, type) -const char *ext; -char *value; -int crit; -int type; +static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, + int crit, int type) { unsigned char *ext_der=NULL; long ext_len; @@ -249,11 +241,8 @@ return extension; * section */ -int X509V3_EXT_add_conf(conf, ctx, section, cert) -LHASH *conf; -X509V3_CTX *ctx; -char *section; -X509 *cert; +int X509V3_EXT_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, + X509 *cert) { X509_EXTENSION *ext; STACK *nval; @@ -272,11 +261,8 @@ X509 *cert; /* Same as above but for a CRL */ -int X509V3_EXT_CRL_add_conf(conf, ctx, section, crl) -LHASH *conf; -X509V3_CTX *ctx; -char *section; -X509_CRL *crl; +int X509V3_EXT_CRL_add_conf(LHASH *conf, X509V3_CTX *ctx, char *section, + X509_CRL *crl) { X509_EXTENSION *ext; STACK *nval; @@ -295,54 +281,40 @@ X509_CRL *crl; /* Config database functions */ -char * X509V3_get_string(ctx, name, section) -X509V3_CTX *ctx; -char *name; -char *section; +char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section) { if(ctx->db_meth->get_string) return ctx->db_meth->get_string(ctx->db, name, section); return NULL; } -STACK * X509V3_get_section(ctx, section) -X509V3_CTX *ctx; -char *section; +STACK * X509V3_get_section(X509V3_CTX *ctx, char *section) { if(ctx->db_meth->get_section) return ctx->db_meth->get_section(ctx->db, section); return NULL; } -void X509V3_string_free(ctx, str) -X509V3_CTX *ctx; -char *str; +void X509V3_string_free(X509V3_CTX *ctx, char *str) { if(!str) return; if(ctx->db_meth->free_string) return ctx->db_meth->free_string(ctx->db, str); } -void X509V3_section_free(ctx, section) -X509V3_CTX *ctx; -STACK *section; +void X509V3_section_free(X509V3_CTX *ctx, STACK *section) { if(!section) return; if(ctx->db_meth->free_section) return ctx->db_meth->free_section(ctx->db, section); } -static char *conf_lhash_get_string(db, section, value) -void *db; -char *section; -char *value; +static char *conf_lhash_get_string(void *db, char *section, char *value) { return CONF_get_string(db, section, value); } -static STACK *conf_lhash_get_section(db, section) -void *db; -char *section; +static STACK *conf_lhash_get_section(void *db, char *section) { return CONF_get_section(db, section); } @@ -354,21 +326,14 @@ NULL, NULL }; -void X509V3_set_conf_lhash(ctx, lhash) -X509V3_CTX *ctx; -LHASH *lhash; +void X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH *lhash) { ctx->db_meth = &conf_lhash_method; ctx->db = lhash; } -void X509V3_set_ctx(ctx, issuer, subj, req, crl, flags) -X509V3_CTX *ctx; -X509 *issuer; -X509 *subj; -X509_REQ *req; -X509_CRL *crl; -int flags; +void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subj, X509_REQ *req, + X509_CRL *crl, int flags) { ctx->issuer_cert = issuer; ctx->subject_cert = subj; diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c index cb6d0b0f9c..7785047025 100644 --- a/crypto/x509v3/v3_cpols.c +++ b/crypto/x509v3/v3_cpols.c @@ -98,10 +98,8 @@ NULL * ASN1err(ASN1_F_D2I_NOTICEREF,ERR_R_MALLOC_FAILURE); */ -static STACK_OF(POLICYINFO) *r2i_certpol(method, ctx, value) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -char *value; +static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *value) { STACK_OF(POLICYINFO) *pols = NULL; char *pstr; @@ -150,9 +148,7 @@ char *value; return NULL; } -static POLICYINFO *policy_section(ctx, polstrs) -X509V3_CTX *ctx; -STACK *polstrs; +static POLICYINFO *policy_section(X509V3_CTX *ctx, STACK *polstrs) { int i; CONF_VALUE *cnf; @@ -224,9 +220,7 @@ STACK *polstrs; } -static POLICYQUALINFO *notice_section(ctx, unot) -X509V3_CTX *ctx; -STACK *unot; +static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, STACK *unot) { int i; CONF_VALUE *cnf; @@ -293,8 +287,7 @@ STACK *unot; return NULL; } -static STACK *nref_nos(nos) -STACK *nos; +static STACK *nref_nos(STACK *nos) { STACK *nnums; CONF_VALUE *cnf; @@ -322,11 +315,8 @@ STACK *nos; } -static int i2r_certpol(method, pol, out, indent) -X509V3_EXT_METHOD *method; -STACK_OF(POLICYINFO) *pol; -BIO *out; -int indent; +static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, + BIO *out, int indent) { int i; POLICYINFO *pinfo; @@ -343,29 +333,24 @@ int indent; } -int i2d_CERTIFICATEPOLICIES(a, pp) -STACK_OF(POLICYINFO) *a; -unsigned char **pp; +int i2d_CERTIFICATEPOLICIES(STACK_OF(POLICYINFO) *a, unsigned char **pp) { return i2d_ASN1_SET_OF_POLICYINFO(a, pp, i2d_POLICYINFO, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE);} -STACK_OF(POLICYINFO) *CERTIFICATEPOLICIES_new() +STACK_OF(POLICYINFO) *CERTIFICATEPOLICIES_new(void) { return sk_POLICYINFO_new_null(); } -void CERTIFICATEPOLICIES_free(a) -STACK_OF(POLICYINFO) *a; +void CERTIFICATEPOLICIES_free(STACK_OF(POLICYINFO) *a) { sk_POLICYINFO_pop_free(a, POLICYINFO_free); } -STACK_OF(POLICYINFO) *d2i_CERTIFICATEPOLICIES(a,pp,length) -STACK_OF(POLICYINFO) **a; -unsigned char **pp; -long length; +STACK_OF(POLICYINFO) *d2i_CERTIFICATEPOLICIES(STACK_OF(POLICYINFO) **a, + unsigned char **pp,long length) { return d2i_ASN1_SET_OF_POLICYINFO(a, pp, length, d2i_POLICYINFO, POLICYINFO_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); @@ -375,9 +360,7 @@ return d2i_ASN1_SET_OF_POLICYINFO(a, pp, length, d2i_POLICYINFO, IMPLEMENT_STACK_OF(POLICYINFO) IMPLEMENT_ASN1_SET_OF(POLICYINFO) -int i2d_POLICYINFO(a,pp) -POLICYINFO *a; -unsigned char **pp; +int i2d_POLICYINFO(POLICYINFO *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -394,7 +377,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -POLICYINFO *POLICYINFO_new() +POLICYINFO *POLICYINFO_new(void) { POLICYINFO *ret=NULL; ASN1_CTX c; @@ -405,10 +388,7 @@ POLICYINFO *POLICYINFO_new() M_ASN1_New_Error(ASN1_F_POLICYINFO_NEW); } -POLICYINFO *d2i_POLICYINFO(a,pp,length) -POLICYINFO **a; -unsigned char **pp; -long length; +POLICYINFO *d2i_POLICYINFO(POLICYINFO **a, unsigned char **pp,long length) { M_ASN1_D2I_vars(a,POLICYINFO *,POLICYINFO_new); M_ASN1_D2I_Init(); @@ -421,8 +401,7 @@ long length; M_ASN1_D2I_Finish(a, POLICYINFO_free, ASN1_F_D2I_POLICYINFO); } -void POLICYINFO_free(a) -POLICYINFO *a; +void POLICYINFO_free(POLICYINFO *a) { if (a == NULL) return; ASN1_OBJECT_free(a->policyid); @@ -430,10 +409,8 @@ POLICYINFO *a; Free (a); } -static void print_qualifiers(out, quals, indent) -BIO *out; -STACK_OF(POLICYQUALINFO) *quals; -int indent; +static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, + int indent) { POLICYQUALINFO *qualinfo; int i; @@ -462,10 +439,7 @@ int indent; } } -static void print_notice(out, notice, indent) -BIO *out; -USERNOTICE *notice; -int indent; +static void print_notice(BIO *out, USERNOTICE *notice, int indent) { int i; if(notice->noticeref) { @@ -493,9 +467,7 @@ int indent; -int i2d_POLICYQUALINFO(a,pp) -POLICYQUALINFO *a; -unsigned char **pp; +int i2d_POLICYQUALINFO(POLICYQUALINFO *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -534,7 +506,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -POLICYQUALINFO *POLICYQUALINFO_new() +POLICYQUALINFO *POLICYQUALINFO_new(void) { POLICYQUALINFO *ret=NULL; ASN1_CTX c; @@ -545,10 +517,8 @@ POLICYQUALINFO *POLICYQUALINFO_new() M_ASN1_New_Error(ASN1_F_POLICYQUALINFO_NEW); } -POLICYQUALINFO *d2i_POLICYQUALINFO(a,pp,length) -POLICYQUALINFO **a; -unsigned char **pp; -long length; +POLICYQUALINFO *d2i_POLICYQUALINFO(POLICYQUALINFO **a, unsigned char **pp, + long length) { M_ASN1_D2I_vars(a,POLICYQUALINFO *,POLICYQUALINFO_new); M_ASN1_D2I_Init(); @@ -570,8 +540,7 @@ long length; M_ASN1_D2I_Finish(a, POLICYQUALINFO_free, ASN1_F_D2I_POLICYQUALINFO); } -void POLICYQUALINFO_free(a) -POLICYQUALINFO *a; +void POLICYQUALINFO_free(POLICYQUALINFO *a) { if (a == NULL) return; switch(OBJ_obj2nid(a->pqualid)) { @@ -592,9 +561,7 @@ POLICYQUALINFO *a; Free (a); } -int i2d_USERNOTICE(a,pp) -USERNOTICE *a; -unsigned char **pp; +int i2d_USERNOTICE(USERNOTICE *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -609,7 +576,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -USERNOTICE *USERNOTICE_new() +USERNOTICE *USERNOTICE_new(void) { USERNOTICE *ret=NULL; ASN1_CTX c; @@ -620,10 +587,7 @@ USERNOTICE *USERNOTICE_new() M_ASN1_New_Error(ASN1_F_USERNOTICE_NEW); } -USERNOTICE *d2i_USERNOTICE(a,pp,length) -USERNOTICE **a; -unsigned char **pp; -long length; +USERNOTICE *d2i_USERNOTICE(USERNOTICE **a, unsigned char **pp,long length) { M_ASN1_D2I_vars(a,USERNOTICE *,USERNOTICE_new); M_ASN1_D2I_Init(); @@ -635,8 +599,7 @@ long length; M_ASN1_D2I_Finish(a, USERNOTICE_free, ASN1_F_D2I_USERNOTICE); } -void USERNOTICE_free(a) -USERNOTICE *a; +void USERNOTICE_free(USERNOTICE *a) { if (a == NULL) return; NOTICEREF_free(a->noticeref); @@ -644,9 +607,7 @@ USERNOTICE *a; Free (a); } -int i2d_NOTICEREF(a,pp) -NOTICEREF *a; -unsigned char **pp; +int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -661,7 +622,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -NOTICEREF *NOTICEREF_new() +NOTICEREF *NOTICEREF_new(void) { NOTICEREF *ret=NULL; ASN1_CTX c; @@ -672,10 +633,7 @@ NOTICEREF *NOTICEREF_new() M_ASN1_New_Error(ASN1_F_NOTICEREF_NEW); } -NOTICEREF *d2i_NOTICEREF(a,pp,length) -NOTICEREF **a; -unsigned char **pp; -long length; +NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, unsigned char **pp,long length) { M_ASN1_D2I_vars(a,NOTICEREF *,NOTICEREF_new); M_ASN1_D2I_Init(); @@ -692,8 +650,7 @@ long length; M_ASN1_D2I_Finish(a, NOTICEREF_free, ASN1_F_D2I_NOTICEREF); } -void NOTICEREF_free(a) -NOTICEREF *a; +void NOTICEREF_free(NOTICEREF *a) { if (a == NULL) return; DISPLAYTEXT_free(a->organization); diff --git a/crypto/x509v3/v3_enum.c b/crypto/x509v3/v3_enum.c index 8c0b37ce86..eb9f7163c9 100644 --- a/crypto/x509v3/v3_enum.c +++ b/crypto/x509v3/v3_enum.c @@ -84,14 +84,13 @@ i2d_ASN1_ENUMERATED, NULL, NULL, NULL, NULL, (char *)crl_reasons}; -static ASN1_ENUMERATED *asn1_enumerated_new() +static ASN1_ENUMERATED *asn1_enumerated_new(void) { return ASN1_ENUMERATED_new(); } -char *i2s_ASN1_ENUMERATED_TABLE(method, e) -X509V3_EXT_METHOD *method; -ASN1_ENUMERATED *e; +char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, + ASN1_ENUMERATED *e) { ENUMERATED_NAMES *enam; long strval; diff --git a/crypto/x509v3/v3_extku.c b/crypto/x509v3/v3_extku.c index aa8fe1e5a6..b01359d393 100644 --- a/crypto/x509v3/v3_extku.c +++ b/crypto/x509v3/v3_extku.c @@ -84,30 +84,24 @@ NULL,NULL, NULL }; -STACK *ext_ku_new() +STACK *ext_ku_new(void) { return sk_new_null(); } -void ext_ku_free(eku) -STACK *eku; +void ext_ku_free(STACK *eku) { sk_pop_free(eku, ASN1_OBJECT_free); return; } -int i2d_ext_ku(a,pp) -STACK *a; -unsigned char **pp; +int i2d_ext_ku(STACK *a, unsigned char **pp) { return i2d_ASN1_SET(a, pp, i2d_ASN1_OBJECT, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE); } -STACK *d2i_ext_ku(a,pp,length) -STACK **a; -unsigned char **pp; -long length; +STACK *d2i_ext_ku(STACK **a, unsigned char **pp, long length) { return d2i_ASN1_SET(a, pp, length, (char *(*)())(d2i_ASN1_OBJECT), ASN1_OBJECT_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); @@ -115,10 +109,8 @@ long length; -static STACK *i2v_ext_ku(method, eku, ext_list) -X509V3_EXT_METHOD *method; -STACK *eku; -STACK *ext_list; +static STACK *i2v_ext_ku(X509V3_EXT_METHOD *method, STACK *eku, + STACK *ext_list) { int i; ASN1_OBJECT *obj; @@ -131,10 +123,8 @@ for(i = 0; i < sk_num(eku); i++) { return ext_list; } -static STACK *v2i_ext_ku(method, ctx, nval) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *nval; +static STACK *v2i_ext_ku(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK *nval) { STACK *extku; char *extval; diff --git a/crypto/x509v3/v3_genn.c b/crypto/x509v3/v3_genn.c index e7918d6b3c..d2804c3353 100644 --- a/crypto/x509v3/v3_genn.c +++ b/crypto/x509v3/v3_genn.c @@ -69,9 +69,7 @@ * ASN1err(ASN1_F_D2I_GENERAL_NAME,ERR_R_MALLOC_FAILURE); */ -int i2d_GENERAL_NAME(a,pp) -GENERAL_NAME *a; -unsigned char **pp; +int i2d_GENERAL_NAME(GENERAL_NAME *a, unsigned char **pp) { unsigned char *p; int ret; @@ -120,7 +118,7 @@ unsigned char **pp; return ret; } -GENERAL_NAME *GENERAL_NAME_new() +GENERAL_NAME *GENERAL_NAME_new(void) { GENERAL_NAME *ret=NULL; ASN1_CTX c; @@ -131,10 +129,8 @@ GENERAL_NAME *GENERAL_NAME_new() M_ASN1_New_Error(ASN1_F_GENERAL_NAME_NEW); } -GENERAL_NAME *d2i_GENERAL_NAME(a,pp,length) -GENERAL_NAME **a; -unsigned char **pp; -long length; +GENERAL_NAME *d2i_GENERAL_NAME(GENERAL_NAME **a, unsigned char **pp, + long length) { unsigned char _tmp; M_ASN1_D2I_vars(a,GENERAL_NAME *,GENERAL_NAME_new); @@ -181,8 +177,7 @@ long length; M_ASN1_D2I_Finish(a, GENERAL_NAME_free, ASN1_F_D2I_GENERAL_NAME); } -void GENERAL_NAME_free(a) -GENERAL_NAME *a; +void GENERAL_NAME_free(GENERAL_NAME *a) { if (a == NULL) return; switch(a->type) { @@ -219,29 +214,23 @@ GENERAL_NAME *a; * an explicit functions. */ -STACK *GENERAL_NAMES_new() +STACK *GENERAL_NAMES_new(void) { return sk_new(NULL); } -void GENERAL_NAMES_free(a) -STACK *a; +void GENERAL_NAMES_free(STACK *a) { sk_pop_free(a, GENERAL_NAME_free); } -STACK *d2i_GENERAL_NAMES(a,pp,length) -STACK **a; -unsigned char **pp; -long length; +STACK *d2i_GENERAL_NAMES(STACK **a, unsigned char **pp, long length) { return d2i_ASN1_SET(a, pp, length, (char *(*)())d2i_GENERAL_NAME, GENERAL_NAME_free, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL); } -int i2d_GENERAL_NAMES(a,pp) -STACK *a; -unsigned char **pp; +int i2d_GENERAL_NAMES(STACK *a, unsigned char **pp) { return i2d_ASN1_SET(a, pp, i2d_GENERAL_NAME, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE); diff --git a/crypto/x509v3/v3_ia5.c b/crypto/x509v3/v3_ia5.c index 1030d8ea69..f4042915f0 100644 --- a/crypto/x509v3/v3_ia5.c +++ b/crypto/x509v3/v3_ia5.c @@ -90,9 +90,8 @@ static ASN1_IA5STRING *ia5string_new(void) return ASN1_IA5STRING_new(); } -static char *i2s_ASN1_IA5STRING(method, ia5) -X509V3_EXT_METHOD *method; -ASN1_IA5STRING *ia5; +static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + ASN1_IA5STRING *ia5) { char *tmp; if(!ia5 || !ia5->length) return NULL; @@ -102,10 +101,8 @@ ASN1_IA5STRING *ia5; return tmp; } -static ASN1_IA5STRING *s2i_ASN1_IA5STRING(method, ctx, str) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -char *str; +static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) { ASN1_IA5STRING *ia5; if(!str) { diff --git a/crypto/x509v3/v3_int.c b/crypto/x509v3/v3_int.c index 03b1c2539a..7c69dd0740 100644 --- a/crypto/x509v3/v3_int.c +++ b/crypto/x509v3/v3_int.c @@ -72,7 +72,7 @@ i2d_ASN1_INTEGER, NULL, NULL, NULL, NULL, NULL}; -static ASN1_INTEGER *asn1_integer_new() +static ASN1_INTEGER *asn1_integer_new(void) { return ASN1_INTEGER_new(); } diff --git a/crypto/x509v3/v3_lib.c b/crypto/x509v3/v3_lib.c index e3686b6275..af105723a2 100644 --- a/crypto/x509v3/v3_lib.c +++ b/crypto/x509v3/v3_lib.c @@ -67,8 +67,7 @@ static STACK *ext_list = NULL; static int ext_cmp(X509V3_EXT_METHOD **a, X509V3_EXT_METHOD **b); static void ext_list_free(X509V3_EXT_METHOD *ext); -int X509V3_EXT_add(ext) -X509V3_EXT_METHOD *ext; +int X509V3_EXT_add(X509V3_EXT_METHOD *ext) { if(!ext_list && !(ext_list = sk_new(ext_cmp))) { X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE); @@ -81,14 +80,12 @@ X509V3_EXT_METHOD *ext; return 1; } -static int ext_cmp(a, b) -X509V3_EXT_METHOD **a, **b; +static int ext_cmp(X509V3_EXT_METHOD **a, X509V3_EXT_METHOD **b) { return ((*a)->ext_nid - (*b)->ext_nid); } -X509V3_EXT_METHOD *X509V3_EXT_get_nid(nid) -int nid; +X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) { X509V3_EXT_METHOD tmp; int idx; @@ -99,8 +96,7 @@ int nid; return (X509V3_EXT_METHOD *)sk_value(ext_list, idx); } -X509V3_EXT_METHOD *X509V3_EXT_get(ext) -X509_EXTENSION *ext; +X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) { int nid; if((nid = OBJ_obj2nid(ext->object)) == NID_undef) return NULL; @@ -108,16 +104,14 @@ X509_EXTENSION *ext; } -int X509V3_EXT_add_list(extlist) -X509V3_EXT_METHOD *extlist; +int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist) { for(;extlist->ext_nid!=-1;extlist++) if(!X509V3_EXT_add(extlist)) return 0; return 1; } -int X509V3_EXT_add_alias(nid_to, nid_from) -int nid_to, nid_from; +int X509V3_EXT_add_alias(int nid_to, int nid_from) { X509V3_EXT_METHOD *ext, *tmpext; if(!(ext = X509V3_EXT_get_nid(nid_from))) { @@ -134,13 +128,12 @@ int nid_to, nid_from; return 1; } -void X509V3_EXT_cleanup() +void X509V3_EXT_cleanup(void) { sk_pop_free(ext_list, ext_list_free); } -static void ext_list_free(ext) -X509V3_EXT_METHOD *ext; +static void ext_list_free(X509V3_EXT_METHOD *ext) { if(ext->ext_flags & X509V3_EXT_DYNAMIC) Free(ext); } @@ -151,7 +144,7 @@ extern X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id, v3_akey_id; extern X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_cpols; -int X509V3_add_standard_extensions() +int X509V3_add_standard_extensions(void) { X509V3_EXT_add_list(v3_ns_ia5_list); X509V3_EXT_add_list(v3_alt); @@ -171,8 +164,7 @@ int X509V3_add_standard_extensions() /* Return an extension internal structure */ -char *X509V3_EXT_d2i(ext) -X509_EXTENSION *ext; +char *X509V3_EXT_d2i(X509_EXTENSION *ext) { X509V3_EXT_METHOD *method; unsigned char *p; diff --git a/crypto/x509v3/v3_pku.c b/crypto/x509v3/v3_pku.c index 23a71522f6..54ae80df1d 100644 --- a/crypto/x509v3/v3_pku.c +++ b/crypto/x509v3/v3_pku.c @@ -91,9 +91,7 @@ NULL * ASN1err(ASN1_F_D2I_PKEY_USAGE_PERIOD,ERR_R_MALLOC_FAILURE); */ -int i2d_PKEY_USAGE_PERIOD(a,pp) -PKEY_USAGE_PERIOD *a; -unsigned char **pp; +int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -108,7 +106,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new() +PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(void) { PKEY_USAGE_PERIOD *ret=NULL; ASN1_CTX c; @@ -119,10 +117,8 @@ PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new() M_ASN1_New_Error(ASN1_F_PKEY_USAGE_PERIOD_NEW); } -PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(a,pp,length) -PKEY_USAGE_PERIOD **a; -unsigned char **pp; -long length; +PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a, + unsigned char **pp, long length) { M_ASN1_D2I_vars(a,PKEY_USAGE_PERIOD *,PKEY_USAGE_PERIOD_new); M_ASN1_D2I_Init(); @@ -134,8 +130,7 @@ long length; M_ASN1_D2I_Finish(a, PKEY_USAGE_PERIOD_free, ASN1_F_D2I_PKEY_USAGE_PERIOD); } -void PKEY_USAGE_PERIOD_free(a) -PKEY_USAGE_PERIOD *a; +void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a) { if (a == NULL) return; ASN1_GENERALIZEDTIME_free(a->notBefore); @@ -143,11 +138,8 @@ PKEY_USAGE_PERIOD *a; Free ((char *)a); } -static int i2r_PKEY_USAGE_PERIOD(method, usage, out, indent) -X509V3_EXT_METHOD *method; -PKEY_USAGE_PERIOD *usage; -BIO *out; -int indent; +static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, + PKEY_USAGE_PERIOD *usage, BIO *out, int indent) { BIO_printf(out, "%*s", indent, ""); if(usage->notBefore) { diff --git a/crypto/x509v3/v3_prn.c b/crypto/x509v3/v3_prn.c index 34bc9c86a5..d81f4088e0 100644 --- a/crypto/x509v3/v3_prn.c +++ b/crypto/x509v3/v3_prn.c @@ -66,11 +66,7 @@ /* Print out a name+value stack */ -void X509V3_EXT_val_prn(out, val, indent, ml) -BIO *out; -STACK *val; -int indent; -int ml; +void X509V3_EXT_val_prn(BIO *out, STACK *val, int indent, int ml) { int i; CONF_VALUE *nval; @@ -89,11 +85,7 @@ int ml; /* Main routine: print out a general extension */ -int X509V3_EXT_print(out, ext, flag, indent) -BIO *out; -X509_EXTENSION *ext; -int flag; -int indent; +int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent) { char *ext_str = NULL, *p, *value = NULL; X509V3_EXT_METHOD *method; @@ -126,11 +118,7 @@ int indent; return ok; } -int X509V3_EXT_print_fp(fp, ext, flag, indent) -FILE *fp; -X509_EXTENSION *ext; -int flag; -int indent; +int X509V3_EXT_print_fp(FILE *fp, X509_EXTENSION *ext, int flag, int indent) { BIO *bio_tmp; int ret; diff --git a/crypto/x509v3/v3_skey.c b/crypto/x509v3/v3_skey.c index 932cd8b26c..49f151e9c9 100644 --- a/crypto/x509v3/v3_skey.c +++ b/crypto/x509v3/v3_skey.c @@ -84,17 +84,14 @@ static ASN1_OCTET_STRING *octet_string_new(void) return ASN1_OCTET_STRING_new(); } -char *i2s_ASN1_OCTET_STRING(method, oct) -X509V3_EXT_METHOD *method; -ASN1_OCTET_STRING *oct; +char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + ASN1_OCTET_STRING *oct) { return hex_to_string(oct->data, oct->length); } -ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(method, ctx, str) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -char *str; +ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) { ASN1_OCTET_STRING *oct; long length; @@ -115,10 +112,8 @@ char *str; } -static ASN1_OCTET_STRING *s2i_skey_id(method, ctx, str) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -char *str; +static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, char *str) { ASN1_OCTET_STRING *oct; ASN1_BIT_STRING *pk; diff --git a/crypto/x509v3/v3_sxnet.c b/crypto/x509v3/v3_sxnet.c index ac7aa76752..1e261c51c0 100644 --- a/crypto/x509v3/v3_sxnet.c +++ b/crypto/x509v3/v3_sxnet.c @@ -102,9 +102,7 @@ NULL * ASN1err(ASN1_F_D2I_SXNETID,ERR_R_MALLOC_FAILURE); */ -int i2d_SXNET(a,pp) -SXNET *a; -unsigned char **pp; +int i2d_SXNET(SXNET *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -119,7 +117,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -SXNET *SXNET_new() +SXNET *SXNET_new(void) { SXNET *ret=NULL; ASN1_CTX c; @@ -130,10 +128,7 @@ SXNET *SXNET_new() M_ASN1_New_Error(ASN1_F_SXNET_NEW); } -SXNET *d2i_SXNET(a,pp,length) -SXNET **a; -unsigned char **pp; -long length; +SXNET *d2i_SXNET(SXNET **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,SXNET *,SXNET_new); M_ASN1_D2I_Init(); @@ -143,8 +138,7 @@ long length; M_ASN1_D2I_Finish(a, SXNET_free, ASN1_F_D2I_SXNET); } -void SXNET_free(a) -SXNET *a; +void SXNET_free(SXNET *a) { if (a == NULL) return; ASN1_INTEGER_free(a->version); @@ -152,9 +146,7 @@ SXNET *a; Free (a); } -int i2d_SXNETID(a,pp) -SXNETID *a; -unsigned char **pp; +int i2d_SXNETID(SXNETID *a, unsigned char **pp) { M_ASN1_I2D_vars(a); @@ -169,7 +161,7 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -SXNETID *SXNETID_new() +SXNETID *SXNETID_new(void) { SXNETID *ret=NULL; ASN1_CTX c; @@ -180,10 +172,7 @@ SXNETID *SXNETID_new() M_ASN1_New_Error(ASN1_F_SXNETID_NEW); } -SXNETID *d2i_SXNETID(a,pp,length) -SXNETID **a; -unsigned char **pp; -long length; +SXNETID *d2i_SXNETID(SXNETID **a, unsigned char **pp, long length) { M_ASN1_D2I_vars(a,SXNETID *,SXNETID_new); M_ASN1_D2I_Init(); @@ -193,8 +182,7 @@ long length; M_ASN1_D2I_Finish(a, SXNETID_free, ASN1_F_D2I_SXNETID); } -void SXNETID_free(a) -SXNETID *a; +void SXNETID_free(SXNETID *a) { if (a == NULL) return; ASN1_INTEGER_free(a->zone); @@ -202,11 +190,8 @@ SXNETID *a; Free (a); } -static int sxnet_i2r(method, sx, out, indent) -X509V3_EXT_METHOD *method; -SXNET *sx; -BIO *out; -int indent; +static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, + int indent) { long v; char *tmp; @@ -232,10 +217,8 @@ int indent; */ -static SXNET * sxnet_v2i(method, ctx, nval) -X509V3_EXT_METHOD *method; -X509V3_CTX *ctx; -STACK *nval; +static SXNET * sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + STACK *nval) { CONF_VALUE *cnf; SXNET *sx = NULL; @@ -255,11 +238,8 @@ STACK *nval; /* Add an id given the zone as an ASCII number */ -int SXNET_add_id_asc(psx, zone, user, userlen) -SXNET **psx; -char *zone; -unsigned char *user; -int userlen; +int SXNET_add_id_asc(SXNET **psx, char *zone, unsigned char *user, + int userlen) { ASN1_INTEGER *izone = NULL; if(!(izone = s2i_ASN1_INTEGER(NULL, zone))) { @@ -271,11 +251,8 @@ int userlen; /* Add an id given the zone as an unsigned long */ -int SXNET_add_id_ulong(psx, lzone, user, userlen) -SXNET **psx; -unsigned long lzone; -unsigned char *user; -int userlen; +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, unsigned char *user, + int userlen) { ASN1_INTEGER *izone = NULL; if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) { @@ -292,11 +269,8 @@ int userlen; * free it up afterwards. */ -int SXNET_add_id_INTEGER(psx, zone, user, userlen) -SXNET **psx; -ASN1_INTEGER *zone; -unsigned char *user; -int userlen; +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, unsigned char *user, + int userlen) { SXNET *sx = NULL; SXNETID *id = NULL; @@ -335,9 +309,7 @@ int userlen; return 0; } -ASN1_OCTET_STRING *SXNET_get_id_asc(sx, zone) -SXNET *sx; -char *zone; +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone) { ASN1_INTEGER *izone = NULL; ASN1_OCTET_STRING *oct; @@ -350,9 +322,7 @@ char *zone; return oct; } -ASN1_OCTET_STRING *SXNET_get_id_ulong(sx, lzone) -SXNET *sx; -unsigned long lzone; +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone) { ASN1_INTEGER *izone = NULL; ASN1_OCTET_STRING *oct; @@ -366,9 +336,7 @@ unsigned long lzone; return oct; } -ASN1_OCTET_STRING *SXNET_get_id_INTEGER(sx, zone) -SXNET *sx; -ASN1_INTEGER *zone; +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone) { SXNETID *id; int i; diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 5f26e40af2..7c79728771 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -68,10 +68,7 @@ static char *strip_spaces(char *name); /* Add a CONF_VALUE name value pair to stack */ -int X509V3_add_value(name, value, extlist) -const char *name; -const char *value; -STACK **extlist; +int X509V3_add_value(const char *name, const char *value, STACK **extlist) { CONF_VALUE *vtmp = NULL; char *tname = NULL, *tvalue = NULL; @@ -94,8 +91,7 @@ STACK **extlist; /* Free function for STACK of CONF_VALUE */ -void X509V3_conf_free(conf) -CONF_VALUE *conf; +void X509V3_conf_free(CONF_VALUE *conf) { if(!conf) return; if(conf->name) Free(conf->name); @@ -104,28 +100,20 @@ CONF_VALUE *conf; Free((char *)conf); } -int X509V3_add_value_bool(name, asn1_bool, extlist) -const char *name; -int asn1_bool; -STACK **extlist; +int X509V3_add_value_bool(const char *name, int asn1_bool, STACK **extlist) { if(asn1_bool) return X509V3_add_value(name, "TRUE", extlist); return X509V3_add_value(name, "FALSE", extlist); } -int X509V3_add_value_bool_nf(name, asn1_bool, extlist) -char *name; -int asn1_bool; -STACK **extlist; +int X509V3_add_value_bool_nf(char *name, int asn1_bool, STACK **extlist) { if(asn1_bool) return X509V3_add_value(name, "TRUE", extlist); return 1; } -char *i2s_ASN1_ENUMERATED(method, a) -X509V3_EXT_METHOD *method; -ASN1_ENUMERATED *a; +char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *a) { BIGNUM *bntmp = NULL; char *strtmp = NULL; @@ -137,9 +125,7 @@ ASN1_ENUMERATED *a; return strtmp; } -char *i2s_ASN1_INTEGER(method, a) -X509V3_EXT_METHOD *method; -ASN1_INTEGER *a; +char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a) { BIGNUM *bntmp = NULL; char *strtmp = NULL; @@ -151,9 +137,7 @@ ASN1_INTEGER *a; return strtmp; } -ASN1_INTEGER *s2i_ASN1_INTEGER(method, value) -X509V3_EXT_METHOD *method; -char *value; +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) { BIGNUM *bn = NULL; ASN1_INTEGER *aint; @@ -175,10 +159,8 @@ char *value; return aint; } -int X509V3_add_value_int(name, aint, extlist) -const char *name; -ASN1_INTEGER *aint; -STACK **extlist; +int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, + STACK **extlist) { char *strtmp; int ret; @@ -189,9 +171,7 @@ STACK **extlist; return ret; } -int X509V3_get_value_bool(value, asn1_bool) -CONF_VALUE *value; -int *asn1_bool; +int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool) { char *btmp; if(!(btmp = value->value)) goto err; @@ -212,9 +192,7 @@ int *asn1_bool; return 0; } -int X509V3_get_value_int(value, aint) -CONF_VALUE *value; -ASN1_INTEGER **aint; +int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint) { ASN1_INTEGER *itmp; if(!(itmp = s2i_ASN1_INTEGER(NULL, value->value))) { @@ -230,8 +208,7 @@ ASN1_INTEGER **aint; /*#define DEBUG*/ -STACK *X509V3_parse_list(line) -char *line; +STACK *X509V3_parse_list(char *line) { char *p, *q, c; char *ntmp, *vtmp; @@ -323,8 +300,7 @@ return NULL; } /* Delete leading and trailing spaces from a string */ -static char *strip_spaces(name) -char *name; +static char *strip_spaces(char *name) { char *p, *q; /* Skip over leading spaces */ @@ -344,9 +320,7 @@ char *name; * hex representation */ -char *hex_to_string(buffer, len) -unsigned char *buffer; -long len; +char *hex_to_string(unsigned char *buffer, long len) { char *tmp, *q; unsigned char *p; @@ -371,9 +345,7 @@ long len; * a buffer */ -unsigned char *string_to_hex(str, len) -char *str; -long *len; +unsigned char *string_to_hex(char *str, long *len) { unsigned char *hexbuf, *q; unsigned char ch, cl, *p; @@ -425,9 +397,7 @@ long *len; * cmp or cmp.* */ -int name_cmp(name, cmp) -const char *name; -const char *cmp; +int name_cmp(const char *name, const char *cmp) { int len, ret; char c; diff --git a/crypto/x509v3/v3conf.c b/crypto/x509v3/v3conf.c index 64a5561b53..aca90b6d7b 100644 --- a/crypto/x509v3/v3conf.c +++ b/crypto/x509v3/v3conf.c @@ -67,9 +67,7 @@ /* Test application to add extensions from a config file */ -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { LHASH *conf; X509 *cert; diff --git a/crypto/x509v3/v3err.c b/crypto/x509v3/v3err.c index 2f6ed4346b..09c5ff4ae8 100644 --- a/crypto/x509v3/v3err.c +++ b/crypto/x509v3/v3err.c @@ -150,7 +150,7 @@ static ERR_STRING_DATA X509V3_str_reasons[]= #endif -void ERR_load_X509V3_strings() +void ERR_load_X509V3_strings(void) { static int init=1; diff --git a/crypto/x509v3/v3prin.c b/crypto/x509v3/v3prin.c index 36f78b25df..2f80a8e24d 100644 --- a/crypto/x509v3/v3prin.c +++ b/crypto/x509v3/v3prin.c @@ -66,9 +66,7 @@ #include "x509.h" #include "x509v3.h" -int main(argc, argv) -int argc; -char **argv; +int main(int argc, char **argv) { X509 *cert; FILE *inf; diff --git a/perl/openssl_cb.c b/perl/openssl_cb.c index c093ae0bd6..7a880d97ae 100644 --- a/perl/openssl_cb.c +++ b/perl/openssl_cb.c @@ -55,10 +55,8 @@ * [including the GNU Public Licence.] */ -SV *new_ref(type,obj,mort) -char *type; -char *obj; - { +SV *new_ref(char *type, char *obj, int mort) +{ SV *ret; if (mort) @@ -69,13 +67,8 @@ char *obj; return(ret); } -int ex_new(obj,data,ad,idx,argl,argp) -char *obj; -SV *data; -CRYPTO_EX_DATA *ad; -int idx; -long argl; -char *argp; +int ex_new(char *obj, SV *data, CRYPTO_EX_DATA *ad, int idx, long argl, + char *argp) { SV *sv; @@ -86,13 +79,8 @@ fprintf(stderr,"ex_new idx=%d %08X %s\n",idx,obj,argp); return(1); } -void ex_cleanup(obj,data,ad,idx,argl,argp) -char *obj; -SV *data; -CRYPTO_EX_DATA *ad; -int idx; -long argl; -char *argp; +void ex_cleanup(char *obj, SV *data, CRYPTO_EX_DATA *ad, int idx, long argl, + char *argp) { pr_name("ex_cleanup"); fprintf(stderr,"ex_cleanup %08X %s\n",obj,argp); diff --git a/rsaref/rsar_err.c b/rsaref/rsar_err.c index 3ba902766c..f8714e1f7e 100644 --- a/rsaref/rsar_err.c +++ b/rsaref/rsar_err.c @@ -114,7 +114,7 @@ static ERR_STRING_DATA RSAREF_str_reasons[]= #endif -void ERR_load_RSAREF_strings() +void ERR_load_RSAREF_strings(void) { static int init=1; diff --git a/rsaref/rsaref.c b/rsaref/rsaref.c index 84486dd1b5..c72b5fc19b 100644 --- a/rsaref/rsaref.c +++ b/rsaref/rsaref.c @@ -130,33 +130,26 @@ static RSA_METHOD rsa_pkcs1_ref_meth={ NULL, }; -RSA_METHOD *RSA_PKCS1_RSAref() +RSA_METHOD *RSA_PKCS1_RSAref(void) { return(&rsa_pkcs1_ref_meth); } -static int RSA_ref_mod_exp(r0, I, rsa) -BIGNUM *r0; -BIGNUM *I; -RSA *rsa; +static int RSA_ref_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) { RSAREFerr(RSAREF_F_RSA_REF_MOD_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(0); } -static int BN_ref_mod_exp(r,a,p,m,ctx,m_ctx) -BIGNUM *r,*a,*p,*m; -BN_CTX *ctx; -BN_MONT_CTX *m_ctx; +static int BN_ref_mod_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, + BN_CTX *ctx, BN_MONT_CTX *m_ctx) { RSAREFerr(RSAREF_F_BN_REF_MOD_EXP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return(0); } -static int RSAref_bn2bin(from,to,max) -BIGNUM *from; -unsigned char *to; /* [max] */ -int max; +/* unsigned char *to: [max] */ +static int RSAref_bn2bin(BIGNUM *from, unsigned char *to, int max) { int i; @@ -174,10 +167,8 @@ int max; } #ifdef undef -static BIGNUM *RSAref_bin2bn(from,to,max) -unsigned char *from; /* [max] */ -BIGNUM *to; -int max; +/* unsigned char *from: [max] */ +static BIGNUM *RSAref_bin2bn(unsigned char *from, BIGNUM *to, int max) { int i; BIGNUM *ret; @@ -189,9 +180,7 @@ int max; return(ret); } -static int RSAref_Public_ref2eay(from,to) -RSArefPublicKey *from; -RSA *to; +static int RSAref_Public_ref2eay(RSArefPublicKey *from, RSA *to) { to->n=RSAref_bin2bn(from->m,NULL,RSAref_MAX_LEN); to->e=RSAref_bin2bn(from->e,NULL,RSAref_MAX_LEN); @@ -200,9 +189,7 @@ RSA *to; } #endif -static int RSAref_Public_eay2ref(from,to) -RSA *from; -RSArefPublicKey *to; +static int RSAref_Public_eay2ref(RSA *from, RSArefPublicKey *to) { to->bits=BN_num_bits(from->n); if (!RSAref_bn2bin(from->n,to->m,RSAref_MAX_LEN)) return(0); @@ -211,9 +198,7 @@ RSArefPublicKey *to; } #ifdef undef -static int RSAref_Private_ref2eay(from,to) -RSArefPrivateKey *from; -RSA *to; +static int RSAref_Private_ref2eay(RSArefPrivateKey *from, RSA *to) { if ((to->n=RSAref_bin2bn(from->m,NULL,RSAref_MAX_LEN)) == NULL) return(0); @@ -237,9 +222,7 @@ RSA *to; } #endif -static int RSAref_Private_eay2ref(from,to) -RSA *from; -RSArefPrivateKey *to; +static int RSAref_Private_eay2ref(RSA *from, RSArefPrivateKey *to) { to->bits=BN_num_bits(from->n); if (!RSAref_bn2bin(from->n,to->m,RSAref_MAX_LEN)) return(0); @@ -253,11 +236,8 @@ RSArefPrivateKey *to; return(1); } -int RSA_ref_private_decrypt(len,from,to,rsa,padding) -int len; -unsigned char *from,*to; -RSA *rsa; -int padding; +int RSA_ref_private_decrypt(int len, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { int i,outlen= -1; RSArefPrivateKey RSAkey; @@ -274,11 +254,8 @@ err: return(outlen); } -int RSA_ref_private_encrypt(len,from,to,rsa,padding) -int len; -unsigned char *from,*to; -RSA *rsa; -int padding; +int RSA_ref_private_encrypt(int len, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { int i,outlen= -1; RSArefPrivateKey RSAkey; @@ -300,11 +277,8 @@ err: return(outlen); } -int RSA_ref_public_decrypt(len,from,to,rsa,padding) -int len; -unsigned char *from,*to; -RSA *rsa; -int padding; +int RSA_ref_public_decrypt(int len, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { int i,outlen= -1; RSArefPublicKey RSAkey; @@ -321,11 +295,8 @@ err: return(outlen); } -int RSA_ref_public_encrypt(len,from,to,rsa,padding) -int len; -unsigned char *from,*to; -RSA *rsa; -int padding; +int RSA_ref_public_encrypt(int len, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { int outlen= -1; int i; diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c index 58a6d69b9b..ed08327228 100644 --- a/ssl/bio_ssl.c +++ b/ssl/bio_ssl.c @@ -104,13 +104,12 @@ static BIO_METHOD methods_sslp= ssl_free, }; -BIO_METHOD *BIO_f_ssl() +BIO_METHOD *BIO_f_ssl(void) { return(&methods_sslp); } -static int ssl_new(bi) -BIO *bi; +static int ssl_new(BIO *bi) { BIO_SSL *bs; @@ -127,8 +126,7 @@ BIO *bi; return(1); } -static int ssl_free(a) -BIO *a; +static int ssl_free(BIO *a) { BIO_SSL *bs; @@ -147,10 +145,7 @@ BIO *a; return(1); } -static int ssl_read(b,out,outl) -BIO *b; -char *out; -int outl; +static int ssl_read(BIO *b, char *out, int outl) { int ret=1; BIO_SSL *sb; @@ -234,10 +229,7 @@ int outl; return(ret); } -static int ssl_write(b,out,outl) -BIO *b; -char *out; -int outl; +static int ssl_write(BIO *b, char *out, int outl) { int ret,r=0; int retry_reason=0; @@ -305,11 +297,7 @@ int outl; return(ret); } -static long ssl_ctrl(b,cmd,num,ptr) -BIO *b; -int cmd; -long num; -char *ptr; +static long ssl_ctrl(BIO *b, int cmd, long num, char *ptr) { SSL **sslp,*ssl; BIO_SSL *bs; @@ -483,9 +471,7 @@ char *ptr; return(ret); } -static int ssl_puts(bp,str) -BIO *bp; -char *str; +static int ssl_puts(BIO *bp, char *str) { int n,ret; @@ -494,8 +480,7 @@ char *str; return(ret); } -BIO *BIO_new_buffer_ssl_connect(ctx) -SSL_CTX *ctx; +BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx) { BIO *ret=NULL,*buf=NULL,*ssl=NULL; @@ -512,8 +497,7 @@ err: return(NULL); } -BIO *BIO_new_ssl_connect(ctx) -SSL_CTX *ctx; +BIO *BIO_new_ssl_connect(SSL_CTX *ctx) { BIO *ret=NULL,*con=NULL,*ssl=NULL; @@ -530,9 +514,7 @@ err: return(NULL); } -BIO *BIO_new_ssl(ctx,client) -SSL_CTX *ctx; -int client; +BIO *BIO_new_ssl(SSL_CTX *ctx, int client) { BIO *ret; SSL *ssl; @@ -553,8 +535,7 @@ int client; return(ret); } -int BIO_ssl_copy_session_id(t,f) -BIO *t,*f; +int BIO_ssl_copy_session_id(BIO *t, BIO *f) { t=BIO_find_type(t,BIO_TYPE_SSL); f=BIO_find_type(f,BIO_TYPE_SSL); @@ -567,8 +548,7 @@ BIO *t,*f; return(1); } -void BIO_ssl_shutdown(b) -BIO *b; +void BIO_ssl_shutdown(BIO *b) { SSL *s; diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c index c0948fd2da..61c7420135 100644 --- a/ssl/s23_clnt.c +++ b/ssl/s23_clnt.c @@ -75,8 +75,7 @@ static int ssl23_client_hello(); static int ssl23_get_server_hello(); #endif -static SSL_METHOD *ssl23_get_client_method(ver) -int ver; +static SSL_METHOD *ssl23_get_client_method(int ver) { if (ver == SSL2_VERSION) return(SSLv2_client_method()); @@ -88,7 +87,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv23_client_method() +SSL_METHOD *SSLv23_client_method(void) { static int init=1; static SSL_METHOD SSLv23_client_data; @@ -104,8 +103,7 @@ SSL_METHOD *SSLv23_client_method() return(&SSLv23_client_data); } -int ssl23_connect(s) -SSL *s; +int ssl23_connect(SSL *s) { BUF_MEM *buf; unsigned long Time=time(NULL); @@ -215,8 +213,7 @@ end: } -static int ssl23_client_hello(s) -SSL *s; +static int ssl23_client_hello(SSL *s) { unsigned char *buf; unsigned char *p,*d; @@ -315,8 +312,7 @@ SSL *s; return(ssl23_write_bytes(s)); } -static int ssl23_get_server_hello(s) -SSL *s; +static int ssl23_get_server_hello(SSL *s) { char buf[8]; unsigned char *p; diff --git a/ssl/s23_lib.c b/ssl/s23_lib.c index 34aa0de4fd..4d58558522 100644 --- a/ssl/s23_lib.c +++ b/ssl/s23_lib.c @@ -105,23 +105,22 @@ static SSL_METHOD SSLv23_data= { &ssl3_undef_enc_method, }; -static long ssl23_default_timeout() +static long ssl23_default_timeout(void) { return(300); } -SSL_METHOD *sslv23_base_method() +SSL_METHOD *sslv23_base_method(void) { return(&SSLv23_data); } -static int ssl23_num_ciphers() +static int ssl23_num_ciphers(void) { return(ssl3_num_ciphers()+ssl2_num_ciphers()); } -static SSL_CIPHER *ssl23_get_cipher(u) -unsigned int u; +static SSL_CIPHER *ssl23_get_cipher(unsigned int u) { unsigned int uu=ssl3_num_ciphers(); @@ -133,8 +132,7 @@ unsigned int u; /* This function needs to check if the ciphers required are actually * available */ -static SSL_CIPHER *ssl23_get_cipher_by_char(p) -const unsigned char *p; +static SSL_CIPHER *ssl23_get_cipher_by_char(const unsigned char *p) { SSL_CIPHER c,*cp; unsigned long id; @@ -150,9 +148,7 @@ const unsigned char *p; return(cp); } -static int ssl23_put_cipher_by_char(c,p) -const SSL_CIPHER *c; -unsigned char *p; +static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; @@ -167,10 +163,7 @@ unsigned char *p; return(3); } -static int ssl23_read(s,buf,len) -SSL *s; -char *buf; -int len; +static int ssl23_read(SSL *s, char *buf, int len) { int n; @@ -200,10 +193,7 @@ int len; } } -static int ssl23_write(s,buf,len) -SSL *s; -const char *buf; -int len; +static int ssl23_write(SSL *s, const char *buf, int len) { int n; diff --git a/ssl/s23_meth.c b/ssl/s23_meth.c index bbda4ff182..edcbdbb2bd 100644 --- a/ssl/s23_meth.c +++ b/ssl/s23_meth.c @@ -66,8 +66,7 @@ static SSL_METHOD *ssl23_get_method(int ver); static SSL_METHOD *ssl23_get_method(); #endif -static SSL_METHOD *ssl23_get_method(ver) -int ver; +static SSL_METHOD *ssl23_get_method(int ver) { if (ver == SSL2_VERSION) return(SSLv23_method()); @@ -79,7 +78,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv23_method() +SSL_METHOD *SSLv23_method(void) { static int init=1; static SSL_METHOD SSLv23_data; diff --git a/ssl/s23_pkt.c b/ssl/s23_pkt.c index 99f909d50f..64acf2ce7d 100644 --- a/ssl/s23_pkt.c +++ b/ssl/s23_pkt.c @@ -63,8 +63,7 @@ #include "buffer.h" #include "ssl_locl.h" -int ssl23_write_bytes(s) -SSL *s; +int ssl23_write_bytes(SSL *s) { int i,num,tot; char *buf; @@ -91,9 +90,7 @@ SSL *s; } /* only return when we have read 'n' bytes */ -int ssl23_read_bytes(s,n) -SSL *s; -int n; +int ssl23_read_bytes(SSL *s, int n) { unsigned char *p; int j; diff --git a/ssl/s23_srvr.c b/ssl/s23_srvr.c index fa132166bd..8dc0a0608f 100644 --- a/ssl/s23_srvr.c +++ b/ssl/s23_srvr.c @@ -73,8 +73,7 @@ static SSL_METHOD *ssl23_get_server_method(); int ssl23_get_client_hello(); #endif -static SSL_METHOD *ssl23_get_server_method(ver) -int ver; +static SSL_METHOD *ssl23_get_server_method(int ver) { if (ver == SSL2_VERSION) return(SSLv2_server_method()); @@ -86,7 +85,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv23_server_method() +SSL_METHOD *SSLv23_server_method(void) { static int init=1; static SSL_METHOD SSLv23_server_data; @@ -102,8 +101,7 @@ SSL_METHOD *SSLv23_server_method() return(&SSLv23_server_data); } -int ssl23_accept(s) -SSL *s; +int ssl23_accept(SSL *s) { BUF_MEM *buf; unsigned long Time=time(NULL); @@ -194,8 +192,7 @@ end: } -int ssl23_get_client_hello(s) -SSL *s; +int ssl23_get_client_hello(SSL *s) { char buf_space[8]; char *buf= &(buf_space[0]); diff --git a/ssl/s2_clnt.c b/ssl/s2_clnt.c index 8c3cbde177..5652549dac 100644 --- a/ssl/s2_clnt.c +++ b/ssl/s2_clnt.c @@ -88,8 +88,7 @@ static int ssl_rsa_public_encrypt(); #define BREAK break -static SSL_METHOD *ssl2_get_client_method(ver) -int ver; +static SSL_METHOD *ssl2_get_client_method(int ver) { if (ver == SSL2_VERSION) return(SSLv2_client_method()); @@ -97,7 +96,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv2_client_method() +SSL_METHOD *SSLv2_client_method(void) { static int init=1; static SSL_METHOD SSLv2_client_data; @@ -113,8 +112,7 @@ SSL_METHOD *SSLv2_client_method() return(&SSLv2_client_data); } -int ssl2_connect(s) -SSL *s; +int ssl2_connect(SSL *s) { unsigned long l=time(NULL); BUF_MEM *buf=NULL; @@ -296,8 +294,7 @@ end: return(ret); } -static int get_server_hello(s) -SSL *s; +static int get_server_hello(SSL *s) { unsigned char *buf; unsigned char *p; @@ -461,8 +458,7 @@ SSL *s; return(1); } -static int client_hello(s) -SSL *s; +static int client_hello(SSL *s) { unsigned char *buf; unsigned char *p,*d; @@ -529,8 +525,7 @@ SSL *s; return(ssl2_do_write(s)); } -static int client_master_key(s) -SSL *s; +static int client_master_key(SSL *s) { unsigned char *buf; unsigned char *p,*d; @@ -615,8 +610,7 @@ SSL *s; return(ssl2_do_write(s)); } -static int client_finished(s) -SSL *s; +static int client_finished(SSL *s) { unsigned char *p; @@ -634,8 +628,7 @@ SSL *s; } /* read the data and then respond */ -static int client_certificate(s) -SSL *s; +static int client_certificate(SSL *s) { unsigned char *buf; unsigned char *p,*d; @@ -779,8 +772,7 @@ SSL *s; return(ssl2_do_write(s)); } -static int get_server_verify(s) -SSL *s; +static int get_server_verify(SSL *s) { unsigned char *p; int i; @@ -823,8 +815,7 @@ SSL *s; return(1); } -static int get_server_finished(s) -SSL *s; +static int get_server_finished(SSL *s) { unsigned char *buf; unsigned char *p; @@ -889,11 +880,7 @@ SSL *s; } /* loads in the certificate from the server */ -int ssl2_set_certificate(s, type, len, data) -SSL *s; -int type; -int len; -unsigned char *data; +int ssl2_set_certificate(SSL *s, int type, int len, unsigned char *data) { STACK_OF(X509) *sk=NULL; EVP_PKEY *pkey=NULL; @@ -963,12 +950,8 @@ err: return(ret); } -static int ssl_rsa_public_encrypt(c, len, from, to, padding) -CERT *c; -int len; -unsigned char *from; -unsigned char *to; -int padding; +static int ssl_rsa_public_encrypt(CERT *c, int len, unsigned char *from, + unsigned char *to, int padding) { EVP_PKEY *pkey=NULL; int i= -1; diff --git a/ssl/s2_enc.c b/ssl/s2_enc.c index af12dc472f..09835008a9 100644 --- a/ssl/s2_enc.c +++ b/ssl/s2_enc.c @@ -59,9 +59,7 @@ #include #include "ssl_locl.h" -int ssl2_enc_init(s, client) -SSL *s; -int client; +int ssl2_enc_init(SSL *s, int client) { /* Max number of bytes needed */ EVP_CIPHER_CTX *rs,*ws; @@ -114,9 +112,7 @@ err: /* read/writes from s->s2->mac_data using length for encrypt and * decrypt. It sets the s->s2->padding, s->[rw]length and * s->s2->pad_data ptr if we are encrypting */ -void ssl2_enc(s,send) -SSL *s; -int send; +void ssl2_enc(SSL *s, int send) { EVP_CIPHER_CTX *ds; unsigned long l; @@ -146,10 +142,7 @@ int send; EVP_Cipher(ds,s->s2->mac_data,s->s2->mac_data,l); } -void ssl2_mac(s, md,send) -SSL *s; -unsigned char *md; -int send; +void ssl2_mac(SSL *s, unsigned char *md, int send) { EVP_MD_CTX c; unsigned char sequence[4],*p,*sec,*act; diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c index 7241ea2cf9..43c7cab3ed 100644 --- a/ssl/s2_lib.c +++ b/ssl/s2_lib.c @@ -196,23 +196,22 @@ static SSL_METHOD SSLv2_data= { &ssl3_undef_enc_method, }; -static long ssl2_default_timeout() +static long ssl2_default_timeout(void) { return(300); } -SSL_METHOD *sslv2_base_method() +SSL_METHOD *sslv2_base_method(void) { return(&SSLv2_data); } -int ssl2_num_ciphers() +int ssl2_num_ciphers(void) { return(SSL2_NUM_CIPHERS); } -SSL_CIPHER *ssl2_get_cipher(u) -unsigned int u; +SSL_CIPHER *ssl2_get_cipher(unsigned int u) { if (u < SSL2_NUM_CIPHERS) return(&(ssl2_ciphers[SSL2_NUM_CIPHERS-1-u])); @@ -220,14 +219,12 @@ unsigned int u; return(NULL); } -int ssl2_pending(s) -SSL *s; +int ssl2_pending(SSL *s) { return(s->s2->ract_data_length); } -int ssl2_new(s) -SSL *s; +int ssl2_new(SSL *s) { SSL2_CTX *s2; @@ -252,8 +249,7 @@ err: return(0); } -void ssl2_free(s) -SSL *s; +void ssl2_free(SSL *s) { SSL2_CTX *s2; @@ -268,8 +264,7 @@ SSL *s; s->s2=NULL; } -void ssl2_clear(s) -SSL *s; +void ssl2_clear(SSL *s) { SSL2_CTX *s2; unsigned char *rbuf,*wbuf; @@ -289,11 +284,7 @@ SSL *s; s->packet_length=0; } -long ssl2_ctrl(s,cmd,larg,parg) -SSL *s; -int cmd; -long larg; -char *parg; +long ssl2_ctrl(SSL *s, int cmd, long larg, char *parg) { int ret=0; @@ -308,19 +299,14 @@ char *parg; return(ret); } -long ssl2_ctx_ctrl(ctx,cmd,larg,parg) -SSL_CTX *ctx; -int cmd; -long larg; -char *parg; +long ssl2_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg) { return(0); } /* This function needs to check if the ciphers required are actually * available */ -SSL_CIPHER *ssl2_get_cipher_by_char(p) -const unsigned char *p; +SSL_CIPHER *ssl2_get_cipher_by_char(const unsigned char *p) { static int init=1; static SSL_CIPHER *sorted[SSL2_NUM_CIPHERS]; @@ -353,9 +339,7 @@ const unsigned char *p; return(*cpp); } -int ssl2_put_cipher_by_char(c,p) -const SSL_CIPHER *c; -unsigned char *p; +int ssl2_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; @@ -370,8 +354,7 @@ unsigned char *p; return(3); } -void ssl2_generate_key_material(s) -SSL *s; +void ssl2_generate_key_material(SSL *s) { unsigned int i; MD5_CTX ctx; @@ -393,9 +376,7 @@ SSL *s; } } -void ssl2_return_error(s,err) -SSL *s; -int err; +void ssl2_return_error(SSL *s, int err) { if (!s->error) { @@ -407,8 +388,7 @@ int err; } -void ssl2_write_error(s) -SSL *s; +void ssl2_write_error(SSL *s) { char buf[3]; int i,error; @@ -431,8 +411,7 @@ SSL *s; s->error=0; */ } -int ssl2_shutdown(s) -SSL *s; +int ssl2_shutdown(SSL *s) { s->shutdown=(SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); return(1); diff --git a/ssl/s2_meth.c b/ssl/s2_meth.c index f28c9162cf..7d7eed8a8f 100644 --- a/ssl/s2_meth.c +++ b/ssl/s2_meth.c @@ -66,8 +66,7 @@ static SSL_METHOD *ssl2_get_method(int ver); static SSL_METHOD *ssl2_get_method(); #endif -static SSL_METHOD *ssl2_get_method(ver) -int ver; +static SSL_METHOD *ssl2_get_method(int ver) { if (ver == SSL2_VERSION) return(SSLv2_method()); @@ -75,7 +74,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv2_method() +SSL_METHOD *SSLv2_method(void) { static int init=1; static SSL_METHOD SSLv2_data; diff --git a/ssl/s2_pkt.c b/ssl/s2_pkt.c index e1b13ccf65..89fe9dabb1 100644 --- a/ssl/s2_pkt.c +++ b/ssl/s2_pkt.c @@ -80,10 +80,7 @@ static int write_pending(); static int ssl_mt_error(); #endif -int ssl2_peek(s,buf,len) -SSL *s; -char *buf; -int len; +int ssl2_peek(SSL *s, char *buf, int len) { int ret; @@ -99,10 +96,7 @@ int len; /* SSL_read - * This routine will return 0 to len bytes, decrypted etc if required. */ -int ssl2_read(s, buf, len) -SSL *s; -char *buf; -int len; +int ssl2_read(SSL *s, char *buf, int len) { int n; unsigned char mac[MAX_MAC_SIZE]; @@ -252,11 +246,8 @@ int len; } } -static int read_n(s, n, max, extend) -SSL *s; -unsigned int n; -unsigned int max; -unsigned int extend; +static int read_n(SSL *s, unsigned int n, unsigned int max, + unsigned int extend) { int i,off,newb; @@ -354,10 +345,7 @@ unsigned int extend; return(n); } -int ssl2_write(s, buf, len) -SSL *s; -const char *buf; -int len; +int ssl2_write(SSL *s, const char *buf, int len) { unsigned int n,tot; int i; @@ -403,10 +391,7 @@ int len; } } -static int write_pending(s,buf,len) -SSL *s; -const char *buf; -unsigned int len; +static int write_pending(SSL *s, const char *buf, unsigned int len) { int i; @@ -451,10 +436,7 @@ unsigned int len; } } -static int do_ssl_write(s, buf, len) -SSL *s; -const char *buf; -unsigned int len; +static int do_ssl_write(SSL *s, const char *buf, unsigned int len) { unsigned int j,k,olen,p,mac_size,bs; register unsigned char *pp; @@ -575,10 +557,7 @@ unsigned int len; return(write_pending(s,buf,olen)); } -int ssl2_part_read(s,f,i) -SSL *s; -unsigned long f; -int i; +int ssl2_part_read(SSL *s, unsigned long f, int i) { unsigned char *p; int j; @@ -608,8 +587,7 @@ int i; } } -int ssl2_do_write(s) -SSL *s; +int ssl2_do_write(SSL *s) { int ret; @@ -624,8 +602,7 @@ SSL *s; return(0); } -static int ssl_mt_error(n) -int n; +static int ssl_mt_error(int n) { int ret; diff --git a/ssl/s2_srvr.c b/ssl/s2_srvr.c index c058b522bc..83621290fb 100644 --- a/ssl/s2_srvr.c +++ b/ssl/s2_srvr.c @@ -88,8 +88,7 @@ static int ssl_rsa_private_decrypt(); #define BREAK break -static SSL_METHOD *ssl2_get_server_method(ver) -int ver; +static SSL_METHOD *ssl2_get_server_method(int ver) { if (ver == SSL2_VERSION) return(SSLv2_server_method()); @@ -97,7 +96,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv2_server_method() +SSL_METHOD *SSLv2_server_method(void) { static int init=1; static SSL_METHOD SSLv2_server_data; @@ -113,8 +112,7 @@ SSL_METHOD *SSLv2_server_method() return(&SSLv2_server_data); } -int ssl2_accept(s) -SSL *s; +int ssl2_accept(SSL *s) { unsigned long l=time(NULL); BUF_MEM *buf=NULL; @@ -334,8 +332,7 @@ end: return(ret); } -static int get_client_master_key(s) -SSL *s; +static int get_client_master_key(SSL *s) { int export,i,n,keya,ek; unsigned char *p; @@ -460,8 +457,7 @@ SSL *s; return(1); } -static int get_client_hello(s) -SSL *s; +static int get_client_hello(SSL *s) { int i,n; unsigned char *p; @@ -603,8 +599,7 @@ mem_err: return(0); } -static int server_hello(s) -SSL *s; +static int server_hello(SSL *s) { unsigned char *p,*d; int n,hit; @@ -694,8 +689,7 @@ SSL *s; return(ssl2_do_write(s)); } -static int get_client_finished(s) -SSL *s; +static int get_client_finished(SSL *s) { unsigned char *p; int i; @@ -737,8 +731,7 @@ SSL *s; return(1); } -static int server_verify(s) -SSL *s; +static int server_verify(SSL *s) { unsigned char *p; @@ -756,8 +749,7 @@ SSL *s; return(ssl2_do_write(s)); } -static int server_finish(s) -SSL *s; +static int server_finish(SSL *s) { unsigned char *p; @@ -780,8 +772,7 @@ SSL *s; } /* send the request and check the response */ -static int request_certificate(s) -SSL *s; +static int request_certificate(SSL *s) { unsigned char *p,*p2,*buf2; unsigned char *ccd; @@ -938,12 +929,8 @@ end: return(ret); } -static int ssl_rsa_private_decrypt(c, len, from, to,padding) -CERT *c; -int len; -unsigned char *from; -unsigned char *to; -int padding; +static int ssl_rsa_private_decrypt(CERT *c, int len, unsigned char *from, + unsigned char *to, int padding) { RSA *rsa; int i; diff --git a/ssl/s3_both.c b/ssl/s3_both.c index c3d660ff33..d5f8c464ba 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -69,12 +69,8 @@ /* SSL3err(SSL_F_SSL3_GET_FINISHED,SSL_R_EXCESSIVE_MESSAGE_SIZE); */ -int ssl3_send_finished(s,a,b,sender,slen) -SSL *s; -int a; -int b; -unsigned char *sender; -int slen; +int ssl3_send_finished(SSL *s, int a, int b, unsigned char *sender, + int slen) { unsigned char *p,*d; int i; @@ -111,10 +107,7 @@ int slen; return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); } -int ssl3_get_finished(s,a,b) -SSL *s; -int a; -int b; +int ssl3_get_finished(SSL *s, int a, int b) { int al,i,ok; long n; @@ -174,9 +167,7 @@ f_err: * ssl->session->read_compression assign * ssl->session->read_hash assign */ -int ssl3_send_change_cipher_spec(s,a,b) -SSL *s; -int a,b; +int ssl3_send_change_cipher_spec(SSL *s, int a, int b) { unsigned char *p; @@ -194,9 +185,7 @@ int a,b; return(ssl3_do_write(s,SSL3_RT_CHANGE_CIPHER_SPEC)); } -unsigned long ssl3_output_cert_chain(s,x) -SSL *s; -X509 *x; +unsigned long ssl3_output_cert_chain(SSL *s, X509 *x) { unsigned char *p; int n,i; @@ -271,11 +260,7 @@ X509 *x; return(l); } -long ssl3_get_message(s,st1,stn,mt,max,ok) -SSL *s; -int st1,stn,mt; -long max; -int *ok; +long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) { unsigned char *p; unsigned long l; @@ -356,9 +341,7 @@ err: return(-1); } -int ssl_cert_type(x,pkey) -X509 *x; -EVP_PKEY *pkey; +int ssl_cert_type(X509 *x, EVP_PKEY *pkey) { EVP_PKEY *pk; int ret= -1,i,j; @@ -408,8 +391,7 @@ err: return(ret); } -int ssl_verify_alarm_type(type) -long type; +int ssl_verify_alarm_type(long type) { int al; @@ -461,8 +443,7 @@ long type; return(al); } -int ssl3_setup_buffers(s) -SSL *s; +int ssl3_setup_buffers(SSL *s) { unsigned char *p; unsigned int extra; diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 24d4f14e93..6c8eefbdcf 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -101,8 +101,7 @@ static int ssl3_get_server_certificate(); static int ssl3_check_cert_and_algorithm(); #endif -static SSL_METHOD *ssl3_get_client_method(ver) -int ver; +static SSL_METHOD *ssl3_get_client_method(int ver) { if (ver == SSL3_VERSION) return(SSLv3_client_method()); @@ -110,7 +109,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv3_client_method() +SSL_METHOD *SSLv3_client_method(void) { static int init=1; static SSL_METHOD SSLv3_client_data; @@ -126,8 +125,7 @@ SSL_METHOD *SSLv3_client_method() return(&SSLv3_client_data); } -int ssl3_connect(s) -SSL *s; +int ssl3_connect(SSL *s) { BUF_MEM *buf; unsigned long Time=time(NULL),l; @@ -468,8 +466,7 @@ end: } -static int ssl3_client_hello(s) -SSL *s; +static int ssl3_client_hello(SSL *s) { unsigned char *buf; unsigned char *p,*d; @@ -557,8 +554,7 @@ err: return(-1); } -static int ssl3_get_server_hello(s) -SSL *s; +static int ssl3_get_server_hello(SSL *s) { STACK_OF(SSL_CIPHER) *sk; SSL_CIPHER *c; @@ -700,8 +696,7 @@ err: return(-1); } -static int ssl3_get_server_certificate(s) -SSL *s; +static int ssl3_get_server_certificate(SSL *s) { int al,i,ok,ret= -1; unsigned long n,nc,llen,l; @@ -849,8 +844,7 @@ err: return(ret); } -static int ssl3_get_key_exchange(s) -SSL *s; +static int ssl3_get_key_exchange(SSL *s) { #ifndef NO_RSA unsigned char *q,md_buf[EVP_MAX_MD_SIZE*2]; @@ -1143,8 +1137,7 @@ err: return(-1); } -static int ssl3_get_certificate_request(s) -SSL *s; +static int ssl3_get_certificate_request(SSL *s) { int ok,ret=0; unsigned long n,nc,l; @@ -1290,14 +1283,12 @@ err: return(ret); } -static int ca_dn_cmp(a,b) -X509_NAME **a,**b; +static int ca_dn_cmp(X509_NAME **a, X509_NAME **b) { return(X509_NAME_cmp(*a,*b)); } -static int ssl3_get_server_done(s) -SSL *s; +static int ssl3_get_server_done(SSL *s) { int ok,ret=0; long n; @@ -1320,8 +1311,7 @@ SSL *s; return(ret); } -static int ssl3_send_client_key_exchange(s) -SSL *s; +static int ssl3_send_client_key_exchange(SSL *s) { unsigned char *p,*q,*d; int n; @@ -1471,8 +1461,7 @@ err: return(-1); } -static int ssl3_send_client_verify(s) -SSL *s; +static int ssl3_send_client_verify(SSL *s) { unsigned char *p,*d; unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH]; @@ -1542,8 +1531,7 @@ err: return(-1); } -static int ssl3_send_client_certificate(s) -SSL *s; +static int ssl3_send_client_certificate(SSL *s) { X509 *x509=NULL; EVP_PKEY *pkey=NULL; @@ -1622,8 +1610,7 @@ SSL *s; #define has_bits(i,m) (((i)&(m)) == (m)) -static int ssl3_check_cert_and_algorithm(s) -SSL *s; +static int ssl3_check_cert_and_algorithm(SSL *s) { int i,idx; long algs; diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index d1341af178..dfddb51d17 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -83,10 +83,7 @@ static int ssl3_handshake_mac(SSL *s, EVP_MD_CTX *in_ctx, static int ssl3_handshake_mac(); #endif -static void ssl3_generate_key_block(s,km,num) -SSL *s; -unsigned char *km; -int num; +static void ssl3_generate_key_block(SSL *s, unsigned char *km, int num) { MD5_CTX m5; SHA_CTX s1; @@ -126,9 +123,7 @@ int num; memset(smd,0,SHA_DIGEST_LENGTH); } -int ssl3_change_cipher_state(s,which) -SSL *s; -int which; +int ssl3_change_cipher_state(SSL *s, int which) { unsigned char *p,*key_block,*mac_secret; unsigned char exp_key[EVP_MAX_KEY_LENGTH]; @@ -278,8 +273,7 @@ err2: return(0); } -int ssl3_setup_key_block(s) -SSL *s; +int ssl3_setup_key_block(SSL *s) { unsigned char *p; const EVP_CIPHER *c; @@ -319,8 +313,7 @@ err: return(0); } -void ssl3_cleanup_key_block(s) -SSL *s; +void ssl3_cleanup_key_block(SSL *s) { if (s->s3->tmp.key_block != NULL) { @@ -332,9 +325,7 @@ SSL *s; s->s3->tmp.key_block_length=0; } -int ssl3_enc(s,send) -SSL *s; -int send; +int ssl3_enc(SSL *s, int send) { SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; @@ -402,36 +393,25 @@ int send; return(1); } -void ssl3_init_finished_mac(s) -SSL *s; +void ssl3_init_finished_mac(SSL *s) { EVP_DigestInit(&(s->s3->finish_dgst1),s->ctx->md5); EVP_DigestInit(&(s->s3->finish_dgst2),s->ctx->sha1); } -void ssl3_finish_mac(s,buf,len) -SSL *s; -const unsigned char *buf; -int len; +void ssl3_finish_mac(SSL *s, const unsigned char *buf, int len) { EVP_DigestUpdate(&(s->s3->finish_dgst1),buf,len); EVP_DigestUpdate(&(s->s3->finish_dgst2),buf,len); } -int ssl3_cert_verify_mac(s,ctx,p) -SSL *s; -EVP_MD_CTX *ctx; -unsigned char *p; +int ssl3_cert_verify_mac(SSL *s, EVP_MD_CTX *ctx, unsigned char *p) { return(ssl3_handshake_mac(s,ctx,NULL,0,p)); } -int ssl3_final_finish_mac(s,ctx1,ctx2,sender,len,p) -SSL *s; -EVP_MD_CTX *ctx1,*ctx2; -unsigned char *sender; -int len; -unsigned char *p; +int ssl3_final_finish_mac(SSL *s, EVP_MD_CTX *ctx1, EVP_MD_CTX *ctx2, + unsigned char *sender, int len, unsigned char *p) { int ret; @@ -441,12 +421,8 @@ unsigned char *p; return(ret); } -static int ssl3_handshake_mac(s,in_ctx,sender,len,p) -SSL *s; -EVP_MD_CTX *in_ctx; -unsigned char *sender; -int len; -unsigned char *p; +static int ssl3_handshake_mac(SSL *s, EVP_MD_CTX *in_ctx, + unsigned char *sender, int len, unsigned char *p) { unsigned int ret; int npad,n; @@ -478,10 +454,7 @@ unsigned char *p; return((int)ret); } -int ssl3_mac(ssl,md,send) -SSL *ssl; -unsigned char *md; -int send; +int ssl3_mac(SSL *ssl, unsigned char *md, int send) { SSL3_RECORD *rec; unsigned char *mac_sec,*seq; @@ -535,11 +508,8 @@ int send; return(md_size); } -int ssl3_generate_master_secret(s,out,p,len) -SSL *s; -unsigned char *out; -unsigned char *p; -int len; +int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, + int len) { static const unsigned char *salt[3]={ (const unsigned char *)"A", @@ -572,8 +542,7 @@ int len; return(ret); } -int ssl3_alert_code(code) -int code; +int ssl3_alert_code(int code) { switch (code) { diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 444e554c27..4e58bcd632 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -464,25 +464,24 @@ static SSL_METHOD SSLv3_data= { &SSLv3_enc_data, }; -static long ssl3_default_timeout() +static long ssl3_default_timeout(void) { /* 2 hours, the 24 hours mentioned in the SSLv3 spec * is way too long for http, the cache would over fill */ return(60*60*2); } -SSL_METHOD *sslv3_base_method() +SSL_METHOD *sslv3_base_method(void) { return(&SSLv3_data); } -int ssl3_num_ciphers() +int ssl3_num_ciphers(void) { return(SSL3_NUM_CIPHERS); } -SSL_CIPHER *ssl3_get_cipher(u) -unsigned int u; +SSL_CIPHER *ssl3_get_cipher(unsigned int u) { if (u < SSL3_NUM_CIPHERS) return(&(ssl3_ciphers[SSL3_NUM_CIPHERS-1-u])); @@ -491,14 +490,12 @@ unsigned int u; } /* The problem is that it may not be the correct record type */ -int ssl3_pending(s) -SSL *s; +int ssl3_pending(SSL *s) { return(s->s3->rrec.length); } -int ssl3_new(s) -SSL *s; +int ssl3_new(SSL *s) { SSL3_CTX *s3; @@ -520,8 +517,7 @@ err: return(0); } -void ssl3_free(s) -SSL *s; +void ssl3_free(SSL *s) { if(s == NULL) return; @@ -544,8 +540,7 @@ SSL *s; s->s3=NULL; } -void ssl3_clear(s) -SSL *s; +void ssl3_clear(SSL *s) { unsigned char *rp,*wp; @@ -576,11 +571,7 @@ SSL *s; s->version=SSL3_VERSION; } -long ssl3_ctrl(s,cmd,larg,parg) -SSL *s; -int cmd; -long larg; -char *parg; +long ssl3_ctrl(SSL *s, int cmd, long larg, char *parg) { int ret=0; @@ -693,11 +684,7 @@ char *parg; return(ret); } -long ssl3_ctx_ctrl(ctx,cmd,larg,parg) -SSL_CTX *ctx; -int cmd; -long larg; -char *parg; +long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, char *parg) { CERT *cert; @@ -800,8 +787,7 @@ char *parg; /* This function needs to check if the ciphers required are actually * available */ -SSL_CIPHER *ssl3_get_cipher_by_char(p) -const unsigned char *p; +SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p) { static int init=1; static SSL_CIPHER *sorted[SSL3_NUM_CIPHERS]; @@ -833,9 +819,7 @@ const unsigned char *p; return(*cpp); } -int ssl3_put_cipher_by_char(c,p) -const SSL_CIPHER *c; -unsigned char *p; +int ssl3_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p) { long l; @@ -849,9 +833,7 @@ unsigned char *p; return(2); } -int ssl3_part_read(s,i) -SSL *s; -int i; +int ssl3_part_read(SSL *s, int i) { s->rwstate=SSL_READING; @@ -866,10 +848,8 @@ int i; } } -SSL_CIPHER *ssl3_choose_cipher(s,have,pref) -SSL *s; -STACK_OF(SSL_CIPHER) *have; -STACK_OF(SSL_CIPHER) *pref; +SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *have, + STACK_OF(SSL_CIPHER) *pref) { SSL_CIPHER *c,*ret=NULL; int i,j,ok; @@ -931,9 +911,7 @@ STACK_OF(SSL_CIPHER) *pref; return(ret); } -int ssl3_get_req_cert_type(s,p) -SSL *s; -unsigned char *p; +int ssl3_get_req_cert_type(SSL *s, unsigned char *p) { int ret=0; unsigned long alg; @@ -970,8 +948,7 @@ unsigned char *p; return(ret); } -int ssl3_shutdown(s) -SSL *s; +int ssl3_shutdown(SSL *s) { /* Don't do anything much if we have not done the handshake or @@ -1011,10 +988,7 @@ SSL *s; return(0); } -int ssl3_write(s,buf,len) -SSL *s; -const char *buf; -int len; +int ssl3_write(SSL *s, const char *buf, int len) { int ret,n; @@ -1067,10 +1041,7 @@ int len; return(ret); } -int ssl3_read(s,buf,len) -SSL *s; -char *buf; -int len; +int ssl3_read(SSL *s, char *buf, int len) { int ret; @@ -1092,10 +1063,7 @@ int len; return(ret); } -int ssl3_peek(s,buf,len) -SSL *s; -char *buf; -int len; +int ssl3_peek(SSL *s, char *buf, int len) { SSL3_RECORD *rr; int n; @@ -1117,8 +1085,7 @@ int len; return(n); } -int ssl3_renegotiate(s) -SSL *s; +int ssl3_renegotiate(SSL *s) { if (s->handshake_func == NULL) return(1); @@ -1130,8 +1097,7 @@ SSL *s; return(1); } -int ssl3_renegotiate_check(s) -SSL *s; +int ssl3_renegotiate_check(SSL *s) { int ret=0; diff --git a/ssl/s3_meth.c b/ssl/s3_meth.c index 387b352370..d9cd9c2210 100644 --- a/ssl/s3_meth.c +++ b/ssl/s3_meth.c @@ -66,8 +66,7 @@ static SSL_METHOD *ssl3_get_method(int ver); static SSL_METHOD *ssl3_get_method(); #endif -static SSL_METHOD *ssl3_get_method(ver) -int ver; +static SSL_METHOD *ssl3_get_method(int ver) { if (ver == SSL3_VERSION) return(SSLv3_method()); @@ -75,7 +74,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv3_method() +SSL_METHOD *SSLv3_method(void) { static int init=1; static SSL_METHOD SSLv3_data; diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 6b1addc6ac..6e581e1ab1 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -110,11 +110,7 @@ static int do_uncompress(); static int do_change_cipher_spec(); #endif -static int ssl3_read_n(s,n,max,extend) -SSL *s; -int n; -int max; -int extend; +static int ssl3_read_n(SSL *s, int n, int max, int extend) { int i,off,newb; @@ -223,8 +219,7 @@ int extend; * ssl->s3->rrec.data, - data * ssl->s3->rrec.length, - number of bytes */ -static int ssl3_get_record(s) -SSL *s; +static int ssl3_get_record(SSL *s) { int ssl_major,ssl_minor,al; int n,i,ret= -1; @@ -435,8 +430,7 @@ err: return(ret); } -static int do_uncompress(ssl) -SSL *ssl; +static int do_uncompress(SSL *ssl) { int i; SSL3_RECORD *rr; @@ -453,8 +447,7 @@ SSL *ssl; return(1); } -static int do_compress(ssl) -SSL *ssl; +static int do_compress(SSL *ssl) { int i; SSL3_RECORD *wr; @@ -475,11 +468,7 @@ SSL *ssl; /* Call this to write data * It will return <= 0 if not all data has been sent or non-blocking IO. */ -int ssl3_write_bytes(s,type,buf,len) -SSL *s; -int type; -const char *buf; -int len; +int ssl3_write_bytes(SSL *s, int type, const char *buf, int len) { unsigned int tot,n,nw; int i; @@ -524,11 +513,8 @@ int len; } } -static int do_ssl3_write(s,type,buf,len) -SSL *s; -int type; -const char *buf; -unsigned int len; +static int do_ssl3_write(SSL *s, int type, const char *buf, + unsigned int len) { unsigned char *p,*plen; int i,mac_size,clear=0; @@ -642,11 +628,8 @@ err: } /* if s->s3->wbuf.left != 0, we need to call this */ -static int ssl3_write_pending(s,type,buf,len) -SSL *s; -int type; -const char *buf; -unsigned int len; +static int ssl3_write_pending(SSL *s, int type, const char *buf, + unsigned int len) { int i; @@ -686,11 +669,7 @@ unsigned int len; } } -int ssl3_read_bytes(s,type,buf,len) -SSL *s; -int type; -char *buf; -int len; +int ssl3_read_bytes(SSL *s, int type, char *buf, int len) { int al,i,j,n,ret; SSL3_RECORD *rr; @@ -984,8 +963,7 @@ err: return(-1); } -static int do_change_cipher_spec(s) -SSL *s; +static int do_change_cipher_spec(SSL *s) { int i; unsigned char *sender; @@ -1027,9 +1005,7 @@ SSL *s; return(1); } -int ssl3_do_write(s,type) -SSL *s; -int type; +int ssl3_do_write(SSL *s, int type) { int ret; @@ -1043,10 +1019,7 @@ int type; return(0); } -void ssl3_send_alert(s,level,desc) -SSL *s; -int level; -int desc; +void ssl3_send_alert(SSL *s, int level, int desc) { /* Map tls/ssl alert value to correct one */ desc=s->method->ssl3_enc->alert_value(desc); @@ -1064,8 +1037,7 @@ int desc; * some time in the future */ } -int ssl3_dispatch_alert(s) -SSL *s; +int ssl3_dispatch_alert(SSL *s) { int i,j; void (*cb)()=NULL; diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 3969657599..06e5268a54 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -101,8 +101,7 @@ static int ssl3_send_hello_request(); #endif -static SSL_METHOD *ssl3_get_server_method(ver) -int ver; +static SSL_METHOD *ssl3_get_server_method(int ver) { if (ver == SSL3_VERSION) return(SSLv3_server_method()); @@ -110,7 +109,7 @@ int ver; return(NULL); } -SSL_METHOD *SSLv3_server_method() +SSL_METHOD *SSLv3_server_method(void) { static int init=1; static SSL_METHOD SSLv3_server_data; @@ -126,8 +125,7 @@ SSL_METHOD *SSLv3_server_method() return(&SSLv3_server_data); } -int ssl3_accept(s) -SSL *s; +int ssl3_accept(SSL *s) { BUF_MEM *buf; unsigned long l,Time=time(NULL); @@ -523,8 +521,7 @@ end: return(ret); } -static int ssl3_send_hello_request(s) -SSL *s; +static int ssl3_send_hello_request(SSL *s) { unsigned char *p; @@ -546,8 +543,7 @@ SSL *s; return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); } -static int ssl3_get_client_hello(s) -SSL *s; +static int ssl3_get_client_hello(SSL *s) { int i,j,ok,al,ret= -1; long n; @@ -814,8 +810,7 @@ err: return(ret); } -static int ssl3_send_server_hello(s) -SSL *s; +static int ssl3_send_server_hello(SSL *s) { unsigned char *buf; unsigned char *p,*d; @@ -881,8 +876,7 @@ SSL *s; return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); } -static int ssl3_send_server_done(s) -SSL *s; +static int ssl3_send_server_done(SSL *s) { unsigned char *p; @@ -906,8 +900,7 @@ SSL *s; return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); } -static int ssl3_send_server_key_exchange(s) -SSL *s; +static int ssl3_send_server_key_exchange(SSL *s) { #ifndef NO_RSA unsigned char *q; @@ -1131,8 +1124,7 @@ err: return(-1); } -static int ssl3_send_certificate_request(s) -SSL *s; +static int ssl3_send_certificate_request(SSL *s) { unsigned char *p,*d; int i,j,nl,off,n; @@ -1209,8 +1201,7 @@ err: return(-1); } -static int ssl3_get_client_key_exchange(s) -SSL *s; +static int ssl3_get_client_key_exchange(SSL *s) { int i,al,ok; long n; @@ -1416,8 +1407,7 @@ err: return(-1); } -static int ssl3_get_cert_verify(s) -SSL *s; +static int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey=NULL; unsigned char *p; @@ -1555,8 +1545,7 @@ end: return(ret); } -static int ssl3_get_client_certificate(s) -SSL *s; +static int ssl3_get_client_certificate(SSL *s) { int i,ok,al,ret= -1; X509 *x=NULL; @@ -1698,8 +1687,7 @@ err: return(ret); } -int ssl3_send_server_certificate(s) -SSL *s; +int ssl3_send_server_certificate(SSL *s) { unsigned long l; X509 *x; diff --git a/ssl/ssl_algs.c b/ssl/ssl_algs.c index 31809582bd..0c0e8da482 100644 --- a/ssl/ssl_algs.c +++ b/ssl/ssl_algs.c @@ -61,7 +61,7 @@ #include "lhash.h" #include "ssl_locl.h" -int SSL_library_init() +int SSL_library_init(void) { #ifndef NO_DES EVP_add_cipher(EVP_des_cbc()); diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index f4ba04a961..7454ba39ac 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -80,9 +80,7 @@ typedef struct ssl_session_asn1_st * SSLerr(SSL_F_D2I_SSL_SESSION,SSL_R_UNSUPPORTED_CIPHER); */ -int i2d_SSL_SESSION(in,pp) -SSL_SESSION *in; -unsigned char **pp; +int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) { #define LSIZE2 (sizeof(long)*2) int v1=0,v2=0,v3=0,v4=0; @@ -199,10 +197,8 @@ unsigned char **pp; M_ASN1_I2D_finish(); } -SSL_SESSION *d2i_SSL_SESSION(a,pp,length) -SSL_SESSION **a; -unsigned char **pp; -long length; +SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, unsigned char **pp, + long length) { int version,ssl_version=0,i; long id; diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 52812e9966..90eb769ea6 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -66,7 +66,7 @@ #include "pem.h" #include "ssl_locl.h" -int SSL_get_ex_data_X509_STORE_CTX_idx() +int SSL_get_ex_data_X509_STORE_CTX_idx(void) { static int ssl_x509_store_ctx_idx= -1; @@ -78,7 +78,7 @@ int SSL_get_ex_data_X509_STORE_CTX_idx() return(ssl_x509_store_ctx_idx); } -CERT *ssl_cert_new() +CERT *ssl_cert_new(void) { CERT *ret; @@ -207,8 +207,7 @@ int ssl_verify_cert_chain(SSL *s,STACK_OF(X509) *sk) return(i); } -static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list, - STACK_OF(X509_NAME) *list) +static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,STACK_OF(X509_NAME) *list) { if (*ca_list != NULL) sk_X509_NAME_pop_free(*ca_list,X509_NAME_free); diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 2b95ee6aff..b5d6f09969 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -159,13 +159,12 @@ static SSL_CIPHER cipher_aliases[]={ static int init_ciphers=1; static void load_ciphers(); -static int cmp_by_name(a,b) -SSL_CIPHER **a,**b; +static int cmp_by_name(SSL_CIPHER **a, SSL_CIPHER **b) { return(strcmp((*a)->name,(*b)->name)); } -static void load_ciphers() +static void load_ciphers(void) { init_ciphers=0; ssl_cipher_methods[SSL_ENC_DES_IDX]= @@ -185,11 +184,8 @@ static void load_ciphers() EVP_get_digestbyname(SN_sha1); } -int ssl_cipher_get_evp(s,enc,md,comp) -SSL_SESSION *s; -const EVP_CIPHER **enc; -const EVP_MD **md; -SSL_COMP **comp; +int ssl_cipher_get_evp(SSL_SESSION *s, const EVP_CIPHER **enc, + const EVP_MD **md, SSL_COMP **comp) { int i; SSL_CIPHER *c; @@ -282,8 +278,8 @@ SSL_COMP **comp; #define ITEM_SEP(a) \ (((a) == ':') || ((a) == ' ') || ((a) == ';') || ((a) == ',')) -static void ll_append_tail(head,curr,tail) -CIPHER_ORDER **head,*curr,**tail; +static void ll_append_tail(CIPHER_ORDER **head, CIPHER_ORDER *curr, + CIPHER_ORDER **tail) { if (curr == *tail) return; if (curr == *head) @@ -298,11 +294,10 @@ CIPHER_ORDER **head,*curr,**tail; *tail=curr; } -STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(ssl_method,cipher_list, - cipher_list_by_id,str) -SSL_METHOD *ssl_method; -STACK_OF(SSL_CIPHER) **cipher_list,**cipher_list_by_id; -char *str; +STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(SSL_METHOD *ssl_method, + STACK_OF(SSL_CIPHER) **cipher_list, + STACK_OF(SSL_CIPHER) **cipher_list_by_id, + char *str) { SSL_CIPHER *c; char *l; @@ -613,10 +608,7 @@ err: return(ok); } -char *SSL_CIPHER_description(cipher,buf,len) -SSL_CIPHER *cipher; -char *buf; -int len; +char *SSL_CIPHER_description(SSL_CIPHER *cipher, char *buf, int len) { int is_export,pkl,kl; char *ver,*exp; @@ -734,8 +726,7 @@ int len; return(buf); } -char *SSL_CIPHER_get_version(c) -SSL_CIPHER *c; +char *SSL_CIPHER_get_version(SSL_CIPHER *c) { int i; @@ -750,8 +741,7 @@ SSL_CIPHER *c; } /* return the actual cipher being used */ -const char *SSL_CIPHER_get_name(c) -SSL_CIPHER *c; +const char *SSL_CIPHER_get_name(SSL_CIPHER *c) { if (c != NULL) return(c->name); @@ -759,9 +749,7 @@ SSL_CIPHER *c; } /* number of bits for symetric cipher */ -int SSL_CIPHER_get_bits(c,alg_bits) -SSL_CIPHER *c; -int *alg_bits; +int SSL_CIPHER_get_bits(SSL_CIPHER *c, int *alg_bits) { int ret=0,a=0; const EVP_CIPHER *enc; @@ -794,9 +782,7 @@ int *alg_bits; return(ret); } -SSL_COMP *ssl3_comp_find(sk,n) -STACK_OF(SSL_COMP) *sk; -int n; +SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n) { SSL_COMP *ctmp; int i,nn; @@ -817,14 +803,12 @@ static int sk_comp_cmp(SSL_COMP **a,SSL_COMP **b) return((*a)->id-(*b)->id); } -STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods() +STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void) { return(ssl_comp_methods); } -int SSL_COMP_add_compression_method(id,cm) -int id; -COMP_METHOD *cm; +int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) { SSL_COMP *comp; STACK_OF(SSL_COMP) *sk; diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 4f8bd3652a..a9c2b6f66e 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -388,7 +388,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= #endif -void ERR_load_SSL_strings() +void ERR_load_SSL_strings(void) { static int init=1; diff --git a/ssl/ssl_err2.c b/ssl/ssl_err2.c index 0b91f7b8d2..dc8d038875 100644 --- a/ssl/ssl_err2.c +++ b/ssl/ssl_err2.c @@ -60,7 +60,7 @@ #include "err.h" #include "ssl.h" -void SSL_load_error_strings() +void SSL_load_error_strings(void) { #ifndef NO_ERR ERR_load_crypto_strings(); diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 2fad1c32c3..6479e38959 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1678,7 +1678,7 @@ void SSL_set_info_callback(SSL *ssl,void (*cb)()) ssl->info_callback=cb; } -void (*SSL_get_info_callback(SSL *ssl))() +void (*SSL_get_info_callback(SSL *ssl))(void) { return((void (*)())ssl->info_callback); } diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index 8579c51fc6..9d10831ca0 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -72,9 +72,7 @@ static int ssl_set_cert(); static int ssl_set_pkey(); #endif -int SSL_use_certificate(ssl, x) -SSL *ssl; -X509 *x; +int SSL_use_certificate(SSL *ssl, X509 *x) { if (x == NULL) { @@ -90,10 +88,7 @@ X509 *x; } #ifndef NO_STDIO -int SSL_use_certificate_file(ssl, file, type) -SSL *ssl; -char *file; -int type; +int SSL_use_certificate_file(SSL *ssl, char *file, int type) { int j; BIO *in; @@ -142,10 +137,7 @@ end: } #endif -int SSL_use_certificate_ASN1(ssl, d,len) -SSL *ssl; -unsigned char *d; -int len; +int SSL_use_certificate_ASN1(SSL *ssl, unsigned char *d, int len) { X509 *x; int ret; @@ -163,9 +155,7 @@ int len; } #ifndef NO_RSA -int SSL_use_RSAPrivateKey(ssl, rsa) -SSL *ssl; -RSA *rsa; +int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) { EVP_PKEY *pkey; int ret; @@ -195,9 +185,7 @@ RSA *rsa; } #endif -static int ssl_set_pkey(c,pkey) -CERT *c; -EVP_PKEY *pkey; +static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) { int i,ok=0,bad=0; @@ -271,10 +259,7 @@ EVP_PKEY *pkey; #ifndef NO_RSA #ifndef NO_STDIO -int SSL_use_RSAPrivateKey_file(ssl, file, type) -SSL *ssl; -char *file; -int type; +int SSL_use_RSAPrivateKey_file(SSL *ssl, char *file, int type) { int j,ret=0; BIO *in; @@ -321,10 +306,7 @@ end: } #endif -int SSL_use_RSAPrivateKey_ASN1(ssl,d,len) -SSL *ssl; -unsigned char *d; -long len; +int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len) { int ret; unsigned char *p; @@ -343,9 +325,7 @@ long len; } #endif /* !NO_RSA */ -int SSL_use_PrivateKey(ssl, pkey) -SSL *ssl; -EVP_PKEY *pkey; +int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) { int ret; @@ -364,10 +344,7 @@ EVP_PKEY *pkey; } #ifndef NO_STDIO -int SSL_use_PrivateKey_file(ssl, file, type) -SSL *ssl; -char *file; -int type; +int SSL_use_PrivateKey_file(SSL *ssl, char *file, int type) { int j,ret=0; BIO *in; @@ -409,11 +386,7 @@ end: } #endif -int SSL_use_PrivateKey_ASN1(type,ssl,d,len) -int type; -SSL *ssl; -unsigned char *d; -long len; +int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, unsigned char *d, long len) { int ret; unsigned char *p; @@ -431,9 +404,7 @@ long len; return(ret); } -int SSL_CTX_use_certificate(ctx, x) -SSL_CTX *ctx; -X509 *x; +int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) { if (x == NULL) { @@ -448,9 +419,7 @@ X509 *x; return(ssl_set_cert(ctx->default_cert,x)); } -static int ssl_set_cert(c,x) -CERT *c; -X509 *x; +static int ssl_set_cert(CERT *c, X509 *x) { EVP_PKEY *pkey; int i,ok=0,bad=0; @@ -531,10 +500,7 @@ X509 *x; } #ifndef NO_STDIO -int SSL_CTX_use_certificate_file(ctx, file, type) -SSL_CTX *ctx; -char *file; -int type; +int SSL_CTX_use_certificate_file(SSL_CTX *ctx, char *file, int type) { int j; BIO *in; @@ -583,10 +549,7 @@ end: } #endif -int SSL_CTX_use_certificate_ASN1(ctx, len, d) -SSL_CTX *ctx; -int len; -unsigned char *d; +int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, unsigned char *d) { X509 *x; int ret; @@ -604,9 +567,7 @@ unsigned char *d; } #ifndef NO_RSA -int SSL_CTX_use_RSAPrivateKey(ctx, rsa) -SSL_CTX *ctx; -RSA *rsa; +int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) { int ret; EVP_PKEY *pkey; @@ -636,10 +597,7 @@ RSA *rsa; } #ifndef NO_STDIO -int SSL_CTX_use_RSAPrivateKey_file(ctx, file, type) -SSL_CTX *ctx; -char *file; -int type; +int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, char *file, int type) { int j,ret=0; BIO *in; @@ -686,10 +644,7 @@ end: } #endif -int SSL_CTX_use_RSAPrivateKey_ASN1(ctx,d,len) -SSL_CTX *ctx; -unsigned char *d; -long len; +int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len) { int ret; unsigned char *p; @@ -708,9 +663,7 @@ long len; } #endif /* !NO_RSA */ -int SSL_CTX_use_PrivateKey(ctx, pkey) -SSL_CTX *ctx; -EVP_PKEY *pkey; +int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) { if (pkey == NULL) { @@ -726,10 +679,7 @@ EVP_PKEY *pkey; } #ifndef NO_STDIO -int SSL_CTX_use_PrivateKey_file(ctx, file, type) -SSL_CTX *ctx; -char *file; -int type; +int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, char *file, int type) { int j,ret=0; BIO *in; @@ -771,11 +721,8 @@ end: } #endif -int SSL_CTX_use_PrivateKey_ASN1(type,ctx,d,len) -int type; -SSL_CTX *ctx; -unsigned char *d; -long len; +int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, unsigned char *d, + long len) { int ret; unsigned char *p; diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 1eb40c0606..3422099ace 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -72,18 +72,13 @@ static void SSL_SESSION_list_add(); static int ssl_session_num=0; static STACK *ssl_session_meth=NULL; -SSL_SESSION *SSL_get_session(ssl) -SSL *ssl; +SSL_SESSION *SSL_get_session(SSL *ssl) { return(ssl->session); } -int SSL_SESSION_get_ex_new_index(argl,argp,new_func,dup_func,free_func) -long argl; -char *argp; -int (*new_func)(); -int (*dup_func)(); -void (*free_func)(); +int SSL_SESSION_get_ex_new_index(long argl, char *argp, int (*new_func)(), + int (*dup_func)(), void (*free_func)()) { ssl_session_num++; return(CRYPTO_get_ex_new_index(ssl_session_num-1, @@ -91,22 +86,17 @@ void (*free_func)(); argl,argp,new_func,dup_func,free_func)); } -int SSL_SESSION_set_ex_data(s,idx,arg) -SSL_SESSION *s; -int idx; -void *arg; +int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, void *arg) { return(CRYPTO_set_ex_data(&s->ex_data,idx,arg)); } -void *SSL_SESSION_get_ex_data(s,idx) -SSL_SESSION *s; -int idx; +void *SSL_SESSION_get_ex_data(SSL_SESSION *s, int idx) { return(CRYPTO_get_ex_data(&s->ex_data,idx)); } -SSL_SESSION *SSL_SESSION_new() +SSL_SESSION *SSL_SESSION_new(void) { SSL_SESSION *ss; @@ -128,9 +118,7 @@ SSL_SESSION *SSL_SESSION_new() return(ss); } -int ssl_get_new_session(s, session) -SSL *s; -int session; +int ssl_get_new_session(SSL *s, int session) { SSL_SESSION *ss=NULL; @@ -198,10 +186,7 @@ int session; return(1); } -int ssl_get_prev_session(s,session_id,len) -SSL *s; -unsigned char *session_id; -int len; +int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len) { SSL_SESSION *ret=NULL,data; int copy=1; @@ -292,9 +277,7 @@ int len; return(1); } -int SSL_CTX_add_session(ctx,c) -SSL_CTX *ctx; -SSL_SESSION *c; +int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c) { int ret=0; SSL_SESSION *s; @@ -339,9 +322,7 @@ SSL_SESSION *c; return(ret); } -int SSL_CTX_remove_session(ctx,c) -SSL_CTX *ctx; -SSL_SESSION *c; +int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c) { SSL_SESSION *r; int ret=0; @@ -371,8 +352,7 @@ SSL_SESSION *c; return(ret); } -void SSL_SESSION_free(ss) -SSL_SESSION *ss; +void SSL_SESSION_free(SSL_SESSION *ss) { int i; @@ -404,9 +384,7 @@ SSL_SESSION *ss; Free(ss); } -int SSL_set_session(s, session) -SSL *s; -SSL_SESSION *session; +int SSL_set_session(SSL *s, SSL_SESSION *session) { int ret=0; SSL_METHOD *meth; @@ -459,41 +437,33 @@ SSL_SESSION *session; return(ret); } -long SSL_SESSION_set_timeout(s,t) -SSL_SESSION *s; -long t; +long SSL_SESSION_set_timeout(SSL_SESSION *s, long t) { if (s == NULL) return(0); s->timeout=t; return(1); } -long SSL_SESSION_get_timeout(s) -SSL_SESSION *s; +long SSL_SESSION_get_timeout(SSL_SESSION *s) { if (s == NULL) return(0); return(s->timeout); } -long SSL_SESSION_get_time(s) -SSL_SESSION *s; +long SSL_SESSION_get_time(SSL_SESSION *s) { if (s == NULL) return(0); return(s->time); } -long SSL_SESSION_set_time(s,t) -SSL_SESSION *s; -long t; +long SSL_SESSION_set_time(SSL_SESSION *s, long t) { if (s == NULL) return(0); s->time=t; return(t); } -long SSL_CTX_set_timeout(s,t) -SSL_CTX *s; -long t; +long SSL_CTX_set_timeout(SSL_CTX *s, long t) { long l; if (s == NULL) return(0); @@ -502,8 +472,7 @@ long t; return(l); } -long SSL_CTX_get_timeout(s) -SSL_CTX *s; +long SSL_CTX_get_timeout(SSL_CTX *s) { if (s == NULL) return(0); return(s->session_timeout); @@ -516,9 +485,7 @@ typedef struct timeout_param_st LHASH *cache; } TIMEOUT_PARAM; -static void timeout(s,p) -SSL_SESSION *s; -TIMEOUT_PARAM *p; +static void timeout(SSL_SESSION *s, TIMEOUT_PARAM *p) { if ((p->time == 0) || (p->time > (s->time+s->timeout))) /* timeout */ { @@ -533,9 +500,7 @@ TIMEOUT_PARAM *p; } } -void SSL_CTX_flush_sessions(s,t) -SSL_CTX *s; -long t; +void SSL_CTX_flush_sessions(SSL_CTX *s, long t) { unsigned long i; TIMEOUT_PARAM tp; @@ -552,8 +517,7 @@ long t; CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX); } -int ssl_clear_bad_session(s) -SSL *s; +int ssl_clear_bad_session(SSL *s) { if ( (s->session != NULL) && !(s->shutdown & SSL_SENT_SHUTDOWN) && @@ -567,9 +531,7 @@ SSL *s; } /* locked by SSL_CTX in the calling function */ -static void SSL_SESSION_list_remove(ctx,s) -SSL_CTX *ctx; -SSL_SESSION *s; +static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s) { if ((s->next == NULL) || (s->prev == NULL)) return; @@ -602,9 +564,7 @@ SSL_SESSION *s; s->prev=s->next=NULL; } -static void SSL_SESSION_list_add(ctx,s) -SSL_CTX *ctx; -SSL_SESSION *s; +static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *s) { if ((s->next != NULL) && (s->prev != NULL)) SSL_SESSION_list_remove(ctx,s); diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c index 1401ae724a..14f58dbdfd 100644 --- a/ssl/ssl_stat.c +++ b/ssl/ssl_stat.c @@ -59,8 +59,7 @@ #include #include "ssl_locl.h" -char *SSL_state_string_long(s) -SSL *s; +char *SSL_state_string_long(SSL *s) { char *str; @@ -198,8 +197,7 @@ default: str="unknown state"; break; return(str); } -char *SSL_rstate_string_long(s) -SSL *s; +char *SSL_rstate_string_long(SSL *s) { char *str; @@ -213,8 +211,7 @@ SSL *s; return(str); } -char *SSL_state_string(s) -SSL *s; +char *SSL_state_string(SSL *s) { char *str; @@ -346,8 +343,7 @@ default: str="UNKWN "; break; return(str); } -char *SSL_alert_type_string_long(value) -int value; +char *SSL_alert_type_string_long(int value) { value>>=8; if (value == SSL3_AL_WARNING) @@ -358,8 +354,7 @@ int value; return("unknown"); } -char *SSL_alert_type_string(value) -int value; +char *SSL_alert_type_string(int value) { value>>=8; if (value == SSL3_AL_WARNING) @@ -370,8 +365,7 @@ int value; return("U"); } -char *SSL_alert_desc_string(value) -int value; +char *SSL_alert_desc_string(int value) { char *str; @@ -394,8 +388,7 @@ int value; return(str); } -char *SSL_alert_desc_string_long(value) -int value; +char *SSL_alert_desc_string_long(int value) { char *str; @@ -442,8 +435,7 @@ int value; return(str); } -char *SSL_rstate_string(s) -SSL *s; +char *SSL_rstate_string(SSL *s) { char *str; diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c index 22fbb5f55b..c1b2a8652a 100644 --- a/ssl/ssl_txt.c +++ b/ssl/ssl_txt.c @@ -61,9 +61,7 @@ #include "ssl_locl.h" #ifndef NO_FP_API -int SSL_SESSION_print_fp(fp, x) -FILE *fp; -SSL_SESSION *x; +int SSL_SESSION_print_fp(FILE *fp, SSL_SESSION *x) { BIO *b; int ret; @@ -80,9 +78,7 @@ SSL_SESSION *x; } #endif -int SSL_SESSION_print(bp,x) -BIO *bp; -SSL_SESSION *x; +int SSL_SESSION_print(BIO *bp, SSL_SESSION *x) { unsigned int i; char str[128],*s; diff --git a/ssl/ssltest.c b/ssl/ssltest.c index 720abfa01e..ef80d42990 100644 --- a/ssl/ssltest.c +++ b/ssl/ssltest.c @@ -104,7 +104,7 @@ int doit(SSL *s_ssl,SSL *c_ssl,long bytes); int doit(); #endif -static void sv_usage() +static void sv_usage(void) { fprintf(stderr,"usage: ssltest [args ...]\n"); fprintf(stderr,"\n"); @@ -132,9 +132,7 @@ static void sv_usage() fprintf(stderr," -cipher arg - The cipher list\n"); } -int main(argc, argv) -int argc; -char *argv[]; +int main(int argc, char *argv[]) { char *CApath=NULL,*CAfile=NULL; int badop=0; @@ -373,9 +371,7 @@ end: #define C_DONE 1 #define S_DONE 2 -int doit(s_ssl,c_ssl,count) -SSL *s_ssl,*c_ssl; -long count; +int doit(SSL *s_ssl, SSL *c_ssl, long count) { MS_STATIC char cbuf[1024*8],sbuf[1024*8]; long cw_num=count,cr_num=count; @@ -674,9 +670,7 @@ err: return(ret); } -int MS_CALLBACK verify_callback(ok, ctx) -int ok; -X509_STORE_CTX *ctx; +int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx) { char *s,buf[256]; @@ -717,7 +711,7 @@ static unsigned char dh512_g[]={ 0x02, }; -static DH *get_dh512() +static DH *get_dh512(void) { DH *dh=NULL; @@ -730,10 +724,7 @@ static DH *get_dh512() } #endif -static RSA MS_CALLBACK *tmp_rsa_cb(s,export,keylength) -SSL *s; -int export; -int keylength; +static RSA MS_CALLBACK *tmp_rsa_cb(SSL *s, int export, int keylength) { static RSA *rsa_tmp=NULL; diff --git a/ssl/t1_clnt.c b/ssl/t1_clnt.c index 1a179221e7..3cc03e3887 100644 --- a/ssl/t1_clnt.c +++ b/ssl/t1_clnt.c @@ -69,8 +69,7 @@ static SSL_METHOD *tls1_get_client_method(int ver); static SSL_METHOD *tls1_get_client_method(); #endif -static SSL_METHOD *tls1_get_client_method(ver) -int ver; +static SSL_METHOD *tls1_get_client_method(int ver) { if (ver == TLS1_VERSION) return(TLSv1_client_method()); @@ -78,7 +77,7 @@ int ver; return(NULL); } -SSL_METHOD *TLSv1_client_method() +SSL_METHOD *TLSv1_client_method(void) { static int init=1; static SSL_METHOD TLSv1_client_data; diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 4e783c23a4..235205b676 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -62,14 +62,8 @@ #include "hmac.h" #include "ssl_locl.h" -static void tls1_P_hash(md,sec,sec_len,seed,seed_len,out,olen) -EVP_MD *md; -unsigned char *sec; -int sec_len; -unsigned char *seed; -int seed_len; -unsigned char *out; -int olen; +static void tls1_P_hash(EVP_MD *md, unsigned char *sec, int sec_len, + unsigned char *seed, int seed_len, unsigned char *out, int olen) { int chunk,n; unsigned int j; @@ -111,16 +105,9 @@ int olen; memset(A1,0,sizeof(A1)); } -static void tls1_PRF(md5,sha1,label,label_len,sec,slen,out1,out2,olen) -EVP_MD *md5; -EVP_MD *sha1; -unsigned char *label; -int label_len; -unsigned char *sec; -int slen; -unsigned char *out1; -unsigned char *out2; -int olen; +static void tls1_PRF(EVP_MD *md5, EVP_MD *sha1, unsigned char *label, + int label_len, unsigned char *sec, int slen, unsigned char *out1, + unsigned char *out2, int olen) { int len,i; unsigned char *S1,*S2; @@ -138,10 +125,8 @@ int olen; out1[i]^=out2[i]; } -static void tls1_generate_key_block(s,km,tmp,num) -SSL *s; -unsigned char *km,*tmp; -int num; +static void tls1_generate_key_block(SSL *s, unsigned char *km, + unsigned char *tmp, int num) { unsigned char *p; unsigned char buf[SSL3_RANDOM_SIZE*2+ @@ -161,9 +146,7 @@ int num; km,tmp,num); } -int tls1_change_cipher_state(s,which) -SSL *s; -int which; +int tls1_change_cipher_state(SSL *s, int which) { unsigned char *p,*key_block,*mac_secret; unsigned char *exp_label,buf[TLS_MD_MAX_CONST_SIZE+ @@ -342,8 +325,7 @@ err2: return(0); } -int tls1_setup_key_block(s) -SSL *s; +int tls1_setup_key_block(SSL *s) { unsigned char *p1,*p2; const EVP_CIPHER *c; @@ -399,9 +381,7 @@ err: return(0); } -int tls1_enc(s,send) -SSL *s; -int send; +int tls1_enc(SSL *s, int send) { SSL3_RECORD *rec; EVP_CIPHER_CTX *ds; @@ -498,10 +478,7 @@ int send; return(1); } -int tls1_cert_verify_mac(s,in_ctx,out) -SSL *s; -EVP_MD_CTX *in_ctx; -unsigned char *out; +int tls1_cert_verify_mac(SSL *s, EVP_MD_CTX *in_ctx, unsigned char *out) { unsigned int ret; EVP_MD_CTX ctx; @@ -511,12 +488,8 @@ unsigned char *out; return((int)ret); } -int tls1_final_finish_mac(s,in1_ctx,in2_ctx,str,slen,out) -SSL *s; -EVP_MD_CTX *in1_ctx,*in2_ctx; -unsigned char *str; -int slen; -unsigned char *out; +int tls1_final_finish_mac(SSL *s, EVP_MD_CTX *in1_ctx, EVP_MD_CTX *in2_ctx, + unsigned char *str, int slen, unsigned char *out) { unsigned int i; EVP_MD_CTX ctx; @@ -542,10 +515,7 @@ unsigned char *out; return((int)12); } -int tls1_mac(ssl,md,send) -SSL *ssl; -unsigned char *md; -int send; +int tls1_mac(SSL *ssl, unsigned char *md, int send) { SSL3_RECORD *rec; unsigned char *mac_sec,*seq; @@ -605,11 +575,8 @@ printf("rec="); return(md_size); } -int tls1_generate_master_secret(s,out,p,len) -SSL *s; -unsigned char *out; -unsigned char *p; -int len; +int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, + int len) { unsigned char buf[SSL3_RANDOM_SIZE*2+TLS_MD_MASTER_SECRET_CONST_SIZE]; unsigned char buff[SSL_MAX_MASTER_KEY_LENGTH]; @@ -627,8 +594,7 @@ int len; return(SSL3_MASTER_SECRET_SIZE); } -int tls1_alert_code(code) -int code; +int tls1_alert_code(int code) { switch (code) { diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 4534403d22..746ef7edff 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -107,45 +107,38 @@ static SSL_METHOD TLSv1_data= { &TLSv1_enc_data, }; -static long tls1_default_timeout() +static long tls1_default_timeout(void) { /* 2 hours, the 24 hours mentioned in the TLSv1 spec * is way too long for http, the cache would over fill */ return(60*60*2); } -SSL_METHOD *tlsv1_base_method() +SSL_METHOD *tlsv1_base_method(void) { return(&TLSv1_data); } -int tls1_new(s) -SSL *s; +int tls1_new(SSL *s) { if (!ssl3_new(s)) return(0); s->method->ssl_clear(s); return(1); } -void tls1_free(s) -SSL *s; +void tls1_free(SSL *s) { ssl3_free(s); } -void tls1_clear(s) -SSL *s; +void tls1_clear(SSL *s) { ssl3_clear(s); s->version=TLS1_VERSION; } #if 0 -long tls1_ctrl(s,cmd,larg,parg) -SSL *s; -int cmd; -long larg; -char *parg; +long tls1_ctrl(SSL *s, int cmd, long larg, char *parg) { return(0); } diff --git a/ssl/t1_meth.c b/ssl/t1_meth.c index d64b5f4e67..fb065d2c94 100644 --- a/ssl/t1_meth.c +++ b/ssl/t1_meth.c @@ -66,8 +66,7 @@ static SSL_METHOD *tls1_get_method(int ver); static SSL_METHOD *tls1_get_method(); #endif -static SSL_METHOD *tls1_get_method(ver) -int ver; +static SSL_METHOD *tls1_get_method(int ver) { if (ver == TLS1_VERSION) return(TLSv1_method()); @@ -75,7 +74,7 @@ int ver; return(NULL); } -SSL_METHOD *TLSv1_method() +SSL_METHOD *TLSv1_method(void) { static int init=1; static SSL_METHOD TLSv1_data; diff --git a/ssl/t1_srvr.c b/ssl/t1_srvr.c index 8b18572fb0..5603879284 100644 --- a/ssl/t1_srvr.c +++ b/ssl/t1_srvr.c @@ -70,8 +70,7 @@ static SSL_METHOD *tls1_get_server_method(int ver); static SSL_METHOD *tls1_get_server_method(); #endif -static SSL_METHOD *tls1_get_server_method(ver) -int ver; +static SSL_METHOD *tls1_get_server_method(int ver) { if (ver == TLS1_VERSION) return(TLSv1_server_method()); @@ -79,7 +78,7 @@ int ver; return(NULL); } -SSL_METHOD *TLSv1_server_method() +SSL_METHOD *TLSv1_server_method(void) { static int init=1; static SSL_METHOD TLSv1_server_data; -- 2.25.1