Run util/openssl-format-source -v -c .
authorMatt Caswell <matt@openssl.org>
Thu, 22 Jan 2015 03:29:12 +0000 (03:29 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 22 Jan 2015 09:31:38 +0000 (09:31 +0000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
1086 files changed:
MacOS/GetHTTPS.src/MacSocket.h
MacOS/Randomizer.h
MacOS/_MWERKS_GUSI_prefix.h
MacOS/_MWERKS_prefix.h
MacOS/buildinf.h
MacOS/opensslconf.h
apps/app_rand.c
apps/apps.c
apps/apps.h
apps/asn1pars.c
apps/ca.c
apps/ciphers.c
apps/cms.c
apps/crl.c
apps/crl2p7.c
apps/dgst.c
apps/dh.c
apps/dhparam.c
apps/dsa.c
apps/dsaparam.c
apps/ec.c
apps/ecparam.c
apps/enc.c
apps/engine.c
apps/errstr.c
apps/gendh.c
apps/gendsa.c
apps/genpkey.c
apps/genrsa.c
apps/nseq.c
apps/ocsp.c
apps/openssl.c
apps/passwd.c
apps/pkcs12.c
apps/pkcs7.c
apps/pkcs8.c
apps/pkey.c
apps/pkeyparam.c
apps/pkeyutl.c
apps/prime.c
apps/progs.h
apps/rand.c
apps/req.c
apps/rsa.c
apps/rsautl.c
apps/s_apps.h
apps/s_cb.c
apps/s_client.c
apps/s_server.c
apps/s_socket.c
apps/s_time.c
apps/sess_id.c
apps/smime.c
apps/speed.c
apps/spkac.c
apps/srp.c
apps/testdsa.h
apps/testrsa.h
apps/timeouts.h
apps/ts.c
apps/verify.c
apps/version.c
apps/vms_decc_init.c [changed mode: 0755->0644]
apps/winrand.c
apps/x509.c
bugs/alpha.c
bugs/dggccbug.c
bugs/sgiccbug.c
bugs/stream.c
bugs/ultrixcc.c
crypto/LPdir_nyi.c
crypto/LPdir_unix.c
crypto/LPdir_vms.c
crypto/LPdir_win.c
crypto/LPdir_win32.c
crypto/LPdir_wince.c
crypto/aes/aes.h
crypto/aes/aes_cbc.c
crypto/aes/aes_cfb.c
crypto/aes/aes_ctr.c
crypto/aes/aes_ecb.c
crypto/aes/aes_ige.c
crypto/aes/aes_locl.h
crypto/aes/aes_misc.c
crypto/aes/aes_ofb.c
crypto/aes/aes_wrap.c
crypto/arm_arch.h
crypto/armcap.c
crypto/asn1/a_bitstr.c
crypto/asn1/a_bool.c
crypto/asn1/a_bytes.c
crypto/asn1/a_d2i_fp.c
crypto/asn1/a_digest.c
crypto/asn1/a_dup.c
crypto/asn1/a_enum.c
crypto/asn1/a_gentm.c
crypto/asn1/a_i2d_fp.c
crypto/asn1/a_int.c
crypto/asn1/a_mbstr.c
crypto/asn1/a_object.c
crypto/asn1/a_octet.c
crypto/asn1/a_print.c
crypto/asn1/a_set.c
crypto/asn1/a_sign.c
crypto/asn1/a_strex.c
crypto/asn1/a_strnid.c
crypto/asn1/a_time.c
crypto/asn1/a_type.c
crypto/asn1/a_utctm.c
crypto/asn1/a_utf8.c
crypto/asn1/a_verify.c
crypto/asn1/ameth_lib.c
crypto/asn1/asn1.h
crypto/asn1/asn1_err.c
crypto/asn1/asn1_gen.c
crypto/asn1/asn1_lib.c
crypto/asn1/asn1_locl.h
crypto/asn1/asn1_mac.h
crypto/asn1/asn1_par.c
crypto/asn1/asn1t.h
crypto/asn1/asn_mime.c
crypto/asn1/asn_moid.c
crypto/asn1/asn_pack.c
crypto/asn1/bio_asn1.c
crypto/asn1/bio_ndef.c
crypto/asn1/charmap.h
crypto/asn1/d2i_pr.c
crypto/asn1/d2i_pu.c
crypto/asn1/evp_asn1.c
crypto/asn1/f_enum.c
crypto/asn1/f_int.c
crypto/asn1/f_string.c
crypto/asn1/i2d_pr.c
crypto/asn1/i2d_pu.c
crypto/asn1/n_pkey.c
crypto/asn1/nsseq.c
crypto/asn1/p5_pbe.c
crypto/asn1/p5_pbev2.c
crypto/asn1/p8_pkey.c
crypto/asn1/t_bitst.c
crypto/asn1/t_crl.c
crypto/asn1/t_pkey.c
crypto/asn1/t_req.c
crypto/asn1/t_spki.c
crypto/asn1/t_x509.c
crypto/asn1/t_x509a.c
crypto/asn1/tasn_dec.c
crypto/asn1/tasn_enc.c
crypto/asn1/tasn_fre.c
crypto/asn1/tasn_new.c
crypto/asn1/tasn_prn.c
crypto/asn1/tasn_typ.c
crypto/asn1/tasn_utl.c
crypto/asn1/x_algor.c
crypto/asn1/x_attrib.c
crypto/asn1/x_bignum.c
crypto/asn1/x_crl.c
crypto/asn1/x_exten.c
crypto/asn1/x_info.c
crypto/asn1/x_long.c
crypto/asn1/x_name.c
crypto/asn1/x_nx509.c
crypto/asn1/x_pkey.c
crypto/asn1/x_pubkey.c
crypto/asn1/x_req.c
crypto/asn1/x_sig.c
crypto/asn1/x_spki.c
crypto/asn1/x_val.c
crypto/asn1/x_x509.c
crypto/asn1/x_x509a.c
crypto/bf/bf_cbc.c
crypto/bf/bf_cfb64.c
crypto/bf/bf_ecb.c
crypto/bf/bf_enc.c
crypto/bf/bf_locl.h
crypto/bf/bf_ofb64.c
crypto/bf/bf_opts.c
crypto/bf/bf_pi.h
crypto/bf/bf_skey.c
crypto/bf/bfspeed.c
crypto/bf/bftest.c
crypto/bf/blowfish.h
crypto/bio/b_dump.c
crypto/bio/b_print.c
crypto/bio/b_sock.c
crypto/bio/bf_buff.c
crypto/bio/bf_lbuf.c
crypto/bio/bf_nbio.c
crypto/bio/bf_null.c
crypto/bio/bio.h
crypto/bio/bio_cb.c
crypto/bio/bio_err.c
crypto/bio/bio_lcl.h
crypto/bio/bio_lib.c
crypto/bio/bss_acpt.c
crypto/bio/bss_bio.c
crypto/bio/bss_conn.c
crypto/bio/bss_dgram.c
crypto/bio/bss_fd.c
crypto/bio/bss_file.c
crypto/bio/bss_log.c
crypto/bio/bss_mem.c
crypto/bio/bss_null.c
crypto/bio/bss_rtcp.c
crypto/bio/bss_sock.c
crypto/bn/asm/x86_64-gcc.c
crypto/bn/bn.h
crypto/bn/bn_add.c
crypto/bn/bn_asm.c
crypto/bn/bn_blind.c
crypto/bn/bn_const.c
crypto/bn/bn_ctx.c
crypto/bn/bn_depr.c
crypto/bn/bn_div.c
crypto/bn/bn_err.c
crypto/bn/bn_exp.c
crypto/bn/bn_exp2.c
crypto/bn/bn_gcd.c
crypto/bn/bn_gf2m.c
crypto/bn/bn_kron.c
crypto/bn/bn_lcl.h
crypto/bn/bn_lib.c
crypto/bn/bn_mod.c
crypto/bn/bn_mont.c
crypto/bn/bn_mpi.c
crypto/bn/bn_mul.c
crypto/bn/bn_nist.c
crypto/bn/bn_prime.c
crypto/bn/bn_prime.h
crypto/bn/bn_print.c
crypto/bn/bn_rand.c
crypto/bn/bn_recp.c
crypto/bn/bn_shift.c
crypto/bn/bn_sqr.c
crypto/bn/bn_sqrt.c
crypto/bn/bn_word.c
crypto/bn/bn_x931p.c
crypto/bn/bnspeed.c
crypto/bn/bntest.c
crypto/bn/divtest.c
crypto/bn/exp.c
crypto/bn/expspeed.c
crypto/bn/exptest.c
crypto/bn/rsaz_exp.c
crypto/bn/rsaz_exp.h
crypto/bn/vms-helper.c
crypto/buffer/buf_err.c
crypto/buffer/buf_str.c
crypto/buffer/buffer.c
crypto/buffer/buffer.h
crypto/camellia/camellia.c
crypto/camellia/camellia.h
crypto/camellia/cmll_cbc.c
crypto/camellia/cmll_cfb.c
crypto/camellia/cmll_ctr.c
crypto/camellia/cmll_ecb.c
crypto/camellia/cmll_locl.h
crypto/camellia/cmll_misc.c
crypto/camellia/cmll_ofb.c
crypto/camellia/cmll_utl.c
crypto/cast/c_cfb64.c
crypto/cast/c_ecb.c
crypto/cast/c_enc.c
crypto/cast/c_ofb64.c
crypto/cast/c_skey.c
crypto/cast/cast.h
crypto/cast/cast_lcl.h
crypto/cast/cast_s.h
crypto/cast/cast_spd.c
crypto/cast/castopts.c
crypto/cast/casttest.c
crypto/cmac/cm_ameth.c
crypto/cmac/cm_pmeth.c
crypto/cmac/cmac.c
crypto/cmac/cmac.h
crypto/cms/cms.h
crypto/cms/cms_asn1.c
crypto/cms/cms_att.c
crypto/cms/cms_cd.c
crypto/cms/cms_dd.c
crypto/cms/cms_enc.c
crypto/cms/cms_env.c
crypto/cms/cms_err.c
crypto/cms/cms_ess.c
crypto/cms/cms_io.c
crypto/cms/cms_kari.c
crypto/cms/cms_lcl.h
crypto/cms/cms_lib.c
crypto/cms/cms_pwri.c
crypto/cms/cms_sd.c
crypto/cms/cms_smime.c
crypto/comp/c_rle.c
crypto/comp/c_zlib.c
crypto/comp/comp.h
crypto/comp/comp_err.c
crypto/comp/comp_lib.c
crypto/conf/cnf_save.c
crypto/conf/conf.h
crypto/conf/conf_api.c
crypto/conf/conf_api.h
crypto/conf/conf_def.c
crypto/conf/conf_def.h
crypto/conf/conf_err.c
crypto/conf/conf_lib.c
crypto/conf/conf_mall.c
crypto/conf/conf_mod.c
crypto/conf/conf_sap.c
crypto/conf/test.c
crypto/constant_time_locl.h
crypto/constant_time_test.c
crypto/cpt_err.c
crypto/cryptlib.c
crypto/cryptlib.h
crypto/crypto.h
crypto/cversion.c
crypto/des/cbc3_enc.c
crypto/des/cbc_cksm.c
crypto/des/cbc_enc.c
crypto/des/cfb64ede.c
crypto/des/cfb64enc.c
crypto/des/cfb_enc.c
crypto/des/des.c
crypto/des/des.h
crypto/des/des_enc.c
crypto/des/des_locl.h
crypto/des/des_old.c
crypto/des/des_old.h
crypto/des/des_old2.c
crypto/des/des_opts.c
crypto/des/des_ver.h
crypto/des/destest.c
crypto/des/ecb3_enc.c
crypto/des/ecb_enc.c
crypto/des/ede_cbcm_enc.c
crypto/des/enc_read.c
crypto/des/enc_writ.c
crypto/des/fcrypt.c
crypto/des/fcrypt_b.c
crypto/des/ncbc_enc.c
crypto/des/ofb64ede.c
crypto/des/ofb64enc.c
crypto/des/ofb_enc.c
crypto/des/pcbc_enc.c
crypto/des/qud_cksm.c
crypto/des/rand_key.c
crypto/des/read2pwd.c
crypto/des/read_pwd.c
crypto/des/rpc_des.h
crypto/des/rpc_enc.c
crypto/des/rpw.c
crypto/des/set_key.c
crypto/des/speed.c
crypto/des/spr.h
crypto/des/str2key.c
crypto/des/xcbc_enc.c
crypto/dh/dh.h
crypto/dh/dh_ameth.c
crypto/dh/dh_asn1.c
crypto/dh/dh_check.c
crypto/dh/dh_depr.c
crypto/dh/dh_err.c
crypto/dh/dh_gen.c
crypto/dh/dh_kdf.c
crypto/dh/dh_key.c
crypto/dh/dh_lib.c
crypto/dh/dh_pmeth.c
crypto/dh/dh_prn.c
crypto/dh/dh_rfc5114.c
crypto/dh/dhtest.c
crypto/dh/p1024.c
crypto/dh/p192.c
crypto/dh/p512.c
crypto/dsa/dsa.h
crypto/dsa/dsa_ameth.c
crypto/dsa/dsa_asn1.c
crypto/dsa/dsa_depr.c
crypto/dsa/dsa_err.c
crypto/dsa/dsa_gen.c
crypto/dsa/dsa_key.c
crypto/dsa/dsa_lib.c
crypto/dsa/dsa_locl.h
crypto/dsa/dsa_ossl.c
crypto/dsa/dsa_pmeth.c
crypto/dsa/dsa_prn.c
crypto/dsa/dsa_sign.c
crypto/dsa/dsa_vrf.c
crypto/dsa/dsagen.c
crypto/dsa/dsatest.c
crypto/dso/dso.h
crypto/dso/dso_beos.c
crypto/dso/dso_dl.c
crypto/dso/dso_dlfcn.c
crypto/dso/dso_err.c
crypto/dso/dso_lib.c
crypto/dso/dso_null.c
crypto/dso/dso_openssl.c
crypto/dso/dso_vms.c
crypto/dso/dso_win32.c
crypto/ebcdic.c
crypto/ebcdic.h
crypto/ec/ec.h
crypto/ec/ec2_mult.c
crypto/ec/ec2_oct.c
crypto/ec/ec2_smpl.c
crypto/ec/ec_ameth.c
crypto/ec/ec_asn1.c
crypto/ec/ec_check.c
crypto/ec/ec_curve.c
crypto/ec/ec_cvt.c
crypto/ec/ec_err.c
crypto/ec/ec_key.c
crypto/ec/ec_lcl.h
crypto/ec/ec_lib.c
crypto/ec/ec_mult.c
crypto/ec/ec_oct.c
crypto/ec/ec_pmeth.c
crypto/ec/ec_print.c
crypto/ec/eck_prn.c
crypto/ec/ecp_mont.c
crypto/ec/ecp_nist.c
crypto/ec/ecp_nistp224.c
crypto/ec/ecp_nistp256.c
crypto/ec/ecp_nistp521.c
crypto/ec/ecp_nistputil.c
crypto/ec/ecp_nistz256_table.c
crypto/ec/ecp_oct.c
crypto/ec/ecp_smpl.c
crypto/ec/ectest.c
crypto/ecdh/ecdh.h
crypto/ecdh/ecdhtest.c
crypto/ecdh/ech_err.c
crypto/ecdh/ech_kdf.c
crypto/ecdh/ech_key.c
crypto/ecdh/ech_lib.c
crypto/ecdh/ech_locl.h
crypto/ecdh/ech_ossl.c
crypto/ecdsa/ecdsa.h
crypto/ecdsa/ecdsatest.c
crypto/ecdsa/ecs_asn1.c
crypto/ecdsa/ecs_err.c
crypto/ecdsa/ecs_lib.c
crypto/ecdsa/ecs_locl.h
crypto/ecdsa/ecs_ossl.c
crypto/ecdsa/ecs_sign.c
crypto/ecdsa/ecs_vrf.c
crypto/engine/eng_all.c
crypto/engine/eng_cnf.c
crypto/engine/eng_cryptodev.c
crypto/engine/eng_ctrl.c
crypto/engine/eng_dyn.c
crypto/engine/eng_err.c
crypto/engine/eng_fat.c
crypto/engine/eng_init.c
crypto/engine/eng_int.h
crypto/engine/eng_lib.c
crypto/engine/eng_list.c
crypto/engine/eng_openssl.c
crypto/engine/eng_pkey.c
crypto/engine/eng_rdrand.c
crypto/engine/eng_rsax.c
crypto/engine/eng_table.c
crypto/engine/engine.h
crypto/engine/enginetest.c
crypto/engine/tb_asnmth.c
crypto/engine/tb_cipher.c
crypto/engine/tb_dh.c
crypto/engine/tb_digest.c
crypto/engine/tb_dsa.c
crypto/engine/tb_ecdh.c
crypto/engine/tb_ecdsa.c
crypto/engine/tb_pkmeth.c
crypto/engine/tb_rand.c
crypto/engine/tb_rsa.c
crypto/engine/tb_store.c
crypto/err/err.c
crypto/err/err.h
crypto/err/err_all.c
crypto/err/err_prn.c
crypto/evp/bio_b64.c
crypto/evp/bio_enc.c
crypto/evp/bio_md.c
crypto/evp/bio_ok.c
crypto/evp/c_all.c
crypto/evp/c_allc.c
crypto/evp/c_alld.c
crypto/evp/digest.c
crypto/evp/e_aes.c
crypto/evp/e_aes_cbc_hmac_sha1.c
crypto/evp/e_aes_cbc_hmac_sha256.c
crypto/evp/e_bf.c
crypto/evp/e_camellia.c
crypto/evp/e_cast.c
crypto/evp/e_des.c
crypto/evp/e_des3.c
crypto/evp/e_dsa.c
crypto/evp/e_idea.c
crypto/evp/e_null.c
crypto/evp/e_old.c
crypto/evp/e_rc2.c
crypto/evp/e_rc4.c
crypto/evp/e_rc4_hmac_md5.c
crypto/evp/e_rc5.c
crypto/evp/e_seed.c
crypto/evp/e_xcbc_d.c
crypto/evp/encode.c
crypto/evp/evp.h
crypto/evp/evp_acnf.c
crypto/evp/evp_cnf.c
crypto/evp/evp_enc.c
crypto/evp/evp_err.c
crypto/evp/evp_key.c
crypto/evp/evp_lib.c
crypto/evp/evp_locl.h
crypto/evp/evp_pbe.c
crypto/evp/evp_pkey.c
crypto/evp/evp_test.c
crypto/evp/m_dss.c
crypto/evp/m_dss1.c
crypto/evp/m_ecdsa.c
crypto/evp/m_md2.c
crypto/evp/m_md4.c
crypto/evp/m_md5.c
crypto/evp/m_mdc2.c
crypto/evp/m_null.c
crypto/evp/m_ripemd.c
crypto/evp/m_sha.c
crypto/evp/m_sha1.c
crypto/evp/m_sigver.c
crypto/evp/m_wp.c
crypto/evp/names.c
crypto/evp/openbsd_hw.c
crypto/evp/p5_crpt.c
crypto/evp/p5_crpt2.c
crypto/evp/p_dec.c
crypto/evp/p_enc.c
crypto/evp/p_lib.c
crypto/evp/p_open.c
crypto/evp/p_seal.c
crypto/evp/p_sign.c
crypto/evp/p_verify.c
crypto/evp/pmeth_fn.c
crypto/evp/pmeth_gn.c
crypto/evp/pmeth_lib.c
crypto/ex_data.c
crypto/fips_err.h
crypto/fips_ers.c
crypto/hmac/hm_ameth.c
crypto/hmac/hm_pmeth.c
crypto/hmac/hmac.c
crypto/hmac/hmac.h
crypto/hmac/hmactest.c
crypto/idea/i_cbc.c
crypto/idea/i_cfb64.c
crypto/idea/i_ecb.c
crypto/idea/i_ofb64.c
crypto/idea/i_skey.c
crypto/idea/idea.h
crypto/idea/idea_lcl.h
crypto/idea/idea_spd.c
crypto/idea/ideatest.c
crypto/jpake/jpake.c
crypto/jpake/jpake.h
crypto/jpake/jpake_err.c
crypto/jpake/jpaketest.c
crypto/krb5/krb5_asn.c
crypto/krb5/krb5_asn.h
crypto/lhash/lh_stats.c
crypto/lhash/lh_test.c
crypto/lhash/lhash.c
crypto/lhash/lhash.h
crypto/md2/md2.c
crypto/md2/md2.h
crypto/md2/md2_dgst.c
crypto/md2/md2_one.c
crypto/md2/md2test.c
crypto/md32_common.h
crypto/md4/md4.c
crypto/md4/md4.h
crypto/md4/md4_dgst.c
crypto/md4/md4_locl.h
crypto/md4/md4_one.c
crypto/md4/md4test.c
crypto/md5/md5.c
crypto/md5/md5.h
crypto/md5/md5_dgst.c
crypto/md5/md5_locl.h
crypto/md5/md5_one.c
crypto/md5/md5test.c
crypto/mdc2/mdc2.h
crypto/mdc2/mdc2_one.c
crypto/mdc2/mdc2dgst.c
crypto/mdc2/mdc2test.c
crypto/mem.c
crypto/mem_clr.c
crypto/mem_dbg.c
crypto/modes/cbc128.c
crypto/modes/ccm128.c
crypto/modes/cfb128.c
crypto/modes/ctr128.c
crypto/modes/cts128.c
crypto/modes/gcm128.c
crypto/modes/modes.h
crypto/modes/modes_lcl.h
crypto/modes/ofb128.c
crypto/modes/wrap128.c
crypto/modes/xts128.c
crypto/o_dir.c
crypto/o_dir.h
crypto/o_dir_test.c
crypto/o_fips.c
crypto/o_init.c
crypto/o_str.c
crypto/o_str.h
crypto/o_time.c
crypto/o_time.h
crypto/objects/o_names.c
crypto/objects/obj_dat.c
crypto/objects/obj_err.c
crypto/objects/obj_lib.c
crypto/objects/obj_mac.h
crypto/objects/obj_xref.c
crypto/objects/obj_xref.h
crypto/objects/objects.h
crypto/ocsp/ocsp.h
crypto/ocsp/ocsp_asn.c
crypto/ocsp/ocsp_cl.c
crypto/ocsp/ocsp_err.c
crypto/ocsp/ocsp_ext.c
crypto/ocsp/ocsp_ht.c
crypto/ocsp/ocsp_lib.c
crypto/ocsp/ocsp_prn.c
crypto/ocsp/ocsp_srv.c
crypto/ocsp/ocsp_vfy.c
crypto/opensslv.h
crypto/ossl_typ.h
crypto/pem/pem.h
crypto/pem/pem2.h
crypto/pem/pem_all.c
crypto/pem/pem_err.c
crypto/pem/pem_info.c
crypto/pem/pem_lib.c
crypto/pem/pem_oth.c
crypto/pem/pem_pk8.c
crypto/pem/pem_pkey.c
crypto/pem/pem_seal.c
crypto/pem/pem_sign.c
crypto/pem/pem_x509.c
crypto/pem/pem_xaux.c
crypto/pem/pvkfmt.c
crypto/pkcs12/p12_add.c
crypto/pkcs12/p12_asn.c
crypto/pkcs12/p12_attr.c
crypto/pkcs12/p12_crpt.c
crypto/pkcs12/p12_crt.c
crypto/pkcs12/p12_decr.c
crypto/pkcs12/p12_init.c
crypto/pkcs12/p12_key.c
crypto/pkcs12/p12_kiss.c
crypto/pkcs12/p12_mutl.c
crypto/pkcs12/p12_npas.c
crypto/pkcs12/p12_p8d.c
crypto/pkcs12/p12_p8e.c
crypto/pkcs12/p12_utl.c
crypto/pkcs12/pk12err.c
crypto/pkcs12/pkcs12.h
crypto/pkcs7/bio_pk7.c
crypto/pkcs7/pk7_asn1.c
crypto/pkcs7/pk7_attr.c
crypto/pkcs7/pk7_dgst.c
crypto/pkcs7/pk7_doit.c
crypto/pkcs7/pk7_enc.c
crypto/pkcs7/pk7_lib.c
crypto/pkcs7/pk7_mime.c
crypto/pkcs7/pk7_smime.c
crypto/pkcs7/pkcs7.h
crypto/pkcs7/pkcs7err.c
crypto/ppc_arch.h
crypto/ppccap.c
crypto/pqueue/pq_test.c
crypto/pqueue/pqueue.c
crypto/pqueue/pqueue.h
crypto/rand/md_rand.c
crypto/rand/rand.h
crypto/rand/rand_egd.c
crypto/rand/rand_err.c
crypto/rand/rand_lcl.h
crypto/rand/rand_lib.c
crypto/rand/rand_nw.c
crypto/rand/rand_os2.c
crypto/rand/rand_unix.c
crypto/rand/rand_vms.c
crypto/rand/rand_win.c
crypto/rand/randfile.c
crypto/rand/randtest.c
crypto/rc2/rc2.h
crypto/rc2/rc2_cbc.c
crypto/rc2/rc2_ecb.c
crypto/rc2/rc2_locl.h
crypto/rc2/rc2_skey.c
crypto/rc2/rc2cfb64.c
crypto/rc2/rc2ofb64.c
crypto/rc2/rc2speed.c
crypto/rc2/rc2test.c
crypto/rc2/tab.c
crypto/rc4/rc4.c
crypto/rc4/rc4.h
crypto/rc4/rc4_enc.c
crypto/rc4/rc4_locl.h
crypto/rc4/rc4_skey.c
crypto/rc4/rc4_utl.c
crypto/rc4/rc4speed.c
crypto/rc4/rc4test.c
crypto/rc5/rc5.h
crypto/rc5/rc5_ecb.c
crypto/rc5/rc5_enc.c
crypto/rc5/rc5_locl.h
crypto/rc5/rc5_skey.c
crypto/rc5/rc5cfb64.c
crypto/rc5/rc5ofb64.c
crypto/rc5/rc5speed.c
crypto/rc5/rc5test.c
crypto/ripemd/ripemd.h
crypto/ripemd/rmd160.c
crypto/ripemd/rmd_dgst.c
crypto/ripemd/rmd_locl.h
crypto/ripemd/rmd_one.c
crypto/ripemd/rmdconst.h
crypto/ripemd/rmdtest.c
crypto/rsa/rsa.h
crypto/rsa/rsa_ameth.c
crypto/rsa/rsa_asn1.c
crypto/rsa/rsa_chk.c
crypto/rsa/rsa_crpt.c
crypto/rsa/rsa_depr.c
crypto/rsa/rsa_eay.c
crypto/rsa/rsa_err.c
crypto/rsa/rsa_gen.c
crypto/rsa/rsa_lib.c
crypto/rsa/rsa_locl.h
crypto/rsa/rsa_none.c
crypto/rsa/rsa_null.c
crypto/rsa/rsa_oaep.c
crypto/rsa/rsa_pk1.c
crypto/rsa/rsa_pmeth.c
crypto/rsa/rsa_prn.c
crypto/rsa/rsa_pss.c
crypto/rsa/rsa_saos.c
crypto/rsa/rsa_sign.c
crypto/rsa/rsa_ssl.c
crypto/rsa/rsa_test.c
crypto/rsa/rsa_x931.c
crypto/s390xcap.c
crypto/seed/seed.c
crypto/seed/seed.h
crypto/seed/seed_cbc.c
crypto/seed/seed_cfb.c
crypto/seed/seed_ecb.c
crypto/seed/seed_locl.h
crypto/seed/seed_ofb.c
crypto/sha/sha.c
crypto/sha/sha.h
crypto/sha/sha1.c
crypto/sha/sha1_one.c
crypto/sha/sha1dgst.c
crypto/sha/sha1test.c
crypto/sha/sha256.c
crypto/sha/sha256t.c
crypto/sha/sha512.c
crypto/sha/sha512t.c
crypto/sha/sha_dgst.c
crypto/sha/sha_locl.h
crypto/sha/sha_one.c
crypto/sha/shatest.c
crypto/sparc_arch.h
crypto/sparcv9cap.c
crypto/srp/srp.h
crypto/srp/srp_grps.h
crypto/srp/srp_lcl.h
crypto/srp/srp_lib.c
crypto/srp/srp_vfy.c
crypto/srp/srptest.c
crypto/stack/safestack.h
crypto/stack/stack.c
crypto/stack/stack.h
crypto/store/store.h
crypto/store/str_err.c
crypto/store/str_lib.c
crypto/store/str_locl.h
crypto/store/str_mem.c
crypto/store/str_meth.c
crypto/symhacks.h
crypto/threads/mttest.c
crypto/threads/th-lock.c
crypto/ts/ts.h
crypto/ts/ts_asn1.c
crypto/ts/ts_conf.c
crypto/ts/ts_err.c
crypto/ts/ts_lib.c
crypto/ts/ts_req_print.c
crypto/ts/ts_req_utils.c
crypto/ts/ts_rsp_print.c
crypto/ts/ts_rsp_sign.c
crypto/ts/ts_rsp_utils.c
crypto/ts/ts_rsp_verify.c
crypto/ts/ts_verify_ctx.c
crypto/txt_db/txt_db.c
crypto/txt_db/txt_db.h
crypto/ui/ui.h
crypto/ui/ui_compat.c
crypto/ui/ui_compat.h
crypto/ui/ui_err.c
crypto/ui/ui_lib.c
crypto/ui/ui_locl.h
crypto/ui/ui_openssl.c
crypto/ui/ui_util.c
crypto/uid.c
crypto/vms_rms.h [changed mode: 0755->0644]
crypto/whrlpool/whrlpool.h
crypto/whrlpool/wp_block.c
crypto/whrlpool/wp_dgst.c
crypto/whrlpool/wp_locl.h
crypto/whrlpool/wp_test.c
crypto/x509/by_dir.c
crypto/x509/by_file.c
crypto/x509/vpm_int.h
crypto/x509/x509.h
crypto/x509/x509_att.c
crypto/x509/x509_cmp.c
crypto/x509/x509_d2.c
crypto/x509/x509_def.c
crypto/x509/x509_err.c
crypto/x509/x509_ext.c
crypto/x509/x509_lu.c
crypto/x509/x509_obj.c
crypto/x509/x509_r2x.c
crypto/x509/x509_req.c
crypto/x509/x509_set.c
crypto/x509/x509_trs.c
crypto/x509/x509_txt.c
crypto/x509/x509_v3.c
crypto/x509/x509_vfy.c
crypto/x509/x509_vfy.h
crypto/x509/x509_vpm.c
crypto/x509/x509cset.c
crypto/x509/x509name.c
crypto/x509/x509rset.c
crypto/x509/x509spki.c
crypto/x509/x509type.c
crypto/x509/x_all.c
crypto/x509v3/ext_dat.h
crypto/x509v3/pcy_cache.c
crypto/x509v3/pcy_data.c
crypto/x509v3/pcy_int.h
crypto/x509v3/pcy_lib.c
crypto/x509v3/pcy_map.c
crypto/x509v3/pcy_node.c
crypto/x509v3/pcy_tree.c
crypto/x509v3/tabtest.c
crypto/x509v3/v3_addr.c
crypto/x509v3/v3_akey.c
crypto/x509v3/v3_akeya.c
crypto/x509v3/v3_alt.c
crypto/x509v3/v3_asid.c
crypto/x509v3/v3_bcons.c
crypto/x509v3/v3_bitst.c
crypto/x509v3/v3_conf.c
crypto/x509v3/v3_cpols.c
crypto/x509v3/v3_crld.c
crypto/x509v3/v3_enum.c
crypto/x509v3/v3_extku.c
crypto/x509v3/v3_genn.c
crypto/x509v3/v3_ia5.c
crypto/x509v3/v3_info.c
crypto/x509v3/v3_int.c
crypto/x509v3/v3_lib.c
crypto/x509v3/v3_ncons.c
crypto/x509v3/v3_ocsp.c
crypto/x509v3/v3_pci.c
crypto/x509v3/v3_pcia.c
crypto/x509v3/v3_pcons.c
crypto/x509v3/v3_pku.c
crypto/x509v3/v3_pmaps.c
crypto/x509v3/v3_prn.c
crypto/x509v3/v3_purp.c
crypto/x509v3/v3_scts.c
crypto/x509v3/v3_skey.c
crypto/x509v3/v3_sxnet.c
crypto/x509v3/v3_utl.c
crypto/x509v3/v3conf.c
crypto/x509v3/v3err.c
crypto/x509v3/v3nametest.c
crypto/x509v3/v3prin.c
crypto/x509v3/x509v3.h
demos/asn1/ocsp.c
demos/b64.c
demos/bio/client-arg.c
demos/bio/client-conf.c
demos/bio/saccept.c
demos/bio/sconnect.c
demos/bio/server-arg.c
demos/bio/server-conf.c
demos/cms/cms_comp.c
demos/cms/cms_ddec.c
demos/cms/cms_dec.c
demos/cms/cms_denc.c
demos/cms/cms_enc.c
demos/cms/cms_sign.c
demos/cms/cms_sign2.c
demos/cms/cms_uncomp.c
demos/cms/cms_ver.c
demos/easy_tls/easy-tls.c
demos/easy_tls/easy-tls.h
demos/easy_tls/test.c
demos/easy_tls/test.h
demos/engines/cluster_labs/cluster_labs.h
demos/engines/cluster_labs/hw_cluster_labs.c
demos/engines/cluster_labs/hw_cluster_labs_err.c
demos/engines/cluster_labs/hw_cluster_labs_err.h
demos/engines/ibmca/hw_ibmca.c
demos/engines/ibmca/hw_ibmca_err.c
demos/engines/ibmca/hw_ibmca_err.h
demos/engines/ibmca/ica_openssl_api.h
demos/engines/rsaref/rsaref.c
demos/engines/rsaref/rsaref_err.c
demos/engines/rsaref/rsaref_err.h
demos/engines/zencod/hw_zencod.c
demos/engines/zencod/hw_zencod.h
demos/engines/zencod/hw_zencod_err.c
demos/engines/zencod/hw_zencod_err.h
demos/pkcs12/pkread.c
demos/pkcs12/pkwrite.c
demos/prime/prime.c
demos/selfsign.c
demos/sign/sign.c
demos/smime/smdec.c
demos/smime/smenc.c
demos/smime/smsign.c
demos/smime/smsign2.c
demos/smime/smver.c
demos/spkigen.c
demos/state_machine/state_machine.c
demos/tunala/breakage.c
demos/tunala/buffer.c
demos/tunala/cb.c
demos/tunala/ip.c
demos/tunala/sm.c
demos/tunala/tunala.c
demos/tunala/tunala.h
demos/x509/mkcert.c
demos/x509/mkreq.c
e_os.h
e_os2.h
engines/ccgost/e_gost_err.c
engines/ccgost/e_gost_err.h
engines/ccgost/gost2001.c
engines/ccgost/gost2001_keyx.c
engines/ccgost/gost2001_keyx.h
engines/ccgost/gost89.c
engines/ccgost/gost89.h
engines/ccgost/gost94_keyx.c
engines/ccgost/gost_ameth.c
engines/ccgost/gost_asn1.c
engines/ccgost/gost_crypt.c
engines/ccgost/gost_ctl.c
engines/ccgost/gost_eng.c
engines/ccgost/gost_keywrap.c
engines/ccgost/gost_keywrap.h
engines/ccgost/gost_lcl.h
engines/ccgost/gost_md.c
engines/ccgost/gost_params.c
engines/ccgost/gost_params.h
engines/ccgost/gost_pmeth.c
engines/ccgost/gost_sign.c
engines/ccgost/gosthash.c
engines/ccgost/gosthash.h
engines/ccgost/gostsum.c
engines/e_4758cca.c
engines/e_4758cca_err.c
engines/e_4758cca_err.h
engines/e_aep.c
engines/e_aep_err.c
engines/e_aep_err.h
engines/e_atalla.c
engines/e_atalla_err.c
engines/e_atalla_err.h
engines/e_capi.c
engines/e_capi_err.c
engines/e_capi_err.h
engines/e_chil.c
engines/e_chil_err.c
engines/e_chil_err.h
engines/e_cswift.c
engines/e_cswift_err.c
engines/e_cswift_err.h
engines/e_gmp.c
engines/e_gmp_err.c
engines/e_gmp_err.h
engines/e_nuron.c
engines/e_nuron_err.c
engines/e_nuron_err.h
engines/e_padlock.c
engines/e_sureware.c
engines/e_sureware_err.c
engines/e_sureware_err.h
engines/e_ubsec.c
engines/e_ubsec_err.c
engines/e_ubsec_err.h
engines/vendor_defns/aep.h
engines/vendor_defns/atalla.h
engines/vendor_defns/cswift.h
engines/vendor_defns/hw_4758_cca.h
engines/vendor_defns/hw_ubsec.h
engines/vendor_defns/hwcryptohook.h
engines/vendor_defns/sureware.h
ms/applink.c
ms/tlhelp32.h
ms/uplink.c
ssl/bio_ssl.c
ssl/d1_both.c
ssl/d1_clnt.c
ssl/d1_lib.c
ssl/d1_meth.c
ssl/d1_pkt.c
ssl/d1_srtp.c
ssl/d1_srvr.c
ssl/dtls1.h
ssl/heartbeat_test.c
ssl/kssl.c
ssl/kssl.h
ssl/kssl_lcl.h
ssl/s23_clnt.c
ssl/s23_lib.c
ssl/s23_meth.c
ssl/s23_pkt.c
ssl/s23_srvr.c
ssl/s2_clnt.c
ssl/s2_enc.c
ssl/s2_lib.c
ssl/s2_meth.c
ssl/s2_pkt.c
ssl/s2_srvr.c
ssl/s3_both.c
ssl/s3_cbc.c
ssl/s3_clnt.c
ssl/s3_enc.c
ssl/s3_lib.c
ssl/s3_meth.c
ssl/s3_pkt.c
ssl/s3_srvr.c
ssl/srtp.h
ssl/ssl.h
ssl/ssl2.h
ssl/ssl23.h
ssl/ssl3.h
ssl/ssl_algs.c
ssl/ssl_asn1.c
ssl/ssl_cert.c
ssl/ssl_ciph.c
ssl/ssl_conf.c
ssl/ssl_err.c
ssl/ssl_err2.c
ssl/ssl_lib.c
ssl/ssl_locl.h
ssl/ssl_rsa.c
ssl/ssl_sess.c
ssl/ssl_stat.c
ssl/ssl_task.c
ssl/ssl_txt.c
ssl/ssl_utst.c
ssl/ssltest.c
ssl/t1_clnt.c
ssl/t1_enc.c
ssl/t1_ext.c
ssl/t1_lib.c
ssl/t1_meth.c
ssl/t1_reneg.c
ssl/t1_srvr.c
ssl/t1_trce.c
ssl/tls1.h
ssl/tls_srp.c
test/asn1test.c [changed mode: 0755->0644]
test/dummytest.c
test/igetest.c
test/methtest.c
test/r160test.c
test/testutil.h

index ad59dc9..155d40d 100644 (file)
@@ -5,97 +5,98 @@
 extern "C" {
 #endif
 
-
-
-enum
-{
-       kMacSocket_TimeoutErr = -2
+enum {
+    kMacSocket_TimeoutErr = -2
 };
 
+// Since MacSocket does busy waiting, I do a callback while waiting
 
-//     Since MacSocket does busy waiting, I do a callback while waiting
-
-typedef OSErr (*MacSocket_IdleWaitCallback)(void *);
+typedef OSErr(*MacSocket_IdleWaitCallback) (void *);
 
-
-//     Call this before anything else!
+// Call this before anything else!
 
 OSErr MacSocket_Startup(void);
 
-
-//     Call this to cleanup before quitting
+// Call this to cleanup before quitting
 
 OSErr MacSocket_Shutdown(void);
 
+// Call this to allocate a "socket" (reference number is returned in
+// outSocketNum)
+// Note that inDoThreadSwitching is pretty much irrelevant right now, since I
+// ignore it
+// The inTimeoutTicks parameter is applied during reads/writes of data
+// The inIdleWaitCallback parameter specifies a callback which is called
+// during busy-waiting periods
+// The inUserRefPtr parameter is passed back to the idle-wait callback
 
-//     Call this to allocate a "socket" (reference number is returned in outSocketNum)
-//     Note that inDoThreadSwitching is pretty much irrelevant right now, since I ignore it
-//     The inTimeoutTicks parameter is applied during reads/writes of data
-//     The inIdleWaitCallback parameter specifies a callback which is called during busy-waiting periods
-//     The inUserRefPtr parameter is passed back to the idle-wait callback
-
-OSErr MacSocket_socket(int *outSocketNum,const Boolean inDoThreadSwitching,const long inTimeoutTicks,MacSocket_IdleWaitCallback inIdleWaitCallback,void *inUserRefPtr);
-
-
-//     Call this to connect to an IP/DNS address
-//     Note that inTargetAddressAndPort is in "IP:port" format-- e.g. 10.1.1.1:123
-
-OSErr MacSocket_connect(const int inSocketNum,char *inTargetAddressAndPort);
+OSErr MacSocket_socket(int *outSocketNum, const Boolean inDoThreadSwitching,
+                       const long inTimeoutTicks,
+                       MacSocket_IdleWaitCallback inIdleWaitCallback,
+                       void *inUserRefPtr);
 
+// Call this to connect to an IP/DNS address
+// Note that inTargetAddressAndPort is in "IP:port" format-- e.g.
+// 10.1.1.1:123
 
-//     Call this to listen on a port
-//     Since this a low-performance implementation, I allow a maximum of 1 (one!) incoming request when I listen
+OSErr MacSocket_connect(const int inSocketNum, char *inTargetAddressAndPort);
 
-OSErr MacSocket_listen(const int inSocketNum,const int inPortNum);
+// Call this to listen on a port
+// Since this a low-performance implementation, I allow a maximum of 1 (one!)
+// incoming request when I listen
 
+OSErr MacSocket_listen(const int inSocketNum, const int inPortNum);
 
-//     Call this to close a socket
+// Call this to close a socket
 
 OSErr MacSocket_close(const int inSocketNum);
 
+// Call this to receive data on a socket
+// Most parameters' purpose are obvious-- except maybe "inBlock" which
+// controls whether I wait for data or return immediately
 
-//     Call this to receive data on a socket
-//     Most parameters' purpose are obvious-- except maybe "inBlock" which controls whether I wait for data or return immediately
+int MacSocket_recv(const int inSocketNum, void *outBuff, int outBuffLength,
+                   const Boolean inBlock);
 
-int MacSocket_recv(const int inSocketNum,void *outBuff,int outBuffLength,const Boolean inBlock);
+// Call this to send data on a socket
 
+int MacSocket_send(const int inSocketNum, const void *inBuff,
+                   int inBuffLength);
 
-//     Call this to send data on a socket
-
-int MacSocket_send(const int inSocketNum,const void *inBuff,int inBuffLength);
-
-
-//     If zero bytes were read in a call to MacSocket_recv(), it may be that the remote end has done a half-close
-//     This function will let you check whether that's true or not
+// If zero bytes were read in a call to MacSocket_recv(), it may be that the
+// remote end has done a half-close
+// This function will let you check whether that's true or not
 
 Boolean MacSocket_RemoteEndIsClosing(const int inSocketNum);
 
-
-//     Call this to see if the listen has completed after a call to MacSocket_listen()
+// Call this to see if the listen has completed after a call to
+// MacSocket_listen()
 
 Boolean MacSocket_ListenCompleted(const int inSocketNum);
 
-
-//     These really aren't very useful anymore
+// These really aren't very useful anymore
 
 Boolean MacSocket_LocalEndIsOpen(const int inSocketNum);
 Boolean MacSocket_RemoteEndIsOpen(const int inSocketNum);
 
+// You may wish to change the userRefPtr for a socket callback-- use this to
+// do it
 
-//     You may wish to change the userRefPtr for a socket callback-- use this to do it
-
-void MacSocket_SetUserRefPtr(const int inSocketNum,void *inNewRefPtr);
-
-
-//     Call these to get the socket's IP:port descriptor
+void MacSocket_SetUserRefPtr(const int inSocketNum, void *inNewRefPtr);
 
-void MacSocket_GetLocalIPAndPort(const int inSocketNum,char *outIPAndPort,const int inIPAndPortLength);
-void MacSocket_GetRemoteIPAndPort(const int inSocketNum,char *outIPAndPort,const int inIPAndPortLength);
+// Call these to get the socket's IP:port descriptor
 
+void MacSocket_GetLocalIPAndPort(const int inSocketNum, char *outIPAndPort,
+                                 const int inIPAndPortLength);
+void MacSocket_GetRemoteIPAndPort(const int inSocketNum, char *outIPAndPort,
+                                  const int inIPAndPortLength);
 
-//     Call this to get error info from a socket
+// Call this to get error info from a socket
 
-void MacSocket_GetSocketErrorInfo(const int inSocketNum,int *outSocketErrCode,char *outSocketErrString,const int inSocketErrStringMaxLength);
+void MacSocket_GetSocketErrorInfo(const int inSocketNum,
+                                  int *outSocketErrCode,
+                                  char *outSocketErrString,
+                                  const int inSocketErrStringMaxLength);
 
 
 #ifdef __cplusplus
index 565537b..7c8b076 100644 (file)
@@ -1,43 +1,42 @@
 
-//     Gathers unpredictable system data to be used for generating
-//     random bits
+// Gathers unpredictable system data to be used for generating
+// random bits
 
 #include <MacTypes.h>
 
-class CRandomizer
-{
-public:
-       CRandomizer (void);
-       void PeriodicAction (void);
-       
-private:
-
-       // Private calls
-
-       void            AddTimeSinceMachineStartup (void);
-       void            AddAbsoluteSystemStartupTime (void);
-       void            AddAppRunningTime (void);
-       void            AddStartupVolumeInfo (void);
-       void            AddFiller (void);
-
-       void            AddCurrentMouse (void);
-       void            AddNow (double millisecondUncertainty);
-       void            AddBytes (void *data, long size, double entropy);
-       
-       void            GetTimeBaseResolution (void);
-       unsigned long   SysTimer (void);
-
-       // System Info  
-       bool            mSupportsLargeVolumes;
-       bool            mIsPowerPC;
-       bool            mIs601;
-       
-       // Time info
-       double          mTimebaseTicksPerMillisec;
-       unsigned long   mLastPeriodicTicks;
-       
-       // Mouse info
-       long            mSamplePeriod;
-       Point           mLastMouse;
-       long            mMouseStill;
+class CRandomizer {
+ public:
+    CRandomizer(void);
+    void PeriodicAction(void);
+
+ private:
+
+    // Private calls
+
+    void AddTimeSinceMachineStartup(void);
+    void AddAbsoluteSystemStartupTime(void);
+    void AddAppRunningTime(void);
+    void AddStartupVolumeInfo(void);
+    void AddFiller(void);
+
+    void AddCurrentMouse(void);
+    void AddNow(double millisecondUncertainty);
+    void AddBytes(void *data, long size, double entropy);
+
+    void GetTimeBaseResolution(void);
+    unsigned long SysTimer(void);
+
+    // System Info
+    bool mSupportsLargeVolumes;
+    bool mIsPowerPC;
+    bool mIs601;
+
+    // Time info
+    double mTimebaseTicksPerMillisec;
+    unsigned long mLastPeriodicTicks;
+
+    // Mouse info
+    long mSamplePeriod;
+    Point mLastMouse;
+    long mMouseStill;
 };
index fe6b538..6028920 100644 (file)
@@ -1,9 +1,9 @@
 #include <MacHeaders.h>
 #define B_ENDIAN
 #ifdef __POWERPC__
-#pragma longlong on
+# pragma longlong on
 #endif
 #if 1
-#define MAC_OS_GUSI_SOURCE
+# define MAC_OS_GUSI_SOURCE
 #endif
 #define MONOLITH
index 2189da7..eda14e8 100644 (file)
@@ -1,9 +1,9 @@
 #include <MacHeaders.h>
 #define B_ENDIAN
 #ifdef __POWERPC__
-#pragma longlong on
+# pragma longlong on
 #endif
 #if 0
-#define MAC_OS_GUSI_SOURCE
+# define MAC_OS_GUSI_SOURCE
 #endif
 #define MONOLITH
index 90875b6..2e287c4 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef MK1MF_BUILD
-#  define CFLAGS       "-DB_ENDIAN"
-#  define PLATFORM     "macos"
-#  define DATE         "Sun Feb 27 19:44:16 MET 2000"
+# define CFLAGS        "-DB_ENDIAN"
+# define PLATFORM      "macos"
+# define DATE          "Sun Feb 27 19:44:16 MET 2000"
 #endif
index 1bc31bf..bace0a1 100644 (file)
 /* MacOS/opensslconf.h */
 
 #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
-#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
-#define OPENSSLDIR "/usr/local/ssl"
-#endif
+# if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
+#  define OPENSSLDIR "/usr/local/ssl"
+# endif
 #endif
 
 #if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
-#define IDEA_INT unsigned int
+# define IDEA_INT unsigned int
 #endif
 
 #if defined(HEADER_MD2_H) && !defined(MD2_INT)
-#define MD2_INT unsigned int
+# define MD2_INT unsigned int
 #endif
 
 #if defined(HEADER_RC2_H) && !defined(RC2_INT)
 /* I need to put in a mod for the alpha - eay */
-#define RC2_INT unsigned int
+# define RC2_INT unsigned int
 #endif
 
 #if defined(HEADER_RC4_H)
-#if !defined(RC4_INT)
-/* using int types make the structure larger but make the code faster
- * on most boxes I have tested - up to %20 faster. */
+# if !defined(RC4_INT)
+/*
+ * using int types make the structure larger but make the code faster on most
+ * boxes I have tested - up to %20 faster.
+ */
 /*-
  * I don't know what does "most" mean, but declaring "int" is a must on:
  * - Intel P6 because partial register stalls are very expensive;
  * - elder Alpha because it lacks byte load/store instructions;
  */
-#define RC4_INT unsigned char
-#endif
-#if !defined(RC4_CHUNK)
+#  define RC4_INT unsigned char
+# endif
+# if !defined(RC4_CHUNK)
 /*
  * This enables code handling data aligned at natural CPU word
  * boundary. See crypto/rc4/rc4_enc.c for further details.
  */
-#define RC4_CHUNK unsigned long
-#endif
+#  define RC4_CHUNK unsigned long
+# endif
 #endif
 
 #if defined(HEADER_DES_H) && !defined(DES_LONG)
-/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
- * %20 speed up (longs are 8 bytes, int's are 4). */
-#ifndef DES_LONG
-#define DES_LONG unsigned long
-#endif
+/*
+ * If this is set to 'unsigned int' on a DEC Alpha, this gives about a %20
+ * speed up (longs are 8 bytes, int's are 4).
+ */
+# ifndef DES_LONG
+#  define DES_LONG unsigned long
+# endif
 #endif
 
 #if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
-#define CONFIG_HEADER_BN_H
-#if __option(longlong)
+# define CONFIG_HEADER_BN_H
+# if __option(longlong)
 #  define BN_LLONG
-#else
+# else
 #  undef BN_LLONG
-#endif
+# endif
 
 /* Should we define BN_DIV2W here? */
 
 /* Only one for the following should be defined */
-/* The prime number generation stuff may not work when
- * EIGHT_BIT but I don't care since I've only used this mode
- * for debuging the bignum libraries */
-#undef SIXTY_FOUR_BIT_LONG
-#undef SIXTY_FOUR_BIT
-#define THIRTY_TWO_BIT
-#undef SIXTEEN_BIT
-#undef EIGHT_BIT
+/*
+ * The prime number generation stuff may not work when EIGHT_BIT but I don't
+ * care since I've only used this mode for debuging the bignum libraries
+ */
+# undef SIXTY_FOUR_BIT_LONG
+# undef SIXTY_FOUR_BIT
+# define THIRTY_TWO_BIT
+# undef SIXTEEN_BIT
+# undef EIGHT_BIT
 #endif
 
 #if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
-#define CONFIG_HEADER_RC4_LOCL_H
-/* if this is defined data[i] is used instead of *data, this is a %20
- * speedup on x86 */
-#undef RC4_INDEX
+# define CONFIG_HEADER_RC4_LOCL_H
+/*
+ * if this is defined data[i] is used instead of *data, this is a %20 speedup
+ * on x86
+ */
+# undef RC4_INDEX
 #endif
 
 #if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
-#define CONFIG_HEADER_BF_LOCL_H
-#define BF_PTR
-#endif /* HEADER_BF_LOCL_H */
+# define CONFIG_HEADER_BF_LOCL_H
+# define BF_PTR
+#endif                          /* HEADER_BF_LOCL_H */
 
 #if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
-#define CONFIG_HEADER_DES_LOCL_H
-/* the following is tweaked from a config script, that is why it is a
- * protected undef/define */
-#ifndef DES_PTR
-#define DES_PTR
-#endif
+# define CONFIG_HEADER_DES_LOCL_H
+/*
+ * the following is tweaked from a config script, that is why it is a
+ * protected undef/define
+ */
+# ifndef DES_PTR
+#  define DES_PTR
+# endif
 
-/* This helps C compiler generate the correct code for multiple functional
+/*
+ * This helps C compiler generate the correct code for multiple functional
  * units.  It reduces register dependancies at the expense of 2 more
- * registers */
-#ifndef DES_RISC1
-#define DES_RISC1
-#endif
-
-#ifndef DES_RISC2
-#undef DES_RISC2
-#endif
-
-#if defined(DES_RISC1) && defined(DES_RISC2)
-YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
-#endif
-
-/* Unroll the inner loop, this sometimes helps, sometimes hinders.
- * Very mucy CPU dependant */
-#ifndef DES_UNROLL
-#define DES_UNROLL
-#endif
+ * registers
+ */
+# ifndef DES_RISC1
+#  define DES_RISC1
+# endif
 
-#endif /* HEADER_DES_LOCL_H */
+# ifndef DES_RISC2
+#  undef DES_RISC2
+# endif
 
+# if defined(DES_RISC1) && defined(DES_RISC2)
+YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED ! !!!!
+# endif
+/*
+ * Unroll the inner loop, this sometimes helps, sometimes hinders. Very mucy
+ * CPU dependant
+ */
+# ifndef DES_UNROLL
+#  define DES_UNROLL
+# endif
+#endif                          /* HEADER_DES_LOCL_H */
 #ifndef __POWERPC__
-#define MD32_XARRAY
+# define MD32_XARRAY
 #endif
index b7b6128..595fc78 100644 (file)
@@ -5,21 +5,21 @@
  * This package is an SSL implementation written
  * by Eric Young (eay@cryptsoft.com).
  * The implementation was written so as to conform with Netscapes SSL.
- * 
+ *
  * This library is free for commercial and non-commercial use as long as
  * the following conditions are aheared to.  The following conditions
  * apply to all code found in this distribution, be it the RC4, RSA,
  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
  * included with this distribution is covered by the same copyright terms
  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- * 
+ *
  * Copyright remains Eric Young's, and as such any Copyright notices in
  * the code are not to be removed.
  * If this package is used in a product, Eric Young should be given attribution
  * as the author of the parts of the library used.
  * This can be in the form of a textual message at program startup or
  * in documentation (online or textual) provided with the package.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *     Eric Young (eay@cryptsoft.com)"
  *    The word 'cryptographic' can be left out if the rouines from the library
  *    being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from 
+ * 4. If you include any Windows specific code (or a derivative thereof) from
  *    the apps directory (application code) you must include an acknowledgement:
  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * 
+ *
  * The licence and distribution terms for any publically available version or
  * derivative of this code cannot be changed.  i.e. this code cannot simply be
  * copied and put under another distribution licence
@@ -63,7 +63,7 @@
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
+ *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
 #include <openssl/bio.h>
 #include <openssl/rand.h>
 
-
 static int seeded = 0;
 static int egdsocket = 0;
 
 int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
-       {
-       int consider_randfile = (file == NULL);
-       char buffer[200];
-       
+{
+    int consider_randfile = (file == NULL);
+    char buffer[200];
+
 #ifdef OPENSSL_SYS_WINDOWS
-       BIO_printf(bio_e,"Loading 'screen' into random state -");
-       BIO_flush(bio_e);
-       RAND_screen();
-       BIO_printf(bio_e," done\n");
+    BIO_printf(bio_e, "Loading 'screen' into random state -");
+    BIO_flush(bio_e);
+    RAND_screen();
+    BIO_printf(bio_e, " done\n");
 #endif
 
-       if (file == NULL)
-               file = RAND_file_name(buffer, sizeof buffer);
-       else if (RAND_egd(file) > 0)
-               {
-               /* we try if the given filename is an EGD socket.
-                  if it is, we don't write anything back to the file. */
-               egdsocket = 1;
-               return 1;
-               }
-       if (file == NULL || !RAND_load_file(file, -1))
-               {
-               if (RAND_status() == 0)
-                       {
-                       if (!dont_warn)
-                               {
-                               BIO_printf(bio_e,"unable to load 'random state'\n");
-                               BIO_printf(bio_e,"This means that the random number generator has not been seeded\n");
-                               BIO_printf(bio_e,"with much random data.\n");
-                               if (consider_randfile) /* explanation does not apply when a file is explicitly named */
-                                       {
-                                       BIO_printf(bio_e,"Consider setting the RANDFILE environment variable to point at a file that\n");
-                                       BIO_printf(bio_e,"'random' data can be kept in (the file will be overwritten).\n");
-                                       }
-                               }
-                       return 0;
-                       }
-               }
-       seeded = 1;
-       return 1;
-       }
+    if (file == NULL)
+        file = RAND_file_name(buffer, sizeof buffer);
+    else if (RAND_egd(file) > 0) {
+        /*
+         * we try if the given filename is an EGD socket. if it is, we don't
+         * write anything back to the file.
+         */
+        egdsocket = 1;
+        return 1;
+    }
+    if (file == NULL || !RAND_load_file(file, -1)) {
+        if (RAND_status() == 0) {
+            if (!dont_warn) {
+                BIO_printf(bio_e, "unable to load 'random state'\n");
+                BIO_printf(bio_e,
+                           "This means that the random number generator has not been seeded\n");
+                BIO_printf(bio_e, "with much random data.\n");
+                if (consider_randfile) { /* explanation does not apply when a
+                                          * file is explicitly named */
+                    BIO_printf(bio_e,
+                               "Consider setting the RANDFILE environment variable to point at a file that\n");
+                    BIO_printf(bio_e,
+                               "'random' data can be kept in (the file will be overwritten).\n");
+                }
+            }
+            return 0;
+        }
+    }
+    seeded = 1;
+    return 1;
+}
 
 long app_RAND_load_files(char *name)
-       {
-       char *p,*n;
-       int last;
-       long tot=0;
-       int egd;
-       
-       for (;;)
-               {
-               last=0;
-               for (p=name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++);
-               if (*p == '\0') last=1;
-               *p='\0';
-               n=name;
-               name=p+1;
-               if (*n == '\0') break;
+{
+    char *p, *n;
+    int last;
+    long tot = 0;
+    int egd;
 
-               egd=RAND_egd(n);
-               if (egd > 0)
-                       tot+=egd;
-               else
-                       tot+=RAND_load_file(n,-1);
-               if (last) break;
-               }
-       if (tot > 512)
-               app_RAND_allow_write_file();
-       return(tot);
-       }
+    for (;;) {
+        last = 0;
+        for (p = name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++) ;
+        if (*p == '\0')
+            last = 1;
+        *p = '\0';
+        n = name;
+        name = p + 1;
+        if (*n == '\0')
+            break;
+
+        egd = RAND_egd(n);
+        if (egd > 0)
+            tot += egd;
+        else
+            tot += RAND_load_file(n, -1);
+        if (last)
+            break;
+    }
+    if (tot > 512)
+        app_RAND_allow_write_file();
+    return (tot);
+}
 
 int app_RAND_write_file(const char *file, BIO *bio_e)
-       {
-       char buffer[200];
-       
-       if (egdsocket || !seeded)
-               /* If we did not manage to read the seed file,
-                * we should not write a low-entropy seed file back --
-                * it would suppress a crucial warning the next time
-                * we want to use it. */
-               return 0;
+{
+    char buffer[200];
+
+    if (egdsocket || !seeded)
+        /*
+         * If we did not manage to read the seed file, we should not write a
+         * low-entropy seed file back -- it would suppress a crucial warning
+         * the next time we want to use it.
+         */
+        return 0;
 
-       if (file == NULL)
-               file = RAND_file_name(buffer, sizeof buffer);
-       if (file == NULL || !RAND_write_file(file))
-               {
-               BIO_printf(bio_e,"unable to write 'random state'\n");
-               return 0;
-               }
-       return 1;
-       }
+    if (file == NULL)
+        file = RAND_file_name(buffer, sizeof buffer);
+    if (file == NULL || !RAND_write_file(file)) {
+        BIO_printf(bio_e, "unable to write 'random state'\n");
+        return 0;
+    }
+    return 1;
+}
 
 void app_RAND_allow_write_file(void)
-       {
-       seeded = 1;
-       }
+{
+    seeded = 1;
+}
index 501c464..e6bb48f 100644 (file)
@@ -5,21 +5,21 @@
  * This package is an SSL implementation written
  * by Eric Young (eay@cryptsoft.com).
  * The implementation was written so as to conform with Netscapes SSL.
- * 
+ *
  * This library is free for commercial and non-commercial use as long as
  * the following conditions are aheared to.  The following conditions
  * apply to all code found in this distribution, be it the RC4, RSA,
  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
  * included with this distribution is covered by the same copyright terms
  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- * 
+ *
  * Copyright remains Eric Young's, and as such any Copyright notices in
  * the code are not to be removed.
  * If this package is used in a product, Eric Young should be given attribution
  * as the author of the parts of the library used.
  * This can be in the form of a textual message at program startup or
  * in documentation (online or textual) provided with the package.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  *     Eric Young (eay@cryptsoft.com)"
  *    The word 'cryptographic' can be left out if the rouines from the library
  *    being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from 
+ * 4. If you include any Windows specific code (or a derivative thereof) from
  *    the apps directory (application code) you must include an acknowledgement:
  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- * 
+ *
  * The licence and distribution terms for any publically available version or
  * derivative of this code cannot be changed.  i.e. this code cannot simply be
  * copied and put under another distribution licence
@@ -63,7 +63,7 @@
  * are met:
  *
  * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
+ *    notice, this list of conditions and the following disclaimer.
  *
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in
  */
 
 #if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS)
-/* On VMS, you need to define this to get
- * the declaration of fileno().  The value
- * 2 is to make sure no function defined
- * in POSIX-2 is left undefined.
+/*
+ * On VMS, you need to define this to get the declaration of fileno().  The
+ * value 2 is to make sure no function defined in POSIX-2 is left undefined.
  */
-#define _POSIX_C_SOURCE 2
+# define _POSIX_C_SOURCE 2
 #endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
-#include <strings.h>
+# include <strings.h>
 #endif
 #include <sys/types.h>
 #include <ctype.h>
 #include <openssl/ui.h>
 #include <openssl/safestack.h>
 #ifndef OPENSSL_NO_ENGINE
-#include <openssl/engine.h>
+# include <openssl/engine.h>
 #endif
 #ifndef OPENSSL_NO_RSA
-#include <openssl/rsa.h>
+# include <openssl/rsa.h>
 #endif
 #include <openssl/bn.h>
 #ifndef OPENSSL_NO_JPAKE
-#include <openssl/jpake.h>
+# include <openssl/jpake.h>
 #endif
 
 #define NON_MAIN
 
 #ifdef _WIN32
 static int WIN32_rename(const char *from, const char *to);
-#define rename(from,to) WIN32_rename((from),(to))
+# define rename(from,to) WIN32_rename((from),(to))
 #endif
 
 typedef struct {
-       const char *name;
-       unsigned long flag;
-       unsigned long mask;
+    const char *name;
+    unsigned long flag;
+    unsigned long mask;
 } NAME_EX_TBL;
 
 static UI_METHOD *ui_method = NULL;
 
-static int set_table_opts(unsigned long *flags, const char *arg, const NAME_EX_TBL *in_tbl);
-static int set_multi_opts(unsigned long *flags, const char *arg, const NAME_EX_TBL *in_tbl);
+static int set_table_opts(unsigned long *flags, const char *arg,
+                          const NAME_EX_TBL * in_tbl);
+static int set_multi_opts(unsigned long *flags, const char *arg,
+                          const NAME_EX_TBL * in_tbl);
 
 #if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
 /* Looks like this stuff is worth moving into separate function */
-static EVP_PKEY *
-load_netscape_key(BIO *err, BIO *key, const char *file,
-               const char *key_descrip, int format);
+static EVP_PKEY *load_netscape_key(BIO *err, BIO *key, const char *file,
+                                   const char *key_descrip, int format);
 #endif
 
 int app_init(long mesgwin);
-#ifdef undef /* never finished - probably never will be :-) */
+#ifdef undef                    /* never finished - probably never will be
+                                 * :-) */
 int args_from_file(char *file, int *argc, char **argv[])
-       {
-       FILE *fp;
-       int num,i;
-       unsigned int len;
-       static char *buf=NULL;
-       static char **arg=NULL;
-       char *p;
-
-       fp=fopen(file,"r");
-       if (fp == NULL)
-               return(0);
-
-       if (fseek(fp,0,SEEK_END)==0)
-               len=ftell(fp), rewind(fp);
-       else    len=-1;
-       if (len<=0)
-               {
-               fclose(fp);
-               return(0);
-               }
-
-       *argc=0;
-       *argv=NULL;
-
-       if (buf != NULL) OPENSSL_free(buf);
-       buf=(char *)OPENSSL_malloc(len+1);
-       if (buf == NULL) return(0);
-
-       len=fread(buf,1,len,fp);
-       if (len <= 1) return(0);
-       buf[len]='\0';
-
-       i=0;
-       for (p=buf; *p; p++)
-               if (*p == '\n') i++;
-       if (arg != NULL) OPENSSL_free(arg);
-       arg=(char **)OPENSSL_malloc(sizeof(char *)*(i*2));
-
-       *argv=arg;
-       num=0;
-       p=buf;
-       for (;;)
-               {
-               if (!*p) break;
-               if (*p == '#') /* comment line */
-                       {
-                       while (*p && (*p != '\n')) p++;
-                       continue;
-                       }
-               /* else we have a line */
-               *(arg++)=p;
-               num++;
-               while (*p && ((*p != ' ') && (*p != '\t') && (*p != '\n')))
-                       p++;
-               if (!*p) break;
-               if (*p == '\n')
-                       {
-                       *(p++)='\0';
-                       continue;
-                       }
-               /* else it is a tab or space */
-               p++;
-               while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\n')))
-                       p++;
-               if (!*p) break;
-               if (*p == '\n')
-                       {
-                       p++;
-                       continue;
-                       }
-               *(arg++)=p++;
-               num++;
-               while (*p && (*p != '\n')) p++;
-               if (!*p) break;
-               /* else *p == '\n' */
-               *(p++)='\0';
-               }
-       *argc=num;
-       return(1);
-       }
+{
+    FILE *fp;
+    int num, i;
+    unsigned int len;
+    static char *buf = NULL;
+    static char **arg = NULL;
+    char *p;
+
+    fp = fopen(file, "r");
+    if (fp == NULL)
+        return (0);
+
+    if (fseek(fp, 0, SEEK_END) == 0)
+        len = ftell(fp), rewind(fp);
+    else
+        len = -1;
+    if (len <= 0) {
+        fclose(fp);
+        return (0);
+    }
+
+    *argc = 0;
+    *argv = NULL;
+
+    if (buf != NULL)
+        OPENSSL_free(buf);
+    buf = (char *)OPENSSL_malloc(len + 1);
+    if (buf == NULL)
+        return (0);
+
+    len = fread(buf, 1, len, fp);
+    if (len <= 1)
+        return (0);
+    buf[len] = '\0';
+
+    i = 0;
+    for (p = buf; *p; p++)
+        if (*p == '\n')
+            i++;
+    if (arg != NULL)
+        OPENSSL_free(arg);
+    arg = (char **)OPENSSL_malloc(sizeof(char *) * (i * 2));
+
+    *argv = arg;
+    num = 0;
+    p = buf;
+    for (;;) {
+        if (!*p)
+            break;
+        if (*p == '#') {        /* comment line */
+            while (*p && (*p != '\n'))
+                p++;
+            continue;
+        }
+        /* else we have a line */
+        *(arg++) = p;
+        num++;
+        while (*p && ((*p != ' ') && (*p != '\t') && (*p != '\n')))
+            p++;
+        if (!*p)
+            break;
+        if (*p == '\n') {
+            *(p++) = '\0';
+            continue;
+        }
+        /* else it is a tab or space */
+        p++;
+        while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\n')))
+            p++;
+        if (!*p)
+            break;
+        if (*p == '\n') {
+            p++;
+            continue;
+        }
+        *(arg++) = p++;
+        num++;
+        while (*p && (*p != '\n'))
+            p++;
+        if (!*p)
+            break;
+        /* else *p == '\n' */
+        *(p++) = '\0';
+    }
+    *argc = num;
+    return (1);
+}
 #endif
 
 int str2fmt(char *s)
-       {
-       if (s == NULL)
-               return FORMAT_UNDEF;
-       if      ((*s == 'D') || (*s == 'd'))
-               return(FORMAT_ASN1);
-       else if ((*s == 'T') || (*s == 't'))
-               return(FORMAT_TEXT);
-       else if ((*s == 'N') || (*s == 'n'))
-               return(FORMAT_NETSCAPE);
-       else if ((*s == 'S') || (*s == 's'))
-               return(FORMAT_SMIME);
-       else if ((*s == 'M') || (*s == 'm'))
-               return(FORMAT_MSBLOB);
-       else if ((*s == '1')
-               || (strcmp(s,"PKCS12") == 0) || (strcmp(s,"pkcs12") == 0)
-               || (strcmp(s,"P12") == 0) || (strcmp(s,"p12") == 0))
-               return(FORMAT_PKCS12);
-       else if ((*s == 'E') || (*s == 'e'))
-               return(FORMAT_ENGINE);
-       else if ((*s == 'H') || (*s == 'h'))
-               return FORMAT_HTTP;
-       else if ((*s == 'P') || (*s == 'p'))
-               {
-               if (s[1] == 'V' || s[1] == 'v')
-                       return FORMAT_PVK;
-               else
-                       return(FORMAT_PEM);
-               }
-       else
-               return(FORMAT_UNDEF);
-       }
+{
+    if (s == NULL)
+        return FORMAT_UNDEF;
+    if ((*s == 'D') || (*s == 'd'))
+        return (FORMAT_ASN1);
+    else if ((*s == 'T') || (*s == 't'))
+        return (FORMAT_TEXT);
+    else if ((*s == 'N') || (*s == 'n'))
+        return (FORMAT_NETSCAPE);
+    else if ((*s == 'S') || (*s == 's'))
+        return (FORMAT_SMIME);
+    else if ((*s == 'M') || (*s == 'm'))
+        return (FORMAT_MSBLOB);
+    else if ((*s == '1')
+             || (strcmp(s, "PKCS12") == 0) || (strcmp(s, "pkcs12") == 0)
+             || (strcmp(s, "P12") == 0) || (strcmp(s, "p12") == 0))
+        return (FORMAT_PKCS12);
+    else if ((*s == 'E') || (*s == 'e'))
+        return (FORMAT_ENGINE);
+    else if ((*s == 'H') || (*s == 'h'))
+        return FORMAT_HTTP;
+    else if ((*s == 'P') || (*s == 'p')) {
+        if (s[1] == 'V' || s[1] == 'v')
+            return FORMAT_PVK;
+        else
+            return (FORMAT_PEM);
+    } else
+        return (FORMAT_UNDEF);
+}
 
 #if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16) || defined(OPENSSL_SYS_NETWARE)
 void program_name(char *in, char *out, int size)
-       {
-       int i,n;
-       char *p=NULL;
-
-       n=strlen(in);
-       /* find the last '/', '\' or ':' */
-       for (i=n-1; i>0; i--)
-               {
-               if ((in[i] == '/') || (in[i] == '\\') || (in[i] == ':'))
-                       {
-                       p= &(in[i+1]);
-                       break;
-                       }
-               }
-       if (p == NULL)
-               p=in;
-       n=strlen(p);
-
-#if defined(OPENSSL_SYS_NETWARE)
-   /* strip off trailing .nlm if present. */
-   if ((n > 4) && (p[n-4] == '.') &&
-      ((p[n-3] == 'n') || (p[n-3] == 'N')) &&
-      ((p[n-2] == 'l') || (p[n-2] == 'L')) &&
-      ((p[n-1] == 'm') || (p[n-1] == 'M')))
-      n-=4;
-#else
-       /* strip off trailing .exe if present. */
-       if ((n > 4) && (p[n-4] == '.') &&
-               ((p[n-3] == 'e') || (p[n-3] == 'E')) &&
-               ((p[n-2] == 'x') || (p[n-2] == 'X')) &&
-               ((p[n-1] == 'e') || (p[n-1] == 'E')))
-               n-=4;
-#endif
+{
+    int i, n;
+    char *p = NULL;
+
+    n = strlen(in);
+    /* find the last '/', '\' or ':' */
+    for (i = n - 1; i > 0; i--) {
+        if ((in[i] == '/') || (in[i] == '\\') || (in[i] == ':')) {
+            p = &(in[i + 1]);
+            break;
+        }
+    }
+    if (p == NULL)
+        p = in;
+    n = strlen(p);
+
+# if defined(OPENSSL_SYS_NETWARE)
+    /* strip off trailing .nlm if present. */
+    if ((n > 4) && (p[n - 4] == '.') &&
+        ((p[n - 3] == 'n') || (p[n - 3] == 'N')) &&
+        ((p[n - 2] == 'l') || (p[n - 2] == 'L')) &&
+        ((p[n - 1] == 'm') || (p[n - 1] == 'M')))
+        n -= 4;
+# else
+    /* strip off trailing .exe if present. */
+    if ((n > 4) && (p[n - 4] == '.') &&
+        ((p[n - 3] == 'e') || (p[n - 3] == 'E')) &&
+        ((p[n - 2] == 'x') || (p[n - 2] == 'X')) &&
+        ((p[n - 1] == 'e') || (p[n - 1] == 'E')))
+        n -= 4;
+# endif
+
+    if (n > size - 1)
+        n = size - 1;
 
-       if (n > size-1)
-               n=size-1;
-
-       for (i=0; i<n; i++)
-               {
-               if ((p[i] >= 'A') && (p[i] <= 'Z'))
-                       out[i]=p[i]-'A'+'a';
-               else
-                       out[i]=p[i];
-               }
-       out[n]='\0';
-       }
+    for (i = 0; i < n; i++) {
+        if ((p[i] >= 'A') && (p[i] <= 'Z'))
+            out[i] = p[i] - 'A' + 'a';
+        else
+            out[i] = p[i];
+    }
+    out[n] = '\0';
+}
 #else
-#ifdef OPENSSL_SYS_VMS
+# ifdef OPENSSL_SYS_VMS
 void program_name(char *in, char *out, int size)
-       {
-       char *p=in, *q;
-       char *chars=":]>";
-
-       while(*chars != '\0')
-               {
-               q=strrchr(p,*chars);
-               if (q > p)
-                       p = q + 1;
-               chars++;
-               }
-
-       q=strrchr(p,'.');
-       if (q == NULL)
-               q = p + strlen(p);
-       strncpy(out,p,size-1);
-       if (q-p >= size)
-               {
-               out[size-1]='\0';
-               }
-       else
-               {
-               out[q-p]='\0';
-               }
-       }
-#else
+{
+    char *p = in, *q;
+    char *chars = ":]>";
+
+    while (*chars != '\0') {
+        q = strrchr(p, *chars);
+        if (q > p)
+            p = q + 1;
+        chars++;
+    }
+
+    q = strrchr(p, '.');
+    if (q == NULL)
+        q = p + strlen(p);
+    strncpy(out, p, size - 1);
+    if (q - p >= size) {
+        out[size - 1] = '\0';
+    } else {
+        out[q - p] = '\0';
+    }
+}
+# else
 void program_name(char *in, char *out, int size)
-       {
-       char *p;
-
-       p=strrchr(in,'/');
-       if (p != NULL)
-               p++;
-       else
-               p=in;
-       BUF_strlcpy(out,p,size);
-       }
-#endif
+{
+    char *p;
+
+    p = strrchr(in, '/');
+    if (p != NULL)
+        p++;
+    else
+        p = in;
+    BUF_strlcpy(out, p, size);
+}
+# endif
 #endif
 
 int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
-       {
-       int num,i;
-       char *p;
-
-       *argc=0;
-       *argv=NULL;
-
-       i=0;
-       if (arg->count == 0)
-               {
-               arg->count=20;
-               arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
-               if (arg->data == NULL)
-                       return 0;
-               }
-       for (i=0; i<arg->count; i++)
-               arg->data[i]=NULL;
-
-       num=0;
-       p=buf;
-       for (;;)
-               {
-               /* first scan over white space */
-               if (!*p) break;
-               while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\n')))
-                       p++;
-               if (!*p) break;
-
-               /* The start of something good :-) */
-               if (num >= arg->count)
-                       {
-                       char **tmp_p;
-                       int tlen = arg->count + 20;
-                       tmp_p = (char **)OPENSSL_realloc(arg->data,
-                               sizeof(char *)*tlen);
-                       if (tmp_p == NULL)
-                               return 0;
-                       arg->data  = tmp_p;
-                       arg->count = tlen;
-                       /* initialize newly allocated data */
-                       for (i = num; i < arg->count; i++)
-                               arg->data[i] = NULL;
-                       }
-               arg->data[num++]=p;
-
-               /* now look for the end of this */
-               if ((*p == '\'') || (*p == '\"')) /* scan for closing quote */
-                       {
-                       i= *(p++);
-                       arg->data[num-1]++; /* jump over quote */
-                       while (*p && (*p != i))
-                               p++;
-                       *p='\0';
-                       }
-               else
-                       {
-                       while (*p && ((*p != ' ') &&
-                               (*p != '\t') && (*p != '\n')))
-                               p++;
-
-                       if (*p == '\0')
-                               p--;
-                       else
-                               *p='\0';
-                       }
-               p++;
-               }
-       *argc=num;
-       *argv=arg->data;
-       return(1);
-       }
+{
+    int num, i;
+    char *p;
+
+    *argc = 0;
+    *argv = NULL;
+
+    i = 0;
+    if (arg->count == 0) {
+        arg->count = 20;
+        arg->data = (char **)OPENSSL_malloc(sizeof(char *) * arg->count);
+        if (arg->data == NULL)
+            return 0;
+    }
+    for (i = 0; i < arg->count; i++)
+        arg->data[i] = NULL;
+
+    num = 0;
+    p = buf;
+    for (;;) {
+        /* first scan over white space */
+        if (!*p)
+            break;
+        while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\n')))
+            p++;
+        if (!*p)
+            break;
+
+        /* The start of something good :-) */
+        if (num >= arg->count) {
+            char **tmp_p;
+            int tlen = arg->count + 20;
+            tmp_p = (char **)OPENSSL_realloc(arg->data,
+                                             sizeof(char *) * tlen);
+            if (tmp_p == NULL)
+                return 0;
+            arg->data = tmp_p;
+            arg->count = tlen;
+            /* initialize newly allocated data */
+            for (i = num; i < arg->count; i++)
+                arg->data[i] = NULL;
+        }
+        arg->data[num++] = p;
+
+        /* now look for the end of this */
+        if ((*p == '\'') || (*p == '\"')) { /* scan for closing quote */
+            i = *(p++);
+            arg->data[num - 1]++; /* jump over quote */
+            while (*p && (*p != i))
+                p++;
+            *p = '\0';
+        } else {
+            while (*p && ((*p != ' ') && (*p != '\t') && (*p != '\n')))
+                p++;
+
+            if (*p == '\0')
+                p--;
+            else
+                *p = '\0';
+        }
+        p++;
+    }
+    *argc = num;
+    *argv = arg->data;
+    return (1);
+}
 
 #ifndef APP_INIT
 int app_init(long mesgwin)
-       {
-       return(1);
-       }
+{
+    return (1);
+}
 #endif
 
-
-int dump_cert_text (BIO *out, X509 *x)
+int dump_cert_text(BIO *out, X509 *x)
 {
-       char *p;
+    char *p;
 
-       p=X509_NAME_oneline(X509_get_subject_name(x),NULL,0);
-       BIO_puts(out,"subject=");
-       BIO_puts(out,p);
-       OPENSSL_free(p);
+    p = X509_NAME_oneline(X509_get_subject_name(x), NULL, 0);
+    BIO_puts(out, "subject=");
+    BIO_puts(out, p);
+    OPENSSL_free(p);
 
-       p=X509_NAME_oneline(X509_get_issuer_name(x),NULL,0);
-       BIO_puts(out,"\nissuer=");
-       BIO_puts(out,p);
-       BIO_puts(out,"\n");
-       OPENSSL_free(p);
+    p = X509_NAME_oneline(X509_get_issuer_name(x), NULL, 0);
+    BIO_puts(out, "\nissuer=");
+    BIO_puts(out, p);
+    BIO_puts(out, "\n");
+    OPENSSL_free(p);
 
-       return 0;
+    return 0;
 }
 
 static int ui_open(UI *ui)
-       {
-       return UI_method_get_opener(UI_OpenSSL())(ui);
-       }
+{
+    return UI_method_get_opener(UI_OpenSSL())(ui);
+}
+
 static int ui_read(UI *ui, UI_STRING *uis)
-       {
-       if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
-               && UI_get0_user_data(ui))
-               {
-               switch(UI_get_string_type(uis))
-                       {
-               case UIT_PROMPT:
-               case UIT_VERIFY:
-                       {
-                       const char *password =
-                               ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
-                       if (password && password[0] != '\0')
-                               {
-                               UI_set_result(ui, uis, password);
-                               return 1;
-                               }
-                       }
-               default:
-                       break;
-                       }
-               }
-       return UI_method_get_reader(UI_OpenSSL())(ui, uis);
-       }
+{
+    if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
+        && UI_get0_user_data(ui)) {
+        switch (UI_get_string_type(uis)) {
+        case UIT_PROMPT:
+        case UIT_VERIFY:
+            {
+                const char *password =
+                    ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
+                if (password && password[0] != '\0') {
+                    UI_set_result(ui, uis, password);
+                    return 1;
+                }
+            }
+        default:
+            break;
+        }
+    }
+    return UI_method_get_reader(UI_OpenSSL())(ui, uis);
+}
+
 static int ui_write(UI *ui, UI_STRING *uis)
-       {
-       if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
-               && UI_get0_user_data(ui))
-               {
-               switch(UI_get_string_type(uis))
-                       {
-               case UIT_PROMPT:
-               case UIT_VERIFY:
-                       {
-                       const char *password =
-                               ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
-                       if (password && password[0] != '\0')
-                               return 1;
-                       }
-               default:
-                       break;
-                       }
-               }
-       return UI_method_get_writer(UI_OpenSSL())(ui, uis);
-       }
+{
+    if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
+        && UI_get0_user_data(ui)) {
+        switch (UI_get_string_type(uis)) {
+        case UIT_PROMPT:
+        case UIT_VERIFY:
+            {
+                const char *password =
+                    ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
+                if (password && password[0] != '\0')
+                    return 1;
+            }
+        default:
+            break;
+        }
+    }
+    return UI_method_get_writer(UI_OpenSSL())(ui, uis);
+}
+
 static int ui_close(UI *ui)
-       {
-       return UI_method_get_closer(UI_OpenSSL())(ui);
-       }
+{
+    return UI_method_get_closer(UI_OpenSSL())(ui);
+}
+
 int setup_ui_method(void)
-       {
-       ui_method = UI_create_method("OpenSSL application user interface");
-       UI_method_set_opener(ui_method, ui_open);
-       UI_method_set_reader(ui_method, ui_read);
-       UI_method_set_writer(ui_method, ui_write);
-       UI_method_set_closer(ui_method, ui_close);
-       return 0;
-       }
+{
+    ui_method = UI_create_method("OpenSSL application user interface");
+    UI_method_set_opener(ui_method, ui_open);
+    UI_method_set_reader(ui_method, ui_read);
+    UI_method_set_writer(ui_method, ui_write);
+    UI_method_set_closer(ui_method, ui_close);
+    return 0;
+}
+
 void destroy_ui_method(void)
-       {
-       if(ui_method)
-               {
-               UI_destroy_method(ui_method);
-               ui_method = NULL;
-               }
-       }
-int password_callback(char *buf, int bufsiz, int verify,
-       PW_CB_DATA *cb_tmp)
-       {
-       UI *ui = NULL;
-       int res = 0;
-       const char *prompt_info = NULL;
-       const char *password = NULL;
-       PW_CB_DATA *cb_data = (PW_CB_DATA *)cb_tmp;
-
-       if (cb_data)
-               {
-               if (cb_data->password)
-                       password = cb_data->password;
-               if (cb_data->prompt_info)
-                       prompt_info = cb_data->prompt_info;
-               }
-
-       if (password)
-               {
-               res = strlen(password);
-               if (res > bufsiz)
-                       res = bufsiz;
-               memcpy(buf, password, res);
-               return res;
-               }
-
-       ui = UI_new_method(ui_method);
-       if (ui)
-               {
-               int ok = 0;
-               char *buff = NULL;
-               int ui_flags = 0;
-               char *prompt = NULL;
-
-               prompt = UI_construct_prompt(ui, "pass phrase",
-                       prompt_info);
-
-               ui_flags |= UI_INPUT_FLAG_DEFAULT_PWD;
-               UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);
-
-               if (ok >= 0)
-                       ok = UI_add_input_string(ui,prompt,ui_flags,buf,
-                               PW_MIN_LENGTH,bufsiz-1);
-               if (ok >= 0 && verify)
-                       {
-                       buff = (char *)OPENSSL_malloc(bufsiz);
-                       ok = UI_add_verify_string(ui,prompt,ui_flags,buff,
-                               PW_MIN_LENGTH,bufsiz-1, buf);
-                       }
-               if (ok >= 0)
-                       do
-                               {
-                               ok = UI_process(ui);
-                               }
-                       while (ok < 0 && UI_ctrl(ui, UI_CTRL_IS_REDOABLE, 0, 0, 0));
-
-               if (buff)
-                       {
-                       OPENSSL_cleanse(buff,(unsigned int)bufsiz);
-                       OPENSSL_free(buff);
-                       }
-
-               if (ok >= 0)
-                       res = strlen(buf);
-               if (ok == -1)
-                       {
-                       BIO_printf(bio_err, "User interface error\n");
-                       ERR_print_errors(bio_err);
-                       OPENSSL_cleanse(buf,(unsigned int)bufsiz);
-                       res = 0;
-                       }
-               if (ok == -2)
-                       {
-                       BIO_printf(bio_err,"aborted!\n");
-                       OPENSSL_cleanse(buf,(unsigned int)bufsiz);
-                       res = 0;
-                       }
-               UI_free(ui);
-               OPENSSL_free(prompt);
-               }
-       return res;
-       }
+{
+    if (ui_method) {
+        UI_destroy_method(ui_method);
+        ui_method = NULL;
+    }
+}
+
+int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
+{
+    UI *ui = NULL;
+    int res = 0;
+    const char *prompt_info = NULL;
+    const char *password = NULL;
+    PW_CB_DATA *cb_data = (PW_CB_DATA *)cb_tmp;
+
+    if (cb_data) {
+        if (cb_data->password)
+            password = cb_data->password;
+        if (cb_data->prompt_info)
+            prompt_info = cb_data->prompt_info;
+    }
+
+    if (password) {
+        res = strlen(password);
+        if (res > bufsiz)
+            res = bufsiz;
+        memcpy(buf, password, res);
+        return res;
+    }
+
+    ui = UI_new_method(ui_method);
+    if (ui) {
+        int ok = 0;
+        char *buff = NULL;
+        int ui_flags = 0;
+        char *prompt = NULL;
+
+        prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
+
+        ui_flags |= UI_INPUT_FLAG_DEFAULT_PWD;
+        UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);
+
+        if (ok >= 0)
+            ok = UI_add_input_string(ui, prompt, ui_flags, buf,
+                                     PW_MIN_LENGTH, bufsiz - 1);
+        if (ok >= 0 && verify) {
+            buff = (char *)OPENSSL_malloc(bufsiz);
+            ok = UI_add_verify_string(ui, prompt, ui_flags, buff,
+                                      PW_MIN_LENGTH, bufsiz - 1, buf);
+        }
+        if (ok >= 0)
+            do {
+                ok = UI_process(ui);
+            }
+            while (ok < 0 && UI_ctrl(ui, UI_CTRL_IS_REDOABLE, 0, 0, 0));
+
+        if (buff) {
+            OPENSSL_cleanse(buff, (unsigned int)bufsiz);
+            OPENSSL_free(buff);
+        }
+
+        if (ok >= 0)
+            res = strlen(buf);
+        if (ok == -1) {
+            BIO_printf(bio_err, "User interface error\n");
+            ERR_print_errors(bio_err);
+            OPENSSL_cleanse(buf, (unsigned int)bufsiz);
+            res = 0;
+        }
+        if (ok == -2) {
+            BIO_printf(bio_err, "aborted!\n");
+            OPENSSL_cleanse(buf, (unsigned int)bufsiz);
+            res = 0;
+        }
+        UI_free(ui);
+        OPENSSL_free(prompt);
+    }
+    return res;
+}
 
 static char *app_get_pass(BIO *err, char *arg, int keepbio);
 
 int app_passwd(BIO *err, char *arg1, char *arg2, char **pass1, char **pass2)
 {
-       int same;
-       if(!arg2 || !arg1 || strcmp(arg1, arg2)) same = 0;
-       else same = 1;
-       if(arg1) {
-               *pass1 = app_get_pass(err, arg1, same);
-               if(!*pass1) return 0;
-       } else if(pass1) *pass1 = NULL;
-       if(arg2) {
-               *pass2 = app_get_pass(err, arg2, same ? 2 : 0);
-               if(!*pass2) return 0;
-       } else if(pass2) *pass2 = NULL;
-       return 1;
+    int same;
+    if (!arg2 || !arg1 || strcmp(arg1, arg2))
+        same = 0;
+    else
+        same = 1;
+    if (arg1) {
+        *pass1 = app_get_pass(err, arg1, same);
+        if (!*pass1)
+            return 0;
+    } else if (pass1)
+        *pass1 = NULL;
+    if (arg2) {
+        *pass2 = app_get_pass(err, arg2, same ? 2 : 0);
+        if (!*pass2)
+            return 0;
+    } else if (pass2)
+        *pass2 = NULL;
+    return 1;
 }
 
 static char *app_get_pass(BIO *err, char *arg, int keepbio)
 {
-       char *tmp, tpass[APP_PASS_LEN];
-       static BIO *pwdbio = NULL;
-       int i;
-       if(!strncmp(arg, "pass:", 5)) return BUF_strdup(arg + 5);
-       if(!strncmp(arg, "env:", 4)) {
-               tmp = getenv(arg + 4);
-               if(!tmp) {
-                       BIO_printf(err, "Can't read environment variable %s\n", arg + 4);
-                       return NULL;
-               }
-               return BUF_strdup(tmp);
-       }
-       if(!keepbio || !pwdbio) {
-               if(!strncmp(arg, "file:", 5)) {
-                       pwdbio = BIO_new_file(arg + 5, "r");
-                       if(!pwdbio) {
-                               BIO_printf(err, "Can't open file %s\n", arg + 5);
-                               return NULL;
-                       }
+    char *tmp, tpass[APP_PASS_LEN];
+    static BIO *pwdbio = NULL;
+    int i;
+    if (!strncmp(arg, "pass:", 5))
+        return BUF_strdup(arg + 5);
+    if (!strncmp(arg, "env:", 4)) {
+        tmp = getenv(arg + 4);
+        if (!tmp) {
+            BIO_printf(err, "Can't read environment variable %s\n", arg + 4);
+            return NULL;
+        }
+        return BUF_strdup(tmp);
+    }
+    if (!keepbio || !pwdbio) {
+        if (!strncmp(arg, "file:", 5)) {
+            pwdbio = BIO_new_file(arg + 5, "r");
+            if (!pwdbio) {
+                BIO_printf(err, "Can't open file %s\n", arg + 5);
+                return NULL;
+            }
 #if !defined(_WIN32)
-               /*
-                * Under _WIN32, which covers even Win64 and CE, file
-                * descriptors referenced by BIO_s_fd are not inherited
-                * by child process and therefore below is not an option.
-                * It could have been an option if bss_fd.c was operating
-                * on real Windows descriptors, such as those obtained
-                * with CreateFile.
-                */
-               } else if(!strncmp(arg, "fd:", 3)) {
-                       BIO *btmp;
-                       i = atoi(arg + 3);
-                       if(i >= 0) pwdbio = BIO_new_fd(i, BIO_NOCLOSE);
-                       if((i < 0) || !pwdbio) {
-                               BIO_printf(err, "Can't access file descriptor %s\n", arg + 3);
-                               return NULL;
-                       }
-                       /* Can't do BIO_gets on an fd BIO so add a buffering BIO */
-                       btmp = BIO_new(BIO_f_buffer());
-                       pwdbio = BIO_push(btmp, pwdbio);
-#endif
-               } else if(!strcmp(arg, "stdin")) {
-                       pwdbio = BIO_new_fp(stdin, BIO_NOCLOSE);
-                       if(!pwdbio) {
-                               BIO_printf(err, "Can't open BIO for stdin\n");
-                               return NULL;
-                       }
-               } else {
-                       BIO_printf(err, "Invalid password argument \"%s\"\n", arg);
-                       return NULL;
-               }
-       }
-       i = BIO_gets(pwdbio, tpass, APP_PASS_LEN);
-       if(keepbio != 1) {
-               BIO_free_all(pwdbio);
-               pwdbio = NULL;
-       }
-       if(i <= 0) {
-               BIO_printf(err, "Error reading password from BIO\n");
-               return NULL;
-       }
-       tmp = strchr(tpass, '\n');
-       if(tmp) *tmp = 0;
-       return BUF_strdup(tpass);
+            /*
+             * Under _WIN32, which covers even Win64 and CE, file
+             * descriptors referenced by BIO_s_fd are not inherited
+             * by child process and therefore below is not an option.
+             * It could have been an option if bss_fd.c was operating
+             * on real Windows descriptors, such as those obtained
+             * with CreateFile.
+             */
+        } else if (!strncmp(arg, "fd:", 3)) {
+            BIO *btmp;
+            i = atoi(arg + 3);
+            if (i >= 0)
+                pwdbio = BIO_new_fd(i, BIO_NOCLOSE);
+            if ((i < 0) || !pwdbio) {
+                BIO_printf(err, "Can't access file descriptor %s\n", arg + 3);
+                return NULL;
+            }
+            /*
+             * Can't do BIO_gets on an fd BIO so add a buffering BIO
+             */
+            btmp = BIO_new(BIO_f_buffer());
+            pwdbio = BIO_push(btmp, pwdbio);
+#endif
+        } else if (!strcmp(arg, "stdin")) {
+            pwdbio = BIO_new_fp(stdin, BIO_NOCLOSE);
+            if (!pwdbio) {
+                BIO_printf(err, "Can't open BIO for stdin\n");
+                return NULL;
+            }
+        } else {
+            BIO_printf(err, "Invalid password argument \"%s\"\n", arg);
+            return NULL;
+        }
+    }
+    i = BIO_gets(pwdbio, tpass, APP_PASS_LEN);
+    if (keepbio != 1) {
+        BIO_free_all(pwdbio);
+        pwdbio = NULL;
+    }
+    if (i <= 0) {
+        BIO_printf(err, "Error reading password from BIO\n");
+        return NULL;
+    }
+    tmp = strchr(tpass, '\n');
+    if (tmp)
+        *tmp = 0;
+    return BUF_strdup(tpass);
 }
 
 int add_oid_section(BIO *err, CONF *conf)
-{      
-       char *p;
-       STACK_OF(CONF_VALUE) *sktmp;
-       CONF_VALUE *cnf;
-       int i;
-       if(!(p=NCONF_get_string(conf,NULL,"oid_section")))
-               {
-               ERR_clear_error();
-               return 1;
-               }
-       if(!(sktmp = NCONF_get_section(conf, p))) {
-               BIO_printf(err, "problem loading oid section %s\n", p);
-               return 0;
-       }
-       for(i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
-               cnf = sk_CONF_VALUE_value(sktmp, i);
-               if(OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) {
-                       BIO_printf(err, "problem creating object %s=%s\n",
-                                                        cnf->name, cnf->value);
-                       return 0;
-               }
-       }
-       return 1;
+{
+    char *p;
+    STACK_OF(CONF_VALUE) *sktmp;
+    CONF_VALUE *cnf;
+    int i;
+    if (!(p = NCONF_get_string(conf, NULL, "oid_section"))) {
+        ERR_clear_error();
+        return 1;
+    }
+    if (!(sktmp = NCONF_get_section(conf, p))) {
+        BIO_printf(err, "problem loading oid section %s\n", p);
+        return 0;
+    }
+    for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
+        cnf = sk_CONF_VALUE_value(sktmp, i);
+        if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) {
+            BIO_printf(err, "problem creating object %s=%s\n",
+                       cnf->name, cnf->value);
+            return 0;
+        }
+    }
+    return 1;
 }
 
 static int load_pkcs12(BIO *err, BIO *in, const char *desc,
-               pem_password_cb *pem_cb,  void *cb_data,
-               EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
-       {
-       const char *pass;
-       char tpass[PEM_BUFSIZE];
-       int len, ret = 0;
-       PKCS12 *p12;
-       p12 = d2i_PKCS12_bio(in, NULL);
-       if (p12 == NULL)
-               {
-               BIO_printf(err, "Error loading PKCS12 file for %s\n", desc);    
-               goto die;
-               }
-       /* See if an empty password will do */
-       if (PKCS12_verify_mac(p12, "", 0) || PKCS12_verify_mac(p12, NULL, 0))
-               pass = "";
-       else
-               {
-               if (!pem_cb)
-                       pem_cb = (pem_password_cb *)password_callback;
-               len = pem_cb(tpass, PEM_BUFSIZE, 0, cb_data);
-               if (len < 0) 
-                       {
-                       BIO_printf(err, "Passpharse callback error for %s\n",
-                                       desc);
-                       goto die;
-                       }
-               if (len < PEM_BUFSIZE)
-                       tpass[len] = 0;
-               if (!PKCS12_verify_mac(p12, tpass, len))
-                       {
-                       BIO_printf(err,
-       "Mac verify error (wrong password?) in PKCS12 file for %s\n", desc);    
-                       goto die;
-                       }
-               pass = tpass;
-               }
-       ret = PKCS12_parse(p12, pass, pkey, cert, ca);
-       die:
-       if (p12)
-               PKCS12_free(p12);
-       return ret;
-       }
+                       pem_password_cb *pem_cb, void *cb_data,
+                       EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
+{
+    const char *pass;
+    char tpass[PEM_BUFSIZE];
+    int len, ret = 0;
+    PKCS12 *p12;
+    p12 = d2i_PKCS12_bio(in, NULL);
+    if (p12 == NULL) {
+        BIO_printf(err, "Error loading PKCS12 file for %s\n", desc);
+        goto die;
+    }
+    /* See if an empty password will do */
+    if (PKCS12_verify_mac(p12, "", 0) || PKCS12_verify_mac(p12, NULL, 0))
+        pass = "";
+    else {
+        if (!pem_cb)
+            pem_cb = (pem_password_cb *)password_callback;
+        len = pem_cb(tpass, PEM_BUFSIZE, 0, cb_data);
+        if (len < 0) {
+            BIO_printf(err, "Passpharse callback error for %s\n", desc);
+            goto die;
+        }
+        if (len < PEM_BUFSIZE)
+            tpass[len] = 0;
+        if (!PKCS12_verify_mac(p12, tpass, len)) {
+            BIO_printf(err,
+                       "Mac verify error (wrong password?) in PKCS12 file for %s\n",
+                       desc);
+            goto die;
+        }
+        pass = tpass;
+    }
+    ret = PKCS12_parse(p12, pass, pkey, cert, ca);
+ die:
+    if (p12)
+        PKCS12_free(p12);
+    return ret;
+}
 
 int load_cert_crl_http(const char *url, BIO *err,
-                                       X509 **pcert, X509_CRL **pcrl)
-       {
-       char *host = NULL, *port = NULL, *path = NULL;
-       BIO *bio = NULL;
-       OCSP_REQ_CTX *rctx = NULL;
-       int use_ssl, rv = 0;
-       if (!OCSP_parse_url(url, &host, &port, &path, &use_ssl))
-               goto err;
-       if (use_ssl)
-               {
-               if (err)
-                       BIO_puts(err, "https not supported\n");
-               goto err;
-               }
-       bio = BIO_new_connect(host);
-       if (!bio || !BIO_set_conn_port(bio, port))
-               goto err;
-       rctx = OCSP_REQ_CTX_new(bio, 1024);
-       if (!rctx)
-               goto err;
-       if (!OCSP_REQ_CTX_http(rctx, "GET", path))
-               goto err;
-       if (!OCSP_REQ_CTX_add1_header(rctx, "Host", host))
-               goto err;
-       if (pcert)
-               {
-               do
-                       {
-                       rv = X509_http_nbio(rctx, pcert);
-                       }
-               while (rv == -1);
-               }
-       else
-               {
-               do
-                       {
-                       rv = X509_CRL_http_nbio(rctx, pcrl);
-                       } while (rv == -1);
-               }
-
-       err:
-       if (host)
-               OPENSSL_free(host);
-       if (path)
-               OPENSSL_free(path);
-       if (port)
-               OPENSSL_free(port);
-       if (bio)
-               BIO_free_all(bio);
-       if (rctx)
-               OCSP_REQ_CTX_free(rctx);
-       if (rv != 1)
-               {
-               if (bio && err)
-                       BIO_printf(bio_err, "Error loading %s from %s\n",
-                                       pcert ? "certificate" : "CRL", url);
-               ERR_print_errors(bio_err);
-               }
-       return rv;
-       }
+                       X509 **pcert, X509_CRL **pcrl)
+{
+    char *host = NULL, *port = NULL, *path = NULL;
+    BIO *bio = NULL;
+    OCSP_REQ_CTX *rctx = NULL;
+    int use_ssl, rv = 0;
+    if (!OCSP_parse_url(url, &host, &port, &path, &use_ssl))
+        goto err;
+    if (use_ssl) {
+        if (err)
+            BIO_puts(err, "https not supported\n");
+        goto err;
+    }
+    bio = BIO_new_connect(host);
+    if (!bio || !BIO_set_conn_port(bio, port))
+        goto err;
+    rctx = OCSP_REQ_CTX_new(bio, 1024);
+    if (!rctx)
+        goto err;
+    if (!OCSP_REQ_CTX_http(rctx, "GET", path))
+        goto err;
+    if (!OCSP_REQ_CTX_add1_header(rctx, "Host", host))
+        goto err;
+    if (pcert) {
+        do {
+            rv = X509_http_nbio(rctx, pcert);
+        }
+        while (rv == -1);
+    } else {
+        do {
+            rv = X509_CRL_http_nbio(rctx, pcrl);
+        } while (rv == -1);
+    }
+
+ err:
+    if (host)
+        OPENSSL_free(host);
+    if (path)
+        OPENSSL_free(path);
+    if (port)
+        OPENSSL_free(port);
+    if (bio)
+        BIO_free_all(bio);
+    if (rctx)
+        OCSP_REQ_CTX_free(rctx);
+    if (rv != 1) {
+        if (bio && err)
+            BIO_printf(bio_err, "Error loading %s from %s\n",
+                       pcert ? "certificate" : "CRL", url);
+        ERR_print_errors(bio_err);
+    }
+    return rv;
+}
 
 X509 *load_cert(BIO *err, const char *file, int format,
-       const char *pass, ENGINE *e, const char *cert_descrip)
-       {
-       X509 *x=NULL;
-       BIO *cert;
-
-       if (format == FORMAT_HTTP)
-               {
-               load_cert_crl_http(file, err, &x, NULL);
-               return x;
-               }
-
-       if ((cert=BIO_new(BIO_s_file())) == NULL)
-               {
-               ERR_print_errors(err);
-               goto end;
-               }
-
-       if (file == NULL)
-               {
+                const char *pass, ENGINE *e, const char *cert_descrip)
+{
+    X509 *x = NULL;
+    BIO *cert;
+
+    if (format == FORMAT_HTTP) {
+        load_cert_crl_http(file, err, &x, NULL);
+        return x;
+    }
+
+    if ((cert = BIO_new(BIO_s_file())) == NULL) {
+        ERR_print_errors(err);
+        goto end;
+    }
+
+    if (file == NULL) {
 #ifdef _IONBF
 # ifndef OPENSSL_NO_SETVBUF_IONBF
-               setvbuf(stdin, NULL, _IONBF, 0);
-# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#endif
-               BIO_set_fp(cert,stdin,BIO_NOCLOSE);
-               }
-       else
-               {
-               if (BIO_read_filename(cert,file) <= 0)
-                       {
-                       BIO_printf(err, "Error opening %s %s\n",
-                               cert_descrip, file);
-                       ERR_print_errors(err);
-                       goto end;
-                       }
-               }
-
-       if      (format == FORMAT_ASN1)
-               x=d2i_X509_bio(cert,NULL);
-       else if (format == FORMAT_NETSCAPE)
-               {
-               NETSCAPE_X509 *nx;
-               nx=ASN1_item_d2i_bio(ASN1_ITEM_rptr(NETSCAPE_X509),cert,NULL);
-               if (nx == NULL)
-                               goto end;
-
-               if ((strncmp(NETSCAPE_CERT_HDR,(char *)nx->header->data,
-                       nx->header->length) != 0))
-                       {
-                       NETSCAPE_X509_free(nx);
-                       BIO_printf(err,"Error reading header on certificate\n");
-                       goto end;
-                       }
-               x=nx->cert;
-               nx->cert = NULL;
-               NETSCAPE_X509_free(nx);
-               }
-       else if (format == FORMAT_PEM)
-               x=PEM_read_bio_X509_AUX(cert,NULL,
-                       (pem_password_cb *)password_callback, NULL);
-       else if (format == FORMAT_PKCS12)
-               {
-               if (!load_pkcs12(err, cert,cert_descrip, NULL, NULL,
-                                       NULL, &x, NULL))
-                       goto end;
-               }
-       else    {
-               BIO_printf(err,"bad input format specified for %s\n",
-                       cert_descrip);
-               goto end;
-               }
-end:
-       if (x == NULL)
-               {
-               BIO_printf(err,"unable to load certificate\n");
-               ERR_print_errors(err);
-               }
-       if (cert != NULL) BIO_free(cert);
-       return(x);
-       }
+        setvbuf(stdin, NULL, _IONBF, 0);
+# endif                         /* ndef OPENSSL_NO_SETVBUF_IONBF */
+#endif
+        BIO_set_fp(cert, stdin, BIO_NOCLOSE);
+    } else {
+        if (BIO_read_filename(cert, file) <= 0) {
+            BIO_printf(err, "Error opening %s %s\n", cert_descrip, file);
+            ERR_print_errors(err);
+            goto end;
+        }
+    }
+
+    if (format == FORMAT_ASN1)
+        x = d2i_X509_bio(cert, NULL);
+    else if (format == FORMAT_NETSCAPE) {
+        NETSCAPE_X509 *nx;
+        nx = ASN1_item_d2i_bio(ASN1_ITEM_rptr(NETSCAPE_X509), cert, NULL);
+        if (nx == NULL)
+            goto end;
+
+        if ((strncmp(NETSCAPE_CERT_HDR, (char *)nx->header->data,
+                     nx->header->length) != 0)) {
+            NETSCAPE_X509_free(nx);
+            BIO_printf(err, "Error reading header on certificate\n");
+            goto end;
+        }
+        x = nx->cert;
+        nx->cert = NULL;
+        NETSCAPE_X509_free(nx);
+    } else if (format == FORMAT_PEM)
+        x = PEM_read_bio_X509_AUX(cert, NULL,
+                                  (pem_password_cb *)password_callback, NULL);
+    else if (format == FORMAT_PKCS12) {
+        if (!load_pkcs12(err, cert, cert_descrip, NULL, NULL, NULL, &x, NULL))
+            goto end;
+    } else {
+        BIO_printf(err, "bad input format specified for %s\n", cert_descrip);
+        goto end;
+    }
+ end:
+    if (x == NULL) {
+        BIO_printf(err, "unable to load certificate\n");
+        ERR_print_errors(err);
+    }
+    if (cert != NULL)
+        BIO_free(cert);
+    return (x);
+}
 
 X509_CRL *load_crl(const char *infile, int format)
-       {
-       X509_CRL *x=NULL;
-       BIO *in=NULL;
-
-       if (format == FORMAT_HTTP)
-               {
-               load_cert_crl_http(infile, bio_err, NULL, &x);
-               return x;
-               }
-
-       in=BIO_new(BIO_s_file());
-       if (in == NULL)
-               {
-               ERR_print_errors(bio_err);
-               goto end;
-               }
-
-       if (infile == NULL)
-               BIO_set_fp(in,stdin,BIO_NOCLOSE);
-       else
-               {
-               if (BIO_read_filename(in,infile) <= 0)
-                       {
-                       perror(infile);
-                       goto end;
-                       }
-               }
-       if      (format == FORMAT_ASN1)
-               x=d2i_X509_CRL_bio(in,NULL);
-       else if (format == FORMAT_PEM)
-               x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
-       else    {
-               BIO_printf(bio_err,"bad input format specified for input crl\n");
-               goto end;
-               }
-       if (x == NULL)
-               {
-               BIO_printf(bio_err,"unable to load CRL\n");
-               ERR_print_errors(bio_err);
-               goto end;
-               }
-       
-end:
-       BIO_free(in);
-       return(x);
-       }
+{
+    X509_CRL *x = NULL;
+    BIO *in = NULL;
+
+    if (format == FORMAT_HTTP) {
+        load_cert_crl_http(infile, bio_err, NULL, &x);
+        return x;
+    }
+
+    in = BIO_new(BIO_s_file());
+    if (in == NULL) {
+        ERR_print_errors(bio_err);
+        goto end;
+    }
+
+    if (infile == NULL)
+        BIO_set_fp(in, stdin, BIO_NOCLOSE);
+    else {
+        if (BIO_read_filename(in, infile) <= 0) {
+            perror(infile);
+            goto end;
+        }
+    }
+    if (format == FORMAT_ASN1)
+        x = d2i_X509_CRL_bio(in, NULL);
+    else if (format == FORMAT_PEM)
+        x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
+    else {
+        BIO_printf(bio_err, "bad input format specified for input crl\n");
+        goto end;
+    }
+    if (x == NULL) {
+        BIO_printf(bio_err, "unable to load CRL\n");
+        ERR_print_errors(bio_err);
+        goto end;
+    }
 
+ end:
+    BIO_free(in);
+    return (x);
+}
 
 EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
-       const char *pass, ENGINE *e, const char *key_descrip)
-       {
-       BIO *key=NULL;
-       EVP_PKEY *pkey=NULL;
-       PW_CB_DATA cb_data;
-
-       cb_data.password = pass;
-       cb_data.prompt_info = file;
-
-       if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE))
-               {
-               BIO_printf(err,"no keyfile specified\n");
-               goto end;
-               }
+                   const char *pass, ENGINE *e, const char *key_descrip)
+{
+    BIO *key = NULL;
+    EVP_PKEY *pkey = NULL;
+    PW_CB_DATA cb_data;
+
+    cb_data.password = pass;
+    cb_data.prompt_info = file;
+
+    if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
+        BIO_printf(err, "no keyfile specified\n");
+        goto end;
+    }
 #ifndef OPENSSL_NO_ENGINE
-       if (format == FORMAT_ENGINE)
-               {
-               if (!e)
-                       BIO_printf(err,"no engine specified\n");
-               else
-                       {
-                       pkey = ENGINE_load_private_key(e, file,
-                               ui_method, &cb_data);
-                       if (!pkey) 
-                               {
-                               BIO_printf(err,"cannot load %s from engine\n",key_descrip);
-                               ERR_print_errors(err);
-                               }       
-                       }
-               goto end;
-               }
-#endif
-       key=BIO_new(BIO_s_file());
-       if (key == NULL)
-               {
-               ERR_print_errors(err);
-               goto end;
-               }
-       if (file == NULL && maybe_stdin)
-               {
+    if (format == FORMAT_ENGINE) {
+        if (!e)
+            BIO_printf(err, "no engine specified\n");
+        else {
+            pkey = ENGINE_load_private_key(e, file, ui_method, &cb_data);
+            if (!pkey) {
+                BIO_printf(err, "cannot load %s from engine\n", key_descrip);
+                ERR_print_errors(err);
+            }
+        }
+        goto end;
+    }
+#endif
+    key = BIO_new(BIO_s_file());
+    if (key == NULL) {
+        ERR_print_errors(err);
+        goto end;
+    }
+    if (file == NULL && maybe_stdin) {
 #ifdef _IONBF
 # ifndef OPENSSL_NO_SETVBUF_IONBF
-               setvbuf(stdin, NULL, _IONBF, 0);
-# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#endif
-               BIO_set_fp(key,stdin,BIO_NOCLOSE);
-               }
-       else
-               if (BIO_read_filename(key,file) <= 0)
-                       {
-                       BIO_printf(err, "Error opening %s %s\n",
-                               key_descrip, file);
-                       ERR_print_errors(err);
-                       goto end;
-                       }
-       if (format == FORMAT_ASN1)
-               {
-               pkey=d2i_PrivateKey_bio(key, NULL);
-               }
-       else if (format == FORMAT_PEM)
-               {
-               pkey=PEM_read_bio_PrivateKey(key,NULL,
-                       (pem_password_cb *)password_callback, &cb_data);
-               }
+        setvbuf(stdin, NULL, _IONBF, 0);
+# endif                         /* ndef OPENSSL_NO_SETVBUF_IONBF */
+#endif
+        BIO_set_fp(key, stdin, BIO_NOCLOSE);
+    } else if (BIO_read_filename(key, file) <= 0) {
+        BIO_printf(err, "Error opening %s %s\n", key_descrip, file);
+        ERR_print_errors(err);
+        goto end;
+    }
+    if (format == FORMAT_ASN1) {
+        pkey = d2i_PrivateKey_bio(key, NULL);
+    } else if (format == FORMAT_PEM) {
+        pkey = PEM_read_bio_PrivateKey(key, NULL,
+                                       (pem_password_cb *)password_callback,
+                                       &cb_data);
+    }
 #if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
-       else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
-               pkey = load_netscape_key(err, key, file, key_descrip, format);
-#endif
-       else if (format == FORMAT_PKCS12)
-               {
-               if (!load_pkcs12(err, key, key_descrip,
-                               (pem_password_cb *)password_callback, &cb_data,
-                               &pkey, NULL, NULL))
-                       goto end;
-               }
+    else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
+        pkey = load_netscape_key(err, key, file, key_descrip, format);
+#endif
+    else if (format == FORMAT_PKCS12) {
+        if (!load_pkcs12(err, key, key_descrip,
+                         (pem_password_cb *)password_callback, &cb_data,
+                         &pkey, NULL, NULL))
+            goto end;
+    }
 #if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
-       else if (format == FORMAT_MSBLOB)
-               pkey = b2i_PrivateKey_bio(key);
-       else if (format == FORMAT_PVK)
-               pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback,
-                                                               &cb_data);
-#endif
-       else
-               {
-               BIO_printf(err,"bad input format specified for key file\n");
-               goto end;
-               }
+    else if (format == FORMAT_MSBLOB)
+        pkey = b2i_PrivateKey_bio(key);
+    else if (format == FORMAT_PVK)
+        pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback,
+                           &cb_data);
+#endif
+    else {
+        BIO_printf(err, "bad input format specified for key file\n");
+        goto end;
+    }
  end:
-       if (key != NULL) BIO_free(key);
-       if (pkey == NULL) 
-               {
-               BIO_printf(err,"unable to load %s\n", key_descrip);
-               ERR_print_errors(err);
-               }       
-       return(pkey);
-       }
+    if (key != NULL)
+        BIO_free(key);
+    if (pkey == NULL) {
+        BIO_printf(err, "unable to load %s\n", key_descrip);
+        ERR_print_errors(err);
+    }
+    return (pkey);
+}
 
 EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
-       const char *pass, ENGINE *e, const char *key_descrip)
-       {
-       BIO *key=NULL;
-       EVP_PKEY *pkey=NULL;
-       PW_CB_DATA cb_data;
-
-       cb_data.password = pass;
-       cb_data.prompt_info = file;
-
-       if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE))
-               {
-               BIO_printf(err,"no keyfile specified\n");
-               goto end;
-               }
+                      const char *pass, ENGINE *e, const char *key_descrip)
+{
+    BIO *key = NULL;
+    EVP_PKEY *pkey = NULL;
+    PW_CB_DATA cb_data;
+
+    cb_data.password = pass;
+    cb_data.prompt_info = file;
+
+    if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
+        BIO_printf(err, "no keyfile specified\n");
+        goto end;
+    }
 #ifndef OPENSSL_NO_ENGINE
-       if (format == FORMAT_ENGINE)
-               {
-               if (!e)
-                       BIO_printf(bio_err,"no engine specified\n");
-               else
-                       pkey = ENGINE_load_public_key(e, file,
-                               ui_method, &cb_data);
-               goto end;
-               }
-#endif
-       key=BIO_new(BIO_s_file());
-       if (key == NULL)
-               {
-               ERR_print_errors(err);
-               goto end;
-               }
-       if (file == NULL && maybe_stdin)
-               {
+    if (format == FORMAT_ENGINE) {
+        if (!e)
+            BIO_printf(bio_err, "no engine specified\n");
+        else
+            pkey = ENGINE_load_public_key(e, file, ui_method, &cb_data);
+        goto end;
+    }
+#endif
+    key = BIO_new(BIO_s_file());
+    if (key == NULL) {
+        ERR_print_errors(err);
+        goto end;
+    }
+    if (file == NULL && maybe_stdin) {
 #ifdef _IONBF
 # ifndef OPENSSL_NO_SETVBUF_IONBF
-               setvbuf(stdin, NULL, _IONBF, 0);
-# endif /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#endif
-               BIO_set_fp(key,stdin,BIO_NOCLOSE);
-               }
-       else
-               if (BIO_read_filename(key,file) <= 0)
-                       {
-                       BIO_printf(err, "Error opening %s %s\n",
-                               key_descrip, file);
-                       ERR_print_errors(err);
-                       goto end;
-               }
-       if (format == FORMAT_ASN1)
-               {
-               pkey=d2i_PUBKEY_bio(key, NULL);
-               }
+        setvbuf(stdin, NULL, _IONBF, 0);
+# endif                         /* ndef OPENSSL_NO_SETVBUF_IONBF */
+#endif
+        BIO_set_fp(key, stdin, BIO_NOCLOSE);
+    } else if (BIO_read_filename(key, file) <= 0) {
+        BIO_printf(err, "Error opening %s %s\n", key_descrip, file);
+        ERR_print_errors(err);
+        goto end;
+    }
+    if (format == FORMAT_ASN1) {
+        pkey = d2i_PUBKEY_bio(key, NULL);
+    }
 #ifndef OPENSSL_NO_RSA
-       else if (format == FORMAT_ASN1RSA)
-               {
-               RSA *rsa;
-               rsa = d2i_RSAPublicKey_bio(key, NULL);
-               if (rsa)
-                       {
-                       pkey = EVP_PKEY_new();
-                       if (pkey)
-                               EVP_PKEY_set1_RSA(pkey, rsa);
-                       RSA_free(rsa);
-                       }
-               else
-                       pkey = NULL;
-               }
-       else if (format == FORMAT_PEMRSA)
-               {
-               RSA *rsa;
-               rsa = PEM_read_bio_RSAPublicKey(key, NULL, 
-                       (pem_password_cb *)password_callback, &cb_data);
-               if (rsa)
-                       {
-                       pkey = EVP_PKEY_new();
-                       if (pkey)
-                               EVP_PKEY_set1_RSA(pkey, rsa);
-                       RSA_free(rsa);
-                       }
-               else
-                       pkey = NULL;
-               }
-#endif
-       else if (format == FORMAT_PEM)
-               {
-               pkey=PEM_read_bio_PUBKEY(key,NULL,
-                       (pem_password_cb *)password_callback, &cb_data);
-               }
+    else if (format == FORMAT_ASN1RSA) {
+        RSA *rsa;
+        rsa = d2i_RSAPublicKey_bio(key, NULL);
+        if (rsa) {
+            pkey = EVP_PKEY_new();
+            if (pkey)
+                EVP_PKEY_set1_RSA(pkey, rsa);
+            RSA_free(rsa);
+        } else
+            pkey = NULL;
+    } else if (format == FORMAT_PEMRSA) {
+        RSA *rsa;
+        rsa = PEM_read_bio_RSAPublicKey(key, NULL,
+                                        (pem_password_cb *)password_callback,
+                                        &cb_data);
+        if (rsa) {
+            pkey = EVP_PKEY_new();
+            if (pkey)
+                EVP_PKEY_set1_RSA(pkey, rsa);
+            RSA_free(rsa);
+        } else
+            pkey = NULL;
+    }
+#endif
+    else if (format == FORMAT_PEM) {
+        pkey = PEM_read_bio_PUBKEY(key, NULL,
+                                   (pem_password_cb *)password_callback,
+                                   &cb_data);
+    }
 #if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
-       else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
-               pkey = load_netscape_key(err, key, file, key_descrip, format);
+    else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
+        pkey = load_netscape_key(err, key, file, key_descrip, format);
 #endif
 #if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
-       else if (format == FORMAT_MSBLOB)
-               pkey = b2i_PublicKey_bio(key);
+    else if (format == FORMAT_MSBLOB)
+        pkey = b2i_PublicKey_bio(key);
 #endif
-       else
-               {
-               BIO_printf(err,"bad input format specified for key file\n");
-               goto end;
-               }
+    else {
+        BIO_printf(err, "bad input format specified for key file\n");
+        goto end;
+    }
  end:
-       if (key != NULL) BIO_free(key);
-       if (pkey == NULL)
-               BIO_printf(err,"unable to load %s\n", key_descrip);
-       return(pkey);
-       }
+    if (key != NULL)
+        BIO_free(key);
+    if (pkey == NULL)
+        BIO_printf(err, "unable to load %s\n", key_descrip);
+    return (pkey);
+}
 
 #if !defined(OPENSSL_NO_RC4) && !defined(OPENSSL_NO_RSA)
-static EVP_PKEY *
-load_netscape_key(BIO *err, BIO *key, const char *file,
-               const char *key_descrip, int format)
-       {
-       EVP_PKEY *pkey;
-       BUF_MEM *buf;
-       RSA     *rsa;
-       const unsigned char *p;
-       int size, i;
-
-       buf=BUF_MEM_new();
-       pkey = EVP_PKEY_new();
-       size = 0;
-       if (buf == NULL || pkey == NULL)
-               goto error;
-       for (;;)
-               {
-               if (!BUF_MEM_grow_clean(buf,size+1024*10))
-                       goto error;
-               i = BIO_read(key, &(buf->data[size]), 1024*10);
-               size += i;
-               if (i == 0)
-                       break;
-               if (i < 0)
-                       {
-                               BIO_printf(err, "Error reading %s %s",
-                                       key_descrip, file);
-                               goto error;
-                       }
-               }
-       p=(unsigned char *)buf->data;
-       rsa = d2i_RSA_NET(NULL,&p,(long)size,NULL,
-               (format == FORMAT_IISSGC ? 1 : 0));
-       if (rsa == NULL)
-               goto error;
-       BUF_MEM_free(buf);
-       EVP_PKEY_set1_RSA(pkey, rsa);
-       return pkey;
-error:
-       BUF_MEM_free(buf);
-       EVP_PKEY_free(pkey);
-       return NULL;
-       }
-#endif /* ndef OPENSSL_NO_RC4 */
+static EVP_PKEY *load_netscape_key(BIO *err, BIO *key, const char *file,
+                                   const char *key_descrip, int format)
+{
+    EVP_PKEY *pkey;
+    BUF_MEM *buf;
+    RSA *rsa;
+    const unsigned char *p;
+    int size, i;
+
+    buf = BUF_MEM_new();
+    pkey = EVP_PKEY_new();
+    size = 0;
+    if (buf == NULL || pkey == NULL)
+        goto error;
+    for (;;) {
+        if (!BUF_MEM_grow_clean(buf, size + 1024 * 10))
+            goto error;
+        i = BIO_read(key, &(buf->data[size]), 1024 * 10);
+        size += i;
+        if (i == 0)
+            break;
+        if (i < 0) {
+            BIO_printf(err, "Error reading %s %s", key_descrip, file);
+            goto error;
+        }
+    }
+    p = (unsigned char *)buf->data;
+    rsa = d2i_RSA_NET(NULL, &p, (long)size, NULL,
+                      (format == FORMAT_IISSGC ? 1 : 0));
+    if (rsa == NULL)
+        goto error;
+    BUF_MEM_free(buf);
+    EVP_PKEY_set1_RSA(pkey, rsa);
+    return pkey;
+ error:
+    BUF_MEM_free(buf);
+    EVP_PKEY_free(pkey);
+    return NULL;
+}
+#endif                          /* ndef OPENSSL_NO_RC4 */
 
 static int load_certs_crls(BIO *err, const char *file, int format,
-       const char *pass, ENGINE *e, const char *desc,
-       STACK_OF(X509) **pcerts, STACK_OF(X509_CRL) **pcrls)
-       {
-       int i;
-       BIO *bio;
-       STACK_OF(X509_INFO) *xis = NULL;
-       X509_INFO *xi;
-       PW_CB_DATA cb_data;
-       int rv = 0;
-
-       cb_data.password = pass;
-       cb_data.prompt_info = file;
-
-       if (format != FORMAT_PEM)
-               {
-               BIO_printf(err,"bad input format specified for %s\n", desc);
-               return 0;
-               }
-
-       if (file == NULL)
-               bio = BIO_new_fp(stdin,BIO_NOCLOSE);
-       else
-               bio = BIO_new_file(file, "r");
-
-       if (bio == NULL)
-               {
-               BIO_printf(err, "Error opening %s %s\n",
-                               desc, file ? file : "stdin");
-               ERR_print_errors(err);
-               return 0;
-               }
-
-       xis = PEM_X509_INFO_read_bio(bio, NULL,
-                               (pem_password_cb *)password_callback, &cb_data);
-
-       BIO_free(bio);
-
-       if (pcerts)
-               {
-               *pcerts = sk_X509_new_null();
-               if (!*pcerts)
-                       goto end;
-               }
-
-       if (pcrls)
-               {
-               *pcrls = sk_X509_CRL_new_null();
-               if (!*pcrls)
-                       goto end;
-               }
-
-       for(i = 0; i < sk_X509_INFO_num(xis); i++)
-               {
-               xi = sk_X509_INFO_value (xis, i);
-               if (xi->x509 && pcerts)
-                       {
-                       if (!sk_X509_push(*pcerts, xi->x509))
-                               goto end;
-                       xi->x509 = NULL;
-                       }
-               if (xi->crl && pcrls)
-                       {
-                       if (!sk_X509_CRL_push(*pcrls, xi->crl))
-                               goto end;
-                       xi->crl = NULL;
-                       }
-               }
-
-       if (pcerts && sk_X509_num(*pcerts) > 0)
-               rv = 1;
-
-       if (pcrls && sk_X509_CRL_num(*pcrls) > 0)
-               rv = 1;
-
-       end:
-
-       if (xis)
-               sk_X509_INFO_pop_free(xis, X509_INFO_free);
-
-       if (rv == 0)
-               {
-               if (pcerts)
-                       {
-                       sk_X509_pop_free(*pcerts, X509_free);
-                       *pcerts = NULL;
-                       }
-               if (pcrls)
-                       {
-                       sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
-                       *pcrls = NULL;
-                       }
-               BIO_printf(err,"unable to load %s\n",
-                               pcerts ? "certificates" : "CRLs");
-               ERR_print_errors(err);
-               }
-       return rv;
-       }
+                           const char *pass, ENGINE *e, const char *desc,
+                           STACK_OF(X509) **pcerts,
+                           STACK_OF(X509_CRL) **pcrls)
+{
+    int i;
+    BIO *bio;
+    STACK_OF(X509_INFO) *xis = NULL;
+    X509_INFO *xi;
+    PW_CB_DATA cb_data;
+    int rv = 0;
+
+    cb_data.password = pass;
+    cb_data.prompt_info = file;
+
+    if (format != FORMAT_PEM) {
+        BIO_printf(err, "bad input format specified for %s\n", desc);
+        return 0;
+    }
+
+    if (file == NULL)
+        bio = BIO_new_fp(stdin, BIO_NOCLOSE);
+    else
+        bio = BIO_new_file(file, "r");
+
+    if (bio == NULL) {
+        BIO_printf(err, "Error opening %s %s\n", desc, file ? file : "stdin");
+        ERR_print_errors(err);
+        return 0;
+    }
+
+    xis = PEM_X509_INFO_read_bio(bio, NULL,
+                                 (pem_password_cb *)password_callback,
+                                 &cb_data);
+
+    BIO_free(bio);
+
+    if (pcerts) {
+        *pcerts = sk_X509_new_null();
+        if (!*pcerts)
+            goto end;
+    }
+
+    if (pcrls) {
+        *pcrls = sk_X509_CRL_new_null();
+        if (!*pcrls)
+            goto end;
+    }
+
+    for (i = 0; i < sk_X509_INFO_num(xis); i++) {
+        xi = sk_X509_INFO_value(xis, i);
+        if (xi->x509 && pcerts) {
+            if (!sk_X509_push(*pcerts, xi->x509))
+                goto end;
+            xi->x509 = NULL;
+        }
+        if (xi->crl && pcrls) {
+            if (!sk_X509_CRL_push(*pcrls, xi->crl))
+                goto end;
+            xi->crl = NULL;
+        }
+    }
+
+    if (pcerts && sk_X509_num(*pcerts) > 0)
+        rv = 1;
+
+    if (pcrls && sk_X509_CRL_num(*pcrls) > 0)
+        rv = 1;
+
+ end:
+
+    if (xis)
+        sk_X509_INFO_pop_free(xis, X509_INFO_free);
+
+    if (rv == 0) {
+        if (pcerts) {
+            sk_X509_pop_free(*pcerts, X509_free);
+            *pcerts = NULL;
+        }
+        if (pcrls) {
+            sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
+            *pcrls = NULL;
+        }
+        BIO_printf(err, "unable to load %s\n",
+                   pcerts ? "certificates" : "CRLs");
+        ERR_print_errors(err);
+    }
+    return rv;
+}
 
 STACK_OF(X509) *load_certs(BIO *err, const char *file, int format,
-       const char *pass, ENGINE *e, const char *desc)
-       {
-       STACK_OF(X509) *certs;
-       if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL))
-               return NULL;
-       return certs;
-       }       
+                           const char *pass, ENGINE *e, const char *desc)
+{
+    STACK_OF(X509) *certs;
+    if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL))
+        return NULL;
+    return certs;
+}
 
 STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format,
-       const char *pass, ENGINE *e, const char *desc)
-       {
-       STACK_OF(X509_CRL) *crls;
-       if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls))
-               return NULL;
-       return crls;
-       }       
-
-#define X509V3_EXT_UNKNOWN_MASK                (0xfL << 16)
+                              const char *pass, ENGINE *e, const char *desc)
+{
+    STACK_OF(X509_CRL) *crls;
+    if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls))
+        return NULL;
+    return crls;
+}
+
+#define X509V3_EXT_UNKNOWN_MASK         (0xfL << 16)
 /* Return error for unknown extensions */
-#define X509V3_EXT_DEFAULT             0
+#define X509V3_EXT_DEFAULT              0
 /* Print error for unknown extensions */
-#define X509V3_EXT_ERROR_UNKNOWN       (1L << 16)
+#define X509V3_EXT_ERROR_UNKNOWN        (1L << 16)
 /* ASN1 parse unknown extensions */
-#define X509V3_EXT_PARSE_UNKNOWN       (2L << 16)
+#define X509V3_EXT_PARSE_UNKNOWN        (2L << 16)
 /* BIO_dump unknown extensions */
-#define X509V3_EXT_DUMP_UNKNOWN                (3L << 16)
+#define X509V3_EXT_DUMP_UNKNOWN         (3L << 16)
 
 #define X509_FLAG_CA (X509_FLAG_NO_ISSUER | X509_FLAG_NO_PUBKEY | \
-                        X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION)
+                         X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION)
 
 int set_cert_ex(unsigned long *flags, const char *arg)
 {
-       static const NAME_EX_TBL cert_tbl[] = {
-               { "compatible", X509_FLAG_COMPAT, 0xffffffffl},
-               { "ca_default", X509_FLAG_CA, 0xffffffffl},
-            &nb