├── .gitignore
├── Android.mk
├── AndroidManifest.xml
├── CleanSpec.mk
├── MODULE_LICENSE_BSD_LIKE
├── NOTICE
├── README.android
├── README.md
├── ThirdPartyProject.prop
├── android-config.mk
├── android.testssl
├── CAss.cnf
├── Uss.cnf
├── server2.pem
├── testssl
└── testssl.sh
├── ant.properties
├── apps
├── Android.mk
├── CA.pl
├── CA.pl.in
├── CA.sh
├── app_rand.c
├── apps.c
├── apps.h
├── asn1pars.c
├── ca-cert.srl
├── ca-key.pem
├── ca-req.pem
├── ca.c
├── cert.pem
├── ciphers.c
├── client.pem
├── cms.c
├── crl.c
├── crl2p7.c
├── dgst.c
├── dh.c
├── dh1024.pem
├── dh2048.pem
├── dh4096.pem
├── dh512.pem
├── dhparam.c
├── dsa-ca.pem
├── dsa-pca.pem
├── dsa.c
├── dsa1024.pem
├── dsa512.pem
├── dsap.pem
├── dsaparam.c
├── ec.c
├── ecparam.c
├── enc.c
├── engine.c
├── errstr.c
├── gendh.c
├── gendsa.c
├── genpkey.c
├── genrsa.c
├── md4.c
├── nseq.c
├── ocsp.c
├── oid.cnf
├── openssl.c
├── openssl.cnf
├── passwd.c
├── pca-cert.srl
├── pca-key.pem
├── pca-req.pem
├── pkcs12.c
├── pkcs7.c
├── pkcs8.c
├── pkey.c
├── pkeyparam.c
├── pkeyutl.c
├── prime.c
├── privkey.pem
├── progs.h
├── progs.pl
├── rand.c
├── req.c
├── req.pem
├── rsa.c
├── rsa8192.pem
├── rsautl.c
├── s1024key.pem
├── s1024req.pem
├── s512-key.pem
├── s512-req.pem
├── s_apps.h
├── s_cb.c
├── s_client.c
├── s_server.c
├── s_socket.c
├── s_time.c
├── server.pem
├── server.srl
├── server2.pem
├── sess_id.c
├── smime.c
├── speed.c
├── spkac.c
├── testCA.pem
├── testdsa.h
├── testrsa.h
├── timeouts.h
├── verify.c
├── version.c
├── winrand.c
└── x509.c
├── build.xml
├── crypto
├── Android.mk
├── LPdir_nyi.c
├── LPdir_unix.c
├── LPdir_win.c
├── LPdir_wince.c
├── aes
│ ├── README
│ ├── aes.h
│ ├── aes_cbc.c
│ ├── aes_cfb.c
│ ├── aes_core.c
│ ├── aes_ctr.c
│ ├── aes_ecb.c
│ ├── aes_ige.c
│ ├── aes_locl.h
│ ├── aes_misc.c
│ ├── aes_ofb.c
│ ├── aes_wrap.c
│ ├── aes_x86core.c
│ └── asm
│ │ ├── aes-586.pl
│ │ ├── aes-armv4.pl
│ │ ├── aes-armv4.s
│ │ ├── aes-ia64.S
│ │ ├── aes-mips.pl
│ │ ├── aes-mips.s
│ │ ├── aes-ppc.pl
│ │ ├── aes-s390x.pl
│ │ ├── aes-sparcv9.pl
│ │ └── aes-x86_64.pl
├── alphacpuid.pl
├── asn1
│ ├── a_bitstr.c
│ ├── a_bool.c
│ ├── a_bytes.c
│ ├── a_d2i_fp.c
│ ├── a_digest.c
│ ├── a_dup.c
│ ├── a_enum.c
│ ├── a_gentm.c
│ ├── a_i2d_fp.c
│ ├── a_int.c
│ ├── a_mbstr.c
│ ├── a_object.c
│ ├── a_octet.c
│ ├── a_print.c
│ ├── a_set.c
│ ├── a_sign.c
│ ├── a_strex.c
│ ├── a_strnid.c
│ ├── a_time.c
│ ├── a_type.c
│ ├── a_utctm.c
│ ├── a_utf8.c
│ ├── a_verify.c
│ ├── ameth_lib.c
│ ├── asn1.h
│ ├── asn1_err.c
│ ├── asn1_gen.c
│ ├── asn1_lib.c
│ ├── asn1_locl.h
│ ├── asn1_mac.h
│ ├── asn1_par.c
│ ├── asn1t.h
│ ├── asn_mime.c
│ ├── asn_moid.c
│ ├── asn_pack.c
│ ├── bio_asn1.c
│ ├── bio_ndef.c
│ ├── charmap.h
│ ├── charmap.pl
│ ├── d2i_pr.c
│ ├── d2i_pu.c
│ ├── evp_asn1.c
│ ├── f_enum.c
│ ├── f_int.c
│ ├── f_string.c
│ ├── i2d_pr.c
│ ├── i2d_pu.c
│ ├── n_pkey.c
│ ├── nsseq.c
│ ├── p5_pbe.c
│ ├── p5_pbev2.c
│ ├── p8_pkey.c
│ ├── t_bitst.c
│ ├── t_crl.c
│ ├── t_pkey.c
│ ├── t_req.c
│ ├── t_spki.c
│ ├── t_x509.c
│ ├── t_x509a.c
│ ├── tasn_dec.c
│ ├── tasn_enc.c
│ ├── tasn_fre.c
│ ├── tasn_new.c
│ ├── tasn_prn.c
│ ├── tasn_typ.c
│ ├── tasn_utl.c
│ ├── x_algor.c
│ ├── x_attrib.c
│ ├── x_bignum.c
│ ├── x_crl.c
│ ├── x_exten.c
│ ├── x_info.c
│ ├── x_long.c
│ ├── x_name.c
│ ├── x_nx509.c
│ ├── x_pkey.c
│ ├── x_pubkey.c
│ ├── x_req.c
│ ├── x_sig.c
│ ├── x_spki.c
│ ├── x_val.c
│ ├── x_x509.c
│ └── x_x509a.c
├── bf
│ ├── COPYRIGHT
│ ├── asm
│ │ ├── bf-586.pl
│ │ └── bf-686.pl
│ ├── bf_cfb64.c
│ ├── bf_ecb.c
│ ├── bf_enc.c
│ ├── bf_locl.h
│ ├── bf_ofb64.c
│ ├── bf_pi.h
│ ├── bf_skey.c
│ └── blowfish.h
├── bio
│ ├── b_dump.c
│ ├── b_print.c
│ ├── b_sock.c
│ ├── bf_buff.c
│ ├── bf_lbuf.c
│ ├── bf_nbio.c
│ ├── bf_null.c
│ ├── bio.h
│ ├── bio_cb.c
│ ├── bio_err.c
│ ├── bio_lcl.h
│ ├── bio_lib.c
│ ├── bss_acpt.c
│ ├── bss_bio.c
│ ├── bss_conn.c
│ ├── bss_dgram.c
│ ├── bss_fd.c
│ ├── bss_file.c
│ ├── bss_log.c
│ ├── bss_mem.c
│ ├── bss_null.c
│ └── bss_sock.c
├── bn
│ ├── asm
│ │ ├── README
│ │ ├── alpha-mont.pl
│ │ ├── armv4-mont.pl
│ │ ├── armv4-mont.s
│ │ ├── bn-586.pl
│ │ ├── bn-mips.s
│ │ ├── co-586.pl
│ │ ├── ia64.S
│ │ ├── mips-mont.pl
│ │ ├── mips-mont.s
│ │ ├── mips.pl
│ │ ├── mips3-mont.pl
│ │ ├── mips3.s
│ │ ├── pa-risc2.s
│ │ ├── pa-risc2W.s
│ │ ├── ppc-mont.pl
│ │ ├── ppc.pl
│ │ ├── ppc64-mont.pl
│ │ ├── s390x-mont.pl
│ │ ├── s390x.S
│ │ ├── sparcv8.S
│ │ ├── sparcv8plus.S
│ │ ├── sparcv9-mont.pl
│ │ ├── sparcv9a-mont.pl
│ │ ├── via-mont.pl
│ │ ├── x86-mont.pl
│ │ ├── x86.pl
│ │ ├── x86
│ │ │ ├── add.pl
│ │ │ ├── comba.pl
│ │ │ ├── div.pl
│ │ │ ├── f
│ │ │ ├── mul.pl
│ │ │ ├── mul_add.pl
│ │ │ ├── sqr.pl
│ │ │ └── sub.pl
│ │ ├── x86_64-gcc.c
│ │ └── x86_64-mont.pl
│ ├── bn.h
│ ├── bn.mul
│ ├── bn_add.c
│ ├── bn_asm.c
│ ├── bn_blind.c
│ ├── bn_const.c
│ ├── bn_ctx.c
│ ├── bn_depr.c
│ ├── bn_div.c
│ ├── bn_err.c
│ ├── bn_exp.c
│ ├── bn_exp2.c
│ ├── bn_gcd.c
│ ├── bn_gf2m.c
│ ├── bn_kron.c
│ ├── bn_lcl.h
│ ├── bn_lib.c
│ ├── bn_mod.c
│ ├── bn_mont.c
│ ├── bn_mpi.c
│ ├── bn_mul.c
│ ├── bn_nist.c
│ ├── bn_prime.c
│ ├── bn_prime.h
│ ├── bn_prime.pl
│ ├── bn_print.c
│ ├── bn_rand.c
│ ├── bn_recp.c
│ ├── bn_shift.c
│ ├── bn_sqr.c
│ ├── bn_sqrt.c
│ ├── bn_word.c
│ ├── bnspeed.c
│ ├── bntest.c
│ ├── divtest.c
│ ├── exp.c
│ ├── expspeed.c
│ ├── exptest.c
│ └── todo
├── buffer
│ ├── buf_err.c
│ ├── buffer.c
│ └── buffer.h
├── comp
│ ├── c_rle.c
│ ├── c_zlib.c
│ ├── comp.h
│ ├── comp_err.c
│ └── comp_lib.c
├── conf
│ ├── README
│ ├── cnf_save.c
│ ├── conf.h
│ ├── conf_api.c
│ ├── conf_api.h
│ ├── conf_def.c
│ ├── conf_def.h
│ ├── conf_err.c
│ ├── conf_lib.c
│ ├── conf_mall.c
│ ├── conf_mod.c
│ ├── conf_sap.c
│ ├── keysets.pl
│ ├── ssleay.cnf
│ └── test.c
├── cpt_err.c
├── cryptlib.c
├── cryptlib.h
├── crypto.h
├── cversion.c
├── des
│ ├── COPYRIGHT
│ ├── DES.pm
│ ├── DES.xs
│ ├── FILES0
│ ├── INSTALL
│ ├── Imakefile
│ ├── KERBEROS
│ ├── README
│ ├── VERSION
│ ├── asm
│ │ ├── crypt586.pl
│ │ ├── des-586.pl
│ │ ├── des_enc.m4
│ │ ├── desboth.pl
│ │ └── readme
│ ├── cbc3_enc.c
│ ├── cbc_cksm.c
│ ├── cbc_enc.c
│ ├── cfb64ede.c
│ ├── cfb64enc.c
│ ├── cfb_enc.c
│ ├── des.c
│ ├── des.h
│ ├── des.pod
│ ├── des3s.cpp
│ ├── des_enc.c
│ ├── des_locl.h
│ ├── des_old.c
│ ├── des_old.h
│ ├── des_old2.c
│ ├── des_opts.c
│ ├── des_ver.h
│ ├── dess.cpp
│ ├── destest.c
│ ├── ecb3_enc.c
│ ├── ecb_enc.c
│ ├── ede_cbcm_enc.c
│ ├── enc_read.c
│ ├── enc_writ.c
│ ├── fcrypt.c
│ ├── fcrypt_b.c
│ ├── makefile.bc
│ ├── ncbc_enc.c
│ ├── ofb64ede.c
│ ├── ofb64enc.c
│ ├── ofb_enc.c
│ ├── options.txt
│ ├── pcbc_enc.c
│ ├── qud_cksm.c
│ ├── rand_key.c
│ ├── read2pwd.c
│ ├── read_pwd.c
│ ├── rpc_des.h
│ ├── rpc_enc.c
│ ├── rpw.c
│ ├── set_key.c
│ ├── speed.c
│ ├── spr.h
│ ├── str2key.c
│ ├── t
│ │ └── test
│ ├── times
│ │ ├── 486-50.sol
│ │ ├── 586-100.lnx
│ │ ├── 686-200.fre
│ │ ├── aix.cc
│ │ ├── alpha.cc
│ │ ├── hpux.cc
│ │ ├── sparc.gcc
│ │ └── usparc.cc
│ ├── typemap
│ └── xcbc_enc.c
├── dh
│ ├── dh.h
│ ├── dh1024.pem
│ ├── dh192.pem
│ ├── dh2048.pem
│ ├── dh4096.pem
│ ├── dh512.pem
│ ├── dh_ameth.c
│ ├── dh_asn1.c
│ ├── dh_check.c
│ ├── dh_depr.c
│ ├── dh_err.c
│ ├── dh_gen.c
│ ├── dh_key.c
│ ├── dh_lib.c
│ ├── dh_pmeth.c
│ ├── dhtest.c
│ ├── example
│ ├── generate
│ ├── p1024.c
│ ├── p192.c
│ └── p512.c
├── dsa
│ ├── README
│ ├── dsa.h
│ ├── dsa_ameth.c
│ ├── dsa_asn1.c
│ ├── dsa_depr.c
│ ├── dsa_err.c
│ ├── dsa_gen.c
│ ├── dsa_key.c
│ ├── dsa_lib.c
│ ├── dsa_locl.h
│ ├── dsa_ossl.c
│ ├── dsa_pmeth.c
│ ├── dsa_prn.c
│ ├── dsa_sign.c
│ ├── dsa_vrf.c
│ ├── dsagen.c
│ ├── dsatest.c
│ └── fips186a.txt
├── dso
│ ├── README
│ ├── dso.h
│ ├── dso_dl.c
│ ├── dso_dlfcn.c
│ ├── dso_err.c
│ ├── dso_lib.c
│ ├── dso_null.c
│ └── dso_openssl.c
├── ebcdic.c
├── ebcdic.h
├── ec
│ ├── ec.h
│ ├── ec2_mult.c
│ ├── ec2_smpl.c
│ ├── ec_ameth.c
│ ├── ec_asn1.c
│ ├── ec_check.c
│ ├── ec_curve.c
│ ├── ec_cvt.c
│ ├── ec_err.c
│ ├── ec_key.c
│ ├── ec_lcl.h
│ ├── ec_lib.c
│ ├── ec_mult.c
│ ├── ec_pmeth.c
│ ├── ec_print.c
│ ├── eck_prn.c
│ ├── ecp_mont.c
│ ├── ecp_nist.c
│ ├── ecp_smpl.c
│ └── ectest.c
├── ecdh
│ ├── ecdh.h
│ ├── ecdhtest.c
│ ├── ech_err.c
│ ├── ech_key.c
│ ├── ech_lib.c
│ ├── ech_locl.h
│ └── ech_ossl.c
├── ecdsa
│ ├── ecdsa.h
│ ├── ecdsatest.c
│ ├── ecs_asn1.c
│ ├── ecs_err.c
│ ├── ecs_lib.c
│ ├── ecs_locl.h
│ ├── ecs_ossl.c
│ ├── ecs_sign.c
│ └── ecs_vrf.c
├── engine
│ ├── README
│ ├── eng_all.c
│ ├── eng_cnf.c
│ ├── eng_cryptodev.c
│ ├── eng_ctrl.c
│ ├── eng_dyn.c
│ ├── eng_err.c
│ ├── eng_fat.c
│ ├── eng_init.c
│ ├── eng_int.h
│ ├── eng_lib.c
│ ├── eng_list.c
│ ├── eng_openssl.c
│ ├── eng_pkey.c
│ ├── eng_table.c
│ ├── engine.h
│ ├── enginetest.c
│ ├── tb_cipher.c
│ ├── tb_dh.c
│ ├── tb_digest.c
│ ├── tb_dsa.c
│ ├── tb_ecdh.c
│ ├── tb_ecdsa.c
│ ├── tb_rand.c
│ ├── tb_rsa.c
│ └── tb_store.c
├── err
│ ├── err.c
│ ├── err.h
│ ├── err_all.c
│ ├── err_prn.c
│ └── openssl.ec
├── evp
│ ├── bio_b64.c
│ ├── bio_enc.c
│ ├── bio_md.c
│ ├── bio_ok.c
│ ├── c_all.c
│ ├── c_allc.c
│ ├── c_alld.c
│ ├── digest.c
│ ├── e_aes.c
│ ├── e_bf.c
│ ├── e_camellia.c
│ ├── e_cast.c
│ ├── e_des.c
│ ├── e_des3.c
│ ├── e_dsa.c
│ ├── e_idea.c
│ ├── e_null.c
│ ├── e_old.c
│ ├── e_rc2.c
│ ├── e_rc4.c
│ ├── e_rc5.c
│ ├── e_seed.c
│ ├── e_xcbc_d.c
│ ├── encode.c
│ ├── evp.h
│ ├── evp_acnf.c
│ ├── evp_enc.c
│ ├── evp_err.c
│ ├── evp_key.c
│ ├── evp_lib.c
│ ├── evp_locl.h
│ ├── evp_pbe.c
│ ├── evp_pkey.c
│ ├── evp_test.c
│ ├── evptests.txt
│ ├── m_dss.c
│ ├── m_dss1.c
│ ├── m_ecdsa.c
│ ├── m_md4.c
│ ├── m_md5.c
│ ├── m_mdc2.c
│ ├── m_null.c
│ ├── m_ripemd.c
│ ├── m_sha1.c
│ ├── m_sigver.c
│ ├── m_wp.c
│ ├── names.c
│ ├── openbsd_hw.c
│ ├── p5_crpt.c
│ ├── p5_crpt2.c
│ ├── p_dec.c
│ ├── p_enc.c
│ ├── p_lib.c
│ ├── p_open.c
│ ├── p_seal.c
│ ├── p_sign.c
│ ├── p_verify.c
│ ├── pmeth_fn.c
│ ├── pmeth_gn.c
│ └── pmeth_lib.c
├── ex_data.c
├── hmac
│ ├── hm_ameth.c
│ ├── hm_pmeth.c
│ ├── hmac.c
│ ├── hmac.h
│ └── hmactest.c
├── ia64cpuid.S
├── jpake
│ ├── jpake.c
│ ├── jpake.h
│ ├── jpake_err.c
│ └── jpaketest.c
├── krb5
│ ├── krb5_asn.c
│ └── krb5_asn.h
├── lhash
│ ├── lh_stats.c
│ ├── lh_test.c
│ ├── lhash.c
│ ├── lhash.h
│ └── num.pl
├── md32_common.h
├── md4
│ ├── md4.c
│ ├── md4.h
│ ├── md4_dgst.c
│ ├── md4_locl.h
│ ├── md4_one.c
│ ├── md4s.cpp
│ └── md4test.c
├── md5
│ ├── asm
│ │ ├── md5-586.pl
│ │ ├── md5-ia64.S
│ │ └── md5-x86_64.pl
│ ├── md5.c
│ ├── md5.h
│ ├── md5_dgst.c
│ ├── md5_locl.h
│ ├── md5_one.c
│ ├── md5s.cpp
│ └── md5test.c
├── mdc2
│ ├── mdc2.h
│ ├── mdc2_one.c
│ ├── mdc2dgst.c
│ └── mdc2test.c
├── mem.c
├── mem_clr.c
├── mem_dbg.c
├── modes
│ ├── cbc128.c
│ ├── cfb128.c
│ ├── ctr128.c
│ └── ofb128.c
├── o_dir.c
├── o_dir.h
├── o_dir_test.c
├── o_str.c
├── o_str.h
├── o_time.c
├── o_time.h
├── objects
│ ├── o_names.c
│ ├── obj_dat.c
│ ├── obj_dat.h
│ ├── obj_dat.pl
│ ├── obj_err.c
│ ├── obj_lib.c
│ ├── obj_mac.h
│ ├── obj_mac.num
│ ├── obj_xref.c
│ ├── obj_xref.h
│ ├── obj_xref.txt
│ ├── objects.README
│ ├── objects.h
│ ├── objects.pl
│ ├── objects.txt
│ └── objxref.pl
├── ocsp
│ ├── ocsp.h
│ ├── ocsp_asn.c
│ ├── ocsp_cl.c
│ ├── ocsp_err.c
│ ├── ocsp_ext.c
│ ├── ocsp_ht.c
│ ├── ocsp_lib.c
│ ├── ocsp_prn.c
│ ├── ocsp_srv.c
│ └── ocsp_vfy.c
├── opensslconf.h
├── opensslconf.h.in
├── opensslv.h
├── ossl_typ.h
├── pem
│ ├── message
│ ├── pem.h
│ ├── pem2.h
│ ├── pem_all.c
│ ├── pem_err.c
│ ├── pem_info.c
│ ├── pem_lib.c
│ ├── pem_oth.c
│ ├── pem_pk8.c
│ ├── pem_pkey.c
│ ├── pem_seal.c
│ ├── pem_sign.c
│ ├── pem_x509.c
│ ├── pem_xaux.c
│ ├── pkcs7.lis
│ └── pvkfmt.c
├── perlasm
│ ├── cbc.pl
│ ├── ppc-xlate.pl
│ ├── readme
│ ├── x86_64-xlate.pl
│ ├── x86asm.pl
│ ├── x86gas.pl
│ ├── x86masm.pl
│ └── x86nasm.pl
├── pkcs12
│ ├── p12_add.c
│ ├── p12_asn.c
│ ├── p12_attr.c
│ ├── p12_crpt.c
│ ├── p12_crt.c
│ ├── p12_decr.c
│ ├── p12_init.c
│ ├── p12_key.c
│ ├── p12_kiss.c
│ ├── p12_mutl.c
│ ├── p12_npas.c
│ ├── p12_p8d.c
│ ├── p12_p8e.c
│ ├── p12_utl.c
│ ├── pk12err.c
│ └── pkcs12.h
├── pkcs7
│ ├── bio_ber.c
│ ├── dec.c
│ ├── des.pem
│ ├── doc
│ ├── enc.c
│ ├── es1.pem
│ ├── example.c
│ ├── example.h
│ ├── info.pem
│ ├── infokey.pem
│ ├── p7
│ │ ├── a1
│ │ ├── a2
│ │ ├── cert.p7c
│ │ ├── smime.p7m
│ │ └── smime.p7s
│ ├── pk7_asn1.c
│ ├── pk7_attr.c
│ ├── pk7_dgst.c
│ ├── pk7_doit.c
│ ├── pk7_enc.c
│ ├── pk7_lib.c
│ ├── pk7_mime.c
│ ├── pk7_smime.c
│ ├── pkcs7.h
│ ├── pkcs7err.c
│ ├── server.pem
│ ├── sign.c
│ ├── t
│ │ ├── 3des.pem
│ │ ├── 3dess.pem
│ │ ├── c.pem
│ │ ├── ff
│ │ ├── msie-e
│ │ ├── msie-e.pem
│ │ ├── msie-enc-01
│ │ ├── msie-enc-01.pem
│ │ ├── msie-enc-02
│ │ ├── msie-enc-02.pem
│ │ ├── msie-s-a-e
│ │ ├── msie-s-a-e.pem
│ │ ├── nav-smime
│ │ ├── s.pem
│ │ └── server.pem
│ └── verify.c
├── ppccpuid.pl
├── pqueue
│ ├── pq_test.c
│ ├── pqueue.c
│ └── pqueue.h
├── rand
│ ├── md_rand.c
│ ├── rand.h
│ ├── rand_egd.c
│ ├── rand_err.c
│ ├── rand_lcl.h
│ ├── rand_lib.c
│ ├── rand_nw.c
│ ├── rand_os2.c
│ ├── rand_unix.c
│ ├── rand_win.c
│ ├── randfile.c
│ └── randtest.c
├── rc2
│ ├── rc2.h
│ ├── rc2_cbc.c
│ ├── rc2_ecb.c
│ ├── rc2_locl.h
│ ├── rc2_skey.c
│ ├── rc2cfb64.c
│ ├── rc2ofb64.c
│ ├── rc2speed.c
│ ├── rc2test.c
│ ├── rrc2.doc
│ ├── tab.c
│ └── version
├── rc4
│ ├── asm
│ │ ├── rc4-586.pl
│ │ ├── rc4-ia64.pl
│ │ ├── rc4-s390x.pl
│ │ └── rc4-x86_64.pl
│ ├── rc4.c
│ ├── rc4.h
│ ├── rc4_enc.c
│ ├── rc4_locl.h
│ ├── rc4_skey.c
│ ├── rc4s.cpp
│ ├── rc4speed.c
│ ├── rc4test.c
│ └── rrc4.doc
├── ripemd
│ ├── README
│ ├── asm
│ │ ├── rips.cpp
│ │ └── rmd-586.pl
│ ├── ripemd.h
│ ├── rmd160.c
│ ├── rmd_dgst.c
│ ├── rmd_locl.h
│ ├── rmd_one.c
│ ├── rmdconst.h
│ └── rmdtest.c
├── rsa
│ ├── rsa.h
│ ├── rsa_ameth.c
│ ├── rsa_asn1.c
│ ├── rsa_chk.c
│ ├── rsa_depr.c
│ ├── rsa_eay.c
│ ├── rsa_err.c
│ ├── rsa_gen.c
│ ├── rsa_lib.c
│ ├── rsa_locl.h
│ ├── rsa_none.c
│ ├── rsa_null.c
│ ├── rsa_oaep.c
│ ├── rsa_pk1.c
│ ├── rsa_pmeth.c
│ ├── rsa_prn.c
│ ├── rsa_pss.c
│ ├── rsa_saos.c
│ ├── rsa_sign.c
│ ├── rsa_ssl.c
│ ├── rsa_test.c
│ └── rsa_x931.c
├── s390xcap.c
├── s390xcpuid.S
├── sha
│ ├── asm
│ │ ├── README
│ │ ├── sha1-586.pl
│ │ ├── sha1-armv4-large.pl
│ │ ├── sha1-armv4-large.s
│ │ ├── sha1-ia64.pl
│ │ ├── sha1-mips.pl
│ │ ├── sha1-mips.s
│ │ ├── sha1-ppc.pl
│ │ ├── sha1-s390x.pl
│ │ ├── sha1-sparcv9.pl
│ │ ├── sha1-sparcv9a.pl
│ │ ├── sha1-thumb.pl
│ │ ├── sha1-x86_64.pl
│ │ ├── sha256-586.pl
│ │ ├── sha256-armv4.pl
│ │ ├── sha256-armv4.s
│ │ ├── sha256-mips.s
│ │ ├── sha512-586.pl
│ │ ├── sha512-armv4.pl
│ │ ├── sha512-armv4.s
│ │ ├── sha512-ia64.pl
│ │ ├── sha512-mips.pl
│ │ ├── sha512-ppc.pl
│ │ ├── sha512-s390x.pl
│ │ ├── sha512-sparcv9.pl
│ │ └── sha512-x86_64.pl
│ ├── sha.c
│ ├── sha.h
│ ├── sha1.c
│ ├── sha1_one.c
│ ├── sha1dgst.c
│ ├── sha1test.c
│ ├── sha256.c
│ ├── sha256t.c
│ ├── sha512.c
│ ├── sha512t.c
│ ├── sha_dgst.c
│ ├── sha_locl.h
│ └── shatest.c
├── sparccpuid.S
├── sparcv9cap.c
├── stack
│ ├── safestack.h
│ ├── stack.c
│ └── stack.h
├── store
│ ├── README
│ ├── store.h
│ ├── str_err.c
│ ├── str_lib.c
│ ├── str_locl.h
│ ├── str_mem.c
│ └── str_meth.c
├── symhacks.h
├── threads
│ ├── README
│ ├── mttest.c
│ ├── netware.bat
│ ├── profile.sh
│ ├── ptest.bat
│ ├── pthread.sh
│ ├── pthread2.sh
│ ├── purify.sh
│ ├── solaris.sh
│ └── th-lock.c
├── ts
│ └── ts_err.c
├── txt_db
│ ├── txt_db.c
│ └── txt_db.h
├── ui
│ ├── ui.h
│ ├── ui_compat.c
│ ├── ui_compat.h
│ ├── ui_err.c
│ ├── ui_lib.c
│ ├── ui_locl.h
│ ├── ui_openssl.c
│ └── ui_util.c
├── uid.c
├── x509
│ ├── by_dir.c
│ ├── by_file.c
│ ├── x509.h
│ ├── x509_att.c
│ ├── x509_cmp.c
│ ├── x509_d2.c
│ ├── x509_def.c
│ ├── x509_err.c
│ ├── x509_ext.c
│ ├── x509_lu.c
│ ├── x509_obj.c
│ ├── x509_r2x.c
│ ├── x509_req.c
│ ├── x509_set.c
│ ├── x509_trs.c
│ ├── x509_txt.c
│ ├── x509_v3.c
│ ├── x509_vfy.c
│ ├── x509_vfy.h
│ ├── x509_vpm.c
│ ├── x509cset.c
│ ├── x509name.c
│ ├── x509rset.c
│ ├── x509spki.c
│ ├── x509type.c
│ └── x_all.c
├── x509v3
│ ├── ext_dat.h
│ ├── pcy_cache.c
│ ├── pcy_data.c
│ ├── pcy_int.h
│ ├── pcy_lib.c
│ ├── pcy_map.c
│ ├── pcy_node.c
│ ├── pcy_tree.c
│ ├── tabtest.c
│ ├── v3_addr.c
│ ├── v3_akey.c
│ ├── v3_akeya.c
│ ├── v3_alt.c
│ ├── v3_asid.c
│ ├── v3_bcons.c
│ ├── v3_bitst.c
│ ├── v3_conf.c
│ ├── v3_cpols.c
│ ├── v3_crld.c
│ ├── v3_enum.c
│ ├── v3_extku.c
│ ├── v3_genn.c
│ ├── v3_ia5.c
│ ├── v3_info.c
│ ├── v3_int.c
│ ├── v3_lib.c
│ ├── v3_ncons.c
│ ├── v3_ocsp.c
│ ├── v3_pci.c
│ ├── v3_pcia.c
│ ├── v3_pcons.c
│ ├── v3_pku.c
│ ├── v3_pmaps.c
│ ├── v3_prn.c
│ ├── v3_purp.c
│ ├── v3_skey.c
│ ├── v3_sxnet.c
│ ├── v3_utl.c
│ ├── v3conf.c
│ ├── v3err.c
│ ├── v3prin.c
│ └── x509v3.h
├── x86_64cpuid.pl
└── x86cpuid.pl
├── e_os.h
├── e_os2.h
├── import_openssl.sh
├── include
└── openssl
│ ├── aes.h
│ ├── asn1.h
│ ├── asn1_mac.h
│ ├── asn1t.h
│ ├── bio.h
│ ├── blowfish.h
│ ├── bn.h
│ ├── buffer.h
│ ├── comp.h
│ ├── conf.h
│ ├── conf_api.h
│ ├── crypto.h
│ ├── des.h
│ ├── des_old.h
│ ├── dh.h
│ ├── dsa.h
│ ├── dso.h
│ ├── dtls1.h
│ ├── e_os2.h
│ ├── ebcdic.h
│ ├── ec.h
│ ├── ecdh.h
│ ├── ecdsa.h
│ ├── engine.h
│ ├── err.h
│ ├── evp.h
│ ├── hmac.h
│ ├── krb5_asn.h
│ ├── kssl.h
│ ├── lhash.h
│ ├── md4.h
│ ├── md5.h
│ ├── modes.h
│ ├── obj_mac.h
│ ├── objects.h
│ ├── ocsp.h
│ ├── opensslconf.h
│ ├── opensslv.h
│ ├── ossl_typ.h
│ ├── pem.h
│ ├── pem2.h
│ ├── pkcs12.h
│ ├── pkcs7.h
│ ├── pqueue.h
│ ├── rand.h
│ ├── rc2.h
│ ├── rc4.h
│ ├── ripemd.h
│ ├── rsa.h
│ ├── safestack.h
│ ├── sha.h
│ ├── ssl.h
│ ├── ssl2.h
│ ├── ssl23.h
│ ├── ssl3.h
│ ├── stack.h
│ ├── symhacks.h
│ ├── tls1.h
│ ├── ts.h
│ ├── txt_db.h
│ ├── ui.h
│ ├── ui_compat.h
│ ├── x509.h
│ ├── x509_vfy.h
│ └── x509v3.h
├── jni
└── Application.mk
├── openssl.config
├── openssl.version
├── patches
├── README
├── apps_Android.mk
├── crypto_Android.mk
├── handshake_cutthrough.patch
├── jsse.patch
├── mips_asm.patch
├── npn.patch
├── progs.patch
├── sha1_armv4_large.patch
├── small_records.patch
├── ssl_Android.mk
├── sslv3_uninit_padding.patch
└── testssl.sh
├── proguard-project.txt
├── project.properties
└── ssl
├── Android.mk
├── Makefile
├── bio_ssl.c
├── d1_both.c
├── d1_clnt.c
├── d1_enc.c
├── d1_lib.c
├── d1_meth.c
├── d1_pkt.c
├── d1_srvr.c
├── dtls1.h
├── kssl.c
├── kssl.h
├── kssl_lcl.h
├── s23_clnt.c
├── s23_lib.c
├── s23_meth.c
├── s23_pkt.c
├── s23_srvr.c
├── s2_clnt.c
├── s2_enc.c
├── s2_lib.c
├── s2_meth.c
├── s2_pkt.c
├── s2_srvr.c
├── s3_both.c
├── s3_clnt.c
├── s3_enc.c
├── s3_lib.c
├── s3_meth.c
├── s3_pkt.c
├── s3_srvr.c
├── ssl.h
├── ssl2.h
├── ssl23.h
├── ssl3.h
├── ssl_algs.c
├── ssl_asn1.c
├── ssl_cert.c
├── ssl_ciph.c
├── ssl_err.c
├── ssl_err2.c
├── ssl_lib.c
├── ssl_locl.h
├── ssl_rsa.c
├── ssl_sess.c
├── ssl_stat.c
├── ssl_txt.c
├── ssltest.c
├── t1_clnt.c
├── t1_enc.c
├── t1_lib.c
├── t1_meth.c
├── t1_reneg.c
├── t1_srvr.c
└── tls1.h
/.gitignore:
--------------------------------------------------------------------------------
1 | libs
2 | obj
3 | local.properties
4 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | subdirs := $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk, \
4 | crypto \
5 | ssl \
6 | apps \
7 | ))
8 |
9 | include $(subdirs)
10 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/MODULE_LICENSE_BSD_LIKE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/MODULE_LICENSE_BSD_LIKE
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | This is the official Android OpenSSL sources with the makefiles lightly patched to build as an external project with the Android NDK. Similar to https://github.com/eighthave/openssl-android but updated for Android 4.0.3 (OpenSSL 1.0.0e) and NDK r8d.
2 |
3 | To build, run:
4 | ```
5 | ndk-build -j $(getconf _NPROCESSORS_ONLN)
6 | ```
7 |
8 | * Upstream: https://android.googlesource.com/platform/external/openssl
9 | * Makefile patches inpired by: https://github.com/eighthave/openssl-android
10 |
11 | To see the patches, run:
12 |
13 | git remote add upstream https://android.googlesource.com/platform/external/openssl
14 | git fetch upstream
15 | git diff upstream/ics-plus-aosp
16 |
17 |
18 | # Background
19 | Although Android ships with OpenSSL, it understandably doesn't provide libcrypto and libssl as part of its public API. Thus developers porting OpenSSL using apps to Android need a project like this.
20 |
--------------------------------------------------------------------------------
/ThirdPartyProject.prop:
--------------------------------------------------------------------------------
1 | # Copyright 2010 Google Inc. All Rights Reserved.
2 | #Fri Jul 16 10:03:09 PDT 2010
3 | currentVersion=1.0.0e
4 | version=1.0.0e
5 | isNative=true
6 | feedurl=http\://www.openssl.org/
7 | name=openssl
8 | keywords=openssl
9 | onDevice=true
10 | homepage=http\://www.openssl.org/
11 |
--------------------------------------------------------------------------------
/android-config.mk:
--------------------------------------------------------------------------------
1 | #
2 | # These flags represent the build-time configuration of openssl for android
3 | #
4 | # They were pruned from the "Makefile" generated by running ./Configure from import_openssl.sh
5 | #
6 |
7 | # From CLFAG=
8 | LOCAL_CFLAGS += -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN #-DTERMIO
9 |
10 | # From DEPFLAG=
11 | LOCAL_CFLAGS += -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CAST -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_SHA0 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_STORE -DOPENSSL_NO_WHIRLPOOL
12 |
13 | # Extra
14 | LOCAL_CFLAGS += -DOPENSSL_NO_HW -DOPENSSL_NO_ENGINE -DZLIB
15 |
16 | # Debug
17 | # LOCAL_CFLAGS += -DCIPHER_DEBUG
18 |
--------------------------------------------------------------------------------
/android.testssl/CAss.cnf:
--------------------------------------------------------------------------------
1 | #
2 | # SSLeay example configuration file.
3 | # This is mostly being used for generation of certificate requests.
4 | #
5 |
6 | RANDFILE = /sdcard/android.testssl/.rnd
7 |
8 | ####################################################################
9 | [ req ]
10 | default_bits = 512
11 | default_keyfile = keySS.pem
12 | distinguished_name = req_distinguished_name
13 | encrypt_rsa_key = no
14 | default_md = sha1
15 |
16 | [ req_distinguished_name ]
17 | countryName = Country Name (2 letter code)
18 | countryName_default = AU
19 | countryName_value = AU
20 |
21 | organizationName = Organization Name (eg, company)
22 | organizationName_value = Dodgy Brothers
23 |
24 | commonName = Common Name (eg, YOUR name)
25 | commonName_value = Dodgy CA
26 |
27 | ####################################################################
28 | [ ca ]
29 | default_ca = CA_default # The default ca section
30 |
31 | ####################################################################
32 | [ CA_default ]
33 |
34 | dir = ./demoCA # Where everything is kept
35 | certs = $dir/certs # Where the issued certs are kept
36 | crl_dir = $dir/crl # Where the issued crl are kept
37 | database = $dir/index.txt # database index file.
38 | #unique_subject = no # Set to 'no' to allow creation of
39 | # several ctificates with same subject.
40 | new_certs_dir = $dir/newcerts # default place for new certs.
41 |
42 | certificate = $dir/cacert.pem # The CA certificate
43 | serial = $dir/serial # The current serial number
44 | crl = $dir/crl.pem # The current CRL
45 | private_key = $dir/private/cakey.pem# The private key
46 | RANDFILE = $dir/private/.rand # private random number file
47 |
48 | x509_extensions = v3_ca # The extentions to add to the cert
49 |
50 | name_opt = ca_default # Subject Name options
51 | cert_opt = ca_default # Certificate field options
52 |
53 | default_days = 365 # how long to certify for
54 | default_crl_days= 30 # how long before next CRL
55 | default_md = md5 # which md to use.
56 | preserve = no # keep passed DN ordering
57 |
58 | policy = policy_anything
59 |
60 | [ policy_anything ]
61 | countryName = optional
62 | stateOrProvinceName = optional
63 | localityName = optional
64 | organizationName = optional
65 | organizationalUnitName = optional
66 | commonName = supplied
67 | emailAddress = optional
68 |
69 |
70 |
71 | [ v3_ca ]
72 | subjectKeyIdentifier=hash
73 | authorityKeyIdentifier=keyid:always,issuer:always
74 | basicConstraints = CA:true,pathlen:1
75 | keyUsage = cRLSign, keyCertSign
76 | issuerAltName=issuer:copy
77 |
--------------------------------------------------------------------------------
/android.testssl/Uss.cnf:
--------------------------------------------------------------------------------
1 | #
2 | # SSLeay example configuration file.
3 | # This is mostly being used for generation of certificate requests.
4 | #
5 |
6 | RANDFILE = /sdcard/android.testssl/.rnd
7 |
8 | ####################################################################
9 | [ req ]
10 | default_bits = 512
11 | default_keyfile = keySS.pem
12 | distinguished_name = req_distinguished_name
13 | encrypt_rsa_key = no
14 | default_md = md2
15 |
16 | [ req_distinguished_name ]
17 | countryName = Country Name (2 letter code)
18 | countryName_default = AU
19 | countryName_value = AU
20 |
21 | organizationName = Organization Name (eg, company)
22 | organizationName_value = Dodgy Brothers
23 |
24 | 0.commonName = Common Name (eg, YOUR name)
25 | 0.commonName_value = Brother 1
26 |
27 | 1.commonName = Common Name (eg, YOUR name)
28 | 1.commonName_value = Brother 2
29 |
30 | [ v3_ee ]
31 | subjectKeyIdentifier=hash
32 | authorityKeyIdentifier=keyid,issuer:always
33 | basicConstraints = CA:false
34 | keyUsage = nonRepudiation, digitalSignature, keyEncipherment
35 | issuerAltName=issuer:copy
36 |
37 |
--------------------------------------------------------------------------------
/android.testssl/testssl.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2010 The Android Open Source Project
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | #
19 | # Android testssl.sh driver script for openssl's testssl
20 | #
21 | # based on openssl's test/testss script and test/Makefile's test_ssl target
22 | #
23 |
24 | set -e
25 | trap "echo Exiting on unexpected error." ERR
26 |
27 | device=/sdcard/android.testssl
28 |
29 | digest='-sha1'
30 | reqcmd="adb shell /system/bin/openssl req"
31 | x509cmd="adb shell /system/bin/openssl x509 $digest"
32 |
33 | CAkey="$device/keyCA.ss"
34 | CAcert="$device/certCA.ss"
35 | CAreq="$device/reqCA.ss"
36 | CAconf="$device/CAss.cnf"
37 |
38 | Uconf="$device/Uss.cnf"
39 | Ureq="$device/reqU.ss"
40 | Ukey="$device/keyU.ss"
41 | Ucert="$device/certU.ss"
42 |
43 | echo
44 | echo "setting up"
45 | adb remount
46 | adb shell rm -r $device
47 | adb shell mkdir $device
48 |
49 | echo
50 | echo "pushing test files to device"
51 | adb push . $device
52 |
53 | echo
54 | echo "make a certificate request using 'req'"
55 | adb shell "echo \"string to make the random number generator think it has entropy\" >> $device/.rnd"
56 | req_new='-new'
57 | $reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new
58 |
59 | echo
60 | echo "convert the certificate request into a self signed certificate using 'x509'"
61 | $x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey -extfile $CAconf -extensions v3_ca
62 |
63 | echo
64 | echo "make a user certificate request using 'req'"
65 | $reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new
66 |
67 | echo
68 | echo "sign user certificate request with the just created CA via 'x509'"
69 | $x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -extfile $Uconf -extensions v3_ee
70 |
71 | echo
72 | echo "running testssl"
73 | ./testssl $Ukey $Ucert $CAcert
74 |
75 | echo
76 | echo "cleaning up"
77 | adb shell rm -r $device
78 |
--------------------------------------------------------------------------------
/ant.properties:
--------------------------------------------------------------------------------
1 | # This file is used to override default values used by the Ant build system.
2 | #
3 | # This file must be checked into Version Control Systems, as it is
4 | # integral to the build system of your project.
5 |
6 | # This file is only used by the Ant script.
7 |
8 | # You can use this to override default values such as
9 | # 'source.dir' for the location of your java source folder and
10 | # 'out.dir' for the location of your output folder.
11 |
12 | # You can also use it define how the release builds are signed by declaring
13 | # the following properties:
14 | # 'key.store' for the location of your keystore and
15 | # 'key.alias' for the name of the key to use.
16 | # The password will be asked during the build when you use the 'release' target.
17 |
18 |
--------------------------------------------------------------------------------
/apps/Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright 2006 The Android Open Source Project
2 |
3 | LOCAL_PATH:= $(call my-dir)
4 |
5 | local_src_files:= \
6 | app_rand.c \
7 | apps.c \
8 | asn1pars.c \
9 | ca.c \
10 | ciphers.c \
11 | crl.c \
12 | crl2p7.c \
13 | dgst.c \
14 | dh.c \
15 | dhparam.c \
16 | dsa.c \
17 | dsaparam.c \
18 | ecparam.c \
19 | ec.c \
20 | enc.c \
21 | engine.c \
22 | errstr.c \
23 | gendh.c \
24 | gendsa.c \
25 | genpkey.c \
26 | genrsa.c \
27 | nseq.c \
28 | ocsp.c \
29 | openssl.c \
30 | passwd.c \
31 | pkcs12.c \
32 | pkcs7.c \
33 | pkcs8.c \
34 | pkey.c \
35 | pkeyparam.c \
36 | pkeyutl.c \
37 | prime.c \
38 | rand.c \
39 | req.c \
40 | rsa.c \
41 | rsautl.c \
42 | s_cb.c \
43 | s_client.c \
44 | s_server.c \
45 | s_socket.c \
46 | s_time.c \
47 | sess_id.c \
48 | smime.c \
49 | speed.c \
50 | spkac.c \
51 | verify.c \
52 | version.c \
53 | x509.c
54 |
55 | local_shared_libraries := \
56 | libssl \
57 | libcrypto
58 |
59 | local_c_includes := \
60 | $(NDK_PROJECT_PATH) \
61 | $(NDK_PROJECT_PATH)/include
62 |
63 | local_cflags := -DMONOLITH
64 |
65 | # These flags omit whole features from the commandline "openssl".
66 | # However, portions of these features are actually turned on.
67 | local_cflags += -DOPENSSL_NO_DTLS1
68 |
69 | include $(CLEAR_VARS)
70 | LOCAL_MODULE:= openssl
71 | LOCAL_MODULE_TAGS := optional
72 | LOCAL_SRC_FILES := $(local_src_files)
73 | LOCAL_SHARED_LIBRARIES := $(local_shared_libraries)
74 | # libcrypto.so needs libz.so which is provided by the NDK
75 | LOCAL_LDLIBS := -lz
76 | LOCAL_C_INCLUDES := $(local_c_includes)
77 | LOCAL_CFLAGS := $(local_cflags)
78 | include $(LOCAL_PATH)/../android-config.mk
79 | include $(BUILD_EXECUTABLE)
80 |
81 | include $(CLEAR_VARS)
82 | LOCAL_MODULE:= openssl
83 | LOCAL_MODULE_TAGS := optional
84 | LOCAL_SRC_FILES := $(local_src_files)
85 | LOCAL_SHARED_LIBRARIES := $(local_shared_libraries)
86 | LOCAL_C_INCLUDES := $(local_c_includes)
87 | LOCAL_CFLAGS := $(local_cflags)
88 | include $(LOCAL_PATH)/../android-config.mk
89 | # include $(BUILD_HOST_EXECUTABLE)
90 |
--------------------------------------------------------------------------------
/apps/ca-cert.srl:
--------------------------------------------------------------------------------
1 | 07
2 |
--------------------------------------------------------------------------------
/apps/ca-key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425
3 | gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd
4 | 2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB
5 | AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6
6 | hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2
7 | J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs
8 | HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL
9 | 21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s
10 | nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz
11 | MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa
12 | pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb
13 | KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2
14 | XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/apps/ca-req.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBmTCCAQICAQAwWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx
3 | GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgx
4 | MDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgy
5 | bTsZDCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/d
6 | FXSv1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUe
7 | cQU2mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAKlk7
8 | cxu9gCJN3/iQFyJXQ6YphaiQAT5VBXTx9ftRrQIjA3vxlDzPWGDy+V5Tqa7h8PtR
9 | 5Bn00JShII2zf0hjyjKils6x/UkWmjEiwSiFp4hR70iE8XwSNEHY2P6j6nQEIpgW
10 | kbfgmmUqk7dl2V+ossTJ80B8SBpEhrn81V/cHxA=
11 | -----END CERTIFICATE REQUEST-----
12 |
--------------------------------------------------------------------------------
/apps/cert.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIBoDCCAUoCAQAwDQYJKoZIhvcNAQEEBQAwYzELMAkGA1UEBhMCQVUxEzARBgNV
3 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSMwIQYD
4 | VQQDExpTZXJ2ZXIgdGVzdCBjZXJ0ICg1MTIgYml0KTAeFw05NzA5MDkwMzQxMjZa
5 | Fw05NzEwMDkwMzQxMjZaMF4xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0
6 | YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFzAVBgNVBAMT
7 | DkVyaWMgdGhlIFlvdW5nMFEwCQYFKw4DAgwFAANEAAJBALVEqPODnpI4rShlY8S7
8 | tB713JNvabvn6Gned7zylwLLiXQAo/PAT6mfdWPTyCX9RlId/Aroh1ou893BA32Q
9 | sggwDQYJKoZIhvcNAQEEBQADQQCU5SSgapJSdRXJoX+CpCvFy+JVh9HpSjCpSNKO
10 | 19raHv98hKAUJuP9HyM+SUsffO6mAIgitUaqW8/wDMePhEC3
11 | -----END CERTIFICATE-----
12 |
--------------------------------------------------------------------------------
/apps/client.pem:
--------------------------------------------------------------------------------
1 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
2 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Client test cert (512 bit)
3 | -----BEGIN CERTIFICATE-----
4 | MIIB6TCCAVICAQIwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV
5 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD
6 | VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU2WhcNOTgwNjA5
7 | MTM1NzU2WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG
8 | A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGkNsaWVudCB0ZXN0IGNl
9 | cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALtv55QyzG6i2Plw
10 | Z1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexmq/R4KedLjFEIYjocDui+IXs62NNt
11 | XrT8odkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBwtMmI7oGUG8nKmftQssATViH5
12 | NRRtoEw07DxJp/LfatHdrhqQB73eGdL5WILZJXk46Xz2e9WMSUjVCSYhdKxtflU3
13 | UR2Ajv1Oo0sTNdfz0wDqJNirLNtzyhhsaq8qMTrLwXrCP31VxBiigFSQSUFnZyTE
14 | 9TKwhS4GlwbtCfxSKQ==
15 | -----END CERTIFICATE-----
16 | -----BEGIN RSA PRIVATE KEY-----
17 | MIIBOwIBAAJBALtv55QyzG6i2PlwZ1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexm
18 | q/R4KedLjFEIYjocDui+IXs62NNtXrT8odkCAwEAAQJAbwXq0vJ/+uyEvsNgxLko
19 | /V86mGXQ/KrSkeKlL0r4ENxjcyeMAGoKu6J9yMY7+X9+Zm4nxShNfTsf/+Freoe1
20 | HQIhAPOSm5Q1YI+KIsII2GeVJx1U69+wnd71OasIPakS1L1XAiEAxQAW+J3/JWE0
21 | ftEYakbhUOKL8tD1OaFZS71/5GdG7E8CIQCefUMmySSvwd6kC0VlATSWbW+d+jp/
22 | nWmM1KvqnAo5uQIhALqEADu5U1Wvt8UN8UDGBRPQulHWNycuNV45d3nnskWPAiAw
23 | ueTyr6WsZ5+SD8g/Hy3xuvF3nPmJRH+rwvVihlcFOg==
24 | -----END RSA PRIVATE KEY-----
25 |
--------------------------------------------------------------------------------
/apps/dh1024.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIGHAoGBAPSI/VhOSdvNILSd5JEHNmszbDgNRR0PfIizHHxbLY7288kjwEPwpVsY
3 | jY67VYy4XTjTNP18F1dDox0YbN4zISy1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6
4 | ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9iUsiGSa6q6Jew1XpL3jHAgEC
5 | -----END DH PARAMETERS-----
6 |
7 | These are the 1024 bit DH parameters from "Assigned Number for SKIP Protocols"
8 | (http://www.skip-vpn.org/spec/numbers.html).
9 | See there for how they were generated.
10 | Note that g is not a generator, but this is not a problem since p is a safe prime.
11 |
--------------------------------------------------------------------------------
/apps/dh2048.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIIBCAKCAQEA9kJXtwh/CBdyorrWqULzBej5UxE5T7bxbrlLOCDaAadWoxTpj0BV
3 | 89AHxstDqZSt90xkhkn4DIO9ZekX1KHTUPj1WV/cdlJPPT2N286Z4VeSWc39uK50
4 | T8X8dryDxUcwYc58yWb/Ffm7/ZFexwGq01uejaClcjrUGvC/RgBYK+X0iP1YTknb
5 | zSC0neSRBzZrM2w4DUUdD3yIsxx8Wy2O9vPJI8BD8KVbGI2Ou1WMuF040zT9fBdX
6 | Q6MdGGzeMyEstSr/POGxKUAYEY18hKcKctaGxAMZyAcpesqVDNmWn6vQClCbAkbT
7 | CD1mpF1Bn5x8vYlLIhkmuquiXsNV6TILOwIBAg==
8 | -----END DH PARAMETERS-----
9 |
10 | These are the 2048 bit DH parameters from "Assigned Number for SKIP Protocols"
11 | (http://www.skip-vpn.org/spec/numbers.html).
12 | See there for how they were generated.
13 |
--------------------------------------------------------------------------------
/apps/dh4096.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIICCAKCAgEA+hRyUsFN4VpJ1O8JLcCo/VWr19k3BCgJ4uk+d+KhehjdRqNDNyOQ
3 | l/MOyQNQfWXPeGKmOmIig6Ev/nm6Nf9Z2B1h3R4hExf+zTiHnvVPeRBhjdQi81rt
4 | Xeoh6TNrSBIKIHfUJWBh3va0TxxjQIs6IZOLeVNRLMqzeylWqMf49HsIXqbcokUS
5 | Vt1BkvLdW48j8PPv5DsKRN3tloTxqDJGo9tKvj1Fuk74A+Xda1kNhB7KFlqMyN98
6 | VETEJ6c7KpfOo30mnK30wqw3S8OtaIR/maYX72tGOno2ehFDkq3pnPtEbD2CScxc
7 | alJC+EL7RPk5c/tgeTvCngvc1KZn92Y//EI7G9tPZtylj2b56sHtMftIoYJ9+ODM
8 | sccD5Piz/rejE3Ome8EOOceUSCYAhXn8b3qvxVI1ddd1pED6FHRhFvLrZxFvBEM9
9 | ERRMp5QqOaHJkM+Dxv8Cj6MqrCbfC4u+ZErxodzuusgDgvZiLF22uxMZbobFWyte
10 | OvOzKGtwcTqO/1wV5gKkzu1ZVswVUQd5Gg8lJicwqRWyyNRczDDoG9jVDxmogKTH
11 | AaqLulO7R8Ifa1SwF2DteSGVtgWEN8gDpN3RBmmPTDngyF2DHb5qmpnznwtFKdTL
12 | KWbuHn491xNO25CQWMtem80uKw+pTnisBRF/454n1Jnhub144YRBoN8CAQI=
13 | -----END DH PARAMETERS-----
14 |
15 | These are the 4096 bit DH parameters from "Assigned Number for SKIP Protocols"
16 | (http://www.skip-vpn.org/spec/numbers.html).
17 | See there for how they were generated.
18 | Note that g is not a generator, but this is not a problem since p is a safe prime.
19 |
--------------------------------------------------------------------------------
/apps/dh512.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MEYCQQD1Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWak
3 | XUGfnHy9iUsiGSa6q6Jew1XpKgVfAgEC
4 | -----END DH PARAMETERS-----
5 |
6 | These are the 512 bit DH parameters from "Assigned Number for SKIP Protocols"
7 | (http://www.skip-vpn.org/spec/numbers.html).
8 | See there for how they were generated.
9 | Note that g is not a generator, but this is not a problem since p is a safe prime.
10 |
--------------------------------------------------------------------------------
/apps/dsa-ca.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DSA PRIVATE KEY-----
2 | MIIBugIBAAKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQ
3 | PnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtel
4 | u+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcH
5 | Me36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLso
6 | hkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbu
7 | SXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7Y
8 | Mu0OArgCgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuHvSLw9YUrJahcBHmbpvt4
9 | 94lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUqAylOVFJJJXuirVJ+o+0T
10 | tOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u3enxhqnDGQIUB78dhW77
11 | J6zsFbSEHaQGUmfSeoM=
12 | -----END DSA PRIVATE KEY-----
13 | -----BEGIN CERTIFICATE REQUEST-----
14 | MIICUjCCAhECAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx
15 | ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAxMCQ0Ew
16 | ggG0MIIBKQYFKw4DAgwwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaW
17 | sxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5m
18 | rmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHk
19 | cJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVo
20 | bzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqR
21 | CZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxB
22 | F5WS6wG1c6Vqftgy7Q4CuAOBhAACgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuH
23 | vSLw9YUrJahcBHmbpvt494lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUq
24 | AylOVFJJJXuirVJ+o+0TtOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u
25 | 3enxhqnDGaAAMAkGBSsOAwIbBQADMAAwLQIVAJGVuFsG/0DBuSZ0jF7ypdU0/G0v
26 | AhQfeF5BoMMDbX/kidUVpQ6gadPlZA==
27 | -----END CERTIFICATE REQUEST-----
28 | -----BEGIN CERTIFICATE-----
29 | MIIBrjCCAWwCAQswCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK
30 | U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww
31 | CgYDVQQDEwNQQ0EwHhcNOTcwNjE1MDIxNDI5WhcNOTcwNzE1MDIxNDI5WjBSMQsw
32 | CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu
33 | ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE
34 | AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi
35 | ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh
36 | MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD
37 | MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa
38 | C1Q=
39 | -----END CERTIFICATE-----
40 |
41 |
--------------------------------------------------------------------------------
/apps/dsa-pca.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DSA PRIVATE KEY-----
2 | MIIBvAIBAAKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQ
3 | PnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtel
4 | u+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcH
5 | Me36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLso
6 | hkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbu
7 | SXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7Y
8 | Mu0OArgCgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk
9 | umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A
10 | 29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUCFQDNvrBz
11 | 6TicfImU7UFRn9h00j0lJQ==
12 | -----END DSA PRIVATE KEY-----
13 | -----BEGIN CERTIFICATE REQUEST-----
14 | MIICVTCCAhMCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx
15 | ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAxMDUENB
16 | MIIBtTCCASkGBSsOAwIMMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2G
17 | lrMV4FMuj+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7O
18 | Zq5riDb77Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR
19 | 5HCVW1DNSQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnl
20 | aG8w42nh5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6
21 | kQmdtvFNnFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15Als
22 | QReVkusBtXOlan7YMu0OArgDgYUAAoGBAKbtuR5AdW+ICjCFe2ixjUiJJzM2IKwe
23 | 6NZEMXg39+HQ1UTPTmfLZLps+rZfolHDXuRKMXbGFdSF0nXYzotPCzi7GauwEJTZ
24 | yr27ZZjA1C6apGSQ9GzuwNvZ4rCXystVEagAS8OQ4H3D4dWS17Zg31ICb5o4E5r0
25 | z09o/Uz46u0VoAAwCQYFKw4DAhsFAAMxADAuAhUArRubTxsbIXy3AhtjQ943AbNB
26 | nSICFQCu+g1iW3jwF+gOcbroD4S/ZcvB3w==
27 | -----END CERTIFICATE REQUEST-----
28 | -----BEGIN CERTIFICATE-----
29 | MIIC0zCCApECAQAwCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK
30 | U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww
31 | CgYDVQQDEwNQQ0EwHhcNOTcwNjE0MjI1NDQ1WhcNOTcwNzE0MjI1NDQ1WjBTMQsw
32 | CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu
33 | ZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNQQ0EwggG1MIIBKQYFKw4DAgww
34 | ggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaWsxXgUy6P4FmCc5A+dTGZ
35 | R3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5mrmuINvvsKNzC16W75Sw5
36 | JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHkcJVbUM1JAhUA9wcx7fps
37 | BgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVobzDjaeHls12YuyiGSPze
38 | mQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqRCZ228U2cVA9YBu5JdAfO
39 | VX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxBF5WS6wG1c6Vqftgy7Q4C
40 | uAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk
41 | umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A
42 | 29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUwCQYFKw4D
43 | AhsFAAMxADAuAhUAvtv6AkMolix1Jvy3UnVEIUqdCUICFQC+jq8P49mwrY9oJ24n
44 | 5rKUjNBhSg==
45 | -----END CERTIFICATE-----
46 |
47 |
--------------------------------------------------------------------------------
/apps/dsa1024.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DSA PARAMETERS-----
2 | MIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQPnUx
3 | mUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtelu+Us
4 | OSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcHMe36
5 | bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLsohkj8
6 | 3pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbuSXQH
7 | zlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7YMu0O
8 | Arg=
9 | -----END DSA PARAMETERS-----
10 |
--------------------------------------------------------------------------------
/apps/dsa512.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DSA PARAMETERS-----
2 | MIGdAkEAnRtpjibb8isRcBmG9hnI+BnyGFOURgbQYlAzSwI8UjADizv5X9EkBk97
3 | TLqqQJv9luQ3M7stWtdaEUBmonZ9MQIVAPtT71C0QJIxVoZTeuiLIppJ+3GPAkEA
4 | gz6I5cWJc847bAFJv7PHnwrqRJHlMKrZvltftxDXibeOdPvPKR7rqCxUUbgQ3qDO
5 | L8wka5B33qJoplISogOdIA==
6 | -----END DSA PARAMETERS-----
7 |
--------------------------------------------------------------------------------
/apps/dsap.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DSA PARAMETERS-----
2 | MIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZS4J1PHvPrm9MXj5ntVheDPkdmBDTncya
3 | GAJcMjwsyB/GvLDGd6yGCw/8eF+09wIVAK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2
4 | t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjgtWiJc/tpvcuzeuAayH89UofjAGueKjXD
5 | ADiRffvSdhrNw5dkqdql
6 | -----END DSA PARAMETERS-----
7 |
--------------------------------------------------------------------------------
/apps/md4.c:
--------------------------------------------------------------------------------
1 | ../crypto/md4/md4.c
--------------------------------------------------------------------------------
/apps/oid.cnf:
--------------------------------------------------------------------------------
1 | 2.99999.1 SET.ex1 SET x509v3 extension 1
2 | 2.99999.2 SET.ex2 SET x509v3 extension 2
3 | 2.99999.3 SET.ex3 SET x509v3 extension 3
4 | 2.99999.4 SET.ex4 SET x509v3 extension 4
5 | 2.99999.5 SET.ex5 SET x509v3 extension 5
6 | 2.99999.6 SET.ex6 SET x509v3 extension 6
7 |
--------------------------------------------------------------------------------
/apps/pca-cert.srl:
--------------------------------------------------------------------------------
1 | 07
2 |
--------------------------------------------------------------------------------
/apps/pca-key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
3 | wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
4 | vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
5 | AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
6 | z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
7 | xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
8 | HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
9 | yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
10 | xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
11 | 7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
12 | h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
13 | QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
14 | hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/apps/pca-req.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBmjCCAQMCAQAwXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx
3 | GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAo
4 | MTAyNCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfj
5 | Irkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUX
6 | MRsp22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3
7 | vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAEzz
8 | IG8NnfpnPTQSCN5zJhOfy6p9AcDyQzuJirYv1HR/qoYWalPh/U2uiK0lAim7qMcv
9 | wOlK3I7A8B7/4dLqvIqgtUj9b1WT8zIrnwdvJI4osLI2BY+c1pVlp174DHLMol1L
10 | Cl1e3N5BTm7lCitTYjuUhsw6hiA8IcdNKDo6sktV
11 | -----END CERTIFICATE REQUEST-----
12 |
--------------------------------------------------------------------------------
/apps/privkey.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | Proc-Type: 4,ENCRYPTED
3 | DEK-Info: DES-EDE3-CBC,BA26229A1653B7FF
4 |
5 | 6nhWG8PKhTPO/s3ZvjUa6226NlKdvPDZFsNXOOoSUs9ejxpb/aj5huhs6qRYzsz9
6 | Year47uaAZYhGD0vAagnNiBnYmjWEpN9G/wQxG7pgZThK1ZxDi63qn8aQ8UjuGHo
7 | F6RpnnBQIAnWTWqr/Qsybtc5EoNkrj/Cpx0OfbSr6gZsFBCxwX1R1hT3/mhJ45f3
8 | XMofY32Vdfx9/vtw1O7HmlHXQnXaqnbd9/nn1EpvFJG9+UjPoW7gV4jCOLuR4deE
9 | jS8hm+cpkwXmFtk3VGjT9tQXPpMv3JpYfBqgGQoMAJ5Toq0DWcHi6Wg08PsD8lgy
10 | vmTioPsRg+JGkJkJ8GnusgLpQdlQJbjzd7wGE6ElUFLfOxLo8bLlRHoriHNdWYhh
11 | JjY0LyeTkovcmWxVjImc6ZyBz5Ly4t0BYf1gq3OkjsV91Q1taBxnhiavfizqMCAf
12 | PPB3sLQnlXG77TOXkNxpqbZfEYrVZW2Nsqqdn8s07Uj4IMONZyq2odYKWFPMJBiM
13 | POYwXjMAOcmFMTHYsVlhcUJuV6LOuipw/FEbTtPH/MYMxLe4zx65dYo1rb4iLKLS
14 | gMtB0o/Wl4Xno3ZXh1ucicYnV2J7NpVcjVq+3SFiCRu2SrSkZHZ23EPS13Ec6fcz
15 | 8X/YGA2vTJ8MAOozAzQUwHQYvLk7bIoQVekqDq4p0AZQbhdspHpArCk0Ifqqzg/v
16 | Uyky/zZiQYanzDenTSRVI/8wac3olxpU8QvbySxYqmbkgq6bTpXJfYFQfnAttEsC
17 | dA4S5UFgyOPZluxCAM4yaJF3Ft6neutNwftuJQMbgCUi9vYg2tGdSw==
18 | -----END RSA PRIVATE KEY-----
19 |
--------------------------------------------------------------------------------
/apps/req.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBlzCCAVcCAQAwXjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx
3 | ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEXMBUGA1UEAxMORXJp
4 | YyB0aGUgWW91bmcwge8wgaYGBSsOAwIMMIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZ
5 | S4J1PHvPrm9MXj5ntVheDPkdmBDTncyaGAJcMjwsyB/GvLDGd6yGCw/8eF+09wIV
6 | AK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjg
7 | tWiJc/tpvcuzeuAayH89UofjAGueKjXDADiRffvSdhrNw5dkqdqlA0QAAkEAtUSo
8 | 84OekjitKGVjxLu0HvXck29pu+foad53vPKXAsuJdACj88BPqZ91Y9PIJf1GUh38
9 | CuiHWi7z3cEDfZCyCKAAMAkGBSsOAwIbBQADLwAwLAIUTg8amKVBE9oqC5B75dDQ
10 | Chy3LdQCFHKodGEj3LjuTzdm/RTe2KZL9Uzf
11 | -----END CERTIFICATE REQUEST-----
12 |
--------------------------------------------------------------------------------
/apps/s1024key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV
3 | S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP
4 | pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB
5 | AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0
6 | dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY
7 | bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E
8 | Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq
9 | zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM
10 | 6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf
11 | QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD
12 | dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M
13 | 0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv
14 | nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA==
15 | -----END RSA PRIVATE KEY-----
16 |
--------------------------------------------------------------------------------
/apps/s1024req.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBojCCAQsCAQAwZDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx
3 | GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSQwIgYDVQQDExtTZXJ2ZXIgdGVz
4 | dCBjZXJ0ICgxMDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALMR
5 | 9TwT5kZMa0ddXleG8zYuDfZ9dQiPJ1dvfgEZU9fqg3v5o1VL15ZrK9b/73+9RvRo
6 | KqKUmukV6yAi1XZPxWGGM4T75dTPjq42lwxTvAcwQBdS58+nO2kWbxkSTa0Uq9p2
7 | RJKg3yVvXWO69lWRKQ+UHrmkWFJ7hApKnongeuRjAgMBAAEwDQYJKoZIhvcNAQEE
8 | BQADgYEAStHlk4pBbwiNeQ2/PKTPPXzITYC8Gn0XMbrU94e/6JIKiO7aArq9Espq
9 | nrBSvC14dHcNl6NNvnkEKdQ7hAkcACfBbnOXA/oQvMBd4GD78cH3k0jVDoVUEjil
10 | frLfWlckW6WzpTktt0ZPDdAjJCmKVh0ABHimi7Bo9FC3wIGIe5M=
11 | -----END CERTIFICATE REQUEST-----
12 |
--------------------------------------------------------------------------------
/apps/s512-key.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN RSA PRIVATE KEY-----
2 | MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD
3 | TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu
4 | OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj
5 | gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz
6 | rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b
7 | PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA
8 | vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU=
9 | -----END RSA PRIVATE KEY-----
10 |
--------------------------------------------------------------------------------
/apps/s512-req.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBGzCBxgIBADBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEa
3 | MBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0
4 | IGNlcnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8S
5 | MVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8E
6 | y2//Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAANBAAB+uQi+qwn6qRSHB8EUTvsm
7 | 5TNTHzYDeN39nyIbZNX2s0se3Srn2Bxft5YCwD3moFZ9QoyDHxE0h6qLX5yjD+8=
8 | -----END CERTIFICATE REQUEST-----
9 |
--------------------------------------------------------------------------------
/apps/server.srl:
--------------------------------------------------------------------------------
1 | 01
2 |
--------------------------------------------------------------------------------
/apps/testCA.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBBzCBsgIBADBNMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEX
3 | MBUGA1UEChMOTWluY29tIFB0eSBMdGQxEDAOBgNVBAMTB1RFU1QgQ0EwXDANBgkq
4 | hkiG9w0BAQEFAANLADBIAkEAzW9brgA8efT2ODB+NrsflJZj3KKqKsm4OrXTRqfL
5 | VETj1ws/zCXl42XJAxdWQMCP0liKfc9Ut4xi1qCVI7N07wIDAQABoAAwDQYJKoZI
6 | hvcNAQEEBQADQQBjZZ42Det9Uw0AFwJy4ufUEy5Cv74pxBp5SZnljgHY+Az0Hs2S
7 | uNkIegr2ITX5azKi9nOkg9ZmsmGG13FIjiC/
8 | -----END CERTIFICATE REQUEST-----
9 |
--------------------------------------------------------------------------------
/crypto/LPdir_nyi.c:
--------------------------------------------------------------------------------
1 | /* $LP: LPlib/source/LPdir_win.c,v 1.1 2004/06/14 10:07:56 _cvs_levitte Exp $ */
2 | /*
3 | * Copyright (c) 2004, Richard Levitte
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * 2. Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in the
13 | * documentation and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 | * SUCH DAMAGE.
26 | */
27 |
28 | #ifndef LPDIR_H
29 | #include "LPdir.h"
30 | #endif
31 |
32 | struct LP_dir_context_st { void *dummy; };
33 | const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory)
34 | {
35 | errno = EINVAL;
36 | return 0;
37 | }
38 | int LP_find_file_end(LP_DIR_CTX **ctx)
39 | {
40 | errno = EINVAL;
41 | return 0;
42 | }
43 |
--------------------------------------------------------------------------------
/crypto/LPdir_wince.c:
--------------------------------------------------------------------------------
1 | /* $LP: LPlib/source/LPdir_wince.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp $ */
2 | /*
3 | * Copyright (c) 2004, Richard Levitte
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | * 2. Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in the
13 | * documentation and/or other materials provided with the distribution.
14 | *
15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | #define LP_SYS_WINCE
29 | /* We might want to define LP_MULTIBYTE_AVAILABLE here. It's currently
30 | under investigation what the exact conditions would be */
31 | #include "LPdir_win.c"
32 |
--------------------------------------------------------------------------------
/crypto/aes/README:
--------------------------------------------------------------------------------
1 | This is an OpenSSL-compatible version of AES (also called Rijndael).
2 | aes_core.c is basically the same as rijndael-alg-fst.c but with an
3 | API that looks like the rest of the OpenSSL symmetric cipher suite.
4 |
--------------------------------------------------------------------------------
/crypto/aes/aes_cbc.c:
--------------------------------------------------------------------------------
1 | /* crypto/aes/aes_cbc.c -*- mode:C; c-file-style: "eay" -*- */
2 | /* ====================================================================
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in
14 | * the documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * 3. All advertising materials mentioning features or use of this
18 | * software must display the following acknowledgment:
19 | * "This product includes software developed by the OpenSSL Project
20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
21 | *
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23 | * endorse or promote products derived from this software without
24 | * prior written permission. For written permission, please contact
25 | * openssl-core@openssl.org.
26 | *
27 | * 5. Products derived from this software may not be called "OpenSSL"
28 | * nor may "OpenSSL" appear in their names without prior written
29 | * permission of the OpenSSL Project.
30 | *
31 | * 6. Redistributions of any form whatsoever must retain the following
32 | * acknowledgment:
33 | * "This product includes software developed by the OpenSSL Project
34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
35 | *
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 | * OF THE POSSIBILITY OF SUCH DAMAGE.
48 | * ====================================================================
49 | *
50 | */
51 |
52 | #include
53 | #include
54 |
55 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
56 | size_t len, const AES_KEY *key,
57 | unsigned char *ivec, const int enc) {
58 |
59 | if (enc)
60 | CRYPTO_cbc128_encrypt(in,out,len,key,ivec,(block128_f)AES_encrypt);
61 | else
62 | CRYPTO_cbc128_decrypt(in,out,len,key,ivec,(block128_f)AES_decrypt);
63 | }
64 |
--------------------------------------------------------------------------------
/crypto/aes/aes_ctr.c:
--------------------------------------------------------------------------------
1 | /* crypto/aes/aes_ctr.c -*- mode:C; c-file-style: "eay" -*- */
2 | /* ====================================================================
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in
14 | * the documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * 3. All advertising materials mentioning features or use of this
18 | * software must display the following acknowledgment:
19 | * "This product includes software developed by the OpenSSL Project
20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
21 | *
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23 | * endorse or promote products derived from this software without
24 | * prior written permission. For written permission, please contact
25 | * openssl-core@openssl.org.
26 | *
27 | * 5. Products derived from this software may not be called "OpenSSL"
28 | * nor may "OpenSSL" appear in their names without prior written
29 | * permission of the OpenSSL Project.
30 | *
31 | * 6. Redistributions of any form whatsoever must retain the following
32 | * acknowledgment:
33 | * "This product includes software developed by the OpenSSL Project
34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
35 | *
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 | * OF THE POSSIBILITY OF SUCH DAMAGE.
48 | * ====================================================================
49 | *
50 | */
51 |
52 | #include
53 | #include
54 |
55 | void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
56 | size_t length, const AES_KEY *key,
57 | unsigned char ivec[AES_BLOCK_SIZE],
58 | unsigned char ecount_buf[AES_BLOCK_SIZE],
59 | unsigned int *num) {
60 | CRYPTO_ctr128_encrypt(in,out,length,key,ivec,ecount_buf,num,(block128_f)AES_encrypt);
61 | }
62 |
--------------------------------------------------------------------------------
/crypto/aes/aes_misc.c:
--------------------------------------------------------------------------------
1 | /* crypto/aes/aes_misc.c -*- mode:C; c-file-style: "eay" -*- */
2 | /* ====================================================================
3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in
14 | * the documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * 3. All advertising materials mentioning features or use of this
18 | * software must display the following acknowledgment:
19 | * "This product includes software developed by the OpenSSL Project
20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
21 | *
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23 | * endorse or promote products derived from this software without
24 | * prior written permission. For written permission, please contact
25 | * openssl-core@openssl.org.
26 | *
27 | * 5. Products derived from this software may not be called "OpenSSL"
28 | * nor may "OpenSSL" appear in their names without prior written
29 | * permission of the OpenSSL Project.
30 | *
31 | * 6. Redistributions of any form whatsoever must retain the following
32 | * acknowledgment:
33 | * "This product includes software developed by the OpenSSL Project
34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
35 | *
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 | * OF THE POSSIBILITY OF SUCH DAMAGE.
48 | * ====================================================================
49 | *
50 | */
51 |
52 | #include
53 | #include
54 | #include "aes_locl.h"
55 |
56 | const char AES_version[]="AES" OPENSSL_VERSION_PTEXT;
57 |
58 | const char *AES_options(void) {
59 | #ifdef FULL_UNROLL
60 | return "aes(full)";
61 | #else
62 | return "aes(partial)";
63 | #endif
64 | }
65 |
--------------------------------------------------------------------------------
/crypto/aes/aes_ofb.c:
--------------------------------------------------------------------------------
1 | /* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */
2 | /* ====================================================================
3 | * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions
7 | * are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright
10 | * notice, this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright
13 | * notice, this list of conditions and the following disclaimer in
14 | * the documentation and/or other materials provided with the
15 | * distribution.
16 | *
17 | * 3. All advertising materials mentioning features or use of this
18 | * software must display the following acknowledgment:
19 | * "This product includes software developed by the OpenSSL Project
20 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
21 | *
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
23 | * endorse or promote products derived from this software without
24 | * prior written permission. For written permission, please contact
25 | * openssl-core@openssl.org.
26 | *
27 | * 5. Products derived from this software may not be called "OpenSSL"
28 | * nor may "OpenSSL" appear in their names without prior written
29 | * permission of the OpenSSL Project.
30 | *
31 | * 6. Redistributions of any form whatsoever must retain the following
32 | * acknowledgment:
33 | * "This product includes software developed by the OpenSSL Project
34 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
35 | *
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
47 | * OF THE POSSIBILITY OF SUCH DAMAGE.
48 | * ====================================================================
49 | *
50 | */
51 |
52 | #include
53 | #include
54 |
55 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
56 | size_t length, const AES_KEY *key,
57 | unsigned char *ivec, int *num)
58 | {
59 | CRYPTO_ofb128_encrypt(in,out,length,key,ivec,num,(block128_f)AES_encrypt);
60 | }
61 |
--------------------------------------------------------------------------------
/crypto/aes/asm/aes-586.pl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/aes/asm/aes-586.pl
--------------------------------------------------------------------------------
/crypto/alphacpuid.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | print <<'___';
3 | .text
4 |
5 | .set noat
6 |
7 | .globl OPENSSL_cpuid_setup
8 | .ent OPENSSL_cpuid_setup
9 | OPENSSL_cpuid_setup:
10 | .frame $30,0,$26
11 | .prologue 0
12 | ret ($26)
13 | .end OPENSSL_cpuid_setup
14 |
15 | .globl OPENSSL_wipe_cpu
16 | .ent OPENSSL_wipe_cpu
17 | OPENSSL_wipe_cpu:
18 | .frame $30,0,$26
19 | .prologue 0
20 | clr $1
21 | clr $2
22 | clr $3
23 | clr $4
24 | clr $5
25 | clr $6
26 | clr $7
27 | clr $8
28 | clr $16
29 | clr $17
30 | clr $18
31 | clr $19
32 | clr $20
33 | clr $21
34 | clr $22
35 | clr $23
36 | clr $24
37 | clr $25
38 | clr $27
39 | clr $at
40 | clr $29
41 | fclr $f0
42 | fclr $f1
43 | fclr $f10
44 | fclr $f11
45 | fclr $f12
46 | fclr $f13
47 | fclr $f14
48 | fclr $f15
49 | fclr $f16
50 | fclr $f17
51 | fclr $f18
52 | fclr $f19
53 | fclr $f20
54 | fclr $f21
55 | fclr $f22
56 | fclr $f23
57 | fclr $f24
58 | fclr $f25
59 | fclr $f26
60 | fclr $f27
61 | fclr $f28
62 | fclr $f29
63 | fclr $f30
64 | mov $sp,$0
65 | ret ($26)
66 | .end OPENSSL_wipe_cpu
67 |
68 | .globl OPENSSL_atomic_add
69 | .ent OPENSSL_atomic_add
70 | OPENSSL_atomic_add:
71 | .frame $30,0,$26
72 | .prologue 0
73 | 1: ldl_l $0,0($16)
74 | addl $0,$17,$1
75 | stl_c $1,0($16)
76 | beq $1,1b
77 | addl $0,$17,$0
78 | ret ($26)
79 | .end OPENSSL_atomic_add
80 |
81 | .globl OPENSSL_rdtsc
82 | .ent OPENSSL_rdtsc
83 | OPENSSL_rdtsc:
84 | .frame $30,0,$26
85 | .prologue 0
86 | rpcc $0
87 | ret ($26)
88 | .end OPENSSL_rdtsc
89 |
90 | .globl OPENSSL_cleanse
91 | .ent OPENSSL_cleanse
92 | OPENSSL_cleanse:
93 | .frame $30,0,$26
94 | .prologue 0
95 | beq $17,.Ldone
96 | and $16,7,$0
97 | bic $17,7,$at
98 | beq $at,.Little
99 | beq $0,.Laligned
100 |
101 | .Little:
102 | subq $0,8,$0
103 | ldq_u $1,0($16)
104 | mov $16,$2
105 | .Lalign:
106 | mskbl $1,$16,$1
107 | lda $16,1($16)
108 | subq $17,1,$17
109 | addq $0,1,$0
110 | beq $17,.Lout
111 | bne $0,.Lalign
112 | .Lout: stq_u $1,0($2)
113 | beq $17,.Ldone
114 | bic $17,7,$at
115 | beq $at,.Little
116 |
117 | .Laligned:
118 | stq $31,0($16)
119 | subq $17,8,$17
120 | lda $16,8($16)
121 | bic $17,7,$at
122 | bne $at,.Laligned
123 | bne $17,.Little
124 | .Ldone: ret ($26)
125 | .end OPENSSL_cleanse
126 | ___
127 |
--------------------------------------------------------------------------------
/crypto/asn1/charmap.h:
--------------------------------------------------------------------------------
1 | /* Auto generated with chartype.pl script.
2 | * Mask of various character properties
3 | */
4 |
5 | static const unsigned char char_type[] = {
6 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
7 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
8 | 120, 0, 1,40, 0, 0, 0,16,16,16, 0,25,25,16,16,16,
9 | 16,16,16,16,16,16,16,16,16,16,16, 9, 9,16, 9,16,
10 | 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
11 | 16,16,16,16,16,16,16,16,16,16,16, 0, 1, 0, 0, 0,
12 | 0,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,
13 | 16,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0, 2
14 | };
15 |
16 |
--------------------------------------------------------------------------------
/crypto/asn1/charmap.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl -w
2 |
3 | use strict;
4 |
5 | my ($i, @arr);
6 |
7 | # Set up an array with the type of ASCII characters
8 | # Each set bit represents a character property.
9 |
10 | # RFC2253 character properties
11 | my $RFC2253_ESC = 1; # Character escaped with \
12 | my $ESC_CTRL = 2; # Escaped control character
13 | # These are used with RFC1779 quoting using "
14 | my $NOESC_QUOTE = 8; # Not escaped if quoted
15 | my $PSTRING_CHAR = 0x10; # Valid PrintableString character
16 | my $RFC2253_FIRST_ESC = 0x20; # Escaped with \ if first character
17 | my $RFC2253_LAST_ESC = 0x40; # Escaped with \ if last character
18 |
19 | for($i = 0; $i < 128; $i++) {
20 | # Set the RFC2253 escape characters (control)
21 | $arr[$i] = 0;
22 | if(($i < 32) || ($i > 126)) {
23 | $arr[$i] |= $ESC_CTRL;
24 | }
25 |
26 | # Some PrintableString characters
27 | if( ( ( $i >= ord("a")) && ( $i <= ord("z")) )
28 | || ( ( $i >= ord("A")) && ( $i <= ord("Z")) )
29 | || ( ( $i >= ord("0")) && ( $i <= ord("9")) ) ) {
30 | $arr[$i] |= $PSTRING_CHAR;
31 | }
32 | }
33 |
34 | # Now setup the rest
35 |
36 | # Remaining RFC2253 escaped characters
37 |
38 | $arr[ord(" ")] |= $NOESC_QUOTE | $RFC2253_FIRST_ESC | $RFC2253_LAST_ESC;
39 | $arr[ord("#")] |= $NOESC_QUOTE | $RFC2253_FIRST_ESC;
40 |
41 | $arr[ord(",")] |= $NOESC_QUOTE | $RFC2253_ESC;
42 | $arr[ord("+")] |= $NOESC_QUOTE | $RFC2253_ESC;
43 | $arr[ord("\"")] |= $RFC2253_ESC;
44 | $arr[ord("\\")] |= $RFC2253_ESC;
45 | $arr[ord("<")] |= $NOESC_QUOTE | $RFC2253_ESC;
46 | $arr[ord(">")] |= $NOESC_QUOTE | $RFC2253_ESC;
47 | $arr[ord(";")] |= $NOESC_QUOTE | $RFC2253_ESC;
48 |
49 | # Remaining PrintableString characters
50 |
51 | $arr[ord(" ")] |= $PSTRING_CHAR;
52 | $arr[ord("'")] |= $PSTRING_CHAR;
53 | $arr[ord("(")] |= $PSTRING_CHAR;
54 | $arr[ord(")")] |= $PSTRING_CHAR;
55 | $arr[ord("+")] |= $PSTRING_CHAR;
56 | $arr[ord(",")] |= $PSTRING_CHAR;
57 | $arr[ord("-")] |= $PSTRING_CHAR;
58 | $arr[ord(".")] |= $PSTRING_CHAR;
59 | $arr[ord("/")] |= $PSTRING_CHAR;
60 | $arr[ord(":")] |= $PSTRING_CHAR;
61 | $arr[ord("=")] |= $PSTRING_CHAR;
62 | $arr[ord("?")] |= $PSTRING_CHAR;
63 |
64 | # Now generate the C code
65 |
66 | print <0; $i-=2)
72 | {
73 | &comment("");
74 | &comment("Round $i");
75 | &BF_ENCRYPT($i,$R,$L,$P,$tot,$tmp1,$tmp2,$tmp3);
76 | &comment("");
77 | &comment("Round ".sprintf("%d",$i-1));
78 | &BF_ENCRYPT($i-1,$L,$R,$P,$tot,$tmp1,$tmp2,$tmp3);
79 | }
80 | &xor($R,&DWP(0,$P,"",0));
81 |
82 | &mov("eax",&wparam(0));
83 | &mov(&DWP(0,"eax","",0),$R);
84 | &mov(&DWP(4,"eax","",0),$L);
85 | &function_end_A($name);
86 | }
87 |
88 | &function_end_B($name);
89 | }
90 |
91 | sub BF_ENCRYPT
92 | {
93 | local($i,$L,$R,$P,$tot,$tmp1,$tmp2,$tmp3)=@_;
94 |
95 | &rotr( $R, 16);
96 | &mov( $tot, &DWP(&n2a($i*4),$P,"",0));
97 |
98 | &movb( &LB($tmp1), &HB($R));
99 | &movb( &LB($tmp2), &LB($R));
100 |
101 | &rotr( $R, 16);
102 | &xor( $L, $tot);
103 |
104 | &mov( $tot, &DWP(&n2a($BF_OFF+0x0000),$P,$tmp1,4));
105 | &mov( $tmp3, &DWP(&n2a($BF_OFF+0x0400),$P,$tmp2,4));
106 |
107 | &movb( &LB($tmp1), &HB($R));
108 | &movb( &LB($tmp2), &LB($R));
109 |
110 | &add( $tot, $tmp3);
111 | &mov( $tmp1, &DWP(&n2a($BF_OFF+0x0800),$P,$tmp1,4)); # delay
112 |
113 | &xor( $tot, $tmp1);
114 | &mov( $tmp3, &DWP(&n2a($BF_OFF+0x0C00),$P,$tmp2,4));
115 |
116 | &add( $tot, $tmp3);
117 | &xor( $tmp1, $tmp1);
118 |
119 | &xor( $L, $tot);
120 | # delay
121 | }
122 |
123 | sub n2a
124 | {
125 | sprintf("%d",$_[0]);
126 | }
127 |
128 |
--------------------------------------------------------------------------------
/crypto/bio/bio_lcl.h:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #if BIO_FLAGS_UPLINK==0
4 | /* Shortcut UPLINK calls on most platforms... */
5 | #define UP_stdin stdin
6 | #define UP_stdout stdout
7 | #define UP_stderr stderr
8 | #define UP_fprintf fprintf
9 | #define UP_fgets fgets
10 | #define UP_fread fread
11 | #define UP_fwrite fwrite
12 | #undef UP_fsetmod
13 | #define UP_feof feof
14 | #define UP_fclose fclose
15 |
16 | #define UP_fopen fopen
17 | #define UP_fseek fseek
18 | #define UP_ftell ftell
19 | #define UP_fflush fflush
20 | #define UP_ferror ferror
21 | #ifdef _WIN32
22 | #define UP_fileno _fileno
23 | #define UP_open _open
24 | #define UP_read _read
25 | #define UP_write _write
26 | #define UP_lseek _lseek
27 | #define UP_close _close
28 | #else
29 | #define UP_fileno fileno
30 | #define UP_open open
31 | #define UP_read read
32 | #define UP_write write
33 | #define UP_lseek lseek
34 | #define UP_close close
35 | #endif
36 | #endif
37 |
--------------------------------------------------------------------------------
/crypto/bn/asm/README:
--------------------------------------------------------------------------------
1 |
2 |
3 | All assember in this directory are just version of the file
4 | crypto/bn/bn_asm.c.
5 |
6 | Quite a few of these files are just the assember output from gcc since on
7 | quite a few machines they are 2 times faster than the system compiler.
8 |
9 | For the x86, I have hand written assember because of the bad job all
10 | compilers seem to do on it. This normally gives a 2 time speed up in the RSA
11 | routines.
12 |
13 | For the DEC alpha, I also hand wrote the assember (except the division which
14 | is just the output from the C compiler pasted on the end of the file).
15 | On the 2 alpha C compilers I had access to, it was not possible to do
16 | 64b x 64b -> 128b calculations (both long and the long long data types
17 | were 64 bits). So the hand assember gives access to the 128 bit result and
18 | a 2 times speedup :-).
19 |
20 | There are 3 versions of assember for the HP PA-RISC.
21 |
22 | pa-risc.s is the origional one which works fine and generated using gcc :-)
23 |
24 | pa-risc2W.s and pa-risc2.s are 64 and 32-bit PA-RISC 2.0 implementations
25 | by Chris Ruemmler from HP (with some help from the HP C compiler).
26 |
27 |
28 |
--------------------------------------------------------------------------------
/crypto/bn/asm/ia64.S:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/bn/asm/ia64.S
--------------------------------------------------------------------------------
/crypto/bn/asm/x86.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 |
3 | push(@INC,"perlasm","../../perlasm");
4 | require "x86asm.pl";
5 |
6 | require("x86/mul_add.pl");
7 | require("x86/mul.pl");
8 | require("x86/sqr.pl");
9 | require("x86/div.pl");
10 | require("x86/add.pl");
11 | require("x86/sub.pl");
12 | require("x86/comba.pl");
13 |
14 | &asm_init($ARGV[0],$0);
15 |
16 | &bn_mul_add_words("bn_mul_add_words");
17 | &bn_mul_words("bn_mul_words");
18 | &bn_sqr_words("bn_sqr_words");
19 | &bn_div_words("bn_div_words");
20 | &bn_add_words("bn_add_words");
21 | &bn_sub_words("bn_sub_words");
22 | &bn_mul_comba("bn_mul_comba8",8);
23 | &bn_mul_comba("bn_mul_comba4",4);
24 | &bn_sqr_comba("bn_sqr_comba8",8);
25 | &bn_sqr_comba("bn_sqr_comba4",4);
26 |
27 | &asm_finish();
28 |
29 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/add.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 | sub bn_add_words
5 | {
6 | local($name)=@_;
7 |
8 | &function_begin($name,"");
9 |
10 | &comment("");
11 | $a="esi";
12 | $b="edi";
13 | $c="eax";
14 | $r="ebx";
15 | $tmp1="ecx";
16 | $tmp2="edx";
17 | $num="ebp";
18 |
19 | &mov($r,&wparam(0)); # get r
20 | &mov($a,&wparam(1)); # get a
21 | &mov($b,&wparam(2)); # get b
22 | &mov($num,&wparam(3)); # get num
23 | &xor($c,$c); # clear carry
24 | &and($num,0xfffffff8); # num / 8
25 |
26 | &jz(&label("aw_finish"));
27 |
28 | &set_label("aw_loop",0);
29 | for ($i=0; $i<8; $i++)
30 | {
31 | &comment("Round $i");
32 |
33 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a
34 | &mov($tmp2,&DWP($i*4,$b,"",0)); # *b
35 | &add($tmp1,$c);
36 | &mov($c,0);
37 | &adc($c,$c);
38 | &add($tmp1,$tmp2);
39 | &adc($c,0);
40 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *r
41 | }
42 |
43 | &comment("");
44 | &add($a,32);
45 | &add($b,32);
46 | &add($r,32);
47 | &sub($num,8);
48 | &jnz(&label("aw_loop"));
49 |
50 | &set_label("aw_finish",0);
51 | &mov($num,&wparam(3)); # get num
52 | &and($num,7);
53 | &jz(&label("aw_end"));
54 |
55 | for ($i=0; $i<7; $i++)
56 | {
57 | &comment("Tail Round $i");
58 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a
59 | &mov($tmp2,&DWP($i*4,$b,"",0));# *b
60 | &add($tmp1,$c);
61 | &mov($c,0);
62 | &adc($c,$c);
63 | &add($tmp1,$tmp2);
64 | &adc($c,0);
65 | &dec($num) if ($i != 6);
66 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *a
67 | &jz(&label("aw_end")) if ($i != 6);
68 | }
69 | &set_label("aw_end",0);
70 |
71 | # &mov("eax",$c); # $c is "eax"
72 |
73 | &function_end($name);
74 | }
75 |
76 | 1;
77 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/div.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 | sub bn_div_words
5 | {
6 | local($name)=@_;
7 |
8 | &function_begin($name,"");
9 | &mov("edx",&wparam(0)); #
10 | &mov("eax",&wparam(1)); #
11 | &mov("ebx",&wparam(2)); #
12 | &div("ebx");
13 | &function_end($name);
14 | }
15 | 1;
16 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/f:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/mul.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 | sub bn_mul_words
5 | {
6 | local($name)=@_;
7 |
8 | &function_begin($name,"");
9 |
10 | &comment("");
11 | $Low="eax";
12 | $High="edx";
13 | $a="ebx";
14 | $w="ecx";
15 | $r="edi";
16 | $c="esi";
17 | $num="ebp";
18 |
19 | &xor($c,$c); # clear carry
20 | &mov($r,&wparam(0)); #
21 | &mov($a,&wparam(1)); #
22 | &mov($num,&wparam(2)); #
23 | &mov($w,&wparam(3)); #
24 |
25 | &and($num,0xfffffff8); # num / 8
26 | &jz(&label("mw_finish"));
27 |
28 | &set_label("mw_loop",0);
29 | for ($i=0; $i<32; $i+=4)
30 | {
31 | &comment("Round $i");
32 |
33 | &mov("eax",&DWP($i,$a,"",0)); # *a
34 | &mul($w); # *a * w
35 | &add("eax",$c); # L(t)+=c
36 | # XXX
37 |
38 | &adc("edx",0); # H(t)+=carry
39 | &mov(&DWP($i,$r,"",0),"eax"); # *r= L(t);
40 |
41 | &mov($c,"edx"); # c= H(t);
42 | }
43 |
44 | &comment("");
45 | &add($a,32);
46 | &add($r,32);
47 | &sub($num,8);
48 | &jz(&label("mw_finish"));
49 | &jmp(&label("mw_loop"));
50 |
51 | &set_label("mw_finish",0);
52 | &mov($num,&wparam(2)); # get num
53 | &and($num,7);
54 | &jnz(&label("mw_finish2"));
55 | &jmp(&label("mw_end"));
56 |
57 | &set_label("mw_finish2",1);
58 | for ($i=0; $i<7; $i++)
59 | {
60 | &comment("Tail Round $i");
61 | &mov("eax",&DWP($i*4,$a,"",0));# *a
62 | &mul($w); # *a * w
63 | &add("eax",$c); # L(t)+=c
64 | # XXX
65 | &adc("edx",0); # H(t)+=carry
66 | &mov(&DWP($i*4,$r,"",0),"eax");# *r= L(t);
67 | &mov($c,"edx"); # c= H(t);
68 | &dec($num) if ($i != 7-1);
69 | &jz(&label("mw_end")) if ($i != 7-1);
70 | }
71 | &set_label("mw_end",0);
72 | &mov("eax",$c);
73 |
74 | &function_end($name);
75 | }
76 |
77 | 1;
78 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/mul_add.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 | sub bn_mul_add_words
5 | {
6 | local($name)=@_;
7 |
8 | &function_begin($name,"");
9 |
10 | &comment("");
11 | $Low="eax";
12 | $High="edx";
13 | $a="ebx";
14 | $w="ebp";
15 | $r="edi";
16 | $c="esi";
17 |
18 | &xor($c,$c); # clear carry
19 | &mov($r,&wparam(0)); #
20 |
21 | &mov("ecx",&wparam(2)); #
22 | &mov($a,&wparam(1)); #
23 |
24 | &and("ecx",0xfffffff8); # num / 8
25 | &mov($w,&wparam(3)); #
26 |
27 | &push("ecx"); # Up the stack for a tmp variable
28 |
29 | &jz(&label("maw_finish"));
30 |
31 | &set_label("maw_loop",0);
32 |
33 | &mov(&swtmp(0),"ecx"); #
34 |
35 | for ($i=0; $i<32; $i+=4)
36 | {
37 | &comment("Round $i");
38 |
39 | &mov("eax",&DWP($i,$a,"",0)); # *a
40 | &mul($w); # *a * w
41 | &add("eax",$c); # L(t)+= *r
42 | &mov($c,&DWP($i,$r,"",0)); # L(t)+= *r
43 | &adc("edx",0); # H(t)+=carry
44 | &add("eax",$c); # L(t)+=c
45 | &adc("edx",0); # H(t)+=carry
46 | &mov(&DWP($i,$r,"",0),"eax"); # *r= L(t);
47 | &mov($c,"edx"); # c= H(t);
48 | }
49 |
50 | &comment("");
51 | &mov("ecx",&swtmp(0)); #
52 | &add($a,32);
53 | &add($r,32);
54 | &sub("ecx",8);
55 | &jnz(&label("maw_loop"));
56 |
57 | &set_label("maw_finish",0);
58 | &mov("ecx",&wparam(2)); # get num
59 | &and("ecx",7);
60 | &jnz(&label("maw_finish2")); # helps branch prediction
61 | &jmp(&label("maw_end"));
62 |
63 | &set_label("maw_finish2",1);
64 | for ($i=0; $i<7; $i++)
65 | {
66 | &comment("Tail Round $i");
67 | &mov("eax",&DWP($i*4,$a,"",0));# *a
68 | &mul($w); # *a * w
69 | &add("eax",$c); # L(t)+=c
70 | &mov($c,&DWP($i*4,$r,"",0)); # L(t)+= *r
71 | &adc("edx",0); # H(t)+=carry
72 | &add("eax",$c);
73 | &adc("edx",0); # H(t)+=carry
74 | &dec("ecx") if ($i != 7-1);
75 | &mov(&DWP($i*4,$r,"",0),"eax"); # *r= L(t);
76 | &mov($c,"edx"); # c= H(t);
77 | &jz(&label("maw_end")) if ($i != 7-1);
78 | }
79 | &set_label("maw_end",0);
80 | &mov("eax",$c);
81 |
82 | &pop("ecx"); # clear variable from
83 |
84 | &function_end($name);
85 | }
86 |
87 | 1;
88 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/sqr.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 | sub bn_sqr_words
5 | {
6 | local($name)=@_;
7 |
8 | &function_begin($name,"");
9 |
10 | &comment("");
11 | $r="esi";
12 | $a="edi";
13 | $num="ebx";
14 |
15 | &mov($r,&wparam(0)); #
16 | &mov($a,&wparam(1)); #
17 | &mov($num,&wparam(2)); #
18 |
19 | &and($num,0xfffffff8); # num / 8
20 | &jz(&label("sw_finish"));
21 |
22 | &set_label("sw_loop",0);
23 | for ($i=0; $i<32; $i+=4)
24 | {
25 | &comment("Round $i");
26 | &mov("eax",&DWP($i,$a,"",0)); # *a
27 | # XXX
28 | &mul("eax"); # *a * *a
29 | &mov(&DWP($i*2,$r,"",0),"eax"); #
30 | &mov(&DWP($i*2+4,$r,"",0),"edx");#
31 | }
32 |
33 | &comment("");
34 | &add($a,32);
35 | &add($r,64);
36 | &sub($num,8);
37 | &jnz(&label("sw_loop"));
38 |
39 | &set_label("sw_finish",0);
40 | &mov($num,&wparam(2)); # get num
41 | &and($num,7);
42 | &jz(&label("sw_end"));
43 |
44 | for ($i=0; $i<7; $i++)
45 | {
46 | &comment("Tail Round $i");
47 | &mov("eax",&DWP($i*4,$a,"",0)); # *a
48 | # XXX
49 | &mul("eax"); # *a * *a
50 | &mov(&DWP($i*8,$r,"",0),"eax"); #
51 | &dec($num) if ($i != 7-1);
52 | &mov(&DWP($i*8+4,$r,"",0),"edx");
53 | &jz(&label("sw_end")) if ($i != 7-1);
54 | }
55 | &set_label("sw_end",0);
56 |
57 | &function_end($name);
58 | }
59 |
60 | 1;
61 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86/sub.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 | # x86 assember
3 |
4 | sub bn_sub_words
5 | {
6 | local($name)=@_;
7 |
8 | &function_begin($name,"");
9 |
10 | &comment("");
11 | $a="esi";
12 | $b="edi";
13 | $c="eax";
14 | $r="ebx";
15 | $tmp1="ecx";
16 | $tmp2="edx";
17 | $num="ebp";
18 |
19 | &mov($r,&wparam(0)); # get r
20 | &mov($a,&wparam(1)); # get a
21 | &mov($b,&wparam(2)); # get b
22 | &mov($num,&wparam(3)); # get num
23 | &xor($c,$c); # clear carry
24 | &and($num,0xfffffff8); # num / 8
25 |
26 | &jz(&label("aw_finish"));
27 |
28 | &set_label("aw_loop",0);
29 | for ($i=0; $i<8; $i++)
30 | {
31 | &comment("Round $i");
32 |
33 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a
34 | &mov($tmp2,&DWP($i*4,$b,"",0)); # *b
35 | &sub($tmp1,$c);
36 | &mov($c,0);
37 | &adc($c,$c);
38 | &sub($tmp1,$tmp2);
39 | &adc($c,0);
40 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *r
41 | }
42 |
43 | &comment("");
44 | &add($a,32);
45 | &add($b,32);
46 | &add($r,32);
47 | &sub($num,8);
48 | &jnz(&label("aw_loop"));
49 |
50 | &set_label("aw_finish",0);
51 | &mov($num,&wparam(3)); # get num
52 | &and($num,7);
53 | &jz(&label("aw_end"));
54 |
55 | for ($i=0; $i<7; $i++)
56 | {
57 | &comment("Tail Round $i");
58 | &mov($tmp1,&DWP($i*4,$a,"",0)); # *a
59 | &mov($tmp2,&DWP($i*4,$b,"",0));# *b
60 | &sub($tmp1,$c);
61 | &mov($c,0);
62 | &adc($c,$c);
63 | &sub($tmp1,$tmp2);
64 | &adc($c,0);
65 | &dec($num) if ($i != 6);
66 | &mov(&DWP($i*4,$r,"",0),$tmp1); # *a
67 | &jz(&label("aw_end")) if ($i != 6);
68 | }
69 | &set_label("aw_end",0);
70 |
71 | # &mov("eax",$c); # $c is "eax"
72 |
73 | &function_end($name);
74 | }
75 |
76 | 1;
77 |
--------------------------------------------------------------------------------
/crypto/bn/asm/x86_64-gcc.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/bn/asm/x86_64-gcc.c
--------------------------------------------------------------------------------
/crypto/bn/bn.mul:
--------------------------------------------------------------------------------
1 | We need
2 |
3 | * bn_mul_comba8
4 | * bn_mul_comba4
5 | * bn_mul_normal
6 | * bn_mul_recursive
7 |
8 | * bn_sqr_comba8
9 | * bn_sqr_comba4
10 | bn_sqr_normal -> BN_sqr
11 | * bn_sqr_recursive
12 |
13 | * bn_mul_low_recursive
14 | * bn_mul_low_normal
15 | * bn_mul_high
16 |
17 | * bn_mul_part_recursive # symetric but not power of 2
18 |
19 | bn_mul_asymetric_recursive # uneven, but do the chop up.
20 |
--------------------------------------------------------------------------------
/crypto/bn/divtest.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | static int Rand(n)
5 | {
6 | unsigned char x[2];
7 | RAND_pseudo_bytes(x,2);
8 | return (x[0] + 2*x[1]);
9 | }
10 |
11 | static void bug(char *m, BIGNUM *a, BIGNUM *b)
12 | {
13 | printf("%s!\na=",m);
14 | BN_print_fp(stdout, a);
15 | printf("\nb=");
16 | BN_print_fp(stdout, b);
17 | printf("\n");
18 | fflush(stdout);
19 | }
20 |
21 | main()
22 | {
23 | BIGNUM *a=BN_new(), *b=BN_new(), *c=BN_new(), *d=BN_new(),
24 | *C=BN_new(), *D=BN_new();
25 | BN_RECP_CTX *recp=BN_RECP_CTX_new();
26 | BN_CTX *ctx=BN_CTX_new();
27 |
28 | for(;;) {
29 | BN_pseudo_rand(a,Rand(),0,0);
30 | BN_pseudo_rand(b,Rand(),0,0);
31 | if (BN_is_zero(b)) continue;
32 |
33 | BN_RECP_CTX_set(recp,b,ctx);
34 | if (BN_div(C,D,a,b,ctx) != 1)
35 | bug("BN_div failed",a,b);
36 | if (BN_div_recp(c,d,a,recp,ctx) != 1)
37 | bug("BN_div_recp failed",a,b);
38 | else if (BN_cmp(c,C) != 0 || BN_cmp(c,C) != 0)
39 | bug("mismatch",a,b);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/crypto/bn/exp.c:
--------------------------------------------------------------------------------
1 | /* unused */
2 |
3 | #include
4 | #include
5 | #include "bn_lcl.h"
6 |
7 | #define SIZE 256
8 | #define NUM (8*8*8)
9 | #define MOD (8*8*8*8*8)
10 |
11 | main(argc,argv)
12 | int argc;
13 | char *argv[];
14 | {
15 | BN_CTX ctx;
16 | BIGNUM a,b,c,r,rr,t,l;
17 | int j,i,size=SIZE,num=NUM,mod=MOD;
18 | char *start,*end;
19 | BN_MONT_CTX mont;
20 | double d,md;
21 |
22 | BN_MONT_CTX_init(&mont);
23 | BN_CTX_init(&ctx);
24 | BN_init(&a);
25 | BN_init(&b);
26 | BN_init(&c);
27 | BN_init(&r);
28 |
29 | start=ms_time_new();
30 | end=ms_time_new();
31 | while (size <= 1024*8)
32 | {
33 | BN_rand(&a,size,0,0);
34 | BN_rand(&b,size,1,0);
35 | BN_rand(&c,size,0,1);
36 |
37 | BN_mod(&a,&a,&c,&ctx);
38 |
39 | ms_time_get(start);
40 | for (i=0; i<10; i++)
41 | BN_MONT_CTX_set(&mont,&c,&ctx);
42 | ms_time_get(end);
43 | md=ms_time_diff(start,end);
44 |
45 | ms_time_get(start);
46 | for (i=0; i
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
8 | unsigned int olen, unsigned char *in, unsigned int ilen);
9 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
10 | unsigned int olen, unsigned char *in, unsigned int ilen);
11 |
12 | static COMP_METHOD rle_method={
13 | NID_rle_compression,
14 | LN_rle_compression,
15 | NULL,
16 | NULL,
17 | rle_compress_block,
18 | rle_expand_block,
19 | NULL,
20 | NULL,
21 | };
22 |
23 | COMP_METHOD *COMP_rle(void)
24 | {
25 | return(&rle_method);
26 | }
27 |
28 | static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
29 | unsigned int olen, unsigned char *in, unsigned int ilen)
30 | {
31 | /* int i; */
32 |
33 | if (olen < (ilen+1))
34 | {
35 | /* ZZZZZZZZZZZZZZZZZZZZZZ */
36 | return(-1);
37 | }
38 |
39 | *(out++)=0;
40 | memcpy(out,in,ilen);
41 | return(ilen+1);
42 | }
43 |
44 | static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
45 | unsigned int olen, unsigned char *in, unsigned int ilen)
46 | {
47 | int i;
48 |
49 | if (ilen == 0 || olen < (ilen-1))
50 | {
51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */
52 | return(-1);
53 | }
54 |
55 | i= *(in++);
56 | if (i == 0)
57 | {
58 | memcpy(out,in,ilen-1);
59 | }
60 | return(ilen-1);
61 | }
62 |
--------------------------------------------------------------------------------
/crypto/comp/comp.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef HEADER_COMP_H
3 | #define HEADER_COMP_H
4 |
5 | #include
6 |
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 |
11 | typedef struct comp_ctx_st COMP_CTX;
12 |
13 | typedef struct comp_method_st
14 | {
15 | int type; /* NID for compression library */
16 | const char *name; /* A text string to identify the library */
17 | int (*init)(COMP_CTX *ctx);
18 | void (*finish)(COMP_CTX *ctx);
19 | int (*compress)(COMP_CTX *ctx,
20 | unsigned char *out, unsigned int olen,
21 | unsigned char *in, unsigned int ilen);
22 | int (*expand)(COMP_CTX *ctx,
23 | unsigned char *out, unsigned int olen,
24 | unsigned char *in, unsigned int ilen);
25 | /* The following two do NOTHING, but are kept for backward compatibility */
26 | long (*ctrl)(void);
27 | long (*callback_ctrl)(void);
28 | } COMP_METHOD;
29 |
30 | struct comp_ctx_st
31 | {
32 | COMP_METHOD *meth;
33 | unsigned long compress_in;
34 | unsigned long compress_out;
35 | unsigned long expand_in;
36 | unsigned long expand_out;
37 |
38 | CRYPTO_EX_DATA ex_data;
39 | };
40 |
41 |
42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
43 | void COMP_CTX_free(COMP_CTX *ctx);
44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
45 | unsigned char *in, int ilen);
46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
47 | unsigned char *in, int ilen);
48 | COMP_METHOD *COMP_rle(void );
49 | COMP_METHOD *COMP_zlib(void );
50 | void COMP_zlib_cleanup(void);
51 |
52 | #ifdef HEADER_BIO_H
53 | #ifdef ZLIB
54 | BIO_METHOD *BIO_f_zlib(void);
55 | #endif
56 | #endif
57 |
58 | /* BEGIN ERROR CODES */
59 | /* The following lines are auto generated by the script mkerr.pl. Any changes
60 | * made after this point may be overwritten when the script is next run.
61 | */
62 | void ERR_load_COMP_strings(void);
63 |
64 | /* Error codes for the COMP functions. */
65 |
66 | /* Function codes. */
67 | #define COMP_F_BIO_ZLIB_FLUSH 99
68 | #define COMP_F_BIO_ZLIB_NEW 100
69 | #define COMP_F_BIO_ZLIB_READ 101
70 | #define COMP_F_BIO_ZLIB_WRITE 102
71 |
72 | /* Reason codes. */
73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99
74 | #define COMP_R_ZLIB_INFLATE_ERROR 100
75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101
76 |
77 | #ifdef __cplusplus
78 | }
79 | #endif
80 | #endif
81 |
--------------------------------------------------------------------------------
/crypto/comp/comp_lib.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
8 | {
9 | COMP_CTX *ret;
10 |
11 | if ((ret=(COMP_CTX *)OPENSSL_malloc(sizeof(COMP_CTX))) == NULL)
12 | {
13 | /* ZZZZZZZZZZZZZZZZ */
14 | return(NULL);
15 | }
16 | memset(ret,0,sizeof(COMP_CTX));
17 | ret->meth=meth;
18 | if ((ret->meth->init != NULL) && !ret->meth->init(ret))
19 | {
20 | OPENSSL_free(ret);
21 | ret=NULL;
22 | }
23 | return(ret);
24 | }
25 |
26 | void COMP_CTX_free(COMP_CTX *ctx)
27 | {
28 | if(ctx == NULL)
29 | return;
30 |
31 | if (ctx->meth->finish != NULL)
32 | ctx->meth->finish(ctx);
33 |
34 | OPENSSL_free(ctx);
35 | }
36 |
37 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
38 | unsigned char *in, int ilen)
39 | {
40 | int ret;
41 | if (ctx->meth->compress == NULL)
42 | {
43 | /* ZZZZZZZZZZZZZZZZZ */
44 | return(-1);
45 | }
46 | ret=ctx->meth->compress(ctx,out,olen,in,ilen);
47 | if (ret > 0)
48 | {
49 | ctx->compress_in+=ilen;
50 | ctx->compress_out+=ret;
51 | }
52 | return(ret);
53 | }
54 |
55 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
56 | unsigned char *in, int ilen)
57 | {
58 | int ret;
59 |
60 | if (ctx->meth->expand == NULL)
61 | {
62 | /* ZZZZZZZZZZZZZZZZZ */
63 | return(-1);
64 | }
65 | ret=ctx->meth->expand(ctx,out,olen,in,ilen);
66 | if (ret > 0)
67 | {
68 | ctx->expand_in+=ilen;
69 | ctx->expand_out+=ret;
70 | }
71 | return(ret);
72 | }
73 |
--------------------------------------------------------------------------------
/crypto/conf/README:
--------------------------------------------------------------------------------
1 | Configuration modules. These are a set of modules which can perform
2 | various configuration functions.
3 |
4 | Currently the routines should be called at most once when an application
5 | starts up: that is before it starts any threads.
6 |
7 | The routines read a configuration file set up like this:
8 |
9 | -----
10 | #default section
11 | openssl_conf=init_section
12 |
13 | [init_section]
14 |
15 | module1=value1
16 | #Second instance of module1
17 | module1.1=valueX
18 | module2=value2
19 | module3=dso_literal
20 | module4=dso_section
21 |
22 | [dso_section]
23 |
24 | path=/some/path/to/some/dso.so
25 | other_stuff=other_value
26 | ----
27 |
28 | When this file is loaded a configuration module with the specified string
29 | (module* in the above example) is looked up and its init function called as:
30 |
31 | int conf_init_func(CONF_IMODULE *md, CONF *cnf);
32 |
33 | The function can then take whatever action is appropriate, for example further
34 | lookups based on the value. Multiple instances of the same config module can be
35 | loaded.
36 |
37 | When the application closes down the modules are cleaned up by calling an
38 | optional finish function:
39 |
40 | void conf_finish_func(CONF_IMODULE *md);
41 |
42 | The finish functions are called in reverse order: that is the last module
43 | loaded is the first one cleaned up.
44 |
45 | If no module exists with a given name then an attempt is made to load a DSO
46 | with the supplied name. This might mean that "module3" attempts to load a DSO
47 | called libmodule3.so or module3.dll for example. An explicit DSO name can be
48 | given by including a separate section as in the module4 example above.
49 |
50 | The DSO is expected to at least contain an initialization function:
51 |
52 | int OPENSSL_init(CONF_IMODULE *md, CONF *cnf);
53 |
54 | and may also include a finish function:
55 |
56 | void OPENSSL_finish(CONF_IMODULE *md);
57 |
58 | Static modules can also be added using,
59 |
60 | int CONF_module_add(char *name, dso_mod_init_func *ifunc, dso_mod_finish_func
61 | *ffunc);
62 |
63 | where "name" is the name in the configuration file this function corresponds
64 | to.
65 |
66 | A set of builtin modules (currently only an ASN1 non functional test module)
67 | can be added by calling OPENSSL_load_builtin_modules().
68 |
69 | The function OPENSSL_config() is intended as a simple configuration function
70 | that any application can call to perform various default configuration tasks.
71 | It uses the file openssl.cnf in the usual locations.
72 |
73 |
74 |
--------------------------------------------------------------------------------
/crypto/conf/ssleay.cnf:
--------------------------------------------------------------------------------
1 | #
2 | # This is a test configuration file for use in SSLeay etc...
3 | #
4 |
5 | init = 5
6 | in\#it1 =10
7 | init2='10'
8 | init3='10\''
9 | init4="10'"
10 | init5='='10\'' again'
11 |
12 | SSLeay::version = 0.5.0
13 |
14 | [genrsa]
15 | default_bits = 512
16 | SSLEAY::version = 0.5.0
17 |
18 | [gendh]
19 | default_bits = 512
20 | def_generator = 2
21 |
22 | [s_client]
23 | cipher1 = DES_CBC_MD5:DES_CBC_SHA:DES_EDE_SHA:RC4_MD5\
24 | cipher2 = 'DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5'
25 | cipher3 = "DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5"
26 | cipher4 = DES_CBC_MD5 DES_CBC_SHA DES_EDE_SHA RC4_MD5
27 |
28 | [ default ]
29 | cert_dir = $ENV::HOME/.ca_certs
30 |
31 | HOME = /tmp/eay
32 |
33 | tmp_cert_dir = $HOME/.ca_certs
34 | tmp2_cert_dir = thisis$(HOME)stuff
35 |
36 | LOGNAME = Eric Young (home=$HOME)
37 |
38 | [ special ]
39 |
40 | H=$HOME
41 | H=$default::HOME
42 | H=$ENV::HOME
43 | #
44 | # SSLeay example configuration file.
45 | # This is mostly being used for generation of certificate requests.
46 | #
47 |
48 | RANDFILE = $HOME/.rand
49 |
50 | [ req ]
51 | default_bits = 512
52 | default_keyfile = privkey.pem
53 |
54 | Attribute_type_1 = countryName
55 | Attribute_text_1 = Country Name (2 letter code)
56 | Attribute_default_1 = AU
57 |
58 | Attribute_type_2 = stateOrProvinceName
59 | Attribute_text_2 = State or Province Name (full name)
60 | Attribute_default_2 = Queensland
61 |
62 | Attribute_type_3 = localityName
63 | Attribute_text_3 = Locality Name (eg, city)
64 |
65 | Attribute_type_4 = organizationName
66 | Attribute_text_4 = Organization Name (eg, company)
67 | Attribute_default_4 = Mincom Pty Ltd
68 |
69 | Attribute_type_5 = organizationalUnitName
70 | Attribute_text_5 = Organizational Unit Name (eg, section)
71 | Attribute_default_5 = TR
72 |
73 | Attribute_type_6 = commonName
74 | Attribute_text_6 = Common Name (eg, YOUR name)
75 |
76 | Attribute_type_7 = emailAddress
77 | Attribute_text_7 = Email Address
78 |
79 |
--------------------------------------------------------------------------------
/crypto/des/COPYRIGHT:
--------------------------------------------------------------------------------
1 | Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
2 | All rights reserved.
3 |
4 | This package is an DES implementation written by Eric Young (eay@cryptsoft.com).
5 | The implementation was written so as to conform with MIT's libdes.
6 |
7 | This library is free for commercial and non-commercial use as long as
8 | the following conditions are aheared to. The following conditions
9 | apply to all code found in this distribution.
10 |
11 | Copyright remains Eric Young's, and as such any Copyright notices in
12 | the code are not to be removed.
13 | If this package is used in a product, Eric Young should be given attribution
14 | as the author of that the SSL library. This can be in the form of a textual
15 | message at program startup or in documentation (online or textual) provided
16 | with the package.
17 |
18 | Redistribution and use in source and binary forms, with or without
19 | modification, are permitted provided that the following conditions
20 | are met:
21 | 1. Redistributions of source code must retain the copyright
22 | notice, this list of conditions and the following disclaimer.
23 | 2. Redistributions in binary form must reproduce the above copyright
24 | notice, this list of conditions and the following disclaimer in the
25 | documentation and/or other materials provided with the distribution.
26 | 3. All advertising materials mentioning features or use of this software
27 | must display the following acknowledgement:
28 | This product includes software developed by Eric Young (eay@cryptsoft.com)
29 |
30 | THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
31 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
34 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 | SUCH DAMAGE.
41 |
42 | The license and distribution terms for any publically available version or
43 | derivative of this code cannot be changed. i.e. this code cannot simply be
44 | copied and put under another distrubution license
45 | [including the GNU Public License.]
46 |
47 | The reason behind this being stated in this direct manner is past
48 | experience in code simply being copied and the attribution removed
49 | from it and then being distributed as part of other packages. This
50 | implementation was a non-trivial and unpaid effort.
51 |
--------------------------------------------------------------------------------
/crypto/des/DES.pm:
--------------------------------------------------------------------------------
1 | package DES;
2 |
3 | require Exporter;
4 | require DynaLoader;
5 | @ISA = qw(Exporter DynaLoader);
6 | # Items to export into callers namespace by default
7 | # (move infrequently used names to @EXPORT_OK below)
8 | @EXPORT = qw(
9 | );
10 | # Other items we are prepared to export if requested
11 | @EXPORT_OK = qw(
12 | crypt
13 | );
14 |
15 | # Preloaded methods go here. Autoload methods go after __END__, and are
16 | # processed by the autosplit program.
17 | bootstrap DES;
18 | 1;
19 | __END__
20 |
--------------------------------------------------------------------------------
/crypto/des/INSTALL:
--------------------------------------------------------------------------------
1 | Check the CC and CFLAGS lines in the makefile
2 |
3 | If your C library does not support the times(3) function, change the
4 | #define TIMES to
5 | #undef TIMES in speed.c
6 | If it does, check the HZ value for the times(3) function.
7 | If your system does not define CLK_TCK it will be assumed to
8 | be 100.0.
9 |
10 | If possible use gcc v 2.7.?
11 | Turn on the maximum optimising (normally '-O3 -fomit-frame-pointer' for gcc)
12 | In recent times, some system compilers give better performace.
13 |
14 | type 'make'
15 |
16 | run './destest' to check things are ok.
17 | run './rpw' to check the tty code for reading passwords works.
18 | run './speed' to see how fast those optimisations make the library run :-)
19 | run './des_opts' to determin the best compile time options.
20 |
21 | The output from des_opts should be put in the makefile options and des_enc.c
22 | should be rebuilt. For 64 bit computers, do not use the DES_PTR option.
23 | For the DEC Alpha, edit des.h and change DES_LONG to 'unsigned int'
24 | and then you can use the 'DES_PTR' option.
25 |
26 | The file options.txt has the options listed for best speed on quite a
27 | few systems. Look and the options (UNROLL, PTR, RISC2 etc) and then
28 | turn on the relevant option in the Makefile.
29 |
30 | There are some special Makefile targets that make life easier.
31 | make cc - standard cc build
32 | make gcc - standard gcc build
33 | make x86-elf - x86 assembler (elf), linux-elf.
34 | make x86-out - x86 assembler (a.out), FreeBSD
35 | make x86-solaris- x86 assembler
36 | make x86-bsdi - x86 assembler (a.out with primative assembler).
37 |
38 | If at all possible use the assembler (for Windows NT/95, use
39 | asm/win32.obj to link with). The x86 assembler is very very fast.
40 |
41 | A make install will by default install
42 | libdes.a in /usr/local/lib/libdes.a
43 | des in /usr/local/bin/des
44 | des_crypt.man in /usr/local/man/man3/des_crypt.3
45 | des.man in /usr/local/man/man1/des.1
46 | des.h in /usr/include/des.h
47 |
48 | des(1) should be compatible with sunOS's but I have been unable to
49 | test it.
50 |
51 | These routines should compile on MSDOS, most 32bit and 64bit version
52 | of Unix (BSD and SYSV) and VMS, without modification.
53 | The only problems should be #include files that are in the wrong places.
54 |
55 | These routines can be compiled under MSDOS.
56 | I have successfully encrypted files using des(1) under MSDOS and then
57 | decrypted the files on a SparcStation.
58 | I have been able to compile and test the routines with
59 | Microsoft C v 5.1 and Turbo C v 2.0.
60 | The code in this library is in no way optimised for the 16bit
61 | operation of MSDOS.
62 |
63 | When building for glibc, ignore all of the above and just unpack into
64 | glibc-1.??/des and then gmake as per normal.
65 |
66 | As a final note on performace. Certain CPUs like sparcs and Alpha often give
67 | a %10 speed difference depending on the link order. It is rather anoying
68 | when one program reports 'x' DES encrypts a second and another reports
69 | 'x*0.9' the speed.
70 |
--------------------------------------------------------------------------------
/crypto/des/Imakefile:
--------------------------------------------------------------------------------
1 | # This Imakefile has not been tested for a while but it should still
2 | # work when placed in the correct directory in the kerberos v 4 distribution
3 |
4 | SRCS= cbc_cksm.c cbc_enc.c ecb_enc.c pcbc_enc.c \
5 | qud_cksm.c rand_key.c read_pwd.c set_key.c str2key.c \
6 | enc_read.c enc_writ.c fcrypt.c cfb_enc.c \
7 | ecb3_enc.c ofb_enc.c ofb64enc.c
8 |
9 | OBJS= cbc_cksm.o cbc_enc.o ecb_enc.o pcbc_enc.o \
10 | qud_cksm.o rand_key.o read_pwd.o set_key.o str2key.o \
11 | enc_read.o enc_writ.o fcrypt.o cfb_enc.o \
12 | ecb3_enc.o ofb_enc.o ofb64enc.o
13 |
14 | GENERAL=COPYRIGHT FILES INSTALL Imakefile README VERSION makefile times \
15 | vms.com KERBEROS
16 | DES= des.c des.man
17 | TESTING=destest.c speed.c rpw.c
18 | LIBDES= des_crypt.man des.h des_locl.h podd.h sk.h spr.h
19 |
20 | PERL= des.pl testdes.pl doIP doPC1 doPC2 PC1 PC2 shifts.pl
21 |
22 | CODE= $(GENERAL) $(DES) $(TESTING) $(SRCS) $(LIBDES) $(PERL)
23 |
24 | SRCDIR=$(SRCTOP)/lib/des
25 |
26 | DBG= -O
27 | INCLUDE= -I$(SRCDIR)
28 | CC= cc
29 |
30 | library_obj_rule()
31 |
32 | install_library_target(des,$(OBJS),$(SRCS),)
33 |
34 | test(destest,libdes.a,)
35 | test(rpw,libdes.a,)
36 |
--------------------------------------------------------------------------------
/crypto/des/KERBEROS:
--------------------------------------------------------------------------------
1 | [ This is an old file, I don't know if it is true anymore
2 | but I will leave the file here - eay 21/11/95 ]
3 |
4 | To use this library with Bones (kerberos without DES):
5 | 1) Get my modified Bones - eBones. It can be found on
6 | gondwana.ecr.mu.oz.au (128.250.1.63) /pub/athena/eBones-p9.tar.Z
7 | and
8 | nic.funet.fi (128.214.6.100) /pub/unix/security/Kerberos/eBones-p9.tar.Z
9 |
10 | 2) Unpack this library in src/lib/des, makeing sure it is version
11 | 3.00 or greater (libdes.tar.93-10-07.Z). This versions differences
12 | from the version in comp.sources.misc volume 29 patchlevel2.
13 | The primarily difference is that it should compile under kerberos :-).
14 | It can be found at.
15 | ftp.psy.uq.oz.au (130.102.32.1) /pub/DES/libdes.tar.93-10-07.Z
16 |
17 | Now do a normal kerberos build and things should work.
18 |
19 | One problem I found when I was build on my local sun.
20 | ---
21 | For sunOS 4.1.1 apply the following patch to src/util/ss/make_commands.c
22 |
23 | *** make_commands.c.orig Fri Jul 3 04:18:35 1987
24 | --- make_commands.c Wed May 20 08:47:42 1992
25 | ***************
26 | *** 98,104 ****
27 | if (!rename(o_file, z_file)) {
28 | if (!vfork()) {
29 | chdir("/tmp");
30 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r", "-n",
31 | z_file+5, 0);
32 | perror("/bin/ld");
33 | _exit(1);
34 | --- 98,104 ----
35 | if (!rename(o_file, z_file)) {
36 | if (!vfork()) {
37 | chdir("/tmp");
38 | ! execl("/bin/ld", "ld", "-o", o_file+5, "-s", "-r",
39 | z_file+5, 0);
40 | perror("/bin/ld");
41 | _exit(1);
42 |
--------------------------------------------------------------------------------
/crypto/des/README:
--------------------------------------------------------------------------------
1 |
2 | libdes, Version 4.01 10-Jan-97
3 |
4 | Copyright (c) 1997, Eric Young
5 | All rights reserved.
6 |
7 | This program is free software; you can redistribute it and/or modify
8 | it under the terms specified in COPYRIGHT.
9 |
10 | --
11 | The primary ftp site for this library is
12 | ftp://ftp.psy.uq.oz.au/pub/Crypto/DES/libdes-x.xx.tar.gz
13 | libdes is now also shipped with SSLeay. Primary ftp site of
14 | ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL/SSLeay-x.x.x.tar.gz
15 |
16 | The best way to build this library is to build it as part of SSLeay.
17 |
18 | This kit builds a DES encryption library and a DES encryption program.
19 | It supports ecb, cbc, ofb, cfb, triple ecb, triple cbc, triple ofb,
20 | triple cfb, desx, and MIT's pcbc encryption modes and also has a fast
21 | implementation of crypt(3).
22 | It contains support routines to read keys from a terminal,
23 | generate a random key, generate a key from an arbitrary length string,
24 | read/write encrypted data from/to a file descriptor.
25 |
26 | The implementation was written so as to conform with the manual entry
27 | for the des_crypt(3) library routines from MIT's project Athena.
28 |
29 | destest should be run after compilation to test the des routines.
30 | rpw should be run after compilation to test the read password routines.
31 | The des program is a replacement for the sun des command. I believe it
32 | conforms to the sun version.
33 |
34 | The Imakefile is setup for use in the kerberos distribution.
35 |
36 | These routines are best compiled with gcc or any other good
37 | optimising compiler.
38 | Just turn you optimiser up to the highest settings and run destest
39 | after the build to make sure everything works.
40 |
41 | I believe these routines are close to the fastest and most portable DES
42 | routines that use small lookup tables (4.5k) that are publicly available.
43 | The fcrypt routine is faster than ufc's fcrypt (when compiling with
44 | gcc2 -O2) on the sparc 2 (1410 vs 1270) but is not so good on other machines
45 | (on a sun3/260 168 vs 336). It is a function of CPU on chip cache size.
46 | [ 10-Jan-97 and a function of an incorrect speed testing program in
47 | ufc which gave much better test figures that reality ].
48 |
49 | It is worth noting that on sparc and Alpha CPUs, performance of the DES
50 | library can vary by upto %10 due to the positioning of files after application
51 | linkage.
52 |
53 | Eric Young (eay@cryptsoft.com)
54 |
55 |
--------------------------------------------------------------------------------
/crypto/des/asm/desboth.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 |
3 | $L="edi";
4 | $R="esi";
5 |
6 | sub DES_encrypt3
7 | {
8 | local($name,$enc)=@_;
9 |
10 | &function_begin_B($name,"");
11 | &push("ebx");
12 | &mov("ebx",&wparam(0));
13 |
14 | &push("ebp");
15 | &push("esi");
16 |
17 | &push("edi");
18 |
19 | &comment("");
20 | &comment("Load the data words");
21 | &mov($L,&DWP(0,"ebx","",0));
22 | &mov($R,&DWP(4,"ebx","",0));
23 | &stack_push(3);
24 |
25 | &comment("");
26 | &comment("IP");
27 | &IP_new($L,$R,"edx",0);
28 |
29 | # put them back
30 |
31 | if ($enc)
32 | {
33 | &mov(&DWP(4,"ebx","",0),$R);
34 | &mov("eax",&wparam(1));
35 | &mov(&DWP(0,"ebx","",0),"edx");
36 | &mov("edi",&wparam(2));
37 | &mov("esi",&wparam(3));
38 | }
39 | else
40 | {
41 | &mov(&DWP(4,"ebx","",0),$R);
42 | &mov("esi",&wparam(1));
43 | &mov(&DWP(0,"ebx","",0),"edx");
44 | &mov("edi",&wparam(2));
45 | &mov("eax",&wparam(3));
46 | }
47 | &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
48 | &mov(&swtmp(1), "eax");
49 | &mov(&swtmp(0), "ebx");
50 | &call("DES_encrypt2");
51 | &mov(&swtmp(2), (DWC(($enc)?"0":"1")));
52 | &mov(&swtmp(1), "edi");
53 | &mov(&swtmp(0), "ebx");
54 | &call("DES_encrypt2");
55 | &mov(&swtmp(2), (DWC(($enc)?"1":"0")));
56 | &mov(&swtmp(1), "esi");
57 | &mov(&swtmp(0), "ebx");
58 | &call("DES_encrypt2");
59 |
60 | &stack_pop(3);
61 | &mov($L,&DWP(0,"ebx","",0));
62 | &mov($R,&DWP(4,"ebx","",0));
63 |
64 | &comment("");
65 | &comment("FP");
66 | &FP_new($L,$R,"eax",0);
67 |
68 | &mov(&DWP(0,"ebx","",0),"eax");
69 | &mov(&DWP(4,"ebx","",0),$R);
70 |
71 | &pop("edi");
72 | &pop("esi");
73 | &pop("ebp");
74 | &pop("ebx");
75 | &ret();
76 | &function_end_B($name);
77 | }
78 |
79 |
80 |
--------------------------------------------------------------------------------
/crypto/des/des3s.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // gettsc.inl
3 | //
4 | // gives access to the Pentium's (secret) cycle counter
5 | //
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca)
7 | // in 1996-7 and is entered, by him, into the public domain.
8 |
9 | #if defined(__WATCOMC__)
10 | void GetTSC(unsigned long&);
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12 | #elif defined(__GNUC__)
13 | inline
14 | void GetTSC(unsigned long& tsc)
15 | {
16 | asm volatile(".byte 15, 49\n\t"
17 | : "=eax" (tsc)
18 | :
19 | : "%edx", "%eax");
20 | }
21 | #elif defined(_MSC_VER)
22 | inline
23 | void GetTSC(unsigned long& tsc)
24 | {
25 | unsigned long a;
26 | __asm _emit 0fh
27 | __asm _emit 31h
28 | __asm mov a, eax;
29 | tsc=a;
30 | }
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | void main(int argc,char *argv[])
38 | {
39 | des_key_schedule key1,key2,key3;
40 | unsigned long s1,s2,e1,e2;
41 | unsigned long data[2];
42 | int i,j;
43 |
44 | for (j=0; j<6; j++)
45 | {
46 | for (i=0; i<1000; i++) /**/
47 | {
48 | des_encrypt3(&data[0],key1,key2,key3);
49 | GetTSC(s1);
50 | des_encrypt3(&data[0],key1,key2,key3);
51 | des_encrypt3(&data[0],key1,key2,key3);
52 | des_encrypt3(&data[0],key1,key2,key3);
53 | GetTSC(e1);
54 | GetTSC(s2);
55 | des_encrypt3(&data[0],key1,key2,key3);
56 | des_encrypt3(&data[0],key1,key2,key3);
57 | des_encrypt3(&data[0],key1,key2,key3);
58 | des_encrypt3(&data[0],key1,key2,key3);
59 | GetTSC(e2);
60 | des_encrypt3(&data[0],key1,key2,key3);
61 | }
62 |
63 | printf("des %d %d (%d)\n",
64 | e1-s1,e2-s2,((e2-s2)-(e1-s1)));
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/crypto/des/dess.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // gettsc.inl
3 | //
4 | // gives access to the Pentium's (secret) cycle counter
5 | //
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca)
7 | // in 1996-7 and is entered, by him, into the public domain.
8 |
9 | #if defined(__WATCOMC__)
10 | void GetTSC(unsigned long&);
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12 | #elif defined(__GNUC__)
13 | inline
14 | void GetTSC(unsigned long& tsc)
15 | {
16 | asm volatile(".byte 15, 49\n\t"
17 | : "=eax" (tsc)
18 | :
19 | : "%edx", "%eax");
20 | }
21 | #elif defined(_MSC_VER)
22 | inline
23 | void GetTSC(unsigned long& tsc)
24 | {
25 | unsigned long a;
26 | __asm _emit 0fh
27 | __asm _emit 31h
28 | __asm mov a, eax;
29 | tsc=a;
30 | }
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | void main(int argc,char *argv[])
38 | {
39 | des_key_schedule key;
40 | unsigned long s1,s2,e1,e2;
41 | unsigned long data[2];
42 | int i,j;
43 |
44 | for (j=0; j<6; j++)
45 | {
46 | for (i=0; i<1000; i++) /**/
47 | {
48 | des_encrypt1(&data[0],key,1);
49 | GetTSC(s1);
50 | des_encrypt1(&data[0],key,1);
51 | des_encrypt1(&data[0],key,1);
52 | des_encrypt1(&data[0],key,1);
53 | GetTSC(e1);
54 | GetTSC(s2);
55 | des_encrypt1(&data[0],key,1);
56 | des_encrypt1(&data[0],key,1);
57 | des_encrypt1(&data[0],key,1);
58 | des_encrypt1(&data[0],key,1);
59 | GetTSC(e2);
60 | des_encrypt1(&data[0],key,1);
61 | }
62 |
63 | printf("des %d %d (%d)\n",
64 | e1-s1,e2-s2,((e2-s2)-(e1-s1)));
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/crypto/des/makefile.bc:
--------------------------------------------------------------------------------
1 | #
2 | # Origional BC Makefile from Teun
3 | #
4 | #
5 | CC = bcc
6 | TLIB = tlib /0 /C
7 | # note: the -3 flag produces code for 386, 486, Pentium etc; omit it for 286s
8 | OPTIMIZE= -3 -O2
9 | #WINDOWS= -W
10 | CFLAGS = -c -ml -d $(OPTIMIZE) $(WINDOWS) -DMSDOS
11 | LFLAGS = -ml $(WINDOWS)
12 |
13 | .c.obj:
14 | $(CC) $(CFLAGS) $*.c
15 |
16 | .obj.exe:
17 | $(CC) $(LFLAGS) -e$*.exe $*.obj libdes.lib
18 |
19 | all: $(LIB) destest.exe rpw.exe des.exe speed.exe
20 |
21 | # "make clean": use a directory containing only libdes .exe and .obj files...
22 | clean:
23 | del *.exe
24 | del *.obj
25 | del libdes.lib
26 | del libdes.rsp
27 |
28 | OBJS= cbc_cksm.obj cbc_enc.obj ecb_enc.obj pcbc_enc.obj \
29 | qud_cksm.obj rand_key.obj set_key.obj str2key.obj \
30 | enc_read.obj enc_writ.obj fcrypt.obj cfb_enc.obj \
31 | ecb3_enc.obj ofb_enc.obj cbc3_enc.obj read_pwd.obj\
32 | cfb64enc.obj ofb64enc.obj ede_enc.obj cfb64ede.obj\
33 | ofb64ede.obj supp.obj
34 |
35 | LIB= libdes.lib
36 |
37 | $(LIB): $(OBJS)
38 | del $(LIB)
39 | makersp "+%s &\n" &&|
40 | $(OBJS)
41 | | >libdes.rsp
42 | $(TLIB) libdes.lib @libdes.rsp,nul
43 | del libdes.rsp
44 |
45 | destest.exe: destest.obj libdes.lib
46 | rpw.exe: rpw.obj libdes.lib
47 | speed.exe: speed.obj libdes.lib
48 | des.exe: des.obj libdes.lib
49 |
50 |
51 |
--------------------------------------------------------------------------------
/crypto/des/options.txt:
--------------------------------------------------------------------------------
1 | Note that the UNROLL option makes the 'inner' des loop unroll all 16 rounds
2 | instead of the default 4.
3 | RISC1 and RISC2 are 2 alternatives for the inner loop and
4 | PTR means to use pointers arithmatic instead of arrays.
5 |
6 | FreeBSD - Pentium Pro 200mhz - gcc 2.7.2.2 - assembler 577,000 4620k/s
7 | IRIX 6.2 - R10000 195mhz - cc (-O3 -n32) - UNROLL RISC2 PTR 496,000 3968k/s
8 | solaris 2.5.1 usparc 167mhz?? - SC4.0 - UNROLL RISC1 PTR [1] 459,400 3672k/s
9 | FreeBSD - Pentium Pro 200mhz - gcc 2.7.2.2 - UNROLL RISC1 433,000 3468k/s
10 | solaris 2.5.1 usparc 167mhz?? - gcc 2.7.2 - UNROLL 380,000 3041k/s
11 | linux - pentium 100mhz - gcc 2.7.0 - assembler 281,000 2250k/s
12 | NT 4.0 - pentium 100mhz - VC 4.2 - assembler 281,000 2250k/s
13 | AIX 4.1? - PPC604 100mhz - cc - UNROLL 275,000 2200k/s
14 | IRIX 5.3 - R4400 200mhz - gcc 2.6.3 - UNROLL RISC2 PTR 235,300 1882k/s
15 | IRIX 5.3 - R4400 200mhz - cc - UNROLL RISC2 PTR 233,700 1869k/s
16 | NT 4.0 - pentium 100mhz - VC 4.2 - UNROLL RISC1 PTR 191,000 1528k/s
17 | DEC Alpha 165mhz?? - cc - RISC2 PTR [2] 181,000 1448k/s
18 | linux - pentium 100mhz - gcc 2.7.0 - UNROLL RISC1 PTR 158,500 1268k/s
19 | HPUX 10 - 9000/887 - cc - UNROLL [3] 148,000 1190k/s
20 | solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2 - UNROLL 123,600 989k/s
21 | IRIX 5.3 - R4000 100mhz - cc - UNROLL RISC2 PTR 101,000 808k/s
22 | DGUX - 88100 50mhz(?) - gcc 2.6.3 - UNROLL 81,000 648k/s
23 | solaris 2.4 486 50mhz - gcc 2.6.3 - assembler 65,000 522k/s
24 | HPUX 10 - 9000/887 - k&r cc (default compiler) - UNROLL PTR 76,000 608k/s
25 | solaris 2.4 486 50mhz - gcc 2.6.3 - UNROLL RISC2 43,500 344k/s
26 | AIX - old slow one :-) - cc - 39,000 312k/s
27 |
28 | Notes.
29 | [1] For the ultra sparc, SunC 4.0
30 | cc -xtarget=ultra -xarch=v8plus -Xa -xO5, running 'des_opts'
31 | gives a speed of 344,000 des/s while 'speed' gives 459,000 des/s.
32 | I'll record the higher since it is coming from the library but it
33 | is all rather weird.
34 | [2] Similar to the ultra sparc ([1]), 181,000 for 'des_opts' vs 175,000.
35 | [3] I was unable to get access to this machine when it was not heavily loaded.
36 | As such, my timing program was never able to get more that %30 of the CPU.
37 | This would cause the program to give much lower speed numbers because
38 | it would be 'fighting' to stay in the cache with the other CPU burning
39 | processes.
40 |
--------------------------------------------------------------------------------
/crypto/des/t/test:
--------------------------------------------------------------------------------
1 | #!./perl
2 |
3 | BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); }
4 |
5 | use DES;
6 |
7 | $key='00000000';
8 | $ks=DES::set_key($key);
9 | @a=split(//,$ks);
10 | foreach (@a) { printf "%02x-",ord($_); }
11 | print "\n";
12 |
13 |
14 | $key=DES::random_key();
15 | print "($_)\n";
16 | @a=split(//,$key);
17 | foreach (@a) { printf "%02x-",ord($_); }
18 | print "\n";
19 | $str="this is and again into the breach";
20 | ($k1,$k2)=DES::string_to_2keys($str);
21 | @a=split(//,$k1);
22 | foreach (@a) { printf "%02x-",ord($_); }
23 | print "\n";
24 | @a=split(//,$k2);
25 | foreach (@a) { printf "%02x-",ord($_); }
26 | print "\n";
27 |
28 |
--------------------------------------------------------------------------------
/crypto/des/times/486-50.sol:
--------------------------------------------------------------------------------
1 | Solaris 2.4, 486 50mhz, gcc 2.6.3
2 | options des ecb/s
3 | 16 r2 i 43552.51 100.0%
4 | 16 r1 i 43487.45 99.9%
5 | 16 c p 43003.23 98.7%
6 | 16 r2 p 42339.00 97.2%
7 | 16 c i 41900.91 96.2%
8 | 16 r1 p 41360.64 95.0%
9 | 4 c i 38728.48 88.9%
10 | 4 c p 38225.63 87.8%
11 | 4 r1 i 38085.79 87.4%
12 | 4 r2 i 37825.64 86.9%
13 | 4 r2 p 34611.00 79.5%
14 | 4 r1 p 31802.00 73.0%
15 | -DDES_UNROLL -DDES_RISC2
16 |
17 |
--------------------------------------------------------------------------------
/crypto/des/times/586-100.lnx:
--------------------------------------------------------------------------------
1 | Pentium 100
2 | Linux 2 kernel
3 | gcc 2.7.0 -O3 -fomit-frame-pointer
4 | No X server running, just a console, it makes the top speed jump from 151,000
5 | to 158,000 :-).
6 | options des ecb/s
7 | assember 281000.00 177.1%
8 | 16 r1 p 158667.40 100.0%
9 | 16 r1 i 148471.70 93.6%
10 | 16 r2 p 143961.80 90.7%
11 | 16 r2 i 141689.20 89.3%
12 | 4 r1 i 140100.00 88.3%
13 | 4 r2 i 134049.40 84.5%
14 | 16 c i 124145.20 78.2%
15 | 16 c p 121584.20 76.6%
16 | 4 c i 118116.00 74.4%
17 | 4 r2 p 117977.90 74.4%
18 | 4 c p 114971.40 72.5%
19 | 4 r1 p 114578.40 72.2%
20 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR
21 |
--------------------------------------------------------------------------------
/crypto/des/times/686-200.fre:
--------------------------------------------------------------------------------
1 | Pentium 100
2 | Free BSD 2.1.5 kernel
3 | gcc 2.7.2.2 -O3 -fomit-frame-pointer
4 | options des ecb/s
5 | assember 578000.00 133.1%
6 | 16 r2 i 434454.80 100.0%
7 | 16 r1 i 433621.43 99.8%
8 | 16 r2 p 431375.69 99.3%
9 | 4 r1 i 423722.30 97.5%
10 | 4 r2 i 422399.40 97.2%
11 | 16 r1 p 421739.40 97.1%
12 | 16 c i 399027.94 91.8%
13 | 16 c p 372251.70 85.7%
14 | 4 c i 365118.35 84.0%
15 | 4 c p 352880.51 81.2%
16 | 4 r2 p 255104.90 58.7%
17 | 4 r1 p 251289.18 57.8%
18 | -DDES_UNROLL -DDES_RISC2
19 |
--------------------------------------------------------------------------------
/crypto/des/times/aix.cc:
--------------------------------------------------------------------------------
1 | From: Paco Garcia
2 |
3 | This machine is a Bull Estrella Minitower Model MT604-100
4 | Processor : PPC604
5 | P.Speed : 100Mhz
6 | Data/Instr Cache : 16 K
7 | L2 Cache : 256 K
8 | PCI BUS Speed : 33 Mhz
9 | TransfRate PCI : 132 MB/s
10 | Memory : 96 MB
11 |
12 | options des ecb/s
13 | 4 c p 275118.61 100.0%
14 | 4 c i 273545.07 99.4%
15 | 4 r2 p 270441.02 98.3%
16 | 4 r1 p 253052.15 92.0%
17 | 4 r2 i 240842.97 87.5%
18 | 4 r1 i 240556.66 87.4%
19 | 16 c i 224603.99 81.6%
20 | 16 c p 224483.98 81.6%
21 | 16 r2 p 215691.19 78.4%
22 | 16 r1 p 208332.83 75.7%
23 | 16 r1 i 199206.50 72.4%
24 | 16 r2 i 198963.70 72.3%
25 | -DDES_PTR
26 |
27 |
--------------------------------------------------------------------------------
/crypto/des/times/alpha.cc:
--------------------------------------------------------------------------------
1 | cc -O2
2 | DES_LONG is 'unsigned int'
3 |
4 | options des ecb/s
5 | 4 r2 p 181146.14 100.0%
6 | 16 r2 p 172102.94 95.0%
7 | 4 r2 i 165424.11 91.3%
8 | 16 c p 160468.64 88.6%
9 | 4 c p 156653.59 86.5%
10 | 4 c i 155245.18 85.7%
11 | 4 r1 p 154729.68 85.4%
12 | 16 r2 i 154137.69 85.1%
13 | 16 r1 p 152357.96 84.1%
14 | 16 c i 148743.91 82.1%
15 | 4 r1 i 146695.59 81.0%
16 | 16 r1 i 144961.00 80.0%
17 | -DDES_RISC2 -DDES_PTR
18 |
19 |
--------------------------------------------------------------------------------
/crypto/des/times/hpux.cc:
--------------------------------------------------------------------------------
1 | HPUX 10 - 9000/887 - cc -D_HPUX_SOURCE -Aa +ESlit +O2 -Wl,-a,archive
2 |
3 | options des ecb/s
4 | 16 c i 149448.90 100.0%
5 | 4 c i 145861.79 97.6%
6 | 16 r2 i 141710.96 94.8%
7 | 16 r1 i 139455.33 93.3%
8 | 4 r2 i 138800.00 92.9%
9 | 4 r1 i 136692.65 91.5%
10 | 16 r2 p 110228.17 73.8%
11 | 16 r1 p 109397.07 73.2%
12 | 16 c p 109209.89 73.1%
13 | 4 c p 108014.71 72.3%
14 | 4 r2 p 107873.88 72.2%
15 | 4 r1 p 107685.83 72.1%
16 | -DDES_UNROLL
17 |
18 |
--------------------------------------------------------------------------------
/crypto/des/times/sparc.gcc:
--------------------------------------------------------------------------------
1 | solaris 2.5.1 - sparc 10 50mhz - gcc 2.7.2
2 |
3 | options des ecb/s
4 | 16 c i 124382.70 100.0%
5 | 4 c i 118884.68 95.6%
6 | 16 c p 112261.20 90.3%
7 | 16 r2 i 111777.10 89.9%
8 | 16 r2 p 108896.30 87.5%
9 | 16 r1 p 108791.59 87.5%
10 | 4 c p 107290.10 86.3%
11 | 4 r1 p 104583.80 84.1%
12 | 16 r1 i 104206.20 83.8%
13 | 4 r2 p 103709.80 83.4%
14 | 4 r2 i 98306.43 79.0%
15 | 4 r1 i 91525.80 73.6%
16 | -DDES_UNROLL
17 |
18 |
--------------------------------------------------------------------------------
/crypto/des/times/usparc.cc:
--------------------------------------------------------------------------------
1 | solaris 2.5.1 usparc 167mhz?? - SC4.0 cc -fast -Xa -xO5
2 |
3 | For the ultra sparc, SunC 4.0 cc -fast -Xa -xO5, running 'des_opts'
4 | gives a speed of 475,000 des/s while 'speed' gives 417,000 des/s.
5 | I believe the difference is tied up in optimisation that the compiler
6 | is able to perform when the code is 'inlined'. For 'speed', the DES
7 | routines are being linked from a library. I'll record the higher
8 | speed since if performance is everything, you can always inline
9 | 'des_enc.c'.
10 |
11 | [ 16-Jan-06 - I've been playing with the
12 | '-xtarget=ultra -xarch=v8plus -Xa -xO5 -Xa'
13 | and while it makes the des_opts numbers much slower, it makes the
14 | actual 'speed' numbers look better which is a realistic version of
15 | using the libraries. ]
16 |
17 | options des ecb/s
18 | 16 r1 p 475516.90 100.0%
19 | 16 r2 p 439388.10 92.4%
20 | 16 c i 427001.40 89.8%
21 | 16 c p 419516.50 88.2%
22 | 4 r2 p 409491.70 86.1%
23 | 4 r1 p 404266.90 85.0%
24 | 4 c p 398121.00 83.7%
25 | 4 c i 370588.40 77.9%
26 | 4 r1 i 362742.20 76.3%
27 | 16 r2 i 331275.50 69.7%
28 | 16 r1 i 324730.60 68.3%
29 | 4 r2 i 63535.10 13.4% <-- very very weird, must be cache problems.
30 | -DDES_UNROLL -DDES_RISC1 -DDES_PTR
31 |
32 |
--------------------------------------------------------------------------------
/crypto/des/typemap:
--------------------------------------------------------------------------------
1 | #
2 | # DES SECTION
3 | #
4 | deschar * T_DESCHARP
5 | des_cblock * T_CBLOCK
6 | des_cblock T_CBLOCK
7 | des_key_schedule T_SCHEDULE
8 | des_key_schedule * T_SCHEDULE
9 |
10 | INPUT
11 | T_CBLOCK
12 | $var=(des_cblock *)SvPV($arg,len);
13 | if (len < DES_KEY_SZ)
14 | {
15 | croak(\"$var needs to be at least %u bytes long\",DES_KEY_SZ);
16 | }
17 |
18 | T_SCHEDULE
19 | $var=(des_key_schedule *)SvPV($arg,len);
20 | if (len < DES_SCHEDULE_SZ)
21 | {
22 | croak(\"$var needs to be at least %u bytes long\",
23 | DES_SCHEDULE_SZ);
24 | }
25 |
26 | OUTPUT
27 | T_CBLOCK
28 | sv_setpvn($arg,(char *)$var,DES_KEY_SZ);
29 |
30 | T_SCHEDULE
31 | sv_setpvn($arg,(char *)$var,DES_SCHEDULE_SZ);
32 |
33 | T_DESCHARP
34 | sv_setpvn($arg,(char *)$var,len);
35 |
--------------------------------------------------------------------------------
/crypto/dh/dh1024.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIGHAoGBAJf2QmHKtQXdKCjhPx1ottPb0PMTBH9A6FbaWMsTuKG/K3g6TG1Z1fkq
3 | /Gz/PWk/eLI9TzFgqVAuPvr3q14a1aZeVUMTgo2oO5/y2UHe6VaJ+trqCTat3xlx
4 | /mNbIK9HA2RgPC3gWfVLZQrY+gz3ASHHR5nXWHEyvpuZm7m3h+irAgEC
5 | -----END DH PARAMETERS-----
6 |
--------------------------------------------------------------------------------
/crypto/dh/dh192.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MB4CGQDUoLoCULb9LsYm5+/WN992xxbiLQlEuIsCAQM=
3 | -----END DH PARAMETERS-----
4 |
--------------------------------------------------------------------------------
/crypto/dh/dh2048.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIIBCAKCAQEA7ZKJNYJFVcs7+6J2WmkEYb8h86tT0s0h2v94GRFS8Q7B4lW9aG9o
3 | AFO5Imov5Jo0H2XMWTKKvbHbSe3fpxJmw/0hBHAY8H/W91hRGXKCeyKpNBgdL8sh
4 | z22SrkO2qCnHJ6PLAMXy5fsKpFmFor2tRfCzrfnggTXu2YOzzK7q62bmqVdmufEo
5 | pT8igNcLpvZxk5uBDvhakObMym9mX3rAEBoe8PwttggMYiiw7NuJKO4MqD1llGkW
6 | aVM8U2ATsCun1IKHrRxynkE1/MJ86VHeYYX8GZt2YA8z+GuzylIOKcMH6JAWzMwA
7 | Gbatw6QwizOhr9iMjZ0B26TE3X8LvW84wwIBAg==
8 | -----END DH PARAMETERS-----
9 | -----BEGIN DH PARAMETERS-----
10 | MIIBCAKCAQEArtA3w73zP6Lu3EOQtwogiXt3AXXpuS6yD4BhzNS1pZFyPHk0/an5
11 | 8ydEkPhQZHKDW+BZJxxPLANaTudWo2YT8TgtvUdN6KSgMiEi6McwqDw+SADuvW+F
12 | SKUYFxG6VFIxyEP6xBdf+vhJxEDbRG2EYsHDRRtJ76gp9cSKTHusf2R+4AAVGqnt
13 | gRAbNqtcOar/7FSj+Pl8G3v0Bty0LcCSpbqgYlnv6z+rErQmmC6PPvSz97TDMCok
14 | yKpCE9hFA1zkqK3TH4FmFvGeIaXJUIBZf4mArWuBTjWFW3nmhESRUn1VK3K3x42N
15 | a5k6c2+EhrMFiLjxuH6JZoqL0/E93FF9SwIBAg==
16 | -----END DH PARAMETERS-----
17 |
--------------------------------------------------------------------------------
/crypto/dh/dh4096.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MIICCAKCAgEA/urRnb6vkPYc/KEGXWnbCIOaKitq7ySIq9dTH7s+Ri59zs77zty7
3 | vfVlSe6VFTBWgYjD2XKUFmtqq6CqXMhVX5ElUDoYDpAyTH85xqNFLzFC7nKrff/H
4 | TFKNttp22cZE9V0IPpzedPfnQkE7aUdmF9JnDyv21Z/818O93u1B4r0szdnmEvEF
5 | bKuIxEHX+bp0ZR7RqE1AeifXGJX3d6tsd2PMAObxwwsv55RGkn50vHO4QxtTARr1
6 | rRUV5j3B3oPMgC7Offxx+98Xn45B1/G0Prp11anDsR1PGwtaCYipqsvMwQUSJtyE
7 | EOQWk+yFkeMe4vWv367eEi0Sd/wnC+TSXBE3pYvpYerJ8n1MceI5GQTdarJ77OW9
8 | bGTHmxRsLSCM1jpLdPja5jjb4siAa6EHc4qN9c/iFKS3PQPJEnX7pXKBRs5f7AF3
9 | W3RIGt+G9IVNZfXaS7Z/iCpgzgvKCs0VeqN38QsJGtC1aIkwOeyjPNy2G6jJ4yqH
10 | ovXYt/0mc00vCWeSNS1wren0pR2EiLxX0ypjjgsU1mk/Z3b/+zVf7fZSIB+nDLjb
11 | NPtUlJCVGnAeBK1J1nG3TQicqowOXoM6ISkdaXj5GPJdXHab2+S7cqhKGv5qC7rR
12 | jT6sx7RUr0CNTxzLI7muV2/a4tGmj0PSdXQdsZ7tw7gbXlaWT1+MM2MCAQI=
13 | -----END DH PARAMETERS-----
14 |
15 |
--------------------------------------------------------------------------------
/crypto/dh/dh512.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN DH PARAMETERS-----
2 | MEYCQQDaWDwW2YUiidDkr3VvTMqS3UvlM7gE+w/tlO+cikQD7VdGUNNpmdsp13Yn
3 | a6LT1BLiGPTdHghM9tgAPnxHdOgzAgEC
4 | -----END DH PARAMETERS-----
5 |
--------------------------------------------------------------------------------
/crypto/dh/example:
--------------------------------------------------------------------------------
1 | From owner-cypherpunks@toad.com Mon Sep 25 10:50:51 1995
2 | Received: from minbne.mincom.oz.au by orb.mincom.oz.au with SMTP id AA10562
3 | (5.65c/IDA-1.4.4 for eay); Wed, 27 Sep 1995 19:41:55 +1000
4 | Received: by minbne.mincom.oz.au id AA19958
5 | (5.65c/IDA-1.4.4 for eay@orb.mincom.oz.au); Wed, 27 Sep 1995 19:34:59 +1000
6 | Received: from relay3.UU.NET by bunyip.cc.uq.oz.au with SMTP (PP);
7 | Wed, 27 Sep 1995 19:13:05 +1000
8 | Received: from toad.com by relay3.UU.NET with SMTP id QQzizb16156;
9 | Wed, 27 Sep 1995 04:48:46 -0400
10 | Received: by toad.com id AA07905; Tue, 26 Sep 95 06:31:45 PDT
11 | Received: from by toad.com id AB07851; Tue, 26 Sep 95 06:31:40 PDT
12 | Received: from servo.qualcomm.com (servo.qualcomm.com [129.46.128.14])
13 | by cygnus.com (8.6.12/8.6.9) with ESMTP id RAA18442
14 | for ; Mon, 25 Sep 1995 17:52:47 -0700
15 | Received: (karn@localhost) by servo.qualcomm.com (8.6.12/QC-BSD-2.5.1)
16 | id RAA14732; Mon, 25 Sep 1995 17:50:51 -0700
17 | Date: Mon, 25 Sep 1995 17:50:51 -0700
18 | From: Phil Karn
19 | Message-Id: <199509260050.RAA14732@servo.qualcomm.com>
20 | To: cypherpunks@toad.com, ipsec-dev@eit.com
21 | Subject: Primality verification needed
22 | Sender: owner-cypherpunks@toad.com
23 | Precedence: bulk
24 | Status: RO
25 | X-Status:
26 |
27 | Hi. I've generated a 2047-bit "strong" prime number that I would like to
28 | use with Diffie-Hellman key exchange. I assert that not only is this number
29 | 'p' prime, but so is (p-1)/2.
30 |
31 | I've used the mpz_probab_prime() function in the Gnu Math Package (GMP) version
32 | 1.3.2 to test this number. This function uses the Miller-Rabin primality test.
33 | However, to increase my confidence that this number really is a strong prime,
34 | I'd like to ask others to confirm it with other tests. Here's the number in hex:
35 |
36 | 72a925f760b2f954ed287f1b0953f3e6aef92e456172f9fe86fdd8822241b9c9788fbc289982743e
37 | fbcd2ccf062b242d7a567ba8bbb40d79bca7b8e0b6c05f835a5b938d985816bc648985adcff5402a
38 | a76756b36c845a840a1d059ce02707e19cf47af0b5a882f32315c19d1b86a56c5389c5e9bee16b65
39 | fde7b1a8d74a7675de9b707d4c5a4633c0290c95ff30a605aeb7ae864ff48370f13cf01d49adb9f2
40 | 3d19a439f753ee7703cf342d87f431105c843c78ca4df639931f3458fae8a94d1687e99a76ed99d0
41 | ba87189f42fd31ad8262c54a8cf5914ae6c28c540d714a5f6087a171fb74f4814c6f968d72386ef3
42 | 56a05180c3bec7ddd5ef6fe76b1f717b
43 |
44 | The generator, g, for this prime is 2.
45 |
46 | Thanks!
47 |
48 | Phil Karn
49 |
50 |
51 |
--------------------------------------------------------------------------------
/crypto/dh/generate:
--------------------------------------------------------------------------------
1 | From: stewarts@ix.netcom.com (Bill Stewart)
2 | Newsgroups: sci.crypt
3 | Subject: Re: Diffie-Hellman key exchange
4 | Date: Wed, 11 Oct 1995 23:08:28 GMT
5 | Organization: Freelance Information Architect
6 | Lines: 32
7 | Message-ID: <45hir2$7l8@ixnews7.ix.netcom.com>
8 | References: <458rhn$76m$1@mhadf.production.compuserve.com>
9 | NNTP-Posting-Host: ix-pl4-16.ix.netcom.com
10 | X-NETCOM-Date: Wed Oct 11 4:09:22 PM PDT 1995
11 | X-Newsreader: Forte Free Agent 1.0.82
12 |
13 | Kent Briggs <72124.3234@CompuServe.COM> wrote:
14 |
15 | >I have a copy of the 1976 IEEE article describing the
16 | >Diffie-Hellman public key exchange algorithm: y=a^x mod q. I'm
17 | >looking for sources that give examples of secure a,q pairs and
18 | >possible some source code that I could examine.
19 |
20 | q should be prime, and ideally should be a "strong prime",
21 | which means it's of the form 2n+1 where n is also prime.
22 | q also needs to be long enough to prevent the attacks LaMacchia and
23 | Odlyzko described (some variant on a factoring attack which generates
24 | a large pile of simultaneous equations and then solves them);
25 | long enough is about the same size as factoring, so 512 bits may not
26 | be secure enough for most applications. (The 192 bits used by
27 | "secure NFS" was certainly not long enough.)
28 |
29 | a should be a generator for q, which means it needs to be
30 | relatively prime to q-1. Usually a small prime like 2, 3 or 5 will
31 | work.
32 |
33 | ....
34 |
35 | Date: Tue, 26 Sep 1995 13:52:36 MST
36 | From: "Richard Schroeppel"
37 | To: karn
38 | Cc: ho@cs.arizona.edu
39 | Subject: random large primes
40 |
41 | Since your prime is really random, proving it is hard.
42 | My personal limit on rigorously proved primes is ~350 digits.
43 | If you really want a proof, we should talk to Francois Morain,
44 | or the Australian group.
45 |
46 | If you want 2 to be a generator (mod P), then you need it
47 | to be a non-square. If (P-1)/2 is also prime, then
48 | non-square == primitive-root for bases << P.
49 |
50 | In the case at hand, this means 2 is a generator iff P = 11 (mod 24).
51 | If you want this, you should restrict your sieve accordingly.
52 |
53 | 3 is a generator iff P = 5 (mod 12).
54 |
55 | 5 is a generator iff P = 3 or 7 (mod 10).
56 |
57 | 2 is perfectly usable as a base even if it's a non-generator, since
58 | it still covers half the space of possible residues. And an
59 | eavesdropper can always determine the low-bit of your exponent for
60 | a generator anyway.
61 |
62 | Rich rcs@cs.arizona.edu
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/crypto/dsa/README:
--------------------------------------------------------------------------------
1 | The stuff in here is based on patches supplied to me by
2 | Steven Schoch to do DSS.
3 | I have since modified a them a little but a debt of gratitude
4 | is due for doing the initial work.
5 |
--------------------------------------------------------------------------------
/crypto/dsa/dsa_locl.h:
--------------------------------------------------------------------------------
1 | /* ====================================================================
2 | * Copyright (c) 2007 The OpenSSL Project. All rights reserved.
3 | *
4 | * Redistribution and use in source and binary forms, with or without
5 | * modification, are permitted provided that the following conditions
6 | * are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | *
11 | * 2. Redistributions in binary form must reproduce the above copyright
12 | * notice, this list of conditions and the following disclaimer in
13 | * the documentation and/or other materials provided with the
14 | * distribution.
15 | *
16 | * 3. All advertising materials mentioning features or use of this
17 | * software must display the following acknowledgment:
18 | * "This product includes software developed by the OpenSSL Project
19 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
20 | *
21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
22 | * endorse or promote products derived from this software without
23 | * prior written permission. For written permission, please contact
24 | * openssl-core@openssl.org.
25 | *
26 | * 5. Products derived from this software may not be called "OpenSSL"
27 | * nor may "OpenSSL" appear in their names without prior written
28 | * permission of the OpenSSL Project.
29 | *
30 | * 6. Redistributions of any form whatsoever must retain the following
31 | * acknowledgment:
32 | * "This product includes software developed by the OpenSSL Project
33 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
34 | *
35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
46 | * OF THE POSSIBILITY OF SUCH DAMAGE.
47 | * ====================================================================
48 | *
49 | * This product includes cryptographic software written by Eric Young
50 | * (eay@cryptsoft.com). This product includes software written by Tim
51 | * Hudson (tjh@cryptsoft.com).
52 | *
53 | */
54 |
55 | #include
56 |
57 | int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
58 | const EVP_MD *evpmd, const unsigned char *seed_in, size_t seed_len,
59 | int *counter_ret, unsigned long *h_ret, BN_GENCB *cb);
60 |
--------------------------------------------------------------------------------
/crypto/dso/README:
--------------------------------------------------------------------------------
1 | NOTES
2 | -----
3 |
4 | I've checked out HPUX (well, version 11 at least) and shl_t is
5 | a pointer type so it's safe to use in the way it has been in
6 | dso_dl.c. On the other hand, HPUX11 support dlfcn too and
7 | according to their man page, prefer developers to move to that.
8 | I'll leave Richard's changes there as I guess dso_dl is needed
9 | for HPUX10.20.
10 |
11 | There is now a callback scheme in place where filename conversion can
12 | (a) be turned off altogether through the use of the
13 | DSO_FLAG_NO_NAME_TRANSLATION flag,
14 | (b) be handled by default using the default DSO_METHOD's converter
15 | (c) overriden per-DSO by setting the override callback
16 | (d) a mix of (b) and (c) - eg. implement an override callback that;
17 | (i) checks if we're win32 (if(strstr(dso->meth->name, "win32")....)
18 | and if so, convert "blah" into "blah32.dll" (the default is
19 | otherwise to make it "blah.dll").
20 | (ii) default to the normal behaviour - we're not on win32, eg.
21 | finish with (return dso->meth->dso_name_converter(dso,NULL)).
22 |
23 |
--------------------------------------------------------------------------------
/crypto/ebcdic.h:
--------------------------------------------------------------------------------
1 | /* crypto/ebcdic.h */
2 |
3 | #ifndef HEADER_EBCDIC_H
4 | #define HEADER_EBCDIC_H
5 |
6 | #include
7 |
8 | /* Avoid name clashes with other applications */
9 | #define os_toascii _openssl_os_toascii
10 | #define os_toebcdic _openssl_os_toebcdic
11 | #define ebcdic2ascii _openssl_ebcdic2ascii
12 | #define ascii2ebcdic _openssl_ascii2ebcdic
13 |
14 | extern const unsigned char os_toascii[256];
15 | extern const unsigned char os_toebcdic[256];
16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count);
17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count);
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/crypto/evp/m_wp.c:
--------------------------------------------------------------------------------
1 | /* crypto/evp/m_wp.c */
2 |
3 | #include
4 | #include "cryptlib.h"
5 |
6 | #ifndef OPENSSL_NO_WHIRLPOOL
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 |
13 | static int init(EVP_MD_CTX *ctx)
14 | { return WHIRLPOOL_Init(ctx->md_data); }
15 |
16 | static int update(EVP_MD_CTX *ctx,const void *data,size_t count)
17 | { return WHIRLPOOL_Update(ctx->md_data,data,count); }
18 |
19 | static int final(EVP_MD_CTX *ctx,unsigned char *md)
20 | { return WHIRLPOOL_Final(md,ctx->md_data); }
21 |
22 | static const EVP_MD whirlpool_md=
23 | {
24 | NID_whirlpool,
25 | 0,
26 | WHIRLPOOL_DIGEST_LENGTH,
27 | 0,
28 | init,
29 | update,
30 | final,
31 | NULL,
32 | NULL,
33 | EVP_PKEY_NULL_method,
34 | WHIRLPOOL_BBLOCK/8,
35 | sizeof(EVP_MD *)+sizeof(WHIRLPOOL_CTX),
36 | };
37 |
38 | const EVP_MD *EVP_whirlpool(void)
39 | {
40 | return(&whirlpool_md);
41 | }
42 | #endif
43 |
--------------------------------------------------------------------------------
/crypto/lhash/num.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 |
3 | #node 10 -> 4
4 |
5 | while (<>)
6 | {
7 | next unless /^node/;
8 | chop;
9 | @a=split;
10 | $num{$a[3]}++;
11 | }
12 |
13 | @a=sort {$a <=> $b } keys %num;
14 | foreach (0 .. $a[$#a])
15 | {
16 | printf "%4d:%4d\n",$_,$num{$_};
17 | }
18 |
--------------------------------------------------------------------------------
/crypto/md4/md4s.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // gettsc.inl
3 | //
4 | // gives access to the Pentium's (secret) cycle counter
5 | //
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca)
7 | // in 1996-7 and is entered, by him, into the public domain.
8 |
9 | #if defined(__WATCOMC__)
10 | void GetTSC(unsigned long&);
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12 | #elif defined(__GNUC__)
13 | inline
14 | void GetTSC(unsigned long& tsc)
15 | {
16 | asm volatile(".byte 15, 49\n\t"
17 | : "=eax" (tsc)
18 | :
19 | : "%edx", "%eax");
20 | }
21 | #elif defined(_MSC_VER)
22 | inline
23 | void GetTSC(unsigned long& tsc)
24 | {
25 | unsigned long a;
26 | __asm _emit 0fh
27 | __asm _emit 31h
28 | __asm mov a, eax;
29 | tsc=a;
30 | }
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | extern "C" {
38 | void md4_block_x86(MD4_CTX *ctx, unsigned char *buffer,int num);
39 | }
40 |
41 | void main(int argc,char *argv[])
42 | {
43 | unsigned char buffer[64*256];
44 | MD4_CTX ctx;
45 | unsigned long s1,s2,e1,e2;
46 | unsigned char k[16];
47 | unsigned long data[2];
48 | unsigned char iv[8];
49 | int i,num=0,numm;
50 | int j=0;
51 |
52 | if (argc >= 2)
53 | num=atoi(argv[1]);
54 |
55 | if (num == 0) num=16;
56 | if (num > 250) num=16;
57 | numm=num+2;
58 | num*=64;
59 | numm*=64;
60 |
61 | for (j=0; j<6; j++)
62 | {
63 | for (i=0; i<10; i++) /**/
64 | {
65 | md4_block_x86(&ctx,buffer,numm);
66 | GetTSC(s1);
67 | md4_block_x86(&ctx,buffer,numm);
68 | GetTSC(e1);
69 | GetTSC(s2);
70 | md4_block_x86(&ctx,buffer,num);
71 | GetTSC(e2);
72 | md4_block_x86(&ctx,buffer,num);
73 | }
74 | printf("md4 (%d bytes) %d %d (%.2f)\n",num,
75 | e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
76 | }
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/crypto/md5/md5s.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // gettsc.inl
3 | //
4 | // gives access to the Pentium's (secret) cycle counter
5 | //
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca)
7 | // in 1996-7 and is entered, by him, into the public domain.
8 |
9 | #if defined(__WATCOMC__)
10 | void GetTSC(unsigned long&);
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12 | #elif defined(__GNUC__)
13 | inline
14 | void GetTSC(unsigned long& tsc)
15 | {
16 | asm volatile(".byte 15, 49\n\t"
17 | : "=eax" (tsc)
18 | :
19 | : "%edx", "%eax");
20 | }
21 | #elif defined(_MSC_VER)
22 | inline
23 | void GetTSC(unsigned long& tsc)
24 | {
25 | unsigned long a;
26 | __asm _emit 0fh
27 | __asm _emit 31h
28 | __asm mov a, eax;
29 | tsc=a;
30 | }
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | extern "C" {
38 | void md5_block_x86(MD5_CTX *ctx, unsigned char *buffer,int num);
39 | }
40 |
41 | void main(int argc,char *argv[])
42 | {
43 | unsigned char buffer[64*256];
44 | MD5_CTX ctx;
45 | unsigned long s1,s2,e1,e2;
46 | unsigned char k[16];
47 | unsigned long data[2];
48 | unsigned char iv[8];
49 | int i,num=0,numm;
50 | int j=0;
51 |
52 | if (argc >= 2)
53 | num=atoi(argv[1]);
54 |
55 | if (num == 0) num=16;
56 | if (num > 250) num=16;
57 | numm=num+2;
58 | num*=64;
59 | numm*=64;
60 |
61 | for (j=0; j<6; j++)
62 | {
63 | for (i=0; i<10; i++) /**/
64 | {
65 | md5_block_x86(&ctx,buffer,numm);
66 | GetTSC(s1);
67 | md5_block_x86(&ctx,buffer,numm);
68 | GetTSC(e1);
69 | GetTSC(s2);
70 | md5_block_x86(&ctx,buffer,num);
71 | GetTSC(e2);
72 | md5_block_x86(&ctx,buffer,num);
73 | }
74 | printf("md5 (%d bytes) %d %d (%.2f)\n",num,
75 | e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
76 | }
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/crypto/o_dir.h:
--------------------------------------------------------------------------------
1 | /* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */
2 | /* Copied from Richard Levitte's (richard@levitte.org) LP library. All
3 | * symbol names have been changed, with permission from the author.
4 | */
5 |
6 | /* $LP: LPlib/source/LPdir.h,v 1.1 2004/06/14 08:56:04 _cvs_levitte Exp $ */
7 | /*
8 | * Copyright (c) 2004, Richard Levitte
9 | * All rights reserved.
10 | *
11 | * Redistribution and use in source and binary forms, with or without
12 | * modification, are permitted provided that the following conditions
13 | * are met:
14 | * 1. Redistributions of source code must retain the above copyright
15 | * notice, this list of conditions and the following disclaimer.
16 | * 2. Redistributions in binary form must reproduce the above copyright
17 | * notice, this list of conditions and the following disclaimer in the
18 | * documentation and/or other materials provided with the distribution.
19 | *
20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 | * SUCH DAMAGE.
31 | */
32 |
33 |
34 | #ifndef O_DIR_H
35 | #define O_DIR_H
36 |
37 | #ifdef __cplusplus
38 | extern "C" {
39 | #endif
40 |
41 | typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX;
42 |
43 | /* returns NULL on error or end-of-directory.
44 | If it is end-of-directory, errno will be zero */
45 | const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory);
46 | /* returns 1 on success, 0 on error */
47 | int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx);
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 |
53 | #endif /* LPDIR_H */
54 |
--------------------------------------------------------------------------------
/crypto/o_dir_test.c:
--------------------------------------------------------------------------------
1 | /* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */
2 | /* Copied from Richard Levitte's (richard@levitte.org) LP library. All
3 | * symbol names have been changed, with permission from the author.
4 | */
5 |
6 | /* $LP: LPlib/test/test_dir.c,v 1.1 2004/06/16 22:59:47 _cvs_levitte Exp $ */
7 | /*
8 | * Copyright (c) 2004, Richard Levitte
9 | * All rights reserved.
10 | *
11 | * Redistribution and use in source and binary forms, with or without
12 | * modification, are permitted provided that the following conditions
13 | * are met:
14 | * 1. Redistributions of source code must retain the above copyright
15 | * notice, this list of conditions and the following disclaimer.
16 | * 2. Redistributions in binary form must reproduce the above copyright
17 | * notice, this list of conditions and the following disclaimer in the
18 | * documentation and/or other materials provided with the distribution.
19 | *
20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 | * SUCH DAMAGE.
31 | */
32 |
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include "e_os2.h"
38 | #include "o_dir.h"
39 |
40 | #if defined OPENSSL_SYS_UNIX || defined OPENSSL_SYS_WIN32 || defined OPENSSL_SYS_WINCE
41 | #define CURRDIR "."
42 | #elif defined OPENSSL_SYS_VMS
43 | #define CURRDIR "SYS$DISK:[]"
44 | #else
45 | #error "No supported platform defined!"
46 | #endif
47 |
48 | int main()
49 | {
50 | OPENSSL_DIR_CTX *ctx = NULL;
51 | const char *result;
52 |
53 | while((result = OPENSSL_DIR_read(&ctx, CURRDIR)) != NULL)
54 | {
55 | printf("%s\n", result);
56 | }
57 |
58 | if (errno)
59 | {
60 | perror("test_dir");
61 | exit(1);
62 | }
63 |
64 | if (!OPENSSL_DIR_end(&ctx))
65 | {
66 | perror("test_dir");
67 | exit(2);
68 | }
69 | exit(0);
70 | }
71 |
--------------------------------------------------------------------------------
/crypto/objects/obj_xref.h:
--------------------------------------------------------------------------------
1 | /* AUTOGENERATED BY objxref.pl, DO NOT EDIT */
2 |
3 | typedef struct
4 | {
5 | int sign_id;
6 | int hash_id;
7 | int pkey_id;
8 | } nid_triple;
9 |
10 | static const nid_triple sigoid_srt[] =
11 | {
12 | {NID_md2WithRSAEncryption, NID_md2, NID_rsaEncryption},
13 | {NID_md5WithRSAEncryption, NID_md5, NID_rsaEncryption},
14 | {NID_shaWithRSAEncryption, NID_sha, NID_rsaEncryption},
15 | {NID_sha1WithRSAEncryption, NID_sha1, NID_rsaEncryption},
16 | {NID_dsaWithSHA, NID_sha, NID_dsa},
17 | {NID_dsaWithSHA1_2, NID_sha1, NID_dsa_2},
18 | {NID_mdc2WithRSA, NID_mdc2, NID_rsaEncryption},
19 | {NID_md5WithRSA, NID_md5, NID_rsa},
20 | {NID_dsaWithSHA1, NID_sha1, NID_dsa},
21 | {NID_sha1WithRSA, NID_sha1, NID_rsa},
22 | {NID_ripemd160WithRSA, NID_ripemd160, NID_rsaEncryption},
23 | {NID_md4WithRSAEncryption, NID_md4, NID_rsaEncryption},
24 | {NID_ecdsa_with_SHA1, NID_sha1, NID_X9_62_id_ecPublicKey},
25 | {NID_sha256WithRSAEncryption, NID_sha256, NID_rsaEncryption},
26 | {NID_sha384WithRSAEncryption, NID_sha384, NID_rsaEncryption},
27 | {NID_sha512WithRSAEncryption, NID_sha512, NID_rsaEncryption},
28 | {NID_sha224WithRSAEncryption, NID_sha224, NID_rsaEncryption},
29 | {NID_ecdsa_with_Recommended, NID_undef, NID_X9_62_id_ecPublicKey},
30 | {NID_ecdsa_with_Specified, NID_undef, NID_X9_62_id_ecPublicKey},
31 | {NID_ecdsa_with_SHA224, NID_sha224, NID_X9_62_id_ecPublicKey},
32 | {NID_ecdsa_with_SHA256, NID_sha256, NID_X9_62_id_ecPublicKey},
33 | {NID_ecdsa_with_SHA384, NID_sha384, NID_X9_62_id_ecPublicKey},
34 | {NID_ecdsa_with_SHA512, NID_sha512, NID_X9_62_id_ecPublicKey},
35 | {NID_dsa_with_SHA224, NID_sha224, NID_dsa},
36 | {NID_dsa_with_SHA256, NID_sha256, NID_dsa},
37 | {NID_id_GostR3411_94_with_GostR3410_2001, NID_id_GostR3411_94, NID_id_GostR3410_2001},
38 | {NID_id_GostR3411_94_with_GostR3410_94, NID_id_GostR3411_94, NID_id_GostR3410_94},
39 | {NID_id_GostR3411_94_with_GostR3410_94_cc, NID_id_GostR3411_94, NID_id_GostR3410_94_cc},
40 | {NID_id_GostR3411_94_with_GostR3410_2001_cc, NID_id_GostR3411_94, NID_id_GostR3410_2001_cc},
41 | };
42 |
43 | static const nid_triple * const sigoid_srt_xref[] =
44 | {
45 | &sigoid_srt[17],
46 | &sigoid_srt[18],
47 | &sigoid_srt[0],
48 | &sigoid_srt[1],
49 | &sigoid_srt[7],
50 | &sigoid_srt[2],
51 | &sigoid_srt[4],
52 | &sigoid_srt[3],
53 | &sigoid_srt[9],
54 | &sigoid_srt[5],
55 | &sigoid_srt[8],
56 | &sigoid_srt[12],
57 | &sigoid_srt[6],
58 | &sigoid_srt[10],
59 | &sigoid_srt[11],
60 | &sigoid_srt[13],
61 | &sigoid_srt[24],
62 | &sigoid_srt[20],
63 | &sigoid_srt[14],
64 | &sigoid_srt[21],
65 | &sigoid_srt[15],
66 | &sigoid_srt[22],
67 | &sigoid_srt[16],
68 | &sigoid_srt[23],
69 | &sigoid_srt[19],
70 | &sigoid_srt[25],
71 | &sigoid_srt[26],
72 | &sigoid_srt[27],
73 | &sigoid_srt[28],
74 | };
75 |
76 |
--------------------------------------------------------------------------------
/crypto/objects/obj_xref.txt:
--------------------------------------------------------------------------------
1 | # OID cross reference table.
2 | # Links signatures OIDs to their corresponding public key algorithms
3 | # and digests.
4 |
5 | md2WithRSAEncryption md2 rsaEncryption
6 | md5WithRSAEncryption md5 rsaEncryption
7 | shaWithRSAEncryption sha rsaEncryption
8 | sha1WithRSAEncryption sha1 rsaEncryption
9 | md4WithRSAEncryption md4 rsaEncryption
10 | sha256WithRSAEncryption sha256 rsaEncryption
11 | sha384WithRSAEncryption sha384 rsaEncryption
12 | sha512WithRSAEncryption sha512 rsaEncryption
13 | sha224WithRSAEncryption sha224 rsaEncryption
14 | mdc2WithRSA mdc2 rsaEncryption
15 | ripemd160WithRSA ripemd160 rsaEncryption
16 |
17 | # Alternative deprecated OIDs. By using the older "rsa" OID this
18 | # type will be recognized by not normally used.
19 |
20 | md5WithRSA md5 rsa
21 | sha1WithRSA sha1 rsa
22 |
23 | dsaWithSHA sha dsa
24 | dsaWithSHA1 sha1 dsa
25 |
26 | dsaWithSHA1_2 sha1 dsa_2
27 |
28 | ecdsa_with_SHA1 sha1 X9_62_id_ecPublicKey
29 | ecdsa_with_SHA224 sha224 X9_62_id_ecPublicKey
30 | ecdsa_with_SHA256 sha256 X9_62_id_ecPublicKey
31 | ecdsa_with_SHA384 sha384 X9_62_id_ecPublicKey
32 | ecdsa_with_SHA512 sha512 X9_62_id_ecPublicKey
33 | ecdsa_with_Recommended undef X9_62_id_ecPublicKey
34 | ecdsa_with_Specified undef X9_62_id_ecPublicKey
35 |
36 | dsa_with_SHA224 sha224 dsa
37 | dsa_with_SHA256 sha256 dsa
38 |
39 | id_GostR3411_94_with_GostR3410_2001 id_GostR3411_94 id_GostR3410_2001
40 | id_GostR3411_94_with_GostR3410_94 id_GostR3411_94 id_GostR3410_94
41 | id_GostR3411_94_with_GostR3410_94_cc id_GostR3411_94 id_GostR3410_94_cc
42 | id_GostR3411_94_with_GostR3410_2001_cc id_GostR3411_94 id_GostR3410_2001_cc
43 |
--------------------------------------------------------------------------------
/crypto/objects/objects.README:
--------------------------------------------------------------------------------
1 | objects.txt syntax
2 | ------------------
3 |
4 | To cover all the naming hacks that were previously in objects.h needed some
5 | kind of hacks in objects.txt.
6 |
7 | The basic syntax for adding an object is as follows:
8 |
9 | 1 2 3 4 : shortName : Long Name
10 |
11 | If the long name doesn't contain spaces, or no short name
12 | exists, the long name is used as basis for the base name
13 | in C. Otherwise, the short name is used.
14 |
15 | The base name (let's call it 'base') will then be used to
16 | create the C macros SN_base, LN_base, NID_base and OBJ_base.
17 |
18 | Note that if the base name contains spaces, dashes or periods,
19 | those will be converte to underscore.
20 |
21 | Then there are some extra commands:
22 |
23 | !Alias foo 1 2 3 4
24 |
25 | This juts makes a name foo for an OID. The C macro
26 | OBJ_foo will be created as a result.
27 |
28 | !Cname foo
29 |
30 | This makes sure that the name foo will be used as base name
31 | in C.
32 |
33 | !module foo
34 | 1 2 3 4 : shortName : Long Name
35 | !global
36 |
37 | The !module command was meant to define a kind of modularity.
38 | What it does is to make sure the module name is prepended
39 | to the base name. !global turns this off. This construction
40 | is not recursive.
41 |
42 | Lines starting with # are treated as comments, as well as any line starting
43 | with ! and not matching the commands above.
44 |
45 |
--------------------------------------------------------------------------------
/crypto/objects/objxref.pl:
--------------------------------------------------------------------------------
1 | #!/usr/local/bin/perl
2 |
3 | use strict;
4 |
5 | my %xref_tbl;
6 | my %oid_tbl;
7 |
8 | my ($mac_file, $xref_file) = @ARGV;
9 |
10 | open(IN, $mac_file) || die "Can't open $mac_file";
11 |
12 | # Read in OID nid values for a lookup table.
13 |
14 | while ()
15 | {
16 | chomp;
17 | my ($name, $num) = /^(\S+)\s+(\S+)$/;
18 | $oid_tbl{$name} = $num;
19 | }
20 | close IN;
21 |
22 | open(IN, $xref_file) || die "Can't open $xref_file";
23 |
24 | my $ln = 1;
25 |
26 | while ()
27 | {
28 | chomp;
29 | s/#.*$//;
30 | next if (/^\S*$/);
31 | my ($xr, $p1, $p2) = /^(\S+)\s+(\S+)\s+(\S+)/;
32 | check_oid($xr);
33 | check_oid($p1);
34 | check_oid($p2);
35 | $xref_tbl{$xr} = [$p1, $p2, $ln];
36 | }
37 |
38 | my @xrkeys = keys %xref_tbl;
39 |
40 | my @srt1 = sort { $oid_tbl{$a} <=> $oid_tbl{$b}} @xrkeys;
41 |
42 | for(my $i = 0; $i <= $#srt1; $i++)
43 | {
44 | $xref_tbl{$srt1[$i]}[2] = $i;
45 | }
46 |
47 | my @srt2 = sort
48 | {
49 | my$ap1 = $oid_tbl{$xref_tbl{$a}[0]};
50 | my$bp1 = $oid_tbl{$xref_tbl{$b}[0]};
51 | return $ap1 - $bp1 if ($ap1 != $bp1);
52 | my$ap2 = $oid_tbl{$xref_tbl{$a}[1]};
53 | my$bp2 = $oid_tbl{$xref_tbl{$b}[1]};
54 |
55 | return $ap2 - $bp2;
56 | } @xrkeys;
57 |
58 | my $pname = $0;
59 |
60 | $pname =~ s|^.[^/]/||;
61 |
62 | print < for the
4 | clarification and origional specification of RC2. BSAFE uses
5 | this last parameter, 'bits'. It the key is 128 bits, BSAFE
6 | also sets this parameter to 128. The old behaviour can be
7 | duplicated by setting this parameter to 1024.
8 |
9 | 1.0 08/04/96 - eay
10 | First version of SSLeay with rc2. This has been written from the spec
11 | posted sci.crypt. It is in this directory under rrc2.doc
12 | I have no test values for any mode other than ecb, my wrappers for the
13 | other modes should be ok since they are basically the same as
14 | the ones taken from idea and des :-). I have implemented them as
15 | little-endian operators.
16 | While rc2 is included because it is used with SSL, I don't know how
17 | far I trust it. It is about the same speed as IDEA and DES.
18 | So if you are paranoid, used Tripple DES, else IDEA. If RC2
19 | does get used more, perhaps more people will look for weaknesses in
20 | it.
21 |
22 |
23 |
--------------------------------------------------------------------------------
/crypto/rc4/asm/rc4-x86_64.pl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/rc4/asm/rc4-x86_64.pl
--------------------------------------------------------------------------------
/crypto/rc4/rc4_locl.h:
--------------------------------------------------------------------------------
1 | #ifndef HEADER_RC4_LOCL_H
2 | #define HEADER_RC4_LOCL_H
3 | #include
4 | #include
5 | #endif
6 |
--------------------------------------------------------------------------------
/crypto/rc4/rc4s.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // gettsc.inl
3 | //
4 | // gives access to the Pentium's (secret) cycle counter
5 | //
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca)
7 | // in 1996-7 and is entered, by him, into the public domain.
8 |
9 | #if defined(__WATCOMC__)
10 | void GetTSC(unsigned long&);
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12 | #elif defined(__GNUC__)
13 | inline
14 | void GetTSC(unsigned long& tsc)
15 | {
16 | asm volatile(".byte 15, 49\n\t"
17 | : "=eax" (tsc)
18 | :
19 | : "%edx", "%eax");
20 | }
21 | #elif defined(_MSC_VER)
22 | inline
23 | void GetTSC(unsigned long& tsc)
24 | {
25 | unsigned long a;
26 | __asm _emit 0fh
27 | __asm _emit 31h
28 | __asm mov a, eax;
29 | tsc=a;
30 | }
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | void main(int argc,char *argv[])
38 | {
39 | unsigned char buffer[1024];
40 | RC4_KEY ctx;
41 | unsigned long s1,s2,e1,e2;
42 | unsigned char k[16];
43 | unsigned long data[2];
44 | unsigned char iv[8];
45 | int i,num=64,numm;
46 | int j=0;
47 |
48 | if (argc >= 2)
49 | num=atoi(argv[1]);
50 |
51 | if (num == 0) num=256;
52 | if (num > 1024-16) num=1024-16;
53 | numm=num+8;
54 |
55 | for (j=0; j<6; j++)
56 | {
57 | for (i=0; i<10; i++) /**/
58 | {
59 | RC4(&ctx,numm,buffer,buffer);
60 | GetTSC(s1);
61 | RC4(&ctx,numm,buffer,buffer);
62 | GetTSC(e1);
63 | GetTSC(s2);
64 | RC4(&ctx,num,buffer,buffer);
65 | GetTSC(e2);
66 | RC4(&ctx,num,buffer,buffer);
67 | }
68 |
69 | printf("RC4 (%d bytes) %d %d (%d) - 8 bytes\n",num,
70 | e1-s1,e2-s2,(e1-s1)-(e2-s2));
71 | }
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/crypto/ripemd/README:
--------------------------------------------------------------------------------
1 | RIPEMD-160
2 | http://www.esat.kuleuven.ac.be/~bosselae/ripemd160.html
3 |
4 | This is my implementation of RIPEMD-160. The pentium assember is a little
5 | off the pace since I only get 1050 cycles, while the best is 1013.
6 | I have a few ideas for how to get another 20 or so cycles, but at
7 | this point I will not bother right now. I believe the trick will be
8 | to remove my 'copy X array onto stack' until inside the RIP1() finctions the
9 | first time round. To do this I need another register and will only have one
10 | temporary one. A bit tricky.... I can also cleanup the saving of the 5 words
11 | after the first half of the calculation. I should read the origional
12 | value, add then write. Currently I just save the new and read the origioal.
13 | I then read both at the end. Bad.
14 |
15 | eric (20-Jan-1998)
16 |
--------------------------------------------------------------------------------
/crypto/ripemd/asm/rips.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // gettsc.inl
3 | //
4 | // gives access to the Pentium's (secret) cycle counter
5 | //
6 | // This software was written by Leonard Janke (janke@unixg.ubc.ca)
7 | // in 1996-7 and is entered, by him, into the public domain.
8 |
9 | #if defined(__WATCOMC__)
10 | void GetTSC(unsigned long&);
11 | #pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12 | #elif defined(__GNUC__)
13 | inline
14 | void GetTSC(unsigned long& tsc)
15 | {
16 | asm volatile(".byte 15, 49\n\t"
17 | : "=eax" (tsc)
18 | :
19 | : "%edx", "%eax");
20 | }
21 | #elif defined(_MSC_VER)
22 | inline
23 | void GetTSC(unsigned long& tsc)
24 | {
25 | unsigned long a;
26 | __asm _emit 0fh
27 | __asm _emit 31h
28 | __asm mov a, eax;
29 | tsc=a;
30 | }
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 |
37 | #define ripemd160_block_x86 ripemd160_block_asm_host_order
38 |
39 | extern "C" {
40 | void ripemd160_block_x86(RIPEMD160_CTX *ctx, unsigned char *buffer,int num);
41 | }
42 |
43 | void main(int argc,char *argv[])
44 | {
45 | unsigned char buffer[64*256];
46 | RIPEMD160_CTX ctx;
47 | unsigned long s1,s2,e1,e2;
48 | unsigned char k[16];
49 | unsigned long data[2];
50 | unsigned char iv[8];
51 | int i,num=0,numm;
52 | int j=0;
53 |
54 | if (argc >= 2)
55 | num=atoi(argv[1]);
56 |
57 | if (num == 0) num=16;
58 | if (num > 250) num=16;
59 | numm=num+2;
60 | #if 0
61 | num*=64;
62 | numm*=64;
63 | #endif
64 |
65 | for (j=0; j<6; j++)
66 | {
67 | for (i=0; i<10; i++) /**/
68 | {
69 | ripemd160_block_x86(&ctx,buffer,numm);
70 | GetTSC(s1);
71 | ripemd160_block_x86(&ctx,buffer,numm);
72 | GetTSC(e1);
73 | GetTSC(s2);
74 | ripemd160_block_x86(&ctx,buffer,num);
75 | GetTSC(e2);
76 | ripemd160_block_x86(&ctx,buffer,num);
77 | }
78 | printf("ripemd160 (%d bytes) %d %d (%.2f)\n",num*64,
79 | e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2);
80 | }
81 | }
82 |
83 |
--------------------------------------------------------------------------------
/crypto/rsa/rsa_locl.h:
--------------------------------------------------------------------------------
1 | extern int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len,
2 | unsigned char *rm, size_t *prm_len,
3 | const unsigned char *sigbuf, size_t siglen,
4 | RSA *rsa);
5 |
--------------------------------------------------------------------------------
/crypto/s390xcap.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | extern unsigned long OPENSSL_s390xcap_P;
8 |
9 | static sigjmp_buf ill_jmp;
10 | static void ill_handler (int sig) { siglongjmp(ill_jmp,sig); }
11 |
12 | unsigned long OPENSSL_s390x_facilities(void);
13 |
14 | void OPENSSL_cpuid_setup(void)
15 | {
16 | sigset_t oset;
17 | struct sigaction ill_act,oact;
18 |
19 | if (OPENSSL_s390xcap_P) return;
20 |
21 | memset(&ill_act,0,sizeof(ill_act));
22 | ill_act.sa_handler = ill_handler;
23 | sigfillset(&ill_act.sa_mask);
24 | sigdelset(&ill_act.sa_mask,SIGILL);
25 | sigdelset(&ill_act.sa_mask,SIGTRAP);
26 | sigprocmask(SIG_SETMASK,&ill_act.sa_mask,&oset);
27 | sigaction (SIGILL,&ill_act,&oact);
28 |
29 | /* protection against missing store-facility-list-extended */
30 | if (sigsetjmp(ill_jmp,0) == 0)
31 | OPENSSL_s390xcap_P = OPENSSL_s390x_facilities();
32 | else
33 | OPENSSL_s390xcap_P = 1UL<<63;
34 |
35 | sigaction (SIGILL,&oact,NULL);
36 | sigprocmask(SIG_SETMASK,&oset,NULL);
37 | }
38 |
--------------------------------------------------------------------------------
/crypto/s390xcpuid.S:
--------------------------------------------------------------------------------
1 | .text
2 |
3 | .globl OPENSSL_s390x_facilities
4 | .type OPENSSL_s390x_facilities,@function
5 | .align 16
6 | OPENSSL_s390x_facilities:
7 | lghi %r0,0
8 | .long 0xb2b0f010 # stfle 16(%r15)
9 | lg %r2,16(%r15)
10 | larl %r1,OPENSSL_s390xcap_P
11 | stg %r2,0(%r1)
12 | br %r14
13 | .size OPENSSL_s390x_facilities,.-OPENSSL_s390x_facilities
14 |
15 | .globl OPENSSL_rdtsc
16 | .type OPENSSL_rdtsc,@function
17 | .align 16
18 | OPENSSL_rdtsc:
19 | stck 16(%r15)
20 | lg %r2,16(%r15)
21 | br %r14
22 | .size OPENSSL_rdtsc,.-OPENSSL_rdtsc
23 |
24 | .globl OPENSSL_atomic_add
25 | .type OPENSSL_atomic_add,@function
26 | .align 16
27 | OPENSSL_atomic_add:
28 | l %r1,0(%r2)
29 | .Lspin: lr %r0,%r1
30 | ar %r0,%r3
31 | cs %r1,%r0,0(%r2)
32 | brc 4,.Lspin
33 | lgfr %r2,%r0 # OpenSSL expects the new value
34 | br %r14
35 | .size OPENSSL_atomic_add,.-OPENSSL_atomic_add
36 |
37 | .globl OPENSSL_wipe_cpu
38 | .type OPENSSL_wipe_cpu,@function
39 | .align 16
40 | OPENSSL_wipe_cpu:
41 | xgr %r0,%r0
42 | xgr %r1,%r1
43 | lgr %r2,%r15
44 | xgr %r3,%r3
45 | xgr %r4,%r4
46 | lzdr %f0
47 | lzdr %f1
48 | lzdr %f2
49 | lzdr %f3
50 | lzdr %f4
51 | lzdr %f5
52 | lzdr %f6
53 | lzdr %f7
54 | br %r14
55 | .size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
56 |
57 | .globl OPENSSL_cleanse
58 | .type OPENSSL_cleanse,@function
59 | .align 16
60 | OPENSSL_cleanse:
61 | lghi %r4,15
62 | lghi %r0,0
63 | clgr %r3,%r4
64 | jh .Lot
65 | clgr %r3,%r0
66 | bcr 8,%r14
67 | .Little:
68 | stc %r0,0(%r2)
69 | la %r2,1(%r2)
70 | brctg %r3,.Little
71 | br %r14
72 | .align 4
73 | .Lot: tmll %r2,7
74 | jz .Laligned
75 | stc %r0,0(%r2)
76 | la %r2,1(%r2)
77 | brctg %r3,.Lot
78 | .Laligned:
79 | srlg %r4,%r3,3
80 | .Loop: stg %r0,0(%r2)
81 | la %r2,8(%r2)
82 | brctg %r4,.Loop
83 | lghi %r4,7
84 | ngr %r3,%r4
85 | jnz .Little
86 | br %r14
87 | .size OPENSSL_cleanse,.-OPENSSL_cleanse
88 |
89 | .section .init
90 | brasl %r14,OPENSSL_cpuid_setup
91 |
92 | .comm OPENSSL_s390xcap_P,8,8
93 |
--------------------------------------------------------------------------------
/crypto/sha/asm/README:
--------------------------------------------------------------------------------
1 | C2.pl works
2 |
--------------------------------------------------------------------------------
/crypto/sha/asm/sha256-586.pl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/sha/asm/sha256-586.pl
--------------------------------------------------------------------------------
/crypto/sha/asm/sha512-586.pl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/sha/asm/sha512-586.pl
--------------------------------------------------------------------------------
/crypto/sparccpuid.S:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/sparccpuid.S
--------------------------------------------------------------------------------
/crypto/threads/README:
--------------------------------------------------------------------------------
1 | Mutithreading testing area.
2 |
3 | Since this stuff is very very platorm specific, this is not part of the
4 | normal build. Have a read of doc/threads.doc.
5 |
6 | mttest will do some testing and will currently build under Windows NT/95,
7 | Solaris and Linux. The IRIX stuff is not finished.
8 |
9 | I have tested this program on a 12 CPU ultra sparc box (solaris 2.5.1)
10 | and things seem to work ok.
11 |
12 | The Linux pthreads package can be retrieved from
13 | http://www.mit.edu:8001/people/proven/pthreads.html
14 |
15 |
--------------------------------------------------------------------------------
/crypto/threads/netware.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | rem batch file to build multi-thread test ( mttest.nlm )
3 |
4 | rem command line arguments:
5 | rem debug => build using debug settings
6 |
7 | rem
8 | rem After building, copy mttest.nlm to the server and run it, you'll probably
9 | rem want to redirect stdout and stderr. An example command line would be
10 | rem "mttest.nlm -thread 20 -loops 10 -CAfile \openssl\apps\server.pem >mttest.out 2>mttest.err"
11 | rem
12 |
13 | del mttest.nlm
14 |
15 | set BLD_DEBUG=
16 | set CFLAGS=
17 | set LFLAGS=
18 | set LIBS=
19 |
20 | if "%1" == "DEBUG" set BLD_DEBUG=YES
21 | if "%1" == "debug" set BLD_DEBUG=YES
22 |
23 | if "%MWCIncludes%" == "" goto inc_error
24 | if "%PRELUDE%" == "" goto prelude_error
25 | if "%IMPORTS%" == "" goto imports_error
26 |
27 | set CFLAGS=-c -I..\..\outinc_nw -nosyspath -DOPENSSL_SYS_NETWARE -opt off -g -sym internal -maxerrors 20
28 |
29 | if "%BLD_DEBUG%" == "YES" set LIBS=..\..\out_nw.dbg\ssl.lib ..\..\out_nw.dbg\crypto.lib
30 | if "%BLD_DEBUG%" == "" set LIBS=..\..\out_nw\ssl.lib ..\..\out_nw\crypto.lib
31 |
32 | set LFLAGS=-msgstyle gcc -zerobss -stacksize 32768 -nostdlib -sym internal
33 |
34 | rem generate command file for metrowerks
35 | echo.
36 | echo Generating Metrowerks command file: mttest.def
37 | echo # dynamically generated command file for metrowerks build > mttest.def
38 | echo IMPORT @%IMPORTS%\clib.imp >> mttest.def
39 | echo IMPORT @%IMPORTS%\threads.imp >> mttest.def
40 | echo IMPORT @%IMPORTS%\ws2nlm.imp >> mttest.def
41 | echo IMPORT GetProcessSwitchCount >> mttest.def
42 | echo MODULE clib >> mttest.def
43 |
44 | rem compile
45 | echo.
46 | echo Compiling mttest.c
47 | mwccnlm.exe mttest.c %CFLAGS%
48 | if errorlevel 1 goto end
49 |
50 | rem link
51 | echo.
52 | echo Linking mttest.nlm
53 | mwldnlm.exe %LFLAGS% -screenname mttest -commandfile mttest.def mttest.o "%PRELUDE%" %LIBS% -o mttest.nlm
54 | if errorlevel 1 goto end
55 |
56 | goto end
57 |
58 | :inc_error
59 | echo.
60 | echo Environment variable MWCIncludes is not set - see install.nw
61 | goto end
62 |
63 | :prelude_error
64 | echo.
65 | echo Environment variable PRELUDE is not set - see install.nw
66 | goto end
67 |
68 | :imports_error
69 | echo.
70 | echo Environment variable IMPORTS is not set - see install.nw
71 | goto end
72 |
73 |
74 | :end
75 | set BLD_DEBUG=
76 | set CFLAGS=
77 | set LFLAGS=
78 | set LIBS=
79 |
80 |
--------------------------------------------------------------------------------
/crypto/threads/profile.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | /bin/rm -f mttest
3 | cc -p -DSOLARIS -I../../include -g mttest.c -o mttest -L/usr/lib/libc -ldl -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
4 |
5 |
--------------------------------------------------------------------------------
/crypto/threads/ptest.bat:
--------------------------------------------------------------------------------
1 | del mttest.exe
2 |
3 | purify cl /O2 -DWIN32 /MD -I..\..\out mttest.c /Femttest ..\..\out\ssl32.lib ..\..\out\crypt32.lib
4 |
5 |
--------------------------------------------------------------------------------
/crypto/threads/pthread.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # build using pthreads
4 | #
5 | # http://www.mit.edu:8001/people/proven/pthreads.html
6 | #
7 | /bin/rm -f mttest
8 | pgcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto
9 |
10 |
--------------------------------------------------------------------------------
/crypto/threads/pthread2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # build using pthreads where it's already built into the system
4 | #
5 | /bin/rm -f mttest
6 | gcc -DPTHREADS -I../../include -g mttest.c -o mttest -L../.. -lssl -lcrypto -lpthread
7 |
8 |
--------------------------------------------------------------------------------
/crypto/threads/purify.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | /bin/rm -f mttest
3 | purify cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
4 |
5 |
--------------------------------------------------------------------------------
/crypto/threads/solaris.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | /bin/rm -f mttest
3 | cc -DSOLARIS -I../../include -g mttest.c -o mttest -L../.. -lthread -lssl -lcrypto -lnsl -lsocket
4 |
5 |
--------------------------------------------------------------------------------
/crypto/x509v3/v3_pci.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/x509v3/v3_pci.c
--------------------------------------------------------------------------------
/crypto/x509v3/v3_pcia.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/scottt/openssl-android/98ea02b773a647e2fd935bee50fdaa310b7f447d/crypto/x509v3/v3_pcia.c
--------------------------------------------------------------------------------
/include/openssl/comp.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef HEADER_COMP_H
3 | #define HEADER_COMP_H
4 |
5 | #include
6 |
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 |
11 | typedef struct comp_ctx_st COMP_CTX;
12 |
13 | typedef struct comp_method_st
14 | {
15 | int type; /* NID for compression library */
16 | const char *name; /* A text string to identify the library */
17 | int (*init)(COMP_CTX *ctx);
18 | void (*finish)(COMP_CTX *ctx);
19 | int (*compress)(COMP_CTX *ctx,
20 | unsigned char *out, unsigned int olen,
21 | unsigned char *in, unsigned int ilen);
22 | int (*expand)(COMP_CTX *ctx,
23 | unsigned char *out, unsigned int olen,
24 | unsigned char *in, unsigned int ilen);
25 | /* The following two do NOTHING, but are kept for backward compatibility */
26 | long (*ctrl)(void);
27 | long (*callback_ctrl)(void);
28 | } COMP_METHOD;
29 |
30 | struct comp_ctx_st
31 | {
32 | COMP_METHOD *meth;
33 | unsigned long compress_in;
34 | unsigned long compress_out;
35 | unsigned long expand_in;
36 | unsigned long expand_out;
37 |
38 | CRYPTO_EX_DATA ex_data;
39 | };
40 |
41 |
42 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
43 | void COMP_CTX_free(COMP_CTX *ctx);
44 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
45 | unsigned char *in, int ilen);
46 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
47 | unsigned char *in, int ilen);
48 | COMP_METHOD *COMP_rle(void );
49 | COMP_METHOD *COMP_zlib(void );
50 | void COMP_zlib_cleanup(void);
51 |
52 | #ifdef HEADER_BIO_H
53 | #ifdef ZLIB
54 | BIO_METHOD *BIO_f_zlib(void);
55 | #endif
56 | #endif
57 |
58 | /* BEGIN ERROR CODES */
59 | /* The following lines are auto generated by the script mkerr.pl. Any changes
60 | * made after this point may be overwritten when the script is next run.
61 | */
62 | void ERR_load_COMP_strings(void);
63 |
64 | /* Error codes for the COMP functions. */
65 |
66 | /* Function codes. */
67 | #define COMP_F_BIO_ZLIB_FLUSH 99
68 | #define COMP_F_BIO_ZLIB_NEW 100
69 | #define COMP_F_BIO_ZLIB_READ 101
70 | #define COMP_F_BIO_ZLIB_WRITE 102
71 |
72 | /* Reason codes. */
73 | #define COMP_R_ZLIB_DEFLATE_ERROR 99
74 | #define COMP_R_ZLIB_INFLATE_ERROR 100
75 | #define COMP_R_ZLIB_NOT_SUPPORTED 101
76 |
77 | #ifdef __cplusplus
78 | }
79 | #endif
80 | #endif
81 |
--------------------------------------------------------------------------------
/include/openssl/ebcdic.h:
--------------------------------------------------------------------------------
1 | /* crypto/ebcdic.h */
2 |
3 | #ifndef HEADER_EBCDIC_H
4 | #define HEADER_EBCDIC_H
5 |
6 | #include
7 |
8 | /* Avoid name clashes with other applications */
9 | #define os_toascii _openssl_os_toascii
10 | #define os_toebcdic _openssl_os_toebcdic
11 | #define ebcdic2ascii _openssl_ebcdic2ascii
12 | #define ascii2ebcdic _openssl_ascii2ebcdic
13 |
14 | extern const unsigned char os_toascii[256];
15 | extern const unsigned char os_toebcdic[256];
16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count);
17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count);
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/include/openssl/modes.h:
--------------------------------------------------------------------------------
1 | /* ====================================================================
2 | * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
3 | *
4 | * Rights for redistribution and usage in source and binary
5 | * forms are granted according to the OpenSSL license.
6 | */
7 |
8 | #include
9 |
10 | typedef void (*block128_f)(const unsigned char in[16],
11 | unsigned char out[16],
12 | const void *key);
13 |
14 | typedef void (*cbc128_f)(const unsigned char *in, unsigned char *out,
15 | size_t len, const void *key,
16 | unsigned char ivec[16], int enc);
17 |
18 | void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
19 | size_t len, const void *key,
20 | unsigned char ivec[16], block128_f block);
21 | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
22 | size_t len, const void *key,
23 | unsigned char ivec[16], block128_f block);
24 |
25 | void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,
26 | size_t len, const void *key,
27 | unsigned char ivec[16], unsigned char ecount_buf[16],
28 | unsigned int *num, block128_f block);
29 |
30 | void CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,
31 | size_t len, const void *key,
32 | unsigned char ivec[16], int *num,
33 | block128_f block);
34 |
35 | void CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,
36 | size_t len, const void *key,
37 | unsigned char ivec[16], int *num,
38 | int enc, block128_f block);
39 | void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,
40 | size_t length, const void *key,
41 | unsigned char ivec[16], int *num,
42 | int enc, block128_f block);
43 | void CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,
44 | size_t bits, const void *key,
45 | unsigned char ivec[16], int *num,
46 | int enc, block128_f block);
47 |
48 | size_t CRYPTO_cts128_encrypt_block(const unsigned char *in, unsigned char *out,
49 | size_t len, const void *key,
50 | unsigned char ivec[16], block128_f block);
51 | size_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,
52 | size_t len, const void *key,
53 | unsigned char ivec[16], cbc128_f cbc);
54 | size_t CRYPTO_cts128_decrypt_block(const unsigned char *in, unsigned char *out,
55 | size_t len, const void *key,
56 | unsigned char ivec[16], block128_f block);
57 | size_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,
58 | size_t len, const void *key,
59 | unsigned char ivec[16], cbc128_f cbc);
60 |
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_PROJECT_PATH := $(shell pwd)
2 | APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
3 |
--------------------------------------------------------------------------------
/openssl.version:
--------------------------------------------------------------------------------
1 | # also update ThirdPartyProject.prop
2 | OPENSSL_VERSION=1.0.0e
3 |
--------------------------------------------------------------------------------
/patches/README:
--------------------------------------------------------------------------------
1 | progs.patch:
2 |
3 | Fixup sources under the apps/ directory that are not built under the android environment.
4 |
5 |
6 | small_records.patch:
7 |
8 | Reduce OpenSSL memory consumption.
9 | SSL records may be as large as 16K, but are typically < 2K. In
10 | addition, a historic bug in Windows allowed records to be as large
11 | 32K. OpenSSL statically allocates read and write buffers (34K and
12 | 18K respectively) used for processing records.
13 | With this patch, OpenSSL statically allocates 4K + 4K buffers, with
14 | the option of dynamically growing buffers to 34K + 4K, which is a
15 | saving of 44K per connection for the typical case.
16 |
17 |
18 | handshake_cutthrough.patch
19 |
20 | Enables SSL3+ clients to send application data immediately following the
21 | Finished message even when negotiating full-handshakes. With this patch,
22 | clients can negotiate SSL connections in 1-RTT even when performing
23 | full-handshakes.
24 |
25 | jsse.patch
26 |
27 | Support for JSSE implementation based on OpenSSL.
28 |
29 | npn.patch
30 |
31 | Transport Layer Security (TLS) Next Protocol Negotiation Extension
32 |
33 | sslv3_uninit_padding.patch
34 |
35 | This patch sets the padding for SSLv3 block ciphers to zero.
36 |
37 | sha1_armv4_large.patch
38 |
39 | This patch eliminates memory stores to addresses below SP.
40 |
41 | mips_asm.patch
42 |
43 | MIPS assembly routines (AES, BN, SHA1, SHA256)
44 |
--------------------------------------------------------------------------------
/patches/apps_Android.mk:
--------------------------------------------------------------------------------
1 | # Copyright 2006 The Android Open Source Project
2 |
3 | LOCAL_PATH:= $(call my-dir)
4 |
5 | local_src_files:= \
6 | app_rand.c \
7 | apps.c \
8 | asn1pars.c \
9 | ca.c \
10 | ciphers.c \
11 | crl.c \
12 | crl2p7.c \
13 | dgst.c \
14 | dh.c \
15 | dhparam.c \
16 | dsa.c \
17 | dsaparam.c \
18 | ecparam.c \
19 | ec.c \
20 | enc.c \
21 | engine.c \
22 | errstr.c \
23 | gendh.c \
24 | gendsa.c \
25 | genpkey.c \
26 | genrsa.c \
27 | nseq.c \
28 | ocsp.c \
29 | openssl.c \
30 | passwd.c \
31 | pkcs12.c \
32 | pkcs7.c \
33 | pkcs8.c \
34 | pkey.c \
35 | pkeyparam.c \
36 | pkeyutl.c \
37 | prime.c \
38 | rand.c \
39 | req.c \
40 | rsa.c \
41 | rsautl.c \
42 | s_cb.c \
43 | s_client.c \
44 | s_server.c \
45 | s_socket.c \
46 | s_time.c \
47 | sess_id.c \
48 | smime.c \
49 | speed.c \
50 | spkac.c \
51 | verify.c \
52 | version.c \
53 | x509.c
54 |
55 | local_shared_libraries := \
56 | libssl \
57 | libcrypto
58 |
59 | local_c_includes := \
60 | external/openssl \
61 | external/openssl/include
62 |
63 | local_cflags := -DMONOLITH
64 |
65 | # These flags omit whole features from the commandline "openssl".
66 | # However, portions of these features are actually turned on.
67 | local_cflags += -DOPENSSL_NO_DTLS1
68 |
69 | include $(CLEAR_VARS)
70 | LOCAL_MODULE:= openssl
71 | LOCAL_MODULE_TAGS := optional
72 | LOCAL_SRC_FILES := $(local_src_files)
73 | LOCAL_SHARED_LIBRARIES := $(local_shared_libraries)
74 | LOCAL_C_INCLUDES := $(local_c_includes)
75 | LOCAL_CFLAGS := $(local_cflags)
76 | include $(LOCAL_PATH)/../android-config.mk
77 | include $(BUILD_EXECUTABLE)
78 |
79 | include $(CLEAR_VARS)
80 | LOCAL_MODULE:= openssl
81 | LOCAL_MODULE_TAGS := optional
82 | LOCAL_SRC_FILES := $(local_src_files)
83 | LOCAL_SHARED_LIBRARIES := $(local_shared_libraries)
84 | LOCAL_C_INCLUDES := $(local_c_includes)
85 | LOCAL_CFLAGS := $(local_cflags)
86 | include $(LOCAL_PATH)/../android-config.mk
87 | include $(BUILD_HOST_EXECUTABLE)
88 |
--------------------------------------------------------------------------------
/patches/progs.patch:
--------------------------------------------------------------------------------
1 | --- openssl-1.0.0.orig/apps/openssl.c 2009-10-04 09:43:21.000000000 -0700
2 | +++ openssl-1.0.0/apps/openssl.c 2010-05-18 14:05:14.000000000 -0700
3 | @@ -275,8 +275,10 @@ int main(int Argc, char *Argv[])
4 | if (ERR_GET_REASON(ERR_peek_last_error())
5 | == CONF_R_NO_SUCH_FILE)
6 | {
7 | +#if 0 /* ANDROID */
8 | BIO_printf(bio_err,
9 | "WARNING: can't open config file: %s\n",p);
10 | +#endif
11 | ERR_clear_error();
12 | NCONF_free(config);
13 | config = NULL;
14 | --- openssl-1.0.0.orig/apps/progs.h 2009-06-30 08:08:38.000000000 -0700
15 | +++ openssl-1.0.0/apps/progs.h 2010-05-18 14:05:38.000000000 -0700
16 | @@ -146,7 +152,9 @@ FUNCTION functions[] = {
17 | {FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
18 | #endif
19 | {FUNC_TYPE_GENERAL,"prime",prime_main},
20 | +#if 0 /* ANDROID */
21 | {FUNC_TYPE_GENERAL,"ts",ts_main},
22 | +#endif
23 | #ifndef OPENSSL_NO_MD2
24 | {FUNC_TYPE_MD,"md2",dgst_main},
25 | #endif
26 | --- openssl-1.0.0.orig/apps/speed.c 2010-03-03 11:56:17.000000000 -0800
27 | +++ openssl-1.0.0/apps/speed.c 2010-05-18 14:05:57.000000000 -0700
28 | @@ -1718,6 +1718,7 @@ int MAIN(int argc, char **argv)
29 | }
30 | }
31 |
32 | +#if 0 /* ANDROID */
33 | if (doit[D_IGE_128_AES])
34 | {
35 | for (j=0; jinput[rec->length], 0, i);
12 | rec->length+=i;
13 | rec->input[l-1]=(i-1);
14 | }
15 |
--------------------------------------------------------------------------------
/patches/testssl.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright (C) 2010 The Android Open Source Project
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | #
19 | # Android testssl.sh driver script for openssl's testssl
20 | #
21 | # based on openssl's test/testss script and test/Makefile's test_ssl target
22 | #
23 |
24 | set -e
25 | trap "echo Exiting on unexpected error." ERR
26 |
27 | device=/sdcard/android.testssl
28 |
29 | digest='-sha1'
30 | reqcmd="adb shell /system/bin/openssl req"
31 | x509cmd="adb shell /system/bin/openssl x509 $digest"
32 |
33 | CAkey="$device/keyCA.ss"
34 | CAcert="$device/certCA.ss"
35 | CAreq="$device/reqCA.ss"
36 | CAconf="$device/CAss.cnf"
37 |
38 | Uconf="$device/Uss.cnf"
39 | Ureq="$device/reqU.ss"
40 | Ukey="$device/keyU.ss"
41 | Ucert="$device/certU.ss"
42 |
43 | echo
44 | echo "setting up"
45 | adb remount
46 | adb shell rm -r $device
47 | adb shell mkdir $device
48 |
49 | echo
50 | echo "pushing test files to device"
51 | adb push . $device
52 |
53 | echo
54 | echo "make a certificate request using 'req'"
55 | adb shell "echo \"string to make the random number generator think it has entropy\" >> $device/.rnd"
56 | req_new='-new'
57 | $reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new
58 |
59 | echo
60 | echo "convert the certificate request into a self signed certificate using 'x509'"
61 | $x509cmd -CAcreateserial -in $CAreq -days 30 -req -out $CAcert -signkey $CAkey -extfile $CAconf -extensions v3_ca
62 |
63 | echo
64 | echo "make a user certificate request using 'req'"
65 | $reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new
66 |
67 | echo
68 | echo "sign user certificate request with the just created CA via 'x509'"
69 | $x509cmd -CAcreateserial -in $Ureq -days 30 -req -out $Ucert -CA $CAcert -CAkey $CAkey -extfile $Uconf -extensions v3_ee
70 |
71 | echo
72 | echo "running testssl"
73 | ./testssl $Ukey $Ucert $CAcert
74 |
75 | echo
76 | echo "cleaning up"
77 | adb shell rm -r $device
78 |
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-8
15 | android.library=true
16 |
--------------------------------------------------------------------------------
/ssl/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH:= $(call my-dir)
2 |
3 | local_c_includes := \
4 | $(NDK_PROJECT_PATH) \
5 | $(NDK_PROJECT_PATH)/include \
6 | $(NDK_PROJECT_PATH)/crypto
7 |
8 | local_src_files:= \
9 | s2_meth.c \
10 | s2_srvr.c \
11 | s2_clnt.c \
12 | s2_lib.c \
13 | s2_enc.c \
14 | s2_pkt.c \
15 | s3_meth.c \
16 | s3_srvr.c \
17 | s3_clnt.c \
18 | s3_lib.c \
19 | s3_enc.c \
20 | s3_pkt.c \
21 | s3_both.c \
22 | s23_meth.c \
23 | s23_srvr.c \
24 | s23_clnt.c \
25 | s23_lib.c \
26 | s23_pkt.c \
27 | t1_meth.c \
28 | t1_srvr.c \
29 | t1_clnt.c \
30 | t1_lib.c \
31 | t1_enc.c \
32 | t1_reneg.c \
33 | ssl_lib.c \
34 | ssl_err2.c \
35 | ssl_cert.c \
36 | ssl_sess.c \
37 | ssl_ciph.c \
38 | ssl_stat.c \
39 | ssl_rsa.c \
40 | ssl_asn1.c \
41 | ssl_txt.c \
42 | ssl_algs.c \
43 | bio_ssl.c \
44 | ssl_err.c \
45 | kssl.c
46 |
47 | #######################################
48 | # target static library
49 | include $(CLEAR_VARS)
50 | include $(LOCAL_PATH)/../android-config.mk
51 |
52 | ifeq ($(TARGET_ARCH),arm)
53 | LOCAL_NDK_VERSION := 5
54 | LOCAL_SDK_VERSION := 9
55 | endif
56 | LOCAL_SRC_FILES += $(local_src_files)
57 | LOCAL_C_INCLUDES += $(local_c_includes)
58 | LOCAL_MODULE_TAGS := optional
59 | LOCAL_MODULE:= libssl_static
60 | include $(BUILD_STATIC_LIBRARY)
61 |
62 | #######################################
63 | # target shared library
64 | include $(CLEAR_VARS)
65 | include $(LOCAL_PATH)/../android-config.mk
66 |
67 | ifeq ($(TARGET_ARCH),arm)
68 | LOCAL_NDK_VERSION := 5
69 | LOCAL_SDK_VERSION := 9
70 | endif
71 | LOCAL_SRC_FILES += $(local_src_files)
72 | LOCAL_C_INCLUDES += $(local_c_includes)
73 | LOCAL_SHARED_LIBRARIES += libcrypto
74 | LOCAL_MODULE_TAGS := optional
75 | LOCAL_MODULE:= libssl
76 | include $(BUILD_SHARED_LIBRARY)
77 |
78 | #######################################
79 | # host shared library
80 | include $(CLEAR_VARS)
81 | include $(LOCAL_PATH)/../android-config.mk
82 | LOCAL_SRC_FILES += $(local_src_files)
83 | LOCAL_C_INCLUDES += $(local_c_includes)
84 | LOCAL_SHARED_LIBRARIES += libcrypto
85 | LOCAL_MODULE_TAGS := optional
86 | LOCAL_MODULE:= libssl
87 | # include $(BUILD_HOST_SHARED_LIBRARY)
88 |
89 | #######################################
90 | # ssltest
91 | include $(CLEAR_VARS)
92 | include $(LOCAL_PATH)/../android-config.mk
93 | LOCAL_SRC_FILES:= ssltest.c
94 | LOCAL_C_INCLUDES += $(local_c_includes)
95 | LOCAL_SHARED_LIBRARIES := libssl libcrypto
96 | # libcrypto.so needs libz.so which is provided by the NDK
97 | LOCAL_LDLIBS := -lz
98 | LOCAL_MODULE:= ssltest
99 | LOCAL_MODULE_TAGS := optional
100 | include $(BUILD_EXECUTABLE)
101 |
--------------------------------------------------------------------------------