summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
authorbeck <>2000-12-15 02:58:47 +0000
committerbeck <>2000-12-15 02:58:47 +0000
commit9200bb13d15da4b2a23e6bc92c20e95b74aa2113 (patch)
tree5c52d628ec1e34be76e7ef2a4235d248b7c44d24 /src/lib/libcrypto
parente131d25072e3d4197ba4b9bcc0d1b27d34d6488d (diff)
downloadopenbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.gz
openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.tar.bz2
openbsd-9200bb13d15da4b2a23e6bc92c20e95b74aa2113.zip
openssl-engine-0.9.6 merge
Diffstat (limited to 'src/lib/libcrypto')
-rw-r--r--src/lib/libcrypto/Attic/Makefile36
-rw-r--r--src/lib/libcrypto/Makefile.ssl36
-rw-r--r--src/lib/libcrypto/asn1/Makefile.ssl989
-rw-r--r--src/lib/libcrypto/asn1/a_bitstr.c74
-rw-r--r--src/lib/libcrypto/asn1/a_bytes.c14
-rw-r--r--src/lib/libcrypto/asn1/a_digest.c4
-rw-r--r--src/lib/libcrypto/asn1/a_dup.c4
-rw-r--r--src/lib/libcrypto/asn1/a_enum.c165
-rw-r--r--src/lib/libcrypto/asn1/a_gentm.c4
-rw-r--r--src/lib/libcrypto/asn1/a_hdr.c2
-rw-r--r--src/lib/libcrypto/asn1/a_i2d_fp.c4
-rw-r--r--src/lib/libcrypto/asn1/a_int.c108
-rw-r--r--src/lib/libcrypto/asn1/a_mbstr.c20
-rw-r--r--src/lib/libcrypto/asn1/a_object.c62
-rw-r--r--src/lib/libcrypto/asn1/a_set.c12
-rw-r--r--src/lib/libcrypto/asn1/a_sign.c10
-rw-r--r--src/lib/libcrypto/asn1/a_strex.c533
-rw-r--r--src/lib/libcrypto/asn1/a_strnid.c19
-rw-r--r--src/lib/libcrypto/asn1/a_time.c4
-rw-r--r--src/lib/libcrypto/asn1/a_type.c18
-rw-r--r--src/lib/libcrypto/asn1/a_utctm.c90
-rw-r--r--src/lib/libcrypto/asn1/a_utf8.c16
-rw-r--r--src/lib/libcrypto/asn1/a_verify.c4
-rw-r--r--src/lib/libcrypto/asn1/asn1.h164
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c23
-rw-r--r--src/lib/libcrypto/asn1/asn1_mac.h6
-rw-r--r--src/lib/libcrypto/asn1/asn1_par.c48
-rw-r--r--src/lib/libcrypto/asn1/asn_pack.c8
-rw-r--r--src/lib/libcrypto/asn1/charmap.h15
-rw-r--r--src/lib/libcrypto/asn1/charmap.pl80
-rw-r--r--src/lib/libcrypto/asn1/d2i_dsap.c2
-rw-r--r--src/lib/libcrypto/asn1/d2i_r_pu.c2
-rw-r--r--src/lib/libcrypto/asn1/d2i_s_pr.c1
-rw-r--r--src/lib/libcrypto/asn1/d2i_s_pu.c2
-rw-r--r--src/lib/libcrypto/asn1/f_enum.c6
-rw-r--r--src/lib/libcrypto/asn1/f_int.c6
-rw-r--r--src/lib/libcrypto/asn1/f_string.c6
-rw-r--r--src/lib/libcrypto/asn1/i2d_dhp.c4
-rw-r--r--src/lib/libcrypto/asn1/i2d_dsap.c4
-rw-r--r--src/lib/libcrypto/asn1/i2d_r_pr.c4
-rw-r--r--src/lib/libcrypto/asn1/i2d_r_pu.c4
-rw-r--r--src/lib/libcrypto/asn1/i2d_s_pr.c4
-rw-r--r--src/lib/libcrypto/asn1/i2d_s_pu.c4
-rw-r--r--src/lib/libcrypto/asn1/n_pkey.c62
-rw-r--r--src/lib/libcrypto/asn1/nsseq.c2
-rw-r--r--src/lib/libcrypto/asn1/p5_pbe.c4
-rw-r--r--src/lib/libcrypto/asn1/p5_pbev2.c6
-rw-r--r--src/lib/libcrypto/asn1/p7_dgst.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_enc.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_enc_c.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_evp.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_i_s.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_lib.c112
-rw-r--r--src/lib/libcrypto/asn1/p7_recip.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_s_e.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_signd.c2
-rw-r--r--src/lib/libcrypto/asn1/p7_signi.c2
-rw-r--r--src/lib/libcrypto/asn1/p8_key.c4
-rw-r--r--src/lib/libcrypto/asn1/p8_pkey.c2
-rw-r--r--src/lib/libcrypto/asn1/t_pkey.c16
-rw-r--r--src/lib/libcrypto/asn1/t_x509.c2
-rw-r--r--src/lib/libcrypto/asn1/t_x509a.c8
-rw-r--r--src/lib/libcrypto/asn1/x_algor.c2
-rw-r--r--src/lib/libcrypto/asn1/x_attrib.c2
-rw-r--r--src/lib/libcrypto/asn1/x_cinf.c2
-rw-r--r--src/lib/libcrypto/asn1/x_crl.c21
-rw-r--r--src/lib/libcrypto/asn1/x_exten.c2
-rw-r--r--src/lib/libcrypto/asn1/x_info.c6
-rw-r--r--src/lib/libcrypto/asn1/x_name.c6
-rw-r--r--src/lib/libcrypto/asn1/x_pkey.c4
-rw-r--r--src/lib/libcrypto/asn1/x_pubkey.c10
-rw-r--r--src/lib/libcrypto/asn1/x_req.c25
-rw-r--r--src/lib/libcrypto/asn1/x_sig.c2
-rw-r--r--src/lib/libcrypto/asn1/x_spki.c4
-rw-r--r--src/lib/libcrypto/asn1/x_val.c2
-rw-r--r--src/lib/libcrypto/asn1/x_x509.c18
-rw-r--r--src/lib/libcrypto/asn1/x_x509a.c10
-rw-r--r--src/lib/libcrypto/bf/Makefile.ssl4
-rw-r--r--src/lib/libcrypto/bf/bftest.c3
-rw-r--r--src/lib/libcrypto/bio/Makefile.ssl127
-rw-r--r--src/lib/libcrypto/bio/b_dump.c122
-rw-r--r--src/lib/libcrypto/bio/b_print.c346
-rw-r--r--src/lib/libcrypto/bio/b_sock.c37
-rw-r--r--src/lib/libcrypto/bio/bf_buff.c52
-rw-r--r--src/lib/libcrypto/bio/bf_lbuf.c397
-rw-r--r--src/lib/libcrypto/bio/bf_nbio.c20
-rw-r--r--src/lib/libcrypto/bio/bf_null.c20
-rw-r--r--src/lib/libcrypto/bio/bio.h66
-rw-r--r--src/lib/libcrypto/bio/bio_err.c7
-rw-r--r--src/lib/libcrypto/bio/bio_lib.c30
-rw-r--r--src/lib/libcrypto/bio/bss_acpt.c24
-rw-r--r--src/lib/libcrypto/bio/bss_bio.c20
-rw-r--r--src/lib/libcrypto/bio/bss_conn.c47
-rw-r--r--src/lib/libcrypto/bio/bss_file.c16
-rw-r--r--src/lib/libcrypto/bio/bss_log.c130
-rw-r--r--src/lib/libcrypto/bio/bss_mem.c33
-rw-r--r--src/lib/libcrypto/bio/bss_null.c16
-rw-r--r--src/lib/libcrypto/bio/bss_rtcp.c16
-rw-r--r--src/lib/libcrypto/bio/bss_sock.c28
-rw-r--r--src/lib/libcrypto/bn/Makefile.ssl135
-rw-r--r--src/lib/libcrypto/bn/asm/README12
-rw-r--r--src/lib/libcrypto/bn/asm/pa-risc2.s2024
-rw-r--r--src/lib/libcrypto/bn/asm/pa-risc2W.s1605
-rw-r--r--src/lib/libcrypto/bn/bn.h12
-rw-r--r--src/lib/libcrypto/bn/bn_asm.c11
-rw-r--r--src/lib/libcrypto/bn/bn_blind.c4
-rw-r--r--src/lib/libcrypto/bn/bn_ctx.c4
-rw-r--r--src/lib/libcrypto/bn/bn_div.c2
-rw-r--r--src/lib/libcrypto/bn/bn_err.c2
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c521
-rw-r--r--src/lib/libcrypto/bn/bn_exp2.c357
-rw-r--r--src/lib/libcrypto/bn/bn_lcl.h100
-rw-r--r--src/lib/libcrypto/bn/bn_lib.c42
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c31
-rw-r--r--src/lib/libcrypto/bn/bn_mul.c2
-rw-r--r--src/lib/libcrypto/bn/bn_print.c12
-rw-r--r--src/lib/libcrypto/bn/bn_rand.c10
-rw-r--r--src/lib/libcrypto/bn/bn_recp.c4
-rw-r--r--src/lib/libcrypto/bn/bn_shift.c2
-rw-r--r--src/lib/libcrypto/bn/bn_sqr.c2
-rw-r--r--src/lib/libcrypto/bn/bn_word.c17
-rw-r--r--src/lib/libcrypto/bn/vms-helper.c2
-rw-r--r--src/lib/libcrypto/buffer/Makefile.ssl11
-rw-r--r--src/lib/libcrypto/buffer/buffer.c12
-rw-r--r--src/lib/libcrypto/cast/c_skey.c2
-rw-r--r--src/lib/libcrypto/cast/cast.h2
-rw-r--r--src/lib/libcrypto/comp/Makefile.ssl20
-rw-r--r--src/lib/libcrypto/comp/comp.h4
-rw-r--r--src/lib/libcrypto/comp/comp_lib.c6
-rw-r--r--src/lib/libcrypto/conf/Makefile.ssl44
-rw-r--r--src/lib/libcrypto/conf/conf.c730
-rw-r--r--src/lib/libcrypto/conf/conf.h69
-rw-r--r--src/lib/libcrypto/conf/conf_api.c289
-rw-r--r--src/lib/libcrypto/conf/conf_api.h87
-rw-r--r--src/lib/libcrypto/conf/conf_def.c703
-rw-r--r--src/lib/libcrypto/conf/conf_def.h145
-rw-r--r--src/lib/libcrypto/conf/conf_err.c9
-rw-r--r--src/lib/libcrypto/conf/conf_lcl.h116
-rw-r--r--src/lib/libcrypto/conf/conf_lib.c352
-rw-r--r--src/lib/libcrypto/conf/keysets.pl152
-rw-r--r--src/lib/libcrypto/conf/test.c8
-rw-r--r--src/lib/libcrypto/cpt_err.c2
-rw-r--r--src/lib/libcrypto/cryptlib.c201
-rw-r--r--src/lib/libcrypto/cryptlib.h8
-rw-r--r--src/lib/libcrypto/crypto-lib.com63
-rw-r--r--src/lib/libcrypto/crypto.h86
-rw-r--r--src/lib/libcrypto/des/Makefile.ssl17
-rw-r--r--src/lib/libcrypto/des/des.c4
-rw-r--r--src/lib/libcrypto/des/des.h9
-rw-r--r--src/lib/libcrypto/des/enc_read.c6
-rw-r--r--src/lib/libcrypto/des/enc_writ.c2
-rw-r--r--src/lib/libcrypto/des/qud_cksm.c12
-rw-r--r--src/lib/libcrypto/des/read_pwd.c20
-rw-r--r--src/lib/libcrypto/dh/Makefile.ssl66
-rw-r--r--src/lib/libcrypto/dh/dh.h26
-rw-r--r--src/lib/libcrypto/dh/dh_key.c34
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c76
-rw-r--r--src/lib/libcrypto/dh/dhtest.c8
-rw-r--r--src/lib/libcrypto/doc/DH_set_method.pod62
-rw-r--r--src/lib/libcrypto/doc/DSA_set_method.pod58
-rw-r--r--src/lib/libcrypto/doc/ERR_error_string.pod16
-rw-r--r--src/lib/libcrypto/doc/ERR_get_error.pod5
-rw-r--r--src/lib/libcrypto/doc/ERR_remove_state.pod2
-rw-r--r--src/lib/libcrypto/doc/EVP_DigestInit.pod15
-rw-r--r--src/lib/libcrypto/doc/EVP_EncryptInit.pod199
-rw-r--r--src/lib/libcrypto/doc/EVP_OpenInit.pod28
-rw-r--r--src/lib/libcrypto/doc/EVP_SealInit.pod18
-rw-r--r--src/lib/libcrypto/doc/EVP_SignInit.pod6
-rw-r--r--src/lib/libcrypto/doc/EVP_VerifyInit.pod15
-rw-r--r--src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod46
-rw-r--r--src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod5
-rw-r--r--src/lib/libcrypto/doc/RSA_get_ex_new_index.pod14
-rw-r--r--src/lib/libcrypto/doc/RSA_print.pod5
-rw-r--r--src/lib/libcrypto/doc/RSA_public_encrypt.pod2
-rw-r--r--src/lib/libcrypto/doc/RSA_set_method.pod60
-rw-r--r--src/lib/libcrypto/doc/dh.pod9
-rw-r--r--src/lib/libcrypto/doc/dsa.pod9
-rw-r--r--src/lib/libcrypto/doc/evp.pod37
-rw-r--r--src/lib/libcrypto/doc/rsa.pod11
-rw-r--r--src/lib/libcrypto/dsa/Makefile.ssl127
-rw-r--r--src/lib/libcrypto/dsa/dsa.h29
-rw-r--r--src/lib/libcrypto/dsa/dsa_asn1.c14
-rw-r--r--src/lib/libcrypto/dsa/dsa_key.c2
-rw-r--r--src/lib/libcrypto/dsa/dsa_lib.c74
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c7
-rw-r--r--src/lib/libcrypto/dsa/dsa_sign.c5
-rw-r--r--src/lib/libcrypto/dsa/dsa_vrf.c3
-rw-r--r--src/lib/libcrypto/dso/Makefile.ssl140
-rw-r--r--src/lib/libcrypto/dso/README24
-rw-r--r--src/lib/libcrypto/dso/dso.h250
-rw-r--r--src/lib/libcrypto/dso/dso_dl.c251
-rw-r--r--src/lib/libcrypto/dso/dso_dlfcn.c276
-rw-r--r--src/lib/libcrypto/dso/dso_err.c128
-rw-r--r--src/lib/libcrypto/dso/dso_lib.c306
-rw-r--r--src/lib/libcrypto/dso/dso_null.c86
-rw-r--r--src/lib/libcrypto/dso/dso_openssl.c81
-rw-r--r--src/lib/libcrypto/dso/dso_vms.c371
-rw-r--r--src/lib/libcrypto/dso/dso_win32.c273
-rw-r--r--src/lib/libcrypto/engine/Makefile.ssl220
-rw-r--r--src/lib/libcrypto/engine/README278
-rw-r--r--src/lib/libcrypto/engine/engine.h398
-rw-r--r--src/lib/libcrypto/engine/engine_err.c183
-rw-r--r--src/lib/libcrypto/engine/engine_int.h160
-rw-r--r--src/lib/libcrypto/engine/engine_lib.c488
-rw-r--r--src/lib/libcrypto/engine/engine_list.c675
-rw-r--r--src/lib/libcrypto/engine/engine_openssl.c174
-rw-r--r--src/lib/libcrypto/engine/enginetest.c251
-rw-r--r--src/lib/libcrypto/engine/hw_atalla.c444
-rw-r--r--src/lib/libcrypto/engine/hw_cswift.c807
-rw-r--r--src/lib/libcrypto/engine/hw_ncipher.c1019
-rw-r--r--src/lib/libcrypto/engine/vendor_defns/atalla.h61
-rw-r--r--src/lib/libcrypto/engine/vendor_defns/cswift.h213
-rw-r--r--src/lib/libcrypto/err/Makefile.ssl33
-rw-r--r--src/lib/libcrypto/err/err.c154
-rw-r--r--src/lib/libcrypto/err/err.h37
-rw-r--r--src/lib/libcrypto/err/err_all.c4
-rw-r--r--src/lib/libcrypto/err/err_prn.c6
-rw-r--r--src/lib/libcrypto/err/openssl.ec2
-rw-r--r--src/lib/libcrypto/evp/Makefile.ssl1163
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c37
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c22
-rw-r--r--src/lib/libcrypto/evp/bio_md.c22
-rw-r--r--src/lib/libcrypto/evp/bio_ok.c18
-rw-r--r--src/lib/libcrypto/evp/c_alld.c3
-rw-r--r--src/lib/libcrypto/evp/e_bf.c80
-rw-r--r--src/lib/libcrypto/evp/e_cast.c82
-rw-r--r--src/lib/libcrypto/evp/e_cbc_3d.c151
-rw-r--r--src/lib/libcrypto/evp/e_cbc_bf.c106
-rw-r--r--src/lib/libcrypto/evp/e_cbc_c.c107
-rw-r--r--src/lib/libcrypto/evp/e_cbc_d.c106
-rw-r--r--src/lib/libcrypto/evp/e_cbc_i.c119
-rw-r--r--src/lib/libcrypto/evp/e_cbc_r2.c216
-rw-r--r--src/lib/libcrypto/evp/e_cbc_r5.c108
-rw-r--r--src/lib/libcrypto/evp/e_cfb_3d.c155
-rw-r--r--src/lib/libcrypto/evp/e_cfb_bf.c108
-rw-r--r--src/lib/libcrypto/evp/e_cfb_c.c109
-rw-r--r--src/lib/libcrypto/evp/e_cfb_d.c110
-rw-r--r--src/lib/libcrypto/evp/e_cfb_i.c109
-rw-r--r--src/lib/libcrypto/evp/e_cfb_r2.c110
-rw-r--r--src/lib/libcrypto/evp/e_cfb_r5.c110
-rw-r--r--src/lib/libcrypto/evp/e_des.c118
-rw-r--r--src/lib/libcrypto/evp/e_des3.c165
-rw-r--r--src/lib/libcrypto/evp/e_ecb_3d.c158
-rw-r--r--src/lib/libcrypto/evp/e_ecb_bf.c109
-rw-r--r--src/lib/libcrypto/evp/e_ecb_c.c110
-rw-r--r--src/lib/libcrypto/evp/e_ecb_d.c118
-rw-r--r--src/lib/libcrypto/evp/e_ecb_i.c121
-rw-r--r--src/lib/libcrypto/evp/e_ecb_r2.c111
-rw-r--r--src/lib/libcrypto/evp/e_ecb_r5.c111
-rw-r--r--src/lib/libcrypto/evp/e_idea.c112
-rw-r--r--src/lib/libcrypto/evp/e_null.c20
-rw-r--r--src/lib/libcrypto/evp/e_ofb_3d.c152
-rw-r--r--src/lib/libcrypto/evp/e_ofb_bf.c109
-rw-r--r--src/lib/libcrypto/evp/e_ofb_c.c110
-rw-r--r--src/lib/libcrypto/evp/e_ofb_d.c107
-rw-r--r--src/lib/libcrypto/evp/e_ofb_i.c109
-rw-r--r--src/lib/libcrypto/evp/e_ofb_r2.c111
-rw-r--r--src/lib/libcrypto/evp/e_ofb_r5.c111
-rw-r--r--src/lib/libcrypto/evp/e_rc2.c222
-rw-r--r--src/lib/libcrypto/evp/e_rc4.c30
-rw-r--r--src/lib/libcrypto/evp/e_rc5.c118
-rw-r--r--src/lib/libcrypto/evp/e_xcbc_d.c33
-rw-r--r--src/lib/libcrypto/evp/encode.c10
-rw-r--r--src/lib/libcrypto/evp/evp.h133
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c149
-rw-r--r--src/lib/libcrypto/evp/evp_err.c10
-rw-r--r--src/lib/libcrypto/evp/evp_key.c2
-rw-r--r--src/lib/libcrypto/evp/evp_locl.h168
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c12
-rw-r--r--src/lib/libcrypto/evp/evp_pkey.c49
-rw-r--r--src/lib/libcrypto/evp/m_md4.c83
-rw-r--r--src/lib/libcrypto/evp/p5_crpt.c3
-rw-r--r--src/lib/libcrypto/evp/p5_crpt2.c3
-rw-r--r--src/lib/libcrypto/evp/p_lib.c4
-rw-r--r--src/lib/libcrypto/evp/p_open.c20
-rw-r--r--src/lib/libcrypto/evp/p_seal.c13
-rw-r--r--src/lib/libcrypto/ex_data.c4
-rw-r--r--src/lib/libcrypto/hmac/Makefile.ssl5
-rw-r--r--src/lib/libcrypto/hmac/hmac.h8
-rw-r--r--src/lib/libcrypto/idea/idea.h18
-rw-r--r--src/lib/libcrypto/install.com16
-rw-r--r--src/lib/libcrypto/lhash/Makefile.ssl10
-rw-r--r--src/lib/libcrypto/lhash/lh_stats.c5
-rw-r--r--src/lib/libcrypto/lhash/lh_test.c2
-rw-r--r--src/lib/libcrypto/lhash/lhash.c20
-rw-r--r--src/lib/libcrypto/lhash/lhash.h14
-rw-r--r--src/lib/libcrypto/md2/Makefile.ssl7
-rw-r--r--src/lib/libcrypto/md2/md2.h8
-rw-r--r--src/lib/libcrypto/md4/Makefile.ssl84
-rw-r--r--src/lib/libcrypto/md4/md4.c127
-rw-r--r--src/lib/libcrypto/md4/md4.h114
-rw-r--r--src/lib/libcrypto/md4/md4_dgst.c285
-rw-r--r--src/lib/libcrypto/md4/md4_locl.h154
-rw-r--r--src/lib/libcrypto/md4/md4_one.c95
-rw-r--r--src/lib/libcrypto/md4/md4s.cpp78
-rw-r--r--src/lib/libcrypto/md4/md4test.c131
-rw-r--r--src/lib/libcrypto/md5/Makefile.ssl2
-rw-r--r--src/lib/libcrypto/mdc2/Makefile.ssl7
-rw-r--r--src/lib/libcrypto/mdc2/mdc2.h4
-rw-r--r--src/lib/libcrypto/mem.c51
-rw-r--r--src/lib/libcrypto/mem_dbg.c66
-rw-r--r--src/lib/libcrypto/objects/Makefile.ssl27
-rw-r--r--src/lib/libcrypto/objects/o_names.c15
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c64
-rw-r--r--src/lib/libcrypto/objects/obj_dat.h.src2208
-rw-r--r--src/lib/libcrypto/objects/obj_dat.pl43
-rw-r--r--src/lib/libcrypto/objects/obj_lib.c12
-rw-r--r--src/lib/libcrypto/objects/obj_mac.h1798
-rw-r--r--src/lib/libcrypto/objects/obj_mac.num392
-rw-r--r--src/lib/libcrypto/objects/objects.README44
-rw-r--r--src/lib/libcrypto/objects/objects.h18
-rw-r--r--src/lib/libcrypto/objects/objects.pl224
-rw-r--r--src/lib/libcrypto/objects/objects.txt629
-rw-r--r--src/lib/libcrypto/opensslv.h57
-rw-r--r--src/lib/libcrypto/pem/Makefile.ssl87
-rw-r--r--src/lib/libcrypto/pem/pem.h22
-rw-r--r--src/lib/libcrypto/pem/pem2.h8
-rw-r--r--src/lib/libcrypto/pem/pem_info.c12
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c26
-rw-r--r--src/lib/libcrypto/pem/pem_seal.c8
-rw-r--r--src/lib/libcrypto/pem/pem_sign.c4
-rw-r--r--src/lib/libcrypto/pkcs12/Makefile.ssl234
-rw-r--r--src/lib/libcrypto/pkcs12/p12_add.c10
-rw-r--r--src/lib/libcrypto/pkcs12/p12_attr.c16
-rw-r--r--src/lib/libcrypto/pkcs12/p12_bags.c2
-rw-r--r--src/lib/libcrypto/pkcs12/p12_crt.c25
-rw-r--r--src/lib/libcrypto/pkcs12/p12_decr.c18
-rw-r--r--src/lib/libcrypto/pkcs12/p12_key.c38
-rw-r--r--src/lib/libcrypto/pkcs12/p12_kiss.c100
-rw-r--r--src/lib/libcrypto/pkcs12/p12_lib.c2
-rw-r--r--src/lib/libcrypto/pkcs12/p12_mac.c2
-rw-r--r--src/lib/libcrypto/pkcs12/p12_mutl.c7
-rw-r--r--src/lib/libcrypto/pkcs12/p12_npas.c37
-rw-r--r--src/lib/libcrypto/pkcs12/p12_sbag.c23
-rw-r--r--src/lib/libcrypto/pkcs12/p12_utl.c4
-rw-r--r--src/lib/libcrypto/pkcs12/pkcs12.h57
-rw-r--r--src/lib/libcrypto/pkcs7/Makefile.ssl91
-rw-r--r--src/lib/libcrypto/pkcs7/bio_ber.c4
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_attr.c30
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_doit.c57
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_mime.c138
-rw-r--r--src/lib/libcrypto/pkcs7/pk7_smime.c24
-rw-r--r--src/lib/libcrypto/pkcs7/pkcs7.h43
-rw-r--r--src/lib/libcrypto/rand/Makefile.ssl42
-rw-r--r--src/lib/libcrypto/rand/md_rand.c331
-rw-r--r--src/lib/libcrypto/rand/rand.h25
-rw-r--r--src/lib/libcrypto/rand/rand_egd.c57
-rw-r--r--src/lib/libcrypto/rand/rand_lcl.h184
-rw-r--r--src/lib/libcrypto/rand/rand_lib.c57
-rw-r--r--src/lib/libcrypto/rand/rand_win.c732
-rw-r--r--src/lib/libcrypto/rand/randfile.c31
-rw-r--r--src/lib/libcrypto/rc2/rc2.h26
-rw-r--r--src/lib/libcrypto/rc2/rc2_cbc.c2
-rw-r--r--src/lib/libcrypto/rc2/rc2_ecb.c4
-rw-r--r--src/lib/libcrypto/rc2/rc2_skey.c2
-rw-r--r--src/lib/libcrypto/rc2/rc2cfb64.c5
-rw-r--r--src/lib/libcrypto/rc2/rc2ofb64.c5
-rw-r--r--src/lib/libcrypto/rc4/rc4.h8
-rw-r--r--src/lib/libcrypto/rc5/rc5.h19
-rw-r--r--src/lib/libcrypto/ripemd/Makefile.ssl2
-rw-r--r--src/lib/libcrypto/rsa/Makefile.ssl121
-rw-r--r--src/lib/libcrypto/rsa/rsa.h31
-rw-r--r--src/lib/libcrypto/rsa/rsa_eay.c43
-rw-r--r--src/lib/libcrypto/rsa/rsa_gen.c2
-rw-r--r--src/lib/libcrypto/rsa/rsa_lib.c123
-rw-r--r--src/lib/libcrypto/rsa/rsa_oaep.c8
-rw-r--r--src/lib/libcrypto/rsa/rsa_saos.c8
-rw-r--r--src/lib/libcrypto/rsa/rsa_sign.c15
-rw-r--r--src/lib/libcrypto/rsa/rsa_ssl.c2
-rw-r--r--src/lib/libcrypto/stack/Makefile.ssl5
-rw-r--r--src/lib/libcrypto/stack/safestack.h1137
-rw-r--r--src/lib/libcrypto/stack/stack.c73
-rw-r--r--src/lib/libcrypto/stack/stack.h18
-rw-r--r--src/lib/libcrypto/symhacks.h154
-rw-r--r--src/lib/libcrypto/threads/mttest.c24
-rw-r--r--src/lib/libcrypto/threads/th-lock.c26
-rw-r--r--src/lib/libcrypto/tmdiff.c4
-rw-r--r--src/lib/libcrypto/txt_db/Makefile.ssl4
-rw-r--r--src/lib/libcrypto/txt_db/txt_db.c28
-rw-r--r--src/lib/libcrypto/txt_db/txt_db.h11
-rw-r--r--src/lib/libcrypto/util/libeay.num4162
-rw-r--r--src/lib/libcrypto/util/mk1mf.pl33
-rw-r--r--src/lib/libcrypto/util/mkdef.pl751
-rw-r--r--src/lib/libcrypto/util/mkerr.pl14
-rw-r--r--src/lib/libcrypto/util/mkfiles.pl3
-rw-r--r--src/lib/libcrypto/util/mklink.pl6
-rw-r--r--src/lib/libcrypto/util/mkstack.pl124
-rw-r--r--src/lib/libcrypto/util/pl/BC-32.pl2
-rw-r--r--src/lib/libcrypto/util/pl/Mingw32.pl4
-rw-r--r--src/lib/libcrypto/util/pl/Mingw32f.pl4
-rw-r--r--src/lib/libcrypto/util/pl/VC-32.pl7
-rw-r--r--src/lib/libcrypto/util/pl/linux.pl4
-rw-r--r--src/lib/libcrypto/util/selftest.pl13
-rw-r--r--src/lib/libcrypto/util/sp-diff.pl2
-rw-r--r--src/lib/libcrypto/util/ssleay.num422
-rw-r--r--src/lib/libcrypto/x509/Makefile.ssl273
-rw-r--r--src/lib/libcrypto/x509/by_dir.c26
-rw-r--r--src/lib/libcrypto/x509/x509.h152
-rw-r--r--src/lib/libcrypto/x509/x509_cmp.c28
-rw-r--r--src/lib/libcrypto/x509/x509_lu.c332
-rw-r--r--src/lib/libcrypto/x509/x509_obj.c4
-rw-r--r--src/lib/libcrypto/x509/x509_req.c6
-rw-r--r--src/lib/libcrypto/x509/x509_set.c16
-rw-r--r--src/lib/libcrypto/x509/x509_trs.c16
-rw-r--r--src/lib/libcrypto/x509/x509_txt.c9
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c491
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.h56
-rw-r--r--src/lib/libcrypto/x509/x509spki.c12
-rw-r--r--src/lib/libcrypto/x509/x_all.c38
-rw-r--r--src/lib/libcrypto/x509v3/Makefile.ssl418
-rw-r--r--src/lib/libcrypto/x509v3/v3_akey.c8
-rw-r--r--src/lib/libcrypto/x509v3/v3_alt.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_bcons.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_conf.c4
-rw-r--r--src/lib/libcrypto/x509v3/v3_cpols.c41
-rw-r--r--src/lib/libcrypto/x509v3/v3_crld.c10
-rw-r--r--src/lib/libcrypto/x509v3/v3_extku.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_genn.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_ia5.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_info.c16
-rw-r--r--src/lib/libcrypto/x509v3/v3_lib.c28
-rw-r--r--src/lib/libcrypto/x509v3/v3_pku.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_prn.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_purp.c162
-rw-r--r--src/lib/libcrypto/x509v3/v3_sxnet.c6
-rw-r--r--src/lib/libcrypto/x509v3/v3_utl.c134
-rw-r--r--src/lib/libcrypto/x509v3/x509v3.h23
427 files changed, 34187 insertions, 12838 deletions
diff --git a/src/lib/libcrypto/Attic/Makefile b/src/lib/libcrypto/Attic/Makefile
index b980f54dba..3c4cf3ea9a 100644
--- a/src/lib/libcrypto/Attic/Makefile
+++ b/src/lib/libcrypto/Attic/Makefile
@@ -27,7 +27,7 @@ LIBS=
27 27
28SDIRS= md2 md5 sha mdc2 hmac ripemd \ 28SDIRS= md2 md5 sha mdc2 hmac ripemd \
29 des rc2 rc4 rc5 idea bf cast \ 29 des rc2 rc4 rc5 idea bf cast \
30 bn rsa dsa dh \ 30 bn rsa dsa dh dso engine \
31 buffer bio stack lhash rand err objects \ 31 buffer bio stack lhash rand err objects \
32 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp 32 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
33 33
@@ -39,7 +39,7 @@ LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdi
39 39
40SRC= $(LIBSRC) 40SRC= $(LIBSRC)
41 41
42EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h 42EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h
43HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER) 43HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER)
44 44
45ALL= $(GENERAL) $(SRC) $(HEADER) 45ALL= $(GENERAL) $(SRC) $(HEADER)
@@ -155,41 +155,45 @@ dclean:
155 155
156# DO NOT DELETE THIS LINE -- make depend depends on it. 156# DO NOT DELETE THIS LINE -- make depend depends on it.
157 157
158cpt_err.o: ../include/openssl/crypto.h ../include/openssl/err.h 158cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
159cpt_err.o: ../include/openssl/err.h ../include/openssl/lhash.h
159cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h 160cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
160cpt_err.o: ../include/openssl/stack.h 161cpt_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
161cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h 162cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h
162cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 163cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
163cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h 164cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h
164cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 165cryptlib.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
165cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h 166cryptlib.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
166cryptlib.o: cryptlib.h 167cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
167cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h 168cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h
168cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 169cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
169cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h 170cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h
170cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 171cversion.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
171cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h 172cversion.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
172cversion.o: buildinf.h cryptlib.h 173cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
174cversion.o: cryptlib.h
173ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h 175ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h
174ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 176ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
175ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h 177ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h
176ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h 178ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
177ex_data.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h 179ex_data.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
178ex_data.o: ../include/openssl/stack.h cryptlib.h 180ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
179mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h 181mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h
180mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 182mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
181mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h 183mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h
182mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 184mem.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
183mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h cryptlib.h 185mem.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
186mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
184mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h 187mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h
185mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 188mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
186mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h 189mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h
187mem_dbg.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h 190mem_dbg.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
188mem_dbg.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h 191mem_dbg.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
189mem_dbg.o: ../include/openssl/stack.h cryptlib.h 192mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
190tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h 193tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h
191tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 194tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
192tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h 195tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h
193tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 196tmdiff.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
194tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h 197tmdiff.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
198tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
195tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h 199tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h
diff --git a/src/lib/libcrypto/Makefile.ssl b/src/lib/libcrypto/Makefile.ssl
index f9b33586be..05e3bb701e 100644
--- a/src/lib/libcrypto/Makefile.ssl
+++ b/src/lib/libcrypto/Makefile.ssl
@@ -27,7 +27,7 @@ LIBS=
27 27
28SDIRS= md2 md5 sha mdc2 hmac ripemd \ 28SDIRS= md2 md5 sha mdc2 hmac ripemd \
29 des rc2 rc4 rc5 idea bf cast \ 29 des rc2 rc4 rc5 idea bf cast \
30 bn rsa dsa dh \ 30 bn rsa dsa dh dso engine \
31 buffer bio stack lhash rand err objects \ 31 buffer bio stack lhash rand err objects \
32 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp 32 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
33 33
@@ -39,7 +39,7 @@ LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdi
39 39
40SRC= $(LIBSRC) 40SRC= $(LIBSRC)
41 41
42EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h 42EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h
43HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER) 43HEADER= cryptlib.h buildinf.h md32_common.h $(EXHEADER)
44 44
45ALL= $(GENERAL) $(SRC) $(HEADER) 45ALL= $(GENERAL) $(SRC) $(HEADER)
@@ -155,41 +155,45 @@ dclean:
155 155
156# DO NOT DELETE THIS LINE -- make depend depends on it. 156# DO NOT DELETE THIS LINE -- make depend depends on it.
157 157
158cpt_err.o: ../include/openssl/crypto.h ../include/openssl/err.h 158cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
159cpt_err.o: ../include/openssl/err.h ../include/openssl/lhash.h
159cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h 160cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
160cpt_err.o: ../include/openssl/stack.h 161cpt_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
161cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h 162cryptlib.o: ../include/openssl/bio.h ../include/openssl/buffer.h
162cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 163cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
163cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h 164cryptlib.o: ../include/openssl/e_os2.h ../include/openssl/err.h
164cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 165cryptlib.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
165cryptlib.o: ../include/openssl/safestack.h ../include/openssl/stack.h 166cryptlib.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
166cryptlib.o: cryptlib.h 167cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
167cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h 168cversion.o: ../include/openssl/bio.h ../include/openssl/buffer.h
168cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 169cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
169cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h 170cversion.o: ../include/openssl/e_os2.h ../include/openssl/err.h
170cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 171cversion.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
171cversion.o: ../include/openssl/safestack.h ../include/openssl/stack.h 172cversion.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
172cversion.o: buildinf.h cryptlib.h 173cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
174cversion.o: cryptlib.h
173ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h 175ex_data.o: ../include/openssl/bio.h ../include/openssl/buffer.h
174ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 176ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
175ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h 177ex_data.o: ../include/openssl/e_os2.h ../include/openssl/err.h
176ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h 178ex_data.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
177ex_data.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h 179ex_data.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
178ex_data.o: ../include/openssl/stack.h cryptlib.h 180ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
179mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h 181mem.o: ../include/openssl/bio.h ../include/openssl/buffer.h
180mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 182mem.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
181mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h 183mem.o: ../include/openssl/e_os2.h ../include/openssl/err.h
182mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 184mem.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
183mem.o: ../include/openssl/safestack.h ../include/openssl/stack.h cryptlib.h 185mem.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
186mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
184mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h 187mem_dbg.o: ../include/openssl/bio.h ../include/openssl/buffer.h
185mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 188mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
186mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h 189mem_dbg.o: ../include/openssl/e_os2.h ../include/openssl/err.h
187mem_dbg.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h 190mem_dbg.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
188mem_dbg.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h 191mem_dbg.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
189mem_dbg.o: ../include/openssl/stack.h cryptlib.h 192mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
190tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h 193tmdiff.o: ../include/openssl/bio.h ../include/openssl/buffer.h
191tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h 194tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os.h
192tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h 195tmdiff.o: ../include/openssl/e_os2.h ../include/openssl/err.h
193tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h 196tmdiff.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
194tmdiff.o: ../include/openssl/safestack.h ../include/openssl/stack.h 197tmdiff.o: ../include/openssl/opensslv.h ../include/openssl/safestack.h
198tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
195tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h 199tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h
diff --git a/src/lib/libcrypto/asn1/Makefile.ssl b/src/lib/libcrypto/asn1/Makefile.ssl
index a17a713a75..b8059ddffe 100644
--- a/src/lib/libcrypto/asn1/Makefile.ssl
+++ b/src/lib/libcrypto/asn1/Makefile.ssl
@@ -24,7 +24,7 @@ APPS=
24LIB=$(TOP)/libcrypto.a 24LIB=$(TOP)/libcrypto.a
25LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \ 25LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
26 a_null.c a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c \ 26 a_null.c a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c \
27 a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c \ 27 a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c \
28 x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c \ 28 x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c \
29 x_name.c x_cinf.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c \ 29 x_name.c x_cinf.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c \
30 d2i_r_pr.c i2d_r_pr.c d2i_r_pu.c i2d_r_pu.c \ 30 d2i_r_pr.c i2d_r_pr.c d2i_r_pu.c i2d_r_pu.c \
@@ -39,7 +39,7 @@ LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \
39 evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c 39 evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c
40LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \ 40LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \
41 a_null.o a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o \ 41 a_null.o a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o \
42 a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o \ 42 a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o a_strex.o \
43 x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o \ 43 x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o \
44 x_name.o x_cinf.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o \ 44 x_name.o x_cinf.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o \
45 d2i_r_pr.o i2d_r_pr.o d2i_r_pu.o i2d_r_pu.o \ 45 d2i_r_pr.o i2d_r_pr.o d2i_r_pu.o i2d_r_pu.o \
@@ -119,37 +119,43 @@ a_bitstr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
119a_bitstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 119a_bitstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
120a_bitstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 120a_bitstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
121a_bitstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 121a_bitstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
122a_bitstr.o: ../../include/openssl/opensslconf.h 122a_bitstr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
123a_bitstr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 123a_bitstr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
124a_bitstr.o: ../../include/openssl/stack.h ../cryptlib.h 124a_bitstr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
125a_bitstr.o: ../cryptlib.h
125a_bmp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 126a_bmp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
126a_bmp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 127a_bmp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
127a_bmp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 128a_bmp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
128a_bmp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 129a_bmp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
129a_bmp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 130a_bmp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
130a_bmp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 131a_bmp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
132a_bmp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
131a_bmp.o: ../cryptlib.h 133a_bmp.o: ../cryptlib.h
132a_bool.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 134a_bool.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
133a_bool.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 135a_bool.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
134a_bool.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 136a_bool.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
135a_bool.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 137a_bool.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
136a_bool.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 138a_bool.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
137a_bool.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 139a_bool.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
140a_bool.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
138a_bool.o: ../cryptlib.h 141a_bool.o: ../cryptlib.h
139a_bytes.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 142a_bytes.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
140a_bytes.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 143a_bytes.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
141a_bytes.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 144a_bytes.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
142a_bytes.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 145a_bytes.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
143a_bytes.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 146a_bytes.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
144a_bytes.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 147a_bytes.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
145a_bytes.o: ../../include/openssl/stack.h ../cryptlib.h 148a_bytes.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
149a_bytes.o: ../../include/openssl/symhacks.h ../cryptlib.h
146a_d2i_fp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 150a_d2i_fp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
147a_d2i_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 151a_d2i_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
148a_d2i_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 152a_d2i_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
149a_d2i_fp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 153a_d2i_fp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
150a_d2i_fp.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 154a_d2i_fp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
155a_d2i_fp.o: ../../include/openssl/opensslconf.h
151a_d2i_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 156a_d2i_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
152a_d2i_fp.o: ../../include/openssl/stack.h ../cryptlib.h 157a_d2i_fp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
158a_d2i_fp.o: ../cryptlib.h
153a_digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 159a_digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
154a_digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 160a_digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
155a_digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 161a_digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -157,107 +163,124 @@ a_digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
157a_digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 163a_digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
158a_digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 164a_digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
159a_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h 165a_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
160a_digest.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 166a_digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
167a_digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
161a_digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 168a_digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
162a_digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 169a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
170a_digest.o: ../../include/openssl/opensslconf.h
163a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 171a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
164a_digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 172a_digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
165a_digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 173a_digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
166a_digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 174a_digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
167a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 175a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
168a_digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 176a_digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
169a_digest.o: ../cryptlib.h 177a_digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
170a_dup.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 178a_dup.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
171a_dup.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 179a_dup.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
172a_dup.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 180a_dup.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
173a_dup.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 181a_dup.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
174a_dup.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 182a_dup.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
175a_dup.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 183a_dup.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
176a_dup.o: ../../include/openssl/stack.h ../cryptlib.h 184a_dup.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
185a_dup.o: ../../include/openssl/symhacks.h ../cryptlib.h
177a_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 186a_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
178a_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 187a_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
179a_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 188a_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
180a_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 189a_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
181a_enum.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 190a_enum.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
182a_enum.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 191a_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
192a_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
183a_enum.o: ../cryptlib.h 193a_enum.o: ../cryptlib.h
184a_gentm.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 194a_gentm.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
185a_gentm.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 195a_gentm.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
186a_gentm.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 196a_gentm.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
187a_gentm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 197a_gentm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
188a_gentm.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 198a_gentm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
189a_gentm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 199a_gentm.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
200a_gentm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
190a_gentm.o: ../cryptlib.h 201a_gentm.o: ../cryptlib.h
191a_hdr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 202a_hdr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
192a_hdr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 203a_hdr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
193a_hdr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 204a_hdr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
194a_hdr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 205a_hdr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
195a_hdr.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 206a_hdr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
196a_hdr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 207a_hdr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
197a_hdr.o: ../../include/openssl/stack.h ../cryptlib.h 208a_hdr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
209a_hdr.o: ../../include/openssl/symhacks.h ../cryptlib.h
198a_i2d_fp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 210a_i2d_fp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
199a_i2d_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 211a_i2d_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
200a_i2d_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 212a_i2d_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
201a_i2d_fp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 213a_i2d_fp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
202a_i2d_fp.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 214a_i2d_fp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
215a_i2d_fp.o: ../../include/openssl/opensslconf.h
203a_i2d_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 216a_i2d_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
204a_i2d_fp.o: ../../include/openssl/stack.h ../cryptlib.h 217a_i2d_fp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
218a_i2d_fp.o: ../cryptlib.h
205a_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 219a_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
206a_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 220a_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
207a_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 221a_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
208a_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 222a_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
209a_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 223a_int.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
210a_int.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 224a_int.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
225a_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
211a_int.o: ../cryptlib.h 226a_int.o: ../cryptlib.h
212a_mbstr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 227a_mbstr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
213a_mbstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 228a_mbstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
214a_mbstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 229a_mbstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
215a_mbstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 230a_mbstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
216a_mbstr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 231a_mbstr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
217a_mbstr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 232a_mbstr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
233a_mbstr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
218a_mbstr.o: ../cryptlib.h 234a_mbstr.o: ../cryptlib.h
219a_meth.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 235a_meth.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
220a_meth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 236a_meth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
221a_meth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 237a_meth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
222a_meth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 238a_meth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
223a_meth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 239a_meth.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
224a_meth.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 240a_meth.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
241a_meth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
225a_meth.o: ../cryptlib.h 242a_meth.o: ../cryptlib.h
226a_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 243a_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
227a_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 244a_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
228a_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 245a_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
229a_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 246a_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
230a_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 247a_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
231a_null.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 248a_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
249a_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
232a_null.o: ../cryptlib.h 250a_null.o: ../cryptlib.h
233a_object.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 251a_object.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
234a_object.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 252a_object.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
235a_object.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 253a_object.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
236a_object.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 254a_object.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
255a_object.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
237a_object.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 256a_object.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
238a_object.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 257a_object.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
239a_object.o: ../../include/openssl/stack.h ../cryptlib.h 258a_object.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
259a_object.o: ../cryptlib.h
240a_octet.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 260a_octet.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
241a_octet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 261a_octet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
242a_octet.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 262a_octet.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
243a_octet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 263a_octet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
244a_octet.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 264a_octet.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
245a_octet.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 265a_octet.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
266a_octet.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
246a_octet.o: ../cryptlib.h 267a_octet.o: ../cryptlib.h
247a_print.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 268a_print.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
248a_print.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 269a_print.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
249a_print.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 270a_print.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
250a_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 271a_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
251a_print.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 272a_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
252a_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 273a_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
274a_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
253a_print.o: ../cryptlib.h 275a_print.o: ../cryptlib.h
254a_set.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 276a_set.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
255a_set.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 277a_set.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
256a_set.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 278a_set.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
257a_set.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 279a_set.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
258a_set.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 280a_set.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
259a_set.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 281a_set.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
260a_set.o: ../../include/openssl/stack.h ../cryptlib.h 282a_set.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
283a_set.o: ../../include/openssl/symhacks.h ../cryptlib.h
261a_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 284a_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
262a_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 285a_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
263a_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 286a_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -265,50 +288,76 @@ a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
265a_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 288a_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
266a_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 289a_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
267a_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h 290a_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
268a_sign.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 291a_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
292a_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
269a_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 293a_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
270a_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 294a_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
271a_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 295a_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
272a_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 296a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
273a_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 297a_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
274a_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 298a_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
275a_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 299a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
300a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
276a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 301a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
277a_sign.o: ../cryptlib.h 302a_sign.o: ../cryptlib.h
303a_strex.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
304a_strex.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
305a_strex.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
306a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
307a_strex.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
308a_strex.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h
309a_strex.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
310a_strex.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
311a_strex.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
312a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
313a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
314a_strex.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
315a_strex.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
316a_strex.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
317a_strex.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
318a_strex.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
319a_strex.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
320a_strex.o: charmap.h
278a_strnid.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 321a_strnid.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
279a_strnid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 322a_strnid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
280a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 323a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
281a_strnid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 324a_strnid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
325a_strnid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
282a_strnid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 326a_strnid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
283a_strnid.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 327a_strnid.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
284a_strnid.o: ../../include/openssl/stack.h ../cryptlib.h 328a_strnid.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
329a_strnid.o: ../cryptlib.h
285a_time.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 330a_time.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
286a_time.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 331a_time.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
287a_time.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 332a_time.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
288a_time.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 333a_time.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
289a_time.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 334a_time.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
290a_time.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 335a_time.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
336a_time.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
291a_time.o: ../cryptlib.h 337a_time.o: ../cryptlib.h
292a_type.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 338a_type.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
293a_type.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 339a_type.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
294a_type.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 340a_type.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
295a_type.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 341a_type.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
296a_type.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 342a_type.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
297a_type.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 343a_type.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
298a_type.o: ../../include/openssl/stack.h ../cryptlib.h 344a_type.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
345a_type.o: ../../include/openssl/symhacks.h ../cryptlib.h
299a_utctm.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 346a_utctm.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
300a_utctm.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 347a_utctm.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
301a_utctm.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 348a_utctm.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
302a_utctm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 349a_utctm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
303a_utctm.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 350a_utctm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
304a_utctm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 351a_utctm.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
352a_utctm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
305a_utctm.o: ../cryptlib.h 353a_utctm.o: ../cryptlib.h
306a_utf8.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 354a_utf8.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
307a_utf8.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 355a_utf8.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
308a_utf8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 356a_utf8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
309a_utf8.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 357a_utf8.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
310a_utf8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 358a_utf8.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
311a_utf8.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 359a_utf8.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
360a_utf8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
312a_utf8.o: ../cryptlib.h 361a_utf8.o: ../cryptlib.h
313a_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 362a_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
314a_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 363a_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -317,64 +366,79 @@ a_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
317a_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 366a_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
318a_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 367a_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
319a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h 368a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
320a_verify.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 369a_verify.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
370a_verify.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
321a_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 371a_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
322a_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 372a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
373a_verify.o: ../../include/openssl/opensslconf.h
323a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 374a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
324a_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 375a_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
325a_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 376a_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
326a_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 377a_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
327a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 378a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
328a_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 379a_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
329a_verify.o: ../cryptlib.h 380a_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
330a_vis.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 381a_vis.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
331a_vis.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 382a_vis.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
332a_vis.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 383a_vis.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
333a_vis.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 384a_vis.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
334a_vis.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 385a_vis.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
335a_vis.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 386a_vis.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
387a_vis.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
336a_vis.o: ../cryptlib.h 388a_vis.o: ../cryptlib.h
337asn1_err.o: ../../include/openssl/asn1.h ../../include/openssl/bn.h 389asn1_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
338asn1_err.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 390asn1_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
339asn1_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 391asn1_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
392asn1_err.o: ../../include/openssl/opensslconf.h
393asn1_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
394asn1_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
340asn1_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 395asn1_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
341asn1_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 396asn1_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
342asn1_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 397asn1_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
343asn1_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 398asn1_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
344asn1_lib.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 399asn1_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
400asn1_lib.o: ../../include/openssl/opensslconf.h
345asn1_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 401asn1_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
346asn1_lib.o: ../../include/openssl/stack.h ../cryptlib.h 402asn1_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
403asn1_lib.o: ../cryptlib.h
347asn1_par.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 404asn1_par.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
348asn1_par.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 405asn1_par.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
349asn1_par.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 406asn1_par.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
350asn1_par.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 407asn1_par.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
408asn1_par.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
351asn1_par.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 409asn1_par.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
352asn1_par.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 410asn1_par.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
353asn1_par.o: ../../include/openssl/stack.h ../cryptlib.h 411asn1_par.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
412asn1_par.o: ../cryptlib.h
354asn_pack.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 413asn_pack.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
355asn_pack.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 414asn_pack.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
356asn_pack.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 415asn_pack.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
357asn_pack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 416asn_pack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
358asn_pack.o: ../../include/openssl/opensslconf.h 417asn_pack.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
359asn_pack.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 418asn_pack.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
360asn_pack.o: ../../include/openssl/stack.h ../cryptlib.h 419asn_pack.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
420asn_pack.o: ../cryptlib.h
361d2i_dhp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 421d2i_dhp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
362d2i_dhp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 422d2i_dhp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
363d2i_dhp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 423d2i_dhp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
364d2i_dhp.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h 424d2i_dhp.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
365d2i_dhp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 425d2i_dhp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
426d2i_dhp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
366d2i_dhp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 427d2i_dhp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
367d2i_dhp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 428d2i_dhp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
368d2i_dhp.o: ../../include/openssl/stack.h ../cryptlib.h 429d2i_dhp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
430d2i_dhp.o: ../cryptlib.h
369d2i_dsap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 431d2i_dsap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
370d2i_dsap.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 432d2i_dsap.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
371d2i_dsap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 433d2i_dsap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
372d2i_dsap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 434d2i_dsap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
373d2i_dsap.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 435d2i_dsap.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
374d2i_dsap.o: ../../include/openssl/err.h ../../include/openssl/objects.h 436d2i_dsap.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
437d2i_dsap.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
375d2i_dsap.o: ../../include/openssl/opensslconf.h 438d2i_dsap.o: ../../include/openssl/opensslconf.h
376d2i_dsap.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 439d2i_dsap.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
377d2i_dsap.o: ../../include/openssl/stack.h ../cryptlib.h 440d2i_dsap.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
441d2i_dsap.o: ../cryptlib.h
378d2i_pr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 442d2i_pr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
379d2i_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 443d2i_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
380d2i_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 444d2i_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -382,14 +446,16 @@ d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
382d2i_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 446d2i_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
383d2i_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 447d2i_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
384d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h 448d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
385d2i_pr.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 449d2i_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
450d2i_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
386d2i_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 451d2i_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
387d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 452d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
388d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 453d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
389d2i_pr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 454d2i_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
390d2i_pr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 455d2i_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
391d2i_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 456d2i_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
392d2i_pr.o: ../../include/openssl/stack.h ../cryptlib.h 457d2i_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
458d2i_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h
393d2i_pu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 459d2i_pu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
394d2i_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 460d2i_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
395d2i_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 461d2i_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -397,94 +463,110 @@ d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
397d2i_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 463d2i_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
398d2i_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 464d2i_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
399d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h 465d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
400d2i_pu.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 466d2i_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
467d2i_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
401d2i_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 468d2i_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
402d2i_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 469d2i_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
403d2i_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 470d2i_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
404d2i_pu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 471d2i_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
405d2i_pu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 472d2i_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
406d2i_pu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 473d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
407d2i_pu.o: ../../include/openssl/stack.h ../cryptlib.h 474d2i_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
475d2i_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h
408d2i_r_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 476d2i_r_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
409d2i_r_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 477d2i_r_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
410d2i_r_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 478d2i_r_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
411d2i_r_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 479d2i_r_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
412d2i_r_pr.o: ../../include/openssl/err.h ../../include/openssl/objects.h 480d2i_r_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
481d2i_r_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
413d2i_r_pr.o: ../../include/openssl/opensslconf.h 482d2i_r_pr.o: ../../include/openssl/opensslconf.h
414d2i_r_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 483d2i_r_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
415d2i_r_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 484d2i_r_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
416d2i_r_pr.o: ../cryptlib.h 485d2i_r_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h
417d2i_r_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 486d2i_r_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
418d2i_r_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 487d2i_r_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
419d2i_r_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 488d2i_r_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
420d2i_r_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 489d2i_r_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
421d2i_r_pu.o: ../../include/openssl/err.h ../../include/openssl/objects.h 490d2i_r_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
491d2i_r_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
422d2i_r_pu.o: ../../include/openssl/opensslconf.h 492d2i_r_pu.o: ../../include/openssl/opensslconf.h
423d2i_r_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 493d2i_r_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
424d2i_r_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 494d2i_r_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
425d2i_r_pu.o: ../cryptlib.h 495d2i_r_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h
426d2i_s_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 496d2i_s_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
427d2i_s_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 497d2i_s_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
428d2i_s_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 498d2i_s_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
429d2i_s_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 499d2i_s_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
430d2i_s_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 500d2i_s_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
431d2i_s_pr.o: ../../include/openssl/err.h ../../include/openssl/objects.h 501d2i_s_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
502d2i_s_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
432d2i_s_pr.o: ../../include/openssl/opensslconf.h 503d2i_s_pr.o: ../../include/openssl/opensslconf.h
433d2i_s_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 504d2i_s_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
434d2i_s_pr.o: ../../include/openssl/stack.h ../cryptlib.h 505d2i_s_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
506d2i_s_pr.o: ../cryptlib.h
435d2i_s_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 507d2i_s_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
436d2i_s_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 508d2i_s_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
437d2i_s_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 509d2i_s_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
438d2i_s_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 510d2i_s_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
439d2i_s_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 511d2i_s_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
440d2i_s_pu.o: ../../include/openssl/err.h ../../include/openssl/objects.h 512d2i_s_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
513d2i_s_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
441d2i_s_pu.o: ../../include/openssl/opensslconf.h 514d2i_s_pu.o: ../../include/openssl/opensslconf.h
442d2i_s_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 515d2i_s_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
443d2i_s_pu.o: ../../include/openssl/stack.h ../cryptlib.h 516d2i_s_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
517d2i_s_pu.o: ../cryptlib.h
444evp_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 518evp_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
445evp_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 519evp_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
446evp_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 520evp_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
447evp_asn1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 521evp_asn1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
448evp_asn1.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 522evp_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
523evp_asn1.o: ../../include/openssl/opensslconf.h
449evp_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 524evp_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
450evp_asn1.o: ../../include/openssl/stack.h ../cryptlib.h 525evp_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
526evp_asn1.o: ../cryptlib.h
451f_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 527f_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
452f_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 528f_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
453f_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 529f_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
454f_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 530f_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
455f_enum.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 531f_enum.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
456f_enum.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 532f_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
533f_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
457f_enum.o: ../cryptlib.h 534f_enum.o: ../cryptlib.h
458f_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 535f_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
459f_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 536f_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
460f_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 537f_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
461f_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 538f_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
462f_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 539f_int.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
463f_int.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 540f_int.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
541f_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
464f_int.o: ../cryptlib.h 542f_int.o: ../cryptlib.h
465f_string.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 543f_string.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
466f_string.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 544f_string.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
467f_string.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 545f_string.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
468f_string.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 546f_string.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
469f_string.o: ../../include/openssl/opensslconf.h 547f_string.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
470f_string.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 548f_string.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
471f_string.o: ../../include/openssl/stack.h ../cryptlib.h 549f_string.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
550f_string.o: ../cryptlib.h
472i2d_dhp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 551i2d_dhp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
473i2d_dhp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 552i2d_dhp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
474i2d_dhp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 553i2d_dhp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
475i2d_dhp.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h 554i2d_dhp.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
476i2d_dhp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 555i2d_dhp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
477i2d_dhp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 556i2d_dhp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
478i2d_dhp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 557i2d_dhp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
558i2d_dhp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
479i2d_dhp.o: ../cryptlib.h 559i2d_dhp.o: ../cryptlib.h
480i2d_dsap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 560i2d_dsap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
481i2d_dsap.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 561i2d_dsap.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
482i2d_dsap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 562i2d_dsap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
483i2d_dsap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 563i2d_dsap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
484i2d_dsap.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 564i2d_dsap.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
485i2d_dsap.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 565i2d_dsap.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
566i2d_dsap.o: ../../include/openssl/opensslconf.h
486i2d_dsap.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 567i2d_dsap.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
487i2d_dsap.o: ../../include/openssl/stack.h ../cryptlib.h 568i2d_dsap.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
569i2d_dsap.o: ../cryptlib.h
488i2d_pr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 570i2d_pr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
489i2d_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 571i2d_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
490i2d_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 572i2d_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -492,14 +574,16 @@ i2d_pr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
492i2d_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 574i2d_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
493i2d_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 575i2d_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
494i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h 576i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
495i2d_pr.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 577i2d_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
578i2d_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
496i2d_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 579i2d_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
497i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 580i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
498i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 581i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
499i2d_pr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 582i2d_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
500i2d_pr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 583i2d_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
501i2d_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 584i2d_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
502i2d_pr.o: ../../include/openssl/stack.h ../cryptlib.h 585i2d_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
586i2d_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h
503i2d_pu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 587i2d_pu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
504i2d_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 588i2d_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
505i2d_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 589i2d_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -507,50 +591,58 @@ i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
507i2d_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 591i2d_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
508i2d_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 592i2d_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
509i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h 593i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
510i2d_pu.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 594i2d_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
595i2d_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
511i2d_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 596i2d_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
512i2d_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 597i2d_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
513i2d_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 598i2d_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
514i2d_pu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 599i2d_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
515i2d_pu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 600i2d_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
516i2d_pu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 601i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
517i2d_pu.o: ../../include/openssl/stack.h ../cryptlib.h 602i2d_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
603i2d_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h
518i2d_r_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 604i2d_r_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
519i2d_r_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 605i2d_r_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
520i2d_r_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 606i2d_r_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
521i2d_r_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 607i2d_r_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
522i2d_r_pr.o: ../../include/openssl/err.h ../../include/openssl/objects.h 608i2d_r_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
609i2d_r_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
523i2d_r_pr.o: ../../include/openssl/opensslconf.h 610i2d_r_pr.o: ../../include/openssl/opensslconf.h
524i2d_r_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 611i2d_r_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
525i2d_r_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 612i2d_r_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
526i2d_r_pr.o: ../cryptlib.h 613i2d_r_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h
527i2d_r_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 614i2d_r_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
528i2d_r_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 615i2d_r_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
529i2d_r_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 616i2d_r_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
530i2d_r_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 617i2d_r_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
531i2d_r_pu.o: ../../include/openssl/err.h ../../include/openssl/objects.h 618i2d_r_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
619i2d_r_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
532i2d_r_pu.o: ../../include/openssl/opensslconf.h 620i2d_r_pu.o: ../../include/openssl/opensslconf.h
533i2d_r_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 621i2d_r_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
534i2d_r_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 622i2d_r_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
535i2d_r_pu.o: ../cryptlib.h 623i2d_r_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h
536i2d_s_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 624i2d_s_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
537i2d_s_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 625i2d_s_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
538i2d_s_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 626i2d_s_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
539i2d_s_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 627i2d_s_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
540i2d_s_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 628i2d_s_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
541i2d_s_pr.o: ../../include/openssl/err.h ../../include/openssl/objects.h 629i2d_s_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
630i2d_s_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
542i2d_s_pr.o: ../../include/openssl/opensslconf.h 631i2d_s_pr.o: ../../include/openssl/opensslconf.h
543i2d_s_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 632i2d_s_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
544i2d_s_pr.o: ../../include/openssl/stack.h ../cryptlib.h 633i2d_s_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
634i2d_s_pr.o: ../cryptlib.h
545i2d_s_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 635i2d_s_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
546i2d_s_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 636i2d_s_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
547i2d_s_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 637i2d_s_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
548i2d_s_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 638i2d_s_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
549i2d_s_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 639i2d_s_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
550i2d_s_pu.o: ../../include/openssl/err.h ../../include/openssl/objects.h 640i2d_s_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
641i2d_s_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
551i2d_s_pu.o: ../../include/openssl/opensslconf.h 642i2d_s_pu.o: ../../include/openssl/opensslconf.h
552i2d_s_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 643i2d_s_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
553i2d_s_pu.o: ../../include/openssl/stack.h ../cryptlib.h 644i2d_s_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
645i2d_s_pu.o: ../cryptlib.h
554n_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 646n_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
555n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 647n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
556n_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 648n_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -559,31 +651,35 @@ n_pkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h
559n_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 651n_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
560n_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 652n_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
561n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 653n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
562n_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 654n_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
563n_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 655n_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
564n_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 656n_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
565n_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 657n_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
566n_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 658n_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
567n_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 659n_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
568n_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 660n_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
569n_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 661n_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
662n_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
663n_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
570n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 664n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
571nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 665nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
572nsseq.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 666nsseq.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
573nsseq.o: ../../include/openssl/bn.h ../../include/openssl/cast.h 667nsseq.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
574nsseq.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 668nsseq.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
575nsseq.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 669nsseq.o: ../../include/openssl/des.h ../../include/openssl/dh.h
576nsseq.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 670nsseq.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
577nsseq.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 671nsseq.o: ../../include/openssl/err.h ../../include/openssl/evp.h
578nsseq.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 672nsseq.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
579nsseq.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 673nsseq.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
674nsseq.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
675nsseq.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
580nsseq.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 676nsseq.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
581nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 677nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
582nsseq.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 678nsseq.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
583nsseq.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 679nsseq.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
584nsseq.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 680nsseq.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
585nsseq.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 681nsseq.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
586nsseq.o: ../../include/openssl/x509_vfy.h 682nsseq.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
587p5_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 683p5_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
588p5_pbe.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 684p5_pbe.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
589p5_pbe.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 685p5_pbe.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -592,14 +688,16 @@ p5_pbe.o: ../../include/openssl/des.h ../../include/openssl/dh.h
592p5_pbe.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 688p5_pbe.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
593p5_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 689p5_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
594p5_pbe.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 690p5_pbe.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
595p5_pbe.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 691p5_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
596p5_pbe.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 692p5_pbe.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
597p5_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 693p5_pbe.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
598p5_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h 694p5_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
599p5_pbe.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 695p5_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
600p5_pbe.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 696p5_pbe.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
601p5_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 697p5_pbe.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
602p5_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 698p5_pbe.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
699p5_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
700p5_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
603p5_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 701p5_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
604p5_pbe.o: ../cryptlib.h 702p5_pbe.o: ../cryptlib.h
605p5_pbev2.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 703p5_pbev2.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -610,16 +708,18 @@ p5_pbev2.o: ../../include/openssl/des.h ../../include/openssl/dh.h
610p5_pbev2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 708p5_pbev2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
611p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 709p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
612p5_pbev2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 710p5_pbev2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
613p5_pbev2.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 711p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
614p5_pbev2.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 712p5_pbev2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
615p5_pbev2.o: ../../include/openssl/opensslconf.h 713p5_pbev2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
714p5_pbev2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
616p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 715p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
617p5_pbev2.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 716p5_pbev2.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
618p5_pbev2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 717p5_pbev2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
619p5_pbev2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 718p5_pbev2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
620p5_pbev2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 719p5_pbev2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
621p5_pbev2.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 720p5_pbev2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
622p5_pbev2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 721p5_pbev2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
722p5_pbev2.o: ../cryptlib.h
623p7_dgst.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 723p7_dgst.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
624p7_dgst.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 724p7_dgst.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
625p7_dgst.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 725p7_dgst.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -628,14 +728,16 @@ p7_dgst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
628p7_dgst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 728p7_dgst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
629p7_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 729p7_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
630p7_dgst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 730p7_dgst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
631p7_dgst.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 731p7_dgst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
632p7_dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 732p7_dgst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
633p7_dgst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 733p7_dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
634p7_dgst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 734p7_dgst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
635p7_dgst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 735p7_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
636p7_dgst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 736p7_dgst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
637p7_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 737p7_dgst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
638p7_dgst.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 738p7_dgst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
739p7_dgst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
740p7_dgst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
639p7_dgst.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 741p7_dgst.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
640p7_enc.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 742p7_enc.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
641p7_enc.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 743p7_enc.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -645,14 +747,16 @@ p7_enc.o: ../../include/openssl/des.h ../../include/openssl/dh.h
645p7_enc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 747p7_enc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
646p7_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 748p7_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
647p7_enc.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 749p7_enc.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
648p7_enc.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 750p7_enc.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
649p7_enc.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 751p7_enc.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
650p7_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 752p7_enc.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
651p7_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 753p7_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
652p7_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 754p7_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
653p7_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 755p7_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
654p7_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 756p7_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
655p7_enc.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 757p7_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
758p7_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
759p7_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
656p7_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 760p7_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
657p7_enc_c.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 761p7_enc_c.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
658p7_enc_c.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 762p7_enc_c.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -662,16 +766,17 @@ p7_enc_c.o: ../../include/openssl/des.h ../../include/openssl/dh.h
662p7_enc_c.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 766p7_enc_c.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
663p7_enc_c.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 767p7_enc_c.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
664p7_enc_c.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 768p7_enc_c.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
665p7_enc_c.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 769p7_enc_c.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
666p7_enc_c.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 770p7_enc_c.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
667p7_enc_c.o: ../../include/openssl/opensslconf.h 771p7_enc_c.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
772p7_enc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
668p7_enc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 773p7_enc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
669p7_enc_c.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 774p7_enc_c.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
670p7_enc_c.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 775p7_enc_c.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
671p7_enc_c.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 776p7_enc_c.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
672p7_enc_c.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 777p7_enc_c.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
673p7_enc_c.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 778p7_enc_c.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
674p7_enc_c.o: ../cryptlib.h 779p7_enc_c.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
675p7_evp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 780p7_evp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
676p7_evp.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 781p7_evp.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
677p7_evp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 782p7_evp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -680,14 +785,16 @@ p7_evp.o: ../../include/openssl/des.h ../../include/openssl/dh.h
680p7_evp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 785p7_evp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
681p7_evp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 786p7_evp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
682p7_evp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 787p7_evp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
683p7_evp.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 788p7_evp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
684p7_evp.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 789p7_evp.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
685p7_evp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 790p7_evp.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
686p7_evp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 791p7_evp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
687p7_evp.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 792p7_evp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
688p7_evp.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 793p7_evp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
689p7_evp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 794p7_evp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
690p7_evp.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 795p7_evp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
796p7_evp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
797p7_evp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
691p7_evp.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 798p7_evp.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
692p7_i_s.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 799p7_i_s.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
693p7_i_s.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 800p7_i_s.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -697,14 +804,16 @@ p7_i_s.o: ../../include/openssl/des.h ../../include/openssl/dh.h
697p7_i_s.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 804p7_i_s.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
698p7_i_s.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 805p7_i_s.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
699p7_i_s.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 806p7_i_s.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
700p7_i_s.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 807p7_i_s.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
701p7_i_s.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 808p7_i_s.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
702p7_i_s.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 809p7_i_s.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
703p7_i_s.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 810p7_i_s.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
704p7_i_s.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 811p7_i_s.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
705p7_i_s.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 812p7_i_s.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
706p7_i_s.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 813p7_i_s.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
707p7_i_s.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 814p7_i_s.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
815p7_i_s.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
816p7_i_s.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
708p7_i_s.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 817p7_i_s.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
709p7_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 818p7_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
710p7_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 819p7_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -714,14 +823,16 @@ p7_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
714p7_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 823p7_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
715p7_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 824p7_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
716p7_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 825p7_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
717p7_lib.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 826p7_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
718p7_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 827p7_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
719p7_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 828p7_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
720p7_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 829p7_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
721p7_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 830p7_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
722p7_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 831p7_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
723p7_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 832p7_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
724p7_lib.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 833p7_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
834p7_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
835p7_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
725p7_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 836p7_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
726p7_recip.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 837p7_recip.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
727p7_recip.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 838p7_recip.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -731,16 +842,17 @@ p7_recip.o: ../../include/openssl/des.h ../../include/openssl/dh.h
731p7_recip.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 842p7_recip.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
732p7_recip.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 843p7_recip.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
733p7_recip.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 844p7_recip.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
734p7_recip.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 845p7_recip.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
735p7_recip.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 846p7_recip.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
736p7_recip.o: ../../include/openssl/opensslconf.h 847p7_recip.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
848p7_recip.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
737p7_recip.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 849p7_recip.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
738p7_recip.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 850p7_recip.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
739p7_recip.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 851p7_recip.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
740p7_recip.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 852p7_recip.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
741p7_recip.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 853p7_recip.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
742p7_recip.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 854p7_recip.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
743p7_recip.o: ../cryptlib.h 855p7_recip.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
744p7_s_e.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 856p7_s_e.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
745p7_s_e.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 857p7_s_e.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
746p7_s_e.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 858p7_s_e.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -749,14 +861,16 @@ p7_s_e.o: ../../include/openssl/des.h ../../include/openssl/dh.h
749p7_s_e.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 861p7_s_e.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
750p7_s_e.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 862p7_s_e.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
751p7_s_e.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 863p7_s_e.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
752p7_s_e.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 864p7_s_e.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
753p7_s_e.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 865p7_s_e.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
754p7_s_e.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 866p7_s_e.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
755p7_s_e.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 867p7_s_e.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
756p7_s_e.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 868p7_s_e.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
757p7_s_e.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 869p7_s_e.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
758p7_s_e.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 870p7_s_e.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
759p7_s_e.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 871p7_s_e.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
872p7_s_e.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
873p7_s_e.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
760p7_s_e.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 874p7_s_e.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
761p7_signd.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 875p7_signd.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
762p7_signd.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 876p7_signd.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -766,16 +880,17 @@ p7_signd.o: ../../include/openssl/des.h ../../include/openssl/dh.h
766p7_signd.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 880p7_signd.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
767p7_signd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 881p7_signd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
768p7_signd.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 882p7_signd.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
769p7_signd.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 883p7_signd.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
770p7_signd.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 884p7_signd.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
771p7_signd.o: ../../include/openssl/opensslconf.h 885p7_signd.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
886p7_signd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
772p7_signd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 887p7_signd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
773p7_signd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 888p7_signd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
774p7_signd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 889p7_signd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
775p7_signd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 890p7_signd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
776p7_signd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 891p7_signd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
777p7_signd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 892p7_signd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
778p7_signd.o: ../cryptlib.h 893p7_signd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
779p7_signi.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 894p7_signi.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
780p7_signi.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 895p7_signi.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
781p7_signi.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 896p7_signi.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -784,16 +899,17 @@ p7_signi.o: ../../include/openssl/des.h ../../include/openssl/dh.h
784p7_signi.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 899p7_signi.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
785p7_signi.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 900p7_signi.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
786p7_signi.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 901p7_signi.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
787p7_signi.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 902p7_signi.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
788p7_signi.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 903p7_signi.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
789p7_signi.o: ../../include/openssl/opensslconf.h 904p7_signi.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
905p7_signi.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
790p7_signi.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 906p7_signi.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
791p7_signi.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 907p7_signi.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
792p7_signi.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 908p7_signi.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
793p7_signi.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 909p7_signi.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
794p7_signi.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 910p7_signi.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
795p7_signi.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 911p7_signi.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
796p7_signi.o: ../cryptlib.h 912p7_signi.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
797p8_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 913p8_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
798p8_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 914p8_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
799p8_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 915p8_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -802,14 +918,16 @@ p8_pkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h
802p8_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 918p8_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
803p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 919p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
804p8_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 920p8_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
805p8_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 921p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
806p8_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 922p8_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
807p8_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 923p8_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
808p8_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 924p8_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
809p8_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 925p8_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
810p8_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 926p8_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
811p8_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 927p8_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
812p8_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 928p8_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
929p8_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
930p8_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
813p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 931p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
814t_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 932t_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
815t_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 933t_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -817,16 +935,18 @@ t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
817t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 935t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
818t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h 936t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
819t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 937t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
820t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 938t_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
821t_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 939t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
822t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 940t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
941t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
823t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 942t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
824t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 943t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
825t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 944t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
826t_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 945t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
827t_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 946t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
828t_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 947t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
829t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 948t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
949t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
830t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 950t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
831t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h 951t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h
832t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 952t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -835,25 +955,28 @@ t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
835t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 955t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
836t_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h 956t_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h
837t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 957t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
838t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 958t_crl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
839t_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 959t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
840t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 960t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
961t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
841t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 962t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
842t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 963t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
843t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 964t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
844t_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 965t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
845t_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 966t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
846t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 967t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
847t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 968t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
969t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
848t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 970t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
849t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h 971t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h
850t_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 972t_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
851t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 973t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
852t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 974t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
853t_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 975t_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
854t_pkey.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 976t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
855t_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 977t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
856t_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 978t_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
979t_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
857t_pkey.o: ../cryptlib.h 980t_pkey.o: ../cryptlib.h
858t_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 981t_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
859t_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 982t_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -861,16 +984,18 @@ t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
861t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 984t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
862t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h 985t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h
863t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 986t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
864t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 987t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
865t_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 988t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
866t_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 989t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
990t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
867t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 991t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
868t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 992t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
869t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 993t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
870t_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 994t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
871t_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 995t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
872t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 996t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
873t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 997t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
998t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
874t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 999t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
875t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h 1000t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h
876t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1001t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -881,14 +1006,16 @@ t_spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h
881t_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1006t_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
882t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1007t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
883t_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1008t_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
884t_spki.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1009t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
885t_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1010t_spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
886t_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1011t_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
887t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1012t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
888t_spki.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1013t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
889t_spki.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1014t_spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
890t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1015t_spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
891t_spki.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1016t_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1017t_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1018t_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
892t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1019t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
893t_x509.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 1020t_x509.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
894t_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 1021t_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -896,16 +1023,18 @@ t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
896t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 1023t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
897t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h 1024t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h
898t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1025t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
899t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1026t_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
900t_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1027t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h
901t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 1028t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
1029t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
902t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 1030t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
903t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 1031t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
904t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 1032t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
905t_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 1033t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
906t_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 1034t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
907t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 1035t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
908t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 1036t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
1037t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
909t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 1038t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
910t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h 1039t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h
911t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1040t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -916,14 +1045,16 @@ t_x509a.o: ../../include/openssl/des.h ../../include/openssl/dh.h
916t_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1045t_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
917t_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1046t_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
918t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1047t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
919t_x509a.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1048t_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
920t_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1049t_x509a.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
921t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1050t_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
922t_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1051t_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
923t_x509a.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1052t_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
924t_x509a.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1053t_x509a.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
925t_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1054t_x509a.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
926t_x509a.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1055t_x509a.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1056t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1057t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
927t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1058t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
928x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1059x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
929x_algor.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1060x_algor.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -933,14 +1064,16 @@ x_algor.o: ../../include/openssl/des.h ../../include/openssl/dh.h
933x_algor.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1064x_algor.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
934x_algor.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1065x_algor.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
935x_algor.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1066x_algor.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
936x_algor.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1067x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
937x_algor.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1068x_algor.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
938x_algor.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1069x_algor.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
939x_algor.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1070x_algor.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
940x_algor.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1071x_algor.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
941x_algor.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1072x_algor.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
942x_algor.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1073x_algor.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
943x_algor.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1074x_algor.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1075x_algor.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1076x_algor.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
944x_algor.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1077x_algor.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
945x_attrib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1078x_attrib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
946x_attrib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1079x_attrib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -950,16 +1083,17 @@ x_attrib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
950x_attrib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1083x_attrib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
951x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1084x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
952x_attrib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1085x_attrib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
953x_attrib.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1086x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
954x_attrib.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1087x_attrib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
955x_attrib.o: ../../include/openssl/opensslconf.h 1088x_attrib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1089x_attrib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
956x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 1090x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
957x_attrib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 1091x_attrib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
958x_attrib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 1092x_attrib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
959x_attrib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 1093x_attrib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
960x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 1094x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
961x_attrib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 1095x_attrib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
962x_attrib.o: ../cryptlib.h 1096x_attrib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
963x_cinf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1097x_cinf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
964x_cinf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1098x_cinf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
965x_cinf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 1099x_cinf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -968,14 +1102,16 @@ x_cinf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
968x_cinf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1102x_cinf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
969x_cinf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1103x_cinf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
970x_cinf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1104x_cinf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
971x_cinf.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1105x_cinf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
972x_cinf.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1106x_cinf.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
973x_cinf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1107x_cinf.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
974x_cinf.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1108x_cinf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
975x_cinf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1109x_cinf.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
976x_cinf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1110x_cinf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
977x_cinf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1111x_cinf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
978x_cinf.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1112x_cinf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1113x_cinf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1114x_cinf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
979x_cinf.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1115x_cinf.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
980x_crl.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1116x_crl.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
981x_crl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1117x_crl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -985,14 +1121,16 @@ x_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h
985x_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1121x_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
986x_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1122x_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
987x_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1123x_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
988x_crl.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1124x_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
989x_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1125x_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
990x_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1126x_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
991x_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1127x_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
992x_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1128x_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
993x_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1129x_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
994x_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1130x_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
995x_crl.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1131x_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1132x_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1133x_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
996x_crl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1134x_crl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
997x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1135x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
998x_exten.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1136x_exten.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1002,14 +1140,16 @@ x_exten.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1002x_exten.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1140x_exten.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1003x_exten.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1141x_exten.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1004x_exten.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1142x_exten.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1005x_exten.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1143x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1006x_exten.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1144x_exten.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1007x_exten.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1145x_exten.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1008x_exten.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1146x_exten.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1009x_exten.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1147x_exten.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1010x_exten.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1148x_exten.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1011x_exten.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1149x_exten.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1012x_exten.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1150x_exten.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1151x_exten.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1152x_exten.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1013x_exten.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1153x_exten.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1014x_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1154x_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1015x_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1155x_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1019,14 +1159,16 @@ x_info.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1019x_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1159x_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1020x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1160x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1021x_info.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1161x_info.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1022x_info.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1162x_info.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1023x_info.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1163x_info.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1024x_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1164x_info.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1025x_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1165x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1026x_info.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1166x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1027x_info.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1167x_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1028x_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1168x_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1029x_info.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1169x_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1170x_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1171x_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1030x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1172x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1031x_name.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1173x_name.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1032x_name.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1174x_name.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1036,14 +1178,16 @@ x_name.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1036x_name.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1178x_name.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1037x_name.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1179x_name.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1038x_name.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1180x_name.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1039x_name.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1181x_name.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1040x_name.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1182x_name.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1041x_name.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1183x_name.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1042x_name.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1184x_name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1043x_name.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1185x_name.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1044x_name.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1186x_name.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1045x_name.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1187x_name.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1046x_name.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1188x_name.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1189x_name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1190x_name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1047x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1191x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1048x_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1192x_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1049x_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1193x_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1053,14 +1197,16 @@ x_pkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1053x_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1197x_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1054x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1198x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1055x_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1199x_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1056x_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1200x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1057x_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1201x_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1058x_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1202x_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1059x_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1203x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1060x_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1204x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1061x_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1205x_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1062x_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1206x_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1063x_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1207x_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1208x_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1209x_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1064x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1210x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1065x_pubkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1211x_pubkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1066x_pubkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1212x_pubkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1070,16 +1216,17 @@ x_pubkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1070x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1216x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1071x_pubkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1217x_pubkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1072x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1218x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1073x_pubkey.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1219x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1074x_pubkey.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1220x_pubkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1075x_pubkey.o: ../../include/openssl/opensslconf.h 1221x_pubkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1222x_pubkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1076x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 1223x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1077x_pubkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 1224x_pubkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1078x_pubkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 1225x_pubkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1079x_pubkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 1226x_pubkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1080x_pubkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 1227x_pubkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1081x_pubkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 1228x_pubkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1082x_pubkey.o: ../cryptlib.h 1229x_pubkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1083x_req.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1230x_req.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1084x_req.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1231x_req.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
1085x_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 1232x_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -1088,14 +1235,16 @@ x_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1088x_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1235x_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1089x_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1236x_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1090x_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1237x_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1091x_req.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1238x_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1092x_req.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1239x_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1093x_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1240x_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1094x_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1241x_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1095x_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1242x_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1096x_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1243x_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1097x_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1244x_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1098x_req.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1245x_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1246x_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1247x_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1099x_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1248x_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1100x_sig.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1249x_sig.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1101x_sig.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1250x_sig.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1105,14 +1254,16 @@ x_sig.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1105x_sig.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1254x_sig.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1106x_sig.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1255x_sig.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1107x_sig.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1256x_sig.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1108x_sig.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1257x_sig.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1109x_sig.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1258x_sig.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1110x_sig.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1259x_sig.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1111x_sig.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1260x_sig.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1112x_sig.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1261x_sig.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1113x_sig.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1262x_sig.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1114x_sig.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1263x_sig.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1115x_sig.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1264x_sig.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1265x_sig.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1266x_sig.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1116x_sig.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1267x_sig.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1117x_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1268x_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1118x_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1269x_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1122,14 +1273,16 @@ x_spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1122x_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1273x_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1123x_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1274x_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1124x_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1275x_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1125x_spki.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1276x_spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1126x_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1277x_spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1127x_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1278x_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1128x_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1279x_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1129x_spki.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1280x_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1130x_spki.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1281x_spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1131x_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1282x_spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1132x_spki.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1283x_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1284x_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1285x_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1133x_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1286x_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1134x_val.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1287x_val.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1135x_val.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1288x_val.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1139,32 +1292,38 @@ x_val.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1139x_val.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1292x_val.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1140x_val.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1293x_val.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1141x_val.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1294x_val.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1142x_val.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1295x_val.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1143x_val.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1296x_val.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1144x_val.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1297x_val.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1145x_val.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1298x_val.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1146x_val.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1299x_val.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1147x_val.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1300x_val.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1148x_val.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1301x_val.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1149x_val.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1302x_val.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1303x_val.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1304x_val.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1150x_val.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1305x_val.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1151x_x509.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1306x_x509.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1152x_x509.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1307x_x509.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
1153x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 1308x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
1154x_x509.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 1309x_x509.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
1155x_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h 1310x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1156x_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1311x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1312x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
1157x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1313x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1158x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1314x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1159x_x509.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1315x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1160x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1316x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1161x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1317x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1162x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1318x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1163x_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1319x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1164x_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1320x_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1165x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1321x_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1166x_x509.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1322x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1167x_x509.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1323x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1324x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1325x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
1326x_x509.o: ../cryptlib.h
1168x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 1327x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1169x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 1328x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
1170x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 1329x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -1173,12 +1332,14 @@ x_x509a.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1173x_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 1332x_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1174x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 1333x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1175x_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 1334x_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1176x_x509a.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 1335x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1177x_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 1336x_x509a.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1178x_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 1337x_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1179x_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 1338x_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1180x_x509a.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 1339x_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1181x_x509a.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 1340x_x509a.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1182x_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 1341x_x509a.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1183x_x509a.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 1342x_x509a.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1343x_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1344x_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1184x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 1345x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c
index c77456b315..7013a407ad 100644
--- a/src/lib/libcrypto/asn1/a_bitstr.c
+++ b/src/lib/libcrypto/asn1/a_bitstr.c
@@ -70,13 +70,27 @@ int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
70{ return M_ASN1_BIT_STRING_set(x, d, len); } 70{ return M_ASN1_BIT_STRING_set(x, d, len); }
71 71
72int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) 72int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
73{
74 int len, ret;
75 len = i2c_ASN1_BIT_STRING(a, NULL);
76 ret=ASN1_object_size(0,len,V_ASN1_BIT_STRING);
77 if(pp) {
78 ASN1_put_object(pp,0,len,V_ASN1_BIT_STRING,V_ASN1_UNIVERSAL);
79 i2c_ASN1_BIT_STRING(a, pp);
80 }
81 return ret;
82}
83
84int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
73 { 85 {
74 int ret,j,r,bits,len; 86 int ret,j,bits,len;
75 unsigned char *p,*d; 87 unsigned char *p,*d;
76 88
77 if (a == NULL) return(0); 89 if (a == NULL) return(0);
78 90
79 len=a->length; 91 len=a->length;
92 ret=1+len;
93 if (pp == NULL) return(ret);
80 94
81 if (len > 0) 95 if (len > 0)
82 { 96 {
@@ -104,36 +118,27 @@ int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
104 } 118 }
105 else 119 else
106 bits=0; 120 bits=0;
107 ret=1+len;
108 r=ASN1_object_size(0,ret,V_ASN1_BIT_STRING);
109 if (pp == NULL) return(r);
110 p= *pp; 121 p= *pp;
111 122
112 ASN1_put_object(&p,0,ret,V_ASN1_BIT_STRING,V_ASN1_UNIVERSAL);
113 *(p++)=(unsigned char)bits; 123 *(p++)=(unsigned char)bits;
114 d=a->data; 124 d=a->data;
115 memcpy(p,d,len); 125 memcpy(p,d,len);
116 p+=len; 126 p+=len;
117 if (len > 0) p[-1]&=(0xff<<bits); 127 if (len > 0) p[-1]&=(0xff<<bits);
118 *pp=p; 128 *pp=p;
119 return(r); 129 return(ret);
120 } 130 }
121 131
132
133/* Convert DER encoded ASN1 BIT_STRING to ASN1_BIT_STRING structure */
122ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, 134ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
123 long length) 135 long length)
124 { 136{
125 ASN1_BIT_STRING *ret=NULL; 137 unsigned char *p;
126 unsigned char *p,*s;
127 long len; 138 long len;
128 int inf,tag,xclass;
129 int i; 139 int i;
130 140 int inf,tag,xclass;
131 if ((a == NULL) || ((*a) == NULL)) 141 ASN1_BIT_STRING *ret;
132 {
133 if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL);
134 }
135 else
136 ret=(*a);
137 142
138 p= *pp; 143 p= *pp;
139 inf=ASN1_get_object(&p,&len,&tag,&xclass,length); 144 inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
@@ -149,7 +154,30 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
149 goto err; 154 goto err;
150 } 155 }
151 if (len < 1) { i=ASN1_R_STRING_TOO_SHORT; goto err; } 156 if (len < 1) { i=ASN1_R_STRING_TOO_SHORT; goto err; }
157 ret = c2i_ASN1_BIT_STRING(a, &p, len);
158 if(ret) *pp = p;
159 return ret;
160err:
161 ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i);
162 return(NULL);
163
164}
165
166ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
167 long len)
168 {
169 ASN1_BIT_STRING *ret=NULL;
170 unsigned char *p,*s;
171 int i;
172
173 if ((a == NULL) || ((*a) == NULL))
174 {
175 if ((ret=M_ASN1_BIT_STRING_new()) == NULL) return(NULL);
176 }
177 else
178 ret=(*a);
152 179
180 p= *pp;
153 i= *(p++); 181 i= *(p++);
154 /* We do this to preserve the settings. If we modify 182 /* We do this to preserve the settings. If we modify
155 * the settings, via the _set_bit function, we will recalculate 183 * the settings, via the _set_bit function, we will recalculate
@@ -159,7 +187,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
159 187
160 if (len-- > 1) /* using one because of the bits left byte */ 188 if (len-- > 1) /* using one because of the bits left byte */
161 { 189 {
162 s=(unsigned char *)Malloc((int)len); 190 s=(unsigned char *)OPENSSL_malloc((int)len);
163 if (s == NULL) 191 if (s == NULL)
164 { 192 {
165 i=ERR_R_MALLOC_FAILURE; 193 i=ERR_R_MALLOC_FAILURE;
@@ -173,7 +201,7 @@ ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
173 s=NULL; 201 s=NULL;
174 202
175 ret->length=(int)len; 203 ret->length=(int)len;
176 if (ret->data != NULL) Free(ret->data); 204 if (ret->data != NULL) OPENSSL_free(ret->data);
177 ret->data=s; 205 ret->data=s;
178 ret->type=V_ASN1_BIT_STRING; 206 ret->type=V_ASN1_BIT_STRING;
179 if (a != NULL) (*a)=ret; 207 if (a != NULL) (*a)=ret;
@@ -204,14 +232,14 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
204 { 232 {
205 if (!value) return(1); /* Don't need to set */ 233 if (!value) return(1); /* Don't need to set */
206 if (a->data == NULL) 234 if (a->data == NULL)
207 c=(unsigned char *)Malloc(w+1); 235 c=(unsigned char *)OPENSSL_malloc(w+1);
208 else 236 else
209 c=(unsigned char *)Realloc(a->data,w+1); 237 c=(unsigned char *)OPENSSL_realloc(a->data,w+1);
210 if (c == NULL) return(0); 238 if (c == NULL) return(0);
239 if (w+1-a->length > 0) memset(c+a->length, 0, w+1-a->length);
211 a->data=c; 240 a->data=c;
212 a->length=w+1; 241 a->length=w+1;
213 c[w]=0; 242 }
214 }
215 a->data[w]=((a->data[w])&iv)|v; 243 a->data[w]=((a->data[w])&iv)|v;
216 while ((a->length > 0) && (a->data[a->length-1] == 0)) 244 while ((a->length > 0) && (a->data[a->length-1] == 0))
217 a->length--; 245 a->length--;
diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c
index 8cde695804..3a0c0c7835 100644
--- a/src/lib/libcrypto/asn1/a_bytes.c
+++ b/src/lib/libcrypto/asn1/a_bytes.c
@@ -111,7 +111,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
111 111
112 if (len != 0) 112 if (len != 0)
113 { 113 {
114 s=(unsigned char *)Malloc((int)len+1); 114 s=(unsigned char *)OPENSSL_malloc((int)len+1);
115 if (s == NULL) 115 if (s == NULL)
116 { 116 {
117 i=ERR_R_MALLOC_FAILURE; 117 i=ERR_R_MALLOC_FAILURE;
@@ -124,7 +124,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp,
124 else 124 else
125 s=NULL; 125 s=NULL;
126 126
127 if (ret->data != NULL) Free(ret->data); 127 if (ret->data != NULL) OPENSSL_free(ret->data);
128 ret->length=(int)len; 128 ret->length=(int)len;
129 ret->data=s; 129 ret->data=s;
130 ret->type=tag; 130 ret->type=tag;
@@ -218,8 +218,8 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
218 { 218 {
219 if ((ret->length < len) || (ret->data == NULL)) 219 if ((ret->length < len) || (ret->data == NULL))
220 { 220 {
221 if (ret->data != NULL) Free(ret->data); 221 if (ret->data != NULL) OPENSSL_free(ret->data);
222 s=(unsigned char *)Malloc((int)len + 1); 222 s=(unsigned char *)OPENSSL_malloc((int)len + 1);
223 if (s == NULL) 223 if (s == NULL)
224 { 224 {
225 i=ERR_R_MALLOC_FAILURE; 225 i=ERR_R_MALLOC_FAILURE;
@@ -235,7 +235,7 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, long length,
235 else 235 else
236 { 236 {
237 s=NULL; 237 s=NULL;
238 if (ret->data != NULL) Free(ret->data); 238 if (ret->data != NULL) OPENSSL_free(ret->data);
239 } 239 }
240 240
241 ret->length=(int)len; 241 ret->length=(int)len;
@@ -310,14 +310,14 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c)
310 if (!asn1_Finish(c)) goto err; 310 if (!asn1_Finish(c)) goto err;
311 311
312 a->length=num; 312 a->length=num;
313 if (a->data != NULL) Free(a->data); 313 if (a->data != NULL) OPENSSL_free(a->data);
314 a->data=(unsigned char *)b.data; 314 a->data=(unsigned char *)b.data;
315 if (os != NULL) ASN1_STRING_free(os); 315 if (os != NULL) ASN1_STRING_free(os);
316 return(1); 316 return(1);
317err: 317err:
318 ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE,c->error); 318 ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE,c->error);
319 if (os != NULL) ASN1_STRING_free(os); 319 if (os != NULL) ASN1_STRING_free(os);
320 if (b.data != NULL) Free(b.data); 320 if (b.data != NULL) OPENSSL_free(b.data);
321 return(0); 321 return(0);
322 } 322 }
323 323
diff --git a/src/lib/libcrypto/asn1/a_digest.c b/src/lib/libcrypto/asn1/a_digest.c
index 3370aae998..8257b8639e 100644
--- a/src/lib/libcrypto/asn1/a_digest.c
+++ b/src/lib/libcrypto/asn1/a_digest.c
@@ -77,14 +77,14 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
77 unsigned char *str,*p; 77 unsigned char *str,*p;
78 78
79 i=i2d(data,NULL); 79 i=i2d(data,NULL);
80 if ((str=(unsigned char *)Malloc(i)) == NULL) return(0); 80 if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) return(0);
81 p=str; 81 p=str;
82 i2d(data,&p); 82 i2d(data,&p);
83 83
84 EVP_DigestInit(&ctx,type); 84 EVP_DigestInit(&ctx,type);
85 EVP_DigestUpdate(&ctx,str,i); 85 EVP_DigestUpdate(&ctx,str,i);
86 EVP_DigestFinal(&ctx,md,len); 86 EVP_DigestFinal(&ctx,md,len);
87 Free(str); 87 OPENSSL_free(str);
88 return(1); 88 return(1);
89 } 89 }
90 90
diff --git a/src/lib/libcrypto/asn1/a_dup.c b/src/lib/libcrypto/asn1/a_dup.c
index 3202a816d0..c3bda58a5d 100644
--- a/src/lib/libcrypto/asn1/a_dup.c
+++ b/src/lib/libcrypto/asn1/a_dup.c
@@ -71,13 +71,13 @@ char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
71 if (x == NULL) return(NULL); 71 if (x == NULL) return(NULL);
72 72
73 i=(long)i2d(x,NULL); 73 i=(long)i2d(x,NULL);
74 b=(unsigned char *)Malloc((unsigned int)i+10); 74 b=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
75 if (b == NULL) 75 if (b == NULL)
76 { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } 76 { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
77 p= b; 77 p= b;
78 i=i2d(x,&p); 78 i=i2d(x,&p);
79 p= b; 79 p= b;
80 ret=d2i(NULL,&p,i); 80 ret=d2i(NULL,&p,i);
81 Free(b); 81 OPENSSL_free(b);
82 return(ret); 82 return(ret);
83 } 83 }
diff --git a/src/lib/libcrypto/asn1/a_enum.c b/src/lib/libcrypto/asn1/a_enum.c
index ccf62e5a04..1428d1df7a 100644
--- a/src/lib/libcrypto/asn1/a_enum.c
+++ b/src/lib/libcrypto/asn1/a_enum.c
@@ -71,88 +71,28 @@ ASN1_ENUMERATED *ASN1_ENUMERATED_new(void)
71void ASN1_ENUMERATED_free(ASN1_ENUMERATED *x) 71void ASN1_ENUMERATED_free(ASN1_ENUMERATED *x)
72{ M_ASN1_ENUMERATED_free(x); } 72{ M_ASN1_ENUMERATED_free(x); }
73 73
74int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
75 {
76 int pad=0,ret,r,i,t;
77 unsigned char *p,*n,pb=0;
78
79 if ((a == NULL) || (a->data == NULL)) return(0);
80 t=a->type;
81 if (a->length == 0)
82 ret=1;
83 else
84 {
85 ret=a->length;
86 i=a->data[0];
87 if ((t == V_ASN1_ENUMERATED) && (i > 127)) {
88 pad=1;
89 pb=0;
90 } else if(t == V_ASN1_NEG_ENUMERATED) {
91 if(i>128) {
92 pad=1;
93 pb=0xFF;
94 } else if(i == 128) {
95 for(i = 1; i < a->length; i++) if(a->data[i]) {
96 pad=1;
97 pb=0xFF;
98 break;
99 }
100 }
101 }
102 ret+=pad;
103 }
104 r=ASN1_object_size(0,ret,V_ASN1_ENUMERATED);
105 if (pp == NULL) return(r);
106 p= *pp;
107
108 ASN1_put_object(&p,0,ret,V_ASN1_ENUMERATED,V_ASN1_UNIVERSAL);
109 if (pad) *(p++)=pb;
110 if (a->length == 0)
111 *(p++)=0;
112 else if (t == V_ASN1_ENUMERATED)
113 {
114 memcpy(p,a->data,(unsigned int)a->length);
115 p+=a->length;
116 }
117 else {
118 /* Begin at the end of the encoding */
119 n=a->data + a->length - 1;
120 p += a->length - 1;
121 i = a->length;
122 /* Copy zeros to destination as long as source is zero */
123 while(!*n) {
124 *(p--) = 0;
125 n--;
126 i--;
127 }
128 /* Complement and increment next octet */
129 *(p--) = ((*(n--)) ^ 0xff) + 1;
130 i--;
131 /* Complement any octets left */
132 for(;i > 0; i--) *(p--) = *(n--) ^ 0xff;
133 p += a->length;
134 }
135 74
136 *pp=p; 75int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp)
137 return(r); 76{
77 int len, ret;
78 if(!a) return 0;
79 len = i2c_ASN1_INTEGER(a, NULL);
80 ret=ASN1_object_size(0,len,V_ASN1_ENUMERATED);
81 if(pp) {
82 ASN1_put_object(pp,0,len,V_ASN1_ENUMERATED,V_ASN1_UNIVERSAL);
83 i2c_ASN1_INTEGER(a, pp);
138 } 84 }
85 return ret;
86}
139 87
140ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp, 88ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
141 long length) 89 long length)
142 { 90{
143 ASN1_ENUMERATED *ret=NULL; 91 unsigned char *p;
144 unsigned char *p,*to,*s;
145 long len; 92 long len;
146 int inf,tag,xclass;
147 int i; 93 int i;
148 94 int inf,tag,xclass;
149 if ((a == NULL) || ((*a) == NULL)) 95 ASN1_ENUMERATED *ret;
150 {
151 if ((ret=M_ASN1_ENUMERATED_new()) == NULL) return(NULL);
152 ret->type=V_ASN1_ENUMERATED;
153 }
154 else
155 ret=(*a);
156 96
157 p= *pp; 97 p= *pp;
158 inf=ASN1_get_object(&p,&len,&tag,&xclass,length); 98 inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
@@ -167,70 +107,17 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp,
167 i=ASN1_R_EXPECTING_AN_ENUMERATED; 107 i=ASN1_R_EXPECTING_AN_ENUMERATED;
168 goto err; 108 goto err;
169 } 109 }
170 110 ret = c2i_ASN1_INTEGER(a, &p, len);
171 /* We must Malloc stuff, even for 0 bytes otherwise it 111 if(ret) {
172 * signifies a missing NULL parameter. */ 112 ret->type = (V_ASN1_NEG & ret->type) | V_ASN1_ENUMERATED;
173 s=(unsigned char *)Malloc((int)len+1); 113 *pp = p;
174 if (s == NULL)
175 {
176 i=ERR_R_MALLOC_FAILURE;
177 goto err;
178 }
179 to=s;
180 if(!len) {
181 /* Strictly speaking this is an illegal ENUMERATED but we
182 * tolerate it.
183 */
184 ret->type=V_ASN1_ENUMERATED;
185 } else if (*p & 0x80) /* a negative number */
186 {
187 ret->type=V_ASN1_NEG_ENUMERATED;
188 if ((*p == 0xff) && (len != 1)) {
189 p++;
190 len--;
191 }
192 i = len;
193 p += i - 1;
194 to += i - 1;
195 while((!*p) && i) {
196 *(to--) = 0;
197 i--;
198 p--;
199 }
200 if(!i) {
201 *s = 1;
202 s[len] = 0;
203 p += len;
204 len++;
205 } else {
206 *(to--) = (*(p--) ^ 0xff) + 1;
207 i--;
208 for(;i > 0; i--) *(to--) = *(p--) ^ 0xff;
209 p += len;
210 }
211 } else {
212 ret->type=V_ASN1_ENUMERATED;
213 if ((*p == 0) && (len != 1))
214 {
215 p++;
216 len--;
217 }
218 memcpy(s,p,(int)len);
219 p+=len;
220 } 114 }
221 115 return ret;
222 if (ret->data != NULL) Free(ret->data);
223 ret->data=s;
224 ret->length=(int)len;
225 if (a != NULL) (*a)=ret;
226 *pp=p;
227 return(ret);
228err: 116err:
229 ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,i); 117 ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,i);
230 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
231 M_ASN1_ENUMERATED_free(ret);
232 return(NULL); 118 return(NULL);
233 } 119
120}
234 121
235int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) 122int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
236 { 123 {
@@ -242,8 +129,8 @@ int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v)
242 if (a->length < (sizeof(long)+1)) 129 if (a->length < (sizeof(long)+1))
243 { 130 {
244 if (a->data != NULL) 131 if (a->data != NULL)
245 Free(a->data); 132 OPENSSL_free(a->data);
246 if ((a->data=(unsigned char *)Malloc(sizeof(long)+1)) != NULL) 133 if ((a->data=(unsigned char *)OPENSSL_malloc(sizeof(long)+1)) != NULL)
247 memset((char *)a->data,0,sizeof(long)+1); 134 memset((char *)a->data,0,sizeof(long)+1);
248 } 135 }
249 if (a->data == NULL) 136 if (a->data == NULL)
@@ -318,7 +205,7 @@ ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai)
318 else ret->type=V_ASN1_ENUMERATED; 205 else ret->type=V_ASN1_ENUMERATED;
319 j=BN_num_bits(bn); 206 j=BN_num_bits(bn);
320 len=((j == 0)?0:((j/8)+1)); 207 len=((j == 0)?0:((j/8)+1));
321 ret->data=(unsigned char *)Malloc(len+4); 208 ret->data=(unsigned char *)OPENSSL_malloc(len+4);
322 ret->length=BN_bn2bin(bn,ret->data); 209 ret->length=BN_bn2bin(bn,ret->data);
323 return(ret); 210 return(ret);
324err: 211err:
@@ -332,6 +219,6 @@ BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn)
332 219
333 if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) 220 if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL)
334 ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB); 221 ASN1err(ASN1_F_ASN1_ENUMERATED_TO_BN,ASN1_R_BN_LIB);
335 if(ai->type == V_ASN1_NEG_ENUMERATED) bn->neg = 1; 222 else if(ai->type == V_ASN1_NEG_ENUMERATED) ret->neg = 1;
336 return(ret); 223 return(ret);
337 } 224 }
diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c
index 84062170e8..314479a03d 100644
--- a/src/lib/libcrypto/asn1/a_gentm.c
+++ b/src/lib/libcrypto/asn1/a_gentm.c
@@ -212,10 +212,10 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
212 p=(char *)s->data; 212 p=(char *)s->data;
213 if ((p == NULL) || (s->length < 16)) 213 if ((p == NULL) || (s->length < 16))
214 { 214 {
215 p=Malloc(20); 215 p=OPENSSL_malloc(20);
216 if (p == NULL) return(NULL); 216 if (p == NULL) return(NULL);
217 if (s->data != NULL) 217 if (s->data != NULL)
218 Free(s->data); 218 OPENSSL_free(s->data);
219 s->data=(unsigned char *)p; 219 s->data=(unsigned char *)p;
220 } 220 }
221 221
diff --git a/src/lib/libcrypto/asn1/a_hdr.c b/src/lib/libcrypto/asn1/a_hdr.c
index 434610e8e1..b1aad81f77 100644
--- a/src/lib/libcrypto/asn1/a_hdr.c
+++ b/src/lib/libcrypto/asn1/a_hdr.c
@@ -115,5 +115,5 @@ void ASN1_HEADER_free(ASN1_HEADER *a)
115 M_ASN1_OCTET_STRING_free(a->header); 115 M_ASN1_OCTET_STRING_free(a->header);
116 if (a->meth != NULL) 116 if (a->meth != NULL)
117 a->meth->destroy(a->data); 117 a->meth->destroy(a->data);
118 Free(a); 118 OPENSSL_free(a);
119 } 119 }
diff --git a/src/lib/libcrypto/asn1/a_i2d_fp.c b/src/lib/libcrypto/asn1/a_i2d_fp.c
index d9b8035e17..aee29a7790 100644
--- a/src/lib/libcrypto/asn1/a_i2d_fp.c
+++ b/src/lib/libcrypto/asn1/a_i2d_fp.c
@@ -86,7 +86,7 @@ int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x)
86 int i,j=0,n,ret=1; 86 int i,j=0,n,ret=1;
87 87
88 n=i2d(x,NULL); 88 n=i2d(x,NULL);
89 b=(char *)Malloc(n); 89 b=(char *)OPENSSL_malloc(n);
90 if (b == NULL) 90 if (b == NULL)
91 { 91 {
92 ASN1err(ASN1_F_ASN1_I2D_BIO,ERR_R_MALLOC_FAILURE); 92 ASN1err(ASN1_F_ASN1_I2D_BIO,ERR_R_MALLOC_FAILURE);
@@ -108,6 +108,6 @@ int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x)
108 j+=i; 108 j+=i;
109 n-=i; 109 n-=i;
110 } 110 }
111 Free(b); 111 OPENSSL_free(b);
112 return(ret); 112 return(ret);
113 } 113 }
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c
index 8b6794e8c1..6f0413f885 100644
--- a/src/lib/libcrypto/asn1/a_int.c
+++ b/src/lib/libcrypto/asn1/a_int.c
@@ -72,8 +72,23 @@ ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x)
72int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) 72int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y)
73{ return M_ASN1_INTEGER_cmp(x,y);} 73{ return M_ASN1_INTEGER_cmp(x,y);}
74 74
75/* Output ASN1 INTEGER including tag+length */
76
77int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
78{
79 int len, ret;
80 if(!a) return 0;
81 len = i2c_ASN1_INTEGER(a, NULL);
82 ret=ASN1_object_size(0,len,V_ASN1_INTEGER);
83 if(pp) {
84 ASN1_put_object(pp,0,len,V_ASN1_INTEGER,V_ASN1_UNIVERSAL);
85 i2c_ASN1_INTEGER(a, pp);
86 }
87 return ret;
88}
89
75/* 90/*
76 * This converts an ASN1 INTEGER into its DER encoding. 91 * This converts an ASN1 INTEGER into its content encoding.
77 * The internal representation is an ASN1_STRING whose data is a big endian 92 * The internal representation is an ASN1_STRING whose data is a big endian
78 * representation of the value, ignoring the sign. The sign is determined by 93 * representation of the value, ignoring the sign. The sign is determined by
79 * the type: V_ASN1_INTEGER for positive and V_ASN1_NEG_INTEGER for negative. 94 * the type: V_ASN1_INTEGER for positive and V_ASN1_NEG_INTEGER for negative.
@@ -97,23 +112,23 @@ int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y)
97 * followed by optional zeros isn't padded. 112 * followed by optional zeros isn't padded.
98 */ 113 */
99 114
100int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) 115int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
101 { 116 {
102 int pad=0,ret,r,i,t; 117 int pad=0,ret,i,neg;
103 unsigned char *p,*n,pb=0; 118 unsigned char *p,*n,pb=0;
104 119
105 if ((a == NULL) || (a->data == NULL)) return(0); 120 if ((a == NULL) || (a->data == NULL)) return(0);
106 t=a->type; 121 neg=a->type & V_ASN1_NEG;
107 if (a->length == 0) 122 if (a->length == 0)
108 ret=1; 123 ret=1;
109 else 124 else
110 { 125 {
111 ret=a->length; 126 ret=a->length;
112 i=a->data[0]; 127 i=a->data[0];
113 if ((t == V_ASN1_INTEGER) && (i > 127)) { 128 if (!neg && (i > 127)) {
114 pad=1; 129 pad=1;
115 pb=0; 130 pb=0;
116 } else if(t == V_ASN1_NEG_INTEGER) { 131 } else if(neg) {
117 if(i>128) { 132 if(i>128) {
118 pad=1; 133 pad=1;
119 pb=0xFF; 134 pb=0xFF;
@@ -131,14 +146,12 @@ int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
131 } 146 }
132 ret+=pad; 147 ret+=pad;
133 } 148 }
134 r=ASN1_object_size(0,ret,V_ASN1_INTEGER); 149 if (pp == NULL) return(ret);
135 if (pp == NULL) return(r);
136 p= *pp; 150 p= *pp;
137 151
138 ASN1_put_object(&p,0,ret,V_ASN1_INTEGER,V_ASN1_UNIVERSAL);
139 if (pad) *(p++)=pb; 152 if (pad) *(p++)=pb;
140 if (a->length == 0) *(p++)=0; 153 if (a->length == 0) *(p++)=0;
141 else if (t == V_ASN1_INTEGER) memcpy(p,a->data,(unsigned int)a->length); 154 else if (!neg) memcpy(p,a->data,(unsigned int)a->length);
142 else { 155 else {
143 /* Begin at the end of the encoding */ 156 /* Begin at the end of the encoding */
144 n=a->data + a->length - 1; 157 n=a->data + a->length - 1;
@@ -157,30 +170,22 @@ int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
157 for(;i > 0; i--) *(p--) = *(n--) ^ 0xff; 170 for(;i > 0; i--) *(p--) = *(n--) ^ 0xff;
158 } 171 }
159 172
160 *pp+=r; 173 *pp+=ret;
161 return(r); 174 return(ret);
162 } 175 }
163 176
177/* Convert DER encoded ASN1 INTEGER to ASN1_INTEGER structure */
164ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, 178ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
165 long length) 179 long length)
166 { 180{
167 ASN1_INTEGER *ret=NULL; 181 unsigned char *p;
168 unsigned char *p,*to,*s, *pend;
169 long len; 182 long len;
170 int inf,tag,xclass;
171 int i; 183 int i;
172 184 int inf,tag,xclass;
173 if ((a == NULL) || ((*a) == NULL)) 185 ASN1_INTEGER *ret;
174 {
175 if ((ret=M_ASN1_INTEGER_new()) == NULL) return(NULL);
176 ret->type=V_ASN1_INTEGER;
177 }
178 else
179 ret=(*a);
180 186
181 p= *pp; 187 p= *pp;
182 inf=ASN1_get_object(&p,&len,&tag,&xclass,length); 188 inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
183 pend = p + len;
184 if (inf & 0x80) 189 if (inf & 0x80)
185 { 190 {
186 i=ASN1_R_BAD_OBJECT_HEADER; 191 i=ASN1_R_BAD_OBJECT_HEADER;
@@ -192,10 +197,39 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
192 i=ASN1_R_EXPECTING_AN_INTEGER; 197 i=ASN1_R_EXPECTING_AN_INTEGER;
193 goto err; 198 goto err;
194 } 199 }
200 ret = c2i_ASN1_INTEGER(a, &p, len);
201 if(ret) *pp = p;
202 return ret;
203err:
204 ASN1err(ASN1_F_D2I_ASN1_INTEGER,i);
205 return(NULL);
206
207}
208
209
210/* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */
211
212ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
213 long len)
214 {
215 ASN1_INTEGER *ret=NULL;
216 unsigned char *p,*to,*s, *pend;
217 int i;
218
219 if ((a == NULL) || ((*a) == NULL))
220 {
221 if ((ret=M_ASN1_INTEGER_new()) == NULL) return(NULL);
222 ret->type=V_ASN1_INTEGER;
223 }
224 else
225 ret=(*a);
195 226
196 /* We must Malloc stuff, even for 0 bytes otherwise it 227 p= *pp;
228 pend = p + len;
229
230 /* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it
197 * signifies a missing NULL parameter. */ 231 * signifies a missing NULL parameter. */
198 s=(unsigned char *)Malloc((int)len+1); 232 s=(unsigned char *)OPENSSL_malloc((int)len+1);
199 if (s == NULL) 233 if (s == NULL)
200 { 234 {
201 i=ERR_R_MALLOC_FAILURE; 235 i=ERR_R_MALLOC_FAILURE;
@@ -248,7 +282,7 @@ ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp,
248 memcpy(s,p,(int)len); 282 memcpy(s,p,(int)len);
249 } 283 }
250 284
251 if (ret->data != NULL) Free(ret->data); 285 if (ret->data != NULL) OPENSSL_free(ret->data);
252 ret->data=s; 286 ret->data=s;
253 ret->length=(int)len; 287 ret->length=(int)len;
254 if (a != NULL) (*a)=ret; 288 if (a != NULL) (*a)=ret;
@@ -261,6 +295,7 @@ err:
261 return(NULL); 295 return(NULL);
262 } 296 }
263 297
298
264/* This is a version of d2i_ASN1_INTEGER that ignores the sign bit of 299/* This is a version of d2i_ASN1_INTEGER that ignores the sign bit of
265 * ASN1 integers: some broken software can encode a positive INTEGER 300 * ASN1 integers: some broken software can encode a positive INTEGER
266 * with its MSB set as negative (it doesn't add a padding zero). 301 * with its MSB set as negative (it doesn't add a padding zero).
@@ -297,9 +332,9 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
297 goto err; 332 goto err;
298 } 333 }
299 334
300 /* We must Malloc stuff, even for 0 bytes otherwise it 335 /* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it
301 * signifies a missing NULL parameter. */ 336 * signifies a missing NULL parameter. */
302 s=(unsigned char *)Malloc((int)len+1); 337 s=(unsigned char *)OPENSSL_malloc((int)len+1);
303 if (s == NULL) 338 if (s == NULL)
304 { 339 {
305 i=ERR_R_MALLOC_FAILURE; 340 i=ERR_R_MALLOC_FAILURE;
@@ -317,7 +352,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, unsigned char **pp,
317 p+=len; 352 p+=len;
318 } 353 }
319 354
320 if (ret->data != NULL) Free(ret->data); 355 if (ret->data != NULL) OPENSSL_free(ret->data);
321 ret->data=s; 356 ret->data=s;
322 ret->length=(int)len; 357 ret->length=(int)len;
323 if (a != NULL) (*a)=ret; 358 if (a != NULL) (*a)=ret;
@@ -340,8 +375,8 @@ int ASN1_INTEGER_set(ASN1_INTEGER *a, long v)
340 if (a->length < (sizeof(long)+1)) 375 if (a->length < (sizeof(long)+1))
341 { 376 {
342 if (a->data != NULL) 377 if (a->data != NULL)
343 Free(a->data); 378 OPENSSL_free(a->data);
344 if ((a->data=(unsigned char *)Malloc(sizeof(long)+1)) != NULL) 379 if ((a->data=(unsigned char *)OPENSSL_malloc(sizeof(long)+1)) != NULL)
345 memset((char *)a->data,0,sizeof(long)+1); 380 memset((char *)a->data,0,sizeof(long)+1);
346 } 381 }
347 if (a->data == NULL) 382 if (a->data == NULL)
@@ -416,7 +451,7 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai)
416 else ret->type=V_ASN1_INTEGER; 451 else ret->type=V_ASN1_INTEGER;
417 j=BN_num_bits(bn); 452 j=BN_num_bits(bn);
418 len=((j == 0)?0:((j/8)+1)); 453 len=((j == 0)?0:((j/8)+1));
419 ret->data=(unsigned char *)Malloc(len+4); 454 ret->data=(unsigned char *)OPENSSL_malloc(len+4);
420 ret->length=BN_bn2bin(bn,ret->data); 455 ret->length=BN_bn2bin(bn,ret->data);
421 return(ret); 456 return(ret);
422err: 457err:
@@ -430,6 +465,9 @@ BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai, BIGNUM *bn)
430 465
431 if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL) 466 if ((ret=BN_bin2bn(ai->data,ai->length,bn)) == NULL)
432 ASN1err(ASN1_F_ASN1_INTEGER_TO_BN,ASN1_R_BN_LIB); 467 ASN1err(ASN1_F_ASN1_INTEGER_TO_BN,ASN1_R_BN_LIB);
433 if(ai->type == V_ASN1_NEG_INTEGER) bn->neg = 1; 468 else if(ai->type == V_ASN1_NEG_INTEGER) ret->neg = 1;
434 return(ret); 469 return(ret);
435 } 470 }
471
472IMPLEMENT_STACK_OF(ASN1_INTEGER)
473IMPLEMENT_ASN1_SET_OF(ASN1_INTEGER)
diff --git a/src/lib/libcrypto/asn1/a_mbstr.c b/src/lib/libcrypto/asn1/a_mbstr.c
index 7a710d5459..5d981c6553 100644
--- a/src/lib/libcrypto/asn1/a_mbstr.c
+++ b/src/lib/libcrypto/asn1/a_mbstr.c
@@ -92,6 +92,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
92{ 92{
93 int str_type; 93 int str_type;
94 int ret; 94 int ret;
95 char free_out;
95 int outform, outlen; 96 int outform, outlen;
96 ASN1_STRING *dest; 97 ASN1_STRING *dest;
97 unsigned char *p; 98 unsigned char *p;
@@ -180,14 +181,16 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
180 } 181 }
181 if(!out) return str_type; 182 if(!out) return str_type;
182 if(*out) { 183 if(*out) {
184 free_out = 0;
183 dest = *out; 185 dest = *out;
184 if(dest->data) { 186 if(dest->data) {
185 dest->length = 0; 187 dest->length = 0;
186 Free(dest->data); 188 OPENSSL_free(dest->data);
187 dest->data = NULL; 189 dest->data = NULL;
188 } 190 }
189 dest->type = str_type; 191 dest->type = str_type;
190 } else { 192 } else {
193 free_out = 1;
191 dest = ASN1_STRING_type_new(str_type); 194 dest = ASN1_STRING_type_new(str_type);
192 if(!dest) { 195 if(!dest) {
193 ASN1err(ASN1_F_ASN1_MBSTRING_COPY, 196 ASN1err(ASN1_F_ASN1_MBSTRING_COPY,
@@ -228,8 +231,8 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
228 cpyfunc = cpy_utf8; 231 cpyfunc = cpy_utf8;
229 break; 232 break;
230 } 233 }
231 if(!(p = Malloc(outlen + 1))) { 234 if(!(p = OPENSSL_malloc(outlen + 1))) {
232 ASN1_STRING_free(dest); 235 if(free_out) ASN1_STRING_free(dest);
233 ASN1err(ASN1_F_ASN1_MBSTRING_COPY,ERR_R_MALLOC_FAILURE); 236 ASN1err(ASN1_F_ASN1_MBSTRING_COPY,ERR_R_MALLOC_FAILURE);
234 return -1; 237 return -1;
235 } 238 }
@@ -258,8 +261,8 @@ static int traverse_string(const unsigned char *p, int len, int inform,
258 value |= *p++; 261 value |= *p++;
259 len -= 2; 262 len -= 2;
260 } else if(inform == MBSTRING_UNIV) { 263 } else if(inform == MBSTRING_UNIV) {
261 value = *p++ << 24; 264 value = ((unsigned long)*p++) << 24;
262 value |= *p++ << 16; 265 value |= ((unsigned long)*p++) << 16;
263 value |= *p++ << 8; 266 value |= *p++ << 8;
264 value |= *p++; 267 value |= *p++;
265 len -= 4; 268 len -= 4;
@@ -382,9 +385,16 @@ static int is_printable(unsigned long value)
382 /* Note: we can't use 'isalnum' because certain accented 385 /* Note: we can't use 'isalnum' because certain accented
383 * characters may count as alphanumeric in some environments. 386 * characters may count as alphanumeric in some environments.
384 */ 387 */
388#ifndef CHARSET_EBCDIC
385 if((ch >= 'a') && (ch <= 'z')) return 1; 389 if((ch >= 'a') && (ch <= 'z')) return 1;
386 if((ch >= 'A') && (ch <= 'Z')) return 1; 390 if((ch >= 'A') && (ch <= 'Z')) return 1;
387 if((ch >= '0') && (ch <= '9')) return 1; 391 if((ch >= '0') && (ch <= '9')) return 1;
388 if ((ch == ' ') || strchr("'()+,-./:=?", ch)) return 1; 392 if ((ch == ' ') || strchr("'()+,-./:=?", ch)) return 1;
393#else /*CHARSET_EBCDIC*/
394 if((ch >= os_toascii['a']) && (ch <= os_toascii['z'])) return 1;
395 if((ch >= os_toascii['A']) && (ch <= os_toascii['Z'])) return 1;
396 if((ch >= os_toascii['0']) && (ch <= os_toascii['9'])) return 1;
397 if ((ch == os_toascii[' ']) || strchr("'()+,-./:=?", os_toebcdic[ch])) return 1;
398#endif /*CHARSET_EBCDIC*/
389 return 0; 399 return 0;
390} 400}
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c
index 09d56fb669..20caa2d3bd 100644
--- a/src/lib/libcrypto/asn1/a_object.c
+++ b/src/lib/libcrypto/asn1/a_object.c
@@ -65,11 +65,12 @@
65int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) 65int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
66 { 66 {
67 unsigned char *p; 67 unsigned char *p;
68 int objsize;
68 69
69 if ((a == NULL) || (a->data == NULL)) return(0); 70 if ((a == NULL) || (a->data == NULL)) return(0);
70 71
71 if (pp == NULL) 72 objsize = ASN1_object_size(0,a->length,V_ASN1_OBJECT);
72 return(ASN1_object_size(0,a->length,V_ASN1_OBJECT)); 73 if (pp == NULL) return objsize;
73 74
74 p= *pp; 75 p= *pp;
75 ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL); 76 ASN1_put_object(&p,0,a->length,V_ASN1_OBJECT,V_ASN1_UNIVERSAL);
@@ -77,7 +78,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
77 p+=a->length; 78 p+=a->length;
78 79
79 *pp=p; 80 *pp=p;
80 return(a->length); 81 return(objsize);
81 } 82 }
82 83
83int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) 84int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
@@ -190,24 +191,13 @@ int i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a)
190 191
191ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp, 192ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
192 long length) 193 long length)
193 { 194{
194 ASN1_OBJECT *ret=NULL;
195 unsigned char *p; 195 unsigned char *p;
196 long len; 196 long len;
197 int tag,xclass; 197 int tag,xclass;
198 int inf,i; 198 int inf,i;
199 199 ASN1_OBJECT *ret = NULL;
200 /* only the ASN1_OBJECTs from the 'table' will have values
201 * for ->sn or ->ln */
202 if ((a == NULL) || ((*a) == NULL) ||
203 !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC))
204 {
205 if ((ret=ASN1_OBJECT_new()) == NULL) return(NULL);
206 }
207 else ret=(*a);
208
209 p= *pp; 200 p= *pp;
210
211 inf=ASN1_get_object(&p,&len,&tag,&xclass,length); 201 inf=ASN1_get_object(&p,&len,&tag,&xclass,length);
212 if (inf & 0x80) 202 if (inf & 0x80)
213 { 203 {
@@ -220,10 +210,36 @@ ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
220 i=ASN1_R_EXPECTING_AN_OBJECT; 210 i=ASN1_R_EXPECTING_AN_OBJECT;
221 goto err; 211 goto err;
222 } 212 }
213 ret = c2i_ASN1_OBJECT(a, &p, len);
214 if(ret) *pp = p;
215 return ret;
216err:
217 ASN1err(ASN1_F_D2I_ASN1_OBJECT,i);
218 if ((ret != NULL) && ((a == NULL) || (*a != ret)))
219 ASN1_OBJECT_free(ret);
220 return(NULL);
221}
222ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, unsigned char **pp,
223 long len)
224 {
225 ASN1_OBJECT *ret=NULL;
226 unsigned char *p;
227 int i;
228
229 /* only the ASN1_OBJECTs from the 'table' will have values
230 * for ->sn or ->ln */
231 if ((a == NULL) || ((*a) == NULL) ||
232 !((*a)->flags & ASN1_OBJECT_FLAG_DYNAMIC))
233 {
234 if ((ret=ASN1_OBJECT_new()) == NULL) return(NULL);
235 }
236 else ret=(*a);
237
238 p= *pp;
223 if ((ret->data == NULL) || (ret->length < len)) 239 if ((ret->data == NULL) || (ret->length < len))
224 { 240 {
225 if (ret->data != NULL) Free(ret->data); 241 if (ret->data != NULL) OPENSSL_free(ret->data);
226 ret->data=(unsigned char *)Malloc(len ? (int)len : 1); 242 ret->data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1);
227 ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; 243 ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA;
228 if (ret->data == NULL) 244 if (ret->data == NULL)
229 { i=ERR_R_MALLOC_FAILURE; goto err; } 245 { i=ERR_R_MALLOC_FAILURE; goto err; }
@@ -249,7 +265,7 @@ ASN1_OBJECT *ASN1_OBJECT_new(void)
249 { 265 {
250 ASN1_OBJECT *ret; 266 ASN1_OBJECT *ret;
251 267
252 ret=(ASN1_OBJECT *)Malloc(sizeof(ASN1_OBJECT)); 268 ret=(ASN1_OBJECT *)OPENSSL_malloc(sizeof(ASN1_OBJECT));
253 if (ret == NULL) 269 if (ret == NULL)
254 { 270 {
255 ASN1err(ASN1_F_ASN1_OBJECT_NEW,ERR_R_MALLOC_FAILURE); 271 ASN1err(ASN1_F_ASN1_OBJECT_NEW,ERR_R_MALLOC_FAILURE);
@@ -270,19 +286,19 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a)
270 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS) 286 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_STRINGS)
271 { 287 {
272#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */ 288#ifndef CONST_STRICT /* disable purely for compile-time strict const checking. Doing this on a "real" compile will cause memory leaks */
273 if (a->sn != NULL) Free((void *)a->sn); 289 if (a->sn != NULL) OPENSSL_free((void *)a->sn);
274 if (a->ln != NULL) Free((void *)a->ln); 290 if (a->ln != NULL) OPENSSL_free((void *)a->ln);
275#endif 291#endif
276 a->sn=a->ln=NULL; 292 a->sn=a->ln=NULL;
277 } 293 }
278 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA) 294 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC_DATA)
279 { 295 {
280 if (a->data != NULL) Free(a->data); 296 if (a->data != NULL) OPENSSL_free(a->data);
281 a->data=NULL; 297 a->data=NULL;
282 a->length=0; 298 a->length=0;
283 } 299 }
284 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC) 300 if (a->flags & ASN1_OBJECT_FLAG_DYNAMIC)
285 Free(a); 301 OPENSSL_free(a);
286 } 302 }
287 303
288ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, 304ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c
index c2481e7597..caf5a1419c 100644
--- a/src/lib/libcrypto/asn1/a_set.c
+++ b/src/lib/libcrypto/asn1/a_set.c
@@ -116,7 +116,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
116 } 116 }
117 117
118 pStart = p; /* Catch the beg of Setblobs*/ 118 pStart = p; /* Catch the beg of Setblobs*/
119 rgSetBlob = (MYBLOB *)Malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array 119 rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
120we will store the SET blobs */ 120we will store the SET blobs */
121 121
122 for (i=0; i<sk_num(a); i++) 122 for (i=0; i<sk_num(a); i++)
@@ -133,7 +133,7 @@ SetBlob
133 /* Now we have to sort the blobs. I am using a simple algo. 133 /* Now we have to sort the blobs. I am using a simple algo.
134 *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/ 134 *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
135 qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp); 135 qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
136 pTempMem = Malloc(totSize); 136 pTempMem = OPENSSL_malloc(totSize);
137 137
138/* Copy to temp mem */ 138/* Copy to temp mem */
139 p = pTempMem; 139 p = pTempMem;
@@ -145,20 +145,20 @@ SetBlob
145 145
146/* Copy back to user mem*/ 146/* Copy back to user mem*/
147 memcpy(pStart, pTempMem, totSize); 147 memcpy(pStart, pTempMem, totSize);
148 Free(pTempMem); 148 OPENSSL_free(pTempMem);
149 Free(rgSetBlob); 149 OPENSSL_free(rgSetBlob);
150 150
151 return(r); 151 return(r);
152 } 152 }
153 153
154STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, 154STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
155 char *(*func)(), void (*free_func)(), int ex_tag, int ex_class) 155 char *(*func)(), void (*free_func)(void *), int ex_tag, int ex_class)
156 { 156 {
157 ASN1_CTX c; 157 ASN1_CTX c;
158 STACK *ret=NULL; 158 STACK *ret=NULL;
159 159
160 if ((a == NULL) || ((*a) == NULL)) 160 if ((a == NULL) || ((*a) == NULL))
161 { if ((ret=sk_new(NULL)) == NULL) goto err; } 161 { if ((ret=sk_new_null()) == NULL) goto err; }
162 else 162 else
163 ret=(*a); 163 ret=(*a);
164 164
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c
index cfb4bca4f1..4c651706d2 100644
--- a/src/lib/libcrypto/asn1/a_sign.c
+++ b/src/lib/libcrypto/asn1/a_sign.c
@@ -108,9 +108,9 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
108 } 108 }
109 } 109 }
110 inl=i2d(data,NULL); 110 inl=i2d(data,NULL);
111 buf_in=(unsigned char *)Malloc((unsigned int)inl); 111 buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
112 outll=outl=EVP_PKEY_size(pkey); 112 outll=outl=EVP_PKEY_size(pkey);
113 buf_out=(unsigned char *)Malloc((unsigned int)outl); 113 buf_out=(unsigned char *)OPENSSL_malloc((unsigned int)outl);
114 if ((buf_in == NULL) || (buf_out == NULL)) 114 if ((buf_in == NULL) || (buf_out == NULL))
115 { 115 {
116 outl=0; 116 outl=0;
@@ -129,7 +129,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
129 ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB); 129 ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB);
130 goto err; 130 goto err;
131 } 131 }
132 if (signature->data != NULL) Free(signature->data); 132 if (signature->data != NULL) OPENSSL_free(signature->data);
133 signature->data=buf_out; 133 signature->data=buf_out;
134 buf_out=NULL; 134 buf_out=NULL;
135 signature->length=outl; 135 signature->length=outl;
@@ -141,8 +141,8 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2,
141err: 141err:
142 memset(&ctx,0,sizeof(ctx)); 142 memset(&ctx,0,sizeof(ctx));
143 if (buf_in != NULL) 143 if (buf_in != NULL)
144 { memset((char *)buf_in,0,(unsigned int)inl); Free(buf_in); } 144 { memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); }
145 if (buf_out != NULL) 145 if (buf_out != NULL)
146 { memset((char *)buf_out,0,outll); Free(buf_out); } 146 { memset((char *)buf_out,0,outll); OPENSSL_free(buf_out); }
147 return(outl); 147 return(outl);
148 } 148 }
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c
new file mode 100644
index 0000000000..569b811998
--- /dev/null
+++ b/src/lib/libcrypto/asn1/a_strex.c
@@ -0,0 +1,533 @@
1/* a_strex.c */
2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <string.h>
61#include <openssl/crypto.h>
62#include <openssl/x509.h>
63#include <openssl/asn1.h>
64
65#include "charmap.h"
66
67/* ASN1_STRING_print_ex() and X509_NAME_print_ex().
68 * Enhanced string and name printing routines handling
69 * multibyte characters, RFC2253 and a host of other
70 * options.
71 */
72
73
74#define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253)
75
76
77/* Three IO functions for sending data to memory, a BIO and
78 * and a FILE pointer.
79 */
80
81int send_mem_chars(void *arg, const void *buf, int len)
82{
83 unsigned char **out = arg;
84 if(!out) return 1;
85 memcpy(*out, buf, len);
86 *out += len;
87 return 1;
88}
89
90int send_bio_chars(void *arg, const void *buf, int len)
91{
92 if(!arg) return 1;
93 if(BIO_write(arg, buf, len) != len) return 0;
94 return 1;
95}
96
97int send_fp_chars(void *arg, const void *buf, int len)
98{
99 if(!arg) return 1;
100 if(fwrite(buf, 1, len, arg) != (unsigned int)len) return 0;
101 return 1;
102}
103
104typedef int char_io(void *arg, const void *buf, int len);
105
106/* This function handles display of
107 * strings, one character at a time.
108 * It is passed an unsigned long for each
109 * character because it could come from 2 or even
110 * 4 byte forms.
111 */
112
113static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, char_io *io_ch, void *arg)
114{
115 unsigned char chflgs, chtmp;
116 char tmphex[11];
117 if(c > 0xffff) {
118 BIO_snprintf(tmphex, 11, "\\W%08lX", c);
119 if(!io_ch(arg, tmphex, 10)) return -1;
120 return 10;
121 }
122 if(c > 0xff) {
123 BIO_snprintf(tmphex, 11, "\\U%04lX", c);
124 if(!io_ch(arg, tmphex, 6)) return -1;
125 return 6;
126 }
127 chtmp = (unsigned char)c;
128 if(chtmp > 0x7f) chflgs = flags & ASN1_STRFLGS_ESC_MSB;
129 else chflgs = char_type[chtmp] & flags;
130 if(chflgs & CHARTYPE_BS_ESC) {
131 /* If we don't escape with quotes, signal we need quotes */
132 if(chflgs & ASN1_STRFLGS_ESC_QUOTE) {
133 if(do_quotes) *do_quotes = 1;
134 if(!io_ch(arg, &chtmp, 1)) return -1;
135 return 1;
136 }
137 if(!io_ch(arg, "\\", 1)) return -1;
138 if(!io_ch(arg, &chtmp, 1)) return -1;
139 return 2;
140 }
141 if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
142 BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
143 if(!io_ch(arg, tmphex, 3)) return -1;
144 return 3;
145 }
146 if(!io_ch(arg, &chtmp, 1)) return -1;
147 return 1;
148}
149
150#define BUF_TYPE_WIDTH_MASK 0x7
151#define BUF_TYPE_CONVUTF8 0x8
152
153/* This function sends each character in a buffer to
154 * do_esc_char(). It interprets the content formats
155 * and converts to or from UTF8 as appropriate.
156 */
157
158static int do_buf(unsigned char *buf, int buflen,
159 int type, unsigned char flags, char *quotes, char_io *io_ch, void *arg)
160{
161 int i, outlen, len;
162 unsigned char orflags, *p, *q;
163 unsigned long c;
164 p = buf;
165 q = buf + buflen;
166 outlen = 0;
167 while(p != q) {
168 if(p == buf) orflags = CHARTYPE_FIRST_ESC_2253;
169 else orflags = 0;
170 switch(type & BUF_TYPE_WIDTH_MASK) {
171 case 4:
172 c = ((unsigned long)*p++) << 24;
173 c |= ((unsigned long)*p++) << 16;
174 c |= ((unsigned long)*p++) << 8;
175 c |= *p++;
176 break;
177
178 case 2:
179 c = ((unsigned long)*p++) << 8;
180 c |= *p++;
181 break;
182
183 case 1:
184 c = *p++;
185 break;
186
187 case 0:
188 i = UTF8_getc(p, buflen, &c);
189 if(i < 0) return -1; /* Invalid UTF8String */
190 p += i;
191 break;
192 }
193 if (p == q) orflags = CHARTYPE_LAST_ESC_2253;
194 if(type & BUF_TYPE_CONVUTF8) {
195 unsigned char utfbuf[6];
196 int utflen;
197 utflen = UTF8_putc(utfbuf, 6, c);
198 for(i = 0; i < utflen; i++) {
199 /* We don't need to worry about setting orflags correctly
200 * because if utflen==1 its value will be correct anyway
201 * otherwise each character will be > 0x7f and so the
202 * character will never be escaped on first and last.
203 */
204 len = do_esc_char(utfbuf[i], (unsigned char)(flags | orflags), quotes, io_ch, arg);
205 if(len < 0) return -1;
206 outlen += len;
207 }
208 } else {
209 len = do_esc_char(c, (unsigned char)(flags | orflags), quotes, io_ch, arg);
210 if(len < 0) return -1;
211 outlen += len;
212 }
213 }
214 return outlen;
215}
216
217/* This function hex dumps a buffer of characters */
218
219static int do_hex_dump(char_io *io_ch, void *arg, unsigned char *buf, int buflen)
220{
221 const static char hexdig[] = "0123456789ABCDEF";
222 unsigned char *p, *q;
223 char hextmp[2];
224 if(arg) {
225 p = buf;
226 q = buf + buflen;
227 while(p != q) {
228 hextmp[0] = hexdig[*p >> 4];
229 hextmp[1] = hexdig[*p & 0xf];
230 if(!io_ch(arg, hextmp, 2)) return -1;
231 p++;
232 }
233 }
234 return buflen << 1;
235}
236
237/* "dump" a string. This is done when the type is unknown,
238 * or the flags request it. We can either dump the content
239 * octets or the entire DER encoding. This uses the RFC2253
240 * #01234 format.
241 */
242
243int do_dump(unsigned long lflags, char_io *io_ch, void *arg, ASN1_STRING *str)
244{
245 /* Placing the ASN1_STRING in a temp ASN1_TYPE allows
246 * the DER encoding to readily obtained
247 */
248 ASN1_TYPE t;
249 unsigned char *der_buf, *p;
250 int outlen, der_len;
251
252 if(!io_ch(arg, "#", 1)) return -1;
253 /* If we don't dump DER encoding just dump content octets */
254 if(!(lflags & ASN1_STRFLGS_DUMP_DER)) {
255 outlen = do_hex_dump(io_ch, arg, str->data, str->length);
256 if(outlen < 0) return -1;
257 return outlen + 1;
258 }
259 t.type = str->type;
260 t.value.ptr = (char *)str;
261 der_len = i2d_ASN1_TYPE(&t, NULL);
262 der_buf = OPENSSL_malloc(der_len);
263 if(!der_buf) return -1;
264 p = der_buf;
265 i2d_ASN1_TYPE(&t, &p);
266 outlen = do_hex_dump(io_ch, arg, der_buf, der_len);
267 OPENSSL_free(der_buf);
268 if(outlen < 0) return -1;
269 return outlen + 1;
270}
271
272/* Lookup table to convert tags to character widths,
273 * 0 = UTF8 encoded, -1 is used for non string types
274 * otherwise it is the number of bytes per character
275 */
276
277const static char tag2nbyte[] = {
278 -1, -1, -1, -1, -1, /* 0-4 */
279 -1, -1, -1, -1, -1, /* 5-9 */
280 -1, -1, 0, -1, /* 10-13 */
281 -1, -1, -1, -1, /* 15-17 */
282 -1, 1, 1, /* 18-20 */
283 -1, 1, -1,-1, /* 21-24 */
284 -1, 1, -1, /* 25-27 */
285 4, -1, 2 /* 28-30 */
286};
287
288#define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \
289 ASN1_STRFLGS_ESC_QUOTE | \
290 ASN1_STRFLGS_ESC_CTRL | \
291 ASN1_STRFLGS_ESC_MSB)
292
293/* This is the main function, print out an
294 * ASN1_STRING taking note of various escape
295 * and display options. Returns number of
296 * characters written or -1 if an error
297 * occurred.
298 */
299
300static int do_print_ex(char_io *io_ch, void *arg, unsigned long lflags, ASN1_STRING *str)
301{
302 int outlen, len;
303 int type;
304 char quotes;
305 unsigned char flags;
306 quotes = 0;
307 /* Keep a copy of escape flags */
308 flags = (unsigned char)(lflags & ESC_FLAGS);
309
310 type = str->type;
311
312 outlen = 0;
313
314
315 if(lflags & ASN1_STRFLGS_SHOW_TYPE) {
316 const char *tagname;
317 tagname = ASN1_tag2str(type);
318 outlen += strlen(tagname);
319 if(!io_ch(arg, tagname, outlen) || !io_ch(arg, ":", 1)) return -1;
320 outlen++;
321 }
322
323 /* Decide what to do with type, either dump content or display it */
324
325 /* Dump everything */
326 if(lflags & ASN1_STRFLGS_DUMP_ALL) type = -1;
327 /* Ignore the string type */
328 else if(lflags & ASN1_STRFLGS_IGNORE_TYPE) type = 1;
329 else {
330 /* Else determine width based on type */
331 if((type > 0) && (type < 31)) type = tag2nbyte[type];
332 else type = -1;
333 if((type == -1) && !(lflags & ASN1_STRFLGS_DUMP_UNKNOWN)) type = 1;
334 }
335
336 if(type == -1) {
337 len = do_dump(lflags, io_ch, arg, str);
338 if(len < 0) return -1;
339 outlen += len;
340 return outlen;
341 }
342
343 if(lflags & ASN1_STRFLGS_UTF8_CONVERT) {
344 /* Note: if string is UTF8 and we want
345 * to convert to UTF8 then we just interpret
346 * it as 1 byte per character to avoid converting
347 * twice.
348 */
349 if(!type) type = 1;
350 else type |= BUF_TYPE_CONVUTF8;
351 }
352
353 len = do_buf(str->data, str->length, type, flags, &quotes, io_ch, NULL);
354 if(outlen < 0) return -1;
355 outlen += len;
356 if(quotes) outlen += 2;
357 if(!arg) return outlen;
358 if(quotes && !io_ch(arg, "\"", 1)) return -1;
359 do_buf(str->data, str->length, type, flags, NULL, io_ch, arg);
360 if(quotes && !io_ch(arg, "\"", 1)) return -1;
361 return outlen;
362}
363
364/* Used for line indenting: print 'indent' spaces */
365
366static int do_indent(char_io *io_ch, void *arg, int indent)
367{
368 int i;
369 for(i = 0; i < indent; i++)
370 if(!io_ch(arg, " ", 1)) return 0;
371 return 1;
372}
373
374
375static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,
376 int indent, unsigned long flags)
377{
378 int i, prev = -1, orflags, cnt;
379 int fn_opt, fn_nid;
380 ASN1_OBJECT *fn;
381 ASN1_STRING *val;
382 X509_NAME_ENTRY *ent;
383 char objtmp[80];
384 const char *objbuf;
385 int outlen, len;
386 char *sep_dn, *sep_mv, *sep_eq;
387 int sep_dn_len, sep_mv_len, sep_eq_len;
388 if(indent < 0) indent = 0;
389 outlen = indent;
390 if(!do_indent(io_ch, arg, indent)) return -1;
391 switch (flags & XN_FLAG_SEP_MASK)
392 {
393 case XN_FLAG_SEP_MULTILINE:
394 sep_dn = "\n";
395 sep_dn_len = 1;
396 sep_mv = " + ";
397 sep_mv_len = 3;
398 break;
399
400 case XN_FLAG_SEP_COMMA_PLUS:
401 sep_dn = ",";
402 sep_dn_len = 1;
403 sep_mv = "+";
404 sep_mv_len = 1;
405 indent = 0;
406 break;
407
408 case XN_FLAG_SEP_CPLUS_SPC:
409 sep_dn = ", ";
410 sep_dn_len = 2;
411 sep_mv = " + ";
412 sep_mv_len = 3;
413 indent = 0;
414 break;
415
416 case XN_FLAG_SEP_SPLUS_SPC:
417 sep_dn = "; ";
418 sep_dn_len = 2;
419 sep_mv = " + ";
420 sep_mv_len = 3;
421 indent = 0;
422 break;
423
424 default:
425 return -1;
426 }
427
428 if(flags & XN_FLAG_SPC_EQ) {
429 sep_eq = " = ";
430 sep_eq_len = 3;
431 } else {
432 sep_eq = "=";
433 sep_eq_len = 1;
434 }
435
436 fn_opt = flags & XN_FLAG_FN_MASK;
437
438 cnt = X509_NAME_entry_count(n);
439 for(i = 0; i < cnt; i++) {
440 if(flags & XN_FLAG_DN_REV)
441 ent = X509_NAME_get_entry(n, cnt - i - 1);
442 else ent = X509_NAME_get_entry(n, i);
443 if(prev != -1) {
444 if(prev == ent->set) {
445 if(!io_ch(arg, sep_mv, sep_mv_len)) return -1;
446 outlen += sep_mv_len;
447 } else {
448 if(!io_ch(arg, sep_dn, sep_dn_len)) return -1;
449 outlen += sep_dn_len;
450 if(!do_indent(io_ch, arg, indent)) return -1;
451 outlen += indent;
452 }
453 }
454 prev = ent->set;
455 fn = X509_NAME_ENTRY_get_object(ent);
456 val = X509_NAME_ENTRY_get_data(ent);
457 fn_nid = OBJ_obj2nid(fn);
458 if(fn_opt != XN_FLAG_FN_NONE) {
459 int objlen;
460 if((fn_opt == XN_FLAG_FN_OID) || (fn_nid==NID_undef) ) {
461 OBJ_obj2txt(objtmp, 80, fn, 1);
462 objbuf = objtmp;
463 } else {
464 if(fn_opt == XN_FLAG_FN_SN)
465 objbuf = OBJ_nid2sn(fn_nid);
466 else if(fn_opt == XN_FLAG_FN_LN)
467 objbuf = OBJ_nid2ln(fn_nid);
468 else objbuf = "";
469 }
470 objlen = strlen(objbuf);
471 if(!io_ch(arg, objbuf, objlen)) return -1;
472 if(!io_ch(arg, sep_eq, sep_eq_len)) return -1;
473 outlen += objlen + sep_eq_len;
474 }
475 /* If the field name is unknown then fix up the DER dump
476 * flag. We might want to limit this further so it will
477 * DER dump on anything other than a few 'standard' fields.
478 */
479 if((fn_nid == NID_undef) && (flags & XN_FLAG_DUMP_UNKNOWN_FIELDS))
480 orflags = ASN1_STRFLGS_DUMP_ALL;
481 else orflags = 0;
482
483 len = do_print_ex(io_ch, arg, flags | orflags, val);
484 if(len < 0) return -1;
485 outlen += len;
486 }
487 return outlen;
488}
489
490/* Wrappers round the main functions */
491
492int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags)
493{
494 return do_name_ex(send_bio_chars, out, nm, indent, flags);
495}
496
497
498int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags)
499{
500 return do_name_ex(send_fp_chars, fp, nm, indent, flags);
501}
502
503int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags)
504{
505 return do_print_ex(send_bio_chars, out, flags, str);
506}
507
508
509int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags)
510{
511 return do_print_ex(send_fp_chars, fp, flags, str);
512}
513
514/* Utility function: convert any string type to UTF8, returns number of bytes
515 * in output string or a negative error code
516 */
517
518int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in)
519{
520 ASN1_STRING stmp, *str = &stmp;
521 int mbflag, type, ret;
522 if(!*out || !in) return -1;
523 type = in->type;
524 if((type < 0) || (type > 30)) return -1;
525 mbflag = tag2nbyte[type];
526 if(mbflag == -1) return -1;
527 mbflag |= MBSTRING_FLAG;
528 stmp.data = NULL;
529 ret = ASN1_mbstring_copy(&str, in->data, in->length, mbflag, B_ASN1_UTF8STRING);
530 if(ret < 0) return ret;
531 if(out) *out = stmp.data;
532 return stmp.length;
533}
diff --git a/src/lib/libcrypto/asn1/a_strnid.c b/src/lib/libcrypto/asn1/a_strnid.c
index ab8417ffab..6b10cff994 100644
--- a/src/lib/libcrypto/asn1/a_strnid.c
+++ b/src/lib/libcrypto/asn1/a_strnid.c
@@ -65,8 +65,9 @@
65 65
66static STACK_OF(ASN1_STRING_TABLE) *stable = NULL; 66static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
67static void st_free(ASN1_STRING_TABLE *tbl); 67static void st_free(ASN1_STRING_TABLE *tbl);
68static int sk_table_cmp(ASN1_STRING_TABLE **a, ASN1_STRING_TABLE **b); 68static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
69static int table_cmp(ASN1_STRING_TABLE *a, ASN1_STRING_TABLE *b); 69 const ASN1_STRING_TABLE * const *b);
70static int table_cmp(const void *a, const void *b);
70 71
71 72
72/* This is the global mask for the mbstring functions: this is use to 73/* This is the global mask for the mbstring functions: this is use to
@@ -173,14 +174,16 @@ static ASN1_STRING_TABLE tbl_standard[] = {
173{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK} 174{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}
174}; 175};
175 176
176static int sk_table_cmp(ASN1_STRING_TABLE **a, ASN1_STRING_TABLE **b) 177static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
178 const ASN1_STRING_TABLE * const *b)
177{ 179{
178 return (*a)->nid - (*b)->nid; 180 return (*a)->nid - (*b)->nid;
179} 181}
180 182
181static int table_cmp(ASN1_STRING_TABLE *a, ASN1_STRING_TABLE *b) 183static int table_cmp(const void *a, const void *b)
182{ 184{
183 return a->nid - b->nid; 185 const ASN1_STRING_TABLE *sa = a, *sb = b;
186 return sa->nid - sb->nid;
184} 187}
185 188
186ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid) 189ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid)
@@ -192,7 +195,7 @@ ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid)
192 ttmp = (ASN1_STRING_TABLE *) OBJ_bsearch((char *)&fnd, 195 ttmp = (ASN1_STRING_TABLE *) OBJ_bsearch((char *)&fnd,
193 (char *)tbl_standard, 196 (char *)tbl_standard,
194 sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE), 197 sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE),
195 sizeof(ASN1_STRING_TABLE), (int(*)())table_cmp); 198 sizeof(ASN1_STRING_TABLE), table_cmp);
196 if(ttmp) return ttmp; 199 if(ttmp) return ttmp;
197 if(!stable) return NULL; 200 if(!stable) return NULL;
198 idx = sk_ASN1_STRING_TABLE_find(stable, &fnd); 201 idx = sk_ASN1_STRING_TABLE_find(stable, &fnd);
@@ -213,7 +216,7 @@ int ASN1_STRING_TABLE_add(int nid,
213 return 0; 216 return 0;
214 } 217 }
215 if(!(tmp = ASN1_STRING_TABLE_get(nid))) { 218 if(!(tmp = ASN1_STRING_TABLE_get(nid))) {
216 tmp = Malloc(sizeof(ASN1_STRING_TABLE)); 219 tmp = OPENSSL_malloc(sizeof(ASN1_STRING_TABLE));
217 if(!tmp) { 220 if(!tmp) {
218 ASN1err(ASN1_F_ASN1_STRING_TABLE_ADD, 221 ASN1err(ASN1_F_ASN1_STRING_TABLE_ADD,
219 ERR_R_MALLOC_FAILURE); 222 ERR_R_MALLOC_FAILURE);
@@ -241,7 +244,7 @@ void ASN1_STRING_TABLE_cleanup(void)
241 244
242static void st_free(ASN1_STRING_TABLE *tbl) 245static void st_free(ASN1_STRING_TABLE *tbl)
243{ 246{
244 if(tbl->flags & STABLE_FLAGS_MALLOC) Free(tbl); 247 if(tbl->flags & STABLE_FLAGS_MALLOC) OPENSSL_free(tbl);
245} 248}
246 249
247IMPLEMENT_STACK_OF(ASN1_STRING_TABLE) 250IMPLEMENT_STACK_OF(ASN1_STRING_TABLE)
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c
index b193f1c71f..8c0ddee4ac 100644
--- a/src/lib/libcrypto/asn1/a_time.c
+++ b/src/lib/libcrypto/asn1/a_time.c
@@ -113,11 +113,9 @@ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length)
113ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) 113ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t)
114 { 114 {
115 struct tm *ts; 115 struct tm *ts;
116#if defined(THREADS) && !defined(WIN32) 116#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
117 struct tm data; 117 struct tm data;
118#endif
119 118
120#if defined(THREADS) && !defined(WIN32)
121 gmtime_r(&t,&data); 119 gmtime_r(&t,&data);
122 ts=&data; /* should return &data, but doesn't on some systems, so we don't even look at the return value */ 120 ts=&data; /* should return &data, but doesn't on some systems, so we don't even look at the return value */
123#else 121#else
diff --git a/src/lib/libcrypto/asn1/a_type.c b/src/lib/libcrypto/asn1/a_type.c
index 161ef81197..e72a6b29e0 100644
--- a/src/lib/libcrypto/asn1/a_type.c
+++ b/src/lib/libcrypto/asn1/a_type.c
@@ -123,6 +123,8 @@ int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp)
123 break; 123 break;
124 case V_ASN1_SET: 124 case V_ASN1_SET:
125 case V_ASN1_SEQUENCE: 125 case V_ASN1_SEQUENCE:
126 case V_ASN1_OTHER:
127 default:
126 if (a->value.set == NULL) 128 if (a->value.set == NULL)
127 r=0; 129 r=0;
128 else 130 else
@@ -159,6 +161,8 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
159 161
160 inf=ASN1_get_object(&q,&len,&tag,&xclass,length); 162 inf=ASN1_get_object(&q,&len,&tag,&xclass,length);
161 if (inf & 0x80) goto err; 163 if (inf & 0x80) goto err;
164 /* If not universal tag we've no idea what it is */
165 if(xclass != V_ASN1_UNIVERSAL) tag = V_ASN1_OTHER;
162 166
163 ASN1_TYPE_component_free(ret); 167 ASN1_TYPE_component_free(ret);
164 168
@@ -245,6 +249,8 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
245 break; 249 break;
246 case V_ASN1_SET: 250 case V_ASN1_SET:
247 case V_ASN1_SEQUENCE: 251 case V_ASN1_SEQUENCE:
252 case V_ASN1_OTHER:
253 default:
248 /* Sets and sequences are left complete */ 254 /* Sets and sequences are left complete */
249 if ((ret->value.set=ASN1_STRING_new()) == NULL) goto err; 255 if ((ret->value.set=ASN1_STRING_new()) == NULL) goto err;
250 ret->value.set->type=tag; 256 ret->value.set->type=tag;
@@ -252,9 +258,6 @@ ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length)
252 if (!ASN1_STRING_set(ret->value.set,p,(int)len)) goto err; 258 if (!ASN1_STRING_set(ret->value.set,p,(int)len)) goto err;
253 p+=len; 259 p+=len;
254 break; 260 break;
255 default:
256 ASN1err(ASN1_F_D2I_ASN1_TYPE,ASN1_R_BAD_TYPE);
257 goto err;
258 } 261 }
259 262
260 ret->type=tag; 263 ret->type=tag;
@@ -282,7 +285,7 @@ void ASN1_TYPE_free(ASN1_TYPE *a)
282 { 285 {
283 if (a == NULL) return; 286 if (a == NULL) return;
284 ASN1_TYPE_component_free(a); 287 ASN1_TYPE_component_free(a);
285 Free(a); 288 OPENSSL_free(a);
286 } 289 }
287 290
288int ASN1_TYPE_get(ASN1_TYPE *a) 291int ASN1_TYPE_get(ASN1_TYPE *a)
@@ -312,6 +315,8 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a)
312 case V_ASN1_OBJECT: 315 case V_ASN1_OBJECT:
313 ASN1_OBJECT_free(a->value.object); 316 ASN1_OBJECT_free(a->value.object);
314 break; 317 break;
318 case V_ASN1_NULL:
319 break;
315 case V_ASN1_INTEGER: 320 case V_ASN1_INTEGER:
316 case V_ASN1_NEG_INTEGER: 321 case V_ASN1_NEG_INTEGER:
317 case V_ASN1_ENUMERATED: 322 case V_ASN1_ENUMERATED:
@@ -333,10 +338,9 @@ static void ASN1_TYPE_component_free(ASN1_TYPE *a)
333 case V_ASN1_UNIVERSALSTRING: 338 case V_ASN1_UNIVERSALSTRING:
334 case V_ASN1_BMPSTRING: 339 case V_ASN1_BMPSTRING:
335 case V_ASN1_UTF8STRING: 340 case V_ASN1_UTF8STRING:
336 ASN1_STRING_free((ASN1_STRING *)a->value.ptr); 341 case V_ASN1_OTHER:
337 break;
338 default: 342 default:
339 /* MEMORY LEAK */ 343 ASN1_STRING_free((ASN1_STRING *)a->value.ptr);
340 break; 344 break;
341 } 345 }
342 a->type=0; 346 a->type=0;
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c
index 07565974e3..d381c9e0d1 100644
--- a/src/lib/libcrypto/asn1/a_utctm.c
+++ b/src/lib/libcrypto/asn1/a_utctm.c
@@ -193,7 +193,8 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
193 { 193 {
194 char *p; 194 char *p;
195 struct tm *ts; 195 struct tm *ts;
196#if defined(THREADS) && !defined(WIN32) 196#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
197
197 struct tm data; 198 struct tm data;
198#endif 199#endif
199 200
@@ -202,7 +203,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
202 if (s == NULL) 203 if (s == NULL)
203 return(NULL); 204 return(NULL);
204 205
205#if defined(THREADS) && !defined(WIN32) 206#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
206 gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ 207 gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */
207 ts=&data; 208 ts=&data;
208#else 209#else
@@ -248,10 +249,10 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
248 p=(char *)s->data; 249 p=(char *)s->data;
249 if ((p == NULL) || (s->length < 14)) 250 if ((p == NULL) || (s->length < 14))
250 { 251 {
251 p=Malloc(20); 252 p=OPENSSL_malloc(20);
252 if (p == NULL) return(NULL); 253 if (p == NULL) return(NULL);
253 if (s->data != NULL) 254 if (s->data != NULL)
254 Free(s->data); 255 OPENSSL_free(s->data);
255 s->data=(unsigned char *)p; 256 s->data=(unsigned char *)p;
256 } 257 }
257 258
@@ -264,3 +265,84 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
264#endif 265#endif
265 return(s); 266 return(s);
266 } 267 }
268
269
270int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
271 {
272 struct tm *tm;
273 int offset;
274 int year;
275
276#define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
277
278 if (s->data[12] == 'Z')
279 offset=0;
280 else
281 {
282 offset = g2(s->data+13)*60+g2(s->data+15);
283 if (s->data[12] == '-')
284 offset = -offset;
285 }
286
287 t -= offset*60; /* FIXME: may overflow in extreme cases */
288
289#if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__)
290 { struct tm data; gmtime_r(&t, &data); tm = &data; }
291#else
292 tm = gmtime(&t);
293#endif
294
295#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
296 year = g2(s->data);
297 if (year < 50)
298 year += 100;
299 return_cmp(year, tm->tm_year);
300 return_cmp(g2(s->data+2) - 1, tm->tm_mon);
301 return_cmp(g2(s->data+4), tm->tm_mday);
302 return_cmp(g2(s->data+6), tm->tm_hour);
303 return_cmp(g2(s->data+8), tm->tm_min);
304 return_cmp(g2(s->data+10), tm->tm_sec);
305#undef g2
306#undef return_cmp
307
308 return 0;
309 }
310
311
312#if 0
313time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s)
314 {
315 struct tm tm;
316 int offset;
317
318 memset(&tm,'\0',sizeof tm);
319
320#define g2(p) (((p)[0]-'0')*10+(p)[1]-'0')
321 tm.tm_year=g2(s->data);
322 if(tm.tm_year < 50)
323 tm.tm_year+=100;
324 tm.tm_mon=g2(s->data+2)-1;
325 tm.tm_mday=g2(s->data+4);
326 tm.tm_hour=g2(s->data+6);
327 tm.tm_min=g2(s->data+8);
328 tm.tm_sec=g2(s->data+10);
329 if(s->data[12] == 'Z')
330 offset=0;
331 else
332 {
333 offset=g2(s->data+13)*60+g2(s->data+15);
334 if(s->data[12] == '-')
335 offset= -offset;
336 }
337#undef g2
338
339 return mktime(&tm)-offset*60; /* FIXME: mktime assumes the current timezone
340 * instead of UTC, and unless we rewrite OpenSSL
341 * in Lisp we cannot locally change the timezone
342 * without possibly interfering with other parts
343 * of the program. timegm, which uses UTC, is
344 * non-standard.
345 * Also time_t is inappropriate for general
346 * UTC times because it may a 32 bit type. */
347 }
348#endif
diff --git a/src/lib/libcrypto/asn1/a_utf8.c b/src/lib/libcrypto/asn1/a_utf8.c
index b5125af224..854278f136 100644
--- a/src/lib/libcrypto/asn1/a_utf8.c
+++ b/src/lib/libcrypto/asn1/a_utf8.c
@@ -133,7 +133,7 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
133 if( ((p[1] & 0xc0) != 0x80) 133 if( ((p[1] & 0xc0) != 0x80)
134 || ((p[2] & 0xc0) != 0x80) 134 || ((p[2] & 0xc0) != 0x80)
135 || ((p[3] & 0xc0) != 0x80) ) return -3; 135 || ((p[3] & 0xc0) != 0x80) ) return -3;
136 value = (*p++ & 0x7) << 18; 136 value = ((unsigned long)(*p++ & 0x7)) << 18;
137 value |= (*p++ & 0x3f) << 12; 137 value |= (*p++ & 0x3f) << 12;
138 value |= (*p++ & 0x3f) << 6; 138 value |= (*p++ & 0x3f) << 6;
139 value |= *p++ & 0x3f; 139 value |= *p++ & 0x3f;
@@ -145,9 +145,9 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
145 || ((p[2] & 0xc0) != 0x80) 145 || ((p[2] & 0xc0) != 0x80)
146 || ((p[3] & 0xc0) != 0x80) 146 || ((p[3] & 0xc0) != 0x80)
147 || ((p[4] & 0xc0) != 0x80) ) return -3; 147 || ((p[4] & 0xc0) != 0x80) ) return -3;
148 value = (*p++ & 0x3) << 24; 148 value = ((unsigned long)(*p++ & 0x3)) << 24;
149 value |= (*p++ & 0x3f) << 18; 149 value |= ((unsigned long)(*p++ & 0x3f)) << 18;
150 value |= (*p++ & 0x3f) << 12; 150 value |= ((unsigned long)(*p++ & 0x3f)) << 12;
151 value |= (*p++ & 0x3f) << 6; 151 value |= (*p++ & 0x3f) << 6;
152 value |= *p++ & 0x3f; 152 value |= *p++ & 0x3f;
153 if(value < 0x200000) return -4; 153 if(value < 0x200000) return -4;
@@ -159,10 +159,10 @@ int UTF8_getc(const unsigned char *str, int len, unsigned long *val)
159 || ((p[3] & 0xc0) != 0x80) 159 || ((p[3] & 0xc0) != 0x80)
160 || ((p[4] & 0xc0) != 0x80) 160 || ((p[4] & 0xc0) != 0x80)
161 || ((p[5] & 0xc0) != 0x80) ) return -3; 161 || ((p[5] & 0xc0) != 0x80) ) return -3;
162 value = (*p++ & 0x1) << 30; 162 value = ((unsigned long)(*p++ & 0x1)) << 30;
163 value |= (*p++ & 0x3f) << 24; 163 value |= ((unsigned long)(*p++ & 0x3f)) << 24;
164 value |= (*p++ & 0x3f) << 18; 164 value |= ((unsigned long)(*p++ & 0x3f)) << 18;
165 value |= (*p++ & 0x3f) << 12; 165 value |= ((unsigned long)(*p++ & 0x3f)) << 12;
166 value |= (*p++ & 0x3f) << 6; 166 value |= (*p++ & 0x3f) << 6;
167 value |= *p++ & 0x3f; 167 value |= *p++ & 0x3f;
168 if(value < 0x4000000) return -4; 168 if(value < 0x4000000) return -4;
diff --git a/src/lib/libcrypto/asn1/a_verify.c b/src/lib/libcrypto/asn1/a_verify.c
index d4aede85c3..2a11927e5c 100644
--- a/src/lib/libcrypto/asn1/a_verify.c
+++ b/src/lib/libcrypto/asn1/a_verify.c
@@ -88,7 +88,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
88 } 88 }
89 89
90 inl=i2d(data,NULL); 90 inl=i2d(data,NULL);
91 buf_in=Malloc((unsigned int)inl); 91 buf_in=OPENSSL_malloc((unsigned int)inl);
92 if (buf_in == NULL) 92 if (buf_in == NULL)
93 { 93 {
94 ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE); 94 ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE);
@@ -101,7 +101,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature,
101 EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); 101 EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl);
102 102
103 memset(buf_in,0,(unsigned int)inl); 103 memset(buf_in,0,(unsigned int)inl);
104 Free(buf_in); 104 OPENSSL_free(buf_in);
105 105
106 if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, 106 if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data,
107 (unsigned int)signature->length,pkey) <= 0) 107 (unsigned int)signature->length,pkey) <= 0)
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h
index 99bd64a11e..6f956b1963 100644
--- a/src/lib/libcrypto/asn1/asn1.h
+++ b/src/lib/libcrypto/asn1/asn1.h
@@ -59,17 +59,18 @@
59#ifndef HEADER_ASN1_H 59#ifndef HEADER_ASN1_H
60#define HEADER_ASN1_H 60#define HEADER_ASN1_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#include <time.h> 62#include <time.h>
63#ifndef NO_BIO
64#include <openssl/bio.h>
65#endif
67#include <openssl/bn.h> 66#include <openssl/bn.h>
68#include <openssl/stack.h> 67#include <openssl/stack.h>
69#include <openssl/safestack.h> 68#include <openssl/safestack.h>
70 69
71#ifdef VMS 70#include <openssl/symhacks.h>
72#include <openssl/vms_idhacks.h> 71
72#ifdef __cplusplus
73extern "C" {
73#endif 74#endif
74 75
75#define V_ASN1_UNIVERSAL 0x00 76#define V_ASN1_UNIVERSAL 0x00
@@ -82,12 +83,15 @@ extern "C" {
82#define V_ASN1_PRIMATIVE_TAG 0x1f 83#define V_ASN1_PRIMATIVE_TAG 0x1f
83 84
84#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ 85#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
86#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */
87
88#define V_ASN1_NEG 0x100 /* negative flag */
85 89
86#define V_ASN1_UNDEF -1 90#define V_ASN1_UNDEF -1
87#define V_ASN1_EOC 0 91#define V_ASN1_EOC 0
88#define V_ASN1_BOOLEAN 1 /**/ 92#define V_ASN1_BOOLEAN 1 /**/
89#define V_ASN1_INTEGER 2 93#define V_ASN1_INTEGER 2
90#define V_ASN1_NEG_INTEGER (2+0x100) 94#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
91#define V_ASN1_BIT_STRING 3 95#define V_ASN1_BIT_STRING 3
92#define V_ASN1_OCTET_STRING 4 96#define V_ASN1_OCTET_STRING 4
93#define V_ASN1_NULL 5 97#define V_ASN1_NULL 5
@@ -96,7 +100,7 @@ extern "C" {
96#define V_ASN1_EXTERNAL 8 100#define V_ASN1_EXTERNAL 8
97#define V_ASN1_REAL 9 101#define V_ASN1_REAL 9
98#define V_ASN1_ENUMERATED 10 102#define V_ASN1_ENUMERATED 10
99#define V_ASN1_NEG_ENUMERATED (10+0x100) 103#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
100#define V_ASN1_UTF8STRING 12 104#define V_ASN1_UTF8STRING 12
101#define V_ASN1_SEQUENCE 16 105#define V_ASN1_SEQUENCE 16
102#define V_ASN1_SET 17 106#define V_ASN1_SET 17
@@ -140,32 +144,10 @@ extern "C" {
140#define MBSTRING_UNIV (MBSTRING_FLAG|3) 144#define MBSTRING_UNIV (MBSTRING_FLAG|3)
141#define MBSTRING_UTF8 (MBSTRING_FLAG|4) 145#define MBSTRING_UTF8 (MBSTRING_FLAG|4)
142 146
143#define DECLARE_ASN1_SET_OF(type) \ 147struct X509_algor_st;
144int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \ 148
145 int (*func)(type *,unsigned char **), int ex_tag, \ 149#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
146 int ex_class, int is_set); \ 150#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
147STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
148 long length, \
149 type *(*func)(type **, \
150 unsigned char **,long), \
151 void (*free_func)(type *), \
152 int ex_tag,int ex_class);
153
154#define IMPLEMENT_ASN1_SET_OF(type) \
155int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
156 int (*func)(type *,unsigned char **), int ex_tag, \
157 int ex_class, int is_set) \
158 { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \
159STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
160 long length, \
161 type *(*func)(type **, \
162 unsigned char **,long), \
163 void (*free_func)(type *), \
164 int ex_tag,int ex_class) \
165 { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \
166 (char *(*)())func, \
167 (void (*)())free_func, \
168 ex_tag,ex_class); }
169 151
170typedef struct asn1_ctx_st 152typedef struct asn1_ctx_st
171 { 153 {
@@ -254,6 +236,7 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE)
254#define ASN1_BMPSTRING ASN1_STRING 236#define ASN1_BMPSTRING ASN1_STRING
255#define ASN1_VISIBLESTRING ASN1_STRING 237#define ASN1_VISIBLESTRING ASN1_STRING
256#define ASN1_UTF8STRING ASN1_STRING 238#define ASN1_UTF8STRING ASN1_STRING
239#define ASN1_BOOLEAN int
257#else 240#else
258typedef struct asn1_string_st ASN1_INTEGER; 241typedef struct asn1_string_st ASN1_INTEGER;
259typedef struct asn1_string_st ASN1_ENUMERATED; 242typedef struct asn1_string_st ASN1_ENUMERATED;
@@ -270,15 +253,99 @@ typedef struct asn1_string_st ASN1_TIME;
270typedef struct asn1_string_st ASN1_GENERALIZEDTIME; 253typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
271typedef struct asn1_string_st ASN1_VISIBLESTRING; 254typedef struct asn1_string_st ASN1_VISIBLESTRING;
272typedef struct asn1_string_st ASN1_UTF8STRING; 255typedef struct asn1_string_st ASN1_UTF8STRING;
256typedef int ASN1_BOOLEAN;
273#endif 257#endif
274 258
275typedef int ASN1_NULL; 259typedef int ASN1_NULL;
276 260
261/* Parameters used by ASN1_STRING_print_ex() */
262
263/* These determine which characters to escape:
264 * RFC2253 special characters, control characters and
265 * MSB set characters
266 */
267
268#define ASN1_STRFLGS_ESC_2253 1
269#define ASN1_STRFLGS_ESC_CTRL 2
270#define ASN1_STRFLGS_ESC_MSB 4
271
272
273/* This flag determines how we do escaping: normally
274 * RC2253 backslash only, set this to use backslash and
275 * quote.
276 */
277
278#define ASN1_STRFLGS_ESC_QUOTE 8
279
280
281/* These three flags are internal use only. */
282
283/* Character is a valid PrintableString character */
284#define CHARTYPE_PRINTABLESTRING 0x10
285/* Character needs escaping if it is the first character */
286#define CHARTYPE_FIRST_ESC_2253 0x20
287/* Character needs escaping if it is the last character */
288#define CHARTYPE_LAST_ESC_2253 0x40
289
290/* NB the internal flags are safely reused below by flags
291 * handled at the top level.
292 */
293
294/* If this is set we convert all character strings
295 * to UTF8 first
296 */
297
298#define ASN1_STRFLGS_UTF8_CONVERT 0x10
299
300/* If this is set we don't attempt to interpret content:
301 * just assume all strings are 1 byte per character. This
302 * will produce some pretty odd looking output!
303 */
304
305#define ASN1_STRFLGS_IGNORE_TYPE 0x20
306
307/* If this is set we include the string type in the output */
308#define ASN1_STRFLGS_SHOW_TYPE 0x40
309
310/* This determines which strings to display and which to
311 * 'dump' (hex dump of content octets or DER encoding). We can
312 * only dump non character strings or everything. If we
313 * don't dump 'unknown' they are interpreted as character
314 * strings with 1 octet per character and are subject to
315 * the usual escaping options.
316 */
317
318#define ASN1_STRFLGS_DUMP_ALL 0x80
319#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
320
321/* These determine what 'dumping' does, we can dump the
322 * content octets or the DER encoding: both use the
323 * RFC2253 #XXXXX notation.
324 */
325
326#define ASN1_STRFLGS_DUMP_DER 0x200
327
328/* All the string flags consistent with RFC2253,
329 * escaping control characters isn't essential in
330 * RFC2253 but it is advisable anyway.
331 */
332
333#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
334 ASN1_STRFLGS_ESC_CTRL | \
335 ASN1_STRFLGS_ESC_MSB | \
336 ASN1_STRFLGS_UTF8_CONVERT | \
337 ASN1_STRFLGS_DUMP_UNKNOWN | \
338 ASN1_STRFLGS_DUMP_DER)
339
340DECLARE_STACK_OF(ASN1_INTEGER)
341DECLARE_ASN1_SET_OF(ASN1_INTEGER)
342
277typedef struct asn1_type_st 343typedef struct asn1_type_st
278 { 344 {
279 int type; 345 int type;
280 union { 346 union {
281 char *ptr; 347 char *ptr;
348 ASN1_BOOLEAN boolean;
282 ASN1_STRING * asn1_string; 349 ASN1_STRING * asn1_string;
283 ASN1_OBJECT * object; 350 ASN1_OBJECT * object;
284 ASN1_INTEGER * integer; 351 ASN1_INTEGER * integer;
@@ -520,6 +587,8 @@ void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
520ASN1_OBJECT * ASN1_OBJECT_new(void ); 587ASN1_OBJECT * ASN1_OBJECT_new(void );
521void ASN1_OBJECT_free(ASN1_OBJECT *a); 588void ASN1_OBJECT_free(ASN1_OBJECT *a);
522int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); 589int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp);
590ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp,
591 long length);
523ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp, 592ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp,
524 long length); 593 long length);
525 594
@@ -542,14 +611,17 @@ unsigned char * ASN1_STRING_data(ASN1_STRING *x);
542ASN1_BIT_STRING * ASN1_BIT_STRING_new(void); 611ASN1_BIT_STRING * ASN1_BIT_STRING_new(void);
543void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a); 612void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a);
544int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); 613int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
614int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
545ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp, 615ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp,
546 long length); 616 long length);
617ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp,
618 long length);
547int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, 619int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
548 int length ); 620 int length );
549int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); 621int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
550int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); 622int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
551 623
552#ifdef HEADER_BIO_H 624#ifndef NO_BIO
553int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, 625int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
554 BIT_STRING_BITNAME *tbl, int indent); 626 BIT_STRING_BITNAME *tbl, int indent);
555#endif 627#endif
@@ -563,8 +635,11 @@ int d2i_ASN1_BOOLEAN(int *a,unsigned char **pp,long length);
563ASN1_INTEGER * ASN1_INTEGER_new(void); 635ASN1_INTEGER * ASN1_INTEGER_new(void);
564void ASN1_INTEGER_free(ASN1_INTEGER *a); 636void ASN1_INTEGER_free(ASN1_INTEGER *a);
565int i2d_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); 637int i2d_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
638int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
566ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp, 639ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp,
567 long length); 640 long length);
641ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp,
642 long length);
568ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp, 643ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp,
569 long length); 644 long length);
570ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); 645ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
@@ -579,6 +654,10 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a,unsigned char **pp,
579int ASN1_UTCTIME_check(ASN1_UTCTIME *a); 654int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
580ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); 655ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t);
581int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str); 656int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str);
657int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
658#if 0
659time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
660#endif
582 661
583int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); 662int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
584ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); 663ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
@@ -673,10 +752,10 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
673int i2d_ASN1_SET(STACK *a, unsigned char **pp, 752int i2d_ASN1_SET(STACK *a, unsigned char **pp,
674 int (*func)(), int ex_tag, int ex_class, int is_set); 753 int (*func)(), int ex_tag, int ex_class, int is_set);
675STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, 754STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
676 char *(*func)(), void (*free_func)(), 755 char *(*func)(), void (*free_func)(void *),
677 int ex_tag, int ex_class); 756 int ex_tag, int ex_class);
678 757
679#ifdef HEADER_BIO_H 758#ifndef NO_BIO
680int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); 759int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
681int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); 760int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size);
682int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); 761int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);
@@ -729,16 +808,21 @@ char *ASN1_dup(int (*i2d)(),char *(*d2i)(),char *x);
729#ifndef NO_FP_API 808#ifndef NO_FP_API
730char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x); 809char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x);
731int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x); 810int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x);
811int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
732#endif 812#endif
733 813
734#ifdef HEADER_BIO_H 814int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
815
816#ifndef NO_BIO
735char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x); 817char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x);
736int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x); 818int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x);
737int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); 819int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
738int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); 820int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
739int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); 821int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
740int ASN1_STRING_print(BIO *bp,ASN1_STRING *v); 822int ASN1_STRING_print(BIO *bp,ASN1_STRING *v);
823int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
741int ASN1_parse(BIO *bp,unsigned char *pp,long len,int indent); 824int ASN1_parse(BIO *bp,unsigned char *pp,long len,int indent);
825int ASN1_parse_dump(BIO *bp,unsigned char *pp,long len,int indent,int dump);
742#endif 826#endif
743const char *ASN1_tag2str(int tag); 827const char *ASN1_tag2str(int tag);
744 828
@@ -768,9 +852,9 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
768 unsigned char *data, int max_len); 852 unsigned char *data, int max_len);
769 853
770STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), 854STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
771 void (*free_func)() ); 855 void (*free_func)(void *) );
772unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, 856unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
773 int *len ); 857 int *len );
774void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)()); 858void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
775ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct); 859ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct);
776 860
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index be8daa8688..77447a5240 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -181,7 +181,7 @@ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
181 int xclass) 181 int xclass)
182 { 182 {
183 unsigned char *p= *pp; 183 unsigned char *p= *pp;
184 int i; 184 int i, ttag;
185 185
186 i=(constructed)?V_ASN1_CONSTRUCTED:0; 186 i=(constructed)?V_ASN1_CONSTRUCTED:0;
187 i|=(xclass&V_ASN1_PRIVATE); 187 i|=(xclass&V_ASN1_PRIVATE);
@@ -190,12 +190,15 @@ void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
190 else 190 else
191 { 191 {
192 *(p++)=i|V_ASN1_PRIMITIVE_TAG; 192 *(p++)=i|V_ASN1_PRIMITIVE_TAG;
193 while (tag > 0x7f) 193 for(i = 0, ttag = tag; ttag > 0; i++) ttag >>=7;
194 ttag = i;
195 while(i-- > 0)
194 { 196 {
195 *(p++)=(tag&0x7f)|0x80; 197 p[i] = tag & 0x7f;
196 tag>>=7; 198 if(i != (ttag - 1)) p[i] |= 0x80;
199 tag >>= 7;
197 } 200 }
198 *(p++)=(tag&0x7f); 201 p += ttag;
199 } 202 }
200 if ((constructed == 2) && (length == 0)) 203 if ((constructed == 2) && (length == 0))
201 *(p++)=0x80; /* der_put_length would output 0 instead */ 204 *(p++)=0x80; /* der_put_length would output 0 instead */
@@ -335,9 +338,9 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)
335 { 338 {
336 c=str->data; 339 c=str->data;
337 if (c == NULL) 340 if (c == NULL)
338 str->data=Malloc(len+1); 341 str->data=OPENSSL_malloc(len+1);
339 else 342 else
340 str->data=Realloc(c,len+1); 343 str->data=OPENSSL_realloc(c,len+1);
341 344
342 if (str->data == NULL) 345 if (str->data == NULL)
343 { 346 {
@@ -365,7 +368,7 @@ ASN1_STRING *ASN1_STRING_type_new(int type)
365 { 368 {
366 ASN1_STRING *ret; 369 ASN1_STRING *ret;
367 370
368 ret=(ASN1_STRING *)Malloc(sizeof(ASN1_STRING)); 371 ret=(ASN1_STRING *)OPENSSL_malloc(sizeof(ASN1_STRING));
369 if (ret == NULL) 372 if (ret == NULL)
370 { 373 {
371 ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW,ERR_R_MALLOC_FAILURE); 374 ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW,ERR_R_MALLOC_FAILURE);
@@ -381,8 +384,8 @@ ASN1_STRING *ASN1_STRING_type_new(int type)
381void ASN1_STRING_free(ASN1_STRING *a) 384void ASN1_STRING_free(ASN1_STRING *a)
382 { 385 {
383 if (a == NULL) return; 386 if (a == NULL) return;
384 if (a->data != NULL) Free(a->data); 387 if (a->data != NULL) OPENSSL_free(a->data);
385 Free(a); 388 OPENSSL_free(a);
386 } 389 }
387 390
388int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b) 391int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b)
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h
index 4f2a82d340..4512ba6cc6 100644
--- a/src/lib/libcrypto/asn1/asn1_mac.h
+++ b/src/lib/libcrypto/asn1/asn1_mac.h
@@ -59,12 +59,12 @@
59#ifndef HEADER_ASN1_MAC_H 59#ifndef HEADER_ASN1_MAC_H
60#define HEADER_ASN1_MAC_H 60#define HEADER_ASN1_MAC_H
61 61
62#include <openssl/asn1.h>
63
62#ifdef __cplusplus 64#ifdef __cplusplus
63extern "C" { 65extern "C" {
64#endif 66#endif
65 67
66#include <openssl/asn1.h>
67
68#ifndef ASN1_MAC_ERR_LIB 68#ifndef ASN1_MAC_ERR_LIB
69#define ASN1_MAC_ERR_LIB ERR_LIB_ASN1 69#define ASN1_MAC_ERR_LIB ERR_LIB_ASN1
70#endif 70#endif
@@ -340,7 +340,7 @@ err:\
340 340
341/* New macros */ 341/* New macros */
342#define M_ASN1_New_Malloc(ret,type) \ 342#define M_ASN1_New_Malloc(ret,type) \
343 if ((ret=(type *)Malloc(sizeof(type))) == NULL) \ 343 if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \
344 { c.line=__LINE__; goto err2; } 344 { c.line=__LINE__; goto err2; }
345 345
346#define M_ASN1_New(arg,func) \ 346#define M_ASN1_New(arg,func) \
diff --git a/src/lib/libcrypto/asn1/asn1_par.c b/src/lib/libcrypto/asn1/asn1_par.c
index d1e9816bad..facfdd27fc 100644
--- a/src/lib/libcrypto/asn1/asn1_par.c
+++ b/src/lib/libcrypto/asn1/asn1_par.c
@@ -65,7 +65,7 @@
65static int asn1_print_info(BIO *bp, int tag, int xclass,int constructed, 65static int asn1_print_info(BIO *bp, int tag, int xclass,int constructed,
66 int indent); 66 int indent);
67static int asn1_parse2(BIO *bp, unsigned char **pp, long length, 67static int asn1_parse2(BIO *bp, unsigned char **pp, long length,
68 int offset, int depth, int indent); 68 int offset, int depth, int indent, int dump);
69static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, 69static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
70 int indent) 70 int indent)
71 { 71 {
@@ -110,11 +110,16 @@ err:
110 110
111int ASN1_parse(BIO *bp, unsigned char *pp, long len, int indent) 111int ASN1_parse(BIO *bp, unsigned char *pp, long len, int indent)
112 { 112 {
113 return(asn1_parse2(bp,&pp,len,0,0,indent)); 113 return(asn1_parse2(bp,&pp,len,0,0,indent,0));
114 }
115
116int ASN1_parse_dump(BIO *bp, unsigned char *pp, long len, int indent, int dump)
117 {
118 return(asn1_parse2(bp,&pp,len,0,0,indent,dump));
114 } 119 }
115 120
116static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset, 121static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
117 int depth, int indent) 122 int depth, int indent, int dump)
118 { 123 {
119 unsigned char *p,*ep,*tot,*op,*opp; 124 unsigned char *p,*ep,*tot,*op,*opp;
120 long len; 125 long len;
@@ -123,7 +128,13 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
123 ASN1_OBJECT *o=NULL; 128 ASN1_OBJECT *o=NULL;
124 ASN1_OCTET_STRING *os=NULL; 129 ASN1_OCTET_STRING *os=NULL;
125 /* ASN1_BMPSTRING *bmp=NULL;*/ 130 /* ASN1_BMPSTRING *bmp=NULL;*/
131 int dump_indent;
126 132
133#if 0
134 dump_indent = indent;
135#else
136 dump_indent = 6; /* Because we know BIO_dump_indent() */
137#endif
127 p= *pp; 138 p= *pp;
128 tot=p+length; 139 tot=p+length;
129 op=p-1; 140 op=p-1;
@@ -178,7 +189,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
178 { 189 {
179 r=asn1_parse2(bp,&p,(long)(tot-p), 190 r=asn1_parse2(bp,&p,(long)(tot-p),
180 offset+(p - *pp),depth+1, 191 offset+(p - *pp),depth+1,
181 indent); 192 indent,dump);
182 if (r == 0) { ret=0; goto end; } 193 if (r == 0) { ret=0; goto end; }
183 if ((r == 2) || (p >= tot)) break; 194 if ((r == 2) || (p >= tot)) break;
184 } 195 }
@@ -188,7 +199,7 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
188 { 199 {
189 r=asn1_parse2(bp,&p,(long)len, 200 r=asn1_parse2(bp,&p,(long)len,
190 offset+(p - *pp),depth+1, 201 offset+(p - *pp),depth+1,
191 indent); 202 indent,dump);
192 if (r == 0) { ret=0; goto end; } 203 if (r == 0) { ret=0; goto end; }
193 } 204 }
194 } 205 }
@@ -273,6 +284,20 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
273 os->length) <= 0) 284 os->length) <= 0)
274 goto end; 285 goto end;
275 } 286 }
287 if (!printable && (os->length > 0)
288 && dump)
289 {
290 if (!nl)
291 {
292 if (BIO_write(bp,"\n",1) <= 0)
293 goto end;
294 }
295 if (BIO_dump_indent(bp,(char *)opp,
296 ((dump == -1 || dump > os->length)?os->length:dump),
297 dump_indent) <= 0)
298 goto end;
299 nl=1;
300 }
276 M_ASN1_OCTET_STRING_free(os); 301 M_ASN1_OCTET_STRING_free(os);
277 os=NULL; 302 os=NULL;
278 } 303 }
@@ -341,6 +366,19 @@ static int asn1_parse2(BIO *bp, unsigned char **pp, long length, int offset,
341 } 366 }
342 M_ASN1_ENUMERATED_free(bs); 367 M_ASN1_ENUMERATED_free(bs);
343 } 368 }
369 else if (len > 0 && dump)
370 {
371 if (!nl)
372 {
373 if (BIO_write(bp,"\n",1) <= 0)
374 goto end;
375 }
376 if (BIO_dump_indent(bp,(char *)p,
377 ((dump == -1 || dump > len)?len:dump),
378 dump_indent) <= 0)
379 goto end;
380 nl=1;
381 }
344 382
345 if (!nl) 383 if (!nl)
346 { 384 {
diff --git a/src/lib/libcrypto/asn1/asn_pack.c b/src/lib/libcrypto/asn1/asn_pack.c
index 662a2626a1..bdf5f130b3 100644
--- a/src/lib/libcrypto/asn1/asn_pack.c
+++ b/src/lib/libcrypto/asn1/asn_pack.c
@@ -65,7 +65,7 @@
65/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ 65/* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */
66 66
67STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), 67STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
68 void (*free_func)()) 68 void (*free_func)(void *))
69{ 69{
70 STACK *sk; 70 STACK *sk;
71 unsigned char *pbuf; 71 unsigned char *pbuf;
@@ -77,7 +77,7 @@ STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
77} 77}
78 78
79/* Turn a STACK structures into an ASN1 encoded SEQUENCE OF structure in a 79/* Turn a STACK structures into an ASN1 encoded SEQUENCE OF structure in a
80 * Malloc'ed buffer 80 * OPENSSL_malloc'ed buffer
81 */ 81 */
82 82
83unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, 83unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
@@ -90,7 +90,7 @@ unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
90 ASN1err(ASN1_F_ASN1_SEQ_PACK,ASN1_R_ENCODE_ERROR); 90 ASN1err(ASN1_F_ASN1_SEQ_PACK,ASN1_R_ENCODE_ERROR);
91 return NULL; 91 return NULL;
92 } 92 }
93 if (!(safe = Malloc (safelen))) { 93 if (!(safe = OPENSSL_malloc (safelen))) {
94 ASN1err(ASN1_F_ASN1_SEQ_PACK,ERR_R_MALLOC_FAILURE); 94 ASN1err(ASN1_F_ASN1_SEQ_PACK,ERR_R_MALLOC_FAILURE);
95 return NULL; 95 return NULL;
96 } 96 }
@@ -134,7 +134,7 @@ ASN1_STRING *ASN1_pack_string (void *obj, int (*i2d)(), ASN1_STRING **oct)
134 ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); 134 ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR);
135 return NULL; 135 return NULL;
136 } 136 }
137 if (!(p = Malloc (octmp->length))) { 137 if (!(p = OPENSSL_malloc (octmp->length))) {
138 ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); 138 ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE);
139 return NULL; 139 return NULL;
140 } 140 }
diff --git a/src/lib/libcrypto/asn1/charmap.h b/src/lib/libcrypto/asn1/charmap.h
new file mode 100644
index 0000000000..bd020a9562
--- /dev/null
+++ b/src/lib/libcrypto/asn1/charmap.h
@@ -0,0 +1,15 @@
1/* Auto generated with chartype.pl script.
2 * Mask of various character properties
3 */
4
5static 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,
8120, 0, 1,40, 0, 0, 0,16,16,16, 0,25,25,16,16,16,
916,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,
1116,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,
1316,16,16,16,16,16,16,16,16,16,16, 0, 0, 0, 0, 2
14};
15
diff --git a/src/lib/libcrypto/asn1/charmap.pl b/src/lib/libcrypto/asn1/charmap.pl
new file mode 100644
index 0000000000..2875c59867
--- /dev/null
+++ b/src/lib/libcrypto/asn1/charmap.pl
@@ -0,0 +1,80 @@
1#!/usr/local/bin/perl -w
2
3use strict;
4
5my ($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
11my $RFC2253_ESC = 1; # Character escaped with \
12my $ESC_CTRL = 2; # Escaped control character
13# These are used with RFC1779 quoting using "
14my $NOESC_QUOTE = 8; # Not escaped if quoted
15my $PSTRING_CHAR = 0x10; # Valid PrintableString character
16my $RFC2253_FIRST_ESC = 0x20; # Escaped with \ if first character
17my $RFC2253_LAST_ESC = 0x40; # Escaped with \ if last character
18
19for($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
66print <<EOF;
67/* Auto generated with chartype.pl script.
68 * Mask of various character properties
69 */
70
71static unsigned char char_type[] = {
72EOF
73
74for($i = 0; $i < 128; $i++) {
75 print("\n") if($i && (($i % 16) == 0));
76 printf("%2d", $arr[$i]);
77 print(",") if ($i != 127);
78}
79print("\n};\n\n");
80
diff --git a/src/lib/libcrypto/asn1/d2i_dsap.c b/src/lib/libcrypto/asn1/d2i_dsap.c
index 6d1c297133..9d4dea6145 100644
--- a/src/lib/libcrypto/asn1/d2i_dsap.c
+++ b/src/lib/libcrypto/asn1/d2i_dsap.c
@@ -64,7 +64,7 @@
64#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/asn1_mac.h> 65#include <openssl/asn1_mac.h>
66 66
67#ifdef NEG_PUBKEY_BUG 67#ifndef NO_NEG_PUBKEY_BUG
68#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER 68#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER
69#endif 69#endif
70 70
diff --git a/src/lib/libcrypto/asn1/d2i_r_pu.c b/src/lib/libcrypto/asn1/d2i_r_pu.c
index d1289f160e..9e5d41cf53 100644
--- a/src/lib/libcrypto/asn1/d2i_r_pu.c
+++ b/src/lib/libcrypto/asn1/d2i_r_pu.c
@@ -64,7 +64,7 @@
64#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/asn1_mac.h> 65#include <openssl/asn1_mac.h>
66 66
67#ifdef NEG_PUBKEY_BUG 67#ifndef NO_NEG_PUBKEY_BUG
68#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER 68#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER
69#endif 69#endif
70 70
diff --git a/src/lib/libcrypto/asn1/d2i_s_pr.c b/src/lib/libcrypto/asn1/d2i_s_pr.c
index dec2a2ebd3..55d5802d70 100644
--- a/src/lib/libcrypto/asn1/d2i_s_pr.c
+++ b/src/lib/libcrypto/asn1/d2i_s_pr.c
@@ -92,6 +92,7 @@ DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length)
92 == NULL) goto err_bn; 92 == NULL) goto err_bn;
93 93
94 M_ASN1_INTEGER_free(bs); 94 M_ASN1_INTEGER_free(bs);
95 bs = NULL;
95 96
96 M_ASN1_D2I_Finish_2(a); 97 M_ASN1_D2I_Finish_2(a);
97err_bn: 98err_bn:
diff --git a/src/lib/libcrypto/asn1/d2i_s_pu.c b/src/lib/libcrypto/asn1/d2i_s_pu.c
index e0adaa0393..0b7d2fafcc 100644
--- a/src/lib/libcrypto/asn1/d2i_s_pu.c
+++ b/src/lib/libcrypto/asn1/d2i_s_pu.c
@@ -66,7 +66,7 @@
66#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/asn1_mac.h> 67#include <openssl/asn1_mac.h>
68 68
69#ifdef NEG_PUBKEY_BUG 69#ifndef NO_NEG_PUBKEY_BUG
70#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER 70#define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER
71#endif 71#endif
72 72
diff --git a/src/lib/libcrypto/asn1/f_enum.c b/src/lib/libcrypto/asn1/f_enum.c
index 3d0b1107cb..56e3cc8df2 100644
--- a/src/lib/libcrypto/asn1/f_enum.c
+++ b/src/lib/libcrypto/asn1/f_enum.c
@@ -153,15 +153,15 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
153 if (num+i > slen) 153 if (num+i > slen)
154 { 154 {
155 if (s == NULL) 155 if (s == NULL)
156 sp=(unsigned char *)Malloc( 156 sp=(unsigned char *)OPENSSL_malloc(
157 (unsigned int)num+i*2); 157 (unsigned int)num+i*2);
158 else 158 else
159 sp=(unsigned char *)Realloc(s, 159 sp=(unsigned char *)OPENSSL_realloc(s,
160 (unsigned int)num+i*2); 160 (unsigned int)num+i*2);
161 if (sp == NULL) 161 if (sp == NULL)
162 { 162 {
163 ASN1err(ASN1_F_A2I_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE); 163 ASN1err(ASN1_F_A2I_ASN1_ENUMERATED,ERR_R_MALLOC_FAILURE);
164 if (s != NULL) Free(s); 164 if (s != NULL) OPENSSL_free(s);
165 goto err; 165 goto err;
166 } 166 }
167 s=sp; 167 s=sp;
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c
index cd57331c3f..6b090f6740 100644
--- a/src/lib/libcrypto/asn1/f_int.c
+++ b/src/lib/libcrypto/asn1/f_int.c
@@ -160,15 +160,15 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size)
160 if (num+i > slen) 160 if (num+i > slen)
161 { 161 {
162 if (s == NULL) 162 if (s == NULL)
163 sp=(unsigned char *)Malloc( 163 sp=(unsigned char *)OPENSSL_malloc(
164 (unsigned int)num+i*2); 164 (unsigned int)num+i*2);
165 else 165 else
166 sp=(unsigned char *)Realloc(s, 166 sp=(unsigned char *)OPENSSL_realloc(s,
167 (unsigned int)num+i*2); 167 (unsigned int)num+i*2);
168 if (sp == NULL) 168 if (sp == NULL)
169 { 169 {
170 ASN1err(ASN1_F_A2I_ASN1_INTEGER,ERR_R_MALLOC_FAILURE); 170 ASN1err(ASN1_F_A2I_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
171 if (s != NULL) Free(s); 171 if (s != NULL) OPENSSL_free(s);
172 goto err; 172 goto err;
173 } 173 }
174 s=sp; 174 s=sp;
diff --git a/src/lib/libcrypto/asn1/f_string.c b/src/lib/libcrypto/asn1/f_string.c
index 088313689a..968698a798 100644
--- a/src/lib/libcrypto/asn1/f_string.c
+++ b/src/lib/libcrypto/asn1/f_string.c
@@ -158,15 +158,15 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
158 if (num+i > slen) 158 if (num+i > slen)
159 { 159 {
160 if (s == NULL) 160 if (s == NULL)
161 sp=(unsigned char *)Malloc( 161 sp=(unsigned char *)OPENSSL_malloc(
162 (unsigned int)num+i*2); 162 (unsigned int)num+i*2);
163 else 163 else
164 sp=(unsigned char *)Realloc(s, 164 sp=(unsigned char *)OPENSSL_realloc(s,
165 (unsigned int)num+i*2); 165 (unsigned int)num+i*2);
166 if (sp == NULL) 166 if (sp == NULL)
167 { 167 {
168 ASN1err(ASN1_F_A2I_ASN1_STRING,ERR_R_MALLOC_FAILURE); 168 ASN1err(ASN1_F_A2I_ASN1_STRING,ERR_R_MALLOC_FAILURE);
169 if (s != NULL) Free(s); 169 if (s != NULL) OPENSSL_free(s);
170 goto err; 170 goto err;
171 } 171 }
172 s=sp; 172 s=sp;
diff --git a/src/lib/libcrypto/asn1/i2d_dhp.c b/src/lib/libcrypto/asn1/i2d_dhp.c
index 61eeb646f9..b1de17fe07 100644
--- a/src/lib/libcrypto/asn1/i2d_dhp.c
+++ b/src/lib/libcrypto/asn1/i2d_dhp.c
@@ -105,7 +105,7 @@ int i2d_DHparams(DH *a, unsigned char **pp)
105 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); 105 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
106 106
107 bs.type=V_ASN1_INTEGER; 107 bs.type=V_ASN1_INTEGER;
108 bs.data=(unsigned char *)Malloc(max+4); 108 bs.data=(unsigned char *)OPENSSL_malloc(max+4);
109 if (bs.data == NULL) 109 if (bs.data == NULL)
110 { 110 {
111 ASN1err(ASN1_F_I2D_DHPARAMS,ERR_R_MALLOC_FAILURE); 111 ASN1err(ASN1_F_I2D_DHPARAMS,ERR_R_MALLOC_FAILURE);
@@ -118,7 +118,7 @@ int i2d_DHparams(DH *a, unsigned char **pp)
118 bs.length=BN_bn2bin(num[i],bs.data); 118 bs.length=BN_bn2bin(num[i],bs.data);
119 i2d_ASN1_INTEGER(&bs,&p); 119 i2d_ASN1_INTEGER(&bs,&p);
120 } 120 }
121 Free(bs.data); 121 OPENSSL_free(bs.data);
122 ret=t; 122 ret=t;
123err: 123err:
124 if (num[2] != NULL) BN_free(num[2]); 124 if (num[2] != NULL) BN_free(num[2]);
diff --git a/src/lib/libcrypto/asn1/i2d_dsap.c b/src/lib/libcrypto/asn1/i2d_dsap.c
index 4021123ba3..157fb43893 100644
--- a/src/lib/libcrypto/asn1/i2d_dsap.c
+++ b/src/lib/libcrypto/asn1/i2d_dsap.c
@@ -94,7 +94,7 @@ int i2d_DSAparams(DSA *a, unsigned char **pp)
94 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); 94 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
95 95
96 bs.type=V_ASN1_INTEGER; 96 bs.type=V_ASN1_INTEGER;
97 bs.data=(unsigned char *)Malloc(max+4); 97 bs.data=(unsigned char *)OPENSSL_malloc(max+4);
98 if (bs.data == NULL) 98 if (bs.data == NULL)
99 { 99 {
100 ASN1err(ASN1_F_I2D_DSAPARAMS,ERR_R_MALLOC_FAILURE); 100 ASN1err(ASN1_F_I2D_DSAPARAMS,ERR_R_MALLOC_FAILURE);
@@ -107,7 +107,7 @@ int i2d_DSAparams(DSA *a, unsigned char **pp)
107 bs.length=BN_bn2bin(num[i],bs.data); 107 bs.length=BN_bn2bin(num[i],bs.data);
108 i2d_ASN1_INTEGER(&bs,&p); 108 i2d_ASN1_INTEGER(&bs,&p);
109 } 109 }
110 Free(bs.data); 110 OPENSSL_free(bs.data);
111 ret=t; 111 ret=t;
112err: 112err:
113 *pp=p; 113 *pp=p;
diff --git a/src/lib/libcrypto/asn1/i2d_r_pr.c b/src/lib/libcrypto/asn1/i2d_r_pr.c
index 1250fa4b2d..88b1aac989 100644
--- a/src/lib/libcrypto/asn1/i2d_r_pr.c
+++ b/src/lib/libcrypto/asn1/i2d_r_pr.c
@@ -107,7 +107,7 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp)
107 107
108 i2d_ASN1_INTEGER(&bs,&p); 108 i2d_ASN1_INTEGER(&bs,&p);
109 109
110 bs.data=(unsigned char *)Malloc(max+4); 110 bs.data=(unsigned char *)OPENSSL_malloc(max+4);
111 if (bs.data == NULL) 111 if (bs.data == NULL)
112 { 112 {
113 ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ERR_R_MALLOC_FAILURE); 113 ASN1err(ASN1_F_I2D_RSAPRIVATEKEY,ERR_R_MALLOC_FAILURE);
@@ -119,7 +119,7 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp)
119 bs.length=BN_bn2bin(num[i],bs.data); 119 bs.length=BN_bn2bin(num[i],bs.data);
120 i2d_ASN1_INTEGER(&bs,&p); 120 i2d_ASN1_INTEGER(&bs,&p);
121 } 121 }
122 Free(bs.data); 122 OPENSSL_free(bs.data);
123 *pp=p; 123 *pp=p;
124 return(t); 124 return(t);
125 } 125 }
diff --git a/src/lib/libcrypto/asn1/i2d_r_pu.c b/src/lib/libcrypto/asn1/i2d_r_pu.c
index 582b92ee4c..8178c2c3b3 100644
--- a/src/lib/libcrypto/asn1/i2d_r_pu.c
+++ b/src/lib/libcrypto/asn1/i2d_r_pu.c
@@ -93,7 +93,7 @@ int i2d_RSAPublicKey(RSA *a, unsigned char **pp)
93 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); 93 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
94 94
95 bs.type=V_ASN1_INTEGER; 95 bs.type=V_ASN1_INTEGER;
96 bs.data=(unsigned char *)Malloc(max+4); 96 bs.data=(unsigned char *)OPENSSL_malloc(max+4);
97 if (bs.data == NULL) 97 if (bs.data == NULL)
98 { 98 {
99 ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ERR_R_MALLOC_FAILURE); 99 ASN1err(ASN1_F_I2D_RSAPUBLICKEY,ERR_R_MALLOC_FAILURE);
@@ -105,7 +105,7 @@ int i2d_RSAPublicKey(RSA *a, unsigned char **pp)
105 bs.length=BN_bn2bin(num[i],bs.data); 105 bs.length=BN_bn2bin(num[i],bs.data);
106 i2d_ASN1_INTEGER(&bs,&p); 106 i2d_ASN1_INTEGER(&bs,&p);
107 } 107 }
108 Free(bs.data); 108 OPENSSL_free(bs.data);
109 *pp=p; 109 *pp=p;
110 return(t); 110 return(t);
111 } 111 }
diff --git a/src/lib/libcrypto/asn1/i2d_s_pr.c b/src/lib/libcrypto/asn1/i2d_s_pr.c
index e399ceaeb9..9922952ad7 100644
--- a/src/lib/libcrypto/asn1/i2d_s_pr.c
+++ b/src/lib/libcrypto/asn1/i2d_s_pr.c
@@ -104,7 +104,7 @@ int i2d_DSAPrivateKey(DSA *a, unsigned char **pp)
104 104
105 i2d_ASN1_INTEGER(&bs,&p); 105 i2d_ASN1_INTEGER(&bs,&p);
106 106
107 bs.data=(unsigned char *)Malloc(max+4); 107 bs.data=(unsigned char *)OPENSSL_malloc(max+4);
108 if (bs.data == NULL) 108 if (bs.data == NULL)
109 { 109 {
110 ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ERR_R_MALLOC_FAILURE); 110 ASN1err(ASN1_F_I2D_DSAPRIVATEKEY,ERR_R_MALLOC_FAILURE);
@@ -116,7 +116,7 @@ int i2d_DSAPrivateKey(DSA *a, unsigned char **pp)
116 bs.length=BN_bn2bin(num[i],bs.data); 116 bs.length=BN_bn2bin(num[i],bs.data);
117 i2d_ASN1_INTEGER(&bs,&p); 117 i2d_ASN1_INTEGER(&bs,&p);
118 } 118 }
119 Free(bs.data); 119 OPENSSL_free(bs.data);
120 *pp=p; 120 *pp=p;
121 return(t); 121 return(t);
122 } 122 }
diff --git a/src/lib/libcrypto/asn1/i2d_s_pu.c b/src/lib/libcrypto/asn1/i2d_s_pu.c
index ca7f251b71..e6014b82a8 100644
--- a/src/lib/libcrypto/asn1/i2d_s_pu.c
+++ b/src/lib/libcrypto/asn1/i2d_s_pu.c
@@ -109,7 +109,7 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp)
109 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); 109 ASN1_put_object(&p,1,tot,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);
110 110
111 bs.type=V_ASN1_INTEGER; 111 bs.type=V_ASN1_INTEGER;
112 bs.data=(unsigned char *)Malloc(max+4); 112 bs.data=(unsigned char *)OPENSSL_malloc(max+4);
113 if (bs.data == NULL) 113 if (bs.data == NULL)
114 { 114 {
115 ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ERR_R_MALLOC_FAILURE); 115 ASN1err(ASN1_F_I2D_DSAPUBLICKEY,ERR_R_MALLOC_FAILURE);
@@ -121,7 +121,7 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp)
121 bs.length=BN_bn2bin(num[i],bs.data); 121 bs.length=BN_bn2bin(num[i],bs.data);
122 i2d_ASN1_INTEGER(&bs,&p); 122 i2d_ASN1_INTEGER(&bs,&p);
123 } 123 }
124 Free(bs.data); 124 OPENSSL_free(bs.data);
125 *pp=p; 125 *pp=p;
126 if(all) return(t); 126 if(all) return(t);
127 else return(tot); 127 else return(tot);
diff --git a/src/lib/libcrypto/asn1/n_pkey.c b/src/lib/libcrypto/asn1/n_pkey.c
index d804986b73..9840193538 100644
--- a/src/lib/libcrypto/asn1/n_pkey.c
+++ b/src/lib/libcrypto/asn1/n_pkey.c
@@ -81,6 +81,11 @@ static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void);
81static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *); 81static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *);
82 82
83int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()) 83int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
84{
85 return i2d_RSA_NET(a, pp, cb, 0);
86}
87
88int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey)
84 { 89 {
85 int i,j,l[6]; 90 int i,j,l[6];
86 NETSCAPE_PKEY *pkey; 91 NETSCAPE_PKEY *pkey;
@@ -139,8 +144,8 @@ int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
139 } 144 }
140 145
141 if (pkey->private_key->data != NULL) 146 if (pkey->private_key->data != NULL)
142 Free(pkey->private_key->data); 147 OPENSSL_free(pkey->private_key->data);
143 if ((pkey->private_key->data=(unsigned char *)Malloc(l[0])) == NULL) 148 if ((pkey->private_key->data=(unsigned char *)OPENSSL_malloc(l[0])) == NULL)
144 { 149 {
145 ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); 150 ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);
146 goto err; 151 goto err;
@@ -148,7 +153,7 @@ int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
148 zz=pkey->private_key->data; 153 zz=pkey->private_key->data;
149 i2d_RSAPrivateKey(a,&zz); 154 i2d_RSAPrivateKey(a,&zz);
150 155
151 if ((os2.data=(unsigned char *)Malloc(os2.length)) == NULL) 156 if ((os2.data=(unsigned char *)OPENSSL_malloc(os2.length)) == NULL)
152 { 157 {
153 ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); 158 ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE);
154 goto err; 159 goto err;
@@ -164,8 +169,18 @@ int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
164 ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ASN1_R_BAD_PASSWORD_READ); 169 ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ASN1_R_BAD_PASSWORD_READ);
165 goto err; 170 goto err;
166 } 171 }
167 EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf, 172 i = strlen((char *)buf);
168 strlen((char *)buf),1,key,NULL); 173 /* If the key is used for SGC the algorithm is modified a little. */
174 if(sgckey){
175 EVP_MD_CTX mctx;
176 EVP_DigestInit(&mctx, EVP_md5());
177 EVP_DigestUpdate(&mctx, buf, i);
178 EVP_DigestFinal(&mctx, buf, NULL);
179 memcpy(buf + 16, "SGCKEYSALT", 10);
180 i = 26;
181 }
182
183 EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);
169 memset(buf,0,256); 184 memset(buf,0,256);
170 185
171 EVP_CIPHER_CTX_init(&ctx); 186 EVP_CIPHER_CTX_init(&ctx);
@@ -182,14 +197,20 @@ int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)())
182 i2d_ASN1_OCTET_STRING(&os2,&p); 197 i2d_ASN1_OCTET_STRING(&os2,&p);
183 ret=l[5]; 198 ret=l[5];
184err: 199err:
185 if (os2.data != NULL) Free(os2.data); 200 if (os2.data != NULL) OPENSSL_free(os2.data);
186 if (alg != NULL) X509_ALGOR_free(alg); 201 if (alg != NULL) X509_ALGOR_free(alg);
187 if (pkey != NULL) NETSCAPE_PKEY_free(pkey); 202 if (pkey != NULL) NETSCAPE_PKEY_free(pkey);
188 r=r; 203 r=r;
189 return(ret); 204 return(ret);
190 } 205 }
191 206
207
192RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()) 208RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)())
209{
210 return d2i_RSA_NET(a, pp, length, cb, 0);
211}
212
213RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey)
193 { 214 {
194 RSA *ret=NULL; 215 RSA *ret=NULL;
195 ASN1_OCTET_STRING *os=NULL; 216 ASN1_OCTET_STRING *os=NULL;
@@ -210,14 +231,24 @@ RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)())
210 } 231 }
211 M_ASN1_BIT_STRING_free(os); 232 M_ASN1_BIT_STRING_free(os);
212 c.q=c.p; 233 c.q=c.p;
213 if ((ret=d2i_Netscape_RSA_2(a,&c.p,c.slen,cb)) == NULL) goto err; 234 if ((ret=d2i_RSA_NET_2(a,&c.p,c.slen,cb, sgckey)) == NULL) goto err;
214 c.slen-=(c.p-c.q); 235 /* Note: some versions of IIS key files use length values that are
236 * too small for the surrounding SEQUENCEs. This following line
237 * effectively disable length checking.
238 */
239 c.slen = 0;
215 240
216 M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA); 241 M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA);
217 } 242 }
218 243
219RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, 244RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length,
220 int (*cb)()) 245 int (*cb)())
246{
247 return d2i_RSA_NET_2(a, pp, length, cb, 0);
248}
249
250RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length,
251 int (*cb)(), int sgckey)
221 { 252 {
222 NETSCAPE_PKEY *pkey=NULL; 253 NETSCAPE_PKEY *pkey=NULL;
223 RSA *ret=NULL; 254 RSA *ret=NULL;
@@ -250,8 +281,17 @@ RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length,
250 goto err; 281 goto err;
251 } 282 }
252 283
253 EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf, 284 i = strlen((char *)buf);
254 strlen((char *)buf),1,key,NULL); 285 if(sgckey){
286 EVP_MD_CTX mctx;
287 EVP_DigestInit(&mctx, EVP_md5());
288 EVP_DigestUpdate(&mctx, buf, i);
289 EVP_DigestFinal(&mctx, buf, NULL);
290 memcpy(buf + 16, "SGCKEYSALT", 10);
291 i = 26;
292 }
293
294 EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL);
255 memset(buf,0,256); 295 memset(buf,0,256);
256 296
257 EVP_CIPHER_CTX_init(&ctx); 297 EVP_CIPHER_CTX_init(&ctx);
@@ -334,7 +374,7 @@ static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a)
334 M_ASN1_INTEGER_free(a->version); 374 M_ASN1_INTEGER_free(a->version);
335 X509_ALGOR_free(a->algor); 375 X509_ALGOR_free(a->algor);
336 M_ASN1_OCTET_STRING_free(a->private_key); 376 M_ASN1_OCTET_STRING_free(a->private_key);
337 Free(a); 377 OPENSSL_free(a);
338 } 378 }
339 379
340#endif /* NO_RC4 */ 380#endif /* NO_RC4 */
diff --git a/src/lib/libcrypto/asn1/nsseq.c b/src/lib/libcrypto/asn1/nsseq.c
index 417d024b81..6e7f09ba23 100644
--- a/src/lib/libcrypto/asn1/nsseq.c
+++ b/src/lib/libcrypto/asn1/nsseq.c
@@ -114,5 +114,5 @@ void NETSCAPE_CERT_SEQUENCE_free (NETSCAPE_CERT_SEQUENCE *a)
114 ASN1_OBJECT_free(a->type); 114 ASN1_OBJECT_free(a->type);
115 if(a->certs) 115 if(a->certs)
116 sk_X509_pop_free(a->certs, X509_free); 116 sk_X509_pop_free(a->certs, X509_free);
117 Free (a); 117 OPENSSL_free (a);
118} 118}
diff --git a/src/lib/libcrypto/asn1/p5_pbe.c b/src/lib/libcrypto/asn1/p5_pbe.c
index a147ac3295..b7ed538eb2 100644
--- a/src/lib/libcrypto/asn1/p5_pbe.c
+++ b/src/lib/libcrypto/asn1/p5_pbe.c
@@ -103,7 +103,7 @@ void PBEPARAM_free (PBEPARAM *a)
103 if(a==NULL) return; 103 if(a==NULL) return;
104 M_ASN1_OCTET_STRING_free(a->salt); 104 M_ASN1_OCTET_STRING_free(a->salt);
105 M_ASN1_INTEGER_free (a->iter); 105 M_ASN1_INTEGER_free (a->iter);
106 Free (a); 106 OPENSSL_free (a);
107} 107}
108 108
109/* Return an algorithm identifier for a PKCS#5 PBE algorithm */ 109/* Return an algorithm identifier for a PKCS#5 PBE algorithm */
@@ -123,7 +123,7 @@ X509_ALGOR *PKCS5_pbe_set(int alg, int iter, unsigned char *salt,
123 if(iter <= 0) iter = PKCS5_DEFAULT_ITER; 123 if(iter <= 0) iter = PKCS5_DEFAULT_ITER;
124 ASN1_INTEGER_set (pbe->iter, iter); 124 ASN1_INTEGER_set (pbe->iter, iter);
125 if (!saltlen) saltlen = PKCS5_SALT_LEN; 125 if (!saltlen) saltlen = PKCS5_SALT_LEN;
126 if (!(pbe->salt->data = Malloc (saltlen))) { 126 if (!(pbe->salt->data = OPENSSL_malloc (saltlen))) {
127 ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE); 127 ASN1err(ASN1_F_ASN1_PBE_SET,ERR_R_MALLOC_FAILURE);
128 return NULL; 128 return NULL;
129 } 129 }
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c
index 1bbdb10c71..6a7b578c0e 100644
--- a/src/lib/libcrypto/asn1/p5_pbev2.c
+++ b/src/lib/libcrypto/asn1/p5_pbev2.c
@@ -104,7 +104,7 @@ void PBE2PARAM_free (PBE2PARAM *a)
104 if(a==NULL) return; 104 if(a==NULL) return;
105 X509_ALGOR_free(a->keyfunc); 105 X509_ALGOR_free(a->keyfunc);
106 X509_ALGOR_free(a->encryption); 106 X509_ALGOR_free(a->encryption);
107 Free (a); 107 OPENSSL_free (a);
108} 108}
109 109
110int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp) 110int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp)
@@ -158,7 +158,7 @@ void PBKDF2PARAM_free (PBKDF2PARAM *a)
158 M_ASN1_INTEGER_free(a->iter); 158 M_ASN1_INTEGER_free(a->iter);
159 M_ASN1_INTEGER_free(a->keylength); 159 M_ASN1_INTEGER_free(a->keylength);
160 X509_ALGOR_free(a->prf); 160 X509_ALGOR_free(a->prf);
161 Free (a); 161 OPENSSL_free (a);
162} 162}
163 163
164/* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm: 164/* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm:
@@ -210,7 +210,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,
210 if(!(osalt = M_ASN1_OCTET_STRING_new())) goto merr; 210 if(!(osalt = M_ASN1_OCTET_STRING_new())) goto merr;
211 211
212 if (!saltlen) saltlen = PKCS5_SALT_LEN; 212 if (!saltlen) saltlen = PKCS5_SALT_LEN;
213 if (!(osalt->data = Malloc (saltlen))) goto merr; 213 if (!(osalt->data = OPENSSL_malloc (saltlen))) goto merr;
214 osalt->length = saltlen; 214 osalt->length = saltlen;
215 if (salt) memcpy (osalt->data, salt, saltlen); 215 if (salt) memcpy (osalt->data, salt, saltlen);
216 else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) goto merr; 216 else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) goto merr;
diff --git a/src/lib/libcrypto/asn1/p7_dgst.c b/src/lib/libcrypto/asn1/p7_dgst.c
index cba90e94a1..c170244616 100644
--- a/src/lib/libcrypto/asn1/p7_dgst.c
+++ b/src/lib/libcrypto/asn1/p7_dgst.c
@@ -116,6 +116,6 @@ void PKCS7_DIGEST_free(PKCS7_DIGEST *a)
116 X509_ALGOR_free(a->md); 116 X509_ALGOR_free(a->md);
117 PKCS7_free(a->contents); 117 PKCS7_free(a->contents);
118 M_ASN1_OCTET_STRING_free(a->digest); 118 M_ASN1_OCTET_STRING_free(a->digest);
119 Free(a); 119 OPENSSL_free(a);
120 } 120 }
121 121
diff --git a/src/lib/libcrypto/asn1/p7_enc.c b/src/lib/libcrypto/asn1/p7_enc.c
index 83b0e15faa..38ccafbdb0 100644
--- a/src/lib/libcrypto/asn1/p7_enc.c
+++ b/src/lib/libcrypto/asn1/p7_enc.c
@@ -106,6 +106,6 @@ void PKCS7_ENCRYPT_free(PKCS7_ENCRYPT *a)
106 if (a == NULL) return; 106 if (a == NULL) return;
107 M_ASN1_INTEGER_free(a->version); 107 M_ASN1_INTEGER_free(a->version);
108 PKCS7_ENC_CONTENT_free(a->enc_data); 108 PKCS7_ENC_CONTENT_free(a->enc_data);
109 Free(a); 109 OPENSSL_free(a);
110 } 110 }
111 111
diff --git a/src/lib/libcrypto/asn1/p7_enc_c.c b/src/lib/libcrypto/asn1/p7_enc_c.c
index 582cc78b06..031178ab52 100644
--- a/src/lib/libcrypto/asn1/p7_enc_c.c
+++ b/src/lib/libcrypto/asn1/p7_enc_c.c
@@ -115,6 +115,6 @@ void PKCS7_ENC_CONTENT_free(PKCS7_ENC_CONTENT *a)
115 ASN1_OBJECT_free(a->content_type); 115 ASN1_OBJECT_free(a->content_type);
116 X509_ALGOR_free(a->algorithm); 116 X509_ALGOR_free(a->algorithm);
117 M_ASN1_OCTET_STRING_free(a->enc_data); 117 M_ASN1_OCTET_STRING_free(a->enc_data);
118 Free(a); 118 OPENSSL_free(a);
119 } 119 }
120 120
diff --git a/src/lib/libcrypto/asn1/p7_evp.c b/src/lib/libcrypto/asn1/p7_evp.c
index 4e734fdd28..60be3e5f66 100644
--- a/src/lib/libcrypto/asn1/p7_evp.c
+++ b/src/lib/libcrypto/asn1/p7_evp.c
@@ -114,6 +114,6 @@ void PKCS7_ENVELOPE_free(PKCS7_ENVELOPE *a)
114 M_ASN1_INTEGER_free(a->version); 114 M_ASN1_INTEGER_free(a->version);
115 sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free); 115 sk_PKCS7_RECIP_INFO_pop_free(a->recipientinfo,PKCS7_RECIP_INFO_free);
116 PKCS7_ENC_CONTENT_free(a->enc_data); 116 PKCS7_ENC_CONTENT_free(a->enc_data);
117 Free(a); 117 OPENSSL_free(a);
118 } 118 }
119 119
diff --git a/src/lib/libcrypto/asn1/p7_i_s.c b/src/lib/libcrypto/asn1/p7_i_s.c
index d21f7ddb84..4a7260a5c8 100644
--- a/src/lib/libcrypto/asn1/p7_i_s.c
+++ b/src/lib/libcrypto/asn1/p7_i_s.c
@@ -106,6 +106,6 @@ void PKCS7_ISSUER_AND_SERIAL_free(PKCS7_ISSUER_AND_SERIAL *a)
106 if (a == NULL) return; 106 if (a == NULL) return;
107 X509_NAME_free(a->issuer); 107 X509_NAME_free(a->issuer);
108 M_ASN1_INTEGER_free(a->serial); 108 M_ASN1_INTEGER_free(a->serial);
109 Free(a); 109 OPENSSL_free(a);
110 } 110 }
111 111
diff --git a/src/lib/libcrypto/asn1/p7_lib.c b/src/lib/libcrypto/asn1/p7_lib.c
index 86db82cfa1..b1196ef581 100644
--- a/src/lib/libcrypto/asn1/p7_lib.c
+++ b/src/lib/libcrypto/asn1/p7_lib.c
@@ -62,6 +62,8 @@
62#include <openssl/pkcs7.h> 62#include <openssl/pkcs7.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64 64
65#ifdef PKCS7_INDEFINITE_ENCODING
66
65int i2d_PKCS7(PKCS7 *a, unsigned char **pp) 67int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
66 { 68 {
67 M_ASN1_I2D_vars(a); 69 M_ASN1_I2D_vars(a);
@@ -102,6 +104,7 @@ int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
102 M_ASN1_I2D_len(a->d.encrypted,i2d_PKCS7_ENCRYPT); 104 M_ASN1_I2D_len(a->d.encrypted,i2d_PKCS7_ENCRYPT);
103 break; 105 break;
104 default: 106 default:
107 M_ASN1_I2D_len(a->d.other,i2d_ASN1_TYPE);
105 break; 108 break;
106 } 109 }
107 } 110 }
@@ -136,6 +139,7 @@ int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
136 M_ASN1_I2D_put(a->d.encrypted,i2d_PKCS7_ENCRYPT); 139 M_ASN1_I2D_put(a->d.encrypted,i2d_PKCS7_ENCRYPT);
137 break; 140 break;
138 default: 141 default:
142 M_ASN1_I2D_put(a->d.other,i2d_ASN1_TYPE);
139 break; 143 break;
140 } 144 }
141 M_ASN1_I2D_INF_seq_end(); 145 M_ASN1_I2D_INF_seq_end();
@@ -144,6 +148,98 @@ int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
144 M_ASN1_I2D_finish(); 148 M_ASN1_I2D_finish();
145 } 149 }
146 150
151#else
152
153int i2d_PKCS7(PKCS7 *a, unsigned char **pp)
154 {
155 int explen = 0;
156 M_ASN1_I2D_vars(a);
157
158 if (a->asn1 != NULL)
159 {
160 if (pp == NULL)
161 return((int)a->length);
162 memcpy(*pp,a->asn1,(int)a->length);
163 *pp+=a->length;
164 return((int)a->length);
165 }
166
167 M_ASN1_I2D_len(a->type,i2d_ASN1_OBJECT);
168 if (a->d.ptr != NULL)
169 {
170 /* Save current length */
171 r = ret;
172 switch (OBJ_obj2nid(a->type))
173 {
174 case NID_pkcs7_data:
175 M_ASN1_I2D_len(a->d.data,i2d_ASN1_OCTET_STRING);
176 break;
177 case NID_pkcs7_signed:
178 M_ASN1_I2D_len(a->d.sign,i2d_PKCS7_SIGNED);
179 break;
180 case NID_pkcs7_enveloped:
181 M_ASN1_I2D_len(a->d.enveloped,i2d_PKCS7_ENVELOPE);
182 break;
183 case NID_pkcs7_signedAndEnveloped:
184 M_ASN1_I2D_len(a->d.signed_and_enveloped,
185 i2d_PKCS7_SIGN_ENVELOPE);
186 break;
187 case NID_pkcs7_digest:
188 M_ASN1_I2D_len(a->d.digest,i2d_PKCS7_DIGEST);
189 break;
190 case NID_pkcs7_encrypted:
191 M_ASN1_I2D_len(a->d.encrypted,i2d_PKCS7_ENCRYPT);
192 break;
193 default:
194 M_ASN1_I2D_len(a->d.other,i2d_ASN1_TYPE);
195 break;
196 }
197 /* Work out explicit tag content size */
198 explen = ret - r;
199 /* Work out explicit tag size: Note: ASN1_object_size
200 * includes the content length.
201 */
202 ret = r + ASN1_object_size(1, explen, 0);
203 }
204
205 M_ASN1_I2D_seq_total();
206
207 M_ASN1_I2D_put(a->type,i2d_ASN1_OBJECT);
208
209 if (a->d.ptr != NULL)
210 {
211 ASN1_put_object(&p, 1, explen, 0, V_ASN1_CONTEXT_SPECIFIC);
212 switch (OBJ_obj2nid(a->type))
213 {
214 case NID_pkcs7_data:
215 M_ASN1_I2D_put(a->d.data,i2d_ASN1_OCTET_STRING);
216 break;
217 case NID_pkcs7_signed:
218 M_ASN1_I2D_put(a->d.sign,i2d_PKCS7_SIGNED);
219 break;
220 case NID_pkcs7_enveloped:
221 M_ASN1_I2D_put(a->d.enveloped,i2d_PKCS7_ENVELOPE);
222 break;
223 case NID_pkcs7_signedAndEnveloped:
224 M_ASN1_I2D_put(a->d.signed_and_enveloped,
225 i2d_PKCS7_SIGN_ENVELOPE);
226 break;
227 case NID_pkcs7_digest:
228 M_ASN1_I2D_put(a->d.digest,i2d_PKCS7_DIGEST);
229 break;
230 case NID_pkcs7_encrypted:
231 M_ASN1_I2D_put(a->d.encrypted,i2d_PKCS7_ENCRYPT);
232 break;
233 default:
234 M_ASN1_I2D_put(a->d.other,i2d_ASN1_TYPE);
235 break;
236 }
237 }
238 M_ASN1_I2D_finish();
239 }
240
241#endif
242
147PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length) 243PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length)
148 { 244 {
149 M_ASN1_D2I_vars(a,PKCS7 *,PKCS7_new); 245 M_ASN1_D2I_vars(a,PKCS7 *,PKCS7_new);
@@ -152,7 +248,7 @@ PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length)
152 { 248 {
153 if ((*a)->asn1 != NULL) 249 if ((*a)->asn1 != NULL)
154 { 250 {
155 Free((*a)->asn1); 251 OPENSSL_free((*a)->asn1);
156 (*a)->asn1=NULL; 252 (*a)->asn1=NULL;
157 } 253 }
158 (*a)->length=0; 254 (*a)->length=0;
@@ -206,10 +302,8 @@ PKCS7 *d2i_PKCS7(PKCS7 **a, unsigned char **pp, long length)
206 M_ASN1_D2I_get(ret->d.encrypted,d2i_PKCS7_ENCRYPT); 302 M_ASN1_D2I_get(ret->d.encrypted,d2i_PKCS7_ENCRYPT);
207 break; 303 break;
208 default: 304 default:
209 c.error=ASN1_R_BAD_PKCS7_TYPE; 305 M_ASN1_D2I_get(ret->d.other,d2i_ASN1_TYPE);
210 c.line=__LINE__; 306 break;
211 goto err;
212 /* break; */
213 } 307 }
214 if (Tinf == (1|V_ASN1_CONSTRUCTED)) 308 if (Tinf == (1|V_ASN1_CONSTRUCTED))
215 { 309 {
@@ -251,7 +345,7 @@ void PKCS7_free(PKCS7 *a)
251 { 345 {
252 ASN1_OBJECT_free(a->type); 346 ASN1_OBJECT_free(a->type);
253 } 347 }
254 Free(a); 348 OPENSSL_free(a);
255 } 349 }
256 350
257void PKCS7_content_free(PKCS7 *a) 351void PKCS7_content_free(PKCS7 *a)
@@ -259,7 +353,7 @@ void PKCS7_content_free(PKCS7 *a)
259 if(a == NULL) 353 if(a == NULL)
260 return; 354 return;
261 355
262 if (a->asn1 != NULL) Free(a->asn1); 356 if (a->asn1 != NULL) OPENSSL_free(a->asn1);
263 357
264 if (a->d.ptr != NULL) 358 if (a->d.ptr != NULL)
265 { 359 {
@@ -286,10 +380,12 @@ void PKCS7_content_free(PKCS7 *a)
286 PKCS7_ENCRYPT_free(a->d.encrypted); 380 PKCS7_ENCRYPT_free(a->d.encrypted);
287 break; 381 break;
288 default: 382 default:
289 /* MEMORY LEAK */ 383 ASN1_TYPE_free(a->d.other);
290 break; 384 break;
291 } 385 }
292 } 386 }
293 a->d.ptr=NULL; 387 a->d.ptr=NULL;
294 } 388 }
295 389
390IMPLEMENT_STACK_OF(PKCS7)
391IMPLEMENT_ASN1_SET_OF(PKCS7)
diff --git a/src/lib/libcrypto/asn1/p7_recip.c b/src/lib/libcrypto/asn1/p7_recip.c
index b1abfa3b8f..5f6c88a2fa 100644
--- a/src/lib/libcrypto/asn1/p7_recip.c
+++ b/src/lib/libcrypto/asn1/p7_recip.c
@@ -118,7 +118,7 @@ void PKCS7_RECIP_INFO_free(PKCS7_RECIP_INFO *a)
118 X509_ALGOR_free(a->key_enc_algor); 118 X509_ALGOR_free(a->key_enc_algor);
119 M_ASN1_OCTET_STRING_free(a->enc_key); 119 M_ASN1_OCTET_STRING_free(a->enc_key);
120 if (a->cert != NULL) X509_free(a->cert); 120 if (a->cert != NULL) X509_free(a->cert);
121 Free(a); 121 OPENSSL_free(a);
122 } 122 }
123 123
124IMPLEMENT_STACK_OF(PKCS7_RECIP_INFO) 124IMPLEMENT_STACK_OF(PKCS7_RECIP_INFO)
diff --git a/src/lib/libcrypto/asn1/p7_s_e.c b/src/lib/libcrypto/asn1/p7_s_e.c
index 3d18fedf8e..709eb24b27 100644
--- a/src/lib/libcrypto/asn1/p7_s_e.c
+++ b/src/lib/libcrypto/asn1/p7_s_e.c
@@ -140,6 +140,6 @@ void PKCS7_SIGN_ENVELOPE_free(PKCS7_SIGN_ENVELOPE *a)
140 sk_X509_pop_free(a->cert,X509_free); 140 sk_X509_pop_free(a->cert,X509_free);
141 sk_X509_CRL_pop_free(a->crl,X509_CRL_free); 141 sk_X509_CRL_pop_free(a->crl,X509_CRL_free);
142 sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free); 142 sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free);
143 Free(a); 143 OPENSSL_free(a);
144 } 144 }
145 145
diff --git a/src/lib/libcrypto/asn1/p7_signd.c b/src/lib/libcrypto/asn1/p7_signd.c
index f6f16a8715..c835f5475f 100644
--- a/src/lib/libcrypto/asn1/p7_signd.c
+++ b/src/lib/libcrypto/asn1/p7_signd.c
@@ -131,5 +131,5 @@ void PKCS7_SIGNED_free(PKCS7_SIGNED *a)
131 sk_X509_pop_free(a->cert,X509_free); 131 sk_X509_pop_free(a->cert,X509_free);
132 sk_X509_CRL_pop_free(a->crl,X509_CRL_free); 132 sk_X509_CRL_pop_free(a->crl,X509_CRL_free);
133 sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free); 133 sk_PKCS7_SIGNER_INFO_pop_free(a->signer_info,PKCS7_SIGNER_INFO_free);
134 Free(a); 134 OPENSSL_free(a);
135 } 135 }
diff --git a/src/lib/libcrypto/asn1/p7_signi.c b/src/lib/libcrypto/asn1/p7_signi.c
index f74658ffe6..248bf00945 100644
--- a/src/lib/libcrypto/asn1/p7_signi.c
+++ b/src/lib/libcrypto/asn1/p7_signi.c
@@ -143,7 +143,7 @@ void PKCS7_SIGNER_INFO_free(PKCS7_SIGNER_INFO *a)
143 sk_X509_ATTRIBUTE_pop_free(a->unauth_attr,X509_ATTRIBUTE_free); 143 sk_X509_ATTRIBUTE_pop_free(a->unauth_attr,X509_ATTRIBUTE_free);
144 if (a->pkey != NULL) 144 if (a->pkey != NULL)
145 EVP_PKEY_free(a->pkey); 145 EVP_PKEY_free(a->pkey);
146 Free(a); 146 OPENSSL_free(a);
147 } 147 }
148 148
149IMPLEMENT_STACK_OF(PKCS7_SIGNER_INFO) 149IMPLEMENT_STACK_OF(PKCS7_SIGNER_INFO)
diff --git a/src/lib/libcrypto/asn1/p8_key.c b/src/lib/libcrypto/asn1/p8_key.c
index 0b24374627..3a31248e14 100644
--- a/src/lib/libcrypto/asn1/p8_key.c
+++ b/src/lib/libcrypto/asn1/p8_key.c
@@ -94,7 +94,7 @@ X509 *X509_KEY_new(void)
94 { 94 {
95 X509_KEY *ret=NULL; 95 X509_KEY *ret=NULL;
96 96
97 M_ASN1_New_Malloc(ret,X509_KEY); 97 M_ASN1_New_OPENSSL_malloc(ret,X509_KEY);
98 ret->references=1; 98 ret->references=1;
99 ret->type=NID 99 ret->type=NID
100 M_ASN1_New(ret->cert_info,X509_CINF_new); 100 M_ASN1_New(ret->cert_info,X509_CINF_new);
@@ -126,6 +126,6 @@ void X509_KEY_free(X509 *a)
126 X509_CINF_free(a->cert_info); 126 X509_CINF_free(a->cert_info);
127 X509_ALGOR_free(a->sig_alg); 127 X509_ALGOR_free(a->sig_alg);
128 ASN1_BIT_STRING_free(a->signature); 128 ASN1_BIT_STRING_free(a->signature);
129 Free(a); 129 OPENSSL_free(a);
130 } 130 }
131 131
diff --git a/src/lib/libcrypto/asn1/p8_pkey.c b/src/lib/libcrypto/asn1/p8_pkey.c
index 59cfbe7f28..fa6cbfb6f8 100644
--- a/src/lib/libcrypto/asn1/p8_pkey.c
+++ b/src/lib/libcrypto/asn1/p8_pkey.c
@@ -123,5 +123,5 @@ void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a)
123 0, a->pkey->value.octet_string->length); 123 0, a->pkey->value.octet_string->length);
124 ASN1_TYPE_free (a->pkey); 124 ASN1_TYPE_free (a->pkey);
125 sk_X509_ATTRIBUTE_pop_free (a->attributes, X509_ATTRIBUTE_free); 125 sk_X509_ATTRIBUTE_pop_free (a->attributes, X509_ATTRIBUTE_free);
126 Free (a); 126 OPENSSL_free (a);
127} 127}
diff --git a/src/lib/libcrypto/asn1/t_pkey.c b/src/lib/libcrypto/asn1/t_pkey.c
index e570ed1c47..ae18da96e3 100644
--- a/src/lib/libcrypto/asn1/t_pkey.c
+++ b/src/lib/libcrypto/asn1/t_pkey.c
@@ -99,7 +99,7 @@ int RSA_print(BIO *bp, RSA *x, int off)
99 int i,ret=0; 99 int i,ret=0;
100 100
101 i=RSA_size(x); 101 i=RSA_size(x);
102 m=(unsigned char *)Malloc((unsigned int)i+10); 102 m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
103 if (m == NULL) 103 if (m == NULL)
104 { 104 {
105 RSAerr(RSA_F_RSA_PRINT,ERR_R_MALLOC_FAILURE); 105 RSAerr(RSA_F_RSA_PRINT,ERR_R_MALLOC_FAILURE);
@@ -133,7 +133,7 @@ int RSA_print(BIO *bp, RSA *x, int off)
133 if (!print(bp,"coefficient:",x->iqmp,m,off)) goto err; 133 if (!print(bp,"coefficient:",x->iqmp,m,off)) goto err;
134 ret=1; 134 ret=1;
135err: 135err:
136 if (m != NULL) Free(m); 136 if (m != NULL) OPENSSL_free(m);
137 return(ret); 137 return(ret);
138 } 138 }
139#endif /* NO_RSA */ 139#endif /* NO_RSA */
@@ -176,7 +176,7 @@ int DSA_print(BIO *bp, DSA *x, int off)
176 i=BN_num_bytes(bn)*2; 176 i=BN_num_bytes(bn)*2;
177 else 177 else
178 i=256; 178 i=256;
179 m=(unsigned char *)Malloc((unsigned int)i+10); 179 m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
180 if (m == NULL) 180 if (m == NULL)
181 { 181 {
182 DSAerr(DSA_F_DSA_PRINT,ERR_R_MALLOC_FAILURE); 182 DSAerr(DSA_F_DSA_PRINT,ERR_R_MALLOC_FAILURE);
@@ -204,7 +204,7 @@ int DSA_print(BIO *bp, DSA *x, int off)
204 if ((x->g != NULL) && !print(bp,"G: ",x->g,m,off)) goto err; 204 if ((x->g != NULL) && !print(bp,"G: ",x->g,m,off)) goto err;
205 ret=1; 205 ret=1;
206err: 206err:
207 if (m != NULL) Free(m); 207 if (m != NULL) OPENSSL_free(m);
208 return(ret); 208 return(ret);
209 } 209 }
210#endif /* !NO_DSA */ 210#endif /* !NO_DSA */
@@ -284,7 +284,7 @@ int DHparams_print(BIO *bp, DH *x)
284 int reason=ERR_R_BUF_LIB,i,ret=0; 284 int reason=ERR_R_BUF_LIB,i,ret=0;
285 285
286 i=BN_num_bytes(x->p); 286 i=BN_num_bytes(x->p);
287 m=(unsigned char *)Malloc((unsigned int)i+10); 287 m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
288 if (m == NULL) 288 if (m == NULL)
289 { 289 {
290 reason=ERR_R_MALLOC_FAILURE; 290 reason=ERR_R_MALLOC_FAILURE;
@@ -307,7 +307,7 @@ int DHparams_print(BIO *bp, DH *x)
307err: 307err:
308 DHerr(DH_F_DHPARAMS_PRINT,reason); 308 DHerr(DH_F_DHPARAMS_PRINT,reason);
309 } 309 }
310 if (m != NULL) Free(m); 310 if (m != NULL) OPENSSL_free(m);
311 return(ret); 311 return(ret);
312 } 312 }
313#endif 313#endif
@@ -337,7 +337,7 @@ int DSAparams_print(BIO *bp, DSA *x)
337 int reason=ERR_R_BUF_LIB,i,ret=0; 337 int reason=ERR_R_BUF_LIB,i,ret=0;
338 338
339 i=BN_num_bytes(x->p); 339 i=BN_num_bytes(x->p);
340 m=(unsigned char *)Malloc((unsigned int)i+10); 340 m=(unsigned char *)OPENSSL_malloc((unsigned int)i+10);
341 if (m == NULL) 341 if (m == NULL)
342 { 342 {
343 reason=ERR_R_MALLOC_FAILURE; 343 reason=ERR_R_MALLOC_FAILURE;
@@ -352,7 +352,7 @@ int DSAparams_print(BIO *bp, DSA *x)
352 if (!print(bp,"g:",x->g,m,4)) goto err; 352 if (!print(bp,"g:",x->g,m,4)) goto err;
353 ret=1; 353 ret=1;
354err: 354err:
355 if (m != NULL) Free(m); 355 if (m != NULL) OPENSSL_free(m);
356 DSAerr(DSA_F_DSAPARAMS_PRINT,reason); 356 DSAerr(DSA_F_DSAPARAMS_PRINT,reason);
357 return(ret); 357 return(ret);
358 } 358 }
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c
index 6ee1065ce9..314bdfb1c7 100644
--- a/src/lib/libcrypto/asn1/t_x509.c
+++ b/src/lib/libcrypto/asn1/t_x509.c
@@ -223,7 +223,7 @@ int X509_print(BIO *bp, X509 *x)
223 ret=1; 223 ret=1;
224err: 224err:
225 if (str != NULL) ASN1_STRING_free(str); 225 if (str != NULL) ASN1_STRING_free(str);
226 if (m != NULL) Free(m); 226 if (m != NULL) OPENSSL_free(m);
227 return(ret); 227 return(ret);
228 } 228 }
229 229
diff --git a/src/lib/libcrypto/asn1/t_x509a.c b/src/lib/libcrypto/asn1/t_x509a.c
index a18ebb586c..f06af5b576 100644
--- a/src/lib/libcrypto/asn1/t_x509a.c
+++ b/src/lib/libcrypto/asn1/t_x509a.c
@@ -98,5 +98,13 @@ int X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent)
98 } else BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); 98 } else BIO_printf(out, "%*sNo Rejected Uses.\n", indent, "");
99 if(aux->alias) BIO_printf(out, "%*sAlias: %s\n", indent, "", 99 if(aux->alias) BIO_printf(out, "%*sAlias: %s\n", indent, "",
100 aux->alias->data); 100 aux->alias->data);
101 if(aux->keyid) {
102 BIO_printf(out, "%*sKey Id: ", indent, "");
103 for(i = 0; i < aux->keyid->length; i++)
104 BIO_printf(out, "%s%02X",
105 i ? ":" : "",
106 aux->keyid->data[i]);
107 BIO_write(out,"\n",1);
108 }
101 return 1; 109 return 1;
102} 110}
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c
index fe023842f8..853a8dfeef 100644
--- a/src/lib/libcrypto/asn1/x_algor.c
+++ b/src/lib/libcrypto/asn1/x_algor.c
@@ -111,7 +111,7 @@ void X509_ALGOR_free(X509_ALGOR *a)
111 if (a == NULL) return; 111 if (a == NULL) return;
112 ASN1_OBJECT_free(a->algorithm); 112 ASN1_OBJECT_free(a->algorithm);
113 ASN1_TYPE_free(a->parameter); 113 ASN1_TYPE_free(a->parameter);
114 Free(a); 114 OPENSSL_free(a);
115 } 115 }
116 116
117IMPLEMENT_STACK_OF(X509_ALGOR) 117IMPLEMENT_STACK_OF(X509_ALGOR)
diff --git a/src/lib/libcrypto/asn1/x_attrib.c b/src/lib/libcrypto/asn1/x_attrib.c
index a874df79db..14e5ea27aa 100644
--- a/src/lib/libcrypto/asn1/x_attrib.c
+++ b/src/lib/libcrypto/asn1/x_attrib.c
@@ -160,6 +160,6 @@ void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a)
160 sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free); 160 sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free);
161 else 161 else
162 ASN1_TYPE_free(a->value.single); 162 ASN1_TYPE_free(a->value.single);
163 Free(a); 163 OPENSSL_free(a);
164 } 164 }
165 165
diff --git a/src/lib/libcrypto/asn1/x_cinf.c b/src/lib/libcrypto/asn1/x_cinf.c
index b87c8fff17..339a110eef 100644
--- a/src/lib/libcrypto/asn1/x_cinf.c
+++ b/src/lib/libcrypto/asn1/x_cinf.c
@@ -196,6 +196,6 @@ void X509_CINF_free(X509_CINF *a)
196 M_ASN1_BIT_STRING_free(a->issuerUID); 196 M_ASN1_BIT_STRING_free(a->issuerUID);
197 M_ASN1_BIT_STRING_free(a->subjectUID); 197 M_ASN1_BIT_STRING_free(a->subjectUID);
198 sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free); 198 sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
199 Free(a); 199 OPENSSL_free(a);
200 } 200 }
201 201
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c
index 12a42d04c7..1f302d0e01 100644
--- a/src/lib/libcrypto/asn1/x_crl.c
+++ b/src/lib/libcrypto/asn1/x_crl.c
@@ -61,8 +61,10 @@
61#include <openssl/asn1_mac.h> 61#include <openssl/asn1_mac.h>
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
64static int X509_REVOKED_cmp(X509_REVOKED **a,X509_REVOKED **b); 64static int X509_REVOKED_cmp(const X509_REVOKED * const *a,
65static int X509_REVOKED_seq_cmp(X509_REVOKED **a,X509_REVOKED **b); 65 const X509_REVOKED * const *b);
66static int X509_REVOKED_seq_cmp(const X509_REVOKED * const *a,
67 const X509_REVOKED * const *b);
66int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **pp) 68int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **pp)
67 { 69 {
68 M_ASN1_I2D_vars(a); 70 M_ASN1_I2D_vars(a);
@@ -100,7 +102,8 @@ int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **pp)
100 { 102 {
101 int v1=0; 103 int v1=0;
102 long l=0; 104 long l=0;
103 int (*old_cmp)(X509_REVOKED **,X509_REVOKED **); 105 int (*old_cmp)(const X509_REVOKED * const *,
106 const X509_REVOKED * const *);
104 M_ASN1_I2D_vars(a); 107 M_ASN1_I2D_vars(a);
105 108
106 old_cmp=sk_X509_REVOKED_set_cmp_func(a->revoked,X509_REVOKED_seq_cmp); 109 old_cmp=sk_X509_REVOKED_set_cmp_func(a->revoked,X509_REVOKED_seq_cmp);
@@ -283,7 +286,7 @@ void X509_REVOKED_free(X509_REVOKED *a)
283 M_ASN1_INTEGER_free(a->serialNumber); 286 M_ASN1_INTEGER_free(a->serialNumber);
284 M_ASN1_UTCTIME_free(a->revocationDate); 287 M_ASN1_UTCTIME_free(a->revocationDate);
285 sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free); 288 sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
286 Free(a); 289 OPENSSL_free(a);
287 } 290 }
288 291
289void X509_CRL_INFO_free(X509_CRL_INFO *a) 292void X509_CRL_INFO_free(X509_CRL_INFO *a)
@@ -297,7 +300,7 @@ void X509_CRL_INFO_free(X509_CRL_INFO *a)
297 M_ASN1_UTCTIME_free(a->nextUpdate); 300 M_ASN1_UTCTIME_free(a->nextUpdate);
298 sk_X509_REVOKED_pop_free(a->revoked,X509_REVOKED_free); 301 sk_X509_REVOKED_pop_free(a->revoked,X509_REVOKED_free);
299 sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free); 302 sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free);
300 Free(a); 303 OPENSSL_free(a);
301 } 304 }
302 305
303void X509_CRL_free(X509_CRL *a) 306void X509_CRL_free(X509_CRL *a)
@@ -322,17 +325,19 @@ void X509_CRL_free(X509_CRL *a)
322 X509_CRL_INFO_free(a->crl); 325 X509_CRL_INFO_free(a->crl);
323 X509_ALGOR_free(a->sig_alg); 326 X509_ALGOR_free(a->sig_alg);
324 M_ASN1_BIT_STRING_free(a->signature); 327 M_ASN1_BIT_STRING_free(a->signature);
325 Free(a); 328 OPENSSL_free(a);
326 } 329 }
327 330
328static int X509_REVOKED_cmp(X509_REVOKED **a, X509_REVOKED **b) 331static int X509_REVOKED_cmp(const X509_REVOKED * const *a,
332 const X509_REVOKED * const *b)
329 { 333 {
330 return(ASN1_STRING_cmp( 334 return(ASN1_STRING_cmp(
331 (ASN1_STRING *)(*a)->serialNumber, 335 (ASN1_STRING *)(*a)->serialNumber,
332 (ASN1_STRING *)(*b)->serialNumber)); 336 (ASN1_STRING *)(*b)->serialNumber));
333 } 337 }
334 338
335static int X509_REVOKED_seq_cmp(X509_REVOKED **a, X509_REVOKED **b) 339static int X509_REVOKED_seq_cmp(const X509_REVOKED * const *a,
340 const X509_REVOKED * const *b)
336 { 341 {
337 return((*a)->sequence-(*b)->sequence); 342 return((*a)->sequence-(*b)->sequence);
338 } 343 }
diff --git a/src/lib/libcrypto/asn1/x_exten.c b/src/lib/libcrypto/asn1/x_exten.c
index 185cbd78a0..fbfd963b40 100644
--- a/src/lib/libcrypto/asn1/x_exten.c
+++ b/src/lib/libcrypto/asn1/x_exten.c
@@ -134,6 +134,6 @@ void X509_EXTENSION_free(X509_EXTENSION *a)
134 if (a == NULL) return; 134 if (a == NULL) return;
135 ASN1_OBJECT_free(a->object); 135 ASN1_OBJECT_free(a->object);
136 M_ASN1_OCTET_STRING_free(a->value); 136 M_ASN1_OCTET_STRING_free(a->value);
137 Free(a); 137 OPENSSL_free(a);
138 } 138 }
139 139
diff --git a/src/lib/libcrypto/asn1/x_info.c b/src/lib/libcrypto/asn1/x_info.c
index 7fdc6f9dc8..5e62fc2f6f 100644
--- a/src/lib/libcrypto/asn1/x_info.c
+++ b/src/lib/libcrypto/asn1/x_info.c
@@ -66,7 +66,7 @@ X509_INFO *X509_INFO_new(void)
66 { 66 {
67 X509_INFO *ret=NULL; 67 X509_INFO *ret=NULL;
68 68
69 ret=(X509_INFO *)Malloc(sizeof(X509_INFO)); 69 ret=(X509_INFO *)OPENSSL_malloc(sizeof(X509_INFO));
70 if (ret == NULL) 70 if (ret == NULL)
71 { 71 {
72 ASN1err(ASN1_F_X509_INFO_NEW,ERR_R_MALLOC_FAILURE); 72 ASN1err(ASN1_F_X509_INFO_NEW,ERR_R_MALLOC_FAILURE);
@@ -106,8 +106,8 @@ void X509_INFO_free(X509_INFO *x)
106 if (x->x509 != NULL) X509_free(x->x509); 106 if (x->x509 != NULL) X509_free(x->x509);
107 if (x->crl != NULL) X509_CRL_free(x->crl); 107 if (x->crl != NULL) X509_CRL_free(x->crl);
108 if (x->x_pkey != NULL) X509_PKEY_free(x->x_pkey); 108 if (x->x_pkey != NULL) X509_PKEY_free(x->x_pkey);
109 if (x->enc_data != NULL) Free(x->enc_data); 109 if (x->enc_data != NULL) OPENSSL_free(x->enc_data);
110 Free(x); 110 OPENSSL_free(x);
111 } 111 }
112 112
113IMPLEMENT_STACK_OF(X509_INFO) 113IMPLEMENT_STACK_OF(X509_INFO)
diff --git a/src/lib/libcrypto/asn1/x_name.c b/src/lib/libcrypto/asn1/x_name.c
index 64baf5719d..b832deb928 100644
--- a/src/lib/libcrypto/asn1/x_name.c
+++ b/src/lib/libcrypto/asn1/x_name.c
@@ -217,7 +217,7 @@ X509_NAME *X509_NAME_new(void)
217 ASN1_CTX c; 217 ASN1_CTX c;
218 218
219 M_ASN1_New_Malloc(ret,X509_NAME); 219 M_ASN1_New_Malloc(ret,X509_NAME);
220 if ((ret->entries=sk_X509_NAME_ENTRY_new(NULL)) == NULL) 220 if ((ret->entries=sk_X509_NAME_ENTRY_new_null()) == NULL)
221 { c.line=__LINE__; goto err2; } 221 { c.line=__LINE__; goto err2; }
222 M_ASN1_New(ret->bytes,BUF_MEM_new); 222 M_ASN1_New(ret->bytes,BUF_MEM_new);
223 ret->modified=1; 223 ret->modified=1;
@@ -246,7 +246,7 @@ void X509_NAME_free(X509_NAME *a)
246 246
247 BUF_MEM_free(a->bytes); 247 BUF_MEM_free(a->bytes);
248 sk_X509_NAME_ENTRY_pop_free(a->entries,X509_NAME_ENTRY_free); 248 sk_X509_NAME_ENTRY_pop_free(a->entries,X509_NAME_ENTRY_free);
249 Free(a); 249 OPENSSL_free(a);
250 } 250 }
251 251
252void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) 252void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a)
@@ -254,7 +254,7 @@ void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a)
254 if (a == NULL) return; 254 if (a == NULL) return;
255 ASN1_OBJECT_free(a->object); 255 ASN1_OBJECT_free(a->object);
256 M_ASN1_BIT_STRING_free(a->value); 256 M_ASN1_BIT_STRING_free(a->value);
257 Free(a); 257 OPENSSL_free(a);
258 } 258 }
259 259
260int X509_NAME_set(X509_NAME **xn, X509_NAME *name) 260int X509_NAME_set(X509_NAME **xn, X509_NAME *name)
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c
index fe58919dbb..f1c6221ac3 100644
--- a/src/lib/libcrypto/asn1/x_pkey.c
+++ b/src/lib/libcrypto/asn1/x_pkey.c
@@ -146,6 +146,6 @@ void X509_PKEY_free(X509_PKEY *x)
146 if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor); 146 if (x->enc_algor != NULL) X509_ALGOR_free(x->enc_algor);
147 if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey); 147 if (x->enc_pkey != NULL) M_ASN1_OCTET_STRING_free(x->enc_pkey);
148 if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey); 148 if (x->dec_pkey != NULL)EVP_PKEY_free(x->dec_pkey);
149 if ((x->key_data != NULL) && (x->key_free)) Free(x->key_data); 149 if ((x->key_data != NULL) && (x->key_free)) OPENSSL_free(x->key_data);
150 Free(x); 150 OPENSSL_free(x);
151 } 151 }
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c
index 7a05d575c9..b2e2a51477 100644
--- a/src/lib/libcrypto/asn1/x_pubkey.c
+++ b/src/lib/libcrypto/asn1/x_pubkey.c
@@ -112,7 +112,7 @@ void X509_PUBKEY_free(X509_PUBKEY *a)
112 X509_ALGOR_free(a->algor); 112 X509_ALGOR_free(a->algor);
113 M_ASN1_BIT_STRING_free(a->public_key); 113 M_ASN1_BIT_STRING_free(a->public_key);
114 if (a->pkey != NULL) EVP_PKEY_free(a->pkey); 114 if (a->pkey != NULL) EVP_PKEY_free(a->pkey);
115 Free(a); 115 OPENSSL_free(a);
116 } 116 }
117 117
118int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) 118int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
@@ -156,14 +156,14 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
156 dsa->write_params=0; 156 dsa->write_params=0;
157 ASN1_TYPE_free(a->parameter); 157 ASN1_TYPE_free(a->parameter);
158 i=i2d_DSAparams(dsa,NULL); 158 i=i2d_DSAparams(dsa,NULL);
159 p=(unsigned char *)Malloc(i); 159 p=(unsigned char *)OPENSSL_malloc(i);
160 pp=p; 160 pp=p;
161 i2d_DSAparams(dsa,&pp); 161 i2d_DSAparams(dsa,&pp);
162 a->parameter=ASN1_TYPE_new(); 162 a->parameter=ASN1_TYPE_new();
163 a->parameter->type=V_ASN1_SEQUENCE; 163 a->parameter->type=V_ASN1_SEQUENCE;
164 a->parameter->value.sequence=ASN1_STRING_new(); 164 a->parameter->value.sequence=ASN1_STRING_new();
165 ASN1_STRING_set(a->parameter->value.sequence,p,i); 165 ASN1_STRING_set(a->parameter->value.sequence,p,i);
166 Free(p); 166 OPENSSL_free(p);
167 } 167 }
168 else 168 else
169#endif 169#endif
@@ -173,7 +173,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
173 } 173 }
174 174
175 if ((i=i2d_PublicKey(pkey,NULL)) <= 0) goto err; 175 if ((i=i2d_PublicKey(pkey,NULL)) <= 0) goto err;
176 if ((s=(unsigned char *)Malloc(i+1)) == NULL) goto err; 176 if ((s=(unsigned char *)OPENSSL_malloc(i+1)) == NULL) goto err;
177 p=s; 177 p=s;
178 i2d_PublicKey(pkey,&p); 178 i2d_PublicKey(pkey,&p);
179 if (!M_ASN1_BIT_STRING_set(pk->public_key,s,i)) goto err; 179 if (!M_ASN1_BIT_STRING_set(pk->public_key,s,i)) goto err;
@@ -181,7 +181,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
181 pk->public_key->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); 181 pk->public_key->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07);
182 pk->public_key->flags|=ASN1_STRING_FLAG_BITS_LEFT; 182 pk->public_key->flags|=ASN1_STRING_FLAG_BITS_LEFT;
183 183
184 Free(s); 184 OPENSSL_free(s);
185 185
186#if 0 186#if 0
187 CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); 187 CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY);
diff --git a/src/lib/libcrypto/asn1/x_req.c b/src/lib/libcrypto/asn1/x_req.c
index 0cd572ee73..6dddd4f653 100644
--- a/src/lib/libcrypto/asn1/x_req.c
+++ b/src/lib/libcrypto/asn1/x_req.c
@@ -65,6 +65,14 @@ int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp)
65 { 65 {
66 M_ASN1_I2D_vars(a); 66 M_ASN1_I2D_vars(a);
67 67
68 if(a->asn1) {
69 if(pp) {
70 memcpy(*pp, a->asn1, a->length);
71 *pp += a->length;
72 }
73 return a->length;
74 }
75
68 M_ASN1_I2D_len(a->version, i2d_ASN1_INTEGER); 76 M_ASN1_I2D_len(a->version, i2d_ASN1_INTEGER);
69 M_ASN1_I2D_len(a->subject, i2d_X509_NAME); 77 M_ASN1_I2D_len(a->subject, i2d_X509_NAME);
70 M_ASN1_I2D_len(a->pubkey, i2d_X509_PUBKEY); 78 M_ASN1_I2D_len(a->pubkey, i2d_X509_PUBKEY);
@@ -152,6 +160,7 @@ X509_REQ_INFO *X509_REQ_INFO_new(void)
152 M_ASN1_New(ret->pubkey,X509_PUBKEY_new); 160 M_ASN1_New(ret->pubkey,X509_PUBKEY_new);
153 M_ASN1_New(ret->attributes,sk_X509_ATTRIBUTE_new_null); 161 M_ASN1_New(ret->attributes,sk_X509_ATTRIBUTE_new_null);
154 ret->req_kludge=0; 162 ret->req_kludge=0;
163 ret->asn1 = NULL;
155 return(ret); 164 return(ret);
156 M_ASN1_New_Error(ASN1_F_X509_REQ_INFO_NEW); 165 M_ASN1_New_Error(ASN1_F_X509_REQ_INFO_NEW);
157 } 166 }
@@ -159,11 +168,12 @@ X509_REQ_INFO *X509_REQ_INFO_new(void)
159void X509_REQ_INFO_free(X509_REQ_INFO *a) 168void X509_REQ_INFO_free(X509_REQ_INFO *a)
160 { 169 {
161 if (a == NULL) return; 170 if (a == NULL) return;
171 if(a->asn1) OPENSSL_free(a->asn1);
162 M_ASN1_INTEGER_free(a->version); 172 M_ASN1_INTEGER_free(a->version);
163 X509_NAME_free(a->subject); 173 X509_NAME_free(a->subject);
164 X509_PUBKEY_free(a->pubkey); 174 X509_PUBKEY_free(a->pubkey);
165 sk_X509_ATTRIBUTE_pop_free(a->attributes,X509_ATTRIBUTE_free); 175 sk_X509_ATTRIBUTE_pop_free(a->attributes,X509_ATTRIBUTE_free);
166 Free(a); 176 OPENSSL_free(a);
167 } 177 }
168 178
169int i2d_X509_REQ(X509_REQ *a, unsigned char **pp) 179int i2d_X509_REQ(X509_REQ *a, unsigned char **pp)
@@ -189,6 +199,17 @@ X509_REQ *d2i_X509_REQ(X509_REQ **a, unsigned char **pp, long length)
189 M_ASN1_D2I_Init(); 199 M_ASN1_D2I_Init();
190 M_ASN1_D2I_start_sequence(); 200 M_ASN1_D2I_start_sequence();
191 M_ASN1_D2I_get(ret->req_info,d2i_X509_REQ_INFO); 201 M_ASN1_D2I_get(ret->req_info,d2i_X509_REQ_INFO);
202
203 /* Keep a copy of the original encoding for signature checking */
204 ret->req_info->length = c.p - c.q;
205 if(!(ret->req_info->asn1 = OPENSSL_malloc(ret->req_info->length))) {
206 c.line=__LINE__;
207 c.error = ERR_R_MALLOC_FAILURE;
208 goto err;
209 }
210
211 memcpy(ret->req_info->asn1, c.q, ret->req_info->length);
212
192 M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); 213 M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR);
193 M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); 214 M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING);
194 M_ASN1_D2I_Finish(a,X509_REQ_free,ASN1_F_D2I_X509_REQ); 215 M_ASN1_D2I_Finish(a,X509_REQ_free,ASN1_F_D2I_X509_REQ);
@@ -230,7 +251,7 @@ void X509_REQ_free(X509_REQ *a)
230 X509_REQ_INFO_free(a->req_info); 251 X509_REQ_INFO_free(a->req_info);
231 X509_ALGOR_free(a->sig_alg); 252 X509_ALGOR_free(a->sig_alg);
232 M_ASN1_BIT_STRING_free(a->signature); 253 M_ASN1_BIT_STRING_free(a->signature);
233 Free(a); 254 OPENSSL_free(a);
234 } 255 }
235 256
236 257
diff --git a/src/lib/libcrypto/asn1/x_sig.c b/src/lib/libcrypto/asn1/x_sig.c
index 3559bd5368..d79f147647 100644
--- a/src/lib/libcrypto/asn1/x_sig.c
+++ b/src/lib/libcrypto/asn1/x_sig.c
@@ -104,7 +104,7 @@ void X509_SIG_free(X509_SIG *a)
104 if (a == NULL) return; 104 if (a == NULL) return;
105 X509_ALGOR_free(a->algor); 105 X509_ALGOR_free(a->algor);
106 M_ASN1_OCTET_STRING_free(a->digest); 106 M_ASN1_OCTET_STRING_free(a->digest);
107 Free(a); 107 OPENSSL_free(a);
108 } 108 }
109 109
110 110
diff --git a/src/lib/libcrypto/asn1/x_spki.c b/src/lib/libcrypto/asn1/x_spki.c
index 8f5e7e6380..4f01888f7d 100644
--- a/src/lib/libcrypto/asn1/x_spki.c
+++ b/src/lib/libcrypto/asn1/x_spki.c
@@ -109,7 +109,7 @@ void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a)
109 if (a == NULL) return; 109 if (a == NULL) return;
110 X509_PUBKEY_free(a->pubkey); 110 X509_PUBKEY_free(a->pubkey);
111 M_ASN1_IA5STRING_free(a->challenge); 111 M_ASN1_IA5STRING_free(a->challenge);
112 Free(a); 112 OPENSSL_free(a);
113 } 113 }
114 114
115int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **pp) 115int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **pp)
@@ -161,6 +161,6 @@ void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a)
161 NETSCAPE_SPKAC_free(a->spkac); 161 NETSCAPE_SPKAC_free(a->spkac);
162 X509_ALGOR_free(a->sig_algor); 162 X509_ALGOR_free(a->sig_algor);
163 M_ASN1_BIT_STRING_free(a->signature); 163 M_ASN1_BIT_STRING_free(a->signature);
164 Free(a); 164 OPENSSL_free(a);
165 } 165 }
166 166
diff --git a/src/lib/libcrypto/asn1/x_val.c b/src/lib/libcrypto/asn1/x_val.c
index 1a2f49ffdf..0f8f020b57 100644
--- a/src/lib/libcrypto/asn1/x_val.c
+++ b/src/lib/libcrypto/asn1/x_val.c
@@ -104,6 +104,6 @@ void X509_VAL_free(X509_VAL *a)
104 if (a == NULL) return; 104 if (a == NULL) return;
105 M_ASN1_TIME_free(a->notBefore); 105 M_ASN1_TIME_free(a->notBefore);
106 M_ASN1_TIME_free(a->notAfter); 106 M_ASN1_TIME_free(a->notAfter);
107 Free(a); 107 OPENSSL_free(a);
108 } 108 }
109 109
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c
index 11e564ea30..61ba856b17 100644
--- a/src/lib/libcrypto/asn1/x_x509.c
+++ b/src/lib/libcrypto/asn1/x_x509.c
@@ -61,6 +61,7 @@
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/asn1_mac.h> 62#include <openssl/asn1_mac.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64#include <openssl/x509v3.h>
64 65
65static int x509_meth_num = 0; 66static int x509_meth_num = 0;
66static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL; 67static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL;
@@ -102,7 +103,7 @@ X509 *d2i_X509(X509 **a, unsigned char **pp, long length)
102 M_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF); 103 M_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF);
103 M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); 104 M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR);
104 M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); 105 M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING);
105 if (ret->name != NULL) Free(ret->name); 106 if (ret->name != NULL) OPENSSL_free(ret->name);
106 ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0); 107 ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
107 108
108 M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); 109 M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509);
@@ -114,11 +115,14 @@ X509 *X509_new(void)
114 ASN1_CTX c; 115 ASN1_CTX c;
115 116
116 M_ASN1_New_Malloc(ret,X509); 117 M_ASN1_New_Malloc(ret,X509);
117 ret->references=1;
118 ret->valid=0; 118 ret->valid=0;
119 ret->references=1;
120 ret->name = NULL;
119 ret->ex_flags = 0; 121 ret->ex_flags = 0;
120 ret->name=NULL; 122 ret->ex_pathlen = -1;
121 ret->aux=NULL; 123 ret->skid = NULL;
124 ret->akid = NULL;
125 ret->aux = NULL;
122 M_ASN1_New(ret->cert_info,X509_CINF_new); 126 M_ASN1_New(ret->cert_info,X509_CINF_new);
123 M_ASN1_New(ret->sig_alg,X509_ALGOR_new); 127 M_ASN1_New(ret->sig_alg,X509_ALGOR_new);
124 M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); 128 M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new);
@@ -151,9 +155,11 @@ void X509_free(X509 *a)
151 X509_ALGOR_free(a->sig_alg); 155 X509_ALGOR_free(a->sig_alg);
152 M_ASN1_BIT_STRING_free(a->signature); 156 M_ASN1_BIT_STRING_free(a->signature);
153 X509_CERT_AUX_free(a->aux); 157 X509_CERT_AUX_free(a->aux);
158 ASN1_OCTET_STRING_free(a->skid);
159 AUTHORITY_KEYID_free(a->akid);
154 160
155 if (a->name != NULL) Free(a->name); 161 if (a->name != NULL) OPENSSL_free(a->name);
156 Free(a); 162 OPENSSL_free(a);
157 } 163 }
158 164
159int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 165int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
diff --git a/src/lib/libcrypto/asn1/x_x509a.c b/src/lib/libcrypto/asn1/x_x509a.c
index b9987ea968..ebcce87bf2 100644
--- a/src/lib/libcrypto/asn1/x_x509a.c
+++ b/src/lib/libcrypto/asn1/x_x509a.c
@@ -112,7 +112,7 @@ void X509_CERT_AUX_free(X509_CERT_AUX *a)
112 ASN1_UTF8STRING_free(a->alias); 112 ASN1_UTF8STRING_free(a->alias);
113 ASN1_OCTET_STRING_free(a->keyid); 113 ASN1_OCTET_STRING_free(a->keyid);
114 sk_X509_ALGOR_pop_free(a->other, X509_ALGOR_free); 114 sk_X509_ALGOR_pop_free(a->other, X509_ALGOR_free);
115 Free(a); 115 OPENSSL_free(a);
116} 116}
117 117
118int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **pp) 118int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **pp)
@@ -153,6 +153,14 @@ int X509_alias_set1(X509 *x, unsigned char *name, int len)
153 return ASN1_STRING_set(aux->alias, name, len); 153 return ASN1_STRING_set(aux->alias, name, len);
154} 154}
155 155
156int X509_keyid_set1(X509 *x, unsigned char *id, int len)
157{
158 X509_CERT_AUX *aux;
159 if(!(aux = aux_get(x))) return 0;
160 if(!aux->keyid && !(aux->keyid = ASN1_OCTET_STRING_new())) return 0;
161 return ASN1_STRING_set(aux->keyid, id, len);
162}
163
156unsigned char *X509_alias_get0(X509 *x, int *len) 164unsigned char *X509_alias_get0(X509 *x, int *len)
157{ 165{
158 if(!x->aux || !x->aux->alias) return NULL; 166 if(!x->aux || !x->aux->alias) return NULL;
diff --git a/src/lib/libcrypto/bf/Makefile.ssl b/src/lib/libcrypto/bf/Makefile.ssl
index cf2f7dd48e..f4eb90f13f 100644
--- a/src/lib/libcrypto/bf/Makefile.ssl
+++ b/src/lib/libcrypto/bf/Makefile.ssl
@@ -77,7 +77,9 @@ links:
77 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST) 77 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
78 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) 78 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
79 79
80install: 80install: installs
81
82installs:
81 @for i in $(EXHEADER) ; \ 83 @for i in $(EXHEADER) ; \
82 do \ 84 do \
83 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ 85 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
diff --git a/src/lib/libcrypto/bf/bftest.c b/src/lib/libcrypto/bf/bftest.c
index 5695250195..cf67cadefd 100644
--- a/src/lib/libcrypto/bf/bftest.c
+++ b/src/lib/libcrypto/bf/bftest.c
@@ -442,7 +442,8 @@ static int test(void)
442 { 442 {
443 BF_set_key(&key,n,key_test); 443 BF_set_key(&key,n,key_test);
444 BF_ecb_encrypt(key_data,out,&key,BF_ENCRYPT); 444 BF_ecb_encrypt(key_data,out,&key,BF_ENCRYPT);
445 if (memcmp(out,&(key_out[n-1][0]),8) != 0) 445 /* mips-sgi-irix6.5-gcc vv -mabi=64 bug workaround */
446 if (memcmp(out,&(key_out[i=n-1][0]),8) != 0)
446 { 447 {
447 printf("blowfish setkey error\n"); 448 printf("blowfish setkey error\n");
448 err=1; 449 err=1;
diff --git a/src/lib/libcrypto/bio/Makefile.ssl b/src/lib/libcrypto/bio/Makefile.ssl
index 755f255fe4..916d651d47 100644
--- a/src/lib/libcrypto/bio/Makefile.ssl
+++ b/src/lib/libcrypto/bio/Makefile.ssl
@@ -27,11 +27,13 @@ LIBSRC= bio_lib.c bio_cb.c bio_err.c \
27 bss_file.c bss_sock.c bss_conn.c \ 27 bss_file.c bss_sock.c bss_conn.c \
28 bf_null.c bf_buff.c b_print.c b_dump.c \ 28 bf_null.c bf_buff.c b_print.c b_dump.c \
29 b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c 29 b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c
30# bf_lbuf.c
30LIBOBJ= bio_lib.o bio_cb.o bio_err.o \ 31LIBOBJ= bio_lib.o bio_cb.o bio_err.o \
31 bss_mem.o bss_null.o bss_fd.o \ 32 bss_mem.o bss_null.o bss_fd.o \
32 bss_file.o bss_sock.o bss_conn.o \ 33 bss_file.o bss_sock.o bss_conn.o \
33 bf_null.o bf_buff.o b_print.o b_dump.o \ 34 bf_null.o bf_buff.o b_print.o b_dump.o \
34 b_sock.o bss_acpt.o bf_nbio.o bss_log.o bss_bio.o 35 b_sock.o bss_acpt.o bf_nbio.o bss_log.o bss_bio.o
36# bf_lbuf.o
35 37
36SRC= $(LIBSRC) 38SRC= $(LIBSRC)
37 39
@@ -89,20 +91,23 @@ clean:
89b_dump.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 91b_dump.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
90b_dump.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 92b_dump.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
91b_dump.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 93b_dump.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
92b_dump.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 94b_dump.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
93b_dump.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 95b_dump.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
96b_dump.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
94b_dump.o: ../cryptlib.h 97b_dump.o: ../cryptlib.h
95b_print.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 98b_print.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
96b_print.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 99b_print.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
97b_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 100b_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
98b_print.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 101b_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
99b_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 102b_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
103b_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
100b_print.o: ../cryptlib.h 104b_print.o: ../cryptlib.h
101b_sock.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 105b_sock.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
102b_sock.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 106b_sock.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
103b_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 107b_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
104b_sock.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 108b_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
105b_sock.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 109b_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
110b_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
106b_sock.o: ../cryptlib.h 111b_sock.o: ../cryptlib.h
107bf_buff.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 112bf_buff.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
108bf_buff.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 113bf_buff.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -111,14 +116,16 @@ bf_buff.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
111bf_buff.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 116bf_buff.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
112bf_buff.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 117bf_buff.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
113bf_buff.o: ../../include/openssl/err.h ../../include/openssl/evp.h 118bf_buff.o: ../../include/openssl/err.h ../../include/openssl/evp.h
114bf_buff.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 119bf_buff.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
120bf_buff.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
115bf_buff.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 121bf_buff.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
116bf_buff.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 122bf_buff.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
117bf_buff.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 123bf_buff.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
118bf_buff.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 124bf_buff.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
119bf_buff.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 125bf_buff.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
120bf_buff.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 126bf_buff.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
121bf_buff.o: ../../include/openssl/stack.h ../cryptlib.h 127bf_buff.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
128bf_buff.o: ../../include/openssl/symhacks.h ../cryptlib.h
122bf_nbio.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 129bf_nbio.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
123bf_nbio.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 130bf_nbio.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
124bf_nbio.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 131bf_nbio.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -126,14 +133,16 @@ bf_nbio.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
126bf_nbio.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 133bf_nbio.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
127bf_nbio.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 134bf_nbio.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
128bf_nbio.o: ../../include/openssl/err.h ../../include/openssl/evp.h 135bf_nbio.o: ../../include/openssl/err.h ../../include/openssl/evp.h
129bf_nbio.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 136bf_nbio.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
137bf_nbio.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
130bf_nbio.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 138bf_nbio.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
131bf_nbio.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 139bf_nbio.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
132bf_nbio.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 140bf_nbio.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
133bf_nbio.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 141bf_nbio.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
134bf_nbio.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 142bf_nbio.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
135bf_nbio.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 143bf_nbio.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
136bf_nbio.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 144bf_nbio.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
145bf_nbio.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
137bf_nbio.o: ../cryptlib.h 146bf_nbio.o: ../cryptlib.h
138bf_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 147bf_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
139bf_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 148bf_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -142,79 +151,93 @@ bf_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
142bf_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 151bf_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
143bf_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 152bf_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
144bf_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h 153bf_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
145bf_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 154bf_null.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
155bf_null.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
146bf_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 156bf_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
147bf_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 157bf_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
148bf_null.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 158bf_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
149bf_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 159bf_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
150bf_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 160bf_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
151bf_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 161bf_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
152bf_null.o: ../../include/openssl/stack.h ../cryptlib.h 162bf_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
163bf_null.o: ../../include/openssl/symhacks.h ../cryptlib.h
153bio_cb.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 164bio_cb.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
154bio_cb.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 165bio_cb.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
155bio_cb.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 166bio_cb.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
156bio_cb.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 167bio_cb.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
157bio_cb.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 168bio_cb.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
169bio_cb.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
158bio_cb.o: ../cryptlib.h 170bio_cb.o: ../cryptlib.h
159bio_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 171bio_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
160bio_err.o: ../../include/openssl/err.h ../../include/openssl/opensslv.h 172bio_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
161bio_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 173bio_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
174bio_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
162bio_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 175bio_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
163bio_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 176bio_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
164bio_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 177bio_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
165bio_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 178bio_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
166bio_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 179bio_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
180bio_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
167bio_lib.o: ../cryptlib.h 181bio_lib.o: ../cryptlib.h
168bss_acpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 182bss_acpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
169bss_acpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 183bss_acpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
170bss_acpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 184bss_acpt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
171bss_acpt.o: ../../include/openssl/opensslconf.h 185bss_acpt.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
172bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 186bss_acpt.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
173bss_acpt.o: ../../include/openssl/stack.h ../cryptlib.h 187bss_acpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
188bss_acpt.o: ../cryptlib.h
174bss_bio.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 189bss_bio.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
175bss_bio.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 190bss_bio.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
176bss_bio.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 191bss_bio.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
177bss_bio.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 192bss_bio.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
178bss_bio.o: ../../include/openssl/stack.h 193bss_bio.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
194bss_bio.o: ../../include/openssl/symhacks.h
179bss_conn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 195bss_conn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
180bss_conn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 196bss_conn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
181bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 197bss_conn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
182bss_conn.o: ../../include/openssl/opensslconf.h 198bss_conn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
183bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 199bss_conn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
184bss_conn.o: ../../include/openssl/stack.h ../cryptlib.h 200bss_conn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
201bss_conn.o: ../cryptlib.h
185bss_fd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 202bss_fd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
186bss_fd.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 203bss_fd.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
187bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 204bss_fd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
188bss_fd.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 205bss_fd.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
189bss_fd.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 206bss_fd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
207bss_fd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
190bss_fd.o: ../cryptlib.h bss_sock.c 208bss_fd.o: ../cryptlib.h bss_sock.c
191bss_file.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 209bss_file.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
192bss_file.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 210bss_file.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
193bss_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 211bss_file.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
194bss_file.o: ../../include/openssl/opensslconf.h 212bss_file.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
195bss_file.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 213bss_file.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
196bss_file.o: ../../include/openssl/stack.h ../cryptlib.h 214bss_file.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
215bss_file.o: ../cryptlib.h
197bss_log.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 216bss_log.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
198bss_log.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 217bss_log.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
199bss_log.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 218bss_log.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
200bss_log.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 219bss_log.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
201bss_log.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 220bss_log.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
221bss_log.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
202bss_log.o: ../cryptlib.h 222bss_log.o: ../cryptlib.h
203bss_mem.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 223bss_mem.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
204bss_mem.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 224bss_mem.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
205bss_mem.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 225bss_mem.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
206bss_mem.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 226bss_mem.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
207bss_mem.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 227bss_mem.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
228bss_mem.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
208bss_mem.o: ../cryptlib.h 229bss_mem.o: ../cryptlib.h
209bss_null.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 230bss_null.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
210bss_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 231bss_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
211bss_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 232bss_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
212bss_null.o: ../../include/openssl/opensslconf.h 233bss_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
213bss_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 234bss_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
214bss_null.o: ../../include/openssl/stack.h ../cryptlib.h 235bss_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
236bss_null.o: ../cryptlib.h
215bss_sock.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 237bss_sock.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
216bss_sock.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 238bss_sock.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
217bss_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 239bss_sock.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
218bss_sock.o: ../../include/openssl/opensslconf.h 240bss_sock.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
219bss_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 241bss_sock.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
220bss_sock.o: ../../include/openssl/stack.h ../cryptlib.h 242bss_sock.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
243bss_sock.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index f5aeb237f5..8397cfab6a 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -66,63 +66,87 @@
66 66
67#define TRUNCATE 67#define TRUNCATE
68#define DUMP_WIDTH 16 68#define DUMP_WIDTH 16
69#define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH-((i-(i>6?6:i)+3)/4))
69 70
70int BIO_dump(BIO *bio, const char *s, int len) 71int BIO_dump(BIO *bio, const char *s, int len)
71{ 72 {
72 int ret=0; 73 return BIO_dump_indent(bio, s, len, 0);
73 char buf[160+1],tmp[20]; 74 }
74 int i,j,rows,trunc;
75 unsigned char ch;
76
77 trunc=0;
78 75
76int BIO_dump_indent(BIO *bio, const char *s, int len, int indent)
77 {
78 int ret=0;
79 char buf[288+1],tmp[20],str[128+1];
80 int i,j,rows,trunc;
81 unsigned char ch;
82 int dump_width;
83
84 trunc=0;
85
79#ifdef TRUNCATE 86#ifdef TRUNCATE
80 for(; (len > 0) && ((s[len-1] == ' ') || (s[len-1] == '\0')); len--) 87 for(; (len > 0) && ((s[len-1] == ' ') || (s[len-1] == '\0')); len--)
81 trunc++; 88 trunc++;
82#endif 89#endif
83 90
84 rows=(len/DUMP_WIDTH); 91 if (indent < 0)
85 if ((rows*DUMP_WIDTH)<len) 92 indent = 0;
86 rows++; 93 if (indent)
87 for(i=0;i<rows;i++) { 94 {
88 buf[0]='\0'; /* start with empty string */ 95 if (indent > 128) indent=128;
89 sprintf(tmp,"%04x - ",i*DUMP_WIDTH); 96 memset(str,' ',indent);
90 strcpy(buf,tmp); 97 }
91 for(j=0;j<DUMP_WIDTH;j++) { 98 str[indent]='\0';
92 if (((i*DUMP_WIDTH)+j)>=len) { 99
93 strcat(buf," "); 100 dump_width=DUMP_WIDTH_LESS_INDENT(indent);
94 } else { 101 rows=(len/dump_width);
95 ch=((unsigned char)*(s+i*DUMP_WIDTH+j)) & 0xff; 102 if ((rows*dump_width)<len)
96 sprintf(tmp,"%02x%c",ch,j==7?'-':' '); 103 rows++;
97 strcat(buf,tmp); 104 for(i=0;i<rows;i++)
98 } 105 {
99 } 106 buf[0]='\0'; /* start with empty string */
100 strcat(buf," "); 107 strcpy(buf,str);
101 for(j=0;j<DUMP_WIDTH;j++) { 108 sprintf(tmp,"%04x - ",i*dump_width);
102 if (((i*DUMP_WIDTH)+j)>=len) 109 strcat(buf,tmp);
103 break; 110 for(j=0;j<dump_width;j++)
104 ch=((unsigned char)*(s+i*DUMP_WIDTH+j)) & 0xff; 111 {
112 if (((i*dump_width)+j)>=len)
113 {
114 strcat(buf," ");
115 }
116 else
117 {
118 ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
119 sprintf(tmp,"%02x%c",ch,j==7?'-':' ');
120 strcat(buf,tmp);
121 }
122 }
123 strcat(buf," ");
124 for(j=0;j<dump_width;j++)
125 {
126 if (((i*dump_width)+j)>=len)
127 break;
128 ch=((unsigned char)*(s+i*dump_width+j)) & 0xff;
105#ifndef CHARSET_EBCDIC 129#ifndef CHARSET_EBCDIC
106 sprintf(tmp,"%c",((ch>=' ')&&(ch<='~'))?ch:'.'); 130 sprintf(tmp,"%c",((ch>=' ')&&(ch<='~'))?ch:'.');
107#else 131#else
108 sprintf(tmp,"%c",((ch>=os_toascii[' '])&&(ch<=os_toascii['~'])) 132 sprintf(tmp,"%c",((ch>=os_toascii[' '])&&(ch<=os_toascii['~']))
109 ? os_toebcdic[ch] 133 ? os_toebcdic[ch]
110 : '.'); 134 : '.');
111#endif 135#endif
112 strcat(buf,tmp); 136 strcat(buf,tmp);
113 } 137 }
114 strcat(buf,"\n"); 138 strcat(buf,"\n");
115 /* if this is the last call then update the ddt_dump thing so that 139 /* if this is the last call then update the ddt_dump thing so that
116 * we will move the selection point in the debug window 140 * we will move the selection point in the debug window
117 */ 141 */
118 ret+=BIO_write(bio,(char *)buf,strlen(buf)); 142 ret+=BIO_write(bio,(char *)buf,strlen(buf));
119 } 143 }
120#ifdef TRUNCATE 144#ifdef TRUNCATE
121 if (trunc > 0) { 145 if (trunc > 0)
122 sprintf(buf,"%04x - <SPACES/NULS>\n",len+trunc); 146 {
123 ret+=BIO_write(bio,(char *)buf,strlen(buf)); 147 sprintf(buf,"%s%04x - <SPACES/NULS>\n",str,len+trunc);
124 } 148 ret+=BIO_write(bio,(char *)buf,strlen(buf));
149 }
125#endif 150#endif
126 return(ret); 151 return(ret);
127} 152 }
128
diff --git a/src/lib/libcrypto/bio/b_print.c b/src/lib/libcrypto/bio/b_print.c
index b11b501512..a62f551635 100644
--- a/src/lib/libcrypto/bio/b_print.c
+++ b/src/lib/libcrypto/bio/b_print.c
@@ -61,7 +61,6 @@
61 */ 61 */
62 62
63#include <stdio.h> 63#include <stdio.h>
64#include <stdarg.h>
65#include <string.h> 64#include <string.h>
66#include <ctype.h> 65#include <ctype.h>
67#include <assert.h> 66#include <assert.h>
@@ -78,48 +77,7 @@
78# endif 77# endif
79#endif 78#endif
80 79
81static void dopr (char *buffer, size_t maxlen, size_t *retlen, 80/***************************************************************************/
82 const char *format, va_list args);
83#ifdef USE_ALLOCATING_PRINT
84static void doapr (char **buffer, size_t *retlen,
85 const char *format, va_list args);
86#endif
87
88int BIO_printf (BIO *bio, ...)
89 {
90 va_list args;
91 char *format;
92 int ret;
93 size_t retlen;
94#ifdef USE_ALLOCATING_PRINT
95 char *hugebuf;
96#else
97 MS_STATIC char hugebuf[1024*2]; /* 10k in one chunk is the limit */
98#endif
99
100 va_start(args, bio);
101 format=va_arg(args, char *);
102
103#ifndef USE_ALLOCATING_PRINT
104 hugebuf[0]='\0';
105 dopr(hugebuf, sizeof(hugebuf), &retlen, format, args);
106#else
107 hugebuf = NULL;
108 CRYPTO_push_info("doapr()");
109 doapr(&hugebuf, &retlen, format, args);
110 if (hugebuf)
111 {
112#endif
113 ret=BIO_write(bio, hugebuf, (int)retlen);
114
115#ifdef USE_ALLOCATING_PRINT
116 Free(hugebuf);
117 }
118 CRYPTO_pop_info();
119#endif
120 va_end(args);
121 return(ret);
122 }
123 81
124/* 82/*
125 * Copyright Patrick Powell 1995 83 * Copyright Patrick Powell 1995
@@ -140,6 +98,7 @@ int BIO_printf (BIO *bio, ...)
140 * o Andrew Tridgell <tridge@samba.org> (1998, for Samba) 98 * o Andrew Tridgell <tridge@samba.org> (1998, for Samba)
141 * o Luke Mewburn <lukem@netbsd.org> (1999, for LukemFTP) 99 * o Luke Mewburn <lukem@netbsd.org> (1999, for LukemFTP)
142 * o Ralf S. Engelschall <rse@engelschall.com> (1999, for Pth) 100 * o Ralf S. Engelschall <rse@engelschall.com> (1999, for Pth)
101 * o ... (for OpenSSL)
143 */ 102 */
144 103
145#if HAVE_LONG_DOUBLE 104#if HAVE_LONG_DOUBLE
@@ -154,25 +113,15 @@ int BIO_printf (BIO *bio, ...)
154#define LLONG long 113#define LLONG long
155#endif 114#endif
156 115
157static void fmtstr (void (*)(char **, size_t *, size_t *, int), 116static void fmtstr (char **, char **, size_t *, size_t *,
158 char **, size_t *, size_t *, const char *, int, int, 117 const char *, int, int, int);
159 int); 118static void fmtint (char **, char **, size_t *, size_t *,
160static void fmtint (void (*)(char **, size_t *, size_t *, int), 119 LLONG, int, int, int, int);
161 char **, size_t *, size_t *, LLONG, int, int, int, int); 120static void fmtfp (char **, char **, size_t *, size_t *,
162static void fmtfp (void (*)(char **, size_t *, size_t *, int), 121 LDOUBLE, int, int, int);
163 char **, size_t *, size_t *, LDOUBLE, int, int, int); 122static void doapr_outch (char **, char **, size_t *, size_t *, int);
164#ifndef USE_ALLOCATING_PRINT 123static void _dopr(char **sbuffer, char **buffer,
165static int dopr_isbig (size_t, size_t); 124 size_t *maxlen, size_t *retlen, int *truncated,
166static int dopr_copy (size_t);
167static void dopr_outch (char **, size_t *, size_t *, int);
168#else
169static int doapr_isbig (size_t, size_t);
170static int doapr_copy (size_t);
171static void doapr_outch (char **, size_t *, size_t *, int);
172#endif
173static void _dopr(void (*)(char **, size_t *, size_t *, int),
174 int (*)(size_t, size_t), int (*)(size_t),
175 char **buffer, size_t *maxlen, size_t *retlen,
176 const char *format, va_list args); 125 const char *format, va_list args);
177 126
178/* format read states */ 127/* format read states */
@@ -204,41 +153,13 @@ static void _dopr(void (*)(char **, size_t *, size_t *, int),
204#define char_to_int(p) (p - '0') 153#define char_to_int(p) (p - '0')
205#define MAX(p,q) ((p >= q) ? p : q) 154#define MAX(p,q) ((p >= q) ? p : q)
206 155
207#ifndef USE_ALLOCATING_PRINT
208static void
209dopr(
210 char *buffer,
211 size_t maxlen,
212 size_t *retlen,
213 const char *format,
214 va_list args)
215{
216 _dopr(dopr_outch, dopr_isbig, dopr_copy,
217 &buffer, &maxlen, retlen, format, args);
218}
219
220#else
221static void
222doapr(
223 char **buffer,
224 size_t *retlen,
225 const char *format,
226 va_list args)
227{
228 size_t dummy_maxlen = 0;
229 _dopr(doapr_outch, doapr_isbig, doapr_copy,
230 buffer, &dummy_maxlen, retlen, format, args);
231}
232#endif
233
234static void 156static void
235_dopr( 157_dopr(
236 void (*outch_fn)(char **, size_t *, size_t *, int), 158 char **sbuffer,
237 int (*isbig_fn)(size_t, size_t),
238 int (*copy_fn)(size_t),
239 char **buffer, 159 char **buffer,
240 size_t *maxlen, 160 size_t *maxlen,
241 size_t *retlen, 161 size_t *retlen,
162 int *truncated,
242 const char *format, 163 const char *format,
243 va_list args) 164 va_list args)
244{ 165{
@@ -259,7 +180,7 @@ _dopr(
259 ch = *format++; 180 ch = *format++;
260 181
261 while (state != DP_S_DONE) { 182 while (state != DP_S_DONE) {
262 if ((ch == '\0') || (*isbig_fn)(currlen, *maxlen)) 183 if (ch == '\0' || (buffer == NULL && currlen >= *maxlen))
263 state = DP_S_DONE; 184 state = DP_S_DONE;
264 185
265 switch (state) { 186 switch (state) {
@@ -267,7 +188,7 @@ _dopr(
267 if (ch == '%') 188 if (ch == '%')
268 state = DP_S_FLAGS; 189 state = DP_S_FLAGS;
269 else 190 else
270 (*outch_fn)(buffer, &currlen, maxlen, ch); 191 doapr_outch(sbuffer,buffer, &currlen, maxlen, ch);
271 ch = *format++; 192 ch = *format++;
272 break; 193 break;
273 case DP_S_FLAGS: 194 case DP_S_FLAGS:
@@ -373,8 +294,8 @@ _dopr(
373 value = va_arg(args, int); 294 value = va_arg(args, int);
374 break; 295 break;
375 } 296 }
376 fmtint(outch_fn, buffer, &currlen, maxlen, 297 fmtint(sbuffer, buffer, &currlen, maxlen,
377 value, 10, min, max, flags); 298 value, 10, min, max, flags);
378 break; 299 break;
379 case 'X': 300 case 'X':
380 flags |= DP_F_UP; 301 flags |= DP_F_UP;
@@ -399,7 +320,7 @@ _dopr(
399 unsigned int); 320 unsigned int);
400 break; 321 break;
401 } 322 }
402 fmtint(outch_fn, buffer, &currlen, maxlen, value, 323 fmtint(sbuffer, buffer, &currlen, maxlen, value,
403 ch == 'o' ? 8 : (ch == 'u' ? 10 : 16), 324 ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
404 min, max, flags); 325 min, max, flags);
405 break; 326 break;
@@ -408,8 +329,8 @@ _dopr(
408 fvalue = va_arg(args, LDOUBLE); 329 fvalue = va_arg(args, LDOUBLE);
409 else 330 else
410 fvalue = va_arg(args, double); 331 fvalue = va_arg(args, double);
411 fmtfp(outch_fn, buffer, &currlen, maxlen, 332 fmtfp(sbuffer, buffer, &currlen, maxlen,
412 fvalue, min, max, flags); 333 fvalue, min, max, flags);
413 break; 334 break;
414 case 'E': 335 case 'E':
415 flags |= DP_F_UP; 336 flags |= DP_F_UP;
@@ -428,19 +349,23 @@ _dopr(
428 fvalue = va_arg(args, double); 349 fvalue = va_arg(args, double);
429 break; 350 break;
430 case 'c': 351 case 'c':
431 (*outch_fn)(buffer, &currlen, maxlen, 352 doapr_outch(sbuffer, buffer, &currlen, maxlen,
432 va_arg(args, int)); 353 va_arg(args, int));
433 break; 354 break;
434 case 's': 355 case 's':
435 strvalue = va_arg(args, char *); 356 strvalue = va_arg(args, char *);
436 if (max < 0) 357 if (max < 0) {
437 max = (*copy_fn)(*maxlen); 358 if (buffer)
438 fmtstr(outch_fn, buffer, &currlen, maxlen, strvalue, 359 max = INT_MAX;
439 flags, min, max); 360 else
361 max = *maxlen;
362 }
363 fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue,
364 flags, min, max);
440 break; 365 break;
441 case 'p': 366 case 'p':
442 value = (long)va_arg(args, void *); 367 value = (long)va_arg(args, void *);
443 fmtint(outch_fn, buffer, &currlen, maxlen, 368 fmtint(sbuffer, buffer, &currlen, maxlen,
444 value, 16, min, max, flags); 369 value, 16, min, max, flags);
445 break; 370 break;
446 case 'n': /* XXX */ 371 case 'n': /* XXX */
@@ -463,7 +388,7 @@ _dopr(
463 } 388 }
464 break; 389 break;
465 case '%': 390 case '%':
466 (*outch_fn)(buffer, &currlen, maxlen, ch); 391 doapr_outch(sbuffer, buffer, &currlen, maxlen, ch);
467 break; 392 break;
468 case 'w': 393 case 'w':
469 /* not supported yet, treat as next char */ 394 /* not supported yet, treat as next char */
@@ -484,16 +409,17 @@ _dopr(
484 break; 409 break;
485 } 410 }
486 } 411 }
487 if (currlen >= *maxlen - 1) 412 *truncated = (currlen > *maxlen - 1);
413 if (*truncated)
488 currlen = *maxlen - 1; 414 currlen = *maxlen - 1;
489 (*buffer)[currlen] = '\0'; 415 doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0');
490 *retlen = currlen; 416 *retlen = currlen - 1;
491 return; 417 return;
492} 418}
493 419
494static void 420static void
495fmtstr( 421fmtstr(
496 void (*outch_fn)(char **, size_t *, size_t *, int), 422 char **sbuffer,
497 char **buffer, 423 char **buffer,
498 size_t *currlen, 424 size_t *currlen,
499 size_t *maxlen, 425 size_t *maxlen,
@@ -516,16 +442,16 @@ fmtstr(
516 padlen = -padlen; 442 padlen = -padlen;
517 443
518 while ((padlen > 0) && (cnt < max)) { 444 while ((padlen > 0) && (cnt < max)) {
519 (*outch_fn)(buffer, currlen, maxlen, ' '); 445 doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
520 --padlen; 446 --padlen;
521 ++cnt; 447 ++cnt;
522 } 448 }
523 while (*value && (cnt < max)) { 449 while (*value && (cnt < max)) {
524 (*outch_fn)(buffer, currlen, maxlen, *value++); 450 doapr_outch(sbuffer, buffer, currlen, maxlen, *value++);
525 ++cnt; 451 ++cnt;
526 } 452 }
527 while ((padlen < 0) && (cnt < max)) { 453 while ((padlen < 0) && (cnt < max)) {
528 (*outch_fn)(buffer, currlen, maxlen, ' '); 454 doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
529 ++padlen; 455 ++padlen;
530 ++cnt; 456 ++cnt;
531 } 457 }
@@ -533,7 +459,7 @@ fmtstr(
533 459
534static void 460static void
535fmtint( 461fmtint(
536 void (*outch_fn)(char **, size_t *, size_t *, int), 462 char **sbuffer,
537 char **buffer, 463 char **buffer,
538 size_t *currlen, 464 size_t *currlen,
539 size_t *maxlen, 465 size_t *maxlen,
@@ -590,28 +516,28 @@ fmtint(
590 516
591 /* spaces */ 517 /* spaces */
592 while (spadlen > 0) { 518 while (spadlen > 0) {
593 (*outch_fn)(buffer, currlen, maxlen, ' '); 519 doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
594 --spadlen; 520 --spadlen;
595 } 521 }
596 522
597 /* sign */ 523 /* sign */
598 if (signvalue) 524 if (signvalue)
599 (*outch_fn)(buffer, currlen, maxlen, signvalue); 525 doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
600 526
601 /* zeros */ 527 /* zeros */
602 if (zpadlen > 0) { 528 if (zpadlen > 0) {
603 while (zpadlen > 0) { 529 while (zpadlen > 0) {
604 (*outch_fn)(buffer, currlen, maxlen, '0'); 530 doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
605 --zpadlen; 531 --zpadlen;
606 } 532 }
607 } 533 }
608 /* digits */ 534 /* digits */
609 while (place > 0) 535 while (place > 0)
610 (*outch_fn)(buffer, currlen, maxlen, convert[--place]); 536 doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]);
611 537
612 /* left justified spaces */ 538 /* left justified spaces */
613 while (spadlen < 0) { 539 while (spadlen < 0) {
614 (*outch_fn)(buffer, currlen, maxlen, ' '); 540 doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
615 ++spadlen; 541 ++spadlen;
616 } 542 }
617 return; 543 return;
@@ -650,7 +576,7 @@ round(LDOUBLE value)
650 576
651static void 577static void
652fmtfp( 578fmtfp(
653 void (*outch_fn)(char **, size_t *, size_t *, int), 579 char **sbuffer,
654 char **buffer, 580 char **buffer,
655 size_t *currlen, 581 size_t *currlen,
656 size_t *maxlen, 582 size_t *maxlen,
@@ -731,114 +657,158 @@ fmtfp(
731 657
732 if ((flags & DP_F_ZERO) && (padlen > 0)) { 658 if ((flags & DP_F_ZERO) && (padlen > 0)) {
733 if (signvalue) { 659 if (signvalue) {
734 (*outch_fn)(buffer, currlen, maxlen, signvalue); 660 doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
735 --padlen; 661 --padlen;
736 signvalue = 0; 662 signvalue = 0;
737 } 663 }
738 while (padlen > 0) { 664 while (padlen > 0) {
739 (*outch_fn)(buffer, currlen, maxlen, '0'); 665 doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
740 --padlen; 666 --padlen;
741 } 667 }
742 } 668 }
743 while (padlen > 0) { 669 while (padlen > 0) {
744 (*outch_fn)(buffer, currlen, maxlen, ' '); 670 doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
745 --padlen; 671 --padlen;
746 } 672 }
747 if (signvalue) 673 if (signvalue)
748 (*outch_fn)(buffer, currlen, maxlen, signvalue); 674 doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue);
749 675
750 while (iplace > 0) 676 while (iplace > 0)
751 (*outch_fn)(buffer, currlen, maxlen, iconvert[--iplace]); 677 doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]);
752 678
753 /* 679 /*
754 * Decimal point. This should probably use locale to find the correct 680 * Decimal point. This should probably use locale to find the correct
755 * char to print out. 681 * char to print out.
756 */ 682 */
757 if (max > 0) { 683 if (max > 0) {
758 (*outch_fn)(buffer, currlen, maxlen, '.'); 684 doapr_outch(sbuffer, buffer, currlen, maxlen, '.');
759 685
760 while (fplace > 0) 686 while (fplace > 0)
761 (*outch_fn)(buffer, currlen, maxlen, fconvert[--fplace]); 687 doapr_outch(sbuffer, buffer, currlen, maxlen, fconvert[--fplace]);
762 } 688 }
763 while (zpadlen > 0) { 689 while (zpadlen > 0) {
764 (*outch_fn)(buffer, currlen, maxlen, '0'); 690 doapr_outch(sbuffer, buffer, currlen, maxlen, '0');
765 --zpadlen; 691 --zpadlen;
766 } 692 }
767 693
768 while (padlen < 0) { 694 while (padlen < 0) {
769 (*outch_fn)(buffer, currlen, maxlen, ' '); 695 doapr_outch(sbuffer, buffer, currlen, maxlen, ' ');
770 ++padlen; 696 ++padlen;
771 } 697 }
772} 698}
773 699
774static int
775dopr_copy(
776 size_t len)
777{
778 return len;
779}
780
781#ifdef USE_ALLOCATING_PRINT
782static int
783doapr_copy(
784 size_t len)
785{
786 /* Return as high an integer as possible */
787 return INT_MAX;
788}
789#endif
790
791static int
792dopr_isbig(
793 size_t currlen,
794 size_t maxlen)
795{
796 return currlen > maxlen;
797}
798
799#ifdef USE_ALLOCATING_PRINT
800static int
801doapr_isbig(
802 size_t currlen,
803 size_t maxlen)
804{
805 return 0;
806}
807#endif
808
809static void
810dopr_outch(
811 char **buffer,
812 size_t *currlen,
813 size_t *maxlen,
814 int c)
815{
816 if (*currlen < *maxlen)
817 (*buffer)[(*currlen)++] = (char)c;
818 return;
819}
820
821#ifdef USE_ALLOCATING_PRINT
822static void 700static void
823doapr_outch( 701doapr_outch(
702 char **sbuffer,
824 char **buffer, 703 char **buffer,
825 size_t *currlen, 704 size_t *currlen,
826 size_t *maxlen, 705 size_t *maxlen,
827 int c) 706 int c)
828{ 707{
829 if (*buffer == NULL) { 708 /* If we haven't at least one buffer, someone has doe a big booboo */
830 if (*maxlen == 0) 709 assert(*sbuffer != NULL || buffer != NULL);
831 *maxlen = 1024; 710
832 *buffer = Malloc(*maxlen); 711 if (buffer) {
712 while (*currlen >= *maxlen) {
713 if (*buffer == NULL) {
714 assert(*sbuffer != NULL);
715 if (*maxlen == 0)
716 *maxlen = 1024;
717 *buffer = OPENSSL_malloc(*maxlen);
718 if (*currlen > 0)
719 memcpy(*buffer, *sbuffer, *currlen);
720 *sbuffer = NULL;
721 } else {
722 *maxlen += 1024;
723 *buffer = OPENSSL_realloc(*buffer, *maxlen);
724 }
725 }
726 /* What to do if *buffer is NULL? */
727 assert(*sbuffer != NULL || *buffer != NULL);
833 } 728 }
834 while (*currlen >= *maxlen) { 729
835 *maxlen += 1024; 730 if (*currlen < *maxlen) {
836 *buffer = Realloc(*buffer, *maxlen); 731 if (*sbuffer)
732 (*sbuffer)[(*currlen)++] = (char)c;
733 else
734 (*buffer)[(*currlen)++] = (char)c;
837 } 735 }
838 /* What to do if *buffer is NULL? */
839 assert(*buffer != NULL);
840 736
841 (*buffer)[(*currlen)++] = (char)c;
842 return; 737 return;
843} 738}
844#endif 739
740/***************************************************************************/
741
742int BIO_printf (BIO *bio, const char *format, ...)
743 {
744 va_list args;
745 int ret;
746
747 va_start(args, format);
748
749 ret = BIO_vprintf(bio, format, args);
750
751 va_end(args);
752 return(ret);
753 }
754
755int BIO_vprintf (BIO *bio, const char *format, va_list args)
756 {
757 int ret;
758 size_t retlen;
759 MS_STATIC char hugebuf[1024*10];
760 char *hugebufp = hugebuf;
761 size_t hugebufsize = sizeof(hugebuf);
762 char *dynbuf = NULL;
763 int ignored;
764
765 dynbuf = NULL;
766 CRYPTO_push_info("doapr()");
767 _dopr(&hugebufp, &dynbuf, &hugebufsize,
768 &retlen, &ignored, format, args);
769 if (dynbuf)
770 {
771 ret=BIO_write(bio, dynbuf, (int)retlen);
772 OPENSSL_free(dynbuf);
773 }
774 else
775 {
776 ret=BIO_write(bio, hugebuf, (int)retlen);
777 }
778 CRYPTO_pop_info();
779 return(ret);
780 }
781
782/* As snprintf is not available everywhere, we provide our own implementation.
783 * This function has nothing to do with BIOs, but it's closely related
784 * to BIO_printf, and we need *some* name prefix ...
785 * (XXX the function should be renamed, but to what?) */
786int BIO_snprintf(char *buf, size_t n, const char *format, ...)
787 {
788 va_list args;
789 int ret;
790
791 va_start(args, format);
792
793 ret = BIO_vsnprintf(buf, n, format, args);
794
795 va_end(args);
796 return(ret);
797 }
798
799int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
800 {
801 size_t retlen;
802 int truncated;
803
804 _dopr(&buf, NULL, &n, &retlen, &truncated, format, args);
805
806 if (truncated)
807 /* In case of truncation, return -1 like traditional snprintf.
808 * (Current drafts for ISO/IEC 9899 say snprintf should return
809 * the number of characters that would have been written,
810 * had the buffer been large enough.) */
811 return -1;
812 else
813 return (retlen <= INT_MAX) ? retlen : -1;
814 }
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c
index 6409f98f57..64310058b4 100644
--- a/src/lib/libcrypto/bio/b_sock.c
+++ b/src/lib/libcrypto/bio/b_sock.c
@@ -105,17 +105,22 @@ int BIO_get_host_ip(const char *str, unsigned char *ip)
105 struct hostent *he; 105 struct hostent *he;
106 106
107 i=get_ip(str,ip); 107 i=get_ip(str,ip);
108 if (i > 0) return(1);
109 if (i < 0) 108 if (i < 0)
110 { 109 {
111 BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_INVALID_IP_ADDRESS); 110 BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_INVALID_IP_ADDRESS);
112 goto err; 111 goto err;
113 } 112 }
114 113
115 /* do a gethostbyname */ 114 /* At this point, we have something that is most probably correct
115 in some way, so let's init the socket. */
116 if (!BIO_sock_init()) 116 if (!BIO_sock_init())
117 return(0); /* don't generate another error code here */ 117 return(0); /* don't generate another error code here */
118 118
119 /* If the string actually contained an IP address, we need not do
120 anything more */
121 if (i > 0) return(1);
122
123 /* do a gethostbyname */
119 CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME); 124 CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);
120 locked = 1; 125 locked = 1;
121 he=BIO_gethostbyname(str); 126 he=BIO_gethostbyname(str);
@@ -267,14 +272,14 @@ static struct hostent *ghbn_dup(struct hostent *a)
267 int i,j; 272 int i,j;
268 273
269 MemCheck_off(); 274 MemCheck_off();
270 ret=(struct hostent *)Malloc(sizeof(struct hostent)); 275 ret=(struct hostent *)OPENSSL_malloc(sizeof(struct hostent));
271 if (ret == NULL) return(NULL); 276 if (ret == NULL) return(NULL);
272 memset(ret,0,sizeof(struct hostent)); 277 memset(ret,0,sizeof(struct hostent));
273 278
274 for (i=0; a->h_aliases[i] != NULL; i++) 279 for (i=0; a->h_aliases[i] != NULL; i++)
275 ; 280 ;
276 i++; 281 i++;
277 ret->h_aliases = (char **)Malloc(i*sizeof(char *)); 282 ret->h_aliases = (char **)OPENSSL_malloc(i*sizeof(char *));
278 if (ret->h_aliases == NULL) 283 if (ret->h_aliases == NULL)
279 goto err; 284 goto err;
280 memset(ret->h_aliases, 0, i*sizeof(char *)); 285 memset(ret->h_aliases, 0, i*sizeof(char *));
@@ -282,25 +287,25 @@ static struct hostent *ghbn_dup(struct hostent *a)
282 for (i=0; a->h_addr_list[i] != NULL; i++) 287 for (i=0; a->h_addr_list[i] != NULL; i++)
283 ; 288 ;
284 i++; 289 i++;
285 ret->h_addr_list=(char **)Malloc(i*sizeof(char *)); 290 ret->h_addr_list=(char **)OPENSSL_malloc(i*sizeof(char *));
286 if (ret->h_addr_list == NULL) 291 if (ret->h_addr_list == NULL)
287 goto err; 292 goto err;
288 memset(ret->h_addr_list, 0, i*sizeof(char *)); 293 memset(ret->h_addr_list, 0, i*sizeof(char *));
289 294
290 j=strlen(a->h_name)+1; 295 j=strlen(a->h_name)+1;
291 if ((ret->h_name=Malloc(j)) == NULL) goto err; 296 if ((ret->h_name=OPENSSL_malloc(j)) == NULL) goto err;
292 memcpy((char *)ret->h_name,a->h_name,j); 297 memcpy((char *)ret->h_name,a->h_name,j);
293 for (i=0; a->h_aliases[i] != NULL; i++) 298 for (i=0; a->h_aliases[i] != NULL; i++)
294 { 299 {
295 j=strlen(a->h_aliases[i])+1; 300 j=strlen(a->h_aliases[i])+1;
296 if ((ret->h_aliases[i]=Malloc(j)) == NULL) goto err; 301 if ((ret->h_aliases[i]=OPENSSL_malloc(j)) == NULL) goto err;
297 memcpy(ret->h_aliases[i],a->h_aliases[i],j); 302 memcpy(ret->h_aliases[i],a->h_aliases[i],j);
298 } 303 }
299 ret->h_length=a->h_length; 304 ret->h_length=a->h_length;
300 ret->h_addrtype=a->h_addrtype; 305 ret->h_addrtype=a->h_addrtype;
301 for (i=0; a->h_addr_list[i] != NULL; i++) 306 for (i=0; a->h_addr_list[i] != NULL; i++)
302 { 307 {
303 if ((ret->h_addr_list[i]=Malloc(a->h_length)) == NULL) 308 if ((ret->h_addr_list[i]=OPENSSL_malloc(a->h_length)) == NULL)
304 goto err; 309 goto err;
305 memcpy(ret->h_addr_list[i],a->h_addr_list[i],a->h_length); 310 memcpy(ret->h_addr_list[i],a->h_addr_list[i],a->h_length);
306 } 311 }
@@ -325,17 +330,17 @@ static void ghbn_free(struct hostent *a)
325 if (a->h_aliases != NULL) 330 if (a->h_aliases != NULL)
326 { 331 {
327 for (i=0; a->h_aliases[i] != NULL; i++) 332 for (i=0; a->h_aliases[i] != NULL; i++)
328 Free(a->h_aliases[i]); 333 OPENSSL_free(a->h_aliases[i]);
329 Free(a->h_aliases); 334 OPENSSL_free(a->h_aliases);
330 } 335 }
331 if (a->h_addr_list != NULL) 336 if (a->h_addr_list != NULL)
332 { 337 {
333 for (i=0; a->h_addr_list[i] != NULL; i++) 338 for (i=0; a->h_addr_list[i] != NULL; i++)
334 Free(a->h_addr_list[i]); 339 OPENSSL_free(a->h_addr_list[i]);
335 Free(a->h_addr_list); 340 OPENSSL_free(a->h_addr_list);
336 } 341 }
337 if (a->h_name != NULL) Free(a->h_name); 342 if (a->h_name != NULL) OPENSSL_free(a->h_name);
338 Free(a); 343 OPENSSL_free(a);
339 } 344 }
340 345
341struct hostent *BIO_gethostbyname(const char *name) 346struct hostent *BIO_gethostbyname(const char *name)
@@ -628,7 +633,7 @@ again:
628 } 633 }
629 ret=1; 634 ret=1;
630err: 635err:
631 if (str != NULL) Free(str); 636 if (str != NULL) OPENSSL_free(str);
632 if ((ret == 0) && (s != INVALID_SOCKET)) 637 if ((ret == 0) && (s != INVALID_SOCKET))
633 { 638 {
634 closesocket(s); 639 closesocket(s);
@@ -667,7 +672,7 @@ int BIO_accept(int sock, char **addr)
667 port=ntohs(from.sin_port); 672 port=ntohs(from.sin_port);
668 if (*addr == NULL) 673 if (*addr == NULL)
669 { 674 {
670 if ((p=Malloc(24)) == NULL) 675 if ((p=OPENSSL_malloc(24)) == NULL)
671 { 676 {
672 BIOerr(BIO_F_BIO_ACCEPT,ERR_R_MALLOC_FAILURE); 677 BIOerr(BIO_F_BIO_ACCEPT,ERR_R_MALLOC_FAILURE);
673 goto end; 678 goto end;
diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c
index ff0c9070ae..f50e8f98a3 100644
--- a/src/lib/libcrypto/bio/bf_buff.c
+++ b/src/lib/libcrypto/bio/bf_buff.c
@@ -62,14 +62,14 @@
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
65static int buffer_write(BIO *h,char *buf,int num); 65static int buffer_write(BIO *h, const char *buf,int num);
66static int buffer_read(BIO *h,char *buf,int size); 66static int buffer_read(BIO *h, char *buf, int size);
67static int buffer_puts(BIO *h,char *str); 67static int buffer_puts(BIO *h, const char *str);
68static int buffer_gets(BIO *h,char *str,int size); 68static int buffer_gets(BIO *h, char *str, int size);
69static long buffer_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
70static int buffer_new(BIO *h); 70static int buffer_new(BIO *h);
71static int buffer_free(BIO *data); 71static int buffer_free(BIO *data);
72static long buffer_callback_ctrl(BIO *h,int cmd, void (*fp)()); 72static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
73#define DEFAULT_BUFFER_SIZE 1024 73#define DEFAULT_BUFFER_SIZE 1024
74 74
75static BIO_METHOD methods_buffer= 75static BIO_METHOD methods_buffer=
@@ -95,12 +95,12 @@ static int buffer_new(BIO *bi)
95 { 95 {
96 BIO_F_BUFFER_CTX *ctx; 96 BIO_F_BUFFER_CTX *ctx;
97 97
98 ctx=(BIO_F_BUFFER_CTX *)Malloc(sizeof(BIO_F_BUFFER_CTX)); 98 ctx=(BIO_F_BUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_F_BUFFER_CTX));
99 if (ctx == NULL) return(0); 99 if (ctx == NULL) return(0);
100 ctx->ibuf=(char *)Malloc(DEFAULT_BUFFER_SIZE); 100 ctx->ibuf=(char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
101 if (ctx->ibuf == NULL) { Free(ctx); return(0); } 101 if (ctx->ibuf == NULL) { OPENSSL_free(ctx); return(0); }
102 ctx->obuf=(char *)Malloc(DEFAULT_BUFFER_SIZE); 102 ctx->obuf=(char *)OPENSSL_malloc(DEFAULT_BUFFER_SIZE);
103 if (ctx->obuf == NULL) { Free(ctx->ibuf); Free(ctx); return(0); } 103 if (ctx->obuf == NULL) { OPENSSL_free(ctx->ibuf); OPENSSL_free(ctx); return(0); }
104 ctx->ibuf_size=DEFAULT_BUFFER_SIZE; 104 ctx->ibuf_size=DEFAULT_BUFFER_SIZE;
105 ctx->obuf_size=DEFAULT_BUFFER_SIZE; 105 ctx->obuf_size=DEFAULT_BUFFER_SIZE;
106 ctx->ibuf_len=0; 106 ctx->ibuf_len=0;
@@ -120,9 +120,9 @@ static int buffer_free(BIO *a)
120 120
121 if (a == NULL) return(0); 121 if (a == NULL) return(0);
122 b=(BIO_F_BUFFER_CTX *)a->ptr; 122 b=(BIO_F_BUFFER_CTX *)a->ptr;
123 if (b->ibuf != NULL) Free(b->ibuf); 123 if (b->ibuf != NULL) OPENSSL_free(b->ibuf);
124 if (b->obuf != NULL) Free(b->obuf); 124 if (b->obuf != NULL) OPENSSL_free(b->obuf);
125 Free(a->ptr); 125 OPENSSL_free(a->ptr);
126 a->ptr=NULL; 126 a->ptr=NULL;
127 a->init=0; 127 a->init=0;
128 a->flags=0; 128 a->flags=0;
@@ -195,7 +195,7 @@ start:
195 goto start; 195 goto start;
196 } 196 }
197 197
198static int buffer_write(BIO *b, char *in, int inl) 198static int buffer_write(BIO *b, const char *in, int inl)
199 { 199 {
200 int i,num=0; 200 int i,num=0;
201 BIO_F_BUFFER_CTX *ctx; 201 BIO_F_BUFFER_CTX *ctx;
@@ -268,7 +268,7 @@ start:
268 goto start; 268 goto start;
269 } 269 }
270 270
271static long buffer_ctrl(BIO *b, int cmd, long num, char *ptr) 271static long buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
272 { 272 {
273 BIO *dbio; 273 BIO *dbio;
274 BIO_F_BUFFER_CTX *ctx; 274 BIO_F_BUFFER_CTX *ctx;
@@ -319,9 +319,9 @@ static long buffer_ctrl(BIO *b, int cmd, long num, char *ptr)
319 case BIO_C_SET_BUFF_READ_DATA: 319 case BIO_C_SET_BUFF_READ_DATA:
320 if (num > ctx->ibuf_size) 320 if (num > ctx->ibuf_size)
321 { 321 {
322 p1=Malloc((int)num); 322 p1=OPENSSL_malloc((int)num);
323 if (p1 == NULL) goto malloc_error; 323 if (p1 == NULL) goto malloc_error;
324 if (ctx->ibuf != NULL) Free(ctx->ibuf); 324 if (ctx->ibuf != NULL) OPENSSL_free(ctx->ibuf);
325 ctx->ibuf=p1; 325 ctx->ibuf=p1;
326 } 326 }
327 ctx->ibuf_off=0; 327 ctx->ibuf_off=0;
@@ -353,21 +353,21 @@ static long buffer_ctrl(BIO *b, int cmd, long num, char *ptr)
353 p2=ctx->obuf; 353 p2=ctx->obuf;
354 if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) 354 if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size))
355 { 355 {
356 p1=(char *)Malloc((int)num); 356 p1=(char *)OPENSSL_malloc((int)num);
357 if (p1 == NULL) goto malloc_error; 357 if (p1 == NULL) goto malloc_error;
358 } 358 }
359 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) 359 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size))
360 { 360 {
361 p2=(char *)Malloc((int)num); 361 p2=(char *)OPENSSL_malloc((int)num);
362 if (p2 == NULL) 362 if (p2 == NULL)
363 { 363 {
364 if (p1 != ctx->ibuf) Free(p1); 364 if (p1 != ctx->ibuf) OPENSSL_free(p1);
365 goto malloc_error; 365 goto malloc_error;
366 } 366 }
367 } 367 }
368 if (ctx->ibuf != p1) 368 if (ctx->ibuf != p1)
369 { 369 {
370 Free(ctx->ibuf); 370 OPENSSL_free(ctx->ibuf);
371 ctx->ibuf=p1; 371 ctx->ibuf=p1;
372 ctx->ibuf_off=0; 372 ctx->ibuf_off=0;
373 ctx->ibuf_len=0; 373 ctx->ibuf_len=0;
@@ -375,7 +375,7 @@ static long buffer_ctrl(BIO *b, int cmd, long num, char *ptr)
375 } 375 }
376 if (ctx->obuf != p2) 376 if (ctx->obuf != p2)
377 { 377 {
378 Free(ctx->obuf); 378 OPENSSL_free(ctx->obuf);
379 ctx->obuf=p2; 379 ctx->obuf=p2;
380 ctx->obuf_off=0; 380 ctx->obuf_off=0;
381 ctx->obuf_len=0; 381 ctx->obuf_len=0;
@@ -439,7 +439,7 @@ malloc_error:
439 return(0); 439 return(0);
440 } 440 }
441 441
442static long buffer_callback_ctrl(BIO *b, int cmd, void (*fp)()) 442static long buffer_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
443 { 443 {
444 long ret=1; 444 long ret=1;
445 445
@@ -504,8 +504,8 @@ static int buffer_gets(BIO *b, char *buf, int size)
504 } 504 }
505 } 505 }
506 506
507static int buffer_puts(BIO *b, char *str) 507static int buffer_puts(BIO *b, const char *str)
508 { 508 {
509 return(BIO_write(b,str,strlen(str))); 509 return(buffer_write(b,str,strlen(str)));
510 } 510 }
511 511
diff --git a/src/lib/libcrypto/bio/bf_lbuf.c b/src/lib/libcrypto/bio/bf_lbuf.c
new file mode 100644
index 0000000000..7bcf8ed941
--- /dev/null
+++ b/src/lib/libcrypto/bio/bf_lbuf.c
@@ -0,0 +1,397 @@
1/* crypto/bio/bf_buff.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <errno.h>
61#include "cryptlib.h"
62#include <openssl/bio.h>
63#include <openssl/evp.h>
64
65static int linebuffer_write(BIO *h, const char *buf,int num);
66static int linebuffer_read(BIO *h, char *buf, int size);
67static int linebuffer_puts(BIO *h, const char *str);
68static int linebuffer_gets(BIO *h, char *str, int size);
69static long linebuffer_ctrl(BIO *h, int cmd, long arg1, void *arg2);
70static int linebuffer_new(BIO *h);
71static int linebuffer_free(BIO *data);
72static long linebuffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
73
74/* A 10k maximum should be enough for most purposes */
75#define DEFAULT_LINEBUFFER_SIZE 1024*10
76
77/* #define DEBUG */
78
79static BIO_METHOD methods_linebuffer=
80 {
81 BIO_TYPE_LINEBUFFER,
82 "linebuffer",
83 linebuffer_write,
84 linebuffer_read,
85 linebuffer_puts,
86 linebuffer_gets,
87 linebuffer_ctrl,
88 linebuffer_new,
89 linebuffer_free,
90 linebuffer_callback_ctrl,
91 };
92
93BIO_METHOD *BIO_f_linebuffer(void)
94 {
95 return(&methods_linebuffer);
96 }
97
98typedef struct bio_linebuffer_ctx_struct
99 {
100 char *obuf; /* the output char array */
101 int obuf_size; /* how big is the output buffer */
102 int obuf_len; /* how many bytes are in it */
103 } BIO_LINEBUFFER_CTX;
104
105static int linebuffer_new(BIO *bi)
106 {
107 BIO_LINEBUFFER_CTX *ctx;
108
109 ctx=(BIO_LINEBUFFER_CTX *)OPENSSL_malloc(sizeof(BIO_LINEBUFFER_CTX));
110 if (ctx == NULL) return(0);
111 ctx->obuf=(char *)OPENSSL_malloc(DEFAULT_LINEBUFFER_SIZE);
112 if (ctx->obuf == NULL) { OPENSSL_free(ctx); return(0); }
113 ctx->obuf_size=DEFAULT_LINEBUFFER_SIZE;
114 ctx->obuf_len=0;
115
116 bi->init=1;
117 bi->ptr=(char *)ctx;
118 bi->flags=0;
119 return(1);
120 }
121
122static int linebuffer_free(BIO *a)
123 {
124 BIO_LINEBUFFER_CTX *b;
125
126 if (a == NULL) return(0);
127 b=(BIO_LINEBUFFER_CTX *)a->ptr;
128 if (b->obuf != NULL) OPENSSL_free(b->obuf);
129 OPENSSL_free(a->ptr);
130 a->ptr=NULL;
131 a->init=0;
132 a->flags=0;
133 return(1);
134 }
135
136static int linebuffer_read(BIO *b, char *out, int outl)
137 {
138 int ret=0;
139
140 if (out == NULL) return(0);
141 if (b->next_bio == NULL) return(0);
142 ret=BIO_read(b->next_bio,out,outl);
143 BIO_clear_retry_flags(b);
144 BIO_copy_next_retry(b);
145 return(ret);
146 }
147
148static int linebuffer_write(BIO *b, const char *in, int inl)
149 {
150 int i,num=0,foundnl;
151 BIO_LINEBUFFER_CTX *ctx;
152
153 if ((in == NULL) || (inl <= 0)) return(0);
154 ctx=(BIO_LINEBUFFER_CTX *)b->ptr;
155 if ((ctx == NULL) || (b->next_bio == NULL)) return(0);
156
157 BIO_clear_retry_flags(b);
158
159 do
160 {
161 const char *p;
162
163 for(p = in; p < in + inl && *p != '\n'; p++)
164 ;
165 if (*p == '\n')
166 {
167 p++;
168 foundnl = 1;
169 }
170 else
171 foundnl = 0;
172
173 /* If a NL was found and we already have text in the save
174 buffer, concatenate them and write */
175 while ((foundnl || p - in > ctx->obuf_size - ctx->obuf_len)
176 && ctx->obuf_len > 0)
177 {
178 int orig_olen = ctx->obuf_len;
179
180 i = ctx->obuf_size - ctx->obuf_len;
181 if (p - in > 0)
182 {
183 if (i >= p - in)
184 {
185 memcpy(&(ctx->obuf[ctx->obuf_len]),
186 in,p - in);
187 ctx->obuf_len += p - in;
188 inl -= p - in;
189 num += p - in;
190 in = p;
191 }
192 else
193 {
194 memcpy(&(ctx->obuf[ctx->obuf_len]),
195 in,i);
196 ctx->obuf_len += i;
197 inl -= i;
198 in += i;
199 num += i;
200 }
201 }
202
203#ifdef DEBUG
204BIO_write(b->next_bio, "<*<", 3);
205#endif
206 i=BIO_write(b->next_bio,
207 ctx->obuf, ctx->obuf_len);
208 if (i <= 0)
209 {
210 ctx->obuf_len = orig_olen;
211 BIO_copy_next_retry(b);
212
213#ifdef DEBUG
214BIO_write(b->next_bio, ">*>", 3);
215#endif
216 if (i < 0) return((num > 0)?num:i);
217 if (i == 0) return(num);
218 }
219#ifdef DEBUG
220BIO_write(b->next_bio, ">*>", 3);
221#endif
222 if (i < ctx->obuf_len)
223 memmove(ctx->obuf, ctx->obuf + i,
224 ctx->obuf_len - i);
225 ctx->obuf_len-=i;
226 }
227
228 /* Now that the save buffer is emptied, let's write the input
229 buffer if a NL was found and there is anything to write. */
230 if ((foundnl || p - in > ctx->obuf_size) && p - in > 0)
231 {
232#ifdef DEBUG
233BIO_write(b->next_bio, "<*<", 3);
234#endif
235 i=BIO_write(b->next_bio,in,p - in);
236 if (i <= 0)
237 {
238 BIO_copy_next_retry(b);
239#ifdef DEBUG
240BIO_write(b->next_bio, ">*>", 3);
241#endif
242 if (i < 0) return((num > 0)?num:i);
243 if (i == 0) return(num);
244 }
245#ifdef DEBUG
246BIO_write(b->next_bio, ">*>", 3);
247#endif
248 num+=i;
249 in+=i;
250 inl-=i;
251 }
252 }
253 while(foundnl && inl > 0);
254 /* We've written as much as we can. The rest of the input buffer, if
255 any, is text that doesn't and with a NL and therefore needs to be
256 saved for the next trip. */
257 if (inl > 0)
258 {
259 memcpy(&(ctx->obuf[ctx->obuf_len]), in, inl);
260 ctx->obuf_len += inl;
261 num += inl;
262 }
263 return num;
264 }
265
266static long linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
267 {
268 BIO *dbio;
269 BIO_LINEBUFFER_CTX *ctx;
270 long ret=1;
271 char *p;
272 int r;
273 int obs;
274
275 ctx=(BIO_LINEBUFFER_CTX *)b->ptr;
276
277 switch (cmd)
278 {
279 case BIO_CTRL_RESET:
280 ctx->obuf_len=0;
281 if (b->next_bio == NULL) return(0);
282 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
283 break;
284 case BIO_CTRL_INFO:
285 ret=(long)ctx->obuf_len;
286 break;
287 case BIO_CTRL_WPENDING:
288 ret=(long)ctx->obuf_len;
289 if (ret == 0)
290 {
291 if (b->next_bio == NULL) return(0);
292 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
293 }
294 break;
295 case BIO_C_SET_BUFF_SIZE:
296 obs=(int)num;
297 p=ctx->obuf;
298 if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size))
299 {
300 p=(char *)OPENSSL_malloc((int)num);
301 if (p == NULL)
302 goto malloc_error;
303 }
304 if (ctx->obuf != p)
305 {
306 if (ctx->obuf_len > obs)
307 {
308 ctx->obuf_len = obs;
309 }
310 memcpy(p, ctx->obuf, ctx->obuf_len);
311 OPENSSL_free(ctx->obuf);
312 ctx->obuf=p;
313 ctx->obuf_size=obs;
314 }
315 break;
316 case BIO_C_DO_STATE_MACHINE:
317 if (b->next_bio == NULL) return(0);
318 BIO_clear_retry_flags(b);
319 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
320 BIO_copy_next_retry(b);
321 break;
322
323 case BIO_CTRL_FLUSH:
324 if (b->next_bio == NULL) return(0);
325 if (ctx->obuf_len <= 0)
326 {
327 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
328 break;
329 }
330
331 for (;;)
332 {
333 BIO_clear_retry_flags(b);
334 if (ctx->obuf_len > 0)
335 {
336 r=BIO_write(b->next_bio,
337 ctx->obuf, ctx->obuf_len);
338#if 0
339fprintf(stderr,"FLUSH %3d -> %3d\n",ctx->obuf_len,r);
340#endif
341 BIO_copy_next_retry(b);
342 if (r <= 0) return((long)r);
343 if (r < ctx->obuf_len)
344 memmove(ctx->obuf, ctx->obuf + r,
345 ctx->obuf_len - r);
346 ctx->obuf_len-=r;
347 }
348 else
349 {
350 ctx->obuf_len=0;
351 ret=1;
352 break;
353 }
354 }
355 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
356 break;
357 case BIO_CTRL_DUP:
358 dbio=(BIO *)ptr;
359 if ( !BIO_set_write_buffer_size(dbio,ctx->obuf_size))
360 ret=0;
361 break;
362 default:
363 if (b->next_bio == NULL) return(0);
364 ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
365 break;
366 }
367 return(ret);
368malloc_error:
369 BIOerr(BIO_F_LINEBUFFER_CTRL,ERR_R_MALLOC_FAILURE);
370 return(0);
371 }
372
373static long linebuffer_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
374 {
375 long ret=1;
376
377 if (b->next_bio == NULL) return(0);
378 switch (cmd)
379 {
380 default:
381 ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
382 break;
383 }
384 return(ret);
385 }
386
387static int linebuffer_gets(BIO *b, char *buf, int size)
388 {
389 if (b->next_bio == NULL) return(0);
390 return(BIO_gets(b->next_bio,buf,size));
391 }
392
393static int linebuffer_puts(BIO *b, const char *str)
394 {
395 return(linebuffer_write(b,str,strlen(str)));
396 }
397
diff --git a/src/lib/libcrypto/bio/bf_nbio.c b/src/lib/libcrypto/bio/bf_nbio.c
index 5e574b7231..413ef5c4c5 100644
--- a/src/lib/libcrypto/bio/bf_nbio.c
+++ b/src/lib/libcrypto/bio/bf_nbio.c
@@ -66,14 +66,14 @@
66/* BIO_put and BIO_get both add to the digest, 66/* BIO_put and BIO_get both add to the digest,
67 * BIO_gets returns the digest */ 67 * BIO_gets returns the digest */
68 68
69static int nbiof_write(BIO *h,char *buf,int num); 69static int nbiof_write(BIO *h,const char *buf,int num);
70static int nbiof_read(BIO *h,char *buf,int size); 70static int nbiof_read(BIO *h,char *buf,int size);
71static int nbiof_puts(BIO *h,char *str); 71static int nbiof_puts(BIO *h,const char *str);
72static int nbiof_gets(BIO *h,char *str,int size); 72static int nbiof_gets(BIO *h,char *str,int size);
73static long nbiof_ctrl(BIO *h,int cmd,long arg1,char *arg2); 73static long nbiof_ctrl(BIO *h,int cmd,long arg1,void *arg2);
74static int nbiof_new(BIO *h); 74static int nbiof_new(BIO *h);
75static int nbiof_free(BIO *data); 75static int nbiof_free(BIO *data);
76static long nbiof_callback_ctrl(BIO *h,int cmd,void (*fp)()); 76static long nbiof_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
77typedef struct nbio_test_st 77typedef struct nbio_test_st
78 { 78 {
79 /* only set if we sent a 'should retry' error */ 79 /* only set if we sent a 'should retry' error */
@@ -104,7 +104,7 @@ static int nbiof_new(BIO *bi)
104 { 104 {
105 NBIO_TEST *nt; 105 NBIO_TEST *nt;
106 106
107 nt=(NBIO_TEST *)Malloc(sizeof(NBIO_TEST)); 107 nt=(NBIO_TEST *)OPENSSL_malloc(sizeof(NBIO_TEST));
108 nt->lrn= -1; 108 nt->lrn= -1;
109 nt->lwn= -1; 109 nt->lwn= -1;
110 bi->ptr=(char *)nt; 110 bi->ptr=(char *)nt;
@@ -117,7 +117,7 @@ static int nbiof_free(BIO *a)
117 { 117 {
118 if (a == NULL) return(0); 118 if (a == NULL) return(0);
119 if (a->ptr != NULL) 119 if (a->ptr != NULL)
120 Free(a->ptr); 120 OPENSSL_free(a->ptr);
121 a->ptr=NULL; 121 a->ptr=NULL;
122 a->init=0; 122 a->init=0;
123 a->flags=0; 123 a->flags=0;
@@ -159,7 +159,7 @@ static int nbiof_read(BIO *b, char *out, int outl)
159 return(ret); 159 return(ret);
160 } 160 }
161 161
162static int nbiof_write(BIO *b, char *in, int inl) 162static int nbiof_write(BIO *b, const char *in, int inl)
163 { 163 {
164 NBIO_TEST *nt; 164 NBIO_TEST *nt;
165 int ret=0; 165 int ret=0;
@@ -204,7 +204,7 @@ static int nbiof_write(BIO *b, char *in, int inl)
204 return(ret); 204 return(ret);
205 } 205 }
206 206
207static long nbiof_ctrl(BIO *b, int cmd, long num, char *ptr) 207static long nbiof_ctrl(BIO *b, int cmd, long num, void *ptr)
208 { 208 {
209 long ret; 209 long ret;
210 210
@@ -226,7 +226,7 @@ static long nbiof_ctrl(BIO *b, int cmd, long num, char *ptr)
226 return(ret); 226 return(ret);
227 } 227 }
228 228
229static long nbiof_callback_ctrl(BIO *b, int cmd, void (*fp)()) 229static long nbiof_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
230 { 230 {
231 long ret=1; 231 long ret=1;
232 232
@@ -247,7 +247,7 @@ static int nbiof_gets(BIO *bp, char *buf, int size)
247 } 247 }
248 248
249 249
250static int nbiof_puts(BIO *bp, char *str) 250static int nbiof_puts(BIO *bp, const char *str)
251 { 251 {
252 if (bp->next_bio == NULL) return(0); 252 if (bp->next_bio == NULL) return(0);
253 return(BIO_puts(bp->next_bio,str)); 253 return(BIO_puts(bp->next_bio,str));
diff --git a/src/lib/libcrypto/bio/bf_null.c b/src/lib/libcrypto/bio/bf_null.c
index 0d183a6d9a..2678a1a85d 100644
--- a/src/lib/libcrypto/bio/bf_null.c
+++ b/src/lib/libcrypto/bio/bf_null.c
@@ -65,14 +65,14 @@
65/* BIO_put and BIO_get both add to the digest, 65/* BIO_put and BIO_get both add to the digest,
66 * BIO_gets returns the digest */ 66 * BIO_gets returns the digest */
67 67
68static int nullf_write(BIO *h,char *buf,int num); 68static int nullf_write(BIO *h, const char *buf, int num);
69static int nullf_read(BIO *h,char *buf,int size); 69static int nullf_read(BIO *h, char *buf, int size);
70static int nullf_puts(BIO *h,char *str); 70static int nullf_puts(BIO *h, const char *str);
71static int nullf_gets(BIO *h,char *str,int size); 71static int nullf_gets(BIO *h, char *str, int size);
72static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2); 72static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2);
73static int nullf_new(BIO *h); 73static int nullf_new(BIO *h);
74static int nullf_free(BIO *data); 74static int nullf_free(BIO *data);
75static long nullf_callback_ctrl(BIO *h,int cmd,void (*fp)()); 75static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
76static BIO_METHOD methods_nullf= 76static BIO_METHOD methods_nullf=
77 { 77 {
78 BIO_TYPE_NULL_FILTER, 78 BIO_TYPE_NULL_FILTER,
@@ -121,7 +121,7 @@ static int nullf_read(BIO *b, char *out, int outl)
121 return(ret); 121 return(ret);
122 } 122 }
123 123
124static int nullf_write(BIO *b, char *in, int inl) 124static int nullf_write(BIO *b, const char *in, int inl)
125 { 125 {
126 int ret=0; 126 int ret=0;
127 127
@@ -133,7 +133,7 @@ static int nullf_write(BIO *b, char *in, int inl)
133 return(ret); 133 return(ret);
134 } 134 }
135 135
136static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr) 136static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr)
137 { 137 {
138 long ret; 138 long ret;
139 139
@@ -154,7 +154,7 @@ static long nullf_ctrl(BIO *b, int cmd, long num, char *ptr)
154 return(ret); 154 return(ret);
155 } 155 }
156 156
157static long nullf_callback_ctrl(BIO *b, int cmd, void (*fp)()) 157static long nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
158 { 158 {
159 long ret=1; 159 long ret=1;
160 160
@@ -175,7 +175,7 @@ static int nullf_gets(BIO *bp, char *buf, int size)
175 } 175 }
176 176
177 177
178static int nullf_puts(BIO *bp, char *str) 178static int nullf_puts(BIO *bp, const char *str)
179 { 179 {
180 if (bp->next_bio == NULL) return(0); 180 if (bp->next_bio == NULL) return(0);
181 return(BIO_puts(bp->next_bio,str)); 181 return(BIO_puts(bp->next_bio,str));
diff --git a/src/lib/libcrypto/bio/bio.h b/src/lib/libcrypto/bio/bio.h
index ebdb18170b..97003b503c 100644
--- a/src/lib/libcrypto/bio/bio.h
+++ b/src/lib/libcrypto/bio/bio.h
@@ -59,14 +59,17 @@
59#ifndef HEADER_BIO_H 59#ifndef HEADER_BIO_H
60#define HEADER_BIO_H 60#define HEADER_BIO_H
61 61
62#ifdef __cplusplus 62#ifndef NO_FP_API
63extern "C" { 63# include <stdio.h>
64#endif 64#endif
65#include <stdarg.h>
65 66
66#include <stdio.h>
67#include <stdlib.h>
68#include <openssl/crypto.h> 67#include <openssl/crypto.h>
69 68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
70/* These are the 'types' of BIOs */ 73/* These are the 'types' of BIOs */
71#define BIO_TYPE_NONE 0 74#define BIO_TYPE_NONE 0
72#define BIO_TYPE_MEM (1|0x0400) 75#define BIO_TYPE_MEM (1|0x0400)
@@ -88,6 +91,7 @@ extern "C" {
88#define BIO_TYPE_NULL_FILTER (17|0x0200) 91#define BIO_TYPE_NULL_FILTER (17|0x0200)
89#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */ 92#define BIO_TYPE_BER (18|0x0200) /* BER -> bin filter */
90#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ 93#define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */
94#define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */
91 95
92#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */ 96#define BIO_TYPE_DESCRIPTOR 0x0100 /* socket, fd, connect or accept */
93#define BIO_TYPE_FILTER 0x0200 97#define BIO_TYPE_FILTER 0x0200
@@ -207,19 +211,23 @@ extern "C" {
207#define BIO_method_name(b) ((b)->method->name) 211#define BIO_method_name(b) ((b)->method->name)
208#define BIO_method_type(b) ((b)->method->type) 212#define BIO_method_type(b) ((b)->method->type)
209 213
214typedef struct bio_st BIO;
215
216typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long);
217
210#ifndef WIN16 218#ifndef WIN16
211typedef struct bio_method_st 219typedef struct bio_method_st
212 { 220 {
213 int type; 221 int type;
214 const char *name; 222 const char *name;
215 int (*bwrite)(); 223 int (*bwrite)(BIO *, const char *, int);
216 int (*bread)(); 224 int (*bread)(BIO *, char *, int);
217 int (*bputs)(); 225 int (*bputs)(BIO *, const char *);
218 int (*bgets)(); 226 int (*bgets)(BIO *, char *, int);
219 long (*ctrl)(); 227 long (*ctrl)(BIO *, int, long, void *);
220 int (*create)(); 228 int (*create)(BIO *);
221 int (*destroy)(); 229 int (*destroy)(BIO *);
222 long (*callback_ctrl)(); 230 long (*callback_ctrl)(BIO *, int, bio_info_cb *);
223 } BIO_METHOD; 231 } BIO_METHOD;
224#else 232#else
225typedef struct bio_method_st 233typedef struct bio_method_st
@@ -237,7 +245,7 @@ typedef struct bio_method_st
237 } BIO_METHOD; 245 } BIO_METHOD;
238#endif 246#endif
239 247
240typedef struct bio_st 248struct bio_st
241 { 249 {
242 BIO_METHOD *method; 250 BIO_METHOD *method;
243 /* bio, mode, argp, argi, argl, ret */ 251 /* bio, mode, argp, argi, argl, ret */
@@ -257,7 +265,9 @@ typedef struct bio_st
257 unsigned long num_write; 265 unsigned long num_write;
258 266
259 CRYPTO_EX_DATA ex_data; 267 CRYPTO_EX_DATA ex_data;
260 } BIO; 268 };
269
270DECLARE_STACK_OF(BIO)
261 271
262typedef struct bio_f_buffer_ctx_struct 272typedef struct bio_f_buffer_ctx_struct
263 { 273 {
@@ -454,8 +464,8 @@ int BIO_read_filename(BIO *b,const char *name);
454size_t BIO_ctrl_pending(BIO *b); 464size_t BIO_ctrl_pending(BIO *b);
455size_t BIO_ctrl_wpending(BIO *b); 465size_t BIO_ctrl_wpending(BIO *b);
456#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) 466#define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
457#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(void (**)())(cbp)) 467#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(bio_info_cb **)(cbp))
458#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(void (*)())(cb)) 468#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(bio_info_cb *)(cb))
459 469
460/* For the BIO_f_buffer() type */ 470/* For the BIO_f_buffer() type */
461#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) 471#define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)
@@ -465,6 +475,7 @@ size_t BIO_ctrl_wpending(BIO *b);
465#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL) 475#define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)
466#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2) 476#define BIO_make_bio_pair(b1,b2) (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)
467#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL) 477#define BIO_destroy_bio_pair(b) (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)
478#define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)
468/* macros with inappropriate type -- but ...pending macros use int too: */ 479/* macros with inappropriate type -- but ...pending macros use int too: */
469#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL) 480#define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)
470#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL) 481#define BIO_get_read_request(b) (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)
@@ -472,11 +483,6 @@ size_t BIO_ctrl_get_write_guarantee(BIO *b);
472size_t BIO_ctrl_get_read_request(BIO *b); 483size_t BIO_ctrl_get_read_request(BIO *b);
473int BIO_ctrl_reset_read_request(BIO *b); 484int BIO_ctrl_reset_read_request(BIO *b);
474 485
475#ifdef NO_STDIO
476#define NO_FP_API
477#endif
478
479
480/* These two aren't currently implemented */ 486/* These two aren't currently implemented */
481/* int BIO_get_ex_num(BIO *bio); */ 487/* int BIO_get_ex_num(BIO *bio); */
482/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */ 488/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */
@@ -487,6 +493,7 @@ int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
487unsigned long BIO_number_read(BIO *bio); 493unsigned long BIO_number_read(BIO *bio);
488unsigned long BIO_number_written(BIO *bio); 494unsigned long BIO_number_written(BIO *bio);
489 495
496# ifndef NO_FP_API
490# if defined(WIN16) && defined(_WINDLL) 497# if defined(WIN16) && defined(_WINDLL)
491BIO_METHOD *BIO_s_file_internal(void); 498BIO_METHOD *BIO_s_file_internal(void);
492BIO *BIO_new_file_internal(char *filename, char *mode); 499BIO *BIO_new_file_internal(char *filename, char *mode);
@@ -502,21 +509,24 @@ BIO *BIO_new_fp(FILE *stream, int close_flag);
502# define BIO_new_file_internal BIO_new_file 509# define BIO_new_file_internal BIO_new_file
503# define BIO_new_fp_internal BIO_s_file 510# define BIO_new_fp_internal BIO_s_file
504# endif /* FP_API */ 511# endif /* FP_API */
512# endif
505BIO * BIO_new(BIO_METHOD *type); 513BIO * BIO_new(BIO_METHOD *type);
506int BIO_set(BIO *a,BIO_METHOD *type); 514int BIO_set(BIO *a,BIO_METHOD *type);
507int BIO_free(BIO *a); 515int BIO_free(BIO *a);
516void BIO_vfree(BIO *a);
508int BIO_read(BIO *b, void *data, int len); 517int BIO_read(BIO *b, void *data, int len);
509int BIO_gets(BIO *bp,char *buf, int size); 518int BIO_gets(BIO *bp,char *buf, int size);
510int BIO_write(BIO *b, const void *data, int len); 519int BIO_write(BIO *b, const void *data, int len);
511int BIO_puts(BIO *bp,const char *buf); 520int BIO_puts(BIO *bp,const char *buf);
512long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg); 521long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
513long BIO_callback_ctrl(BIO *bp,int cmd,void (*fp)()); 522long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long));
514char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg); 523char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
515long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg); 524long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
516BIO * BIO_push(BIO *b,BIO *append); 525BIO * BIO_push(BIO *b,BIO *append);
517BIO * BIO_pop(BIO *b); 526BIO * BIO_pop(BIO *b);
518void BIO_free_all(BIO *a); 527void BIO_free_all(BIO *a);
519BIO * BIO_find_type(BIO *b,int bio_type); 528BIO * BIO_find_type(BIO *b,int bio_type);
529BIO * BIO_next(BIO *b);
520BIO * BIO_get_retry_BIO(BIO *bio, int *reason); 530BIO * BIO_get_retry_BIO(BIO *bio, int *reason);
521int BIO_get_retry_reason(BIO *bio); 531int BIO_get_retry_reason(BIO *bio);
522BIO * BIO_dup_chain(BIO *in); 532BIO * BIO_dup_chain(BIO *in);
@@ -545,6 +555,9 @@ BIO_METHOD *BIO_s_bio(void);
545BIO_METHOD *BIO_s_null(void); 555BIO_METHOD *BIO_s_null(void);
546BIO_METHOD *BIO_f_null(void); 556BIO_METHOD *BIO_f_null(void);
547BIO_METHOD *BIO_f_buffer(void); 557BIO_METHOD *BIO_f_buffer(void);
558#ifdef VMS
559BIO_METHOD *BIO_f_linebuffer(void);
560#endif
548BIO_METHOD *BIO_f_nbio_test(void); 561BIO_METHOD *BIO_f_nbio_test(void);
549/* BIO_METHOD *BIO_f_ber(void); */ 562/* BIO_METHOD *BIO_f_ber(void); */
550 563
@@ -553,6 +566,7 @@ int BIO_sock_non_fatal_error(int error);
553int BIO_fd_should_retry(int i); 566int BIO_fd_should_retry(int i);
554int BIO_fd_non_fatal_error(int error); 567int BIO_fd_non_fatal_error(int error);
555int BIO_dump(BIO *b,const char *bytes,int len); 568int BIO_dump(BIO *b,const char *bytes,int len);
569int BIO_dump_indent(BIO *b,const char *bytes,int len,int indent);
556 570
557struct hostent *BIO_gethostbyname(const char *name); 571struct hostent *BIO_gethostbyname(const char *name);
558/* We might want a thread-safe interface too: 572/* We might want a thread-safe interface too:
@@ -592,7 +606,10 @@ void BIO_copy_next_retry(BIO *b);
592 606
593long BIO_ghbn_ctrl(int cmd,int iarg,char *parg); 607long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);
594 608
595int BIO_printf(BIO *bio, ...); 609int BIO_printf(BIO *bio, const char *format, ...);
610int BIO_vprintf(BIO *bio, const char *format, va_list args);
611int BIO_snprintf(char *buf, size_t n, const char *format, ...);
612int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
596 613
597/* BEGIN ERROR CODES */ 614/* BEGIN ERROR CODES */
598/* The following lines are auto generated by the script mkerr.pl. Any changes 615/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -627,6 +644,8 @@ int BIO_printf(BIO *bio, ...);
627#define BIO_F_CONN_CTRL 127 644#define BIO_F_CONN_CTRL 127
628#define BIO_F_CONN_STATE 115 645#define BIO_F_CONN_STATE 115
629#define BIO_F_FILE_CTRL 116 646#define BIO_F_FILE_CTRL 116
647#define BIO_F_LINEBUFFER_CTRL 129
648#define BIO_F_MEM_READ 128
630#define BIO_F_MEM_WRITE 117 649#define BIO_F_MEM_WRITE 117
631#define BIO_F_SSL_NEW 118 650#define BIO_F_SSL_NEW 118
632#define BIO_F_WSASTARTUP 119 651#define BIO_F_WSASTARTUP 119
@@ -637,6 +656,7 @@ int BIO_printf(BIO *bio, ...);
637#define BIO_R_BAD_HOSTNAME_LOOKUP 102 656#define BIO_R_BAD_HOSTNAME_LOOKUP 102
638#define BIO_R_BROKEN_PIPE 124 657#define BIO_R_BROKEN_PIPE 124
639#define BIO_R_CONNECT_ERROR 103 658#define BIO_R_CONNECT_ERROR 103
659#define BIO_R_EOF_ON_MEMORY_BIO 127
640#define BIO_R_ERROR_SETTING_NBIO 104 660#define BIO_R_ERROR_SETTING_NBIO 104
641#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105 661#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET 105
642#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106 662#define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET 106
diff --git a/src/lib/libcrypto/bio/bio_err.c b/src/lib/libcrypto/bio/bio_err.c
index f38e7b9178..bb815fb1e6 100644
--- a/src/lib/libcrypto/bio/bio_err.c
+++ b/src/lib/libcrypto/bio/bio_err.c
@@ -91,6 +91,8 @@ static ERR_STRING_DATA BIO_str_functs[]=
91{ERR_PACK(0,BIO_F_CONN_CTRL,0), "CONN_CTRL"}, 91{ERR_PACK(0,BIO_F_CONN_CTRL,0), "CONN_CTRL"},
92{ERR_PACK(0,BIO_F_CONN_STATE,0), "CONN_STATE"}, 92{ERR_PACK(0,BIO_F_CONN_STATE,0), "CONN_STATE"},
93{ERR_PACK(0,BIO_F_FILE_CTRL,0), "FILE_CTRL"}, 93{ERR_PACK(0,BIO_F_FILE_CTRL,0), "FILE_CTRL"},
94{ERR_PACK(0,BIO_F_LINEBUFFER_CTRL,0), "LINEBUFFER_CTRL"},
95{ERR_PACK(0,BIO_F_MEM_READ,0), "MEM_READ"},
94{ERR_PACK(0,BIO_F_MEM_WRITE,0), "MEM_WRITE"}, 96{ERR_PACK(0,BIO_F_MEM_WRITE,0), "MEM_WRITE"},
95{ERR_PACK(0,BIO_F_SSL_NEW,0), "SSL_new"}, 97{ERR_PACK(0,BIO_F_SSL_NEW,0), "SSL_new"},
96{ERR_PACK(0,BIO_F_WSASTARTUP,0), "WSASTARTUP"}, 98{ERR_PACK(0,BIO_F_WSASTARTUP,0), "WSASTARTUP"},
@@ -104,6 +106,7 @@ static ERR_STRING_DATA BIO_str_reasons[]=
104{BIO_R_BAD_HOSTNAME_LOOKUP ,"bad hostname lookup"}, 106{BIO_R_BAD_HOSTNAME_LOOKUP ,"bad hostname lookup"},
105{BIO_R_BROKEN_PIPE ,"broken pipe"}, 107{BIO_R_BROKEN_PIPE ,"broken pipe"},
106{BIO_R_CONNECT_ERROR ,"connect error"}, 108{BIO_R_CONNECT_ERROR ,"connect error"},
109{BIO_R_EOF_ON_MEMORY_BIO ,"EOF on memory BIO"},
107{BIO_R_ERROR_SETTING_NBIO ,"error setting nbio"}, 110{BIO_R_ERROR_SETTING_NBIO ,"error setting nbio"},
108{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET,"error setting nbio on accepted socket"}, 111{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET,"error setting nbio on accepted socket"},
109{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET,"error setting nbio on accept socket"}, 112{BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET,"error setting nbio on accept socket"},
@@ -124,8 +127,8 @@ static ERR_STRING_DATA BIO_str_reasons[]=
124{BIO_R_UNABLE_TO_LISTEN_SOCKET ,"unable to listen socket"}, 127{BIO_R_UNABLE_TO_LISTEN_SOCKET ,"unable to listen socket"},
125{BIO_R_UNINITIALIZED ,"uninitialized"}, 128{BIO_R_UNINITIALIZED ,"uninitialized"},
126{BIO_R_UNSUPPORTED_METHOD ,"unsupported method"}, 129{BIO_R_UNSUPPORTED_METHOD ,"unsupported method"},
127{BIO_R_WRITE_TO_READ_ONLY_BIO ,"write to read only bio"}, 130{BIO_R_WRITE_TO_READ_ONLY_BIO ,"write to read only BIO"},
128{BIO_R_WSASTARTUP ,"wsastartup"}, 131{BIO_R_WSASTARTUP ,"WSAStartup"},
129{0,NULL} 132{0,NULL}
130 }; 133 };
131 134
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c
index e88dcc80f3..381afc9b8e 100644
--- a/src/lib/libcrypto/bio/bio_lib.c
+++ b/src/lib/libcrypto/bio/bio_lib.c
@@ -70,7 +70,7 @@ BIO *BIO_new(BIO_METHOD *method)
70 { 70 {
71 BIO *ret=NULL; 71 BIO *ret=NULL;
72 72
73 ret=(BIO *)Malloc(sizeof(BIO)); 73 ret=(BIO *)OPENSSL_malloc(sizeof(BIO));
74 if (ret == NULL) 74 if (ret == NULL)
75 { 75 {
76 BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE); 76 BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);
@@ -78,7 +78,7 @@ BIO *BIO_new(BIO_METHOD *method)
78 } 78 }
79 if (!BIO_set(ret,method)) 79 if (!BIO_set(ret,method))
80 { 80 {
81 Free(ret); 81 OPENSSL_free(ret);
82 ret=NULL; 82 ret=NULL;
83 } 83 }
84 return(ret); 84 return(ret);
@@ -133,10 +133,13 @@ int BIO_free(BIO *a)
133 133
134 if ((a->method == NULL) || (a->method->destroy == NULL)) return(1); 134 if ((a->method == NULL) || (a->method->destroy == NULL)) return(1);
135 ret=a->method->destroy(a); 135 ret=a->method->destroy(a);
136 Free(a); 136 OPENSSL_free(a);
137 return(1); 137 return(1);
138 } 138 }
139 139
140void BIO_vfree(BIO *a)
141 { BIO_free(a); }
142
140int BIO_read(BIO *b, void *out, int outl) 143int BIO_read(BIO *b, void *out, int outl)
141 { 144 {
142 int i; 145 int i;
@@ -198,13 +201,7 @@ int BIO_write(BIO *b, const void *in, int inl)
198 201
199 if (i > 0) b->num_write+=(unsigned long)i; 202 if (i > 0) b->num_write+=(unsigned long)i;
200 203
201 /* This is evil and not thread safe. If the BIO has been freed, 204 if (cb != NULL)
202 * we must not call the callback. The only way to be able to
203 * determine this is the reference count which is now invalid since
204 * the memory has been free()ed.
205 */
206 if (b->references <= 0) abort();
207 if (cb != NULL) /* && (b->references >= 1)) */
208 i=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,in,inl, 205 i=(int)cb(b,BIO_CB_WRITE|BIO_CB_RETURN,in,inl,
209 0L,(long)i); 206 0L,(long)i);
210 return(i); 207 return(i);
@@ -235,6 +232,8 @@ int BIO_puts(BIO *b, const char *in)
235 232
236 i=b->method->bputs(b,in); 233 i=b->method->bputs(b,in);
237 234
235 if (i > 0) b->num_write+=(unsigned long)i;
236
238 if (cb != NULL) 237 if (cb != NULL)
239 i=(int)cb(b,BIO_CB_PUTS|BIO_CB_RETURN,in,0, 238 i=(int)cb(b,BIO_CB_PUTS|BIO_CB_RETURN,in,0,
240 0L,(long)i); 239 0L,(long)i);
@@ -317,7 +316,7 @@ long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
317 return(ret); 316 return(ret);
318 } 317 }
319 318
320long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)()) 319long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int, const char *, int, long, long))
321 { 320 {
322 long ret; 321 long ret;
323 long (*cb)(); 322 long (*cb)();
@@ -419,6 +418,7 @@ BIO *BIO_find_type(BIO *bio, int type)
419 { 418 {
420 int mt,mask; 419 int mt,mask;
421 420
421 if(!bio) return NULL;
422 mask=type&0xff; 422 mask=type&0xff;
423 do { 423 do {
424 if (bio->method != NULL) 424 if (bio->method != NULL)
@@ -437,6 +437,12 @@ BIO *BIO_find_type(BIO *bio, int type)
437 return(NULL); 437 return(NULL);
438 } 438 }
439 439
440BIO *BIO_next(BIO *b)
441 {
442 if(!b) return NULL;
443 return b->next_bio;
444 }
445
440void BIO_free_all(BIO *bio) 446void BIO_free_all(BIO *bio)
441 { 447 {
442 BIO *b; 448 BIO *b;
@@ -532,3 +538,5 @@ unsigned long BIO_number_written(BIO *bio)
532 if(bio) return bio->num_write; 538 if(bio) return bio->num_write;
533 return 0; 539 return 0;
534} 540}
541
542IMPLEMENT_STACK_OF(BIO)
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c
index 9afa636406..4da5822062 100644
--- a/src/lib/libcrypto/bio/bss_acpt.c
+++ b/src/lib/libcrypto/bio/bss_acpt.c
@@ -92,10 +92,10 @@ typedef struct bio_accept_st
92 BIO *bio_chain; 92 BIO *bio_chain;
93 } BIO_ACCEPT; 93 } BIO_ACCEPT;
94 94
95static int acpt_write(BIO *h,char *buf,int num); 95static int acpt_write(BIO *h, const char *buf, int num);
96static int acpt_read(BIO *h,char *buf,int size); 96static int acpt_read(BIO *h, char *buf, int size);
97static int acpt_puts(BIO *h,char *str); 97static int acpt_puts(BIO *h, const char *str);
98static long acpt_ctrl(BIO *h,int cmd,long arg1,char *arg2); 98static long acpt_ctrl(BIO *h, int cmd, long arg1, void *arg2);
99static int acpt_new(BIO *h); 99static int acpt_new(BIO *h);
100static int acpt_free(BIO *data); 100static int acpt_free(BIO *data);
101static int acpt_state(BIO *b, BIO_ACCEPT *c); 101static int acpt_state(BIO *b, BIO_ACCEPT *c);
@@ -145,7 +145,7 @@ BIO_ACCEPT *BIO_ACCEPT_new(void)
145 { 145 {
146 BIO_ACCEPT *ret; 146 BIO_ACCEPT *ret;
147 147
148 if ((ret=(BIO_ACCEPT *)Malloc(sizeof(BIO_ACCEPT))) == NULL) 148 if ((ret=(BIO_ACCEPT *)OPENSSL_malloc(sizeof(BIO_ACCEPT))) == NULL)
149 return(NULL); 149 return(NULL);
150 150
151 memset(ret,0,sizeof(BIO_ACCEPT)); 151 memset(ret,0,sizeof(BIO_ACCEPT));
@@ -159,10 +159,10 @@ void BIO_ACCEPT_free(BIO_ACCEPT *a)
159 if(a == NULL) 159 if(a == NULL)
160 return; 160 return;
161 161
162 if (a->param_addr != NULL) Free(a->param_addr); 162 if (a->param_addr != NULL) OPENSSL_free(a->param_addr);
163 if (a->addr != NULL) Free(a->addr); 163 if (a->addr != NULL) OPENSSL_free(a->addr);
164 if (a->bio_chain != NULL) BIO_free(a->bio_chain); 164 if (a->bio_chain != NULL) BIO_free(a->bio_chain);
165 Free(a); 165 OPENSSL_free(a);
166 } 166 }
167 167
168static void acpt_close_socket(BIO *bio) 168static void acpt_close_socket(BIO *bio)
@@ -307,7 +307,7 @@ static int acpt_read(BIO *b, char *out, int outl)
307 return(ret); 307 return(ret);
308 } 308 }
309 309
310static int acpt_write(BIO *b, char *in, int inl) 310static int acpt_write(BIO *b, const char *in, int inl)
311 { 311 {
312 int ret; 312 int ret;
313 BIO_ACCEPT *data; 313 BIO_ACCEPT *data;
@@ -326,7 +326,7 @@ static int acpt_write(BIO *b, char *in, int inl)
326 return(ret); 326 return(ret);
327 } 327 }
328 328
329static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr) 329static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
330 { 330 {
331 BIO *dbio; 331 BIO *dbio;
332 int *ip; 332 int *ip;
@@ -355,7 +355,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr)
355 { 355 {
356 b->init=1; 356 b->init=1;
357 if (data->param_addr != NULL) 357 if (data->param_addr != NULL)
358 Free(data->param_addr); 358 OPENSSL_free(data->param_addr);
359 data->param_addr=BUF_strdup(ptr); 359 data->param_addr=BUF_strdup(ptr);
360 } 360 }
361 else if (num == 1) 361 else if (num == 1)
@@ -440,7 +440,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, char *ptr)
440 return(ret); 440 return(ret);
441 } 441 }
442 442
443static int acpt_puts(BIO *bp, char *str) 443static int acpt_puts(BIO *bp, const char *str)
444 { 444 {
445 int n,ret; 445 int n,ret;
446 446
diff --git a/src/lib/libcrypto/bio/bss_bio.c b/src/lib/libcrypto/bio/bss_bio.c
index 1e2d7491f2..78c6ab4fdd 100644
--- a/src/lib/libcrypto/bio/bss_bio.c
+++ b/src/lib/libcrypto/bio/bss_bio.c
@@ -30,9 +30,9 @@
30static int bio_new(BIO *bio); 30static int bio_new(BIO *bio);
31static int bio_free(BIO *bio); 31static int bio_free(BIO *bio);
32static int bio_read(BIO *bio, char *buf, int size); 32static int bio_read(BIO *bio, char *buf, int size);
33static int bio_write(BIO *bio, char *buf, int num); 33static int bio_write(BIO *bio, const char *buf, int num);
34static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr); 34static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr);
35static int bio_puts(BIO *bio, char *str); 35static int bio_puts(BIO *bio, const char *str);
36 36
37static int bio_make_pair(BIO *bio1, BIO *bio2); 37static int bio_make_pair(BIO *bio1, BIO *bio2);
38static void bio_destroy_pair(BIO *bio); 38static void bio_destroy_pair(BIO *bio);
@@ -80,7 +80,7 @@ static int bio_new(BIO *bio)
80 { 80 {
81 struct bio_bio_st *b; 81 struct bio_bio_st *b;
82 82
83 b = Malloc(sizeof *b); 83 b = OPENSSL_malloc(sizeof *b);
84 if (b == NULL) 84 if (b == NULL)
85 return 0; 85 return 0;
86 86
@@ -108,10 +108,10 @@ static int bio_free(BIO *bio)
108 108
109 if (b->buf != NULL) 109 if (b->buf != NULL)
110 { 110 {
111 Free(b->buf); 111 OPENSSL_free(b->buf);
112 } 112 }
113 113
114 Free(b); 114 OPENSSL_free(b);
115 115
116 return 1; 116 return 1;
117 } 117 }
@@ -283,7 +283,7 @@ static ssize_t bio_nread(BIO *bio, char **buf, size_t num_)
283 } 283 }
284 284
285 285
286static int bio_write(BIO *bio, char *buf, int num_) 286static int bio_write(BIO *bio, const char *buf, int num_)
287 { 287 {
288 size_t num = num_; 288 size_t num = num_;
289 size_t rest; 289 size_t rest;
@@ -464,7 +464,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
464 { 464 {
465 if (b->buf) 465 if (b->buf)
466 { 466 {
467 Free(b->buf); 467 OPENSSL_free(b->buf);
468 b->buf = NULL; 468 b->buf = NULL;
469 } 469 }
470 b->size = new_size; 470 b->size = new_size;
@@ -628,7 +628,7 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr)
628 return ret; 628 return ret;
629 } 629 }
630 630
631static int bio_puts(BIO *bio, char *str) 631static int bio_puts(BIO *bio, const char *str)
632 { 632 {
633 return bio_write(bio, str, strlen(str)); 633 return bio_write(bio, str, strlen(str));
634 } 634 }
@@ -652,7 +652,7 @@ static int bio_make_pair(BIO *bio1, BIO *bio2)
652 652
653 if (b1->buf == NULL) 653 if (b1->buf == NULL)
654 { 654 {
655 b1->buf = Malloc(b1->size); 655 b1->buf = OPENSSL_malloc(b1->size);
656 if (b1->buf == NULL) 656 if (b1->buf == NULL)
657 { 657 {
658 BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE); 658 BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE);
@@ -664,7 +664,7 @@ static int bio_make_pair(BIO *bio1, BIO *bio2)
664 664
665 if (b2->buf == NULL) 665 if (b2->buf == NULL)
666 { 666 {
667 b2->buf = Malloc(b2->size); 667 b2->buf = OPENSSL_malloc(b2->size);
668 if (b2->buf == NULL) 668 if (b2->buf == NULL)
669 { 669 {
670 BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE); 670 BIOerr(BIO_F_BIO_MAKE_PAIR, ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c
index 22d00b369e..a6b77a2cb9 100644
--- a/src/lib/libcrypto/bio/bss_conn.c
+++ b/src/lib/libcrypto/bio/bss_conn.c
@@ -98,13 +98,13 @@ typedef struct bio_connect_st
98 int (*info_callback)(); 98 int (*info_callback)();
99 } BIO_CONNECT; 99 } BIO_CONNECT;
100 100
101static int conn_write(BIO *h,char *buf,int num); 101static int conn_write(BIO *h, const char *buf, int num);
102static int conn_read(BIO *h,char *buf,int size); 102static int conn_read(BIO *h, char *buf, int size);
103static int conn_puts(BIO *h,char *str); 103static int conn_puts(BIO *h, const char *str);
104static long conn_ctrl(BIO *h,int cmd,long arg1,char *arg2); 104static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2);
105static int conn_new(BIO *h); 105static int conn_new(BIO *h);
106static int conn_free(BIO *data); 106static int conn_free(BIO *data);
107static long conn_callback_ctrl(BIO *h,int cmd,void *(*fp)()); 107static long conn_callback_ctrl(BIO *h, int cmd, bio_info_cb *);
108 108
109static int conn_state(BIO *b, BIO_CONNECT *c); 109static int conn_state(BIO *b, BIO_CONNECT *c);
110static void conn_close_socket(BIO *data); 110static void conn_close_socket(BIO *data);
@@ -165,7 +165,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
165 break; 165 break;
166 } 166 }
167 if (c->param_port != NULL) 167 if (c->param_port != NULL)
168 Free(c->param_port); 168 OPENSSL_free(c->param_port);
169 c->param_port=BUF_strdup(p); 169 c->param_port=BUF_strdup(p);
170 } 170 }
171 } 171 }
@@ -188,7 +188,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
188 case BIO_CONN_S_GET_PORT: 188 case BIO_CONN_S_GET_PORT:
189 if (c->param_port == NULL) 189 if (c->param_port == NULL)
190 { 190 {
191 abort(); 191 /* abort(); */
192 goto exit_loop; 192 goto exit_loop;
193 } 193 }
194 else if (BIO_get_port(c->param_port,&c->port) <= 0) 194 else if (BIO_get_port(c->param_port,&c->port) <= 0)
@@ -236,7 +236,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
236 } 236 }
237 c->state=BIO_CONN_S_CONNECT; 237 c->state=BIO_CONN_S_CONNECT;
238 238
239#ifdef SO_KEEPALIVE 239#if defined(SO_KEEPALIVE) && !defined(MPE)
240 i=1; 240 i=1;
241 i=setsockopt(b->num,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); 241 i=setsockopt(b->num,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
242 if (i < 0) 242 if (i < 0)
@@ -299,7 +299,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
299 ret=1; 299 ret=1;
300 goto exit_loop; 300 goto exit_loop;
301 default: 301 default:
302 abort(); 302 /* abort(); */
303 goto exit_loop; 303 goto exit_loop;
304 } 304 }
305 305
@@ -322,7 +322,7 @@ BIO_CONNECT *BIO_CONNECT_new(void)
322 { 322 {
323 BIO_CONNECT *ret; 323 BIO_CONNECT *ret;
324 324
325 if ((ret=(BIO_CONNECT *)Malloc(sizeof(BIO_CONNECT))) == NULL) 325 if ((ret=(BIO_CONNECT *)OPENSSL_malloc(sizeof(BIO_CONNECT))) == NULL)
326 return(NULL); 326 return(NULL);
327 ret->state=BIO_CONN_S_BEFORE; 327 ret->state=BIO_CONN_S_BEFORE;
328 ret->param_hostname=NULL; 328 ret->param_hostname=NULL;
@@ -344,10 +344,10 @@ void BIO_CONNECT_free(BIO_CONNECT *a)
344 return; 344 return;
345 345
346 if (a->param_hostname != NULL) 346 if (a->param_hostname != NULL)
347 Free(a->param_hostname); 347 OPENSSL_free(a->param_hostname);
348 if (a->param_port != NULL) 348 if (a->param_port != NULL)
349 Free(a->param_port); 349 OPENSSL_free(a->param_port);
350 Free(a); 350 OPENSSL_free(a);
351 } 351 }
352 352
353BIO_METHOD *BIO_s_connect(void) 353BIO_METHOD *BIO_s_connect(void)
@@ -426,7 +426,7 @@ static int conn_read(BIO *b, char *out, int outl)
426 return(ret); 426 return(ret);
427 } 427 }
428 428
429static int conn_write(BIO *b, char *in, int inl) 429static int conn_write(BIO *b, const char *in, int inl)
430 { 430 {
431 int ret; 431 int ret;
432 BIO_CONNECT *data; 432 BIO_CONNECT *data;
@@ -449,7 +449,7 @@ static int conn_write(BIO *b, char *in, int inl)
449 return(ret); 449 return(ret);
450 } 450 }
451 451
452static long conn_ctrl(BIO *b, int cmd, long num, char *ptr) 452static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
453 { 453 {
454 BIO *dbio; 454 BIO *dbio;
455 int *ip; 455 int *ip;
@@ -507,23 +507,24 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
507 if (num == 0) 507 if (num == 0)
508 { 508 {
509 if (data->param_hostname != NULL) 509 if (data->param_hostname != NULL)
510 Free(data->param_hostname); 510 OPENSSL_free(data->param_hostname);
511 data->param_hostname=BUF_strdup(ptr); 511 data->param_hostname=BUF_strdup(ptr);
512 } 512 }
513 else if (num == 1) 513 else if (num == 1)
514 { 514 {
515 if (data->param_port != NULL) 515 if (data->param_port != NULL)
516 Free(data->param_port); 516 OPENSSL_free(data->param_port);
517 data->param_port=BUF_strdup(ptr); 517 data->param_port=BUF_strdup(ptr);
518 } 518 }
519 else if (num == 2) 519 else if (num == 2)
520 { 520 {
521 char buf[16]; 521 char buf[16];
522 char *p = ptr;
522 523
523 sprintf(buf,"%d.%d.%d.%d", 524 sprintf(buf,"%d.%d.%d.%d",
524 ptr[0],ptr[1],ptr[2],ptr[3]); 525 p[0],p[1],p[2],p[3]);
525 if (data->param_hostname != NULL) 526 if (data->param_hostname != NULL)
526 Free(data->param_hostname); 527 OPENSSL_free(data->param_hostname);
527 data->param_hostname=BUF_strdup(buf); 528 data->param_hostname=BUF_strdup(buf);
528 memcpy(&(data->ip[0]),ptr,4); 529 memcpy(&(data->ip[0]),ptr,4);
529 } 530 }
@@ -533,7 +534,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
533 534
534 sprintf(buf,"%d",*(int *)ptr); 535 sprintf(buf,"%d",*(int *)ptr);
535 if (data->param_port != NULL) 536 if (data->param_port != NULL)
536 Free(data->param_port); 537 OPENSSL_free(data->param_port);
537 data->param_port=BUF_strdup(buf); 538 data->param_port=BUF_strdup(buf);
538 data->port= *(int *)ptr; 539 data->port= *(int *)ptr;
539 } 540 }
@@ -573,7 +574,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
573 if (data->param_hostname) 574 if (data->param_hostname)
574 BIO_set_conn_hostname(dbio,data->param_hostname); 575 BIO_set_conn_hostname(dbio,data->param_hostname);
575 BIO_set_nbio(dbio,data->nbio); 576 BIO_set_nbio(dbio,data->nbio);
576 (void)BIO_set_info_callback(dbio,(void *(*)())(data->info_callback)); 577 (void)BIO_set_info_callback(dbio,data->info_callback);
577 } 578 }
578 break; 579 break;
579 case BIO_CTRL_SET_CALLBACK: 580 case BIO_CTRL_SET_CALLBACK:
@@ -601,7 +602,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr)
601 return(ret); 602 return(ret);
602 } 603 }
603 604
604static long conn_callback_ctrl(BIO *b, int cmd, void *(*fp)()) 605static long conn_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
605 { 606 {
606 long ret=1; 607 long ret=1;
607 BIO_CONNECT *data; 608 BIO_CONNECT *data;
@@ -622,7 +623,7 @@ static long conn_callback_ctrl(BIO *b, int cmd, void *(*fp)())
622 return(ret); 623 return(ret);
623 } 624 }
624 625
625static int conn_puts(BIO *bp, char *str) 626static int conn_puts(BIO *bp, const char *str)
626 { 627 {
627 int n,ret; 628 int n,ret;
628 629
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c
index 0d44dc3889..1f770b390f 100644
--- a/src/lib/libcrypto/bio/bss_file.c
+++ b/src/lib/libcrypto/bio/bss_file.c
@@ -73,11 +73,11 @@
73 73
74#if !defined(NO_STDIO) 74#if !defined(NO_STDIO)
75 75
76static int MS_CALLBACK file_write(BIO *h,char *buf,int num); 76static int MS_CALLBACK file_write(BIO *h, const char *buf, int num);
77static int MS_CALLBACK file_read(BIO *h,char *buf,int size); 77static int MS_CALLBACK file_read(BIO *h, char *buf, int size);
78static int MS_CALLBACK file_puts(BIO *h,char *str); 78static int MS_CALLBACK file_puts(BIO *h, const char *str);
79static int MS_CALLBACK file_gets(BIO *h,char *str,int size); 79static int MS_CALLBACK file_gets(BIO *h, char *str, int size);
80static long MS_CALLBACK file_ctrl(BIO *h,int cmd,long arg1,char *arg2); 80static long MS_CALLBACK file_ctrl(BIO *h, int cmd, long arg1, void *arg2);
81static int MS_CALLBACK file_new(BIO *h); 81static int MS_CALLBACK file_new(BIO *h);
82static int MS_CALLBACK file_free(BIO *data); 82static int MS_CALLBACK file_free(BIO *data);
83static BIO_METHOD methods_filep= 83static BIO_METHOD methods_filep=
@@ -163,7 +163,7 @@ static int MS_CALLBACK file_read(BIO *b, char *out, int outl)
163 return(ret); 163 return(ret);
164 } 164 }
165 165
166static int MS_CALLBACK file_write(BIO *b, char *in, int inl) 166static int MS_CALLBACK file_write(BIO *b, const char *in, int inl)
167 { 167 {
168 int ret=0; 168 int ret=0;
169 169
@@ -179,7 +179,7 @@ static int MS_CALLBACK file_write(BIO *b, char *in, int inl)
179 return(ret); 179 return(ret);
180 } 180 }
181 181
182static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, char *ptr) 182static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
183 { 183 {
184 long ret=1; 184 long ret=1;
185 FILE *fp=(FILE *)b->ptr; 185 FILE *fp=(FILE *)b->ptr;
@@ -294,7 +294,7 @@ static int MS_CALLBACK file_gets(BIO *bp, char *buf, int size)
294 return(ret); 294 return(ret);
295 } 295 }
296 296
297static int MS_CALLBACK file_puts(BIO *bp, char *str) 297static int MS_CALLBACK file_puts(BIO *bp, const char *str)
298 { 298 {
299 int n,ret; 299 int n,ret;
300 300
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c
index 497eb1af72..1edf16a76f 100644
--- a/src/lib/libcrypto/bio/bss_log.c
+++ b/src/lib/libcrypto/bio/bss_log.c
@@ -110,14 +110,26 @@
110#define LOG_DAEMON OPC$M_NM_NTWORK 110#define LOG_DAEMON OPC$M_NM_NTWORK
111#endif 111#endif
112 112
113static int MS_CALLBACK slg_write(BIO *h,char *buf,int num); 113static int MS_CALLBACK slg_write(BIO *h, const char *buf, int num);
114static int MS_CALLBACK slg_puts(BIO *h,char *str); 114static int MS_CALLBACK slg_puts(BIO *h, const char *str);
115static long MS_CALLBACK slg_ctrl(BIO *h,int cmd,long arg1,char *arg2); 115static long MS_CALLBACK slg_ctrl(BIO *h, int cmd, long arg1, void *arg2);
116static int MS_CALLBACK slg_new(BIO *h); 116static int MS_CALLBACK slg_new(BIO *h);
117static int MS_CALLBACK slg_free(BIO *data); 117static int MS_CALLBACK slg_free(BIO *data);
118static void xopenlog(BIO* bp, const char* name, int level); 118static void xopenlog(BIO* bp, char* name, int level);
119static void xsyslog(BIO* bp, int priority, const char* string); 119static void xsyslog(BIO* bp, int priority, const char* string);
120static void xcloselog(BIO* bp); 120static void xcloselog(BIO* bp);
121#ifdef WIN32
122LONG (WINAPI *go_for_advapi)() = RegOpenKeyEx;
123HANDLE (WINAPI *register_event_source)() = NULL;
124BOOL (WINAPI *deregister_event_source)() = NULL;
125BOOL (WINAPI *report_event)() = NULL;
126#define DL_PROC(m,f) (GetProcAddress( m, f ))
127#ifdef UNICODE
128#define DL_PROC_X(m,f) DL_PROC( m, f "W" )
129#else
130#define DL_PROC_X(m,f) DL_PROC( m, f "A" )
131#endif
132#endif
121 133
122static BIO_METHOD methods_slg= 134static BIO_METHOD methods_slg=
123 { 135 {
@@ -153,40 +165,60 @@ static int MS_CALLBACK slg_free(BIO *a)
153 return(1); 165 return(1);
154 } 166 }
155 167
156static int MS_CALLBACK slg_write(BIO *b, char *in, int inl) 168static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl)
157 { 169 {
158 int ret= inl; 170 int ret= inl;
159 char* buf= in; 171 char* buf;
160 char* pp; 172 char* pp;
161 int priority; 173 int priority, i;
162 174 static struct
163 if((buf= (char *)Malloc(inl+ 1)) == NULL){ 175 {
176 int strl;
177 char str[10];
178 int log_level;
179 }
180 mapping[] =
181 {
182 { 6, "PANIC ", LOG_EMERG },
183 { 6, "EMERG ", LOG_EMERG },
184 { 4, "EMR ", LOG_EMERG },
185 { 6, "ALERT ", LOG_ALERT },
186 { 4, "ALR ", LOG_ALERT },
187 { 5, "CRIT ", LOG_CRIT },
188 { 4, "CRI ", LOG_CRIT },
189 { 6, "ERROR ", LOG_ERR },
190 { 4, "ERR ", LOG_ERR },
191 { 8, "WARNING ", LOG_WARNING },
192 { 5, "WARN ", LOG_WARNING },
193 { 4, "WAR ", LOG_WARNING },
194 { 7, "NOTICE ", LOG_NOTICE },
195 { 5, "NOTE ", LOG_NOTICE },
196 { 4, "NOT ", LOG_NOTICE },
197 { 5, "INFO ", LOG_INFO },
198 { 4, "INF ", LOG_INFO },
199 { 6, "DEBUG ", LOG_DEBUG },
200 { 4, "DBG ", LOG_DEBUG },
201 { 0, "", LOG_ERR } /* The default */
202 };
203
204 if((buf= (char *)OPENSSL_malloc(inl+ 1)) == NULL){
164 return(0); 205 return(0);
165 } 206 }
166 strncpy(buf, in, inl); 207 strncpy(buf, in, inl);
167 buf[inl]= '\0'; 208 buf[inl]= '\0';
168 209
169 if(strncmp(buf, "ERR ", 4) == 0){ 210 i = 0;
170 priority= LOG_ERR; 211 while(strncmp(buf, mapping[i].str, mapping[i].strl) != 0) i++;
171 pp= buf+ 4; 212 priority = mapping[i].log_level;
172 }else if(strncmp(buf, "WAR ", 4) == 0){ 213 pp = buf + mapping[i].strl;
173 priority= LOG_WARNING;
174 pp= buf+ 4;
175 }else if(strncmp(buf, "INF ", 4) == 0){
176 priority= LOG_INFO;
177 pp= buf+ 4;
178 }else{
179 priority= LOG_ERR;
180 pp= buf;
181 }
182 214
183 xsyslog(b, priority, pp); 215 xsyslog(b, priority, pp);
184 216
185 Free(buf); 217 OPENSSL_free(buf);
186 return(ret); 218 return(ret);
187 } 219 }
188 220
189static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, char *ptr) 221static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, void *ptr)
190 { 222 {
191 switch (cmd) 223 switch (cmd)
192 { 224 {
@@ -200,7 +232,7 @@ static long MS_CALLBACK slg_ctrl(BIO *b, int cmd, long num, char *ptr)
200 return(0); 232 return(0);
201 } 233 }
202 234
203static int MS_CALLBACK slg_puts(BIO *bp, char *str) 235static int MS_CALLBACK slg_puts(BIO *bp, const char *str)
204 { 236 {
205 int n,ret; 237 int n,ret;
206 238
@@ -211,9 +243,29 @@ static int MS_CALLBACK slg_puts(BIO *bp, char *str)
211 243
212#if defined(WIN32) 244#if defined(WIN32)
213 245
214static void xopenlog(BIO* bp, const char* name, int level) 246static void xopenlog(BIO* bp, char* name, int level)
215{ 247{
216 bp->ptr= (char *)RegisterEventSource(NULL, name); 248 if ( !register_event_source )
249 {
250 HANDLE advapi;
251 if ( !(advapi = GetModuleHandle("advapi32")) )
252 return;
253 register_event_source = (HANDLE (WINAPI *)())DL_PROC_X(advapi,
254 "RegisterEventSource" );
255 deregister_event_source = (BOOL (WINAPI *)())DL_PROC(advapi,
256 "DeregisterEventSource");
257 report_event = (BOOL (WINAPI *)())DL_PROC_X(advapi,
258 "ReportEvent" );
259 if ( !(register_event_source && deregister_event_source &&
260 report_event) )
261 {
262 register_event_source = NULL;
263 deregister_event_source = NULL;
264 report_event = NULL;
265 return;
266 }
267 }
268 bp->ptr= (char *)register_event_source(NULL, name);
217} 269}
218 270
219static void xsyslog(BIO *bp, int priority, const char *string) 271static void xsyslog(BIO *bp, int priority, const char *string)
@@ -225,16 +277,22 @@ static void xsyslog(BIO *bp, int priority, const char *string)
225 277
226 switch (priority) 278 switch (priority)
227 { 279 {
280 case LOG_EMERG:
281 case LOG_ALERT:
282 case LOG_CRIT:
228 case LOG_ERR: 283 case LOG_ERR:
229 evtype = EVENTLOG_ERROR_TYPE; 284 evtype = EVENTLOG_ERROR_TYPE;
230 break; 285 break;
231 case LOG_WARNING: 286 case LOG_WARNING:
232 evtype = EVENTLOG_WARNING_TYPE; 287 evtype = EVENTLOG_WARNING_TYPE;
233 break; 288 break;
289 case LOG_NOTICE:
234 case LOG_INFO: 290 case LOG_INFO:
291 case LOG_DEBUG:
235 evtype = EVENTLOG_INFORMATION_TYPE; 292 evtype = EVENTLOG_INFORMATION_TYPE;
236 break; 293 break;
237 default: 294 default: /* Should never happen, but set it
295 as error anyway. */
238 evtype = EVENTLOG_ERROR_TYPE; 296 evtype = EVENTLOG_ERROR_TYPE;
239 break; 297 break;
240 } 298 }
@@ -243,15 +301,15 @@ static void xsyslog(BIO *bp, int priority, const char *string)
243 lpszStrings[0] = pidbuf; 301 lpszStrings[0] = pidbuf;
244 lpszStrings[1] = string; 302 lpszStrings[1] = string;
245 303
246 if(bp->ptr) 304 if(report_event && bp->ptr)
247 ReportEvent(bp->ptr, evtype, 0, 1024, NULL, 2, 0, 305 report_event(bp->ptr, evtype, 0, 1024, NULL, 2, 0,
248 lpszStrings, NULL); 306 lpszStrings, NULL);
249} 307}
250 308
251static void xcloselog(BIO* bp) 309static void xcloselog(BIO* bp)
252{ 310{
253 if(bp->ptr) 311 if(deregister_event_source && bp->ptr)
254 DeregisterEventSource((HANDLE)(bp->ptr)); 312 deregister_event_source((HANDLE)(bp->ptr));
255 bp->ptr= NULL; 313 bp->ptr= NULL;
256} 314}
257 315
@@ -259,7 +317,7 @@ static void xcloselog(BIO* bp)
259 317
260static int VMS_OPC_target = LOG_DAEMON; 318static int VMS_OPC_target = LOG_DAEMON;
261 319
262static void xopenlog(BIO* bp, const char* name, int level) 320static void xopenlog(BIO* bp, char* name, int level)
263{ 321{
264 VMS_OPC_target = level; 322 VMS_OPC_target = level;
265} 323}
@@ -294,7 +352,7 @@ static void xsyslog(BIO *bp, int priority, const char *string)
294 lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); 352 lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string);
295 353
296 /* we know there's an 8 byte header. That's documented */ 354 /* we know there's an 8 byte header. That's documented */
297 opcdef_p = (struct opcdef *) Malloc(8 + len); 355 opcdef_p = (struct opcdef *) OPENSSL_malloc(8 + len);
298 opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; 356 opcdef_p->opc$b_ms_type = OPC$_RQ_RQST;
299 memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); 357 memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3);
300 opcdef_p->opc$l_ms_rqstid = 0; 358 opcdef_p->opc$l_ms_rqstid = 0;
@@ -307,7 +365,7 @@ static void xsyslog(BIO *bp, int priority, const char *string)
307 365
308 sys$sndopr(opc_dsc, 0); 366 sys$sndopr(opc_dsc, 0);
309 367
310 Free(opcdef_p); 368 OPENSSL_free(opcdef_p);
311} 369}
312 370
313static void xcloselog(BIO* bp) 371static void xcloselog(BIO* bp)
@@ -316,7 +374,7 @@ static void xcloselog(BIO* bp)
316 374
317#else /* Unix */ 375#else /* Unix */
318 376
319static void xopenlog(BIO* bp, const char* name, int level) 377static void xopenlog(BIO* bp, char* name, int level)
320{ 378{
321 openlog(name, LOG_PID|LOG_CONS, level); 379 openlog(name, LOG_PID|LOG_CONS, level);
322} 380}
diff --git a/src/lib/libcrypto/bio/bss_mem.c b/src/lib/libcrypto/bio/bss_mem.c
index 41eab92415..28ff7582bf 100644
--- a/src/lib/libcrypto/bio/bss_mem.c
+++ b/src/lib/libcrypto/bio/bss_mem.c
@@ -61,11 +61,11 @@
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63 63
64static int mem_write(BIO *h,char *buf,int num); 64static int mem_write(BIO *h, const char *buf, int num);
65static int mem_read(BIO *h,char *buf,int size); 65static int mem_read(BIO *h, char *buf, int size);
66static int mem_puts(BIO *h,char *str); 66static int mem_puts(BIO *h, const char *str);
67static int mem_gets(BIO *h,char *str,int size); 67static int mem_gets(BIO *h, char *str, int size);
68static long mem_ctrl(BIO *h,int cmd,long arg1,char *arg2); 68static long mem_ctrl(BIO *h, int cmd, long arg1, void *arg2);
69static int mem_new(BIO *h); 69static int mem_new(BIO *h);
70static int mem_free(BIO *data); 70static int mem_free(BIO *data);
71static BIO_METHOD mem_method= 71static BIO_METHOD mem_method=
@@ -163,14 +163,14 @@ static int mem_read(BIO *b, char *out, int outl)
163 } 163 }
164 } else if (bm->length == 0) 164 } else if (bm->length == 0)
165 { 165 {
166 if (b->num != 0) 166 ret = b->num;
167 if (ret != 0)
167 BIO_set_retry_read(b); 168 BIO_set_retry_read(b);
168 ret= b->num;
169 } 169 }
170 return(ret); 170 return(ret);
171 } 171 }
172 172
173static int mem_write(BIO *b, char *in, int inl) 173static int mem_write(BIO *b, const char *in, int inl)
174 { 174 {
175 int ret= -1; 175 int ret= -1;
176 int blen; 176 int blen;
@@ -198,7 +198,7 @@ end:
198 return(ret); 198 return(ret);
199 } 199 }
200 200
201static long mem_ctrl(BIO *b, int cmd, long num, char *ptr) 201static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)
202 { 202 {
203 long ret=1; 203 long ret=1;
204 char **pptr; 204 char **pptr;
@@ -208,15 +208,20 @@ static long mem_ctrl(BIO *b, int cmd, long num, char *ptr)
208 switch (cmd) 208 switch (cmd)
209 { 209 {
210 case BIO_CTRL_RESET: 210 case BIO_CTRL_RESET:
211 if (bm->data != NULL) { 211 if (bm->data != NULL)
212 {
212 /* For read only case reset to the start again */ 213 /* For read only case reset to the start again */
213 if(b->flags & BIO_FLAGS_MEM_RDONLY) 214 if(b->flags & BIO_FLAGS_MEM_RDONLY)
214 bm->data -= bm->max - bm->length; 215 {
215 else { 216 bm->data -= bm->max - bm->length;
217 bm->length = bm->max;
218 }
219 else
220 {
216 memset(bm->data,0,bm->max); 221 memset(bm->data,0,bm->max);
217 bm->length=0; 222 bm->length=0;
223 }
218 } 224 }
219 }
220 break; 225 break;
221 case BIO_CTRL_EOF: 226 case BIO_CTRL_EOF:
222 ret=(long)(bm->length == 0); 227 ret=(long)(bm->length == 0);
@@ -300,7 +305,7 @@ static int mem_gets(BIO *bp, char *buf, int size)
300 return(ret); 305 return(ret);
301 } 306 }
302 307
303static int mem_puts(BIO *bp, char *str) 308static int mem_puts(BIO *bp, const char *str)
304 { 309 {
305 int n,ret; 310 int n,ret;
306 311
diff --git a/src/lib/libcrypto/bio/bss_null.c b/src/lib/libcrypto/bio/bss_null.c
index aee18e3ada..46b73339df 100644
--- a/src/lib/libcrypto/bio/bss_null.c
+++ b/src/lib/libcrypto/bio/bss_null.c
@@ -61,11 +61,11 @@
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/bio.h> 62#include <openssl/bio.h>
63 63
64static int null_write(BIO *h,char *buf,int num); 64static int null_write(BIO *h, const char *buf, int num);
65static int null_read(BIO *h,char *buf,int size); 65static int null_read(BIO *h, char *buf, int size);
66static int null_puts(BIO *h,char *str); 66static int null_puts(BIO *h, const char *str);
67static int null_gets(BIO *h,char *str,int size); 67static int null_gets(BIO *h, char *str, int size);
68static long null_ctrl(BIO *h,int cmd,long arg1,char *arg2); 68static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);
69static int null_new(BIO *h); 69static int null_new(BIO *h);
70static int null_free(BIO *data); 70static int null_free(BIO *data);
71static BIO_METHOD null_method= 71static BIO_METHOD null_method=
@@ -106,12 +106,12 @@ static int null_read(BIO *b, char *out, int outl)
106 return(0); 106 return(0);
107 } 107 }
108 108
109static int null_write(BIO *b, char *in, int inl) 109static int null_write(BIO *b, const char *in, int inl)
110 { 110 {
111 return(inl); 111 return(inl);
112 } 112 }
113 113
114static long null_ctrl(BIO *b, int cmd, long num, char *ptr) 114static long null_ctrl(BIO *b, int cmd, long num, void *ptr)
115 { 115 {
116 long ret=1; 116 long ret=1;
117 117
@@ -142,7 +142,7 @@ static int null_gets(BIO *bp, char *buf, int size)
142 return(0); 142 return(0);
143 } 143 }
144 144
145static int null_puts(BIO *bp, char *str) 145static int null_puts(BIO *bp, const char *str)
146 { 146 {
147 if (str == NULL) return(0); 147 if (str == NULL) return(0);
148 return(strlen(str)); 148 return(strlen(str));
diff --git a/src/lib/libcrypto/bio/bss_rtcp.c b/src/lib/libcrypto/bio/bss_rtcp.c
index 4ad0739464..7dae485564 100644
--- a/src/lib/libcrypto/bio/bss_rtcp.c
+++ b/src/lib/libcrypto/bio/bss_rtcp.c
@@ -88,11 +88,11 @@ struct rpc_ctx {
88 struct rpc_msg msg; 88 struct rpc_msg msg;
89}; 89};
90 90
91static int rtcp_write(BIO *h,char *buf,int num); 91static int rtcp_write(BIO *h,const char *buf,int num);
92static int rtcp_read(BIO *h,char *buf,int size); 92static int rtcp_read(BIO *h,char *buf,int size);
93static int rtcp_puts(BIO *h,char *str); 93static int rtcp_puts(BIO *h,const char *str);
94static int rtcp_gets(BIO *h,char *str,int size); 94static int rtcp_gets(BIO *h,char *str,int size);
95static long rtcp_ctrl(BIO *h,int cmd,long arg1,char *arg2); 95static long rtcp_ctrl(BIO *h,int cmd,long arg1,void *arg2);
96static int rtcp_new(BIO *h); 96static int rtcp_new(BIO *h);
97static int rtcp_free(BIO *data); 97static int rtcp_free(BIO *data);
98 98
@@ -156,7 +156,7 @@ static int rtcp_new(BIO *bi)
156 bi->init=1; 156 bi->init=1;
157 bi->num=0; 157 bi->num=0;
158 bi->flags = 0; 158 bi->flags = 0;
159 bi->ptr=Malloc(sizeof(struct rpc_ctx)); 159 bi->ptr=OPENSSL_malloc(sizeof(struct rpc_ctx));
160 ctx = (struct rpc_ctx *) bi->ptr; 160 ctx = (struct rpc_ctx *) bi->ptr;
161 ctx->filled = 0; 161 ctx->filled = 0;
162 ctx->pos = 0; 162 ctx->pos = 0;
@@ -166,7 +166,7 @@ static int rtcp_new(BIO *bi)
166static int rtcp_free(BIO *a) 166static int rtcp_free(BIO *a)
167{ 167{
168 if (a == NULL) return(0); 168 if (a == NULL) return(0);
169 if ( a->ptr ) Free ( a->ptr ); 169 if ( a->ptr ) OPENSSL_free ( a->ptr );
170 a->ptr = NULL; 170 a->ptr = NULL;
171 return(1); 171 return(1);
172} 172}
@@ -218,7 +218,7 @@ static int rtcp_read(BIO *b, char *out, int outl)
218 return length; 218 return length;
219} 219}
220 220
221static int rtcp_write(BIO *b, char *in, int inl) 221static int rtcp_write(BIO *b, const char *in, int inl)
222{ 222{
223 int status, i, segment, length; 223 int status, i, segment, length;
224 struct rpc_ctx *ctx; 224 struct rpc_ctx *ctx;
@@ -247,7 +247,7 @@ static int rtcp_write(BIO *b, char *in, int inl)
247 return(i); 247 return(i);
248} 248}
249 249
250static long rtcp_ctrl(BIO *b, int cmd, long num, char *ptr) 250static long rtcp_ctrl(BIO *b, int cmd, long num, void *ptr)
251 { 251 {
252 long ret=1; 252 long ret=1;
253 253
@@ -283,7 +283,7 @@ static int rtcp_gets(BIO *bp, char *buf, int size)
283 return(0); 283 return(0);
284 } 284 }
285 285
286static int rtcp_puts(BIO *bp, char *str) 286static int rtcp_puts(BIO *bp, const char *str)
287{ 287{
288 int length; 288 int length;
289 if (str == NULL) return(0); 289 if (str == NULL) return(0);
diff --git a/src/lib/libcrypto/bio/bss_sock.c b/src/lib/libcrypto/bio/bss_sock.c
index 8ce80ef68d..50c6744c06 100644
--- a/src/lib/libcrypto/bio/bss_sock.c
+++ b/src/lib/libcrypto/bio/bss_sock.c
@@ -65,19 +65,19 @@
65#include <openssl/bio.h> 65#include <openssl/bio.h>
66 66
67#ifndef BIO_FD 67#ifndef BIO_FD
68static int sock_write(BIO *h,char *buf,int num); 68static int sock_write(BIO *h, const char *buf, int num);
69static int sock_read(BIO *h,char *buf,int size); 69static int sock_read(BIO *h, char *buf, int size);
70static int sock_puts(BIO *h,char *str); 70static int sock_puts(BIO *h, const char *str);
71static long sock_ctrl(BIO *h,int cmd,long arg1,char *arg2); 71static long sock_ctrl(BIO *h, int cmd, long arg1, void *arg2);
72static int sock_new(BIO *h); 72static int sock_new(BIO *h);
73static int sock_free(BIO *data); 73static int sock_free(BIO *data);
74int BIO_sock_should_retry(int s); 74int BIO_sock_should_retry(int s);
75#else 75#else
76 76
77static int fd_write(BIO *h,char *buf,int num); 77static int fd_write(BIO *h, const char *buf, int num);
78static int fd_read(BIO *h,char *buf,int size); 78static int fd_read(BIO *h, char *buf, int size);
79static int fd_puts(BIO *h,char *str); 79static int fd_puts(BIO *h, const char *str);
80static long fd_ctrl(BIO *h,int cmd,long arg1,char *arg2); 80static long fd_ctrl(BIO *h, int cmd, long arg1, void *arg2);
81static int fd_new(BIO *h); 81static int fd_new(BIO *h);
82static int fd_free(BIO *data); 82static int fd_free(BIO *data);
83int BIO_fd_should_retry(int s); 83int BIO_fd_should_retry(int s);
@@ -209,9 +209,9 @@ static int fd_read(BIO *b, char *out,int outl)
209 } 209 }
210 210
211#ifndef BIO_FD 211#ifndef BIO_FD
212static int sock_write(BIO *b, char *in, int inl) 212static int sock_write(BIO *b, const char *in, int inl)
213#else 213#else
214static int fd_write(BIO *b, char *in, int inl) 214static int fd_write(BIO *b, const char *in, int inl)
215#endif 215#endif
216 { 216 {
217 int ret; 217 int ret;
@@ -237,9 +237,9 @@ static int fd_write(BIO *b, char *in, int inl)
237 } 237 }
238 238
239#ifndef BIO_FD 239#ifndef BIO_FD
240static long sock_ctrl(BIO *b, int cmd, long num, char *ptr) 240static long sock_ctrl(BIO *b, int cmd, long num, void *ptr)
241#else 241#else
242static long fd_ctrl(BIO *b, int cmd, long num, char *ptr) 242static long fd_ctrl(BIO *b, int cmd, long num, void *ptr)
243#endif 243#endif
244 { 244 {
245 long ret=1; 245 long ret=1;
@@ -313,9 +313,9 @@ static int sock_gets(BIO *bp, char *buf,int size)
313#endif 313#endif
314 314
315#ifndef BIO_FD 315#ifndef BIO_FD
316static int sock_puts(BIO *bp, char *str) 316static int sock_puts(BIO *bp, const char *str)
317#else 317#else
318static int fd_puts(BIO *bp, char *str) 318static int fd_puts(BIO *bp, const char *str)
319#endif 319#endif
320 { 320 {
321 int n,ret; 321 int n,ret;
diff --git a/src/lib/libcrypto/bn/Makefile.ssl b/src/lib/libcrypto/bn/Makefile.ssl
index beb9c1b523..17b72d577f 100644
--- a/src/lib/libcrypto/bn/Makefile.ssl
+++ b/src/lib/libcrypto/bn/Makefile.ssl
@@ -170,118 +170,143 @@ clean:
170bn_add.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 170bn_add.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
171bn_add.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 171bn_add.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
172bn_add.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 172bn_add.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
173bn_add.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 173bn_add.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
174bn_add.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 174bn_add.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
175bn_add.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 175bn_add.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
176bn_add.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
176bn_asm.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 177bn_asm.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
177bn_asm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 178bn_asm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
178bn_asm.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 179bn_asm.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
179bn_asm.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 180bn_asm.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
180bn_asm.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 181bn_asm.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
181bn_asm.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 182bn_asm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
183bn_asm.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
182bn_blind.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 184bn_blind.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
183bn_blind.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 185bn_blind.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
184bn_blind.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 186bn_blind.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
185bn_blind.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 187bn_blind.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
188bn_blind.o: ../../include/openssl/opensslconf.h
186bn_blind.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 189bn_blind.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
187bn_blind.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 190bn_blind.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
191bn_blind.o: ../cryptlib.h bn_lcl.h
188bn_ctx.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 192bn_ctx.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
189bn_ctx.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 193bn_ctx.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
190bn_ctx.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 194bn_ctx.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
191bn_ctx.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 195bn_ctx.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
192bn_ctx.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 196bn_ctx.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
193bn_ctx.o: ../../include/openssl/stack.h ../cryptlib.h 197bn_ctx.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
198bn_ctx.o: ../../include/openssl/symhacks.h ../cryptlib.h
194bn_div.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 199bn_div.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
195bn_div.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 200bn_div.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
196bn_div.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 201bn_div.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
197bn_div.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 202bn_div.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
198bn_div.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 203bn_div.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
199bn_div.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 204bn_div.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
200bn_err.o: ../../include/openssl/bn.h ../../include/openssl/err.h 205bn_div.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
201bn_err.o: ../../include/openssl/opensslconf.h 206bn_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
207bn_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
208bn_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
209bn_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
210bn_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
202bn_exp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 211bn_exp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
203bn_exp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 212bn_exp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
204bn_exp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 213bn_exp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
205bn_exp.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 214bn_exp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
206bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 215bn_exp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
207bn_exp.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 216bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
217bn_exp.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
208bn_exp2.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 218bn_exp2.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
209bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 219bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
210bn_exp2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 220bn_exp2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
211bn_exp2.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 221bn_exp2.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
212bn_exp2.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 222bn_exp2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
213bn_exp2.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 223bn_exp2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
224bn_exp2.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
214bn_gcd.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 225bn_gcd.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
215bn_gcd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 226bn_gcd.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
216bn_gcd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 227bn_gcd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
217bn_gcd.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 228bn_gcd.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
218bn_gcd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 229bn_gcd.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
219bn_gcd.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 230bn_gcd.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
231bn_gcd.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
220bn_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 232bn_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
221bn_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 233bn_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
222bn_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 234bn_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
223bn_lib.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 235bn_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
224bn_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 236bn_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
225bn_lib.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 237bn_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
238bn_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
226bn_mont.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 239bn_mont.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
227bn_mont.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 240bn_mont.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
228bn_mont.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 241bn_mont.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
229bn_mont.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 242bn_mont.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
230bn_mont.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 243bn_mont.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
231bn_mont.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 244bn_mont.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
245bn_mont.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
232bn_mpi.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 246bn_mpi.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
233bn_mpi.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 247bn_mpi.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
234bn_mpi.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 248bn_mpi.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
235bn_mpi.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 249bn_mpi.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
236bn_mpi.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 250bn_mpi.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
237bn_mpi.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 251bn_mpi.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
252bn_mpi.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
238bn_mul.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 253bn_mul.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
239bn_mul.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 254bn_mul.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
240bn_mul.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 255bn_mul.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
241bn_mul.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 256bn_mul.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
242bn_mul.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 257bn_mul.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
243bn_mul.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 258bn_mul.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
259bn_mul.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
244bn_prime.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 260bn_prime.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
245bn_prime.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 261bn_prime.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
246bn_prime.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 262bn_prime.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
247bn_prime.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 263bn_prime.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
264bn_prime.o: ../../include/openssl/opensslconf.h
248bn_prime.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 265bn_prime.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
249bn_prime.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 266bn_prime.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
250bn_prime.o: ../cryptlib.h bn_lcl.h bn_prime.h 267bn_prime.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_prime.h
251bn_print.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 268bn_print.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
252bn_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 269bn_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
253bn_print.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 270bn_print.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
254bn_print.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 271bn_print.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
272bn_print.o: ../../include/openssl/opensslconf.h
255bn_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 273bn_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
256bn_print.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 274bn_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
275bn_print.o: ../cryptlib.h bn_lcl.h
257bn_rand.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 276bn_rand.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
258bn_rand.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 277bn_rand.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
259bn_rand.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 278bn_rand.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
260bn_rand.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 279bn_rand.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
261bn_rand.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 280bn_rand.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
262bn_rand.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 281bn_rand.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
282bn_rand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
263bn_rand.o: ../cryptlib.h bn_lcl.h 283bn_rand.o: ../cryptlib.h bn_lcl.h
264bn_recp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 284bn_recp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
265bn_recp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 285bn_recp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
266bn_recp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 286bn_recp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
267bn_recp.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 287bn_recp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
268bn_recp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 288bn_recp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
269bn_recp.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 289bn_recp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
290bn_recp.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
270bn_shift.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 291bn_shift.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
271bn_shift.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 292bn_shift.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
272bn_shift.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 293bn_shift.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
273bn_shift.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 294bn_shift.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
295bn_shift.o: ../../include/openssl/opensslconf.h
274bn_shift.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 296bn_shift.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
275bn_shift.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 297bn_shift.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
298bn_shift.o: ../cryptlib.h bn_lcl.h
276bn_sqr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 299bn_sqr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
277bn_sqr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 300bn_sqr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
278bn_sqr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 301bn_sqr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
279bn_sqr.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 302bn_sqr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
280bn_sqr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 303bn_sqr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
281bn_sqr.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 304bn_sqr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
305bn_sqr.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
282bn_word.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 306bn_word.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
283bn_word.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 307bn_word.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
284bn_word.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 308bn_word.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
285bn_word.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 309bn_word.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
286bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 310bn_word.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
287bn_word.o: ../../include/openssl/stack.h ../cryptlib.h bn_lcl.h 311bn_word.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
312bn_word.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h
diff --git a/src/lib/libcrypto/bn/asm/README b/src/lib/libcrypto/bn/asm/README
index 86bf64cfc2..a0fe58a677 100644
--- a/src/lib/libcrypto/bn/asm/README
+++ b/src/lib/libcrypto/bn/asm/README
@@ -15,9 +15,9 @@ On the 2 alpha C compilers I had access to, it was not possible to do
15were 64 bits). So the hand assember gives access to the 128 bit result and 15were 64 bits). So the hand assember gives access to the 128 bit result and
16a 2 times speedup :-). 16a 2 times speedup :-).
17 17
18There are 2 versions of assember for the HP PA-RISC. 18There are 3 versions of assember for the HP PA-RISC.
19pa-risc.s is the origional one which works fine. 19
20pa-risc2.s is a new version that often generates warnings but if the 20pa-risc.s is the origional one which works fine and generated using gcc :-)
21tests pass, it gives performance that is over 2 times faster than 21
22pa-risc.s. 22pa-risc2W.s and pa-risc2.s are 64 and 32-bit PA-RISC 2.0 implementations
23Both were generated using gcc :-) 23by Chris Ruemmler from HP (with some help from the HP C compiler).
diff --git a/src/lib/libcrypto/bn/asm/pa-risc2.s b/src/lib/libcrypto/bn/asm/pa-risc2.s
index c2725996a4..7239aa2c76 100644
--- a/src/lib/libcrypto/bn/asm/pa-risc2.s
+++ b/src/lib/libcrypto/bn/asm/pa-risc2.s
@@ -1,416 +1,1618 @@
1 .SPACE $PRIVATE$ 1;
2 .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31 2; PA-RISC 2.0 implementation of bn_asm code, based on the
3 .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82 3; 64-bit version of the code. This code is effectively the
4 .SPACE $TEXT$ 4; same as the 64-bit version except the register model is
5 .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44 5; slightly different given all values must be 32-bit between
6 .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY 6; function calls. Thus the 64-bit return values are returned
7 .IMPORT $global$,DATA 7; in %ret0 and %ret1 vs just %ret0 as is done in 64-bit
8 .IMPORT $$dyncall,MILLICODE 8;
9; gcc_compiled.: 9;
10 .SPACE $TEXT$ 10; This code is approximately 2x faster than the C version
11 .SUBSPA $CODE$ 11; for RSA/DSA.
12 12;
13 .align 4 13; See http://devresource.hp.com/ for more details on the PA-RISC
14 .EXPORT bn_mul_add_words,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR 14; architecture. Also see the book "PA-RISC 2.0 Architecture"
15; by Gerry Kane for information on the instruction set architecture.
16;
17; Code written by Chris Ruemmler (with some help from the HP C
18; compiler).
19;
20; The code compiles with HP's assembler
21;
22
23 .level 2.0N
24 .space $TEXT$
25 .subspa $CODE$,QUAD=0,ALIGN=8,ACCESS=0x2c,CODE_ONLY
26
27;
28; Global Register definitions used for the routines.
29;
30; Some information about HP's runtime architecture for 32-bits.
31;
32; "Caller save" means the calling function must save the register
33; if it wants the register to be preserved.
34; "Callee save" means if a function uses the register, it must save
35; the value before using it.
36;
37; For the floating point registers
38;
39; "caller save" registers: fr4-fr11, fr22-fr31
40; "callee save" registers: fr12-fr21
41; "special" registers: fr0-fr3 (status and exception registers)
42;
43; For the integer registers
44; value zero : r0
45; "caller save" registers: r1,r19-r26
46; "callee save" registers: r3-r18
47; return register : r2 (rp)
48; return values ; r28,r29 (ret0,ret1)
49; Stack pointer ; r30 (sp)
50; millicode return ptr ; r31 (also a caller save register)
51
52
53;
54; Arguments to the routines
55;
56r_ptr .reg %r26
57a_ptr .reg %r25
58b_ptr .reg %r24
59num .reg %r24
60n .reg %r23
61
62;
63; Note that the "w" argument for bn_mul_add_words and bn_mul_words
64; is passed on the stack at a delta of -56 from the top of stack
65; as the routine is entered.
66;
67
68;
69; Globals used in some routines
70;
71
72top_overflow .reg %r23
73high_mask .reg %r22 ; value 0xffffffff80000000L
74
75
76;------------------------------------------------------------------------------
77;
78; bn_mul_add_words
79;
80;BN_ULONG bn_mul_add_words(BN_ULONG *r_ptr, BN_ULONG *a_ptr,
81; int num, BN_ULONG w)
82;
83; arg0 = r_ptr
84; arg1 = a_ptr
85; arg3 = num
86; -56(sp) = w
87;
88; Local register definitions
89;
90
91fm1 .reg %fr22
92fm .reg %fr23
93ht_temp .reg %fr24
94ht_temp_1 .reg %fr25
95lt_temp .reg %fr26
96lt_temp_1 .reg %fr27
97fm1_1 .reg %fr28
98fm_1 .reg %fr29
99
100fw_h .reg %fr7L
101fw_l .reg %fr7R
102fw .reg %fr7
103
104fht_0 .reg %fr8L
105flt_0 .reg %fr8R
106t_float_0 .reg %fr8
107
108fht_1 .reg %fr9L
109flt_1 .reg %fr9R
110t_float_1 .reg %fr9
111
112tmp_0 .reg %r31
113tmp_1 .reg %r21
114m_0 .reg %r20
115m_1 .reg %r19
116ht_0 .reg %r1
117ht_1 .reg %r3
118lt_0 .reg %r4
119lt_1 .reg %r5
120m1_0 .reg %r6
121m1_1 .reg %r7
122rp_val .reg %r8
123rp_val_1 .reg %r9
124
15bn_mul_add_words 125bn_mul_add_words
16 .PROC 126 .export bn_mul_add_words,entry,NO_RELOCATION,LONG_RETURN
17 .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=4 127 .proc
18 .ENTRY 128 .callinfo frame=128
19 stw %r2,-20(0,%r30) 129 .entry
20 stwm %r4,64(0,%r30) 130 .align 64
21 copy %r24,%r31 131
22 stw %r3,-60(0,%r30) 132 STD %r3,0(%sp) ; save r3
23 ldi 0,%r20 133 STD %r4,8(%sp) ; save r4
24 ldo 12(%r26),%r2 134 NOP ; Needed to make the loop 16-byte aligned
25 stw %r23,-16(0,%r30) 135 NOP ; needed to make the loop 16-byte aligned
26 copy %r25,%r3 136
27 ldo 12(%r3),%r1 137 STD %r5,16(%sp) ; save r5
28 fldws -16(0,%r30),%fr8L 138 NOP
29L$0010 139 STD %r6,24(%sp) ; save r6
30 copy %r20,%r25 140 STD %r7,32(%sp) ; save r7
31 ldi 0,%r24 141
32 fldws 0(0,%r3),%fr9L 142 STD %r8,40(%sp) ; save r8
33 ldw 0(0,%r26),%r19 143 STD %r9,48(%sp) ; save r9
34 xmpyu %fr8L,%fr9L,%fr9 144 COPY %r0,%ret1 ; return 0 by default
35 fstds %fr9,-16(0,%r30) 145 DEPDI,Z 1,31,1,top_overflow ; top_overflow = 1 << 32
36 copy %r19,%r23 146
37 ldw -16(0,%r30),%r28 147 CMPIB,>= 0,num,bn_mul_add_words_exit ; if (num <= 0) then exit
38 ldw -12(0,%r30),%r29 148 LDO 128(%sp),%sp ; bump stack
39 ldi 0,%r22 149
40 add %r23,%r29,%r29 150 ;
41 addc %r22,%r28,%r28 151 ; The loop is unrolled twice, so if there is only 1 number
42 add %r25,%r29,%r29 152 ; then go straight to the cleanup code.
43 addc %r24,%r28,%r28 153 ;
44 copy %r28,%r21 154 CMPIB,= 1,num,bn_mul_add_words_single_top
45 ldi 0,%r20 155 FLDD -184(%sp),fw ; (-56-128) load up w into fw (fw_h/fw_l)
46 copy %r21,%r20 156
47 addib,= -1,%r31,L$0011 157 ;
48 stw %r29,0(0,%r26) 158 ; This loop is unrolled 2 times (64-byte aligned as well)
49 copy %r20,%r25 159 ;
50 ldi 0,%r24 160 ; PA-RISC 2.0 chips have two fully pipelined multipliers, thus
51 fldws -8(0,%r1),%fr9L 161 ; two 32-bit mutiplies can be issued per cycle.
52 ldw -8(0,%r2),%r19 162 ;
53 xmpyu %fr8L,%fr9L,%fr9 163bn_mul_add_words_unroll2
54 fstds %fr9,-16(0,%r30) 164
55 copy %r19,%r23 165 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
56 ldw -16(0,%r30),%r28 166 FLDD 8(a_ptr),t_float_1 ; load up 64-bit value (fr8L) ht(L)/lt(R)
57 ldw -12(0,%r30),%r29 167 LDD 0(r_ptr),rp_val ; rp[0]
58 ldi 0,%r22 168 LDD 8(r_ptr),rp_val_1 ; rp[1]
59 add %r23,%r29,%r29 169
60 addc %r22,%r28,%r28 170 XMPYU fht_0,fw_l,fm1 ; m1[0] = fht_0*fw_l
61 add %r25,%r29,%r29 171 XMPYU fht_1,fw_l,fm1_1 ; m1[1] = fht_1*fw_l
62 addc %r24,%r28,%r28 172 FSTD fm1,-16(%sp) ; -16(sp) = m1[0]
63 copy %r28,%r21 173 FSTD fm1_1,-48(%sp) ; -48(sp) = m1[1]
64 ldi 0,%r20 174
65 copy %r21,%r20 175 XMPYU flt_0,fw_h,fm ; m[0] = flt_0*fw_h
66 addib,= -1,%r31,L$0011 176 XMPYU flt_1,fw_h,fm_1 ; m[1] = flt_1*fw_h
67 stw %r29,-8(0,%r2) 177 FSTD fm,-8(%sp) ; -8(sp) = m[0]
68 copy %r20,%r25 178 FSTD fm_1,-40(%sp) ; -40(sp) = m[1]
69 ldi 0,%r24 179
70 fldws -4(0,%r1),%fr9L 180 XMPYU fht_0,fw_h,ht_temp ; ht_temp = fht_0*fw_h
71 ldw -4(0,%r2),%r19 181 XMPYU fht_1,fw_h,ht_temp_1 ; ht_temp_1 = fht_1*fw_h
72 xmpyu %fr8L,%fr9L,%fr9 182 FSTD ht_temp,-24(%sp) ; -24(sp) = ht_temp
73 fstds %fr9,-16(0,%r30) 183 FSTD ht_temp_1,-56(%sp) ; -56(sp) = ht_temp_1
74 copy %r19,%r23 184
75 ldw -16(0,%r30),%r28 185 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
76 ldw -12(0,%r30),%r29 186 XMPYU flt_1,fw_l,lt_temp_1 ; lt_temp = lt*fw_l
77 ldi 0,%r22 187 FSTD lt_temp,-32(%sp) ; -32(sp) = lt_temp
78 add %r23,%r29,%r29 188 FSTD lt_temp_1,-64(%sp) ; -64(sp) = lt_temp_1
79 addc %r22,%r28,%r28 189
80 add %r25,%r29,%r29 190 LDD -8(%sp),m_0 ; m[0]
81 addc %r24,%r28,%r28 191 LDD -40(%sp),m_1 ; m[1]
82 copy %r28,%r21 192 LDD -16(%sp),m1_0 ; m1[0]
83 ldi 0,%r20 193 LDD -48(%sp),m1_1 ; m1[1]
84 copy %r21,%r20 194
85 addib,= -1,%r31,L$0011 195 LDD -24(%sp),ht_0 ; ht[0]
86 stw %r29,-4(0,%r2) 196 LDD -56(%sp),ht_1 ; ht[1]
87 copy %r20,%r25 197 ADD,L m1_0,m_0,tmp_0 ; tmp_0 = m[0] + m1[0];
88 ldi 0,%r24 198 ADD,L m1_1,m_1,tmp_1 ; tmp_1 = m[1] + m1[1];
89 fldws 0(0,%r1),%fr9L 199
90 ldw 0(0,%r2),%r19 200 LDD -32(%sp),lt_0
91 xmpyu %fr8L,%fr9L,%fr9 201 LDD -64(%sp),lt_1
92 fstds %fr9,-16(0,%r30) 202 CMPCLR,*>>= tmp_0,m1_0, %r0 ; if (m[0] < m1[0])
93 copy %r19,%r23 203 ADD,L ht_0,top_overflow,ht_0 ; ht[0] += (1<<32)
94 ldw -16(0,%r30),%r28 204
95 ldw -12(0,%r30),%r29 205 CMPCLR,*>>= tmp_1,m1_1,%r0 ; if (m[1] < m1[1])
96 ldi 0,%r22 206 ADD,L ht_1,top_overflow,ht_1 ; ht[1] += (1<<32)
97 add %r23,%r29,%r29 207 EXTRD,U tmp_0,31,32,m_0 ; m[0]>>32
98 addc %r22,%r28,%r28 208 DEPD,Z tmp_0,31,32,m1_0 ; m1[0] = m[0]<<32
99 add %r25,%r29,%r29 209
100 addc %r24,%r28,%r28 210 EXTRD,U tmp_1,31,32,m_1 ; m[1]>>32
101 copy %r28,%r21 211 DEPD,Z tmp_1,31,32,m1_1 ; m1[1] = m[1]<<32
102 ldi 0,%r20 212 ADD,L ht_0,m_0,ht_0 ; ht[0]+= (m[0]>>32)
103 copy %r21,%r20 213 ADD,L ht_1,m_1,ht_1 ; ht[1]+= (m[1]>>32)
104 addib,= -1,%r31,L$0011 214
105 stw %r29,0(0,%r2) 215 ADD lt_0,m1_0,lt_0 ; lt[0] = lt[0]+m1[0];
106 ldo 16(%r1),%r1 216 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
107 ldo 16(%r3),%r3 217 ADD lt_1,m1_1,lt_1 ; lt[1] = lt[1]+m1[1];
108 ldo 16(%r2),%r2 218 ADD,DC ht_1,%r0,ht_1 ; ht[1]++
109 bl L$0010,0 219
110 ldo 16(%r26),%r26 220 ADD %ret1,lt_0,lt_0 ; lt[0] = lt[0] + c;
111L$0011 221 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
112 copy %r20,%r28 222 ADD lt_0,rp_val,lt_0 ; lt[0] = lt[0]+rp[0]
113 ldw -84(0,%r30),%r2 223 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
114 ldw -60(0,%r30),%r3 224
115 bv 0(%r2) 225 LDO -2(num),num ; num = num - 2;
116 ldwm -64(0,%r30),%r4 226 ADD ht_0,lt_1,lt_1 ; lt[1] = lt[1] + ht_0 (c);
117 .EXIT 227 ADD,DC ht_1,%r0,ht_1 ; ht[1]++
118 .PROCEND 228 STD lt_0,0(r_ptr) ; rp[0] = lt[0]
119 .align 4 229
120 .EXPORT bn_mul_words,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR 230 ADD lt_1,rp_val_1,lt_1 ; lt[1] = lt[1]+rp[1]
231 ADD,DC ht_1,%r0,%ret1 ; ht[1]++
232 LDO 16(a_ptr),a_ptr ; a_ptr += 2
233
234 STD lt_1,8(r_ptr) ; rp[1] = lt[1]
235 CMPIB,<= 2,num,bn_mul_add_words_unroll2 ; go again if more to do
236 LDO 16(r_ptr),r_ptr ; r_ptr += 2
237
238 CMPIB,=,N 0,num,bn_mul_add_words_exit ; are we done, or cleanup last one
239
240 ;
241 ; Top of loop aligned on 64-byte boundary
242 ;
243bn_mul_add_words_single_top
244 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
245 LDD 0(r_ptr),rp_val ; rp[0]
246 LDO 8(a_ptr),a_ptr ; a_ptr++
247 XMPYU fht_0,fw_l,fm1 ; m1 = ht*fw_l
248 FSTD fm1,-16(%sp) ; -16(sp) = m1
249 XMPYU flt_0,fw_h,fm ; m = lt*fw_h
250 FSTD fm,-8(%sp) ; -8(sp) = m
251 XMPYU fht_0,fw_h,ht_temp ; ht_temp = ht*fw_h
252 FSTD ht_temp,-24(%sp) ; -24(sp) = ht
253 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
254 FSTD lt_temp,-32(%sp) ; -32(sp) = lt
255
256 LDD -8(%sp),m_0
257 LDD -16(%sp),m1_0 ; m1 = temp1
258 ADD,L m_0,m1_0,tmp_0 ; tmp_0 = m + m1;
259 LDD -24(%sp),ht_0
260 LDD -32(%sp),lt_0
261
262 CMPCLR,*>>= tmp_0,m1_0,%r0 ; if (m < m1)
263 ADD,L ht_0,top_overflow,ht_0 ; ht += (1<<32)
264
265 EXTRD,U tmp_0,31,32,m_0 ; m>>32
266 DEPD,Z tmp_0,31,32,m1_0 ; m1 = m<<32
267
268 ADD,L ht_0,m_0,ht_0 ; ht+= (m>>32)
269 ADD lt_0,m1_0,tmp_0 ; tmp_0 = lt+m1;
270 ADD,DC ht_0,%r0,ht_0 ; ht++
271 ADD %ret1,tmp_0,lt_0 ; lt = lt + c;
272 ADD,DC ht_0,%r0,ht_0 ; ht++
273 ADD lt_0,rp_val,lt_0 ; lt = lt+rp[0]
274 ADD,DC ht_0,%r0,%ret1 ; ht++
275 STD lt_0,0(r_ptr) ; rp[0] = lt
276
277bn_mul_add_words_exit
278 .EXIT
279
280 EXTRD,U %ret1,31,32,%ret0 ; for 32-bit, return in ret0/ret1
281 LDD -80(%sp),%r9 ; restore r9
282 LDD -88(%sp),%r8 ; restore r8
283 LDD -96(%sp),%r7 ; restore r7
284 LDD -104(%sp),%r6 ; restore r6
285 LDD -112(%sp),%r5 ; restore r5
286 LDD -120(%sp),%r4 ; restore r4
287 BVE (%rp)
288 LDD,MB -128(%sp),%r3 ; restore r3
289 .PROCEND ;in=23,24,25,26,29;out=28;
290
291;----------------------------------------------------------------------------
292;
293;BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
294;
295; arg0 = rp
296; arg1 = ap
297; arg3 = num
298; w on stack at -56(sp)
299
121bn_mul_words 300bn_mul_words
122 .PROC 301 .proc
123 .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=3 302 .callinfo frame=128
124 .ENTRY 303 .entry
125 stw %r2,-20(0,%r30) 304 .EXPORT bn_mul_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
126 copy %r25,%r2 305 .align 64
127 stwm %r4,64(0,%r30) 306
128 copy %r24,%r19 307 STD %r3,0(%sp) ; save r3
129 ldi 0,%r28 308 STD %r4,8(%sp) ; save r4
130 stw %r23,-16(0,%r30) 309 NOP
131 ldo 12(%r26),%r31 310 STD %r5,16(%sp) ; save r5
132 ldo 12(%r2),%r29 311
133 fldws -16(0,%r30),%fr8L 312 STD %r6,24(%sp) ; save r6
134L$0026 313 STD %r7,32(%sp) ; save r7
135 fldws 0(0,%r2),%fr9L 314 COPY %r0,%ret1 ; return 0 by default
136 xmpyu %fr8L,%fr9L,%fr9 315 DEPDI,Z 1,31,1,top_overflow ; top_overflow = 1 << 32
137 fstds %fr9,-16(0,%r30) 316
138 copy %r28,%r21 317 CMPIB,>= 0,num,bn_mul_words_exit
139 ldi 0,%r20 318 LDO 128(%sp),%sp ; bump stack
140 ldw -16(0,%r30),%r24 319
141 ldw -12(0,%r30),%r25 320 ;
142 add %r21,%r25,%r25 321 ; See if only 1 word to do, thus just do cleanup
143 addc %r20,%r24,%r24 322 ;
144 copy %r24,%r23 323 CMPIB,= 1,num,bn_mul_words_single_top
145 ldi 0,%r22 324 FLDD -184(%sp),fw ; (-56-128) load up w into fw (fw_h/fw_l)
146 copy %r23,%r28 325
147 addib,= -1,%r19,L$0027 326 ;
148 stw %r25,0(0,%r26) 327 ; This loop is unrolled 2 times (64-byte aligned as well)
149 fldws -8(0,%r29),%fr9L 328 ;
150 xmpyu %fr8L,%fr9L,%fr9 329 ; PA-RISC 2.0 chips have two fully pipelined multipliers, thus
151 fstds %fr9,-16(0,%r30) 330 ; two 32-bit mutiplies can be issued per cycle.
152 copy %r28,%r21 331 ;
153 ldi 0,%r20 332bn_mul_words_unroll2
154 ldw -16(0,%r30),%r24 333
155 ldw -12(0,%r30),%r25 334 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
156 add %r21,%r25,%r25 335 FLDD 8(a_ptr),t_float_1 ; load up 64-bit value (fr8L) ht(L)/lt(R)
157 addc %r20,%r24,%r24 336 XMPYU fht_0,fw_l,fm1 ; m1[0] = fht_0*fw_l
158 copy %r24,%r23 337 XMPYU fht_1,fw_l,fm1_1 ; m1[1] = ht*fw_l
159 ldi 0,%r22 338
160 copy %r23,%r28 339 FSTD fm1,-16(%sp) ; -16(sp) = m1
161 addib,= -1,%r19,L$0027 340 FSTD fm1_1,-48(%sp) ; -48(sp) = m1
162 stw %r25,-8(0,%r31) 341 XMPYU flt_0,fw_h,fm ; m = lt*fw_h
163 fldws -4(0,%r29),%fr9L 342 XMPYU flt_1,fw_h,fm_1 ; m = lt*fw_h
164 xmpyu %fr8L,%fr9L,%fr9 343
165 fstds %fr9,-16(0,%r30) 344 FSTD fm,-8(%sp) ; -8(sp) = m
166 copy %r28,%r21 345 FSTD fm_1,-40(%sp) ; -40(sp) = m
167 ldi 0,%r20 346 XMPYU fht_0,fw_h,ht_temp ; ht_temp = fht_0*fw_h
168 ldw -16(0,%r30),%r24 347 XMPYU fht_1,fw_h,ht_temp_1 ; ht_temp = ht*fw_h
169 ldw -12(0,%r30),%r25 348
170 add %r21,%r25,%r25 349 FSTD ht_temp,-24(%sp) ; -24(sp) = ht
171 addc %r20,%r24,%r24 350 FSTD ht_temp_1,-56(%sp) ; -56(sp) = ht
172 copy %r24,%r23 351 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
173 ldi 0,%r22 352 XMPYU flt_1,fw_l,lt_temp_1 ; lt_temp = lt*fw_l
174 copy %r23,%r28 353
175 addib,= -1,%r19,L$0027 354 FSTD lt_temp,-32(%sp) ; -32(sp) = lt
176 stw %r25,-4(0,%r31) 355 FSTD lt_temp_1,-64(%sp) ; -64(sp) = lt
177 fldws 0(0,%r29),%fr9L 356 LDD -8(%sp),m_0
178 xmpyu %fr8L,%fr9L,%fr9 357 LDD -40(%sp),m_1
179 fstds %fr9,-16(0,%r30) 358
180 copy %r28,%r21 359 LDD -16(%sp),m1_0
181 ldi 0,%r20 360 LDD -48(%sp),m1_1
182 ldw -16(0,%r30),%r24 361 LDD -24(%sp),ht_0
183 ldw -12(0,%r30),%r25 362 LDD -56(%sp),ht_1
184 add %r21,%r25,%r25 363
185 addc %r20,%r24,%r24 364 ADD,L m1_0,m_0,tmp_0 ; tmp_0 = m + m1;
186 copy %r24,%r23 365 ADD,L m1_1,m_1,tmp_1 ; tmp_1 = m + m1;
187 ldi 0,%r22 366 LDD -32(%sp),lt_0
188 copy %r23,%r28 367 LDD -64(%sp),lt_1
189 addib,= -1,%r19,L$0027 368
190 stw %r25,0(0,%r31) 369 CMPCLR,*>>= tmp_0,m1_0, %r0 ; if (m < m1)
191 ldo 16(%r29),%r29 370 ADD,L ht_0,top_overflow,ht_0 ; ht += (1<<32)
192 ldo 16(%r2),%r2 371 CMPCLR,*>>= tmp_1,m1_1,%r0 ; if (m < m1)
193 ldo 16(%r31),%r31 372 ADD,L ht_1,top_overflow,ht_1 ; ht += (1<<32)
194 bl L$0026,0 373
195 ldo 16(%r26),%r26 374 EXTRD,U tmp_0,31,32,m_0 ; m>>32
196L$0027 375 DEPD,Z tmp_0,31,32,m1_0 ; m1 = m<<32
197 ldw -84(0,%r30),%r2 376 EXTRD,U tmp_1,31,32,m_1 ; m>>32
198 bv 0(%r2) 377 DEPD,Z tmp_1,31,32,m1_1 ; m1 = m<<32
199 ldwm -64(0,%r30),%r4 378
200 .EXIT 379 ADD,L ht_0,m_0,ht_0 ; ht+= (m>>32)
201 .PROCEND 380 ADD,L ht_1,m_1,ht_1 ; ht+= (m>>32)
202 .align 4 381 ADD lt_0,m1_0,lt_0 ; lt = lt+m1;
203 .EXPORT bn_sqr_words,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR 382 ADD,DC ht_0,%r0,ht_0 ; ht++
383
384 ADD lt_1,m1_1,lt_1 ; lt = lt+m1;
385 ADD,DC ht_1,%r0,ht_1 ; ht++
386 ADD %ret1,lt_0,lt_0 ; lt = lt + c (ret1);
387 ADD,DC ht_0,%r0,ht_0 ; ht++
388
389 ADD ht_0,lt_1,lt_1 ; lt = lt + c (ht_0)
390 ADD,DC ht_1,%r0,ht_1 ; ht++
391 STD lt_0,0(r_ptr) ; rp[0] = lt
392 STD lt_1,8(r_ptr) ; rp[1] = lt
393
394 COPY ht_1,%ret1 ; carry = ht
395 LDO -2(num),num ; num = num - 2;
396 LDO 16(a_ptr),a_ptr ; ap += 2
397 CMPIB,<= 2,num,bn_mul_words_unroll2
398 LDO 16(r_ptr),r_ptr ; rp++
399
400 CMPIB,=,N 0,num,bn_mul_words_exit ; are we done?
401
402 ;
403 ; Top of loop aligned on 64-byte boundary
404 ;
405bn_mul_words_single_top
406 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
407
408 XMPYU fht_0,fw_l,fm1 ; m1 = ht*fw_l
409 FSTD fm1,-16(%sp) ; -16(sp) = m1
410 XMPYU flt_0,fw_h,fm ; m = lt*fw_h
411 FSTD fm,-8(%sp) ; -8(sp) = m
412 XMPYU fht_0,fw_h,ht_temp ; ht_temp = ht*fw_h
413 FSTD ht_temp,-24(%sp) ; -24(sp) = ht
414 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
415 FSTD lt_temp,-32(%sp) ; -32(sp) = lt
416
417 LDD -8(%sp),m_0
418 LDD -16(%sp),m1_0
419 ADD,L m_0,m1_0,tmp_0 ; tmp_0 = m + m1;
420 LDD -24(%sp),ht_0
421 LDD -32(%sp),lt_0
422
423 CMPCLR,*>>= tmp_0,m1_0,%r0 ; if (m < m1)
424 ADD,L ht_0,top_overflow,ht_0 ; ht += (1<<32)
425
426 EXTRD,U tmp_0,31,32,m_0 ; m>>32
427 DEPD,Z tmp_0,31,32,m1_0 ; m1 = m<<32
428
429 ADD,L ht_0,m_0,ht_0 ; ht+= (m>>32)
430 ADD lt_0,m1_0,lt_0 ; lt= lt+m1;
431 ADD,DC ht_0,%r0,ht_0 ; ht++
432
433 ADD %ret1,lt_0,lt_0 ; lt = lt + c;
434 ADD,DC ht_0,%r0,ht_0 ; ht++
435
436 COPY ht_0,%ret1 ; copy carry
437 STD lt_0,0(r_ptr) ; rp[0] = lt
438
439bn_mul_words_exit
440 .EXIT
441 EXTRD,U %ret1,31,32,%ret0 ; for 32-bit, return in ret0/ret1
442 LDD -96(%sp),%r7 ; restore r7
443 LDD -104(%sp),%r6 ; restore r6
444 LDD -112(%sp),%r5 ; restore r5
445 LDD -120(%sp),%r4 ; restore r4
446 BVE (%rp)
447 LDD,MB -128(%sp),%r3 ; restore r3
448 .PROCEND
449
450;----------------------------------------------------------------------------
451;
452;void bn_sqr_words(BN_ULONG *rp, BN_ULONG *ap, int num)
453;
454; arg0 = rp
455; arg1 = ap
456; arg2 = num
457;
458
204bn_sqr_words 459bn_sqr_words
460 .proc
461 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
462 .EXPORT bn_sqr_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
463 .entry
464 .align 64
465
466 STD %r3,0(%sp) ; save r3
467 STD %r4,8(%sp) ; save r4
468 NOP
469 STD %r5,16(%sp) ; save r5
470
471 CMPIB,>= 0,num,bn_sqr_words_exit
472 LDO 128(%sp),%sp ; bump stack
473
474 ;
475 ; If only 1, the goto straight to cleanup
476 ;
477 CMPIB,= 1,num,bn_sqr_words_single_top
478 DEPDI,Z -1,32,33,high_mask ; Create Mask 0xffffffff80000000L
479
480 ;
481 ; This loop is unrolled 2 times (64-byte aligned as well)
482 ;
483
484bn_sqr_words_unroll2
485 FLDD 0(a_ptr),t_float_0 ; a[0]
486 FLDD 8(a_ptr),t_float_1 ; a[1]
487 XMPYU fht_0,flt_0,fm ; m[0]
488 XMPYU fht_1,flt_1,fm_1 ; m[1]
489
490 FSTD fm,-24(%sp) ; store m[0]
491 FSTD fm_1,-56(%sp) ; store m[1]
492 XMPYU flt_0,flt_0,lt_temp ; lt[0]
493 XMPYU flt_1,flt_1,lt_temp_1 ; lt[1]
494
495 FSTD lt_temp,-16(%sp) ; store lt[0]
496 FSTD lt_temp_1,-48(%sp) ; store lt[1]
497 XMPYU fht_0,fht_0,ht_temp ; ht[0]
498 XMPYU fht_1,fht_1,ht_temp_1 ; ht[1]
499
500 FSTD ht_temp,-8(%sp) ; store ht[0]
501 FSTD ht_temp_1,-40(%sp) ; store ht[1]
502 LDD -24(%sp),m_0
503 LDD -56(%sp),m_1
504
505 AND m_0,high_mask,tmp_0 ; m[0] & Mask
506 AND m_1,high_mask,tmp_1 ; m[1] & Mask
507 DEPD,Z m_0,30,31,m_0 ; m[0] << 32+1
508 DEPD,Z m_1,30,31,m_1 ; m[1] << 32+1
509
510 LDD -16(%sp),lt_0
511 LDD -48(%sp),lt_1
512 EXTRD,U tmp_0,32,33,tmp_0 ; tmp_0 = m[0]&Mask >> 32-1
513 EXTRD,U tmp_1,32,33,tmp_1 ; tmp_1 = m[1]&Mask >> 32-1
514
515 LDD -8(%sp),ht_0
516 LDD -40(%sp),ht_1
517 ADD,L ht_0,tmp_0,ht_0 ; ht[0] += tmp_0
518 ADD,L ht_1,tmp_1,ht_1 ; ht[1] += tmp_1
519
520 ADD lt_0,m_0,lt_0 ; lt = lt+m
521 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
522 STD lt_0,0(r_ptr) ; rp[0] = lt[0]
523 STD ht_0,8(r_ptr) ; rp[1] = ht[1]
524
525 ADD lt_1,m_1,lt_1 ; lt = lt+m
526 ADD,DC ht_1,%r0,ht_1 ; ht[1]++
527 STD lt_1,16(r_ptr) ; rp[2] = lt[1]
528 STD ht_1,24(r_ptr) ; rp[3] = ht[1]
529
530 LDO -2(num),num ; num = num - 2;
531 LDO 16(a_ptr),a_ptr ; ap += 2
532 CMPIB,<= 2,num,bn_sqr_words_unroll2
533 LDO 32(r_ptr),r_ptr ; rp += 4
534
535 CMPIB,=,N 0,num,bn_sqr_words_exit ; are we done?
536
537 ;
538 ; Top of loop aligned on 64-byte boundary
539 ;
540bn_sqr_words_single_top
541 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
542
543 XMPYU fht_0,flt_0,fm ; m
544 FSTD fm,-24(%sp) ; store m
545
546 XMPYU flt_0,flt_0,lt_temp ; lt
547 FSTD lt_temp,-16(%sp) ; store lt
548
549 XMPYU fht_0,fht_0,ht_temp ; ht
550 FSTD ht_temp,-8(%sp) ; store ht
551
552 LDD -24(%sp),m_0 ; load m
553 AND m_0,high_mask,tmp_0 ; m & Mask
554 DEPD,Z m_0,30,31,m_0 ; m << 32+1
555 LDD -16(%sp),lt_0 ; lt
556
557 LDD -8(%sp),ht_0 ; ht
558 EXTRD,U tmp_0,32,33,tmp_0 ; tmp_0 = m&Mask >> 32-1
559 ADD m_0,lt_0,lt_0 ; lt = lt+m
560 ADD,L ht_0,tmp_0,ht_0 ; ht += tmp_0
561 ADD,DC ht_0,%r0,ht_0 ; ht++
562
563 STD lt_0,0(r_ptr) ; rp[0] = lt
564 STD ht_0,8(r_ptr) ; rp[1] = ht
565
566bn_sqr_words_exit
567 .EXIT
568 LDD -112(%sp),%r5 ; restore r5
569 LDD -120(%sp),%r4 ; restore r4
570 BVE (%rp)
571 LDD,MB -128(%sp),%r3
572 .PROCEND ;in=23,24,25,26,29;out=28;
573
574
575;----------------------------------------------------------------------------
576;
577;BN_ULONG bn_add_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
578;
579; arg0 = rp
580; arg1 = ap
581; arg2 = bp
582; arg3 = n
583
584t .reg %r22
585b .reg %r21
586l .reg %r20
587
588bn_add_words
589 .proc
590 .entry
591 .callinfo
592 .EXPORT bn_add_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
593 .align 64
594
595 CMPIB,>= 0,n,bn_add_words_exit
596 COPY %r0,%ret1 ; return 0 by default
597
598 ;
599 ; If 2 or more numbers do the loop
600 ;
601 CMPIB,= 1,n,bn_add_words_single_top
602 NOP
603
604 ;
605 ; This loop is unrolled 2 times (64-byte aligned as well)
606 ;
607bn_add_words_unroll2
608 LDD 0(a_ptr),t
609 LDD 0(b_ptr),b
610 ADD t,%ret1,t ; t = t+c;
611 ADD,DC %r0,%r0,%ret1 ; set c to carry
612 ADD t,b,l ; l = t + b[0]
613 ADD,DC %ret1,%r0,%ret1 ; c+= carry
614 STD l,0(r_ptr)
615
616 LDD 8(a_ptr),t
617 LDD 8(b_ptr),b
618 ADD t,%ret1,t ; t = t+c;
619 ADD,DC %r0,%r0,%ret1 ; set c to carry
620 ADD t,b,l ; l = t + b[0]
621 ADD,DC %ret1,%r0,%ret1 ; c+= carry
622 STD l,8(r_ptr)
623
624 LDO -2(n),n
625 LDO 16(a_ptr),a_ptr
626 LDO 16(b_ptr),b_ptr
627
628 CMPIB,<= 2,n,bn_add_words_unroll2
629 LDO 16(r_ptr),r_ptr
630
631 CMPIB,=,N 0,n,bn_add_words_exit ; are we done?
632
633bn_add_words_single_top
634 LDD 0(a_ptr),t
635 LDD 0(b_ptr),b
636
637 ADD t,%ret1,t ; t = t+c;
638 ADD,DC %r0,%r0,%ret1 ; set c to carry (could use CMPCLR??)
639 ADD t,b,l ; l = t + b[0]
640 ADD,DC %ret1,%r0,%ret1 ; c+= carry
641 STD l,0(r_ptr)
642
643bn_add_words_exit
644 .EXIT
645 BVE (%rp)
646 EXTRD,U %ret1,31,32,%ret0 ; for 32-bit, return in ret0/ret1
647 .PROCEND ;in=23,24,25,26,29;out=28;
648
649;----------------------------------------------------------------------------
650;
651;BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
652;
653; arg0 = rp
654; arg1 = ap
655; arg2 = bp
656; arg3 = n
657
658t1 .reg %r22
659t2 .reg %r21
660sub_tmp1 .reg %r20
661sub_tmp2 .reg %r19
662
663
664bn_sub_words
665 .proc
666 .callinfo
667 .EXPORT bn_sub_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
668 .entry
669 .align 64
670
671 CMPIB,>= 0,n,bn_sub_words_exit
672 COPY %r0,%ret1 ; return 0 by default
673
674 ;
675 ; If 2 or more numbers do the loop
676 ;
677 CMPIB,= 1,n,bn_sub_words_single_top
678 NOP
679
680 ;
681 ; This loop is unrolled 2 times (64-byte aligned as well)
682 ;
683bn_sub_words_unroll2
684 LDD 0(a_ptr),t1
685 LDD 0(b_ptr),t2
686 SUB t1,t2,sub_tmp1 ; t3 = t1-t2;
687 SUB sub_tmp1,%ret1,sub_tmp1 ; t3 = t3- c;
688
689 CMPCLR,*>> t1,t2,sub_tmp2 ; clear if t1 > t2
690 LDO 1(%r0),sub_tmp2
691
692 CMPCLR,*= t1,t2,%r0
693 COPY sub_tmp2,%ret1
694 STD sub_tmp1,0(r_ptr)
695
696 LDD 8(a_ptr),t1
697 LDD 8(b_ptr),t2
698 SUB t1,t2,sub_tmp1 ; t3 = t1-t2;
699 SUB sub_tmp1,%ret1,sub_tmp1 ; t3 = t3- c;
700 CMPCLR,*>> t1,t2,sub_tmp2 ; clear if t1 > t2
701 LDO 1(%r0),sub_tmp2
702
703 CMPCLR,*= t1,t2,%r0
704 COPY sub_tmp2,%ret1
705 STD sub_tmp1,8(r_ptr)
706
707 LDO -2(n),n
708 LDO 16(a_ptr),a_ptr
709 LDO 16(b_ptr),b_ptr
710
711 CMPIB,<= 2,n,bn_sub_words_unroll2
712 LDO 16(r_ptr),r_ptr
713
714 CMPIB,=,N 0,n,bn_sub_words_exit ; are we done?
715
716bn_sub_words_single_top
717 LDD 0(a_ptr),t1
718 LDD 0(b_ptr),t2
719 SUB t1,t2,sub_tmp1 ; t3 = t1-t2;
720 SUB sub_tmp1,%ret1,sub_tmp1 ; t3 = t3- c;
721 CMPCLR,*>> t1,t2,sub_tmp2 ; clear if t1 > t2
722 LDO 1(%r0),sub_tmp2
723
724 CMPCLR,*= t1,t2,%r0
725 COPY sub_tmp2,%ret1
726
727 STD sub_tmp1,0(r_ptr)
728
729bn_sub_words_exit
730 .EXIT
731 BVE (%rp)
732 EXTRD,U %ret1,31,32,%ret0 ; for 32-bit, return in ret0/ret1
733 .PROCEND ;in=23,24,25,26,29;out=28;
734
735;------------------------------------------------------------------------------
736;
737; unsigned long bn_div_words(unsigned long h, unsigned long l, unsigned long d)
738;
739; arg0 = h
740; arg1 = l
741; arg2 = d
742;
743; This is mainly just output from the HP C compiler.
744;
745;------------------------------------------------------------------------------
746bn_div_words
205 .PROC 747 .PROC
206 .CALLINFO FRAME=0,NO_CALLS 748 .EXPORT bn_div_words,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR,LONG_RETURN
207 .ENTRY 749 .IMPORT BN_num_bits_word,CODE
208 ldo 28(%r26),%r19 750 .IMPORT __iob,DATA
209 ldo 12(%r25),%r28 751 .IMPORT fprintf,CODE
210L$0042 752 .IMPORT abort,CODE
211 fldws 0(0,%r25),%fr8L 753 .IMPORT $$div2U,MILLICODE
212 fldws 0(0,%r25),%fr8R 754 .CALLINFO CALLER,FRAME=144,ENTRY_GR=%r9,SAVE_RP,ARGS_SAVED,ORDERING_AWARE
213 xmpyu %fr8L,%fr8R,%fr8 755 .ENTRY
214 fstds %fr8,-16(0,%r30) 756 STW %r2,-20(%r30) ;offset 0x8ec
215 ldw -16(0,%r30),%r22 757 STW,MA %r3,192(%r30) ;offset 0x8f0
216 ldw -12(0,%r30),%r23 758 STW %r4,-188(%r30) ;offset 0x8f4
217 stw %r23,0(0,%r26) 759 DEPD %r5,31,32,%r6 ;offset 0x8f8
218 copy %r22,%r21 760 STD %r6,-184(%r30) ;offset 0x8fc
219 ldi 0,%r20 761 DEPD %r7,31,32,%r8 ;offset 0x900
220 addib,= -1,%r24,L$0049 762 STD %r8,-176(%r30) ;offset 0x904
221 stw %r21,-24(0,%r19) 763 STW %r9,-168(%r30) ;offset 0x908
222 fldws -8(0,%r28),%fr8L 764 LDD -248(%r30),%r3 ;offset 0x90c
223 fldws -8(0,%r28),%fr8R 765 COPY %r26,%r4 ;offset 0x910
224 xmpyu %fr8L,%fr8R,%fr8 766 COPY %r24,%r5 ;offset 0x914
225 fstds %fr8,-16(0,%r30) 767 DEPD %r25,31,32,%r4 ;offset 0x918
226 ldw -16(0,%r30),%r22 768 CMPB,*<> %r3,%r0,$0006000C ;offset 0x91c
227 ldw -12(0,%r30),%r23 769 DEPD %r23,31,32,%r5 ;offset 0x920
228 stw %r23,-20(0,%r19) 770 MOVIB,TR -1,%r29,$00060002 ;offset 0x924
229 copy %r22,%r21 771 EXTRD,U %r29,31,32,%r28 ;offset 0x928
230 ldi 0,%r20 772$0006002A
231 addib,= -1,%r24,L$0049 773 LDO -1(%r29),%r29 ;offset 0x92c
232 stw %r21,-16(0,%r19) 774 SUB %r23,%r7,%r23 ;offset 0x930
233 fldws -4(0,%r28),%fr8L 775$00060024
234 fldws -4(0,%r28),%fr8R 776 SUB %r4,%r31,%r25 ;offset 0x934
235 xmpyu %fr8L,%fr8R,%fr8 777 AND %r25,%r19,%r26 ;offset 0x938
236 fstds %fr8,-16(0,%r30) 778 CMPB,*<>,N %r0,%r26,$00060046 ;offset 0x93c
237 ldw -16(0,%r30),%r22 779 DEPD,Z %r25,31,32,%r20 ;offset 0x940
238 ldw -12(0,%r30),%r23 780 OR %r20,%r24,%r21 ;offset 0x944
239 stw %r23,-12(0,%r19) 781 CMPB,*<<,N %r21,%r23,$0006002A ;offset 0x948
240 copy %r22,%r21 782 SUB %r31,%r2,%r31 ;offset 0x94c
241 ldi 0,%r20 783$00060046
242 addib,= -1,%r24,L$0049 784$0006002E
243 stw %r21,-8(0,%r19) 785 DEPD,Z %r23,31,32,%r25 ;offset 0x950
244 fldws 0(0,%r28),%fr8L 786 EXTRD,U %r23,31,32,%r26 ;offset 0x954
245 fldws 0(0,%r28),%fr8R 787 AND %r25,%r19,%r24 ;offset 0x958
246 xmpyu %fr8L,%fr8R,%fr8 788 ADD,L %r31,%r26,%r31 ;offset 0x95c
247 fstds %fr8,-16(0,%r30) 789 CMPCLR,*>>= %r5,%r24,%r0 ;offset 0x960
248 ldw -16(0,%r30),%r22 790 LDO 1(%r31),%r31 ;offset 0x964
249 ldw -12(0,%r30),%r23 791$00060032
250 stw %r23,-4(0,%r19) 792 CMPB,*<<=,N %r31,%r4,$00060036 ;offset 0x968
251 copy %r22,%r21 793 LDO -1(%r29),%r29 ;offset 0x96c
252 ldi 0,%r20 794 ADD,L %r4,%r3,%r4 ;offset 0x970
253 addib,= -1,%r24,L$0049 795$00060036
254 stw %r21,0(0,%r19) 796 ADDIB,=,N -1,%r8,$D0 ;offset 0x974
255 ldo 16(%r28),%r28 797 SUB %r5,%r24,%r28 ;offset 0x978
256 ldo 16(%r25),%r25 798$0006003A
257 ldo 32(%r19),%r19 799 SUB %r4,%r31,%r24 ;offset 0x97c
258 bl L$0042,0 800 SHRPD %r24,%r28,32,%r4 ;offset 0x980
259 ldo 32(%r26),%r26 801 DEPD,Z %r29,31,32,%r9 ;offset 0x984
260L$0049 802 DEPD,Z %r28,31,32,%r5 ;offset 0x988
261 bv,n 0(%r2) 803$0006001C
262 .EXIT 804 EXTRD,U %r4,31,32,%r31 ;offset 0x98c
263 .PROCEND 805 CMPB,*<>,N %r31,%r2,$00060020 ;offset 0x990
264 .IMPORT BN_num_bits_word,CODE 806 MOVB,TR %r6,%r29,$D1 ;offset 0x994
265 .IMPORT fprintf,CODE 807 STD %r29,-152(%r30) ;offset 0x998
266 .IMPORT __iob,DATA 808$0006000C
267 .SPACE $TEXT$ 809 EXTRD,U %r3,31,32,%r25 ;offset 0x99c
268 .SUBSPA $LIT$ 810 COPY %r3,%r26 ;offset 0x9a0
269 811 EXTRD,U %r3,31,32,%r9 ;offset 0x9a4
270 .align 4 812 EXTRD,U %r4,31,32,%r8 ;offset 0x9a8
271L$C0000 813 .CALL ARGW0=GR,ARGW1=GR,RTNVAL=GR ;in=25,26;out=28;
272 .STRING "Division would overflow (%d)\x0a\x00" 814 B,L BN_num_bits_word,%r2 ;offset 0x9ac
273 .IMPORT abort,CODE 815 EXTRD,U %r5,31,32,%r7 ;offset 0x9b0
274 .SPACE $TEXT$ 816 LDI 64,%r20 ;offset 0x9b4
275 .SUBSPA $CODE$ 817 DEPD %r7,31,32,%r5 ;offset 0x9b8
276 818 DEPD %r8,31,32,%r4 ;offset 0x9bc
277 .align 4 819 DEPD %r9,31,32,%r3 ;offset 0x9c0
278 .EXPORT bn_div64,ENTRY,PRIV_LEV=3,ARGW0=GR,ARGW1=GR,ARGW2=GR,RTNVAL=GR 820 CMPB,= %r28,%r20,$00060012 ;offset 0x9c4
279bn_div64 821 COPY %r28,%r24 ;offset 0x9c8
822 MTSARCM %r24 ;offset 0x9cc
823 DEPDI,Z -1,%sar,1,%r19 ;offset 0x9d0
824 CMPB,*>>,N %r4,%r19,$D2 ;offset 0x9d4
825$00060012
826 SUBI 64,%r24,%r31 ;offset 0x9d8
827 CMPCLR,*<< %r4,%r3,%r0 ;offset 0x9dc
828 SUB %r4,%r3,%r4 ;offset 0x9e0
829$00060016
830 CMPB,= %r31,%r0,$0006001A ;offset 0x9e4
831 COPY %r0,%r9 ;offset 0x9e8
832 MTSARCM %r31 ;offset 0x9ec
833 DEPD,Z %r3,%sar,64,%r3 ;offset 0x9f0
834 SUBI 64,%r31,%r26 ;offset 0x9f4
835 MTSAR %r26 ;offset 0x9f8
836 SHRPD %r4,%r5,%sar,%r4 ;offset 0x9fc
837 MTSARCM %r31 ;offset 0xa00
838 DEPD,Z %r5,%sar,64,%r5 ;offset 0xa04
839$0006001A
840 DEPDI,Z -1,31,32,%r19 ;offset 0xa08
841 AND %r3,%r19,%r29 ;offset 0xa0c
842 EXTRD,U %r29,31,32,%r2 ;offset 0xa10
843 DEPDI,Z -1,63,32,%r6 ;offset 0xa14
844 MOVIB,TR 2,%r8,$0006001C ;offset 0xa18
845 EXTRD,U %r3,63,32,%r7 ;offset 0xa1c
846$D2
847 ADDIL LR'__iob-$global$,%r27,%r1 ;offset 0xa20
848 LDIL LR'C$7,%r21 ;offset 0xa24
849 LDO RR'__iob-$global$+32(%r1),%r26 ;offset 0xa28
850 .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,RTNVAL=GR ;in=24,25,26;out=28;
851 B,L fprintf,%r2 ;offset 0xa2c
852 LDO RR'C$7(%r21),%r25 ;offset 0xa30
853 .CALL ;
854 B,L abort,%r2 ;offset 0xa34
855 NOP ;offset 0xa38
856 B $D3 ;offset 0xa3c
857 LDW -212(%r30),%r2 ;offset 0xa40
858$00060020
859 COPY %r4,%r26 ;offset 0xa44
860 EXTRD,U %r4,31,32,%r25 ;offset 0xa48
861 COPY %r2,%r24 ;offset 0xa4c
862 .CALL ;in=23,24,25,26;out=20,21,22,28,29; (MILLICALL)
863 B,L $$div2U,%r31 ;offset 0xa50
864 EXTRD,U %r2,31,32,%r23 ;offset 0xa54
865 DEPD %r28,31,32,%r29 ;offset 0xa58
866$00060022
867 STD %r29,-152(%r30) ;offset 0xa5c
868$D1
869 AND %r5,%r19,%r24 ;offset 0xa60
870 EXTRD,U %r24,31,32,%r24 ;offset 0xa64
871 STW %r2,-160(%r30) ;offset 0xa68
872 STW %r7,-128(%r30) ;offset 0xa6c
873 FLDD -152(%r30),%fr4 ;offset 0xa70
874 FLDD -152(%r30),%fr7 ;offset 0xa74
875 FLDW -160(%r30),%fr8L ;offset 0xa78
876 FLDW -128(%r30),%fr5L ;offset 0xa7c
877 XMPYU %fr8L,%fr7L,%fr10 ;offset 0xa80
878 FSTD %fr10,-136(%r30) ;offset 0xa84
879 XMPYU %fr8L,%fr7R,%fr22 ;offset 0xa88
880 FSTD %fr22,-144(%r30) ;offset 0xa8c
881 XMPYU %fr5L,%fr4L,%fr11 ;offset 0xa90
882 XMPYU %fr5L,%fr4R,%fr23 ;offset 0xa94
883 FSTD %fr11,-112(%r30) ;offset 0xa98
884 FSTD %fr23,-120(%r30) ;offset 0xa9c
885 LDD -136(%r30),%r28 ;offset 0xaa0
886 DEPD,Z %r28,31,32,%r31 ;offset 0xaa4
887 LDD -144(%r30),%r20 ;offset 0xaa8
888 ADD,L %r20,%r31,%r31 ;offset 0xaac
889 LDD -112(%r30),%r22 ;offset 0xab0
890 DEPD,Z %r22,31,32,%r22 ;offset 0xab4
891 LDD -120(%r30),%r21 ;offset 0xab8
892 B $00060024 ;offset 0xabc
893 ADD,L %r21,%r22,%r23 ;offset 0xac0
894$D0
895 OR %r9,%r29,%r29 ;offset 0xac4
896$00060040
897 EXTRD,U %r29,31,32,%r28 ;offset 0xac8
898$00060002
899$L2
900 LDW -212(%r30),%r2 ;offset 0xacc
901$D3
902 LDW -168(%r30),%r9 ;offset 0xad0
903 LDD -176(%r30),%r8 ;offset 0xad4
904 EXTRD,U %r8,31,32,%r7 ;offset 0xad8
905 LDD -184(%r30),%r6 ;offset 0xadc
906 EXTRD,U %r6,31,32,%r5 ;offset 0xae0
907 LDW -188(%r30),%r4 ;offset 0xae4
908 BVE (%r2) ;offset 0xae8
909 .EXIT
910 LDW,MB -192(%r30),%r3 ;offset 0xaec
911 .PROCEND ;in=23,25;out=28,29;fpin=105,107;
912
913
914
915
916;----------------------------------------------------------------------------
917;
918; Registers to hold 64-bit values to manipulate. The "L" part
919; of the register corresponds to the upper 32-bits, while the "R"
920; part corresponds to the lower 32-bits
921;
922; Note, that when using b6 and b7, the code must save these before
923; using them because they are callee save registers
924;
925;
926; Floating point registers to use to save values that
927; are manipulated. These don't collide with ftemp1-6 and
928; are all caller save registers
929;
930a0 .reg %fr22
931a0L .reg %fr22L
932a0R .reg %fr22R
933
934a1 .reg %fr23
935a1L .reg %fr23L
936a1R .reg %fr23R
937
938a2 .reg %fr24
939a2L .reg %fr24L
940a2R .reg %fr24R
941
942a3 .reg %fr25
943a3L .reg %fr25L
944a3R .reg %fr25R
945
946a4 .reg %fr26
947a4L .reg %fr26L
948a4R .reg %fr26R
949
950a5 .reg %fr27
951a5L .reg %fr27L
952a5R .reg %fr27R
953
954a6 .reg %fr28
955a6L .reg %fr28L
956a6R .reg %fr28R
957
958a7 .reg %fr29
959a7L .reg %fr29L
960a7R .reg %fr29R
961
962b0 .reg %fr30
963b0L .reg %fr30L
964b0R .reg %fr30R
965
966b1 .reg %fr31
967b1L .reg %fr31L
968b1R .reg %fr31R
969
970;
971; Temporary floating point variables, these are all caller save
972; registers
973;
974ftemp1 .reg %fr4
975ftemp2 .reg %fr5
976ftemp3 .reg %fr6
977ftemp4 .reg %fr7
978
979;
980; The B set of registers when used.
981;
982
983b2 .reg %fr8
984b2L .reg %fr8L
985b2R .reg %fr8R
986
987b3 .reg %fr9
988b3L .reg %fr9L
989b3R .reg %fr9R
990
991b4 .reg %fr10
992b4L .reg %fr10L
993b4R .reg %fr10R
994
995b5 .reg %fr11
996b5L .reg %fr11L
997b5R .reg %fr11R
998
999b6 .reg %fr12
1000b6L .reg %fr12L
1001b6R .reg %fr12R
1002
1003b7 .reg %fr13
1004b7L .reg %fr13L
1005b7R .reg %fr13R
1006
1007c1 .reg %r21 ; only reg
1008temp1 .reg %r20 ; only reg
1009temp2 .reg %r19 ; only reg
1010temp3 .reg %r31 ; only reg
1011
1012m1 .reg %r28
1013c2 .reg %r23
1014high_one .reg %r1
1015ht .reg %r6
1016lt .reg %r5
1017m .reg %r4
1018c3 .reg %r3
1019
1020SQR_ADD_C .macro A0L,A0R,C1,C2,C3
1021 XMPYU A0L,A0R,ftemp1 ; m
1022 FSTD ftemp1,-24(%sp) ; store m
1023
1024 XMPYU A0R,A0R,ftemp2 ; lt
1025 FSTD ftemp2,-16(%sp) ; store lt
1026
1027 XMPYU A0L,A0L,ftemp3 ; ht
1028 FSTD ftemp3,-8(%sp) ; store ht
1029
1030 LDD -24(%sp),m ; load m
1031 AND m,high_mask,temp2 ; m & Mask
1032 DEPD,Z m,30,31,temp3 ; m << 32+1
1033 LDD -16(%sp),lt ; lt
1034
1035 LDD -8(%sp),ht ; ht
1036 EXTRD,U temp2,32,33,temp1 ; temp1 = m&Mask >> 32-1
1037 ADD temp3,lt,lt ; lt = lt+m
1038 ADD,L ht,temp1,ht ; ht += temp1
1039 ADD,DC ht,%r0,ht ; ht++
1040
1041 ADD C1,lt,C1 ; c1=c1+lt
1042 ADD,DC ht,%r0,ht ; ht++
1043
1044 ADD C2,ht,C2 ; c2=c2+ht
1045 ADD,DC C3,%r0,C3 ; c3++
1046.endm
1047
1048SQR_ADD_C2 .macro A0L,A0R,A1L,A1R,C1,C2,C3
1049 XMPYU A0L,A1R,ftemp1 ; m1 = bl*ht
1050 FSTD ftemp1,-16(%sp) ;
1051 XMPYU A0R,A1L,ftemp2 ; m = bh*lt
1052 FSTD ftemp2,-8(%sp) ;
1053 XMPYU A0R,A1R,ftemp3 ; lt = bl*lt
1054 FSTD ftemp3,-32(%sp)
1055 XMPYU A0L,A1L,ftemp4 ; ht = bh*ht
1056 FSTD ftemp4,-24(%sp) ;
1057
1058 LDD -8(%sp),m ; r21 = m
1059 LDD -16(%sp),m1 ; r19 = m1
1060 ADD,L m,m1,m ; m+m1
1061
1062 DEPD,Z m,31,32,temp3 ; (m+m1<<32)
1063 LDD -24(%sp),ht ; r24 = ht
1064
1065 CMPCLR,*>>= m,m1,%r0 ; if (m < m1)
1066 ADD,L ht,high_one,ht ; ht+=high_one
1067
1068 EXTRD,U m,31,32,temp1 ; m >> 32
1069 LDD -32(%sp),lt ; lt
1070 ADD,L ht,temp1,ht ; ht+= m>>32
1071 ADD lt,temp3,lt ; lt = lt+m1
1072 ADD,DC ht,%r0,ht ; ht++
1073
1074 ADD ht,ht,ht ; ht=ht+ht;
1075 ADD,DC C3,%r0,C3 ; add in carry (c3++)
1076
1077 ADD lt,lt,lt ; lt=lt+lt;
1078 ADD,DC ht,%r0,ht ; add in carry (ht++)
1079
1080 ADD C1,lt,C1 ; c1=c1+lt
1081 ADD,DC,*NUV ht,%r0,ht ; add in carry (ht++)
1082 LDO 1(C3),C3 ; bump c3 if overflow,nullify otherwise
1083
1084 ADD C2,ht,C2 ; c2 = c2 + ht
1085 ADD,DC C3,%r0,C3 ; add in carry (c3++)
1086.endm
1087
1088;
1089;void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
1090; arg0 = r_ptr
1091; arg1 = a_ptr
1092;
1093
1094bn_sqr_comba8
280 .PROC 1095 .PROC
281 .CALLINFO FRAME=128,CALLS,SAVE_RP,ENTRY_GR=8 1096 .CALLINFO FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
282 .ENTRY 1097 .EXPORT bn_sqr_comba8,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
283 stw %r2,-20(0,%r30) 1098 .ENTRY
284 stwm %r8,128(0,%r30) 1099 .align 64
285 stw %r7,-124(0,%r30) 1100
286 stw %r4,-112(0,%r30) 1101 STD %r3,0(%sp) ; save r3
287 stw %r3,-108(0,%r30) 1102 STD %r4,8(%sp) ; save r4
288 copy %r26,%r3 1103 STD %r5,16(%sp) ; save r5
289 copy %r25,%r4 1104 STD %r6,24(%sp) ; save r6
290 stw %r6,-120(0,%r30) 1105
291 ldi 0,%r7 1106 ;
292 stw %r5,-116(0,%r30) 1107 ; Zero out carries
293 movb,<> %r24,%r5,L$0051 1108 ;
294 ldi 2,%r6 1109 COPY %r0,c1
295 bl L$0068,0 1110 COPY %r0,c2
296 ldi -1,%r28 1111 COPY %r0,c3
297L$0051 1112
298 .CALL ARGW0=GR 1113 LDO 128(%sp),%sp ; bump stack
299 bl BN_num_bits_word,%r2 1114 DEPDI,Z -1,32,33,high_mask ; Create Mask 0xffffffff80000000L
300 copy %r5,%r26 1115 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
301 copy %r28,%r24 1116
302 ldi 32,%r19 1117 ;
303 comb,= %r19,%r24,L$0052 1118 ; Load up all of the values we are going to use
304 subi 31,%r24,%r19 1119 ;
305 mtsar %r19 1120 FLDD 0(a_ptr),a0
306 zvdepi 1,32,%r19 1121 FLDD 8(a_ptr),a1
307 comb,>>= %r19,%r3,L$0052 1122 FLDD 16(a_ptr),a2
308 addil LR'__iob-$global$+32,%r27 1123 FLDD 24(a_ptr),a3
309 ldo RR'__iob-$global$+32(%r1),%r26 1124 FLDD 32(a_ptr),a4
310 ldil LR'L$C0000,%r25 1125 FLDD 40(a_ptr),a5
311 .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR 1126 FLDD 48(a_ptr),a6
312 bl fprintf,%r2 1127 FLDD 56(a_ptr),a7
313 ldo RR'L$C0000(%r25),%r25 1128
314 .CALL 1129 SQR_ADD_C a0L,a0R,c1,c2,c3
315 bl abort,%r2 1130 STD c1,0(r_ptr) ; r[0] = c1;
316 nop 1131 COPY %r0,c1
317L$0052 1132
318 comb,>> %r5,%r3,L$0053 1133 SQR_ADD_C2 a1L,a1R,a0L,a0R,c2,c3,c1
319 subi 32,%r24,%r24 1134 STD c2,8(r_ptr) ; r[1] = c2;
320 sub %r3,%r5,%r3 1135 COPY %r0,c2
321L$0053 1136
322 comib,= 0,%r24,L$0054 1137 SQR_ADD_C a1L,a1R,c3,c1,c2
323 subi 31,%r24,%r19 1138 SQR_ADD_C2 a2L,a2R,a0L,a0R,c3,c1,c2
324 mtsar %r19 1139 STD c3,16(r_ptr) ; r[2] = c3;
325 zvdep %r5,32,%r5 1140 COPY %r0,c3
326 zvdep %r3,32,%r21 1141
327 subi 32,%r24,%r20 1142 SQR_ADD_C2 a3L,a3R,a0L,a0R,c1,c2,c3
328 mtsar %r20 1143 SQR_ADD_C2 a2L,a2R,a1L,a1R,c1,c2,c3
329 vshd 0,%r4,%r20 1144 STD c1,24(r_ptr) ; r[3] = c1;
330 or %r21,%r20,%r3 1145 COPY %r0,c1
331 mtsar %r19 1146
332 zvdep %r4,32,%r4 1147 SQR_ADD_C a2L,a2R,c2,c3,c1
333L$0054 1148 SQR_ADD_C2 a3L,a3R,a1L,a1R,c2,c3,c1
334 extru %r5,15,16,%r23 1149 SQR_ADD_C2 a4L,a4R,a0L,a0R,c2,c3,c1
335 extru %r5,31,16,%r28 1150 STD c2,32(r_ptr) ; r[4] = c2;
336L$0055 1151 COPY %r0,c2
337 extru %r3,15,16,%r19 1152
338 comb,<> %r23,%r19,L$0058 1153 SQR_ADD_C2 a5L,a5R,a0L,a0R,c3,c1,c2
339 copy %r3,%r26 1154 SQR_ADD_C2 a4L,a4R,a1L,a1R,c3,c1,c2
340 bl L$0059,0 1155 SQR_ADD_C2 a3L,a3R,a2L,a2R,c3,c1,c2
341 zdepi -1,31,16,%r29 1156 STD c3,40(r_ptr) ; r[5] = c3;
342L$0058 1157 COPY %r0,c3
343 .IMPORT $$divU,MILLICODE 1158
344 bl $$divU,%r31 1159 SQR_ADD_C a3L,a3R,c1,c2,c3
345 copy %r23,%r25 1160 SQR_ADD_C2 a4L,a4R,a2L,a2R,c1,c2,c3
346L$0059 1161 SQR_ADD_C2 a5L,a5R,a1L,a1R,c1,c2,c3
347 stw %r29,-16(0,%r30) 1162 SQR_ADD_C2 a6L,a6R,a0L,a0R,c1,c2,c3
348 fldws -16(0,%r30),%fr10L 1163 STD c1,48(r_ptr) ; r[6] = c1;
349 stw %r28,-16(0,%r30) 1164 COPY %r0,c1
350 fldws -16(0,%r30),%fr10R 1165
351 stw %r23,-16(0,%r30) 1166 SQR_ADD_C2 a7L,a7R,a0L,a0R,c2,c3,c1
352 xmpyu %fr10L,%fr10R,%fr8 1167 SQR_ADD_C2 a6L,a6R,a1L,a1R,c2,c3,c1
353 fldws -16(0,%r30),%fr10R 1168 SQR_ADD_C2 a5L,a5R,a2L,a2R,c2,c3,c1
354 fstws %fr8R,-16(0,%r30) 1169 SQR_ADD_C2 a4L,a4R,a3L,a3R,c2,c3,c1
355 xmpyu %fr10L,%fr10R,%fr9 1170 STD c2,56(r_ptr) ; r[7] = c2;
356 ldw -16(0,%r30),%r8 1171 COPY %r0,c2
357 fstws %fr9R,-16(0,%r30) 1172
358 copy %r8,%r22 1173 SQR_ADD_C a4L,a4R,c3,c1,c2
359 ldw -16(0,%r30),%r8 1174 SQR_ADD_C2 a5L,a5R,a3L,a3R,c3,c1,c2
360 extru %r4,15,16,%r24 1175 SQR_ADD_C2 a6L,a6R,a2L,a2R,c3,c1,c2
361 copy %r8,%r21 1176 SQR_ADD_C2 a7L,a7R,a1L,a1R,c3,c1,c2
362L$0060 1177 STD c3,64(r_ptr) ; r[8] = c3;
363 sub %r3,%r21,%r20 1178 COPY %r0,c3
364 copy %r20,%r19 1179
365 depi 0,31,16,%r19 1180 SQR_ADD_C2 a7L,a7R,a2L,a2R,c1,c2,c3
366 comib,<> 0,%r19,L$0061 1181 SQR_ADD_C2 a6L,a6R,a3L,a3R,c1,c2,c3
367 zdep %r20,15,16,%r19 1182 SQR_ADD_C2 a5L,a5R,a4L,a4R,c1,c2,c3
368 addl %r19,%r24,%r19 1183 STD c1,72(r_ptr) ; r[9] = c1;
369 comb,>>= %r19,%r22,L$0061 1184 COPY %r0,c1
370 sub %r22,%r28,%r22 1185
371 sub %r21,%r23,%r21 1186 SQR_ADD_C a5L,a5R,c2,c3,c1
372 bl L$0060,0 1187 SQR_ADD_C2 a6L,a6R,a4L,a4R,c2,c3,c1
373 ldo -1(%r29),%r29 1188 SQR_ADD_C2 a7L,a7R,a3L,a3R,c2,c3,c1
374L$0061 1189 STD c2,80(r_ptr) ; r[10] = c2;
375 stw %r29,-16(0,%r30) 1190 COPY %r0,c2
376 fldws -16(0,%r30),%fr10L 1191
377 stw %r28,-16(0,%r30) 1192 SQR_ADD_C2 a7L,a7R,a4L,a4R,c3,c1,c2
378 fldws -16(0,%r30),%fr10R 1193 SQR_ADD_C2 a6L,a6R,a5L,a5R,c3,c1,c2
379 xmpyu %fr10L,%fr10R,%fr8 1194 STD c3,88(r_ptr) ; r[11] = c3;
380 fstws %fr8R,-16(0,%r30) 1195 COPY %r0,c3
381 ldw -16(0,%r30),%r8 1196
382 stw %r23,-16(0,%r30) 1197 SQR_ADD_C a6L,a6R,c1,c2,c3
383 fldws -16(0,%r30),%fr10R 1198 SQR_ADD_C2 a7L,a7R,a5L,a5R,c1,c2,c3
384 copy %r8,%r19 1199 STD c1,96(r_ptr) ; r[12] = c1;
385 xmpyu %fr10L,%fr10R,%fr8 1200 COPY %r0,c1
386 fstws %fr8R,-16(0,%r30) 1201
387 extru %r19,15,16,%r20 1202 SQR_ADD_C2 a7L,a7R,a6L,a6R,c2,c3,c1
388 ldw -16(0,%r30),%r8 1203 STD c2,104(r_ptr) ; r[13] = c2;
389 zdep %r19,15,16,%r19 1204 COPY %r0,c2
390 addl %r8,%r20,%r20 1205
391 comclr,<<= %r19,%r4,0 1206 SQR_ADD_C a7L,a7R,c3,c1,c2
392 addi 1,%r20,%r20 1207 STD c3, 112(r_ptr) ; r[14] = c3
393 comb,<<= %r20,%r3,L$0066 1208 STD c1, 120(r_ptr) ; r[15] = c1
394 sub %r4,%r19,%r4 1209
395 addl %r3,%r5,%r3 1210 .EXIT
396 ldo -1(%r29),%r29 1211 LDD -104(%sp),%r6 ; restore r6
397L$0066 1212 LDD -112(%sp),%r5 ; restore r5
398 addib,= -1,%r6,L$0056 1213 LDD -120(%sp),%r4 ; restore r4
399 sub %r3,%r20,%r3 1214 BVE (%rp)
400 zdep %r29,15,16,%r7 1215 LDD,MB -128(%sp),%r3
401 shd %r3,%r4,16,%r3 1216
402 bl L$0055,0 1217 .PROCEND
403 zdep %r4,15,16,%r4 1218
404L$0056 1219;-----------------------------------------------------------------------------
405 or %r7,%r29,%r28 1220;
406L$0068 1221;void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
407 ldw -148(0,%r30),%r2 1222; arg0 = r_ptr
408 ldw -124(0,%r30),%r7 1223; arg1 = a_ptr
409 ldw -120(0,%r30),%r6 1224;
410 ldw -116(0,%r30),%r5 1225
411 ldw -112(0,%r30),%r4 1226bn_sqr_comba4
412 ldw -108(0,%r30),%r3 1227 .proc
413 bv 0(%r2) 1228 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
414 ldwm -128(0,%r30),%r8 1229 .EXPORT bn_sqr_comba4,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
415 .EXIT 1230 .entry
416 .PROCEND 1231 .align 64
1232 STD %r3,0(%sp) ; save r3
1233 STD %r4,8(%sp) ; save r4
1234 STD %r5,16(%sp) ; save r5
1235 STD %r6,24(%sp) ; save r6
1236
1237 ;
1238 ; Zero out carries
1239 ;
1240 COPY %r0,c1
1241 COPY %r0,c2
1242 COPY %r0,c3
1243
1244 LDO 128(%sp),%sp ; bump stack
1245 DEPDI,Z -1,32,33,high_mask ; Create Mask 0xffffffff80000000L
1246 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1247
1248 ;
1249 ; Load up all of the values we are going to use
1250 ;
1251 FLDD 0(a_ptr),a0
1252 FLDD 8(a_ptr),a1
1253 FLDD 16(a_ptr),a2
1254 FLDD 24(a_ptr),a3
1255 FLDD 32(a_ptr),a4
1256 FLDD 40(a_ptr),a5
1257 FLDD 48(a_ptr),a6
1258 FLDD 56(a_ptr),a7
1259
1260 SQR_ADD_C a0L,a0R,c1,c2,c3
1261
1262 STD c1,0(r_ptr) ; r[0] = c1;
1263 COPY %r0,c1
1264
1265 SQR_ADD_C2 a1L,a1R,a0L,a0R,c2,c3,c1
1266
1267 STD c2,8(r_ptr) ; r[1] = c2;
1268 COPY %r0,c2
1269
1270 SQR_ADD_C a1L,a1R,c3,c1,c2
1271 SQR_ADD_C2 a2L,a2R,a0L,a0R,c3,c1,c2
1272
1273 STD c3,16(r_ptr) ; r[2] = c3;
1274 COPY %r0,c3
1275
1276 SQR_ADD_C2 a3L,a3R,a0L,a0R,c1,c2,c3
1277 SQR_ADD_C2 a2L,a2R,a1L,a1R,c1,c2,c3
1278
1279 STD c1,24(r_ptr) ; r[3] = c1;
1280 COPY %r0,c1
1281
1282 SQR_ADD_C a2L,a2R,c2,c3,c1
1283 SQR_ADD_C2 a3L,a3R,a1L,a1R,c2,c3,c1
1284
1285 STD c2,32(r_ptr) ; r[4] = c2;
1286 COPY %r0,c2
1287
1288 SQR_ADD_C2 a3L,a3R,a2L,a2R,c3,c1,c2
1289 STD c3,40(r_ptr) ; r[5] = c3;
1290 COPY %r0,c3
1291
1292 SQR_ADD_C a3L,a3R,c1,c2,c3
1293 STD c1,48(r_ptr) ; r[6] = c1;
1294 STD c2,56(r_ptr) ; r[7] = c2;
1295
1296 .EXIT
1297 LDD -104(%sp),%r6 ; restore r6
1298 LDD -112(%sp),%r5 ; restore r5
1299 LDD -120(%sp),%r4 ; restore r4
1300 BVE (%rp)
1301 LDD,MB -128(%sp),%r3
1302
1303 .PROCEND
1304
1305
1306;---------------------------------------------------------------------------
1307
1308MUL_ADD_C .macro A0L,A0R,B0L,B0R,C1,C2,C3
1309 XMPYU A0L,B0R,ftemp1 ; m1 = bl*ht
1310 FSTD ftemp1,-16(%sp) ;
1311 XMPYU A0R,B0L,ftemp2 ; m = bh*lt
1312 FSTD ftemp2,-8(%sp) ;
1313 XMPYU A0R,B0R,ftemp3 ; lt = bl*lt
1314 FSTD ftemp3,-32(%sp)
1315 XMPYU A0L,B0L,ftemp4 ; ht = bh*ht
1316 FSTD ftemp4,-24(%sp) ;
1317
1318 LDD -8(%sp),m ; r21 = m
1319 LDD -16(%sp),m1 ; r19 = m1
1320 ADD,L m,m1,m ; m+m1
1321
1322 DEPD,Z m,31,32,temp3 ; (m+m1<<32)
1323 LDD -24(%sp),ht ; r24 = ht
1324
1325 CMPCLR,*>>= m,m1,%r0 ; if (m < m1)
1326 ADD,L ht,high_one,ht ; ht+=high_one
1327
1328 EXTRD,U m,31,32,temp1 ; m >> 32
1329 LDD -32(%sp),lt ; lt
1330 ADD,L ht,temp1,ht ; ht+= m>>32
1331 ADD lt,temp3,lt ; lt = lt+m1
1332 ADD,DC ht,%r0,ht ; ht++
1333
1334 ADD C1,lt,C1 ; c1=c1+lt
1335 ADD,DC ht,%r0,ht ; bump c3 if overflow,nullify otherwise
1336
1337 ADD C2,ht,C2 ; c2 = c2 + ht
1338 ADD,DC C3,%r0,C3 ; add in carry (c3++)
1339.endm
1340
1341
1342;
1343;void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
1344; arg0 = r_ptr
1345; arg1 = a_ptr
1346; arg2 = b_ptr
1347;
1348
1349bn_mul_comba8
1350 .proc
1351 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
1352 .EXPORT bn_mul_comba8,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
1353 .entry
1354 .align 64
1355
1356 STD %r3,0(%sp) ; save r3
1357 STD %r4,8(%sp) ; save r4
1358 STD %r5,16(%sp) ; save r5
1359 STD %r6,24(%sp) ; save r6
1360 FSTD %fr12,32(%sp) ; save r6
1361 FSTD %fr13,40(%sp) ; save r7
1362
1363 ;
1364 ; Zero out carries
1365 ;
1366 COPY %r0,c1
1367 COPY %r0,c2
1368 COPY %r0,c3
1369
1370 LDO 128(%sp),%sp ; bump stack
1371 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1372
1373 ;
1374 ; Load up all of the values we are going to use
1375 ;
1376 FLDD 0(a_ptr),a0
1377 FLDD 8(a_ptr),a1
1378 FLDD 16(a_ptr),a2
1379 FLDD 24(a_ptr),a3
1380 FLDD 32(a_ptr),a4
1381 FLDD 40(a_ptr),a5
1382 FLDD 48(a_ptr),a6
1383 FLDD 56(a_ptr),a7
1384
1385 FLDD 0(b_ptr),b0
1386 FLDD 8(b_ptr),b1
1387 FLDD 16(b_ptr),b2
1388 FLDD 24(b_ptr),b3
1389 FLDD 32(b_ptr),b4
1390 FLDD 40(b_ptr),b5
1391 FLDD 48(b_ptr),b6
1392 FLDD 56(b_ptr),b7
1393
1394 MUL_ADD_C a0L,a0R,b0L,b0R,c1,c2,c3
1395 STD c1,0(r_ptr)
1396 COPY %r0,c1
1397
1398 MUL_ADD_C a0L,a0R,b1L,b1R,c2,c3,c1
1399 MUL_ADD_C a1L,a1R,b0L,b0R,c2,c3,c1
1400 STD c2,8(r_ptr)
1401 COPY %r0,c2
1402
1403 MUL_ADD_C a2L,a2R,b0L,b0R,c3,c1,c2
1404 MUL_ADD_C a1L,a1R,b1L,b1R,c3,c1,c2
1405 MUL_ADD_C a0L,a0R,b2L,b2R,c3,c1,c2
1406 STD c3,16(r_ptr)
1407 COPY %r0,c3
1408
1409 MUL_ADD_C a0L,a0R,b3L,b3R,c1,c2,c3
1410 MUL_ADD_C a1L,a1R,b2L,b2R,c1,c2,c3
1411 MUL_ADD_C a2L,a2R,b1L,b1R,c1,c2,c3
1412 MUL_ADD_C a3L,a3R,b0L,b0R,c1,c2,c3
1413 STD c1,24(r_ptr)
1414 COPY %r0,c1
1415
1416 MUL_ADD_C a4L,a4R,b0L,b0R,c2,c3,c1
1417 MUL_ADD_C a3L,a3R,b1L,b1R,c2,c3,c1
1418 MUL_ADD_C a2L,a2R,b2L,b2R,c2,c3,c1
1419 MUL_ADD_C a1L,a1R,b3L,b3R,c2,c3,c1
1420 MUL_ADD_C a0L,a0R,b4L,b4R,c2,c3,c1
1421 STD c2,32(r_ptr)
1422 COPY %r0,c2
1423
1424 MUL_ADD_C a0L,a0R,b5L,b5R,c3,c1,c2
1425 MUL_ADD_C a1L,a1R,b4L,b4R,c3,c1,c2
1426 MUL_ADD_C a2L,a2R,b3L,b3R,c3,c1,c2
1427 MUL_ADD_C a3L,a3R,b2L,b2R,c3,c1,c2
1428 MUL_ADD_C a4L,a4R,b1L,b1R,c3,c1,c2
1429 MUL_ADD_C a5L,a5R,b0L,b0R,c3,c1,c2
1430 STD c3,40(r_ptr)
1431 COPY %r0,c3
1432
1433 MUL_ADD_C a6L,a6R,b0L,b0R,c1,c2,c3
1434 MUL_ADD_C a5L,a5R,b1L,b1R,c1,c2,c3
1435 MUL_ADD_C a4L,a4R,b2L,b2R,c1,c2,c3
1436 MUL_ADD_C a3L,a3R,b3L,b3R,c1,c2,c3
1437 MUL_ADD_C a2L,a2R,b4L,b4R,c1,c2,c3
1438 MUL_ADD_C a1L,a1R,b5L,b5R,c1,c2,c3
1439 MUL_ADD_C a0L,a0R,b6L,b6R,c1,c2,c3
1440 STD c1,48(r_ptr)
1441 COPY %r0,c1
1442
1443 MUL_ADD_C a0L,a0R,b7L,b7R,c2,c3,c1
1444 MUL_ADD_C a1L,a1R,b6L,b6R,c2,c3,c1
1445 MUL_ADD_C a2L,a2R,b5L,b5R,c2,c3,c1
1446 MUL_ADD_C a3L,a3R,b4L,b4R,c2,c3,c1
1447 MUL_ADD_C a4L,a4R,b3L,b3R,c2,c3,c1
1448 MUL_ADD_C a5L,a5R,b2L,b2R,c2,c3,c1
1449 MUL_ADD_C a6L,a6R,b1L,b1R,c2,c3,c1
1450 MUL_ADD_C a7L,a7R,b0L,b0R,c2,c3,c1
1451 STD c2,56(r_ptr)
1452 COPY %r0,c2
1453
1454 MUL_ADD_C a7L,a7R,b1L,b1R,c3,c1,c2
1455 MUL_ADD_C a6L,a6R,b2L,b2R,c3,c1,c2
1456 MUL_ADD_C a5L,a5R,b3L,b3R,c3,c1,c2
1457 MUL_ADD_C a4L,a4R,b4L,b4R,c3,c1,c2
1458 MUL_ADD_C a3L,a3R,b5L,b5R,c3,c1,c2
1459 MUL_ADD_C a2L,a2R,b6L,b6R,c3,c1,c2
1460 MUL_ADD_C a1L,a1R,b7L,b7R,c3,c1,c2
1461 STD c3,64(r_ptr)
1462 COPY %r0,c3
1463
1464 MUL_ADD_C a2L,a2R,b7L,b7R,c1,c2,c3
1465 MUL_ADD_C a3L,a3R,b6L,b6R,c1,c2,c3
1466 MUL_ADD_C a4L,a4R,b5L,b5R,c1,c2,c3
1467 MUL_ADD_C a5L,a5R,b4L,b4R,c1,c2,c3
1468 MUL_ADD_C a6L,a6R,b3L,b3R,c1,c2,c3
1469 MUL_ADD_C a7L,a7R,b2L,b2R,c1,c2,c3
1470 STD c1,72(r_ptr)
1471 COPY %r0,c1
1472
1473 MUL_ADD_C a7L,a7R,b3L,b3R,c2,c3,c1
1474 MUL_ADD_C a6L,a6R,b4L,b4R,c2,c3,c1
1475 MUL_ADD_C a5L,a5R,b5L,b5R,c2,c3,c1
1476 MUL_ADD_C a4L,a4R,b6L,b6R,c2,c3,c1
1477 MUL_ADD_C a3L,a3R,b7L,b7R,c2,c3,c1
1478 STD c2,80(r_ptr)
1479 COPY %r0,c2
1480
1481 MUL_ADD_C a4L,a4R,b7L,b7R,c3,c1,c2
1482 MUL_ADD_C a5L,a5R,b6L,b6R,c3,c1,c2
1483 MUL_ADD_C a6L,a6R,b5L,b5R,c3,c1,c2
1484 MUL_ADD_C a7L,a7R,b4L,b4R,c3,c1,c2
1485 STD c3,88(r_ptr)
1486 COPY %r0,c3
1487
1488 MUL_ADD_C a7L,a7R,b5L,b5R,c1,c2,c3
1489 MUL_ADD_C a6L,a6R,b6L,b6R,c1,c2,c3
1490 MUL_ADD_C a5L,a5R,b7L,b7R,c1,c2,c3
1491 STD c1,96(r_ptr)
1492 COPY %r0,c1
1493
1494 MUL_ADD_C a6L,a6R,b7L,b7R,c2,c3,c1
1495 MUL_ADD_C a7L,a7R,b6L,b6R,c2,c3,c1
1496 STD c2,104(r_ptr)
1497 COPY %r0,c2
1498
1499 MUL_ADD_C a7L,a7R,b7L,b7R,c3,c1,c2
1500 STD c3,112(r_ptr)
1501 STD c1,120(r_ptr)
1502
1503 .EXIT
1504 FLDD -88(%sp),%fr13
1505 FLDD -96(%sp),%fr12
1506 LDD -104(%sp),%r6 ; restore r6
1507 LDD -112(%sp),%r5 ; restore r5
1508 LDD -120(%sp),%r4 ; restore r4
1509 BVE (%rp)
1510 LDD,MB -128(%sp),%r3
1511
1512 .PROCEND
1513
1514;-----------------------------------------------------------------------------
1515;
1516;void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
1517; arg0 = r_ptr
1518; arg1 = a_ptr
1519; arg2 = b_ptr
1520;
1521
1522bn_mul_comba4
1523 .proc
1524 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
1525 .EXPORT bn_mul_comba4,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
1526 .entry
1527 .align 64
1528
1529 STD %r3,0(%sp) ; save r3
1530 STD %r4,8(%sp) ; save r4
1531 STD %r5,16(%sp) ; save r5
1532 STD %r6,24(%sp) ; save r6
1533 FSTD %fr12,32(%sp) ; save r6
1534 FSTD %fr13,40(%sp) ; save r7
1535
1536 ;
1537 ; Zero out carries
1538 ;
1539 COPY %r0,c1
1540 COPY %r0,c2
1541 COPY %r0,c3
1542
1543 LDO 128(%sp),%sp ; bump stack
1544 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1545
1546 ;
1547 ; Load up all of the values we are going to use
1548 ;
1549 FLDD 0(a_ptr),a0
1550 FLDD 8(a_ptr),a1
1551 FLDD 16(a_ptr),a2
1552 FLDD 24(a_ptr),a3
1553
1554 FLDD 0(b_ptr),b0
1555 FLDD 8(b_ptr),b1
1556 FLDD 16(b_ptr),b2
1557 FLDD 24(b_ptr),b3
1558
1559 MUL_ADD_C a0L,a0R,b0L,b0R,c1,c2,c3
1560 STD c1,0(r_ptr)
1561 COPY %r0,c1
1562
1563 MUL_ADD_C a0L,a0R,b1L,b1R,c2,c3,c1
1564 MUL_ADD_C a1L,a1R,b0L,b0R,c2,c3,c1
1565 STD c2,8(r_ptr)
1566 COPY %r0,c2
1567
1568 MUL_ADD_C a2L,a2R,b0L,b0R,c3,c1,c2
1569 MUL_ADD_C a1L,a1R,b1L,b1R,c3,c1,c2
1570 MUL_ADD_C a0L,a0R,b2L,b2R,c3,c1,c2
1571 STD c3,16(r_ptr)
1572 COPY %r0,c3
1573
1574 MUL_ADD_C a0L,a0R,b3L,b3R,c1,c2,c3
1575 MUL_ADD_C a1L,a1R,b2L,b2R,c1,c2,c3
1576 MUL_ADD_C a2L,a2R,b1L,b1R,c1,c2,c3
1577 MUL_ADD_C a3L,a3R,b0L,b0R,c1,c2,c3
1578 STD c1,24(r_ptr)
1579 COPY %r0,c1
1580
1581 MUL_ADD_C a3L,a3R,b1L,b1R,c2,c3,c1
1582 MUL_ADD_C a2L,a2R,b2L,b2R,c2,c3,c1
1583 MUL_ADD_C a1L,a1R,b3L,b3R,c2,c3,c1
1584 STD c2,32(r_ptr)
1585 COPY %r0,c2
1586
1587 MUL_ADD_C a2L,a2R,b3L,b3R,c3,c1,c2
1588 MUL_ADD_C a3L,a3R,b2L,b2R,c3,c1,c2
1589 STD c3,40(r_ptr)
1590 COPY %r0,c3
1591
1592 MUL_ADD_C a3L,a3R,b3L,b3R,c1,c2,c3
1593 STD c1,48(r_ptr)
1594 STD c2,56(r_ptr)
1595
1596 .EXIT
1597 FLDD -88(%sp),%fr13
1598 FLDD -96(%sp),%fr12
1599 LDD -104(%sp),%r6 ; restore r6
1600 LDD -112(%sp),%r5 ; restore r5
1601 LDD -120(%sp),%r4 ; restore r4
1602 BVE (%rp)
1603 LDD,MB -128(%sp),%r3
1604
1605 .PROCEND
1606
1607
1608 .SPACE $TEXT$
1609 .SUBSPA $CODE$
1610 .SPACE $PRIVATE$,SORT=16
1611 .IMPORT $global$,DATA
1612 .SPACE $TEXT$
1613 .SUBSPA $CODE$
1614 .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16
1615C$7
1616 .ALIGN 8
1617 .STRINGZ "Division would overflow (%d)\n"
1618 .END
diff --git a/src/lib/libcrypto/bn/asm/pa-risc2W.s b/src/lib/libcrypto/bn/asm/pa-risc2W.s
new file mode 100644
index 0000000000..54b6606252
--- /dev/null
+++ b/src/lib/libcrypto/bn/asm/pa-risc2W.s
@@ -0,0 +1,1605 @@
1;
2; PA-RISC 64-bit implementation of bn_asm code
3;
4; This code is approximately 2x faster than the C version
5; for RSA/DSA.
6;
7; See http://devresource.hp.com/ for more details on the PA-RISC
8; architecture. Also see the book "PA-RISC 2.0 Architecture"
9; by Gerry Kane for information on the instruction set architecture.
10;
11; Code written by Chris Ruemmler (with some help from the HP C
12; compiler).
13;
14; The code compiles with HP's assembler
15;
16
17 .level 2.0W
18 .space $TEXT$
19 .subspa $CODE$,QUAD=0,ALIGN=8,ACCESS=0x2c,CODE_ONLY
20
21;
22; Global Register definitions used for the routines.
23;
24; Some information about HP's runtime architecture for 64-bits.
25;
26; "Caller save" means the calling function must save the register
27; if it wants the register to be preserved.
28; "Callee save" means if a function uses the register, it must save
29; the value before using it.
30;
31; For the floating point registers
32;
33; "caller save" registers: fr4-fr11, fr22-fr31
34; "callee save" registers: fr12-fr21
35; "special" registers: fr0-fr3 (status and exception registers)
36;
37; For the integer registers
38; value zero : r0
39; "caller save" registers: r1,r19-r26
40; "callee save" registers: r3-r18
41; return register : r2 (rp)
42; return values ; r28 (ret0,ret1)
43; Stack pointer ; r30 (sp)
44; global data pointer ; r27 (dp)
45; argument pointer ; r29 (ap)
46; millicode return ptr ; r31 (also a caller save register)
47
48
49;
50; Arguments to the routines
51;
52r_ptr .reg %r26
53a_ptr .reg %r25
54b_ptr .reg %r24
55num .reg %r24
56w .reg %r23
57n .reg %r23
58
59
60;
61; Globals used in some routines
62;
63
64top_overflow .reg %r29
65high_mask .reg %r22 ; value 0xffffffff80000000L
66
67
68;------------------------------------------------------------------------------
69;
70; bn_mul_add_words
71;
72;BN_ULONG bn_mul_add_words(BN_ULONG *r_ptr, BN_ULONG *a_ptr,
73; int num, BN_ULONG w)
74;
75; arg0 = r_ptr
76; arg1 = a_ptr
77; arg2 = num
78; arg3 = w
79;
80; Local register definitions
81;
82
83fm1 .reg %fr22
84fm .reg %fr23
85ht_temp .reg %fr24
86ht_temp_1 .reg %fr25
87lt_temp .reg %fr26
88lt_temp_1 .reg %fr27
89fm1_1 .reg %fr28
90fm_1 .reg %fr29
91
92fw_h .reg %fr7L
93fw_l .reg %fr7R
94fw .reg %fr7
95
96fht_0 .reg %fr8L
97flt_0 .reg %fr8R
98t_float_0 .reg %fr8
99
100fht_1 .reg %fr9L
101flt_1 .reg %fr9R
102t_float_1 .reg %fr9
103
104tmp_0 .reg %r31
105tmp_1 .reg %r21
106m_0 .reg %r20
107m_1 .reg %r19
108ht_0 .reg %r1
109ht_1 .reg %r3
110lt_0 .reg %r4
111lt_1 .reg %r5
112m1_0 .reg %r6
113m1_1 .reg %r7
114rp_val .reg %r8
115rp_val_1 .reg %r9
116
117bn_mul_add_words
118 .export bn_mul_add_words,entry,NO_RELOCATION,LONG_RETURN
119 .proc
120 .callinfo frame=128
121 .entry
122 .align 64
123
124 STD %r3,0(%sp) ; save r3
125 STD %r4,8(%sp) ; save r4
126 NOP ; Needed to make the loop 16-byte aligned
127 NOP ; Needed to make the loop 16-byte aligned
128
129 STD %r5,16(%sp) ; save r5
130 STD %r6,24(%sp) ; save r6
131 STD %r7,32(%sp) ; save r7
132 STD %r8,40(%sp) ; save r8
133
134 STD %r9,48(%sp) ; save r9
135 COPY %r0,%ret0 ; return 0 by default
136 DEPDI,Z 1,31,1,top_overflow ; top_overflow = 1 << 32
137 STD w,56(%sp) ; store w on stack
138
139 CMPIB,>= 0,num,bn_mul_add_words_exit ; if (num <= 0) then exit
140 LDO 128(%sp),%sp ; bump stack
141
142 ;
143 ; The loop is unrolled twice, so if there is only 1 number
144 ; then go straight to the cleanup code.
145 ;
146 CMPIB,= 1,num,bn_mul_add_words_single_top
147 FLDD -72(%sp),fw ; load up w into fp register fw (fw_h/fw_l)
148
149 ;
150 ; This loop is unrolled 2 times (64-byte aligned as well)
151 ;
152 ; PA-RISC 2.0 chips have two fully pipelined multipliers, thus
153 ; two 32-bit mutiplies can be issued per cycle.
154 ;
155bn_mul_add_words_unroll2
156
157 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
158 FLDD 8(a_ptr),t_float_1 ; load up 64-bit value (fr8L) ht(L)/lt(R)
159 LDD 0(r_ptr),rp_val ; rp[0]
160 LDD 8(r_ptr),rp_val_1 ; rp[1]
161
162 XMPYU fht_0,fw_l,fm1 ; m1[0] = fht_0*fw_l
163 XMPYU fht_1,fw_l,fm1_1 ; m1[1] = fht_1*fw_l
164 FSTD fm1,-16(%sp) ; -16(sp) = m1[0]
165 FSTD fm1_1,-48(%sp) ; -48(sp) = m1[1]
166
167 XMPYU flt_0,fw_h,fm ; m[0] = flt_0*fw_h
168 XMPYU flt_1,fw_h,fm_1 ; m[1] = flt_1*fw_h
169 FSTD fm,-8(%sp) ; -8(sp) = m[0]
170 FSTD fm_1,-40(%sp) ; -40(sp) = m[1]
171
172 XMPYU fht_0,fw_h,ht_temp ; ht_temp = fht_0*fw_h
173 XMPYU fht_1,fw_h,ht_temp_1 ; ht_temp_1 = fht_1*fw_h
174 FSTD ht_temp,-24(%sp) ; -24(sp) = ht_temp
175 FSTD ht_temp_1,-56(%sp) ; -56(sp) = ht_temp_1
176
177 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
178 XMPYU flt_1,fw_l,lt_temp_1 ; lt_temp = lt*fw_l
179 FSTD lt_temp,-32(%sp) ; -32(sp) = lt_temp
180 FSTD lt_temp_1,-64(%sp) ; -64(sp) = lt_temp_1
181
182 LDD -8(%sp),m_0 ; m[0]
183 LDD -40(%sp),m_1 ; m[1]
184 LDD -16(%sp),m1_0 ; m1[0]
185 LDD -48(%sp),m1_1 ; m1[1]
186
187 LDD -24(%sp),ht_0 ; ht[0]
188 LDD -56(%sp),ht_1 ; ht[1]
189 ADD,L m1_0,m_0,tmp_0 ; tmp_0 = m[0] + m1[0];
190 ADD,L m1_1,m_1,tmp_1 ; tmp_1 = m[1] + m1[1];
191
192 LDD -32(%sp),lt_0
193 LDD -64(%sp),lt_1
194 CMPCLR,*>>= tmp_0,m1_0, %r0 ; if (m[0] < m1[0])
195 ADD,L ht_0,top_overflow,ht_0 ; ht[0] += (1<<32)
196
197 CMPCLR,*>>= tmp_1,m1_1,%r0 ; if (m[1] < m1[1])
198 ADD,L ht_1,top_overflow,ht_1 ; ht[1] += (1<<32)
199 EXTRD,U tmp_0,31,32,m_0 ; m[0]>>32
200 DEPD,Z tmp_0,31,32,m1_0 ; m1[0] = m[0]<<32
201
202 EXTRD,U tmp_1,31,32,m_1 ; m[1]>>32
203 DEPD,Z tmp_1,31,32,m1_1 ; m1[1] = m[1]<<32
204 ADD,L ht_0,m_0,ht_0 ; ht[0]+= (m[0]>>32)
205 ADD,L ht_1,m_1,ht_1 ; ht[1]+= (m[1]>>32)
206
207 ADD lt_0,m1_0,lt_0 ; lt[0] = lt[0]+m1[0];
208 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
209 ADD lt_1,m1_1,lt_1 ; lt[1] = lt[1]+m1[1];
210 ADD,DC ht_1,%r0,ht_1 ; ht[1]++
211
212 ADD %ret0,lt_0,lt_0 ; lt[0] = lt[0] + c;
213 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
214 ADD lt_0,rp_val,lt_0 ; lt[0] = lt[0]+rp[0]
215 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
216
217 LDO -2(num),num ; num = num - 2;
218 ADD ht_0,lt_1,lt_1 ; lt[1] = lt[1] + ht_0 (c);
219 ADD,DC ht_1,%r0,ht_1 ; ht[1]++
220 STD lt_0,0(r_ptr) ; rp[0] = lt[0]
221
222 ADD lt_1,rp_val_1,lt_1 ; lt[1] = lt[1]+rp[1]
223 ADD,DC ht_1,%r0,%ret0 ; ht[1]++
224 LDO 16(a_ptr),a_ptr ; a_ptr += 2
225
226 STD lt_1,8(r_ptr) ; rp[1] = lt[1]
227 CMPIB,<= 2,num,bn_mul_add_words_unroll2 ; go again if more to do
228 LDO 16(r_ptr),r_ptr ; r_ptr += 2
229
230 CMPIB,=,N 0,num,bn_mul_add_words_exit ; are we done, or cleanup last one
231
232 ;
233 ; Top of loop aligned on 64-byte boundary
234 ;
235bn_mul_add_words_single_top
236 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
237 LDD 0(r_ptr),rp_val ; rp[0]
238 LDO 8(a_ptr),a_ptr ; a_ptr++
239 XMPYU fht_0,fw_l,fm1 ; m1 = ht*fw_l
240 FSTD fm1,-16(%sp) ; -16(sp) = m1
241 XMPYU flt_0,fw_h,fm ; m = lt*fw_h
242 FSTD fm,-8(%sp) ; -8(sp) = m
243 XMPYU fht_0,fw_h,ht_temp ; ht_temp = ht*fw_h
244 FSTD ht_temp,-24(%sp) ; -24(sp) = ht
245 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
246 FSTD lt_temp,-32(%sp) ; -32(sp) = lt
247
248 LDD -8(%sp),m_0
249 LDD -16(%sp),m1_0 ; m1 = temp1
250 ADD,L m_0,m1_0,tmp_0 ; tmp_0 = m + m1;
251 LDD -24(%sp),ht_0
252 LDD -32(%sp),lt_0
253
254 CMPCLR,*>>= tmp_0,m1_0,%r0 ; if (m < m1)
255 ADD,L ht_0,top_overflow,ht_0 ; ht += (1<<32)
256
257 EXTRD,U tmp_0,31,32,m_0 ; m>>32
258 DEPD,Z tmp_0,31,32,m1_0 ; m1 = m<<32
259
260 ADD,L ht_0,m_0,ht_0 ; ht+= (m>>32)
261 ADD lt_0,m1_0,tmp_0 ; tmp_0 = lt+m1;
262 ADD,DC ht_0,%r0,ht_0 ; ht++
263 ADD %ret0,tmp_0,lt_0 ; lt = lt + c;
264 ADD,DC ht_0,%r0,ht_0 ; ht++
265 ADD lt_0,rp_val,lt_0 ; lt = lt+rp[0]
266 ADD,DC ht_0,%r0,%ret0 ; ht++
267 STD lt_0,0(r_ptr) ; rp[0] = lt
268
269bn_mul_add_words_exit
270 .EXIT
271 LDD -80(%sp),%r9 ; restore r9
272 LDD -88(%sp),%r8 ; restore r8
273 LDD -96(%sp),%r7 ; restore r7
274 LDD -104(%sp),%r6 ; restore r6
275 LDD -112(%sp),%r5 ; restore r5
276 LDD -120(%sp),%r4 ; restore r4
277 BVE (%rp)
278 LDD,MB -128(%sp),%r3 ; restore r3
279 .PROCEND ;in=23,24,25,26,29;out=28;
280
281;----------------------------------------------------------------------------
282;
283;BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
284;
285; arg0 = rp
286; arg1 = ap
287; arg2 = num
288; arg3 = w
289
290bn_mul_words
291 .proc
292 .callinfo frame=128
293 .entry
294 .EXPORT bn_mul_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
295 .align 64
296
297 STD %r3,0(%sp) ; save r3
298 STD %r4,8(%sp) ; save r4
299 STD %r5,16(%sp) ; save r5
300 STD %r6,24(%sp) ; save r6
301
302 STD %r7,32(%sp) ; save r7
303 COPY %r0,%ret0 ; return 0 by default
304 DEPDI,Z 1,31,1,top_overflow ; top_overflow = 1 << 32
305 STD w,56(%sp) ; w on stack
306
307 CMPIB,>= 0,num,bn_mul_words_exit
308 LDO 128(%sp),%sp ; bump stack
309
310 ;
311 ; See if only 1 word to do, thus just do cleanup
312 ;
313 CMPIB,= 1,num,bn_mul_words_single_top
314 FLDD -72(%sp),fw ; load up w into fp register fw (fw_h/fw_l)
315
316 ;
317 ; This loop is unrolled 2 times (64-byte aligned as well)
318 ;
319 ; PA-RISC 2.0 chips have two fully pipelined multipliers, thus
320 ; two 32-bit mutiplies can be issued per cycle.
321 ;
322bn_mul_words_unroll2
323
324 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
325 FLDD 8(a_ptr),t_float_1 ; load up 64-bit value (fr8L) ht(L)/lt(R)
326 XMPYU fht_0,fw_l,fm1 ; m1[0] = fht_0*fw_l
327 XMPYU fht_1,fw_l,fm1_1 ; m1[1] = ht*fw_l
328
329 FSTD fm1,-16(%sp) ; -16(sp) = m1
330 FSTD fm1_1,-48(%sp) ; -48(sp) = m1
331 XMPYU flt_0,fw_h,fm ; m = lt*fw_h
332 XMPYU flt_1,fw_h,fm_1 ; m = lt*fw_h
333
334 FSTD fm,-8(%sp) ; -8(sp) = m
335 FSTD fm_1,-40(%sp) ; -40(sp) = m
336 XMPYU fht_0,fw_h,ht_temp ; ht_temp = fht_0*fw_h
337 XMPYU fht_1,fw_h,ht_temp_1 ; ht_temp = ht*fw_h
338
339 FSTD ht_temp,-24(%sp) ; -24(sp) = ht
340 FSTD ht_temp_1,-56(%sp) ; -56(sp) = ht
341 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
342 XMPYU flt_1,fw_l,lt_temp_1 ; lt_temp = lt*fw_l
343
344 FSTD lt_temp,-32(%sp) ; -32(sp) = lt
345 FSTD lt_temp_1,-64(%sp) ; -64(sp) = lt
346 LDD -8(%sp),m_0
347 LDD -40(%sp),m_1
348
349 LDD -16(%sp),m1_0
350 LDD -48(%sp),m1_1
351 LDD -24(%sp),ht_0
352 LDD -56(%sp),ht_1
353
354 ADD,L m1_0,m_0,tmp_0 ; tmp_0 = m + m1;
355 ADD,L m1_1,m_1,tmp_1 ; tmp_1 = m + m1;
356 LDD -32(%sp),lt_0
357 LDD -64(%sp),lt_1
358
359 CMPCLR,*>>= tmp_0,m1_0, %r0 ; if (m < m1)
360 ADD,L ht_0,top_overflow,ht_0 ; ht += (1<<32)
361 CMPCLR,*>>= tmp_1,m1_1,%r0 ; if (m < m1)
362 ADD,L ht_1,top_overflow,ht_1 ; ht += (1<<32)
363
364 EXTRD,U tmp_0,31,32,m_0 ; m>>32
365 DEPD,Z tmp_0,31,32,m1_0 ; m1 = m<<32
366 EXTRD,U tmp_1,31,32,m_1 ; m>>32
367 DEPD,Z tmp_1,31,32,m1_1 ; m1 = m<<32
368
369 ADD,L ht_0,m_0,ht_0 ; ht+= (m>>32)
370 ADD,L ht_1,m_1,ht_1 ; ht+= (m>>32)
371 ADD lt_0,m1_0,lt_0 ; lt = lt+m1;
372 ADD,DC ht_0,%r0,ht_0 ; ht++
373
374 ADD lt_1,m1_1,lt_1 ; lt = lt+m1;
375 ADD,DC ht_1,%r0,ht_1 ; ht++
376 ADD %ret0,lt_0,lt_0 ; lt = lt + c (ret0);
377 ADD,DC ht_0,%r0,ht_0 ; ht++
378
379 ADD ht_0,lt_1,lt_1 ; lt = lt + c (ht_0)
380 ADD,DC ht_1,%r0,ht_1 ; ht++
381 STD lt_0,0(r_ptr) ; rp[0] = lt
382 STD lt_1,8(r_ptr) ; rp[1] = lt
383
384 COPY ht_1,%ret0 ; carry = ht
385 LDO -2(num),num ; num = num - 2;
386 LDO 16(a_ptr),a_ptr ; ap += 2
387 CMPIB,<= 2,num,bn_mul_words_unroll2
388 LDO 16(r_ptr),r_ptr ; rp++
389
390 CMPIB,=,N 0,num,bn_mul_words_exit ; are we done?
391
392 ;
393 ; Top of loop aligned on 64-byte boundary
394 ;
395bn_mul_words_single_top
396 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
397
398 XMPYU fht_0,fw_l,fm1 ; m1 = ht*fw_l
399 FSTD fm1,-16(%sp) ; -16(sp) = m1
400 XMPYU flt_0,fw_h,fm ; m = lt*fw_h
401 FSTD fm,-8(%sp) ; -8(sp) = m
402 XMPYU fht_0,fw_h,ht_temp ; ht_temp = ht*fw_h
403 FSTD ht_temp,-24(%sp) ; -24(sp) = ht
404 XMPYU flt_0,fw_l,lt_temp ; lt_temp = lt*fw_l
405 FSTD lt_temp,-32(%sp) ; -32(sp) = lt
406
407 LDD -8(%sp),m_0
408 LDD -16(%sp),m1_0
409 ADD,L m_0,m1_0,tmp_0 ; tmp_0 = m + m1;
410 LDD -24(%sp),ht_0
411 LDD -32(%sp),lt_0
412
413 CMPCLR,*>>= tmp_0,m1_0,%r0 ; if (m < m1)
414 ADD,L ht_0,top_overflow,ht_0 ; ht += (1<<32)
415
416 EXTRD,U tmp_0,31,32,m_0 ; m>>32
417 DEPD,Z tmp_0,31,32,m1_0 ; m1 = m<<32
418
419 ADD,L ht_0,m_0,ht_0 ; ht+= (m>>32)
420 ADD lt_0,m1_0,lt_0 ; lt= lt+m1;
421 ADD,DC ht_0,%r0,ht_0 ; ht++
422
423 ADD %ret0,lt_0,lt_0 ; lt = lt + c;
424 ADD,DC ht_0,%r0,ht_0 ; ht++
425
426 COPY ht_0,%ret0 ; copy carry
427 STD lt_0,0(r_ptr) ; rp[0] = lt
428
429bn_mul_words_exit
430 .EXIT
431 LDD -96(%sp),%r7 ; restore r7
432 LDD -104(%sp),%r6 ; restore r6
433 LDD -112(%sp),%r5 ; restore r5
434 LDD -120(%sp),%r4 ; restore r4
435 BVE (%rp)
436 LDD,MB -128(%sp),%r3 ; restore r3
437 .PROCEND ;in=23,24,25,26,29;out=28;
438
439;----------------------------------------------------------------------------
440;
441;void bn_sqr_words(BN_ULONG *rp, BN_ULONG *ap, int num)
442;
443; arg0 = rp
444; arg1 = ap
445; arg2 = num
446;
447
448bn_sqr_words
449 .proc
450 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
451 .EXPORT bn_sqr_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
452 .entry
453 .align 64
454
455 STD %r3,0(%sp) ; save r3
456 STD %r4,8(%sp) ; save r4
457 NOP
458 STD %r5,16(%sp) ; save r5
459
460 CMPIB,>= 0,num,bn_sqr_words_exit
461 LDO 128(%sp),%sp ; bump stack
462
463 ;
464 ; If only 1, the goto straight to cleanup
465 ;
466 CMPIB,= 1,num,bn_sqr_words_single_top
467 DEPDI,Z -1,32,33,high_mask ; Create Mask 0xffffffff80000000L
468
469 ;
470 ; This loop is unrolled 2 times (64-byte aligned as well)
471 ;
472
473bn_sqr_words_unroll2
474 FLDD 0(a_ptr),t_float_0 ; a[0]
475 FLDD 8(a_ptr),t_float_1 ; a[1]
476 XMPYU fht_0,flt_0,fm ; m[0]
477 XMPYU fht_1,flt_1,fm_1 ; m[1]
478
479 FSTD fm,-24(%sp) ; store m[0]
480 FSTD fm_1,-56(%sp) ; store m[1]
481 XMPYU flt_0,flt_0,lt_temp ; lt[0]
482 XMPYU flt_1,flt_1,lt_temp_1 ; lt[1]
483
484 FSTD lt_temp,-16(%sp) ; store lt[0]
485 FSTD lt_temp_1,-48(%sp) ; store lt[1]
486 XMPYU fht_0,fht_0,ht_temp ; ht[0]
487 XMPYU fht_1,fht_1,ht_temp_1 ; ht[1]
488
489 FSTD ht_temp,-8(%sp) ; store ht[0]
490 FSTD ht_temp_1,-40(%sp) ; store ht[1]
491 LDD -24(%sp),m_0
492 LDD -56(%sp),m_1
493
494 AND m_0,high_mask,tmp_0 ; m[0] & Mask
495 AND m_1,high_mask,tmp_1 ; m[1] & Mask
496 DEPD,Z m_0,30,31,m_0 ; m[0] << 32+1
497 DEPD,Z m_1,30,31,m_1 ; m[1] << 32+1
498
499 LDD -16(%sp),lt_0
500 LDD -48(%sp),lt_1
501 EXTRD,U tmp_0,32,33,tmp_0 ; tmp_0 = m[0]&Mask >> 32-1
502 EXTRD,U tmp_1,32,33,tmp_1 ; tmp_1 = m[1]&Mask >> 32-1
503
504 LDD -8(%sp),ht_0
505 LDD -40(%sp),ht_1
506 ADD,L ht_0,tmp_0,ht_0 ; ht[0] += tmp_0
507 ADD,L ht_1,tmp_1,ht_1 ; ht[1] += tmp_1
508
509 ADD lt_0,m_0,lt_0 ; lt = lt+m
510 ADD,DC ht_0,%r0,ht_0 ; ht[0]++
511 STD lt_0,0(r_ptr) ; rp[0] = lt[0]
512 STD ht_0,8(r_ptr) ; rp[1] = ht[1]
513
514 ADD lt_1,m_1,lt_1 ; lt = lt+m
515 ADD,DC ht_1,%r0,ht_1 ; ht[1]++
516 STD lt_1,16(r_ptr) ; rp[2] = lt[1]
517 STD ht_1,24(r_ptr) ; rp[3] = ht[1]
518
519 LDO -2(num),num ; num = num - 2;
520 LDO 16(a_ptr),a_ptr ; ap += 2
521 CMPIB,<= 2,num,bn_sqr_words_unroll2
522 LDO 32(r_ptr),r_ptr ; rp += 4
523
524 CMPIB,=,N 0,num,bn_sqr_words_exit ; are we done?
525
526 ;
527 ; Top of loop aligned on 64-byte boundary
528 ;
529bn_sqr_words_single_top
530 FLDD 0(a_ptr),t_float_0 ; load up 64-bit value (fr8L) ht(L)/lt(R)
531
532 XMPYU fht_0,flt_0,fm ; m
533 FSTD fm,-24(%sp) ; store m
534
535 XMPYU flt_0,flt_0,lt_temp ; lt
536 FSTD lt_temp,-16(%sp) ; store lt
537
538 XMPYU fht_0,fht_0,ht_temp ; ht
539 FSTD ht_temp,-8(%sp) ; store ht
540
541 LDD -24(%sp),m_0 ; load m
542 AND m_0,high_mask,tmp_0 ; m & Mask
543 DEPD,Z m_0,30,31,m_0 ; m << 32+1
544 LDD -16(%sp),lt_0 ; lt
545
546 LDD -8(%sp),ht_0 ; ht
547 EXTRD,U tmp_0,32,33,tmp_0 ; tmp_0 = m&Mask >> 32-1
548 ADD m_0,lt_0,lt_0 ; lt = lt+m
549 ADD,L ht_0,tmp_0,ht_0 ; ht += tmp_0
550 ADD,DC ht_0,%r0,ht_0 ; ht++
551
552 STD lt_0,0(r_ptr) ; rp[0] = lt
553 STD ht_0,8(r_ptr) ; rp[1] = ht
554
555bn_sqr_words_exit
556 .EXIT
557 LDD -112(%sp),%r5 ; restore r5
558 LDD -120(%sp),%r4 ; restore r4
559 BVE (%rp)
560 LDD,MB -128(%sp),%r3
561 .PROCEND ;in=23,24,25,26,29;out=28;
562
563
564;----------------------------------------------------------------------------
565;
566;BN_ULONG bn_add_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
567;
568; arg0 = rp
569; arg1 = ap
570; arg2 = bp
571; arg3 = n
572
573t .reg %r22
574b .reg %r21
575l .reg %r20
576
577bn_add_words
578 .proc
579 .entry
580 .callinfo
581 .EXPORT bn_add_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
582 .align 64
583
584 CMPIB,>= 0,n,bn_add_words_exit
585 COPY %r0,%ret0 ; return 0 by default
586
587 ;
588 ; If 2 or more numbers do the loop
589 ;
590 CMPIB,= 1,n,bn_add_words_single_top
591 NOP
592
593 ;
594 ; This loop is unrolled 2 times (64-byte aligned as well)
595 ;
596bn_add_words_unroll2
597 LDD 0(a_ptr),t
598 LDD 0(b_ptr),b
599 ADD t,%ret0,t ; t = t+c;
600 ADD,DC %r0,%r0,%ret0 ; set c to carry
601 ADD t,b,l ; l = t + b[0]
602 ADD,DC %ret0,%r0,%ret0 ; c+= carry
603 STD l,0(r_ptr)
604
605 LDD 8(a_ptr),t
606 LDD 8(b_ptr),b
607 ADD t,%ret0,t ; t = t+c;
608 ADD,DC %r0,%r0,%ret0 ; set c to carry
609 ADD t,b,l ; l = t + b[0]
610 ADD,DC %ret0,%r0,%ret0 ; c+= carry
611 STD l,8(r_ptr)
612
613 LDO -2(n),n
614 LDO 16(a_ptr),a_ptr
615 LDO 16(b_ptr),b_ptr
616
617 CMPIB,<= 2,n,bn_add_words_unroll2
618 LDO 16(r_ptr),r_ptr
619
620 CMPIB,=,N 0,n,bn_add_words_exit ; are we done?
621
622bn_add_words_single_top
623 LDD 0(a_ptr),t
624 LDD 0(b_ptr),b
625
626 ADD t,%ret0,t ; t = t+c;
627 ADD,DC %r0,%r0,%ret0 ; set c to carry (could use CMPCLR??)
628 ADD t,b,l ; l = t + b[0]
629 ADD,DC %ret0,%r0,%ret0 ; c+= carry
630 STD l,0(r_ptr)
631
632bn_add_words_exit
633 .EXIT
634 BVE (%rp)
635 NOP
636 .PROCEND ;in=23,24,25,26,29;out=28;
637
638;----------------------------------------------------------------------------
639;
640;BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
641;
642; arg0 = rp
643; arg1 = ap
644; arg2 = bp
645; arg3 = n
646
647t1 .reg %r22
648t2 .reg %r21
649sub_tmp1 .reg %r20
650sub_tmp2 .reg %r19
651
652
653bn_sub_words
654 .proc
655 .callinfo
656 .EXPORT bn_sub_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
657 .entry
658 .align 64
659
660 CMPIB,>= 0,n,bn_sub_words_exit
661 COPY %r0,%ret0 ; return 0 by default
662
663 ;
664 ; If 2 or more numbers do the loop
665 ;
666 CMPIB,= 1,n,bn_sub_words_single_top
667 NOP
668
669 ;
670 ; This loop is unrolled 2 times (64-byte aligned as well)
671 ;
672bn_sub_words_unroll2
673 LDD 0(a_ptr),t1
674 LDD 0(b_ptr),t2
675 SUB t1,t2,sub_tmp1 ; t3 = t1-t2;
676 SUB sub_tmp1,%ret0,sub_tmp1 ; t3 = t3- c;
677
678 CMPCLR,*>> t1,t2,sub_tmp2 ; clear if t1 > t2
679 LDO 1(%r0),sub_tmp2
680
681 CMPCLR,*= t1,t2,%r0
682 COPY sub_tmp2,%ret0
683 STD sub_tmp1,0(r_ptr)
684
685 LDD 8(a_ptr),t1
686 LDD 8(b_ptr),t2
687 SUB t1,t2,sub_tmp1 ; t3 = t1-t2;
688 SUB sub_tmp1,%ret0,sub_tmp1 ; t3 = t3- c;
689 CMPCLR,*>> t1,t2,sub_tmp2 ; clear if t1 > t2
690 LDO 1(%r0),sub_tmp2
691
692 CMPCLR,*= t1,t2,%r0
693 COPY sub_tmp2,%ret0
694 STD sub_tmp1,8(r_ptr)
695
696 LDO -2(n),n
697 LDO 16(a_ptr),a_ptr
698 LDO 16(b_ptr),b_ptr
699
700 CMPIB,<= 2,n,bn_sub_words_unroll2
701 LDO 16(r_ptr),r_ptr
702
703 CMPIB,=,N 0,n,bn_sub_words_exit ; are we done?
704
705bn_sub_words_single_top
706 LDD 0(a_ptr),t1
707 LDD 0(b_ptr),t2
708 SUB t1,t2,sub_tmp1 ; t3 = t1-t2;
709 SUB sub_tmp1,%ret0,sub_tmp1 ; t3 = t3- c;
710 CMPCLR,*>> t1,t2,sub_tmp2 ; clear if t1 > t2
711 LDO 1(%r0),sub_tmp2
712
713 CMPCLR,*= t1,t2,%r0
714 COPY sub_tmp2,%ret0
715
716 STD sub_tmp1,0(r_ptr)
717
718bn_sub_words_exit
719 .EXIT
720 BVE (%rp)
721 NOP
722 .PROCEND ;in=23,24,25,26,29;out=28;
723
724;------------------------------------------------------------------------------
725;
726; unsigned long bn_div_words(unsigned long h, unsigned long l, unsigned long d)
727;
728; arg0 = h
729; arg1 = l
730; arg2 = d
731;
732; This is mainly just modified assembly from the compiler, thus the
733; lack of variable names.
734;
735;------------------------------------------------------------------------------
736bn_div_words
737 .proc
738 .callinfo CALLER,FRAME=272,ENTRY_GR=%r10,SAVE_RP,ARGS_SAVED,ORDERING_AWARE
739 .EXPORT bn_div_words,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
740 .IMPORT BN_num_bits_word,CODE,NO_RELOCATION
741 .IMPORT __iob,DATA
742 .IMPORT fprintf,CODE,NO_RELOCATION
743 .IMPORT abort,CODE,NO_RELOCATION
744 .IMPORT $$div2U,MILLICODE
745 .entry
746 STD %r2,-16(%r30)
747 STD,MA %r3,352(%r30)
748 STD %r4,-344(%r30)
749 STD %r5,-336(%r30)
750 STD %r6,-328(%r30)
751 STD %r7,-320(%r30)
752 STD %r8,-312(%r30)
753 STD %r9,-304(%r30)
754 STD %r10,-296(%r30)
755
756 STD %r27,-288(%r30) ; save gp
757
758 COPY %r24,%r3 ; save d
759 COPY %r26,%r4 ; save h (high 64-bits)
760 LDO -1(%r0),%ret0 ; return -1 by default
761
762 CMPB,*= %r0,%arg2,$D3 ; if (d == 0)
763 COPY %r25,%r5 ; save l (low 64-bits)
764
765 LDO -48(%r30),%r29 ; create ap
766 .CALL ;in=26,29;out=28;
767 B,L BN_num_bits_word,%r2
768 COPY %r3,%r26
769 LDD -288(%r30),%r27 ; restore gp
770 LDI 64,%r21
771
772 CMPB,= %r21,%ret0,$00000012 ;if (i == 64) (forward)
773 COPY %ret0,%r24 ; i
774 MTSARCM %r24
775 DEPDI,Z -1,%sar,1,%r29
776 CMPB,*<<,N %r29,%r4,bn_div_err_case ; if (h > 1<<i) (forward)
777
778$00000012
779 SUBI 64,%r24,%r31 ; i = 64 - i;
780 CMPCLR,*<< %r4,%r3,%r0 ; if (h >= d)
781 SUB %r4,%r3,%r4 ; h -= d
782 CMPB,= %r31,%r0,$0000001A ; if (i)
783 COPY %r0,%r10 ; ret = 0
784 MTSARCM %r31 ; i to shift
785 DEPD,Z %r3,%sar,64,%r3 ; d <<= i;
786 SUBI 64,%r31,%r19 ; 64 - i; redundent
787 MTSAR %r19 ; (64 -i) to shift
788 SHRPD %r4,%r5,%sar,%r4 ; l>> (64-i)
789 MTSARCM %r31 ; i to shift
790 DEPD,Z %r5,%sar,64,%r5 ; l <<= i;
791
792$0000001A
793 DEPDI,Z -1,31,32,%r19
794 EXTRD,U %r3,31,32,%r6 ; dh=(d&0xfff)>>32
795 EXTRD,U %r3,63,32,%r8 ; dl = d&0xffffff
796 LDO 2(%r0),%r9
797 STD %r3,-280(%r30) ; "d" to stack
798
799$0000001C
800 DEPDI,Z -1,63,32,%r29 ;
801 EXTRD,U %r4,31,32,%r31 ; h >> 32
802 CMPB,*=,N %r31,%r6,$D2 ; if ((h>>32) != dh)(forward) div
803 COPY %r4,%r26
804 EXTRD,U %r4,31,32,%r25
805 COPY %r6,%r24
806 .CALL ;in=23,24,25,26;out=20,21,22,28,29; (MILLICALL)
807 B,L $$div2U,%r2
808 EXTRD,U %r6,31,32,%r23
809 DEPD %r28,31,32,%r29
810$D2
811 STD %r29,-272(%r30) ; q
812 AND %r5,%r19,%r24 ; t & 0xffffffff00000000;
813 EXTRD,U %r24,31,32,%r24 ; ???
814 FLDD -272(%r30),%fr7 ; q
815 FLDD -280(%r30),%fr8 ; d
816 XMPYU %fr8L,%fr7L,%fr10
817 FSTD %fr10,-256(%r30)
818 XMPYU %fr8L,%fr7R,%fr22
819 FSTD %fr22,-264(%r30)
820 XMPYU %fr8R,%fr7L,%fr11
821 XMPYU %fr8R,%fr7R,%fr23
822 FSTD %fr11,-232(%r30)
823 FSTD %fr23,-240(%r30)
824 LDD -256(%r30),%r28
825 DEPD,Z %r28,31,32,%r2
826 LDD -264(%r30),%r20
827 ADD,L %r20,%r2,%r31
828 LDD -232(%r30),%r22
829 DEPD,Z %r22,31,32,%r22
830 LDD -240(%r30),%r21
831 B $00000024 ; enter loop
832 ADD,L %r21,%r22,%r23
833
834$0000002A
835 LDO -1(%r29),%r29
836 SUB %r23,%r8,%r23
837$00000024
838 SUB %r4,%r31,%r25
839 AND %r25,%r19,%r26
840 CMPB,*<>,N %r0,%r26,$00000046 ; (forward)
841 DEPD,Z %r25,31,32,%r20
842 OR %r20,%r24,%r21
843 CMPB,*<<,N %r21,%r23,$0000002A ;(backward)
844 SUB %r31,%r6,%r31
845;-------------Break path---------------------
846
847$00000046
848 DEPD,Z %r23,31,32,%r25 ;tl
849 EXTRD,U %r23,31,32,%r26 ;t
850 AND %r25,%r19,%r24 ;tl = (tl<<32)&0xfffffff0000000L
851 ADD,L %r31,%r26,%r31 ;th += t;
852 CMPCLR,*>>= %r5,%r24,%r0 ;if (l<tl)
853 LDO 1(%r31),%r31 ; th++;
854 CMPB,*<<=,N %r31,%r4,$00000036 ;if (n < th) (forward)
855 LDO -1(%r29),%r29 ;q--;
856 ADD,L %r4,%r3,%r4 ;h += d;
857$00000036
858 ADDIB,=,N -1,%r9,$D1 ;if (--count == 0) break (forward)
859 SUB %r5,%r24,%r28 ; l -= tl;
860 SUB %r4,%r31,%r24 ; h -= th;
861 SHRPD %r24,%r28,32,%r4 ; h = ((h<<32)|(l>>32));
862 DEPD,Z %r29,31,32,%r10 ; ret = q<<32
863 b $0000001C
864 DEPD,Z %r28,31,32,%r5 ; l = l << 32
865
866$D1
867 OR %r10,%r29,%r28 ; ret |= q
868$D3
869 LDD -368(%r30),%r2
870$D0
871 LDD -296(%r30),%r10
872 LDD -304(%r30),%r9
873 LDD -312(%r30),%r8
874 LDD -320(%r30),%r7
875 LDD -328(%r30),%r6
876 LDD -336(%r30),%r5
877 LDD -344(%r30),%r4
878 BVE (%r2)
879 .EXIT
880 LDD,MB -352(%r30),%r3
881
882bn_div_err_case
883 MFIA %r6
884 ADDIL L'bn_div_words-bn_div_err_case,%r6,%r1
885 LDO R'bn_div_words-bn_div_err_case(%r1),%r6
886 ADDIL LT'__iob,%r27,%r1
887 LDD RT'__iob(%r1),%r26
888 ADDIL L'C$4-bn_div_words,%r6,%r1
889 LDO R'C$4-bn_div_words(%r1),%r25
890 LDO 64(%r26),%r26
891 .CALL ;in=24,25,26,29;out=28;
892 B,L fprintf,%r2
893 LDO -48(%r30),%r29
894 LDD -288(%r30),%r27
895 .CALL ;in=29;
896 B,L abort,%r2
897 LDO -48(%r30),%r29
898 LDD -288(%r30),%r27
899 B $D0
900 LDD -368(%r30),%r2
901 .PROCEND ;in=24,25,26,29;out=28;
902
903;----------------------------------------------------------------------------
904;
905; Registers to hold 64-bit values to manipulate. The "L" part
906; of the register corresponds to the upper 32-bits, while the "R"
907; part corresponds to the lower 32-bits
908;
909; Note, that when using b6 and b7, the code must save these before
910; using them because they are callee save registers
911;
912;
913; Floating point registers to use to save values that
914; are manipulated. These don't collide with ftemp1-6 and
915; are all caller save registers
916;
917a0 .reg %fr22
918a0L .reg %fr22L
919a0R .reg %fr22R
920
921a1 .reg %fr23
922a1L .reg %fr23L
923a1R .reg %fr23R
924
925a2 .reg %fr24
926a2L .reg %fr24L
927a2R .reg %fr24R
928
929a3 .reg %fr25
930a3L .reg %fr25L
931a3R .reg %fr25R
932
933a4 .reg %fr26
934a4L .reg %fr26L
935a4R .reg %fr26R
936
937a5 .reg %fr27
938a5L .reg %fr27L
939a5R .reg %fr27R
940
941a6 .reg %fr28
942a6L .reg %fr28L
943a6R .reg %fr28R
944
945a7 .reg %fr29
946a7L .reg %fr29L
947a7R .reg %fr29R
948
949b0 .reg %fr30
950b0L .reg %fr30L
951b0R .reg %fr30R
952
953b1 .reg %fr31
954b1L .reg %fr31L
955b1R .reg %fr31R
956
957;
958; Temporary floating point variables, these are all caller save
959; registers
960;
961ftemp1 .reg %fr4
962ftemp2 .reg %fr5
963ftemp3 .reg %fr6
964ftemp4 .reg %fr7
965
966;
967; The B set of registers when used.
968;
969
970b2 .reg %fr8
971b2L .reg %fr8L
972b2R .reg %fr8R
973
974b3 .reg %fr9
975b3L .reg %fr9L
976b3R .reg %fr9R
977
978b4 .reg %fr10
979b4L .reg %fr10L
980b4R .reg %fr10R
981
982b5 .reg %fr11
983b5L .reg %fr11L
984b5R .reg %fr11R
985
986b6 .reg %fr12
987b6L .reg %fr12L
988b6R .reg %fr12R
989
990b7 .reg %fr13
991b7L .reg %fr13L
992b7R .reg %fr13R
993
994c1 .reg %r21 ; only reg
995temp1 .reg %r20 ; only reg
996temp2 .reg %r19 ; only reg
997temp3 .reg %r31 ; only reg
998
999m1 .reg %r28
1000c2 .reg %r23
1001high_one .reg %r1
1002ht .reg %r6
1003lt .reg %r5
1004m .reg %r4
1005c3 .reg %r3
1006
1007SQR_ADD_C .macro A0L,A0R,C1,C2,C3
1008 XMPYU A0L,A0R,ftemp1 ; m
1009 FSTD ftemp1,-24(%sp) ; store m
1010
1011 XMPYU A0R,A0R,ftemp2 ; lt
1012 FSTD ftemp2,-16(%sp) ; store lt
1013
1014 XMPYU A0L,A0L,ftemp3 ; ht
1015 FSTD ftemp3,-8(%sp) ; store ht
1016
1017 LDD -24(%sp),m ; load m
1018 AND m,high_mask,temp2 ; m & Mask
1019 DEPD,Z m,30,31,temp3 ; m << 32+1
1020 LDD -16(%sp),lt ; lt
1021
1022 LDD -8(%sp),ht ; ht
1023 EXTRD,U temp2,32,33,temp1 ; temp1 = m&Mask >> 32-1
1024 ADD temp3,lt,lt ; lt = lt+m
1025 ADD,L ht,temp1,ht ; ht += temp1
1026 ADD,DC ht,%r0,ht ; ht++
1027
1028 ADD C1,lt,C1 ; c1=c1+lt
1029 ADD,DC ht,%r0,ht ; ht++
1030
1031 ADD C2,ht,C2 ; c2=c2+ht
1032 ADD,DC C3,%r0,C3 ; c3++
1033.endm
1034
1035SQR_ADD_C2 .macro A0L,A0R,A1L,A1R,C1,C2,C3
1036 XMPYU A0L,A1R,ftemp1 ; m1 = bl*ht
1037 FSTD ftemp1,-16(%sp) ;
1038 XMPYU A0R,A1L,ftemp2 ; m = bh*lt
1039 FSTD ftemp2,-8(%sp) ;
1040 XMPYU A0R,A1R,ftemp3 ; lt = bl*lt
1041 FSTD ftemp3,-32(%sp)
1042 XMPYU A0L,A1L,ftemp4 ; ht = bh*ht
1043 FSTD ftemp4,-24(%sp) ;
1044
1045 LDD -8(%sp),m ; r21 = m
1046 LDD -16(%sp),m1 ; r19 = m1
1047 ADD,L m,m1,m ; m+m1
1048
1049 DEPD,Z m,31,32,temp3 ; (m+m1<<32)
1050 LDD -24(%sp),ht ; r24 = ht
1051
1052 CMPCLR,*>>= m,m1,%r0 ; if (m < m1)
1053 ADD,L ht,high_one,ht ; ht+=high_one
1054
1055 EXTRD,U m,31,32,temp1 ; m >> 32
1056 LDD -32(%sp),lt ; lt
1057 ADD,L ht,temp1,ht ; ht+= m>>32
1058 ADD lt,temp3,lt ; lt = lt+m1
1059 ADD,DC ht,%r0,ht ; ht++
1060
1061 ADD ht,ht,ht ; ht=ht+ht;
1062 ADD,DC C3,%r0,C3 ; add in carry (c3++)
1063
1064 ADD lt,lt,lt ; lt=lt+lt;
1065 ADD,DC ht,%r0,ht ; add in carry (ht++)
1066
1067 ADD C1,lt,C1 ; c1=c1+lt
1068 ADD,DC,*NUV ht,%r0,ht ; add in carry (ht++)
1069 LDO 1(C3),C3 ; bump c3 if overflow,nullify otherwise
1070
1071 ADD C2,ht,C2 ; c2 = c2 + ht
1072 ADD,DC C3,%r0,C3 ; add in carry (c3++)
1073.endm
1074
1075;
1076;void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
1077; arg0 = r_ptr
1078; arg1 = a_ptr
1079;
1080
1081bn_sqr_comba8
1082 .PROC
1083 .CALLINFO FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
1084 .EXPORT bn_sqr_comba8,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
1085 .ENTRY
1086 .align 64
1087
1088 STD %r3,0(%sp) ; save r3
1089 STD %r4,8(%sp) ; save r4
1090 STD %r5,16(%sp) ; save r5
1091 STD %r6,24(%sp) ; save r6
1092
1093 ;
1094 ; Zero out carries
1095 ;
1096 COPY %r0,c1
1097 COPY %r0,c2
1098 COPY %r0,c3
1099
1100 LDO 128(%sp),%sp ; bump stack
1101 DEPDI,Z -1,32,33,high_mask ; Create Mask 0xffffffff80000000L
1102 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1103
1104 ;
1105 ; Load up all of the values we are going to use
1106 ;
1107 FLDD 0(a_ptr),a0
1108 FLDD 8(a_ptr),a1
1109 FLDD 16(a_ptr),a2
1110 FLDD 24(a_ptr),a3
1111 FLDD 32(a_ptr),a4
1112 FLDD 40(a_ptr),a5
1113 FLDD 48(a_ptr),a6
1114 FLDD 56(a_ptr),a7
1115
1116 SQR_ADD_C a0L,a0R,c1,c2,c3
1117 STD c1,0(r_ptr) ; r[0] = c1;
1118 COPY %r0,c1
1119
1120 SQR_ADD_C2 a1L,a1R,a0L,a0R,c2,c3,c1
1121 STD c2,8(r_ptr) ; r[1] = c2;
1122 COPY %r0,c2
1123
1124 SQR_ADD_C a1L,a1R,c3,c1,c2
1125 SQR_ADD_C2 a2L,a2R,a0L,a0R,c3,c1,c2
1126 STD c3,16(r_ptr) ; r[2] = c3;
1127 COPY %r0,c3
1128
1129 SQR_ADD_C2 a3L,a3R,a0L,a0R,c1,c2,c3
1130 SQR_ADD_C2 a2L,a2R,a1L,a1R,c1,c2,c3
1131 STD c1,24(r_ptr) ; r[3] = c1;
1132 COPY %r0,c1
1133
1134 SQR_ADD_C a2L,a2R,c2,c3,c1
1135 SQR_ADD_C2 a3L,a3R,a1L,a1R,c2,c3,c1
1136 SQR_ADD_C2 a4L,a4R,a0L,a0R,c2,c3,c1
1137 STD c2,32(r_ptr) ; r[4] = c2;
1138 COPY %r0,c2
1139
1140 SQR_ADD_C2 a5L,a5R,a0L,a0R,c3,c1,c2
1141 SQR_ADD_C2 a4L,a4R,a1L,a1R,c3,c1,c2
1142 SQR_ADD_C2 a3L,a3R,a2L,a2R,c3,c1,c2
1143 STD c3,40(r_ptr) ; r[5] = c3;
1144 COPY %r0,c3
1145
1146 SQR_ADD_C a3L,a3R,c1,c2,c3
1147 SQR_ADD_C2 a4L,a4R,a2L,a2R,c1,c2,c3
1148 SQR_ADD_C2 a5L,a5R,a1L,a1R,c1,c2,c3
1149 SQR_ADD_C2 a6L,a6R,a0L,a0R,c1,c2,c3
1150 STD c1,48(r_ptr) ; r[6] = c1;
1151 COPY %r0,c1
1152
1153 SQR_ADD_C2 a7L,a7R,a0L,a0R,c2,c3,c1
1154 SQR_ADD_C2 a6L,a6R,a1L,a1R,c2,c3,c1
1155 SQR_ADD_C2 a5L,a5R,a2L,a2R,c2,c3,c1
1156 SQR_ADD_C2 a4L,a4R,a3L,a3R,c2,c3,c1
1157 STD c2,56(r_ptr) ; r[7] = c2;
1158 COPY %r0,c2
1159
1160 SQR_ADD_C a4L,a4R,c3,c1,c2
1161 SQR_ADD_C2 a5L,a5R,a3L,a3R,c3,c1,c2
1162 SQR_ADD_C2 a6L,a6R,a2L,a2R,c3,c1,c2
1163 SQR_ADD_C2 a7L,a7R,a1L,a1R,c3,c1,c2
1164 STD c3,64(r_ptr) ; r[8] = c3;
1165 COPY %r0,c3
1166
1167 SQR_ADD_C2 a7L,a7R,a2L,a2R,c1,c2,c3
1168 SQR_ADD_C2 a6L,a6R,a3L,a3R,c1,c2,c3
1169 SQR_ADD_C2 a5L,a5R,a4L,a4R,c1,c2,c3
1170 STD c1,72(r_ptr) ; r[9] = c1;
1171 COPY %r0,c1
1172
1173 SQR_ADD_C a5L,a5R,c2,c3,c1
1174 SQR_ADD_C2 a6L,a6R,a4L,a4R,c2,c3,c1
1175 SQR_ADD_C2 a7L,a7R,a3L,a3R,c2,c3,c1
1176 STD c2,80(r_ptr) ; r[10] = c2;
1177 COPY %r0,c2
1178
1179 SQR_ADD_C2 a7L,a7R,a4L,a4R,c3,c1,c2
1180 SQR_ADD_C2 a6L,a6R,a5L,a5R,c3,c1,c2
1181 STD c3,88(r_ptr) ; r[11] = c3;
1182 COPY %r0,c3
1183
1184 SQR_ADD_C a6L,a6R,c1,c2,c3
1185 SQR_ADD_C2 a7L,a7R,a5L,a5R,c1,c2,c3
1186 STD c1,96(r_ptr) ; r[12] = c1;
1187 COPY %r0,c1
1188
1189 SQR_ADD_C2 a7L,a7R,a6L,a6R,c2,c3,c1
1190 STD c2,104(r_ptr) ; r[13] = c2;
1191 COPY %r0,c2
1192
1193 SQR_ADD_C a7L,a7R,c3,c1,c2
1194 STD c3, 112(r_ptr) ; r[14] = c3
1195 STD c1, 120(r_ptr) ; r[15] = c1
1196
1197 .EXIT
1198 LDD -104(%sp),%r6 ; restore r6
1199 LDD -112(%sp),%r5 ; restore r5
1200 LDD -120(%sp),%r4 ; restore r4
1201 BVE (%rp)
1202 LDD,MB -128(%sp),%r3
1203
1204 .PROCEND
1205
1206;-----------------------------------------------------------------------------
1207;
1208;void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
1209; arg0 = r_ptr
1210; arg1 = a_ptr
1211;
1212
1213bn_sqr_comba4
1214 .proc
1215 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
1216 .EXPORT bn_sqr_comba4,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
1217 .entry
1218 .align 64
1219 STD %r3,0(%sp) ; save r3
1220 STD %r4,8(%sp) ; save r4
1221 STD %r5,16(%sp) ; save r5
1222 STD %r6,24(%sp) ; save r6
1223
1224 ;
1225 ; Zero out carries
1226 ;
1227 COPY %r0,c1
1228 COPY %r0,c2
1229 COPY %r0,c3
1230
1231 LDO 128(%sp),%sp ; bump stack
1232 DEPDI,Z -1,32,33,high_mask ; Create Mask 0xffffffff80000000L
1233 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1234
1235 ;
1236 ; Load up all of the values we are going to use
1237 ;
1238 FLDD 0(a_ptr),a0
1239 FLDD 8(a_ptr),a1
1240 FLDD 16(a_ptr),a2
1241 FLDD 24(a_ptr),a3
1242 FLDD 32(a_ptr),a4
1243 FLDD 40(a_ptr),a5
1244 FLDD 48(a_ptr),a6
1245 FLDD 56(a_ptr),a7
1246
1247 SQR_ADD_C a0L,a0R,c1,c2,c3
1248
1249 STD c1,0(r_ptr) ; r[0] = c1;
1250 COPY %r0,c1
1251
1252 SQR_ADD_C2 a1L,a1R,a0L,a0R,c2,c3,c1
1253
1254 STD c2,8(r_ptr) ; r[1] = c2;
1255 COPY %r0,c2
1256
1257 SQR_ADD_C a1L,a1R,c3,c1,c2
1258 SQR_ADD_C2 a2L,a2R,a0L,a0R,c3,c1,c2
1259
1260 STD c3,16(r_ptr) ; r[2] = c3;
1261 COPY %r0,c3
1262
1263 SQR_ADD_C2 a3L,a3R,a0L,a0R,c1,c2,c3
1264 SQR_ADD_C2 a2L,a2R,a1L,a1R,c1,c2,c3
1265
1266 STD c1,24(r_ptr) ; r[3] = c1;
1267 COPY %r0,c1
1268
1269 SQR_ADD_C a2L,a2R,c2,c3,c1
1270 SQR_ADD_C2 a3L,a3R,a1L,a1R,c2,c3,c1
1271
1272 STD c2,32(r_ptr) ; r[4] = c2;
1273 COPY %r0,c2
1274
1275 SQR_ADD_C2 a3L,a3R,a2L,a2R,c3,c1,c2
1276 STD c3,40(r_ptr) ; r[5] = c3;
1277 COPY %r0,c3
1278
1279 SQR_ADD_C a3L,a3R,c1,c2,c3
1280 STD c1,48(r_ptr) ; r[6] = c1;
1281 STD c2,56(r_ptr) ; r[7] = c2;
1282
1283 .EXIT
1284 LDD -104(%sp),%r6 ; restore r6
1285 LDD -112(%sp),%r5 ; restore r5
1286 LDD -120(%sp),%r4 ; restore r4
1287 BVE (%rp)
1288 LDD,MB -128(%sp),%r3
1289
1290 .PROCEND
1291
1292
1293;---------------------------------------------------------------------------
1294
1295MUL_ADD_C .macro A0L,A0R,B0L,B0R,C1,C2,C3
1296 XMPYU A0L,B0R,ftemp1 ; m1 = bl*ht
1297 FSTD ftemp1,-16(%sp) ;
1298 XMPYU A0R,B0L,ftemp2 ; m = bh*lt
1299 FSTD ftemp2,-8(%sp) ;
1300 XMPYU A0R,B0R,ftemp3 ; lt = bl*lt
1301 FSTD ftemp3,-32(%sp)
1302 XMPYU A0L,B0L,ftemp4 ; ht = bh*ht
1303 FSTD ftemp4,-24(%sp) ;
1304
1305 LDD -8(%sp),m ; r21 = m
1306 LDD -16(%sp),m1 ; r19 = m1
1307 ADD,L m,m1,m ; m+m1
1308
1309 DEPD,Z m,31,32,temp3 ; (m+m1<<32)
1310 LDD -24(%sp),ht ; r24 = ht
1311
1312 CMPCLR,*>>= m,m1,%r0 ; if (m < m1)
1313 ADD,L ht,high_one,ht ; ht+=high_one
1314
1315 EXTRD,U m,31,32,temp1 ; m >> 32
1316 LDD -32(%sp),lt ; lt
1317 ADD,L ht,temp1,ht ; ht+= m>>32
1318 ADD lt,temp3,lt ; lt = lt+m1
1319 ADD,DC ht,%r0,ht ; ht++
1320
1321 ADD C1,lt,C1 ; c1=c1+lt
1322 ADD,DC ht,%r0,ht ; bump c3 if overflow,nullify otherwise
1323
1324 ADD C2,ht,C2 ; c2 = c2 + ht
1325 ADD,DC C3,%r0,C3 ; add in carry (c3++)
1326.endm
1327
1328
1329;
1330;void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
1331; arg0 = r_ptr
1332; arg1 = a_ptr
1333; arg2 = b_ptr
1334;
1335
1336bn_mul_comba8
1337 .proc
1338 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
1339 .EXPORT bn_mul_comba8,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
1340 .entry
1341 .align 64
1342
1343 STD %r3,0(%sp) ; save r3
1344 STD %r4,8(%sp) ; save r4
1345 STD %r5,16(%sp) ; save r5
1346 STD %r6,24(%sp) ; save r6
1347 FSTD %fr12,32(%sp) ; save r6
1348 FSTD %fr13,40(%sp) ; save r7
1349
1350 ;
1351 ; Zero out carries
1352 ;
1353 COPY %r0,c1
1354 COPY %r0,c2
1355 COPY %r0,c3
1356
1357 LDO 128(%sp),%sp ; bump stack
1358 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1359
1360 ;
1361 ; Load up all of the values we are going to use
1362 ;
1363 FLDD 0(a_ptr),a0
1364 FLDD 8(a_ptr),a1
1365 FLDD 16(a_ptr),a2
1366 FLDD 24(a_ptr),a3
1367 FLDD 32(a_ptr),a4
1368 FLDD 40(a_ptr),a5
1369 FLDD 48(a_ptr),a6
1370 FLDD 56(a_ptr),a7
1371
1372 FLDD 0(b_ptr),b0
1373 FLDD 8(b_ptr),b1
1374 FLDD 16(b_ptr),b2
1375 FLDD 24(b_ptr),b3
1376 FLDD 32(b_ptr),b4
1377 FLDD 40(b_ptr),b5
1378 FLDD 48(b_ptr),b6
1379 FLDD 56(b_ptr),b7
1380
1381 MUL_ADD_C a0L,a0R,b0L,b0R,c1,c2,c3
1382 STD c1,0(r_ptr)
1383 COPY %r0,c1
1384
1385 MUL_ADD_C a0L,a0R,b1L,b1R,c2,c3,c1
1386 MUL_ADD_C a1L,a1R,b0L,b0R,c2,c3,c1
1387 STD c2,8(r_ptr)
1388 COPY %r0,c2
1389
1390 MUL_ADD_C a2L,a2R,b0L,b0R,c3,c1,c2
1391 MUL_ADD_C a1L,a1R,b1L,b1R,c3,c1,c2
1392 MUL_ADD_C a0L,a0R,b2L,b2R,c3,c1,c2
1393 STD c3,16(r_ptr)
1394 COPY %r0,c3
1395
1396 MUL_ADD_C a0L,a0R,b3L,b3R,c1,c2,c3
1397 MUL_ADD_C a1L,a1R,b2L,b2R,c1,c2,c3
1398 MUL_ADD_C a2L,a2R,b1L,b1R,c1,c2,c3
1399 MUL_ADD_C a3L,a3R,b0L,b0R,c1,c2,c3
1400 STD c1,24(r_ptr)
1401 COPY %r0,c1
1402
1403 MUL_ADD_C a4L,a4R,b0L,b0R,c2,c3,c1
1404 MUL_ADD_C a3L,a3R,b1L,b1R,c2,c3,c1
1405 MUL_ADD_C a2L,a2R,b2L,b2R,c2,c3,c1
1406 MUL_ADD_C a1L,a1R,b3L,b3R,c2,c3,c1
1407 MUL_ADD_C a0L,a0R,b4L,b4R,c2,c3,c1
1408 STD c2,32(r_ptr)
1409 COPY %r0,c2
1410
1411 MUL_ADD_C a0L,a0R,b5L,b5R,c3,c1,c2
1412 MUL_ADD_C a1L,a1R,b4L,b4R,c3,c1,c2
1413 MUL_ADD_C a2L,a2R,b3L,b3R,c3,c1,c2
1414 MUL_ADD_C a3L,a3R,b2L,b2R,c3,c1,c2
1415 MUL_ADD_C a4L,a4R,b1L,b1R,c3,c1,c2
1416 MUL_ADD_C a5L,a5R,b0L,b0R,c3,c1,c2
1417 STD c3,40(r_ptr)
1418 COPY %r0,c3
1419
1420 MUL_ADD_C a6L,a6R,b0L,b0R,c1,c2,c3
1421 MUL_ADD_C a5L,a5R,b1L,b1R,c1,c2,c3
1422 MUL_ADD_C a4L,a4R,b2L,b2R,c1,c2,c3
1423 MUL_ADD_C a3L,a3R,b3L,b3R,c1,c2,c3
1424 MUL_ADD_C a2L,a2R,b4L,b4R,c1,c2,c3
1425 MUL_ADD_C a1L,a1R,b5L,b5R,c1,c2,c3
1426 MUL_ADD_C a0L,a0R,b6L,b6R,c1,c2,c3
1427 STD c1,48(r_ptr)
1428 COPY %r0,c1
1429
1430 MUL_ADD_C a0L,a0R,b7L,b7R,c2,c3,c1
1431 MUL_ADD_C a1L,a1R,b6L,b6R,c2,c3,c1
1432 MUL_ADD_C a2L,a2R,b5L,b5R,c2,c3,c1
1433 MUL_ADD_C a3L,a3R,b4L,b4R,c2,c3,c1
1434 MUL_ADD_C a4L,a4R,b3L,b3R,c2,c3,c1
1435 MUL_ADD_C a5L,a5R,b2L,b2R,c2,c3,c1
1436 MUL_ADD_C a6L,a6R,b1L,b1R,c2,c3,c1
1437 MUL_ADD_C a7L,a7R,b0L,b0R,c2,c3,c1
1438 STD c2,56(r_ptr)
1439 COPY %r0,c2
1440
1441 MUL_ADD_C a7L,a7R,b1L,b1R,c3,c1,c2
1442 MUL_ADD_C a6L,a6R,b2L,b2R,c3,c1,c2
1443 MUL_ADD_C a5L,a5R,b3L,b3R,c3,c1,c2
1444 MUL_ADD_C a4L,a4R,b4L,b4R,c3,c1,c2
1445 MUL_ADD_C a3L,a3R,b5L,b5R,c3,c1,c2
1446 MUL_ADD_C a2L,a2R,b6L,b6R,c3,c1,c2
1447 MUL_ADD_C a1L,a1R,b7L,b7R,c3,c1,c2
1448 STD c3,64(r_ptr)
1449 COPY %r0,c3
1450
1451 MUL_ADD_C a2L,a2R,b7L,b7R,c1,c2,c3
1452 MUL_ADD_C a3L,a3R,b6L,b6R,c1,c2,c3
1453 MUL_ADD_C a4L,a4R,b5L,b5R,c1,c2,c3
1454 MUL_ADD_C a5L,a5R,b4L,b4R,c1,c2,c3
1455 MUL_ADD_C a6L,a6R,b3L,b3R,c1,c2,c3
1456 MUL_ADD_C a7L,a7R,b2L,b2R,c1,c2,c3
1457 STD c1,72(r_ptr)
1458 COPY %r0,c1
1459
1460 MUL_ADD_C a7L,a7R,b3L,b3R,c2,c3,c1
1461 MUL_ADD_C a6L,a6R,b4L,b4R,c2,c3,c1
1462 MUL_ADD_C a5L,a5R,b5L,b5R,c2,c3,c1
1463 MUL_ADD_C a4L,a4R,b6L,b6R,c2,c3,c1
1464 MUL_ADD_C a3L,a3R,b7L,b7R,c2,c3,c1
1465 STD c2,80(r_ptr)
1466 COPY %r0,c2
1467
1468 MUL_ADD_C a4L,a4R,b7L,b7R,c3,c1,c2
1469 MUL_ADD_C a5L,a5R,b6L,b6R,c3,c1,c2
1470 MUL_ADD_C a6L,a6R,b5L,b5R,c3,c1,c2
1471 MUL_ADD_C a7L,a7R,b4L,b4R,c3,c1,c2
1472 STD c3,88(r_ptr)
1473 COPY %r0,c3
1474
1475 MUL_ADD_C a7L,a7R,b5L,b5R,c1,c2,c3
1476 MUL_ADD_C a6L,a6R,b6L,b6R,c1,c2,c3
1477 MUL_ADD_C a5L,a5R,b7L,b7R,c1,c2,c3
1478 STD c1,96(r_ptr)
1479 COPY %r0,c1
1480
1481 MUL_ADD_C a6L,a6R,b7L,b7R,c2,c3,c1
1482 MUL_ADD_C a7L,a7R,b6L,b6R,c2,c3,c1
1483 STD c2,104(r_ptr)
1484 COPY %r0,c2
1485
1486 MUL_ADD_C a7L,a7R,b7L,b7R,c3,c1,c2
1487 STD c3,112(r_ptr)
1488 STD c1,120(r_ptr)
1489
1490 .EXIT
1491 FLDD -88(%sp),%fr13
1492 FLDD -96(%sp),%fr12
1493 LDD -104(%sp),%r6 ; restore r6
1494 LDD -112(%sp),%r5 ; restore r5
1495 LDD -120(%sp),%r4 ; restore r4
1496 BVE (%rp)
1497 LDD,MB -128(%sp),%r3
1498
1499 .PROCEND
1500
1501;-----------------------------------------------------------------------------
1502;
1503;void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
1504; arg0 = r_ptr
1505; arg1 = a_ptr
1506; arg2 = b_ptr
1507;
1508
1509bn_mul_comba4
1510 .proc
1511 .callinfo FRAME=128,ENTRY_GR=%r3,ARGS_SAVED,ORDERING_AWARE
1512 .EXPORT bn_mul_comba4,ENTRY,PRIV_LEV=3,NO_RELOCATION,LONG_RETURN
1513 .entry
1514 .align 64
1515
1516 STD %r3,0(%sp) ; save r3
1517 STD %r4,8(%sp) ; save r4
1518 STD %r5,16(%sp) ; save r5
1519 STD %r6,24(%sp) ; save r6
1520 FSTD %fr12,32(%sp) ; save r6
1521 FSTD %fr13,40(%sp) ; save r7
1522
1523 ;
1524 ; Zero out carries
1525 ;
1526 COPY %r0,c1
1527 COPY %r0,c2
1528 COPY %r0,c3
1529
1530 LDO 128(%sp),%sp ; bump stack
1531 DEPDI,Z 1,31,1,high_one ; Create Value 1 << 32
1532
1533 ;
1534 ; Load up all of the values we are going to use
1535 ;
1536 FLDD 0(a_ptr),a0
1537 FLDD 8(a_ptr),a1
1538 FLDD 16(a_ptr),a2
1539 FLDD 24(a_ptr),a3
1540
1541 FLDD 0(b_ptr),b0
1542 FLDD 8(b_ptr),b1
1543 FLDD 16(b_ptr),b2
1544 FLDD 24(b_ptr),b3
1545
1546 MUL_ADD_C a0L,a0R,b0L,b0R,c1,c2,c3
1547 STD c1,0(r_ptr)
1548 COPY %r0,c1
1549
1550 MUL_ADD_C a0L,a0R,b1L,b1R,c2,c3,c1
1551 MUL_ADD_C a1L,a1R,b0L,b0R,c2,c3,c1
1552 STD c2,8(r_ptr)
1553 COPY %r0,c2
1554
1555 MUL_ADD_C a2L,a2R,b0L,b0R,c3,c1,c2
1556 MUL_ADD_C a1L,a1R,b1L,b1R,c3,c1,c2
1557 MUL_ADD_C a0L,a0R,b2L,b2R,c3,c1,c2
1558 STD c3,16(r_ptr)
1559 COPY %r0,c3
1560
1561 MUL_ADD_C a0L,a0R,b3L,b3R,c1,c2,c3
1562 MUL_ADD_C a1L,a1R,b2L,b2R,c1,c2,c3
1563 MUL_ADD_C a2L,a2R,b1L,b1R,c1,c2,c3
1564 MUL_ADD_C a3L,a3R,b0L,b0R,c1,c2,c3
1565 STD c1,24(r_ptr)
1566 COPY %r0,c1
1567
1568 MUL_ADD_C a3L,a3R,b1L,b1R,c2,c3,c1
1569 MUL_ADD_C a2L,a2R,b2L,b2R,c2,c3,c1
1570 MUL_ADD_C a1L,a1R,b3L,b3R,c2,c3,c1
1571 STD c2,32(r_ptr)
1572 COPY %r0,c2
1573
1574 MUL_ADD_C a2L,a2R,b3L,b3R,c3,c1,c2
1575 MUL_ADD_C a3L,a3R,b2L,b2R,c3,c1,c2
1576 STD c3,40(r_ptr)
1577 COPY %r0,c3
1578
1579 MUL_ADD_C a3L,a3R,b3L,b3R,c1,c2,c3
1580 STD c1,48(r_ptr)
1581 STD c2,56(r_ptr)
1582
1583 .EXIT
1584 FLDD -88(%sp),%fr13
1585 FLDD -96(%sp),%fr12
1586 LDD -104(%sp),%r6 ; restore r6
1587 LDD -112(%sp),%r5 ; restore r5
1588 LDD -120(%sp),%r4 ; restore r4
1589 BVE (%rp)
1590 LDD,MB -128(%sp),%r3
1591
1592 .PROCEND
1593
1594
1595 .SPACE $TEXT$
1596 .SUBSPA $CODE$
1597 .SPACE $PRIVATE$,SORT=16
1598 .IMPORT $global$,DATA
1599 .SPACE $TEXT$
1600 .SUBSPA $CODE$
1601 .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16
1602C$4
1603 .ALIGN 8
1604 .STRINGZ "Division would overflow (%d)\n"
1605 .END
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h
index 009b0eb685..1eb8395b25 100644
--- a/src/lib/libcrypto/bn/bn.h
+++ b/src/lib/libcrypto/bn/bn.h
@@ -59,7 +59,7 @@
59#ifndef HEADER_BN_H 59#ifndef HEADER_BN_H
60#define HEADER_BN_H 60#define HEADER_BN_H
61 61
62#ifndef WIN16 62#ifndef NO_FP_API
63#include <stdio.h> /* FILE */ 63#include <stdio.h> /* FILE */
64#endif 64#endif
65#include <openssl/opensslconf.h> 65#include <openssl/opensslconf.h>
@@ -233,7 +233,7 @@ typedef struct bignum_st
233 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */ 233 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
234 int top; /* Index of last used d +1. */ 234 int top; /* Index of last used d +1. */
235 /* The next are internal book keeping for bn_expand. */ 235 /* The next are internal book keeping for bn_expand. */
236 int max; /* Size of the d array. */ 236 int dmax; /* Size of the d array. */
237 int neg; /* one if the number is negative */ 237 int neg; /* one if the number is negative */
238 int flags; 238 int flags;
239 } BIGNUM; 239 } BIGNUM;
@@ -364,6 +364,8 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
364 const BIGNUM *m,BN_CTX *ctx); 364 const BIGNUM *m,BN_CTX *ctx);
365int BN_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p, 365int BN_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
366 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); 366 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
367int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
368 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
367int BN_mod_exp2_mont(BIGNUM *r, BIGNUM *a1, BIGNUM *p1,BIGNUM *a2, 369int BN_mod_exp2_mont(BIGNUM *r, BIGNUM *a1, BIGNUM *p1,BIGNUM *a2,
368 BIGNUM *p2,BIGNUM *m,BN_CTX *ctx,BN_MONT_CTX *m_ctx); 370 BIGNUM *p2,BIGNUM *m,BN_CTX *ctx,BN_MONT_CTX *m_ctx);
369int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, BIGNUM *p, 371int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, BIGNUM *p,
@@ -433,9 +435,9 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, BIGNUM *m,
433 435
434/* library internal functions */ 436/* library internal functions */
435 437
436#define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->max)?\ 438#define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\
437 (a):bn_expand2((a),(bits)/BN_BITS2+1)) 439 (a):bn_expand2((a),(bits)/BN_BITS2+1))
438#define bn_wexpand(a,words) (((words) <= (a)->max)?(a):bn_expand2((a),(words))) 440#define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))
439BIGNUM *bn_expand2(BIGNUM *a, int words); 441BIGNUM *bn_expand2(BIGNUM *a, int words);
440 442
441#define bn_fix_top(a) \ 443#define bn_fix_top(a) \
@@ -483,7 +485,9 @@ BN_ULONG bn_sub_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,int num);
483#define BN_F_BN_CTX_NEW 106 485#define BN_F_BN_CTX_NEW 106
484#define BN_F_BN_DIV 107 486#define BN_F_BN_DIV 107
485#define BN_F_BN_EXPAND2 108 487#define BN_F_BN_EXPAND2 108
488#define BN_F_BN_MOD_EXP2_MONT 118
486#define BN_F_BN_MOD_EXP_MONT 109 489#define BN_F_BN_MOD_EXP_MONT 109
490#define BN_F_BN_MOD_EXP_MONT_WORD 117
487#define BN_F_BN_MOD_INVERSE 110 491#define BN_F_BN_MOD_INVERSE 110
488#define BN_F_BN_MOD_MUL_RECIPROCAL 111 492#define BN_F_BN_MOD_MUL_RECIPROCAL 111
489#define BN_F_BN_MPI2BN 112 493#define BN_F_BN_MPI2BN 112
diff --git a/src/lib/libcrypto/bn/bn_asm.c b/src/lib/libcrypto/bn/bn_asm.c
index 3329cc18e6..44e52a40db 100644
--- a/src/lib/libcrypto/bn/bn_asm.c
+++ b/src/lib/libcrypto/bn/bn_asm.c
@@ -227,7 +227,7 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
227 227
228#else 228#else
229 229
230/* Divide h-l by d and return the result. */ 230/* Divide h,l by d and return the result. */
231/* I need to test this some more :-( */ 231/* I need to test this some more :-( */
232BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) 232BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
233 { 233 {
@@ -237,13 +237,8 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
237 if (d == 0) return(BN_MASK2); 237 if (d == 0) return(BN_MASK2);
238 238
239 i=BN_num_bits_word(d); 239 i=BN_num_bits_word(d);
240 if ((i != BN_BITS2) && (h > (BN_ULONG)1<<i)) 240 assert((i == BN_BITS2) || (h > (BN_ULONG)1<<i));
241 { 241
242#if !defined(NO_STDIO) && !defined(WIN16)
243 fprintf(stderr,"Division would overflow (%d)\n",i);
244#endif
245 abort();
246 }
247 i=BN_BITS2-i; 242 i=BN_BITS2-i;
248 if (h >= d) h-=d; 243 if (h >= d) h-=d;
249 244
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c
index 1b1bb06046..2d287e6d1b 100644
--- a/src/lib/libcrypto/bn/bn_blind.c
+++ b/src/lib/libcrypto/bn/bn_blind.c
@@ -67,7 +67,7 @@ BN_BLINDING *BN_BLINDING_new(BIGNUM *A, BIGNUM *Ai, BIGNUM *mod)
67 bn_check_top(Ai); 67 bn_check_top(Ai);
68 bn_check_top(mod); 68 bn_check_top(mod);
69 69
70 if ((ret=(BN_BLINDING *)Malloc(sizeof(BN_BLINDING))) == NULL) 70 if ((ret=(BN_BLINDING *)OPENSSL_malloc(sizeof(BN_BLINDING))) == NULL)
71 { 71 {
72 BNerr(BN_F_BN_BLINDING_NEW,ERR_R_MALLOC_FAILURE); 72 BNerr(BN_F_BN_BLINDING_NEW,ERR_R_MALLOC_FAILURE);
73 return(NULL); 73 return(NULL);
@@ -91,7 +91,7 @@ void BN_BLINDING_free(BN_BLINDING *r)
91 91
92 if (r->A != NULL) BN_free(r->A ); 92 if (r->A != NULL) BN_free(r->A );
93 if (r->Ai != NULL) BN_free(r->Ai); 93 if (r->Ai != NULL) BN_free(r->Ai);
94 Free(r); 94 OPENSSL_free(r);
95 } 95 }
96 96
97int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx) 97int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)
diff --git a/src/lib/libcrypto/bn/bn_ctx.c b/src/lib/libcrypto/bn/bn_ctx.c
index 46132fd180..b1a8d7571e 100644
--- a/src/lib/libcrypto/bn/bn_ctx.c
+++ b/src/lib/libcrypto/bn/bn_ctx.c
@@ -69,7 +69,7 @@ BN_CTX *BN_CTX_new(void)
69 { 69 {
70 BN_CTX *ret; 70 BN_CTX *ret;
71 71
72 ret=(BN_CTX *)Malloc(sizeof(BN_CTX)); 72 ret=(BN_CTX *)OPENSSL_malloc(sizeof(BN_CTX));
73 if (ret == NULL) 73 if (ret == NULL)
74 { 74 {
75 BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE); 75 BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);
@@ -102,7 +102,7 @@ void BN_CTX_free(BN_CTX *ctx)
102 for (i=0; i < BN_CTX_NUM; i++) 102 for (i=0; i < BN_CTX_NUM; i++)
103 BN_clear_free(&(ctx->bn[i])); 103 BN_clear_free(&(ctx->bn[i]));
104 if (ctx->flags & BN_FLG_MALLOCED) 104 if (ctx->flags & BN_FLG_MALLOCED)
105 Free(ctx); 105 OPENSSL_free(ctx);
106 } 106 }
107 107
108void BN_CTX_start(BN_CTX *ctx) 108void BN_CTX_start(BN_CTX *ctx)
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index 07af1d3b44..c3772c243b 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -205,7 +205,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
205 BN_init(&wnum); 205 BN_init(&wnum);
206 wnum.d= &(snum->d[loop]); 206 wnum.d= &(snum->d[loop]);
207 wnum.top= div_n; 207 wnum.top= div_n;
208 wnum.max= snum->max+1; /* a bit of a lie */ 208 wnum.dmax= snum->dmax+1; /* a bit of a lie */
209 209
210 /* Get the top 2 words of sdiv */ 210 /* Get the top 2 words of sdiv */
211 /* i=sdiv->top; */ 211 /* i=sdiv->top; */
diff --git a/src/lib/libcrypto/bn/bn_err.c b/src/lib/libcrypto/bn/bn_err.c
index 988270bcf4..86550c4c21 100644
--- a/src/lib/libcrypto/bn/bn_err.c
+++ b/src/lib/libcrypto/bn/bn_err.c
@@ -76,7 +76,9 @@ static ERR_STRING_DATA BN_str_functs[]=
76{ERR_PACK(0,BN_F_BN_CTX_NEW,0), "BN_CTX_new"}, 76{ERR_PACK(0,BN_F_BN_CTX_NEW,0), "BN_CTX_new"},
77{ERR_PACK(0,BN_F_BN_DIV,0), "BN_div"}, 77{ERR_PACK(0,BN_F_BN_DIV,0), "BN_div"},
78{ERR_PACK(0,BN_F_BN_EXPAND2,0), "bn_expand2"}, 78{ERR_PACK(0,BN_F_BN_EXPAND2,0), "bn_expand2"},
79{ERR_PACK(0,BN_F_BN_MOD_EXP2_MONT,0), "BN_mod_exp2_mont"},
79{ERR_PACK(0,BN_F_BN_MOD_EXP_MONT,0), "BN_mod_exp_mont"}, 80{ERR_PACK(0,BN_F_BN_MOD_EXP_MONT,0), "BN_mod_exp_mont"},
81{ERR_PACK(0,BN_F_BN_MOD_EXP_MONT_WORD,0), "BN_mod_exp_mont_word"},
80{ERR_PACK(0,BN_F_BN_MOD_INVERSE,0), "BN_mod_inverse"}, 82{ERR_PACK(0,BN_F_BN_MOD_INVERSE,0), "BN_mod_inverse"},
81{ERR_PACK(0,BN_F_BN_MOD_MUL_RECIPROCAL,0), "BN_mod_mul_reciprocal"}, 83{ERR_PACK(0,BN_F_BN_MOD_MUL_RECIPROCAL,0), "BN_mod_mul_reciprocal"},
82{ERR_PACK(0,BN_F_BN_MPI2BN,0), "BN_mpi2bn"}, 84{ERR_PACK(0,BN_F_BN_MPI2BN,0), "BN_mpi2bn"},
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index 0c11601675..d2c91628ac 100644
--- a/src/lib/libcrypto/bn/bn_exp.c
+++ b/src/lib/libcrypto/bn/bn_exp.c
@@ -55,18 +55,66 @@
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58/* ====================================================================
59 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111
58 112
59#include <stdio.h> 113#include <stdio.h>
60#include "cryptlib.h" 114#include "cryptlib.h"
61#include "bn_lcl.h" 115#include "bn_lcl.h"
62#ifdef ATALLA
63# include <alloca.h>
64# include <atasi.h>
65# include <assert.h>
66# include <dlfcn.h>
67#endif
68 116
69#define TABLE_SIZE 16 117#define TABLE_SIZE 32
70 118
71/* slow but works */ 119/* slow but works */
72int BN_mod_mul(BIGNUM *ret, BIGNUM *a, BIGNUM *b, const BIGNUM *m, BN_CTX *ctx) 120int BN_mod_mul(BIGNUM *ret, BIGNUM *a, BIGNUM *b, const BIGNUM *m, BN_CTX *ctx)
@@ -91,42 +139,6 @@ err:
91 return(r); 139 return(r);
92 } 140 }
93 141
94#if 0
95/* this one works - simple but works */
96int BN_mod_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, BN_CTX *ctx)
97 {
98 int i,bits,ret=0;
99 BIGNUM *v,*tmp;
100
101 BN_CTX_start(ctx);
102 v = BN_CTX_get(ctx);
103 tmp = BN_CTX_get(ctx);
104 if (v == NULL || tmp == NULL) goto err;
105
106 if (BN_copy(v,a) == NULL) goto err;
107 bits=BN_num_bits(p);
108
109 if (BN_is_odd(p))
110 { if (BN_copy(r,a) == NULL) goto err; }
111 else { if (!BN_one(r)) goto err; }
112
113 for (i=1; i<bits; i++)
114 {
115 if (!BN_sqr(tmp,v,ctx)) goto err;
116 if (!BN_mod(v,tmp,m,ctx)) goto err;
117 if (BN_is_bit_set(p,i))
118 {
119 if (!BN_mul(tmp,r,v,ctx)) goto err;
120 if (!BN_mod(r,tmp,m,ctx)) goto err;
121 }
122 }
123 ret=1;
124err:
125 BN_CTX_end(ctx);
126 return(ret);
127 }
128
129#endif
130 142
131/* this one works - simple but works */ 143/* this one works - simple but works */
132int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx) 144int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx)
@@ -163,172 +175,6 @@ err:
163 return(ret); 175 return(ret);
164 } 176 }
165 177
166#ifdef ATALLA
167
168/*
169 * This routine will dynamically check for the existance of an Atalla AXL-200
170 * SSL accelerator module. If one is found, the variable
171 * asi_accelerator_present is set to 1 and the function pointers
172 * ptr_ASI_xxxxxx above will be initialized to corresponding ASI API calls.
173 */
174typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
175 unsigned int *ret_buf);
176typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
177typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
178 unsigned char *output,
179 unsigned char *input,
180 unsigned int modulus_len);
181
182static tfnASI_GetHardwareConfig *ptr_ASI_GetHardwareConfig;
183static tfnASI_RSAPrivateKeyOpFn *ptr_ASI_RSAPrivateKeyOpFn;
184static tfnASI_GetPerformanceStatistics *ptr_ASI_GetPerformanceStatistics;
185static int asi_accelerator_present;
186static int tried_atalla;
187
188void atalla_initialize_accelerator_handle(void)
189 {
190 void *dl_handle;
191 int status;
192 unsigned int config_buf[1024];
193 static int tested;
194
195 if(tested)
196 return;
197
198 tested=1;
199
200 bzero((void *)config_buf, 1024);
201
202 /*
203 * Check to see if the library is present on the system
204 */
205 dl_handle = dlopen("atasi.so", RTLD_NOW);
206 if (dl_handle == (void *) NULL)
207 {
208/* printf("atasi.so library is not present on the system\n");
209 printf("No HW acceleration available\n");*/
210 return;
211 }
212
213 /*
214 * The library is present. Now we'll check to insure that the
215 * LDM is up and running. First we'll get the address of the
216 * function in the atasi library that we need to see if the
217 * LDM is operating.
218 */
219
220 ptr_ASI_GetHardwareConfig =
221 (tfnASI_GetHardwareConfig *)dlsym(dl_handle,"ASI_GetHardwareConfig");
222
223 if (ptr_ASI_GetHardwareConfig)
224 {
225 /*
226 * We found the call, now we'll get our config
227 * status. If we get a non 0 result, the LDM is not
228 * running and we cannot use the Atalla ASI *
229 * library.
230 */
231 status = (*ptr_ASI_GetHardwareConfig)(0L, config_buf);
232 if (status != 0)
233 {
234 printf("atasi.so library is present but not initialized\n");
235 printf("No HW acceleration available\n");
236 return;
237 }
238 }
239 else
240 {
241/* printf("We found the library, but not the function. Very Strange!\n");*/
242 return ;
243 }
244
245 /*
246 * It looks like we have acceleration capabilities. Load up the
247 * pointers to our ASI API calls.
248 */
249 ptr_ASI_RSAPrivateKeyOpFn=
250 (tfnASI_RSAPrivateKeyOpFn *)dlsym(dl_handle, "ASI_RSAPrivateKeyOpFn");
251 if (ptr_ASI_RSAPrivateKeyOpFn == NULL)
252 {
253/* printf("We found the library, but no RSA function. Very Strange!\n");*/
254 return;
255 }
256
257 ptr_ASI_GetPerformanceStatistics =
258 (tfnASI_GetPerformanceStatistics *)dlsym(dl_handle, "ASI_GetPerformanceStatistics");
259 if (ptr_ASI_GetPerformanceStatistics == NULL)
260 {
261/* printf("We found the library, but no stat function. Very Strange!\n");*/
262 return;
263 }
264
265 /*
266 * Indicate that acceleration is available
267 */
268 asi_accelerator_present = 1;
269
270/* printf("This system has acceleration!\n");*/
271
272 return;
273 }
274
275/* make sure this only gets called once when bn_mod_exp calls bn_mod_exp_mont */
276int BN_mod_exp_atalla(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m)
277 {
278 unsigned char *abin;
279 unsigned char *pbin;
280 unsigned char *mbin;
281 unsigned char *rbin;
282 int an,pn,mn,ret;
283 RSAPrivateKey keydata;
284
285 atalla_initialize_accelerator_handle();
286 if(!asi_accelerator_present)
287 return 0;
288
289
290/* We should be able to run without size testing */
291# define ASIZE 128
292 an=BN_num_bytes(a);
293 pn=BN_num_bytes(p);
294 mn=BN_num_bytes(m);
295
296 if(an <= ASIZE && pn <= ASIZE && mn <= ASIZE)
297 {
298 int size=mn;
299
300 assert(an <= mn);
301 abin=alloca(size);
302 memset(abin,'\0',mn);
303 BN_bn2bin(a,abin+size-an);
304
305 pbin=alloca(pn);
306 BN_bn2bin(p,pbin);
307
308 mbin=alloca(size);
309 memset(mbin,'\0',mn);
310 BN_bn2bin(m,mbin+size-mn);
311
312 rbin=alloca(size);
313
314 memset(&keydata,'\0',sizeof keydata);
315 keydata.privateExponent.data=pbin;
316 keydata.privateExponent.len=pn;
317 keydata.modulus.data=mbin;
318 keydata.modulus.len=size;
319
320 ret=(*ptr_ASI_RSAPrivateKeyOpFn)(&keydata,rbin,abin,keydata.modulus.len);
321/*fprintf(stderr,"!%s\n",BN_bn2hex(a));*/
322 if(!ret)
323 {
324 BN_bin2bn(rbin,keydata.modulus.len,r);
325/*fprintf(stderr,"?%s\n",BN_bn2hex(r));*/
326 return 1;
327 }
328 }
329 return 0;
330 }
331#endif /* def ATALLA */
332 178
333int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, 179int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
334 BN_CTX *ctx) 180 BN_CTX *ctx)
@@ -339,13 +185,6 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
339 bn_check_top(p); 185 bn_check_top(p);
340 bn_check_top(m); 186 bn_check_top(m);
341 187
342#ifdef ATALLA
343 if(BN_mod_exp_atalla(r,a,p,m))
344 return 1;
345/* If it fails, try the other methods (but don't try atalla again) */
346 tried_atalla=1;
347#endif
348
349#ifdef MONT_MUL_MOD 188#ifdef MONT_MUL_MOD
350 /* I have finally been able to take out this pre-condition of 189 /* I have finally been able to take out this pre-condition of
351 * the top bit being set. It was caused by an error in BN_div 190 * the top bit being set. It was caused by an error in BN_div
@@ -354,7 +193,15 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
354/* if ((m->d[m->top-1]&BN_TBIT) && BN_is_odd(m)) */ 193/* if ((m->d[m->top-1]&BN_TBIT) && BN_is_odd(m)) */
355 194
356 if (BN_is_odd(m)) 195 if (BN_is_odd(m))
357 { ret=BN_mod_exp_mont(r,a,p,m,ctx,NULL); } 196 {
197 if (a->top == 1)
198 {
199 BN_ULONG A = a->d[0];
200 ret=BN_mod_exp_mont_word(r,A,p,m,ctx,NULL);
201 }
202 else
203 ret=BN_mod_exp_mont(r,a,p,m,ctx,NULL);
204 }
358 else 205 else
359#endif 206#endif
360#ifdef RECP_MUL_MOD 207#ifdef RECP_MUL_MOD
@@ -363,14 +210,10 @@ int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
363 { ret=BN_mod_exp_simple(r,a,p,m,ctx); } 210 { ret=BN_mod_exp_simple(r,a,p,m,ctx); }
364#endif 211#endif
365 212
366#ifdef ATALLA
367 tried_atalla=0;
368#endif
369
370 return(ret); 213 return(ret);
371 } 214 }
372 215
373/* #ifdef RECP_MUL_MOD */ 216
374int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 217int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
375 const BIGNUM *m, BN_CTX *ctx) 218 const BIGNUM *m, BN_CTX *ctx)
376 { 219 {
@@ -398,27 +241,22 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
398 ts=1; 241 ts=1;
399 242
400 if (!BN_mod(&(val[0]),a,m,ctx)) goto err; /* 1 */ 243 if (!BN_mod(&(val[0]),a,m,ctx)) goto err; /* 1 */
401 if (!BN_mod_mul_reciprocal(aa,&(val[0]),&(val[0]),&recp,ctx))
402 goto err; /* 2 */
403
404 if (bits <= 17) /* This is probably 3 or 0x10001, so just do singles */
405 window=1;
406 else if (bits >= 256)
407 window=5; /* max size of window */
408 else if (bits >= 128)
409 window=4;
410 else
411 window=3;
412 244
413 j=1<<(window-1); 245 window = BN_window_bits_for_exponent_size(bits);
414 for (i=1; i<j; i++) 246 if (window > 1)
415 { 247 {
416 BN_init(&val[i]); 248 if (!BN_mod_mul_reciprocal(aa,&(val[0]),&(val[0]),&recp,ctx))
417 if (!BN_mod_mul_reciprocal(&(val[i]),&(val[i-1]),aa,&recp,ctx)) 249 goto err; /* 2 */
418 goto err; 250 j=1<<(window-1);
251 for (i=1; i<j; i++)
252 {
253 BN_init(&val[i]);
254 if (!BN_mod_mul_reciprocal(&(val[i]),&(val[i-1]),aa,&recp,ctx))
255 goto err;
256 }
257 ts=i;
419 } 258 }
420 ts=i; 259
421
422 start=1; /* This is used to avoid multiplication etc 260 start=1; /* This is used to avoid multiplication etc
423 * when there is only the value '1' in the 261 * when there is only the value '1' in the
424 * buffer. */ 262 * buffer. */
@@ -485,9 +323,8 @@ err:
485 BN_RECP_CTX_free(&recp); 323 BN_RECP_CTX_free(&recp);
486 return(ret); 324 return(ret);
487 } 325 }
488/* #endif */
489 326
490/* #ifdef MONT_MUL_MOD */ 327
491int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p, 328int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
492 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 329 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
493 { 330 {
@@ -502,12 +339,6 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
502 bn_check_top(p); 339 bn_check_top(p);
503 bn_check_top(m); 340 bn_check_top(m);
504 341
505#ifdef ATALLA
506 if(!tried_atalla && BN_mod_exp_atalla(rr,a,p,m))
507 return 1;
508/* If it fails, try the other methods */
509#endif
510
511 if (!(m->d[0] & 1)) 342 if (!(m->d[0] & 1))
512 { 343 {
513 BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS); 344 BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS);
@@ -527,11 +358,9 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
527 /* If this is not done, things will break in the montgomery 358 /* If this is not done, things will break in the montgomery
528 * part */ 359 * part */
529 360
530#if 1
531 if (in_mont != NULL) 361 if (in_mont != NULL)
532 mont=in_mont; 362 mont=in_mont;
533 else 363 else
534#endif
535 { 364 {
536 if ((mont=BN_MONT_CTX_new()) == NULL) goto err; 365 if ((mont=BN_MONT_CTX_new()) == NULL) goto err;
537 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; 366 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err;
@@ -541,31 +370,27 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
541 ts=1; 370 ts=1;
542 if (BN_ucmp(a,m) >= 0) 371 if (BN_ucmp(a,m) >= 0)
543 { 372 {
544 BN_mod(&(val[0]),a,m,ctx); 373 if (!BN_mod(&(val[0]),a,m,ctx))
374 goto err;
545 aa= &(val[0]); 375 aa= &(val[0]);
546 } 376 }
547 else 377 else
548 aa=a; 378 aa=a;
549 if (!BN_to_montgomery(&(val[0]),aa,mont,ctx)) goto err; /* 1 */ 379 if (!BN_to_montgomery(&(val[0]),aa,mont,ctx)) goto err; /* 1 */
550 if (!BN_mod_mul_montgomery(d,&(val[0]),&(val[0]),mont,ctx)) goto err; /* 2 */
551
552 if (bits <= 20) /* This is probably 3 or 0x10001, so just do singles */
553 window=1;
554 else if (bits >= 256)
555 window=5; /* max size of window */
556 else if (bits >= 128)
557 window=4;
558 else
559 window=3;
560 380
561 j=1<<(window-1); 381 window = BN_window_bits_for_exponent_size(bits);
562 for (i=1; i<j; i++) 382 if (window > 1)
563 { 383 {
564 BN_init(&(val[i])); 384 if (!BN_mod_mul_montgomery(d,&(val[0]),&(val[0]),mont,ctx)) goto err; /* 2 */
565 if (!BN_mod_mul_montgomery(&(val[i]),&(val[i-1]),d,mont,ctx)) 385 j=1<<(window-1);
566 goto err; 386 for (i=1; i<j; i++)
387 {
388 BN_init(&(val[i]));
389 if (!BN_mod_mul_montgomery(&(val[i]),&(val[i-1]),d,mont,ctx))
390 goto err;
391 }
392 ts=i;
567 } 393 }
568 ts=i;
569 394
570 start=1; /* This is used to avoid multiplication etc 395 start=1; /* This is used to avoid multiplication etc
571 * when there is only the value '1' in the 396 * when there is only the value '1' in the
@@ -574,7 +399,7 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
574 wstart=bits-1; /* The top bit of the window */ 399 wstart=bits-1; /* The top bit of the window */
575 wend=0; /* The bottom bit of the window */ 400 wend=0; /* The bottom bit of the window */
576 401
577 if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err; 402 if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err;
578 for (;;) 403 for (;;)
579 { 404 {
580 if (BN_is_bit_set(p,wstart) == 0) 405 if (BN_is_bit_set(p,wstart) == 0)
@@ -626,7 +451,7 @@ int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
626 start=0; 451 start=0;
627 if (wstart < 0) break; 452 if (wstart < 0) break;
628 } 453 }
629 BN_from_montgomery(rr,r,mont,ctx); 454 if (!BN_from_montgomery(rr,r,mont,ctx)) goto err;
630 ret=1; 455 ret=1;
631err: 456err:
632 if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont); 457 if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);
@@ -635,7 +460,134 @@ err:
635 BN_clear_free(&(val[i])); 460 BN_clear_free(&(val[i]));
636 return(ret); 461 return(ret);
637 } 462 }
638/* #endif */ 463
464int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
465 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
466 {
467 BN_MONT_CTX *mont = NULL;
468 int b, bits, ret=0;
469 int r_is_one;
470 BN_ULONG w, next_w;
471 BIGNUM *d, *r, *t;
472 BIGNUM *swap_tmp;
473#define BN_MOD_MUL_WORD(r, w, m) \
474 (BN_mul_word(r, (w)) && \
475 (/* BN_ucmp(r, (m)) < 0 ? 1 :*/ \
476 (BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
477 /* BN_MOD_MUL_WORD is only used with 'w' large,
478 * so the BN_ucmp test is probably more overhead
479 * than always using BN_mod (which uses BN_copy if
480 * a similar test returns true). */
481#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
482 (BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
483
484 bn_check_top(p);
485 bn_check_top(m);
486
487 if (!(m->d[0] & 1))
488 {
489 BNerr(BN_F_BN_MOD_EXP_MONT_WORD,BN_R_CALLED_WITH_EVEN_MODULUS);
490 return(0);
491 }
492 bits = BN_num_bits(p);
493 if (bits == 0)
494 {
495 BN_one(rr);
496 return(1);
497 }
498 BN_CTX_start(ctx);
499 d = BN_CTX_get(ctx);
500 r = BN_CTX_get(ctx);
501 t = BN_CTX_get(ctx);
502 if (d == NULL || r == NULL || t == NULL) goto err;
503
504 if (in_mont != NULL)
505 mont=in_mont;
506 else
507 {
508 if ((mont = BN_MONT_CTX_new()) == NULL) goto err;
509 if (!BN_MONT_CTX_set(mont, m, ctx)) goto err;
510 }
511
512 r_is_one = 1; /* except for Montgomery factor */
513
514 /* bits-1 >= 0 */
515
516 /* The result is accumulated in the product r*w. */
517 w = a; /* bit 'bits-1' of 'p' is always set */
518 for (b = bits-2; b >= 0; b--)
519 {
520 /* First, square r*w. */
521 next_w = w*w;
522 if ((next_w/w) != w) /* overflow */
523 {
524 if (r_is_one)
525 {
526 if (!BN_TO_MONTGOMERY_WORD(r, w, mont)) goto err;
527 r_is_one = 0;
528 }
529 else
530 {
531 if (!BN_MOD_MUL_WORD(r, w, m)) goto err;
532 }
533 next_w = 1;
534 }
535 w = next_w;
536 if (!r_is_one)
537 {
538 if (!BN_mod_mul_montgomery(r, r, r, mont, ctx)) goto err;
539 }
540
541 /* Second, multiply r*w by 'a' if exponent bit is set. */
542 if (BN_is_bit_set(p, b))
543 {
544 next_w = w*a;
545 if ((next_w/a) != w) /* overflow */
546 {
547 if (r_is_one)
548 {
549 if (!BN_TO_MONTGOMERY_WORD(r, w, mont)) goto err;
550 r_is_one = 0;
551 }
552 else
553 {
554 if (!BN_MOD_MUL_WORD(r, w, m)) goto err;
555 }
556 next_w = a;
557 }
558 w = next_w;
559 }
560 }
561
562 /* Finally, set r:=r*w. */
563 if (w != 1)
564 {
565 if (r_is_one)
566 {
567 if (!BN_TO_MONTGOMERY_WORD(r, w, mont)) goto err;
568 r_is_one = 0;
569 }
570 else
571 {
572 if (!BN_MOD_MUL_WORD(r, w, m)) goto err;
573 }
574 }
575
576 if (r_is_one) /* can happen only if a == 1*/
577 {
578 if (!BN_one(rr)) goto err;
579 }
580 else
581 {
582 if (!BN_from_montgomery(rr, r, mont, ctx)) goto err;
583 }
584 ret = 1;
585err:
586 if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);
587 BN_CTX_end(ctx);
588 return(ret);
589 }
590
639 591
640/* The old fallback, simple version :-) */ 592/* The old fallback, simple version :-) */
641int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, 593int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m,
@@ -660,26 +612,21 @@ int BN_mod_exp_simple(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m,
660 BN_init(&(val[0])); 612 BN_init(&(val[0]));
661 ts=1; 613 ts=1;
662 if (!BN_mod(&(val[0]),a,m,ctx)) goto err; /* 1 */ 614 if (!BN_mod(&(val[0]),a,m,ctx)) goto err; /* 1 */
663 if (!BN_mod_mul(d,&(val[0]),&(val[0]),m,ctx))
664 goto err; /* 2 */
665
666 if (bits <= 17) /* This is probably 3 or 0x10001, so just do singles */
667 window=1;
668 else if (bits >= 256)
669 window=5; /* max size of window */
670 else if (bits >= 128)
671 window=4;
672 else
673 window=3;
674 615
675 j=1<<(window-1); 616 window = BN_window_bits_for_exponent_size(bits);
676 for (i=1; i<j; i++) 617 if (window > 1)
677 { 618 {
678 BN_init(&(val[i])); 619 if (!BN_mod_mul(d,&(val[0]),&(val[0]),m,ctx))
679 if (!BN_mod_mul(&(val[i]),&(val[i-1]),d,m,ctx)) 620 goto err; /* 2 */
680 goto err; 621 j=1<<(window-1);
622 for (i=1; i<j; i++)
623 {
624 BN_init(&(val[i]));
625 if (!BN_mod_mul(&(val[i]),&(val[i-1]),d,m,ctx))
626 goto err;
627 }
628 ts=i;
681 } 629 }
682 ts=i;
683 630
684 start=1; /* This is used to avoid multiplication etc 631 start=1; /* This is used to avoid multiplication etc
685 * when there is only the value '1' in the 632 * when there is only the value '1' in the
diff --git a/src/lib/libcrypto/bn/bn_exp2.c b/src/lib/libcrypto/bn/bn_exp2.c
index 4f4e9e3299..29029f4c72 100644
--- a/src/lib/libcrypto/bn/bn_exp2.c
+++ b/src/lib/libcrypto/bn/bn_exp2.c
@@ -1,27 +1,128 @@
1/* crypto/bn/bn_exp2.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58/* ====================================================================
59 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111
1#include <stdio.h> 112#include <stdio.h>
2#include "cryptlib.h" 113#include "cryptlib.h"
3#include "bn_lcl.h" 114#include "bn_lcl.h"
4 115
5/* I've done some timing with different table sizes. 116#define TABLE_SIZE 32
6 * The main hassle is that even with bits set at 3, this requires
7 * 63 BIGNUMs to store the pre-calculated values.
8 * 512 1024
9 * bits=1 75.4% 79.4%
10 * bits=2 61.2% 62.4%
11 * bits=3 61.3% 59.3%
12 * The lack of speed improvement is also a function of the pre-calculation
13 * which could be removed.
14 */
15#define EXP2_TABLE_BITS 2 /* 1 2 3 4 5 */
16#define EXP2_TABLE_SIZE 4 /* 2 4 8 16 32 */
17 117
18int BN_mod_exp2_mont(BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2, 118int BN_mod_exp2_mont(BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2,
19 BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) 119 BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
20 { 120 {
21 int i,j,k,bits,bits1,bits2,ret=0,wstart,wend,window,xvalue,yvalue; 121 int i,j,bits,b,bits1,bits2,ret=0,wpos1,wpos2,window1,window2,wvalue1,wvalue2;
22 int start=1,ts=0,x,y; 122 int r_is_one=1,ts1=0,ts2=0;
23 BIGNUM *d,*aa1,*aa2,*r; 123 BIGNUM *d,*r;
24 BIGNUM val[EXP2_TABLE_SIZE][EXP2_TABLE_SIZE]; 124 BIGNUM *a_mod_m;
125 BIGNUM val1[TABLE_SIZE], val2[TABLE_SIZE];
25 BN_MONT_CTX *mont=NULL; 126 BN_MONT_CTX *mont=NULL;
26 127
27 bn_check_top(a1); 128 bn_check_top(a1);
@@ -32,7 +133,7 @@ int BN_mod_exp2_mont(BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2,
32 133
33 if (!(m->d[0] & 1)) 134 if (!(m->d[0] & 1))
34 { 135 {
35 BNerr(BN_F_BN_MOD_EXP_MONT,BN_R_CALLED_WITH_EVEN_MODULUS); 136 BNerr(BN_F_BN_MOD_EXP2_MONT,BN_R_CALLED_WITH_EVEN_MODULUS);
36 return(0); 137 return(0);
37 } 138 }
38 bits1=BN_num_bits(p1); 139 bits1=BN_num_bits(p1);
@@ -42,17 +143,13 @@ int BN_mod_exp2_mont(BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2,
42 BN_one(rr); 143 BN_one(rr);
43 return(1); 144 return(1);
44 } 145 }
146 bits=(bits1 > bits2)?bits1:bits2;
45 147
46 BN_CTX_start(ctx); 148 BN_CTX_start(ctx);
47 d = BN_CTX_get(ctx); 149 d = BN_CTX_get(ctx);
48 r = BN_CTX_get(ctx); 150 r = BN_CTX_get(ctx);
49 if (d == NULL || r == NULL) goto err; 151 if (d == NULL || r == NULL) goto err;
50 152
51 bits=(bits1 > bits2)?bits1:bits2;
52
53 /* If this is not done, things will break in the montgomery
54 * part */
55
56 if (in_mont != NULL) 153 if (in_mont != NULL)
57 mont=in_mont; 154 mont=in_mont;
58 else 155 else
@@ -61,139 +158,143 @@ int BN_mod_exp2_mont(BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2,
61 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err; 158 if (!BN_MONT_CTX_set(mont,m,ctx)) goto err;
62 } 159 }
63 160
64 BN_init(&(val[0][0])); 161 window1 = BN_window_bits_for_exponent_size(bits1);
65 BN_init(&(val[1][1])); 162 window2 = BN_window_bits_for_exponent_size(bits2);
66 BN_init(&(val[0][1])); 163
67 BN_init(&(val[1][0])); 164 /*
68 ts=1; 165 * Build table for a1: val1[i] := a1^(2*i + 1) mod m for i = 0 .. 2^(window1-1)
166 */
167 BN_init(&val1[0]);
168 ts1=1;
69 if (BN_ucmp(a1,m) >= 0) 169 if (BN_ucmp(a1,m) >= 0)
70 { 170 {
71 BN_mod(&(val[1][0]),a1,m,ctx); 171 if (!BN_mod(&(val1[0]),a1,m,ctx))
72 aa1= &(val[1][0]); 172 goto err;
173 a_mod_m = &(val1[0]);
73 } 174 }
74 else 175 else
75 aa1=a1; 176 a_mod_m = a1;
177 if (!BN_to_montgomery(&(val1[0]),a_mod_m,mont,ctx)) goto err;
178 if (window1 > 1)
179 {
180 if (!BN_mod_mul_montgomery(d,&(val1[0]),&(val1[0]),mont,ctx)) goto err;
181
182 j=1<<(window1-1);
183 for (i=1; i<j; i++)
184 {
185 BN_init(&(val1[i]));
186 if (!BN_mod_mul_montgomery(&(val1[i]),&(val1[i-1]),d,mont,ctx))
187 goto err;
188 }
189 ts1=i;
190 }
191
192
193 /*
194 * Build table for a2: val2[i] := a2^(2*i + 1) mod m for i = 0 .. 2^(window2-1)
195 */
196 BN_init(&val2[0]);
197 ts2=1;
76 if (BN_ucmp(a2,m) >= 0) 198 if (BN_ucmp(a2,m) >= 0)
77 { 199 {
78 BN_mod(&(val[0][1]),a2,m,ctx); 200 if (!BN_mod(&(val2[0]),a2,m,ctx))
79 aa2= &(val[0][1]); 201 goto err;
202 a_mod_m = &(val2[0]);
80 } 203 }
81 else 204 else
82 aa2=a2; 205 a_mod_m = a2;
83 if (!BN_to_montgomery(&(val[1][0]),aa1,mont,ctx)) goto err; 206 if (!BN_to_montgomery(&(val2[0]),a_mod_m,mont,ctx)) goto err;
84 if (!BN_to_montgomery(&(val[0][1]),aa2,mont,ctx)) goto err; 207 if (window2 > 1)
85 if (!BN_mod_mul_montgomery(&(val[1][1]),
86 &(val[1][0]),&(val[0][1]),mont,ctx))
87 goto err;
88
89#if 0
90 if (bits <= 20) /* This is probably 3 or 0x10001, so just do singles */
91 window=1;
92 else if (bits > 250)
93 window=5; /* max size of window */
94 else if (bits >= 120)
95 window=4;
96 else
97 window=3;
98#else
99 window=EXP2_TABLE_BITS;
100#endif
101
102 k=1<<window;
103 for (x=0; x<k; x++)
104 { 208 {
105 if (x >= 2) 209 if (!BN_mod_mul_montgomery(d,&(val2[0]),&(val2[0]),mont,ctx)) goto err;
106 { 210
107 BN_init(&(val[x][0])); 211 j=1<<(window2-1);
108 BN_init(&(val[x][1])); 212 for (i=1; i<j; i++)
109 if (!BN_mod_mul_montgomery(&(val[x][0]),
110 &(val[1][0]),&(val[x-1][0]),mont,ctx)) goto err;
111 if (!BN_mod_mul_montgomery(&(val[x][1]),
112 &(val[1][0]),&(val[x-1][1]),mont,ctx)) goto err;
113 }
114 for (y=2; y<k; y++)
115 { 213 {
116 BN_init(&(val[x][y])); 214 BN_init(&(val2[i]));
117 if (!BN_mod_mul_montgomery(&(val[x][y]), 215 if (!BN_mod_mul_montgomery(&(val2[i]),&(val2[i-1]),d,mont,ctx))
118 &(val[x][y-1]),&(val[0][1]),mont,ctx))
119 goto err; 216 goto err;
120 } 217 }
218 ts2=i;
121 } 219 }
122 ts=k; 220
123 221
124 start=1; /* This is used to avoid multiplication etc 222 /* Now compute the power product, using independent windows. */
125 * when there is only the value '1' in the 223 r_is_one=1;
126 * buffer. */ 224 wvalue1=0; /* The 'value' of the first window */
127 xvalue=0; /* The 'x value' of the window */ 225 wvalue2=0; /* The 'value' of the second window */
128 yvalue=0; /* The 'y value' of the window */ 226 wpos1=0; /* If wvalue1 > 0, the bottom bit of the first window */
129 wstart=bits-1; /* The top bit of the window */ 227 wpos2=0; /* If wvalue2 > 0, the bottom bit of the second window */
130 wend=0; /* The bottom bit of the window */ 228
131 229 if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err;
132 if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err; 230 for (b=bits-1; b>=0; b--)
133 for (;;)
134 { 231 {
135 xvalue=BN_is_bit_set(p1,wstart); 232 if (!r_is_one)
136 yvalue=BN_is_bit_set(p2,wstart);
137 if (!(xvalue || yvalue))
138 { 233 {
139 if (!start) 234 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx))
235 goto err;
236 }
237
238 if (!wvalue1)
239 if (BN_is_bit_set(p1, b))
140 { 240 {
141 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) 241 /* consider bits b-window1+1 .. b for this window */
142 goto err; 242 i = b-window1+1;
243 while (!BN_is_bit_set(p1, i)) /* works for i<0 */
244 i++;
245 wpos1 = i;
246 wvalue1 = 1;
247 for (i = b-1; i >= wpos1; i--)
248 {
249 wvalue1 <<= 1;
250 if (BN_is_bit_set(p1, i))
251 wvalue1++;
252 }
143 } 253 }
144 wstart--; 254
145 if (wstart < 0) break; 255 if (!wvalue2)
146 continue; 256 if (BN_is_bit_set(p2, b))
147 }
148 /* We now have wstart on a 'set' bit, we now need to work out
149 * how bit a window to do. To do this we need to scan
150 * forward until the last set bit before the end of the
151 * window */
152 j=wstart;
153 /* xvalue=BN_is_bit_set(p1,wstart); already set */
154 /* yvalue=BN_is_bit_set(p1,wstart); already set */
155 wend=0;
156 for (i=1; i<window; i++)
157 {
158 if (wstart-i < 0) break;
159 xvalue+=xvalue;
160 xvalue|=BN_is_bit_set(p1,wstart-i);
161 yvalue+=yvalue;
162 yvalue|=BN_is_bit_set(p2,wstart-i);
163 }
164
165 /* i is the size of the current window */
166 /* add the 'bytes above' */
167 if (!start)
168 for (j=0; j<i; j++)
169 { 257 {
170 if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) 258 /* consider bits b-window2+1 .. b for this window */
171 goto err; 259 i = b-window2+1;
260 while (!BN_is_bit_set(p2, i))
261 i++;
262 wpos2 = i;
263 wvalue2 = 1;
264 for (i = b-1; i >= wpos2; i--)
265 {
266 wvalue2 <<= 1;
267 if (BN_is_bit_set(p2, i))
268 wvalue2++;
269 }
172 } 270 }
271
272 if (wvalue1 && b == wpos1)
273 {
274 /* wvalue1 is odd and < 2^window1 */
275 if (!BN_mod_mul_montgomery(r,r,&(val1[wvalue1>>1]),mont,ctx))
276 goto err;
277 wvalue1 = 0;
278 r_is_one = 0;
279 }
173 280
174 /* wvalue will be an odd number < 2^window */ 281 if (wvalue2 && b == wpos2)
175 if (xvalue || yvalue)
176 { 282 {
177 if (!BN_mod_mul_montgomery(r,r,&(val[xvalue][yvalue]), 283 /* wvalue2 is odd and < 2^window2 */
178 mont,ctx)) goto err; 284 if (!BN_mod_mul_montgomery(r,r,&(val2[wvalue2>>1]),mont,ctx))
285 goto err;
286 wvalue2 = 0;
287 r_is_one = 0;
179 } 288 }
180
181 /* move the 'window' down further */
182 wstart-=i;
183 start=0;
184 if (wstart < 0) break;
185 } 289 }
186 BN_from_montgomery(rr,r,mont,ctx); 290 BN_from_montgomery(rr,r,mont,ctx);
187 ret=1; 291 ret=1;
188err: 292err:
189 if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont); 293 if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont);
190 BN_CTX_end(ctx); 294 BN_CTX_end(ctx);
191 for (i=0; i<ts; i++) 295 for (i=0; i<ts1; i++)
192 { 296 BN_clear_free(&(val1[i]));
193 for (j=0; j<ts; j++) 297 for (i=0; i<ts2; i++)
194 { 298 BN_clear_free(&(val2[i]));
195 BN_clear_free(&(val[i][j]));
196 }
197 }
198 return(ret); 299 return(ret);
199 } 300 }
diff --git a/src/lib/libcrypto/bn/bn_lcl.h b/src/lib/libcrypto/bn/bn_lcl.h
index e36ccbc4c2..9c959921b4 100644
--- a/src/lib/libcrypto/bn/bn_lcl.h
+++ b/src/lib/libcrypto/bn/bn_lcl.h
@@ -55,6 +55,59 @@
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58/* ====================================================================
59 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
58 111
59#ifndef HEADER_BN_LCL_H 112#ifndef HEADER_BN_LCL_H
60#define HEADER_BN_LCL_H 113#define HEADER_BN_LCL_H
@@ -65,6 +118,51 @@
65extern "C" { 118extern "C" {
66#endif 119#endif
67 120
121
122/*
123 * BN_window_bits_for_exponent_size -- macro for sliding window mod_exp functions
124 *
125 *
126 * For window size 'w' (w >= 2) and a random 'b' bits exponent,
127 * the number of multiplications is a constant plus on average
128 *
129 * 2^(w-1) + (b-w)/(w+1);
130 *
131 * here 2^(w-1) is for precomputing the table (we actually need
132 * entries only for windows that have the lowest bit set), and
133 * (b-w)/(w+1) is an approximation for the expected number of
134 * w-bit windows, not counting the first one.
135 *
136 * Thus we should use
137 *
138 * w >= 6 if b > 671
139 * w = 5 if 671 > b > 239
140 * w = 4 if 239 > b > 79
141 * w = 3 if 79 > b > 23
142 * w <= 2 if 23 > b
143 *
144 * (with draws in between). Very small exponents are often selected
145 * with low Hamming weight, so we use w = 1 for b <= 23.
146 */
147#if 1
148#define BN_window_bits_for_exponent_size(b) \
149 ((b) > 671 ? 6 : \
150 (b) > 239 ? 5 : \
151 (b) > 79 ? 4 : \
152 (b) > 23 ? 3 : 1)
153#else
154/* Old SSLeay/OpenSSL table.
155 * Maximum window size was 5, so this table differs for b==1024;
156 * but it coincides for other interesting values (b==160, b==512).
157 */
158#define BN_window_bits_for_exponent_size(b) \
159 ((b) > 255 ? 5 : \
160 (b) > 127 ? 4 : \
161 (b) > 17 ? 3 : 1)
162#endif
163
164
165
68/* Pentium pro 16,16,16,32,64 */ 166/* Pentium pro 16,16,16,32,64 */
69/* Alpha 16,16,16,16.64 */ 167/* Alpha 16,16,16,16.64 */
70#define BN_MULL_SIZE_NORMAL (16) /* 32 */ 168#define BN_MULL_SIZE_NORMAL (16) /* 32 */
@@ -130,7 +228,7 @@ extern "C" {
130/* This is used for internal error checking and is not normally used */ 228/* This is used for internal error checking and is not normally used */
131#ifdef BN_DEBUG 229#ifdef BN_DEBUG
132# include <assert.h> 230# include <assert.h>
133# define bn_check_top(a) assert ((a)->top >= 0 && (a)->top <= (a)->max); 231# define bn_check_top(a) assert ((a)->top >= 0 && (a)->top <= (a)->dmax);
134#else 232#else
135# define bn_check_top(a) 233# define bn_check_top(a)
136#endif 234#endif
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c
index 0e6b12d9c3..b6b0ce4b3c 100644
--- a/src/lib/libcrypto/bn/bn_lib.c
+++ b/src/lib/libcrypto/bn/bn_lib.c
@@ -56,6 +56,12 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef BN_DEBUG
60# undef NDEBUG /* avoid conflicting definitions */
61# define NDEBUG
62#endif
63
64#include <assert.h>
59#include <stdio.h> 65#include <stdio.h>
60#include "cryptlib.h" 66#include "cryptlib.h"
61#include "bn_lcl.h" 67#include "bn_lcl.h"
@@ -244,14 +250,8 @@ int BN_num_bits(const BIGNUM *a)
244 250
245 if (a->top == 0) return(0); 251 if (a->top == 0) return(0);
246 l=a->d[a->top-1]; 252 l=a->d[a->top-1];
253 assert(l != 0);
247 i=(a->top-1)*BN_BITS2; 254 i=(a->top-1)*BN_BITS2;
248 if (l == 0)
249 {
250#if !defined(NO_STDIO) && !defined(WIN16)
251 fprintf(stderr,"BAD TOP VALUE\n");
252#endif
253 abort();
254 }
255 return(i+BN_num_bits_word(l)); 255 return(i+BN_num_bits_word(l));
256 } 256 }
257 257
@@ -262,24 +262,24 @@ void BN_clear_free(BIGNUM *a)
262 if (a == NULL) return; 262 if (a == NULL) return;
263 if (a->d != NULL) 263 if (a->d != NULL)
264 { 264 {
265 memset(a->d,0,a->max*sizeof(a->d[0])); 265 memset(a->d,0,a->dmax*sizeof(a->d[0]));
266 if (!(BN_get_flags(a,BN_FLG_STATIC_DATA))) 266 if (!(BN_get_flags(a,BN_FLG_STATIC_DATA)))
267 Free(a->d); 267 OPENSSL_free(a->d);
268 } 268 }
269 i=BN_get_flags(a,BN_FLG_MALLOCED); 269 i=BN_get_flags(a,BN_FLG_MALLOCED);
270 memset(a,0,sizeof(BIGNUM)); 270 memset(a,0,sizeof(BIGNUM));
271 if (i) 271 if (i)
272 Free(a); 272 OPENSSL_free(a);
273 } 273 }
274 274
275void BN_free(BIGNUM *a) 275void BN_free(BIGNUM *a)
276 { 276 {
277 if (a == NULL) return; 277 if (a == NULL) return;
278 if ((a->d != NULL) && !(BN_get_flags(a,BN_FLG_STATIC_DATA))) 278 if ((a->d != NULL) && !(BN_get_flags(a,BN_FLG_STATIC_DATA)))
279 Free(a->d); 279 OPENSSL_free(a->d);
280 a->flags|=BN_FLG_FREE; /* REMOVE? */ 280 a->flags|=BN_FLG_FREE; /* REMOVE? */
281 if (a->flags & BN_FLG_MALLOCED) 281 if (a->flags & BN_FLG_MALLOCED)
282 Free(a); 282 OPENSSL_free(a);
283 } 283 }
284 284
285void BN_init(BIGNUM *a) 285void BN_init(BIGNUM *a)
@@ -291,7 +291,7 @@ BIGNUM *BN_new(void)
291 { 291 {
292 BIGNUM *ret; 292 BIGNUM *ret;
293 293
294 if ((ret=(BIGNUM *)Malloc(sizeof(BIGNUM))) == NULL) 294 if ((ret=(BIGNUM *)OPENSSL_malloc(sizeof(BIGNUM))) == NULL)
295 { 295 {
296 BNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE); 296 BNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);
297 return(NULL); 297 return(NULL);
@@ -299,7 +299,7 @@ BIGNUM *BN_new(void)
299 ret->flags=BN_FLG_MALLOCED; 299 ret->flags=BN_FLG_MALLOCED;
300 ret->top=0; 300 ret->top=0;
301 ret->neg=0; 301 ret->neg=0;
302 ret->max=0; 302 ret->dmax=0;
303 ret->d=NULL; 303 ret->d=NULL;
304 return(ret); 304 return(ret);
305 } 305 }
@@ -317,7 +317,7 @@ BIGNUM *bn_expand2(BIGNUM *b, int words)
317 317
318 bn_check_top(b); 318 bn_check_top(b);
319 319
320 if (words > b->max) 320 if (words > b->dmax)
321 { 321 {
322 bn_check_top(b); 322 bn_check_top(b);
323 if (BN_get_flags(b,BN_FLG_STATIC_DATA)) 323 if (BN_get_flags(b,BN_FLG_STATIC_DATA))
@@ -325,7 +325,7 @@ BIGNUM *bn_expand2(BIGNUM *b, int words)
325 BNerr(BN_F_BN_EXPAND2,BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); 325 BNerr(BN_F_BN_EXPAND2,BN_R_EXPAND_ON_STATIC_BIGNUM_DATA);
326 return(NULL); 326 return(NULL);
327 } 327 }
328 a=A=(BN_ULONG *)Malloc(sizeof(BN_ULONG)*(words+1)); 328 a=A=(BN_ULONG *)OPENSSL_malloc(sizeof(BN_ULONG)*(words+1));
329 if (A == NULL) 329 if (A == NULL)
330 { 330 {
331 BNerr(BN_F_BN_EXPAND2,ERR_R_MALLOC_FAILURE); 331 BNerr(BN_F_BN_EXPAND2,ERR_R_MALLOC_FAILURE);
@@ -423,21 +423,21 @@ BIGNUM *bn_expand2(BIGNUM *b, int words)
423 case 0: ; /* ultrix cc workaround, see above */ 423 case 0: ; /* ultrix cc workaround, see above */
424 } 424 }
425#endif 425#endif
426 Free(b->d); 426 OPENSSL_free(b->d);
427 } 427 }
428 428
429 b->d=a; 429 b->d=a;
430 b->max=words; 430 b->dmax=words;
431 431
432 /* Now need to zero any data between b->top and b->max */ 432 /* Now need to zero any data between b->top and b->max */
433 433
434 A= &(b->d[b->top]); 434 A= &(b->d[b->top]);
435 for (i=(b->max - b->top)>>3; i>0; i--,A+=8) 435 for (i=(b->dmax - b->top)>>3; i>0; i--,A+=8)
436 { 436 {
437 A[0]=0; A[1]=0; A[2]=0; A[3]=0; 437 A[0]=0; A[1]=0; A[2]=0; A[3]=0;
438 A[4]=0; A[5]=0; A[6]=0; A[7]=0; 438 A[4]=0; A[5]=0; A[6]=0; A[7]=0;
439 } 439 }
440 for (i=(b->max - b->top)&7; i>0; i--,A++) 440 for (i=(b->dmax - b->top)&7; i>0; i--,A++)
441 A[0]=0; 441 A[0]=0;
442#else 442#else
443 memset(A,0,sizeof(BN_ULONG)*(words+1)); 443 memset(A,0,sizeof(BN_ULONG)*(words+1));
@@ -508,7 +508,7 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
508void BN_clear(BIGNUM *a) 508void BN_clear(BIGNUM *a)
509 { 509 {
510 if (a->d != NULL) 510 if (a->d != NULL)
511 memset(a->d,0,a->max*sizeof(a->d[0])); 511 memset(a->d,0,a->dmax*sizeof(a->d[0]));
512 a->top=0; 512 a->top=0;
513 a->neg=0; 513 a->neg=0;
514 } 514 }
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 598fecbf0c..8cf1febacc 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -85,16 +85,7 @@ int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b,
85 85
86 if (a == b) 86 if (a == b)
87 { 87 {
88#if 0
89 bn_wexpand(tmp,a->top*2);
90 bn_wexpand(tmp2,a->top*4);
91 bn_sqr_recursive(tmp->d,a->d,a->top,tmp2->d);
92 tmp->top=a->top*2;
93 if (tmp->d[tmp->top-1] == 0)
94 tmp->top--;
95#else
96 if (!BN_sqr(tmp,a,ctx)) goto err; 88 if (!BN_sqr(tmp,a,ctx)) goto err;
97#endif
98 } 89 }
99 else 90 else
100 { 91 {
@@ -157,7 +148,22 @@ int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont,
157#endif 148#endif
158 for (i=0; i<nl; i++) 149 for (i=0; i<nl; i++)
159 { 150 {
151#ifdef __TANDEM
152 {
153 long long t1;
154 long long t2;
155 long long t3;
156 t1 = rp[0] * (n0 & 0177777);
157 t2 = 037777600000l;
158 t2 = n0 & t2;
159 t3 = rp[0] & 0177777;
160 t2 = (t3 * t2) & BN_MASK2;
161 t1 = t1 + t2;
162 v=bn_mul_add_words(rp,np,nl,(BN_ULONG) t1);
163 }
164#else
160 v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2); 165 v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2);
166#endif
161 nrp++; 167 nrp++;
162 rp++; 168 rp++;
163 if (((nrp[-1]+=v)&BN_MASK2) >= v) 169 if (((nrp[-1]+=v)&BN_MASK2) >= v)
@@ -175,6 +181,7 @@ int BN_from_montgomery(BIGNUM *ret, BIGNUM *a, BN_MONT_CTX *mont,
175#if 0 181#if 0
176 BN_rshift(ret,r,mont->ri); 182 BN_rshift(ret,r,mont->ri);
177#else 183#else
184 ret->neg = r->neg;
178 x=ri; 185 x=ri;
179 rp=ret->d; 186 rp=ret->d;
180 ap= &(r->d[x]); 187 ap= &(r->d[x]);
@@ -234,7 +241,7 @@ BN_MONT_CTX *BN_MONT_CTX_new(void)
234 { 241 {
235 BN_MONT_CTX *ret; 242 BN_MONT_CTX *ret;
236 243
237 if ((ret=(BN_MONT_CTX *)Malloc(sizeof(BN_MONT_CTX))) == NULL) 244 if ((ret=(BN_MONT_CTX *)OPENSSL_malloc(sizeof(BN_MONT_CTX))) == NULL)
238 return(NULL); 245 return(NULL);
239 246
240 BN_MONT_CTX_init(ret); 247 BN_MONT_CTX_init(ret);
@@ -260,7 +267,7 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
260 BN_free(&(mont->N)); 267 BN_free(&(mont->N));
261 BN_free(&(mont->Ni)); 268 BN_free(&(mont->Ni));
262 if (mont->flags & BN_FLG_MALLOCED) 269 if (mont->flags & BN_FLG_MALLOCED)
263 Free(mont); 270 OPENSSL_free(mont);
264 } 271 }
265 272
266int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) 273int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
@@ -284,7 +291,7 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
284 buf[1]=0; 291 buf[1]=0;
285 tmod.d=buf; 292 tmod.d=buf;
286 tmod.top=1; 293 tmod.top=1;
287 tmod.max=2; 294 tmod.dmax=2;
288 tmod.neg=mod->neg; 295 tmod.neg=mod->neg;
289 /* Ri = R^-1 mod N*/ 296 /* Ri = R^-1 mod N*/
290 if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL) 297 if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL)
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c
index 3e8baaad9a..3e8d8b9567 100644
--- a/src/lib/libcrypto/bn/bn_mul.c
+++ b/src/lib/libcrypto/bn/bn_mul.c
@@ -631,7 +631,6 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
631 631
632 al=a->top; 632 al=a->top;
633 bl=b->top; 633 bl=b->top;
634 r->neg=a->neg^b->neg;
635 634
636 if ((al == 0) || (bl == 0)) 635 if ((al == 0) || (bl == 0))
637 { 636 {
@@ -647,6 +646,7 @@ int BN_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx)
647 } 646 }
648 else 647 else
649 rr = r; 648 rr = r;
649 rr->neg=a->neg^b->neg;
650 650
651#if defined(BN_MUL_COMBA) || defined(BN_RECURSION) 651#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
652 i = al-bl; 652 i = al-bl;
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c
index 782a96e7e0..532e66bcc3 100644
--- a/src/lib/libcrypto/bn/bn_print.c
+++ b/src/lib/libcrypto/bn/bn_print.c
@@ -64,14 +64,14 @@
64 64
65static const char *Hex="0123456789ABCDEF"; 65static const char *Hex="0123456789ABCDEF";
66 66
67/* Must 'Free' the returned data */ 67/* Must 'OPENSSL_free' the returned data */
68char *BN_bn2hex(const BIGNUM *a) 68char *BN_bn2hex(const BIGNUM *a)
69 { 69 {
70 int i,j,v,z=0; 70 int i,j,v,z=0;
71 char *buf; 71 char *buf;
72 char *p; 72 char *p;
73 73
74 buf=(char *)Malloc(a->top*BN_BYTES*2+2); 74 buf=(char *)OPENSSL_malloc(a->top*BN_BYTES*2+2);
75 if (buf == NULL) 75 if (buf == NULL)
76 { 76 {
77 BNerr(BN_F_BN_BN2HEX,ERR_R_MALLOC_FAILURE); 77 BNerr(BN_F_BN_BN2HEX,ERR_R_MALLOC_FAILURE);
@@ -99,7 +99,7 @@ err:
99 return(buf); 99 return(buf);
100 } 100 }
101 101
102/* Must 'Free' the returned data */ 102/* Must 'OPENSSL_free' the returned data */
103char *BN_bn2dec(const BIGNUM *a) 103char *BN_bn2dec(const BIGNUM *a)
104 { 104 {
105 int i=0,num; 105 int i=0,num;
@@ -110,8 +110,8 @@ char *BN_bn2dec(const BIGNUM *a)
110 110
111 i=BN_num_bits(a)*3; 111 i=BN_num_bits(a)*3;
112 num=(i/10+i/1000+3)+1; 112 num=(i/10+i/1000+3)+1;
113 bn_data=(BN_ULONG *)Malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG)); 113 bn_data=(BN_ULONG *)OPENSSL_malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG));
114 buf=(char *)Malloc(num+3); 114 buf=(char *)OPENSSL_malloc(num+3);
115 if ((buf == NULL) || (bn_data == NULL)) 115 if ((buf == NULL) || (bn_data == NULL))
116 { 116 {
117 BNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE); 117 BNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE);
@@ -149,7 +149,7 @@ char *BN_bn2dec(const BIGNUM *a)
149 } 149 }
150 } 150 }
151err: 151err:
152 if (bn_data != NULL) Free(bn_data); 152 if (bn_data != NULL) OPENSSL_free(bn_data);
153 if (t != NULL) BN_free(t); 153 if (t != NULL) BN_free(t);
154 return(buf); 154 return(buf);
155 } 155 }
diff --git a/src/lib/libcrypto/bn/bn_rand.c b/src/lib/libcrypto/bn/bn_rand.c
index 943712c15b..21ecbc04ed 100644
--- a/src/lib/libcrypto/bn/bn_rand.c
+++ b/src/lib/libcrypto/bn/bn_rand.c
@@ -68,11 +68,17 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom)
68 int ret=0,bit,bytes,mask; 68 int ret=0,bit,bytes,mask;
69 time_t tim; 69 time_t tim;
70 70
71 if (bits == 0)
72 {
73 BN_zero(rnd);
74 return 1;
75 }
76
71 bytes=(bits+7)/8; 77 bytes=(bits+7)/8;
72 bit=(bits-1)%8; 78 bit=(bits-1)%8;
73 mask=0xff<<bit; 79 mask=0xff<<bit;
74 80
75 buf=(unsigned char *)Malloc(bytes); 81 buf=(unsigned char *)OPENSSL_malloc(bytes);
76 if (buf == NULL) 82 if (buf == NULL)
77 { 83 {
78 BNerr(BN_F_BN_RAND,ERR_R_MALLOC_FAILURE); 84 BNerr(BN_F_BN_RAND,ERR_R_MALLOC_FAILURE);
@@ -120,7 +126,7 @@ err:
120 if (buf != NULL) 126 if (buf != NULL)
121 { 127 {
122 memset(buf,0,bytes); 128 memset(buf,0,bytes);
123 Free(buf); 129 OPENSSL_free(buf);
124 } 130 }
125 return(ret); 131 return(ret);
126 } 132 }
diff --git a/src/lib/libcrypto/bn/bn_recp.c b/src/lib/libcrypto/bn/bn_recp.c
index a8796bd0aa..d019941d6b 100644
--- a/src/lib/libcrypto/bn/bn_recp.c
+++ b/src/lib/libcrypto/bn/bn_recp.c
@@ -72,7 +72,7 @@ BN_RECP_CTX *BN_RECP_CTX_new(void)
72 { 72 {
73 BN_RECP_CTX *ret; 73 BN_RECP_CTX *ret;
74 74
75 if ((ret=(BN_RECP_CTX *)Malloc(sizeof(BN_RECP_CTX))) == NULL) 75 if ((ret=(BN_RECP_CTX *)OPENSSL_malloc(sizeof(BN_RECP_CTX))) == NULL)
76 return(NULL); 76 return(NULL);
77 77
78 BN_RECP_CTX_init(ret); 78 BN_RECP_CTX_init(ret);
@@ -88,7 +88,7 @@ void BN_RECP_CTX_free(BN_RECP_CTX *recp)
88 BN_free(&(recp->N)); 88 BN_free(&(recp->N));
89 BN_free(&(recp->Nr)); 89 BN_free(&(recp->Nr));
90 if (recp->flags & BN_FLG_MALLOCED) 90 if (recp->flags & BN_FLG_MALLOCED)
91 Free(recp); 91 OPENSSL_free(recp);
92 } 92 }
93 93
94int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx) 94int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
diff --git a/src/lib/libcrypto/bn/bn_shift.c b/src/lib/libcrypto/bn/bn_shift.c
index 61aae65a6b..0883247384 100644
--- a/src/lib/libcrypto/bn/bn_shift.c
+++ b/src/lib/libcrypto/bn/bn_shift.c
@@ -162,7 +162,7 @@ int BN_rshift(BIGNUM *r, BIGNUM *a, int n)
162 nw=n/BN_BITS2; 162 nw=n/BN_BITS2;
163 rb=n%BN_BITS2; 163 rb=n%BN_BITS2;
164 lb=BN_BITS2-rb; 164 lb=BN_BITS2-rb;
165 if (nw > a->top) 165 if (nw > a->top || a->top == 0)
166 { 166 {
167 BN_zero(r); 167 BN_zero(r);
168 return(1); 168 return(1);
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c
index fe00c5f69a..75f4f38392 100644
--- a/src/lib/libcrypto/bn/bn_sqr.c
+++ b/src/lib/libcrypto/bn/bn_sqr.c
@@ -188,7 +188,7 @@ void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp)
188 188
189#ifdef BN_RECURSION 189#ifdef BN_RECURSION
190/* r is 2*n words in size, 190/* r is 2*n words in size,
191 * a and b are both n words in size. 191 * a and b are both n words in size. (There's not actually a 'b' here ...)
192 * n must be a power of 2. 192 * n must be a power of 2.
193 * We multiply and return the result. 193 * We multiply and return the result.
194 * t must be 2*n words in size 194 * t must be 2*n words in size
diff --git a/src/lib/libcrypto/bn/bn_word.c b/src/lib/libcrypto/bn/bn_word.c
index 73157a7d43..cd59baa2c4 100644
--- a/src/lib/libcrypto/bn/bn_word.c
+++ b/src/lib/libcrypto/bn/bn_word.c
@@ -115,7 +115,7 @@ int BN_add_word(BIGNUM *a, BN_ULONG w)
115 a->neg=0; 115 a->neg=0;
116 i=BN_sub_word(a,w); 116 i=BN_sub_word(a,w);
117 if (!BN_is_zero(a)) 117 if (!BN_is_zero(a))
118 a->neg=1; 118 a->neg=!(a->neg);
119 return(i); 119 return(i);
120 } 120 }
121 w&=BN_MASK2; 121 w&=BN_MASK2;
@@ -140,7 +140,7 @@ int BN_sub_word(BIGNUM *a, BN_ULONG w)
140 { 140 {
141 int i; 141 int i;
142 142
143 if (a->neg) 143 if (BN_is_zero(a) || a->neg)
144 { 144 {
145 a->neg=0; 145 a->neg=0;
146 i=BN_add_word(a,w); 146 i=BN_add_word(a,w);
@@ -182,11 +182,16 @@ int BN_mul_word(BIGNUM *a, BN_ULONG w)
182 w&=BN_MASK2; 182 w&=BN_MASK2;
183 if (a->top) 183 if (a->top)
184 { 184 {
185 ll=bn_mul_words(a->d,a->d,a->top,w); 185 if (w == 0)
186 if (ll) 186 BN_zero(a);
187 else
187 { 188 {
188 if (bn_wexpand(a,a->top+1) == NULL) return(0); 189 ll=bn_mul_words(a->d,a->d,a->top,w);
189 a->d[a->top++]=ll; 190 if (ll)
191 {
192 if (bn_wexpand(a,a->top+1) == NULL) return(0);
193 a->d[a->top++]=ll;
194 }
190 } 195 }
191 } 196 }
192 return(1); 197 return(1);
diff --git a/src/lib/libcrypto/bn/vms-helper.c b/src/lib/libcrypto/bn/vms-helper.c
index 73af337069..0fa79c4edb 100644
--- a/src/lib/libcrypto/bn/vms-helper.c
+++ b/src/lib/libcrypto/bn/vms-helper.c
@@ -59,8 +59,10 @@
59 59
60bn_div_words_abort(int i) 60bn_div_words_abort(int i)
61{ 61{
62#ifdef BN_DEBUG
62#if !defined(NO_STDIO) && !defined(WIN16) 63#if !defined(NO_STDIO) && !defined(WIN16)
63 fprintf(stderr,"Division would overflow (%d)\n",i); 64 fprintf(stderr,"Division would overflow (%d)\n",i);
64#endif 65#endif
65 abort(); 66 abort();
67#endif
66} 68}
diff --git a/src/lib/libcrypto/buffer/Makefile.ssl b/src/lib/libcrypto/buffer/Makefile.ssl
index 506708c37f..f473d1ab4b 100644
--- a/src/lib/libcrypto/buffer/Makefile.ssl
+++ b/src/lib/libcrypto/buffer/Makefile.ssl
@@ -78,10 +78,15 @@ clean:
78 78
79# DO NOT DELETE THIS LINE -- make depend depends on it. 79# DO NOT DELETE THIS LINE -- make depend depends on it.
80 80
81buf_err.o: ../../include/openssl/buffer.h ../../include/openssl/err.h 81buf_err.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
82buf_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
83buf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
84buf_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
85buf_err.o: ../../include/openssl/symhacks.h
82buffer.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 86buffer.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
83buffer.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 87buffer.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
84buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 88buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
85buffer.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 89buffer.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
86buffer.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 90buffer.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
91buffer.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
87buffer.o: ../cryptlib.h 92buffer.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/buffer/buffer.c b/src/lib/libcrypto/buffer/buffer.c
index c3a108ea52..b76ff3ad7a 100644
--- a/src/lib/libcrypto/buffer/buffer.c
+++ b/src/lib/libcrypto/buffer/buffer.c
@@ -64,7 +64,7 @@ BUF_MEM *BUF_MEM_new(void)
64 { 64 {
65 BUF_MEM *ret; 65 BUF_MEM *ret;
66 66
67 ret=Malloc(sizeof(BUF_MEM)); 67 ret=OPENSSL_malloc(sizeof(BUF_MEM));
68 if (ret == NULL) 68 if (ret == NULL)
69 { 69 {
70 BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE); 70 BUFerr(BUF_F_BUF_MEM_NEW,ERR_R_MALLOC_FAILURE);
@@ -84,9 +84,9 @@ void BUF_MEM_free(BUF_MEM *a)
84 if (a->data != NULL) 84 if (a->data != NULL)
85 { 85 {
86 memset(a->data,0,(unsigned int)a->max); 86 memset(a->data,0,(unsigned int)a->max);
87 Free(a->data); 87 OPENSSL_free(a->data);
88 } 88 }
89 Free(a); 89 OPENSSL_free(a);
90 } 90 }
91 91
92int BUF_MEM_grow(BUF_MEM *str, int len) 92int BUF_MEM_grow(BUF_MEM *str, int len)
@@ -107,9 +107,9 @@ int BUF_MEM_grow(BUF_MEM *str, int len)
107 } 107 }
108 n=(len+3)/3*4; 108 n=(len+3)/3*4;
109 if (str->data == NULL) 109 if (str->data == NULL)
110 ret=Malloc(n); 110 ret=OPENSSL_malloc(n);
111 else 111 else
112 ret=Realloc(str->data,n); 112 ret=OPENSSL_realloc(str->data,n);
113 if (ret == NULL) 113 if (ret == NULL)
114 { 114 {
115 BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE); 115 BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE);
@@ -132,7 +132,7 @@ char *BUF_strdup(const char *str)
132 if (str == NULL) return(NULL); 132 if (str == NULL) return(NULL);
133 133
134 n=strlen(str); 134 n=strlen(str);
135 ret=Malloc(n+1); 135 ret=OPENSSL_malloc(n+1);
136 if (ret == NULL) 136 if (ret == NULL)
137 { 137 {
138 BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE); 138 BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libcrypto/cast/c_skey.c b/src/lib/libcrypto/cast/c_skey.c
index acf2c3eeb5..76e40005c9 100644
--- a/src/lib/libcrypto/cast/c_skey.c
+++ b/src/lib/libcrypto/cast/c_skey.c
@@ -72,7 +72,7 @@
72#define S6 CAST_S_table6 72#define S6 CAST_S_table6
73#define S7 CAST_S_table7 73#define S7 CAST_S_table7
74 74
75void CAST_set_key(CAST_KEY *key, int len, unsigned char *data) 75void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data)
76 { 76 {
77 CAST_LONG x[16]; 77 CAST_LONG x[16];
78 CAST_LONG z[16]; 78 CAST_LONG z[16];
diff --git a/src/lib/libcrypto/cast/cast.h b/src/lib/libcrypto/cast/cast.h
index 6cc5e8aa8c..e24e133099 100644
--- a/src/lib/libcrypto/cast/cast.h
+++ b/src/lib/libcrypto/cast/cast.h
@@ -82,7 +82,7 @@ typedef struct cast_key_st
82 } CAST_KEY; 82 } CAST_KEY;
83 83
84 84
85void CAST_set_key(CAST_KEY *key, int len, unsigned char *data); 85void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
86void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key, 86void CAST_ecb_encrypt(const unsigned char *in,unsigned char *out,CAST_KEY *key,
87 int enc); 87 int enc);
88void CAST_encrypt(CAST_LONG *data,CAST_KEY *key); 88void CAST_encrypt(CAST_LONG *data,CAST_KEY *key);
diff --git a/src/lib/libcrypto/comp/Makefile.ssl b/src/lib/libcrypto/comp/Makefile.ssl
index 336864a995..39e7993416 100644
--- a/src/lib/libcrypto/comp/Makefile.ssl
+++ b/src/lib/libcrypto/comp/Makefile.ssl
@@ -83,17 +83,19 @@ clean:
83 83
84c_rle.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 84c_rle.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
85c_rle.o: ../../include/openssl/bn.h ../../include/openssl/comp.h 85c_rle.o: ../../include/openssl/bn.h ../../include/openssl/comp.h
86c_rle.o: ../../include/openssl/crypto.h ../../include/openssl/objects.h 86c_rle.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
87c_rle.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 87c_rle.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
88c_rle.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 88c_rle.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
89c_rle.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
89c_zlib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 90c_zlib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
90c_zlib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h 91c_zlib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h
91c_zlib.o: ../../include/openssl/crypto.h ../../include/openssl/objects.h 92c_zlib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
92c_zlib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 93c_zlib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
93c_zlib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 94c_zlib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
95c_zlib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
94comp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 96comp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
95comp_lib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h 97comp_lib.o: ../../include/openssl/bn.h ../../include/openssl/comp.h
96comp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/objects.h 98comp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/obj_mac.h
97comp_lib.o: ../../include/openssl/opensslconf.h 99comp_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
98comp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 100comp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
99comp_lib.o: ../../include/openssl/stack.h 101comp_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
diff --git a/src/lib/libcrypto/comp/comp.h b/src/lib/libcrypto/comp/comp.h
index 811cb5833d..0922609542 100644
--- a/src/lib/libcrypto/comp/comp.h
+++ b/src/lib/libcrypto/comp/comp.h
@@ -2,12 +2,12 @@
2#ifndef HEADER_COMP_H 2#ifndef HEADER_COMP_H
3#define HEADER_COMP_H 3#define HEADER_COMP_H
4 4
5#include <openssl/crypto.h>
6
5#ifdef __cplusplus 7#ifdef __cplusplus
6extern "C" { 8extern "C" {
7#endif 9#endif
8 10
9#include <openssl/crypto.h>
10
11typedef struct comp_method_st 11typedef struct comp_method_st
12 { 12 {
13 int type; /* NID for compression library */ 13 int type; /* NID for compression library */
diff --git a/src/lib/libcrypto/comp/comp_lib.c b/src/lib/libcrypto/comp/comp_lib.c
index a67ef23bc0..beb98ce8cc 100644
--- a/src/lib/libcrypto/comp/comp_lib.c
+++ b/src/lib/libcrypto/comp/comp_lib.c
@@ -8,7 +8,7 @@ COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
8 { 8 {
9 COMP_CTX *ret; 9 COMP_CTX *ret;
10 10
11 if ((ret=(COMP_CTX *)Malloc(sizeof(COMP_CTX))) == NULL) 11 if ((ret=(COMP_CTX *)OPENSSL_malloc(sizeof(COMP_CTX))) == NULL)
12 { 12 {
13 /* ZZZZZZZZZZZZZZZZ */ 13 /* ZZZZZZZZZZZZZZZZ */
14 return(NULL); 14 return(NULL);
@@ -17,7 +17,7 @@ COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
17 ret->meth=meth; 17 ret->meth=meth;
18 if ((ret->meth->init != NULL) && !ret->meth->init(ret)) 18 if ((ret->meth->init != NULL) && !ret->meth->init(ret))
19 { 19 {
20 Free(ret); 20 OPENSSL_free(ret);
21 ret=NULL; 21 ret=NULL;
22 } 22 }
23#if 0 23#if 0
@@ -37,7 +37,7 @@ void COMP_CTX_free(COMP_CTX *ctx)
37 if (ctx->meth->finish != NULL) 37 if (ctx->meth->finish != NULL)
38 ctx->meth->finish(ctx); 38 ctx->meth->finish(ctx);
39 39
40 Free(ctx); 40 OPENSSL_free(ctx);
41 } 41 }
42 42
43int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 43int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
diff --git a/src/lib/libcrypto/conf/Makefile.ssl b/src/lib/libcrypto/conf/Makefile.ssl
index 9dbb2b276a..efbb578981 100644
--- a/src/lib/libcrypto/conf/Makefile.ssl
+++ b/src/lib/libcrypto/conf/Makefile.ssl
@@ -22,14 +22,14 @@ TEST=
22APPS= 22APPS=
23 23
24LIB=$(TOP)/libcrypto.a 24LIB=$(TOP)/libcrypto.a
25LIBSRC= conf.c conf_err.c 25LIBSRC= conf_err.c conf_lib.c conf_api.c conf_def.c
26 26
27LIBOBJ= conf.o conf_err.o 27LIBOBJ= conf_err.o conf_lib.o conf_api.o conf_def.o
28 28
29SRC= $(LIBSRC) 29SRC= $(LIBSRC)
30 30
31EXHEADER= conf.h 31EXHEADER= conf.h conf_api.h
32HEADER= conf_lcl.h $(EXHEADER) 32HEADER= conf_def.h $(EXHEADER)
33 33
34ALL= $(GENERAL) $(SRC) $(HEADER) 34ALL= $(GENERAL) $(SRC) $(HEADER)
35 35
@@ -79,14 +79,30 @@ clean:
79 79
80# DO NOT DELETE THIS LINE -- make depend depends on it. 80# DO NOT DELETE THIS LINE -- make depend depends on it.
81 81
82conf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 82conf_api.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
83conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 83conf_api.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
84conf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 84conf_api.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
85conf.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 85conf_api.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
86conf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 86conf_api.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
87conf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 87conf_api.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
88conf.o: ../cryptlib.h conf_lcl.h 88conf_def.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
89conf_def.o: ../../include/openssl/conf.h ../../include/openssl/conf_api.h
90conf_def.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
91conf_def.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
92conf_def.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
93conf_def.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
94conf_def.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
95conf_def.o: conf_def.h
89conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h 96conf_err.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
90conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h 97conf_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
91conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h 98conf_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
92conf_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 99conf_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
100conf_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
101conf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
102conf_lib.o: ../../include/openssl/bio.h ../../include/openssl/conf.h
103conf_lib.o: ../../include/openssl/conf_api.h ../../include/openssl/crypto.h
104conf_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
105conf_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
106conf_lib.o: ../../include/openssl/opensslconf.h
107conf_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
108conf_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
diff --git a/src/lib/libcrypto/conf/conf.c b/src/lib/libcrypto/conf/conf.c
index 3031fa3b44..e69de29bb2 100644
--- a/src/lib/libcrypto/conf/conf.c
+++ b/src/lib/libcrypto/conf/conf.c
@@ -1,730 +0,0 @@
1/* crypto/conf/conf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <errno.h>
61#include "cryptlib.h"
62#include <openssl/stack.h>
63#include <openssl/lhash.h>
64#include <openssl/conf.h>
65#include <openssl/buffer.h>
66#include <openssl/err.h>
67
68#include "conf_lcl.h"
69
70static void value_free_hash(CONF_VALUE *a, LHASH *conf);
71static void value_free_stack(CONF_VALUE *a,LHASH *conf);
72static unsigned long hash(CONF_VALUE *v);
73static int cmp_conf(CONF_VALUE *a,CONF_VALUE *b);
74static char *eat_ws(char *p);
75static char *eat_alpha_numeric(char *p);
76static void clear_comments(char *p);
77static int str_copy(LHASH *conf,char *section,char **to, char *from);
78static char *scan_quote(char *p);
79static CONF_VALUE *new_section(LHASH *conf,char *section);
80static CONF_VALUE *get_section(LHASH *conf,char *section);
81#define scan_esc(p) ((((p)[1] == '\0')?(p++):(p+=2)),p)
82
83const char *CONF_version="CONF" OPENSSL_VERSION_PTEXT;
84
85
86LHASH *CONF_load(LHASH *h, const char *file, long *line)
87 {
88 LHASH *ltmp;
89 BIO *in=NULL;
90
91#ifdef VMS
92 in=BIO_new_file(file, "r");
93#else
94 in=BIO_new_file(file, "rb");
95#endif
96 if (in == NULL)
97 {
98 CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
99 return NULL;
100 }
101
102 ltmp = CONF_load_bio(h, in, line);
103 BIO_free(in);
104
105 return ltmp;
106}
107#ifndef NO_FP_API
108LHASH *CONF_load_fp(LHASH *h, FILE *in, long *line)
109{
110 BIO *btmp;
111 LHASH *ltmp;
112 if(!(btmp = BIO_new_fp(in, BIO_NOCLOSE))) {
113 CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB);
114 return NULL;
115 }
116 ltmp = CONF_load_bio(h, btmp, line);
117 BIO_free(btmp);
118 return ltmp;
119}
120#endif
121
122LHASH *CONF_load_bio(LHASH *h, BIO *in, long *line)
123 {
124 LHASH *ret=NULL;
125#define BUFSIZE 512
126 char btmp[16];
127 int bufnum=0,i,ii;
128 BUF_MEM *buff=NULL;
129 char *s,*p,*end;
130 int again,n;
131 long eline=0;
132 CONF_VALUE *v=NULL,*vv,*tv;
133 CONF_VALUE *sv=NULL;
134 char *section=NULL,*buf;
135 STACK_OF(CONF_VALUE) *section_sk=NULL,*ts;
136 char *start,*psection,*pname;
137
138 if ((buff=BUF_MEM_new()) == NULL)
139 {
140 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
141 goto err;
142 }
143
144 section=(char *)Malloc(10);
145 if (section == NULL)
146 {
147 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
148 goto err;
149 }
150 strcpy(section,"default");
151
152 if (h == NULL)
153 {
154 if ((ret=lh_new(hash,cmp_conf)) == NULL)
155 {
156 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
157 goto err;
158 }
159 }
160 else
161 ret=h;
162
163 sv=new_section(ret,section);
164 if (sv == NULL)
165 {
166 CONFerr(CONF_F_CONF_LOAD_BIO,
167 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
168 goto err;
169 }
170 section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
171
172 bufnum=0;
173 for (;;)
174 {
175 again=0;
176 if (!BUF_MEM_grow(buff,bufnum+BUFSIZE))
177 {
178 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
179 goto err;
180 }
181 p= &(buff->data[bufnum]);
182 *p='\0';
183 BIO_gets(in, p, BUFSIZE-1);
184 p[BUFSIZE-1]='\0';
185 ii=i=strlen(p);
186 if (i == 0) break;
187 while (i > 0)
188 {
189 if ((p[i-1] != '\r') && (p[i-1] != '\n'))
190 break;
191 else
192 i--;
193 }
194 /* we removed some trailing stuff so there is a new
195 * line on the end. */
196 if (i == ii)
197 again=1; /* long line */
198 else
199 {
200 p[i]='\0';
201 eline++; /* another input line */
202 }
203
204 /* we now have a line with trailing \r\n removed */
205
206 /* i is the number of bytes */
207 bufnum+=i;
208
209 v=NULL;
210 /* check for line continuation */
211 if (bufnum >= 1)
212 {
213 /* If we have bytes and the last char '\\' and
214 * second last char is not '\\' */
215 p= &(buff->data[bufnum-1]);
216 if ( IS_ESC(p[0]) &&
217 ((bufnum <= 1) || !IS_ESC(p[-1])))
218 {
219 bufnum--;
220 again=1;
221 }
222 }
223 if (again) continue;
224 bufnum=0;
225 buf=buff->data;
226
227 clear_comments(buf);
228 n=strlen(buf);
229 s=eat_ws(buf);
230 if (IS_EOF(*s)) continue; /* blank line */
231 if (*s == '[')
232 {
233 char *ss;
234
235 s++;
236 start=eat_ws(s);
237 ss=start;
238again:
239 end=eat_alpha_numeric(ss);
240 p=eat_ws(end);
241 if (*p != ']')
242 {
243 if (*p != '\0')
244 {
245 ss=p;
246 goto again;
247 }
248 CONFerr(CONF_F_CONF_LOAD_BIO,
249 CONF_R_MISSING_CLOSE_SQUARE_BRACKET);
250 goto err;
251 }
252 *end='\0';
253 if (!str_copy(ret,NULL,&section,start)) goto err;
254 if ((sv=get_section(ret,section)) == NULL)
255 sv=new_section(ret,section);
256 if (sv == NULL)
257 {
258 CONFerr(CONF_F_CONF_LOAD_BIO,
259 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
260 goto err;
261 }
262 section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
263 continue;
264 }
265 else
266 {
267 pname=s;
268 psection=NULL;
269 end=eat_alpha_numeric(s);
270 if ((end[0] == ':') && (end[1] == ':'))
271 {
272 *end='\0';
273 end+=2;
274 psection=pname;
275 pname=end;
276 end=eat_alpha_numeric(end);
277 }
278 p=eat_ws(end);
279 if (*p != '=')
280 {
281 CONFerr(CONF_F_CONF_LOAD_BIO,
282 CONF_R_MISSING_EQUAL_SIGN);
283 goto err;
284 }
285 *end='\0';
286 p++;
287 start=eat_ws(p);
288 while (!IS_EOF(*p))
289 p++;
290 p--;
291 while ((p != start) && (IS_WS(*p)))
292 p--;
293 p++;
294 *p='\0';
295
296 if (!(v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE))))
297 {
298 CONFerr(CONF_F_CONF_LOAD_BIO,
299 ERR_R_MALLOC_FAILURE);
300 goto err;
301 }
302 if (psection == NULL) psection=section;
303 v->name=(char *)Malloc(strlen(pname)+1);
304 v->value=NULL;
305 if (v->name == NULL)
306 {
307 CONFerr(CONF_F_CONF_LOAD_BIO,
308 ERR_R_MALLOC_FAILURE);
309 goto err;
310 }
311 strcpy(v->name,pname);
312 if (!str_copy(ret,psection,&(v->value),start)) goto err;
313
314 if (strcmp(psection,section) != 0)
315 {
316 if ((tv=get_section(ret,psection))
317 == NULL)
318 tv=new_section(ret,psection);
319 if (tv == NULL)
320 {
321 CONFerr(CONF_F_CONF_LOAD_BIO,
322 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
323 goto err;
324 }
325 ts=(STACK_OF(CONF_VALUE) *)tv->value;
326 }
327 else
328 {
329 tv=sv;
330 ts=section_sk;
331 }
332 v->section=tv->section;
333 if (!sk_CONF_VALUE_push(ts,v))
334 {
335 CONFerr(CONF_F_CONF_LOAD_BIO,
336 ERR_R_MALLOC_FAILURE);
337 goto err;
338 }
339 vv=(CONF_VALUE *)lh_insert(ret,v);
340 if (vv != NULL)
341 {
342 sk_CONF_VALUE_delete_ptr(ts,vv);
343 Free(vv->name);
344 Free(vv->value);
345 Free(vv);
346 }
347 v=NULL;
348 }
349 }
350 if (buff != NULL) BUF_MEM_free(buff);
351 if (section != NULL) Free(section);
352 return(ret);
353err:
354 if (buff != NULL) BUF_MEM_free(buff);
355 if (section != NULL) Free(section);
356 if (line != NULL) *line=eline;
357 sprintf(btmp,"%ld",eline);
358 ERR_add_error_data(2,"line ",btmp);
359 if ((h != ret) && (ret != NULL)) CONF_free(ret);
360 if (v != NULL)
361 {
362 if (v->name != NULL) Free(v->name);
363 if (v->value != NULL) Free(v->value);
364 if (v != NULL) Free(v);
365 }
366 return(NULL);
367 }
368
369char *CONF_get_string(LHASH *conf, char *section, char *name)
370 {
371 CONF_VALUE *v,vv;
372 char *p;
373
374 if (name == NULL) return(NULL);
375 if (conf != NULL)
376 {
377 if (section != NULL)
378 {
379 vv.name=name;
380 vv.section=section;
381 v=(CONF_VALUE *)lh_retrieve(conf,&vv);
382 if (v != NULL) return(v->value);
383 if (strcmp(section,"ENV") == 0)
384 {
385 p=Getenv(name);
386 if (p != NULL) return(p);
387 }
388 }
389 vv.section="default";
390 vv.name=name;
391 v=(CONF_VALUE *)lh_retrieve(conf,&vv);
392 if (v != NULL)
393 return(v->value);
394 else
395 return(NULL);
396 }
397 else
398 return(Getenv(name));
399 }
400
401static CONF_VALUE *get_section(LHASH *conf, char *section)
402 {
403 CONF_VALUE *v,vv;
404
405 if ((conf == NULL) || (section == NULL)) return(NULL);
406 vv.name=NULL;
407 vv.section=section;
408 v=(CONF_VALUE *)lh_retrieve(conf,&vv);
409 return(v);
410 }
411
412STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf, char *section)
413 {
414 CONF_VALUE *v;
415
416 v=get_section(conf,section);
417 if (v != NULL)
418 return((STACK_OF(CONF_VALUE) *)v->value);
419 else
420 return(NULL);
421 }
422
423long CONF_get_number(LHASH *conf, char *section, char *name)
424 {
425 char *str;
426 long ret=0;
427
428 str=CONF_get_string(conf,section,name);
429 if (str == NULL) return(0);
430 for (;;)
431 {
432 if (IS_NUMER(*str))
433 ret=ret*10+(*str -'0');
434 else
435 return(ret);
436 str++;
437 }
438 }
439
440void CONF_free(LHASH *conf)
441 {
442 if (conf == NULL) return;
443
444 conf->down_load=0; /* evil thing to make sure the 'Free()'
445 * works as expected */
446 lh_doall_arg(conf,(void (*)())value_free_hash,conf);
447
448 /* We now have only 'section' entries in the hash table.
449 * Due to problems with */
450
451 lh_doall_arg(conf,(void (*)())value_free_stack,conf);
452 lh_free(conf);
453 }
454
455static void value_free_hash(CONF_VALUE *a, LHASH *conf)
456 {
457 if (a->name != NULL)
458 {
459 a=(CONF_VALUE *)lh_delete(conf,a);
460 }
461 }
462
463static void value_free_stack(CONF_VALUE *a, LHASH *conf)
464 {
465 CONF_VALUE *vv;
466 STACK *sk;
467 int i;
468
469 if (a->name != NULL) return;
470
471 sk=(STACK *)a->value;
472 for (i=sk_num(sk)-1; i>=0; i--)
473 {
474 vv=(CONF_VALUE *)sk_value(sk,i);
475 Free(vv->value);
476 Free(vv->name);
477 Free(vv);
478 }
479 if (sk != NULL) sk_free(sk);
480 Free(a->section);
481 Free(a);
482 }
483
484static void clear_comments(char *p)
485 {
486 char *to;
487
488 to=p;
489 for (;;)
490 {
491 if (IS_COMMENT(*p))
492 {
493 *p='\0';
494 return;
495 }
496 if (IS_QUOTE(*p))
497 {
498 p=scan_quote(p);
499 continue;
500 }
501 if (IS_ESC(*p))
502 {
503 p=scan_esc(p);
504 continue;
505 }
506 if (IS_EOF(*p))
507 return;
508 else
509 p++;
510 }
511 }
512
513static int str_copy(LHASH *conf, char *section, char **pto, char *from)
514 {
515 int q,r,rr=0,to=0,len=0;
516 char *s,*e,*rp,*p,*rrp,*np,*cp,v;
517 BUF_MEM *buf;
518
519 if ((buf=BUF_MEM_new()) == NULL) return(0);
520
521 len=strlen(from)+1;
522 if (!BUF_MEM_grow(buf,len)) goto err;
523
524 for (;;)
525 {
526 if (IS_QUOTE(*from))
527 {
528 q= *from;
529 from++;
530 while ((*from != '\0') && (*from != q))
531 {
532 if (*from == '\\')
533 {
534 from++;
535 if (*from == '\0') break;
536 }
537 buf->data[to++]= *(from++);
538 }
539 }
540 else if (*from == '\\')
541 {
542 from++;
543 v= *(from++);
544 if (v == '\0') break;
545 else if (v == 'r') v='\r';
546 else if (v == 'n') v='\n';
547 else if (v == 'b') v='\b';
548 else if (v == 't') v='\t';
549 buf->data[to++]= v;
550 }
551 else if (*from == '\0')
552 break;
553 else if (*from == '$')
554 {
555 /* try to expand it */
556 rrp=NULL;
557 s= &(from[1]);
558 if (*s == '{')
559 q='}';
560 else if (*s == '(')
561 q=')';
562 else q=0;
563
564 if (q) s++;
565 cp=section;
566 e=np=s;
567 while (IS_ALPHA_NUMERIC(*e))
568 e++;
569 if ((e[0] == ':') && (e[1] == ':'))
570 {
571 cp=np;
572 rrp=e;
573 rr= *e;
574 *rrp='\0';
575 e+=2;
576 np=e;
577 while (IS_ALPHA_NUMERIC(*e))
578 e++;
579 }
580 r= *e;
581 *e='\0';
582 rp=e;
583 if (q)
584 {
585 if (r != q)
586 {
587 CONFerr(CONF_F_STR_COPY,CONF_R_NO_CLOSE_BRACE);
588 goto err;
589 }
590 e++;
591 }
592 /* So at this point we have
593 * ns which is the start of the name string which is
594 * '\0' terminated.
595 * cs which is the start of the section string which is
596 * '\0' terminated.
597 * e is the 'next point after'.
598 * r and s are the chars replaced by the '\0'
599 * rp and sp is where 'r' and 's' came from.
600 */
601 p=CONF_get_string(conf,cp,np);
602 if (rrp != NULL) *rrp=rr;
603 *rp=r;
604 if (p == NULL)
605 {
606 CONFerr(CONF_F_STR_COPY,CONF_R_VARIABLE_HAS_NO_VALUE);
607 goto err;
608 }
609 BUF_MEM_grow(buf,(strlen(p)+len-(e-from)));
610 while (*p)
611 buf->data[to++]= *(p++);
612 from=e;
613 }
614 else
615 buf->data[to++]= *(from++);
616 }
617 buf->data[to]='\0';
618 if (*pto != NULL) Free(*pto);
619 *pto=buf->data;
620 Free(buf);
621 return(1);
622err:
623 if (buf != NULL) BUF_MEM_free(buf);
624 return(0);
625 }
626
627static char *eat_ws(char *p)
628 {
629 while (IS_WS(*p) && (!IS_EOF(*p)))
630 p++;
631 return(p);
632 }
633
634static char *eat_alpha_numeric(char *p)
635 {
636 for (;;)
637 {
638 if (IS_ESC(*p))
639 {
640 p=scan_esc(p);
641 continue;
642 }
643 if (!IS_ALPHA_NUMERIC_PUNCT(*p))
644 return(p);
645 p++;
646 }
647 }
648
649static unsigned long hash(CONF_VALUE *v)
650 {
651 return((lh_strhash(v->section)<<2)^lh_strhash(v->name));
652 }
653
654static int cmp_conf(CONF_VALUE *a, CONF_VALUE *b)
655 {
656 int i;
657
658 if (a->section != b->section)
659 {
660 i=strcmp(a->section,b->section);
661 if (i) return(i);
662 }
663
664 if ((a->name != NULL) && (b->name != NULL))
665 {
666 i=strcmp(a->name,b->name);
667 return(i);
668 }
669 else if (a->name == b->name)
670 return(0);
671 else
672 return((a->name == NULL)?-1:1);
673 }
674
675static char *scan_quote(char *p)
676 {
677 int q= *p;
678
679 p++;
680 while (!(IS_EOF(*p)) && (*p != q))
681 {
682 if (IS_ESC(*p))
683 {
684 p++;
685 if (IS_EOF(*p)) return(p);
686 }
687 p++;
688 }
689 if (*p == q) p++;
690 return(p);
691 }
692
693static CONF_VALUE *new_section(LHASH *conf, char *section)
694 {
695 STACK *sk=NULL;
696 int ok=0,i;
697 CONF_VALUE *v=NULL,*vv;
698
699 if ((sk=sk_new_null()) == NULL)
700 goto err;
701 if ((v=(CONF_VALUE *)Malloc(sizeof(CONF_VALUE))) == NULL)
702 goto err;
703 i=strlen(section)+1;
704 if ((v->section=(char *)Malloc(i)) == NULL)
705 goto err;
706
707 memcpy(v->section,section,i);
708 v->name=NULL;
709 v->value=(char *)sk;
710
711 vv=(CONF_VALUE *)lh_insert(conf,v);
712 if (vv != NULL)
713 {
714#if !defined(NO_STDIO) && !defined(WIN16)
715 fprintf(stderr,"internal fault\n");
716#endif
717 abort();
718 }
719 ok=1;
720err:
721 if (!ok)
722 {
723 if (sk != NULL) sk_free(sk);
724 if (v != NULL) Free(v);
725 v=NULL;
726 }
727 return(v);
728 }
729
730IMPLEMENT_STACK_OF(CONF_VALUE)
diff --git a/src/lib/libcrypto/conf/conf.h b/src/lib/libcrypto/conf/conf.h
index 21831a92a3..2f70634455 100644
--- a/src/lib/libcrypto/conf/conf.h
+++ b/src/lib/libcrypto/conf/conf.h
@@ -59,14 +59,15 @@
59#ifndef HEADER_CONF_H 59#ifndef HEADER_CONF_H
60#define HEADER_CONF_H 60#define HEADER_CONF_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#include <openssl/bio.h> 62#include <openssl/bio.h>
67#include <openssl/lhash.h> 63#include <openssl/lhash.h>
68#include <openssl/stack.h> 64#include <openssl/stack.h>
69#include <openssl/safestack.h> 65#include <openssl/safestack.h>
66#include <openssl/e_os.h>
67
68#ifdef __cplusplus
69extern "C" {
70#endif
70 71
71typedef struct 72typedef struct
72 { 73 {
@@ -77,6 +78,25 @@ typedef struct
77 78
78DECLARE_STACK_OF(CONF_VALUE) 79DECLARE_STACK_OF(CONF_VALUE)
79 80
81struct conf_st;
82typedef struct conf_st CONF;
83struct conf_method_st;
84typedef struct conf_method_st CONF_METHOD;
85
86struct conf_method_st
87 {
88 const char *name;
89 CONF *(MS_FAR *create)(CONF_METHOD *meth);
90 int (MS_FAR *init)(CONF *conf);
91 int (MS_FAR *destroy)(CONF *conf);
92 int (MS_FAR *destroy_data)(CONF *conf);
93 int (MS_FAR *load)(CONF *conf, BIO *bp, long *eline);
94 int (MS_FAR *dump)(CONF *conf, BIO *bp);
95 int (MS_FAR *is_number)(CONF *conf, char c);
96 int (MS_FAR *to_int)(CONF *conf, char c);
97 };
98
99int CONF_set_default_method(CONF_METHOD *meth);
80LHASH *CONF_load(LHASH *conf,const char *file,long *eline); 100LHASH *CONF_load(LHASH *conf,const char *file,long *eline);
81#ifndef NO_FP_API 101#ifndef NO_FP_API
82LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline); 102LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline);
@@ -86,8 +106,40 @@ STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section);
86char *CONF_get_string(LHASH *conf,char *group,char *name); 106char *CONF_get_string(LHASH *conf,char *group,char *name);
87long CONF_get_number(LHASH *conf,char *group,char *name); 107long CONF_get_number(LHASH *conf,char *group,char *name);
88void CONF_free(LHASH *conf); 108void CONF_free(LHASH *conf);
109int CONF_dump_fp(LHASH *conf, FILE *out);
110int CONF_dump_bio(LHASH *conf, BIO *out);
89void ERR_load_CONF_strings(void ); 111void ERR_load_CONF_strings(void );
90 112
113/* New conf code. The semantics are different from the functions above.
114 If that wasn't the case, the above functions would have been replaced */
115
116struct conf_st
117 {
118 CONF_METHOD *meth;
119 void *meth_data;
120 LHASH *data;
121 };
122
123CONF *NCONF_new(CONF_METHOD *meth);
124CONF_METHOD *NCONF_default();
125CONF_METHOD *NCONF_WIN32();
126#if 0 /* Just to give you an idea of what I have in mind */
127CONF_METHOD *NCONF_XML();
128#endif
129void NCONF_free(CONF *conf);
130void NCONF_free_data(CONF *conf);
131
132int NCONF_load(CONF *conf,const char *file,long *eline);
133#ifndef NO_FP_API
134int NCONF_load_fp(CONF *conf, FILE *fp,long *eline);
135#endif
136int NCONF_load_bio(CONF *conf, BIO *bp,long *eline);
137STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section);
138char *NCONF_get_string(CONF *conf,char *group,char *name);
139long NCONF_get_number(CONF *conf,char *group,char *name);
140int NCONF_dump_fp(CONF *conf, FILE *out);
141int NCONF_dump_bio(CONF *conf, BIO *out);
142
91 143
92/* BEGIN ERROR CODES */ 144/* BEGIN ERROR CODES */
93/* The following lines are auto generated by the script mkerr.pl. Any changes 145/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -97,15 +149,24 @@ void ERR_load_CONF_strings(void );
97/* Error codes for the CONF functions. */ 149/* Error codes for the CONF functions. */
98 150
99/* Function codes. */ 151/* Function codes. */
152#define CONF_F_CONF_DUMP_FP 104
100#define CONF_F_CONF_LOAD 100 153#define CONF_F_CONF_LOAD 100
101#define CONF_F_CONF_LOAD_BIO 102 154#define CONF_F_CONF_LOAD_BIO 102
102#define CONF_F_CONF_LOAD_FP 103 155#define CONF_F_CONF_LOAD_FP 103
156#define CONF_F_NCONF_DUMP_BIO 105
157#define CONF_F_NCONF_DUMP_FP 106
158#define CONF_F_NCONF_GET_NUMBER 107
159#define CONF_F_NCONF_GET_SECTION 108
160#define CONF_F_NCONF_GET_STRING 109
161#define CONF_F_NCONF_LOAD_BIO 110
162#define CONF_F_NCONF_NEW 111
103#define CONF_F_STR_COPY 101 163#define CONF_F_STR_COPY 101
104 164
105/* Reason codes. */ 165/* Reason codes. */
106#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 166#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
107#define CONF_R_MISSING_EQUAL_SIGN 101 167#define CONF_R_MISSING_EQUAL_SIGN 101
108#define CONF_R_NO_CLOSE_BRACE 102 168#define CONF_R_NO_CLOSE_BRACE 102
169#define CONF_R_NO_CONF 105
109#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 170#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
110#define CONF_R_VARIABLE_HAS_NO_VALUE 104 171#define CONF_R_VARIABLE_HAS_NO_VALUE 104
111 172
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c
new file mode 100644
index 0000000000..d05a778ff6
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf_api.c
@@ -0,0 +1,289 @@
1/* conf_api.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59/* Part of the code in here was originally in conf.c, which is now removed */
60
61#ifndef CONF_DEBUG
62# undef NDEBUG /* avoid conflicting definitions */
63# define NDEBUG
64#endif
65
66#include <assert.h>
67#include <string.h>
68#include <openssl/conf.h>
69#include <openssl/conf_api.h>
70
71static void value_free_hash(CONF_VALUE *a, LHASH *conf);
72static void value_free_stack(CONF_VALUE *a,LHASH *conf);
73static unsigned long hash(CONF_VALUE *v);
74static int cmp_conf(CONF_VALUE *a,CONF_VALUE *b);
75
76/* Up until OpenSSL 0.9.5a, this was get_section */
77CONF_VALUE *_CONF_get_section(CONF *conf, char *section)
78 {
79 CONF_VALUE *v,vv;
80
81 if ((conf == NULL) || (section == NULL)) return(NULL);
82 vv.name=NULL;
83 vv.section=section;
84 v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
85 return(v);
86 }
87
88/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
89STACK_OF(CONF_VALUE) *_CONF_get_section_values(CONF *conf, char *section)
90 {
91 CONF_VALUE *v;
92
93 v=_CONF_get_section(conf,section);
94 if (v != NULL)
95 return((STACK_OF(CONF_VALUE) *)v->value);
96 else
97 return(NULL);
98 }
99
100int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value)
101 {
102 CONF_VALUE *v = NULL;
103 STACK_OF(CONF_VALUE) *ts;
104
105 ts = (STACK_OF(CONF_VALUE) *)section->value;
106
107 value->section=section->section;
108 if (!sk_CONF_VALUE_push(ts,value))
109 {
110 return 0;
111 }
112
113 v = (CONF_VALUE *)lh_insert(conf->data, value);
114 if (v != NULL)
115 {
116 sk_CONF_VALUE_delete_ptr(ts,v);
117 OPENSSL_free(v->name);
118 OPENSSL_free(v->value);
119 OPENSSL_free(v);
120 }
121 return 1;
122 }
123
124char *_CONF_get_string(CONF *conf, char *section, char *name)
125 {
126 CONF_VALUE *v,vv;
127 char *p;
128
129 if (name == NULL) return(NULL);
130 if (conf != NULL)
131 {
132 if (section != NULL)
133 {
134 vv.name=name;
135 vv.section=section;
136 v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
137 if (v != NULL) return(v->value);
138 if (strcmp(section,"ENV") == 0)
139 {
140 p=Getenv(name);
141 if (p != NULL) return(p);
142 }
143 }
144 vv.section="default";
145 vv.name=name;
146 v=(CONF_VALUE *)lh_retrieve(conf->data,&vv);
147 if (v != NULL)
148 return(v->value);
149 else
150 return(NULL);
151 }
152 else
153 return(Getenv(name));
154 }
155
156long _CONF_get_number(CONF *conf, char *section, char *name)
157 {
158 char *str;
159 long ret=0;
160
161 str=_CONF_get_string(conf,section,name);
162 if (str == NULL) return(0);
163 for (;;)
164 {
165 if (conf->meth->is_number(conf, *str))
166 ret=ret*10+conf->meth->to_int(conf, *str);
167 else
168 return(ret);
169 str++;
170 }
171 }
172
173int _CONF_new_data(CONF *conf)
174 {
175 if (conf == NULL)
176 {
177 return 0;
178 }
179 if (conf->data == NULL)
180 if ((conf->data = lh_new(hash,cmp_conf)) == NULL)
181 {
182 return 0;
183 }
184 return 1;
185 }
186
187void _CONF_free_data(CONF *conf)
188 {
189 if (conf == NULL || conf->data == NULL) return;
190
191 conf->data->down_load=0; /* evil thing to make sure the 'OPENSSL_free()'
192 * works as expected */
193 lh_doall_arg(conf->data,(void (*)())value_free_hash,conf->data);
194
195 /* We now have only 'section' entries in the hash table.
196 * Due to problems with */
197
198 lh_doall_arg(conf->data,(void (*)())value_free_stack,conf->data);
199 lh_free(conf->data);
200 }
201
202static void value_free_hash(CONF_VALUE *a, LHASH *conf)
203 {
204 if (a->name != NULL)
205 {
206 a=(CONF_VALUE *)lh_delete(conf,a);
207 }
208 }
209
210static void value_free_stack(CONF_VALUE *a, LHASH *conf)
211 {
212 CONF_VALUE *vv;
213 STACK *sk;
214 int i;
215
216 if (a->name != NULL) return;
217
218 sk=(STACK *)a->value;
219 for (i=sk_num(sk)-1; i>=0; i--)
220 {
221 vv=(CONF_VALUE *)sk_value(sk,i);
222 OPENSSL_free(vv->value);
223 OPENSSL_free(vv->name);
224 OPENSSL_free(vv);
225 }
226 if (sk != NULL) sk_free(sk);
227 OPENSSL_free(a->section);
228 OPENSSL_free(a);
229 }
230
231static unsigned long hash(CONF_VALUE *v)
232 {
233 return((lh_strhash(v->section)<<2)^lh_strhash(v->name));
234 }
235
236static int cmp_conf(CONF_VALUE *a, CONF_VALUE *b)
237 {
238 int i;
239
240 if (a->section != b->section)
241 {
242 i=strcmp(a->section,b->section);
243 if (i) return(i);
244 }
245
246 if ((a->name != NULL) && (b->name != NULL))
247 {
248 i=strcmp(a->name,b->name);
249 return(i);
250 }
251 else if (a->name == b->name)
252 return(0);
253 else
254 return((a->name == NULL)?-1:1);
255 }
256
257/* Up until OpenSSL 0.9.5a, this was new_section */
258CONF_VALUE *_CONF_new_section(CONF *conf, char *section)
259 {
260 STACK *sk=NULL;
261 int ok=0,i;
262 CONF_VALUE *v=NULL,*vv;
263
264 if ((sk=sk_new_null()) == NULL)
265 goto err;
266 if ((v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))) == NULL)
267 goto err;
268 i=strlen(section)+1;
269 if ((v->section=(char *)OPENSSL_malloc(i)) == NULL)
270 goto err;
271
272 memcpy(v->section,section,i);
273 v->name=NULL;
274 v->value=(char *)sk;
275
276 vv=(CONF_VALUE *)lh_insert(conf->data,v);
277 assert(vv == NULL);
278 ok=1;
279err:
280 if (!ok)
281 {
282 if (sk != NULL) sk_free(sk);
283 if (v != NULL) OPENSSL_free(v);
284 v=NULL;
285 }
286 return(v);
287 }
288
289IMPLEMENT_STACK_OF(CONF_VALUE)
diff --git a/src/lib/libcrypto/conf/conf_api.h b/src/lib/libcrypto/conf/conf_api.h
new file mode 100644
index 0000000000..a5cc17b233
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf_api.h
@@ -0,0 +1,87 @@
1/* conf_api.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef HEADER_CONF_API_H
60#define HEADER_CONF_API_H
61
62#include <openssl/lhash.h>
63#include <openssl/conf.h>
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69/* Up until OpenSSL 0.9.5a, this was new_section */
70CONF_VALUE *_CONF_new_section(CONF *conf, char *section);
71/* Up until OpenSSL 0.9.5a, this was get_section */
72CONF_VALUE *_CONF_get_section(CONF *conf, char *section);
73/* Up until OpenSSL 0.9.5a, this was CONF_get_section */
74STACK_OF(CONF_VALUE) *_CONF_get_section_values(CONF *conf, char *section);
75
76int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);
77char *_CONF_get_string(CONF *conf, char *section, char *name);
78long _CONF_get_number(CONF *conf, char *section, char *name);
79
80int _CONF_new_data(CONF *conf);
81void _CONF_free_data(CONF *conf);
82
83#ifdef __cplusplus
84}
85#endif
86#endif
87
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
new file mode 100644
index 0000000000..773df32c68
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -0,0 +1,703 @@
1/* crypto/conf/conf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59/* Part of the code in here was originally in conf.c, which is now removed */
60
61#include <stdio.h>
62#include <string.h>
63#include <openssl/stack.h>
64#include <openssl/lhash.h>
65#include <openssl/conf.h>
66#include <openssl/conf_api.h>
67#include "conf_def.h"
68#include <openssl/buffer.h>
69#include <openssl/err.h>
70
71static char *eat_ws(CONF *conf, char *p);
72static char *eat_alpha_numeric(CONF *conf, char *p);
73static void clear_comments(CONF *conf, char *p);
74static int str_copy(CONF *conf,char *section,char **to, char *from);
75static char *scan_quote(CONF *conf, char *p);
76static char *scan_dquote(CONF *conf, char *p);
77#define scan_esc(conf,p) (((IS_EOF((conf),(p)[1]))?((p)+1):((p)+2)))
78
79static CONF *def_create(CONF_METHOD *meth);
80static int def_init_default(CONF *conf);
81static int def_init_WIN32(CONF *conf);
82static int def_destroy(CONF *conf);
83static int def_destroy_data(CONF *conf);
84static int def_load(CONF *conf, BIO *bp, long *eline);
85static int def_dump(CONF *conf, BIO *bp);
86static int def_is_number(CONF *conf, char c);
87static int def_to_int(CONF *conf, char c);
88
89const char *CONF_def_version="CONF_def" OPENSSL_VERSION_PTEXT;
90
91static CONF_METHOD default_method = {
92 "OpenSSL default",
93 def_create,
94 def_init_default,
95 def_destroy,
96 def_destroy_data,
97 def_load,
98 def_dump,
99 def_is_number,
100 def_to_int
101 };
102
103static CONF_METHOD WIN32_method = {
104 "WIN32",
105 def_create,
106 def_init_WIN32,
107 def_destroy,
108 def_destroy_data,
109 def_load,
110 def_dump,
111 def_is_number,
112 def_to_int
113 };
114
115CONF_METHOD *NCONF_default()
116 {
117 return &default_method;
118 }
119CONF_METHOD *NCONF_WIN32()
120 {
121 return &WIN32_method;
122 }
123
124static CONF *def_create(CONF_METHOD *meth)
125 {
126 CONF *ret;
127
128 ret = (CONF *)OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *));
129 if (ret)
130 if (meth->init(ret) == 0)
131 {
132 OPENSSL_free(ret);
133 ret = NULL;
134 }
135 return ret;
136 }
137
138static int def_init_default(CONF *conf)
139 {
140 if (conf == NULL)
141 return 0;
142
143 conf->meth = &default_method;
144 conf->meth_data = (void *)CONF_type_default;
145 conf->data = NULL;
146
147 return 1;
148 }
149
150static int def_init_WIN32(CONF *conf)
151 {
152 if (conf == NULL)
153 return 0;
154
155 conf->meth = &WIN32_method;
156 conf->meth_data = (void *)CONF_type_win32;
157 conf->data = NULL;
158
159 return 1;
160 }
161
162static int def_destroy(CONF *conf)
163 {
164 if (def_destroy_data(conf))
165 {
166 OPENSSL_free(conf);
167 return 1;
168 }
169 return 0;
170 }
171
172static int def_destroy_data(CONF *conf)
173 {
174 if (conf == NULL)
175 return 0;
176 _CONF_free_data(conf);
177 return 1;
178 }
179
180static int def_load(CONF *conf, BIO *in, long *line)
181 {
182#define BUFSIZE 512
183 char btmp[16];
184 int bufnum=0,i,ii;
185 BUF_MEM *buff=NULL;
186 char *s,*p,*end;
187 int again,n;
188 long eline=0;
189 CONF_VALUE *v=NULL,*tv;
190 CONF_VALUE *sv=NULL;
191 char *section=NULL,*buf;
192 STACK_OF(CONF_VALUE) *section_sk=NULL,*ts;
193 char *start,*psection,*pname;
194 void *h = (void *)(conf->data);
195
196 if ((buff=BUF_MEM_new()) == NULL)
197 {
198 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
199 goto err;
200 }
201
202 section=(char *)OPENSSL_malloc(10);
203 if (section == NULL)
204 {
205 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
206 goto err;
207 }
208 strcpy(section,"default");
209
210 if (_CONF_new_data(conf) == 0)
211 {
212 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
213 goto err;
214 }
215
216 sv=_CONF_new_section(conf,section);
217 if (sv == NULL)
218 {
219 CONFerr(CONF_F_CONF_LOAD_BIO,
220 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
221 goto err;
222 }
223 section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
224
225 bufnum=0;
226 for (;;)
227 {
228 again=0;
229 if (!BUF_MEM_grow(buff,bufnum+BUFSIZE))
230 {
231 CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB);
232 goto err;
233 }
234 p= &(buff->data[bufnum]);
235 *p='\0';
236 BIO_gets(in, p, BUFSIZE-1);
237 p[BUFSIZE-1]='\0';
238 ii=i=strlen(p);
239 if (i == 0) break;
240 while (i > 0)
241 {
242 if ((p[i-1] != '\r') && (p[i-1] != '\n'))
243 break;
244 else
245 i--;
246 }
247 /* we removed some trailing stuff so there is a new
248 * line on the end. */
249 if (i == ii)
250 again=1; /* long line */
251 else
252 {
253 p[i]='\0';
254 eline++; /* another input line */
255 }
256
257 /* we now have a line with trailing \r\n removed */
258
259 /* i is the number of bytes */
260 bufnum+=i;
261
262 v=NULL;
263 /* check for line continuation */
264 if (bufnum >= 1)
265 {
266 /* If we have bytes and the last char '\\' and
267 * second last char is not '\\' */
268 p= &(buff->data[bufnum-1]);
269 if (IS_ESC(conf,p[0]) &&
270 ((bufnum <= 1) || !IS_ESC(conf,p[-1])))
271 {
272 bufnum--;
273 again=1;
274 }
275 }
276 if (again) continue;
277 bufnum=0;
278 buf=buff->data;
279
280 clear_comments(conf, buf);
281 n=strlen(buf);
282 s=eat_ws(conf, buf);
283 if (IS_EOF(conf,*s)) continue; /* blank line */
284 if (*s == '[')
285 {
286 char *ss;
287
288 s++;
289 start=eat_ws(conf, s);
290 ss=start;
291again:
292 end=eat_alpha_numeric(conf, ss);
293 p=eat_ws(conf, end);
294 if (*p != ']')
295 {
296 if (*p != '\0')
297 {
298 ss=p;
299 goto again;
300 }
301 CONFerr(CONF_F_CONF_LOAD_BIO,
302 CONF_R_MISSING_CLOSE_SQUARE_BRACKET);
303 goto err;
304 }
305 *end='\0';
306 if (!str_copy(conf,NULL,&section,start)) goto err;
307 if ((sv=_CONF_get_section(conf,section)) == NULL)
308 sv=_CONF_new_section(conf,section);
309 if (sv == NULL)
310 {
311 CONFerr(CONF_F_CONF_LOAD_BIO,
312 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
313 goto err;
314 }
315 section_sk=(STACK_OF(CONF_VALUE) *)sv->value;
316 continue;
317 }
318 else
319 {
320 pname=s;
321 psection=NULL;
322 end=eat_alpha_numeric(conf, s);
323 if ((end[0] == ':') && (end[1] == ':'))
324 {
325 *end='\0';
326 end+=2;
327 psection=pname;
328 pname=end;
329 end=eat_alpha_numeric(conf, end);
330 }
331 p=eat_ws(conf, end);
332 if (*p != '=')
333 {
334 CONFerr(CONF_F_CONF_LOAD_BIO,
335 CONF_R_MISSING_EQUAL_SIGN);
336 goto err;
337 }
338 *end='\0';
339 p++;
340 start=eat_ws(conf, p);
341 while (!IS_EOF(conf,*p))
342 p++;
343 p--;
344 while ((p != start) && (IS_WS(conf,*p)))
345 p--;
346 p++;
347 *p='\0';
348
349 if (!(v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE))))
350 {
351 CONFerr(CONF_F_CONF_LOAD_BIO,
352 ERR_R_MALLOC_FAILURE);
353 goto err;
354 }
355 if (psection == NULL) psection=section;
356 v->name=(char *)OPENSSL_malloc(strlen(pname)+1);
357 v->value=NULL;
358 if (v->name == NULL)
359 {
360 CONFerr(CONF_F_CONF_LOAD_BIO,
361 ERR_R_MALLOC_FAILURE);
362 goto err;
363 }
364 strcpy(v->name,pname);
365 if (!str_copy(conf,psection,&(v->value),start)) goto err;
366
367 if (strcmp(psection,section) != 0)
368 {
369 if ((tv=_CONF_get_section(conf,psection))
370 == NULL)
371 tv=_CONF_new_section(conf,psection);
372 if (tv == NULL)
373 {
374 CONFerr(CONF_F_CONF_LOAD_BIO,
375 CONF_R_UNABLE_TO_CREATE_NEW_SECTION);
376 goto err;
377 }
378 ts=(STACK_OF(CONF_VALUE) *)tv->value;
379 }
380 else
381 {
382 tv=sv;
383 ts=section_sk;
384 }
385#if 1
386 if (_CONF_add_string(conf, tv, v) == 0)
387 {
388 CONFerr(CONF_F_CONF_LOAD_BIO,
389 ERR_R_MALLOC_FAILURE);
390 goto err;
391 }
392#else
393 v->section=tv->section;
394 if (!sk_CONF_VALUE_push(ts,v))
395 {
396 CONFerr(CONF_F_CONF_LOAD_BIO,
397 ERR_R_MALLOC_FAILURE);
398 goto err;
399 }
400 vv=(CONF_VALUE *)lh_insert(conf->data,v);
401 if (vv != NULL)
402 {
403 sk_CONF_VALUE_delete_ptr(ts,vv);
404 OPENSSL_free(vv->name);
405 OPENSSL_free(vv->value);
406 OPENSSL_free(vv);
407 }
408#endif
409 v=NULL;
410 }
411 }
412 if (buff != NULL) BUF_MEM_free(buff);
413 if (section != NULL) OPENSSL_free(section);
414 return(1);
415err:
416 if (buff != NULL) BUF_MEM_free(buff);
417 if (section != NULL) OPENSSL_free(section);
418 if (line != NULL) *line=eline;
419 sprintf(btmp,"%ld",eline);
420 ERR_add_error_data(2,"line ",btmp);
421 if ((h != conf->data) && (conf->data != NULL)) CONF_free(conf->data);
422 if (v != NULL)
423 {
424 if (v->name != NULL) OPENSSL_free(v->name);
425 if (v->value != NULL) OPENSSL_free(v->value);
426 if (v != NULL) OPENSSL_free(v);
427 }
428 return(0);
429 }
430
431static void clear_comments(CONF *conf, char *p)
432 {
433 char *to;
434
435 to=p;
436 for (;;)
437 {
438 if (IS_FCOMMENT(conf,*p))
439 {
440 *p='\0';
441 return;
442 }
443 if (!IS_WS(conf,*p))
444 {
445 break;
446 }
447 p++;
448 }
449
450 for (;;)
451 {
452 if (IS_COMMENT(conf,*p))
453 {
454 *p='\0';
455 return;
456 }
457 if (IS_DQUOTE(conf,*p))
458 {
459 p=scan_dquote(conf, p);
460 continue;
461 }
462 if (IS_QUOTE(conf,*p))
463 {
464 p=scan_quote(conf, p);
465 continue;
466 }
467 if (IS_ESC(conf,*p))
468 {
469 p=scan_esc(conf,p);
470 continue;
471 }
472 if (IS_EOF(conf,*p))
473 return;
474 else
475 p++;
476 }
477 }
478
479static int str_copy(CONF *conf, char *section, char **pto, char *from)
480 {
481 int q,r,rr=0,to=0,len=0;
482 char *s,*e,*rp,*p,*rrp,*np,*cp,v;
483 BUF_MEM *buf;
484
485 if ((buf=BUF_MEM_new()) == NULL) return(0);
486
487 len=strlen(from)+1;
488 if (!BUF_MEM_grow(buf,len)) goto err;
489
490 for (;;)
491 {
492 if (IS_QUOTE(conf,*from))
493 {
494 q= *from;
495 from++;
496 while (!IS_EOF(conf,*from) && (*from != q))
497 {
498 if (IS_ESC(conf,*from))
499 {
500 from++;
501 if (IS_EOF(conf,*from)) break;
502 }
503 buf->data[to++]= *(from++);
504 }
505 if (*from == q) from++;
506 }
507 else if (IS_DQUOTE(conf,*from))
508 {
509 q= *from;
510 from++;
511 while (!IS_EOF(conf,*from))
512 {
513 if (*from == q)
514 {
515 if (*(from+1) == q)
516 {
517 from++;
518 }
519 else
520 {
521 break;
522 }
523 }
524 buf->data[to++]= *(from++);
525 }
526 if (*from == q) from++;
527 }
528 else if (IS_ESC(conf,*from))
529 {
530 from++;
531 v= *(from++);
532 if (IS_EOF(conf,v)) break;
533 else if (v == 'r') v='\r';
534 else if (v == 'n') v='\n';
535 else if (v == 'b') v='\b';
536 else if (v == 't') v='\t';
537 buf->data[to++]= v;
538 }
539 else if (IS_EOF(conf,*from))
540 break;
541 else if (*from == '$')
542 {
543 /* try to expand it */
544 rrp=NULL;
545 s= &(from[1]);
546 if (*s == '{')
547 q='}';
548 else if (*s == '(')
549 q=')';
550 else q=0;
551
552 if (q) s++;
553 cp=section;
554 e=np=s;
555 while (IS_ALPHA_NUMERIC(conf,*e))
556 e++;
557 if ((e[0] == ':') && (e[1] == ':'))
558 {
559 cp=np;
560 rrp=e;
561 rr= *e;
562 *rrp='\0';
563 e+=2;
564 np=e;
565 while (IS_ALPHA_NUMERIC(conf,*e))
566 e++;
567 }
568 r= *e;
569 *e='\0';
570 rp=e;
571 if (q)
572 {
573 if (r != q)
574 {
575 CONFerr(CONF_F_STR_COPY,CONF_R_NO_CLOSE_BRACE);
576 goto err;
577 }
578 e++;
579 }
580 /* So at this point we have
581 * ns which is the start of the name string which is
582 * '\0' terminated.
583 * cs which is the start of the section string which is
584 * '\0' terminated.
585 * e is the 'next point after'.
586 * r and s are the chars replaced by the '\0'
587 * rp and sp is where 'r' and 's' came from.
588 */
589 p=_CONF_get_string(conf,cp,np);
590 if (rrp != NULL) *rrp=rr;
591 *rp=r;
592 if (p == NULL)
593 {
594 CONFerr(CONF_F_STR_COPY,CONF_R_VARIABLE_HAS_NO_VALUE);
595 goto err;
596 }
597 BUF_MEM_grow(buf,(strlen(p)+len-(e-from)));
598 while (*p)
599 buf->data[to++]= *(p++);
600 from=e;
601 }
602 else
603 buf->data[to++]= *(from++);
604 }
605 buf->data[to]='\0';
606 if (*pto != NULL) OPENSSL_free(*pto);
607 *pto=buf->data;
608 OPENSSL_free(buf);
609 return(1);
610err:
611 if (buf != NULL) BUF_MEM_free(buf);
612 return(0);
613 }
614
615static char *eat_ws(CONF *conf, char *p)
616 {
617 while (IS_WS(conf,*p) && (!IS_EOF(conf,*p)))
618 p++;
619 return(p);
620 }
621
622static char *eat_alpha_numeric(CONF *conf, char *p)
623 {
624 for (;;)
625 {
626 if (IS_ESC(conf,*p))
627 {
628 p=scan_esc(conf,p);
629 continue;
630 }
631 if (!IS_ALPHA_NUMERIC_PUNCT(conf,*p))
632 return(p);
633 p++;
634 }
635 }
636
637static char *scan_quote(CONF *conf, char *p)
638 {
639 int q= *p;
640
641 p++;
642 while (!(IS_EOF(conf,*p)) && (*p != q))
643 {
644 if (IS_ESC(conf,*p))
645 {
646 p++;
647 if (IS_EOF(conf,*p)) return(p);
648 }
649 p++;
650 }
651 if (*p == q) p++;
652 return(p);
653 }
654
655
656static char *scan_dquote(CONF *conf, char *p)
657 {
658 int q= *p;
659
660 p++;
661 while (!(IS_EOF(conf,*p)))
662 {
663 if (*p == q)
664 {
665 if (*(p+1) == q)
666 {
667 p++;
668 }
669 else
670 {
671 break;
672 }
673 }
674 p++;
675 }
676 if (*p == q) p++;
677 return(p);
678 }
679
680static void dump_value(CONF_VALUE *a, BIO *out)
681 {
682 if (a->name)
683 BIO_printf(out, "[%s] %s=%s\n", a->section, a->name, a->value);
684 else
685 BIO_printf(out, "[[%s]]\n", a->section);
686 }
687
688static int def_dump(CONF *conf, BIO *out)
689 {
690 lh_doall_arg(conf->data, (void (*)())dump_value, out);
691 return 1;
692 }
693
694static int def_is_number(CONF *conf, char c)
695 {
696 return IS_NUMBER(conf,c);
697 }
698
699static int def_to_int(CONF *conf, char c)
700 {
701 return c - '0';
702 }
703
diff --git a/src/lib/libcrypto/conf/conf_def.h b/src/lib/libcrypto/conf/conf_def.h
new file mode 100644
index 0000000000..3244d9a331
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf_def.h
@@ -0,0 +1,145 @@
1/* crypto/conf/conf_def.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59/* THIS FILE WAS AUTOMAGICALLY GENERATED!
60 Please modify and use keysets.pl to regenerate it. */
61
62#define CONF_NUMBER 1
63#define CONF_UPPER 2
64#define CONF_LOWER 4
65#define CONF_UNDER 256
66#define CONF_PUNCTUATION 512
67#define CONF_WS 16
68#define CONF_ESC 32
69#define CONF_QUOTE 64
70#define CONF_DQUOTE 1024
71#define CONF_COMMENT 128
72#define CONF_FCOMMENT 2048
73#define CONF_EOF 8
74#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
75#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
76#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \
77 CONF_PUNCTUATION)
78
79#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
80#ifndef CHARSET_EBCDIC
81#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT)
82#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT)
83#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_EOF)
84#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ESC)
85#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER)
86#define IS_WS(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_WS)
87#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC)
88#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
89 (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
90#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE)
91#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE)
92
93#else /*CHARSET_EBCDIC*/
94
95#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT)
96#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT)
97#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF)
98#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC)
99#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER)
100#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS)
101#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
102#define IS_ALPHA_NUMERIC_PUNCT(c,a) \
103 (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
104#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE)
105#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE)
106#endif /*CHARSET_EBCDIC*/
107
108static unsigned short CONF_type_default[128]={
109 0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
110 0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
111 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
112 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
113 0x010,0x200,0x040,0x080,0x000,0x200,0x200,0x040,
114 0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
115 0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
116 0x001,0x001,0x000,0x200,0x000,0x000,0x000,0x200,
117 0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
118 0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
119 0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
120 0x002,0x002,0x002,0x000,0x020,0x000,0x200,0x100,
121 0x040,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
122 0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
123 0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
124 0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
125 };
126
127static unsigned short CONF_type_win32[128]={
128 0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
129 0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
130 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
131 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
132 0x010,0x200,0x400,0x000,0x000,0x200,0x200,0x000,
133 0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
134 0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
135 0x001,0x001,0x000,0xA00,0x000,0x000,0x000,0x200,
136 0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
137 0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
138 0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
139 0x002,0x002,0x002,0x000,0x000,0x000,0x200,0x100,
140 0x000,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
141 0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
142 0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
143 0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
144 };
145
diff --git a/src/lib/libcrypto/conf/conf_err.c b/src/lib/libcrypto/conf/conf_err.c
index 5c1ca59090..06d3163573 100644
--- a/src/lib/libcrypto/conf/conf_err.c
+++ b/src/lib/libcrypto/conf/conf_err.c
@@ -66,9 +66,17 @@
66#ifndef NO_ERR 66#ifndef NO_ERR
67static ERR_STRING_DATA CONF_str_functs[]= 67static ERR_STRING_DATA CONF_str_functs[]=
68 { 68 {
69{ERR_PACK(0,CONF_F_CONF_DUMP_FP,0), "CONF_dump_fp"},
69{ERR_PACK(0,CONF_F_CONF_LOAD,0), "CONF_load"}, 70{ERR_PACK(0,CONF_F_CONF_LOAD,0), "CONF_load"},
70{ERR_PACK(0,CONF_F_CONF_LOAD_BIO,0), "CONF_load_bio"}, 71{ERR_PACK(0,CONF_F_CONF_LOAD_BIO,0), "CONF_load_bio"},
71{ERR_PACK(0,CONF_F_CONF_LOAD_FP,0), "CONF_load_fp"}, 72{ERR_PACK(0,CONF_F_CONF_LOAD_FP,0), "CONF_load_fp"},
73{ERR_PACK(0,CONF_F_NCONF_DUMP_BIO,0), "NCONF_dump_bio"},
74{ERR_PACK(0,CONF_F_NCONF_DUMP_FP,0), "NCONF_dump_fp"},
75{ERR_PACK(0,CONF_F_NCONF_GET_NUMBER,0), "NCONF_get_number"},
76{ERR_PACK(0,CONF_F_NCONF_GET_SECTION,0), "NCONF_get_section"},
77{ERR_PACK(0,CONF_F_NCONF_GET_STRING,0), "NCONF_get_string"},
78{ERR_PACK(0,CONF_F_NCONF_LOAD_BIO,0), "NCONF_load_bio"},
79{ERR_PACK(0,CONF_F_NCONF_NEW,0), "NCONF_new"},
72{ERR_PACK(0,CONF_F_STR_COPY,0), "STR_COPY"}, 80{ERR_PACK(0,CONF_F_STR_COPY,0), "STR_COPY"},
73{0,NULL} 81{0,NULL}
74 }; 82 };
@@ -78,6 +86,7 @@ static ERR_STRING_DATA CONF_str_reasons[]=
78{CONF_R_MISSING_CLOSE_SQUARE_BRACKET ,"missing close square bracket"}, 86{CONF_R_MISSING_CLOSE_SQUARE_BRACKET ,"missing close square bracket"},
79{CONF_R_MISSING_EQUAL_SIGN ,"missing equal sign"}, 87{CONF_R_MISSING_EQUAL_SIGN ,"missing equal sign"},
80{CONF_R_NO_CLOSE_BRACE ,"no close brace"}, 88{CONF_R_NO_CLOSE_BRACE ,"no close brace"},
89{CONF_R_NO_CONF ,"no conf"},
81{CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"}, 90{CONF_R_UNABLE_TO_CREATE_NEW_SECTION ,"unable to create new section"},
82{CONF_R_VARIABLE_HAS_NO_VALUE ,"variable has no value"}, 91{CONF_R_VARIABLE_HAS_NO_VALUE ,"variable has no value"},
83{0,NULL} 92{0,NULL}
diff --git a/src/lib/libcrypto/conf/conf_lcl.h b/src/lib/libcrypto/conf/conf_lcl.h
index f9a015df57..e69de29bb2 100644
--- a/src/lib/libcrypto/conf/conf_lcl.h
+++ b/src/lib/libcrypto/conf/conf_lcl.h
@@ -1,116 +0,0 @@
1/* crypto/conf/conf_lcl.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#define CONF_NUMBER 1
60#define CONF_UPPER 2
61#define CONF_LOWER 4
62#define CONF_UNDER 256
63#define CONF_PUNCTUATION 512
64#define CONF_WS 16
65#define CONF_ESC 32
66#define CONF_QUOTE 64
67#define CONF_COMMENT 128
68#define CONF_EOF 8
69#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
70#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
71#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \
72 CONF_PUNCTUATION)
73
74#ifndef CHARSET_EBCDIC
75#define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[(a)&0x7f]))
76#define IS_EOF(a) ((a) == '\0')
77#define IS_ESC(a) ((a) == '\\')
78#define IS_NUMER(a) (CONF_type[(a)&0x7f]&CONF_NUMBER)
79#define IS_WS(a) (CONF_type[(a)&0x7f]&CONF_WS)
80#define IS_ALPHA_NUMERIC(a) (CONF_type[(a)&0x7f]&CONF_ALPHA_NUMERIC)
81#define IS_ALPHA_NUMERIC_PUNCT(a) \
82 (CONF_type[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
83#define IS_QUOTE(a) (CONF_type[(a)&0x7f]&CONF_QUOTE)
84
85#else /*CHARSET_EBCDIC*/
86
87#define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[os_toascii[a]&0x7f]))
88#define IS_EOF(a) (os_toascii[a] == '\0')
89#define IS_ESC(a) (os_toascii[a] == '\\')
90#define IS_NUMER(a) (CONF_type[os_toascii[a]&0x7f]&CONF_NUMBER)
91#define IS_WS(a) (CONF_type[os_toascii[a]&0x7f]&CONF_WS)
92#define IS_ALPHA_NUMERIC(a) (CONF_type[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
93#define IS_ALPHA_NUMERIC_PUNCT(a) \
94 (CONF_type[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
95#define IS_QUOTE(a) (CONF_type[os_toascii[a]&0x7f]&CONF_QUOTE)
96#endif /*CHARSET_EBCDIC*/
97
98static unsigned short CONF_type[128]={
99 0x008,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
100 0x000,0x010,0x010,0x000,0x000,0x010,0x000,0x000,
101 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
102 0x000,0x000,0x000,0x000,0x000,0x000,0x000,0x000,
103 0x010,0x200,0x040,0x080,0x000,0x200,0x200,0x040,
104 0x000,0x000,0x200,0x200,0x200,0x200,0x200,0x200,
105 0x001,0x001,0x001,0x001,0x001,0x001,0x001,0x001,
106 0x001,0x001,0x000,0x200,0x000,0x000,0x000,0x200,
107 0x200,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
108 0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
109 0x002,0x002,0x002,0x002,0x002,0x002,0x002,0x002,
110 0x002,0x002,0x002,0x000,0x020,0x000,0x200,0x100,
111 0x040,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
112 0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
113 0x004,0x004,0x004,0x004,0x004,0x004,0x004,0x004,
114 0x004,0x004,0x004,0x000,0x200,0x000,0x200,0x000,
115 };
116
diff --git a/src/lib/libcrypto/conf/conf_lib.c b/src/lib/libcrypto/conf/conf_lib.c
new file mode 100644
index 0000000000..4c8ca9e9ae
--- /dev/null
+++ b/src/lib/libcrypto/conf/conf_lib.c
@@ -0,0 +1,352 @@
1/* conf_lib.c */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <openssl/crypto.h>
61#include <openssl/err.h>
62#include <openssl/conf.h>
63#include <openssl/conf_api.h>
64#include <openssl/lhash.h>
65
66const char *CONF_version="CONF" OPENSSL_VERSION_PTEXT;
67
68static CONF_METHOD *default_CONF_method=NULL;
69
70/* The following section contains the "CONF classic" functions,
71 rewritten in terms of the new CONF interface. */
72
73int CONF_set_default_method(CONF_METHOD *meth)
74 {
75 default_CONF_method = meth;
76 return 1;
77 }
78
79LHASH *CONF_load(LHASH *conf, const char *file, long *eline)
80 {
81 LHASH *ltmp;
82 BIO *in=NULL;
83
84#ifdef VMS
85 in=BIO_new_file(file, "r");
86#else
87 in=BIO_new_file(file, "rb");
88#endif
89 if (in == NULL)
90 {
91 CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
92 return NULL;
93 }
94
95 ltmp = CONF_load_bio(conf, in, eline);
96 BIO_free(in);
97
98 return ltmp;
99 }
100
101#ifndef NO_FP_API
102LHASH *CONF_load_fp(LHASH *conf, FILE *fp,long *eline)
103 {
104 BIO *btmp;
105 LHASH *ltmp;
106 if(!(btmp = BIO_new_fp(fp, BIO_NOCLOSE))) {
107 CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB);
108 return NULL;
109 }
110 ltmp = CONF_load_bio(conf, btmp, eline);
111 BIO_free(btmp);
112 return ltmp;
113 }
114#endif
115
116LHASH *CONF_load_bio(LHASH *conf, BIO *bp,long *eline)
117 {
118 CONF ctmp;
119 int ret;
120
121 if (default_CONF_method == NULL)
122 default_CONF_method = NCONF_default();
123
124 default_CONF_method->init(&ctmp);
125 ctmp.data = conf;
126 ret = NCONF_load_bio(&ctmp, bp, eline);
127 if (ret)
128 return ctmp.data;
129 return NULL;
130 }
131
132STACK_OF(CONF_VALUE) *CONF_get_section(LHASH *conf,char *section)
133 {
134 CONF ctmp;
135
136 if (default_CONF_method == NULL)
137 default_CONF_method = NCONF_default();
138
139 default_CONF_method->init(&ctmp);
140 ctmp.data = conf;
141 return NCONF_get_section(&ctmp, section);
142 }
143
144char *CONF_get_string(LHASH *conf,char *group,char *name)
145 {
146 CONF ctmp;
147
148 if (default_CONF_method == NULL)
149 default_CONF_method = NCONF_default();
150
151 default_CONF_method->init(&ctmp);
152 ctmp.data = conf;
153 return NCONF_get_string(&ctmp, group, name);
154 }
155
156long CONF_get_number(LHASH *conf,char *group,char *name)
157 {
158 CONF ctmp;
159
160 if (default_CONF_method == NULL)
161 default_CONF_method = NCONF_default();
162
163 default_CONF_method->init(&ctmp);
164 ctmp.data = conf;
165 return NCONF_get_number(&ctmp, group, name);
166 }
167
168void CONF_free(LHASH *conf)
169 {
170 CONF ctmp;
171
172 if (default_CONF_method == NULL)
173 default_CONF_method = NCONF_default();
174
175 default_CONF_method->init(&ctmp);
176 ctmp.data = conf;
177 NCONF_free_data(&ctmp);
178 }
179
180#ifndef NO_FP_API
181int CONF_dump_fp(LHASH *conf, FILE *out)
182 {
183 BIO *btmp;
184 int ret;
185
186 if(!(btmp = BIO_new_fp(out, BIO_NOCLOSE))) {
187 CONFerr(CONF_F_CONF_DUMP_FP,ERR_R_BUF_LIB);
188 return 0;
189 }
190 ret = CONF_dump_bio(conf, btmp);
191 BIO_free(btmp);
192 return ret;
193 }
194#endif
195
196int CONF_dump_bio(LHASH *conf, BIO *out)
197 {
198 CONF ctmp;
199
200 if (default_CONF_method == NULL)
201 default_CONF_method = NCONF_default();
202
203 default_CONF_method->init(&ctmp);
204 ctmp.data = conf;
205 return NCONF_dump_bio(&ctmp, out);
206 }
207
208/* The following section contains the "New CONF" functions. They are
209 completely centralised around a new CONF structure that may contain
210 basically anything, but at least a method pointer and a table of data.
211 These functions are also written in terms of the bridge functions used
212 by the "CONF classic" functions, for consistency. */
213
214CONF *NCONF_new(CONF_METHOD *meth)
215 {
216 CONF *ret;
217
218 if (meth == NULL)
219 meth = NCONF_default();
220
221 ret = meth->create(meth);
222 if (ret == NULL)
223 {
224 CONFerr(CONF_F_NCONF_NEW,ERR_R_MALLOC_FAILURE);
225 return(NULL);
226 }
227
228 return ret;
229 }
230
231void NCONF_free(CONF *conf)
232 {
233 if (conf == NULL)
234 return;
235 conf->meth->destroy(conf);
236 }
237
238void NCONF_free_data(CONF *conf)
239 {
240 if (conf == NULL)
241 return;
242 conf->meth->destroy_data(conf);
243 }
244
245int NCONF_load(CONF *conf, const char *file, long *eline)
246 {
247 int ret;
248 BIO *in=NULL;
249
250#ifdef VMS
251 in=BIO_new_file(file, "r");
252#else
253 in=BIO_new_file(file, "rb");
254#endif
255 if (in == NULL)
256 {
257 CONFerr(CONF_F_CONF_LOAD,ERR_R_SYS_LIB);
258 return 0;
259 }
260
261 ret = NCONF_load_bio(conf, in, eline);
262 BIO_free(in);
263
264 return ret;
265 }
266
267#ifndef NO_FP_API
268int NCONF_load_fp(CONF *conf, FILE *fp,long *eline)
269 {
270 BIO *btmp;
271 int ret;
272 if(!(btmp = BIO_new_fp(fp, BIO_NOCLOSE)))
273 {
274 CONFerr(CONF_F_CONF_LOAD_FP,ERR_R_BUF_LIB);
275 return 0;
276 }
277 ret = NCONF_load_bio(conf, btmp, eline);
278 BIO_free(btmp);
279 return ret;
280 }
281#endif
282
283int NCONF_load_bio(CONF *conf, BIO *bp,long *eline)
284 {
285 if (conf == NULL)
286 {
287 CONFerr(CONF_F_NCONF_LOAD_BIO,CONF_R_NO_CONF);
288 return 0;
289 }
290
291 return conf->meth->load(conf, bp, eline);
292 }
293
294STACK_OF(CONF_VALUE) *NCONF_get_section(CONF *conf,char *section)
295 {
296 if (conf == NULL)
297 {
298 CONFerr(CONF_F_NCONF_GET_SECTION,CONF_R_NO_CONF);
299 return NULL;
300 }
301
302 return _CONF_get_section_values(conf, section);
303 }
304
305char *NCONF_get_string(CONF *conf,char *group,char *name)
306 {
307 if (conf == NULL)
308 {
309 CONFerr(CONF_F_NCONF_GET_STRING,CONF_R_NO_CONF);
310 return NULL;
311 }
312
313 return _CONF_get_string(conf, group, name);
314 }
315
316long NCONF_get_number(CONF *conf,char *group,char *name)
317 {
318 if (conf == NULL)
319 {
320 CONFerr(CONF_F_NCONF_GET_NUMBER,CONF_R_NO_CONF);
321 return 0;
322 }
323
324 return _CONF_get_number(conf, group, name);
325 }
326
327#ifndef NO_FP_API
328int NCONF_dump_fp(CONF *conf, FILE *out)
329 {
330 BIO *btmp;
331 int ret;
332 if(!(btmp = BIO_new_fp(out, BIO_NOCLOSE))) {
333 CONFerr(CONF_F_NCONF_DUMP_FP,ERR_R_BUF_LIB);
334 return 0;
335 }
336 ret = NCONF_dump_bio(conf, btmp);
337 BIO_free(btmp);
338 return ret;
339 }
340#endif
341
342int NCONF_dump_bio(CONF *conf, BIO *out)
343 {
344 if (conf == NULL)
345 {
346 CONFerr(CONF_F_NCONF_DUMP_BIO,CONF_R_NO_CONF);
347 return 0;
348 }
349
350 return conf->meth->dump(conf, out);
351 }
352
diff --git a/src/lib/libcrypto/conf/keysets.pl b/src/lib/libcrypto/conf/keysets.pl
index 1aed0c80c4..56669e76ac 100644
--- a/src/lib/libcrypto/conf/keysets.pl
+++ b/src/lib/libcrypto/conf/keysets.pl
@@ -3,12 +3,15 @@
3$NUMBER=0x01; 3$NUMBER=0x01;
4$UPPER=0x02; 4$UPPER=0x02;
5$LOWER=0x04; 5$LOWER=0x04;
6$EOF=0x08; 6$UNDER=0x100;
7$PUNCTUATION=0x200;
7$WS=0x10; 8$WS=0x10;
8$ESC=0x20; 9$ESC=0x20;
9$QUOTE=0x40; 10$QUOTE=0x40;
11$DQUOTE=0x400;
10$COMMENT=0x80; 12$COMMENT=0x80;
11$UNDER=0x100; 13$FCOMMENT=0x800;
14$EOF=0x08;
12 15
13foreach (0 .. 127) 16foreach (0 .. 127)
14 { 17 {
@@ -18,44 +21,159 @@ foreach (0 .. 127)
18 $v|=$UPPER if ($c =~ /[A-Z]/); 21 $v|=$UPPER if ($c =~ /[A-Z]/);
19 $v|=$LOWER if ($c =~ /[a-z]/); 22 $v|=$LOWER if ($c =~ /[a-z]/);
20 $v|=$UNDER if ($c =~ /_/); 23 $v|=$UNDER if ($c =~ /_/);
21 $v|=$WS if ($c =~ / \t\r\n/); 24 $v|=$PUNCTUATION if ($c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/);
25 $v|=$WS if ($c =~ /[ \t\r\n]/);
22 $v|=$ESC if ($c =~ /\\/); 26 $v|=$ESC if ($c =~ /\\/);
23 $v|=$QUOTE if ($c =~ /['`"]/); 27 $v|=$QUOTE if ($c =~ /['`"]/); # for emacs: "`'}/)
24 $v|=$COMMENT if ($c =~ /\#/); 28 $v|=$COMMENT if ($c =~ /\#/);
25 $v|=$EOF if ($c =~ /\0/); 29 $v|=$EOF if ($c =~ /\0/);
26 30
27 push(@V,$v); 31 push(@V_def,$v);
32 }
33
34foreach (0 .. 127)
35 {
36 $v=0;
37 $c=sprintf("%c",$_);
38 $v|=$NUMBER if ($c =~ /[0-9]/);
39 $v|=$UPPER if ($c =~ /[A-Z]/);
40 $v|=$LOWER if ($c =~ /[a-z]/);
41 $v|=$UNDER if ($c =~ /_/);
42 $v|=$PUNCTUATION if ($c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/);
43 $v|=$WS if ($c =~ /[ \t\r\n]/);
44 $v|=$DQUOTE if ($c =~ /["]/); # for emacs: "}/)
45 $v|=$FCOMMENT if ($c =~ /;/);
46 $v|=$EOF if ($c =~ /\0/);
47
48 push(@V_w32,$v);
28 } 49 }
29 50
30print <<"EOF"; 51print <<"EOF";
52/* crypto/conf/conf_def.h */
53/* Copyright (C) 1995-1998 Eric Young (eay\@cryptsoft.com)
54 * All rights reserved.
55 *
56 * This package is an SSL implementation written
57 * by Eric Young (eay\@cryptsoft.com).
58 * The implementation was written so as to conform with Netscapes SSL.
59 *
60 * This library is free for commercial and non-commercial use as long as
61 * the following conditions are aheared to. The following conditions
62 * apply to all code found in this distribution, be it the RC4, RSA,
63 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
64 * included with this distribution is covered by the same copyright terms
65 * except that the holder is Tim Hudson (tjh\@cryptsoft.com).
66 *
67 * Copyright remains Eric Young's, and as such any Copyright notices in
68 * the code are not to be removed.
69 * If this package is used in a product, Eric Young should be given attribution
70 * as the author of the parts of the library used.
71 * This can be in the form of a textual message at program startup or
72 * in documentation (online or textual) provided with the package.
73 *
74 * Redistribution and use in source and binary forms, with or without
75 * modification, are permitted provided that the following conditions
76 * are met:
77 * 1. Redistributions of source code must retain the copyright
78 * notice, this list of conditions and the following disclaimer.
79 * 2. Redistributions in binary form must reproduce the above copyright
80 * notice, this list of conditions and the following disclaimer in the
81 * documentation and/or other materials provided with the distribution.
82 * 3. All advertising materials mentioning features or use of this software
83 * must display the following acknowledgement:
84 * "This product includes cryptographic software written by
85 * Eric Young (eay\@cryptsoft.com)"
86 * The word 'cryptographic' can be left out if the rouines from the library
87 * being used are not cryptographic related :-).
88 * 4. If you include any Windows specific code (or a derivative thereof) from
89 * the apps directory (application code) you must include an acknowledgement:
90 * "This product includes software written by Tim Hudson (tjh\@cryptsoft.com)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
93 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
95 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
96 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
97 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
98 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
99 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
100 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
101 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
102 * SUCH DAMAGE.
103 *
104 * The licence and distribution terms for any publically available version or
105 * derivative of this code cannot be changed. i.e. this code cannot simply be
106 * copied and put under another distribution licence
107 * [including the GNU Public Licence.]
108 */
109
110/* THIS FILE WAS AUTOMAGICALLY GENERATED!
111 Please modify and use keysets.pl to regenerate it. */
112
31#define CONF_NUMBER $NUMBER 113#define CONF_NUMBER $NUMBER
32#define CONF_UPPER $UPPER 114#define CONF_UPPER $UPPER
33#define CONF_LOWER $LOWER 115#define CONF_LOWER $LOWER
34#define CONF_EOF $EOF 116#define CONF_UNDER $UNDER
117#define CONF_PUNCTUATION $PUNCTUATION
35#define CONF_WS $WS 118#define CONF_WS $WS
36#define CONF_ESC $ESC 119#define CONF_ESC $ESC
37#define CONF_QUOTE $QUOTE 120#define CONF_QUOTE $QUOTE
121#define CONF_DQUOTE $DQUOTE
38#define CONF_COMMENT $COMMENT 122#define CONF_COMMENT $COMMENT
123#define CONF_FCOMMENT $FCOMMENT
124#define CONF_EOF $EOF
39#define CONF_ALPHA (CONF_UPPER|CONF_LOWER) 125#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
40#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) 126#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
41#define CONF_UNDER $UNDER 127#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \\
128 CONF_PUNCTUATION)
129
130#define KEYTYPES(c) ((unsigned short *)((c)->meth_data))
131#ifndef CHARSET_EBCDIC
132#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_COMMENT)
133#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_FCOMMENT)
134#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_EOF)
135#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ESC)
136#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_NUMBER)
137#define IS_WS(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_WS)
138#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC)
139#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
140 (KEYTYPES(c)[(a)&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
141#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_QUOTE)
142#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0x7f]&CONF_DQUOTE)
143
144#else /*CHARSET_EBCDIC*/
42 145
43#define IS_COMMENT(a) (CONF_COMMENT&(CONF_type[(a)&0x7f])) 146#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_COMMENT)
44#define IS_EOF(a) ((a) == '\\0') 147#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_FCOMMENT)
45#define IS_ESC(a) ((a) == '\\\\') 148#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_EOF)
46#define IS_NUMER(a) (CONF_type[(a)&0x7f]&CONF_NUMBER) 149#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ESC)
47#define IS_WS(a) (CONF_type[(a)&0x7f]&CONF_WS) 150#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_NUMBER)
48#define IS_ALPHA_NUMERIC(a) (CONF_type[(a)&0x7f]&CONF_ALPHA_NUMERIC) 151#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_WS)
49#define IS_QUOTE(a) (CONF_type[(a)&0x7f]&CONF_QUOTE) 152#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC)
153#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
154 (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_ALPHA_NUMERIC_PUNCT)
155#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_QUOTE)
156#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0x7f]&CONF_DQUOTE)
157#endif /*CHARSET_EBCDIC*/
50 158
51EOF 159EOF
52 160
53print "static unsigned short CONF_type[128]={"; 161print "static unsigned short CONF_type_default[128]={";
162
163for ($i=0; $i<128; $i++)
164 {
165 print "\n\t" if ($i % 8) == 0;
166 printf "0x%03X,",$V_def[$i];
167 }
168
169print "\n\t};\n\n";
170
171print "static unsigned short CONF_type_win32[128]={";
54 172
55for ($i=0; $i<128; $i++) 173for ($i=0; $i<128; $i++)
56 { 174 {
57 print "\n\t" if ($i % 8) == 0; 175 print "\n\t" if ($i % 8) == 0;
58 printf "0x%03X,",$V[$i]; 176 printf "0x%03X,",$V_w32[$i];
59 } 177 }
60 178
61print "\n\t};\n"; 179print "\n\t};\n\n";
diff --git a/src/lib/libcrypto/conf/test.c b/src/lib/libcrypto/conf/test.c
index 9390a48baf..7fab85053e 100644
--- a/src/lib/libcrypto/conf/test.c
+++ b/src/lib/libcrypto/conf/test.c
@@ -67,7 +67,10 @@ main()
67 long eline; 67 long eline;
68 char *s,*s2; 68 char *s,*s2;
69 69
70 conf=CONF_load(NULL,"openssl.conf",&eline); 70#ifdef USE_WIN32
71 CONF_set_default_method(CONF_WIN32);
72#endif
73 conf=CONF_load(NULL,"ssleay.cnf",&eline);
71 if (conf == NULL) 74 if (conf == NULL)
72 { 75 {
73 ERR_load_crypto_strings(); 76 ERR_load_crypto_strings();
@@ -88,5 +91,8 @@ main()
88 s=CONF_get_string(conf,"s_client","cipher1"); 91 s=CONF_get_string(conf,"s_client","cipher1");
89 printf("s_client:cipher1=%s\n",(s == NULL)?"NULL":s); 92 printf("s_client:cipher1=%s\n",(s == NULL)?"NULL":s);
90 93
94 printf("---------------------------- DUMP ------------------------\n");
95 CONF_dump_fp(conf, stdout);
96
91 exit(0); 97 exit(0);
92 } 98 }
diff --git a/src/lib/libcrypto/cpt_err.c b/src/lib/libcrypto/cpt_err.c
index dadd8d8d92..7018b74ca0 100644
--- a/src/lib/libcrypto/cpt_err.c
+++ b/src/lib/libcrypto/cpt_err.c
@@ -67,6 +67,7 @@
67static ERR_STRING_DATA CRYPTO_str_functs[]= 67static ERR_STRING_DATA CRYPTO_str_functs[]=
68 { 68 {
69{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,0), "CRYPTO_get_ex_new_index"}, 69{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,0), "CRYPTO_get_ex_new_index"},
70{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,0), "CRYPTO_get_new_dynlockid"},
70{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_NEW_LOCKID,0), "CRYPTO_get_new_lockid"}, 71{ERR_PACK(0,CRYPTO_F_CRYPTO_GET_NEW_LOCKID,0), "CRYPTO_get_new_lockid"},
71{ERR_PACK(0,CRYPTO_F_CRYPTO_SET_EX_DATA,0), "CRYPTO_set_ex_data"}, 72{ERR_PACK(0,CRYPTO_F_CRYPTO_SET_EX_DATA,0), "CRYPTO_set_ex_data"},
72{0,NULL} 73{0,NULL}
@@ -74,6 +75,7 @@ static ERR_STRING_DATA CRYPTO_str_functs[]=
74 75
75static ERR_STRING_DATA CRYPTO_str_reasons[]= 76static ERR_STRING_DATA CRYPTO_str_reasons[]=
76 { 77 {
78{CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK ,"no dynlock create callback"},
77{0,NULL} 79{0,NULL}
78 }; 80 };
79 81
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c
index a8f29f1e65..9de60fd528 100644
--- a/src/lib/libcrypto/cryptlib.c
+++ b/src/lib/libcrypto/cryptlib.c
@@ -60,11 +60,15 @@
60#include <string.h> 60#include <string.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include <openssl/crypto.h> 62#include <openssl/crypto.h>
63#include <openssl/safestack.h>
63 64
64#if defined(WIN32) || defined(WIN16) 65#if defined(WIN32) || defined(WIN16)
65static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */ 66static double SSLeay_MSVC5_hack=0.0; /* and for VC1.5 */
66#endif 67#endif
67 68
69DECLARE_STACK_OF(CRYPTO_dynlock)
70IMPLEMENT_STACK_OF(CRYPTO_dynlock)
71
68/* real #defines in crypto.h, keep these upto date */ 72/* real #defines in crypto.h, keep these upto date */
69static const char* lock_names[CRYPTO_NUM_LOCKS] = 73static const char* lock_names[CRYPTO_NUM_LOCKS] =
70 { 74 {
@@ -94,18 +98,36 @@ static const char* lock_names[CRYPTO_NUM_LOCKS] =
94 "RSA_blinding", 98 "RSA_blinding",
95 "dh", 99 "dh",
96 "debug_malloc2", 100 "debug_malloc2",
97#if CRYPTO_NUM_LOCKS != 26 101 "dso",
102 "dynlock",
103 "engine",
104#if CRYPTO_NUM_LOCKS != 29
98# error "Inconsistency between crypto.h and cryptlib.c" 105# error "Inconsistency between crypto.h and cryptlib.c"
99#endif 106#endif
100 }; 107 };
101 108
109/* This is for applications to allocate new type names in the non-dynamic
110 array of lock names. These are numbered with positive numbers. */
102static STACK *app_locks=NULL; 111static STACK *app_locks=NULL;
103 112
113/* For applications that want a more dynamic way of handling threads, the
114 following stack is used. These are externally numbered with negative
115 numbers. */
116static STACK_OF(CRYPTO_dynlock) *dyn_locks=NULL;
117
118
104static void (MS_FAR *locking_callback)(int mode,int type, 119static void (MS_FAR *locking_callback)(int mode,int type,
105 const char *file,int line)=NULL; 120 const char *file,int line)=NULL;
106static int (MS_FAR *add_lock_callback)(int *pointer,int amount, 121static int (MS_FAR *add_lock_callback)(int *pointer,int amount,
107 int type,const char *file,int line)=NULL; 122 int type,const char *file,int line)=NULL;
108static unsigned long (MS_FAR *id_callback)(void)=NULL; 123static unsigned long (MS_FAR *id_callback)(void)=NULL;
124static struct CRYPTO_dynlock_value *(MS_FAR *dynlock_create_callback)
125 (const char *file,int line)=NULL;
126static void (MS_FAR *dynlock_lock_callback)(int mode,
127 struct CRYPTO_dynlock_value *l, const char *file,int line)=NULL;
128static void (MS_FAR *dynlock_destroy_callback)(struct CRYPTO_dynlock_value *l,
129 const char *file,int line)=NULL;
130
109int CRYPTO_get_new_lockid(char *name) 131int CRYPTO_get_new_lockid(char *name)
110 { 132 {
111 char *str; 133 char *str;
@@ -125,10 +147,13 @@ int CRYPTO_get_new_lockid(char *name)
125 return(0); 147 return(0);
126 } 148 }
127 if ((str=BUF_strdup(name)) == NULL) 149 if ((str=BUF_strdup(name)) == NULL)
150 {
151 CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_LOCKID,ERR_R_MALLOC_FAILURE);
128 return(0); 152 return(0);
153 }
129 i=sk_push(app_locks,str); 154 i=sk_push(app_locks,str);
130 if (!i) 155 if (!i)
131 Free(str); 156 OPENSSL_free(str);
132 else 157 else
133 i+=CRYPTO_NUM_LOCKS; /* gap of one :-) */ 158 i+=CRYPTO_NUM_LOCKS; /* gap of one :-) */
134 return(i); 159 return(i);
@@ -139,6 +164,156 @@ int CRYPTO_num_locks(void)
139 return CRYPTO_NUM_LOCKS; 164 return CRYPTO_NUM_LOCKS;
140 } 165 }
141 166
167int CRYPTO_get_new_dynlockid(void)
168 {
169 int i = 0;
170 CRYPTO_dynlock *pointer = NULL;
171
172 if (dynlock_create_callback == NULL)
173 {
174 CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK);
175 return(0);
176 }
177 CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
178 if ((dyn_locks == NULL)
179 && ((dyn_locks=sk_CRYPTO_dynlock_new_null()) == NULL))
180 {
181 CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
182 CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,ERR_R_MALLOC_FAILURE);
183 return(0);
184 }
185 CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
186
187 pointer = (CRYPTO_dynlock *)OPENSSL_malloc(sizeof(CRYPTO_dynlock));
188 if (pointer == NULL)
189 {
190 CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,ERR_R_MALLOC_FAILURE);
191 return(0);
192 }
193 pointer->references = 1;
194 pointer->data = dynlock_create_callback(__FILE__,__LINE__);
195 if (pointer->data == NULL)
196 {
197 OPENSSL_free(pointer);
198 CRYPTOerr(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID,ERR_R_MALLOC_FAILURE);
199 return(0);
200 }
201
202 CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
203 /* First, try to find an existing empty slot */
204 i=sk_CRYPTO_dynlock_find(dyn_locks,NULL);
205 /* If there was none, push, thereby creating a new one */
206 if (i == -1)
207 i=sk_CRYPTO_dynlock_push(dyn_locks,pointer);
208 CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
209
210 if (!i)
211 {
212 dynlock_destroy_callback(pointer->data,__FILE__,__LINE__);
213 OPENSSL_free(pointer);
214 }
215 else
216 i += 1; /* to avoid 0 */
217 return -i;
218 }
219
220void CRYPTO_destroy_dynlockid(int i)
221 {
222 CRYPTO_dynlock *pointer = NULL;
223 if (i)
224 i = -i-1;
225 if (dynlock_destroy_callback == NULL)
226 return;
227
228 CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
229
230 if (dyn_locks == NULL || i >= sk_CRYPTO_dynlock_num(dyn_locks))
231 return;
232 pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
233 if (pointer != NULL)
234 {
235 --pointer->references;
236#ifdef REF_CHECK
237 if (pointer->references < 0)
238 {
239 fprintf(stderr,"CRYPTO_destroy_dynlockid, bad reference count\n");
240 abort();
241 }
242 else
243#endif
244 if (--(pointer->references) <= 0)
245 {
246 sk_CRYPTO_dynlock_set(dyn_locks, i, NULL);
247 }
248 else
249 pointer = NULL;
250 }
251 CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
252
253 if (pointer)
254 {
255 dynlock_destroy_callback(pointer->data,__FILE__,__LINE__);
256 OPENSSL_free(pointer);
257 }
258 }
259
260struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i)
261 {
262 CRYPTO_dynlock *pointer = NULL;
263 if (i)
264 i = -i-1;
265
266 CRYPTO_w_lock(CRYPTO_LOCK_DYNLOCK);
267
268 if (dyn_locks != NULL && i < sk_CRYPTO_dynlock_num(dyn_locks))
269 pointer = sk_CRYPTO_dynlock_value(dyn_locks, i);
270 if (pointer)
271 pointer->references++;
272
273 CRYPTO_w_unlock(CRYPTO_LOCK_DYNLOCK);
274
275 if (pointer)
276 return pointer->data;
277 return NULL;
278 }
279
280struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))
281 (const char *file,int line)
282 {
283 return(dynlock_create_callback);
284 }
285
286void (*CRYPTO_get_dynlock_lock_callback(void))(int mode,
287 struct CRYPTO_dynlock_value *l, const char *file,int line)
288 {
289 return(dynlock_lock_callback);
290 }
291
292void (*CRYPTO_get_dynlock_destroy_callback(void))
293 (struct CRYPTO_dynlock_value *l, const char *file,int line)
294 {
295 return(dynlock_destroy_callback);
296 }
297
298void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*func)
299 (const char *file, int line))
300 {
301 dynlock_create_callback=func;
302 }
303
304void CRYPTO_set_dynlock_lock_callback(void (*func)(int mode,
305 struct CRYPTO_dynlock_value *l, const char *file, int line))
306 {
307 dynlock_lock_callback=func;
308 }
309
310void CRYPTO_set_dynlock_destroy_callback(void (*func)
311 (struct CRYPTO_dynlock_value *l, const char *file, int line))
312 {
313 dynlock_destroy_callback=func;
314 }
315
316
142void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file, 317void (*CRYPTO_get_locking_callback(void))(int mode,int type,const char *file,
143 int line) 318 int line)
144 { 319 {
@@ -219,14 +394,28 @@ void CRYPTO_lock(int mode, int type, const char *file, int line)
219 CRYPTO_get_lock_name(type), file, line); 394 CRYPTO_get_lock_name(type), file, line);
220 } 395 }
221#endif 396#endif
222 if (locking_callback != NULL) 397 if (type < 0)
223 locking_callback(mode,type,file,line); 398 {
399 int i = -type - 1;
400 struct CRYPTO_dynlock_value *pointer
401 = CRYPTO_get_dynlock_value(i);
402
403 if (pointer)
404 {
405 dynlock_lock_callback(mode, pointer, file, line);
406 }
407
408 CRYPTO_destroy_dynlockid(i);
409 }
410 else
411 if (locking_callback != NULL)
412 locking_callback(mode,type,file,line);
224 } 413 }
225 414
226int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, 415int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
227 int line) 416 int line)
228 { 417 {
229 int ret; 418 int ret = 0;
230 419
231 if (add_lock_callback != NULL) 420 if (add_lock_callback != NULL)
232 { 421 {
@@ -265,7 +454,7 @@ int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
265const char *CRYPTO_get_lock_name(int type) 454const char *CRYPTO_get_lock_name(int type)
266 { 455 {
267 if (type < 0) 456 if (type < 0)
268 return("ERROR"); 457 return("dynamic");
269 else if (type < CRYPTO_NUM_LOCKS) 458 else if (type < CRYPTO_NUM_LOCKS)
270 return(lock_names[type]); 459 return(lock_names[type]);
271 else if (type-CRYPTO_NUM_LOCKS >= sk_num(app_locks)) 460 else if (type-CRYPTO_NUM_LOCKS >= sk_num(app_locks))
diff --git a/src/lib/libcrypto/cryptlib.h b/src/lib/libcrypto/cryptlib.h
index e3d38524ae..5eff5d3141 100644
--- a/src/lib/libcrypto/cryptlib.h
+++ b/src/lib/libcrypto/cryptlib.h
@@ -62,10 +62,6 @@
62#include <stdlib.h> 62#include <stdlib.h>
63#include <string.h> 63#include <string.h>
64 64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69#include "openssl/e_os.h" 65#include "openssl/e_os.h"
70 66
71#include <openssl/crypto.h> 67#include <openssl/crypto.h>
@@ -74,6 +70,10 @@ extern "C" {
74#include <openssl/err.h> 70#include <openssl/err.h>
75#include <openssl/opensslconf.h> 71#include <openssl/opensslconf.h>
76 72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77#ifndef VMS 77#ifndef VMS
78#define X509_CERT_AREA OPENSSLDIR 78#define X509_CERT_AREA OPENSSLDIR
79#define X509_CERT_DIR OPENSSLDIR "/certs" 79#define X509_CERT_DIR OPENSSLDIR "/certs"
diff --git a/src/lib/libcrypto/crypto-lib.com b/src/lib/libcrypto/crypto-lib.com
index 8ddeafbc06..21d56a4b50 100644
--- a/src/lib/libcrypto/crypto-lib.com
+++ b/src/lib/libcrypto/crypto-lib.com
@@ -86,9 +86,9 @@ $ ENDIF
86$! 86$!
87$! Define The Different Encryption Types. 87$! Define The Different Encryption Types.
88$! 88$!
89$ ENCRYPT_TYPES = "Basic,MD2,MD5,SHA,MDC2,HMAC,RIPEMD,"+ - 89$ ENCRYPT_TYPES = "Basic,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,"+ -
90 "DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ - 90 "DES,RC2,RC4,RC5,IDEA,BF,CAST,"+ -
91 "BN,RSA,DSA,DH,"+ - 91 "BN,RSA,DSA,DH,DSO,ENGINE,"+ -
92 "BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ - 92 "BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,"+ -
93 "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ - 93 "EVP,EVP_2,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
94 "CONF,TXT_DB,PKCS7,PKCS12,COMP" 94 "CONF,TXT_DB,PKCS7,PKCS12,COMP"
@@ -176,6 +176,7 @@ $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE"
176$ 176$
177$ LIB_ = "cryptlib,mem,mem_dbg,cversion,ex_data,tmdiff,cpt_err" 177$ LIB_ = "cryptlib,mem,mem_dbg,cversion,ex_data,tmdiff,cpt_err"
178$ LIB_MD2 = "md2_dgst,md2_one" 178$ LIB_MD2 = "md2_dgst,md2_one"
179$ LIB_MD4 = "md4_dgst,md4_one"
179$ LIB_MD5 = "md5_dgst,md5_one" 180$ LIB_MD5 = "md5_dgst,md5_one"
180$ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one" 181$ LIB_SHA = "sha_dgst,sha1dgst,sha_one,sha1_one"
181$ LIB_MDC2 = "mdc2dgst,mdc2_one" 182$ LIB_MDC2 = "mdc2dgst,mdc2_one"
@@ -203,35 +204,35 @@ $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ -
203 "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null" 204 "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null"
204$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl" 205$ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,dsa_err,dsa_ossl"
205$ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err" 206$ LIB_DH = "dh_gen,dh_key,dh_lib,dh_check,dh_err"
207$ LIB_DSO = "dso_dl,dso_dlfcn,dso_err,dso_lib,dso_null,"+ -
208 "dso_openssl,dso_win32,dso_vms"
209$ LIB_ENGINE = "engine_err,engine_lib,engine_list,engine_openssl,"+ -
210 "hw_atalla,hw_cswift,hw_ncipher"
206$ LIB_BUFFER = "buffer,buf_err" 211$ LIB_BUFFER = "buffer,buf_err"
207$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - 212$ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ -
208 "bss_mem,bss_null,bss_fd,"+ - 213 "bss_mem,bss_null,bss_fd,"+ -
209 "bss_file,bss_sock,bss_conn,"+ - 214 "bss_file,bss_sock,bss_conn,"+ -
210 "bf_null,bf_buff,b_print,b_dump,"+ - 215 "bf_null,bf_buff,b_print,b_dump,"+ -
211 "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log" 216 "b_sock,bss_acpt,bf_nbio,bss_rtcp,bss_bio,bss_log,"+ -
217 "bf_lbuf"
212$ LIB_STACK = "stack" 218$ LIB_STACK = "stack"
213$ LIB_LHASH = "lhash,lh_stats" 219$ LIB_LHASH = "lhash,lh_stats"
214$ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd" 220$ LIB_RAND = "md_rand,randfile,rand_lib,rand_err,rand_egd,rand_win"
215$ LIB_ERR = "err,err_all,err_prn" 221$ LIB_ERR = "err,err_all,err_prn"
216$ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err" 222$ LIB_OBJECTS = "o_names,obj_dat,obj_lib,obj_err"
217$ LIB_EVP = "encode,digest,evp_enc,evp_key,"+ - 223$ LIB_EVP = "encode,digest,evp_enc,evp_key,"+ -
218 "e_ecb_d,e_cbc_d,e_cfb_d,e_ofb_d,"+ - 224 "e_des,e_bf,e_idea,e_des3,"+ -
219 "e_ecb_i,e_cbc_i,e_cfb_i,e_ofb_i,"+ - 225 "e_rc4,names,"+ -
220 "e_ecb_3d,e_cbc_3d,e_rc4,names,"+ - 226 "e_xcbc_d,e_rc2,e_cast,e_rc5"
221 "e_cfb_3d,e_ofb_3d,e_xcbc_d,"+ - 227$ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1," + -
222 "e_ecb_r2,e_cbc_r2,e_cfb_r2,e_ofb_r2,"+ - 228 "m_dss,m_dss1,m_mdc2,m_ripemd,"+ -
223 "e_ecb_bf,e_cbc_bf,e_cfb_bf,e_ofb_bf"
224$ LIB_EVP_2 = "e_ecb_c,e_cbc_c,e_cfb_c,e_ofb_c,"+ -
225 "e_ecb_r5,e_cbc_r5,e_cfb_r5,e_ofb_r5,"+ -
226 "m_null,m_md2,m_md5,m_sha,m_sha1,m_dss,m_dss1,m_mdc2,"+ -
227 "m_ripemd,"+ -
228 "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ - 229 "p_open,p_seal,p_sign,p_verify,p_lib,p_enc,p_dec,"+ -
229 "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ - 230 "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ -
230 "c_all,c_allc,c_alld,evp_lib,bio_ok,"+- 231 "c_all,c_allc,c_alld,evp_lib,bio_ok,"+-
231 "evp_pkey,evp_pbe,p5_crpt,p5_crpt2" 232 "evp_pkey,evp_pbe,p5_crpt,p5_crpt2"
232$ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ - 233$ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ -
233 "a_null,a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,a_bmp,"+ - 234 "a_null,a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,a_bmp,"+ -
234 "a_enum,a_vis,a_utf8,a_sign,a_digest,a_verify,a_mbstr,"+ - 235 "a_enum,a_vis,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ -
235 "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,"+ - 236 "x_algor,x_val,x_pubkey,x_sig,x_req,x_attrib,"+ -
236 "x_name,x_cinf,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ - 237 "x_name,x_cinf,x_x509,x_x509a,x_crl,x_info,x_spki,nsseq,"+ -
237 "d2i_r_pr,i2d_r_pr,d2i_r_pu,i2d_r_pu,"+ - 238 "d2i_r_pr,i2d_r_pr,d2i_r_pu,i2d_r_pu,"+ -
@@ -254,7 +255,7 @@ $ LIB_X509 = "x509_def,x509_d2,x509_r2x,x509_cmp,"+ -
254$ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ - 255$ LIB_X509V3 = "v3_bcons,v3_bitst,v3_conf,v3_extku,v3_ia5,v3_lib,"+ -
255 "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ - 256 "v3_prn,v3_utl,v3err,v3_genn,v3_alt,v3_skey,v3_akey,v3_pku,"+ -
256 "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info" 257 "v3_int,v3_enum,v3_sxnet,v3_cpols,v3_crld,v3_purp,v3_info"
257$ LIB_CONF = "conf,conf_err" 258$ LIB_CONF = "conf_err,conf_lib,conf_api,conf_def"
258$ LIB_TXT_DB = "txt_db" 259$ LIB_TXT_DB = "txt_db"
259$ LIB_PKCS7 = "pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,pk7_mime" 260$ LIB_PKCS7 = "pk7_lib,pkcs7err,pk7_doit,pk7_smime,pk7_attr,pk7_mime"
260$ LIB_PKCS12 = "p12_add,p12_attr,p12_bags,p12_crpt,p12_crt,p12_decr,"+ - 261$ LIB_PKCS12 = "p12_add,p12_attr,p12_bags,p12_crpt,p12_crt,p12_decr,"+ -
@@ -267,8 +268,8 @@ $! Setup exceptional compilations
267$! 268$!
268$ COMPILEWITH_CC3 = ",bss_rtcp," 269$ COMPILEWITH_CC3 = ",bss_rtcp,"
269$ COMPILEWITH_CC4 = ",a_utctm,bss_log," 270$ COMPILEWITH_CC4 = ",a_utctm,bss_log,"
270$ COMPILEWITH_CC5 = ",md2_dgst,md5_dgst,mdc2dgst,sha_dgst,sha1dgst," + - 271$ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
271 "rmd_dgst,bf_enc," 272 "sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
272$! 273$!
273$! Check To See If We Are Going To Use RSAREF. 274$! Check To See If We Are Going To Use RSAREF.
274$! 275$!
@@ -281,10 +282,10 @@ $!
281$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]RSAREF.C").EQS."") 282$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]RSAREF.C").EQS."")
282$ THEN 283$ THEN
283$! 284$!
284$! Tell The User That The File Dosen't Exist. 285$! Tell The User That The File Doesn't Exist.
285$! 286$!
286$ WRITE SYS$OUTPUT "" 287$ WRITE SYS$OUTPUT ""
287$ WRITE SYS$OUTPUT "The File [-.RSAREF]RSAREF.C Dosen't Exist." 288$ WRITE SYS$OUTPUT "The File [-.RSAREF]RSAREF.C Doesn't Exist."
288$ WRITE SYS$OUTPUT "" 289$ WRITE SYS$OUTPUT ""
289$! 290$!
290$! Exit The Build. 291$! Exit The Build.
@@ -316,10 +317,10 @@ $!
316$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]RSAR_ERR.C").EQS."") 317$ IF (F$SEARCH("SYS$DISK:[-.RSAREF]RSAR_ERR.C").EQS."")
317$ THEN 318$ THEN
318$! 319$!
319$! Tell The User That The File Dosen't Exist. 320$! Tell The User That The File Doesn't Exist.
320$! 321$!
321$ WRITE SYS$OUTPUT "" 322$ WRITE SYS$OUTPUT ""
322$ WRITE SYS$OUTPUT "The File [-.RSAREF]RSAR_ERR.C Dosen't Exist." 323$ WRITE SYS$OUTPUT "The File [-.RSAREF]RSAR_ERR.C Doesn't Exist."
323$ WRITE SYS$OUTPUT "" 324$ WRITE SYS$OUTPUT ""
324$! 325$!
325$! Exit The Build. 326$! Exit The Build.
@@ -532,10 +533,10 @@ $!
532$ IF (F$SEARCH(SOURCE_FILE).EQS."") 533$ IF (F$SEARCH(SOURCE_FILE).EQS."")
533$ THEN 534$ THEN
534$! 535$!
535$! Tell The User That The File Dosen't Exist. 536$! Tell The User That The File Doesn't Exist.
536$! 537$!
537$ WRITE SYS$OUTPUT "" 538$ WRITE SYS$OUTPUT ""
538$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Dosen't Exist." 539$ WRITE SYS$OUTPUT "The File ",SOURCE_FILE," Doesn't Exist."
539$ WRITE SYS$OUTPUT "" 540$ WRITE SYS$OUTPUT ""
540$! 541$!
541$! Exit The Build. 542$! Exit The Build.
@@ -918,7 +919,7 @@ $!
918$ WRITE SYS$OUTPUT "" 919$ WRITE SYS$OUTPUT ""
919$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code." 920$ WRITE SYS$OUTPUT "It appears that you don't have the RSAREF Souce Code."
920$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to" 921$ WRITE SYS$OUTPUT "You need to go to 'ftp://ftp.rsa.com/rsaref'. You have to"
921$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file dosen't have the" 922$ WRITE SYS$OUTPUT "get the '.tar-Z' file as the '.zip' file doesn't have the"
922$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file" 923$ WRITE SYS$OUTPUT "directory structure stored. You have to extract the file"
923$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory" 924$ WRITE SYS$OUTPUT "into the [.RSAREF] directory under the root directory"
924$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files." 925$ WRITE SYS$OUTPUT "as that is where the scripts will look for the files."
@@ -1139,7 +1140,7 @@ $ ENDIF
1139$! 1140$!
1140$! Set Up Initial CC Definitions, Possibly With User Ones 1141$! Set Up Initial CC Definitions, Possibly With User Ones
1141$! 1142$!
1142$ CCDEFS = "VMS=1,TCPIP_TYPE_''P5'" 1143$ CCDEFS = "VMS=1,TCPIP_TYPE_''P5',DSO_VMS"
1143$ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM" 1144$ IF F$TRNLNM("OPENSSL_NO_ASM") THEN CCDEFS = CCDEFS + ",NO_ASM"
1144$ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA" 1145$ IF F$TRNLNM("OPENSSL_NO_RSA") THEN CCDEFS = CCDEFS + ",NO_RSA"
1145$ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA" 1146$ IF F$TRNLNM("OPENSSL_NO_DSA") THEN CCDEFS = CCDEFS + ",NO_DSA"
@@ -1195,7 +1196,9 @@ $ CC = "CC"
1195$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - 1196$ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
1196 THEN CC = "CC/DECC" 1197 THEN CC = "CC/DECC"
1197$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + - 1198$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
1198 "/NOLIST/PREFIX=ALL/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS 1199 "/NOLIST/PREFIX=ALL" + -
1200 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
1201 CCEXTRAFLAGS
1199$! 1202$!
1200$! Define The Linker Options File Name. 1203$! Define The Linker Options File Name.
1201$! 1204$!
@@ -1227,7 +1230,8 @@ $ WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
1227$ EXIT 1230$ EXIT
1228$ ENDIF 1231$ ENDIF
1229$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" 1232$ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
1230$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST/INCLUDE=SYS$DISK:[]" + - 1233$ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1234 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
1231 CCEXTRAFLAGS 1235 CCEXTRAFLAGS
1232$ CCDEFS = """VAXC""," + CCDEFS 1236$ CCDEFS = """VAXC""," + CCDEFS
1233$! 1237$!
@@ -1259,7 +1263,8 @@ $!
1259$! Use GNU C... 1263$! Use GNU C...
1260$! 1264$!
1261$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - 1265$ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
1262 "/INCLUDE=SYS$DISK:[]" + CCEXTRAFLAGS 1266 "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.ENGINE.VENDOR_DEFNS])" + -
1267 CCEXTRAFLAGS
1263$! 1268$!
1264$! Define The Linker Options File Name. 1269$! Define The Linker Options File Name.
1265$! 1270$!
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h
index 41c937966e..52ee97b71a 100644
--- a/src/lib/libcrypto/crypto.h
+++ b/src/lib/libcrypto/crypto.h
@@ -59,10 +59,6 @@
59#ifndef HEADER_CRYPTO_H 59#ifndef HEADER_CRYPTO_H
60#define HEADER_CRYPTO_H 60#define HEADER_CRYPTO_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#include <stdlib.h> 62#include <stdlib.h>
67 63
68#ifndef NO_FP_API 64#ifndef NO_FP_API
@@ -77,10 +73,13 @@ extern "C" {
77#include <openssl/ebcdic.h> 73#include <openssl/ebcdic.h>
78#endif 74#endif
79 75
80#if defined(VMS) || defined(__VMS) 76/* Resolve problems on some operating systems with symbol names that clash
81#include "vms_idhacks.h" 77 one way or another */
82#endif 78#include <openssl/symhacks.h>
83 79
80#ifdef __cplusplus
81extern "C" {
82#endif
84 83
85/* Backward compatibility to SSLeay */ 84/* Backward compatibility to SSLeay */
86/* This is more to be used to check the correct DLL is being used 85/* This is more to be used to check the correct DLL is being used
@@ -121,7 +120,10 @@ extern "C" {
121#define CRYPTO_LOCK_RSA_BLINDING 23 120#define CRYPTO_LOCK_RSA_BLINDING 23
122#define CRYPTO_LOCK_DH 24 121#define CRYPTO_LOCK_DH 24
123#define CRYPTO_LOCK_MALLOC2 25 122#define CRYPTO_LOCK_MALLOC2 25
124#define CRYPTO_NUM_LOCKS 26 123#define CRYPTO_LOCK_DSO 26
124#define CRYPTO_LOCK_DYNLOCK 27
125#define CRYPTO_LOCK_ENGINE 28
126#define CRYPTO_NUM_LOCKS 29
125 127
126#define CRYPTO_LOCK 1 128#define CRYPTO_LOCK 1
127#define CRYPTO_UNLOCK 2 129#define CRYPTO_UNLOCK 2
@@ -149,6 +151,17 @@ extern "C" {
149#define CRYPTO_add(a,b,c) ((*(a))+=(b)) 151#define CRYPTO_add(a,b,c) ((*(a))+=(b))
150#endif 152#endif
151 153
154/* Some applications as well as some parts of OpenSSL need to allocate
155 and deallocate locks in a dynamic fashion. The following typedef
156 makes this possible in a type-safe manner. */
157/* struct CRYPTO_dynlock_value has to be defined by the application. */
158typedef struct
159 {
160 int references;
161 struct CRYPTO_dynlock_value *data;
162 } CRYPTO_dynlock;
163
164
152/* The following can be used to detect memory leaks in the SSLeay library. 165/* The following can be used to detect memory leaks in the SSLeay library.
153 * It used, it turns on malloc checking */ 166 * It used, it turns on malloc checking */
154 167
@@ -230,11 +243,11 @@ DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)
230 * unless CRYPTO_MDEBUG is defined) */ 243 * unless CRYPTO_MDEBUG is defined) */
231#define CRYPTO_malloc_debug_init() do {\ 244#define CRYPTO_malloc_debug_init() do {\
232 CRYPTO_set_mem_debug_functions(\ 245 CRYPTO_set_mem_debug_functions(\
233 (void (*)())CRYPTO_dbg_malloc,\ 246 CRYPTO_dbg_malloc,\
234 (void (*)())CRYPTO_dbg_realloc,\ 247 CRYPTO_dbg_realloc,\
235 (void (*)())CRYPTO_dbg_free,\ 248 CRYPTO_dbg_free,\
236 (void (*)())CRYPTO_dbg_set_options,\ 249 CRYPTO_dbg_set_options,\
237 (long (*)())CRYPTO_dbg_get_options);\ 250 CRYPTO_dbg_get_options);\
238 } while(0) 251 } while(0)
239 252
240int CRYPTO_mem_ctrl(int mode); 253int CRYPTO_mem_ctrl(int mode);
@@ -249,22 +262,17 @@ int CRYPTO_is_mem_check_on(void);
249#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) 262#define MemCheck_off() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)
250#define is_MemCheck_on() CRYPTO_is_mem_check_on() 263#define is_MemCheck_on() CRYPTO_is_mem_check_on()
251 264
252#define Malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__) 265#define OPENSSL_malloc(num) CRYPTO_malloc((int)num,__FILE__,__LINE__)
253#define Realloc(addr,num) \ 266#define OPENSSL_realloc(addr,num) \
254 CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__) 267 CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)
255#define Remalloc(addr,num) \ 268#define OPENSSL_remalloc(addr,num) \
256 CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__) 269 CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)
257#define FreeFunc CRYPTO_free 270#define OPENSSL_freeFunc CRYPTO_free
258#define Free(addr) CRYPTO_free(addr) 271#define OPENSSL_free(addr) CRYPTO_free(addr)
259 272
260#define Malloc_locked(num) CRYPTO_malloc_locked((int)num,__FILE__,__LINE__) 273#define OPENSSL_malloc_locked(num) \
261#define Free_locked(addr) CRYPTO_free_locked(addr) 274 CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)
262 275#define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)
263
264/* Case insensiteve linking causes problems.... */
265#if defined(WIN16) || defined(VMS)
266#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
267#endif
268 276
269 277
270const char *SSLeay_version(int type); 278const char *SSLeay_version(int type);
@@ -298,14 +306,32 @@ const char *CRYPTO_get_lock_name(int type);
298int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file, 306int CRYPTO_add_lock(int *pointer,int amount,int type, const char *file,
299 int line); 307 int line);
300 308
309int CRYPTO_get_new_dynlockid(void);
310void CRYPTO_destroy_dynlockid(int i);
311struct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);
312void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, int line));
313void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line));
314void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, const char *file, int line));
315struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file,int line);
316void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file,int line);
317void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file,int line);
318
301/* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- 319/* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions --
302 * call the latter last if you need different functions */ 320 * call the latter last if you need different functions */
303int CRYPTO_set_mem_functions(void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *)); 321int CRYPTO_set_mem_functions(void *(*m)(size_t),void *(*r)(void *,size_t), void (*f)(void *));
304int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *)); 322int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *));
305int CRYPTO_set_mem_debug_functions(void (*m)(),void (*r)(),void (*f)(),void (*so)(),long (*go)()); 323int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
324 void (*r)(void *,void *,int,const char *,int,int),
325 void (*f)(void *,int),
326 void (*so)(long),
327 long (*go)(void));
306void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *)); 328void CRYPTO_get_mem_functions(void *(**m)(size_t),void *(**r)(void *, size_t), void (**f)(void *));
307void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); 329void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *));
308void CRYPTO_get_mem_debug_functions(void (**m)(),void (**r)(),void (**f)(),void (**so)(),long (**go)()); 330void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int),
331 void (**r)(void *,void *,int,const char *,int,int),
332 void (**f)(void *,int),
333 void (**so)(long),
334 long (**go)(void));
309 335
310void *CRYPTO_malloc_locked(int num, const char *file, int line); 336void *CRYPTO_malloc_locked(int num, const char *file, int line);
311void CRYPTO_free_locked(void *); 337void CRYPTO_free_locked(void *);
@@ -348,7 +374,7 @@ void CRYPTO_mem_leaks_fp(FILE *);
348#endif 374#endif
349void CRYPTO_mem_leaks(struct bio_st *bio); 375void CRYPTO_mem_leaks(struct bio_st *bio);
350/* unsigned long order, char *file, int line, int num_bytes, char *addr */ 376/* unsigned long order, char *file, int line, int num_bytes, char *addr */
351void CRYPTO_mem_leaks_cb(void (*cb)()); 377void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void *));
352 378
353void ERR_load_CRYPTO_strings(void); 379void ERR_load_CRYPTO_strings(void);
354 380
@@ -361,10 +387,12 @@ void ERR_load_CRYPTO_strings(void);
361 387
362/* Function codes. */ 388/* Function codes. */
363#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 389#define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
390#define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID 103
364#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101 391#define CRYPTO_F_CRYPTO_GET_NEW_LOCKID 101
365#define CRYPTO_F_CRYPTO_SET_EX_DATA 102 392#define CRYPTO_F_CRYPTO_SET_EX_DATA 102
366 393
367/* Reason codes. */ 394/* Reason codes. */
395#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
368 396
369#ifdef __cplusplus 397#ifdef __cplusplus
370} 398}
diff --git a/src/lib/libcrypto/des/Makefile.ssl b/src/lib/libcrypto/des/Makefile.ssl
index 3eb0738b7b..34a360b7ab 100644
--- a/src/lib/libcrypto/des/Makefile.ssl
+++ b/src/lib/libcrypto/des/Makefile.ssl
@@ -162,16 +162,19 @@ ede_cbcm_enc.o: ../../include/openssl/opensslconf.h des_locl.h
162enc_read.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 162enc_read.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
163enc_read.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 163enc_read.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
164enc_read.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 164enc_read.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
165enc_read.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 165enc_read.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
166enc_read.o: ../../include/openssl/opensslconf.h
166enc_read.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 167enc_read.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
167enc_read.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h 168enc_read.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
169enc_read.o: ../cryptlib.h des_locl.h
168enc_writ.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 170enc_writ.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
169enc_writ.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 171enc_writ.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
170enc_writ.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 172enc_writ.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
171enc_writ.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 173enc_writ.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
174enc_writ.o: ../../include/openssl/opensslconf.h
172enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 175enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
173enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 176enc_writ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
174enc_writ.o: ../cryptlib.h des_locl.h 177enc_writ.o: ../../include/openssl/symhacks.h ../cryptlib.h des_locl.h
175fcrypt.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 178fcrypt.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
176fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h 179fcrypt.o: ../../include/openssl/opensslconf.h des_locl.h
177fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 180fcrypt_b.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
@@ -193,9 +196,11 @@ read2pwd.o: ../../include/openssl/opensslconf.h des_locl.h
193read_pwd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 196read_pwd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
194read_pwd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 197read_pwd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
195read_pwd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 198read_pwd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
196read_pwd.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 199read_pwd.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
200read_pwd.o: ../../include/openssl/opensslconf.h
197read_pwd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 201read_pwd.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
198read_pwd.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h 202read_pwd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
203read_pwd.o: ../cryptlib.h des_locl.h
199rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 204rpc_enc.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
200rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h 205rpc_enc.o: ../../include/openssl/opensslconf.h des_locl.h des_ver.h rpc_des.h
201set_key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 206set_key.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
diff --git a/src/lib/libcrypto/des/des.c b/src/lib/libcrypto/des/des.c
index 0197489c9e..215d7413c0 100644
--- a/src/lib/libcrypto/des/des.c
+++ b/src/lib/libcrypto/des/des.c
@@ -374,8 +374,8 @@ void doencryption(void)
374 374
375 if (buf == NULL) 375 if (buf == NULL)
376 { 376 {
377 if ( (( buf=Malloc(BUFSIZE+8)) == NULL) || 377 if ( (( buf=OPENSSL_malloc(BUFSIZE+8)) == NULL) ||
378 ((obuf=Malloc(BUFSIZE+8)) == NULL)) 378 ((obuf=OPENSSL_malloc(BUFSIZE+8)) == NULL))
379 { 379 {
380 fputs("Not enough memory\n",stderr); 380 fputs("Not enough memory\n",stderr);
381 Exit=10; 381 Exit=10;
diff --git a/src/lib/libcrypto/des/des.h b/src/lib/libcrypto/des/des.h
index ead67986d9..2db9748cb4 100644
--- a/src/lib/libcrypto/des/des.h
+++ b/src/lib/libcrypto/des/des.h
@@ -59,10 +59,6 @@
59#ifndef HEADER_DES_H 59#ifndef HEADER_DES_H
60#define HEADER_DES_H 60#define HEADER_DES_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_DES 62#ifdef NO_DES
67#error DES is disabled. 63#error DES is disabled.
68#endif 64#endif
@@ -71,10 +67,13 @@ extern "C" {
71#error <openssl/des.h> replaces <kerberos/des.h>. 67#error <openssl/des.h> replaces <kerberos/des.h>.
72#endif 68#endif
73 69
74#include <stdio.h>
75#include <openssl/opensslconf.h> /* DES_LONG */ 70#include <openssl/opensslconf.h> /* DES_LONG */
76#include <openssl/e_os2.h> /* OPENSSL_EXTERN */ 71#include <openssl/e_os2.h> /* OPENSSL_EXTERN */
77 72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
78typedef unsigned char des_cblock[8]; 77typedef unsigned char des_cblock[8];
79typedef /* const */ unsigned char const_des_cblock[8]; 78typedef /* const */ unsigned char const_des_cblock[8];
80/* With "const", gcc 2.8.1 on Solaris thinks that des_cblock * 79/* With "const", gcc 2.8.1 on Solaris thinks that des_cblock *
diff --git a/src/lib/libcrypto/des/enc_read.c b/src/lib/libcrypto/des/enc_read.c
index 7399ff7269..af2d9177d2 100644
--- a/src/lib/libcrypto/des/enc_read.c
+++ b/src/lib/libcrypto/des/enc_read.c
@@ -103,17 +103,17 @@ int des_enc_read(int fd, void *buf, int len, des_key_schedule sched,
103 103
104 if (tmpbuf == NULL) 104 if (tmpbuf == NULL)
105 { 105 {
106 tmpbuf=Malloc(BSIZE); 106 tmpbuf=OPENSSL_malloc(BSIZE);
107 if (tmpbuf == NULL) return(-1); 107 if (tmpbuf == NULL) return(-1);
108 } 108 }
109 if (net == NULL) 109 if (net == NULL)
110 { 110 {
111 net=Malloc(BSIZE); 111 net=OPENSSL_malloc(BSIZE);
112 if (net == NULL) return(-1); 112 if (net == NULL) return(-1);
113 } 113 }
114 if (unnet == NULL) 114 if (unnet == NULL)
115 { 115 {
116 unnet=Malloc(BSIZE); 116 unnet=OPENSSL_malloc(BSIZE);
117 if (unnet == NULL) return(-1); 117 if (unnet == NULL) return(-1);
118 } 118 }
119 /* left over data from last decrypt */ 119 /* left over data from last decrypt */
diff --git a/src/lib/libcrypto/des/enc_writ.c b/src/lib/libcrypto/des/enc_writ.c
index 4d3452724e..cc2b50fb50 100644
--- a/src/lib/libcrypto/des/enc_writ.c
+++ b/src/lib/libcrypto/des/enc_writ.c
@@ -95,7 +95,7 @@ int des_enc_write(int fd, const void *_buf, int len,
95 95
96 if (outbuf == NULL) 96 if (outbuf == NULL)
97 { 97 {
98 outbuf=Malloc(BSIZE+HDRSIZE); 98 outbuf=OPENSSL_malloc(BSIZE+HDRSIZE);
99 if (outbuf == NULL) return(-1); 99 if (outbuf == NULL) return(-1);
100 } 100 }
101 /* If we are sending less than 8 bytes, the same char will look 101 /* If we are sending less than 8 bytes, the same char will look
diff --git a/src/lib/libcrypto/des/qud_cksm.c b/src/lib/libcrypto/des/qud_cksm.c
index 5f0ec5387f..9fff989edb 100644
--- a/src/lib/libcrypto/des/qud_cksm.c
+++ b/src/lib/libcrypto/des/qud_cksm.c
@@ -81,13 +81,17 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[],
81 long l; 81 long l;
82 const unsigned char *cp; 82 const unsigned char *cp;
83#ifdef _CRAY 83#ifdef _CRAY
84 short *lp; 84 struct lp_st { int a:32; int b:32; } *lp;
85#else 85#else
86 DES_LONG *lp; 86 DES_LONG *lp;
87#endif 87#endif
88 88
89 if (out_count < 1) out_count=1; 89 if (out_count < 1) out_count=1;
90#ifdef _CRAY
91 lp = (struct lp_st *) &(output[0])[0];
92#else
90 lp = (DES_LONG *) &(output[0])[0]; 93 lp = (DES_LONG *) &(output[0])[0];
94#endif
91 95
92 z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]); 96 z0=Q_B0((*seed)[0])|Q_B1((*seed)[1])|Q_B2((*seed)[2])|Q_B3((*seed)[3]);
93 z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]); 97 z1=Q_B0((*seed)[4])|Q_B1((*seed)[5])|Q_B2((*seed)[6])|Q_B3((*seed)[7]);
@@ -120,8 +124,14 @@ DES_LONG des_quad_cksum(const unsigned char *input, des_cblock output[],
120 { 124 {
121 /* The MIT library assumes that the checksum is 125 /* The MIT library assumes that the checksum is
122 * composed of 2*out_count 32 bit ints */ 126 * composed of 2*out_count 32 bit ints */
127#ifdef _CRAY
128 (*lp).a = z0;
129 (*lp).b = z1;
130 lp++;
131#else
123 *lp++ = z0; 132 *lp++ = z0;
124 *lp++ = z1; 133 *lp++ = z1;
134#endif
125 } 135 }
126 } 136 }
127 return(z0); 137 return(z0);
diff --git a/src/lib/libcrypto/des/read_pwd.c b/src/lib/libcrypto/des/read_pwd.c
index fa2d67da64..c27ec336e7 100644
--- a/src/lib/libcrypto/des/read_pwd.c
+++ b/src/lib/libcrypto/des/read_pwd.c
@@ -161,7 +161,7 @@
161#include <sys/ioctl.h> 161#include <sys/ioctl.h>
162#endif 162#endif
163 163
164#ifdef MSDOS 164#if defined(MSDOS) && !defined(__CYGWIN32__)
165#include <conio.h> 165#include <conio.h>
166#define fgets(a,b,c) noecho_fgets(a,b,c) 166#define fgets(a,b,c) noecho_fgets(a,b,c)
167#endif 167#endif
@@ -265,13 +265,17 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
265 is_a_tty=1; 265 is_a_tty=1;
266 tty=NULL; 266 tty=NULL;
267 267
268#ifndef MSDOS 268#ifdef MSDOS
269 if ((tty=fopen("/dev/tty","r")) == NULL)
270 tty=stdin;
271#else /* MSDOS */
272 if ((tty=fopen("con","r")) == NULL) 269 if ((tty=fopen("con","r")) == NULL)
273 tty=stdin; 270 tty=stdin;
274#endif /* MSDOS */ 271#elif defined(MAC_OS_pre_X)
272 tty=stdin;
273#else
274#ifndef MPE
275 if ((tty=fopen("/dev/tty","r")) == NULL)
276#endif
277 tty=stdin;
278#endif
275 279
276#if defined(TTY_get) && !defined(VMS) 280#if defined(TTY_get) && !defined(VMS)
277 if (TTY_get(fileno(tty),&tty_orig) == -1) 281 if (TTY_get(fileno(tty),&tty_orig) == -1)
@@ -310,8 +314,12 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
310 314
311#if defined(TTY_set) && !defined(VMS) 315#if defined(TTY_set) && !defined(VMS)
312 if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1)) 316 if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1))
317#ifdef MPE
318 ; /* MPE lies -- echo really has been disabled */
319#else
313 return(-1); 320 return(-1);
314#endif 321#endif
322#endif
315#ifdef VMS 323#ifdef VMS
316 tty_new[0] = tty_orig[0]; 324 tty_new[0] = tty_orig[0];
317 tty_new[1] = tty_orig[1] | TT$M_NOECHO; 325 tty_new[1] = tty_orig[1] | TT$M_NOECHO;
diff --git a/src/lib/libcrypto/dh/Makefile.ssl b/src/lib/libcrypto/dh/Makefile.ssl
index 8df60872ef..88d0d1748b 100644
--- a/src/lib/libcrypto/dh/Makefile.ssl
+++ b/src/lib/libcrypto/dh/Makefile.ssl
@@ -82,31 +82,57 @@ dh_check.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
82dh_check.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 82dh_check.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
83dh_check.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h 83dh_check.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
84dh_check.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 84dh_check.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
85dh_check.o: ../../include/openssl/opensslconf.h 85dh_check.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
86dh_check.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 86dh_check.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
87dh_check.o: ../../include/openssl/stack.h ../cryptlib.h 87dh_check.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
88dh_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 88dh_check.o: ../cryptlib.h
89dh_err.o: ../../include/openssl/dh.h ../../include/openssl/err.h 89dh_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
90dh_err.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
91dh_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
90dh_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 92dh_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
91dh_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 93dh_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
94dh_err.o: ../../include/openssl/symhacks.h
92dh_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 95dh_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
93dh_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 96dh_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
94dh_gen.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h 97dh_gen.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h
95dh_gen.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 98dh_gen.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
96dh_gen.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 99dh_gen.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
97dh_gen.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 100dh_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
101dh_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
98dh_gen.o: ../cryptlib.h 102dh_gen.o: ../cryptlib.h
99dh_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 103dh_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
100dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 104dh_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
101dh_key.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h 105dh_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
102dh_key.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 106dh_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
103dh_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 107dh_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
104dh_key.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 108dh_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
105dh_key.o: ../../include/openssl/stack.h ../cryptlib.h 109dh_key.o: ../../include/openssl/engine.h ../../include/openssl/err.h
106dh_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 110dh_key.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
107dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 111dh_key.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
108dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h 112dh_key.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
109dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 113dh_key.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
110dh_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 114dh_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
111dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 115dh_key.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
112dh_lib.o: ../cryptlib.h 116dh_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
117dh_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
118dh_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
119dh_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
120dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
121dh_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
122dh_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
123dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
124dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
125dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
126dh_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
127dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
128dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
129dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
130dh_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
131dh_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
132dh_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
133dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
134dh_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
135dh_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
136dh_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
137dh_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
138dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h
index c15b2ad483..7a8d9f88c2 100644
--- a/src/lib/libcrypto/dh/dh.h
+++ b/src/lib/libcrypto/dh/dh.h
@@ -59,19 +59,22 @@
59#ifndef HEADER_DH_H 59#ifndef HEADER_DH_H
60#define HEADER_DH_H 60#define HEADER_DH_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_DH 62#ifdef NO_DH
67#error DH is disabled. 63#error DH is disabled.
68#endif 64#endif
69 65
66#ifndef NO_BIO
67#include <openssl/bio.h>
68#endif
70#include <openssl/bn.h> 69#include <openssl/bn.h>
71#include <openssl/crypto.h> 70#include <openssl/crypto.h>
72 71
73#define DH_FLAG_CACHE_MONT_P 0x01 72#define DH_FLAG_CACHE_MONT_P 0x01
74 73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
75typedef struct dh_st DH; 78typedef struct dh_st DH;
76 79
77typedef struct dh_method { 80typedef struct dh_method {
@@ -112,7 +115,11 @@ struct dh_st
112 115
113 int references; 116 int references;
114 CRYPTO_EX_DATA ex_data; 117 CRYPTO_EX_DATA ex_data;
118#if 0
115 DH_METHOD *meth; 119 DH_METHOD *meth;
120#else
121 struct engine_st *engine;
122#endif
116 }; 123 };
117 124
118#define DH_GENERATOR_2 2 125#define DH_GENERATOR_2 2
@@ -147,10 +154,15 @@ struct dh_st
147 154
148DH_METHOD *DH_OpenSSL(void); 155DH_METHOD *DH_OpenSSL(void);
149 156
150void DH_set_default_method(DH_METHOD *meth); 157void DH_set_default_openssl_method(DH_METHOD *meth);
151DH_METHOD *DH_get_default_method(void); 158DH_METHOD *DH_get_default_openssl_method(void);
159#if 0
152DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 160DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth);
153DH *DH_new_method(DH_METHOD *meth); 161DH *DH_new_method(DH_METHOD *meth);
162#else
163int DH_set_method(DH *dh, struct engine_st *engine);
164DH *DH_new_method(struct engine_st *engine);
165#endif
154 166
155DH * DH_new(void); 167DH * DH_new(void);
156void DH_free(DH *dh); 168void DH_free(DH *dh);
@@ -169,7 +181,7 @@ int i2d_DHparams(DH *a,unsigned char **pp);
169#ifndef NO_FP_API 181#ifndef NO_FP_API
170int DHparams_print_fp(FILE *fp, DH *x); 182int DHparams_print_fp(FILE *fp, DH *x);
171#endif 183#endif
172#ifdef HEADER_BIO_H 184#ifndef NO_BIO
173int DHparams_print(BIO *bp, DH *x); 185int DHparams_print(BIO *bp, DH *x);
174#else 186#else
175int DHparams_print(char *bp, DH *x); 187int DHparams_print(char *bp, DH *x);
diff --git a/src/lib/libcrypto/dh/dh_key.c b/src/lib/libcrypto/dh/dh_key.c
index 0c7eeaf260..6915d79dcc 100644
--- a/src/lib/libcrypto/dh/dh_key.c
+++ b/src/lib/libcrypto/dh/dh_key.c
@@ -61,6 +61,7 @@
61#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/rand.h> 62#include <openssl/rand.h>
63#include <openssl/dh.h> 63#include <openssl/dh.h>
64#include <openssl/engine.h>
64 65
65static int generate_key(DH *dh); 66static int generate_key(DH *dh);
66static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); 67static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
@@ -72,12 +73,12 @@ static int dh_finish(DH *dh);
72 73
73int DH_generate_key(DH *dh) 74int DH_generate_key(DH *dh)
74 { 75 {
75 return dh->meth->generate_key(dh); 76 return ENGINE_get_DH(dh->engine)->generate_key(dh);
76 } 77 }
77 78
78int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh) 79int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
79 { 80 {
80 return dh->meth->compute_key(key, pub_key, dh); 81 return ENGINE_get_DH(dh->engine)->compute_key(key, pub_key, dh);
81 } 82 }
82 83
83static DH_METHOD dh_ossl = { 84static DH_METHOD dh_ossl = {
@@ -137,8 +138,9 @@ static int generate_key(DH *dh)
137 } 138 }
138 mont=(BN_MONT_CTX *)dh->method_mont_p; 139 mont=(BN_MONT_CTX *)dh->method_mont_p;
139 140
140 if (!dh->meth->bn_mod_exp(dh, pub_key,dh->g,priv_key,dh->p,&ctx,mont)) 141 if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, pub_key, dh->g,
141 goto err; 142 priv_key,dh->p,&ctx,mont))
143 goto err;
142 144
143 dh->pub_key=pub_key; 145 dh->pub_key=pub_key;
144 dh->priv_key=priv_key; 146 dh->priv_key=priv_key;
@@ -177,7 +179,8 @@ static int compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh)
177 } 179 }
178 180
179 mont=(BN_MONT_CTX *)dh->method_mont_p; 181 mont=(BN_MONT_CTX *)dh->method_mont_p;
180 if (!dh->meth->bn_mod_exp(dh, tmp,pub_key,dh->priv_key,dh->p,&ctx,mont)) 182 if (!ENGINE_get_DH(dh->engine)->bn_mod_exp(dh, tmp, pub_key,
183 dh->priv_key,dh->p,&ctx,mont))
181 { 184 {
182 DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB); 185 DHerr(DH_F_DH_COMPUTE_KEY,ERR_R_BN_LIB);
183 goto err; 186 goto err;
@@ -193,19 +196,26 @@ err:
193static int dh_bn_mod_exp(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, 196static int dh_bn_mod_exp(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
194 const BIGNUM *m, BN_CTX *ctx, 197 const BIGNUM *m, BN_CTX *ctx,
195 BN_MONT_CTX *m_ctx) 198 BN_MONT_CTX *m_ctx)
196{ 199 {
197 return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx); 200 if (a->top == 1)
198} 201 {
202 BN_ULONG A = a->d[0];
203 return BN_mod_exp_mont_word(r,A,p,m,ctx,m_ctx);
204 }
205 else
206 return BN_mod_exp_mont(r,a,p,m,ctx,m_ctx);
207 }
208
199 209
200static int dh_init(DH *dh) 210static int dh_init(DH *dh)
201{ 211 {
202 dh->flags |= DH_FLAG_CACHE_MONT_P; 212 dh->flags |= DH_FLAG_CACHE_MONT_P;
203 return(1); 213 return(1);
204} 214 }
205 215
206static int dh_finish(DH *dh) 216static int dh_finish(DH *dh)
207{ 217 {
208 if(dh->method_mont_p) 218 if(dh->method_mont_p)
209 BN_MONT_CTX_free((BN_MONT_CTX *)dh->method_mont_p); 219 BN_MONT_CTX_free((BN_MONT_CTX *)dh->method_mont_p);
210 return(1); 220 return(1);
211} 221 }
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c
index 6c21463028..66803b5565 100644
--- a/src/lib/libcrypto/dh/dh_lib.c
+++ b/src/lib/libcrypto/dh/dh_lib.c
@@ -60,6 +60,7 @@
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/dh.h> 62#include <openssl/dh.h>
63#include <openssl/engine.h>
63 64
64const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT; 65const char *DH_version="Diffie-Hellman" OPENSSL_VERSION_PTEXT;
65 66
@@ -67,17 +68,32 @@ static DH_METHOD *default_DH_method;
67static int dh_meth_num = 0; 68static int dh_meth_num = 0;
68static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL; 69static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dh_meth = NULL;
69 70
70void DH_set_default_method(DH_METHOD *meth) 71void DH_set_default_openssl_method(DH_METHOD *meth)
71{ 72{
72 default_DH_method = meth; 73 ENGINE *e;
74 /* We'll need to notify the "openssl" ENGINE of this
75 * change too. We won't bother locking things down at
76 * our end as there was never any locking in these
77 * functions! */
78 if(default_DH_method != meth)
79 {
80 default_DH_method = meth;
81 e = ENGINE_by_id("openssl");
82 if(e)
83 {
84 ENGINE_set_DH(e, meth);
85 ENGINE_free(e);
86 }
87 }
73} 88}
74 89
75DH_METHOD *DH_get_default_method(void) 90DH_METHOD *DH_get_default_openssl_method(void)
76{ 91{
77 if(!default_DH_method) default_DH_method = DH_OpenSSL(); 92 if(!default_DH_method) default_DH_method = DH_OpenSSL();
78 return default_DH_method; 93 return default_DH_method;
79} 94}
80 95
96#if 0
81DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth) 97DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
82{ 98{
83 DH_METHOD *mtmp; 99 DH_METHOD *mtmp;
@@ -87,25 +103,56 @@ DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth)
87 if (meth->init) meth->init(dh); 103 if (meth->init) meth->init(dh);
88 return mtmp; 104 return mtmp;
89} 105}
106#else
107int DH_set_method(DH *dh, ENGINE *engine)
108{
109 ENGINE *mtmp;
110 DH_METHOD *meth;
111 mtmp = dh->engine;
112 meth = ENGINE_get_DH(mtmp);
113 if (!ENGINE_init(engine))
114 return 0;
115 if (meth->finish) meth->finish(dh);
116 dh->engine= engine;
117 meth = ENGINE_get_DH(engine);
118 if (meth->init) meth->init(dh);
119 /* SHOULD ERROR CHECK THIS!!! */
120 ENGINE_finish(mtmp);
121 return 1;
122}
123#endif
90 124
91DH *DH_new(void) 125DH *DH_new(void)
92{ 126{
93 return DH_new_method(NULL); 127 return DH_new_method(NULL);
94} 128}
95 129
130#if 0
96DH *DH_new_method(DH_METHOD *meth) 131DH *DH_new_method(DH_METHOD *meth)
132#else
133DH *DH_new_method(ENGINE *engine)
134#endif
97 { 135 {
136 DH_METHOD *meth;
98 DH *ret; 137 DH *ret;
99 ret=(DH *)Malloc(sizeof(DH)); 138 ret=(DH *)OPENSSL_malloc(sizeof(DH));
100 139
101 if (ret == NULL) 140 if (ret == NULL)
102 { 141 {
103 DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE); 142 DHerr(DH_F_DH_NEW,ERR_R_MALLOC_FAILURE);
104 return(NULL); 143 return(NULL);
105 } 144 }
106 if(!default_DH_method) default_DH_method = DH_OpenSSL(); 145 if(engine)
107 if(meth) ret->meth = meth; 146 ret->engine = engine;
108 else ret->meth = default_DH_method; 147 else
148 {
149 if((ret->engine=ENGINE_get_default_DH()) == NULL)
150 {
151 OPENSSL_free(ret);
152 return NULL;
153 }
154 }
155 meth = ENGINE_get_DH(ret->engine);
109 ret->pad=0; 156 ret->pad=0;
110 ret->version=0; 157 ret->version=0;
111 ret->p=NULL; 158 ret->p=NULL;
@@ -120,10 +167,10 @@ DH *DH_new_method(DH_METHOD *meth)
120 ret->counter = NULL; 167 ret->counter = NULL;
121 ret->method_mont_p=NULL; 168 ret->method_mont_p=NULL;
122 ret->references = 1; 169 ret->references = 1;
123 ret->flags=ret->meth->flags; 170 ret->flags=meth->flags;
124 if ((ret->meth->init != NULL) && !ret->meth->init(ret)) 171 if ((meth->init != NULL) && !meth->init(ret))
125 { 172 {
126 Free(ret); 173 OPENSSL_free(ret);
127 ret=NULL; 174 ret=NULL;
128 } 175 }
129 else 176 else
@@ -133,6 +180,7 @@ DH *DH_new_method(DH_METHOD *meth)
133 180
134void DH_free(DH *r) 181void DH_free(DH *r)
135 { 182 {
183 DH_METHOD *meth;
136 int i; 184 int i;
137 if(r == NULL) return; 185 if(r == NULL) return;
138 i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH); 186 i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
@@ -150,17 +198,19 @@ void DH_free(DH *r)
150 198
151 CRYPTO_free_ex_data(dh_meth, r, &r->ex_data); 199 CRYPTO_free_ex_data(dh_meth, r, &r->ex_data);
152 200
153 if(r->meth->finish) r->meth->finish(r); 201 meth = ENGINE_get_DH(r->engine);
202 if(meth->finish) meth->finish(r);
203 ENGINE_finish(r->engine);
154 204
155 if (r->p != NULL) BN_clear_free(r->p); 205 if (r->p != NULL) BN_clear_free(r->p);
156 if (r->g != NULL) BN_clear_free(r->g); 206 if (r->g != NULL) BN_clear_free(r->g);
157 if (r->q != NULL) BN_clear_free(r->q); 207 if (r->q != NULL) BN_clear_free(r->q);
158 if (r->j != NULL) BN_clear_free(r->j); 208 if (r->j != NULL) BN_clear_free(r->j);
159 if (r->seed) Free(r->seed); 209 if (r->seed) OPENSSL_free(r->seed);
160 if (r->counter != NULL) BN_clear_free(r->counter); 210 if (r->counter != NULL) BN_clear_free(r->counter);
161 if (r->pub_key != NULL) BN_clear_free(r->pub_key); 211 if (r->pub_key != NULL) BN_clear_free(r->pub_key);
162 if (r->priv_key != NULL) BN_clear_free(r->priv_key); 212 if (r->priv_key != NULL) BN_clear_free(r->priv_key);
163 Free(r); 213 OPENSSL_free(r);
164 } 214 }
165 215
166int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 216int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
diff --git a/src/lib/libcrypto/dh/dhtest.c b/src/lib/libcrypto/dh/dhtest.c
index d66c28455e..f0151253d7 100644
--- a/src/lib/libcrypto/dh/dhtest.c
+++ b/src/lib/libcrypto/dh/dhtest.c
@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
140 BIO_puts(out,"\n"); 140 BIO_puts(out,"\n");
141 141
142 alen=DH_size(a); 142 alen=DH_size(a);
143 abuf=(unsigned char *)Malloc(alen); 143 abuf=(unsigned char *)OPENSSL_malloc(alen);
144 aout=DH_compute_key(abuf,b->pub_key,a); 144 aout=DH_compute_key(abuf,b->pub_key,a);
145 145
146 BIO_puts(out,"key1 ="); 146 BIO_puts(out,"key1 =");
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
152 BIO_puts(out,"\n"); 152 BIO_puts(out,"\n");
153 153
154 blen=DH_size(b); 154 blen=DH_size(b);
155 bbuf=(unsigned char *)Malloc(blen); 155 bbuf=(unsigned char *)OPENSSL_malloc(blen);
156 bout=DH_compute_key(bbuf,a->pub_key,b); 156 bout=DH_compute_key(bbuf,a->pub_key,b);
157 157
158 BIO_puts(out,"key2 ="); 158 BIO_puts(out,"key2 =");
@@ -170,8 +170,8 @@ int main(int argc, char *argv[])
170 else 170 else
171 ret=0; 171 ret=0;
172err: 172err:
173 if (abuf != NULL) Free(abuf); 173 if (abuf != NULL) OPENSSL_free(abuf);
174 if (bbuf != NULL) Free(bbuf); 174 if (bbuf != NULL) OPENSSL_free(bbuf);
175 if(b != NULL) DH_free(b); 175 if(b != NULL) DH_free(b);
176 if(a != NULL) DH_free(a); 176 if(a != NULL) DH_free(a);
177 BIO_free(out); 177 BIO_free(out);
diff --git a/src/lib/libcrypto/doc/DH_set_method.pod b/src/lib/libcrypto/doc/DH_set_method.pod
index a8f75bdd9d..62088eea1b 100644
--- a/src/lib/libcrypto/doc/DH_set_method.pod
+++ b/src/lib/libcrypto/doc/DH_set_method.pod
@@ -2,20 +2,21 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DH_set_default_method, DH_get_default_method, DH_set_method, 5DH_set_default_openssl_method, DH_get_default_openssl_method,
6DH_new_method, DH_OpenSSL - select DH method 6DH_set_method, DH_new_method, DH_OpenSSL - select DH method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/dh.h> 10 #include <openssl/dh.h>
11 #include <openssl/engine.h>
11 12
12 void DH_set_default_method(DH_METHOD *meth); 13 void DH_set_default_openssl_method(DH_METHOD *meth);
13 14
14 DH_METHOD *DH_get_default_method(void); 15 DH_METHOD *DH_get_default_openssl_method(void);
15 16
16 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 17 int DH_set_method(DH *dh, ENGINE *engine);
17 18
18 DH *DH_new_method(DH_METHOD *meth); 19 DH *DH_new_method(ENGINE *engine);
19 20
20 DH_METHOD *DH_OpenSSL(void); 21 DH_METHOD *DH_OpenSSL(void);
21 22
@@ -28,20 +29,26 @@ such as hardware accelerators may be used.
28Initially, the default is to use the OpenSSL internal implementation. 29Initially, the default is to use the OpenSSL internal implementation.
29DH_OpenSSL() returns a pointer to that method. 30DH_OpenSSL() returns a pointer to that method.
30 31
31DH_set_default_method() makes B<meth> the default method for all B<DH> 32DH_set_default_openssl_method() makes B<meth> the default method for all DH
32structures created later. 33structures created later. B<NB:> This is true only whilst the default engine
34for Diffie-Hellman operations remains as "openssl". ENGINEs provide an
35encapsulation for implementations of one or more algorithms, and all the DH
36functions mentioned here operate within the scope of the default
37"openssl" engine.
33 38
34DH_get_default_method() returns a pointer to the current default 39DH_get_default_openssl_method() returns a pointer to the current default
35method. 40method for the "openssl" engine.
36 41
37DH_set_method() selects B<meth> for all operations using the structure B<dh>. 42DH_set_method() selects B<engine> as the engine that will be responsible for
43all operations using the structure B<dh>. If this function completes successfully,
44then the B<dh> structure will have its own functional reference of B<engine>, so
45the caller should remember to free their own reference to B<engine> when they are
46finished with it. NB: An ENGINE's DH_METHOD can be retrieved (or set) by
47ENGINE_get_DH() or ENGINE_set_DH().
38 48
39DH_get_method() returns a pointer to the method currently selected 49DH_new_method() allocates and initializes a DH structure so that
40for B<dh>. 50B<engine> will be used for the DH operations. If B<engine> is NULL,
41 51the default engine for Diffie-Hellman opertaions is used.
42DH_new_method() allocates and initializes a B<DH> structure so that
43B<method> will be used for the DH operations. If B<method> is B<NULL>,
44the default method is used.
45 52
46=head1 THE DH_METHOD STRUCTURE 53=head1 THE DH_METHOD STRUCTURE
47 54
@@ -75,17 +82,17 @@ the default method is used.
75 82
76=head1 RETURN VALUES 83=head1 RETURN VALUES
77 84
78DH_OpenSSL(), DH_get_default_method() and DH_get_method() return 85DH_OpenSSL() and DH_get_default_method() return pointers to the respective
79pointers to the respective B<DH_METHOD>s. 86DH_METHODs.
80 87
81DH_set_default_method() returns no value. 88DH_set_default_openssl_method() returns no value.
82 89
83DH_set_method() returns a pointer to the B<DH_METHOD> previously 90DH_set_method() returns non-zero if the ENGINE associated with B<dh>
84associated with B<dh>. 91was successfully changed to B<engine>.
85 92
86DH_new_method() returns B<NULL> and sets an error code that can be 93DH_new_method() returns NULL and sets an error code that can be
87obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 94obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails.
88returns a pointer to the newly allocated structure. 95Otherwise it returns a pointer to the newly allocated structure.
89 96
90=head1 SEE ALSO 97=head1 SEE ALSO
91 98
@@ -96,4 +103,9 @@ L<dh(3)|dh(3)>, L<DH_new(3)|DH_new(3)>
96DH_set_default_method(), DH_get_default_method(), DH_set_method(), 103DH_set_default_method(), DH_get_default_method(), DH_set_method(),
97DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4. 104DH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4.
98 105
106DH_set_default_openssl_method() and DH_get_default_openssl_method()
107replaced DH_set_default_method() and DH_get_default_method() respectively,
108and DH_set_method() and DH_new_method() were altered to use B<ENGINE>s
109rather than B<DH_METHOD>s during development of OpenSSL 0.9.6.
110
99=cut 111=cut
diff --git a/src/lib/libcrypto/doc/DSA_set_method.pod b/src/lib/libcrypto/doc/DSA_set_method.pod
index edec46413d..c56dfd0f47 100644
--- a/src/lib/libcrypto/doc/DSA_set_method.pod
+++ b/src/lib/libcrypto/doc/DSA_set_method.pod
@@ -2,20 +2,21 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5DSA_set_default_method, DSA_get_default_method, DSA_set_method, 5DSA_set_default_openssl_method, DSA_get_default_openssl_method,
6DSA_new_method, DSA_OpenSSL - select RSA method 6DSA_set_method, DSA_new_method, DSA_OpenSSL - select DSA method
7 7
8=head1 SYNOPSIS 8=head1 SYNOPSIS
9 9
10 #include <openssl/DSA.h> 10 #include <openssl/dsa.h>
11 #include <openssl/engine.h>
11 12
12 void DSA_set_default_method(DSA_METHOD *meth); 13 void DSA_set_default_openssl_method(DSA_METHOD *meth);
13 14
14 DSA_METHOD *DSA_get_default_method(void); 15 DSA_METHOD *DSA_get_default_openssl_method(void);
15 16
16 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); 17 int DSA_set_method(DSA *dsa, ENGINE *engine);
17 18
18 DSA *DSA_new_method(DSA_METHOD *meth); 19 DSA *DSA_new_method(ENGINE *engine);
19 20
20 DSA_METHOD *DSA_OpenSSL(void); 21 DSA_METHOD *DSA_OpenSSL(void);
21 22
@@ -28,20 +29,21 @@ such as hardware accelerators may be used.
28Initially, the default is to use the OpenSSL internal implementation. 29Initially, the default is to use the OpenSSL internal implementation.
29DSA_OpenSSL() returns a pointer to that method. 30DSA_OpenSSL() returns a pointer to that method.
30 31
31DSA_set_default_method() makes B<meth> the default method for all B<DSA> 32DSA_set_default_openssl_method() makes B<meth> the default method for
32structures created later. 33all DSA structures created later. B<NB:> This is true only whilst the
34default engine for DSA operations remains as "openssl". ENGINEs
35provide an encapsulation for implementations of one or more algorithms at a
36time, and all the DSA functions mentioned here operate within the scope
37of the default "openssl" engine.
33 38
34DSA_get_default_method() returns a pointer to the current default 39DSA_get_default_openssl_method() returns a pointer to the current default
35method. 40method for the "openssl" engine.
36 41
37DSA_set_method() selects B<meth> for all operations using the structure B<DSA>. 42DSA_set_method() selects B<engine> for all operations using the structure B<dsa>.
38 43
39DSA_get_method() returns a pointer to the method currently selected 44DSA_new_method() allocates and initializes a DSA structure so that
40for B<DSA>. 45B<engine> will be used for the DSA operations. If B<engine> is NULL,
41 46the default engine for DSA operations is used.
42DSA_new_method() allocates and initializes a B<DSA> structure so that
43B<method> will be used for the DSA operations. If B<method> is B<NULL>,
44the default method is used.
45 47
46=head1 THE DSA_METHOD STRUCTURE 48=head1 THE DSA_METHOD STRUCTURE
47 49
@@ -87,18 +89,17 @@ struct
87 89
88=head1 RETURN VALUES 90=head1 RETURN VALUES
89 91
90DSA_OpenSSL(), DSA_get_default_method() and DSA_get_method() return 92DSA_OpenSSL() and DSA_get_default_openssl_method() return pointers to the
91pointers to the respective B<DSA_METHOD>s. 93respective DSA_METHODs.
92 94
93DSA_set_default_method() returns no value. 95DSA_set_default_openssl_method() returns no value.
94 96
95DSA_set_method() returns a pointer to the B<DSA_METHOD> previously 97DSA_set_method() returns non-zero if the ENGINE associated with B<dsa>
96associated with B<dsa>. 98was successfully changed to B<engine>.
97 99
98DSA_new_method() returns B<NULL> and sets an error code that can be 100DSA_new_method() returns NULL and sets an error code that can be
99obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation 101obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation
100fails. Otherwise it returns a pointer to the newly allocated 102fails. Otherwise it returns a pointer to the newly allocated structure.
101structure.
102 103
103=head1 SEE ALSO 104=head1 SEE ALSO
104 105
@@ -109,4 +110,9 @@ L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)>
109DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), 110DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(),
110DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4. 111DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4.
111 112
113DSA_set_default_openssl_method() and DSA_get_default_openssl_method()
114replaced DSA_set_default_method() and DSA_get_default_method() respectively,
115and DSA_set_method() and DSA_new_method() were altered to use B<ENGINE>s
116rather than B<DSA_METHOD>s during development of OpenSSL 0.9.6.
117
112=cut 118=cut
diff --git a/src/lib/libcrypto/doc/ERR_error_string.pod b/src/lib/libcrypto/doc/ERR_error_string.pod
index 0d2417599c..e01beb817a 100644
--- a/src/lib/libcrypto/doc/ERR_error_string.pod
+++ b/src/lib/libcrypto/doc/ERR_error_string.pod
@@ -2,13 +2,16 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_error_string - obtain human-readable error message 5ERR_error_string, ERR_error_string_n, ERR_lib_error_string,
6ERR_func_error_string, ERR_reason_error_string - obtain human-readable
7error message
6 8
7=head1 SYNOPSIS 9=head1 SYNOPSIS
8 10
9 #include <openssl/err.h> 11 #include <openssl/err.h>
10 12
11 char *ERR_error_string(unsigned long e, char *buf); 13 char *ERR_error_string(unsigned long e, char *buf);
14 char *ERR_error_string_n(unsigned long e, char *buf, size_t len);
12 15
13 const char *ERR_lib_error_string(unsigned long e); 16 const char *ERR_lib_error_string(unsigned long e);
14 const char *ERR_func_error_string(unsigned long e); 17 const char *ERR_func_error_string(unsigned long e);
@@ -17,9 +20,13 @@ ERR_error_string - obtain human-readable error message
17=head1 DESCRIPTION 20=head1 DESCRIPTION
18 21
19ERR_error_string() generates a human-readable string representing the 22ERR_error_string() generates a human-readable string representing the
20error code B<e>, and places it at B<buf>. B<buf> must be at least 120 23error code I<e>, and places it at I<buf>. I<buf> must be at least 120
21bytes long. If B<buf> is B<NULL>, the error string is placed in a 24bytes long. If I<buf> is B<NULL>, the error string is placed in a
22static buffer. 25static buffer.
26ERR_error_string_n() is a variant of ERR_error_string() that writes
27at most I<len> characters (including the terminating 0)
28and truncates the string if necessary.
29For ERR_error_string_n(), I<buf> may not be B<NULL>.
23 30
24The string will have the following format: 31The string will have the following format:
25 32
@@ -45,7 +52,7 @@ all error codes currently in the queue.
45=head1 RETURN VALUES 52=head1 RETURN VALUES
46 53
47ERR_error_string() returns a pointer to a static buffer containing the 54ERR_error_string() returns a pointer to a static buffer containing the
48string if B<buf == NULL>, B<buf> otherwise. 55string if I<buf> B<== NULL>, I<buf> otherwise.
49 56
50ERR_lib_error_string(), ERR_func_error_string() and 57ERR_lib_error_string(), ERR_func_error_string() and
51ERR_reason_error_string() return the strings, and B<NULL> if 58ERR_reason_error_string() return the strings, and B<NULL> if
@@ -61,5 +68,6 @@ L<ERR_print_errors(3)|ERR_print_errors(3)>
61=head1 HISTORY 68=head1 HISTORY
62 69
63ERR_error_string() is available in all versions of SSLeay and OpenSSL. 70ERR_error_string() is available in all versions of SSLeay and OpenSSL.
71ERR_error_string_n() was added in OpenSSL 0.9.6.
64 72
65=cut 73=cut
diff --git a/src/lib/libcrypto/doc/ERR_get_error.pod b/src/lib/libcrypto/doc/ERR_get_error.pod
index 75ece00d97..3551bacb8d 100644
--- a/src/lib/libcrypto/doc/ERR_get_error.pod
+++ b/src/lib/libcrypto/doc/ERR_get_error.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5ERR_get_error, ERR_peek_error - obtain error code 5ERR_get_error, ERR_peek_error, ERR_get_error_line, ERR_peek_error_line,
6ERR_get_error_line_data, ERR_peek_error_line_data - obtain error code and data
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
@@ -40,7 +41,7 @@ the error occurred in *B<file> and *B<line>, unless these are B<NULL>.
40ERR_get_error_line_data() and ERR_peek_error_line_data() store 41ERR_get_error_line_data() and ERR_peek_error_line_data() store
41additional data and flags associated with the error code in *B<data> 42additional data and flags associated with the error code in *B<data>
42and *B<flags>, unless these are B<NULL>. *B<data> contains a string 43and *B<flags>, unless these are B<NULL>. *B<data> contains a string
43if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by Malloc(), 44if *B<flags>&B<ERR_TXT_STRING>. If it has been allocated by OPENSSL_malloc(),
44*B<flags>&B<ERR_TXT_MALLOCED> is true. 45*B<flags>&B<ERR_TXT_MALLOCED> is true.
45 46
46=head1 RETURN VALUES 47=head1 RETURN VALUES
diff --git a/src/lib/libcrypto/doc/ERR_remove_state.pod b/src/lib/libcrypto/doc/ERR_remove_state.pod
index ebcdc0f5a5..72925fb9f4 100644
--- a/src/lib/libcrypto/doc/ERR_remove_state.pod
+++ b/src/lib/libcrypto/doc/ERR_remove_state.pod
@@ -16,7 +16,7 @@ ERR_remove_state() frees the error queue associated with thread B<pid>.
16If B<pid> == 0, the current thread will have its error queue removed. 16If B<pid> == 0, the current thread will have its error queue removed.
17 17
18Since error queue data structures are allocated automatically for new 18Since error queue data structures are allocated automatically for new
19threads, they must be freed when threads are terminated in oder to 19threads, they must be freed when threads are terminated in order to
20avoid memory leaks. 20avoid memory leaks.
21 21
22=head1 RETURN VALUE 22=head1 RETURN VALUE
diff --git a/src/lib/libcrypto/doc/EVP_DigestInit.pod b/src/lib/libcrypto/doc/EVP_DigestInit.pod
index 6d4e156ae3..fefc858f7e 100644
--- a/src/lib/libcrypto/doc/EVP_DigestInit.pod
+++ b/src/lib/libcrypto/doc/EVP_DigestInit.pod
@@ -2,7 +2,12 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal - EVP digest routines 5EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal, EVP_MAX_MD_SIZE,
6EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, EVP_MD_block_size,
7EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type,
8EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_dss, EVP_dss1, EVP_mdc2,
9EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj -
10EVP digest routines
6 11
7=head1 SYNOPSIS 12=head1 SYNOPSIS
8 13
@@ -45,12 +50,12 @@ EVP_DigestInit, EVP_DigestUpdate, EVP_DigestFinal - EVP digest routines
45 50
46The EVP digest routines are a high level interface to message digests. 51The EVP digest routines are a high level interface to message digests.
47 52
48EVP_DigestInit() initialises a digest context B<ctx> to use a digest 53EVP_DigestInit() initializes a digest context B<ctx> to use a digest
49B<type>: this will typically be supplied by a function such as 54B<type>: this will typically be supplied by a function such as
50EVP_sha1(). 55EVP_sha1().
51 56
52EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the 57EVP_DigestUpdate() hashes B<cnt> bytes of data at B<d> into the
53digest context B<ctx>. This funtion can be called several times on the 58digest context B<ctx>. This function can be called several times on the
54same B<ctx> to hash additional data. 59same B<ctx> to hash additional data.
55 60
56EVP_DigestFinal() retrieves the digest value from B<ctx> and places 61EVP_DigestFinal() retrieves the digest value from B<ctx> and places
@@ -58,7 +63,7 @@ it in B<md>. If the B<s> parameter is not NULL then the number of
58bytes of data written (i.e. the length of the digest) will be written 63bytes of data written (i.e. the length of the digest) will be written
59to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written. 64to the integer at B<s>, at most B<EVP_MAX_MD_SIZE> bytes will be written.
60After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate() 65After calling EVP_DigestFinal() no additional calls to EVP_DigestUpdate()
61can be made, but EVP_DigestInit() can be called to initialiase a new 66can be made, but EVP_DigestInit() can be called to initialize a new
62digest operation. 67digest operation.
63 68
64EVP_MD_CTX_copy() can be used to copy the message digest state from 69EVP_MD_CTX_copy() can be used to copy the message digest state from
@@ -97,7 +102,7 @@ returns is of zero length.
97 102
98EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj() 103EVP_get_digestbyname(), EVP_get_digestbynid() and EVP_get_digestbyobj()
99return an B<EVP_MD> structure when passed a digest name, a digest NID or 104return an B<EVP_MD> structure when passed a digest name, a digest NID or
100an ASN1_OBJECT structure respectively. The digest table must be initialised 105an ASN1_OBJECT structure respectively. The digest table must be initialized
101using, for example, OpenSSL_add_all_digests() for these functions to work. 106using, for example, OpenSSL_add_all_digests() for these functions to work.
102 107
103=head1 RETURN VALUES 108=head1 RETURN VALUES
diff --git a/src/lib/libcrypto/doc/EVP_EncryptInit.pod b/src/lib/libcrypto/doc/EVP_EncryptInit.pod
index 77ed4ccdba..9afe2396e2 100644
--- a/src/lib/libcrypto/doc/EVP_EncryptInit.pod
+++ b/src/lib/libcrypto/doc/EVP_EncryptInit.pod
@@ -2,34 +2,46 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines 5EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal, EVP_DecryptInit,
6EVP_DecryptUpdate, EVP_DecryptFinal, EVP_CipherInit, EVP_CipherUpdate,
7EVP_CipherFinal, EVP_CIPHER_CTX_set_key_length, EVP_CIPHER_CTX_ctrl,
8EVP_CIPHER_CTX_cleanup, EVP_get_cipherbyname, EVP_get_cipherbynid,
9EVP_get_cipherbyobj, EVP_CIPHER_nid, EVP_CIPHER_block_size,
10EVP_CIPHER_key_length, EVP_CIPHER_iv_length, EVP_CIPHER_flags,
11EVP_CIPHER_mode, EVP_CIPHER_type, EVP_CIPHER_CTX_cipher, EVP_CIPHER_CTX_nid,
12EVP_CIPHER_CTX_block_size, EVP_CIPHER_CTX_key_length, EVP_CIPHER_CTX_iv_length,
13EVP_CIPHER_CTX_get_app_data, EVP_CIPHER_CTX_set_app_data, EVP_CIPHER_CTX_type,
14EVP_CIPHER_CTX_flags, EVP_CIPHER_CTX_mode, EVP_CIPHER_param_to_asn1,
15EVP_CIPHER_asn1_to_param - EVP cipher routines
6 16
7=head1 SYNOPSIS 17=head1 SYNOPSIS
8 18
9 #include <openssl/evp.h> 19 #include <openssl/evp.h>
10 20
11 void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 21 int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
12 unsigned char *key, unsigned char *iv); 22 unsigned char *key, unsigned char *iv);
13 void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 23 int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 24 int *outl, unsigned char *in, int inl);
15 void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 25 int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 26 int *outl);
17 27
18 void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 28 int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
19 unsigned char *key, unsigned char *iv); 29 unsigned char *key, unsigned char *iv);
20 void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 30 int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
21 int *outl, unsigned char *in, int inl); 31 int *outl, unsigned char *in, int inl);
22 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 32 int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
23 int *outl); 33 int *outl);
24 34
25 void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 35 int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
26 unsigned char *key, unsigned char *iv, int enc); 36 unsigned char *key, unsigned char *iv, int enc);
27 void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 37 int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
28 int *outl, unsigned char *in, int inl); 38 int *outl, unsigned char *in, int inl);
29 int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, 39 int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm,
30 int *outl); 40 int *outl);
31 41
32 void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); 42 int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
43 int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
44 int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
33 45
34 const EVP_CIPHER *EVP_get_cipherbyname(const char *name); 46 const EVP_CIPHER *EVP_get_cipherbyname(const char *name);
35 #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a)) 47 #define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))
@@ -38,15 +50,21 @@ EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines
38 #define EVP_CIPHER_nid(e) ((e)->nid) 50 #define EVP_CIPHER_nid(e) ((e)->nid)
39 #define EVP_CIPHER_block_size(e) ((e)->block_size) 51 #define EVP_CIPHER_block_size(e) ((e)->block_size)
40 #define EVP_CIPHER_key_length(e) ((e)->key_len) 52 #define EVP_CIPHER_key_length(e) ((e)->key_len)
41 #define EVP_CIPHER_iv_length(e) ((e)->iv_len) 53 #define EVP_CIPHER_iv_length(e) ((e)->iv_len)
42 54 #define EVP_CIPHER_flags(e) ((e)->flags)
55 #define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE)
43 int EVP_CIPHER_type(const EVP_CIPHER *ctx); 56 int EVP_CIPHER_type(const EVP_CIPHER *ctx);
57
44 #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) 58 #define EVP_CIPHER_CTX_cipher(e) ((e)->cipher)
45 #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) 59 #define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid)
46 #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) 60 #define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size)
47 #define EVP_CIPHER_CTX_key_length(e) ((e)->cipher->key_len) 61 #define EVP_CIPHER_CTX_key_length(e) ((e)->key_len)
48 #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) 62 #define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len)
63 #define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
64 #define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
49 #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 65 #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
66 #define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags)
67 #define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE)
50 68
51 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 69 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
52 int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type); 70 int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
@@ -56,16 +74,14 @@ EVP_EncryptInit, EVP_EncryptUpdate, EVP_EncryptFinal - EVP cipher routines
56The EVP cipher routines are a high level interface to certain 74The EVP cipher routines are a high level interface to certain
57symmetric ciphers. 75symmetric ciphers.
58 76
59EVP_EncryptInit() initialises a cipher context B<ctx> for encryption 77EVP_EncryptInit() initializes a cipher context B<ctx> for encryption
60with cipher B<type>. B<type> is normally supplied by a function such 78with cipher B<type>. B<type> is normally supplied by a function such
61as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the 79as EVP_des_cbc() . B<key> is the symmetric key to use and B<iv> is the
62IV to use (if necessary), the actual number of bytes used for the 80IV to use (if necessary), the actual number of bytes used for the
63key and IV depends on the cipher. It is possible to set all parameters 81key and IV depends on the cipher. It is possible to set all parameters
64to NULL except B<type> in an initial call and supply the remaining 82to NULL except B<type> in an initial call and supply the remaining
65parameters in subsequent calls. This is normally done when the 83parameters in subsequent calls, all of which have B<type> set to NULL.
66EVP_CIPHER_asn1_to_param() function is called to set the cipher 84This is done when the default cipher parameters are not appropriate.
67parameters from an ASN1 AlgorithmIdentifier and the key from a
68different source.
69 85
70EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and 86EVP_EncryptUpdate() encrypts B<inl> bytes from the buffer B<in> and
71writes the encrypted version to B<out>. This function can be called 87writes the encrypted version to B<out>. This function can be called
@@ -93,7 +109,8 @@ cipher block size is 1 in which case B<inl> bytes is sufficient.
93EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions 109EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal() are functions
94that can be used for decryption or encryption. The operation performed 110that can be used for decryption or encryption. The operation performed
95depends on the value of the B<enc> parameter. It should be set to 1 for 111depends on the value of the B<enc> parameter. It should be set to 1 for
96encryption and 0 for decryption. 112encryption, 0 for decryption and -1 to leave the value unchanged (the
113actual value of 'enc' being supplied in a previous call).
97 114
98EVP_CIPHER_CTX_cleanup() clears all information from a cipher context. 115EVP_CIPHER_CTX_cleanup() clears all information from a cipher context.
99It should be called after all operations using a cipher are complete 116It should be called after all operations using a cipher are complete
@@ -111,7 +128,13 @@ IDENTIFIER.
111EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key 128EVP_CIPHER_key_length() and EVP_CIPHER_CTX_key_length() return the key
112length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX> 129length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>
113structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length 130structure. The constant B<EVP_MAX_KEY_LENGTH> is the maximum key length
114for all ciphers. 131for all ciphers. Note: although EVP_CIPHER_key_length() is fixed for a
132given cipher, the value of EVP_CIPHER_CTX_key_length() may be different
133for variable key length ciphers.
134
135EVP_CIPHER_CTX_set_key_length() sets the key length of the cipher ctx.
136If the cipher is a fixed length cipher then attempting to set the key
137length to any value other than the fixed value is an error.
115 138
116EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV 139EVP_CIPHER_iv_length() and EVP_CIPHER_CTX_iv_length() return the IV
117length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>. 140length of a cipher when passed an B<EVP_CIPHER> or B<EVP_CIPHER_CTX>.
@@ -133,6 +156,11 @@ B<NID_undef>.
133EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed 156EVP_CIPHER_CTX_cipher() returns the B<EVP_CIPHER> structure when passed
134an B<EVP_CIPHER_CTX> structure. 157an B<EVP_CIPHER_CTX> structure.
135 158
159EVP_CIPHER_mode() and EVP_CIPHER_CTX_mode() return the block cipher mode:
160EVP_CIPH_ECB_MODE, EVP_CIPH_CBC_MODE, EVP_CIPH_CFB_MODE or
161EVP_CIPH_OFB_MODE. If the cipher is a stream cipher then
162EVP_CIPH_STREAM_CIPHER is returned.
163
136EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based 164EVP_CIPHER_param_to_asn1() sets the AlgorithmIdentifier "parameter" based
137on the passed cipher. This will typically include any parameters and an 165on the passed cipher. This will typically include any parameters and an
138IV. The cipher IV (if any) must be set when this call is made. This call 166IV. The cipher IV (if any) must be set when this call is made. This call
@@ -149,21 +177,24 @@ key set to NULL, EVP_CIPHER_asn1_to_param() will be called and finally
149EVP_CipherInit() again with all parameters except the key set to NULL. It is 177EVP_CipherInit() again with all parameters except the key set to NULL. It is
150possible for this function to fail if the cipher does not have any ASN1 support 178possible for this function to fail if the cipher does not have any ASN1 support
151or the parameters cannot be set (for example the RC2 effective key length 179or the parameters cannot be set (for example the RC2 effective key length
152does not have an B<EVP_CIPHER> structure). 180is not supported.
181
182EVP_CIPHER_CTX_ctrl() allows various cipher specific parameters to be determined
183and set. Currently only the RC2 effective key length and the number of rounds of
184RC5 can be set.
153 185
154=head1 RETURN VALUES 186=head1 RETURN VALUES
155 187
156EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() do not return 188EVP_EncryptInit(), EVP_EncryptUpdate() and EVP_EncryptFinal() return 1 for success
157values. 189and 0 for failure.
158 190
159EVP_DecryptInit() and EVP_DecryptUpdate() do not return values. 191EVP_DecryptInit() and EVP_DecryptUpdate() return 1 for success and 0 for failure.
160EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success. 192EVP_DecryptFinal() returns 0 if the decrypt failed or 1 for success.
161 193
162EVP_CipherInit() and EVP_CipherUpdate() do not return values. 194EVP_CipherInit() and EVP_CipherUpdate() return 1 for success and 0 for failure.
163EVP_CipherFinal() returns 1 for a decryption failure or 1 for success, if 195EVP_CipherFinal() returns 1 for a decryption failure or 1 for success.
164the operation is encryption then it always returns 1.
165 196
166EVP_CIPHER_CTX_cleanup() does not return a value. 197EVP_CIPHER_CTX_cleanup() returns 1 for success and 0 for failure.
167 198
168EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() 199EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj()
169return an B<EVP_CIPHER> structure or NULL on error. 200return an B<EVP_CIPHER> structure or NULL on error.
@@ -187,6 +218,75 @@ EVP_CIPHER_CTX_cipher() returns an B<EVP_CIPHER> structure.
187EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for 218EVP_CIPHER_param_to_asn1() and EVP_CIPHER_asn1_to_param() return 1 for
188success or zero for failure. 219success or zero for failure.
189 220
221=head1 CIPHER LISTING
222
223All algorithms have a fixed key length unless otherwise stated.
224
225=over 4
226
227=item EVP_enc_null()
228
229Null cipher: does nothing.
230
231=item EVP_des_cbc(void), EVP_des_ecb(void), EVP_des_cfb(void), EVP_des_ofb(void)
232
233DES in CBC, ECB, CFB and OFB modes respectively.
234
235=item EVP_des_ede_cbc(void), EVP_des_ede(), EVP_des_ede_ofb(void), EVP_des_ede_cfb(void)
236
237Two key triple DES in CBC, ECB, CFB and OFB modes respectively.
238
239=item EVP_des_ede3_cbc(void), EVP_des_ede3(), EVP_des_ede3_ofb(void), EVP_des_ede3_cfb(void)
240
241Three key triple DES in CBC, ECB, CFB and OFB modes respectively.
242
243=item EVP_desx_cbc(void)
244
245DESX algorithm in CBC mode.
246
247=item EVP_rc4(void)
248
249RC4 stream cipher. This is a variable key length cipher with default key length 128 bits.
250
251=item EVP_rc4_40(void)
252
253RC4 stream cipher with 40 bit key length. This is obsolete and new code should use EVP_rc4()
254and the EVP_CIPHER_CTX_set_key_length() function.
255
256=item EVP_idea_cbc() EVP_idea_ecb(void), EVP_idea_cfb(void), EVP_idea_ofb(void), EVP_idea_cbc(void)
257
258IDEA encryption algorithm in CBC, ECB, CFB and OFB modes respectively.
259
260=item EVP_rc2_cbc(void), EVP_rc2_ecb(void), EVP_rc2_cfb(void), EVP_rc2_ofb(void)
261
262RC2 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
263length cipher with an additional parameter called "effective key bits" or "effective key length".
264By default both are set to 128 bits.
265
266=item EVP_rc2_40_cbc(void), EVP_rc2_64_cbc(void)
267
268RC2 algorithm in CBC mode with a default key length and effective key length of 40 and 64 bits.
269These are obsolete and new code should use EVP_rc2_cbc(), EVP_CIPHER_CTX_set_key_length() and
270EVP_CIPHER_CTX_ctrl() to set the key length and effective key length.
271
272=item EVP_bf_cbc(void), EVP_bf_ecb(void), EVP_bf_cfb(void), EVP_bf_ofb(void);
273
274Blowfish encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
275length cipher.
276
277=item EVP_cast5_cbc(void), EVP_cast5_ecb(void), EVP_cast5_cfb(void), EVP_cast5_ofb(void)
278
279CAST encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key
280length cipher.
281
282=item EVP_rc5_32_12_16_cbc(void), EVP_rc5_32_12_16_ecb(void), EVP_rc5_32_12_16_cfb(void), EVP_rc5_32_12_16_ofb(void)
283
284RC5 encryption algorithm in CBC, ECB, CFB and OFB modes respectively. This is a variable key length
285cipher with an additional "number of rounds" parameter. By default the key length is set to 128
286bits and 12 rounds.
287
288=back
289
190=head1 NOTES 290=head1 NOTES
191 291
192Where possible the B<EVP> interface to symmetric ciphers should be used in 292Where possible the B<EVP> interface to symmetric ciphers should be used in
@@ -206,14 +306,49 @@ test that the input data or key is correct. A random block has better than
2061 in 256 chance of being of the correct format and problems with the 3061 in 256 chance of being of the correct format and problems with the
207input data earlier on will not produce a final decrypt error. 307input data earlier on will not produce a final decrypt error.
208 308
309The functions EVP_EncryptInit(), EVP_EncryptUpdate(), EVP_EncryptFinal(),
310EVP_DecryptInit(), EVP_DecryptUpdate(), EVP_CipherInit() and EVP_CipherUpdate()
311and EVP_CIPHER_CTX_cleanup() did not return errors in OpenSSL version 0.9.5a or
312earlier. Software only versions of encryption algorithms will never return
313error codes for these functions, unless there is a programming error (for example
314and attempt to set the key before the cipher is set in EVP_EncryptInit() ).
315
209=head1 BUGS 316=head1 BUGS
210 317
211The current B<EVP> cipher interface is not as flexible as it should be. Only 318For RC5 the number of rounds can currently only be set to 8, 12 or 16. This is
212certain "spot" encryption algorithms can be used for ciphers which have various 319a limitation of the current RC5 code rather than the EVP interface.
213parameters associated with them (RC2, RC5 for example) this is inadequate. 320
321It should be possible to disable PKCS padding: currently it isn't.
322
323EVP_MAX_KEY_LENGTH and EVP_MAX_IV_LENGTH only refer to the internal ciphers with
324default key lengths. If custom ciphers exceed these values the results are
325unpredictable. This is because it has become standard practice to define a
326generic key as a fixed unsigned char array containing EVP_MAX_KEY_LENGTH bytes.
327
328The ASN1 code is incomplete (and sometimes inaccurate) it has only been tested
329for certain common S/MIME ciphers (RC2, DES, triple DES) in CBC mode.
330
331=head1 EXAMPLES
332
333Get the number of rounds used in RC5:
334
335 int nrounds;
336 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC5_ROUNDS, 0, &i);
337
338Get the RC2 effective key length:
339
340 int key_bits;
341 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i);
342
343Set the number of rounds used in RC5:
344
345 int nrounds;
346 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC5_ROUNDS, i, NULL);
347
348Set the number of rounds used in RC2:
214 349
215Several of the functions do not return error codes because the software versions 350 int nrounds;
216can never fail. This is not true of hardware versions. 351 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_SET_RC2_KEY_BITS, i, NULL);
217 352
218=head1 SEE ALSO 353=head1 SEE ALSO
219 354
diff --git a/src/lib/libcrypto/doc/EVP_OpenInit.pod b/src/lib/libcrypto/doc/EVP_OpenInit.pod
index 50edb124e4..2e710da945 100644
--- a/src/lib/libcrypto/doc/EVP_OpenInit.pod
+++ b/src/lib/libcrypto/doc/EVP_OpenInit.pod
@@ -10,9 +10,9 @@ EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption
10 10
11 int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek, 11 int EVP_OpenInit(EVP_CIPHER_CTX *ctx,EVP_CIPHER *type,unsigned char *ek,
12 int ekl,unsigned char *iv,EVP_PKEY *priv); 12 int ekl,unsigned char *iv,EVP_PKEY *priv);
13 void EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 13 int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 14 int *outl, unsigned char *in, int inl);
15 void EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 15 int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 16 int *outl);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
@@ -21,7 +21,7 @@ The EVP envelope routines are a high level interface to envelope
21decryption. They decrypt a public key encrypted symmetric key and 21decryption. They decrypt a public key encrypted symmetric key and
22then decrypt data using it. 22then decrypt data using it.
23 23
24EVP_OpenInit() initialises a cipher context B<ctx> for decryption 24EVP_OpenInit() initializes a cipher context B<ctx> for decryption
25with cipher B<type>. It decrypts the encrypted symmetric key of length 25with cipher B<type>. It decrypts the encrypted symmetric key of length
26B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>. 26B<ekl> bytes passed in the B<ek> parameter using the private key B<priv>.
27The IV is supplied in the B<iv> parameter. 27The IV is supplied in the B<iv> parameter.
@@ -29,20 +29,32 @@ The IV is supplied in the B<iv> parameter.
29EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties 29EVP_OpenUpdate() and EVP_OpenFinal() have exactly the same properties
30as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as 30as the EVP_DecryptUpdate() and EVP_DecryptFinal() routines, as
31documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual 31documented on the L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> manual
32page. 32page.
33
34=head1 NOTES
35
36It is possible to call EVP_OpenInit() twice in the same way as
37EVP_DecryptInit(). The first call should have B<priv> set to NULL
38and (after setting any cipher parameters) it should be called again
39with B<type> set to NULL.
40
41If the cipher passed in the B<type> parameter is a variable length
42cipher then the key length will be set to the value of the recovered
43key length. If the cipher is a fixed length cipher then the recovered
44key length must match the fixed cipher length.
33 45
34=head1 RETURN VALUES 46=head1 RETURN VALUES
35 47
36EVP_OpenInit() returns -1 on error or an non zero integer (actually the 48EVP_OpenInit() returns 0 on error or a non zero integer (actually the
37recovered secret key size) if successful. 49recovered secret key size) if successful.
38 50
39EVP_SealUpdate() does not return a value. 51EVP_OpenUpdate() returns 1 for success or 0 for failure.
40 52
41EVP_SealFinal() returns 0 if the decrypt failed or 1 for success. 53EVP_OpenFinal() returns 0 if the decrypt failed or 1 for success.
42 54
43=head1 SEE ALSO 55=head1 SEE ALSO
44 56
45L<evp(3)|evp(3)>, 57L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
46L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 58L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
47L<EVP_SealInit(3)|EVP_SealInit(3)> 59L<EVP_SealInit(3)|EVP_SealInit(3)>
48 60
diff --git a/src/lib/libcrypto/doc/EVP_SealInit.pod b/src/lib/libcrypto/doc/EVP_SealInit.pod
index 42beed33bd..0451eb648a 100644
--- a/src/lib/libcrypto/doc/EVP_SealInit.pod
+++ b/src/lib/libcrypto/doc/EVP_SealInit.pod
@@ -10,9 +10,9 @@ EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption
10 10
11 int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek, 11 int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
12 int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk); 12 int *ekl, unsigned char *iv,EVP_PKEY **pubk, int npubk);
13 void EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 13 int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
14 int *outl, unsigned char *in, int inl); 14 int *outl, unsigned char *in, int inl);
15 void EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, 15 int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out,
16 int *outl); 16 int *outl);
17 17
18=head1 DESCRIPTION 18=head1 DESCRIPTION
@@ -22,7 +22,7 @@ encryption. They generate a random key and then "envelope" it by
22using public key encryption. Data can then be encrypted using this 22using public key encryption. Data can then be encrypted using this
23key. 23key.
24 24
25EVP_SealInit() initialises a cipher context B<ctx> for encryption 25EVP_SealInit() initializes a cipher context B<ctx> for encryption
26with cipher B<type> using a random secret key and IV supplied in 26with cipher B<type> using a random secret key and IV supplied in
27the B<iv> parameter. B<type> is normally supplied by a function such 27the B<iv> parameter. B<type> is normally supplied by a function such
28as EVP_des_cbc(). The secret key is encrypted using one or more public 28as EVP_des_cbc(). The secret key is encrypted using one or more public
@@ -41,9 +41,10 @@ page.
41 41
42=head1 RETURN VALUES 42=head1 RETURN VALUES
43 43
44EVP_SealInit() returns -1 on error or B<npubk> if successful. 44EVP_SealInit() returns 0 on error or B<npubk> if successful.
45 45
46EVP_SealUpdate() and EVP_SealFinal() do not return values. 46EVP_SealUpdate() and EVP_SealFinal() return 1 for success and 0 for
47failure.
47 48
48=head1 NOTES 49=head1 NOTES
49 50
@@ -59,9 +60,14 @@ but symmetric encryption is fast. So symmetric encryption is used for
59bulk encryption and the small random symmetric key used is transferred 60bulk encryption and the small random symmetric key used is transferred
60using public key encryption. 61using public key encryption.
61 62
63It is possible to call EVP_SealInit() twice in the same way as
64EVP_EncryptInit(). The first call should have B<npubk> set to 0
65and (after setting any cipher parameters) it should be called again
66with B<type> set to NULL.
67
62=head1 SEE ALSO 68=head1 SEE ALSO
63 69
64L<evp(3)|evp(3)>, 70L<evp(3)|evp(3)>, L<rand(3)|rand(3)>,
65L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>, 71L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
66L<EVP_OpenInit(3)|EVP_OpenInit(3)> 72L<EVP_OpenInit(3)|EVP_OpenInit(3)>
67 73
diff --git a/src/lib/libcrypto/doc/EVP_SignInit.pod b/src/lib/libcrypto/doc/EVP_SignInit.pod
index 1167cefb45..d5ce245ecd 100644
--- a/src/lib/libcrypto/doc/EVP_SignInit.pod
+++ b/src/lib/libcrypto/doc/EVP_SignInit.pod
@@ -19,12 +19,12 @@ EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions
19The EVP signature routines are a high level interface to digital 19The EVP signature routines are a high level interface to digital
20signatures. 20signatures.
21 21
22EVP_SignInit() initialises a signing context B<ctx> to using digest 22EVP_SignInit() initializes a signing context B<ctx> to using digest
23B<type>: this will typically be supplied by a function such as 23B<type>: this will typically be supplied by a function such as
24EVP_sha1(). 24EVP_sha1().
25 25
26EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the 26EVP_SignUpdate() hashes B<cnt> bytes of data at B<d> into the
27signature context B<ctx>. This funtion can be called several times on the 27signature context B<ctx>. This function can be called several times on the
28same B<ctx> to include additional data. 28same B<ctx> to include additional data.
29 29
30EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey> 30EVP_SignFinal() signs the data in B<ctx> using the private key B<pkey>
@@ -32,7 +32,7 @@ and places the signature in B<sig>. If the B<s> parameter is not NULL
32then the number of bytes of data written (i.e. the length of the signature) 32then the number of bytes of data written (i.e. the length of the signature)
33will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes 33will be written to the integer at B<s>, at most EVP_PKEY_size(pkey) bytes
34will be written. After calling EVP_SignFinal() no additional calls to 34will be written. After calling EVP_SignFinal() no additional calls to
35EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialiase 35EVP_SignUpdate() can be made, but EVP_SignInit() can be called to initialize
36a new signature operation. 36a new signature operation.
37 37
38EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual 38EVP_PKEY_size() returns the maximum size of a signature in bytes. The actual
diff --git a/src/lib/libcrypto/doc/EVP_VerifyInit.pod b/src/lib/libcrypto/doc/EVP_VerifyInit.pod
index 5e74c5dcf9..736a0f4a82 100644
--- a/src/lib/libcrypto/doc/EVP_VerifyInit.pod
+++ b/src/lib/libcrypto/doc/EVP_VerifyInit.pod
@@ -17,17 +17,17 @@ EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature verification f
17The EVP signature verification routines are a high level interface to digital 17The EVP signature verification routines are a high level interface to digital
18signatures. 18signatures.
19 19
20EVP_VerifyInit() initialises a verification context B<ctx> to using digest 20EVP_VerifyInit() initializes a verification context B<ctx> to using digest
21B<type>: this will typically be supplied by a function such as EVP_sha1(). 21B<type>: this will typically be supplied by a function such as EVP_sha1().
22 22
23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the 23EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
24verification context B<ctx>. This funtion can be called several times on the 24verification context B<ctx>. This function can be called several times on the
25same B<ctx> to include additional data. 25same B<ctx> to include additional data.
26 26
27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey> 27EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey>
28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal() 28and against the B<siglen> bytes at B<sigbuf>. After calling EVP_VerifyFinal()
29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit() 29no additional calls to EVP_VerifyUpdate() can be made, but EVP_VerifyInit()
30can be called to initialiase a new verification operation. 30can be called to initialize a new verification operation.
31 31
32=head1 RETURN VALUES 32=head1 RETURN VALUES
33 33
@@ -57,11 +57,12 @@ might.
57 57
58=head1 SEE ALSO 58=head1 SEE ALSO
59 59
60L<evp(3)|evp(3)>,
60L<EVP_SignInit(3)|EVP_SignInit(3)>, 61L<EVP_SignInit(3)|EVP_SignInit(3)>,
61L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<ERR_get_error(3)|ERR_get_error(3)>, 62L<EVP_DigestInit(3)|EVP_DigestInit(3)>, L<err(3)|err(3)>,
62L<evp(3)|evp(3)>, L<HMAC(3)|HMAC(3)>, L<MD2(3)|MD2(3)>, 63L<evp(3)|evp(3)>, L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>,
63L<MD5(3)|MD5(3)>, L<MDC2(3)|MDC2(3)>, L<RIPEMD(3)|RIPEMD(3)>, 64L<md5(3)|md5(3)>, L<mdc2(3)|mdc2(3)>, L<ripemd(3)|ripemd(3)>,
64L<SHA1(3)|SHA1(3)>, L<digest(1)|digest(1)> 65L<sha(3)|sha(3)>, L<digest(1)|digest(1)>
65 66
66=head1 HISTORY 67=head1 HISTORY
67 68
diff --git a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod b/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod
index b0b1058d19..68ea723259 100644
--- a/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod
+++ b/src/lib/libcrypto/doc/OPENSSL_VERSION_NUMBER.pod
@@ -2,7 +2,7 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OPENSSL_VERSION_NUMBER, SSLeay - get OpenSSL version number 5OPENSSL_VERSION_NUMBER, SSLeay SSLeay_version - get OpenSSL version number
6 6
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
@@ -11,11 +11,27 @@ OPENSSL_VERSION_NUMBER, SSLeay - get OpenSSL version number
11 11
12 #include <openssl/crypto.h> 12 #include <openssl/crypto.h>
13 long SSLeay(void); 13 long SSLeay(void);
14 char *SSLeay_version(int t);
14 15
15=head1 DESCRIPTION 16=head1 DESCRIPTION
16 17
17OPENSSL_VERSION_NUMBER is a numeric release version identifier: 18OPENSSL_VERSION_NUMBER is a numeric release version identifier:
18 19
20 MMNNFFPPS: major minor fix patch status
21
22The status nibble has one of the values 0 for development, 1 to e for betas
231 to 14, and f for release.
24
25for example
26
27 0x000906000 == 0.9.6 dev
28 0x000906023 == 0.9.6b beta 3
29 0x00090605f == 0.9.6e release
30
31Versions prior to 0.9.3 have identifiers E<lt> 0x0930.
32Versions between 0.9.3 and 0.9.5 had a version identifier with this
33interpretation:
34
19 MMNNFFRBB major minor fix final beta/patch 35 MMNNFFRBB major minor fix final beta/patch
20 36
21for example 37for example
@@ -23,13 +39,39 @@ for example
23 0x000904100 == 0.9.4 release 39 0x000904100 == 0.9.4 release
24 0x000905000 == 0.9.5 dev 40 0x000905000 == 0.9.5 dev
25 41
26Versions prior to 0.9.3 have identifiers E<lt> 0x0930. 42Version 0.9.5a had an interim interpretation that is like the current one,
43except the patch level got the highest bit set, to keep continuity. The
44number was therefore 0x0090581f.
45
46
27For backward compatibility, SSLEAY_VERSION_NUMBER is also defined. 47For backward compatibility, SSLEAY_VERSION_NUMBER is also defined.
28 48
29SSLeay() returns this number. The return value can be compared to the 49SSLeay() returns this number. The return value can be compared to the
30macro to make sure that the correct version of the library has been 50macro to make sure that the correct version of the library has been
31loaded, especially when using DLLs on Windows systems. 51loaded, especially when using DLLs on Windows systems.
32 52
53SSLeay_version() returns different strings depending on B<t>:
54
55=over 4
56
57=item SSLEAY_VERSION
58The text variant of the version number and the release date. For example,
59"OpenSSL 0.9.5a 1 Apr 2000".
60
61=item SSLEAY_CFLAGS
62The flags given to the C compiler when compiling OpenSSL are returned in a
63string.
64
65=item SSLEAY_PLATFORM
66The platform name used when OpenSSL was configured is returned.
67
68=back
69
70If the data request isn't available, a text saying that the information is
71not available is returned.
72
73For an unknown B<t>, the text "not available" is returned.
74
33=head1 RETURN VALUE 75=head1 RETURN VALUE
34 76
35The version number. 77The version number.
diff --git a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
index 015d4eaf36..e63411b5bb 100644
--- a/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
+++ b/src/lib/libcrypto/doc/OpenSSL_add_all_algorithms.pod
@@ -2,7 +2,8 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5OpenSSL_add_all_algorithms() - add algorithms to internal table 5OpenSSL_add_all_algorithms, OpenSSL_add_all_ciphers, OpenSSL_add_all_digests -
6add algorithms to internal table
6 7
7=head1 SYNOPSIS 8=head1 SYNOPSIS
8 9
@@ -43,7 +44,7 @@ by EVP_sha1(). It just needs to add them if it (or any of the functions it calls
43needs to lookup algorithms. 44needs to lookup algorithms.
44 45
45The cipher and digest lookup functions are used in many parts of the library. If 46The cipher and digest lookup functions are used in many parts of the library. If
46the table is not initialised several functions will misbehave and complain they 47the table is not initialized several functions will misbehave and complain they
47cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries. 48cannot find algorithms. This includes the PEM, PKCS#12, SSL and S/MIME libraries.
48This is a common query in the OpenSSL mailing lists. 49This is a common query in the OpenSSL mailing lists.
49 50
diff --git a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
index 920dc76325..46cc8f5359 100644
--- a/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
+++ b/src/lib/libcrypto/doc/RSA_get_ex_new_index.pod
@@ -17,14 +17,12 @@ RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data - add application specifi
17 17
18 void *RSA_get_ex_data(RSA *r, int idx); 18 void *RSA_get_ex_data(RSA *r, int idx);
19 19
20 int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 20 typedef int new_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
21 int idx, long argl, void *argp); 21 int idx, long argl, void *argp);
22 22 typedef void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
23 void free_func(void *parent, void *ptr, CRYPTO_EX_DATA *ad, 23 int idx, long argl, void *argp);
24 int idx, long argl, void *argp); 24 typedef int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
25 25 int idx, long argl, void *argp);
26 int dup_func(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d,
27 int idx, long argl, void *argp);
28 26
29=head1 DESCRIPTION 27=head1 DESCRIPTION
30 28
diff --git a/src/lib/libcrypto/doc/RSA_print.pod b/src/lib/libcrypto/doc/RSA_print.pod
index dd968a5274..67876facc5 100644
--- a/src/lib/libcrypto/doc/RSA_print.pod
+++ b/src/lib/libcrypto/doc/RSA_print.pod
@@ -2,8 +2,9 @@
2 2
3=head1 NAME 3=head1 NAME
4 4
5RSA_print, RSA_print_fp, DHparams_print, DHparams_print_fp - print 5RSA_print, RSA_print_fp, DHparams_print, DHparams_print_fp, DSA_print,
6cryptographic parameters 6DSA_print_fp, DHparams_print, DHparams_print_fp - print cryptographic
7parameters
7 8
8=head1 SYNOPSIS 9=head1 SYNOPSIS
9 10
diff --git a/src/lib/libcrypto/doc/RSA_public_encrypt.pod b/src/lib/libcrypto/doc/RSA_public_encrypt.pod
index 13b7df62be..23861c0004 100644
--- a/src/lib/libcrypto/doc/RSA_public_encrypt.pod
+++ b/src/lib/libcrypto/doc/RSA_public_encrypt.pod
@@ -47,7 +47,7 @@ Encrypting user data directly with RSA is insecure.
47=back 47=back
48 48
49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5 49B<flen> must be less than RSA_size(B<rsa>) - 11 for the PKCS #1 v1.5
50based padding modes, and less than RSA_size(B<rsa>) - 21 for 50based padding modes, and less than RSA_size(B<rsa>) - 41 for
51RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded 51RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded
52prior to calling RSA_public_encrypt(). 52prior to calling RSA_public_encrypt().
53 53
diff --git a/src/lib/libcrypto/doc/RSA_set_method.pod b/src/lib/libcrypto/doc/RSA_set_method.pod
index 14b0b4cf35..b672712292 100644
--- a/src/lib/libcrypto/doc/RSA_set_method.pod
+++ b/src/lib/libcrypto/doc/RSA_set_method.pod
@@ -4,17 +4,18 @@
4 4
5RSA_set_default_method, RSA_get_default_method, RSA_set_method, 5RSA_set_default_method, RSA_get_default_method, RSA_set_method,
6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref, 6RSA_get_method, RSA_PKCS1_SSLeay, RSA_PKCS1_RSAref,
7RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method 7RSA_null_method, RSA_flags, RSA_new_method - select RSA method
8 8
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/rsa.h> 11 #include <openssl/rsa.h>
12 #include <openssl/engine.h>
12 13
13 void RSA_set_default_method(RSA_METHOD *meth); 14 void RSA_set_default_openssl_method(RSA_METHOD *meth);
14 15
15 RSA_METHOD *RSA_get_default_method(void); 16 RSA_METHOD *RSA_get_default_openssl_method(void);
16 17
17 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 18 RSA_METHOD *RSA_set_method(RSA *rsa, ENGINE *engine);
18 19
19 RSA_METHOD *RSA_get_method(RSA *rsa); 20 RSA_METHOD *RSA_get_method(RSA *rsa);
20 21
@@ -26,7 +27,7 @@ RSA_PKCS1_null_method, RSA_flags, RSA_new_method - select RSA method
26 27
27 int RSA_flags(RSA *rsa); 28 int RSA_flags(RSA *rsa);
28 29
29 RSA *RSA_new_method(RSA_METHOD *method); 30 RSA *RSA_new_method(ENGINE *engine);
30 31
31=head1 DESCRIPTION 32=head1 DESCRIPTION
32 33
@@ -46,23 +47,27 @@ the RSA transformation. It is the default if OpenSSL is compiled with
46C<-DRSA_NULL>. These methods may be useful in the USA because of a 47C<-DRSA_NULL>. These methods may be useful in the USA because of a
47patent on the RSA cryptosystem. 48patent on the RSA cryptosystem.
48 49
49RSA_set_default_method() makes B<meth> the default method for all B<RSA> 50RSA_set_default_openssl_method() makes B<meth> the default method for all B<RSA>
50structures created later. 51structures created later. B<NB:> This is true only whilst the default engine
52for RSA operations remains as "openssl". ENGINEs provide an
53encapsulation for implementations of one or more algorithms at a time, and all
54the RSA functions mentioned here operate within the scope of the default
55"openssl" engine.
51 56
52RSA_get_default_method() returns a pointer to the current default 57RSA_get_default_openssl_method() returns a pointer to the current default
53method. 58method for the "openssl" engine.
54 59
55RSA_set_method() selects B<meth> for all operations using the key 60RSA_set_method() selects B<engine> for all operations using the key
56B<rsa>. 61B<rsa>.
57 62
58RSA_get_method() returns a pointer to the method currently selected 63RSA_get_method() returns a pointer to the RSA_METHOD from the currently
59for B<rsa>. 64selected ENGINE for B<rsa>.
60 65
61RSA_flags() returns the B<flags> that are set for B<rsa>'s current method. 66RSA_flags() returns the B<flags> that are set for B<rsa>'s current method.
62 67
63RSA_new_method() allocates and initializes an B<RSA> structure so that 68RSA_new_method() allocates and initializes an RSA structure so that
64B<method> will be used for the RSA operations. If B<method> is B<NULL>, 69B<engine> will be used for the RSA operations. If B<engine> is NULL,
65the default method is used. 70the default engine for RSA operations is used.
66 71
67=head1 THE RSA_METHOD STRUCTURE 72=head1 THE RSA_METHOD STRUCTURE
68 73
@@ -128,17 +133,21 @@ the default method is used.
128=head1 RETURN VALUES 133=head1 RETURN VALUES
129 134
130RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(), 135RSA_PKCS1_SSLeay(), RSA_PKCS1_RSAref(), RSA_PKCS1_null_method(),
131RSA_get_default_method() and RSA_get_method() return pointers to the 136RSA_get_default_openssl_method() and RSA_get_method() return pointers to
132respective B<RSA_METHOD>s. 137the respective RSA_METHODs.
133 138
134RSA_set_default_method() returns no value. 139RSA_set_default_openssl_method() returns no value.
135 140
136RSA_set_method() returns a pointer to the B<RSA_METHOD> previously 141RSA_set_method() selects B<engine> as the engine that will be responsible for
137associated with B<rsa>. 142all operations using the structure B<rsa>. If this function completes successfully,
143then the B<rsa> structure will have its own functional reference of B<engine>, so
144the caller should remember to free their own reference to B<engine> when they are
145finished with it. NB: An ENGINE's RSA_METHOD can be retrieved (or set) by
146ENGINE_get_RSA() or ENGINE_set_RSA().
138 147
139RSA_new_method() returns B<NULL> and sets an error code that can be 148RSA_new_method() returns NULL and sets an error code that can be
140obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise it 149obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation fails. Otherwise
141returns a pointer to the newly allocated structure. 150it returns a pointer to the newly allocated structure.
142 151
143=head1 SEE ALSO 152=head1 SEE ALSO
144 153
@@ -151,4 +160,9 @@ RSA_get_default_method(), RSA_set_method() and RSA_get_method() as
151well as the rsa_sign and rsa_verify components of RSA_METHOD were 160well as the rsa_sign and rsa_verify components of RSA_METHOD were
152added in OpenSSL 0.9.4. 161added in OpenSSL 0.9.4.
153 162
163RSA_set_default_openssl_method() and RSA_get_default_openssl_method()
164replaced RSA_set_default_method() and RSA_get_default_method() respectively,
165and RSA_set_method() and RSA_new_method() were altered to use B<ENGINE>s
166rather than B<DH_METHOD>s during development of OpenSSL 0.9.6.
167
154=cut 168=cut
diff --git a/src/lib/libcrypto/doc/dh.pod b/src/lib/libcrypto/doc/dh.pod
index 0a9b7c03a2..b4be4be405 100644
--- a/src/lib/libcrypto/doc/dh.pod
+++ b/src/lib/libcrypto/doc/dh.pod
@@ -7,6 +7,7 @@ dh - Diffie-Hellman key agreement
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dh.h> 9 #include <openssl/dh.h>
10 #include <openssl/engine.h>
10 11
11 DH * DH_new(void); 12 DH * DH_new(void);
12 void DH_free(DH *dh); 13 void DH_free(DH *dh);
@@ -20,10 +21,10 @@ dh - Diffie-Hellman key agreement
20 int DH_generate_key(DH *dh); 21 int DH_generate_key(DH *dh);
21 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); 22 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
22 23
23 void DH_set_default_method(DH_METHOD *meth); 24 void DH_set_default_openssl_method(DH_METHOD *meth);
24 DH_METHOD *DH_get_default_method(void); 25 DH_METHOD *DH_get_default_openssl_method(void);
25 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); 26 int DH_set_method(DH *dh, ENGINE *engine);
26 DH *DH_new_method(DH_METHOD *meth); 27 DH *DH_new_method(ENGINE *engine);
27 DH_METHOD *DH_OpenSSL(void); 28 DH_METHOD *DH_OpenSSL(void);
28 29
29 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(), 30 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(),
diff --git a/src/lib/libcrypto/doc/dsa.pod b/src/lib/libcrypto/doc/dsa.pod
index 80ecf38178..573500204b 100644
--- a/src/lib/libcrypto/doc/dsa.pod
+++ b/src/lib/libcrypto/doc/dsa.pod
@@ -7,6 +7,7 @@ dsa - Digital Signature Algorithm
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/dsa.h> 9 #include <openssl/dsa.h>
10 #include <openssl/engine.h>
10 11
11 DSA * DSA_new(void); 12 DSA * DSA_new(void);
12 void DSA_free(DSA *dsa); 13 void DSA_free(DSA *dsa);
@@ -28,10 +29,10 @@ dsa - Digital Signature Algorithm
28 int DSA_verify(int dummy, const unsigned char *dgst, int len, 29 int DSA_verify(int dummy, const unsigned char *dgst, int len,
29 unsigned char *sigbuf, int siglen, DSA *dsa); 30 unsigned char *sigbuf, int siglen, DSA *dsa);
30 31
31 void DSA_set_default_method(DSA_METHOD *meth); 32 void DSA_set_default_openssl_method(DSA_METHOD *meth);
32 DSA_METHOD *DSA_get_default_method(void); 33 DSA_METHOD *DSA_get_default_openssl_method(void);
33 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); 34 int DSA_set_method(DSA *dsa, ENGINE *engine);
34 DSA *DSA_new_method(DSA_METHOD *meth); 35 DSA *DSA_new_method(ENGINE *engine);
35 DSA_METHOD *DSA_OpenSSL(void); 36 DSA_METHOD *DSA_OpenSSL(void);
36 37
37 int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), 38 int DSA_get_ex_new_index(long argl, char *argp, int (*new_func)(),
diff --git a/src/lib/libcrypto/doc/evp.pod b/src/lib/libcrypto/doc/evp.pod
new file mode 100644
index 0000000000..f089dd49a2
--- /dev/null
+++ b/src/lib/libcrypto/doc/evp.pod
@@ -0,0 +1,37 @@
1=pod
2
3=head1 NAME
4
5evp - high-level cryptographic functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/evp.h>
10
11=head1 DESCRIPTION
12
13The EVP library provided a high-level interface to cryptographic
14functions.
15
16B<EVP_Seal>I<...> and B<EVP_Open>I<...> provide public key encryption
17and decryption to implement digital "envelopes".
18
19The B<EVP_Sign>I<...> and B<EVP_Verify>I<...> functions implement
20digital signatures.
21
22Symmetric encryption is available with the B<EVP_Encrypt>I<...>
23functions. The B<EVP_Digest>I<...> functions provide message digests.
24
25Algorithms are loaded with OpenSSL_add_all_algorithms(3).
26
27=head1 SEE ALSO
28
29L<EVP_DigestInit(3)|EVP_DigestInit(3)>,
30L<EVP_EncryptInit(3)|EVP_EncryptInit(3)>,
31L<EVP_OpenInit(3)|EVP_OpenInit(3)>,
32L<EVP_SealInit(3)|EVP_SealInit(3)>,
33L<EVP_SignInit(3)|EVP_SignInit(3)>,
34L<EVP_VerifyInit(3)|EVP_VerifyInit(3)>,
35L<OpenSSL_add_all_algorithms(3)|OpenSSL_add_all_algorithms(3)>
36
37=cut
diff --git a/src/lib/libcrypto/doc/rsa.pod b/src/lib/libcrypto/doc/rsa.pod
index eb8ba612c4..ef0d4df205 100644
--- a/src/lib/libcrypto/doc/rsa.pod
+++ b/src/lib/libcrypto/doc/rsa.pod
@@ -7,6 +7,7 @@ rsa - RSA public key cryptosystem
7=head1 SYNOPSIS 7=head1 SYNOPSIS
8 8
9 #include <openssl/rsa.h> 9 #include <openssl/rsa.h>
10 #include <openssl/engine.h>
10 11
11 RSA * RSA_new(void); 12 RSA * RSA_new(void);
12 void RSA_free(RSA *rsa); 13 void RSA_free(RSA *rsa);
@@ -31,15 +32,15 @@ rsa - RSA public key cryptosystem
31 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); 32 int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
32 void RSA_blinding_off(RSA *rsa); 33 void RSA_blinding_off(RSA *rsa);
33 34
34 void RSA_set_default_method(RSA_METHOD *meth); 35 void RSA_set_default_openssl_method(RSA_METHOD *meth);
35 RSA_METHOD *RSA_get_default_method(void); 36 RSA_METHOD *RSA_get_default_openssl_method(void);
36 RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 37 int RSA_set_method(RSA *rsa, ENGINE *engine);
37 RSA_METHOD *RSA_get_method(RSA *rsa); 38 RSA_METHOD *RSA_get_method(RSA *rsa);
38 RSA_METHOD *RSA_PKCS1_SSLeay(void); 39 RSA_METHOD *RSA_PKCS1_SSLeay(void);
39 RSA_METHOD *RSA_PKCS1_RSAref(void); 40 RSA_METHOD *RSA_PKCS1_RSAref(void);
40 RSA_METHOD *RSA_null_method(void); 41 RSA_METHOD *RSA_null_method(void);
41 int RSA_flags(RSA *rsa); 42 int RSA_flags(RSA *rsa);
42 RSA *RSA_new_method(RSA_METHOD *method); 43 RSA *RSA_new_method(ENGINE *engine);
43 44
44 int RSA_print(BIO *bp, RSA *x, int offset); 45 int RSA_print(BIO *bp, RSA *x, int offset);
45 int RSA_print_fp(FILE *fp, RSA *x, int offset); 46 int RSA_print_fp(FILE *fp, RSA *x, int offset);
@@ -96,7 +97,7 @@ SSL, PKCS #1 v2.0
96 97
97=head1 PATENTS 98=head1 PATENTS
98 99
99RSA is covered by a US patent which expires in September 2000. 100RSA was covered by a US patent which expired in September 2000.
100 101
101=head1 SEE ALSO 102=head1 SEE ALSO
102 103
diff --git a/src/lib/libcrypto/dsa/Makefile.ssl b/src/lib/libcrypto/dsa/Makefile.ssl
index b0bcf974fb..dac582be00 100644
--- a/src/lib/libcrypto/dsa/Makefile.ssl
+++ b/src/lib/libcrypto/dsa/Makefile.ssl
@@ -85,62 +85,105 @@ dsa_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
85dsa_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 85dsa_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
86dsa_asn1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 86dsa_asn1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
87dsa_asn1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 87dsa_asn1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
88dsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 88dsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
89dsa_asn1.o: ../../include/openssl/opensslconf.h
89dsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 90dsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
90dsa_asn1.o: ../../include/openssl/stack.h ../cryptlib.h 91dsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
91dsa_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 92dsa_asn1.o: ../cryptlib.h
92dsa_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 93dsa_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
93dsa_err.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 94dsa_err.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
95dsa_err.o: ../../include/openssl/dsa.h ../../include/openssl/err.h
96dsa_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
94dsa_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 97dsa_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
95dsa_err.o: ../../include/openssl/stack.h 98dsa_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
96dsa_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 99dsa_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
97dsa_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 100dsa_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
98dsa_gen.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 101dsa_gen.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
99dsa_gen.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 102dsa_gen.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
100dsa_gen.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 103dsa_gen.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
101dsa_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 104dsa_gen.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
102dsa_gen.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 105dsa_gen.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
103dsa_gen.o: ../../include/openssl/stack.h ../cryptlib.h 106dsa_gen.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
107dsa_gen.o: ../../include/openssl/symhacks.h ../cryptlib.h
104dsa_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 108dsa_key.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
105dsa_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 109dsa_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
106dsa_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 110dsa_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
107dsa_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 111dsa_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
108dsa_key.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 112dsa_key.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
109dsa_key.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 113dsa_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
110dsa_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 114dsa_key.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
111dsa_key.o: ../../include/openssl/stack.h ../cryptlib.h 115dsa_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
116dsa_key.o: ../../include/openssl/symhacks.h ../cryptlib.h
112dsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 117dsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
113dsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 118dsa_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
114dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h 119dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
115dsa_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 120dsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
116dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 121dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
117dsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 122dsa_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
118dsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 123dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
119dsa_lib.o: ../cryptlib.h 124dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
125dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
126dsa_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
127dsa_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
128dsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
129dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
130dsa_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
131dsa_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
132dsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
133dsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
134dsa_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
120dsa_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 135dsa_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
121dsa_ossl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 136dsa_ossl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
122dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h 137dsa_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
123dsa_ossl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 138dsa_ossl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
124dsa_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 139dsa_ossl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
125dsa_ossl.o: ../../include/openssl/opensslconf.h 140dsa_ossl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
141dsa_ossl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
142dsa_ossl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
143dsa_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
144dsa_ossl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
145dsa_ossl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
146dsa_ossl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
126dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 147dsa_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
127dsa_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 148dsa_ossl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
128dsa_ossl.o: ../cryptlib.h 149dsa_ossl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
150dsa_ossl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
151dsa_ossl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
152dsa_ossl.o: ../../include/openssl/symhacks.h ../cryptlib.h
129dsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 153dsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
130dsa_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 154dsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
131dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h 155dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
132dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 156dsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
133dsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 157dsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
134dsa_sign.o: ../../include/openssl/opensslconf.h 158dsa_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
159dsa_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
160dsa_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
161dsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
162dsa_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
163dsa_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
164dsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
135dsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 165dsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
136dsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 166dsa_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
137dsa_sign.o: ../cryptlib.h 167dsa_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
168dsa_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
169dsa_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
170dsa_sign.o: ../../include/openssl/symhacks.h ../cryptlib.h
138dsa_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 171dsa_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
139dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 172dsa_vrf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
140dsa_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 173dsa_vrf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
141dsa_vrf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 174dsa_vrf.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
142dsa_vrf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 175dsa_vrf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
143dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 176dsa_vrf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
144dsa_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 177dsa_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
145dsa_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 178dsa_vrf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
179dsa_vrf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
180dsa_vrf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
181dsa_vrf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
182dsa_vrf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
183dsa_vrf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
184dsa_vrf.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
185dsa_vrf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
186dsa_vrf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
187dsa_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
188dsa_vrf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
146dsa_vrf.o: ../cryptlib.h 189dsa_vrf.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/dsa/dsa.h b/src/lib/libcrypto/dsa/dsa.h
index 68d9912cbc..65689a3426 100644
--- a/src/lib/libcrypto/dsa/dsa.h
+++ b/src/lib/libcrypto/dsa/dsa.h
@@ -65,14 +65,13 @@
65#ifndef HEADER_DSA_H 65#ifndef HEADER_DSA_H
66#define HEADER_DSA_H 66#define HEADER_DSA_H
67 67
68#ifdef __cplusplus
69extern "C" {
70#endif
71
72#ifdef NO_DSA 68#ifdef NO_DSA
73#error DSA is disabled. 69#error DSA is disabled.
74#endif 70#endif
75 71
72#ifndef NO_BIO
73#include <openssl/bio.h>
74#endif
76#include <openssl/bn.h> 75#include <openssl/bn.h>
77#include <openssl/crypto.h> 76#include <openssl/crypto.h>
78#ifndef NO_DH 77#ifndef NO_DH
@@ -81,6 +80,10 @@ extern "C" {
81 80
82#define DSA_FLAG_CACHE_MONT_P 0x01 81#define DSA_FLAG_CACHE_MONT_P 0x01
83 82
83#ifdef __cplusplus
84extern "C" {
85#endif
86
84typedef struct dsa_st DSA; 87typedef struct dsa_st DSA;
85 88
86typedef struct DSA_SIG_st 89typedef struct DSA_SIG_st
@@ -130,7 +133,11 @@ struct dsa_st
130 char *method_mont_p; 133 char *method_mont_p;
131 int references; 134 int references;
132 CRYPTO_EX_DATA ex_data; 135 CRYPTO_EX_DATA ex_data;
136#if 0
133 DSA_METHOD *meth; 137 DSA_METHOD *meth;
138#else
139 struct engine_st *engine;
140#endif
134 }; 141 };
135 142
136#define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \ 143#define DSAparams_dup(x) (DSA *)ASN1_dup((int (*)())i2d_DSAparams, \
@@ -156,12 +163,20 @@ int DSA_do_verify(const unsigned char *dgst,int dgst_len,
156 163
157DSA_METHOD *DSA_OpenSSL(void); 164DSA_METHOD *DSA_OpenSSL(void);
158 165
159void DSA_set_default_method(DSA_METHOD *); 166void DSA_set_default_openssl_method(DSA_METHOD *);
160DSA_METHOD *DSA_get_default_method(void); 167DSA_METHOD *DSA_get_default_openssl_method(void);
168#if 0
161DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *); 169DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *);
170#else
171int DSA_set_method(DSA *dsa, struct engine_st *engine);
172#endif
162 173
163DSA * DSA_new(void); 174DSA * DSA_new(void);
175#if 0
164DSA * DSA_new_method(DSA_METHOD *meth); 176DSA * DSA_new_method(DSA_METHOD *meth);
177#else
178DSA * DSA_new_method(struct engine_st *engine);
179#endif
165int DSA_size(DSA *); 180int DSA_size(DSA *);
166 /* next 4 return -1 on error */ 181 /* next 4 return -1 on error */
167int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp); 182int DSA_sign_setup( DSA *dsa,BN_CTX *ctx_in,BIGNUM **kinvp,BIGNUM **rp);
@@ -188,7 +203,7 @@ int i2d_DSAPublicKey(DSA *a, unsigned char **pp);
188int i2d_DSAPrivateKey(DSA *a, unsigned char **pp); 203int i2d_DSAPrivateKey(DSA *a, unsigned char **pp);
189int i2d_DSAparams(DSA *a,unsigned char **pp); 204int i2d_DSAparams(DSA *a,unsigned char **pp);
190 205
191#ifdef HEADER_BIO_H 206#ifndef NO_BIO
192int DSAparams_print(BIO *bp, DSA *x); 207int DSAparams_print(BIO *bp, DSA *x);
193int DSA_print(BIO *bp, DSA *x, int off); 208int DSA_print(BIO *bp, DSA *x, int off);
194#endif 209#endif
diff --git a/src/lib/libcrypto/dsa/dsa_asn1.c b/src/lib/libcrypto/dsa/dsa_asn1.c
index c9b32b4db7..a76c8f7c7e 100644
--- a/src/lib/libcrypto/dsa/dsa_asn1.c
+++ b/src/lib/libcrypto/dsa/dsa_asn1.c
@@ -10,7 +10,7 @@ DSA_SIG *DSA_SIG_new(void)
10{ 10{
11 DSA_SIG *ret; 11 DSA_SIG *ret;
12 12
13 ret = Malloc(sizeof(DSA_SIG)); 13 ret = OPENSSL_malloc(sizeof(DSA_SIG));
14 if (ret == NULL) 14 if (ret == NULL)
15 { 15 {
16 DSAerr(DSA_F_DSA_SIG_NEW,ERR_R_MALLOC_FAILURE); 16 DSAerr(DSA_F_DSA_SIG_NEW,ERR_R_MALLOC_FAILURE);
@@ -26,7 +26,7 @@ void DSA_SIG_free(DSA_SIG *r)
26 if (r == NULL) return; 26 if (r == NULL) return;
27 if (r->r) BN_clear_free(r->r); 27 if (r->r) BN_clear_free(r->r);
28 if (r->s) BN_clear_free(r->s); 28 if (r->s) BN_clear_free(r->s);
29 Free(r); 29 OPENSSL_free(r);
30} 30}
31 31
32int i2d_DSA_SIG(DSA_SIG *v, unsigned char **pp) 32int i2d_DSA_SIG(DSA_SIG *v, unsigned char **pp)
@@ -35,7 +35,7 @@ int i2d_DSA_SIG(DSA_SIG *v, unsigned char **pp)
35 ASN1_INTEGER rbs,sbs; 35 ASN1_INTEGER rbs,sbs;
36 unsigned char *p; 36 unsigned char *p;
37 37
38 rbs.data=Malloc(BN_num_bits(v->r)/8+1); 38 rbs.data=OPENSSL_malloc(BN_num_bits(v->r)/8+1);
39 if (rbs.data == NULL) 39 if (rbs.data == NULL)
40 { 40 {
41 DSAerr(DSA_F_I2D_DSA_SIG, ERR_R_MALLOC_FAILURE); 41 DSAerr(DSA_F_I2D_DSA_SIG, ERR_R_MALLOC_FAILURE);
@@ -43,10 +43,10 @@ int i2d_DSA_SIG(DSA_SIG *v, unsigned char **pp)
43 } 43 }
44 rbs.type=V_ASN1_INTEGER; 44 rbs.type=V_ASN1_INTEGER;
45 rbs.length=BN_bn2bin(v->r,rbs.data); 45 rbs.length=BN_bn2bin(v->r,rbs.data);
46 sbs.data=Malloc(BN_num_bits(v->s)/8+1); 46 sbs.data=OPENSSL_malloc(BN_num_bits(v->s)/8+1);
47 if (sbs.data == NULL) 47 if (sbs.data == NULL)
48 { 48 {
49 Free(rbs.data); 49 OPENSSL_free(rbs.data);
50 DSAerr(DSA_F_I2D_DSA_SIG, ERR_R_MALLOC_FAILURE); 50 DSAerr(DSA_F_I2D_DSA_SIG, ERR_R_MALLOC_FAILURE);
51 return(0); 51 return(0);
52 } 52 }
@@ -64,8 +64,8 @@ int i2d_DSA_SIG(DSA_SIG *v, unsigned char **pp)
64 i2d_ASN1_INTEGER(&sbs,&p); 64 i2d_ASN1_INTEGER(&sbs,&p);
65 } 65 }
66 t=ASN1_object_size(1,len,V_ASN1_SEQUENCE); 66 t=ASN1_object_size(1,len,V_ASN1_SEQUENCE);
67 Free(rbs.data); 67 OPENSSL_free(rbs.data);
68 Free(sbs.data); 68 OPENSSL_free(sbs.data);
69 return(t); 69 return(t);
70} 70}
71 71
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c
index 5aef2d5fcf..af3c56d770 100644
--- a/src/lib/libcrypto/dsa/dsa_key.c
+++ b/src/lib/libcrypto/dsa/dsa_key.c
@@ -84,7 +84,7 @@ int DSA_generate_key(DSA *dsa)
84 i=BN_num_bits(dsa->q); 84 i=BN_num_bits(dsa->q);
85 for (;;) 85 for (;;)
86 { 86 {
87 if (!BN_rand(priv_key,i,1,0)) 87 if (!BN_rand(priv_key,i,0,0))
88 goto err; 88 goto err;
89 if (BN_cmp(priv_key,dsa->q) >= 0) 89 if (BN_cmp(priv_key,dsa->q) >= 0)
90 BN_sub(priv_key,priv_key,dsa->q); 90 BN_sub(priv_key,priv_key,dsa->q);
diff --git a/src/lib/libcrypto/dsa/dsa_lib.c b/src/lib/libcrypto/dsa/dsa_lib.c
index 224e412afc..b31b946ad3 100644
--- a/src/lib/libcrypto/dsa/dsa_lib.c
+++ b/src/lib/libcrypto/dsa/dsa_lib.c
@@ -63,6 +63,7 @@
63#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/dsa.h> 64#include <openssl/dsa.h>
65#include <openssl/asn1.h> 65#include <openssl/asn1.h>
66#include <openssl/engine.h>
66 67
67const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT; 68const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
68 69
@@ -70,12 +71,26 @@ static DSA_METHOD *default_DSA_method;
70static int dsa_meth_num = 0; 71static int dsa_meth_num = 0;
71static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL; 72static STACK_OF(CRYPTO_EX_DATA_FUNCS) *dsa_meth = NULL;
72 73
73void DSA_set_default_method(DSA_METHOD *meth) 74void DSA_set_default_openssl_method(DSA_METHOD *meth)
74{ 75{
75 default_DSA_method = meth; 76 ENGINE *e;
77 /* We'll need to notify the "openssl" ENGINE of this
78 * change too. We won't bother locking things down at
79 * our end as there was never any locking in these
80 * functions! */
81 if(default_DSA_method != meth)
82 {
83 default_DSA_method = meth;
84 e = ENGINE_by_id("openssl");
85 if(e)
86 {
87 ENGINE_set_DSA(e, meth);
88 ENGINE_free(e);
89 }
90 }
76} 91}
77 92
78DSA_METHOD *DSA_get_default_method(void) 93DSA_METHOD *DSA_get_default_openssl_method(void)
79{ 94{
80 if(!default_DSA_method) default_DSA_method = DSA_OpenSSL(); 95 if(!default_DSA_method) default_DSA_method = DSA_OpenSSL();
81 return default_DSA_method; 96 return default_DSA_method;
@@ -86,6 +101,7 @@ DSA *DSA_new(void)
86 return DSA_new_method(NULL); 101 return DSA_new_method(NULL);
87} 102}
88 103
104#if 0
89DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth) 105DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
90{ 106{
91 DSA_METHOD *mtmp; 107 DSA_METHOD *mtmp;
@@ -95,21 +111,52 @@ DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth)
95 if (meth->init) meth->init(dsa); 111 if (meth->init) meth->init(dsa);
96 return mtmp; 112 return mtmp;
97} 113}
114#else
115int DSA_set_method(DSA *dsa, ENGINE *engine)
116 {
117 ENGINE *mtmp;
118 DSA_METHOD *meth;
119 mtmp = dsa->engine;
120 meth = ENGINE_get_DSA(mtmp);
121 if (!ENGINE_init(engine))
122 return 0;
123 if (meth->finish) meth->finish(dsa);
124 dsa->engine = engine;
125 meth = ENGINE_get_DSA(engine);
126 if (meth->init) meth->init(dsa);
127 /* SHOULD ERROR CHECK THIS!!! */
128 ENGINE_finish(mtmp);
129 return 1;
130 }
131#endif
98 132
99 133
134#if 0
100DSA *DSA_new_method(DSA_METHOD *meth) 135DSA *DSA_new_method(DSA_METHOD *meth)
136#else
137DSA *DSA_new_method(ENGINE *engine)
138#endif
101 { 139 {
140 DSA_METHOD *meth;
102 DSA *ret; 141 DSA *ret;
103 142
104 ret=(DSA *)Malloc(sizeof(DSA)); 143 ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
105 if (ret == NULL) 144 if (ret == NULL)
106 { 145 {
107 DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE); 146 DSAerr(DSA_F_DSA_NEW,ERR_R_MALLOC_FAILURE);
108 return(NULL); 147 return(NULL);
109 } 148 }
110 if(!default_DSA_method) default_DSA_method = DSA_OpenSSL(); 149 if(engine)
111 if(meth) ret->meth = meth; 150 ret->engine = engine;
112 else ret->meth = default_DSA_method; 151 else
152 {
153 if((ret->engine=ENGINE_get_default_DSA()) == NULL)
154 {
155 OPENSSL_free(ret);
156 return NULL;
157 }
158 }
159 meth = ENGINE_get_DSA(ret->engine);
113 ret->pad=0; 160 ret->pad=0;
114 ret->version=0; 161 ret->version=0;
115 ret->write_params=1; 162 ret->write_params=1;
@@ -125,10 +172,10 @@ DSA *DSA_new_method(DSA_METHOD *meth)
125 ret->method_mont_p=NULL; 172 ret->method_mont_p=NULL;
126 173
127 ret->references=1; 174 ret->references=1;
128 ret->flags=ret->meth->flags; 175 ret->flags=meth->flags;
129 if ((ret->meth->init != NULL) && !ret->meth->init(ret)) 176 if ((meth->init != NULL) && !meth->init(ret))
130 { 177 {
131 Free(ret); 178 OPENSSL_free(ret);
132 ret=NULL; 179 ret=NULL;
133 } 180 }
134 else 181 else
@@ -139,6 +186,7 @@ DSA *DSA_new_method(DSA_METHOD *meth)
139 186
140void DSA_free(DSA *r) 187void DSA_free(DSA *r)
141 { 188 {
189 DSA_METHOD *meth;
142 int i; 190 int i;
143 191
144 if (r == NULL) return; 192 if (r == NULL) return;
@@ -158,7 +206,9 @@ void DSA_free(DSA *r)
158 206
159 CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data); 207 CRYPTO_free_ex_data(dsa_meth, r, &r->ex_data);
160 208
161 if(r->meth->finish) r->meth->finish(r); 209 meth = ENGINE_get_DSA(r->engine);
210 if(meth->finish) meth->finish(r);
211 ENGINE_finish(r->engine);
162 212
163 if (r->p != NULL) BN_clear_free(r->p); 213 if (r->p != NULL) BN_clear_free(r->p);
164 if (r->q != NULL) BN_clear_free(r->q); 214 if (r->q != NULL) BN_clear_free(r->q);
@@ -167,7 +217,7 @@ void DSA_free(DSA *r)
167 if (r->priv_key != NULL) BN_clear_free(r->priv_key); 217 if (r->priv_key != NULL) BN_clear_free(r->priv_key);
168 if (r->kinv != NULL) BN_clear_free(r->kinv); 218 if (r->kinv != NULL) BN_clear_free(r->kinv);
169 if (r->r != NULL) BN_clear_free(r->r); 219 if (r->r != NULL) BN_clear_free(r->r);
170 Free(r); 220 OPENSSL_free(r);
171 } 221 }
172 222
173int DSA_size(DSA *r) 223int DSA_size(DSA *r)
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index b51cf6ad8d..96295dc24f 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -64,6 +64,7 @@
64#include <openssl/dsa.h> 64#include <openssl/dsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/engine.h>
67 68
68static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); 69static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
69static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); 70static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
@@ -181,7 +182,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
181 /* Get random k */ 182 /* Get random k */
182 for (;;) 183 for (;;)
183 { 184 {
184 if (!BN_rand(&k, BN_num_bits(dsa->q), 1, 0)) goto err; 185 if (!BN_rand(&k, BN_num_bits(dsa->q), 0, 0)) goto err;
185 if (BN_cmp(&k,dsa->q) >= 0) 186 if (BN_cmp(&k,dsa->q) >= 0)
186 BN_sub(&k,&k,dsa->q); 187 BN_sub(&k,&k,dsa->q);
187 if (!BN_is_zero(&k)) break; 188 if (!BN_is_zero(&k)) break;
@@ -195,7 +196,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
195 } 196 }
196 197
197 /* Compute r = (g^k mod p) mod q */ 198 /* Compute r = (g^k mod p) mod q */
198 if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx, 199 if (!ENGINE_get_DSA(dsa->engine)->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
199 (BN_MONT_CTX *)dsa->method_mont_p)) goto err; 200 (BN_MONT_CTX *)dsa->method_mont_p)) goto err;
200 if (!BN_mod(r,r,dsa->q,ctx)) goto err; 201 if (!BN_mod(r,r,dsa->q,ctx)) goto err;
201 202
@@ -273,7 +274,7 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
273 if (!BN_mod(&u1,&u1,dsa->q,ctx)) goto err; 274 if (!BN_mod(&u1,&u1,dsa->q,ctx)) goto err;
274#else 275#else
275 { 276 {
276 if (!dsa->meth->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2, 277 if (!ENGINE_get_DSA(dsa->engine)->dsa_mod_exp(dsa, &t1,dsa->g,&u1,dsa->pub_key,&u2,
277 dsa->p,ctx,mont)) goto err; 278 dsa->p,ctx,mont)) goto err;
278 /* BN_copy(&u1,&t1); */ 279 /* BN_copy(&u1,&t1); */
279 /* let u1 = u1 mod q */ 280 /* let u1 = u1 mod q */
diff --git a/src/lib/libcrypto/dsa/dsa_sign.c b/src/lib/libcrypto/dsa/dsa_sign.c
index 89205026f0..dfe27bae47 100644
--- a/src/lib/libcrypto/dsa/dsa_sign.c
+++ b/src/lib/libcrypto/dsa/dsa_sign.c
@@ -64,10 +64,11 @@
64#include <openssl/dsa.h> 64#include <openssl/dsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/engine.h>
67 68
68DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 69DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
69 { 70 {
70 return dsa->meth->dsa_do_sign(dgst, dlen, dsa); 71 return ENGINE_get_DSA(dsa->engine)->dsa_do_sign(dgst, dlen, dsa);
71 } 72 }
72 73
73int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, 74int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
@@ -87,6 +88,6 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
87 88
88int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) 89int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
89 { 90 {
90 return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); 91 return ENGINE_get_DSA(dsa->engine)->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
91 } 92 }
92 93
diff --git a/src/lib/libcrypto/dsa/dsa_vrf.c b/src/lib/libcrypto/dsa/dsa_vrf.c
index 03277f80fd..2e891ae491 100644
--- a/src/lib/libcrypto/dsa/dsa_vrf.c
+++ b/src/lib/libcrypto/dsa/dsa_vrf.c
@@ -65,11 +65,12 @@
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/asn1_mac.h> 67#include <openssl/asn1_mac.h>
68#include <openssl/engine.h>
68 69
69int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, 70int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
70 DSA *dsa) 71 DSA *dsa)
71 { 72 {
72 return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); 73 return ENGINE_get_DSA(dsa->engine)->dsa_do_verify(dgst, dgst_len, sig, dsa);
73 } 74 }
74 75
75/* data has already been hashed (probably with SHA or SHA-1). */ 76/* data has already been hashed (probably with SHA or SHA-1). */
diff --git a/src/lib/libcrypto/dso/Makefile.ssl b/src/lib/libcrypto/dso/Makefile.ssl
new file mode 100644
index 0000000000..effc46d2dc
--- /dev/null
+++ b/src/lib/libcrypto/dso/Makefile.ssl
@@ -0,0 +1,140 @@
1#
2# SSLeay/crypto/dso/Makefile
3#
4
5DIR= dso
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPEND= $(TOP)/util/domd $(TOP)
15MAKEFILE= Makefile.ssl
16AR= ar r
17
18CFLAGS= $(INCLUDES) $(CFLAG)
19
20GENERAL=Makefile
21TEST=
22APPS=
23
24LIB=$(TOP)/libcrypto.a
25LIBSRC= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c \
26 dso_openssl.c dso_win32.c dso_vms.c
27LIBOBJ= dso_dl.o dso_dlfcn.o dso_err.o dso_lib.o dso_null.o \
28 dso_openssl.o dso_win32.o dso_vms.o
29
30SRC= $(LIBSRC)
31
32EXHEADER= dso.h
33HEADER= $(EXHEADER)
34
35ALL= $(GENERAL) $(SRC) $(HEADER)
36
37top:
38 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
39
40all: lib
41
42lib: $(LIBOBJ)
43 $(AR) $(LIB) $(LIBOBJ)
44 $(RANLIB) $(LIB)
45 @touch lib
46
47files:
48 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
49
50links:
51 @$(TOP)/util/point.sh Makefile.ssl Makefile
52 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
53 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
54 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
55
56install:
57 @for i in $(EXHEADER) ; \
58 do \
59 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
60 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
61 done;
62
63tags:
64 ctags $(SRC)
65
66tests:
67
68lint:
69 lint -DLINT $(INCLUDES) $(SRC)>fluff
70
71depend:
72 $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
73
74dclean:
75 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
76 mv -f Makefile.new $(MAKEFILE)
77
78clean:
79 rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
80
81# DO NOT DELETE THIS LINE -- make depend depends on it.
82
83dso_dl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
84dso_dl.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
85dso_dl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
86dso_dl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
87dso_dl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
88dso_dl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
89dso_dl.o: ../../include/openssl/symhacks.h ../cryptlib.h
90dso_dlfcn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
91dso_dlfcn.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
92dso_dlfcn.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
93dso_dlfcn.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
94dso_dlfcn.o: ../../include/openssl/opensslconf.h
95dso_dlfcn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
96dso_dlfcn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
97dso_dlfcn.o: ../cryptlib.h
98dso_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
99dso_err.o: ../../include/openssl/dso.h ../../include/openssl/err.h
100dso_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
101dso_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
102dso_err.o: ../../include/openssl/symhacks.h
103dso_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
104dso_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
105dso_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
106dso_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
107dso_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
108dso_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
109dso_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
110dso_null.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
111dso_null.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
112dso_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
113dso_null.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
114dso_null.o: ../../include/openssl/opensslconf.h
115dso_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
116dso_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
117dso_null.o: ../cryptlib.h
118dso_openssl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
119dso_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
120dso_openssl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
121dso_openssl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
122dso_openssl.o: ../../include/openssl/opensslconf.h
123dso_openssl.o: ../../include/openssl/opensslv.h
124dso_openssl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
125dso_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h
126dso_vms.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
127dso_vms.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
128dso_vms.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
129dso_vms.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
130dso_vms.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
131dso_vms.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
132dso_vms.o: ../../include/openssl/symhacks.h ../cryptlib.h
133dso_win32.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
134dso_win32.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
135dso_win32.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
136dso_win32.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
137dso_win32.o: ../../include/openssl/opensslconf.h
138dso_win32.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
139dso_win32.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
140dso_win32.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/dso/README b/src/lib/libcrypto/dso/README
new file mode 100644
index 0000000000..6ba03c5631
--- /dev/null
+++ b/src/lib/libcrypto/dso/README
@@ -0,0 +1,24 @@
1TODO
2----
3
4Find a way where name-translation can be done in a way that is
5sensitive to particular methods (ie. generic code could still do
6different path/filename substitutions on win32 to what it does on
7*nix) but doesn't assume some canonical form. Already one case
8exists where the "blah -> (libblah.so,blah.dll)" mapping doesn't
9suffice. I suspect a callback with an enumerated (or string?)
10parameter could be the way to go here ... DSO_ctrl the callback
11into place and it can be invoked to handle name translation with
12some clue to the calling code as to what kind of system it is.
13
14NOTES
15-----
16
17I've checked out HPUX (well, version 11 at least) and shl_t is
18a pointer type so it's safe to use in the way it has been in
19dso_dl.c. On the other hand, HPUX11 support dlfcn too and
20according to their man page, prefer developers to move to that.
21I'll leave Richard's changes there as I guess dso_dl is needed
22for HPUX10.20.
23
24
diff --git a/src/lib/libcrypto/dso/dso.h b/src/lib/libcrypto/dso/dso.h
new file mode 100644
index 0000000000..bed7c464a6
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso.h
@@ -0,0 +1,250 @@
1/* dso.h */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#ifndef HEADER_DSO_H
60#define HEADER_DSO_H
61
62#include <openssl/crypto.h>
63
64#ifdef __cplusplus
65extern "C" {
66#endif
67
68/* These values are used as commands to DSO_ctrl() */
69#define DSO_CTRL_GET_FLAGS 1
70#define DSO_CTRL_SET_FLAGS 2
71#define DSO_CTRL_OR_FLAGS 3
72
73/* These flags control the translation of file-names from canonical to
74 * native. Eg. in the CryptoSwift support, the "dl" and "dlfcn"
75 * methods will translate "swift" -> "libswift.so" whereas the "win32"
76 * method will translate "swift" -> "swift.dll". NB: Until I can figure
77 * out how to be more "conventional" with this, the methods will only
78 * honour this flag if it looks like it was passed a file without any
79 * path and if the filename is small enough.
80 */
81#define DSO_FLAG_NAME_TRANSLATION 0x01
82
83/* The following flag controls the translation of symbol names to upper
84 * case. This is currently only being implemented for OpenVMS.
85 */
86#define DSO_FLAG_UPCASE_SYMBOL 0x02
87
88
89typedef void (*DSO_FUNC_TYPE)(void);
90
91typedef struct dso_st DSO;
92
93typedef struct dso_meth_st
94 {
95 const char *name;
96 /* Loads a shared library */
97 int (*dso_load)(DSO *dso, const char *filename);
98 /* Unloads a shared library */
99 int (*dso_unload)(DSO *dso);
100 /* Binds a variable */
101 void *(*dso_bind_var)(DSO *dso, const char *symname);
102 /* Binds a function - assumes a return type of DSO_FUNC_TYPE.
103 * This should be cast to the real function prototype by the
104 * caller. Platforms that don't have compatible representations
105 * for different prototypes (this is possible within ANSI C)
106 * are highly unlikely to have shared libraries at all, let
107 * alone a DSO_METHOD implemented for them. */
108 DSO_FUNC_TYPE (*dso_bind_func)(DSO *dso, const char *symname);
109
110/* I don't think this would actually be used in any circumstances. */
111#if 0
112 /* Unbinds a variable */
113 int (*dso_unbind_var)(DSO *dso, char *symname, void *symptr);
114 /* Unbinds a function */
115 int (*dso_unbind_func)(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
116#endif
117 /* The generic (yuck) "ctrl()" function. NB: Negative return
118 * values (rather than zero) indicate errors. */
119 long (*dso_ctrl)(DSO *dso, int cmd, long larg, void *parg);
120
121 /* [De]Initialisation handlers. */
122 int (*init)(DSO *dso);
123 int (*finish)(DSO *dso);
124 } DSO_METHOD;
125
126/**********************************************************************/
127/* The low-level handle type used to refer to a loaded shared library */
128
129struct dso_st
130 {
131 DSO_METHOD *meth;
132 /* Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS
133 * doesn't use anything but will need to cache the filename
134 * for use in the dso_bind handler. All in all, let each
135 * method control its own destiny. "Handles" and such go in
136 * a STACK. */
137 STACK *meth_data;
138 int references;
139 int flags;
140 /* For use by applications etc ... use this for your bits'n'pieces,
141 * don't touch meth_data! */
142 CRYPTO_EX_DATA ex_data;
143 };
144
145
146DSO * DSO_new(void);
147DSO * DSO_new_method(DSO_METHOD *method);
148int DSO_free(DSO *dso);
149int DSO_flags(DSO *dso);
150int DSO_up(DSO *dso);
151long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);
152
153void DSO_set_default_method(DSO_METHOD *meth);
154DSO_METHOD *DSO_get_default_method(void);
155DSO_METHOD *DSO_get_method(DSO *dso);
156DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);
157
158/* The all-singing all-dancing load function, you normally pass NULL
159 * for the first and third parameters. Use DSO_up and DSO_free for
160 * subsequent reference count handling. Any flags passed in will be set
161 * in the constructed DSO after its init() function but before the
162 * load operation. This will be done with;
163 * DSO_ctrl(dso, DSO_CTRL_SET_FLAGS, flags, NULL); */
164DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);
165
166/* This function binds to a variable inside a shared library. */
167void *DSO_bind_var(DSO *dso, const char *symname);
168
169/* This function binds to a function inside a shared library. */
170DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);
171
172/* This method is the default, but will beg, borrow, or steal whatever
173 * method should be the default on any particular platform (including
174 * DSO_METH_null() if necessary). */
175DSO_METHOD *DSO_METHOD_openssl(void);
176
177/* This method is defined for all platforms - if a platform has no
178 * DSO support then this will be the only method! */
179DSO_METHOD *DSO_METHOD_null(void);
180
181/* If DSO_DLFCN is defined, the standard dlfcn.h-style functions
182 * (dlopen, dlclose, dlsym, etc) will be used and incorporated into
183 * this method. If not, this method will return NULL. */
184DSO_METHOD *DSO_METHOD_dlfcn(void);
185
186/* If DSO_DL is defined, the standard dl.h-style functions (shl_load,
187 * shl_unload, shl_findsym, etc) will be used and incorporated into
188 * this method. If not, this method will return NULL. */
189DSO_METHOD *DSO_METHOD_dl(void);
190
191/* If WIN32 is defined, use DLLs. If not, return NULL. */
192DSO_METHOD *DSO_METHOD_win32(void);
193
194/* If VMS is defined, use shared images. If not, return NULL. */
195DSO_METHOD *DSO_METHOD_vms(void);
196
197void ERR_load_DSO_strings(void);
198
199/* BEGIN ERROR CODES */
200/* The following lines are auto generated by the script mkerr.pl. Any changes
201 * made after this point may be overwritten when the script is next run.
202 */
203
204/* Error codes for the DSO functions. */
205
206/* Function codes. */
207#define DSO_F_DLFCN_BIND_FUNC 100
208#define DSO_F_DLFCN_BIND_VAR 101
209#define DSO_F_DLFCN_CTRL 102
210#define DSO_F_DLFCN_LOAD 103
211#define DSO_F_DLFCN_UNLOAD 104
212#define DSO_F_DL_BIND_FUNC 105
213#define DSO_F_DL_BIND_VAR 106
214#define DSO_F_DL_CTRL 107
215#define DSO_F_DL_LOAD 108
216#define DSO_F_DL_UNLOAD 109
217#define DSO_F_DSO_BIND_FUNC 110
218#define DSO_F_DSO_BIND_VAR 111
219#define DSO_F_DSO_CTRL 112
220#define DSO_F_DSO_FREE 113
221#define DSO_F_DSO_LOAD 114
222#define DSO_F_DSO_NEW_METHOD 115
223#define DSO_F_DSO_UP 116
224#define DSO_F_VMS_BIND_VAR 122
225#define DSO_F_VMS_CTRL 123
226#define DSO_F_VMS_LOAD 124
227#define DSO_F_VMS_UNLOAD 125
228#define DSO_F_WIN32_BIND_FUNC 117
229#define DSO_F_WIN32_BIND_VAR 118
230#define DSO_F_WIN32_CTRL 119
231#define DSO_F_WIN32_LOAD 120
232#define DSO_F_WIN32_UNLOAD 121
233
234/* Reason codes. */
235#define DSO_R_CTRL_FAILED 100
236#define DSO_R_FILENAME_TOO_BIG 109
237#define DSO_R_FINISH_FAILED 101
238#define DSO_R_LOAD_FAILED 102
239#define DSO_R_NULL_HANDLE 103
240#define DSO_R_STACK_ERROR 104
241#define DSO_R_SYM_FAILURE 105
242#define DSO_R_UNKNOWN_COMMAND 106
243#define DSO_R_UNLOAD_FAILED 107
244#define DSO_R_UNSUPPORTED 108
245
246#ifdef __cplusplus
247}
248#endif
249#endif
250
diff --git a/src/lib/libcrypto/dso/dso_dl.c b/src/lib/libcrypto/dso/dso_dl.c
new file mode 100644
index 0000000000..69810fc3bb
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_dl.c
@@ -0,0 +1,251 @@
1/* dso_dl.c */
2/* Written by Richard Levitte (levitte@openssl.org) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/dso.h>
62
63#ifndef DSO_DL
64DSO_METHOD *DSO_METHOD_dl(void)
65 {
66 return NULL;
67 }
68#else
69
70#include <dl.h>
71
72/* Part of the hack in "dl_load" ... */
73#define DSO_MAX_TRANSLATED_SIZE 256
74
75static int dl_load(DSO *dso, const char *filename);
76static int dl_unload(DSO *dso);
77static void *dl_bind_var(DSO *dso, const char *symname);
78static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname);
79#if 0
80static int dl_unbind_var(DSO *dso, char *symname, void *symptr);
81static int dl_unbind_func(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
82static int dl_init(DSO *dso);
83static int dl_finish(DSO *dso);
84#endif
85static int dl_ctrl(DSO *dso, int cmd, long larg, void *parg);
86
87static DSO_METHOD dso_meth_dl = {
88 "OpenSSL 'dl' shared library method",
89 dl_load,
90 dl_unload,
91 dl_bind_var,
92 dl_bind_func,
93/* For now, "unbind" doesn't exist */
94#if 0
95 NULL, /* unbind_var */
96 NULL, /* unbind_func */
97#endif
98 dl_ctrl,
99 NULL, /* init */
100 NULL /* finish */
101 };
102
103DSO_METHOD *DSO_METHOD_dl(void)
104 {
105 return(&dso_meth_dl);
106 }
107
108/* For this DSO_METHOD, our meth_data STACK will contain;
109 * (i) the handle (shl_t) returned from shl_load().
110 * NB: I checked on HPUX11 and shl_t is itself a pointer
111 * type so the cast is safe.
112 */
113
114static int dl_load(DSO *dso, const char *filename)
115 {
116 shl_t ptr;
117 char translated[DSO_MAX_TRANSLATED_SIZE];
118 int len;
119
120 /* The same comment as in dlfcn_load applies here. bleurgh. */
121 len = strlen(filename);
122 if((dso->flags & DSO_FLAG_NAME_TRANSLATION) &&
123 (len + 6 < DSO_MAX_TRANSLATED_SIZE) &&
124 (strstr(filename, "/") == NULL))
125 {
126 sprintf(translated, "lib%s.so", filename);
127 ptr = shl_load(translated, BIND_IMMEDIATE, NULL);
128 }
129 else
130 ptr = shl_load(filename, BIND_IMMEDIATE, NULL);
131 if(ptr == NULL)
132 {
133 DSOerr(DSO_F_DL_LOAD,DSO_R_LOAD_FAILED);
134 return(0);
135 }
136 if(!sk_push(dso->meth_data, (char *)ptr))
137 {
138 DSOerr(DSO_F_DL_LOAD,DSO_R_STACK_ERROR);
139 shl_unload(ptr);
140 return(0);
141 }
142 return(1);
143 }
144
145static int dl_unload(DSO *dso)
146 {
147 shl_t ptr;
148 if(dso == NULL)
149 {
150 DSOerr(DSO_F_DL_UNLOAD,ERR_R_PASSED_NULL_PARAMETER);
151 return(0);
152 }
153 if(sk_num(dso->meth_data) < 1)
154 return(1);
155 /* Is this statement legal? */
156 ptr = (shl_t)sk_pop(dso->meth_data);
157 if(ptr == NULL)
158 {
159 DSOerr(DSO_F_DL_UNLOAD,DSO_R_NULL_HANDLE);
160 /* Should push the value back onto the stack in
161 * case of a retry. */
162 sk_push(dso->meth_data, (char *)ptr);
163 return(0);
164 }
165 shl_unload(ptr);
166 return(1);
167 }
168
169static void *dl_bind_var(DSO *dso, const char *symname)
170 {
171 shl_t ptr;
172 void *sym;
173
174 if((dso == NULL) || (symname == NULL))
175 {
176 DSOerr(DSO_F_DL_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
177 return(NULL);
178 }
179 if(sk_num(dso->meth_data) < 1)
180 {
181 DSOerr(DSO_F_DL_BIND_VAR,DSO_R_STACK_ERROR);
182 return(NULL);
183 }
184 ptr = (shl_t)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
185 if(ptr == NULL)
186 {
187 DSOerr(DSO_F_DL_BIND_VAR,DSO_R_NULL_HANDLE);
188 return(NULL);
189 }
190 if (shl_findsym(ptr, symname, TYPE_UNDEFINED, &sym) < 0)
191 {
192 DSOerr(DSO_F_DL_BIND_VAR,DSO_R_SYM_FAILURE);
193 return(NULL);
194 }
195 return(sym);
196 }
197
198static DSO_FUNC_TYPE dl_bind_func(DSO *dso, const char *symname)
199 {
200 shl_t ptr;
201 void *sym;
202
203 if((dso == NULL) || (symname == NULL))
204 {
205 DSOerr(DSO_F_DL_BIND_FUNC,ERR_R_PASSED_NULL_PARAMETER);
206 return(NULL);
207 }
208 if(sk_num(dso->meth_data) < 1)
209 {
210 DSOerr(DSO_F_DL_BIND_FUNC,DSO_R_STACK_ERROR);
211 return(NULL);
212 }
213 ptr = (shl_t)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
214 if(ptr == NULL)
215 {
216 DSOerr(DSO_F_DL_BIND_FUNC,DSO_R_NULL_HANDLE);
217 return(NULL);
218 }
219 if (shl_findsym(ptr, symname, TYPE_UNDEFINED, &sym) < 0)
220 {
221 DSOerr(DSO_F_DL_BIND_FUNC,DSO_R_SYM_FAILURE);
222 return(NULL);
223 }
224 return((DSO_FUNC_TYPE)sym);
225 }
226
227static int dl_ctrl(DSO *dso, int cmd, long larg, void *parg)
228 {
229 if(dso == NULL)
230 {
231 DSOerr(DSO_F_DL_CTRL,ERR_R_PASSED_NULL_PARAMETER);
232 return(-1);
233 }
234 switch(cmd)
235 {
236 case DSO_CTRL_GET_FLAGS:
237 return dso->flags;
238 case DSO_CTRL_SET_FLAGS:
239 dso->flags = (int)larg;
240 return(0);
241 case DSO_CTRL_OR_FLAGS:
242 dso->flags |= (int)larg;
243 return(0);
244 default:
245 break;
246 }
247 DSOerr(DSO_F_DL_CTRL,DSO_R_UNKNOWN_COMMAND);
248 return(-1);
249 }
250
251#endif /* DSO_DL */
diff --git a/src/lib/libcrypto/dso/dso_dlfcn.c b/src/lib/libcrypto/dso/dso_dlfcn.c
new file mode 100644
index 0000000000..e709c721cc
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_dlfcn.c
@@ -0,0 +1,276 @@
1/* dso_dlfcn.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/dso.h>
62
63#ifndef DSO_DLFCN
64DSO_METHOD *DSO_METHOD_dlfcn(void)
65 {
66 return NULL;
67 }
68#else
69
70#ifdef HAVE_DLFCN_H
71#include <dlfcn.h>
72#endif
73
74/* Part of the hack in "dlfcn_load" ... */
75#define DSO_MAX_TRANSLATED_SIZE 256
76
77static int dlfcn_load(DSO *dso, const char *filename);
78static int dlfcn_unload(DSO *dso);
79static void *dlfcn_bind_var(DSO *dso, const char *symname);
80static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname);
81#if 0
82static int dlfcn_unbind(DSO *dso, char *symname, void *symptr);
83static int dlfcn_init(DSO *dso);
84static int dlfcn_finish(DSO *dso);
85#endif
86static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg);
87
88static DSO_METHOD dso_meth_dlfcn = {
89 "OpenSSL 'dlfcn' shared library method",
90 dlfcn_load,
91 dlfcn_unload,
92 dlfcn_bind_var,
93 dlfcn_bind_func,
94/* For now, "unbind" doesn't exist */
95#if 0
96 NULL, /* unbind_var */
97 NULL, /* unbind_func */
98#endif
99 dlfcn_ctrl,
100 NULL, /* init */
101 NULL /* finish */
102 };
103
104DSO_METHOD *DSO_METHOD_dlfcn(void)
105 {
106 return(&dso_meth_dlfcn);
107 }
108
109/* Prior to using the dlopen() function, we should decide on the flag
110 * we send. There's a few different ways of doing this and it's a
111 * messy venn-diagram to match up which platforms support what. So
112 * as we don't have autoconf yet, I'm implementing a hack that could
113 * be hacked further relatively easily to deal with cases as we find
114 * them. Initially this is to cope with OpenBSD. */
115#ifdef __OpenBSD__
116# ifdef DL_LAZY
117# define DLOPEN_FLAG DL_LAZY
118# else
119# ifdef RTLD_NOW
120# define DLOPEN_FLAG RTLD_NOW
121# else
122# define DLOPEN_FLAG 0
123# endif
124# endif
125#else
126# define DLOPEN_FLAG RTLD_NOW /* Hope this works everywhere else */
127#endif
128
129/* For this DSO_METHOD, our meth_data STACK will contain;
130 * (i) the handle (void*) returned from dlopen().
131 */
132
133static int dlfcn_load(DSO *dso, const char *filename)
134 {
135 void *ptr;
136 char translated[DSO_MAX_TRANSLATED_SIZE];
137 int len;
138
139 /* NB: This is a hideous hack, but I'm not yet sure what
140 * to replace it with. This attempts to convert any filename,
141 * that looks like it has no path information, into a
142 * translated form, e. "blah" -> "libblah.so" */
143 len = strlen(filename);
144 if((dso->flags & DSO_FLAG_NAME_TRANSLATION) &&
145 (len + 6 < DSO_MAX_TRANSLATED_SIZE) &&
146 (strstr(filename, "/") == NULL))
147 {
148 sprintf(translated, "lib%s.so", filename);
149 ptr = dlopen(translated, DLOPEN_FLAG);
150 }
151 else
152 {
153 ptr = dlopen(filename, DLOPEN_FLAG);
154 }
155 if(ptr == NULL)
156 {
157 DSOerr(DSO_F_DLFCN_LOAD,DSO_R_LOAD_FAILED);
158 return(0);
159 }
160 if(!sk_push(dso->meth_data, (char *)ptr))
161 {
162 DSOerr(DSO_F_DLFCN_LOAD,DSO_R_STACK_ERROR);
163 dlclose(ptr);
164 return(0);
165 }
166 return(1);
167 }
168
169static int dlfcn_unload(DSO *dso)
170 {
171 void *ptr;
172 if(dso == NULL)
173 {
174 DSOerr(DSO_F_DLFCN_UNLOAD,ERR_R_PASSED_NULL_PARAMETER);
175 return(0);
176 }
177 if(sk_num(dso->meth_data) < 1)
178 return(1);
179 ptr = (void *)sk_pop(dso->meth_data);
180 if(ptr == NULL)
181 {
182 DSOerr(DSO_F_DLFCN_UNLOAD,DSO_R_NULL_HANDLE);
183 /* Should push the value back onto the stack in
184 * case of a retry. */
185 sk_push(dso->meth_data, (char *)ptr);
186 return(0);
187 }
188 /* For now I'm not aware of any errors associated with dlclose() */
189 dlclose(ptr);
190 return(1);
191 }
192
193static void *dlfcn_bind_var(DSO *dso, const char *symname)
194 {
195 void *ptr, *sym;
196
197 if((dso == NULL) || (symname == NULL))
198 {
199 DSOerr(DSO_F_DLFCN_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
200 return(NULL);
201 }
202 if(sk_num(dso->meth_data) < 1)
203 {
204 DSOerr(DSO_F_DLFCN_BIND_VAR,DSO_R_STACK_ERROR);
205 return(NULL);
206 }
207 ptr = (void *)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
208 if(ptr == NULL)
209 {
210 DSOerr(DSO_F_DLFCN_BIND_VAR,DSO_R_NULL_HANDLE);
211 return(NULL);
212 }
213 sym = dlsym(ptr, symname);
214 if(sym == NULL)
215 {
216 DSOerr(DSO_F_DLFCN_BIND_VAR,DSO_R_SYM_FAILURE);
217 return(NULL);
218 }
219 return(sym);
220 }
221
222static DSO_FUNC_TYPE dlfcn_bind_func(DSO *dso, const char *symname)
223 {
224 void *ptr;
225 DSO_FUNC_TYPE sym;
226
227 if((dso == NULL) || (symname == NULL))
228 {
229 DSOerr(DSO_F_DLFCN_BIND_FUNC,ERR_R_PASSED_NULL_PARAMETER);
230 return(NULL);
231 }
232 if(sk_num(dso->meth_data) < 1)
233 {
234 DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_STACK_ERROR);
235 return(NULL);
236 }
237 ptr = (void *)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
238 if(ptr == NULL)
239 {
240 DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_NULL_HANDLE);
241 return(NULL);
242 }
243 sym = (DSO_FUNC_TYPE)dlsym(ptr, symname);
244 if(sym == NULL)
245 {
246 DSOerr(DSO_F_DLFCN_BIND_FUNC,DSO_R_SYM_FAILURE);
247 return(NULL);
248 }
249 return(sym);
250 }
251
252static long dlfcn_ctrl(DSO *dso, int cmd, long larg, void *parg)
253 {
254 if(dso == NULL)
255 {
256 DSOerr(DSO_F_DLFCN_CTRL,ERR_R_PASSED_NULL_PARAMETER);
257 return(-1);
258 }
259 switch(cmd)
260 {
261 case DSO_CTRL_GET_FLAGS:
262 return dso->flags;
263 case DSO_CTRL_SET_FLAGS:
264 dso->flags = (int)larg;
265 return(0);
266 case DSO_CTRL_OR_FLAGS:
267 dso->flags |= (int)larg;
268 return(0);
269 default:
270 break;
271 }
272 DSOerr(DSO_F_DLFCN_CTRL,DSO_R_UNKNOWN_COMMAND);
273 return(-1);
274 }
275
276#endif /* DSO_DLFCN */
diff --git a/src/lib/libcrypto/dso/dso_err.c b/src/lib/libcrypto/dso/dso_err.c
new file mode 100644
index 0000000000..a3d7321c9b
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_err.c
@@ -0,0 +1,128 @@
1/* crypto/dso/dso_err.c */
2/* ====================================================================
3 * Copyright (c) 1999 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 * This product includes cryptographic software written by Eric Young
51 * (eay@cryptsoft.com). This product includes software written by Tim
52 * Hudson (tjh@cryptsoft.com).
53 *
54 */
55
56/* NOTE: this file was auto generated by the mkerr.pl script: any changes
57 * made to it will be overwritten when the script next updates this file,
58 * only reason strings will be preserved.
59 */
60
61#include <stdio.h>
62#include <openssl/err.h>
63#include <openssl/dso.h>
64
65/* BEGIN ERROR CODES */
66#ifndef NO_ERR
67static ERR_STRING_DATA DSO_str_functs[]=
68 {
69{ERR_PACK(0,DSO_F_DLFCN_BIND_FUNC,0), "DLFCN_BIND_FUNC"},
70{ERR_PACK(0,DSO_F_DLFCN_BIND_VAR,0), "DLFCN_BIND_VAR"},
71{ERR_PACK(0,DSO_F_DLFCN_CTRL,0), "DLFCN_CTRL"},
72{ERR_PACK(0,DSO_F_DLFCN_LOAD,0), "DLFCN_LOAD"},
73{ERR_PACK(0,DSO_F_DLFCN_UNLOAD,0), "DLFCN_UNLOAD"},
74{ERR_PACK(0,DSO_F_DL_BIND_FUNC,0), "DL_BIND_FUNC"},
75{ERR_PACK(0,DSO_F_DL_BIND_VAR,0), "DL_BIND_VAR"},
76{ERR_PACK(0,DSO_F_DL_CTRL,0), "DL_CTRL"},
77{ERR_PACK(0,DSO_F_DL_LOAD,0), "DL_LOAD"},
78{ERR_PACK(0,DSO_F_DL_UNLOAD,0), "DL_UNLOAD"},
79{ERR_PACK(0,DSO_F_DSO_BIND_FUNC,0), "DSO_bind_func"},
80{ERR_PACK(0,DSO_F_DSO_BIND_VAR,0), "DSO_bind_var"},
81{ERR_PACK(0,DSO_F_DSO_CTRL,0), "DSO_ctrl"},
82{ERR_PACK(0,DSO_F_DSO_FREE,0), "DSO_free"},
83{ERR_PACK(0,DSO_F_DSO_LOAD,0), "DSO_load"},
84{ERR_PACK(0,DSO_F_DSO_NEW_METHOD,0), "DSO_new_method"},
85{ERR_PACK(0,DSO_F_DSO_UP,0), "DSO_up"},
86{ERR_PACK(0,DSO_F_VMS_BIND_VAR,0), "VMS_BIND_VAR"},
87{ERR_PACK(0,DSO_F_VMS_CTRL,0), "VMS_CTRL"},
88{ERR_PACK(0,DSO_F_VMS_LOAD,0), "VMS_LOAD"},
89{ERR_PACK(0,DSO_F_VMS_UNLOAD,0), "VMS_UNLOAD"},
90{ERR_PACK(0,DSO_F_WIN32_BIND_FUNC,0), "WIN32_BIND_FUNC"},
91{ERR_PACK(0,DSO_F_WIN32_BIND_VAR,0), "WIN32_BIND_VAR"},
92{ERR_PACK(0,DSO_F_WIN32_CTRL,0), "WIN32_CTRL"},
93{ERR_PACK(0,DSO_F_WIN32_LOAD,0), "WIN32_LOAD"},
94{ERR_PACK(0,DSO_F_WIN32_UNLOAD,0), "WIN32_UNLOAD"},
95{0,NULL}
96 };
97
98static ERR_STRING_DATA DSO_str_reasons[]=
99 {
100{DSO_R_CTRL_FAILED ,"control command failed"},
101{DSO_R_FILENAME_TOO_BIG ,"filename too big"},
102{DSO_R_FINISH_FAILED ,"cleanup method function failed"},
103{DSO_R_LOAD_FAILED ,"could not load the shared library"},
104{DSO_R_NULL_HANDLE ,"a null shared library handle was used"},
105{DSO_R_STACK_ERROR ,"the meth_data stack is corrupt"},
106{DSO_R_SYM_FAILURE ,"could not bind to the requested symbol name"},
107{DSO_R_UNKNOWN_COMMAND ,"unknown control command"},
108{DSO_R_UNLOAD_FAILED ,"could not unload the shared library"},
109{DSO_R_UNSUPPORTED ,"functionality not supported"},
110{0,NULL}
111 };
112
113#endif
114
115void ERR_load_DSO_strings(void)
116 {
117 static int init=1;
118
119 if (init)
120 {
121 init=0;
122#ifndef NO_ERR
123 ERR_load_strings(ERR_LIB_DSO,DSO_str_functs);
124 ERR_load_strings(ERR_LIB_DSO,DSO_str_reasons);
125#endif
126
127 }
128 }
diff --git a/src/lib/libcrypto/dso/dso_lib.c b/src/lib/libcrypto/dso/dso_lib.c
new file mode 100644
index 0000000000..acd166697e
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_lib.c
@@ -0,0 +1,306 @@
1/* dso_lib.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <openssl/crypto.h>
61#include "cryptlib.h"
62#include <openssl/dso.h>
63
64static DSO_METHOD *default_DSO_meth = NULL;
65
66DSO *DSO_new(void)
67 {
68 return(DSO_new_method(NULL));
69 }
70
71void DSO_set_default_method(DSO_METHOD *meth)
72 {
73 default_DSO_meth = meth;
74 }
75
76DSO_METHOD *DSO_get_default_method(void)
77 {
78 return(default_DSO_meth);
79 }
80
81DSO_METHOD *DSO_get_method(DSO *dso)
82 {
83 return(dso->meth);
84 }
85
86DSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth)
87 {
88 DSO_METHOD *mtmp;
89 mtmp = dso->meth;
90 dso->meth = meth;
91 return(mtmp);
92 }
93
94DSO *DSO_new_method(DSO_METHOD *meth)
95 {
96 DSO *ret;
97
98 if(default_DSO_meth == NULL)
99 /* We default to DSO_METH_openssl() which in turn defaults
100 * to stealing the "best available" method. Will fallback
101 * to DSO_METH_null() in the worst case. */
102 default_DSO_meth = DSO_METHOD_openssl();
103 ret = (DSO *)OPENSSL_malloc(sizeof(DSO));
104 if(ret == NULL)
105 {
106 DSOerr(DSO_F_DSO_NEW_METHOD,ERR_R_MALLOC_FAILURE);
107 return(NULL);
108 }
109 memset(ret, 0, sizeof(DSO));
110 ret->meth_data = sk_new_null();
111 if((ret->meth_data = sk_new_null()) == NULL)
112 {
113 /* sk_new doesn't generate any errors so we do */
114 DSOerr(DSO_F_DSO_NEW_METHOD,ERR_R_MALLOC_FAILURE);
115 OPENSSL_free(ret);
116 return(NULL);
117 }
118 if(meth == NULL)
119 ret->meth = default_DSO_meth;
120 else
121 ret->meth = meth;
122 ret->references = 1;
123 if((ret->meth->init != NULL) && !ret->meth->init(ret))
124 {
125 OPENSSL_free(ret);
126 ret=NULL;
127 }
128 return(ret);
129 }
130
131int DSO_free(DSO *dso)
132 {
133 int i;
134
135 if(dso == NULL)
136 {
137 DSOerr(DSO_F_DSO_FREE,ERR_R_PASSED_NULL_PARAMETER);
138 return(0);
139 }
140
141 i=CRYPTO_add(&dso->references,-1,CRYPTO_LOCK_DSO);
142#ifdef REF_PRINT
143 REF_PRINT("DSO",dso);
144#endif
145 if(i > 0) return(1);
146#ifdef REF_CHECK
147 if(i < 0)
148 {
149 fprintf(stderr,"DSO_free, bad reference count\n");
150 abort();
151 }
152#endif
153
154 if((dso->meth->dso_unload != NULL) && !dso->meth->dso_unload(dso))
155 {
156 DSOerr(DSO_F_DSO_FREE,DSO_R_UNLOAD_FAILED);
157 return(0);
158 }
159
160 if((dso->meth->finish != NULL) && !dso->meth->finish(dso))
161 {
162 DSOerr(DSO_F_DSO_FREE,DSO_R_FINISH_FAILED);
163 return(0);
164 }
165
166 sk_free(dso->meth_data);
167
168 OPENSSL_free(dso);
169 return(1);
170 }
171
172int DSO_flags(DSO *dso)
173 {
174 return((dso == NULL) ? 0 : dso->flags);
175 }
176
177
178int DSO_up(DSO *dso)
179 {
180 if (dso == NULL)
181 {
182 DSOerr(DSO_F_DSO_UP,ERR_R_PASSED_NULL_PARAMETER);
183 return(0);
184 }
185
186 CRYPTO_add(&dso->references,1,CRYPTO_LOCK_DSO);
187 return(1);
188 }
189
190DSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags)
191 {
192 DSO *ret;
193 int allocated = 0;
194
195 if(filename == NULL)
196 {
197 DSOerr(DSO_F_DSO_LOAD,ERR_R_PASSED_NULL_PARAMETER);
198 return(NULL);
199 }
200 if(dso == NULL)
201 {
202 ret = DSO_new_method(meth);
203 if(ret == NULL)
204 {
205 DSOerr(DSO_F_DSO_LOAD,ERR_R_MALLOC_FAILURE);
206 return(NULL);
207 }
208 allocated = 1;
209 }
210 else
211 ret = dso;
212 /* Bleurgh ... have to check for negative return values for
213 * errors. <grimace> */
214 if(DSO_ctrl(ret, DSO_CTRL_SET_FLAGS, flags, NULL) < 0)
215 {
216 DSOerr(DSO_F_DSO_LOAD,DSO_R_CTRL_FAILED);
217 if(allocated)
218 DSO_free(ret);
219 return(NULL);
220 }
221 if(ret->meth->dso_load == NULL)
222 {
223 DSOerr(DSO_F_DSO_LOAD,DSO_R_UNSUPPORTED);
224 if(allocated)
225 DSO_free(ret);
226 return(NULL);
227 }
228 if(!ret->meth->dso_load(ret, filename))
229 {
230 DSOerr(DSO_F_DSO_LOAD,DSO_R_LOAD_FAILED);
231 if(allocated)
232 DSO_free(ret);
233 return(NULL);
234 }
235 /* Load succeeded */
236 return(ret);
237 }
238
239void *DSO_bind_var(DSO *dso, const char *symname)
240 {
241 void *ret = NULL;
242
243 if((dso == NULL) || (symname == NULL))
244 {
245 DSOerr(DSO_F_DSO_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
246 return(NULL);
247 }
248 if(dso->meth->dso_bind_var == NULL)
249 {
250 DSOerr(DSO_F_DSO_BIND_VAR,DSO_R_UNSUPPORTED);
251 return(NULL);
252 }
253 if((ret = dso->meth->dso_bind_var(dso, symname)) == NULL)
254 {
255 DSOerr(DSO_F_DSO_BIND_VAR,DSO_R_SYM_FAILURE);
256 return(NULL);
257 }
258 /* Success */
259 return(ret);
260 }
261
262DSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname)
263 {
264 DSO_FUNC_TYPE ret = NULL;
265
266 if((dso == NULL) || (symname == NULL))
267 {
268 DSOerr(DSO_F_DSO_BIND_FUNC,ERR_R_PASSED_NULL_PARAMETER);
269 return(NULL);
270 }
271 if(dso->meth->dso_bind_func == NULL)
272 {
273 DSOerr(DSO_F_DSO_BIND_FUNC,DSO_R_UNSUPPORTED);
274 return(NULL);
275 }
276 if((ret = dso->meth->dso_bind_func(dso, symname)) == NULL)
277 {
278 DSOerr(DSO_F_DSO_BIND_FUNC,DSO_R_SYM_FAILURE);
279 return(NULL);
280 }
281 /* Success */
282 return(ret);
283 }
284
285/* I don't really like these *_ctrl functions very much to be perfectly
286 * honest. For one thing, I think I have to return a negative value for
287 * any error because possible DSO_ctrl() commands may return values
288 * such as "size"s that can legitimately be zero (making the standard
289 * "if(DSO_cmd(...))" form that works almost everywhere else fail at
290 * odd times. I'd prefer "output" values to be passed by reference and
291 * the return value as success/failure like usual ... but we conform
292 * when we must... :-) */
293long DSO_ctrl(DSO *dso, int cmd, long larg, void *parg)
294 {
295 if(dso == NULL)
296 {
297 DSOerr(DSO_F_DSO_CTRL,ERR_R_PASSED_NULL_PARAMETER);
298 return(-1);
299 }
300 if((dso->meth == NULL) || (dso->meth->dso_ctrl == NULL))
301 {
302 DSOerr(DSO_F_DSO_CTRL,DSO_R_UNSUPPORTED);
303 return(-1);
304 }
305 return(dso->meth->dso_ctrl(dso,cmd,larg,parg));
306 }
diff --git a/src/lib/libcrypto/dso/dso_null.c b/src/lib/libcrypto/dso/dso_null.c
new file mode 100644
index 0000000000..fa13a7cb0f
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_null.c
@@ -0,0 +1,86 @@
1/* dso_null.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59/* This "NULL" method is provided as the fallback for systems that have
60 * no appropriate support for "shared-libraries". */
61
62#include <stdio.h>
63#include "cryptlib.h"
64#include <openssl/dso.h>
65
66static DSO_METHOD dso_meth_null = {
67 "NULL shared library method",
68 NULL, /* load */
69 NULL, /* unload */
70 NULL, /* bind_var */
71 NULL, /* bind_func */
72/* For now, "unbind" doesn't exist */
73#if 0
74 NULL, /* unbind_var */
75 NULL, /* unbind_func */
76#endif
77 NULL, /* ctrl */
78 NULL, /* init */
79 NULL /* finish */
80 };
81
82DSO_METHOD *DSO_METHOD_null(void)
83 {
84 return(&dso_meth_null);
85 }
86
diff --git a/src/lib/libcrypto/dso/dso_openssl.c b/src/lib/libcrypto/dso/dso_openssl.c
new file mode 100644
index 0000000000..a4395ebffe
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_openssl.c
@@ -0,0 +1,81 @@
1/* dso_openssl.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/dso.h>
62
63/* We just pinch the method from an appropriate "default" method. */
64
65DSO_METHOD *DSO_METHOD_openssl(void)
66 {
67#ifdef DEF_DSO_METHOD
68 return(DEF_DSO_METHOD());
69#elif defined(DSO_DLFCN)
70 return(DSO_METHOD_dlfcn());
71#elif defined(DSO_DL)
72 return(DSO_METHOD_dl());
73#elif defined(DSO_WIN32)
74 return(DSO_METHOD_win32());
75#elif defined(DSO_VMS)
76 return(DSO_METHOD_vms());
77#else
78 return(DSO_METHOD_null());
79#endif
80 }
81
diff --git a/src/lib/libcrypto/dso/dso_vms.c b/src/lib/libcrypto/dso/dso_vms.c
new file mode 100644
index 0000000000..8ff7090129
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_vms.c
@@ -0,0 +1,371 @@
1/* dso_vms.c */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <string.h>
61#include <errno.h>
62#ifdef VMS
63#pragma message disable DOLLARID
64#include <lib$routines.h>
65#include <libfisdef.h>
66#include <stsdef.h>
67#include <descrip.h>
68#include <starlet.h>
69#endif
70#include "cryptlib.h"
71#include <openssl/dso.h>
72
73#ifndef VMS
74DSO_METHOD *DSO_METHOD_vms(void)
75 {
76 return NULL;
77 }
78#else
79#pragma message disable DOLLARID
80
81static int vms_load(DSO *dso, const char *filename);
82static int vms_unload(DSO *dso);
83static void *vms_bind_var(DSO *dso, const char *symname);
84static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname);
85#if 0
86static int vms_unbind_var(DSO *dso, char *symname, void *symptr);
87static int vms_unbind_func(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
88static int vms_init(DSO *dso);
89static int vms_finish(DSO *dso);
90#endif
91static long vms_ctrl(DSO *dso, int cmd, long larg, void *parg);
92
93static DSO_METHOD dso_meth_vms = {
94 "OpenSSL 'VMS' shared library method",
95 vms_load,
96 NULL, /* unload */
97 vms_bind_var,
98 vms_bind_func,
99/* For now, "unbind" doesn't exist */
100#if 0
101 NULL, /* unbind_var */
102 NULL, /* unbind_func */
103#endif
104 vms_ctrl,
105 NULL, /* init */
106 NULL /* finish */
107 };
108
109/* On VMS, the only "handle" is the file name. LIB$FIND_IMAGE_SYMBOL depends
110 * on the reference to the file name being the same for all calls regarding
111 * one shared image, so we'll just store it in an instance of the following
112 * structure and put a pointer to that instance in the meth_data stack.
113 */
114typedef struct dso_internal_st
115 {
116 /* This should contain the name only, no directory,
117 * no extension, nothing but a name. */
118 struct dsc$descriptor_s filename_dsc;
119 char filename[FILENAME_MAX+1];
120 /* This contains whatever is not in filename, if needed.
121 * Normally not defined. */
122 struct dsc$descriptor_s imagename_dsc;
123 char imagename[FILENAME_MAX+1];
124 } DSO_VMS_INTERNAL;
125
126
127DSO_METHOD *DSO_METHOD_vms(void)
128 {
129 return(&dso_meth_vms);
130 }
131
132static int vms_load(DSO *dso, const char *filename)
133 {
134 DSO_VMS_INTERNAL *p;
135 const char *sp1, *sp2; /* Search result */
136
137 /* A file specification may look like this:
138 *
139 * node::dev:[dir-spec]name.type;ver
140 *
141 * or (for compatibility with TOPS-20):
142 *
143 * node::dev:<dir-spec>name.type;ver
144 *
145 * and the dir-spec uses '.' as separator. Also, a dir-spec
146 * may consist of several parts, with mixed use of [] and <>:
147 *
148 * [dir1.]<dir2>
149 *
150 * We need to split the file specification into the name and
151 * the rest (both before and after the name itself).
152 */
153 /* Start with trying to find the end of a dir-spec, and save the
154 position of the byte after in sp1 */
155 sp1 = strrchr(filename, ']');
156 sp2 = strrchr(filename, '>');
157 if (sp1 == NULL) sp1 = sp2;
158 if (sp2 != NULL && sp2 > sp1) sp1 = sp2;
159 if (sp1 == NULL) sp1 = strrchr(filename, ':');
160 if (sp1 == NULL)
161 sp1 = filename;
162 else
163 sp1++; /* The byte after the found character */
164 /* Now, let's see if there's a type, and save the position in sp2 */
165 sp2 = strchr(sp1, '.');
166 /* If we found it, that's where we'll cut. Otherwise, look for a
167 version number and save the position in sp2 */
168 if (sp2 == NULL) sp2 = strchr(sp1, ';');
169 /* If there was still nothing to find, set sp2 to point at the end of
170 the string */
171 if (sp2 == NULL) sp2 = sp1 + strlen(sp1);
172
173 /* Check that we won't get buffer overflows */
174 if (sp2 - sp1 > FILENAME_MAX
175 || (sp1 - filename) + strlen(sp2) > FILENAME_MAX)
176 {
177 DSOerr(DSO_F_VMS_LOAD,DSO_R_FILENAME_TOO_BIG);
178 return(0);
179 }
180
181 p = (DSO_VMS_INTERNAL *)OPENSSL_malloc(sizeof(DSO_VMS_INTERNAL));
182 if(p == NULL)
183 {
184 DSOerr(DSO_F_VMS_LOAD,ERR_R_MALLOC_FAILURE);
185 return(0);
186 }
187
188 strncpy(p->filename, sp1, sp2-sp1);
189 p->filename[sp2-sp1] = '\0';
190
191 strncpy(p->imagename, filename, sp1-filename);
192 p->imagename[sp1-filename] = '\0';
193 strcat(p->imagename, sp2);
194
195 p->filename_dsc.dsc$w_length = strlen(p->filename);
196 p->filename_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
197 p->filename_dsc.dsc$b_class = DSC$K_CLASS_S;
198 p->filename_dsc.dsc$a_pointer = p->filename;
199 p->imagename_dsc.dsc$w_length = strlen(p->imagename);
200 p->imagename_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
201 p->imagename_dsc.dsc$b_class = DSC$K_CLASS_S;
202 p->imagename_dsc.dsc$a_pointer = p->imagename;
203
204 if(!sk_push(dso->meth_data, (char *)p))
205 {
206 DSOerr(DSO_F_VMS_LOAD,DSO_R_STACK_ERROR);
207 OPENSSL_free(p);
208 return(0);
209 }
210 return(1);
211 }
212
213/* Note that this doesn't actually unload the shared image, as there is no
214 * such thing in VMS. Next time it get loaded again, a new copy will
215 * actually be loaded.
216 */
217static int vms_unload(DSO *dso)
218 {
219 DSO_VMS_INTERNAL *p;
220 if(dso == NULL)
221 {
222 DSOerr(DSO_F_VMS_UNLOAD,ERR_R_PASSED_NULL_PARAMETER);
223 return(0);
224 }
225 if(sk_num(dso->meth_data) < 1)
226 return(1);
227 p = (DSO_VMS_INTERNAL *)sk_pop(dso->meth_data);
228 if(p == NULL)
229 {
230 DSOerr(DSO_F_VMS_UNLOAD,DSO_R_NULL_HANDLE);
231 return(0);
232 }
233 /* Cleanup */
234 OPENSSL_free(p);
235 return(1);
236 }
237
238/* We must do this in a separate function because of the way the exception
239 handler works (it makes this function return */
240static int do_find_symbol(DSO_VMS_INTERNAL *ptr,
241 struct dsc$descriptor_s *symname_dsc, void **sym,
242 unsigned long flags)
243 {
244 /* Make sure that signals are caught and returned instead of
245 aborting the program. The exception handler gets unestablished
246 automatically on return from this function. */
247 lib$establish(lib$sig_to_ret);
248
249 if(ptr->imagename_dsc.dsc$w_length)
250 return lib$find_image_symbol(&ptr->filename_dsc,
251 symname_dsc, sym,
252 &ptr->imagename_dsc, flags);
253 else
254 return lib$find_image_symbol(&ptr->filename_dsc,
255 symname_dsc, sym,
256 0, flags);
257 }
258
259void vms_bind_sym(DSO *dso, const char *symname, void **sym)
260 {
261 DSO_VMS_INTERNAL *ptr;
262 int status;
263 int flags = LIB$M_FIS_MIXEDCASE;
264 struct dsc$descriptor_s symname_dsc;
265 *sym = NULL;
266
267 symname_dsc.dsc$w_length = strlen(symname);
268 symname_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
269 symname_dsc.dsc$b_class = DSC$K_CLASS_S;
270 symname_dsc.dsc$a_pointer = (char *)symname; /* The cast is needed */
271
272 if((dso == NULL) || (symname == NULL))
273 {
274 DSOerr(DSO_F_VMS_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
275 return;
276 }
277 if(sk_num(dso->meth_data) < 1)
278 {
279 DSOerr(DSO_F_VMS_BIND_VAR,DSO_R_STACK_ERROR);
280 return;
281 }
282 ptr = (DSO_VMS_INTERNAL *)sk_value(dso->meth_data,
283 sk_num(dso->meth_data) - 1);
284 if(ptr == NULL)
285 {
286 DSOerr(DSO_F_VMS_BIND_VAR,DSO_R_NULL_HANDLE);
287 return;
288 }
289
290 if(dso->flags & DSO_FLAG_UPCASE_SYMBOL) flags = 0;
291
292 status = do_find_symbol(ptr, &symname_dsc, sym, flags);
293
294 if(!$VMS_STATUS_SUCCESS(status))
295 {
296 unsigned short length;
297 char errstring[257];
298 struct dsc$descriptor_s errstring_dsc;
299
300 errstring_dsc.dsc$w_length = sizeof(errstring);
301 errstring_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
302 errstring_dsc.dsc$b_class = DSC$K_CLASS_S;
303 errstring_dsc.dsc$a_pointer = errstring;
304
305 *sym = NULL;
306
307 status = sys$getmsg(status, &length, &errstring_dsc, 1, 0);
308
309 if (!$VMS_STATUS_SUCCESS(status))
310 lib$signal(status); /* This is really bad. Abort! */
311 else
312 {
313 errstring[length] = '\0';
314
315 DSOerr(DSO_F_VMS_BIND_VAR,DSO_R_SYM_FAILURE);
316 if (ptr->imagename_dsc.dsc$w_length)
317 ERR_add_error_data(9,
318 "Symbol ", symname,
319 " in ", ptr->filename,
320 " (", ptr->imagename, ")",
321 ": ", errstring);
322 else
323 ERR_add_error_data(6,
324 "Symbol ", symname,
325 " in ", ptr->filename,
326 ": ", errstring);
327 }
328 return;
329 }
330 return;
331 }
332
333static void *vms_bind_var(DSO *dso, const char *symname)
334 {
335 void *sym = 0;
336 vms_bind_sym(dso, symname, &sym);
337 return sym;
338 }
339
340static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname)
341 {
342 DSO_FUNC_TYPE sym = 0;
343 vms_bind_sym(dso, symname, (void **)&sym);
344 return sym;
345 }
346
347static long vms_ctrl(DSO *dso, int cmd, long larg, void *parg)
348 {
349 if(dso == NULL)
350 {
351 DSOerr(DSO_F_VMS_CTRL,ERR_R_PASSED_NULL_PARAMETER);
352 return(-1);
353 }
354 switch(cmd)
355 {
356 case DSO_CTRL_GET_FLAGS:
357 return dso->flags;
358 case DSO_CTRL_SET_FLAGS:
359 dso->flags = (int)larg;
360 return(0);
361 case DSO_CTRL_OR_FLAGS:
362 dso->flags |= (int)larg;
363 return(0);
364 default:
365 break;
366 }
367 DSOerr(DSO_F_VMS_CTRL,DSO_R_UNKNOWN_COMMAND);
368 return(-1);
369 }
370
371#endif /* VMS */
diff --git a/src/lib/libcrypto/dso/dso_win32.c b/src/lib/libcrypto/dso/dso_win32.c
new file mode 100644
index 0000000000..7f1d904806
--- /dev/null
+++ b/src/lib/libcrypto/dso/dso_win32.c
@@ -0,0 +1,273 @@
1/* dso_win32.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 2000 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <string.h>
61#include "cryptlib.h"
62#include <openssl/dso.h>
63
64#ifndef WIN32
65DSO_METHOD *DSO_METHOD_win32(void)
66 {
67 return NULL;
68 }
69#else
70
71/* Part of the hack in "win32_load" ... */
72#define DSO_MAX_TRANSLATED_SIZE 256
73
74static int win32_load(DSO *dso, const char *filename);
75static int win32_unload(DSO *dso);
76static void *win32_bind_var(DSO *dso, const char *symname);
77static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname);
78#if 0
79static int win32_unbind_var(DSO *dso, char *symname, void *symptr);
80static int win32_unbind_func(DSO *dso, char *symname, DSO_FUNC_TYPE symptr);
81static int win32_init(DSO *dso);
82static int win32_finish(DSO *dso);
83#endif
84static long win32_ctrl(DSO *dso, int cmd, long larg, void *parg);
85
86static DSO_METHOD dso_meth_win32 = {
87 "OpenSSL 'win32' shared library method",
88 win32_load,
89 win32_unload,
90 win32_bind_var,
91 win32_bind_func,
92/* For now, "unbind" doesn't exist */
93#if 0
94 NULL, /* unbind_var */
95 NULL, /* unbind_func */
96#endif
97 win32_ctrl,
98 NULL, /* init */
99 NULL /* finish */
100 };
101
102DSO_METHOD *DSO_METHOD_win32(void)
103 {
104 return(&dso_meth_win32);
105 }
106
107/* For this DSO_METHOD, our meth_data STACK will contain;
108 * (i) a pointer to the handle (HINSTANCE) returned from
109 * LoadLibrary(), and copied.
110 */
111
112static int win32_load(DSO *dso, const char *filename)
113 {
114 HINSTANCE h, *p;
115 char translated[DSO_MAX_TRANSLATED_SIZE];
116 int len;
117
118 /* NB: This is a hideous hack, but I'm not yet sure what
119 * to replace it with. This attempts to convert any filename,
120 * that looks like it has no path information, into a
121 * translated form, e. "blah" -> "blah.dll" ... I'm more
122 * comfortable putting hacks into win32 code though ;-) */
123 len = strlen(filename);
124 if((dso->flags & DSO_FLAG_NAME_TRANSLATION) &&
125 (len + 4 < DSO_MAX_TRANSLATED_SIZE) &&
126 (strstr(filename, "/") == NULL) &&
127 (strstr(filename, "\\") == NULL) &&
128 (strstr(filename, ":") == NULL))
129 {
130 sprintf(translated, "%s.dll", filename);
131 h = LoadLibrary(translated);
132 }
133 else
134 h = LoadLibrary(filename);
135 if(h == NULL)
136 {
137 DSOerr(DSO_F_WIN32_LOAD,DSO_R_LOAD_FAILED);
138 return(0);
139 }
140 p = (HINSTANCE *)OPENSSL_malloc(sizeof(HINSTANCE));
141 if(p == NULL)
142 {
143 DSOerr(DSO_F_WIN32_LOAD,ERR_R_MALLOC_FAILURE);
144 FreeLibrary(h);
145 return(0);
146 }
147 *p = h;
148 if(!sk_push(dso->meth_data, (char *)p))
149 {
150 DSOerr(DSO_F_WIN32_LOAD,DSO_R_STACK_ERROR);
151 FreeLibrary(h);
152 OPENSSL_free(p);
153 return(0);
154 }
155 return(1);
156 }
157
158static int win32_unload(DSO *dso)
159 {
160 HINSTANCE *p;
161 if(dso == NULL)
162 {
163 DSOerr(DSO_F_WIN32_UNLOAD,ERR_R_PASSED_NULL_PARAMETER);
164 return(0);
165 }
166 if(sk_num(dso->meth_data) < 1)
167 return(1);
168 p = (HINSTANCE *)sk_pop(dso->meth_data);
169 if(p == NULL)
170 {
171 DSOerr(DSO_F_WIN32_UNLOAD,DSO_R_NULL_HANDLE);
172 return(0);
173 }
174 if(!FreeLibrary(*p))
175 {
176 DSOerr(DSO_F_WIN32_UNLOAD,DSO_R_UNLOAD_FAILED);
177 /* We should push the value back onto the stack in
178 * case of a retry. */
179 sk_push(dso->meth_data, (char *)p);
180 return(0);
181 }
182 /* Cleanup */
183 OPENSSL_free(p);
184 return(1);
185 }
186
187/* Using GetProcAddress for variables? TODO: Check this out in
188 * the Win32 API docs, there's probably a variant for variables. */
189static void *win32_bind_var(DSO *dso, const char *symname)
190 {
191 HINSTANCE *ptr;
192 void *sym;
193
194 if((dso == NULL) || (symname == NULL))
195 {
196 DSOerr(DSO_F_WIN32_BIND_VAR,ERR_R_PASSED_NULL_PARAMETER);
197 return(NULL);
198 }
199 if(sk_num(dso->meth_data) < 1)
200 {
201 DSOerr(DSO_F_WIN32_BIND_VAR,DSO_R_STACK_ERROR);
202 return(NULL);
203 }
204 ptr = (HINSTANCE *)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
205 if(ptr == NULL)
206 {
207 DSOerr(DSO_F_WIN32_BIND_VAR,DSO_R_NULL_HANDLE);
208 return(NULL);
209 }
210 sym = GetProcAddress(*ptr, symname);
211 if(sym == NULL)
212 {
213 DSOerr(DSO_F_WIN32_BIND_VAR,DSO_R_SYM_FAILURE);
214 return(NULL);
215 }
216 return(sym);
217 }
218
219static DSO_FUNC_TYPE win32_bind_func(DSO *dso, const char *symname)
220 {
221 HINSTANCE *ptr;
222 void *sym;
223
224 if((dso == NULL) || (symname == NULL))
225 {
226 DSOerr(DSO_F_WIN32_BIND_FUNC,ERR_R_PASSED_NULL_PARAMETER);
227 return(NULL);
228 }
229 if(sk_num(dso->meth_data) < 1)
230 {
231 DSOerr(DSO_F_WIN32_BIND_FUNC,DSO_R_STACK_ERROR);
232 return(NULL);
233 }
234 ptr = (HINSTANCE *)sk_value(dso->meth_data, sk_num(dso->meth_data) - 1);
235 if(ptr == NULL)
236 {
237 DSOerr(DSO_F_WIN32_BIND_FUNC,DSO_R_NULL_HANDLE);
238 return(NULL);
239 }
240 sym = GetProcAddress(*ptr, symname);
241 if(sym == NULL)
242 {
243 DSOerr(DSO_F_WIN32_BIND_FUNC,DSO_R_SYM_FAILURE);
244 return(NULL);
245 }
246 return((DSO_FUNC_TYPE)sym);
247 }
248
249static long win32_ctrl(DSO *dso, int cmd, long larg, void *parg)
250 {
251 if(dso == NULL)
252 {
253 DSOerr(DSO_F_WIN32_CTRL,ERR_R_PASSED_NULL_PARAMETER);
254 return(-1);
255 }
256 switch(cmd)
257 {
258 case DSO_CTRL_GET_FLAGS:
259 return dso->flags;
260 case DSO_CTRL_SET_FLAGS:
261 dso->flags = (int)larg;
262 return(0);
263 case DSO_CTRL_OR_FLAGS:
264 dso->flags |= (int)larg;
265 return(0);
266 default:
267 break;
268 }
269 DSOerr(DSO_F_WIN32_CTRL,DSO_R_UNKNOWN_COMMAND);
270 return(-1);
271 }
272
273#endif /* WIN32 */
diff --git a/src/lib/libcrypto/engine/Makefile.ssl b/src/lib/libcrypto/engine/Makefile.ssl
new file mode 100644
index 0000000000..7a0ffe755d
--- /dev/null
+++ b/src/lib/libcrypto/engine/Makefile.ssl
@@ -0,0 +1,220 @@
1#
2# OpenSSL/crypto/engine/Makefile
3#
4
5DIR= engine
6TOP= ../..
7CC= cc
8INCLUDES= -I.. -I../../include
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR= /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKE= make -f Makefile.ssl
14MAKEDEPEND= $(TOP)/util/domd $(TOP)
15MAKEFILE= Makefile.ssl
16AR= ar r
17
18CFLAGS= $(INCLUDES) $(CFLAG)
19
20GENERAL=Makefile
21TEST= enginetest.c
22APPS=
23
24LIB=$(TOP)/libcrypto.a
25LIBSRC= engine_err.c engine_lib.c engine_list.c engine_openssl.c \
26 hw_atalla.c hw_cswift.c hw_ncipher.c
27LIBOBJ= engine_err.o engine_lib.o engine_list.o engine_openssl.o \
28 hw_atalla.o hw_cswift.o hw_ncipher.o
29
30SRC= $(LIBSRC)
31
32EXHEADER= engine.h
33HEADER= $(EXHEADER)
34
35ALL= $(GENERAL) $(SRC) $(HEADER)
36
37top:
38 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
39
40all: lib
41
42lib: $(LIBOBJ)
43 $(AR) $(LIB) $(LIBOBJ)
44 $(RANLIB) $(LIB)
45 @touch lib
46
47files:
48 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
49
50links:
51 @$(TOP)/util/point.sh Makefile.ssl Makefile
52 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
53 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
54 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
55
56install:
57 @for i in $(EXHEADER) ; \
58 do \
59 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
60 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
61 done;
62
63tags:
64 ctags $(SRC)
65
66tests:
67
68lint:
69 lint -DLINT $(INCLUDES) $(SRC)>fluff
70
71depend:
72 $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
73
74dclean:
75 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
76 mv -f Makefile.new $(MAKEFILE)
77
78clean:
79 rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
80
81# DO NOT DELETE THIS LINE -- make depend depends on it.
82
83engine_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
84engine_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
85engine_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
86engine_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h
87engine_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
88engine_err.o: ../../include/openssl/engine.h ../../include/openssl/err.h
89engine_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
90engine_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
91engine_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
92engine_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
93engine_err.o: ../../include/openssl/objects.h
94engine_err.o: ../../include/openssl/opensslconf.h
95engine_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
96engine_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
97engine_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
98engine_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
99engine_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
100engine_err.o: ../../include/openssl/symhacks.h
101engine_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
102engine_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
103engine_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
104engine_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
105engine_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
106engine_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
107engine_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
108engine_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
109engine_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
110engine_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
111engine_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
112engine_lib.o: ../../include/openssl/objects.h
113engine_lib.o: ../../include/openssl/opensslconf.h
114engine_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
115engine_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
116engine_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
117engine_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
118engine_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
119engine_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
120engine_list.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
121engine_list.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
122engine_list.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
123engine_list.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
124engine_list.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
125engine_list.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
126engine_list.o: ../../include/openssl/engine.h ../../include/openssl/err.h
127engine_list.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
128engine_list.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
129engine_list.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
130engine_list.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
131engine_list.o: ../../include/openssl/objects.h
132engine_list.o: ../../include/openssl/opensslconf.h
133engine_list.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
134engine_list.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
135engine_list.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
136engine_list.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
137engine_list.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
138engine_list.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
139engine_openssl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
140engine_openssl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
141engine_openssl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
142engine_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
143engine_openssl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
144engine_openssl.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
145engine_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
146engine_openssl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
147engine_openssl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
148engine_openssl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
149engine_openssl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
150engine_openssl.o: ../../include/openssl/obj_mac.h
151engine_openssl.o: ../../include/openssl/objects.h
152engine_openssl.o: ../../include/openssl/opensslconf.h
153engine_openssl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
154engine_openssl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
155engine_openssl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
156engine_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
157engine_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
158engine_openssl.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
159hw_atalla.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
160hw_atalla.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
161hw_atalla.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
162hw_atalla.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
163hw_atalla.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
164hw_atalla.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
165hw_atalla.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
166hw_atalla.o: ../../include/openssl/err.h ../../include/openssl/evp.h
167hw_atalla.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
168hw_atalla.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
169hw_atalla.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
170hw_atalla.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
171hw_atalla.o: ../../include/openssl/opensslconf.h
172hw_atalla.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
173hw_atalla.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
174hw_atalla.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
175hw_atalla.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
176hw_atalla.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
177hw_atalla.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
178hw_atalla.o: vendor_defns/atalla.h
179hw_cswift.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
180hw_cswift.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
181hw_cswift.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
182hw_cswift.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
183hw_cswift.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
184hw_cswift.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
185hw_cswift.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
186hw_cswift.o: ../../include/openssl/err.h ../../include/openssl/evp.h
187hw_cswift.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
188hw_cswift.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
189hw_cswift.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
190hw_cswift.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
191hw_cswift.o: ../../include/openssl/opensslconf.h
192hw_cswift.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
193hw_cswift.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
194hw_cswift.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
195hw_cswift.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
196hw_cswift.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
197hw_cswift.o: ../../include/openssl/symhacks.h ../cryptlib.h engine_int.h
198hw_cswift.o: vendor_defns/cswift.h
199hw_ncipher.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
200hw_ncipher.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
201hw_ncipher.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
202hw_ncipher.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
203hw_ncipher.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
204hw_ncipher.o: ../../include/openssl/dso.h ../../include/openssl/e_os.h
205hw_ncipher.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h
206hw_ncipher.o: ../../include/openssl/err.h ../../include/openssl/evp.h
207hw_ncipher.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
208hw_ncipher.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
209hw_ncipher.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
210hw_ncipher.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
211hw_ncipher.o: ../../include/openssl/opensslconf.h
212hw_ncipher.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
213hw_ncipher.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
214hw_ncipher.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
215hw_ncipher.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
216hw_ncipher.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
217hw_ncipher.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
218hw_ncipher.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
219hw_ncipher.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
220hw_ncipher.o: ../cryptlib.h engine_int.h vendor_defns/hwcryptohook.h
diff --git a/src/lib/libcrypto/engine/README b/src/lib/libcrypto/engine/README
new file mode 100644
index 0000000000..96595e6f35
--- /dev/null
+++ b/src/lib/libcrypto/engine/README
@@ -0,0 +1,278 @@
1NOTES, THOUGHTS, and EVERYTHING
2-------------------------------
3
4(1) Concurrency and locking ... I made a change to the ENGINE_free code
5 because I spotted a potential hold-up in proceedings (doing too
6 much inside a lock including calling a callback), there may be
7 other bits like this. What do the speed/optimisation freaks think
8 of this aspect of the code and design? There's lots of locking for
9 manipulation functions and I need that to keep things nice and
10 solid, but this manipulation is mostly (de)initialisation, I would
11 think that most run-time locking is purely in the ENGINE_init and
12 ENGINE_finish calls that might be made when getting handles for
13 RSA (and friends') structures. These would be mostly reference
14 count operations as the functional references should always be 1
15 or greater at run-time to prevent init/deinit thrashing.
16
17(2) nCipher support, via the HWCryptoHook API, is now in the code.
18 Apparently this hasn't been tested too much yet, but it looks
19 good. :-) Atalla support has been added too, but shares a lot in
20 common with Ben's original hooks in bn_exp.c (although it has been
21 ENGINE-ified, and error handling wrapped around it) and it's also
22 had some low-volume testing, so it should be usable.
23
24(3) Of more concern, we need to work out (a) how to put together usable
25 RAND_METHODs for units that just have one "get n or less random
26 bytes" function, (b) we also need to determine how to hook the code
27 in crypto/rand/ to use the ENGINE defaults in a way similar to what
28 has been done in crypto/rsa/, crypto/dsa/, etc.
29
30(4) ENGINE should really grow to encompass more than 3 public key
31 algorithms and randomness gathering. The structure/data level of
32 the engine code is hidden from code outside the crypto/engine/
33 directory so change shouldn't be too viral. More important though
34 is how things should evolve ... this needs thought and discussion.
35
36
37-----------------------------------==*==-----------------------------------
38
39More notes 2000-08-01
40---------------------
41
42Geoff Thorpe, who designed the engine part, wrote a pretty good description
43of the thoughts he had when he built it, good enough to include verbatim here
44(with his permission) -- Richard Levitte
45
46
47Date: Tue, 1 Aug 2000 16:54:08 +0100 (BST)
48From: Geoff Thorpe
49Subject: Re: The thoughts to merge BRANCH_engine into the main trunk are
50 emerging
51
52Hi there,
53
54I'm going to try and do some justice to this, but I'm a little short on
55time and the there is an endless amount that could be discussed on this
56subject. sigh ... please bear with me :-)
57
58> The changes in BRANCH_engine dig deep into the core of OpenSSL, for example
59> into the RSA and RAND routines, adding a level of indirection which is needed
60> to keep the abstraction, as far as I understand. It would be a good thing if
61> those who do play with those things took a look at the changes that have been
62> done in the branch and say out loud how much (or hopefully little) we've made
63> fools of ourselves.
64
65The point here is that the code that has emerged in the BRANCH_engine
66branch was based on some initial requirements of mine that I went in and
67addressed, and Richard has picked up the ball and run with it too. It
68would be really useful to get some review of the approach we've taken, but
69first I think I need to describe as best I can the reasons behind what has
70been done so far, in particular what issues we have tried to address when
71doing this, and what issues we have intentionally (or necessarily) tried
72to avoid.
73
74methods, engines, and evps
75--------------------------
76
77There has been some dicussion, particularly with Steve, about where this
78ENGINE stuff might fit into the conceptual picture as/when we start to
79abstract algorithms a little bit to make the library more extensible. In
80particular, it would desirable to have algorithms (symmetric, hash, pkc,
81etc) abstracted in some way that allows them to be just objects sitting in
82a list (or database) ... it'll just happen that the "DSA" object doesn't
83support encryption whereas the "RSA" object does. This requires a lot of
84consideration to begin to know how to tackle it; in particular how
85encapsulated should these things be? If the objects also understand their
86own ASN1 encodings and what-not, then it would for example be possible to
87add support for elliptic-curve DSA in as a new algorithm and automatically
88have ECC-DSA certificates supported in SSL applications. Possible, but not
89easy. :-)
90
91Whatever, it seems that the way to go (if I've grok'd Steve's comments on
92this in the past) is to amalgamate these things in EVP as is already done
93(I think) for ciphers or hashes (Steve, please correct/elaborate). I
94certainly think something should be done in this direction because right
95now we have different source directories, types, functions, and methods
96for each algorithm - even when conceptually they are very much different
97feathers of the same bird. (This is certainly all true for the public-key
98stuff, and may be partially true for the other parts.)
99
100ENGINE was *not* conceived as a way of solving this, far from it. Nor was
101it conceived as a way of replacing the various "***_METHOD"s. It was
102conceived as an abstraction of a sort of "virtual crypto device". If we
103lived in a world where "EVP_ALGO"s (or something like them) encapsulated
104particular algorithms like RSA,DSA,MD5,RC4,etc, and "***_METHOD"s
105encapsulated interfaces to algorithms (eg. some algo's might support a
106PKC_METHOD, a HASH_METHOD, or a CIPHER_METHOD, who knows?), then I would
107think that ENGINE would encapsulate an implementation of arbitrarily many
108of those algorithms - perhaps as alternatives to existing algorithms
109and/or perhaps as new previously unimplemented algorithms. An ENGINE could
110be used to contain an alternative software implementation, a wrapper for a
111hardware acceleration and/or key-management unit, a comms-wrapper for
112distributing cryptographic operations to remote machines, or any other
113"devices" your imagination can dream up.
114
115However, what has been done in the ENGINE branch so far is nothing more
116than starting to get our toes wet. I had a couple of self-imposed
117requirements when putting the initial abstraction together, and I may have
118already posed these in one form or another on the list, but briefly;
119
120 (i) only bother with public key algorithms for now, and maybe RAND too
121 (motivated by the need to get hardware support going and the fact
122 this was a comparitively easy subset to address to begin with).
123
124 (ii) don't change (if at all possible) the existing crypto code, ie. the
125 implementations, the way the ***_METHODs work, etc.
126
127 (iii) ensure that if no function from the ENGINE code is ever called then
128 things work the way they always did, and there is no memory
129 allocation (otherwise the failure to cleanup would be a problem -
130 this is part of the reason no STACKs were used, the other part of
131 the reason being I found them inappropriate).
132
133 (iv) ensure that all the built-in crypto was encapsulated by one of
134 these "ENGINE"s and that this engine was automatically selected as
135 the default.
136
137 (v) provide the minimum hooking possible in the existing crypto code
138 so that global functions (eg. RSA_public_encrypt) do not need any
139 extra parameter, yet will use whatever the current default ENGINE
140 for that RSA key is, and that the default can be set "per-key"
141 and globally (new keys will assume the global default, and keys
142 without their own default will be operated on using the global
143 default). NB: Try and make (v) conflict as little as possible with
144 (ii). :-)
145
146 (vi) wrap the ENGINE code up in duct tape so you can't even see the
147 corners. Ie. expose no structures at all, just black-box pointers.
148
149 (v) maintain internally a list of ENGINEs on which a calling
150 application can iterate, interrogate, etc. Allow a calling
151 application to hook in new ENGINEs, remove ENGINEs from the list,
152 and enforce uniqueness within the global list of each ENGINE's
153 "unique id".
154
155 (vi) keep reference counts for everything - eg. this includes storing a
156 reference inside each RSA structure to the ENGINE that it uses.
157 This is freed when the RSA structure is destroyed, or has its
158 ENGINE explicitly changed. The net effect needs to be that at any
159 time, it is deterministic to know whether an ENGINE is in use or
160 can be safely removed (or unloaded in the case of the other type
161 of reference) without invalidating function pointers that may or
162 may not be used indavertently in the future. This was actually
163 one of the biggest problems to overcome in the existing OpenSSL
164 code - implementations had always been assumed to be ever-present,
165 so there was no trivial way to get round this.
166
167 (vii) distinguish between structural references and functional
168 references.
169
170A *little* detail
171-----------------
172
173While my mind is on it; I'll illustrate the bit in item (vii). This idea
174turned out to be very handy - the ENGINEs themselves need to be operated
175on and manipulated simply as objects without necessarily trying to
176"enable" them for use. Eg. most host machines will not have the necessary
177hardware or software to support all the engines one might compile into
178OpenSSL, yet it needs to be possible to iterate across the ENGINEs,
179querying their names, properties, etc - all happening in a thread-safe
180manner that uses reference counts (if you imagine two threads iterating
181through a list and one thread removing the ENGINE the other is currently
182looking at - you can see the gotcha waiting to happen). For all of this,
183*structural references* are used and operate much like the other reference
184counts in OpenSSL.
185
186The other kind of reference count is for *functional* references - these
187indicate a reference on which the caller can actually assume the
188particular ENGINE to be initialised and usable to perform the operations
189it implements. Any increment or decrement of the functional reference
190count automatically invokes a corresponding change in the structural
191reference count, as it is fairly obvious that a functional reference is a
192restricted case of a structural reference. So struct_ref >= funct_ref at
193all times. NB: functional references are usually obtained by a call to
194ENGINE_init(), but can also be created implicitly by calls that require a
195new functional reference to be created, eg. ENGINE_set_default(). Either
196way the only time the underlying ENGINE's "init" function is really called
197is when the (functional) reference count increases to 1, similarly the
198underlying "finish" handler is only called as the count goes down to 0.
199The effect of this, for example, is that if you set the default ENGINE for
200RSA operations to be "cswift", then its functional reference count will
201already be at least 1 so the CryptoSwift shared-library and the card will
202stay loaded and initialised until such time as all RSA keys using the
203cswift ENGINE are changed or destroyed and the default ENGINE for RSA
204operations has been changed. This prevents repeated thrashing of init and
205finish handling if the count keeps getting down as far as zero.
206
207Otherwise, the way the ENGINE code has been put together I think pretty
208much reflects the above points. The reason for the ENGINE structure having
209individual RSA_METHOD, DSA_METHOD, etc pointers is simply that it was the
210easiest way to go about things for now, to hook it all into the raw
211RSA,DSA,etc code, and I was trying to the keep the structure invisible
212anyway so that the way this is internally managed could be easily changed
213later on when we start to work out what's to be done about these other
214abstractions.
215
216Down the line, if some EVP-based technique emerges for adequately
217encapsulating algorithms and all their various bits and pieces, then I can
218imagine that "ENGINE" would turn into a reference-counting database of
219these EVP things, of which the default "openssl" ENGINE would be the
220library's own object database of pre-built software implemented algorithms
221(and such). It would also be cool to see the idea of "METHOD"s detached
222from the algorithms themselves ... so RSA, DSA, ElGamal, etc can all
223expose essentially the same METHOD (aka interface), which would include
224any querying/flagging stuff to identify what the algorithm can/can't do,
225its name, and other stuff like max/min block sizes, key sizes, etc. This
226would result in ENGINE similarly detaching its internal database of
227algorithm implementations from the function definitions that return
228interfaces to them. I think ...
229
230As for DSOs etc. Well the DSO code is pretty handy (but could be made much
231more so) for loading vendor's driver-libraries and talking to them in some
232generic way, but right now there's still big problems associated with
233actually putting OpenSSL code (ie. new ENGINEs, or anything else for that
234matter) in dynamically loadable libraries. These problems won't go away in
235a hurry so I don't think we should expect to have any kind of
236shared-library extensions any time soon - but solving the problems is a
237good thing to aim for, and would as a side-effect probably help make
238OpenSSL more usable as a shared-library itself (looking at the things
239needed to do this will show you why).
240
241One of the problems is that if you look at any of the ENGINE
242implementations, eg. hw_cswift.c or hw_ncipher.c, you'll see how it needs
243a variety of functionality and definitions from various areas of OpenSSL,
244including crypto/bn/, crypto/err/, crypto/ itself (locking for example),
245crypto/dso/, crypto/engine/, crypto/rsa, etc etc etc. So if similar code
246were to be suctioned off into shared libraries, the shared libraries would
247either have to duplicate all the definitions and code and avoid loader
248conflicts, or OpenSSL would have to somehow expose all that functionality
249to the shared-library. If this isn't a big enough problem, the issue of
250binary compatibility will be - anyone writing Apache modules can tell you
251that (Ralf? Ben? :-). However, I don't think OpenSSL would need to be
252quite so forgiving as Apache should be, so OpenSSL could simply tell its
253version to the DSO and leave the DSO with the problem of deciding whether
254to proceed or bail out for fear of binary incompatibilities.
255
256Certainly one thing that would go a long way to addressing this is to
257embark on a bit of an opaqueness mission. I've set the ENGINE code up with
258this in mind - it's so draconian that even to declare your own ENGINE, you
259have to get the engine code to create the underlying ENGINE structure, and
260then feed in the new ENGINE's function/method pointers through various
261"set" functions. The more of the code that takes on such a black-box
262approach, the more of the code that will be (a) easy to expose to shared
263libraries that need it, and (b) easy to expose to applications wanting to
264use OpenSSL itself as a shared-library. From my own explorations in
265OpenSSL, the biggest leviathan I've seen that is a problem in this respect
266is the BIGNUM code. Trying to "expose" the bignum code through any kind of
267organised "METHODs", let alone do all the necessary bignum operations
268solely through functions rather than direct access to the structures and
269macros, will be a massive pain in the "r"s.
270
271Anyway, I'm done for now - hope it was readable. Thoughts?
272
273Cheers,
274Geoff
275
276
277-----------------------------------==*==-----------------------------------
278
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h
new file mode 100644
index 0000000000..2983f47034
--- /dev/null
+++ b/src/lib/libcrypto/engine/engine.h
@@ -0,0 +1,398 @@
1/* openssl/engine.h */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#ifndef HEADER_ENGINE_H
60#define HEADER_ENGINE_H
61
62#include <openssl/bn.h>
63#include <openssl/rsa.h>
64#include <openssl/dsa.h>
65#include <openssl/dh.h>
66#include <openssl/rand.h>
67#include <openssl/evp.h>
68#include <openssl/symhacks.h>
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74/* These flags are used to control combinations of algorithm (methods)
75 * by bitwise "OR"ing. */
76#define ENGINE_METHOD_RSA (unsigned int)0x0001
77#define ENGINE_METHOD_DSA (unsigned int)0x0002
78#define ENGINE_METHOD_DH (unsigned int)0x0004
79#define ENGINE_METHOD_RAND (unsigned int)0x0008
80#define ENGINE_METHOD_BN_MOD_EXP (unsigned int)0x0010
81#define ENGINE_METHOD_BN_MOD_EXP_CRT (unsigned int)0x0020
82/* Obvious all-or-nothing cases. */
83#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
84#define ENGINE_METHOD_NONE (unsigned int)0x0000
85
86/* These flags are used to tell the ctrl function what should be done.
87 * All command numbers are shared between all engines, even if some don't
88 * make sense to some engines. In such a case, they do nothing but return
89 * the error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED. */
90#define ENGINE_CTRL_SET_LOGSTREAM 1
91#define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
92/* Flags specific to the nCipher "chil" engine */
93#define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
94 /* Depending on the value of the (long)i argument, this sets or
95 * unsets the SimpleForkCheck flag in the CHIL API to enable or
96 * disable checking and workarounds for applications that fork().
97 */
98#define ENGINE_CTRL_CHIL_NO_LOCKING 101
99 /* This prevents the initialisation function from providing mutex
100 * callbacks to the nCipher library. */
101
102/* As we're missing a BIGNUM_METHOD, we need a couple of locally
103 * defined function types that engines can implement. */
104
105#ifndef HEADER_ENGINE_INT_H
106/* mod_exp operation, calculates; r = a ^ p mod m
107 * NB: ctx can be NULL, but if supplied, the implementation may use
108 * it if it wishes. */
109typedef int (*BN_MOD_EXP)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
110 const BIGNUM *m, BN_CTX *ctx);
111
112/* private key operation for RSA, provided seperately in case other
113 * RSA implementations wish to use it. */
114typedef int (*BN_MOD_EXP_CRT)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
115 const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
116 const BIGNUM *iqmp, BN_CTX *ctx);
117
118/* Generic function pointer */
119typedef void (*ENGINE_GEN_FUNC_PTR)();
120/* Generic function pointer taking no arguments */
121typedef void (*ENGINE_GEN_INT_FUNC_PTR)(void);
122/* Specific control function pointer */
123typedef int (*ENGINE_CTRL_FUNC_PTR)(int cmd, long i, void *p, void (*f)());
124
125/* The list of "engine" types is a static array of (const ENGINE*)
126 * pointers (not dynamic because static is fine for now and we otherwise
127 * have to hook an appropriate load/unload function in to initialise and
128 * cleanup). */
129typedef struct engine_st ENGINE;
130#endif
131
132/* STRUCTURE functions ... all of these functions deal with pointers to
133 * ENGINE structures where the pointers have a "structural reference".
134 * This means that their reference is to allow access to the structure
135 * but it does not imply that the structure is functional. To simply
136 * increment or decrement the structural reference count, use ENGINE_new
137 * and ENGINE_free. NB: This is not required when iterating using
138 * ENGINE_get_next as it will automatically decrement the structural
139 * reference count of the "current" ENGINE and increment the structural
140 * reference count of the ENGINE it returns (unless it is NULL). */
141
142/* Get the first/last "ENGINE" type available. */
143ENGINE *ENGINE_get_first(void);
144ENGINE *ENGINE_get_last(void);
145/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
146ENGINE *ENGINE_get_next(ENGINE *e);
147ENGINE *ENGINE_get_prev(ENGINE *e);
148/* Add another "ENGINE" type into the array. */
149int ENGINE_add(ENGINE *e);
150/* Remove an existing "ENGINE" type from the array. */
151int ENGINE_remove(ENGINE *e);
152/* Retrieve an engine from the list by its unique "id" value. */
153ENGINE *ENGINE_by_id(const char *id);
154
155/* These functions are useful for manufacturing new ENGINE
156 * structures. They don't address reference counting at all -
157 * one uses them to populate an ENGINE structure with personalised
158 * implementations of things prior to using it directly or adding
159 * it to the builtin ENGINE list in OpenSSL. These are also here
160 * so that the ENGINE structure doesn't have to be exposed and
161 * break binary compatibility!
162 *
163 * NB: I'm changing ENGINE_new to force the ENGINE structure to
164 * be allocated from within OpenSSL. See the comment for
165 * ENGINE_get_struct_size().
166 */
167#if 0
168ENGINE *ENGINE_new(ENGINE *e);
169#else
170ENGINE *ENGINE_new(void);
171#endif
172int ENGINE_free(ENGINE *e);
173int ENGINE_set_id(ENGINE *e, const char *id);
174int ENGINE_set_name(ENGINE *e, const char *name);
175int ENGINE_set_RSA(ENGINE *e, RSA_METHOD *rsa_meth);
176int ENGINE_set_DSA(ENGINE *e, DSA_METHOD *dsa_meth);
177int ENGINE_set_DH(ENGINE *e, DH_METHOD *dh_meth);
178int ENGINE_set_RAND(ENGINE *e, RAND_METHOD *rand_meth);
179int ENGINE_set_BN_mod_exp(ENGINE *e, BN_MOD_EXP bn_mod_exp);
180int ENGINE_set_BN_mod_exp_crt(ENGINE *e, BN_MOD_EXP_CRT bn_mod_exp_crt);
181int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
182int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
183int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
184
185/* These return values from within the ENGINE structure. These can
186 * be useful with functional references as well as structural
187 * references - it depends which you obtained. Using the result
188 * for functional purposes if you only obtained a structural
189 * reference may be problematic! */
190const char *ENGINE_get_id(ENGINE *e);
191const char *ENGINE_get_name(ENGINE *e);
192RSA_METHOD *ENGINE_get_RSA(ENGINE *e);
193DSA_METHOD *ENGINE_get_DSA(ENGINE *e);
194DH_METHOD *ENGINE_get_DH(ENGINE *e);
195RAND_METHOD *ENGINE_get_RAND(ENGINE *e);
196BN_MOD_EXP ENGINE_get_BN_mod_exp(ENGINE *e);
197BN_MOD_EXP_CRT ENGINE_get_BN_mod_exp_crt(ENGINE *e);
198ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(ENGINE *e);
199ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(ENGINE *e);
200ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(ENGINE *e);
201
202/* ENGINE_new is normally passed a NULL in the first parameter because
203 * the calling code doesn't have access to the definition of the ENGINE
204 * structure (for good reason). However, if the caller wishes to use
205 * its own memory allocation or use a static array, the following call
206 * should be used to check the amount of memory the ENGINE structure
207 * will occupy. This will make the code more future-proof.
208 *
209 * NB: I'm "#if 0"-ing this out because it's better to force the use of
210 * internally allocated memory. See similar change in ENGINE_new().
211 */
212#if 0
213int ENGINE_get_struct_size(void);
214#endif
215
216/* FUNCTIONAL functions. These functions deal with ENGINE structures
217 * that have (or will) be initialised for use. Broadly speaking, the
218 * structural functions are useful for iterating the list of available
219 * engine types, creating new engine types, and other "list" operations.
220 * These functions actually deal with ENGINEs that are to be used. As
221 * such these functions can fail (if applicable) when particular
222 * engines are unavailable - eg. if a hardware accelerator is not
223 * attached or not functioning correctly. Each ENGINE has 2 reference
224 * counts; structural and functional. Every time a functional reference
225 * is obtained or released, a corresponding structural reference is
226 * automatically obtained or released too. */
227
228/* Initialise a engine type for use (or up its reference count if it's
229 * already in use). This will fail if the engine is not currently
230 * operational and cannot initialise. */
231int ENGINE_init(ENGINE *e);
232/* Free a functional reference to a engine type. This does not require
233 * a corresponding call to ENGINE_free as it also releases a structural
234 * reference. */
235int ENGINE_finish(ENGINE *e);
236/* Send control parametrised commands to the engine. The possibilities
237 * to send down an integer, a pointer to data or a function pointer are
238 * provided. Any of the parameters may or may not be NULL, depending
239 * on the command number */
240/* WARNING: This is currently experimental and may change radically! */
241int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)());
242
243/* The following functions handle keys that are stored in some secondary
244 * location, handled by the engine. The storage may be on a card or
245 * whatever. */
246EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
247 const char *passphrase);
248EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
249 const char *passphrase);
250
251/* This returns a pointer for the current ENGINE structure that
252 * is (by default) performing any RSA operations. The value returned
253 * is an incremented reference, so it should be free'd (ENGINE_finish)
254 * before it is discarded. */
255ENGINE *ENGINE_get_default_RSA(void);
256/* Same for the other "methods" */
257ENGINE *ENGINE_get_default_DSA(void);
258ENGINE *ENGINE_get_default_DH(void);
259ENGINE *ENGINE_get_default_RAND(void);
260ENGINE *ENGINE_get_default_BN_mod_exp(void);
261ENGINE *ENGINE_get_default_BN_mod_exp_crt(void);
262
263/* This sets a new default ENGINE structure for performing RSA
264 * operations. If the result is non-zero (success) then the ENGINE
265 * structure will have had its reference count up'd so the caller
266 * should still free their own reference 'e'. */
267int ENGINE_set_default_RSA(ENGINE *e);
268/* Same for the other "methods" */
269int ENGINE_set_default_DSA(ENGINE *e);
270int ENGINE_set_default_DH(ENGINE *e);
271int ENGINE_set_default_RAND(ENGINE *e);
272int ENGINE_set_default_BN_mod_exp(ENGINE *e);
273int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e);
274
275/* The combination "set" - the flags are bitwise "OR"d from the
276 * ENGINE_METHOD_*** defines above. */
277int ENGINE_set_default(ENGINE *e, unsigned int flags);
278
279/* Obligatory error function. */
280void ERR_load_ENGINE_strings(void);
281
282/*
283 * Error codes for all engine functions. NB: We use "generic"
284 * function names instead of per-implementation ones because this
285 * levels the playing field for externally implemented bootstrapped
286 * support code. As the filename and line number is included, it's
287 * more important to indicate the type of function, so that
288 * bootstrapped code (that can't easily add its own errors in) can
289 * use the same error codes too.
290 */
291
292/* BEGIN ERROR CODES */
293/* The following lines are auto generated by the script mkerr.pl. Any changes
294 * made after this point may be overwritten when the script is next run.
295 */
296
297/* Error codes for the ENGINE functions. */
298
299/* Function codes. */
300#define ENGINE_F_ATALLA_FINISH 135
301#define ENGINE_F_ATALLA_INIT 136
302#define ENGINE_F_ATALLA_MOD_EXP 137
303#define ENGINE_F_ATALLA_RSA_MOD_EXP 138
304#define ENGINE_F_CSWIFT_DSA_SIGN 133
305#define ENGINE_F_CSWIFT_DSA_VERIFY 134
306#define ENGINE_F_CSWIFT_FINISH 100
307#define ENGINE_F_CSWIFT_INIT 101
308#define ENGINE_F_CSWIFT_MOD_EXP 102
309#define ENGINE_F_CSWIFT_MOD_EXP_CRT 103
310#define ENGINE_F_CSWIFT_RSA_MOD_EXP 104
311#define ENGINE_F_ENGINE_ADD 105
312#define ENGINE_F_ENGINE_BY_ID 106
313#define ENGINE_F_ENGINE_CTRL 142
314#define ENGINE_F_ENGINE_FINISH 107
315#define ENGINE_F_ENGINE_FREE 108
316#define ENGINE_F_ENGINE_GET_BN_MOD_EXP 109
317#define ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT 110
318#define ENGINE_F_ENGINE_GET_CTRL_FUNCTION 144
319#define ENGINE_F_ENGINE_GET_DH 111
320#define ENGINE_F_ENGINE_GET_DSA 112
321#define ENGINE_F_ENGINE_GET_FINISH_FUNCTION 145
322#define ENGINE_F_ENGINE_GET_ID 113
323#define ENGINE_F_ENGINE_GET_INIT_FUNCTION 146
324#define ENGINE_F_ENGINE_GET_NAME 114
325#define ENGINE_F_ENGINE_GET_NEXT 115
326#define ENGINE_F_ENGINE_GET_PREV 116
327#define ENGINE_F_ENGINE_GET_RAND 117
328#define ENGINE_F_ENGINE_GET_RSA 118
329#define ENGINE_F_ENGINE_INIT 119
330#define ENGINE_F_ENGINE_LIST_ADD 120
331#define ENGINE_F_ENGINE_LIST_REMOVE 121
332#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
333#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
334#define ENGINE_F_ENGINE_NEW 122
335#define ENGINE_F_ENGINE_REMOVE 123
336#define ENGINE_F_ENGINE_SET_BN_MOD_EXP 124
337#define ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT 125
338#define ENGINE_F_ENGINE_SET_CTRL_FUNCTION 147
339#define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
340#define ENGINE_F_ENGINE_SET_DH 127
341#define ENGINE_F_ENGINE_SET_DSA 128
342#define ENGINE_F_ENGINE_SET_FINISH_FUNCTION 148
343#define ENGINE_F_ENGINE_SET_ID 129
344#define ENGINE_F_ENGINE_SET_INIT_FUNCTION 149
345#define ENGINE_F_ENGINE_SET_NAME 130
346#define ENGINE_F_ENGINE_SET_RAND 131
347#define ENGINE_F_ENGINE_SET_RSA 132
348#define ENGINE_F_ENGINE_UNLOAD_KEY 152
349#define ENGINE_F_HWCRHK_CTRL 143
350#define ENGINE_F_HWCRHK_FINISH 135
351#define ENGINE_F_HWCRHK_GET_PASS 155
352#define ENGINE_F_HWCRHK_INIT 136
353#define ENGINE_F_HWCRHK_LOAD_PRIVKEY 153
354#define ENGINE_F_HWCRHK_LOAD_PUBKEY 154
355#define ENGINE_F_HWCRHK_MOD_EXP 137
356#define ENGINE_F_HWCRHK_MOD_EXP_CRT 138
357#define ENGINE_F_HWCRHK_RAND_BYTES 139
358#define ENGINE_F_HWCRHK_RSA_MOD_EXP 140
359#define ENGINE_F_LOG_MESSAGE 141
360
361/* Reason codes. */
362#define ENGINE_R_ALREADY_LOADED 100
363#define ENGINE_R_BIO_WAS_FREED 121
364#define ENGINE_R_BN_CTX_FULL 101
365#define ENGINE_R_BN_EXPAND_FAIL 102
366#define ENGINE_R_CHIL_ERROR 123
367#define ENGINE_R_CONFLICTING_ENGINE_ID 103
368#define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
369#define ENGINE_R_DSO_FAILURE 104
370#define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
371#define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
372#define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
373#define ENGINE_R_FINISH_FAILED 106
374#define ENGINE_R_GET_HANDLE_FAILED 107
375#define ENGINE_R_ID_OR_NAME_MISSING 108
376#define ENGINE_R_INIT_FAILED 109
377#define ENGINE_R_INTERNAL_LIST_ERROR 110
378#define ENGINE_R_MISSING_KEY_COMPONENTS 111
379#define ENGINE_R_NOT_INITIALISED 117
380#define ENGINE_R_NOT_LOADED 112
381#define ENGINE_R_NO_CALLBACK 127
382#define ENGINE_R_NO_CONTROL_FUNCTION 120
383#define ENGINE_R_NO_KEY 124
384#define ENGINE_R_NO_LOAD_FUNCTION 125
385#define ENGINE_R_NO_REFERENCE 130
386#define ENGINE_R_NO_SUCH_ENGINE 116
387#define ENGINE_R_NO_UNLOAD_FUNCTION 126
388#define ENGINE_R_PROVIDE_PARAMETERS 113
389#define ENGINE_R_REQUEST_FAILED 114
390#define ENGINE_R_REQUEST_FALLBACK 118
391#define ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL 122
392#define ENGINE_R_UNIT_FAILURE 115
393
394#ifdef __cplusplus
395}
396#endif
397#endif
398
diff --git a/src/lib/libcrypto/engine/engine_err.c b/src/lib/libcrypto/engine/engine_err.c
new file mode 100644
index 0000000000..0d7a31f6d5
--- /dev/null
+++ b/src/lib/libcrypto/engine/engine_err.c
@@ -0,0 +1,183 @@
1/* crypto/engine/engine_err.c */
2/* ====================================================================
3 * Copyright (c) 1999 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 * This product includes cryptographic software written by Eric Young
51 * (eay@cryptsoft.com). This product includes software written by Tim
52 * Hudson (tjh@cryptsoft.com).
53 *
54 */
55
56/* NOTE: this file was auto generated by the mkerr.pl script: any changes
57 * made to it will be overwritten when the script next updates this file,
58 * only reason strings will be preserved.
59 */
60
61#include <stdio.h>
62#include <openssl/err.h>
63#include <openssl/engine.h>
64
65/* BEGIN ERROR CODES */
66#ifndef NO_ERR
67static ERR_STRING_DATA ENGINE_str_functs[]=
68 {
69{ERR_PACK(0,ENGINE_F_ATALLA_FINISH,0), "ATALLA_FINISH"},
70{ERR_PACK(0,ENGINE_F_ATALLA_INIT,0), "ATALLA_INIT"},
71{ERR_PACK(0,ENGINE_F_ATALLA_MOD_EXP,0), "ATALLA_MOD_EXP"},
72{ERR_PACK(0,ENGINE_F_ATALLA_RSA_MOD_EXP,0), "ATALLA_RSA_MOD_EXP"},
73{ERR_PACK(0,ENGINE_F_CSWIFT_DSA_SIGN,0), "CSWIFT_DSA_SIGN"},
74{ERR_PACK(0,ENGINE_F_CSWIFT_DSA_VERIFY,0), "CSWIFT_DSA_VERIFY"},
75{ERR_PACK(0,ENGINE_F_CSWIFT_FINISH,0), "CSWIFT_FINISH"},
76{ERR_PACK(0,ENGINE_F_CSWIFT_INIT,0), "CSWIFT_INIT"},
77{ERR_PACK(0,ENGINE_F_CSWIFT_MOD_EXP,0), "CSWIFT_MOD_EXP"},
78{ERR_PACK(0,ENGINE_F_CSWIFT_MOD_EXP_CRT,0), "CSWIFT_MOD_EXP_CRT"},
79{ERR_PACK(0,ENGINE_F_CSWIFT_RSA_MOD_EXP,0), "CSWIFT_RSA_MOD_EXP"},
80{ERR_PACK(0,ENGINE_F_ENGINE_ADD,0), "ENGINE_add"},
81{ERR_PACK(0,ENGINE_F_ENGINE_BY_ID,0), "ENGINE_by_id"},
82{ERR_PACK(0,ENGINE_F_ENGINE_CTRL,0), "ENGINE_ctrl"},
83{ERR_PACK(0,ENGINE_F_ENGINE_FINISH,0), "ENGINE_finish"},
84{ERR_PACK(0,ENGINE_F_ENGINE_FREE,0), "ENGINE_free"},
85{ERR_PACK(0,ENGINE_F_ENGINE_GET_BN_MOD_EXP,0), "ENGINE_get_BN_mod_exp"},
86{ERR_PACK(0,ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT,0), "ENGINE_get_BN_mod_exp_crt"},
87{ERR_PACK(0,ENGINE_F_ENGINE_GET_CTRL_FUNCTION,0), "ENGINE_get_ctrl_function"},
88{ERR_PACK(0,ENGINE_F_ENGINE_GET_DH,0), "ENGINE_get_DH"},
89{ERR_PACK(0,ENGINE_F_ENGINE_GET_DSA,0), "ENGINE_get_DSA"},
90{ERR_PACK(0,ENGINE_F_ENGINE_GET_FINISH_FUNCTION,0), "ENGINE_get_finish_function"},
91{ERR_PACK(0,ENGINE_F_ENGINE_GET_ID,0), "ENGINE_get_id"},
92{ERR_PACK(0,ENGINE_F_ENGINE_GET_INIT_FUNCTION,0), "ENGINE_get_init_function"},
93{ERR_PACK(0,ENGINE_F_ENGINE_GET_NAME,0), "ENGINE_get_name"},
94{ERR_PACK(0,ENGINE_F_ENGINE_GET_NEXT,0), "ENGINE_get_next"},
95{ERR_PACK(0,ENGINE_F_ENGINE_GET_PREV,0), "ENGINE_get_prev"},
96{ERR_PACK(0,ENGINE_F_ENGINE_GET_RAND,0), "ENGINE_get_RAND"},
97{ERR_PACK(0,ENGINE_F_ENGINE_GET_RSA,0), "ENGINE_get_RSA"},
98{ERR_PACK(0,ENGINE_F_ENGINE_INIT,0), "ENGINE_init"},
99{ERR_PACK(0,ENGINE_F_ENGINE_LIST_ADD,0), "ENGINE_LIST_ADD"},
100{ERR_PACK(0,ENGINE_F_ENGINE_LIST_REMOVE,0), "ENGINE_LIST_REMOVE"},
101{ERR_PACK(0,ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,0), "ENGINE_load_private_key"},
102{ERR_PACK(0,ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,0), "ENGINE_load_public_key"},
103{ERR_PACK(0,ENGINE_F_ENGINE_NEW,0), "ENGINE_new"},
104{ERR_PACK(0,ENGINE_F_ENGINE_REMOVE,0), "ENGINE_remove"},
105{ERR_PACK(0,ENGINE_F_ENGINE_SET_BN_MOD_EXP,0), "ENGINE_set_BN_mod_exp"},
106{ERR_PACK(0,ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT,0), "ENGINE_set_BN_mod_exp_crt"},
107{ERR_PACK(0,ENGINE_F_ENGINE_SET_CTRL_FUNCTION,0), "ENGINE_set_ctrl_function"},
108{ERR_PACK(0,ENGINE_F_ENGINE_SET_DEFAULT_TYPE,0), "ENGINE_SET_DEFAULT_TYPE"},
109{ERR_PACK(0,ENGINE_F_ENGINE_SET_DH,0), "ENGINE_set_DH"},
110{ERR_PACK(0,ENGINE_F_ENGINE_SET_DSA,0), "ENGINE_set_DSA"},
111{ERR_PACK(0,ENGINE_F_ENGINE_SET_FINISH_FUNCTION,0), "ENGINE_set_finish_function"},
112{ERR_PACK(0,ENGINE_F_ENGINE_SET_ID,0), "ENGINE_set_id"},
113{ERR_PACK(0,ENGINE_F_ENGINE_SET_INIT_FUNCTION,0), "ENGINE_set_init_function"},
114{ERR_PACK(0,ENGINE_F_ENGINE_SET_NAME,0), "ENGINE_set_name"},
115{ERR_PACK(0,ENGINE_F_ENGINE_SET_RAND,0), "ENGINE_set_RAND"},
116{ERR_PACK(0,ENGINE_F_ENGINE_SET_RSA,0), "ENGINE_set_RSA"},
117{ERR_PACK(0,ENGINE_F_ENGINE_UNLOAD_KEY,0), "ENGINE_UNLOAD_KEY"},
118{ERR_PACK(0,ENGINE_F_HWCRHK_CTRL,0), "HWCRHK_CTRL"},
119{ERR_PACK(0,ENGINE_F_HWCRHK_FINISH,0), "HWCRHK_FINISH"},
120{ERR_PACK(0,ENGINE_F_HWCRHK_GET_PASS,0), "HWCRHK_GET_PASS"},
121{ERR_PACK(0,ENGINE_F_HWCRHK_INIT,0), "HWCRHK_INIT"},
122{ERR_PACK(0,ENGINE_F_HWCRHK_LOAD_PRIVKEY,0), "HWCRHK_LOAD_PRIVKEY"},
123{ERR_PACK(0,ENGINE_F_HWCRHK_LOAD_PUBKEY,0), "HWCRHK_LOAD_PUBKEY"},
124{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP,0), "HWCRHK_MOD_EXP"},
125{ERR_PACK(0,ENGINE_F_HWCRHK_MOD_EXP_CRT,0), "HWCRHK_MOD_EXP_CRT"},
126{ERR_PACK(0,ENGINE_F_HWCRHK_RAND_BYTES,0), "HWCRHK_RAND_BYTES"},
127{ERR_PACK(0,ENGINE_F_HWCRHK_RSA_MOD_EXP,0), "HWCRHK_RSA_MOD_EXP"},
128{ERR_PACK(0,ENGINE_F_LOG_MESSAGE,0), "LOG_MESSAGE"},
129{0,NULL}
130 };
131
132static ERR_STRING_DATA ENGINE_str_reasons[]=
133 {
134{ENGINE_R_ALREADY_LOADED ,"already loaded"},
135{ENGINE_R_BIO_WAS_FREED ,"bio was freed"},
136{ENGINE_R_BN_CTX_FULL ,"BN_CTX full"},
137{ENGINE_R_BN_EXPAND_FAIL ,"bn_expand fail"},
138{ENGINE_R_CHIL_ERROR ,"chil error"},
139{ENGINE_R_CONFLICTING_ENGINE_ID ,"conflicting engine id"},
140{ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"},
141{ENGINE_R_DSO_FAILURE ,"DSO failure"},
142{ENGINE_R_ENGINE_IS_NOT_IN_LIST ,"engine is not in the list"},
143{ENGINE_R_FAILED_LOADING_PRIVATE_KEY ,"failed loading private key"},
144{ENGINE_R_FAILED_LOADING_PUBLIC_KEY ,"failed loading public key"},
145{ENGINE_R_FINISH_FAILED ,"finish failed"},
146{ENGINE_R_GET_HANDLE_FAILED ,"could not obtain hardware handle"},
147{ENGINE_R_ID_OR_NAME_MISSING ,"'id' or 'name' missing"},
148{ENGINE_R_INIT_FAILED ,"init failed"},
149{ENGINE_R_INTERNAL_LIST_ERROR ,"internal list error"},
150{ENGINE_R_MISSING_KEY_COMPONENTS ,"missing key components"},
151{ENGINE_R_NOT_INITIALISED ,"not initialised"},
152{ENGINE_R_NOT_LOADED ,"not loaded"},
153{ENGINE_R_NO_CALLBACK ,"no callback"},
154{ENGINE_R_NO_CONTROL_FUNCTION ,"no control function"},
155{ENGINE_R_NO_KEY ,"no key"},
156{ENGINE_R_NO_LOAD_FUNCTION ,"no load function"},
157{ENGINE_R_NO_REFERENCE ,"no reference"},
158{ENGINE_R_NO_SUCH_ENGINE ,"no such engine"},
159{ENGINE_R_NO_UNLOAD_FUNCTION ,"no unload function"},
160{ENGINE_R_PROVIDE_PARAMETERS ,"provide parameters"},
161{ENGINE_R_REQUEST_FAILED ,"request failed"},
162{ENGINE_R_REQUEST_FALLBACK ,"request fallback"},
163{ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"},
164{ENGINE_R_UNIT_FAILURE ,"unit failure"},
165{0,NULL}
166 };
167
168#endif
169
170void ERR_load_ENGINE_strings(void)
171 {
172 static int init=1;
173
174 if (init)
175 {
176 init=0;
177#ifndef NO_ERR
178 ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_functs);
179 ERR_load_strings(ERR_LIB_ENGINE,ENGINE_str_reasons);
180#endif
181
182 }
183 }
diff --git a/src/lib/libcrypto/engine/engine_int.h b/src/lib/libcrypto/engine/engine_int.h
new file mode 100644
index 0000000000..447fa2a320
--- /dev/null
+++ b/src/lib/libcrypto/engine/engine_int.h
@@ -0,0 +1,160 @@
1/* crypto/engine/engine_int.h */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#ifndef HEADER_ENGINE_INT_H
60#define HEADER_ENGINE_INT_H
61
62#include <openssl/rsa.h>
63#include <openssl/dsa.h>
64#include <openssl/dh.h>
65#include <openssl/rand.h>
66#include <openssl/bn.h>
67#include <openssl/evp.h>
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
73/* Bitwise OR-able values for the "flags" variable in ENGINE. */
74#define ENGINE_FLAGS_MALLOCED 0x0001
75
76#ifndef HEADER_ENGINE_H
77/* Regrettably, we need to reproduce the "BN" function types here
78 * because there is no such "BIGNUM_METHOD" as there is with RSA,
79 * DSA, etc. We do this so that we don't have a case where engine.h
80 * and engine_int.h conflict with each other. */
81typedef int (*BN_MOD_EXP)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
82 const BIGNUM *m, BN_CTX *ctx);
83
84/* private key operation for RSA, provided seperately in case other
85 * RSA implementations wish to use it. */
86typedef int (*BN_MOD_EXP_CRT)(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
87 const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
88 const BIGNUM *iqmp, BN_CTX *ctx);
89
90/* Generic function pointer */
91typedef int (*ENGINE_GEN_FUNC_PTR)();
92/* Generic function pointer taking no arguments */
93typedef int (*ENGINE_GEN_INT_FUNC_PTR)(void);
94/* Specific control function pointer */
95typedef int (*ENGINE_CTRL_FUNC_PTR)(int cmd, long i, void *p, void (*f)());
96
97#endif
98
99/* This is a structure for storing implementations of various crypto
100 * algorithms and functions. */
101typedef struct engine_st
102 {
103 const char *id;
104 const char *name;
105 RSA_METHOD *rsa_meth;
106 DSA_METHOD *dsa_meth;
107 DH_METHOD *dh_meth;
108 RAND_METHOD *rand_meth;
109 BN_MOD_EXP bn_mod_exp;
110 BN_MOD_EXP_CRT bn_mod_exp_crt;
111 int (*init)(void);
112 int (*finish)(void);
113 int (*ctrl)(int cmd, long i, void *p, void (*f)());
114 EVP_PKEY *(*load_privkey)(const char *key_id, const char *passphrase);
115 EVP_PKEY *(*load_pubkey)(const char *key_id, const char *passphrase);
116 int flags;
117 /* reference count on the structure itself */
118 int struct_ref;
119 /* reference count on usability of the engine type. NB: This
120 * controls the loading and initialisation of any functionlity
121 * required by this engine, whereas the previous count is
122 * simply to cope with (de)allocation of this structure. Hence,
123 * running_ref <= struct_ref at all times. */
124 int funct_ref;
125 /* Used to maintain the linked-list of engines. */
126 struct engine_st *prev;
127 struct engine_st *next;
128 } ENGINE;
129
130/* BUILT-IN ENGINES. (these functions are only ever called once and
131 * do not return references - they are purely for bootstrapping). */
132
133/* Returns a structure of software only methods (the default). */
134ENGINE *ENGINE_openssl();
135
136#ifndef NO_HW
137
138#ifndef NO_HW_CSWIFT
139/* Returns a structure of cswift methods ... NB: This can exist and be
140 * "used" even on non-cswift systems because the "init" will fail if the
141 * card/library are not found. */
142ENGINE *ENGINE_cswift();
143#endif /* !NO_HW_CSWIFT */
144
145#ifndef NO_HW_NCIPHER
146ENGINE *ENGINE_ncipher();
147#endif /* !NO_HW_NCIPHER */
148
149#ifndef NO_HW_ATALLA
150/* Returns a structure of atalla methods. */
151ENGINE *ENGINE_atalla();
152#endif /* !NO_HW_ATALLA */
153
154#endif /* !NO_HW */
155
156#ifdef __cplusplus
157}
158#endif
159
160#endif /* HEADER_ENGINE_INT_H */
diff --git a/src/lib/libcrypto/engine/engine_lib.c b/src/lib/libcrypto/engine/engine_lib.c
new file mode 100644
index 0000000000..1df07af03a
--- /dev/null
+++ b/src/lib/libcrypto/engine/engine_lib.c
@@ -0,0 +1,488 @@
1/* crypto/engine/engine_lib.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <openssl/crypto.h>
60#include "cryptlib.h"
61#include "engine_int.h"
62#include <openssl/engine.h>
63
64/* These pointers each have their own "functional reference" when they
65 * are non-NULL. Similarly, when they are retrieved by a call to
66 * ENGINE_get_default_[RSA|DSA|...] the returned pointer is also a
67 * reference and the caller is responsible for freeing that when they
68 * are finished with it (with a call to ENGINE_finish() *NOT* just
69 * ENGINE_free()!!!!!!). */
70static ENGINE *engine_def_rsa = NULL;
71static ENGINE *engine_def_dsa = NULL;
72static ENGINE *engine_def_dh = NULL;
73static ENGINE *engine_def_rand = NULL;
74static ENGINE *engine_def_bn_mod_exp = NULL;
75static ENGINE *engine_def_bn_mod_exp_crt = NULL;
76/* A static "once-only" flag used to control if/when the above were
77 * initialised to suitable start-up defaults. */
78static int engine_def_flag = 0;
79
80/* This is used in certain static utility functions to save code
81 * repetition for per-algorithm functions. */
82typedef enum {
83 ENGINE_TYPE_RSA,
84 ENGINE_TYPE_DSA,
85 ENGINE_TYPE_DH,
86 ENGINE_TYPE_RAND,
87 ENGINE_TYPE_BN_MOD_EXP,
88 ENGINE_TYPE_BN_MOD_EXP_CRT
89 } ENGINE_TYPE;
90
91static void engine_def_check_util(ENGINE **def, ENGINE *val)
92 {
93 *def = val;
94 val->struct_ref++;
95 val->funct_ref++;
96 }
97
98/* In a slight break with convention - this static function must be
99 * called *outside* any locking of CRYPTO_LOCK_ENGINE. */
100static void engine_def_check(void)
101 {
102 ENGINE *e;
103 if(engine_def_flag)
104 return;
105 e = ENGINE_get_first();
106 if(e == NULL)
107 /* The list is empty ... not much we can do! */
108 return;
109 /* We have a structural reference, see if getting a functional
110 * reference is possible. This is done to cope with init errors
111 * in the engine - the following locked code does a bunch of
112 * manual "ENGINE_init"s which do *not* allow such an init
113 * error so this is worth doing. */
114 if(ENGINE_init(e))
115 {
116 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
117 /* Doing another check here prevents an obvious race
118 * condition because the whole function itself cannot
119 * be locked. */
120 if(engine_def_flag)
121 goto skip_set_defaults;
122 /* OK, we got a functional reference, so we get one each
123 * for the defaults too. */
124 engine_def_check_util(&engine_def_rsa, e);
125 engine_def_check_util(&engine_def_dsa, e);
126 engine_def_check_util(&engine_def_dh, e);
127 engine_def_check_util(&engine_def_rand, e);
128 engine_def_check_util(&engine_def_bn_mod_exp, e);
129 engine_def_check_util(&engine_def_bn_mod_exp_crt, e);
130 engine_def_flag = 1;
131skip_set_defaults:
132 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
133 /* The "if" needs to be balanced out. */
134 ENGINE_finish(e);
135 }
136 /* We need to balance out the fact we obtained a structural
137 * reference to begin with from ENGINE_get_first(). */
138 ENGINE_free(e);
139 }
140
141/* Initialise a engine type for use (or up its functional reference count
142 * if it's already in use). */
143int ENGINE_init(ENGINE *e)
144 {
145 int to_return = 1;
146
147 if(e == NULL)
148 {
149 ENGINEerr(ENGINE_F_ENGINE_INIT,ERR_R_PASSED_NULL_PARAMETER);
150 return 0;
151 }
152 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
153 if((e->funct_ref == 0) && e->init)
154 /* This is the first functional reference and the engine
155 * requires initialisation so we do it now. */
156 to_return = e->init();
157 if(to_return)
158 {
159 /* OK, we return a functional reference which is also a
160 * structural reference. */
161 e->struct_ref++;
162 e->funct_ref++;
163 }
164 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
165 return to_return;
166 }
167
168/* Free a functional reference to a engine type */
169int ENGINE_finish(ENGINE *e)
170 {
171 int to_return = 1;
172
173 if(e == NULL)
174 {
175 ENGINEerr(ENGINE_F_ENGINE_FINISH,ERR_R_PASSED_NULL_PARAMETER);
176 return 0;
177 }
178 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
179 if((e->funct_ref == 1) && e->finish)
180#if 0
181 /* This is the last functional reference and the engine
182 * requires cleanup so we do it now. */
183 to_return = e->finish();
184 if(to_return)
185 {
186 /* Cleanup the functional reference which is also a
187 * structural reference. */
188 e->struct_ref--;
189 e->funct_ref--;
190 }
191 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
192#else
193 /* I'm going to deliberately do a convoluted version of this
194 * piece of code because we don't want "finish" functions
195 * being called inside a locked block of code, if at all
196 * possible. I'd rather have this call take an extra couple
197 * of ticks than have throughput serialised on a externally-
198 * provided callback function that may conceivably never come
199 * back. :-( */
200 {
201 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
202 /* CODE ALERT: This *IS* supposed to be "=" and NOT "==" :-) */
203 if((to_return = e->finish()))
204 {
205 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
206 /* Cleanup the functional reference which is also a
207 * structural reference. */
208 e->struct_ref--;
209 e->funct_ref--;
210 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
211 }
212 }
213 else
214 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
215#endif
216 return to_return;
217 }
218
219EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
220 const char *passphrase)
221 {
222 EVP_PKEY *pkey;
223
224 if(e == NULL)
225 {
226 ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
227 ERR_R_PASSED_NULL_PARAMETER);
228 return 0;
229 }
230 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
231 if(e->funct_ref == 0)
232 {
233 ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
234 ENGINE_R_NOT_INITIALISED);
235 return 0;
236 }
237 if (!e->load_privkey)
238 {
239 ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
240 ENGINE_R_NO_LOAD_FUNCTION);
241 return 0;
242 }
243 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
244 pkey = e->load_privkey(key_id, passphrase);
245 if (!pkey)
246 {
247 ENGINEerr(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY,
248 ENGINE_R_FAILED_LOADING_PRIVATE_KEY);
249 return 0;
250 }
251 return pkey;
252 }
253
254EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
255 const char *passphrase)
256 {
257 EVP_PKEY *pkey;
258
259 if(e == NULL)
260 {
261 ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
262 ERR_R_PASSED_NULL_PARAMETER);
263 return 0;
264 }
265 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
266 if(e->funct_ref == 0)
267 {
268 ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
269 ENGINE_R_NOT_INITIALISED);
270 return 0;
271 }
272 if (!e->load_pubkey)
273 {
274 ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
275 ENGINE_R_NO_LOAD_FUNCTION);
276 return 0;
277 }
278 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
279 pkey = e->load_pubkey(key_id, passphrase);
280 if (!pkey)
281 {
282 ENGINEerr(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY,
283 ENGINE_R_FAILED_LOADING_PUBLIC_KEY);
284 return 0;
285 }
286 return pkey;
287 }
288
289/* Initialise a engine type for use (or up its functional reference count
290 * if it's already in use). */
291int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
292 {
293 if(e == NULL)
294 {
295 ENGINEerr(ENGINE_F_ENGINE_CTRL,ERR_R_PASSED_NULL_PARAMETER);
296 return 0;
297 }
298 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
299 if(e->struct_ref == 0)
300 {
301 ENGINEerr(ENGINE_F_ENGINE_CTRL,ENGINE_R_NO_REFERENCE);
302 return 0;
303 }
304 if (!e->ctrl)
305 {
306 ENGINEerr(ENGINE_F_ENGINE_CTRL,ENGINE_R_NO_CONTROL_FUNCTION);
307 return 0;
308 }
309 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
310 return e->ctrl(cmd, i, p, f);
311 }
312
313static ENGINE *engine_get_default_type(ENGINE_TYPE t)
314 {
315 ENGINE *ret = NULL;
316
317 /* engine_def_check is lean and mean and won't replace any
318 * prior default engines ... so we must ensure that it is always
319 * the first function to get to touch the default values. */
320 engine_def_check();
321 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
322 switch(t)
323 {
324 case ENGINE_TYPE_RSA:
325 ret = engine_def_rsa; break;
326 case ENGINE_TYPE_DSA:
327 ret = engine_def_dsa; break;
328 case ENGINE_TYPE_DH:
329 ret = engine_def_dh; break;
330 case ENGINE_TYPE_RAND:
331 ret = engine_def_rand; break;
332 case ENGINE_TYPE_BN_MOD_EXP:
333 ret = engine_def_bn_mod_exp; break;
334 case ENGINE_TYPE_BN_MOD_EXP_CRT:
335 ret = engine_def_bn_mod_exp_crt; break;
336 }
337 /* Unforunately we can't do this work outside the lock with a
338 * call to ENGINE_init() because that would leave a race
339 * condition open. */
340 if(ret)
341 {
342 ret->struct_ref++;
343 ret->funct_ref++;
344 }
345 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
346 return ret;
347 }
348
349ENGINE *ENGINE_get_default_RSA(void)
350 {
351 return engine_get_default_type(ENGINE_TYPE_RSA);
352 }
353
354ENGINE *ENGINE_get_default_DSA(void)
355 {
356 return engine_get_default_type(ENGINE_TYPE_DSA);
357 }
358
359ENGINE *ENGINE_get_default_DH(void)
360 {
361 return engine_get_default_type(ENGINE_TYPE_DH);
362 }
363
364ENGINE *ENGINE_get_default_RAND(void)
365 {
366 return engine_get_default_type(ENGINE_TYPE_RAND);
367 }
368
369ENGINE *ENGINE_get_default_BN_mod_exp(void)
370 {
371 return engine_get_default_type(ENGINE_TYPE_BN_MOD_EXP);
372 }
373
374ENGINE *ENGINE_get_default_BN_mod_exp_crt(void)
375 {
376 return engine_get_default_type(ENGINE_TYPE_BN_MOD_EXP_CRT);
377 }
378
379static int engine_set_default_type(ENGINE_TYPE t, ENGINE *e)
380 {
381 ENGINE *old = NULL;
382
383 if(e == NULL)
384 {
385 ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_TYPE,
386 ERR_R_PASSED_NULL_PARAMETER);
387 return 0;
388 }
389 /* engine_def_check is lean and mean and won't replace any
390 * prior default engines ... so we must ensure that it is always
391 * the first function to get to touch the default values. */
392 engine_def_check();
393 /* Attempt to get a functional reference (we need one anyway, but
394 * also, 'e' may be just a structural reference being passed in so
395 * this call may actually be the first). */
396 if(!ENGINE_init(e))
397 {
398 ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_TYPE,
399 ENGINE_R_INIT_FAILED);
400 return 0;
401 }
402 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
403 switch(t)
404 {
405 case ENGINE_TYPE_RSA:
406 old = engine_def_rsa;
407 engine_def_rsa = e; break;
408 case ENGINE_TYPE_DSA:
409 old = engine_def_dsa;
410 engine_def_dsa = e; break;
411 case ENGINE_TYPE_DH:
412 old = engine_def_dh;
413 engine_def_dh = e; break;
414 case ENGINE_TYPE_RAND:
415 old = engine_def_rand;
416 engine_def_rand = e; break;
417 case ENGINE_TYPE_BN_MOD_EXP:
418 old = engine_def_bn_mod_exp;
419 engine_def_bn_mod_exp = e; break;
420 case ENGINE_TYPE_BN_MOD_EXP_CRT:
421 old = engine_def_bn_mod_exp_crt;
422 engine_def_bn_mod_exp_crt = e; break;
423 }
424 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
425 /* If we've replaced a previous value, then we need to remove the
426 * functional reference we had. */
427 if(old && !ENGINE_finish(old))
428 {
429 ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_TYPE,
430 ENGINE_R_FINISH_FAILED);
431 return 0;
432 }
433 return 1;
434 }
435
436int ENGINE_set_default_RSA(ENGINE *e)
437 {
438 return engine_set_default_type(ENGINE_TYPE_RSA, e);
439 }
440
441int ENGINE_set_default_DSA(ENGINE *e)
442 {
443 return engine_set_default_type(ENGINE_TYPE_DSA, e);
444 }
445
446int ENGINE_set_default_DH(ENGINE *e)
447 {
448 return engine_set_default_type(ENGINE_TYPE_DH, e);
449 }
450
451int ENGINE_set_default_RAND(ENGINE *e)
452 {
453 return engine_set_default_type(ENGINE_TYPE_RAND, e);
454 }
455
456int ENGINE_set_default_BN_mod_exp(ENGINE *e)
457 {
458 return engine_set_default_type(ENGINE_TYPE_BN_MOD_EXP, e);
459 }
460
461int ENGINE_set_default_BN_mod_exp_crt(ENGINE *e)
462 {
463 return engine_set_default_type(ENGINE_TYPE_BN_MOD_EXP_CRT, e);
464 }
465
466int ENGINE_set_default(ENGINE *e, unsigned int flags)
467 {
468 if((flags & ENGINE_METHOD_RSA) && e->rsa_meth &&
469 !ENGINE_set_default_RSA(e))
470 return 0;
471 if((flags & ENGINE_METHOD_DSA) && e->dsa_meth &&
472 !ENGINE_set_default_DSA(e))
473 return 0;
474 if((flags & ENGINE_METHOD_DH) && e->dh_meth &&
475 !ENGINE_set_default_DH(e))
476 return 0;
477 if((flags & ENGINE_METHOD_RAND) && e->rand_meth &&
478 !ENGINE_set_default_RAND(e))
479 return 0;
480 if((flags & ENGINE_METHOD_BN_MOD_EXP) && e->bn_mod_exp &&
481 !ENGINE_set_default_BN_mod_exp(e))
482 return 0;
483 if((flags & ENGINE_METHOD_BN_MOD_EXP_CRT) && e->bn_mod_exp_crt &&
484 !ENGINE_set_default_BN_mod_exp_crt(e))
485 return 0;
486 return 1;
487 }
488
diff --git a/src/lib/libcrypto/engine/engine_list.c b/src/lib/libcrypto/engine/engine_list.c
new file mode 100644
index 0000000000..d764c60661
--- /dev/null
+++ b/src/lib/libcrypto/engine/engine_list.c
@@ -0,0 +1,675 @@
1/* crypto/engine/engine_list.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <openssl/crypto.h>
60#include "cryptlib.h"
61#include "engine_int.h"
62#include <openssl/engine.h>
63
64/* The linked-list of pointers to engine types. engine_list_head
65 * incorporates an implicit structural reference but engine_list_tail
66 * does not - the latter is a computational niceity and only points
67 * to something that is already pointed to by its predecessor in the
68 * list (or engine_list_head itself). In the same way, the use of the
69 * "prev" pointer in each ENGINE is to save excessive list iteration,
70 * it doesn't correspond to an extra structural reference. Hence,
71 * engine_list_head, and each non-null "next" pointer account for
72 * the list itself assuming exactly 1 structural reference on each
73 * list member. */
74static ENGINE *engine_list_head = NULL;
75static ENGINE *engine_list_tail = NULL;
76/* A boolean switch, used to ensure we only initialise once. This
77 * is needed because the engine list may genuinely become empty during
78 * use (so we can't use engine_list_head as an indicator for example. */
79static int engine_list_flag = 0;
80
81/* These static functions starting with a lower case "engine_" always
82 * take place when CRYPTO_LOCK_ENGINE has been locked up. */
83static int engine_list_add(ENGINE *e)
84 {
85 int conflict = 0;
86 ENGINE *iterator = NULL;
87
88 if(e == NULL)
89 {
90 ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
91 ERR_R_PASSED_NULL_PARAMETER);
92 return 0;
93 }
94 iterator = engine_list_head;
95 while(iterator && !conflict)
96 {
97 conflict = (strcmp(iterator->id, e->id) == 0);
98 iterator = iterator->next;
99 }
100 if(conflict)
101 {
102 ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
103 ENGINE_R_CONFLICTING_ENGINE_ID);
104 return 0;
105 }
106 if(engine_list_head == NULL)
107 {
108 /* We are adding to an empty list. */
109 if(engine_list_tail)
110 {
111 ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
112 ENGINE_R_INTERNAL_LIST_ERROR);
113 return 0;
114 }
115 engine_list_head = e;
116 e->prev = NULL;
117 }
118 else
119 {
120 /* We are adding to the tail of an existing list. */
121 if((engine_list_tail == NULL) ||
122 (engine_list_tail->next != NULL))
123 {
124 ENGINEerr(ENGINE_F_ENGINE_LIST_ADD,
125 ENGINE_R_INTERNAL_LIST_ERROR);
126 return 0;
127 }
128 engine_list_tail->next = e;
129 e->prev = engine_list_tail;
130 }
131 /* Having the engine in the list assumes a structural
132 * reference. */
133 e->struct_ref++;
134 /* However it came to be, e is the last item in the list. */
135 engine_list_tail = e;
136 e->next = NULL;
137 return 1;
138 }
139
140static int engine_list_remove(ENGINE *e)
141 {
142 ENGINE *iterator;
143
144 if(e == NULL)
145 {
146 ENGINEerr(ENGINE_F_ENGINE_LIST_REMOVE,
147 ERR_R_PASSED_NULL_PARAMETER);
148 return 0;
149 }
150 /* We need to check that e is in our linked list! */
151 iterator = engine_list_head;
152 while(iterator && (iterator != e))
153 iterator = iterator->next;
154 if(iterator == NULL)
155 {
156 ENGINEerr(ENGINE_F_ENGINE_LIST_REMOVE,
157 ENGINE_R_ENGINE_IS_NOT_IN_LIST);
158 return 0;
159 }
160 /* un-link e from the chain. */
161 if(e->next)
162 e->next->prev = e->prev;
163 if(e->prev)
164 e->prev->next = e->next;
165 /* Correct our head/tail if necessary. */
166 if(engine_list_head == e)
167 engine_list_head = e->next;
168 if(engine_list_tail == e)
169 engine_list_tail = e->prev;
170 /* remove our structural reference. */
171 e->struct_ref--;
172 return 1;
173 }
174
175/* This check always takes place with CRYPTO_LOCK_ENGINE locked up
176 * so we're synchronised, but we can't call anything that tries to
177 * lock it again! :-) NB: For convenience (and code-clarity) we
178 * don't output errors for failures of the engine_list_add function
179 * as it will generate errors itself. */
180static int engine_internal_check(void)
181 {
182 if(engine_list_flag)
183 return 1;
184 /* This is our first time up, we need to populate the list
185 * with our statically compiled-in engines. */
186 if(!engine_list_add(ENGINE_openssl()))
187 return 0;
188#ifndef NO_HW
189#ifndef NO_HW_CSWIFT
190 if(!engine_list_add(ENGINE_cswift()))
191 return 0;
192#endif /* !NO_HW_CSWIFT */
193#ifndef NO_HW_NCIPHER
194 if(!engine_list_add(ENGINE_ncipher()))
195 return 0;
196#endif /* !NO_HW_NCIPHER */
197#ifndef NO_HW_ATALLA
198 if(!engine_list_add(ENGINE_atalla()))
199 return 0;
200#endif /* !NO_HW_ATALLA */
201#endif /* !NO_HW */
202 engine_list_flag = 1;
203 return 1;
204 }
205
206/* Get the first/last "ENGINE" type available. */
207ENGINE *ENGINE_get_first(void)
208 {
209 ENGINE *ret = NULL;
210
211 CRYPTO_r_lock(CRYPTO_LOCK_ENGINE);
212 if(engine_internal_check())
213 {
214 ret = engine_list_head;
215 if(ret)
216 ret->struct_ref++;
217 }
218 CRYPTO_r_unlock(CRYPTO_LOCK_ENGINE);
219 return ret;
220 }
221ENGINE *ENGINE_get_last(void)
222 {
223 ENGINE *ret = NULL;
224
225 CRYPTO_r_lock(CRYPTO_LOCK_ENGINE);
226 if(engine_internal_check())
227 {
228 ret = engine_list_tail;
229 if(ret)
230 ret->struct_ref++;
231 }
232 CRYPTO_r_unlock(CRYPTO_LOCK_ENGINE);
233 return ret;
234 }
235
236/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
237ENGINE *ENGINE_get_next(ENGINE *e)
238 {
239 ENGINE *ret = NULL;
240 if(e == NULL)
241 {
242 ENGINEerr(ENGINE_F_ENGINE_GET_NEXT,
243 ERR_R_PASSED_NULL_PARAMETER);
244 return 0;
245 }
246 CRYPTO_r_lock(CRYPTO_LOCK_ENGINE);
247 ret = e->next;
248 e->struct_ref--;
249 if(ret)
250 ret->struct_ref++;
251 CRYPTO_r_unlock(CRYPTO_LOCK_ENGINE);
252 return ret;
253 }
254ENGINE *ENGINE_get_prev(ENGINE *e)
255 {
256 ENGINE *ret = NULL;
257 if(e == NULL)
258 {
259 ENGINEerr(ENGINE_F_ENGINE_GET_PREV,
260 ERR_R_PASSED_NULL_PARAMETER);
261 return 0;
262 }
263 CRYPTO_r_lock(CRYPTO_LOCK_ENGINE);
264 ret = e->prev;
265 e->struct_ref--;
266 if(ret)
267 ret->struct_ref++;
268 CRYPTO_r_unlock(CRYPTO_LOCK_ENGINE);
269 return ret;
270 }
271
272/* Add another "ENGINE" type into the list. */
273int ENGINE_add(ENGINE *e)
274 {
275 int to_return = 1;
276 if(e == NULL)
277 {
278 ENGINEerr(ENGINE_F_ENGINE_ADD,
279 ERR_R_PASSED_NULL_PARAMETER);
280 return 0;
281 }
282 if((e->id == NULL) || (e->name == NULL))
283 {
284 ENGINEerr(ENGINE_F_ENGINE_ADD,
285 ENGINE_R_ID_OR_NAME_MISSING);
286 }
287 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
288 if(!engine_internal_check() || !engine_list_add(e))
289 {
290 ENGINEerr(ENGINE_F_ENGINE_ADD,
291 ENGINE_R_INTERNAL_LIST_ERROR);
292 to_return = 0;
293 }
294 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
295 return to_return;
296 }
297
298/* Remove an existing "ENGINE" type from the array. */
299int ENGINE_remove(ENGINE *e)
300 {
301 int to_return = 1;
302 if(e == NULL)
303 {
304 ENGINEerr(ENGINE_F_ENGINE_REMOVE,
305 ERR_R_PASSED_NULL_PARAMETER);
306 return 0;
307 }
308 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
309 if(!engine_internal_check() || !engine_list_remove(e))
310 {
311 ENGINEerr(ENGINE_F_ENGINE_REMOVE,
312 ENGINE_R_INTERNAL_LIST_ERROR);
313 to_return = 0;
314 }
315 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
316 return to_return;
317 }
318
319ENGINE *ENGINE_by_id(const char *id)
320 {
321 ENGINE *iterator = NULL;
322 if(id == NULL)
323 {
324 ENGINEerr(ENGINE_F_ENGINE_BY_ID,
325 ERR_R_PASSED_NULL_PARAMETER);
326 return NULL;
327 }
328 CRYPTO_r_lock(CRYPTO_LOCK_ENGINE);
329 if(!engine_internal_check())
330 ENGINEerr(ENGINE_F_ENGINE_BY_ID,
331 ENGINE_R_INTERNAL_LIST_ERROR);
332 else
333 {
334 iterator = engine_list_head;
335 while(iterator && (strcmp(id, iterator->id) != 0))
336 iterator = iterator->next;
337 if(iterator)
338 /* We need to return a structural reference */
339 iterator->struct_ref++;
340 }
341 CRYPTO_r_unlock(CRYPTO_LOCK_ENGINE);
342 if(iterator == NULL)
343 ENGINEerr(ENGINE_F_ENGINE_BY_ID,
344 ENGINE_R_NO_SUCH_ENGINE);
345 return iterator;
346 }
347
348/* As per the comments in engine.h, it is generally better all round
349 * if the ENGINE structure is allocated within this framework. */
350#if 0
351int ENGINE_get_struct_size(void)
352 {
353 return sizeof(ENGINE);
354 }
355
356ENGINE *ENGINE_new(ENGINE *e)
357 {
358 ENGINE *ret;
359
360 if(e == NULL)
361 {
362 ret = (ENGINE *)(OPENSSL_malloc(sizeof(ENGINE));
363 if(ret == NULL)
364 {
365 ENGINEerr(ENGINE_F_ENGINE_NEW,
366 ERR_R_MALLOC_FAILURE);
367 return NULL;
368 }
369 }
370 else
371 ret = e;
372 memset(ret, 0, sizeof(ENGINE));
373 if(e)
374 ret->flags = ENGINE_FLAGS_MALLOCED;
375 ret->struct_ref = 1;
376 return ret;
377 }
378#else
379ENGINE *ENGINE_new(void)
380 {
381 ENGINE *ret;
382
383 ret = (ENGINE *)OPENSSL_malloc(sizeof(ENGINE));
384 if(ret == NULL)
385 {
386 ENGINEerr(ENGINE_F_ENGINE_NEW, ERR_R_MALLOC_FAILURE);
387 return NULL;
388 }
389 memset(ret, 0, sizeof(ENGINE));
390 ret->flags = ENGINE_FLAGS_MALLOCED;
391 ret->struct_ref = 1;
392 return ret;
393 }
394#endif
395
396int ENGINE_free(ENGINE *e)
397 {
398 int i;
399
400 if(e == NULL)
401 {
402 ENGINEerr(ENGINE_F_ENGINE_FREE,
403 ERR_R_PASSED_NULL_PARAMETER);
404 return 0;
405 }
406 i = CRYPTO_add(&e->struct_ref,-1,CRYPTO_LOCK_ENGINE);
407#ifdef REF_PRINT
408 REF_PRINT("ENGINE",e);
409#endif
410 if (i > 0) return 1;
411#ifdef REF_CHECK
412 if (i < 0)
413 {
414 fprintf(stderr,"ENGINE_free, bad reference count\n");
415 abort();
416 }
417#endif
418 if(e->flags & ENGINE_FLAGS_MALLOCED)
419 OPENSSL_free(e);
420 return 1;
421 }
422
423int ENGINE_set_id(ENGINE *e, const char *id)
424 {
425 if((e == NULL) || (id == NULL))
426 {
427 ENGINEerr(ENGINE_F_ENGINE_SET_ID,
428 ERR_R_PASSED_NULL_PARAMETER);
429 return 0;
430 }
431 e->id = id;
432 return 1;
433 }
434
435int ENGINE_set_name(ENGINE *e, const char *name)
436 {
437 if((e == NULL) || (name == NULL))
438 {
439 ENGINEerr(ENGINE_F_ENGINE_SET_NAME,
440 ERR_R_PASSED_NULL_PARAMETER);
441 return 0;
442 }
443 e->name = name;
444 return 1;
445 }
446
447int ENGINE_set_RSA(ENGINE *e, RSA_METHOD *rsa_meth)
448 {
449 if((e == NULL) || (rsa_meth == NULL))
450 {
451 ENGINEerr(ENGINE_F_ENGINE_SET_RSA,
452 ERR_R_PASSED_NULL_PARAMETER);
453 return 0;
454 }
455 e->rsa_meth = rsa_meth;
456 return 1;
457 }
458
459int ENGINE_set_DSA(ENGINE *e, DSA_METHOD *dsa_meth)
460 {
461 if((e == NULL) || (dsa_meth == NULL))
462 {
463 ENGINEerr(ENGINE_F_ENGINE_SET_DSA,
464 ERR_R_PASSED_NULL_PARAMETER);
465 return 0;
466 }
467 e->dsa_meth = dsa_meth;
468 return 1;
469 }
470
471int ENGINE_set_DH(ENGINE *e, DH_METHOD *dh_meth)
472 {
473 if((e == NULL) || (dh_meth == NULL))
474 {
475 ENGINEerr(ENGINE_F_ENGINE_SET_DH,
476 ERR_R_PASSED_NULL_PARAMETER);
477 return 0;
478 }
479 e->dh_meth = dh_meth;
480 return 1;
481 }
482
483int ENGINE_set_RAND(ENGINE *e, RAND_METHOD *rand_meth)
484 {
485 if((e == NULL) || (rand_meth == NULL))
486 {
487 ENGINEerr(ENGINE_F_ENGINE_SET_RAND,
488 ERR_R_PASSED_NULL_PARAMETER);
489 return 0;
490 }
491 e->rand_meth = rand_meth;
492 return 1;
493 }
494
495int ENGINE_set_BN_mod_exp(ENGINE *e, BN_MOD_EXP bn_mod_exp)
496 {
497 if((e == NULL) || (bn_mod_exp == NULL))
498 {
499 ENGINEerr(ENGINE_F_ENGINE_SET_BN_MOD_EXP,
500 ERR_R_PASSED_NULL_PARAMETER);
501 return 0;
502 }
503 e->bn_mod_exp = bn_mod_exp;
504 return 1;
505 }
506
507int ENGINE_set_BN_mod_exp_crt(ENGINE *e, BN_MOD_EXP_CRT bn_mod_exp_crt)
508 {
509 if((e == NULL) || (bn_mod_exp_crt == NULL))
510 {
511 ENGINEerr(ENGINE_F_ENGINE_SET_BN_MOD_EXP_CRT,
512 ERR_R_PASSED_NULL_PARAMETER);
513 return 0;
514 }
515 e->bn_mod_exp_crt = bn_mod_exp_crt;
516 return 1;
517 }
518
519int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f)
520 {
521 if((e == NULL) || (init_f == NULL))
522 {
523 ENGINEerr(ENGINE_F_ENGINE_SET_INIT_FUNCTION,
524 ERR_R_PASSED_NULL_PARAMETER);
525 return 0;
526 }
527 e->init = init_f;
528 return 1;
529 }
530
531int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f)
532 {
533 if((e == NULL) || (finish_f == NULL))
534 {
535 ENGINEerr(ENGINE_F_ENGINE_SET_FINISH_FUNCTION,
536 ERR_R_PASSED_NULL_PARAMETER);
537 return 0;
538 }
539 e->finish = finish_f;
540 return 1;
541 }
542
543int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f)
544 {
545 if((e == NULL) || (ctrl_f == NULL))
546 {
547 ENGINEerr(ENGINE_F_ENGINE_SET_CTRL_FUNCTION,
548 ERR_R_PASSED_NULL_PARAMETER);
549 return 0;
550 }
551 e->ctrl = ctrl_f;
552 return 1;
553 }
554
555const char *ENGINE_get_id(ENGINE *e)
556 {
557 if(e == NULL)
558 {
559 ENGINEerr(ENGINE_F_ENGINE_GET_ID,
560 ERR_R_PASSED_NULL_PARAMETER);
561 return 0;
562 }
563 return e->id;
564 }
565
566const char *ENGINE_get_name(ENGINE *e)
567 {
568 if(e == NULL)
569 {
570 ENGINEerr(ENGINE_F_ENGINE_GET_NAME,
571 ERR_R_PASSED_NULL_PARAMETER);
572 return 0;
573 }
574 return e->name;
575 }
576
577RSA_METHOD *ENGINE_get_RSA(ENGINE *e)
578 {
579 if(e == NULL)
580 {
581 ENGINEerr(ENGINE_F_ENGINE_GET_RSA,
582 ERR_R_PASSED_NULL_PARAMETER);
583 return NULL;
584 }
585 return e->rsa_meth;
586 }
587
588DSA_METHOD *ENGINE_get_DSA(ENGINE *e)
589 {
590 if(e == NULL)
591 {
592 ENGINEerr(ENGINE_F_ENGINE_GET_DSA,
593 ERR_R_PASSED_NULL_PARAMETER);
594 return NULL;
595 }
596 return e->dsa_meth;
597 }
598
599DH_METHOD *ENGINE_get_DH(ENGINE *e)
600 {
601 if(e == NULL)
602 {
603 ENGINEerr(ENGINE_F_ENGINE_GET_DH,
604 ERR_R_PASSED_NULL_PARAMETER);
605 return NULL;
606 }
607 return e->dh_meth;
608 }
609
610RAND_METHOD *ENGINE_get_RAND(ENGINE *e)
611 {
612 if(e == NULL)
613 {
614 ENGINEerr(ENGINE_F_ENGINE_GET_RAND,
615 ERR_R_PASSED_NULL_PARAMETER);
616 return NULL;
617 }
618 return e->rand_meth;
619 }
620
621BN_MOD_EXP ENGINE_get_BN_mod_exp(ENGINE *e)
622 {
623 if(e == NULL)
624 {
625 ENGINEerr(ENGINE_F_ENGINE_GET_BN_MOD_EXP,
626 ERR_R_PASSED_NULL_PARAMETER);
627 return NULL;
628 }
629 return e->bn_mod_exp;
630 }
631
632BN_MOD_EXP_CRT ENGINE_get_BN_mod_exp_crt(ENGINE *e)
633 {
634 if(e == NULL)
635 {
636 ENGINEerr(ENGINE_F_ENGINE_GET_BN_MOD_EXP_CRT,
637 ERR_R_PASSED_NULL_PARAMETER);
638 return NULL;
639 }
640 return e->bn_mod_exp_crt;
641 }
642
643ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(ENGINE *e)
644 {
645 if(e == NULL)
646 {
647 ENGINEerr(ENGINE_F_ENGINE_GET_INIT_FUNCTION,
648 ERR_R_PASSED_NULL_PARAMETER);
649 return NULL;
650 }
651 return e->init;
652 }
653
654ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(ENGINE *e)
655 {
656 if(e == NULL)
657 {
658 ENGINEerr(ENGINE_F_ENGINE_GET_FINISH_FUNCTION,
659 ERR_R_PASSED_NULL_PARAMETER);
660 return NULL;
661 }
662 return e->finish;
663 }
664
665ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(ENGINE *e)
666 {
667 if(e == NULL)
668 {
669 ENGINEerr(ENGINE_F_ENGINE_GET_CTRL_FUNCTION,
670 ERR_R_PASSED_NULL_PARAMETER);
671 return NULL;
672 }
673 return e->ctrl;
674 }
675
diff --git a/src/lib/libcrypto/engine/engine_openssl.c b/src/lib/libcrypto/engine/engine_openssl.c
new file mode 100644
index 0000000000..9636f51168
--- /dev/null
+++ b/src/lib/libcrypto/engine/engine_openssl.c
@@ -0,0 +1,174 @@
1/* crypto/engine/engine_openssl.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59
60#include <stdio.h>
61#include <openssl/crypto.h>
62#include "cryptlib.h"
63#include "engine_int.h"
64#include <openssl/engine.h>
65#include <openssl/dso.h>
66#include <openssl/rsa.h>
67#include <openssl/dsa.h>
68#include <openssl/dh.h>
69#include <openssl/rand.h>
70#include <openssl/bn.h>
71
72/* This is the only function we need to implement as OpenSSL
73 * doesn't have a native CRT mod_exp. Perhaps this should be
74 * BN_mod_exp_crt and moved into crypto/bn/ ?? ... dunno. */
75static int openssl_mod_exp_crt(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
76 const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
77 const BIGNUM *iqmp, BN_CTX *ctx);
78
79/* The ENGINE structure that can be pointed to. */
80static ENGINE engine_openssl =
81 {
82 "openssl",
83 "Software default engine support",
84 NULL,
85 NULL,
86 NULL, /* these methods are "stolen" in ENGINE_openssl() */
87 NULL,
88 NULL,
89 openssl_mod_exp_crt,
90 NULL, /* no init() */
91 NULL, /* no finish() */
92 NULL, /* no ctrl() */
93 NULL, /* no load_privkey() */
94 NULL, /* no load_pubkey() */
95 0, /* no flags */
96 0, 0, /* no references. */
97 NULL, NULL /* unlinked */
98 };
99
100/* As this is only ever called once, there's no need for locking
101 * (indeed - the lock will already be held by our caller!!!) */
102ENGINE *ENGINE_openssl()
103 {
104 /* We need to populate our structure with the software pointers
105 * that we want to steal. */
106 engine_openssl.rsa_meth = RSA_get_default_openssl_method();
107 engine_openssl.dsa_meth = DSA_get_default_openssl_method();
108 engine_openssl.dh_meth = DH_get_default_openssl_method();
109 engine_openssl.rand_meth = RAND_SSLeay();
110 engine_openssl.bn_mod_exp = BN_mod_exp;
111 return &engine_openssl;
112 }
113
114/* Chinese Remainder Theorem, taken and adapted from rsa_eay.c */
115static int openssl_mod_exp_crt(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
116 const BIGNUM *q, const BIGNUM *dmp1,
117 const BIGNUM *dmq1, const BIGNUM *iqmp, BN_CTX *ctx)
118 {
119 BIGNUM r1,m1;
120 int ret=0;
121 BN_CTX *bn_ctx;
122 BIGNUM *temp_bn = NULL;
123
124 if (ctx)
125 bn_ctx = ctx;
126 else
127 if ((bn_ctx=BN_CTX_new()) == NULL) goto err;
128 BN_init(&m1);
129 BN_init(&r1);
130 /* BN_mul() cannot accept const BIGNUMs so I use the BN_CTX
131 * to duplicate what I need. <sigh> */
132 if ((temp_bn = BN_CTX_get(bn_ctx)) == NULL) goto err;
133 if (!BN_copy(temp_bn, iqmp)) goto err;
134
135 if (!BN_mod(&r1, a, q, bn_ctx)) goto err;
136 if (!engine_openssl.bn_mod_exp(&m1, &r1, dmq1, q, bn_ctx))
137 goto err;
138
139 if (!BN_mod(&r1, a, p, bn_ctx)) goto err;
140 if (!engine_openssl.bn_mod_exp(r, &r1, dmp1, p, bn_ctx))
141 goto err;
142
143 if (!BN_sub(r, r, &m1)) goto err;
144 /* This will help stop the size of r0 increasing, which does
145 * affect the multiply if it optimised for a power of 2 size */
146 if (r->neg)
147 if (!BN_add(r, r, p)) goto err;
148
149 if (!BN_mul(&r1, r, temp_bn, bn_ctx)) goto err;
150 if (!BN_mod(r, &r1, p, bn_ctx)) goto err;
151 /* If p < q it is occasionally possible for the correction of
152 * adding 'p' if r is negative above to leave the result still
153 * negative. This can break the private key operations: the following
154 * second correction should *always* correct this rare occurrence.
155 * This will *never* happen with OpenSSL generated keys because
156 * they ensure p > q [steve]
157 */
158 if (r->neg)
159 if (!BN_add(r, r, p)) goto err;
160 /* Again, BN_mul() will need non-const values. */
161 if (!BN_copy(temp_bn, q)) goto err;
162 if (!BN_mul(&r1, r, temp_bn, bn_ctx)) goto err;
163 if (!BN_add(r, &r1, &m1)) goto err;
164
165 ret=1;
166err:
167 BN_clear_free(&m1);
168 BN_clear_free(&r1);
169 if (temp_bn)
170 bn_ctx->tos--;
171 if (!ctx)
172 BN_CTX_free(bn_ctx);
173 return(ret);
174 }
diff --git a/src/lib/libcrypto/engine/enginetest.c b/src/lib/libcrypto/engine/enginetest.c
new file mode 100644
index 0000000000..a5a3c47fcb
--- /dev/null
+++ b/src/lib/libcrypto/engine/enginetest.c
@@ -0,0 +1,251 @@
1/* crypto/engine/enginetest.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <string.h>
61#include <openssl/engine.h>
62#include <openssl/err.h>
63
64static void display_engine_list()
65 {
66 ENGINE *h;
67 int loop;
68
69 h = ENGINE_get_first();
70 loop = 0;
71 printf("listing available engine types\n");
72 while(h)
73 {
74 printf("engine %i, id = \"%s\", name = \"%s\"\n",
75 loop++, ENGINE_get_id(h), ENGINE_get_name(h));
76 h = ENGINE_get_next(h);
77 }
78 printf("end of list\n");
79 }
80
81int main(int argc, char *argv[])
82 {
83 ENGINE *block[512];
84 char buf[256];
85 const char *id, *name;
86 ENGINE *ptr;
87 int loop;
88 int to_return = 1;
89 ENGINE *new_h1 = NULL;
90 ENGINE *new_h2 = NULL;
91 ENGINE *new_h3 = NULL;
92 ENGINE *new_h4 = NULL;
93
94 ERR_load_crypto_strings();
95
96 memset(block, 0, 512 * sizeof(ENGINE *));
97 if(((new_h1 = ENGINE_new()) == NULL) ||
98 !ENGINE_set_id(new_h1, "test_id0") ||
99 !ENGINE_set_name(new_h1, "First test item") ||
100 ((new_h2 = ENGINE_new()) == NULL) ||
101 !ENGINE_set_id(new_h2, "test_id1") ||
102 !ENGINE_set_name(new_h2, "Second test item") ||
103 ((new_h3 = ENGINE_new()) == NULL) ||
104 !ENGINE_set_id(new_h3, "test_id2") ||
105 !ENGINE_set_name(new_h3, "Third test item") ||
106 ((new_h4 = ENGINE_new()) == NULL) ||
107 !ENGINE_set_id(new_h4, "test_id3") ||
108 !ENGINE_set_name(new_h4, "Fourth test item"))
109 {
110 printf("Couldn't set up test ENGINE structures\n");
111 goto end;
112 }
113 printf("\nenginetest beginning\n\n");
114 display_engine_list();
115 if(!ENGINE_add(new_h1))
116 {
117 printf("Add failed!\n");
118 goto end;
119 }
120 display_engine_list();
121 ptr = ENGINE_get_first();
122 if(!ENGINE_remove(ptr))
123 {
124 printf("Remove failed!\n");
125 goto end;
126 }
127 display_engine_list();
128 if(!ENGINE_add(new_h3) || !ENGINE_add(new_h2))
129 {
130 printf("Add failed!\n");
131 goto end;
132 }
133 display_engine_list();
134 if(!ENGINE_remove(new_h2))
135 {
136 printf("Remove failed!\n");
137 goto end;
138 }
139 display_engine_list();
140 if(!ENGINE_add(new_h4))
141 {
142 printf("Add failed!\n");
143 goto end;
144 }
145 display_engine_list();
146 if(ENGINE_add(new_h3))
147 {
148 printf("Add *should* have failed but didn't!\n");
149 goto end;
150 }
151 else
152 printf("Add that should fail did.\n");
153 ERR_clear_error();
154 if(ENGINE_remove(new_h2))
155 {
156 printf("Remove *should* have failed but didn't!\n");
157 goto end;
158 }
159 else
160 printf("Remove that should fail did.\n");
161 if(!ENGINE_remove(new_h1))
162 {
163 printf("Remove failed!\n");
164 goto end;
165 }
166 display_engine_list();
167 if(!ENGINE_remove(new_h3))
168 {
169 printf("Remove failed!\n");
170 goto end;
171 }
172 display_engine_list();
173 if(!ENGINE_remove(new_h4))
174 {
175 printf("Remove failed!\n");
176 goto end;
177 }
178 display_engine_list();
179 /* Depending on whether there's any hardware support compiled
180 * in, this remove may be destined to fail. */
181 ptr = ENGINE_get_first();
182 if(ptr)
183 if(!ENGINE_remove(ptr))
184 printf("Remove failed!i - probably no hardware "
185 "support present.\n");
186 display_engine_list();
187 if(!ENGINE_add(new_h1) || !ENGINE_remove(new_h1))
188 {
189 printf("Couldn't add and remove to an empty list!\n");
190 goto end;
191 }
192 else
193 printf("Successfully added and removed to an empty list!\n");
194 printf("About to beef up the engine-type list\n");
195 for(loop = 0; loop < 512; loop++)
196 {
197 sprintf(buf, "id%i", loop);
198 id = strdup(buf);
199 sprintf(buf, "Fake engine type %i", loop);
200 name = strdup(buf);
201 if(((block[loop] = ENGINE_new()) == NULL) ||
202 !ENGINE_set_id(block[loop], id) ||
203 !ENGINE_set_name(block[loop], name))
204 {
205 printf("Couldn't create block of ENGINE structures.\n"
206 "I'll probably also core-dump now, damn.\n");
207 goto end;
208 }
209 }
210 for(loop = 0; loop < 512; loop++)
211 {
212 if(!ENGINE_add(block[loop]))
213 {
214 printf("\nAdding stopped at %i, (%s,%s)\n",
215 loop, ENGINE_get_id(block[loop]),
216 ENGINE_get_name(block[loop]));
217 goto cleanup_loop;
218 }
219 else
220 printf("."); fflush(stdout);
221 }
222cleanup_loop:
223 printf("\nAbout to empty the engine-type list\n");
224 while((ptr = ENGINE_get_first()) != NULL)
225 {
226 if(!ENGINE_remove(ptr))
227 {
228 printf("\nRemove failed!\n");
229 goto end;
230 }
231 printf("."); fflush(stdout);
232 }
233 for(loop = 0; loop < 512; loop++)
234 {
235 free((char *)(ENGINE_get_id(block[loop])));
236 free((char *)(ENGINE_get_name(block[loop])));
237 }
238 printf("\nTests completed happily\n");
239 to_return = 0;
240end:
241 if(to_return)
242 ERR_print_errors_fp(stderr);
243 if(new_h1) ENGINE_free(new_h1);
244 if(new_h2) ENGINE_free(new_h2);
245 if(new_h3) ENGINE_free(new_h3);
246 if(new_h4) ENGINE_free(new_h4);
247 for(loop = 0; loop < 512; loop++)
248 if(block[loop])
249 ENGINE_free(block[loop]);
250 return to_return;
251 }
diff --git a/src/lib/libcrypto/engine/hw_atalla.c b/src/lib/libcrypto/engine/hw_atalla.c
new file mode 100644
index 0000000000..3bb992a193
--- /dev/null
+++ b/src/lib/libcrypto/engine/hw_atalla.c
@@ -0,0 +1,444 @@
1/* crypto/engine/hw_atalla.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <openssl/crypto.h>
61#include "cryptlib.h"
62#include <openssl/dso.h>
63#include "engine_int.h"
64#include <openssl/engine.h>
65
66#ifndef NO_HW
67#ifndef NO_HW_ATALLA
68
69#ifdef FLAT_INC
70#include "atalla.h"
71#else
72#include "vendor_defns/atalla.h"
73#endif
74
75static int atalla_init(void);
76static int atalla_finish(void);
77
78/* BIGNUM stuff */
79static int atalla_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
80 const BIGNUM *m, BN_CTX *ctx);
81
82/* RSA stuff */
83static int atalla_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa);
84/* This function is aliased to mod_exp (with the mont stuff dropped). */
85static int atalla_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
86 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
87
88/* DSA stuff */
89static int atalla_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
90 BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
91 BN_CTX *ctx, BN_MONT_CTX *in_mont);
92static int atalla_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
93 const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
94 BN_MONT_CTX *m_ctx);
95
96/* DH stuff */
97/* This function is alised to mod_exp (with the DH and mont dropped). */
98static int atalla_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
99 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
100
101
102/* Our internal RSA_METHOD that we provide pointers to */
103static RSA_METHOD atalla_rsa =
104 {
105 "Atalla RSA method",
106 NULL,
107 NULL,
108 NULL,
109 NULL,
110 atalla_rsa_mod_exp,
111 atalla_mod_exp_mont,
112 NULL,
113 NULL,
114 0,
115 NULL,
116 NULL,
117 NULL
118 };
119
120/* Our internal DSA_METHOD that we provide pointers to */
121static DSA_METHOD atalla_dsa =
122 {
123 "Atalla DSA method",
124 NULL, /* dsa_do_sign */
125 NULL, /* dsa_sign_setup */
126 NULL, /* dsa_do_verify */
127 atalla_dsa_mod_exp, /* dsa_mod_exp */
128 atalla_mod_exp_dsa, /* bn_mod_exp */
129 NULL, /* init */
130 NULL, /* finish */
131 0, /* flags */
132 NULL /* app_data */
133 };
134
135/* Our internal DH_METHOD that we provide pointers to */
136static DH_METHOD atalla_dh =
137 {
138 "Atalla DH method",
139 NULL,
140 NULL,
141 atalla_mod_exp_dh,
142 NULL,
143 NULL,
144 0,
145 NULL
146 };
147
148/* Our ENGINE structure. */
149static ENGINE engine_atalla =
150 {
151 "atalla",
152 "Atalla hardware engine support",
153 &atalla_rsa,
154 &atalla_dsa,
155 &atalla_dh,
156 NULL,
157 atalla_mod_exp,
158 NULL,
159 atalla_init,
160 atalla_finish,
161 NULL, /* no ctrl() */
162 NULL, /* no load_privkey() */
163 NULL, /* no load_pubkey() */
164 0, /* no flags */
165 0, 0, /* no references */
166 NULL, NULL /* unlinked */
167 };
168
169/* As this is only ever called once, there's no need for locking
170 * (indeed - the lock will already be held by our caller!!!) */
171ENGINE *ENGINE_atalla()
172 {
173 RSA_METHOD *meth1;
174 DSA_METHOD *meth2;
175 DH_METHOD *meth3;
176
177 /* We know that the "PKCS1_SSLeay()" functions hook properly
178 * to the atalla-specific mod_exp and mod_exp_crt so we use
179 * those functions. NB: We don't use ENGINE_openssl() or
180 * anything "more generic" because something like the RSAref
181 * code may not hook properly, and if you own one of these
182 * cards then you have the right to do RSA operations on it
183 * anyway! */
184 meth1 = RSA_PKCS1_SSLeay();
185 atalla_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
186 atalla_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
187 atalla_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
188 atalla_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
189
190 /* Use the DSA_OpenSSL() method and just hook the mod_exp-ish
191 * bits. */
192 meth2 = DSA_OpenSSL();
193 atalla_dsa.dsa_do_sign = meth2->dsa_do_sign;
194 atalla_dsa.dsa_sign_setup = meth2->dsa_sign_setup;
195 atalla_dsa.dsa_do_verify = meth2->dsa_do_verify;
196
197 /* Much the same for Diffie-Hellman */
198 meth3 = DH_OpenSSL();
199 atalla_dh.generate_key = meth3->generate_key;
200 atalla_dh.compute_key = meth3->compute_key;
201 return &engine_atalla;
202 }
203
204/* This is a process-global DSO handle used for loading and unloading
205 * the Atalla library. NB: This is only set (or unset) during an
206 * init() or finish() call (reference counts permitting) and they're
207 * operating with global locks, so this should be thread-safe
208 * implicitly. */
209static DSO *atalla_dso = NULL;
210
211/* These are the function pointers that are (un)set when the library has
212 * successfully (un)loaded. */
213static tfnASI_GetHardwareConfig *p_Atalla_GetHardwareConfig = NULL;
214static tfnASI_RSAPrivateKeyOpFn *p_Atalla_RSAPrivateKeyOpFn = NULL;
215static tfnASI_GetPerformanceStatistics *p_Atalla_GetPerformanceStatistics = NULL;
216
217/* (de)initialisation functions. */
218static int atalla_init()
219 {
220 tfnASI_GetHardwareConfig *p1;
221 tfnASI_RSAPrivateKeyOpFn *p2;
222 tfnASI_GetPerformanceStatistics *p3;
223 /* Not sure of the origin of this magic value, but Ben's code had it
224 * and it seemed to have been working for a few people. :-) */
225 unsigned int config_buf[1024];
226
227 if(atalla_dso != NULL)
228 {
229 ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_ALREADY_LOADED);
230 goto err;
231 }
232 /* Attempt to load libatasi.so/atasi.dll/whatever. Needs to be
233 * changed unfortunately because the Atalla drivers don't have
234 * standard library names that can be platform-translated well. */
235 /* TODO: Work out how to actually map to the names the Atalla
236 * drivers really use - for now a symbollic link needs to be
237 * created on the host system from libatasi.so to atasi.so on
238 * unix variants. */
239 atalla_dso = DSO_load(NULL, ATALLA_LIBNAME, NULL,
240 DSO_FLAG_NAME_TRANSLATION);
241 if(atalla_dso == NULL)
242 {
243 ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_DSO_FAILURE);
244 goto err;
245 }
246 if(!(p1 = (tfnASI_GetHardwareConfig *)DSO_bind_func(
247 atalla_dso, ATALLA_F1)) ||
248 !(p2 = (tfnASI_RSAPrivateKeyOpFn *)DSO_bind_func(
249 atalla_dso, ATALLA_F2)) ||
250 !(p3 = (tfnASI_GetPerformanceStatistics *)DSO_bind_func(
251 atalla_dso, ATALLA_F3)))
252 {
253 ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_DSO_FAILURE);
254 goto err;
255 }
256 /* Copy the pointers */
257 p_Atalla_GetHardwareConfig = p1;
258 p_Atalla_RSAPrivateKeyOpFn = p2;
259 p_Atalla_GetPerformanceStatistics = p3;
260 /* Perform a basic test to see if there's actually any unit
261 * running. */
262 if(p1(0L, config_buf) != 0)
263 {
264 ENGINEerr(ENGINE_F_ATALLA_INIT,ENGINE_R_UNIT_FAILURE);
265 goto err;
266 }
267 /* Everything's fine. */
268 return 1;
269err:
270 if(atalla_dso)
271 DSO_free(atalla_dso);
272 p_Atalla_GetHardwareConfig = NULL;
273 p_Atalla_RSAPrivateKeyOpFn = NULL;
274 p_Atalla_GetPerformanceStatistics = NULL;
275 return 0;
276 }
277
278static int atalla_finish()
279 {
280 if(atalla_dso == NULL)
281 {
282 ENGINEerr(ENGINE_F_ATALLA_FINISH,ENGINE_R_NOT_LOADED);
283 return 0;
284 }
285 if(!DSO_free(atalla_dso))
286 {
287 ENGINEerr(ENGINE_F_ATALLA_FINISH,ENGINE_R_DSO_FAILURE);
288 return 0;
289 }
290 atalla_dso = NULL;
291 p_Atalla_GetHardwareConfig = NULL;
292 p_Atalla_RSAPrivateKeyOpFn = NULL;
293 p_Atalla_GetPerformanceStatistics = NULL;
294 return 1;
295 }
296
297static int atalla_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
298 const BIGNUM *m, BN_CTX *ctx)
299 {
300 /* I need somewhere to store temporary serialised values for
301 * use with the Atalla API calls. A neat cheat - I'll use
302 * BIGNUMs from the BN_CTX but access their arrays directly as
303 * byte arrays <grin>. This way I don't have to clean anything
304 * up. */
305 BIGNUM *modulus;
306 BIGNUM *exponent;
307 BIGNUM *argument;
308 BIGNUM *result;
309 RSAPrivateKey keydata;
310 int to_return, numbytes;
311
312 modulus = exponent = argument = result = NULL;
313 to_return = 0; /* expect failure */
314
315 if(!atalla_dso)
316 {
317 ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_NOT_LOADED);
318 goto err;
319 }
320 /* Prepare the params */
321 modulus = BN_CTX_get(ctx);
322 exponent = BN_CTX_get(ctx);
323 argument = BN_CTX_get(ctx);
324 result = BN_CTX_get(ctx);
325 if(!modulus || !exponent || !argument || !result)
326 {
327 ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_BN_CTX_FULL);
328 goto err;
329 }
330 if(!bn_wexpand(modulus, m->top) || !bn_wexpand(exponent, m->top) ||
331 !bn_wexpand(argument, m->top) || !bn_wexpand(result, m->top))
332 {
333 ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_BN_EXPAND_FAIL);
334 goto err;
335 }
336 /* Prepare the key-data */
337 memset(&keydata, 0,sizeof keydata);
338 numbytes = BN_num_bytes(m);
339 memset(exponent->d, 0, numbytes);
340 memset(modulus->d, 0, numbytes);
341 BN_bn2bin(p, (unsigned char *)exponent->d + numbytes - BN_num_bytes(p));
342 BN_bn2bin(m, (unsigned char *)modulus->d + numbytes - BN_num_bytes(m));
343 keydata.privateExponent.data = (unsigned char *)exponent->d;
344 keydata.privateExponent.len = numbytes;
345 keydata.modulus.data = (unsigned char *)modulus->d;
346 keydata.modulus.len = numbytes;
347 /* Prepare the argument */
348 memset(argument->d, 0, numbytes);
349 memset(result->d, 0, numbytes);
350 BN_bn2bin(a, (unsigned char *)argument->d + numbytes - BN_num_bytes(a));
351 /* Perform the operation */
352 if(p_Atalla_RSAPrivateKeyOpFn(&keydata, (unsigned char *)result->d,
353 (unsigned char *)argument->d,
354 keydata.modulus.len) != 0)
355 {
356 ENGINEerr(ENGINE_F_ATALLA_MOD_EXP,ENGINE_R_REQUEST_FAILED);
357 goto err;
358 }
359 /* Convert the response */
360 BN_bin2bn((unsigned char *)result->d, numbytes, r);
361 to_return = 1;
362err:
363 if(modulus) ctx->tos--;
364 if(exponent) ctx->tos--;
365 if(argument) ctx->tos--;
366 if(result) ctx->tos--;
367 return to_return;
368 }
369
370static int atalla_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
371 {
372 BN_CTX *ctx = NULL;
373 int to_return = 0;
374
375 if(!atalla_dso)
376 {
377 ENGINEerr(ENGINE_F_ATALLA_RSA_MOD_EXP,ENGINE_R_NOT_LOADED);
378 goto err;
379 }
380 if((ctx = BN_CTX_new()) == NULL)
381 goto err;
382 if(!rsa->d || !rsa->n)
383 {
384 ENGINEerr(ENGINE_F_ATALLA_RSA_MOD_EXP,ENGINE_R_MISSING_KEY_COMPONENTS);
385 goto err;
386 }
387 to_return = atalla_mod_exp(r0, I, rsa->d, rsa->n, ctx);
388err:
389 if(ctx)
390 BN_CTX_free(ctx);
391 return to_return;
392 }
393
394/* This code was liberated and adapted from the commented-out code in
395 * dsa_ossl.c. Because of the unoptimised form of the Atalla acceleration
396 * (it doesn't have a CRT form for RSA), this function means that an
397 * Atalla system running with a DSA server certificate can handshake
398 * around 5 or 6 times faster/more than an equivalent system running with
399 * RSA. Just check out the "signs" statistics from the RSA and DSA parts
400 * of "openssl speed -engine atalla dsa1024 rsa1024". */
401static int atalla_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
402 BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
403 BN_CTX *ctx, BN_MONT_CTX *in_mont)
404 {
405 BIGNUM t;
406 int to_return = 0;
407
408 BN_init(&t);
409 /* let rr = a1 ^ p1 mod m */
410 if (!atalla_mod_exp(rr,a1,p1,m,ctx)) goto end;
411 /* let t = a2 ^ p2 mod m */
412 if (!atalla_mod_exp(&t,a2,p2,m,ctx)) goto end;
413 /* let rr = rr * t mod m */
414 if (!BN_mod_mul(rr,rr,&t,m,ctx)) goto end;
415 to_return = 1;
416end:
417 BN_free(&t);
418 return to_return;
419 }
420
421
422static int atalla_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a,
423 const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
424 BN_MONT_CTX *m_ctx)
425 {
426 return atalla_mod_exp(r, a, p, m, ctx);
427 }
428
429/* This function is aliased to mod_exp (with the mont stuff dropped). */
430static int atalla_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
431 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
432 {
433 return atalla_mod_exp(r, a, p, m, ctx);
434 }
435
436/* This function is aliased to mod_exp (with the dh and mont dropped). */
437static int atalla_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
438 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
439 {
440 return atalla_mod_exp(r, a, p, m, ctx);
441 }
442
443#endif /* !NO_HW_ATALLA */
444#endif /* !NO_HW */
diff --git a/src/lib/libcrypto/engine/hw_cswift.c b/src/lib/libcrypto/engine/hw_cswift.c
new file mode 100644
index 0000000000..77608b8983
--- /dev/null
+++ b/src/lib/libcrypto/engine/hw_cswift.c
@@ -0,0 +1,807 @@
1/* crypto/engine/hw_cswift.c */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <stdio.h>
60#include <openssl/crypto.h>
61#include "cryptlib.h"
62#include <openssl/dso.h>
63#include "engine_int.h"
64#include <openssl/engine.h>
65
66#ifndef NO_HW
67#ifndef NO_HW_CSWIFT
68
69/* Attribution notice: Rainbow have generously allowed me to reproduce
70 * the necessary definitions here from their API. This means the support
71 * can build independently of whether application builders have the
72 * API or hardware. This will allow developers to easily produce software
73 * that has latent hardware support for any users that have accelerators
74 * installed, without the developers themselves needing anything extra.
75 *
76 * I have only clipped the parts from the CryptoSwift header files that
77 * are (or seem) relevant to the CryptoSwift support code. This is
78 * simply to keep the file sizes reasonable.
79 * [Geoff]
80 */
81#ifdef FLAT_INC
82#include "cswift.h"
83#else
84#include "vendor_defns/cswift.h"
85#endif
86
87static int cswift_init(void);
88static int cswift_finish(void);
89
90/* BIGNUM stuff */
91static int cswift_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
92 const BIGNUM *m, BN_CTX *ctx);
93static int cswift_mod_exp_crt(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
94 const BIGNUM *q, const BIGNUM *dmp1, const BIGNUM *dmq1,
95 const BIGNUM *iqmp, BN_CTX *ctx);
96
97/* RSA stuff */
98static int cswift_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa);
99/* This function is aliased to mod_exp (with the mont stuff dropped). */
100static int cswift_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
101 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
102
103/* DSA stuff */
104static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa);
105static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
106 DSA_SIG *sig, DSA *dsa);
107
108/* DH stuff */
109/* This function is alised to mod_exp (with the DH and mont dropped). */
110static int cswift_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
111 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
112
113
114/* Our internal RSA_METHOD that we provide pointers to */
115static RSA_METHOD cswift_rsa =
116 {
117 "CryptoSwift RSA method",
118 NULL,
119 NULL,
120 NULL,
121 NULL,
122 cswift_rsa_mod_exp,
123 cswift_mod_exp_mont,
124 NULL,
125 NULL,
126 0,
127 NULL,
128 NULL,
129 NULL
130 };
131
132/* Our internal DSA_METHOD that we provide pointers to */
133static DSA_METHOD cswift_dsa =
134 {
135 "CryptoSwift DSA method",
136 cswift_dsa_sign,
137 NULL, /* dsa_sign_setup */
138 cswift_dsa_verify,
139 NULL, /* dsa_mod_exp */
140 NULL, /* bn_mod_exp */
141 NULL, /* init */
142 NULL, /* finish */
143 0, /* flags */
144 NULL /* app_data */
145 };
146
147/* Our internal DH_METHOD that we provide pointers to */
148static DH_METHOD cswift_dh =
149 {
150 "CryptoSwift DH method",
151 NULL,
152 NULL,
153 cswift_mod_exp_dh,
154 NULL,
155 NULL,
156 0,
157 NULL
158 };
159
160/* Our ENGINE structure. */
161static ENGINE engine_cswift =
162 {
163 "cswift",
164 "CryptoSwift hardware engine support",
165 &cswift_rsa,
166 &cswift_dsa,
167 &cswift_dh,
168 NULL,
169 cswift_mod_exp,
170 cswift_mod_exp_crt,
171 cswift_init,
172 cswift_finish,
173 NULL, /* no ctrl() */
174 NULL, /* no load_privkey() */
175 NULL, /* no load_pubkey() */
176 0, /* no flags */
177 0, 0, /* no references */
178 NULL, NULL /* unlinked */
179 };
180
181/* As this is only ever called once, there's no need for locking
182 * (indeed - the lock will already be held by our caller!!!) */
183ENGINE *ENGINE_cswift()
184 {
185 RSA_METHOD *meth1;
186 DH_METHOD *meth2;
187
188 /* We know that the "PKCS1_SSLeay()" functions hook properly
189 * to the cswift-specific mod_exp and mod_exp_crt so we use
190 * those functions. NB: We don't use ENGINE_openssl() or
191 * anything "more generic" because something like the RSAref
192 * code may not hook properly, and if you own one of these
193 * cards then you have the right to do RSA operations on it
194 * anyway! */
195 meth1 = RSA_PKCS1_SSLeay();
196 cswift_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
197 cswift_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
198 cswift_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
199 cswift_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
200
201 /* Much the same for Diffie-Hellman */
202 meth2 = DH_OpenSSL();
203 cswift_dh.generate_key = meth2->generate_key;
204 cswift_dh.compute_key = meth2->compute_key;
205 return &engine_cswift;
206 }
207
208/* This is a process-global DSO handle used for loading and unloading
209 * the CryptoSwift library. NB: This is only set (or unset) during an
210 * init() or finish() call (reference counts permitting) and they're
211 * operating with global locks, so this should be thread-safe
212 * implicitly. */
213static DSO *cswift_dso = NULL;
214
215/* These are the function pointers that are (un)set when the library has
216 * successfully (un)loaded. */
217t_swAcquireAccContext *p_CSwift_AcquireAccContext = NULL;
218t_swAttachKeyParam *p_CSwift_AttachKeyParam = NULL;
219t_swSimpleRequest *p_CSwift_SimpleRequest = NULL;
220t_swReleaseAccContext *p_CSwift_ReleaseAccContext = NULL;
221
222/* Used in the DSO operations. */
223static const char *CSWIFT_LIBNAME = "swift";
224static const char *CSWIFT_F1 = "swAcquireAccContext";
225static const char *CSWIFT_F2 = "swAttachKeyParam";
226static const char *CSWIFT_F3 = "swSimpleRequest";
227static const char *CSWIFT_F4 = "swReleaseAccContext";
228
229
230/* CryptoSwift library functions and mechanics - these are used by the
231 * higher-level functions further down. NB: As and where there's no
232 * error checking, take a look lower down where these functions are
233 * called, the checking and error handling is probably down there. */
234
235/* utility function to obtain a context */
236static int get_context(SW_CONTEXT_HANDLE *hac)
237 {
238 SW_STATUS status;
239
240 status = p_CSwift_AcquireAccContext(hac);
241 if(status != SW_OK)
242 return 0;
243 return 1;
244 }
245
246/* similarly to release one. */
247static void release_context(SW_CONTEXT_HANDLE hac)
248 {
249 p_CSwift_ReleaseAccContext(hac);
250 }
251
252/* (de)initialisation functions. */
253static int cswift_init()
254 {
255 SW_CONTEXT_HANDLE hac;
256 t_swAcquireAccContext *p1;
257 t_swAttachKeyParam *p2;
258 t_swSimpleRequest *p3;
259 t_swReleaseAccContext *p4;
260
261 if(cswift_dso != NULL)
262 {
263 ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_ALREADY_LOADED);
264 goto err;
265 }
266 /* Attempt to load libswift.so/swift.dll/whatever. */
267 cswift_dso = DSO_load(NULL, CSWIFT_LIBNAME, NULL,
268 DSO_FLAG_NAME_TRANSLATION);
269 if(cswift_dso == NULL)
270 {
271 ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
272 goto err;
273 }
274 if(!(p1 = (t_swAcquireAccContext *)
275 DSO_bind_func(cswift_dso, CSWIFT_F1)) ||
276 !(p2 = (t_swAttachKeyParam *)
277 DSO_bind_func(cswift_dso, CSWIFT_F2)) ||
278 !(p3 = (t_swSimpleRequest *)
279 DSO_bind_func(cswift_dso, CSWIFT_F3)) ||
280 !(p4 = (t_swReleaseAccContext *)
281 DSO_bind_func(cswift_dso, CSWIFT_F4)))
282 {
283 ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_DSO_FAILURE);
284 goto err;
285 }
286 /* Copy the pointers */
287 p_CSwift_AcquireAccContext = p1;
288 p_CSwift_AttachKeyParam = p2;
289 p_CSwift_SimpleRequest = p3;
290 p_CSwift_ReleaseAccContext = p4;
291 /* Try and get a context - if not, we may have a DSO but no
292 * accelerator! */
293 if(!get_context(&hac))
294 {
295 ENGINEerr(ENGINE_F_CSWIFT_INIT,ENGINE_R_UNIT_FAILURE);
296 goto err;
297 }
298 release_context(hac);
299 /* Everything's fine. */
300 return 1;
301err:
302 if(cswift_dso)
303 DSO_free(cswift_dso);
304 p_CSwift_AcquireAccContext = NULL;
305 p_CSwift_AttachKeyParam = NULL;
306 p_CSwift_SimpleRequest = NULL;
307 p_CSwift_ReleaseAccContext = NULL;
308 return 0;
309 }
310
311static int cswift_finish()
312 {
313 if(cswift_dso == NULL)
314 {
315 ENGINEerr(ENGINE_F_CSWIFT_FINISH,ENGINE_R_NOT_LOADED);
316 return 0;
317 }
318 if(!DSO_free(cswift_dso))
319 {
320 ENGINEerr(ENGINE_F_CSWIFT_FINISH,ENGINE_R_DSO_FAILURE);
321 return 0;
322 }
323 cswift_dso = NULL;
324 p_CSwift_AcquireAccContext = NULL;
325 p_CSwift_AttachKeyParam = NULL;
326 p_CSwift_SimpleRequest = NULL;
327 p_CSwift_ReleaseAccContext = NULL;
328 return 1;
329 }
330
331/* Un petit mod_exp */
332static int cswift_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
333 const BIGNUM *m, BN_CTX *ctx)
334 {
335 /* I need somewhere to store temporary serialised values for
336 * use with the CryptoSwift API calls. A neat cheat - I'll use
337 * BIGNUMs from the BN_CTX but access their arrays directly as
338 * byte arrays <grin>. This way I don't have to clean anything
339 * up. */
340 BIGNUM *modulus;
341 BIGNUM *exponent;
342 BIGNUM *argument;
343 BIGNUM *result;
344 SW_STATUS sw_status;
345 SW_LARGENUMBER arg, res;
346 SW_PARAM sw_param;
347 SW_CONTEXT_HANDLE hac;
348 int to_return, acquired;
349
350 modulus = exponent = argument = result = NULL;
351 to_return = 0; /* expect failure */
352 acquired = 0;
353
354 if(!get_context(&hac))
355 {
356 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_GET_HANDLE_FAILED);
357 goto err;
358 }
359 acquired = 1;
360 /* Prepare the params */
361 modulus = BN_CTX_get(ctx);
362 exponent = BN_CTX_get(ctx);
363 argument = BN_CTX_get(ctx);
364 result = BN_CTX_get(ctx);
365 if(!modulus || !exponent || !argument || !result)
366 {
367 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_BN_CTX_FULL);
368 goto err;
369 }
370 if(!bn_wexpand(modulus, m->top) || !bn_wexpand(exponent, p->top) ||
371 !bn_wexpand(argument, a->top) || !bn_wexpand(result, m->top))
372 {
373 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_BN_EXPAND_FAIL);
374 goto err;
375 }
376 sw_param.type = SW_ALG_EXP;
377 sw_param.up.exp.modulus.nbytes = BN_bn2bin(m,
378 (unsigned char *)modulus->d);
379 sw_param.up.exp.modulus.value = (unsigned char *)modulus->d;
380 sw_param.up.exp.exponent.nbytes = BN_bn2bin(p,
381 (unsigned char *)exponent->d);
382 sw_param.up.exp.exponent.value = (unsigned char *)exponent->d;
383 /* Attach the key params */
384 sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
385 switch(sw_status)
386 {
387 case SW_OK:
388 break;
389 case SW_ERR_INPUT_SIZE:
390 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,
391 ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
392 goto err;
393 default:
394 {
395 char tmpbuf[20];
396 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_REQUEST_FAILED);
397 sprintf(tmpbuf, "%ld", sw_status);
398 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
399 }
400 goto err;
401 }
402 /* Prepare the argument and response */
403 arg.nbytes = BN_bn2bin(a, (unsigned char *)argument->d);
404 arg.value = (unsigned char *)argument->d;
405 res.nbytes = BN_num_bytes(m);
406 memset(result->d, 0, res.nbytes);
407 res.value = (unsigned char *)result->d;
408 /* Perform the operation */
409 if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP, &arg, 1,
410 &res, 1)) != SW_OK)
411 {
412 char tmpbuf[20];
413 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP,ENGINE_R_REQUEST_FAILED);
414 sprintf(tmpbuf, "%ld", sw_status);
415 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
416 goto err;
417 }
418 /* Convert the response */
419 BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
420 to_return = 1;
421err:
422 if(acquired)
423 release_context(hac);
424 if(modulus) ctx->tos--;
425 if(exponent) ctx->tos--;
426 if(argument) ctx->tos--;
427 if(result) ctx->tos--;
428 return to_return;
429 }
430
431/* Un petit mod_exp chinois */
432static int cswift_mod_exp_crt(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
433 const BIGNUM *q, const BIGNUM *dmp1,
434 const BIGNUM *dmq1, const BIGNUM *iqmp, BN_CTX *ctx)
435 {
436 SW_STATUS sw_status;
437 SW_LARGENUMBER arg, res;
438 SW_PARAM sw_param;
439 SW_CONTEXT_HANDLE hac;
440 BIGNUM *rsa_p = NULL;
441 BIGNUM *rsa_q = NULL;
442 BIGNUM *rsa_dmp1 = NULL;
443 BIGNUM *rsa_dmq1 = NULL;
444 BIGNUM *rsa_iqmp = NULL;
445 BIGNUM *argument = NULL;
446 BIGNUM *result = NULL;
447 int to_return = 0; /* expect failure */
448 int acquired = 0;
449
450 if(!get_context(&hac))
451 {
452 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_GET_HANDLE_FAILED);
453 goto err;
454 }
455 acquired = 1;
456 /* Prepare the params */
457 rsa_p = BN_CTX_get(ctx);
458 rsa_q = BN_CTX_get(ctx);
459 rsa_dmp1 = BN_CTX_get(ctx);
460 rsa_dmq1 = BN_CTX_get(ctx);
461 rsa_iqmp = BN_CTX_get(ctx);
462 argument = BN_CTX_get(ctx);
463 result = BN_CTX_get(ctx);
464 if(!rsa_p || !rsa_q || !rsa_dmp1 || !rsa_dmq1 || !rsa_iqmp ||
465 !argument || !result)
466 {
467 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_BN_CTX_FULL);
468 goto err;
469 }
470 if(!bn_wexpand(rsa_p, p->top) || !bn_wexpand(rsa_q, q->top) ||
471 !bn_wexpand(rsa_dmp1, dmp1->top) ||
472 !bn_wexpand(rsa_dmq1, dmq1->top) ||
473 !bn_wexpand(rsa_iqmp, iqmp->top) ||
474 !bn_wexpand(argument, a->top) ||
475 !bn_wexpand(result, p->top + q->top))
476 {
477 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_BN_EXPAND_FAIL);
478 goto err;
479 }
480 sw_param.type = SW_ALG_CRT;
481 sw_param.up.crt.p.nbytes = BN_bn2bin(p, (unsigned char *)rsa_p->d);
482 sw_param.up.crt.p.value = (unsigned char *)rsa_p->d;
483 sw_param.up.crt.q.nbytes = BN_bn2bin(q, (unsigned char *)rsa_q->d);
484 sw_param.up.crt.q.value = (unsigned char *)rsa_q->d;
485 sw_param.up.crt.dmp1.nbytes = BN_bn2bin(dmp1,
486 (unsigned char *)rsa_dmp1->d);
487 sw_param.up.crt.dmp1.value = (unsigned char *)rsa_dmp1->d;
488 sw_param.up.crt.dmq1.nbytes = BN_bn2bin(dmq1,
489 (unsigned char *)rsa_dmq1->d);
490 sw_param.up.crt.dmq1.value = (unsigned char *)rsa_dmq1->d;
491 sw_param.up.crt.iqmp.nbytes = BN_bn2bin(iqmp,
492 (unsigned char *)rsa_iqmp->d);
493 sw_param.up.crt.iqmp.value = (unsigned char *)rsa_iqmp->d;
494 /* Attach the key params */
495 sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
496 switch(sw_status)
497 {
498 case SW_OK:
499 break;
500 case SW_ERR_INPUT_SIZE:
501 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,
502 ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
503 goto err;
504 default:
505 {
506 char tmpbuf[20];
507 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_REQUEST_FAILED);
508 sprintf(tmpbuf, "%ld", sw_status);
509 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
510 }
511 goto err;
512 }
513 /* Prepare the argument and response */
514 arg.nbytes = BN_bn2bin(a, (unsigned char *)argument->d);
515 arg.value = (unsigned char *)argument->d;
516 res.nbytes = 2 * BN_num_bytes(p);
517 memset(result->d, 0, res.nbytes);
518 res.value = (unsigned char *)result->d;
519 /* Perform the operation */
520 if((sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_MODEXP_CRT, &arg, 1,
521 &res, 1)) != SW_OK)
522 {
523 char tmpbuf[20];
524 ENGINEerr(ENGINE_F_CSWIFT_MOD_EXP_CRT,ENGINE_R_REQUEST_FAILED);
525 sprintf(tmpbuf, "%ld", sw_status);
526 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
527 goto err;
528 }
529 /* Convert the response */
530 BN_bin2bn((unsigned char *)result->d, res.nbytes, r);
531 to_return = 1;
532err:
533 if(acquired)
534 release_context(hac);
535 if(rsa_p) ctx->tos--;
536 if(rsa_q) ctx->tos--;
537 if(rsa_dmp1) ctx->tos--;
538 if(rsa_dmq1) ctx->tos--;
539 if(rsa_iqmp) ctx->tos--;
540 if(argument) ctx->tos--;
541 if(result) ctx->tos--;
542 return to_return;
543 }
544
545static int cswift_rsa_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
546 {
547 BN_CTX *ctx;
548 int to_return = 0;
549
550 if((ctx = BN_CTX_new()) == NULL)
551 goto err;
552 if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
553 {
554 ENGINEerr(ENGINE_F_CSWIFT_RSA_MOD_EXP,ENGINE_R_MISSING_KEY_COMPONENTS);
555 goto err;
556 }
557 to_return = cswift_mod_exp_crt(r0, I, rsa->p, rsa->q, rsa->dmp1,
558 rsa->dmq1, rsa->iqmp, ctx);
559err:
560 if(ctx)
561 BN_CTX_free(ctx);
562 return to_return;
563 }
564
565/* This function is aliased to mod_exp (with the mont stuff dropped). */
566static int cswift_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
567 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
568 {
569 return cswift_mod_exp(r, a, p, m, ctx);
570 }
571
572static DSA_SIG *cswift_dsa_sign(const unsigned char *dgst, int dlen, DSA *dsa)
573 {
574 SW_CONTEXT_HANDLE hac;
575 SW_PARAM sw_param;
576 SW_STATUS sw_status;
577 SW_LARGENUMBER arg, res;
578 unsigned char *ptr;
579 BN_CTX *ctx;
580 BIGNUM *dsa_p = NULL;
581 BIGNUM *dsa_q = NULL;
582 BIGNUM *dsa_g = NULL;
583 BIGNUM *dsa_key = NULL;
584 BIGNUM *result = NULL;
585 DSA_SIG *to_return = NULL;
586 int acquired = 0;
587
588 if((ctx = BN_CTX_new()) == NULL)
589 goto err;
590 if(!get_context(&hac))
591 {
592 ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_GET_HANDLE_FAILED);
593 goto err;
594 }
595 acquired = 1;
596 /* Prepare the params */
597 dsa_p = BN_CTX_get(ctx);
598 dsa_q = BN_CTX_get(ctx);
599 dsa_g = BN_CTX_get(ctx);
600 dsa_key = BN_CTX_get(ctx);
601 result = BN_CTX_get(ctx);
602 if(!dsa_p || !dsa_q || !dsa_g || !dsa_key || !result)
603 {
604 ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_BN_CTX_FULL);
605 goto err;
606 }
607 if(!bn_wexpand(dsa_p, dsa->p->top) ||
608 !bn_wexpand(dsa_q, dsa->q->top) ||
609 !bn_wexpand(dsa_g, dsa->g->top) ||
610 !bn_wexpand(dsa_key, dsa->priv_key->top) ||
611 !bn_wexpand(result, dsa->p->top))
612 {
613 ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_BN_EXPAND_FAIL);
614 goto err;
615 }
616 sw_param.type = SW_ALG_DSA;
617 sw_param.up.dsa.p.nbytes = BN_bn2bin(dsa->p,
618 (unsigned char *)dsa_p->d);
619 sw_param.up.dsa.p.value = (unsigned char *)dsa_p->d;
620 sw_param.up.dsa.q.nbytes = BN_bn2bin(dsa->q,
621 (unsigned char *)dsa_q->d);
622 sw_param.up.dsa.q.value = (unsigned char *)dsa_q->d;
623 sw_param.up.dsa.g.nbytes = BN_bn2bin(dsa->g,
624 (unsigned char *)dsa_g->d);
625 sw_param.up.dsa.g.value = (unsigned char *)dsa_g->d;
626 sw_param.up.dsa.key.nbytes = BN_bn2bin(dsa->priv_key,
627 (unsigned char *)dsa_key->d);
628 sw_param.up.dsa.key.value = (unsigned char *)dsa_key->d;
629 /* Attach the key params */
630 sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
631 switch(sw_status)
632 {
633 case SW_OK:
634 break;
635 case SW_ERR_INPUT_SIZE:
636 ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,
637 ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
638 goto err;
639 default:
640 {
641 char tmpbuf[20];
642 ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_REQUEST_FAILED);
643 sprintf(tmpbuf, "%ld", sw_status);
644 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
645 }
646 goto err;
647 }
648 /* Prepare the argument and response */
649 arg.nbytes = dlen;
650 arg.value = (unsigned char *)dgst;
651 res.nbytes = BN_num_bytes(dsa->p);
652 memset(result->d, 0, res.nbytes);
653 res.value = (unsigned char *)result->d;
654 /* Perform the operation */
655 sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_DSS_SIGN, &arg, 1,
656 &res, 1);
657 if(sw_status != SW_OK)
658 {
659 char tmpbuf[20];
660 ENGINEerr(ENGINE_F_CSWIFT_DSA_SIGN,ENGINE_R_REQUEST_FAILED);
661 sprintf(tmpbuf, "%ld", sw_status);
662 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
663 goto err;
664 }
665 /* Convert the response */
666 ptr = (unsigned char *)result->d;
667 if((to_return = DSA_SIG_new()) == NULL)
668 goto err;
669 to_return->r = BN_bin2bn((unsigned char *)result->d, 20, NULL);
670 to_return->s = BN_bin2bn((unsigned char *)result->d + 20, 20, NULL);
671
672err:
673 if(acquired)
674 release_context(hac);
675 if(dsa_p) ctx->tos--;
676 if(dsa_q) ctx->tos--;
677 if(dsa_g) ctx->tos--;
678 if(dsa_key) ctx->tos--;
679 if(result) ctx->tos--;
680 if(ctx)
681 BN_CTX_free(ctx);
682 return to_return;
683 }
684
685static int cswift_dsa_verify(const unsigned char *dgst, int dgst_len,
686 DSA_SIG *sig, DSA *dsa)
687 {
688 SW_CONTEXT_HANDLE hac;
689 SW_PARAM sw_param;
690 SW_STATUS sw_status;
691 SW_LARGENUMBER arg[2], res;
692 unsigned long sig_result;
693 BN_CTX *ctx;
694 BIGNUM *dsa_p = NULL;
695 BIGNUM *dsa_q = NULL;
696 BIGNUM *dsa_g = NULL;
697 BIGNUM *dsa_key = NULL;
698 BIGNUM *argument = NULL;
699 int to_return = -1;
700 int acquired = 0;
701
702 if((ctx = BN_CTX_new()) == NULL)
703 goto err;
704 if(!get_context(&hac))
705 {
706 ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_GET_HANDLE_FAILED);
707 goto err;
708 }
709 acquired = 1;
710 /* Prepare the params */
711 dsa_p = BN_CTX_get(ctx);
712 dsa_q = BN_CTX_get(ctx);
713 dsa_g = BN_CTX_get(ctx);
714 dsa_key = BN_CTX_get(ctx);
715 argument = BN_CTX_get(ctx);
716 if(!dsa_p || !dsa_q || !dsa_g || !dsa_key || !argument)
717 {
718 ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_BN_CTX_FULL);
719 goto err;
720 }
721 if(!bn_wexpand(dsa_p, dsa->p->top) ||
722 !bn_wexpand(dsa_q, dsa->q->top) ||
723 !bn_wexpand(dsa_g, dsa->g->top) ||
724 !bn_wexpand(dsa_key, dsa->pub_key->top) ||
725 !bn_wexpand(argument, 40))
726 {
727 ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_BN_EXPAND_FAIL);
728 goto err;
729 }
730 sw_param.type = SW_ALG_DSA;
731 sw_param.up.dsa.p.nbytes = BN_bn2bin(dsa->p,
732 (unsigned char *)dsa_p->d);
733 sw_param.up.dsa.p.value = (unsigned char *)dsa_p->d;
734 sw_param.up.dsa.q.nbytes = BN_bn2bin(dsa->q,
735 (unsigned char *)dsa_q->d);
736 sw_param.up.dsa.q.value = (unsigned char *)dsa_q->d;
737 sw_param.up.dsa.g.nbytes = BN_bn2bin(dsa->g,
738 (unsigned char *)dsa_g->d);
739 sw_param.up.dsa.g.value = (unsigned char *)dsa_g->d;
740 sw_param.up.dsa.key.nbytes = BN_bn2bin(dsa->pub_key,
741 (unsigned char *)dsa_key->d);
742 sw_param.up.dsa.key.value = (unsigned char *)dsa_key->d;
743 /* Attach the key params */
744 sw_status = p_CSwift_AttachKeyParam(hac, &sw_param);
745 switch(sw_status)
746 {
747 case SW_OK:
748 break;
749 case SW_ERR_INPUT_SIZE:
750 ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,
751 ENGINE_R_SIZE_TOO_LARGE_OR_TOO_SMALL);
752 goto err;
753 default:
754 {
755 char tmpbuf[20];
756 ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_REQUEST_FAILED);
757 sprintf(tmpbuf, "%ld", sw_status);
758 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
759 }
760 goto err;
761 }
762 /* Prepare the argument and response */
763 arg[0].nbytes = dgst_len;
764 arg[0].value = (unsigned char *)dgst;
765 arg[1].nbytes = 40;
766 arg[1].value = (unsigned char *)argument->d;
767 memset(arg[1].value, 0, 40);
768 BN_bn2bin(sig->r, arg[1].value + 20 - BN_num_bytes(sig->r));
769 BN_bn2bin(sig->s, arg[1].value + 40 - BN_num_bytes(sig->s));
770 res.nbytes = 4; /* unsigned long */
771 res.value = (unsigned char *)(&sig_result);
772 /* Perform the operation */
773 sw_status = p_CSwift_SimpleRequest(hac, SW_CMD_DSS_VERIFY, arg, 2,
774 &res, 1);
775 if(sw_status != SW_OK)
776 {
777 char tmpbuf[20];
778 ENGINEerr(ENGINE_F_CSWIFT_DSA_VERIFY,ENGINE_R_REQUEST_FAILED);
779 sprintf(tmpbuf, "%ld", sw_status);
780 ERR_add_error_data(2, "CryptoSwift error number is ",tmpbuf);
781 goto err;
782 }
783 /* Convert the response */
784 to_return = ((sig_result == 0) ? 0 : 1);
785
786err:
787 if(acquired)
788 release_context(hac);
789 if(dsa_p) ctx->tos--;
790 if(dsa_q) ctx->tos--;
791 if(dsa_g) ctx->tos--;
792 if(dsa_key) ctx->tos--;
793 if(argument) ctx->tos--;
794 if(ctx)
795 BN_CTX_free(ctx);
796 return to_return;
797 }
798
799/* This function is aliased to mod_exp (with the dh and mont dropped). */
800static int cswift_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
801 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
802 {
803 return cswift_mod_exp(r, a, p, m, ctx);
804 }
805
806#endif /* !NO_HW_CSWIFT */
807#endif /* !NO_HW */
diff --git a/src/lib/libcrypto/engine/hw_ncipher.c b/src/lib/libcrypto/engine/hw_ncipher.c
new file mode 100644
index 0000000000..41f5900676
--- /dev/null
+++ b/src/lib/libcrypto/engine/hw_ncipher.c
@@ -0,0 +1,1019 @@
1/* crypto/engine/hw_ncipher.c -*- mode: C; c-file-style: "eay" -*- */
2/* Written by Richard Levitte (richard@levitte.org), Geoff Thorpe
3 * (geoff@geoffthorpe.net) and Dr Stephen N Henson (shenson@bigfoot.com)
4 * for the OpenSSL project 2000.
5 */
6/* ====================================================================
7 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgment:
23 * "This product includes software developed by the OpenSSL Project
24 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
25 *
26 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
27 * endorse or promote products derived from this software without
28 * prior written permission. For written permission, please contact
29 * licensing@OpenSSL.org.
30 *
31 * 5. Products derived from this software may not be called "OpenSSL"
32 * nor may "OpenSSL" appear in their names without prior written
33 * permission of the OpenSSL Project.
34 *
35 * 6. Redistributions of any form whatsoever must retain the following
36 * acknowledgment:
37 * "This product includes software developed by the OpenSSL Project
38 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
41 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
43 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
44 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
46 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
49 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
50 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51 * OF THE POSSIBILITY OF SUCH DAMAGE.
52 * ====================================================================
53 *
54 * This product includes cryptographic software written by Eric Young
55 * (eay@cryptsoft.com). This product includes software written by Tim
56 * Hudson (tjh@cryptsoft.com).
57 *
58 */
59
60#include <stdio.h>
61#include <openssl/crypto.h>
62#include <openssl/pem.h>
63#include "cryptlib.h"
64#include <openssl/dso.h>
65#include "engine_int.h"
66#include <openssl/engine.h>
67
68#ifndef NO_HW
69#ifndef NO_HW_NCIPHER
70
71/* Attribution notice: nCipher have said several times that it's OK for
72 * us to implement a general interface to their boxes, and recently declared
73 * their HWCryptoHook to be public, and therefore available for us to use.
74 * Thanks, nCipher.
75 *
76 * The hwcryptohook.h included here is from May 2000.
77 * [Richard Levitte]
78 */
79#ifdef FLAT_INC
80#include "hwcryptohook.h"
81#else
82#include "vendor_defns/hwcryptohook.h"
83#endif
84
85static int hwcrhk_init(void);
86static int hwcrhk_finish(void);
87static int hwcrhk_ctrl(int cmd, long i, void *p, void (*f)());
88
89/* Functions to handle mutexes */
90static int hwcrhk_mutex_init(HWCryptoHook_Mutex*, HWCryptoHook_CallerContext*);
91static int hwcrhk_mutex_lock(HWCryptoHook_Mutex*);
92static void hwcrhk_mutex_unlock(HWCryptoHook_Mutex*);
93static void hwcrhk_mutex_destroy(HWCryptoHook_Mutex*);
94
95/* BIGNUM stuff */
96static int hwcrhk_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
97 const BIGNUM *m, BN_CTX *ctx);
98
99/* RSA stuff */
100static int hwcrhk_rsa_mod_exp(BIGNUM *r, BIGNUM *I, RSA *rsa);
101/* This function is aliased to mod_exp (with the mont stuff dropped). */
102static int hwcrhk_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
103 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
104
105/* DH stuff */
106/* This function is alised to mod_exp (with the DH and mont dropped). */
107static int hwcrhk_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
108 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
109
110/* RAND stuff */
111static int hwcrhk_rand_bytes(unsigned char *buf, int num);
112static int hwcrhk_rand_status(void);
113
114/* KM stuff */
115static EVP_PKEY *hwcrhk_load_privkey(const char *key_id,
116 const char *passphrase);
117static EVP_PKEY *hwcrhk_load_pubkey(const char *key_id,
118 const char *passphrase);
119static void hwcrhk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
120 int index,long argl, void *argp);
121
122/* Interaction stuff */
123static int hwcrhk_get_pass(const char *prompt_info,
124 int *len_io, char *buf,
125 HWCryptoHook_PassphraseContext *ppctx,
126 HWCryptoHook_CallerContext *cactx);
127static void hwcrhk_log_message(void *logstream, const char *message);
128
129/* Our internal RSA_METHOD that we provide pointers to */
130static RSA_METHOD hwcrhk_rsa =
131 {
132 "nCipher RSA method",
133 NULL,
134 NULL,
135 NULL,
136 NULL,
137 hwcrhk_rsa_mod_exp,
138 hwcrhk_mod_exp_mont,
139 NULL,
140 NULL,
141 0,
142 NULL,
143 NULL,
144 NULL
145 };
146
147/* Our internal DH_METHOD that we provide pointers to */
148static DH_METHOD hwcrhk_dh =
149 {
150 "nCipher DH method",
151 NULL,
152 NULL,
153 hwcrhk_mod_exp_dh,
154 NULL,
155 NULL,
156 0,
157 NULL
158 };
159
160static RAND_METHOD hwcrhk_rand =
161 {
162 /* "nCipher RAND method", */
163 NULL,
164 hwcrhk_rand_bytes,
165 NULL,
166 NULL,
167 hwcrhk_rand_bytes,
168 hwcrhk_rand_status,
169 };
170
171/* Our ENGINE structure. */
172static ENGINE engine_hwcrhk =
173 {
174 "chil",
175 "nCipher hardware engine support",
176 &hwcrhk_rsa,
177 NULL,
178 &hwcrhk_dh,
179 &hwcrhk_rand,
180 hwcrhk_mod_exp,
181 NULL,
182 hwcrhk_init,
183 hwcrhk_finish,
184 hwcrhk_ctrl,
185 hwcrhk_load_privkey,
186 hwcrhk_load_pubkey,
187 0, /* no flags */
188 0, 0, /* no references */
189 NULL, NULL /* unlinked */
190 };
191
192/* Internal stuff for HWCryptoHook */
193
194/* Some structures needed for proper use of thread locks */
195/* hwcryptohook.h has some typedefs that turn struct HWCryptoHook_MutexValue
196 into HWCryptoHook_Mutex */
197struct HWCryptoHook_MutexValue
198 {
199 int lockid;
200 };
201
202/* hwcryptohook.h has some typedefs that turn
203 struct HWCryptoHook_PassphraseContextValue
204 into HWCryptoHook_PassphraseContext */
205struct HWCryptoHook_PassphraseContextValue
206 {
207 void *any;
208 };
209
210/* hwcryptohook.h has some typedefs that turn
211 struct HWCryptoHook_CallerContextValue
212 into HWCryptoHook_CallerContext */
213struct HWCryptoHook_CallerContextValue
214 {
215 void *any;
216 };
217
218/* The MPI structure in HWCryptoHook is pretty compatible with OpenSSL
219 BIGNUM's, so lets define a couple of conversion macros */
220#define BN2MPI(mp, bn) \
221 {mp.size = bn->top * sizeof(BN_ULONG); mp.buf = (unsigned char *)bn->d;}
222#define MPI2BN(bn, mp) \
223 {mp.size = bn->dmax * sizeof(BN_ULONG); mp.buf = (unsigned char *)bn->d;}
224
225#if 0 /* Card and password management is not yet supported */
226/* HWCryptoHook callbacks. insert_card() and get_pass() are not yet
227 defined, because we haven't quite decided on the proper form yet.
228 log_message() just adds an entry in the error stack. I don't know
229 if that's good or bad... */
230static int insert_card(const char *prompt_info,
231 const char *wrong_info,
232 HWCryptoHook_PassphraseContext *ppctx,
233 HWCryptoHook_CallerContext *cactx);
234static int get_pass(const char *prompt_info,
235 int *len_io, char *buf,
236 HWCryptoHook_PassphraseContext *ppctx,
237 HWCryptoHook_CallerContext *cactx);
238#endif
239
240static BIO *logstream = NULL;
241static pem_password_cb *password_callback = NULL;
242#if 0
243static void *password_callback_userdata = NULL;
244#endif
245static int disable_mutex_callbacks = 0;
246
247/* Stuff to pass to the HWCryptoHook library */
248static HWCryptoHook_InitInfo hwcrhk_globals = {
249 0, /* Flags */
250 &logstream, /* logstream */
251 sizeof(BN_ULONG), /* limbsize */
252 0, /* mslimb first: false for BNs */
253 -1, /* msbyte first: use native */
254 0, /* Max mutexes, 0 = no small limit */
255 0, /* Max simultaneous, 0 = default */
256
257 /* The next few are mutex stuff: we write wrapper functions
258 around the OS mutex functions. We initialise them to 0
259 here, and change that to actual function pointers in hwcrhk_init()
260 if dynamic locks are supported (that is, if the application
261 programmer has made sure of setting up callbacks bafore starting
262 this engine) *and* if disable_mutex_callbacks hasn't been set by
263 a call to ENGINE_ctrl(ENGINE_CTRL_CHIL_NO_LOCKING). */
264 sizeof(HWCryptoHook_Mutex),
265 0,
266 0,
267 0,
268 0,
269
270 /* The next few are condvar stuff: we write wrapper functions
271 round the OS functions. Currently not implemented and not
272 and absolute necessity even in threaded programs, therefore
273 0'ed. Will hopefully be implemented some day, since it
274 enhances the efficiency of HWCryptoHook. */
275 0, /* sizeof(HWCryptoHook_CondVar), */
276 0, /* hwcrhk_cv_init, */
277 0, /* hwcrhk_cv_wait, */
278 0, /* hwcrhk_cv_signal, */
279 0, /* hwcrhk_cv_broadcast, */
280 0, /* hwcrhk_cv_destroy, */
281
282 hwcrhk_get_pass, /* pass phrase */
283 0, /* insert_card, */ /* insert a card */
284 hwcrhk_log_message /* Log message */
285};
286
287
288/* Now, to our own code */
289
290/* As this is only ever called once, there's no need for locking
291 * (indeed - the lock will already be held by our caller!!!) */
292ENGINE *ENGINE_ncipher()
293 {
294 RSA_METHOD *meth1;
295 DH_METHOD *meth2;
296
297 /* We know that the "PKCS1_SSLeay()" functions hook properly
298 * to the cswift-specific mod_exp and mod_exp_crt so we use
299 * those functions. NB: We don't use ENGINE_openssl() or
300 * anything "more generic" because something like the RSAref
301 * code may not hook properly, and if you own one of these
302 * cards then you have the right to do RSA operations on it
303 * anyway! */
304 meth1 = RSA_PKCS1_SSLeay();
305 hwcrhk_rsa.rsa_pub_enc = meth1->rsa_pub_enc;
306 hwcrhk_rsa.rsa_pub_dec = meth1->rsa_pub_dec;
307 hwcrhk_rsa.rsa_priv_enc = meth1->rsa_priv_enc;
308 hwcrhk_rsa.rsa_priv_dec = meth1->rsa_priv_dec;
309
310 /* Much the same for Diffie-Hellman */
311 meth2 = DH_OpenSSL();
312 hwcrhk_dh.generate_key = meth2->generate_key;
313 hwcrhk_dh.compute_key = meth2->compute_key;
314 return &engine_hwcrhk;
315 }
316
317/* This is a process-global DSO handle used for loading and unloading
318 * the HWCryptoHook library. NB: This is only set (or unset) during an
319 * init() or finish() call (reference counts permitting) and they're
320 * operating with global locks, so this should be thread-safe
321 * implicitly. */
322static DSO *hwcrhk_dso = NULL;
323static HWCryptoHook_ContextHandle hwcrhk_context = 0;
324static int hndidx = -1; /* Index for KM handle. Not really used yet. */
325
326/* These are the function pointers that are (un)set when the library has
327 * successfully (un)loaded. */
328static HWCryptoHook_Init_t *p_hwcrhk_Init = NULL;
329static HWCryptoHook_Finish_t *p_hwcrhk_Finish = NULL;
330static HWCryptoHook_ModExp_t *p_hwcrhk_ModExp = NULL;
331static HWCryptoHook_RSA_t *p_hwcrhk_RSA = NULL;
332static HWCryptoHook_RandomBytes_t *p_hwcrhk_RandomBytes = NULL;
333static HWCryptoHook_RSALoadKey_t *p_hwcrhk_RSALoadKey = NULL;
334static HWCryptoHook_RSAGetPublicKey_t *p_hwcrhk_RSAGetPublicKey = NULL;
335static HWCryptoHook_RSAUnloadKey_t *p_hwcrhk_RSAUnloadKey = NULL;
336static HWCryptoHook_ModExpCRT_t *p_hwcrhk_ModExpCRT = NULL;
337
338/* Used in the DSO operations. */
339static const char *HWCRHK_LIBNAME = "nfhwcrhk";
340static const char *n_hwcrhk_Init = "HWCryptoHook_Init";
341static const char *n_hwcrhk_Finish = "HWCryptoHook_Finish";
342static const char *n_hwcrhk_ModExp = "HWCryptoHook_ModExp";
343static const char *n_hwcrhk_RSA = "HWCryptoHook_RSA";
344static const char *n_hwcrhk_RandomBytes = "HWCryptoHook_RandomBytes";
345static const char *n_hwcrhk_RSALoadKey = "HWCryptoHook_RSALoadKey";
346static const char *n_hwcrhk_RSAGetPublicKey = "HWCryptoHook_RSAGetPublicKey";
347static const char *n_hwcrhk_RSAUnloadKey = "HWCryptoHook_RSAUnloadKey";
348static const char *n_hwcrhk_ModExpCRT = "HWCryptoHook_ModExpCRT";
349
350/* HWCryptoHook library functions and mechanics - these are used by the
351 * higher-level functions further down. NB: As and where there's no
352 * error checking, take a look lower down where these functions are
353 * called, the checking and error handling is probably down there. */
354
355/* utility function to obtain a context */
356static int get_context(HWCryptoHook_ContextHandle *hac)
357 {
358 char tempbuf[1024];
359 HWCryptoHook_ErrMsgBuf rmsg;
360
361 rmsg.buf = tempbuf;
362 rmsg.size = 1024;
363
364 *hac = p_hwcrhk_Init(&hwcrhk_globals, sizeof(hwcrhk_globals), &rmsg,
365 NULL);
366 if (!*hac)
367 return 0;
368 return 1;
369 }
370
371/* similarly to release one. */
372static void release_context(HWCryptoHook_ContextHandle hac)
373 {
374 p_hwcrhk_Finish(hac);
375 }
376
377/* (de)initialisation functions. */
378static int hwcrhk_init()
379 {
380 HWCryptoHook_Init_t *p1;
381 HWCryptoHook_Finish_t *p2;
382 HWCryptoHook_ModExp_t *p3;
383 HWCryptoHook_RSA_t *p4;
384 HWCryptoHook_RSALoadKey_t *p5;
385 HWCryptoHook_RSAGetPublicKey_t *p6;
386 HWCryptoHook_RSAUnloadKey_t *p7;
387 HWCryptoHook_RandomBytes_t *p8;
388 HWCryptoHook_ModExpCRT_t *p9;
389
390 if(hwcrhk_dso != NULL)
391 {
392 ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_ALREADY_LOADED);
393 goto err;
394 }
395 /* Attempt to load libnfhwcrhk.so/nfhwcrhk.dll/whatever. */
396 hwcrhk_dso = DSO_load(NULL, HWCRHK_LIBNAME, NULL,
397 DSO_FLAG_NAME_TRANSLATION);
398 if(hwcrhk_dso == NULL)
399 {
400 ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE);
401 goto err;
402 }
403 if(!(p1 = (HWCryptoHook_Init_t *)
404 DSO_bind_func(hwcrhk_dso, n_hwcrhk_Init)) ||
405 !(p2 = (HWCryptoHook_Finish_t *)
406 DSO_bind_func(hwcrhk_dso, n_hwcrhk_Finish)) ||
407 !(p3 = (HWCryptoHook_ModExp_t *)
408 DSO_bind_func(hwcrhk_dso, n_hwcrhk_ModExp)) ||
409 !(p4 = (HWCryptoHook_RSA_t *)
410 DSO_bind_func(hwcrhk_dso, n_hwcrhk_RSA)) ||
411 !(p5 = (HWCryptoHook_RSALoadKey_t *)
412 DSO_bind_func(hwcrhk_dso, n_hwcrhk_RSALoadKey)) ||
413 !(p6 = (HWCryptoHook_RSAGetPublicKey_t *)
414 DSO_bind_func(hwcrhk_dso, n_hwcrhk_RSAGetPublicKey)) ||
415 !(p7 = (HWCryptoHook_RSAUnloadKey_t *)
416 DSO_bind_func(hwcrhk_dso, n_hwcrhk_RSAUnloadKey)) ||
417 !(p8 = (HWCryptoHook_RandomBytes_t *)
418 DSO_bind_func(hwcrhk_dso, n_hwcrhk_RandomBytes)) ||
419 !(p9 = (HWCryptoHook_ModExpCRT_t *)
420 DSO_bind_func(hwcrhk_dso, n_hwcrhk_ModExpCRT)))
421 {
422 ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_DSO_FAILURE);
423 goto err;
424 }
425 /* Copy the pointers */
426 p_hwcrhk_Init = p1;
427 p_hwcrhk_Finish = p2;
428 p_hwcrhk_ModExp = p3;
429 p_hwcrhk_RSA = p4;
430 p_hwcrhk_RSALoadKey = p5;
431 p_hwcrhk_RSAGetPublicKey = p6;
432 p_hwcrhk_RSAUnloadKey = p7;
433 p_hwcrhk_RandomBytes = p8;
434 p_hwcrhk_ModExpCRT = p9;
435
436 /* Check if the application decided to support dynamic locks,
437 and if it does, use them. */
438 if (disable_mutex_callbacks == 0 &&
439 CRYPTO_get_dynlock_create_callback() != NULL &&
440 CRYPTO_get_dynlock_lock_callback() != NULL &&
441 CRYPTO_get_dynlock_destroy_callback() != NULL)
442 {
443 hwcrhk_globals.mutex_init = hwcrhk_mutex_init;
444 hwcrhk_globals.mutex_acquire = hwcrhk_mutex_lock;
445 hwcrhk_globals.mutex_release = hwcrhk_mutex_unlock;
446 hwcrhk_globals.mutex_destroy = hwcrhk_mutex_destroy;
447 }
448
449 /* Try and get a context - if not, we may have a DSO but no
450 * accelerator! */
451 if(!get_context(&hwcrhk_context))
452 {
453 ENGINEerr(ENGINE_F_HWCRHK_INIT,ENGINE_R_UNIT_FAILURE);
454 goto err;
455 }
456 /* Everything's fine. */
457 if (hndidx == -1)
458 hndidx = RSA_get_ex_new_index(0,
459 "nFast HWCryptoHook RSA key handle",
460 NULL, NULL, hwcrhk_ex_free);
461 return 1;
462err:
463 if(hwcrhk_dso)
464 DSO_free(hwcrhk_dso);
465 hwcrhk_dso = NULL;
466 p_hwcrhk_Init = NULL;
467 p_hwcrhk_Finish = NULL;
468 p_hwcrhk_ModExp = NULL;
469 p_hwcrhk_RSA = NULL;
470 p_hwcrhk_RSALoadKey = NULL;
471 p_hwcrhk_RSAGetPublicKey = NULL;
472 p_hwcrhk_RSAUnloadKey = NULL;
473 p_hwcrhk_ModExpCRT = NULL;
474 p_hwcrhk_RandomBytes = NULL;
475 return 0;
476 }
477
478static int hwcrhk_finish()
479 {
480 int to_return = 1;
481 if(hwcrhk_dso == NULL)
482 {
483 ENGINEerr(ENGINE_F_HWCRHK_FINISH,ENGINE_R_NOT_LOADED);
484 to_return = 0;
485 goto err;
486 }
487 release_context(hwcrhk_context);
488 if(!DSO_free(hwcrhk_dso))
489 {
490 ENGINEerr(ENGINE_F_HWCRHK_FINISH,ENGINE_R_DSO_FAILURE);
491 to_return = 0;
492 goto err;
493 }
494 err:
495 if (logstream)
496 BIO_free(logstream);
497 hwcrhk_dso = NULL;
498 p_hwcrhk_Init = NULL;
499 p_hwcrhk_Finish = NULL;
500 p_hwcrhk_ModExp = NULL;
501 p_hwcrhk_RSA = NULL;
502 p_hwcrhk_RSALoadKey = NULL;
503 p_hwcrhk_RSAGetPublicKey = NULL;
504 p_hwcrhk_RSAUnloadKey = NULL;
505 p_hwcrhk_ModExpCRT = NULL;
506 p_hwcrhk_RandomBytes = NULL;
507 return to_return;
508 }
509
510static int hwcrhk_ctrl(int cmd, long i, void *p, void (*f)())
511 {
512 int to_return = 1;
513
514 switch(cmd)
515 {
516 case ENGINE_CTRL_SET_LOGSTREAM:
517 {
518 BIO *bio = (BIO *)p;
519
520 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
521 if (logstream)
522 {
523 BIO_free(logstream);
524 logstream = NULL;
525 }
526 if (CRYPTO_add(&bio->references,1,CRYPTO_LOCK_BIO) > 1)
527 logstream = bio;
528 else
529 ENGINEerr(ENGINE_F_HWCRHK_CTRL,ENGINE_R_BIO_WAS_FREED);
530 }
531 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
532 break;
533 case ENGINE_CTRL_SET_PASSWORD_CALLBACK:
534 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
535 password_callback = (pem_password_cb *)f;
536 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
537 break;
538 /* this enables or disables the "SimpleForkCheck" flag used in the
539 * initialisation structure. */
540 case ENGINE_CTRL_CHIL_SET_FORKCHECK:
541 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
542 if(i)
543 hwcrhk_globals.flags |=
544 HWCryptoHook_InitFlags_SimpleForkCheck;
545 else
546 hwcrhk_globals.flags &=
547 ~HWCryptoHook_InitFlags_SimpleForkCheck;
548 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
549 break;
550 /* This will prevent the initialisation function from "installing"
551 * the mutex-handling callbacks, even if they are available from
552 * within the library (or were provided to the library from the
553 * calling application). This is to remove any baggage for
554 * applications not using multithreading. */
555 case ENGINE_CTRL_CHIL_NO_LOCKING:
556 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
557 disable_mutex_callbacks = 1;
558 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
559 break;
560
561 /* The command isn't understood by this engine */
562 default:
563 ENGINEerr(ENGINE_F_HWCRHK_CTRL,
564 ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
565 to_return = 0;
566 break;
567 }
568
569 return to_return;
570 }
571
572static EVP_PKEY *hwcrhk_load_privkey(const char *key_id,
573 const char *passphrase)
574 {
575 RSA *rtmp = NULL;
576 EVP_PKEY *res = NULL;
577 HWCryptoHook_MPI e, n;
578 HWCryptoHook_RSAKeyHandle *hptr;
579 HWCryptoHook_ErrMsgBuf rmsg;
580
581 if(!hwcrhk_context)
582 {
583 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PRIVKEY,
584 ENGINE_R_NOT_INITIALISED);
585 goto err;
586 }
587 hptr = OPENSSL_malloc(sizeof(HWCryptoHook_RSAKeyHandle));
588 if (!hptr)
589 {
590 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PRIVKEY,
591 ERR_R_MALLOC_FAILURE);
592 goto err;
593 }
594 if (p_hwcrhk_RSALoadKey(hwcrhk_context, key_id, hptr,
595 &rmsg, NULL))
596 {
597 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PRIVKEY,
598 ENGINE_R_CHIL_ERROR);
599 ERR_add_error_data(1,rmsg.buf);
600 goto err;
601 }
602 if (!*hptr)
603 {
604 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PRIVKEY,
605 ENGINE_R_NO_KEY);
606 goto err;
607 }
608 rtmp = RSA_new_method(&engine_hwcrhk);
609 RSA_set_ex_data(rtmp, hndidx, (char *)hptr);
610 rtmp->e = BN_new();
611 rtmp->n = BN_new();
612 rtmp->flags |= RSA_FLAG_EXT_PKEY;
613 MPI2BN(rtmp->e, e);
614 MPI2BN(rtmp->n, n);
615 if (p_hwcrhk_RSAGetPublicKey(*hptr, &n, &e, &rmsg)
616 != HWCRYPTOHOOK_ERROR_MPISIZE)
617 {
618 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PUBKEY,ENGINE_R_CHIL_ERROR);
619 ERR_add_error_data(1,rmsg.buf);
620 goto err;
621 }
622
623 bn_expand2(rtmp->e, e.size/sizeof(BN_ULONG));
624 bn_expand2(rtmp->n, n.size/sizeof(BN_ULONG));
625 MPI2BN(rtmp->e, e);
626 MPI2BN(rtmp->n, n);
627
628 if (p_hwcrhk_RSAGetPublicKey(*hptr, &n, &e, &rmsg))
629 {
630 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PUBKEY,
631 ENGINE_R_CHIL_ERROR);
632 ERR_add_error_data(1,rmsg.buf);
633 goto err;
634 }
635 rtmp->e->top = e.size / sizeof(BN_ULONG);
636 bn_fix_top(rtmp->e);
637 rtmp->n->top = n.size / sizeof(BN_ULONG);
638 bn_fix_top(rtmp->n);
639
640 res = EVP_PKEY_new();
641 EVP_PKEY_assign_RSA(res, rtmp);
642
643 return res;
644 err:
645 if (res)
646 EVP_PKEY_free(res);
647 if (rtmp)
648 RSA_free(rtmp);
649 return NULL;
650 }
651
652static EVP_PKEY *hwcrhk_load_pubkey(const char *key_id, const char *passphrase)
653 {
654 EVP_PKEY *res = hwcrhk_load_privkey(key_id, passphrase);
655
656 if (res)
657 switch(res->type)
658 {
659 case EVP_PKEY_RSA:
660 {
661 RSA *rsa = NULL;
662
663 CRYPTO_w_lock(CRYPTO_LOCK_EVP_PKEY);
664 rsa = res->pkey.rsa;
665 res->pkey.rsa = RSA_new();
666 res->pkey.rsa->n = rsa->n;
667 res->pkey.rsa->e = rsa->e;
668 CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY);
669 RSA_free(rsa);
670 }
671 default:
672 ENGINEerr(ENGINE_F_HWCRHK_LOAD_PUBKEY,
673 ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED);
674 goto err;
675 }
676
677 return res;
678 err:
679 if (res)
680 EVP_PKEY_free(res);
681 return NULL;
682 }
683
684/* A little mod_exp */
685static int hwcrhk_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
686 const BIGNUM *m, BN_CTX *ctx)
687 {
688 char tempbuf[1024];
689 HWCryptoHook_ErrMsgBuf rmsg;
690 /* Since HWCryptoHook_MPI is pretty compatible with BIGNUM's,
691 we use them directly, plus a little macro magic. We only
692 thing we need to make sure of is that enough space is allocated. */
693 HWCryptoHook_MPI m_a, m_p, m_n, m_r;
694 int to_return, ret;
695
696 to_return = 0; /* expect failure */
697 rmsg.buf = tempbuf;
698 rmsg.size = 1024;
699
700 if(!hwcrhk_context)
701 {
702 ENGINEerr(ENGINE_F_HWCRHK_MOD_EXP,ENGINE_R_NOT_INITIALISED);
703 goto err;
704 }
705 /* Prepare the params */
706 bn_expand2(r, m->top); /* Check for error !! */
707 BN2MPI(m_a, a);
708 BN2MPI(m_p, p);
709 BN2MPI(m_n, m);
710 MPI2BN(r, m_r);
711
712 /* Perform the operation */
713 ret = p_hwcrhk_ModExp(hwcrhk_context, m_a, m_p, m_n, &m_r, &rmsg);
714
715 /* Convert the response */
716 r->top = m_r.size / sizeof(BN_ULONG);
717 bn_fix_top(r);
718
719 if (ret < 0)
720 {
721 /* FIXME: When this error is returned, HWCryptoHook is
722 telling us that falling back to software computation
723 might be a good thing. */
724 if(ret == HWCRYPTOHOOK_ERROR_FALLBACK)
725 {
726 ENGINEerr(ENGINE_F_HWCRHK_MOD_EXP,ENGINE_R_REQUEST_FALLBACK);
727 }
728 else
729 {
730 ENGINEerr(ENGINE_F_HWCRHK_MOD_EXP,ENGINE_R_REQUEST_FAILED);
731 }
732 ERR_add_error_data(1,rmsg.buf);
733 goto err;
734 }
735
736 to_return = 1;
737err:
738 return to_return;
739 }
740
741static int hwcrhk_rsa_mod_exp(BIGNUM *r, BIGNUM *I, RSA *rsa)
742 {
743 char tempbuf[1024];
744 HWCryptoHook_ErrMsgBuf rmsg;
745 HWCryptoHook_RSAKeyHandle *hptr;
746 int to_return = 0, ret;
747
748 if(!hwcrhk_context)
749 {
750 ENGINEerr(ENGINE_F_HWCRHK_MOD_EXP,ENGINE_R_NOT_INITIALISED);
751 goto err;
752 }
753
754 /* This provides support for nForce keys. Since that's opaque data
755 all we do is provide a handle to the proper key and let HWCryptoHook
756 take care of the rest. */
757 if ((hptr = (HWCryptoHook_RSAKeyHandle *) RSA_get_ex_data(rsa, hndidx))
758 != NULL)
759 {
760 HWCryptoHook_MPI m_a, m_r;
761
762 if(!rsa->n)
763 {
764 ENGINEerr(ENGINE_F_HWCRHK_RSA_MOD_EXP,
765 ENGINE_R_MISSING_KEY_COMPONENTS);
766 goto err;
767 }
768
769 rmsg.buf = tempbuf;
770 rmsg.size = 1024;
771
772 /* Prepare the params */
773 bn_expand2(r, rsa->n->top); /* Check for error !! */
774 BN2MPI(m_a, I);
775 MPI2BN(r, m_r);
776
777 /* Perform the operation */
778 ret = p_hwcrhk_RSA(m_a, *hptr, &m_r, &rmsg);
779
780 /* Convert the response */
781 r->top = m_r.size / sizeof(BN_ULONG);
782 bn_fix_top(r);
783
784 if (ret < 0)
785 {
786 /* FIXME: When this error is returned, HWCryptoHook is
787 telling us that falling back to software computation
788 might be a good thing. */
789 if(ret == HWCRYPTOHOOK_ERROR_FALLBACK)
790 {
791 ENGINEerr(ENGINE_F_HWCRHK_RSA_MOD_EXP,ENGINE_R_REQUEST_FALLBACK);
792 }
793 else
794 {
795 ENGINEerr(ENGINE_F_HWCRHK_RSA_MOD_EXP,ENGINE_R_REQUEST_FAILED);
796 }
797 ERR_add_error_data(1,rmsg.buf);
798 goto err;
799 }
800 }
801 else
802 {
803 HWCryptoHook_MPI m_a, m_p, m_q, m_dmp1, m_dmq1, m_iqmp, m_r;
804
805 if(!rsa->p || !rsa->q || !rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
806 {
807 ENGINEerr(ENGINE_F_HWCRHK_RSA_MOD_EXP,
808 ENGINE_R_MISSING_KEY_COMPONENTS);
809 goto err;
810 }
811
812 rmsg.buf = tempbuf;
813 rmsg.size = 1024;
814
815 /* Prepare the params */
816 bn_expand2(r, rsa->n->top); /* Check for error !! */
817 BN2MPI(m_a, I);
818 BN2MPI(m_p, rsa->p);
819 BN2MPI(m_q, rsa->q);
820 BN2MPI(m_dmp1, rsa->dmp1);
821 BN2MPI(m_dmq1, rsa->dmq1);
822 BN2MPI(m_iqmp, rsa->iqmp);
823 MPI2BN(r, m_r);
824
825 /* Perform the operation */
826 ret = p_hwcrhk_ModExpCRT(hwcrhk_context, m_a, m_p, m_q,
827 m_dmp1, m_dmq1, m_iqmp, &m_r, NULL);
828
829 /* Convert the response */
830 r->top = m_r.size / sizeof(BN_ULONG);
831 bn_fix_top(r);
832
833 if (ret < 0)
834 {
835 /* FIXME: When this error is returned, HWCryptoHook is
836 telling us that falling back to software computation
837 might be a good thing. */
838 if(ret == HWCRYPTOHOOK_ERROR_FALLBACK)
839 {
840 ENGINEerr(ENGINE_F_HWCRHK_RSA_MOD_EXP,ENGINE_R_REQUEST_FALLBACK);
841 }
842 else
843 {
844 ENGINEerr(ENGINE_F_HWCRHK_RSA_MOD_EXP,ENGINE_R_REQUEST_FAILED);
845 }
846 ERR_add_error_data(1,rmsg.buf);
847 goto err;
848 }
849 }
850 /* If we're here, we must be here with some semblance of success :-) */
851 to_return = 1;
852err:
853 return to_return;
854 }
855
856/* This function is aliased to mod_exp (with the mont stuff dropped). */
857static int hwcrhk_mod_exp_mont(BIGNUM *r, BIGNUM *a, const BIGNUM *p,
858 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
859 {
860 return hwcrhk_mod_exp(r, a, p, m, ctx);
861 }
862
863/* This function is aliased to mod_exp (with the dh and mont dropped). */
864static int hwcrhk_mod_exp_dh(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
865 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)
866 {
867 return hwcrhk_mod_exp(r, a, p, m, ctx);
868 }
869
870/* Random bytes are good */
871static int hwcrhk_rand_bytes(unsigned char *buf, int num)
872 {
873 char tempbuf[1024];
874 HWCryptoHook_ErrMsgBuf rmsg;
875 int to_return = 0; /* assume failure */
876 int ret;
877
878 rmsg.buf = tempbuf;
879 rmsg.size = 1024;
880
881 if(!hwcrhk_context)
882 {
883 ENGINEerr(ENGINE_F_HWCRHK_RAND_BYTES,ENGINE_R_NOT_INITIALISED);
884 goto err;
885 }
886
887 ret = p_hwcrhk_RandomBytes(hwcrhk_context, buf, num, &rmsg);
888 if (ret < 0)
889 {
890 /* FIXME: When this error is returned, HWCryptoHook is
891 telling us that falling back to software computation
892 might be a good thing. */
893 if(ret == HWCRYPTOHOOK_ERROR_FALLBACK)
894 {
895 ENGINEerr(ENGINE_F_HWCRHK_RAND_BYTES,ENGINE_R_REQUEST_FALLBACK);
896 }
897 else
898 {
899 ENGINEerr(ENGINE_F_HWCRHK_RAND_BYTES,ENGINE_R_REQUEST_FAILED);
900 }
901 ERR_add_error_data(1,rmsg.buf);
902 goto err;
903 }
904 to_return = 1;
905 err:
906 return to_return;
907 }
908
909static int hwcrhk_rand_status(void)
910 {
911 return 1;
912 }
913
914/* This cleans up an RSA KM key, called when ex_data is freed */
915
916static void hwcrhk_ex_free(void *obj, void *item, CRYPTO_EX_DATA *ad,
917 int index,long argl, void *argp)
918{
919 char tempbuf[1024];
920 HWCryptoHook_ErrMsgBuf rmsg;
921 HWCryptoHook_RSAKeyHandle *hptr;
922 int ret;
923
924 rmsg.buf = tempbuf;
925 rmsg.size = 1024;
926
927 hptr = (HWCryptoHook_RSAKeyHandle *) item;
928 if(!hptr) return;
929 ret = p_hwcrhk_RSAUnloadKey(*hptr, NULL);
930 OPENSSL_free(hptr);
931}
932
933/* Mutex calls: since the HWCryptoHook model closely follows the POSIX model
934 * these just wrap the POSIX functions and add some logging.
935 */
936
937static int hwcrhk_mutex_init(HWCryptoHook_Mutex* mt,
938 HWCryptoHook_CallerContext *cactx)
939 {
940 mt->lockid = CRYPTO_get_new_dynlockid();
941 if (mt->lockid == 0)
942 return 0;
943 return 1;
944 }
945
946static int hwcrhk_mutex_lock(HWCryptoHook_Mutex *mt)
947 {
948 CRYPTO_w_lock(mt->lockid);
949 return 1;
950 }
951
952void hwcrhk_mutex_unlock(HWCryptoHook_Mutex * mt)
953 {
954 CRYPTO_w_unlock(mt->lockid);
955 }
956
957static void hwcrhk_mutex_destroy(HWCryptoHook_Mutex *mt)
958 {
959 CRYPTO_destroy_dynlockid(mt->lockid);
960 }
961
962static int hwcrhk_get_pass(const char *prompt_info,
963 int *len_io, char *buf,
964 HWCryptoHook_PassphraseContext *ppctx,
965 HWCryptoHook_CallerContext *cactx)
966 {
967 int l = 0;
968 char prompt[1024];
969
970 if (password_callback == NULL)
971 {
972 ENGINEerr(ENGINE_F_HWCRHK_GET_PASS,ENGINE_R_NO_CALLBACK);
973 return -1;
974 }
975 if (prompt_info)
976 {
977 strncpy(prompt, "Card: \"", sizeof(prompt));
978 l += 5;
979 strncpy(prompt + l, prompt_info, sizeof(prompt) - l);
980 l += strlen(prompt_info);
981 if (l + 2 < sizeof(prompt))
982 {
983 strncpy(prompt + l, "\"\n", sizeof(prompt) - l);
984 l += 2;
985 }
986 }
987 if (l < sizeof(prompt) - 1)
988 {
989 strncpy(prompt, "Enter Passphrase <enter to cancel>:",
990 sizeof(prompt) - l);
991 l += 35;
992 }
993 prompt[l] = '\0';
994
995 /* I know, passing on the prompt instead of the user data *is*
996 a bad thing. However, that's all we have right now.
997 -- Richard Levitte */
998 *len_io = password_callback(buf, *len_io, 0, prompt);
999 if(!*len_io)
1000 return -1;
1001 return 0;
1002 }
1003
1004static void hwcrhk_log_message(void *logstream, const char *message)
1005 {
1006 BIO *lstream = NULL;
1007
1008 CRYPTO_w_lock(CRYPTO_LOCK_BIO);
1009 if (logstream)
1010 lstream=*(BIO **)logstream;
1011 if (lstream)
1012 {
1013 BIO_write(lstream, message, strlen(message));
1014 }
1015 CRYPTO_w_unlock(CRYPTO_LOCK_BIO);
1016 }
1017
1018#endif /* !NO_HW_NCIPHER */
1019#endif /* !NO_HW */
diff --git a/src/lib/libcrypto/engine/vendor_defns/atalla.h b/src/lib/libcrypto/engine/vendor_defns/atalla.h
new file mode 100644
index 0000000000..8111649c54
--- /dev/null
+++ b/src/lib/libcrypto/engine/vendor_defns/atalla.h
@@ -0,0 +1,61 @@
1/* This header declares the necessary definitions for using the exponentiation
2 * acceleration capabilities of Atalla cards. The only cryptographic operation
3 * is performed by "ASI_RSAPrivateKeyOpFn" and this takes a structure that
4 * defines an "RSA private key". However, it is really only performing a
5 * regular mod_exp using the supplied modulus and exponent - no CRT form is
6 * being used. Hence, it is a generic mod_exp function in disguise, and we use
7 * it as such.
8 *
9 * Thanks to the people at Atalla for letting me know these definitions are
10 * fine and that they can be reproduced here.
11 *
12 * Geoff.
13 */
14
15typedef struct ItemStr
16 {
17 unsigned char *data;
18 int len;
19 } Item;
20
21typedef struct RSAPrivateKeyStr
22 {
23 void *reserved;
24 Item version;
25 Item modulus;
26 Item publicExponent;
27 Item privateExponent;
28 Item prime[2];
29 Item exponent[2];
30 Item coefficient;
31 } RSAPrivateKey;
32
33/* Predeclare the function pointer types that we dynamically load from the DSO.
34 * These use the same names and form that Ben's original support code had (in
35 * crypto/bn/bn_exp.c) unless of course I've inadvertently changed the style
36 * somewhere along the way!
37 */
38
39typedef int tfnASI_GetPerformanceStatistics(int reset_flag,
40 unsigned int *ret_buf);
41
42typedef int tfnASI_GetHardwareConfig(long card_num, unsigned int *ret_buf);
43
44typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey,
45 unsigned char *output,
46 unsigned char *input,
47 unsigned int modulus_len);
48
49/* These are the static string constants for the DSO file name and the function
50 * symbol names to bind to. Regrettably, the DSO name on *nix appears to be
51 * "atasi.so" rather than something more consistent like "libatasi.so". At the
52 * time of writing, I'm not sure what the file name on win32 is but clearly
53 * native name translation is not possible (eg libatasi.so on *nix, and
54 * atasi.dll on win32). For the purposes of testing, I have created a symbollic
55 * link called "libatasi.so" so that we can use native name-translation - a
56 * better solution will be needed. */
57static const char *ATALLA_LIBNAME = "atasi";
58static const char *ATALLA_F1 = "ASI_GetHardwareConfig";
59static const char *ATALLA_F2 = "ASI_RSAPrivateKeyOpFn";
60static const char *ATALLA_F3 = "ASI_GetPerformanceStatistics";
61
diff --git a/src/lib/libcrypto/engine/vendor_defns/cswift.h b/src/lib/libcrypto/engine/vendor_defns/cswift.h
new file mode 100644
index 0000000000..0af14a1a92
--- /dev/null
+++ b/src/lib/libcrypto/engine/vendor_defns/cswift.h
@@ -0,0 +1,213 @@
1/* Attribution notice: Rainbow have generously allowed me to reproduce
2 * the necessary definitions here from their API. This means the support
3 * can build independently of whether application builders have the
4 * API or hardware. This will allow developers to easily produce software
5 * that has latent hardware support for any users that have accelertors
6 * installed, without the developers themselves needing anything extra.
7 *
8 * I have only clipped the parts from the CryptoSwift header files that
9 * are (or seem) relevant to the CryptoSwift support code. This is
10 * simply to keep the file sizes reasonable.
11 * [Geoff]
12 */
13
14
15/* NB: These type widths do *not* seem right in general, in particular
16 * they're not terribly friendly to 64-bit architectures (unsigned long)
17 * will be 64-bit on IA-64 for a start. I'm leaving these alone as they
18 * agree with Rainbow's API and this will only be called into question
19 * on platforms with Rainbow support anyway! ;-) */
20
21#ifdef __cplusplus
22extern "C" {
23#endif /* __cplusplus */
24
25typedef long SW_STATUS; /* status */
26typedef unsigned char SW_BYTE; /* 8 bit byte */
27typedef unsigned short SW_U16; /* 16 bit number */
28#if defined(_IRIX)
29#include <sgidefs.h>
30typedef __uint32_t SW_U32;
31#else
32typedef unsigned long SW_U32; /* 32 bit integer */
33#endif
34
35#if defined(WIN32)
36 typedef struct _SW_U64 {
37 SW_U32 low32;
38 SW_U32 high32;
39 } SW_U64; /* 64 bit integer */
40#elif defined(MAC)
41 typedef longlong SW_U64
42#else /* Unix variants */
43 typedef struct _SW_U64 {
44 SW_U32 low32;
45 SW_U32 high32;
46 } SW_U64; /* 64 bit integer */
47#endif
48
49/* status codes */
50#define SW_OK (0L)
51#define SW_ERR_BASE (-10000L)
52#define SW_ERR_NO_CARD (SW_ERR_BASE-1) /* The Card is not present */
53#define SW_ERR_CARD_NOT_READY (SW_ERR_BASE-2) /* The card has not powered */
54 /* up yet */
55#define SW_ERR_TIME_OUT (SW_ERR_BASE-3) /* Execution of a command */
56 /* time out */
57#define SW_ERR_NO_EXECUTE (SW_ERR_BASE-4) /* The Card failed to */
58 /* execute the command */
59#define SW_ERR_INPUT_NULL_PTR (SW_ERR_BASE-5) /* a required pointer is */
60 /* NULL */
61#define SW_ERR_INPUT_SIZE (SW_ERR_BASE-6) /* size is invalid, too */
62 /* small, too large. */
63#define SW_ERR_INVALID_HANDLE (SW_ERR_BASE-7) /* Invalid SW_ACC_CONTEXT */
64 /* handle */
65#define SW_ERR_PENDING (SW_ERR_BASE-8) /* A request is already out- */
66 /* standing at this */
67 /* context handle */
68#define SW_ERR_AVAILABLE (SW_ERR_BASE-9) /* A result is available. */
69#define SW_ERR_NO_PENDING (SW_ERR_BASE-10)/* No request is pending. */
70#define SW_ERR_NO_MEMORY (SW_ERR_BASE-11)/* Not enough memory */
71#define SW_ERR_BAD_ALGORITHM (SW_ERR_BASE-12)/* Invalid algorithm type */
72 /* in SW_PARAM structure */
73#define SW_ERR_MISSING_KEY (SW_ERR_BASE-13)/* No key is associated with */
74 /* context. */
75 /* swAttachKeyParam() is */
76 /* not called. */
77#define SW_ERR_KEY_CMD_MISMATCH \
78 (SW_ERR_BASE-14)/* Cannot perform requested */
79 /* SW_COMMAND_CODE since */
80 /* key attached via */
81 /* swAttachKeyParam() */
82 /* cannot be used for this*/
83 /* SW_COMMAND_CODE. */
84#define SW_ERR_NOT_IMPLEMENTED \
85 (SW_ERR_BASE-15)/* Not implemented */
86#define SW_ERR_BAD_COMMAND (SW_ERR_BASE-16)/* Bad command code */
87#define SW_ERR_BAD_ITEM_SIZE (SW_ERR_BASE-17)/* too small or too large in */
88 /* the "initems" or */
89 /* "outitems". */
90#define SW_ERR_BAD_ACCNUM (SW_ERR_BASE-18)/* Bad accelerator number */
91#define SW_ERR_SELFTEST_FAIL (SW_ERR_BASE-19)/* At least one of the self */
92 /* test fail, look at the */
93 /* selfTestBitmap in */
94 /* SW_ACCELERATOR_INFO for*/
95 /* details. */
96#define SW_ERR_MISALIGN (SW_ERR_BASE-20)/* Certain alogrithms require*/
97 /* key materials aligned */
98 /* in certain order, e.g. */
99 /* 128 bit for CRT */
100#define SW_ERR_OUTPUT_NULL_PTR \
101 (SW_ERR_BASE-21)/* a required pointer is */
102 /* NULL */
103#define SW_ERR_OUTPUT_SIZE \
104 (SW_ERR_BASE-22)/* size is invalid, too */
105 /* small, too large. */
106#define SW_ERR_FIRMWARE_CHECKSUM \
107 (SW_ERR_BASE-23)/* firmware checksum mismatch*/
108 /* download failed. */
109#define SW_ERR_UNKNOWN_FIRMWARE \
110 (SW_ERR_BASE-24)/* unknown firmware error */
111#define SW_ERR_INTERRUPT (SW_ERR_BASE-25)/* request is abort when */
112 /* it's waiting to be */
113 /* completed. */
114#define SW_ERR_NVWRITE_FAIL (SW_ERR_BASE-26)/* error in writing to Non- */
115 /* volatile memory */
116#define SW_ERR_NVWRITE_RANGE (SW_ERR_BASE-27)/* out of range error in */
117 /* writing to NV memory */
118#define SW_ERR_RNG_ERROR (SW_ERR_BASE-28)/* Random Number Generation */
119 /* failure */
120#define SW_ERR_DSS_FAILURE (SW_ERR_BASE-29)/* DSS Sign or Verify failure*/
121#define SW_ERR_MODEXP_FAILURE (SW_ERR_BASE-30)/* Failure in various math */
122 /* calculations */
123#define SW_ERR_ONBOARD_MEMORY (SW_ERR_BASE-31)/* Error in accessing on - */
124 /* board memory */
125#define SW_ERR_FIRMWARE_VERSION \
126 (SW_ERR_BASE-32)/* Wrong version in firmware */
127 /* update */
128#define SW_ERR_ZERO_WORKING_ACCELERATOR \
129 (SW_ERR_BASE-44)/* All accelerators are bad */
130
131
132 /* algorithm type */
133#define SW_ALG_CRT 1
134#define SW_ALG_EXP 2
135#define SW_ALG_DSA 3
136#define SW_ALG_NVDATA 4
137
138 /* command code */
139#define SW_CMD_MODEXP_CRT 1 /* perform Modular Exponentiation using */
140 /* Chinese Remainder Theorem (CRT) */
141#define SW_CMD_MODEXP 2 /* perform Modular Exponentiation */
142#define SW_CMD_DSS_SIGN 3 /* perform DSS sign */
143#define SW_CMD_DSS_VERIFY 4 /* perform DSS verify */
144#define SW_CMD_RAND 5 /* perform random number generation */
145#define SW_CMD_NVREAD 6 /* perform read to nonvolatile RAM */
146#define SW_CMD_NVWRITE 7 /* perform write to nonvolatile RAM */
147
148typedef SW_U32 SW_ALGTYPE; /* alogrithm type */
149typedef SW_U32 SW_STATE; /* state */
150typedef SW_U32 SW_COMMAND_CODE; /* command code */
151typedef SW_U32 SW_COMMAND_BITMAP[4]; /* bitmap */
152
153typedef struct _SW_LARGENUMBER {
154 SW_U32 nbytes; /* number of bytes in the buffer "value" */
155 SW_BYTE* value; /* the large integer as a string of */
156 /* bytes in network (big endian) order */
157} SW_LARGENUMBER;
158
159typedef struct _SW_CRT {
160 SW_LARGENUMBER p; /* prime number p */
161 SW_LARGENUMBER q; /* prime number q */
162 SW_LARGENUMBER dmp1; /* exponent1 */
163 SW_LARGENUMBER dmq1; /* exponent2 */
164 SW_LARGENUMBER iqmp; /* CRT coefficient */
165} SW_CRT;
166
167typedef struct _SW_EXP {
168 SW_LARGENUMBER modulus; /* modulus */
169 SW_LARGENUMBER exponent;/* exponent */
170} SW_EXP;
171
172typedef struct _SW_DSA {
173 SW_LARGENUMBER p; /* */
174 SW_LARGENUMBER q; /* */
175 SW_LARGENUMBER g; /* */
176 SW_LARGENUMBER key; /* private/public key */
177} SW_DSA;
178
179typedef struct _SW_NVDATA {
180 SW_U32 accnum; /* accelerator board number */
181 SW_U32 offset; /* offset in byte */
182} SW_NVDATA;
183
184typedef struct _SW_PARAM {
185 SW_ALGTYPE type; /* type of the alogrithm */
186 union {
187 SW_CRT crt;
188 SW_EXP exp;
189 SW_DSA dsa;
190 SW_NVDATA nvdata;
191 } up;
192} SW_PARAM;
193
194typedef SW_U32 SW_CONTEXT_HANDLE; /* opaque context handle */
195
196
197/* Now the OpenSSL bits, these function types are the for the function
198 * pointers that will bound into the Rainbow shared libraries. */
199typedef SW_STATUS t_swAcquireAccContext(SW_CONTEXT_HANDLE *hac);
200typedef SW_STATUS t_swAttachKeyParam(SW_CONTEXT_HANDLE hac,
201 SW_PARAM *key_params);
202typedef SW_STATUS t_swSimpleRequest(SW_CONTEXT_HANDLE hac,
203 SW_COMMAND_CODE cmd,
204 SW_LARGENUMBER pin[],
205 SW_U32 pin_count,
206 SW_LARGENUMBER pout[],
207 SW_U32 pout_count);
208typedef SW_STATUS t_swReleaseAccContext(SW_CONTEXT_HANDLE hac);
209
210#ifdef __cplusplus
211}
212#endif /* __cplusplus */
213
diff --git a/src/lib/libcrypto/err/Makefile.ssl b/src/lib/libcrypto/err/Makefile.ssl
index fb74e4eb13..cf94f406e4 100644
--- a/src/lib/libcrypto/err/Makefile.ssl
+++ b/src/lib/libcrypto/err/Makefile.ssl
@@ -83,24 +83,28 @@ err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
83err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 83err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
84err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 84err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
85err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 85err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
86err.o: ../../include/openssl/stack.h ../cryptlib.h 86err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
87err.o: ../cryptlib.h
87err_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 88err_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
88err_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 89err_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
89err_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 90err_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
90err_all.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 91err_all.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
91err_all.o: ../../include/openssl/des.h ../../include/openssl/dh.h 92err_all.o: ../../include/openssl/des.h ../../include/openssl/dh.h
92err_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 93err_all.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
93err_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 94err_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
94err_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 95err_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
95err_all.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 96err_all.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
96err_all.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 97err_all.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
97err_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 98err_all.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
98err_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h 99err_all.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
99err_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h 100err_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
100err_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 101err_all.o: ../../include/openssl/opensslv.h ../../include/openssl/pem2.h
101err_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 102err_all.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
102err_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 103err_all.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
103err_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 104err_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
105err_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
106err_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
107err_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
104err_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 108err_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
105err_all.o: ../../include/openssl/x509v3.h 109err_all.o: ../../include/openssl/x509v3.h
106err_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 110err_prn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
@@ -108,4 +112,5 @@ err_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
108err_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 112err_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
109err_prn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 113err_prn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
110err_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 114err_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
111err_prn.o: ../../include/openssl/stack.h ../cryptlib.h 115err_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
116err_prn.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index eb8c76aa0b..99272e437c 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -116,8 +116,8 @@
116#include <openssl/crypto.h> 116#include <openssl/crypto.h>
117#include "cryptlib.h" 117#include "cryptlib.h"
118#include <openssl/buffer.h> 118#include <openssl/buffer.h>
119#include <openssl/bio.h>
119#include <openssl/err.h> 120#include <openssl/err.h>
120#include <openssl/crypto.h>
121 121
122 122
123static LHASH *error_hash=NULL; 123static LHASH *error_hash=NULL;
@@ -137,6 +137,7 @@ static ERR_STRING_DATA ERR_str_libraries[]=
137{ERR_PACK(ERR_LIB_SYS,0,0) ,"system library"}, 137{ERR_PACK(ERR_LIB_SYS,0,0) ,"system library"},
138{ERR_PACK(ERR_LIB_BN,0,0) ,"bignum routines"}, 138{ERR_PACK(ERR_LIB_BN,0,0) ,"bignum routines"},
139{ERR_PACK(ERR_LIB_RSA,0,0) ,"rsa routines"}, 139{ERR_PACK(ERR_LIB_RSA,0,0) ,"rsa routines"},
140{ERR_PACK(ERR_LIB_DSA,0,0) ,"dsa routines"},
140{ERR_PACK(ERR_LIB_DH,0,0) ,"Diffie-Hellman routines"}, 141{ERR_PACK(ERR_LIB_DH,0,0) ,"Diffie-Hellman routines"},
141{ERR_PACK(ERR_LIB_EVP,0,0) ,"digital envelope routines"}, 142{ERR_PACK(ERR_LIB_EVP,0,0) ,"digital envelope routines"},
142{ERR_PACK(ERR_LIB_BUF,0,0) ,"memory buffer routines"}, 143{ERR_PACK(ERR_LIB_BUF,0,0) ,"memory buffer routines"},
@@ -155,6 +156,8 @@ static ERR_STRING_DATA ERR_str_libraries[]=
155{ERR_PACK(ERR_LIB_X509V3,0,0) ,"X509 V3 routines"}, 156{ERR_PACK(ERR_LIB_X509V3,0,0) ,"X509 V3 routines"},
156{ERR_PACK(ERR_LIB_PKCS12,0,0) ,"PKCS12 routines"}, 157{ERR_PACK(ERR_LIB_PKCS12,0,0) ,"PKCS12 routines"},
157{ERR_PACK(ERR_LIB_RAND,0,0) ,"random number generator"}, 158{ERR_PACK(ERR_LIB_RAND,0,0) ,"random number generator"},
159{ERR_PACK(ERR_LIB_DSO,0,0) ,"DSO support routines"},
160{ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"},
158{0,NULL}, 161{0,NULL},
159 }; 162 };
160 163
@@ -205,6 +208,8 @@ static ERR_STRING_DATA ERR_str_reasons[]=
205{ERR_R_EXPECTING_AN_ASN1_SEQUENCE ,"expecting an asn1 sequence"}, 208{ERR_R_EXPECTING_AN_ASN1_SEQUENCE ,"expecting an asn1 sequence"},
206{ERR_R_ASN1_LENGTH_MISMATCH ,"asn1 length mismatch"}, 209{ERR_R_ASN1_LENGTH_MISMATCH ,"asn1 length mismatch"},
207{ERR_R_MISSING_ASN1_EOS ,"missing asn1 eos"}, 210{ERR_R_MISSING_ASN1_EOS ,"missing asn1 eos"},
211{ERR_R_DSO_LIB ,"DSO lib"},
212{ERR_R_ENGINE_LIB ,"ENGINE lib"},
208 213
209{0,NULL}, 214{0,NULL},
210 }; 215 };
@@ -225,7 +230,7 @@ static ERR_STRING_DATA SYS_str_reasons[NUM_SYS_STR_REASONS + 1];
225 230
226static void build_SYS_str_reasons() 231static void build_SYS_str_reasons()
227 { 232 {
228 /* Malloc cannot be used here, use static storage instead */ 233 /* OPENSSL_malloc cannot be used here, use static storage instead */
229 static char strerror_tab[NUM_SYS_STR_REASONS][LEN_SYS_STR_REASON]; 234 static char strerror_tab[NUM_SYS_STR_REASONS][LEN_SYS_STR_REASON];
230 int i; 235 int i;
231 236
@@ -262,7 +267,7 @@ static void build_SYS_str_reasons()
262 if (((p)->err_data[i] != NULL) && \ 267 if (((p)->err_data[i] != NULL) && \
263 (p)->err_data_flags[i] & ERR_TXT_MALLOCED) \ 268 (p)->err_data_flags[i] & ERR_TXT_MALLOCED) \
264 { \ 269 { \
265 Free((p)->err_data[i]); \ 270 OPENSSL_free((p)->err_data[i]); \
266 (p)->err_data[i]=NULL; \ 271 (p)->err_data[i]=NULL; \
267 } \ 272 } \
268 (p)->err_data_flags[i]=0; 273 (p)->err_data_flags[i]=0;
@@ -278,7 +283,7 @@ static void ERR_STATE_free(ERR_STATE *s)
278 { 283 {
279 err_clear_data(s,i); 284 err_clear_data(s,i);
280 } 285 }
281 Free(s); 286 OPENSSL_free(s);
282 } 287 }
283 288
284void ERR_load_ERR_strings(void) 289void ERR_load_ERR_strings(void)
@@ -475,13 +480,11 @@ static unsigned long get_error_values(int inc, const char **file, int *line,
475 return(ret); 480 return(ret);
476 } 481 }
477 482
478/* BAD for multi-threaded, uses a local buffer if ret == NULL */ 483void ERR_error_string_n(unsigned long e, char *buf, size_t len)
479char *ERR_error_string(unsigned long e, char *ret)
480 { 484 {
481 static char buf[256]; 485 char lsbuf[64], fsbuf[64], rsbuf[64];
482 const char *ls,*fs,*rs; 486 const char *ls,*fs,*rs;
483 unsigned long l,f,r; 487 unsigned long l,f,r;
484 int i;
485 488
486 l=ERR_GET_LIB(e); 489 l=ERR_GET_LIB(e);
487 f=ERR_GET_FUNC(e); 490 f=ERR_GET_FUNC(e);
@@ -491,21 +494,50 @@ char *ERR_error_string(unsigned long e, char *ret)
491 fs=ERR_func_error_string(e); 494 fs=ERR_func_error_string(e);
492 rs=ERR_reason_error_string(e); 495 rs=ERR_reason_error_string(e);
493 496
494 if (ret == NULL) ret=buf; 497 if (ls == NULL)
495 498 BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
496 sprintf(&(ret[0]),"error:%08lX:",e);
497 i=strlen(ret);
498 if (ls == NULL)
499 sprintf(&(ret[i]),":lib(%lu) ",l);
500 else sprintf(&(ret[i]),"%s",ls);
501 i=strlen(ret);
502 if (fs == NULL) 499 if (fs == NULL)
503 sprintf(&(ret[i]),":func(%lu) ",f); 500 BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
504 else sprintf(&(ret[i]),":%s",fs);
505 i=strlen(ret);
506 if (rs == NULL) 501 if (rs == NULL)
507 sprintf(&(ret[i]),":reason(%lu)",r); 502 BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
508 else sprintf(&(ret[i]),":%s",rs); 503
504 BIO_snprintf(buf, len,"error:%08lX:%s:%s:%s", e, ls?ls:lsbuf,
505 fs?fs:fsbuf, rs?rs:rsbuf);
506 if (strlen(buf) == len-1)
507 {
508 /* output may be truncated; make sure we always have 5
509 * colon-separated fields, i.e. 4 colons ... */
510#define NUM_COLONS 4
511 if (len > NUM_COLONS) /* ... if possible */
512 {
513 int i;
514 char *s = buf;
515
516 for (i = 0; i < NUM_COLONS; i++)
517 {
518 char *colon = strchr(s, ':');
519 if (colon == NULL || colon > &buf[len-1] - NUM_COLONS + i)
520 {
521 /* set colon no. i at last possible position
522 * (buf[len-1] is the terminating 0)*/
523 colon = &buf[len-1] - NUM_COLONS + i;
524 *colon = ':';
525 }
526 s = colon + 1;
527 }
528 }
529 }
530 }
531
532/* BAD for multi-threading: uses a local buffer if ret == NULL */
533/* ERR_error_string_n should be used instead for ret != NULL
534 * as ERR_error_string cannot know how large the buffer is */
535char *ERR_error_string(unsigned long e, char *ret)
536 {
537 static char buf[256];
538
539 if (ret == NULL) ret=buf;
540 ERR_error_string_n(e, ret, 256);
509 541
510 return(ret); 542 return(ret);
511 } 543 }
@@ -515,6 +547,7 @@ LHASH *ERR_get_string_table(void)
515 return(error_hash); 547 return(error_hash);
516 } 548 }
517 549
550/* not thread-safe */
518LHASH *ERR_get_err_state_table(void) 551LHASH *ERR_get_err_state_table(void)
519 { 552 {
520 return(thread_hash); 553 return(thread_hash);
@@ -527,7 +560,7 @@ const char *ERR_lib_error_string(unsigned long e)
527 560
528 l=ERR_GET_LIB(e); 561 l=ERR_GET_LIB(e);
529 562
530 CRYPTO_r_lock(CRYPTO_LOCK_ERR_HASH); 563 CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH);
531 564
532 if (error_hash != NULL) 565 if (error_hash != NULL)
533 { 566 {
@@ -535,7 +568,7 @@ const char *ERR_lib_error_string(unsigned long e)
535 p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d); 568 p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d);
536 } 569 }
537 570
538 CRYPTO_r_unlock(CRYPTO_LOCK_ERR_HASH); 571 CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH);
539 572
540 return((p == NULL)?NULL:p->string); 573 return((p == NULL)?NULL:p->string);
541 } 574 }
@@ -548,7 +581,7 @@ const char *ERR_func_error_string(unsigned long e)
548 l=ERR_GET_LIB(e); 581 l=ERR_GET_LIB(e);
549 f=ERR_GET_FUNC(e); 582 f=ERR_GET_FUNC(e);
550 583
551 CRYPTO_r_lock(CRYPTO_LOCK_ERR_HASH); 584 CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH);
552 585
553 if (error_hash != NULL) 586 if (error_hash != NULL)
554 { 587 {
@@ -556,7 +589,7 @@ const char *ERR_func_error_string(unsigned long e)
556 p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d); 589 p=(ERR_STRING_DATA *)lh_retrieve(error_hash,&d);
557 } 590 }
558 591
559 CRYPTO_r_unlock(CRYPTO_LOCK_ERR_HASH); 592 CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH);
560 593
561 return((p == NULL)?NULL:p->string); 594 return((p == NULL)?NULL:p->string);
562 } 595 }
@@ -569,7 +602,7 @@ const char *ERR_reason_error_string(unsigned long e)
569 l=ERR_GET_LIB(e); 602 l=ERR_GET_LIB(e);
570 r=ERR_GET_REASON(e); 603 r=ERR_GET_REASON(e);
571 604
572 CRYPTO_r_lock(CRYPTO_LOCK_ERR_HASH); 605 CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH);
573 606
574 if (error_hash != NULL) 607 if (error_hash != NULL)
575 { 608 {
@@ -582,7 +615,7 @@ const char *ERR_reason_error_string(unsigned long e)
582 } 615 }
583 } 616 }
584 617
585 CRYPTO_r_unlock(CRYPTO_LOCK_ERR_HASH); 618 CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH);
586 619
587 return((p == NULL)?NULL:p->string); 620 return((p == NULL)?NULL:p->string);
588 } 621 }
@@ -613,7 +646,7 @@ static int pid_cmp(ERR_STATE *a, ERR_STATE *b)
613 646
614void ERR_remove_state(unsigned long pid) 647void ERR_remove_state(unsigned long pid)
615 { 648 {
616 ERR_STATE *p,tmp; 649 ERR_STATE *p = NULL,tmp;
617 650
618 if (thread_hash == NULL) 651 if (thread_hash == NULL)
619 return; 652 return;
@@ -621,7 +654,16 @@ void ERR_remove_state(unsigned long pid)
621 pid=(unsigned long)CRYPTO_thread_id(); 654 pid=(unsigned long)CRYPTO_thread_id();
622 tmp.pid=pid; 655 tmp.pid=pid;
623 CRYPTO_w_lock(CRYPTO_LOCK_ERR); 656 CRYPTO_w_lock(CRYPTO_LOCK_ERR);
624 p=(ERR_STATE *)lh_delete(thread_hash,&tmp); 657 if (thread_hash)
658 {
659 p=(ERR_STATE *)lh_delete(thread_hash,&tmp);
660 if (lh_num_items(thread_hash) == 0)
661 {
662 /* make sure we don't leak memory */
663 lh_free(thread_hash);
664 thread_hash = NULL;
665 }
666 }
625 CRYPTO_w_unlock(CRYPTO_LOCK_ERR); 667 CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
626 668
627 if (p != NULL) ERR_STATE_free(p); 669 if (p != NULL) ERR_STATE_free(p);
@@ -630,39 +672,25 @@ void ERR_remove_state(unsigned long pid)
630ERR_STATE *ERR_get_state(void) 672ERR_STATE *ERR_get_state(void)
631 { 673 {
632 static ERR_STATE fallback; 674 static ERR_STATE fallback;
633 ERR_STATE *ret=NULL,tmp,*tmpp; 675 ERR_STATE *ret=NULL,tmp,*tmpp=NULL;
676 int thread_state_exists;
634 int i; 677 int i;
635 unsigned long pid; 678 unsigned long pid;
636 679
637 pid=(unsigned long)CRYPTO_thread_id(); 680 pid=(unsigned long)CRYPTO_thread_id();
638 681
639 CRYPTO_r_lock(CRYPTO_LOCK_ERR); 682 CRYPTO_w_lock(CRYPTO_LOCK_ERR);
640 if (thread_hash == NULL) 683 if (thread_hash != NULL)
641 {
642 CRYPTO_r_unlock(CRYPTO_LOCK_ERR);
643 CRYPTO_w_lock(CRYPTO_LOCK_ERR);
644 if (thread_hash == NULL)
645 {
646 MemCheck_off();
647 thread_hash=lh_new(pid_hash,pid_cmp);
648 MemCheck_on();
649 CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
650 if (thread_hash == NULL) return(&fallback);
651 }
652 else
653 CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
654 }
655 else
656 { 684 {
657 tmp.pid=pid; 685 tmp.pid=pid;
658 ret=(ERR_STATE *)lh_retrieve(thread_hash,&tmp); 686 ret=(ERR_STATE *)lh_retrieve(thread_hash,&tmp);
659 CRYPTO_r_unlock(CRYPTO_LOCK_ERR);
660 } 687 }
688 CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
661 689
662 /* ret == the error state, if NULL, make a new one */ 690 /* ret == the error state, if NULL, make a new one */
663 if (ret == NULL) 691 if (ret == NULL)
664 { 692 {
665 ret=(ERR_STATE *)Malloc(sizeof(ERR_STATE)); 693 ret=(ERR_STATE *)OPENSSL_malloc(sizeof(ERR_STATE));
666 if (ret == NULL) return(&fallback); 694 if (ret == NULL) return(&fallback);
667 ret->pid=pid; 695 ret->pid=pid;
668 ret->top=0; 696 ret->top=0;
@@ -672,9 +700,29 @@ ERR_STATE *ERR_get_state(void)
672 ret->err_data[i]=NULL; 700 ret->err_data[i]=NULL;
673 ret->err_data_flags[i]=0; 701 ret->err_data_flags[i]=0;
674 } 702 }
703
675 CRYPTO_w_lock(CRYPTO_LOCK_ERR); 704 CRYPTO_w_lock(CRYPTO_LOCK_ERR);
676 tmpp=(ERR_STATE *)lh_insert(thread_hash,ret); 705
706 /* no entry yet in thread_hash for current thread -
707 * thus, it may have changed since we last looked at it */
708 if (thread_hash == NULL)
709 thread_hash = lh_new(pid_hash, pid_cmp);
710 if (thread_hash == NULL)
711 thread_state_exists = 0; /* allocation error */
712 else
713 {
714 tmpp=(ERR_STATE *)lh_insert(thread_hash,ret);
715 thread_state_exists = 1;
716 }
717
677 CRYPTO_w_unlock(CRYPTO_LOCK_ERR); 718 CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
719
720 if (!thread_state_exists)
721 {
722 ERR_STATE_free(ret); /* could not insert it */
723 return(&fallback);
724 }
725
678 if (tmpp != NULL) /* old entry - should not happen */ 726 if (tmpp != NULL) /* old entry - should not happen */
679 { 727 {
680 ERR_STATE_free(tmpp); 728 ERR_STATE_free(tmpp);
@@ -712,7 +760,7 @@ void ERR_add_error_data(int num, ...)
712 char *str,*p,*a; 760 char *str,*p,*a;
713 761
714 s=64; 762 s=64;
715 str=Malloc(s+1); 763 str=OPENSSL_malloc(s+1);
716 if (str == NULL) return; 764 if (str == NULL) return;
717 str[0]='\0'; 765 str[0]='\0';
718 766
@@ -728,10 +776,10 @@ void ERR_add_error_data(int num, ...)
728 if (n > s) 776 if (n > s)
729 { 777 {
730 s=n+20; 778 s=n+20;
731 p=Realloc(str,s+1); 779 p=OPENSSL_realloc(str,s+1);
732 if (p == NULL) 780 if (p == NULL)
733 { 781 {
734 Free(str); 782 OPENSSL_free(str);
735 return; 783 return;
736 } 784 }
737 else 785 else
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h
index 15bafbff43..7388a4a937 100644
--- a/src/lib/libcrypto/err/err.h
+++ b/src/lib/libcrypto/err/err.h
@@ -59,12 +59,20 @@
59#ifndef HEADER_ERR_H 59#ifndef HEADER_ERR_H
60#define HEADER_ERR_H 60#define HEADER_ERR_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifndef NO_FP_API 62#ifndef NO_FP_API
67#include <stdio.h> 63#include <stdio.h>
64#include <stdlib.h>
65#endif
66
67#ifndef NO_BIO
68#include <openssl/bio.h>
69#endif
70#ifndef NO_LHASH
71#include <openssl/lhash.h>
72#endif
73
74#ifdef __cplusplus
75extern "C" {
68#endif 76#endif
69 77
70/* The following is a bit of a trick to help the object files only contain 78/* The following is a bit of a trick to help the object files only contain
@@ -123,6 +131,8 @@ typedef struct err_state_st
123#define ERR_LIB_X509V3 34 131#define ERR_LIB_X509V3 34
124#define ERR_LIB_PKCS12 35 132#define ERR_LIB_PKCS12 35
125#define ERR_LIB_RAND 36 133#define ERR_LIB_RAND 36
134#define ERR_LIB_DSO 37
135#define ERR_LIB_ENGINE 38
126 136
127#define ERR_LIB_USER 128 137#define ERR_LIB_USER 128
128 138
@@ -151,6 +161,8 @@ typedef struct err_state_st
151#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),ERR_file_name,__LINE__) 161#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),ERR_file_name,__LINE__)
152#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),ERR_file_name,__LINE__) 162#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),ERR_file_name,__LINE__)
153#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),ERR_file_name,__LINE__) 163#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),ERR_file_name,__LINE__)
164#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),ERR_file_name,__LINE__)
165#define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),ERR_file_name,__LINE__)
154 166
155/* Borland C seems too stupid to be able to shift and do longs in 167/* Borland C seems too stupid to be able to shift and do longs in
156 * the pre-processor :-( */ 168 * the pre-processor :-( */
@@ -199,6 +211,8 @@ typedef struct err_state_st
199#define ERR_R_BIO_LIB ERR_LIB_BIO 211#define ERR_R_BIO_LIB ERR_LIB_BIO
200#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 212#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7
201#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 213#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12
214#define ERR_R_DSO_LIB ERR_LIB_DSO
215#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE
202 216
203/* fatal error */ 217/* fatal error */
204#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) 218#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
@@ -230,13 +244,14 @@ unsigned long ERR_peek_error_line_data(const char **file,int *line,
230 const char **data,int *flags); 244 const char **data,int *flags);
231void ERR_clear_error(void ); 245void ERR_clear_error(void );
232char *ERR_error_string(unsigned long e,char *buf); 246char *ERR_error_string(unsigned long e,char *buf);
247void ERR_error_string_n(unsigned long e, char *buf, size_t len);
233const char *ERR_lib_error_string(unsigned long e); 248const char *ERR_lib_error_string(unsigned long e);
234const char *ERR_func_error_string(unsigned long e); 249const char *ERR_func_error_string(unsigned long e);
235const char *ERR_reason_error_string(unsigned long e); 250const char *ERR_reason_error_string(unsigned long e);
236#ifndef NO_FP_API 251#ifndef NO_FP_API
237void ERR_print_errors_fp(FILE *fp); 252void ERR_print_errors_fp(FILE *fp);
238#endif 253#endif
239#ifdef HEADER_BIO_H 254#ifndef NO_BIO
240void ERR_print_errors(BIO *bp); 255void ERR_print_errors(BIO *bp);
241void ERR_add_error_data(int num, ...); 256void ERR_add_error_data(int num, ...);
242#endif 257#endif
@@ -248,15 +263,13 @@ void ERR_free_strings(void);
248void ERR_remove_state(unsigned long pid); /* if zero we look it up */ 263void ERR_remove_state(unsigned long pid); /* if zero we look it up */
249ERR_STATE *ERR_get_state(void); 264ERR_STATE *ERR_get_state(void);
250 265
251#ifdef HEADER_LHASH_H 266#ifndef NO_LHASH
252LHASH *ERR_get_string_table(void ); 267LHASH *ERR_get_string_table(void);
253LHASH *ERR_get_err_state_table(void ); 268LHASH *ERR_get_err_state_table(void); /* even less thread-safe than
254#else 269 * ERR_get_string_table :-) */
255char *ERR_get_string_table(void );
256char *ERR_get_err_state_table(void );
257#endif 270#endif
258 271
259int ERR_get_next_error_library(void ); 272int ERR_get_next_error_library(void);
260 273
261#ifdef __cplusplus 274#ifdef __cplusplus
262} 275}
diff --git a/src/lib/libcrypto/err/err_all.c b/src/lib/libcrypto/err/err_all.c
index 10c463b389..b8315d8272 100644
--- a/src/lib/libcrypto/err/err_all.c
+++ b/src/lib/libcrypto/err/err_all.c
@@ -81,6 +81,8 @@
81#include <openssl/conf.h> 81#include <openssl/conf.h>
82#include <openssl/pkcs12.h> 82#include <openssl/pkcs12.h>
83#include <openssl/rand.h> 83#include <openssl/rand.h>
84#include <openssl/dso.h>
85#include <openssl/engine.h>
84#include <openssl/err.h> 86#include <openssl/err.h>
85 87
86void ERR_load_crypto_strings(void) 88void ERR_load_crypto_strings(void)
@@ -118,5 +120,7 @@ void ERR_load_crypto_strings(void)
118 ERR_load_PKCS7_strings(); 120 ERR_load_PKCS7_strings();
119 ERR_load_PKCS12_strings(); 121 ERR_load_PKCS12_strings();
120 ERR_load_RAND_strings(); 122 ERR_load_RAND_strings();
123 ERR_load_DSO_strings();
124 ERR_load_ENGINE_strings();
121#endif 125#endif
122 } 126 }
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c
index 0999ff214b..6f60b016c3 100644
--- a/src/lib/libcrypto/err/err_prn.c
+++ b/src/lib/libcrypto/err/err_prn.c
@@ -76,7 +76,8 @@ void ERR_print_errors_fp(FILE *fp)
76 es=CRYPTO_thread_id(); 76 es=CRYPTO_thread_id();
77 while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) 77 while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0)
78 { 78 {
79 fprintf(fp,"%lu:%s:%s:%d:%s\n",es,ERR_error_string(l,buf), 79 ERR_error_string_n(l, buf, sizeof buf);
80 fprintf(fp,"%lu:%s:%s:%d:%s\n",es,buf,
80 file,line,(flags&ERR_TXT_STRING)?data:""); 81 file,line,(flags&ERR_TXT_STRING)?data:"");
81 } 82 }
82 } 83 }
@@ -94,7 +95,8 @@ void ERR_print_errors(BIO *bp)
94 es=CRYPTO_thread_id(); 95 es=CRYPTO_thread_id();
95 while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0) 96 while ((l=ERR_get_error_line_data(&file,&line,&data,&flags)) != 0)
96 { 97 {
97 sprintf(buf2,"%lu:%s:%s:%d:",es,ERR_error_string(l,buf), 98 ERR_error_string_n(l, buf, sizeof buf);
99 sprintf(buf2,"%lu:%s:%s:%d:",es,buf,
98 file,line); 100 file,line);
99 BIO_write(bp,buf2,strlen(buf2)); 101 BIO_write(bp,buf2,strlen(buf2));
100 if (flags & ERR_TXT_STRING) 102 if (flags & ERR_TXT_STRING)
diff --git a/src/lib/libcrypto/err/openssl.ec b/src/lib/libcrypto/err/openssl.ec
index e132ba3182..861d680e07 100644
--- a/src/lib/libcrypto/err/openssl.ec
+++ b/src/lib/libcrypto/err/openssl.ec
@@ -3,6 +3,7 @@ L CRYPTO crypto/crypto.h crypto/cpt_err.c
3L BN crypto/bn/bn.h crypto/bn/bn_err.c 3L BN crypto/bn/bn.h crypto/bn/bn_err.c
4L RSA crypto/rsa/rsa.h crypto/rsa/rsa_err.c 4L RSA crypto/rsa/rsa.h crypto/rsa/rsa_err.c
5L DSA crypto/dsa/dsa.h crypto/dsa/dsa_err.c 5L DSA crypto/dsa/dsa.h crypto/dsa/dsa_err.c
6L DSO crypto/dso/dso.h crypto/dso/dso_err.c
6L DH crypto/dh/dh.h crypto/dh/dh_err.c 7L DH crypto/dh/dh.h crypto/dh/dh_err.c
7L EVP crypto/evp/evp.h crypto/evp/evp_err.c 8L EVP crypto/evp/evp.h crypto/evp/evp_err.c
8L BUF crypto/buffer/buffer.h crypto/buffer/buf_err.c 9L BUF crypto/buffer/buffer.h crypto/buffer/buf_err.c
@@ -22,6 +23,7 @@ L RSAREF rsaref/rsaref.h rsaref/rsar_err.c
22L SSL ssl/ssl.h ssl/ssl_err.c 23L SSL ssl/ssl.h ssl/ssl_err.c
23L COMP crypto/comp/comp.h crypto/comp/comp_err.c 24L COMP crypto/comp/comp.h crypto/comp/comp_err.c
24L RAND crypto/rand/rand.h crypto/rand/rand_err.c 25L RAND crypto/rand/rand.h crypto/rand/rand_err.c
26L ENGINE crypto/engine/engine.h crypto/engine/engine_err.c
25 27
26 28
27F RSAREF_F_RSA_BN2BIN 29F RSAREF_F_RSA_BN2BIN
diff --git a/src/lib/libcrypto/evp/Makefile.ssl b/src/lib/libcrypto/evp/Makefile.ssl
index c763b5ccd6..ad39fcc9e7 100644
--- a/src/lib/libcrypto/evp/Makefile.ssl
+++ b/src/lib/libcrypto/evp/Makefile.ssl
@@ -23,32 +23,22 @@ APPS=
23 23
24LIB=$(TOP)/libcrypto.a 24LIB=$(TOP)/libcrypto.a
25LIBSRC= encode.c digest.c evp_enc.c evp_key.c \ 25LIBSRC= encode.c digest.c evp_enc.c evp_key.c \
26 e_ecb_d.c e_cbc_d.c e_cfb_d.c e_ofb_d.c \ 26 e_des.c e_bf.c e_idea.c e_des3.c \
27 e_ecb_i.c e_cbc_i.c e_cfb_i.c e_ofb_i.c \ 27 e_rc4.c names.c \
28 e_ecb_3d.c e_cbc_3d.c e_rc4.c names.c \ 28 e_xcbc_d.c e_rc2.c e_cast.c e_rc5.c \
29 e_cfb_3d.c e_ofb_3d.c e_xcbc_d.c \ 29 m_null.c m_md2.c m_md4.c m_md5.c m_sha.c m_sha1.c \
30 e_ecb_r2.c e_cbc_r2.c e_cfb_r2.c e_ofb_r2.c \ 30 m_dss.c m_dss1.c m_mdc2.c m_ripemd.c \
31 e_ecb_bf.c e_cbc_bf.c e_cfb_bf.c e_ofb_bf.c \
32 e_ecb_c.c e_cbc_c.c e_cfb_c.c e_ofb_c.c \
33 e_ecb_r5.c e_cbc_r5.c e_cfb_r5.c e_ofb_r5.c \
34 m_null.c m_md2.c m_md5.c m_sha.c m_sha1.c m_dss.c m_dss1.c m_mdc2.c \
35 m_ripemd.c \
36 p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \ 31 p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c p_dec.c \
37 bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ 32 bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \
38 c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ 33 c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \
39 evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c 34 evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c
40 35
41LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \ 36LIBOBJ= encode.o digest.o evp_enc.o evp_key.o \
42 e_ecb_d.o e_cbc_d.o e_cfb_d.o e_ofb_d.o \ 37 e_des.o e_bf.o e_idea.o e_des3.o \
43 e_ecb_i.o e_cbc_i.o e_cfb_i.o e_ofb_i.o \ 38 e_rc4.o names.o \
44 e_ecb_3d.o e_cbc_3d.o e_rc4.o names.o \ 39 e_xcbc_d.o e_rc2.o e_cast.o e_rc5.o \
45 e_cfb_3d.o e_ofb_3d.o e_xcbc_d.o \ 40 m_null.o m_md2.o m_md4.o m_md5.o m_sha.o m_sha1.o \
46 e_ecb_r2.o e_cbc_r2.o e_cfb_r2.o e_ofb_r2.o \ 41 m_dss.o m_dss1.o m_mdc2.o m_ripemd.o \
47 e_ecb_bf.o e_cbc_bf.o e_cfb_bf.o e_ofb_bf.o \
48 e_ecb_c.o e_cbc_c.o e_cfb_c.o e_ofb_c.o \
49 e_ecb_r5.o e_cbc_r5.o e_cfb_r5.o e_ofb_r5.o \
50 m_null.o m_md2.o m_md5.o m_sha.o m_sha1.o m_dss.o m_dss1.o m_mdc2.o \
51 m_ripemd.o \
52 p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \ 42 p_open.o p_seal.o p_sign.o p_verify.o p_lib.o p_enc.o p_dec.o \
53 bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ 43 bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \
54 c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \ 44 c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \
@@ -114,14 +104,16 @@ bio_b64.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
114bio_b64.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 104bio_b64.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
115bio_b64.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 105bio_b64.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
116bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h 106bio_b64.o: ../../include/openssl/err.h ../../include/openssl/evp.h
117bio_b64.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 107bio_b64.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
108bio_b64.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
118bio_b64.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 109bio_b64.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
119bio_b64.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 110bio_b64.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
120bio_b64.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 111bio_b64.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
121bio_b64.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 112bio_b64.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
122bio_b64.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 113bio_b64.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
123bio_b64.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 114bio_b64.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
124bio_b64.o: ../../include/openssl/stack.h ../cryptlib.h 115bio_b64.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
116bio_b64.o: ../../include/openssl/symhacks.h ../cryptlib.h
125bio_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 117bio_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
126bio_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 118bio_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
127bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 119bio_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -129,14 +121,16 @@ bio_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
129bio_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 121bio_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
130bio_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 122bio_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
131bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 123bio_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
132bio_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 124bio_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
125bio_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
133bio_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 126bio_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
134bio_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 127bio_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
135bio_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 128bio_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
136bio_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 129bio_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
137bio_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 130bio_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
138bio_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 131bio_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
139bio_enc.o: ../../include/openssl/stack.h ../cryptlib.h 132bio_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
133bio_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h
140bio_md.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 134bio_md.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
141bio_md.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 135bio_md.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
142bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 136bio_md.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -144,14 +138,16 @@ bio_md.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
144bio_md.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 138bio_md.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
145bio_md.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 139bio_md.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
146bio_md.o: ../../include/openssl/err.h ../../include/openssl/evp.h 140bio_md.o: ../../include/openssl/err.h ../../include/openssl/evp.h
147bio_md.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 141bio_md.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
142bio_md.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
148bio_md.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 143bio_md.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
149bio_md.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 144bio_md.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
150bio_md.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 145bio_md.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
151bio_md.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 146bio_md.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
152bio_md.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 147bio_md.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
153bio_md.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 148bio_md.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
154bio_md.o: ../../include/openssl/stack.h ../cryptlib.h 149bio_md.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
150bio_md.o: ../../include/openssl/symhacks.h ../cryptlib.h
155bio_ok.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 151bio_ok.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
156bio_ok.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 152bio_ok.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
157bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 153bio_ok.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -159,14 +155,16 @@ bio_ok.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
159bio_ok.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 155bio_ok.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
160bio_ok.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 156bio_ok.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
161bio_ok.o: ../../include/openssl/err.h ../../include/openssl/evp.h 157bio_ok.o: ../../include/openssl/err.h ../../include/openssl/evp.h
162bio_ok.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 158bio_ok.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
159bio_ok.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
163bio_ok.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 160bio_ok.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
164bio_ok.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 161bio_ok.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
165bio_ok.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 162bio_ok.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
166bio_ok.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 163bio_ok.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
167bio_ok.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 164bio_ok.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
168bio_ok.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 165bio_ok.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
169bio_ok.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 166bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
167bio_ok.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
170bio_ok.o: ../cryptlib.h 168bio_ok.o: ../cryptlib.h
171c_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 169c_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
172c_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 170c_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -175,14 +173,16 @@ c_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
175c_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 173c_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
176c_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 174c_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
177c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 175c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
178c_all.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 176c_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
177c_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
179c_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 178c_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
180c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 179c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
181c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 180c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
182c_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 181c_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
183c_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 182c_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
184c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 183c_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
185c_all.o: ../../include/openssl/stack.h ../cryptlib.h 184c_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
185c_all.o: ../../include/openssl/symhacks.h ../cryptlib.h
186c_allc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 186c_allc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
187c_allc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 187c_allc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
188c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 188c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -190,15 +190,17 @@ c_allc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
190c_allc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 190c_allc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
191c_allc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 191c_allc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
192c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 192c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
193c_allc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 193c_allc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
194c_allc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
194c_allc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 195c_allc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
195c_allc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 196c_allc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
196c_allc.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 197c_allc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
197c_allc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 198c_allc.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
198c_allc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 199c_allc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
199c_allc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 200c_allc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
200c_allc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 201c_allc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
201c_allc.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 202c_allc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
203c_allc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
202c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 204c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
203c_alld.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 205c_alld.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
204c_alld.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 206c_alld.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -207,15 +209,17 @@ c_alld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
207c_alld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 209c_alld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
208c_alld.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 210c_alld.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
209c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h 211c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h
210c_alld.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 212c_alld.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
213c_alld.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
211c_alld.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 214c_alld.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
212c_alld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 215c_alld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
213c_alld.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 216c_alld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
214c_alld.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 217c_alld.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
215c_alld.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 218c_alld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
216c_alld.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 219c_alld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
217c_alld.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 220c_alld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
218c_alld.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 221c_alld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
222c_alld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
219c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 223c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
220digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 224digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
221digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 225digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -224,329 +228,101 @@ digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
224digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 228digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
225digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 229digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
226digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h 230digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
227digest.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 231digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
232digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
228digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 233digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
229digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 234digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
230digest.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 235digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
231digest.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 236digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
232digest.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 237digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
233digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 238digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
234digest.o: ../../include/openssl/stack.h ../cryptlib.h 239digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
235e_cbc_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 240digest.o: ../../include/openssl/symhacks.h ../cryptlib.h
236e_cbc_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 241e_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
237e_cbc_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 242e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
238e_cbc_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 243e_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
239e_cbc_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 244e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
240e_cbc_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 245e_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
241e_cbc_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h 246e_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
242e_cbc_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 247e_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
243e_cbc_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 248e_bf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
244e_cbc_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 249e_bf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
245e_cbc_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 250e_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
246e_cbc_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 251e_bf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
247e_cbc_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 252e_bf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
248e_cbc_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 253e_bf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
249e_cbc_3d.o: ../../include/openssl/stack.h ../cryptlib.h 254e_bf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
250e_cbc_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 255e_bf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
251e_cbc_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 256e_bf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
252e_cbc_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 257e_bf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
253e_cbc_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 258e_cast.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
254e_cbc_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 259e_cast.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
255e_cbc_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 260e_cast.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
256e_cbc_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h 261e_cast.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
257e_cbc_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 262e_cast.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
258e_cbc_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 263e_cast.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
259e_cbc_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 264e_cast.o: ../../include/openssl/err.h ../../include/openssl/evp.h
260e_cbc_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 265e_cast.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
261e_cbc_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 266e_cast.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
262e_cbc_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 267e_cast.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
263e_cbc_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 268e_cast.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
264e_cbc_bf.o: ../../include/openssl/stack.h ../cryptlib.h 269e_cast.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
265e_cbc_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 270e_cast.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
266e_cbc_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 271e_cast.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
267e_cbc_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 272e_cast.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
268e_cbc_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 273e_cast.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
269e_cbc_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 274e_cast.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
270e_cbc_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 275e_des.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
271e_cbc_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h 276e_des.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
272e_cbc_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 277e_des.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
273e_cbc_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 278e_des.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
274e_cbc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 279e_des.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
275e_cbc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 280e_des.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
276e_cbc_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 281e_des.o: ../../include/openssl/err.h ../../include/openssl/evp.h
277e_cbc_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 282e_des.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
278e_cbc_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 283e_des.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
279e_cbc_c.o: ../../include/openssl/stack.h ../cryptlib.h 284e_des.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
280e_cbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 285e_des.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
281e_cbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 286e_des.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
282e_cbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 287e_des.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
283e_cbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 288e_des.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
284e_cbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 289e_des.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
285e_cbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 290e_des.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
286e_cbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h 291e_des.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
287e_cbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 292e_des3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
288e_cbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 293e_des3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
289e_cbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 294e_des3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
290e_cbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 295e_des3.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
291e_cbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 296e_des3.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
292e_cbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 297e_des3.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
293e_cbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 298e_des3.o: ../../include/openssl/err.h ../../include/openssl/evp.h
294e_cbc_d.o: ../../include/openssl/stack.h ../cryptlib.h 299e_des3.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
295e_cbc_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 300e_des3.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
296e_cbc_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 301e_des3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
297e_cbc_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 302e_des3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
298e_cbc_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 303e_des3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
299e_cbc_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 304e_des3.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
300e_cbc_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 305e_des3.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
301e_cbc_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h 306e_des3.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
302e_cbc_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 307e_des3.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
303e_cbc_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 308e_des3.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
304e_cbc_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 309e_idea.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
305e_cbc_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 310e_idea.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
306e_cbc_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 311e_idea.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
307e_cbc_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 312e_idea.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
308e_cbc_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 313e_idea.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
309e_cbc_i.o: ../../include/openssl/stack.h ../cryptlib.h 314e_idea.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
310e_cbc_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 315e_idea.o: ../../include/openssl/err.h ../../include/openssl/evp.h
311e_cbc_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 316e_idea.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
312e_cbc_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 317e_idea.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
313e_cbc_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 318e_idea.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
314e_cbc_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 319e_idea.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
315e_cbc_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 320e_idea.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
316e_cbc_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h 321e_idea.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
317e_cbc_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 322e_idea.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
318e_cbc_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 323e_idea.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
319e_cbc_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 324e_idea.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
320e_cbc_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 325e_idea.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
321e_cbc_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
322e_cbc_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
323e_cbc_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
324e_cbc_r2.o: ../../include/openssl/stack.h ../cryptlib.h
325e_cbc_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
326e_cbc_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
327e_cbc_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
328e_cbc_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
329e_cbc_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
330e_cbc_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
331e_cbc_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
332e_cbc_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
333e_cbc_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
334e_cbc_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
335e_cbc_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
336e_cbc_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
337e_cbc_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
338e_cbc_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
339e_cbc_r5.o: ../../include/openssl/stack.h ../cryptlib.h
340e_cfb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
341e_cfb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
342e_cfb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
343e_cfb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
344e_cfb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
345e_cfb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
346e_cfb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
347e_cfb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
348e_cfb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
349e_cfb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
350e_cfb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
351e_cfb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
352e_cfb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
353e_cfb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
354e_cfb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
355e_cfb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
356e_cfb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
357e_cfb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
358e_cfb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
359e_cfb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
360e_cfb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
361e_cfb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
362e_cfb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
363e_cfb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
364e_cfb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
365e_cfb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
366e_cfb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
367e_cfb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
368e_cfb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
369e_cfb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
370e_cfb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
371e_cfb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
372e_cfb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
373e_cfb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
374e_cfb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
375e_cfb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
376e_cfb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
377e_cfb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
378e_cfb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
379e_cfb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
380e_cfb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
381e_cfb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
382e_cfb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
383e_cfb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
384e_cfb_c.o: ../../include/openssl/stack.h ../cryptlib.h
385e_cfb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
386e_cfb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
387e_cfb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
388e_cfb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
389e_cfb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
390e_cfb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
391e_cfb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
392e_cfb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
393e_cfb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
394e_cfb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
395e_cfb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
396e_cfb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
397e_cfb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
398e_cfb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
399e_cfb_d.o: ../../include/openssl/stack.h ../cryptlib.h
400e_cfb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
401e_cfb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
402e_cfb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
403e_cfb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
404e_cfb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
405e_cfb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
406e_cfb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
407e_cfb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
408e_cfb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
409e_cfb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
410e_cfb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
411e_cfb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
412e_cfb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
413e_cfb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
414e_cfb_i.o: ../../include/openssl/stack.h ../cryptlib.h
415e_cfb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
416e_cfb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
417e_cfb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
418e_cfb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
419e_cfb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
420e_cfb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
421e_cfb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
422e_cfb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
423e_cfb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
424e_cfb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
425e_cfb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
426e_cfb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
427e_cfb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
428e_cfb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
429e_cfb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
430e_cfb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
431e_cfb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
432e_cfb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
433e_cfb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
434e_cfb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
435e_cfb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
436e_cfb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
437e_cfb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
438e_cfb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
439e_cfb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
440e_cfb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
441e_cfb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
442e_cfb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
443e_cfb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
444e_cfb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
445e_ecb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
446e_ecb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
447e_ecb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
448e_ecb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
449e_ecb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
450e_ecb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
451e_ecb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
452e_ecb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
453e_ecb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
454e_ecb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
455e_ecb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
456e_ecb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
457e_ecb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
458e_ecb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
459e_ecb_3d.o: ../../include/openssl/stack.h ../cryptlib.h
460e_ecb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
461e_ecb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
462e_ecb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
463e_ecb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
464e_ecb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
465e_ecb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
466e_ecb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
467e_ecb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
468e_ecb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
469e_ecb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
470e_ecb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
471e_ecb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
472e_ecb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
473e_ecb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
474e_ecb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
475e_ecb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
476e_ecb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
477e_ecb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
478e_ecb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
479e_ecb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
480e_ecb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
481e_ecb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
482e_ecb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
483e_ecb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
484e_ecb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
485e_ecb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
486e_ecb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
487e_ecb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
488e_ecb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
489e_ecb_c.o: ../../include/openssl/stack.h ../cryptlib.h
490e_ecb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
491e_ecb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
492e_ecb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
493e_ecb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
494e_ecb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
495e_ecb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
496e_ecb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
497e_ecb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
498e_ecb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
499e_ecb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
500e_ecb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
501e_ecb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
502e_ecb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
503e_ecb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
504e_ecb_d.o: ../../include/openssl/stack.h ../cryptlib.h
505e_ecb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
506e_ecb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
507e_ecb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
508e_ecb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
509e_ecb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
510e_ecb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
511e_ecb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
512e_ecb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
513e_ecb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
514e_ecb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
515e_ecb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
516e_ecb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
517e_ecb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
518e_ecb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
519e_ecb_i.o: ../../include/openssl/stack.h ../cryptlib.h
520e_ecb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
521e_ecb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
522e_ecb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
523e_ecb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
524e_ecb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
525e_ecb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
526e_ecb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
527e_ecb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
528e_ecb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
529e_ecb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
530e_ecb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
531e_ecb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
532e_ecb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
533e_ecb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
534e_ecb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
535e_ecb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
536e_ecb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
537e_ecb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
538e_ecb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
539e_ecb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
540e_ecb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
541e_ecb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
542e_ecb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
543e_ecb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
544e_ecb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
545e_ecb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
546e_ecb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
547e_ecb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
548e_ecb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
549e_ecb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
550e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 326e_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
551e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 327e_null.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
552e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 328e_null.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -554,119 +330,33 @@ e_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
554e_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 330e_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
555e_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 331e_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
556e_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h 332e_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
557e_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 333e_null.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
334e_null.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
558e_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 335e_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
559e_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 336e_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
560e_null.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 337e_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
561e_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 338e_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
562e_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 339e_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
563e_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 340e_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
564e_null.o: ../../include/openssl/stack.h ../cryptlib.h 341e_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
565e_ofb_3d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 342e_null.o: ../../include/openssl/symhacks.h ../cryptlib.h
566e_ofb_3d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 343e_rc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
567e_ofb_3d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 344e_rc2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
568e_ofb_3d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 345e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
569e_ofb_3d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 346e_rc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
570e_ofb_3d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 347e_rc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
571e_ofb_3d.o: ../../include/openssl/err.h ../../include/openssl/evp.h 348e_rc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
572e_ofb_3d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 349e_rc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
573e_ofb_3d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 350e_rc2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
574e_ofb_3d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 351e_rc2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
575e_ofb_3d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 352e_rc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
576e_ofb_3d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 353e_rc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
577e_ofb_3d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 354e_rc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
578e_ofb_3d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 355e_rc2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
579e_ofb_3d.o: ../../include/openssl/stack.h ../cryptlib.h 356e_rc2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
580e_ofb_bf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 357e_rc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
581e_ofb_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 358e_rc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
582e_ofb_bf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 359e_rc2.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
583e_ofb_bf.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
584e_ofb_bf.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
585e_ofb_bf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
586e_ofb_bf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
587e_ofb_bf.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
588e_ofb_bf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
589e_ofb_bf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
590e_ofb_bf.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
591e_ofb_bf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
592e_ofb_bf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
593e_ofb_bf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
594e_ofb_bf.o: ../../include/openssl/stack.h ../cryptlib.h
595e_ofb_c.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
596e_ofb_c.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
597e_ofb_c.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
598e_ofb_c.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
599e_ofb_c.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
600e_ofb_c.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
601e_ofb_c.o: ../../include/openssl/err.h ../../include/openssl/evp.h
602e_ofb_c.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
603e_ofb_c.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
604e_ofb_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
605e_ofb_c.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
606e_ofb_c.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
607e_ofb_c.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
608e_ofb_c.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
609e_ofb_c.o: ../../include/openssl/stack.h ../cryptlib.h
610e_ofb_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
611e_ofb_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
612e_ofb_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
613e_ofb_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
614e_ofb_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
615e_ofb_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
616e_ofb_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
617e_ofb_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
618e_ofb_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
619e_ofb_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
620e_ofb_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
621e_ofb_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
622e_ofb_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
623e_ofb_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
624e_ofb_d.o: ../../include/openssl/stack.h ../cryptlib.h
625e_ofb_i.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
626e_ofb_i.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
627e_ofb_i.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
628e_ofb_i.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
629e_ofb_i.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
630e_ofb_i.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
631e_ofb_i.o: ../../include/openssl/err.h ../../include/openssl/evp.h
632e_ofb_i.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
633e_ofb_i.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
634e_ofb_i.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
635e_ofb_i.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
636e_ofb_i.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
637e_ofb_i.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
638e_ofb_i.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
639e_ofb_i.o: ../../include/openssl/stack.h ../cryptlib.h
640e_ofb_r2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
641e_ofb_r2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
642e_ofb_r2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
643e_ofb_r2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
644e_ofb_r2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
645e_ofb_r2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
646e_ofb_r2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
647e_ofb_r2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
648e_ofb_r2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
649e_ofb_r2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
650e_ofb_r2.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
651e_ofb_r2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
652e_ofb_r2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
653e_ofb_r2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
654e_ofb_r2.o: ../../include/openssl/stack.h ../cryptlib.h
655e_ofb_r5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
656e_ofb_r5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
657e_ofb_r5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
658e_ofb_r5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
659e_ofb_r5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
660e_ofb_r5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
661e_ofb_r5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
662e_ofb_r5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
663e_ofb_r5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
664e_ofb_r5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
665e_ofb_r5.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
666e_ofb_r5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
667e_ofb_r5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
668e_ofb_r5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
669e_ofb_r5.o: ../../include/openssl/stack.h ../cryptlib.h
670e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 360e_rc4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
671e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 361e_rc4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
672e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 362e_rc4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -674,14 +364,33 @@ e_rc4.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
674e_rc4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 364e_rc4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
675e_rc4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 365e_rc4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
676e_rc4.o: ../../include/openssl/err.h ../../include/openssl/evp.h 366e_rc4.o: ../../include/openssl/err.h ../../include/openssl/evp.h
677e_rc4.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 367e_rc4.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
368e_rc4.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
678e_rc4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 369e_rc4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
679e_rc4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 370e_rc4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
680e_rc4.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 371e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
681e_rc4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 372e_rc4.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
682e_rc4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 373e_rc4.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
683e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 374e_rc4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
684e_rc4.o: ../../include/openssl/stack.h ../cryptlib.h 375e_rc4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
376e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h
377e_rc5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
378e_rc5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
379e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
380e_rc5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
381e_rc5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
382e_rc5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
383e_rc5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
384e_rc5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
385e_rc5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
386e_rc5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
387e_rc5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
388e_rc5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
389e_rc5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
390e_rc5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
391e_rc5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
392e_rc5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
393e_rc5.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
685e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 394e_xcbc_d.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
686e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 395e_xcbc_d.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
687e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 396e_xcbc_d.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -689,14 +398,17 @@ e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
689e_xcbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 398e_xcbc_d.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
690e_xcbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 399e_xcbc_d.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
691e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h 400e_xcbc_d.o: ../../include/openssl/err.h ../../include/openssl/evp.h
692e_xcbc_d.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 401e_xcbc_d.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
402e_xcbc_d.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
693e_xcbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 403e_xcbc_d.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
694e_xcbc_d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 404e_xcbc_d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
405e_xcbc_d.o: ../../include/openssl/opensslconf.h
695e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 406e_xcbc_d.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
696e_xcbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 407e_xcbc_d.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
697e_xcbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 408e_xcbc_d.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
698e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 409e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
699e_xcbc_d.o: ../../include/openssl/stack.h ../cryptlib.h 410e_xcbc_d.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
411e_xcbc_d.o: ../cryptlib.h
700encode.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 412encode.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
701encode.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 413encode.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
702encode.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 414encode.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -704,14 +416,16 @@ encode.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
704encode.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 416encode.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
705encode.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 417encode.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
706encode.o: ../../include/openssl/err.h ../../include/openssl/evp.h 418encode.o: ../../include/openssl/err.h ../../include/openssl/evp.h
707encode.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 419encode.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
420encode.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
708encode.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 421encode.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
709encode.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 422encode.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
710encode.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 423encode.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
711encode.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 424encode.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
712encode.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 425encode.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
713encode.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 426encode.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
714encode.o: ../../include/openssl/stack.h ../cryptlib.h 427encode.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
428encode.o: ../../include/openssl/symhacks.h ../cryptlib.h
715evp_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 429evp_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
716evp_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 430evp_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
717evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 431evp_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -719,28 +433,32 @@ evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
719evp_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 433evp_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
720evp_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 434evp_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
721evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 435evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
722evp_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 436evp_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
437evp_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
723evp_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 438evp_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
724evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 439evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
725evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 440evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
726evp_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 441evp_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
727evp_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 442evp_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
728evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 443evp_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
729evp_enc.o: ../../include/openssl/stack.h ../cryptlib.h 444evp_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
445evp_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_locl.h
730evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 446evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
731evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 447evp_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
732evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 448evp_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
733evp_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h 449evp_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h
734evp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 450evp_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
735evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 451evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
736evp_err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 452evp_err.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
453evp_err.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
737evp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 454evp_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
738evp_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 455evp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
739evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 456evp_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
740evp_err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 457evp_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
741evp_err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 458evp_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
742evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 459evp_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
743evp_err.o: ../../include/openssl/stack.h 460evp_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
461evp_err.o: ../../include/openssl/symhacks.h
744evp_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 462evp_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
745evp_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 463evp_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
746evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 464evp_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -748,14 +466,16 @@ evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
748evp_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 466evp_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
749evp_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 467evp_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
750evp_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h 468evp_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h
751evp_key.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 469evp_key.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
470evp_key.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
752evp_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 471evp_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
753evp_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 472evp_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
754evp_key.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 473evp_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
755evp_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 474evp_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
756evp_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 475evp_key.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
757evp_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 476evp_key.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
758evp_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 477evp_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
478evp_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
759evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 479evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
760evp_key.o: ../cryptlib.h 480evp_key.o: ../cryptlib.h
761evp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 481evp_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -765,14 +485,16 @@ evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
765evp_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 485evp_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
766evp_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 486evp_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
767evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h 487evp_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
768evp_lib.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 488evp_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
489evp_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
769evp_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 490evp_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
770evp_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 491evp_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
771evp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 492evp_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
772evp_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 493evp_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
773evp_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 494evp_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
774evp_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 495evp_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
775evp_lib.o: ../../include/openssl/stack.h ../cryptlib.h 496evp_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
497evp_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
776evp_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 498evp_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
777evp_pbe.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 499evp_pbe.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
778evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 500evp_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -780,14 +502,16 @@ evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
780evp_pbe.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 502evp_pbe.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
781evp_pbe.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 503evp_pbe.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
782evp_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h 504evp_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
783evp_pbe.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 505evp_pbe.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
506evp_pbe.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
784evp_pbe.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 507evp_pbe.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
785evp_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 508evp_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
786evp_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 509evp_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
787evp_pbe.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 510evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
788evp_pbe.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 511evp_pbe.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
789evp_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 512evp_pbe.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
790evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 513evp_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
514evp_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
791evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 515evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
792evp_pbe.o: ../cryptlib.h 516evp_pbe.o: ../cryptlib.h
793evp_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 517evp_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -797,16 +521,19 @@ evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
797evp_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 521evp_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
798evp_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 522evp_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
799evp_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h 523evp_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
800evp_pkey.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 524evp_pkey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
525evp_pkey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
801evp_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 526evp_pkey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
802evp_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 527evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
528evp_pkey.o: ../../include/openssl/opensslconf.h
803evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 529evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
804evp_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 530evp_pkey.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
805evp_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 531evp_pkey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
806evp_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 532evp_pkey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
807evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 533evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
808evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 534evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
809evp_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 535evp_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
536evp_pkey.o: ../cryptlib.h
810m_dss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 537m_dss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
811m_dss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 538m_dss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
812m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 539m_dss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -814,14 +541,16 @@ m_dss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
814m_dss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 541m_dss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
815m_dss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 542m_dss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
816m_dss.o: ../../include/openssl/err.h ../../include/openssl/evp.h 543m_dss.o: ../../include/openssl/err.h ../../include/openssl/evp.h
817m_dss.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 544m_dss.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
545m_dss.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
818m_dss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 546m_dss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
819m_dss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 547m_dss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
820m_dss.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 548m_dss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
821m_dss.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 549m_dss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
822m_dss.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 550m_dss.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
823m_dss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 551m_dss.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
824m_dss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 552m_dss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
553m_dss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
825m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 554m_dss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
826m_dss.o: ../cryptlib.h 555m_dss.o: ../cryptlib.h
827m_dss1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 556m_dss1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -831,14 +560,16 @@ m_dss1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
831m_dss1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 560m_dss1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
832m_dss1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 561m_dss1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
833m_dss1.o: ../../include/openssl/err.h ../../include/openssl/evp.h 562m_dss1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
834m_dss1.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 563m_dss1.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
564m_dss1.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
835m_dss1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 565m_dss1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
836m_dss1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 566m_dss1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
837m_dss1.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 567m_dss1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
838m_dss1.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 568m_dss1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
839m_dss1.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 569m_dss1.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
840m_dss1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 570m_dss1.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
841m_dss1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 571m_dss1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
572m_dss1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
842m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 573m_dss1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
843m_dss1.o: ../cryptlib.h 574m_dss1.o: ../cryptlib.h
844m_md2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 575m_md2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -848,16 +579,37 @@ m_md2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
848m_md2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 579m_md2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
849m_md2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 580m_md2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
850m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h 581m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
851m_md2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 582m_md2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
583m_md2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
852m_md2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 584m_md2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
853m_md2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 585m_md2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
854m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 586m_md2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
855m_md2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 587m_md2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
856m_md2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 588m_md2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
857m_md2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 589m_md2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
858m_md2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 590m_md2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
591m_md2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
859m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 592m_md2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
860m_md2.o: ../cryptlib.h 593m_md2.o: ../cryptlib.h
594m_md4.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
595m_md4.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
596m_md4.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
597m_md4.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
598m_md4.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
599m_md4.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
600m_md4.o: ../../include/openssl/err.h ../../include/openssl/evp.h
601m_md4.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
602m_md4.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
603m_md4.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
604m_md4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
605m_md4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
606m_md4.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
607m_md4.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
608m_md4.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
609m_md4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
610m_md4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
611m_md4.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
612m_md4.o: ../cryptlib.h
861m_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 613m_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
862m_md5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 614m_md5.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
863m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 615m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -865,14 +617,16 @@ m_md5.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
865m_md5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 617m_md5.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
866m_md5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 618m_md5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
867m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h 619m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
868m_md5.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 620m_md5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
621m_md5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
869m_md5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 622m_md5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
870m_md5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 623m_md5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
871m_md5.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 624m_md5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
872m_md5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 625m_md5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
873m_md5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 626m_md5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
874m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 627m_md5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
875m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 628m_md5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
629m_md5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
876m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 630m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
877m_md5.o: ../cryptlib.h 631m_md5.o: ../cryptlib.h
878m_mdc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 632m_mdc2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -882,14 +636,16 @@ m_mdc2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
882m_mdc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 636m_mdc2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
883m_mdc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 637m_mdc2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
884m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h 638m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
885m_mdc2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 639m_mdc2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
640m_mdc2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
886m_mdc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 641m_mdc2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
887m_mdc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 642m_mdc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
888m_mdc2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 643m_mdc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
889m_mdc2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 644m_mdc2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
890m_mdc2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 645m_mdc2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
891m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 646m_mdc2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
892m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 647m_mdc2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
648m_mdc2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
893m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 649m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
894m_mdc2.o: ../cryptlib.h 650m_mdc2.o: ../cryptlib.h
895m_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 651m_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -899,14 +655,16 @@ m_null.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
899m_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 655m_null.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
900m_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 656m_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
901m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h 657m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
902m_null.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 658m_null.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
659m_null.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
903m_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 660m_null.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
904m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 661m_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
905m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 662m_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
906m_null.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 663m_null.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
907m_null.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 664m_null.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
908m_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 665m_null.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
909m_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 666m_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
667m_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
910m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 668m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
911m_null.o: ../cryptlib.h 669m_null.o: ../cryptlib.h
912m_ripemd.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 670m_ripemd.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -916,16 +674,18 @@ m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
916m_ripemd.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 674m_ripemd.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
917m_ripemd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 675m_ripemd.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
918m_ripemd.o: ../../include/openssl/err.h ../../include/openssl/evp.h 676m_ripemd.o: ../../include/openssl/err.h ../../include/openssl/evp.h
919m_ripemd.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 677m_ripemd.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
678m_ripemd.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
920m_ripemd.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 679m_ripemd.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
921m_ripemd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 680m_ripemd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
681m_ripemd.o: ../../include/openssl/opensslconf.h
922m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 682m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
923m_ripemd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 683m_ripemd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
924m_ripemd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 684m_ripemd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
925m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 685m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
926m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 686m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
927m_ripemd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 687m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
928m_ripemd.o: ../cryptlib.h 688m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
929m_sha.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 689m_sha.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
930m_sha.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 690m_sha.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
931m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 691m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -933,14 +693,16 @@ m_sha.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
933m_sha.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 693m_sha.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
934m_sha.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 694m_sha.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
935m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h 695m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h
936m_sha.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 696m_sha.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
697m_sha.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
937m_sha.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 698m_sha.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
938m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 699m_sha.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
939m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 700m_sha.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
940m_sha.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 701m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
941m_sha.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 702m_sha.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
942m_sha.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 703m_sha.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
943m_sha.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 704m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
705m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
944m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 706m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
945m_sha.o: ../cryptlib.h 707m_sha.o: ../cryptlib.h
946m_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 708m_sha1.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -950,14 +712,16 @@ m_sha1.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
950m_sha1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 712m_sha1.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
951m_sha1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 713m_sha1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
952m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h 714m_sha1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
953m_sha1.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 715m_sha1.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
716m_sha1.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
954m_sha1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 717m_sha1.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
955m_sha1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 718m_sha1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
956m_sha1.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 719m_sha1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
957m_sha1.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 720m_sha1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
958m_sha1.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 721m_sha1.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
959m_sha1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 722m_sha1.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
960m_sha1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 723m_sha1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
724m_sha1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
961m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 725m_sha1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
962m_sha1.o: ../cryptlib.h 726m_sha1.o: ../cryptlib.h
963names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 727names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -967,14 +731,16 @@ names.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
967names.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 731names.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
968names.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 732names.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
969names.o: ../../include/openssl/err.h ../../include/openssl/evp.h 733names.o: ../../include/openssl/err.h ../../include/openssl/evp.h
970names.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 734names.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
735names.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
971names.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 736names.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
972names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 737names.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
973names.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 738names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
974names.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 739names.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
975names.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 740names.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
976names.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 741names.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
977names.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 742names.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
743names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
978names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 744names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
979names.o: ../cryptlib.h 745names.o: ../cryptlib.h
980p5_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 746p5_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -984,14 +750,16 @@ p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
984p5_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 750p5_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
985p5_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 751p5_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
986p5_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h 752p5_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
987p5_crpt.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 753p5_crpt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
754p5_crpt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
988p5_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 755p5_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
989p5_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 756p5_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
990p5_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 757p5_crpt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
991p5_crpt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 758p5_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
992p5_crpt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 759p5_crpt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
993p5_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 760p5_crpt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
994p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 761p5_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
762p5_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
995p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 763p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
996p5_crpt.o: ../cryptlib.h 764p5_crpt.o: ../cryptlib.h
997p5_crpt2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 765p5_crpt2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -1002,16 +770,17 @@ p5_crpt2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1002p5_crpt2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 770p5_crpt2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1003p5_crpt2.o: ../../include/openssl/err.h ../../include/openssl/evp.h 771p5_crpt2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1004p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h 772p5_crpt2.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h
1005p5_crpt2.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 773p5_crpt2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1006p5_crpt2.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 774p5_crpt2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1007p5_crpt2.o: ../../include/openssl/opensslconf.h 775p5_crpt2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
776p5_crpt2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1008p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 777p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1009p5_crpt2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 778p5_crpt2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1010p5_crpt2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 779p5_crpt2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1011p5_crpt2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 780p5_crpt2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1012p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 781p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1013p5_crpt2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 782p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1014p5_crpt2.o: ../cryptlib.h 783p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1015p_dec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 784p_dec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1016p_dec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 785p_dec.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
1017p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 786p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -1019,15 +788,17 @@ p_dec.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1019p_dec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 788p_dec.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1020p_dec.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 789p_dec.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1021p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h 790p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1022p_dec.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 791p_dec.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
792p_dec.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1023p_dec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 793p_dec.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1024p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 794p_dec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
1025p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 795p_dec.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
1026p_dec.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 796p_dec.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
1027p_dec.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 797p_dec.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1028p_dec.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 798p_dec.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1029p_dec.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 799p_dec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1030p_dec.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 800p_dec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
801p_dec.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1031p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 802p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1032p_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 803p_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1033p_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 804p_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -1036,15 +807,17 @@ p_enc.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1036p_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 807p_enc.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1037p_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 808p_enc.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1038p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h 809p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1039p_enc.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 810p_enc.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
811p_enc.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1040p_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 812p_enc.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1041p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 813p_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
1042p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 814p_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
1043p_enc.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 815p_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
1044p_enc.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 816p_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1045p_enc.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 817p_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1046p_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 818p_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1047p_enc.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 819p_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
820p_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1048p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 821p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1049p_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 822p_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
1050p_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 823p_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
@@ -1054,14 +827,16 @@ p_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
1054p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 827p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
1055p_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 828p_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
1056p_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 829p_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
1057p_lib.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 830p_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
1058p_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 831p_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
1059p_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 832p_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
1060p_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 833p_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
1061p_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 834p_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1062p_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 835p_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1063p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 836p_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1064p_lib.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 837p_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
838p_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
839p_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1065p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 840p_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1066p_open.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 841p_open.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1067p_open.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 842p_open.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -1070,14 +845,16 @@ p_open.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1070p_open.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 845p_open.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1071p_open.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 846p_open.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1072p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h 847p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1073p_open.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 848p_open.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
849p_open.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1074p_open.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 850p_open.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1075p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 851p_open.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
1076p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 852p_open.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
1077p_open.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 853p_open.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
1078p_open.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 854p_open.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1079p_open.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 855p_open.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1080p_open.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 856p_open.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
857p_open.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
1081p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 858p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1082p_open.o: ../cryptlib.h 859p_open.o: ../cryptlib.h
1083p_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 860p_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -1087,15 +864,17 @@ p_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1087p_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 864p_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1088p_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 865p_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1089p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h 866p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1090p_seal.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 867p_seal.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
868p_seal.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1091p_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 869p_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1092p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 870p_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
1093p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 871p_seal.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
1094p_seal.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 872p_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
1095p_seal.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 873p_seal.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1096p_seal.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 874p_seal.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1097p_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 875p_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1098p_seal.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 876p_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
877p_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1099p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 878p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
1100p_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 879p_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
1101p_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 880p_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -1104,14 +883,16 @@ p_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1104p_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 883p_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1105p_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 884p_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1106p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h 885p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1107p_sign.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 886p_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
887p_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1108p_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 888p_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1109p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 889p_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
1110p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 890p_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
1111p_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 891p_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
1112p_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 892p_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
1113p_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 893p_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
1114p_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 894p_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
895p_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
1115p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 896p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
1116p_sign.o: ../cryptlib.h 897p_sign.o: ../cryptlib.h
1117p_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 898p_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -1121,13 +902,15 @@ p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
1121p_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 902p_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
1122p_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 903p_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
1123p_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h 904p_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
1124p_verify.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 905p_verify.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
906p_verify.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
1125p_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 907p_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
1126p_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 908p_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
909p_verify.o: ../../include/openssl/opensslconf.h
1127p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 910p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
1128p_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 911p_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
1129p_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 912p_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
1130p_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 913p_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
1131p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 914p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
1132p_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 915p_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
1133p_verify.o: ../cryptlib.h 916p_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index bd5e24f993..af6fa2ae8f 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -62,14 +62,14 @@
62#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
65static int b64_write(BIO *h,char *buf,int num); 65static int b64_write(BIO *h, const char *buf, int num);
66static int b64_read(BIO *h,char *buf,int size); 66static int b64_read(BIO *h, char *buf, int size);
67/*static int b64_puts(BIO *h,char *str); */ 67/*static int b64_puts(BIO *h, const char *str); */
68/*static int b64_gets(BIO *h,char *str,int size); */ 68/*static int b64_gets(BIO *h, char *str, int size); */
69static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
70static int b64_new(BIO *h); 70static int b64_new(BIO *h);
71static int b64_free(BIO *data); 71static int b64_free(BIO *data);
72static long b64_callback_ctrl(BIO *h,int cmd,void (*fp)()); 72static long b64_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
73#define B64_BLOCK_SIZE 1024 73#define B64_BLOCK_SIZE 1024
74#define B64_BLOCK_SIZE2 768 74#define B64_BLOCK_SIZE2 768
75#define B64_NONE 0 75#define B64_NONE 0
@@ -113,7 +113,7 @@ static int b64_new(BIO *bi)
113 { 113 {
114 BIO_B64_CTX *ctx; 114 BIO_B64_CTX *ctx;
115 115
116 ctx=(BIO_B64_CTX *)Malloc(sizeof(BIO_B64_CTX)); 116 ctx=(BIO_B64_CTX *)OPENSSL_malloc(sizeof(BIO_B64_CTX));
117 if (ctx == NULL) return(0); 117 if (ctx == NULL) return(0);
118 118
119 ctx->buf_len=0; 119 ctx->buf_len=0;
@@ -133,7 +133,7 @@ static int b64_new(BIO *bi)
133static int b64_free(BIO *a) 133static int b64_free(BIO *a)
134 { 134 {
135 if (a == NULL) return(0); 135 if (a == NULL) return(0);
136 Free(a->ptr); 136 OPENSSL_free(a->ptr);
137 a->ptr=NULL; 137 a->ptr=NULL;
138 a->init=0; 138 a->init=0;
139 a->flags=0; 139 a->flags=0;
@@ -340,7 +340,7 @@ static int b64_read(BIO *b, char *out, int outl)
340 return((ret == 0)?ret_code:ret); 340 return((ret == 0)?ret_code:ret);
341 } 341 }
342 342
343static int b64_write(BIO *b, char *in, int inl) 343static int b64_write(BIO *b, const char *in, int inl)
344 { 344 {
345 int ret=inl,n,i; 345 int ret=inl,n,i;
346 BIO_B64_CTX *ctx; 346 BIO_B64_CTX *ctx;
@@ -370,10 +370,11 @@ static int b64_write(BIO *b, char *in, int inl)
370 n-=i; 370 n-=i;
371 } 371 }
372 /* at this point all pending data has been written */ 372 /* at this point all pending data has been written */
373 ctx->buf_off=0;
374 ctx->buf_len=0;
373 375
374 if ((in == NULL) || (inl <= 0)) return(0); 376 if ((in == NULL) || (inl <= 0)) return(0);
375 377
376 ctx->buf_off=0;
377 while (inl > 0) 378 while (inl > 0)
378 { 379 {
379 n=(inl > B64_BLOCK_SIZE)?B64_BLOCK_SIZE:inl; 380 n=(inl > B64_BLOCK_SIZE)?B64_BLOCK_SIZE:inl;
@@ -383,14 +384,20 @@ static int b64_write(BIO *b, char *in, int inl)
383 if (ctx->tmp_len > 0) 384 if (ctx->tmp_len > 0)
384 { 385 {
385 n=3-ctx->tmp_len; 386 n=3-ctx->tmp_len;
387 /* There's a teoretical possibility for this */
388 if (n > inl)
389 n=inl;
386 memcpy(&(ctx->tmp[ctx->tmp_len]),in,n); 390 memcpy(&(ctx->tmp[ctx->tmp_len]),in,n);
387 ctx->tmp_len+=n; 391 ctx->tmp_len+=n;
388 n=ctx->tmp_len; 392 if (ctx->tmp_len < 3)
389 if (n < 3)
390 break; 393 break;
391 ctx->buf_len=EVP_EncodeBlock( 394 ctx->buf_len=EVP_EncodeBlock(
392 (unsigned char *)ctx->buf, 395 (unsigned char *)ctx->buf,
393 (unsigned char *)ctx->tmp,n); 396 (unsigned char *)ctx->tmp,
397 ctx->tmp_len);
398 /* Since we're now done using the temporary
399 buffer, the length should be 0'd */
400 ctx->tmp_len=0;
394 } 401 }
395 else 402 else
396 { 403 {
@@ -434,7 +441,7 @@ static int b64_write(BIO *b, char *in, int inl)
434 return(ret); 441 return(ret);
435 } 442 }
436 443
437static long b64_ctrl(BIO *b, int cmd, long num, char *ptr) 444static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
438 { 445 {
439 BIO_B64_CTX *ctx; 446 BIO_B64_CTX *ctx;
440 long ret=1; 447 long ret=1;
@@ -524,7 +531,7 @@ again:
524 return(ret); 531 return(ret);
525 } 532 }
526 533
527static long b64_callback_ctrl(BIO *b, int cmd, void (*fp)()) 534static long b64_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
528 { 535 {
529 long ret=1; 536 long ret=1;
530 537
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 629bf4b95d..831c71a2b5 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -62,14 +62,14 @@
62#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
65static int enc_write(BIO *h,char *buf,int num); 65static int enc_write(BIO *h, const char *buf, int num);
66static int enc_read(BIO *h,char *buf,int size); 66static int enc_read(BIO *h, char *buf, int size);
67/*static int enc_puts(BIO *h,char *str); */ 67/*static int enc_puts(BIO *h, const char *str); */
68/*static int enc_gets(BIO *h,char *str,int size); */ 68/*static int enc_gets(BIO *h, char *str, int size); */
69static long enc_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);
70static int enc_new(BIO *h); 70static int enc_new(BIO *h);
71static int enc_free(BIO *data); 71static int enc_free(BIO *data);
72static long enc_callback_ctrl(BIO *h,int cmd,void (*fp)()); 72static long enc_callback_ctrl(BIO *h, int cmd, bio_info_cb *fps);
73#define ENC_BLOCK_SIZE (1024*4) 73#define ENC_BLOCK_SIZE (1024*4)
74 74
75typedef struct enc_struct 75typedef struct enc_struct
@@ -105,7 +105,7 @@ static int enc_new(BIO *bi)
105 { 105 {
106 BIO_ENC_CTX *ctx; 106 BIO_ENC_CTX *ctx;
107 107
108 ctx=(BIO_ENC_CTX *)Malloc(sizeof(BIO_ENC_CTX)); 108 ctx=(BIO_ENC_CTX *)OPENSSL_malloc(sizeof(BIO_ENC_CTX));
109 EVP_CIPHER_CTX_init(&ctx->cipher); 109 EVP_CIPHER_CTX_init(&ctx->cipher);
110 if (ctx == NULL) return(0); 110 if (ctx == NULL) return(0);
111 111
@@ -129,7 +129,7 @@ static int enc_free(BIO *a)
129 b=(BIO_ENC_CTX *)a->ptr; 129 b=(BIO_ENC_CTX *)a->ptr;
130 EVP_CIPHER_CTX_cleanup(&(b->cipher)); 130 EVP_CIPHER_CTX_cleanup(&(b->cipher));
131 memset(a->ptr,0,sizeof(BIO_ENC_CTX)); 131 memset(a->ptr,0,sizeof(BIO_ENC_CTX));
132 Free(a->ptr); 132 OPENSSL_free(a->ptr);
133 a->ptr=NULL; 133 a->ptr=NULL;
134 a->init=0; 134 a->init=0;
135 a->flags=0; 135 a->flags=0;
@@ -224,7 +224,7 @@ static int enc_read(BIO *b, char *out, int outl)
224 return((ret == 0)?ctx->cont:ret); 224 return((ret == 0)?ctx->cont:ret);
225 } 225 }
226 226
227static int enc_write(BIO *b, char *in, int inl) 227static int enc_write(BIO *b, const char *in, int inl)
228 { 228 {
229 int ret=0,n,i; 229 int ret=0,n,i;
230 BIO_ENC_CTX *ctx; 230 BIO_ENC_CTX *ctx;
@@ -279,7 +279,7 @@ static int enc_write(BIO *b, char *in, int inl)
279 return(ret); 279 return(ret);
280 } 280 }
281 281
282static long enc_ctrl(BIO *b, int cmd, long num, char *ptr) 282static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
283 { 283 {
284 BIO *dbio; 284 BIO *dbio;
285 BIO_ENC_CTX *ctx,*dctx; 285 BIO_ENC_CTX *ctx,*dctx;
@@ -370,7 +370,7 @@ again:
370 return(ret); 370 return(ret);
371 } 371 }
372 372
373static long enc_callback_ctrl(BIO *b, int cmd, void (*fp)()) 373static long enc_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
374 { 374 {
375 long ret=1; 375 long ret=1;
376 376
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index aef928dd8f..2373c247d8 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -65,14 +65,14 @@
65/* BIO_put and BIO_get both add to the digest, 65/* BIO_put and BIO_get both add to the digest,
66 * BIO_gets returns the digest */ 66 * BIO_gets returns the digest */
67 67
68static int md_write(BIO *h,char *buf,int num); 68static int md_write(BIO *h, char const *buf, int num);
69static int md_read(BIO *h,char *buf,int size); 69static int md_read(BIO *h, char *buf, int size);
70/*static int md_puts(BIO *h,char *str); */ 70/*static int md_puts(BIO *h, const char *str); */
71static int md_gets(BIO *h,char *str,int size); 71static int md_gets(BIO *h, char *str, int size);
72static long md_ctrl(BIO *h,int cmd,long arg1,char *arg2); 72static long md_ctrl(BIO *h, int cmd, long arg1, void *arg2);
73static int md_new(BIO *h); 73static int md_new(BIO *h);
74static int md_free(BIO *data); 74static int md_free(BIO *data);
75static long md_callback_ctrl(BIO *h,int cmd,void (*fp)()); 75static long md_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp);
76 76
77static BIO_METHOD methods_md= 77static BIO_METHOD methods_md=
78 { 78 {
@@ -96,7 +96,7 @@ static int md_new(BIO *bi)
96 { 96 {
97 EVP_MD_CTX *ctx; 97 EVP_MD_CTX *ctx;
98 98
99 ctx=(EVP_MD_CTX *)Malloc(sizeof(EVP_MD_CTX)); 99 ctx=(EVP_MD_CTX *)OPENSSL_malloc(sizeof(EVP_MD_CTX));
100 if (ctx == NULL) return(0); 100 if (ctx == NULL) return(0);
101 101
102 bi->init=0; 102 bi->init=0;
@@ -108,7 +108,7 @@ static int md_new(BIO *bi)
108static int md_free(BIO *a) 108static int md_free(BIO *a)
109 { 109 {
110 if (a == NULL) return(0); 110 if (a == NULL) return(0);
111 Free(a->ptr); 111 OPENSSL_free(a->ptr);
112 a->ptr=NULL; 112 a->ptr=NULL;
113 a->init=0; 113 a->init=0;
114 a->flags=0; 114 a->flags=0;
@@ -139,7 +139,7 @@ static int md_read(BIO *b, char *out, int outl)
139 return(ret); 139 return(ret);
140 } 140 }
141 141
142static int md_write(BIO *b, char *in, int inl) 142static int md_write(BIO *b, const char *in, int inl)
143 { 143 {
144 int ret=0; 144 int ret=0;
145 EVP_MD_CTX *ctx; 145 EVP_MD_CTX *ctx;
@@ -162,7 +162,7 @@ static int md_write(BIO *b, char *in, int inl)
162 return(ret); 162 return(ret);
163 } 163 }
164 164
165static long md_ctrl(BIO *b, int cmd, long num, char *ptr) 165static long md_ctrl(BIO *b, int cmd, long num, void *ptr)
166 { 166 {
167 EVP_MD_CTX *ctx,*dctx,**pctx; 167 EVP_MD_CTX *ctx,*dctx,**pctx;
168 const EVP_MD **ppmd; 168 const EVP_MD **ppmd;
@@ -223,7 +223,7 @@ static long md_ctrl(BIO *b, int cmd, long num, char *ptr)
223 return(ret); 223 return(ret);
224 } 224 }
225 225
226static long md_callback_ctrl(BIO *b, int cmd, void (*fp)()) 226static long md_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
227 { 227 {
228 long ret=1; 228 long ret=1;
229 229
diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c
index e6ff5f2cdb..e617ce1d43 100644
--- a/src/lib/libcrypto/evp/bio_ok.c
+++ b/src/lib/libcrypto/evp/bio_ok.c
@@ -125,12 +125,12 @@
125#include <openssl/evp.h> 125#include <openssl/evp.h>
126#include <openssl/rand.h> 126#include <openssl/rand.h>
127 127
128static int ok_write(BIO *h,char *buf,int num); 128static int ok_write(BIO *h, const char *buf, int num);
129static int ok_read(BIO *h,char *buf,int size); 129static int ok_read(BIO *h, char *buf, int size);
130static long ok_ctrl(BIO *h,int cmd,long arg1,char *arg2); 130static long ok_ctrl(BIO *h, int cmd, long arg1, void *arg2);
131static int ok_new(BIO *h); 131static int ok_new(BIO *h);
132static int ok_free(BIO *data); 132static int ok_free(BIO *data);
133static long ok_callback_ctrl(BIO *h,int cmd,void (*fp)()); 133static long ok_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp);
134 134
135static void sig_out(BIO* b); 135static void sig_out(BIO* b);
136static void sig_in(BIO* b); 136static void sig_in(BIO* b);
@@ -187,7 +187,7 @@ static int ok_new(BIO *bi)
187 { 187 {
188 BIO_OK_CTX *ctx; 188 BIO_OK_CTX *ctx;
189 189
190 ctx=(BIO_OK_CTX *)Malloc(sizeof(BIO_OK_CTX)); 190 ctx=(BIO_OK_CTX *)OPENSSL_malloc(sizeof(BIO_OK_CTX));
191 if (ctx == NULL) return(0); 191 if (ctx == NULL) return(0);
192 192
193 ctx->buf_len=0; 193 ctx->buf_len=0;
@@ -209,7 +209,7 @@ static int ok_free(BIO *a)
209 { 209 {
210 if (a == NULL) return(0); 210 if (a == NULL) return(0);
211 memset(a->ptr,0,sizeof(BIO_OK_CTX)); 211 memset(a->ptr,0,sizeof(BIO_OK_CTX));
212 Free(a->ptr); 212 OPENSSL_free(a->ptr);
213 a->ptr=NULL; 213 a->ptr=NULL;
214 a->init=0; 214 a->init=0;
215 a->flags=0; 215 a->flags=0;
@@ -287,7 +287,7 @@ static int ok_read(BIO *b, char *out, int outl)
287 return(ret); 287 return(ret);
288 } 288 }
289 289
290static int ok_write(BIO *b, char *in, int inl) 290static int ok_write(BIO *b, const char *in, int inl)
291 { 291 {
292 int ret=0,n,i; 292 int ret=0,n,i;
293 BIO_OK_CTX *ctx; 293 BIO_OK_CTX *ctx;
@@ -345,7 +345,7 @@ static int ok_write(BIO *b, char *in, int inl)
345 return(ret); 345 return(ret);
346 } 346 }
347 347
348static long ok_ctrl(BIO *b, int cmd, long num, char *ptr) 348static long ok_ctrl(BIO *b, int cmd, long num, void *ptr)
349 { 349 {
350 BIO_OK_CTX *ctx; 350 BIO_OK_CTX *ctx;
351 EVP_MD *md; 351 EVP_MD *md;
@@ -431,7 +431,7 @@ static long ok_ctrl(BIO *b, int cmd, long num, char *ptr)
431 return(ret); 431 return(ret);
432 } 432 }
433 433
434static long ok_callback_ctrl(BIO *b, int cmd, void (*fp)()) 434static long ok_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
435 { 435 {
436 long ret=1; 436 long ret=1;
437 437
diff --git a/src/lib/libcrypto/evp/c_alld.c b/src/lib/libcrypto/evp/c_alld.c
index febe51a3ee..bbf059eb85 100644
--- a/src/lib/libcrypto/evp/c_alld.c
+++ b/src/lib/libcrypto/evp/c_alld.c
@@ -67,6 +67,9 @@ void OpenSSL_add_all_digests(void)
67#ifndef NO_MD2 67#ifndef NO_MD2
68 EVP_add_digest(EVP_md2()); 68 EVP_add_digest(EVP_md2());
69#endif 69#endif
70#ifndef NO_MD4
71 EVP_add_digest(EVP_md4());
72#endif
70#ifndef NO_MD5 73#ifndef NO_MD5
71 EVP_add_digest(EVP_md5()); 74 EVP_add_digest(EVP_md5());
72 EVP_add_digest_alias(SN_md5,"ssl2-md5"); 75 EVP_add_digest_alias(SN_md5,"ssl2-md5");
diff --git a/src/lib/libcrypto/evp/e_bf.c b/src/lib/libcrypto/evp/e_bf.c
new file mode 100644
index 0000000000..72047f64da
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_bf.c
@@ -0,0 +1,80 @@
1/* crypto/evp/e_bf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_BF
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include "evp_locl.h"
64#include <openssl/objects.h>
65
66static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
67 const unsigned char *iv, int enc);
68
69IMPLEMENT_BLOCK_CIPHER(bf, bf_ks, BF, bf_ks, NID_bf, 8, 16, 8,
70 0, bf_init_key, NULL,
71 EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
72
73static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
74 const unsigned char *iv, int enc)
75 {
76 BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key);
77 return 1;
78 }
79
80#endif
diff --git a/src/lib/libcrypto/evp/e_cast.c b/src/lib/libcrypto/evp/e_cast.c
new file mode 100644
index 0000000000..e5af7fb4ed
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_cast.c
@@ -0,0 +1,82 @@
1/* crypto/evp/e_cast.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_CAST
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include "evp_locl.h"
66
67static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
68 const unsigned char *iv,int enc);
69
70IMPLEMENT_BLOCK_CIPHER(cast5, cast_ks, CAST, cast_ks,
71 NID_cast5, 8, EVP_CAST5_KEY_SIZE, 8,
72 EVP_CIPH_VARIABLE_LENGTH, cast_init_key, NULL,
73 EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
74
75static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
76 const unsigned char *iv, int enc)
77 {
78 CAST_set_key(&(ctx->c.cast_ks),EVP_CIPHER_CTX_key_length(ctx),key);
79 return 1;
80 }
81
82#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_3d.c b/src/lib/libcrypto/evp/e_cbc_3d.c
index 5d16b865c5..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_3d.c
+++ b/src/lib/libcrypto/evp/e_cbc_3d.c
@@ -1,151 +0,0 @@
1/* crypto/evp/e_cbc_3d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc);
69static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
70 unsigned char *in, unsigned int inl);
71static EVP_CIPHER d_cbc_ede_cipher2=
72 {
73 NID_des_ede_cbc,
74 8,16,8,
75 des_cbc_ede_init_key,
76 des_cbc_ede_cipher,
77 NULL,
78 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
79 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
80 EVP_CIPHER_set_asn1_iv,
81 EVP_CIPHER_get_asn1_iv,
82 };
83
84static EVP_CIPHER d_cbc_ede_cipher3=
85 {
86 NID_des_ede3_cbc,
87 8,24,8,
88 des_cbc_ede3_init_key,
89 des_cbc_ede_cipher,
90 NULL,
91 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
92 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
93 EVP_CIPHER_set_asn1_iv,
94 EVP_CIPHER_get_asn1_iv,
95 };
96
97EVP_CIPHER *EVP_des_ede_cbc(void)
98 {
99 return(&d_cbc_ede_cipher2);
100 }
101
102EVP_CIPHER *EVP_des_ede3_cbc(void)
103 {
104 return(&d_cbc_ede_cipher3);
105 }
106
107static void des_cbc_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
108 unsigned char *iv, int enc)
109 {
110 des_cblock *deskey = (des_cblock *)key;
111
112 if (iv != NULL)
113 memcpy(&(ctx->oiv[0]),iv,8);
114 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
115
116 if (deskey != NULL)
117 {
118 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
119 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
120 memcpy( (char *)ctx->c.des_ede.ks3,
121 (char *)ctx->c.des_ede.ks1,
122 sizeof(ctx->c.des_ede.ks1));
123 }
124 }
125
126static void des_cbc_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
127 unsigned char *iv, int enc)
128 {
129 des_cblock *deskey = (des_cblock *)key;
130
131 if (iv != NULL)
132 memcpy(&(ctx->oiv[0]),iv,8);
133 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
134
135 if (deskey != NULL)
136 {
137 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
138 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
139 des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
140 }
141 }
142
143static void des_cbc_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
144 unsigned char *in, unsigned int inl)
145 {
146 des_ede3_cbc_encrypt(in,out,inl, ctx->c.des_ede.ks1,
147 ctx->c.des_ede.ks2,ctx->c.des_ede.ks3,
148 (des_cblock *) &(ctx->iv[0]),
149 ctx->encrypt);
150 }
151#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_bf.c b/src/lib/libcrypto/evp/e_cbc_bf.c
index 9bcba3c516..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_bf.c
+++ b/src/lib/libcrypto/evp/e_cbc_bf.c
@@ -1,106 +0,0 @@
1/* crypto/evp/e_cbc_bf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_BF
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER bfish_cbc_cipher=
70 {
71 NID_bf_cbc,
72 8,EVP_BLOWFISH_KEY_SIZE,8,
73 bf_cbc_init_key,
74 bf_cbc_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
78 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv,
80 };
81
82EVP_CIPHER *EVP_bf_cbc(void)
83 {
84 return(&bfish_cbc_cipher);
85 }
86
87static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 if (iv != NULL)
91 memcpy(&(ctx->oiv[0]),iv,8);
92 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
93 if (key != NULL)
94 BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key);
95 }
96
97static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
98 unsigned char *in, unsigned int inl)
99 {
100 BF_cbc_encrypt(
101 in,out,(long)inl,
102 &(ctx->c.bf_ks),&(ctx->iv[0]),
103 ctx->encrypt);
104 }
105
106#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_c.c b/src/lib/libcrypto/evp/e_cbc_c.c
index 6845b0b44c..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_c.c
+++ b/src/lib/libcrypto/evp/e_cbc_c.c
@@ -1,107 +0,0 @@
1/* crypto/evp/e_cbc_c.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_CAST
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER cast5_cbc_cipher=
71 {
72 NID_cast5_cbc,
73 8,EVP_CAST5_KEY_SIZE,8,
74 cast_cbc_init_key,
75 cast_cbc_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_cast5_cbc(void)
84 {
85 return(&cast5_cbc_cipher);
86 }
87
88static void cast_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (iv != NULL)
92 memcpy(&(ctx->oiv[0]),iv,8);
93 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
94 if (key != NULL)
95 CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key);
96 }
97
98static void cast_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
99 unsigned char *in, unsigned int inl)
100 {
101 CAST_cbc_encrypt(
102 in,out,(long)inl,
103 &(ctx->c.cast_ks),&(ctx->iv[0]),
104 ctx->encrypt);
105 }
106
107#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_d.c b/src/lib/libcrypto/evp/e_cbc_d.c
index 5b4e5b8601..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_d.c
+++ b/src/lib/libcrypto/evp/e_cbc_d.c
@@ -1,106 +0,0 @@
1/* crypto/evp/e_cbc_d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER d_cbc_cipher=
70 {
71 NID_des_cbc,
72 8,8,8,
73 des_cbc_init_key,
74 des_cbc_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
78 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv,
80 };
81
82EVP_CIPHER *EVP_des_cbc(void)
83 {
84 return(&d_cbc_cipher);
85 }
86
87static void des_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 des_cblock *deskey = (des_cblock *)key;
91
92 if (iv != NULL)
93 memcpy(&(ctx->oiv[0]),iv,8);
94 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
95 if (deskey != NULL)
96 des_set_key_unchecked(deskey,ctx->c.des_ks);
97 }
98
99static void des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
100 unsigned char *in, unsigned int inl)
101 {
102 des_ncbc_encrypt(in,out,inl,ctx->c.des_ks,
103 (des_cblock *)&(ctx->iv[0]),
104 ctx->encrypt);
105 }
106#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_i.c b/src/lib/libcrypto/evp/e_cbc_i.c
index 34b44aa21f..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_i.c
+++ b/src/lib/libcrypto/evp/e_cbc_i.c
@@ -1,119 +0,0 @@
1/* crypto/evp/e_cbc_i.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_IDEA
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER i_cbc_cipher=
71 {
72 NID_idea_cbc,
73 8,16,8,
74 idea_cbc_init_key,
75 idea_cbc_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_idea_cbc(void)
84 {
85 return(&i_cbc_cipher);
86 }
87
88static void idea_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (iv != NULL)
92 memcpy(&(ctx->oiv[0]),iv,8);
93 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
94 if (key != NULL)
95 {
96 if (enc)
97 idea_set_encrypt_key(key,&(ctx->c.idea_ks));
98 else
99 {
100 IDEA_KEY_SCHEDULE tmp;
101
102 idea_set_encrypt_key(key,&tmp);
103 idea_set_decrypt_key(&tmp,&(ctx->c.idea_ks));
104 memset((unsigned char *)&tmp,0,
105 sizeof(IDEA_KEY_SCHEDULE));
106 }
107 }
108 }
109
110static void idea_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
111 unsigned char *in, unsigned int inl)
112 {
113 idea_cbc_encrypt(
114 in,out,(long)inl,
115 &(ctx->c.idea_ks),&(ctx->iv[0]),
116 ctx->encrypt);
117 }
118
119#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_r2.c b/src/lib/libcrypto/evp/e_cbc_r2.c
index 9dfada4ea6..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_r2.c
+++ b/src/lib/libcrypto/evp/e_cbc_r2.c
@@ -1,216 +0,0 @@
1/* crypto/evp/e_cbc_r2.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC2
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static int rc2_meth_to_magic(const EVP_CIPHER *e);
71static EVP_CIPHER *rc2_magic_to_meth(int i);
72static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
73static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
74
75#define RC2_40_MAGIC 0xa0
76#define RC2_64_MAGIC 0x78
77#define RC2_128_MAGIC 0x3a
78
79static EVP_CIPHER r2_cbc_cipher=
80 {
81 NID_rc2_cbc,
82 8,EVP_RC2_KEY_SIZE,8,
83 rc2_cbc_init_key,
84 rc2_cbc_cipher,
85 NULL,
86 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
87 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
88 rc2_set_asn1_type_and_iv,
89 rc2_get_asn1_type_and_iv,
90 };
91
92static EVP_CIPHER r2_64_cbc_cipher=
93 {
94 NID_rc2_64_cbc,
95 8,8 /* 64 bit */,8,
96 rc2_cbc_init_key,
97 rc2_cbc_cipher,
98 NULL,
99 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
100 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
101 rc2_set_asn1_type_and_iv,
102 rc2_get_asn1_type_and_iv,
103 };
104
105static EVP_CIPHER r2_40_cbc_cipher=
106 {
107 NID_rc2_40_cbc,
108 8,5 /* 40 bit */,8,
109 rc2_cbc_init_key,
110 rc2_cbc_cipher,
111 NULL,
112 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
113 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
114 rc2_set_asn1_type_and_iv,
115 rc2_get_asn1_type_and_iv,
116 };
117
118EVP_CIPHER *EVP_rc2_cbc(void)
119 {
120 return(&r2_cbc_cipher);
121 }
122
123EVP_CIPHER *EVP_rc2_64_cbc(void)
124 {
125 return(&r2_64_cbc_cipher);
126 }
127
128EVP_CIPHER *EVP_rc2_40_cbc(void)
129 {
130 return(&r2_40_cbc_cipher);
131 }
132
133static void rc2_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
134 unsigned char *iv, int enc)
135 {
136 if (iv != NULL)
137 memcpy(&(ctx->oiv[0]),iv,8);
138 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
139 if (key != NULL)
140 RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
141 key,EVP_CIPHER_CTX_key_length(ctx)*8);
142 }
143
144static void rc2_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
145 unsigned char *in, unsigned int inl)
146 {
147 RC2_cbc_encrypt(
148 in,out,(long)inl,
149 &(ctx->c.rc2_ks),&(ctx->iv[0]),
150 ctx->encrypt);
151 }
152
153static int rc2_meth_to_magic(const EVP_CIPHER *e)
154 {
155 int i;
156
157 i=EVP_CIPHER_key_length(e);
158 if (i == 16) return(RC2_128_MAGIC);
159 else if (i == 8) return(RC2_64_MAGIC);
160 else if (i == 5) return(RC2_40_MAGIC);
161 else return(0);
162 }
163
164static EVP_CIPHER *rc2_magic_to_meth(int i)
165 {
166 if (i == RC2_128_MAGIC) return(EVP_rc2_cbc());
167 else if (i == RC2_64_MAGIC) return(EVP_rc2_64_cbc());
168 else if (i == RC2_40_MAGIC) return(EVP_rc2_40_cbc());
169 else
170 {
171 EVPerr(EVP_F_RC2_MAGIC_TO_METH,EVP_R_UNSUPPORTED_KEY_SIZE);
172 return(NULL);
173 }
174 }
175
176static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
177 {
178 long num=0;
179 int i=0,l;
180 EVP_CIPHER *e;
181
182 if (type != NULL)
183 {
184 l=EVP_CIPHER_CTX_iv_length(c);
185 i=ASN1_TYPE_get_int_octetstring(type,&num,c->oiv,l);
186 if (i != l)
187 return(-1);
188 else if (i > 0)
189 memcpy(c->iv,c->oiv,l);
190 e=rc2_magic_to_meth((int)num);
191 if (e == NULL)
192 return(-1);
193 if (e != EVP_CIPHER_CTX_cipher(c))
194 {
195 EVP_CIPHER_CTX_cipher(c)=e;
196 rc2_cbc_init_key(c,NULL,NULL,1);
197 }
198 }
199 return(i);
200 }
201
202static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
203 {
204 long num;
205 int i=0,j;
206
207 if (type != NULL)
208 {
209 num=rc2_meth_to_magic(EVP_CIPHER_CTX_cipher(c));
210 j=EVP_CIPHER_CTX_iv_length(c);
211 i=ASN1_TYPE_set_int_octetstring(type,num,c->oiv,j);
212 }
213 return(i);
214 }
215
216#endif
diff --git a/src/lib/libcrypto/evp/e_cbc_r5.c b/src/lib/libcrypto/evp/e_cbc_r5.c
index cea3fe333a..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cbc_r5.c
+++ b/src/lib/libcrypto/evp/e_cbc_r5.c
@@ -1,108 +0,0 @@
1/* crypto/evp/e_cbc_r5.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC5
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER rc5_32_12_16_cbc_cipher=
71 {
72 NID_rc5_cbc,
73 8,EVP_RC5_32_12_16_KEY_SIZE,8,
74 r_32_12_16_cbc_init_key,
75 r_32_12_16_cbc_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
79 NULL,
80 NULL,
81 };
82
83EVP_CIPHER *EVP_rc5_32_12_16_cbc(void)
84 {
85 return(&rc5_32_12_16_cbc_cipher);
86 }
87
88static void r_32_12_16_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (iv != NULL)
92 memcpy(&(ctx->oiv[0]),iv,8);
93 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
94 if (key != NULL)
95 RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,
96 key,RC5_12_ROUNDS);
97 }
98
99static void r_32_12_16_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
100 unsigned char *in, unsigned int inl)
101 {
102 RC5_32_cbc_encrypt(
103 in,out,(long)inl,
104 &(ctx->c.rc5_ks),&(ctx->iv[0]),
105 ctx->encrypt);
106 }
107
108#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_3d.c b/src/lib/libcrypto/evp/e_cfb_3d.c
index b364bd4e31..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_3d.c
+++ b/src/lib/libcrypto/evp/e_cfb_3d.c
@@ -1,155 +0,0 @@
1/* crypto/evp/e_cfb_3d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc);
69static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
70 unsigned char *in, unsigned int inl);
71static EVP_CIPHER d_ede_cfb_cipher2=
72 {
73 NID_des_ede_cfb64,
74 1,16,8,
75 des_ede_cfb_init_key,
76 des_ede_cfb_cipher,
77 NULL,
78 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
79 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
80 EVP_CIPHER_set_asn1_iv,
81 EVP_CIPHER_get_asn1_iv,
82 };
83
84static EVP_CIPHER d_ede3_cfb_cipher3=
85 {
86 NID_des_ede3_cfb64,
87 1,24,8,
88 des_ede3_cfb_init_key,
89 des_ede_cfb_cipher,
90 NULL,
91 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
92 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
93 EVP_CIPHER_set_asn1_iv,
94 EVP_CIPHER_get_asn1_iv,
95 };
96
97EVP_CIPHER *EVP_des_ede_cfb(void)
98 {
99 return(&d_ede_cfb_cipher2);
100 }
101
102EVP_CIPHER *EVP_des_ede3_cfb(void)
103 {
104 return(&d_ede3_cfb_cipher3);
105 }
106
107static void des_ede_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
108 unsigned char *iv, int enc)
109 {
110 des_cblock *deskey = (des_cblock *)key;
111
112 ctx->num=0;
113
114 if (iv != NULL)
115 memcpy(&(ctx->oiv[0]),iv,8);
116 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
117 if (deskey != NULL)
118 {
119 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
120 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
121 memcpy( (char *)ctx->c.des_ede.ks3,
122 (char *)ctx->c.des_ede.ks1,
123 sizeof(ctx->c.des_ede.ks1));
124 }
125 }
126
127static void des_ede3_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
128 unsigned char *iv, int enc)
129 {
130 des_cblock *deskey = (des_cblock *)key;
131
132 ctx->num=0;
133
134 if (iv != NULL)
135 memcpy(&(ctx->oiv[0]),iv,8);
136 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
137 if (deskey != NULL)
138 {
139 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
140 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
141 des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
142 }
143 }
144
145static void des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
146 unsigned char *in, unsigned int inl)
147 {
148 des_ede3_cfb64_encrypt(in,out,(long)inl,
149 ctx->c.des_ede.ks1,
150 ctx->c.des_ede.ks2,
151 ctx->c.des_ede.ks3,
152 (des_cblock*)&(ctx->iv[0]),
153 &ctx->num,ctx->encrypt);
154 }
155#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_bf.c b/src/lib/libcrypto/evp/e_cfb_bf.c
index 63e1e624ea..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_bf.c
+++ b/src/lib/libcrypto/evp/e_cfb_bf.c
@@ -1,108 +0,0 @@
1/* crypto/evp/e_cfb_bf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_BF
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER bfish_cfb_cipher=
70 {
71 NID_bf_cfb64,
72 1,EVP_BLOWFISH_KEY_SIZE,8,
73 bf_cfb_init_key,
74 bf_cfb_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
78 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv,
80 };
81
82EVP_CIPHER *EVP_bf_cfb(void)
83 {
84 return(&bfish_cfb_cipher);
85 }
86
87static void bf_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 ctx->num=0;
91
92 if (iv != NULL)
93 memcpy(&(ctx->oiv[0]),iv,8);
94 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
95 if (key != NULL)
96 BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key);
97 }
98
99static void bf_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
100 unsigned char *in, unsigned int inl)
101 {
102 BF_cfb64_encrypt(
103 in,out,
104 (long)inl, &(ctx->c.bf_ks),
105 &(ctx->iv[0]),
106 &ctx->num,ctx->encrypt);
107 }
108#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_c.c b/src/lib/libcrypto/evp/e_cfb_c.c
index f04bac034b..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_c.c
+++ b/src/lib/libcrypto/evp/e_cfb_c.c
@@ -1,109 +0,0 @@
1/* crypto/evp/e_cfb_c.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_CAST
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER cast5_cfb_cipher=
71 {
72 NID_cast5_cfb64,
73 1,EVP_CAST5_KEY_SIZE,8,
74 cast_cfb_init_key,
75 cast_cfb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_cast5_cfb(void)
84 {
85 return(&cast5_cfb_cipher);
86 }
87
88static void cast_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key);
98 }
99
100static void cast_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
101 unsigned char *in, unsigned int inl)
102 {
103 CAST_cfb64_encrypt(
104 in,out,
105 (long)inl, &(ctx->c.cast_ks),
106 &(ctx->iv[0]),
107 &ctx->num,ctx->encrypt);
108 }
109#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_d.c b/src/lib/libcrypto/evp/e_cfb_d.c
index 9e1714bd15..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_d.c
+++ b/src/lib/libcrypto/evp/e_cfb_d.c
@@ -1,110 +0,0 @@
1/* crypto/evp/e_cfb_d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include "cryptlib.h"
61#include <openssl/evp.h>
62#include <openssl/objects.h>
63
64#ifndef NO_DES
65static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER d_cfb_cipher=
70 {
71 NID_des_cfb64,
72 1,8,8,
73 des_cfb_init_key,
74 des_cfb_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
78 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv,
80 };
81
82EVP_CIPHER *EVP_des_cfb(void)
83 {
84 return(&d_cfb_cipher);
85 }
86
87static void des_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 des_cblock *deskey = (des_cblock *)key;
91
92 ctx->num=0;
93
94 if (iv != NULL)
95 memcpy(&(ctx->oiv[0]),iv,8);
96 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
97 if (deskey != NULL)
98 des_set_key_unchecked(deskey,ctx->c.des_ks);
99 }
100
101static void des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
102 unsigned char *in, unsigned int inl)
103 {
104 des_cfb64_encrypt(
105 in,out,
106 (long)inl, ctx->c.des_ks,
107 (des_cblock *)&(ctx->iv[0]),
108 &ctx->num,ctx->encrypt);
109 }
110#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_i.c b/src/lib/libcrypto/evp/e_cfb_i.c
index 31c76c6dac..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_i.c
+++ b/src/lib/libcrypto/evp/e_cfb_i.c
@@ -1,109 +0,0 @@
1/* crypto/evp/e_cfb_i.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_IDEA
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER i_cfb_cipher=
71 {
72 NID_idea_cfb64,
73 1,IDEA_KEY_LENGTH,IDEA_BLOCK,
74 idea_cfb_init_key,
75 idea_cfb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_idea_cfb(void)
84 {
85 return(&i_cfb_cipher);
86 }
87
88static void idea_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 idea_set_encrypt_key(key,&(ctx->c.idea_ks));
98 }
99
100static void idea_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
101 unsigned char *in, unsigned int inl)
102 {
103 idea_cfb64_encrypt(
104 in,out,(long)inl,
105 &(ctx->c.idea_ks),&(ctx->iv[0]),
106 &ctx->num,ctx->encrypt);
107 }
108
109#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_r2.c b/src/lib/libcrypto/evp/e_cfb_r2.c
index 32dd77eb7c..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_r2.c
+++ b/src/lib/libcrypto/evp/e_cfb_r2.c
@@ -1,110 +0,0 @@
1/* crypto/evp/e_cfb_r2.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC2
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER r2_cfb_cipher=
71 {
72 NID_rc2_cfb64,
73 1,EVP_RC2_KEY_SIZE,8,
74 rc2_cfb_init_key,
75 rc2_cfb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_rc2_cfb(void)
84 {
85 return(&r2_cfb_cipher);
86 }
87
88static void rc2_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
98 key,EVP_CIPHER_CTX_key_length(ctx)*8);
99 }
100
101static void rc2_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
102 unsigned char *in, unsigned int inl)
103 {
104 RC2_cfb64_encrypt(
105 in,out,
106 (long)inl, &(ctx->c.rc2_ks),
107 &(ctx->iv[0]),
108 &ctx->num,ctx->encrypt);
109 }
110#endif
diff --git a/src/lib/libcrypto/evp/e_cfb_r5.c b/src/lib/libcrypto/evp/e_cfb_r5.c
index 8e79728946..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_cfb_r5.c
+++ b/src/lib/libcrypto/evp/e_cfb_r5.c
@@ -1,110 +0,0 @@
1/* crypto/evp/e_cfb_r5.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC5
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER rc5_cfb_cipher=
71 {
72 NID_rc5_cfb64,
73 1,EVP_RC5_32_12_16_KEY_SIZE,8,
74 rc5_32_12_16_cfb_init_key,
75 rc5_32_12_16_cfb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_rc5_32_12_16_cfb(void)
84 {
85 return(&rc5_cfb_cipher);
86 }
87
88static void rc5_32_12_16_cfb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key,
98 RC5_12_ROUNDS);
99 }
100
101static void rc5_32_12_16_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
102 unsigned char *in, unsigned int inl)
103 {
104 RC5_32_cfb64_encrypt(
105 in,out,
106 (long)inl, &(ctx->c.rc5_ks),
107 &(ctx->iv[0]),
108 &ctx->num,ctx->encrypt);
109 }
110#endif
diff --git a/src/lib/libcrypto/evp/e_des.c b/src/lib/libcrypto/evp/e_des.c
new file mode 100644
index 0000000000..f4e998b81c
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_des.c
@@ -0,0 +1,118 @@
1/* crypto/evp/e_des.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include "evp_locl.h"
65
66static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
67 const unsigned char *iv, int enc);
68
69/* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */
70
71static int des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
72 const unsigned char *in, unsigned int inl)
73{
74 BLOCK_CIPHER_ecb_loop()
75 des_ecb_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i), ctx->c.des_ks, ctx->encrypt);
76 return 1;
77}
78
79static int des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
80 const unsigned char *in, unsigned int inl)
81{
82 des_ofb64_encrypt(in, out, (long)inl, ctx->c.des_ks, (des_cblock *)ctx->iv, &ctx->num);
83 return 1;
84}
85
86static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
87 const unsigned char *in, unsigned int inl)
88{
89 des_ncbc_encrypt(in, out, (long)inl, ctx->c.des_ks,
90 (des_cblock *)ctx->iv, ctx->encrypt);
91 return 1;
92}
93
94static int des_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
95 const unsigned char *in, unsigned int inl)
96{
97 des_cfb64_encrypt(in, out, (long)inl, ctx->c.des_ks,
98 (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
99 return 1;
100}
101
102BLOCK_CIPHER_defs(des, des_ks, NID_des, 8, 8, 8,
103 0, des_init_key, NULL,
104 EVP_CIPHER_set_asn1_iv,
105 EVP_CIPHER_get_asn1_iv,
106 NULL)
107
108
109static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
110 const unsigned char *iv, int enc)
111 {
112 des_cblock *deskey = (des_cblock *)key;
113
114 des_set_key_unchecked(deskey,ctx->c.des_ks);
115 return 1;
116 }
117
118#endif
diff --git a/src/lib/libcrypto/evp/e_des3.c b/src/lib/libcrypto/evp/e_des3.c
new file mode 100644
index 0000000000..a9aba4ae70
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_des3.c
@@ -0,0 +1,165 @@
1/* crypto/evp/e_des3.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include "evp_locl.h"
65
66static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
67 const unsigned char *iv,int enc);
68
69static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
70 const unsigned char *iv,int enc);
71
72/* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */
73
74static int des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
75 const unsigned char *in, unsigned int inl)
76{
77 BLOCK_CIPHER_ecb_loop()
78 des_ecb3_encrypt((des_cblock *)(in + i), (des_cblock *)(out + i),
79 ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
80 ctx->encrypt);
81 return 1;
82}
83
84static int des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
85 const unsigned char *in, unsigned int inl)
86{
87 des_ede3_ofb64_encrypt(in, out, (long)inl,
88 ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
89 (des_cblock *)ctx->iv, &ctx->num);
90 return 1;
91}
92
93static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
94 const unsigned char *in, unsigned int inl)
95{
96 des_ede3_cbc_encrypt(in, out, (long)inl,
97 ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
98 (des_cblock *)ctx->iv, ctx->encrypt);
99 return 1;
100}
101
102static int des_ede_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
103 const unsigned char *in, unsigned int inl)
104{
105 des_ede3_cfb64_encrypt(in, out, (long)inl,
106 ctx->c.des_ede.ks1, ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
107 (des_cblock *)ctx->iv, &ctx->num, ctx->encrypt);
108 return 1;
109}
110
111#define NID_des_ede_ecb NID_des_ede
112
113BLOCK_CIPHER_defs(des_ede, des_ede, NID_des_ede, 8, 16, 8,
114 0, des_ede_init_key, NULL,
115 EVP_CIPHER_set_asn1_iv,
116 EVP_CIPHER_get_asn1_iv,
117 NULL)
118
119#define NID_des_ede3_ecb NID_des_ede3
120#define des_ede3_cfb_cipher des_ede_cfb_cipher
121#define des_ede3_ofb_cipher des_ede_ofb_cipher
122#define des_ede3_cbc_cipher des_ede_cbc_cipher
123#define des_ede3_ecb_cipher des_ede_ecb_cipher
124
125BLOCK_CIPHER_defs(des_ede3, des_ede, NID_des_ede3, 8, 24, 8,
126 0, des_ede3_init_key, NULL,
127 EVP_CIPHER_set_asn1_iv,
128 EVP_CIPHER_get_asn1_iv,
129 NULL)
130
131static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
132 const unsigned char *iv, int enc)
133 {
134 des_cblock *deskey = (des_cblock *)key;
135
136 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
137 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
138 memcpy( (char *)ctx->c.des_ede.ks3,
139 (char *)ctx->c.des_ede.ks1,
140 sizeof(ctx->c.des_ede.ks1));
141 return 1;
142 }
143
144static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
145 const unsigned char *iv, int enc)
146 {
147 des_cblock *deskey = (des_cblock *)key;
148
149 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
150 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
151 des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
152
153 return 1;
154 }
155
156EVP_CIPHER *EVP_des_ede(void)
157{
158 return &des_ede_ecb;
159}
160
161EVP_CIPHER *EVP_des_ede3(void)
162{
163 return &des_ede3_ecb;
164}
165#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_3d.c b/src/lib/libcrypto/evp/e_ecb_3d.c
index 806e971d36..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_3d.c
+++ b/src/lib/libcrypto/evp/e_ecb_3d.c
@@ -1,158 +0,0 @@
1/* crypto/evp/e_ecb_3d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc);
69static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
70 unsigned char *in, unsigned int inl);
71static EVP_CIPHER d_ede_cipher2=
72 {
73 NID_des_ede,
74 8,16,0,
75 des_ede_init_key,
76 des_ede_cipher,
77 NULL,
78 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
79 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
80 NULL,
81 NULL,
82 };
83
84static EVP_CIPHER d_ede3_cipher3=
85 {
86 NID_des_ede3,
87 8,24,0,
88 des_ede3_init_key,
89 des_ede_cipher,
90 NULL,
91 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
92 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
93 NULL,
94 };
95
96EVP_CIPHER *EVP_des_ede(void)
97 {
98 return(&d_ede_cipher2);
99 }
100
101EVP_CIPHER *EVP_des_ede3(void)
102 {
103 return(&d_ede3_cipher3);
104 }
105
106static void des_ede_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
107 unsigned char *iv, int enc)
108 {
109 des_cblock *deskey = (des_cblock *)key;
110
111 if (deskey != NULL)
112 {
113 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
114 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
115 memcpy( (char *)ctx->c.des_ede.ks3,
116 (char *)ctx->c.des_ede.ks1,
117 sizeof(ctx->c.des_ede.ks1));
118 }
119 }
120
121static void des_ede3_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
122 unsigned char *iv, int enc)
123 {
124 des_cblock *deskey = (des_cblock *)key;
125
126 if (deskey != NULL)
127 {
128 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
129 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
130 des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
131 }
132 }
133
134static void des_ede_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
135 unsigned char *in, unsigned int inl)
136 {
137 unsigned int i;
138 des_cblock *output /* = (des_cblock *)out */;
139 des_cblock *input /* = (des_cblock *)in */;
140
141 if (inl < 8) return;
142 inl-=8;
143 for (i=0; i<=inl; i+=8)
144 {
145 output = (des_cblock *)(out + i);
146 input = (des_cblock *)(in + i);
147
148 des_ecb3_encrypt(input,output,
149 ctx->c.des_ede.ks1,
150 ctx->c.des_ede.ks2,
151 ctx->c.des_ede.ks3,
152 ctx->encrypt);
153
154 /* output++; */
155 /* input++; */
156 }
157 }
158#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_bf.c b/src/lib/libcrypto/evp/e_ecb_bf.c
index 334736d253..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_bf.c
+++ b/src/lib/libcrypto/evp/e_ecb_bf.c
@@ -1,109 +0,0 @@
1/* crypto/evp/e_ecb_bf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_BF
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER bfish_ecb_cipher=
70 {
71 NID_bf_ecb,
72 8,EVP_BLOWFISH_KEY_SIZE,0,
73 bf_ecb_init_key,
74 bf_ecb_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
78 NULL,
79 NULL,
80 };
81
82EVP_CIPHER *EVP_bf_ecb(void)
83 {
84 return(&bfish_ecb_cipher);
85 }
86
87static void bf_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 if (key != NULL)
91 BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key);
92 }
93
94static void bf_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
95 unsigned char *in, unsigned int inl)
96 {
97 unsigned int i;
98
99 if (inl < 8) return;
100 inl-=8;
101 for (i=0; i<=inl; i+=8)
102 {
103 BF_ecb_encrypt(
104 &(in[i]),&(out[i]),
105 &(ctx->c.bf_ks),ctx->encrypt);
106 }
107 }
108
109#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_c.c b/src/lib/libcrypto/evp/e_ecb_c.c
index ad14e203cb..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_c.c
+++ b/src/lib/libcrypto/evp/e_ecb_c.c
@@ -1,110 +0,0 @@
1/* crypto/evp/e_ecb_c.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_CAST
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER cast5_ecb_cipher=
71 {
72 NID_cast5_ecb,
73 8,EVP_CAST5_KEY_SIZE,0,
74 cast_ecb_init_key,
75 cast_ecb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
79 NULL,
80 NULL,
81 };
82
83EVP_CIPHER *EVP_cast5_ecb(void)
84 {
85 return(&cast5_ecb_cipher);
86 }
87
88static void cast_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (key != NULL)
92 CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key);
93 }
94
95static void cast_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
96 unsigned char *in, unsigned int inl)
97 {
98 unsigned int i;
99
100 if (inl < 8) return;
101 inl-=8;
102 for (i=0; i<=inl; i+=8)
103 {
104 CAST_ecb_encrypt(
105 &(in[i]),&(out[i]),
106 &(ctx->c.cast_ks),ctx->encrypt);
107 }
108 }
109
110#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_d.c b/src/lib/libcrypto/evp/e_ecb_d.c
index c11bef55ef..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_d.c
+++ b/src/lib/libcrypto/evp/e_ecb_d.c
@@ -1,118 +0,0 @@
1/* crypto/evp/e_ecb_d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER d_ecb_cipher=
70 {
71 NID_des_ecb,
72 8,8,0,
73 des_ecb_init_key,
74 des_ecb_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
78 NULL,
79 NULL,
80 };
81
82EVP_CIPHER *EVP_des_ecb(void)
83 {
84 return(&d_ecb_cipher);
85 }
86
87static void des_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 des_cblock *deskey = (des_cblock *)key;
91
92 if (deskey != NULL)
93 des_set_key_unchecked(deskey,ctx->c.des_ks);
94 }
95
96static void des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
97 unsigned char *in, unsigned int inl)
98 {
99 unsigned int i;
100 des_cblock *output /* = (des_cblock *)out */;
101 des_cblock *input /* = (des_cblock *)in */;
102
103 if (inl < 8) return;
104 inl-=8;
105 for (i=0; i<=inl; i+=8)
106 {
107 /* Either this ... */
108 output = (des_cblock *)(out + i);
109 input = (des_cblock *)(in + i);
110
111 des_ecb_encrypt(input,output,ctx->c.des_ks,ctx->encrypt);
112
113 /* ... or this. */
114 /* output++; */
115 /* input++; */
116 }
117 }
118#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_i.c b/src/lib/libcrypto/evp/e_ecb_i.c
index 50a3da1bba..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_i.c
+++ b/src/lib/libcrypto/evp/e_ecb_i.c
@@ -1,121 +0,0 @@
1/* crypto/evp/e_ecb_i.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_IDEA
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER i_ecb_cipher=
71 {
72 NID_idea_ecb,
73 8,16,0,
74 idea_ecb_init_key,
75 idea_ecb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
79 NULL,
80 NULL,
81 };
82
83EVP_CIPHER *EVP_idea_ecb(void)
84 {
85 return(&i_ecb_cipher);
86 }
87
88static void idea_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (key != NULL)
92 {
93 if (enc)
94 idea_set_encrypt_key(key,&(ctx->c.idea_ks));
95 else
96 {
97 IDEA_KEY_SCHEDULE tmp;
98
99 idea_set_encrypt_key(key,&tmp);
100 idea_set_decrypt_key(&tmp, &(ctx->c.idea_ks));
101 memset((unsigned char *)&tmp,0,
102 sizeof(IDEA_KEY_SCHEDULE));
103 }
104 }
105 }
106
107static void idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
108 unsigned char *in, unsigned int inl)
109 {
110 unsigned int i;
111
112 if (inl < 8) return;
113 inl-=8;
114 for (i=0; i<=inl; i+=8)
115 {
116 idea_ecb_encrypt(
117 &(in[i]),&(out[i]),&(ctx->c.idea_ks));
118 }
119 }
120
121#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_r2.c b/src/lib/libcrypto/evp/e_ecb_r2.c
index 3c2330130d..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_r2.c
+++ b/src/lib/libcrypto/evp/e_ecb_r2.c
@@ -1,111 +0,0 @@
1/* crypto/evp/e_ecb_r2.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC2
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER r2_ecb_cipher=
71 {
72 NID_rc2_ecb,
73 8,EVP_RC2_KEY_SIZE,0,
74 rc2_ecb_init_key,
75 rc2_ecb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
79 NULL,
80 NULL,
81 };
82
83EVP_CIPHER *EVP_rc2_ecb(void)
84 {
85 return(&r2_ecb_cipher);
86 }
87
88static void rc2_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (key != NULL)
92 RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
93 key,EVP_CIPHER_CTX_key_length(ctx)*8);
94 }
95
96static void rc2_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
97 unsigned char *in, unsigned int inl)
98 {
99 unsigned int i;
100
101 if (inl < 8) return;
102 inl-=8;
103 for (i=0; i<=inl; i+=8)
104 {
105 RC2_ecb_encrypt(
106 &(in[i]),&(out[i]),
107 &(ctx->c.rc2_ks),ctx->encrypt);
108 }
109 }
110
111#endif
diff --git a/src/lib/libcrypto/evp/e_ecb_r5.c b/src/lib/libcrypto/evp/e_ecb_r5.c
index ef43ce34bf..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ecb_r5.c
+++ b/src/lib/libcrypto/evp/e_ecb_r5.c
@@ -1,111 +0,0 @@
1/* crypto/evp/e_ecb_r5.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC5
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER rc5_ecb_cipher=
71 {
72 NID_rc5_ecb,
73 8,EVP_RC5_32_12_16_KEY_SIZE,0,
74 rc5_32_12_16_ecb_init_key,
75 rc5_32_12_16_ecb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
79 NULL,
80 NULL,
81 };
82
83EVP_CIPHER *EVP_rc5_32_12_16_ecb(void)
84 {
85 return(&rc5_ecb_cipher);
86 }
87
88static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 if (key != NULL)
92 RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key,
93 RC5_12_ROUNDS);
94 }
95
96static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
97 unsigned char *in, unsigned int inl)
98 {
99 unsigned int i;
100
101 if (inl < 8) return;
102 inl-=8;
103 for (i=0; i<=inl; i+=8)
104 {
105 RC5_32_ecb_encrypt(
106 &(in[i]),&(out[i]),
107 &(ctx->c.rc5_ks),ctx->encrypt);
108 }
109 }
110
111#endif
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c
new file mode 100644
index 0000000000..8d3c88deb7
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_idea.c
@@ -0,0 +1,112 @@
1/* crypto/evp/e_idea.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_IDEA
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include "evp_locl.h"
66
67static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
68 const unsigned char *iv,int enc);
69
70/* NB idea_ecb_encrypt doesn't take an 'encrypt' argument so we treat it as a special
71 * case
72 */
73
74static int idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
75 const unsigned char *in, unsigned int inl)
76{
77 BLOCK_CIPHER_ecb_loop()
78 idea_ecb_encrypt(in + i, out + i, &ctx->c.idea_ks);
79 return 1;
80}
81
82/* Can't use IMPLEMENT_BLOCK_CIPHER because idea_ecb_encrypt is different */
83
84BLOCK_CIPHER_func_cbc(idea, idea, idea_ks)
85BLOCK_CIPHER_func_ofb(idea, idea, idea_ks)
86BLOCK_CIPHER_func_cfb(idea, idea, idea_ks)
87
88BLOCK_CIPHER_defs(idea, idea_ks, NID_idea, 8, 16, 8,
89 0, idea_init_key, NULL,
90 EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL)
91
92static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
93 const unsigned char *iv, int enc)
94 {
95 if(!enc) {
96 if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_OFB_MODE) enc = 1;
97 else if (EVP_CIPHER_CTX_mode(ctx) == EVP_CIPH_CFB_MODE) enc = 1;
98 }
99 if (enc) idea_set_encrypt_key(key,&(ctx->c.idea_ks));
100 else
101 {
102 IDEA_KEY_SCHEDULE tmp;
103
104 idea_set_encrypt_key(key,&tmp);
105 idea_set_decrypt_key(&tmp,&(ctx->c.idea_ks));
106 memset((unsigned char *)&tmp,0,
107 sizeof(IDEA_KEY_SCHEDULE));
108 }
109 return 1;
110 }
111
112#endif
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c
index 0a62c10aa9..e0702cf818 100644
--- a/src/lib/libcrypto/evp/e_null.c
+++ b/src/lib/libcrypto/evp/e_null.c
@@ -61,20 +61,22 @@
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63 63
64static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 64static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
65 unsigned char *iv,int enc); 65 const unsigned char *iv,int enc);
66static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 66static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
67 unsigned char *in, unsigned int inl); 67 const unsigned char *in, unsigned int inl);
68static EVP_CIPHER n_cipher= 68static EVP_CIPHER n_cipher=
69 { 69 {
70 NID_undef, 70 NID_undef,
71 1,0,0, 71 1,0,0,
72 0,
72 null_init_key, 73 null_init_key,
73 null_cipher, 74 null_cipher,
74 NULL, 75 NULL,
75 0, 76 0,
76 NULL, 77 NULL,
77 NULL, 78 NULL,
79 NULL
78 }; 80 };
79 81
80EVP_CIPHER *EVP_enc_null(void) 82EVP_CIPHER *EVP_enc_null(void)
@@ -82,16 +84,18 @@ EVP_CIPHER *EVP_enc_null(void)
82 return(&n_cipher); 84 return(&n_cipher);
83 } 85 }
84 86
85static void null_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 87static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
86 unsigned char *iv, int enc) 88 const unsigned char *iv, int enc)
87 { 89 {
88 memset(&(ctx->c),0,sizeof(ctx->c)); 90 memset(&(ctx->c),0,sizeof(ctx->c));
91 return 1;
89 } 92 }
90 93
91static void null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 94static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
92 unsigned char *in, unsigned int inl) 95 const unsigned char *in, unsigned int inl)
93 { 96 {
94 if (in != out) 97 if (in != out)
95 memcpy((char *)out,(char *)in,(int)inl); 98 memcpy((char *)out,(char *)in,(int)inl);
99 return 1;
96 } 100 }
97 101
diff --git a/src/lib/libcrypto/evp/e_ofb_3d.c b/src/lib/libcrypto/evp/e_ofb_3d.c
index d1a33e2ecd..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_3d.c
+++ b/src/lib/libcrypto/evp/e_ofb_3d.c
@@ -1,152 +0,0 @@
1/* crypto/evp/e_ofb_3d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
68 unsigned char *iv,int enc);
69static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
70 unsigned char *in, unsigned int inl);
71static EVP_CIPHER d_ede_ofb_cipher2=
72 {
73 NID_des_ede_ofb64,
74 1,16,8,
75 des_ede_ofb_init_key,
76 des_ede_ofb_cipher,
77 NULL,
78 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
79 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
80 EVP_CIPHER_set_asn1_iv,
81 EVP_CIPHER_get_asn1_iv,
82 };
83
84static EVP_CIPHER d_ede3_ofb_cipher3=
85 {
86 NID_des_ede3_ofb64,
87 1,24,8,
88 des_ede3_ofb_init_key,
89 des_ede_ofb_cipher,
90 NULL,
91 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
92 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ede)),
93 EVP_CIPHER_set_asn1_iv,
94 EVP_CIPHER_get_asn1_iv,
95 };
96
97EVP_CIPHER *EVP_des_ede_ofb(void)
98 {
99 return(&d_ede_ofb_cipher2);
100 }
101
102EVP_CIPHER *EVP_des_ede3_ofb(void)
103 {
104 return(&d_ede3_ofb_cipher3);
105 }
106
107static void des_ede_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
108 unsigned char *iv, int enc)
109 {
110 des_cblock *deskey = (des_cblock *)key;
111
112 ctx->num=0;
113
114 if (iv != NULL)
115 memcpy(&(ctx->oiv[0]),iv,8);
116 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
117 if (deskey != NULL)
118 {
119 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
120 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
121 memcpy( (char *)ctx->c.des_ede.ks3,
122 (char *)ctx->c.des_ede.ks1,
123 sizeof(ctx->c.des_ede.ks1));
124 }
125 }
126
127static void des_ede3_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
128 unsigned char *iv, int enc)
129 {
130 des_cblock *deskey = (des_cblock *)key;
131
132 ctx->num=0;
133
134 if (iv != NULL)
135 memcpy(&(ctx->oiv[0]),iv,8);
136 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
137 if (deskey != NULL)
138 {
139 des_set_key_unchecked(&deskey[0],ctx->c.des_ede.ks1);
140 des_set_key_unchecked(&deskey[1],ctx->c.des_ede.ks2);
141 des_set_key_unchecked(&deskey[2],ctx->c.des_ede.ks3);
142 }
143 }
144
145static void des_ede_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
146 unsigned char *in, unsigned int inl)
147 {
148 des_ede3_ofb64_encrypt(in,out,inl,ctx->c.des_ede.ks1,
149 ctx->c.des_ede.ks2, ctx->c.des_ede.ks3,
150 (des_cblock *)&(ctx->iv[0]),&ctx->num);
151 }
152#endif
diff --git a/src/lib/libcrypto/evp/e_ofb_bf.c b/src/lib/libcrypto/evp/e_ofb_bf.c
index c82154b549..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_bf.c
+++ b/src/lib/libcrypto/evp/e_ofb_bf.c
@@ -1,109 +0,0 @@
1/* crypto/evp/e_ofb_bf.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_BF
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER bfish_ofb_cipher=
70 {
71 NID_bf_ofb64,
72 1,EVP_BLOWFISH_KEY_SIZE,8,
73 bf_ofb_init_key,
74 bf_ofb_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)),
78 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv,
80 };
81
82EVP_CIPHER *EVP_bf_ofb(void)
83 {
84 return(&bfish_ofb_cipher);
85 }
86
87static void bf_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 ctx->num=0;
91
92 if (iv != NULL)
93 memcpy(&(ctx->oiv[0]),iv,8);
94 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
95 if (key != NULL)
96 BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key);
97 }
98
99static void bf_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
100 unsigned char *in, unsigned int inl)
101 {
102 BF_ofb64_encrypt(
103 in,out,
104 (long)inl, &(ctx->c.bf_ks),
105 &(ctx->iv[0]),
106 &ctx->num);
107 }
108
109#endif
diff --git a/src/lib/libcrypto/evp/e_ofb_c.c b/src/lib/libcrypto/evp/e_ofb_c.c
index 971043de4c..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_c.c
+++ b/src/lib/libcrypto/evp/e_ofb_c.c
@@ -1,110 +0,0 @@
1/* crypto/evp/e_ofb_c.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_CAST
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER cast5_ofb_cipher=
71 {
72 NID_cast5_ofb64,
73 1,EVP_CAST5_KEY_SIZE,8,
74 cast_ofb_init_key,
75 cast_ofb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.cast_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_cast5_ofb(void)
84 {
85 return(&cast5_ofb_cipher);
86 }
87
88static void cast_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 CAST_set_key(&(ctx->c.cast_ks),EVP_CAST5_KEY_SIZE,key);
98 }
99
100static void cast_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
101 unsigned char *in, unsigned int inl)
102 {
103 CAST_ofb64_encrypt(
104 in,out,
105 (long)inl, &(ctx->c.cast_ks),
106 &(ctx->iv[0]),
107 &ctx->num);
108 }
109
110#endif
diff --git a/src/lib/libcrypto/evp/e_ofb_d.c b/src/lib/libcrypto/evp/e_ofb_d.c
index d51ce230f4..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_d.c
+++ b/src/lib/libcrypto/evp/e_ofb_d.c
@@ -1,107 +0,0 @@
1/* crypto/evp/e_ofb_d.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_DES
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64
65static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
66 unsigned char *iv,int enc);
67static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl);
69static EVP_CIPHER d_ofb_cipher=
70 {
71 NID_des_ofb64,
72 1,8,8,
73 des_ofb_init_key,
74 des_ofb_cipher,
75 NULL,
76 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.des_ks)),
78 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv,
80 };
81
82EVP_CIPHER *EVP_des_ofb(void)
83 {
84 return(&d_ofb_cipher);
85 }
86
87static void des_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
88 unsigned char *iv, int enc)
89 {
90 des_cblock *deskey = (des_cblock *)key;
91
92 ctx->num=0;
93
94 if (iv != NULL)
95 memcpy(&(ctx->oiv[0]),iv,8);
96 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
97 if (deskey != NULL)
98 des_set_key_unchecked(deskey,ctx->c.des_ks);
99 }
100
101static void des_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
102 unsigned char *in, unsigned int inl)
103 {
104 des_ofb64_encrypt(in,out,inl,ctx->c.des_ks,
105 (des_cblock *)&(ctx->iv[0]),&ctx->num);
106 }
107#endif
diff --git a/src/lib/libcrypto/evp/e_ofb_i.c b/src/lib/libcrypto/evp/e_ofb_i.c
index 389206ef36..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_i.c
+++ b/src/lib/libcrypto/evp/e_ofb_i.c
@@ -1,109 +0,0 @@
1/* crypto/evp/e_ofb_i.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_IDEA
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER i_ofb_cipher=
71 {
72 NID_idea_ofb64,
73 1,IDEA_KEY_LENGTH,IDEA_BLOCK,
74 idea_ofb_init_key,
75 idea_ofb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.idea_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_idea_ofb(void)
84 {
85 return(&i_ofb_cipher);
86 }
87
88static void idea_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 idea_set_encrypt_key(key,&(ctx->c.idea_ks));
98 }
99
100static void idea_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
101 unsigned char *in, unsigned int inl)
102 {
103 idea_ofb64_encrypt(
104 in,out,(long)inl,
105 &(ctx->c.idea_ks),&(ctx->iv[0]),
106 &ctx->num);
107 }
108
109#endif
diff --git a/src/lib/libcrypto/evp/e_ofb_r2.c b/src/lib/libcrypto/evp/e_ofb_r2.c
index 60ae3d4507..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_r2.c
+++ b/src/lib/libcrypto/evp/e_ofb_r2.c
@@ -1,111 +0,0 @@
1/* crypto/evp/e_ofb_r2.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC2
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER r2_ofb_cipher=
71 {
72 NID_rc2_ofb64,
73 1,EVP_RC2_KEY_SIZE,8,
74 rc2_ofb_init_key,
75 rc2_ofb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_rc2_ofb(void)
84 {
85 return(&r2_ofb_cipher);
86 }
87
88static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
98 key,EVP_CIPHER_CTX_key_length(ctx)*8);
99 }
100
101static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
102 unsigned char *in, unsigned int inl)
103 {
104 RC2_ofb64_encrypt(
105 in,out,
106 (long)inl, &(ctx->c.rc2_ks),
107 &(ctx->iv[0]),
108 &ctx->num);
109 }
110
111#endif
diff --git a/src/lib/libcrypto/evp/e_ofb_r5.c b/src/lib/libcrypto/evp/e_ofb_r5.c
index 30136824eb..e69de29bb2 100644
--- a/src/lib/libcrypto/evp/e_ofb_r5.c
+++ b/src/lib/libcrypto/evp/e_ofb_r5.c
@@ -1,111 +0,0 @@
1/* crypto/evp/e_ofb_r5.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC5
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
66static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
67 unsigned char *iv,int enc);
68static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl);
70static EVP_CIPHER rc5_ofb_cipher=
71 {
72 NID_rc5_ofb64,
73 1,EVP_RC5_32_12_16_KEY_SIZE,8,
74 rc5_32_12_16_ofb_init_key,
75 rc5_32_12_16_ofb_cipher,
76 NULL,
77 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc5_ks)),
79 EVP_CIPHER_set_asn1_iv,
80 EVP_CIPHER_get_asn1_iv,
81 };
82
83EVP_CIPHER *EVP_rc5_32_12_16_ofb(void)
84 {
85 return(&rc5_ofb_cipher);
86 }
87
88static void rc5_32_12_16_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
89 unsigned char *iv, int enc)
90 {
91 ctx->num=0;
92
93 if (iv != NULL)
94 memcpy(&(ctx->oiv[0]),iv,8);
95 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8);
96 if (key != NULL)
97 RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key,
98 RC5_12_ROUNDS);
99 }
100
101static void rc5_32_12_16_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
102 unsigned char *in, unsigned int inl)
103 {
104 RC5_32_ofb64_encrypt(
105 in,out,
106 (long)inl, &(ctx->c.rc5_ks),
107 &(ctx->iv[0]),
108 &ctx->num);
109 }
110
111#endif
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c
new file mode 100644
index 0000000000..3955c3ef84
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_rc2.c
@@ -0,0 +1,222 @@
1/* crypto/evp/e_rc2.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC2
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include "evp_locl.h"
66
67static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
68 const unsigned char *iv,int enc);
69static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx);
70static int rc2_magic_to_meth(int i);
71static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
72static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);
73static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
74
75IMPLEMENT_BLOCK_CIPHER(rc2, rc2.ks, RC2, rc2, NID_rc2,
76 8,
77 EVP_RC2_KEY_SIZE, 8,
78 EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
79 rc2_init_key, NULL,
80 rc2_set_asn1_type_and_iv, rc2_get_asn1_type_and_iv,
81 rc2_ctrl)
82
83#define RC2_40_MAGIC 0xa0
84#define RC2_64_MAGIC 0x78
85#define RC2_128_MAGIC 0x3a
86
87static EVP_CIPHER r2_64_cbc_cipher=
88 {
89 NID_rc2_64_cbc,
90 8,8 /* 64 bit */,8,
91 EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
92 rc2_init_key,
93 rc2_cbc_cipher,
94 NULL,
95 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
96 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2)),
97 rc2_set_asn1_type_and_iv,
98 rc2_get_asn1_type_and_iv,
99 rc2_ctrl,
100 NULL
101 };
102
103static EVP_CIPHER r2_40_cbc_cipher=
104 {
105 NID_rc2_40_cbc,
106 8,5 /* 40 bit */,8,
107 EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
108 rc2_init_key,
109 rc2_cbc_cipher,
110 NULL,
111 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
112 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc2)),
113 rc2_set_asn1_type_and_iv,
114 rc2_get_asn1_type_and_iv,
115 rc2_ctrl,
116 NULL
117 };
118
119EVP_CIPHER *EVP_rc2_64_cbc(void)
120 {
121 return(&r2_64_cbc_cipher);
122 }
123
124EVP_CIPHER *EVP_rc2_40_cbc(void)
125 {
126 return(&r2_40_cbc_cipher);
127 }
128
129static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
130 const unsigned char *iv, int enc)
131 {
132 RC2_set_key(&(ctx->c.rc2.ks),EVP_CIPHER_CTX_key_length(ctx),
133 key,ctx->c.rc2.key_bits);
134 return 1;
135 }
136
137static int rc2_meth_to_magic(EVP_CIPHER_CTX *e)
138 {
139 int i;
140
141 EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i);
142 if (i == 128) return(RC2_128_MAGIC);
143 else if (i == 64) return(RC2_64_MAGIC);
144 else if (i == 40) return(RC2_40_MAGIC);
145 else return(0);
146 }
147
148static int rc2_magic_to_meth(int i)
149 {
150 if (i == RC2_128_MAGIC) return 128;
151 else if (i == RC2_64_MAGIC) return 64;
152 else if (i == RC2_40_MAGIC) return 40;
153 else
154 {
155 EVPerr(EVP_F_RC2_MAGIC_TO_METH,EVP_R_UNSUPPORTED_KEY_SIZE);
156 return(0);
157 }
158 }
159
160static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
161 {
162 long num=0;
163 int i=0,l;
164 int key_bits;
165 unsigned char iv[EVP_MAX_IV_LENGTH];
166
167 if (type != NULL)
168 {
169 l=EVP_CIPHER_CTX_iv_length(c);
170 i=ASN1_TYPE_get_int_octetstring(type,&num,iv,l);
171 if (i != l)
172 return(-1);
173 key_bits =rc2_magic_to_meth((int)num);
174 if (!key_bits)
175 return(-1);
176 if(i > 0) EVP_CipherInit(c, NULL, NULL, iv, -1);
177 EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL);
178 EVP_CIPHER_CTX_set_key_length(c, key_bits / 8);
179 }
180 return(i);
181 }
182
183static int rc2_set_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
184 {
185 long num;
186 int i=0,j;
187
188 if (type != NULL)
189 {
190 num=rc2_meth_to_magic(c);
191 j=EVP_CIPHER_CTX_iv_length(c);
192 i=ASN1_TYPE_set_int_octetstring(type,num,c->oiv,j);
193 }
194 return(i);
195 }
196
197static int rc2_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
198 {
199 switch(type) {
200
201 case EVP_CTRL_INIT:
202 c->c.rc2.key_bits = EVP_CIPHER_CTX_key_length(c) * 8;
203 return 1;
204
205 case EVP_CTRL_GET_RC2_KEY_BITS:
206 *(int *)ptr = c->c.rc2.key_bits;
207 return 1;
208
209
210 case EVP_CTRL_SET_RC2_KEY_BITS:
211 if(arg > 0) {
212 c->c.rc2.key_bits = arg;
213 return 1;
214 }
215 return 0;
216
217 default:
218 return -1;
219 }
220 }
221
222#endif
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c
index c7e58a75cc..1c1e3b3857 100644
--- a/src/lib/libcrypto/evp/e_rc4.c
+++ b/src/lib/libcrypto/evp/e_rc4.c
@@ -63,14 +63,15 @@
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h> 64#include <openssl/objects.h>
65 65
66static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 66static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
67 unsigned char *iv,int enc); 67 const unsigned char *iv,int enc);
68static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 68static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
69 unsigned char *in, unsigned int inl); 69 const unsigned char *in, unsigned int inl);
70static EVP_CIPHER r4_cipher= 70static EVP_CIPHER r4_cipher=
71 { 71 {
72 NID_rc4, 72 NID_rc4,
73 1,EVP_RC4_KEY_SIZE,0, 73 1,EVP_RC4_KEY_SIZE,0,
74 EVP_CIPH_VARIABLE_LENGTH,
74 rc4_init_key, 75 rc4_init_key,
75 rc4_cipher, 76 rc4_cipher,
76 NULL, 77 NULL,
@@ -78,14 +79,22 @@ static EVP_CIPHER r4_cipher=
78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)), 79 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)),
79 NULL, 80 NULL,
80 NULL, 81 NULL,
82 NULL
81 }; 83 };
82 84
83static EVP_CIPHER r4_40_cipher= 85static EVP_CIPHER r4_40_cipher=
84 { 86 {
85 NID_rc4_40, 87 NID_rc4_40,
86 1,5 /* 40 bit */,0, 88 1,5 /* 40 bit */,0,
89 EVP_CIPH_VARIABLE_LENGTH,
87 rc4_init_key, 90 rc4_init_key,
88 rc4_cipher, 91 rc4_cipher,
92 NULL,
93 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+
94 sizeof((((EVP_CIPHER_CTX *)NULL)->c.rc4)),
95 NULL,
96 NULL,
97 NULL
89 }; 98 };
90 99
91EVP_CIPHER *EVP_rc4(void) 100EVP_CIPHER *EVP_rc4(void)
@@ -98,18 +107,19 @@ EVP_CIPHER *EVP_rc4_40(void)
98 return(&r4_40_cipher); 107 return(&r4_40_cipher);
99 } 108 }
100 109
101static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 110static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
102 unsigned char *iv, int enc) 111 const unsigned char *iv, int enc)
103 { 112 {
104 if (key != NULL) 113 memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx));
105 memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx));
106 RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx), 114 RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx),
107 ctx->c.rc4.key); 115 ctx->c.rc4.key);
116 return 1;
108 } 117 }
109 118
110static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 119static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
111 unsigned char *in, unsigned int inl) 120 const unsigned char *in, unsigned int inl)
112 { 121 {
113 RC4(&(ctx->c.rc4.ks),inl,in,out); 122 RC4(&(ctx->c.rc4.ks),inl,in,out);
123 return 1;
114 } 124 }
115#endif 125#endif
diff --git a/src/lib/libcrypto/evp/e_rc5.c b/src/lib/libcrypto/evp/e_rc5.c
new file mode 100644
index 0000000000..5885f1826b
--- /dev/null
+++ b/src/lib/libcrypto/evp/e_rc5.c
@@ -0,0 +1,118 @@
1/* crypto/evp/e_rc5.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_RC5
60
61#include <stdio.h>
62#include "cryptlib.h"
63#include <openssl/evp.h>
64#include <openssl/objects.h>
65#include "evp_locl.h"
66
67static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
68 const unsigned char *iv,int enc);
69static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
70
71IMPLEMENT_BLOCK_CIPHER(rc5_32_12_16, rc5.ks, RC5_32, rc5, NID_rc5,
72 8, EVP_RC5_32_12_16_KEY_SIZE, 8,
73 EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CTRL_INIT,
74 r_32_12_16_init_key, NULL,
75 NULL, NULL, rc5_ctrl)
76
77
78
79static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
80 {
81 switch(type) {
82
83 case EVP_CTRL_INIT:
84 c->c.rc5.rounds = RC5_12_ROUNDS;
85 return 1;
86
87 case EVP_CTRL_GET_RC5_ROUNDS:
88 *(int *)ptr = c->c.rc5.rounds;
89 return 1;
90
91
92 case EVP_CTRL_SET_RC5_ROUNDS:
93 switch(arg) {
94 case RC5_8_ROUNDS:
95 case RC5_12_ROUNDS:
96 case RC5_16_ROUNDS:
97 c->c.rc5.rounds = arg;
98 return 1;
99
100 default:
101 EVPerr(EVP_F_RC5_CTRL, EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS);
102 return 0;
103 }
104
105 default:
106 return -1;
107 }
108 }
109
110static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
111 const unsigned char *iv, int enc)
112 {
113 RC5_32_set_key(&(ctx->c.rc5.ks),EVP_CIPHER_CTX_key_length(ctx),
114 key,ctx->c.rc5.rounds);
115 return 1;
116 }
117
118#endif
diff --git a/src/lib/libcrypto/evp/e_xcbc_d.c b/src/lib/libcrypto/evp/e_xcbc_d.c
index 7568fad4ff..e5b15acc7d 100644
--- a/src/lib/libcrypto/evp/e_xcbc_d.c
+++ b/src/lib/libcrypto/evp/e_xcbc_d.c
@@ -62,14 +62,15 @@
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64 64
65static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 65static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
66 unsigned char *iv,int enc); 66 const unsigned char *iv,int enc);
67static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 67static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
68 unsigned char *in, unsigned int inl); 68 const unsigned char *in, unsigned int inl);
69static EVP_CIPHER d_xcbc_cipher= 69static EVP_CIPHER d_xcbc_cipher=
70 { 70 {
71 NID_desx_cbc, 71 NID_desx_cbc,
72 8,24,8, 72 8,24,8,
73 EVP_CIPH_CBC_MODE,
73 desx_cbc_init_key, 74 desx_cbc_init_key,
74 desx_cbc_cipher, 75 desx_cbc_cipher,
75 NULL, 76 NULL,
@@ -77,6 +78,7 @@ static EVP_CIPHER d_xcbc_cipher=
77 sizeof((((EVP_CIPHER_CTX *)NULL)->c.desx_cbc)), 78 sizeof((((EVP_CIPHER_CTX *)NULL)->c.desx_cbc)),
78 EVP_CIPHER_set_asn1_iv, 79 EVP_CIPHER_set_asn1_iv,
79 EVP_CIPHER_get_asn1_iv, 80 EVP_CIPHER_get_asn1_iv,
81 NULL
80 }; 82 };
81 83
82EVP_CIPHER *EVP_desx_cbc(void) 84EVP_CIPHER *EVP_desx_cbc(void)
@@ -84,29 +86,26 @@ EVP_CIPHER *EVP_desx_cbc(void)
84 return(&d_xcbc_cipher); 86 return(&d_xcbc_cipher);
85 } 87 }
86 88
87static void desx_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, 89static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
88 unsigned char *iv, int enc) 90 const unsigned char *iv, int enc)
89 { 91 {
90 des_cblock *deskey = (des_cblock *)key; 92 des_cblock *deskey = (des_cblock *)key;
91 93
92 if (iv != NULL) 94 des_set_key_unchecked(deskey,ctx->c.desx_cbc.ks);
93 memcpy(&(ctx->oiv[0]),iv,8); 95 memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8);
94 memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); 96 memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8);
95 if (deskey != NULL) 97
96 { 98 return 1;
97 des_set_key_unchecked(deskey,ctx->c.desx_cbc.ks);
98 memcpy(&(ctx->c.desx_cbc.inw[0]),&(key[8]),8);
99 memcpy(&(ctx->c.desx_cbc.outw[0]),&(key[16]),8);
100 }
101 } 99 }
102 100
103static void desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 101static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
104 unsigned char *in, unsigned int inl) 102 const unsigned char *in, unsigned int inl)
105 { 103 {
106 des_xcbc_encrypt(in,out,inl,ctx->c.desx_cbc.ks, 104 des_xcbc_encrypt(in,out,inl,ctx->c.desx_cbc.ks,
107 (des_cblock *)&(ctx->iv[0]), 105 (des_cblock *)&(ctx->iv[0]),
108 &ctx->c.desx_cbc.inw, 106 &ctx->c.desx_cbc.inw,
109 &ctx->c.desx_cbc.outw, 107 &ctx->c.desx_cbc.outw,
110 ctx->encrypt); 108 ctx->encrypt);
109 return 1;
111 } 110 }
112#endif 111#endif
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c
index 14a4cb11f6..6ff9c1783c 100644
--- a/src/lib/libcrypto/evp/encode.c
+++ b/src/lib/libcrypto/evp/encode.c
@@ -292,7 +292,17 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
292 /* If we are at the end of input and it looks like a 292 /* If we are at the end of input and it looks like a
293 * line, process it. */ 293 * line, process it. */
294 if (((i+1) == inl) && (((n&3) == 0) || eof)) 294 if (((i+1) == inl) && (((n&3) == 0) || eof))
295 {
295 v=B64_EOF; 296 v=B64_EOF;
297 /* In case things were given us in really small
298 records (so two '=' were given in separate
299 updates), eof may contain the incorrect number
300 of ending bytes to skip, so let's redo the count */
301 eof = 0;
302 if (d[n-1] == '=') eof++;
303 if (d[n-2] == '=') eof++;
304 /* There will never be more than two '=' */
305 }
296 306
297 if ((v == B64_EOF) || (n >= 64)) 307 if ((v == B64_EOF) || (n >= 64))
298 { 308 {
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index 54215b0905..f5b938d2f8 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -59,13 +59,23 @@
59#ifndef HEADER_ENVELOPE_H 59#ifndef HEADER_ENVELOPE_H
60#define HEADER_ENVELOPE_H 60#define HEADER_ENVELOPE_H
61 61
62#ifdef __cplusplus 62#ifdef OPENSSL_ALGORITHM_DEFINES
63extern "C" { 63# include <openssl/opensslconf.h>
64#else
65# define OPENSSL_ALGORITHM_DEFINES
66# include <openssl/opensslconf.h>
67# undef OPENSSL_ALGORITHM_DEFINES
64#endif 68#endif
65 69
70#ifndef NO_BIO
71#include <openssl/bio.h>
72#endif
66#ifndef NO_MD2 73#ifndef NO_MD2
67#include <openssl/md2.h> 74#include <openssl/md2.h>
68#endif 75#endif
76#ifndef NO_MD4
77#include <openssl/md4.h>
78#endif
69#ifndef NO_MD5 79#ifndef NO_MD5
70#include <openssl/md5.h> 80#include <openssl/md5.h>
71#endif 81#endif
@@ -147,6 +157,10 @@ extern "C" {
147#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 157#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
148#define EVP_PKEY_DH NID_dhKeyAgreement 158#define EVP_PKEY_DH NID_dhKeyAgreement
149 159
160#ifdef __cplusplus
161extern "C" {
162#endif
163
150/* Type needs to be a bit field 164/* Type needs to be a bit field
151 * Sub-type needs to be for variations on the method, as in, can it do 165 * Sub-type needs to be for variations on the method, as in, can it do
152 * arbitrary encryption.... */ 166 * arbitrary encryption.... */
@@ -168,7 +182,7 @@ typedef struct evp_pkey_st
168#endif 182#endif
169 } pkey; 183 } pkey;
170 int save_parameters; 184 int save_parameters;
171 STACK /*X509_ATTRIBUTE*/ *attributes; /* [ 0 ] */ 185 STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
172 } EVP_PKEY; 186 } EVP_PKEY;
173 187
174#define EVP_PKEY_MO_SIGN 0x0001 188#define EVP_PKEY_MO_SIGN 0x0001
@@ -298,6 +312,9 @@ typedef struct env_md_ctx_st
298#ifndef NO_MD5 312#ifndef NO_MD5
299 MD5_CTX md5; 313 MD5_CTX md5;
300#endif 314#endif
315#ifndef NO_MD4
316 MD4_CTX md4;
317#endif
301#ifndef NO_RIPEMD 318#ifndef NO_RIPEMD
302 RIPEMD160_CTX ripemd160; 319 RIPEMD160_CTX ripemd160;
303#endif 320#endif
@@ -310,21 +327,57 @@ typedef struct env_md_ctx_st
310 } md; 327 } md;
311 } EVP_MD_CTX; 328 } EVP_MD_CTX;
312 329
313typedef struct evp_cipher_st 330typedef struct evp_cipher_st EVP_CIPHER;
331typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
332
333struct evp_cipher_st
314 { 334 {
315 int nid; 335 int nid;
316 int block_size; 336 int block_size;
317 int key_len; 337 int key_len; /* Default value for variable length ciphers */
318 int iv_len; 338 int iv_len;
319 void (*init)(); /* init for encryption */ 339 unsigned long flags; /* Various flags */
320 void (*do_cipher)(); /* encrypt data */ 340 int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
321 void (*cleanup)(); /* used by cipher method */ 341 const unsigned char *iv, int enc); /* init key */
342 int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
343 const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */
344 int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */
322 int ctx_size; /* how big the ctx needs to be */ 345 int ctx_size; /* how big the ctx needs to be */
323 /* int set_asn1_parameters(EVP_CIPHER_CTX,ASN1_TYPE *); */ 346 int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */
324 int (*set_asn1_parameters)(); /* Populate a ASN1_TYPE with parameters */ 347 int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */
325 /* int get_asn1_parameters(EVP_CIPHER_CTX,ASN1_TYPE *); */ 348 int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */
326 int (*get_asn1_parameters)(); /* Get parameters from a ASN1_TYPE */ 349 void *app_data; /* Application data */
327 } EVP_CIPHER; 350 };
351
352/* Values for cipher flags */
353
354/* Modes for ciphers */
355
356#define EVP_CIPH_STREAM_CIPHER 0x0
357#define EVP_CIPH_ECB_MODE 0x1
358#define EVP_CIPH_CBC_MODE 0x2
359#define EVP_CIPH_CFB_MODE 0x3
360#define EVP_CIPH_OFB_MODE 0x4
361#define EVP_CIPH_MODE 0x7
362/* Set if variable length cipher */
363#define EVP_CIPH_VARIABLE_LENGTH 0x8
364/* Set if the iv handling should be done by the cipher itself */
365#define EVP_CIPH_CUSTOM_IV 0x10
366/* Set if the cipher's init() function should be called if key is NULL */
367#define EVP_CIPH_ALWAYS_CALL_INIT 0x20
368/* Call ctrl() to init cipher parameters */
369#define EVP_CIPH_CTRL_INIT 0x40
370/* Don't use standard key length function */
371#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
372
373/* ctrl() values */
374
375#define EVP_CTRL_INIT 0x0
376#define EVP_CTRL_SET_KEY_LENGTH 0x1
377#define EVP_CTRL_GET_RC2_KEY_BITS 0x2
378#define EVP_CTRL_SET_RC2_KEY_BITS 0x3
379#define EVP_CTRL_GET_RC5_ROUNDS 0x4
380#define EVP_CTRL_SET_RC5_ROUNDS 0x5
328 381
329typedef struct evp_cipher_info_st 382typedef struct evp_cipher_info_st
330 { 383 {
@@ -332,7 +385,7 @@ typedef struct evp_cipher_info_st
332 unsigned char iv[EVP_MAX_IV_LENGTH]; 385 unsigned char iv[EVP_MAX_IV_LENGTH];
333 } EVP_CIPHER_INFO; 386 } EVP_CIPHER_INFO;
334 387
335typedef struct evp_cipher_ctx_st 388struct evp_cipher_ctx_st
336 { 389 {
337 const EVP_CIPHER *cipher; 390 const EVP_CIPHER *cipher;
338 int encrypt; /* encrypt or decrypt */ 391 int encrypt; /* encrypt or decrypt */
@@ -343,7 +396,8 @@ typedef struct evp_cipher_ctx_st
343 unsigned char buf[EVP_MAX_IV_LENGTH]; /* saved partial block */ 396 unsigned char buf[EVP_MAX_IV_LENGTH]; /* saved partial block */
344 int num; /* used by cfb/ofb mode */ 397 int num; /* used by cfb/ofb mode */
345 398
346 char *app_data; /* application stuff */ 399 void *app_data; /* application stuff */
400 int key_len; /* May change for variable length cipher */
347 union { 401 union {
348#ifndef NO_RC4 402#ifndef NO_RC4
349 struct 403 struct
@@ -371,10 +425,16 @@ typedef struct evp_cipher_ctx_st
371 IDEA_KEY_SCHEDULE idea_ks;/* key schedule */ 425 IDEA_KEY_SCHEDULE idea_ks;/* key schedule */
372#endif 426#endif
373#ifndef NO_RC2 427#ifndef NO_RC2
374 RC2_KEY rc2_ks;/* key schedule */ 428 struct {
429 int key_bits; /* effective key bits */
430 RC2_KEY ks;/* key schedule */
431 } rc2;
375#endif 432#endif
376#ifndef NO_RC5 433#ifndef NO_RC5
377 RC5_32_KEY rc5_ks;/* key schedule */ 434 struct {
435 int rounds; /* number of rounds */
436 RC5_32_KEY ks;/* key schedule */
437 } rc5;
378#endif 438#endif
379#ifndef NO_BF 439#ifndef NO_BF
380 BF_KEY bf_ks;/* key schedule */ 440 BF_KEY bf_ks;/* key schedule */
@@ -383,7 +443,7 @@ typedef struct evp_cipher_ctx_st
383 CAST_KEY cast_ks;/* key schedule */ 443 CAST_KEY cast_ks;/* key schedule */
384#endif 444#endif
385 } c; 445 } c;
386 } EVP_CIPHER_CTX; 446 };
387 447
388typedef struct evp_Encode_Ctx_st 448typedef struct evp_Encode_Ctx_st
389 { 449 {
@@ -430,15 +490,19 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
430#define EVP_CIPHER_block_size(e) ((e)->block_size) 490#define EVP_CIPHER_block_size(e) ((e)->block_size)
431#define EVP_CIPHER_key_length(e) ((e)->key_len) 491#define EVP_CIPHER_key_length(e) ((e)->key_len)
432#define EVP_CIPHER_iv_length(e) ((e)->iv_len) 492#define EVP_CIPHER_iv_length(e) ((e)->iv_len)
493#define EVP_CIPHER_flags(e) ((e)->flags)
494#define EVP_CIPHER_mode(e) ((e)->flags) & EVP_CIPH_MODE)
433 495
434#define EVP_CIPHER_CTX_cipher(e) ((e)->cipher) 496#define EVP_CIPHER_CTX_cipher(e) ((e)->cipher)
435#define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid) 497#define EVP_CIPHER_CTX_nid(e) ((e)->cipher->nid)
436#define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size) 498#define EVP_CIPHER_CTX_block_size(e) ((e)->cipher->block_size)
437#define EVP_CIPHER_CTX_key_length(e) ((e)->cipher->key_len) 499#define EVP_CIPHER_CTX_key_length(e) ((e)->key_len)
438#define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len) 500#define EVP_CIPHER_CTX_iv_length(e) ((e)->cipher->iv_len)
439#define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) 501#define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data)
440#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) 502#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
441#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 503#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
504#define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags)
505#define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE)
442 506
443#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) 507#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
444#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80) 508#define EVP_DECODE_LENGTH(l) ((l+3)/4*3+80)
@@ -486,21 +550,21 @@ int EVP_BytesToKey(const EVP_CIPHER *type,EVP_MD *md,unsigned char *salt,
486 unsigned char *data, int datal, int count, 550 unsigned char *data, int datal, int count,
487 unsigned char *key,unsigned char *iv); 551 unsigned char *key,unsigned char *iv);
488 552
489void EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, 553int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
490 unsigned char *key, unsigned char *iv); 554 unsigned char *key, unsigned char *iv);
491void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 555int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
492 int *outl, unsigned char *in, int inl); 556 int *outl, unsigned char *in, int inl);
493void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); 557int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
494 558
495void EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, 559int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
496 unsigned char *key, unsigned char *iv); 560 unsigned char *key, unsigned char *iv);
497void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 561int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
498 int *outl, unsigned char *in, int inl); 562 int *outl, unsigned char *in, int inl);
499int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); 563int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
500 564
501void EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, 565int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
502 unsigned char *key,unsigned char *iv,int enc); 566 unsigned char *key,unsigned char *iv,int enc);
503void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, 567int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
504 int *outl, unsigned char *in, int inl); 568 int *outl, unsigned char *in, int inl);
505int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); 569int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
506 570
@@ -534,9 +598,11 @@ int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
534void ERR_load_EVP_strings(void ); 598void ERR_load_EVP_strings(void );
535 599
536void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); 600void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
537void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); 601int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
602int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
603int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
538 604
539#ifdef HEADER_BIO_H 605#ifndef NO_BIO
540BIO_METHOD *BIO_f_md(void); 606BIO_METHOD *BIO_f_md(void);
541BIO_METHOD *BIO_f_base64(void); 607BIO_METHOD *BIO_f_base64(void);
542BIO_METHOD *BIO_f_cipher(void); 608BIO_METHOD *BIO_f_cipher(void);
@@ -547,6 +613,7 @@ void BIO_set_cipher(BIO *b,const EVP_CIPHER *c,unsigned char *k,
547 613
548EVP_MD *EVP_md_null(void); 614EVP_MD *EVP_md_null(void);
549EVP_MD *EVP_md2(void); 615EVP_MD *EVP_md2(void);
616EVP_MD *EVP_md4(void);
550EVP_MD *EVP_md5(void); 617EVP_MD *EVP_md5(void);
551EVP_MD *EVP_sha(void); 618EVP_MD *EVP_sha(void);
552EVP_MD *EVP_sha1(void); 619EVP_MD *EVP_sha1(void);
@@ -683,6 +750,9 @@ void EVP_PBE_cleanup(void);
683 750
684/* Function codes. */ 751/* Function codes. */
685#define EVP_F_D2I_PKEY 100 752#define EVP_F_D2I_PKEY 100
753#define EVP_F_EVP_CIPHERINIT 123
754#define EVP_F_EVP_CIPHER_CTX_CTRL 124
755#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
686#define EVP_F_EVP_DECRYPTFINAL 101 756#define EVP_F_EVP_DECRYPTFINAL 101
687#define EVP_F_EVP_MD_CTX_COPY 110 757#define EVP_F_EVP_MD_CTX_COPY 110
688#define EVP_F_EVP_OPENINIT 102 758#define EVP_F_EVP_OPENINIT 102
@@ -703,12 +773,15 @@ void EVP_PBE_cleanup(void);
703#define EVP_F_PKCS5_PBE_KEYIVGEN 117 773#define EVP_F_PKCS5_PBE_KEYIVGEN 117
704#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 774#define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118
705#define EVP_F_RC2_MAGIC_TO_METH 109 775#define EVP_F_RC2_MAGIC_TO_METH 109
776#define EVP_F_RC5_CTRL 125
706 777
707/* Reason codes. */ 778/* Reason codes. */
708#define EVP_R_BAD_DECRYPT 100 779#define EVP_R_BAD_DECRYPT 100
709#define EVP_R_BN_DECODE_ERROR 112 780#define EVP_R_BN_DECODE_ERROR 112
710#define EVP_R_BN_PUBKEY_ERROR 113 781#define EVP_R_BN_PUBKEY_ERROR 113
711#define EVP_R_CIPHER_PARAMETER_ERROR 122 782#define EVP_R_CIPHER_PARAMETER_ERROR 122
783#define EVP_R_CTRL_NOT_IMPLEMENTED 132
784#define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED 133
712#define EVP_R_DECODE_ERROR 114 785#define EVP_R_DECODE_ERROR 114
713#define EVP_R_DIFFERENT_KEY_TYPES 101 786#define EVP_R_DIFFERENT_KEY_TYPES 101
714#define EVP_R_ENCODE_ERROR 115 787#define EVP_R_ENCODE_ERROR 115
@@ -716,16 +789,20 @@ void EVP_PBE_cleanup(void);
716#define EVP_R_EXPECTING_AN_RSA_KEY 127 789#define EVP_R_EXPECTING_AN_RSA_KEY 127
717#define EVP_R_EXPECTING_A_DH_KEY 128 790#define EVP_R_EXPECTING_A_DH_KEY 128
718#define EVP_R_EXPECTING_A_DSA_KEY 129 791#define EVP_R_EXPECTING_A_DSA_KEY 129
792#define EVP_R_INITIALIZATION_ERROR 134
719#define EVP_R_INPUT_NOT_INITIALIZED 111 793#define EVP_R_INPUT_NOT_INITIALIZED 111
794#define EVP_R_INVALID_KEY_LENGTH 130
720#define EVP_R_IV_TOO_LARGE 102 795#define EVP_R_IV_TOO_LARGE 102
721#define EVP_R_KEYGEN_FAILURE 120 796#define EVP_R_KEYGEN_FAILURE 120
722#define EVP_R_MISSING_PARAMETERS 103 797#define EVP_R_MISSING_PARAMETERS 103
798#define EVP_R_NO_CIPHER_SET 131
723#define EVP_R_NO_DSA_PARAMETERS 116 799#define EVP_R_NO_DSA_PARAMETERS 116
724#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104 800#define EVP_R_NO_SIGN_FUNCTION_CONFIGURED 104
725#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105 801#define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED 105
726#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117 802#define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE 117
727#define EVP_R_PUBLIC_KEY_NOT_RSA 106 803#define EVP_R_PUBLIC_KEY_NOT_RSA 106
728#define EVP_R_UNKNOWN_PBE_ALGORITHM 121 804#define EVP_R_UNKNOWN_PBE_ALGORITHM 121
805#define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS 135
729#define EVP_R_UNSUPPORTED_CIPHER 107 806#define EVP_R_UNSUPPORTED_CIPHER 107
730#define EVP_R_UNSUPPORTED_KEYLENGTH 123 807#define EVP_R_UNSUPPORTED_KEYLENGTH 123
731#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 808#define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index 5299a65b6a..e2687f9879 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -59,6 +59,8 @@
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/err.h>
63#include "evp_locl.h"
62 64
63const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT; 65const char *EVP_version="EVP" OPENSSL_VERSION_PTEXT;
64 66
@@ -68,55 +70,84 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx)
68 /* ctx->cipher=NULL; */ 70 /* ctx->cipher=NULL; */
69 } 71 }
70 72
71void EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *data, 73int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
72 unsigned char *key, unsigned char *iv, int enc) 74 unsigned char *key, unsigned char *iv, int enc)
73 { 75 {
74 if (enc) 76 if(enc && (enc != -1)) enc = 1;
75 EVP_EncryptInit(ctx,data,key,iv); 77 if (cipher) {
76 else 78 ctx->cipher=cipher;
77 EVP_DecryptInit(ctx,data,key,iv); 79 ctx->key_len = cipher->key_len;
80 if(ctx->cipher->flags & EVP_CIPH_CTRL_INIT) {
81 if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_INIT, 0, NULL)) {
82 EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_INITIALIZATION_ERROR);
83 return 0;
84 }
85 }
86 } else if(!ctx->cipher) {
87 EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_NO_CIPHER_SET);
88 return 0;
78 } 89 }
90 if(!(EVP_CIPHER_CTX_flags(ctx) & EVP_CIPH_CUSTOM_IV)) {
91 switch(EVP_CIPHER_CTX_mode(ctx)) {
92
93 case EVP_CIPH_STREAM_CIPHER:
94 case EVP_CIPH_ECB_MODE:
95 break;
96
97 case EVP_CIPH_CFB_MODE:
98 case EVP_CIPH_OFB_MODE:
79 99
80void EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 100 ctx->num = 0;
101
102 case EVP_CIPH_CBC_MODE:
103
104 if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx));
105 memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
106 break;
107
108 default:
109 return 0;
110 break;
111 }
112 }
113
114 if(key || (ctx->cipher->flags & EVP_CIPH_ALWAYS_CALL_INIT)) {
115 if(!ctx->cipher->init(ctx,key,iv,enc)) return 0;
116 }
117 if(enc != -1) ctx->encrypt=enc;
118 ctx->buf_len=0;
119 return 1;
120 }
121
122int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
81 unsigned char *in, int inl) 123 unsigned char *in, int inl)
82 { 124 {
83 if (ctx->encrypt) 125 if (ctx->encrypt)
84 EVP_EncryptUpdate(ctx,out,outl,in,inl); 126 return EVP_EncryptUpdate(ctx,out,outl,in,inl);
85 else EVP_DecryptUpdate(ctx,out,outl,in,inl); 127 else return EVP_DecryptUpdate(ctx,out,outl,in,inl);
86 } 128 }
87 129
88int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) 130int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
89 { 131 {
90 if (ctx->encrypt) 132 if (ctx->encrypt)
91 { 133 return EVP_EncryptFinal(ctx,out,outl);
92 EVP_EncryptFinal(ctx,out,outl);
93 return(1);
94 }
95 else return(EVP_DecryptFinal(ctx,out,outl)); 134 else return(EVP_DecryptFinal(ctx,out,outl));
96 } 135 }
97 136
98void EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, 137int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
99 unsigned char *key, unsigned char *iv) 138 unsigned char *key, unsigned char *iv)
100 { 139 {
101 if (cipher != NULL) 140 return EVP_CipherInit(ctx, cipher, key, iv, 1);
102 ctx->cipher=cipher;
103 ctx->cipher->init(ctx,key,iv,1);
104 ctx->encrypt=1;
105 ctx->buf_len=0;
106 } 141 }
107 142
108void EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, 143int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
109 unsigned char *key, unsigned char *iv) 144 unsigned char *key, unsigned char *iv)
110 { 145 {
111 if (cipher != NULL) 146 return EVP_CipherInit(ctx, cipher, key, iv, 0);
112 ctx->cipher=cipher;
113 ctx->cipher->init(ctx,key,iv,0);
114 ctx->encrypt=0;
115 ctx->buf_len=0;
116 } 147 }
117 148
118 149
119void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 150int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
120 unsigned char *in, int inl) 151 unsigned char *in, int inl)
121 { 152 {
122 int i,j,bl; 153 int i,j,bl;
@@ -124,20 +155,20 @@ void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
124 i=ctx->buf_len; 155 i=ctx->buf_len;
125 bl=ctx->cipher->block_size; 156 bl=ctx->cipher->block_size;
126 *outl=0; 157 *outl=0;
127 if ((inl == 0) && (i != bl)) return; 158 if ((inl == 0) && (i != bl)) return 1;
128 if (i != 0) 159 if (i != 0)
129 { 160 {
130 if (i+inl < bl) 161 if (i+inl < bl)
131 { 162 {
132 memcpy(&(ctx->buf[i]),in,inl); 163 memcpy(&(ctx->buf[i]),in,inl);
133 ctx->buf_len+=inl; 164 ctx->buf_len+=inl;
134 return; 165 return 1;
135 } 166 }
136 else 167 else
137 { 168 {
138 j=bl-i; 169 j=bl-i;
139 if (j != 0) memcpy(&(ctx->buf[i]),in,j); 170 if (j != 0) memcpy(&(ctx->buf[i]),in,j);
140 ctx->cipher->do_cipher(ctx,out,ctx->buf,bl); 171 if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0;
141 inl-=j; 172 inl-=j;
142 in+=j; 173 in+=j;
143 out+=bl; 174 out+=bl;
@@ -148,16 +179,17 @@ void EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
148 inl-=i; 179 inl-=i;
149 if (inl > 0) 180 if (inl > 0)
150 { 181 {
151 ctx->cipher->do_cipher(ctx,out,in,inl); 182 if(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0;
152 *outl+=inl; 183 *outl+=inl;
153 } 184 }
154 185
155 if (i != 0) 186 if (i != 0)
156 memcpy(ctx->buf,&(in[inl]),i); 187 memcpy(ctx->buf,&(in[inl]),i);
157 ctx->buf_len=i; 188 ctx->buf_len=i;
189 return 1;
158 } 190 }
159 191
160void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) 192int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
161 { 193 {
162 int i,n,b,bl; 194 int i,n,b,bl;
163 195
@@ -165,24 +197,25 @@ void EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
165 if (b == 1) 197 if (b == 1)
166 { 198 {
167 *outl=0; 199 *outl=0;
168 return; 200 return 1;
169 } 201 }
170 bl=ctx->buf_len; 202 bl=ctx->buf_len;
171 n=b-bl; 203 n=b-bl;
172 for (i=bl; i<b; i++) 204 for (i=bl; i<b; i++)
173 ctx->buf[i]=n; 205 ctx->buf[i]=n;
174 ctx->cipher->do_cipher(ctx,out,ctx->buf,b); 206 if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,b)) return 0;
175 *outl=b; 207 *outl=b;
208 return 1;
176 } 209 }
177 210
178void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, 211int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
179 unsigned char *in, int inl) 212 unsigned char *in, int inl)
180 { 213 {
181 int b,bl,n; 214 int b,bl,n;
182 int keep_last=0; 215 int keep_last=0;
183 216
184 *outl=0; 217 *outl=0;
185 if (inl == 0) return; 218 if (inl == 0) return 1;
186 219
187 b=ctx->cipher->block_size; 220 b=ctx->cipher->block_size;
188 if (b > 1) 221 if (b > 1)
@@ -197,13 +230,13 @@ void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
197 memcpy(&(ctx->buf[bl]),in,inl); 230 memcpy(&(ctx->buf[bl]),in,inl);
198 ctx->buf_len=b; 231 ctx->buf_len=b;
199 *outl=0; 232 *outl=0;
200 return; 233 return 1;
201 } 234 }
202 keep_last=1; 235 keep_last=1;
203 inl-=b; /* don't do the last block */ 236 inl-=b; /* don't do the last block */
204 } 237 }
205 } 238 }
206 EVP_EncryptUpdate(ctx,out,outl,in,inl); 239 if(!EVP_EncryptUpdate(ctx,out,outl,in,inl)) return 0;
207 240
208 /* if we have 'decrypted' a multiple of block size, make sure 241 /* if we have 'decrypted' a multiple of block size, make sure
209 * we have a copy of this last block */ 242 * we have a copy of this last block */
@@ -218,6 +251,7 @@ void EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
218#endif 251#endif
219 ctx->buf_len=b; 252 ctx->buf_len=b;
220 } 253 }
254 return 1;
221 } 255 }
222 256
223int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) 257int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
@@ -234,7 +268,7 @@ int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
234 EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_WRONG_FINAL_BLOCK_LENGTH); 268 EVPerr(EVP_F_EVP_DECRYPTFINAL,EVP_R_WRONG_FINAL_BLOCK_LENGTH);
235 return(0); 269 return(0);
236 } 270 }
237 EVP_EncryptUpdate(ctx,ctx->buf,&n,ctx->buf,0); 271 if(!EVP_EncryptUpdate(ctx,ctx->buf,&n,ctx->buf,0)) return 0;
238 if (n != b) 272 if (n != b)
239 return(0); 273 return(0);
240 n=ctx->buf[b-1]; 274 n=ctx->buf[b-1];
@@ -261,10 +295,47 @@ int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
261 return(1); 295 return(1);
262 } 296 }
263 297
264void EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) 298int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c)
265 { 299 {
266 if ((c->cipher != NULL) && (c->cipher->cleanup != NULL)) 300 if ((c->cipher != NULL) && (c->cipher->cleanup != NULL))
267 c->cipher->cleanup(c); 301 {
302 if(!c->cipher->cleanup(c)) return 0;
303 }
268 memset(c,0,sizeof(EVP_CIPHER_CTX)); 304 memset(c,0,sizeof(EVP_CIPHER_CTX));
305 return 1;
306 }
307
308int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
309 {
310 if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH)
311 return EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_KEY_LENGTH, keylen, NULL);
312 if(c->key_len == keylen) return 1;
313 if((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH))
314 {
315 c->key_len = keylen;
316 return 1;
317 }
318 EVPerr(EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,EVP_R_INVALID_KEY_LENGTH);
319 return 0;
320 }
321
322int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
323{
324 int ret;
325 if(!ctx->cipher) {
326 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_NO_CIPHER_SET);
327 return 0;
328 }
329
330 if(!ctx->cipher->ctrl) {
331 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_CTRL_NOT_IMPLEMENTED);
332 return 0;
269 } 333 }
270 334
335 ret = ctx->cipher->ctrl(ctx, type, arg, ptr);
336 if(ret == -1) {
337 EVPerr(EVP_F_EVP_CIPHER_CTX_CTRL, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED);
338 return 0;
339 }
340 return ret;
341}
diff --git a/src/lib/libcrypto/evp/evp_err.c b/src/lib/libcrypto/evp/evp_err.c
index fc149cbb1a..a01412a07c 100644
--- a/src/lib/libcrypto/evp/evp_err.c
+++ b/src/lib/libcrypto/evp/evp_err.c
@@ -67,6 +67,9 @@
67static ERR_STRING_DATA EVP_str_functs[]= 67static ERR_STRING_DATA EVP_str_functs[]=
68 { 68 {
69{ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"}, 69{ERR_PACK(0,EVP_F_D2I_PKEY,0), "D2I_PKEY"},
70{ERR_PACK(0,EVP_F_EVP_CIPHERINIT,0), "EVP_CipherInit"},
71{ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_CTRL,0), "EVP_CIPHER_CTX_ctrl"},
72{ERR_PACK(0,EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH,0), "EVP_CIPHER_CTX_set_key_length"},
70{ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"}, 73{ERR_PACK(0,EVP_F_EVP_DECRYPTFINAL,0), "EVP_DecryptFinal"},
71{ERR_PACK(0,EVP_F_EVP_MD_CTX_COPY,0), "EVP_MD_CTX_copy"}, 74{ERR_PACK(0,EVP_F_EVP_MD_CTX_COPY,0), "EVP_MD_CTX_copy"},
72{ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"}, 75{ERR_PACK(0,EVP_F_EVP_OPENINIT,0), "EVP_OpenInit"},
@@ -87,6 +90,7 @@ static ERR_STRING_DATA EVP_str_functs[]=
87{ERR_PACK(0,EVP_F_PKCS5_PBE_KEYIVGEN,0), "PKCS5_PBE_keyivgen"}, 90{ERR_PACK(0,EVP_F_PKCS5_PBE_KEYIVGEN,0), "PKCS5_PBE_keyivgen"},
88{ERR_PACK(0,EVP_F_PKCS5_V2_PBE_KEYIVGEN,0), "PKCS5_v2_PBE_keyivgen"}, 91{ERR_PACK(0,EVP_F_PKCS5_V2_PBE_KEYIVGEN,0), "PKCS5_v2_PBE_keyivgen"},
89{ERR_PACK(0,EVP_F_RC2_MAGIC_TO_METH,0), "RC2_MAGIC_TO_METH"}, 92{ERR_PACK(0,EVP_F_RC2_MAGIC_TO_METH,0), "RC2_MAGIC_TO_METH"},
93{ERR_PACK(0,EVP_F_RC5_CTRL,0), "RC5_CTRL"},
90{0,NULL} 94{0,NULL}
91 }; 95 };
92 96
@@ -96,6 +100,8 @@ static ERR_STRING_DATA EVP_str_reasons[]=
96{EVP_R_BN_DECODE_ERROR ,"bn decode error"}, 100{EVP_R_BN_DECODE_ERROR ,"bn decode error"},
97{EVP_R_BN_PUBKEY_ERROR ,"bn pubkey error"}, 101{EVP_R_BN_PUBKEY_ERROR ,"bn pubkey error"},
98{EVP_R_CIPHER_PARAMETER_ERROR ,"cipher parameter error"}, 102{EVP_R_CIPHER_PARAMETER_ERROR ,"cipher parameter error"},
103{EVP_R_CTRL_NOT_IMPLEMENTED ,"ctrl not implemented"},
104{EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED ,"ctrl operation not implemented"},
99{EVP_R_DECODE_ERROR ,"decode error"}, 105{EVP_R_DECODE_ERROR ,"decode error"},
100{EVP_R_DIFFERENT_KEY_TYPES ,"different key types"}, 106{EVP_R_DIFFERENT_KEY_TYPES ,"different key types"},
101{EVP_R_ENCODE_ERROR ,"encode error"}, 107{EVP_R_ENCODE_ERROR ,"encode error"},
@@ -103,16 +109,20 @@ static ERR_STRING_DATA EVP_str_reasons[]=
103{EVP_R_EXPECTING_AN_RSA_KEY ,"expecting an rsa key"}, 109{EVP_R_EXPECTING_AN_RSA_KEY ,"expecting an rsa key"},
104{EVP_R_EXPECTING_A_DH_KEY ,"expecting a dh key"}, 110{EVP_R_EXPECTING_A_DH_KEY ,"expecting a dh key"},
105{EVP_R_EXPECTING_A_DSA_KEY ,"expecting a dsa key"}, 111{EVP_R_EXPECTING_A_DSA_KEY ,"expecting a dsa key"},
112{EVP_R_INITIALIZATION_ERROR ,"initialization error"},
106{EVP_R_INPUT_NOT_INITIALIZED ,"input not initialized"}, 113{EVP_R_INPUT_NOT_INITIALIZED ,"input not initialized"},
114{EVP_R_INVALID_KEY_LENGTH ,"invalid key length"},
107{EVP_R_IV_TOO_LARGE ,"iv too large"}, 115{EVP_R_IV_TOO_LARGE ,"iv too large"},
108{EVP_R_KEYGEN_FAILURE ,"keygen failure"}, 116{EVP_R_KEYGEN_FAILURE ,"keygen failure"},
109{EVP_R_MISSING_PARAMETERS ,"missing parameters"}, 117{EVP_R_MISSING_PARAMETERS ,"missing parameters"},
118{EVP_R_NO_CIPHER_SET ,"no cipher set"},
110{EVP_R_NO_DSA_PARAMETERS ,"no dsa parameters"}, 119{EVP_R_NO_DSA_PARAMETERS ,"no dsa parameters"},
111{EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"}, 120{EVP_R_NO_SIGN_FUNCTION_CONFIGURED ,"no sign function configured"},
112{EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"}, 121{EVP_R_NO_VERIFY_FUNCTION_CONFIGURED ,"no verify function configured"},
113{EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE ,"pkcs8 unknown broken type"}, 122{EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE ,"pkcs8 unknown broken type"},
114{EVP_R_PUBLIC_KEY_NOT_RSA ,"public key not rsa"}, 123{EVP_R_PUBLIC_KEY_NOT_RSA ,"public key not rsa"},
115{EVP_R_UNKNOWN_PBE_ALGORITHM ,"unknown pbe algorithm"}, 124{EVP_R_UNKNOWN_PBE_ALGORITHM ,"unknown pbe algorithm"},
125{EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS ,"unsuported number of rounds"},
116{EVP_R_UNSUPPORTED_CIPHER ,"unsupported cipher"}, 126{EVP_R_UNSUPPORTED_CIPHER ,"unsupported cipher"},
117{EVP_R_UNSUPPORTED_KEYLENGTH ,"unsupported keylength"}, 127{EVP_R_UNSUPPORTED_KEYLENGTH ,"unsupported keylength"},
118{EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION,"unsupported key derivation function"}, 128{EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION,"unsupported key derivation function"},
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index 667c21cca8..09b72bf4bd 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -116,7 +116,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, EVP_MD *md, unsigned char *salt,
116 EVP_DigestUpdate(&c,&(md_buf[0]),mds); 116 EVP_DigestUpdate(&c,&(md_buf[0]),mds);
117 EVP_DigestUpdate(&c,data,datal); 117 EVP_DigestUpdate(&c,data,datal);
118 if (salt != NULL) 118 if (salt != NULL)
119 EVP_DigestUpdate(&c,salt,8); 119 EVP_DigestUpdate(&c,salt,PKCS5_SALT_LEN);
120 EVP_DigestFinal(&c,&(md_buf[0]),&mds); 120 EVP_DigestFinal(&c,&(md_buf[0]),&mds);
121 121
122 for (i=1; i<(unsigned int)count; i++) 122 for (i=1; i<(unsigned int)count; i++)
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h
new file mode 100644
index 0000000000..ce49d5b7d8
--- /dev/null
+++ b/src/lib/libcrypto/evp/evp_locl.h
@@ -0,0 +1,168 @@
1/* evp_locl.h */
2/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
3 * project 2000.
4 */
5/* ====================================================================
6 * Copyright (c) 1999 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59/* Macros to code block cipher wrappers */
60
61/* Wrapper functions for each cipher mode */
62
63#define BLOCK_CIPHER_ecb_loop() \
64 unsigned int i; \
65 if(inl < 8) return 1;\
66 inl -= 8; \
67 for(i=0; i <= inl; i+=8) \
68
69#define BLOCK_CIPHER_func_ecb(cname, cprefix, kname) \
70static int cname##_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \
71{\
72 BLOCK_CIPHER_ecb_loop() \
73 cprefix##_ecb_encrypt(in + i, out + i, &ctx->c.kname, ctx->encrypt);\
74 return 1;\
75}
76
77#define BLOCK_CIPHER_func_ofb(cname, cprefix, kname) \
78static int cname##_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \
79{\
80 cprefix##_ofb64_encrypt(in, out, (long)inl, &ctx->c.kname, ctx->iv, &ctx->num);\
81 return 1;\
82}
83
84#define BLOCK_CIPHER_func_cbc(cname, cprefix, kname) \
85static int cname##_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \
86{\
87 cprefix##_cbc_encrypt(in, out, (long)inl, &ctx->c.kname, ctx->iv, ctx->encrypt);\
88 return 1;\
89}
90
91#define BLOCK_CIPHER_func_cfb(cname, cprefix, kname) \
92static int cname##_cfb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) \
93{\
94 cprefix##_cfb64_encrypt(in, out, (long)inl, &ctx->c.kname, ctx->iv, &ctx->num, ctx->encrypt);\
95 return 1;\
96}
97
98#define BLOCK_CIPHER_all_funcs(cname, cprefix, kname) \
99 BLOCK_CIPHER_func_cbc(cname, cprefix, kname) \
100 BLOCK_CIPHER_func_cfb(cname, cprefix, kname) \
101 BLOCK_CIPHER_func_ecb(cname, cprefix, kname) \
102 BLOCK_CIPHER_func_ofb(cname, cprefix, kname)
103
104#define BLOCK_CIPHER_defs(cname, kstruct, \
105 nid, block_size, key_len, iv_len, flags,\
106 init_key, cleanup, set_asn1, get_asn1, ctrl)\
107static EVP_CIPHER cname##_cbc = {\
108 nid##_cbc, block_size, key_len, iv_len, \
109 flags | EVP_CIPH_CBC_MODE,\
110 init_key,\
111 cname##_cbc_cipher,\
112 cleanup,\
113 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
114 sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
115 set_asn1, get_asn1,\
116 ctrl, \
117 NULL \
118};\
119EVP_CIPHER *EVP_##cname##_cbc(void) { return &cname##_cbc; }\
120static EVP_CIPHER cname##_cfb = {\
121 nid##_cfb64, 1, key_len, iv_len, \
122 flags | EVP_CIPH_CFB_MODE,\
123 init_key,\
124 cname##_cfb_cipher,\
125 cleanup,\
126 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
127 sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
128 set_asn1, get_asn1,\
129 ctrl,\
130 NULL \
131};\
132EVP_CIPHER *EVP_##cname##_cfb(void) { return &cname##_cfb; }\
133static EVP_CIPHER cname##_ofb = {\
134 nid##_ofb64, 1, key_len, iv_len, \
135 flags | EVP_CIPH_OFB_MODE,\
136 init_key,\
137 cname##_ofb_cipher,\
138 cleanup,\
139 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
140 sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
141 set_asn1, get_asn1,\
142 ctrl,\
143 NULL \
144};\
145EVP_CIPHER *EVP_##cname##_ofb(void) { return &cname##_ofb; }\
146static EVP_CIPHER cname##_ecb = {\
147 nid##_ecb, block_size, key_len, iv_len, \
148 flags | EVP_CIPH_ECB_MODE,\
149 init_key,\
150 cname##_ecb_cipher,\
151 cleanup,\
152 sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+\
153 sizeof((((EVP_CIPHER_CTX *)NULL)->c.kstruct)),\
154 set_asn1, get_asn1,\
155 ctrl,\
156 NULL \
157};\
158EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; }
159
160
161
162#define IMPLEMENT_BLOCK_CIPHER(cname, kname, cprefix, kstruct, \
163 nid, block_size, key_len, iv_len, flags, \
164 init_key, cleanup, set_asn1, get_asn1, ctrl) \
165 BLOCK_CIPHER_all_funcs(cname, cprefix, kname) \
166 BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, flags,\
167 init_key, cleanup, set_asn1, get_asn1, ctrl)
168
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index 353c3ad667..224a422b12 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -92,7 +92,8 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
92 ERR_add_error_data(2, "TYPE=", obj_tmp); 92 ERR_add_error_data(2, "TYPE=", obj_tmp);
93 return 0; 93 return 0;
94 } 94 }
95 if (passlen == -1) passlen = strlen(pass); 95 if(!pass) passlen = 0;
96 else if (passlen == -1) passlen = strlen(pass);
96 pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i); 97 pbetmp = (EVP_PBE_CTL *)sk_value (pbe_algs, i);
97 i = (*pbetmp->keygen)(ctx, pass, passlen, param, pbetmp->cipher, 98 i = (*pbetmp->keygen)(ctx, pass, passlen, param, pbetmp->cipher,
98 pbetmp->md, en_de); 99 pbetmp->md, en_de);
@@ -103,8 +104,9 @@ int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
103 return 1; 104 return 1;
104} 105}
105 106
106static int pbe_cmp (EVP_PBE_CTL **pbe1, EVP_PBE_CTL **pbe2) 107static int pbe_cmp(const char * const *a, const char * const *b)
107{ 108{
109 EVP_PBE_CTL **pbe1 = (EVP_PBE_CTL **) a, **pbe2 = (EVP_PBE_CTL **)b;
108 return ((*pbe1)->pbe_nid - (*pbe2)->pbe_nid); 110 return ((*pbe1)->pbe_nid - (*pbe2)->pbe_nid);
109} 111}
110 112
@@ -114,8 +116,8 @@ int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md,
114 EVP_PBE_KEYGEN *keygen) 116 EVP_PBE_KEYGEN *keygen)
115{ 117{
116 EVP_PBE_CTL *pbe_tmp; 118 EVP_PBE_CTL *pbe_tmp;
117 if (!pbe_algs) pbe_algs = sk_new (pbe_cmp); 119 if (!pbe_algs) pbe_algs = sk_new(pbe_cmp);
118 if (!(pbe_tmp = (EVP_PBE_CTL*) Malloc (sizeof(EVP_PBE_CTL)))) { 120 if (!(pbe_tmp = (EVP_PBE_CTL*) OPENSSL_malloc (sizeof(EVP_PBE_CTL)))) {
119 EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE); 121 EVPerr(EVP_F_EVP_PBE_ALG_ADD,ERR_R_MALLOC_FAILURE);
120 return 0; 122 return 0;
121 } 123 }
@@ -129,6 +131,6 @@ int EVP_PBE_alg_add (int nid, EVP_CIPHER *cipher, EVP_MD *md,
129 131
130void EVP_PBE_cleanup(void) 132void EVP_PBE_cleanup(void)
131{ 133{
132 sk_pop_free(pbe_algs, FreeFunc); 134 sk_pop_free(pbe_algs, OPENSSL_freeFunc);
133 pbe_algs = NULL; 135 pbe_algs = NULL;
134} 136}
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c
index 4ab091fa56..8df2874f3c 100644
--- a/src/lib/libcrypto/evp/evp_pkey.c
+++ b/src/lib/libcrypto/evp/evp_pkey.c
@@ -76,7 +76,7 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
76 DSA *dsa = NULL; 76 DSA *dsa = NULL;
77 ASN1_INTEGER *privkey; 77 ASN1_INTEGER *privkey;
78 ASN1_TYPE *t1, *t2, *param = NULL; 78 ASN1_TYPE *t1, *t2, *param = NULL;
79 STACK *ndsa = NULL; 79 STACK_OF(ASN1_TYPE) *ndsa = NULL;
80 BN_CTX *ctx = NULL; 80 BN_CTX *ctx = NULL;
81 int plen; 81 int plen;
82#endif 82#endif
@@ -119,13 +119,13 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
119 119
120 /* Check for broken DSA PKCS#8, UGH! */ 120 /* Check for broken DSA PKCS#8, UGH! */
121 if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED)) { 121 if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED)) {
122 if(!(ndsa = ASN1_seq_unpack(p, pkeylen, 122 if(!(ndsa = ASN1_seq_unpack_ASN1_TYPE(p, pkeylen,
123 (char *(*)())d2i_ASN1_TYPE, 123 d2i_ASN1_TYPE,
124 ASN1_TYPE_free))) { 124 ASN1_TYPE_free))) {
125 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); 125 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
126 goto dsaerr; 126 goto dsaerr;
127 } 127 }
128 if(sk_num(ndsa) != 2 ) { 128 if(sk_ASN1_TYPE_num(ndsa) != 2 ) {
129 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR); 129 EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
130 goto dsaerr; 130 goto dsaerr;
131 } 131 }
@@ -134,8 +134,8 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
134 * SEQUENCE {pub_key, priv_key} 134 * SEQUENCE {pub_key, priv_key}
135 */ 135 */
136 136
137 t1 = (ASN1_TYPE *)sk_value(ndsa, 0); 137 t1 = sk_ASN1_TYPE_value(ndsa, 0);
138 t2 = (ASN1_TYPE *)sk_value(ndsa, 1); 138 t2 = sk_ASN1_TYPE_value(ndsa, 1);
139 if(t1->type == V_ASN1_SEQUENCE) { 139 if(t1->type == V_ASN1_SEQUENCE) {
140 p8->broken = PKCS8_EMBEDDED_PARAM; 140 p8->broken = PKCS8_EMBEDDED_PARAM;
141 param = t1; 141 param = t1;
@@ -193,12 +193,12 @@ EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
193 193
194 EVP_PKEY_assign_DSA(pkey, dsa); 194 EVP_PKEY_assign_DSA(pkey, dsa);
195 BN_CTX_free (ctx); 195 BN_CTX_free (ctx);
196 if(ndsa) sk_pop_free(ndsa, ASN1_TYPE_free); 196 if(ndsa) sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
197 else ASN1_INTEGER_free(privkey); 197 else ASN1_INTEGER_free(privkey);
198 break; 198 break;
199 dsaerr: 199 dsaerr:
200 BN_CTX_free (ctx); 200 BN_CTX_free (ctx);
201 sk_pop_free(ndsa, ASN1_TYPE_free); 201 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
202 DSA_free(dsa); 202 DSA_free(dsa);
203 EVP_PKEY_free(pkey); 203 EVP_PKEY_free(pkey);
204 return NULL; 204 return NULL;
@@ -302,12 +302,13 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
302 ASN1_STRING *params; 302 ASN1_STRING *params;
303 ASN1_INTEGER *prkey; 303 ASN1_INTEGER *prkey;
304 ASN1_TYPE *ttmp; 304 ASN1_TYPE *ttmp;
305 STACK *ndsa; 305 STACK_OF(ASN1_TYPE) *ndsa;
306 unsigned char *p, *q; 306 unsigned char *p, *q;
307 int len; 307 int len;
308
308 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa); 309 p8->pkeyalg->algorithm = OBJ_nid2obj(NID_dsa);
309 len = i2d_DSAparams (pkey->pkey.dsa, NULL); 310 len = i2d_DSAparams (pkey->pkey.dsa, NULL);
310 if (!(p = Malloc(len))) { 311 if (!(p = OPENSSL_malloc(len))) {
311 EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); 312 EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
312 PKCS8_PRIV_KEY_INFO_free (p8); 313 PKCS8_PRIV_KEY_INFO_free (p8);
313 return 0; 314 return 0;
@@ -316,7 +317,7 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
316 i2d_DSAparams (pkey->pkey.dsa, &q); 317 i2d_DSAparams (pkey->pkey.dsa, &q);
317 params = ASN1_STRING_new(); 318 params = ASN1_STRING_new();
318 ASN1_STRING_set(params, p, len); 319 ASN1_STRING_set(params, p, len);
319 Free(p); 320 OPENSSL_free(p);
320 /* Get private key into integer */ 321 /* Get private key into integer */
321 if (!(prkey = BN_to_ASN1_INTEGER (pkey->pkey.dsa->priv_key, NULL))) { 322 if (!(prkey = BN_to_ASN1_INTEGER (pkey->pkey.dsa->priv_key, NULL))) {
322 EVPerr(EVP_F_EVP_PKEY2PKCS8,EVP_R_ENCODE_ERROR); 323 EVPerr(EVP_F_EVP_PKEY2PKCS8,EVP_R_ENCODE_ERROR);
@@ -345,7 +346,7 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
345 346
346 p8->pkeyalg->parameter->value.sequence = params; 347 p8->pkeyalg->parameter->value.sequence = params;
347 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE; 348 p8->pkeyalg->parameter->type = V_ASN1_SEQUENCE;
348 ndsa = sk_new_null(); 349 ndsa = sk_ASN1_TYPE_new_null();
349 ttmp = ASN1_TYPE_new(); 350 ttmp = ASN1_TYPE_new();
350 if (!(ttmp->value.integer = BN_to_ASN1_INTEGER (pkey->pkey.dsa->pub_key, NULL))) { 351 if (!(ttmp->value.integer = BN_to_ASN1_INTEGER (pkey->pkey.dsa->pub_key, NULL))) {
351 EVPerr(EVP_F_EVP_PKEY2PKCS8,EVP_R_ENCODE_ERROR); 352 EVPerr(EVP_F_EVP_PKEY2PKCS8,EVP_R_ENCODE_ERROR);
@@ -353,53 +354,53 @@ static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8, EVP_PKEY *pkey)
353 return 0; 354 return 0;
354 } 355 }
355 ttmp->type = V_ASN1_INTEGER; 356 ttmp->type = V_ASN1_INTEGER;
356 sk_push(ndsa, (char *)ttmp); 357 sk_ASN1_TYPE_push(ndsa, ttmp);
357 358
358 ttmp = ASN1_TYPE_new(); 359 ttmp = ASN1_TYPE_new();
359 ttmp->value.integer = prkey; 360 ttmp->value.integer = prkey;
360 ttmp->type = V_ASN1_INTEGER; 361 ttmp->type = V_ASN1_INTEGER;
361 sk_push(ndsa, (char *)ttmp); 362 sk_ASN1_TYPE_push(ndsa, ttmp);
362 363
363 p8->pkey->value.octet_string = ASN1_OCTET_STRING_new(); 364 p8->pkey->value.octet_string = ASN1_OCTET_STRING_new();
364 365
365 if (!ASN1_seq_pack(ndsa, i2d_ASN1_TYPE, 366 if (!ASN1_seq_pack_ASN1_TYPE(ndsa, i2d_ASN1_TYPE,
366 &p8->pkey->value.octet_string->data, 367 &p8->pkey->value.octet_string->data,
367 &p8->pkey->value.octet_string->length)) { 368 &p8->pkey->value.octet_string->length)) {
368 369
369 EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); 370 EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
370 sk_pop_free(ndsa, ASN1_TYPE_free); 371 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
371 M_ASN1_INTEGER_free(prkey); 372 M_ASN1_INTEGER_free(prkey);
372 return 0; 373 return 0;
373 } 374 }
374 sk_pop_free(ndsa, ASN1_TYPE_free); 375 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
375 break; 376 break;
376 377
377 case PKCS8_EMBEDDED_PARAM: 378 case PKCS8_EMBEDDED_PARAM:
378 379
379 p8->pkeyalg->parameter->type = V_ASN1_NULL; 380 p8->pkeyalg->parameter->type = V_ASN1_NULL;
380 ndsa = sk_new_null(); 381 ndsa = sk_ASN1_TYPE_new_null();
381 ttmp = ASN1_TYPE_new(); 382 ttmp = ASN1_TYPE_new();
382 ttmp->value.sequence = params; 383 ttmp->value.sequence = params;
383 ttmp->type = V_ASN1_SEQUENCE; 384 ttmp->type = V_ASN1_SEQUENCE;
384 sk_push(ndsa, (char *)ttmp); 385 sk_ASN1_TYPE_push(ndsa, ttmp);
385 386
386 ttmp = ASN1_TYPE_new(); 387 ttmp = ASN1_TYPE_new();
387 ttmp->value.integer = prkey; 388 ttmp->value.integer = prkey;
388 ttmp->type = V_ASN1_INTEGER; 389 ttmp->type = V_ASN1_INTEGER;
389 sk_push(ndsa, (char *)ttmp); 390 sk_ASN1_TYPE_push(ndsa, ttmp);
390 391
391 p8->pkey->value.octet_string = ASN1_OCTET_STRING_new(); 392 p8->pkey->value.octet_string = ASN1_OCTET_STRING_new();
392 393
393 if (!ASN1_seq_pack(ndsa, i2d_ASN1_TYPE, 394 if (!ASN1_seq_pack_ASN1_TYPE(ndsa, i2d_ASN1_TYPE,
394 &p8->pkey->value.octet_string->data, 395 &p8->pkey->value.octet_string->data,
395 &p8->pkey->value.octet_string->length)) { 396 &p8->pkey->value.octet_string->length)) {
396 397
397 EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE); 398 EVPerr(EVP_F_EVP_PKEY2PKCS8,ERR_R_MALLOC_FAILURE);
398 sk_pop_free(ndsa, ASN1_TYPE_free); 399 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
399 M_ASN1_INTEGER_free (prkey); 400 M_ASN1_INTEGER_free (prkey);
400 return 0; 401 return 0;
401 } 402 }
402 sk_pop_free(ndsa, ASN1_TYPE_free); 403 sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free);
403 break; 404 break;
404 } 405 }
405 return 1; 406 return 1;
diff --git a/src/lib/libcrypto/evp/m_md4.c b/src/lib/libcrypto/evp/m_md4.c
new file mode 100644
index 0000000000..6a24ceb86d
--- /dev/null
+++ b/src/lib/libcrypto/evp/m_md4.c
@@ -0,0 +1,83 @@
1/* crypto/evp/m_md4.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef NO_MD4
60#include <stdio.h>
61#include "cryptlib.h"
62#include <openssl/evp.h>
63#include <openssl/objects.h>
64#include <openssl/x509.h>
65
66static EVP_MD md4_md=
67 {
68 NID_md4,
69 0,
70 MD4_DIGEST_LENGTH,
71 MD4_Init,
72 MD4_Update,
73 MD4_Final,
74 EVP_PKEY_RSA_method,
75 MD4_CBLOCK,
76 sizeof(EVP_MD *)+sizeof(MD4_CTX),
77 };
78
79EVP_MD *EVP_md4(void)
80 {
81 return(&md4_md);
82 }
83#endif
diff --git a/src/lib/libcrypto/evp/p5_crpt.c b/src/lib/libcrypto/evp/p5_crpt.c
index e3dae52d4d..6bfa2c5acb 100644
--- a/src/lib/libcrypto/evp/p5_crpt.c
+++ b/src/lib/libcrypto/evp/p5_crpt.c
@@ -125,6 +125,9 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen,
125 salt = pbe->salt->data; 125 salt = pbe->salt->data;
126 saltlen = pbe->salt->length; 126 saltlen = pbe->salt->length;
127 127
128 if(!pass) passlen = 0;
129 else if(passlen == -1) passlen = strlen(pass);
130
128 EVP_DigestInit (&ctx, md); 131 EVP_DigestInit (&ctx, md);
129 EVP_DigestUpdate (&ctx, pass, passlen); 132 EVP_DigestUpdate (&ctx, pass, passlen);
130 EVP_DigestUpdate (&ctx, salt, saltlen); 133 EVP_DigestUpdate (&ctx, salt, saltlen);
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c
index 27a2c518be..717fad68ca 100644
--- a/src/lib/libcrypto/evp/p5_crpt2.c
+++ b/src/lib/libcrypto/evp/p5_crpt2.c
@@ -86,7 +86,8 @@ int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
86 HMAC_CTX hctx; 86 HMAC_CTX hctx;
87 p = out; 87 p = out;
88 tkeylen = keylen; 88 tkeylen = keylen;
89 if(passlen == -1) passlen = strlen(pass); 89 if(!pass) passlen = 0;
90 else if(passlen == -1) passlen = strlen(pass);
90 while(tkeylen) { 91 while(tkeylen) {
91 if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH; 92 if(tkeylen > SHA_DIGEST_LENGTH) cplen = SHA_DIGEST_LENGTH;
92 else cplen = tkeylen; 93 else cplen = tkeylen;
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c
index 4cb387f8de..62398ed74d 100644
--- a/src/lib/libcrypto/evp/p_lib.c
+++ b/src/lib/libcrypto/evp/p_lib.c
@@ -180,7 +180,7 @@ EVP_PKEY *EVP_PKEY_new(void)
180 { 180 {
181 EVP_PKEY *ret; 181 EVP_PKEY *ret;
182 182
183 ret=(EVP_PKEY *)Malloc(sizeof(EVP_PKEY)); 183 ret=(EVP_PKEY *)OPENSSL_malloc(sizeof(EVP_PKEY));
184 if (ret == NULL) 184 if (ret == NULL)
185 { 185 {
186 EVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE); 186 EVPerr(EVP_F_EVP_PKEY_NEW,ERR_R_MALLOC_FAILURE);
@@ -302,7 +302,7 @@ void EVP_PKEY_free(EVP_PKEY *x)
302 } 302 }
303#endif 303#endif
304 EVP_PKEY_free_it(x); 304 EVP_PKEY_free_it(x);
305 Free(x); 305 OPENSSL_free(x);
306 } 306 }
307 307
308static void EVP_PKEY_free_it(EVP_PKEY *x) 308static void EVP_PKEY_free_it(EVP_PKEY *x)
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c
index b9ca7892c2..2760c00fec 100644
--- a/src/lib/libcrypto/evp/p_open.c
+++ b/src/lib/libcrypto/evp/p_open.c
@@ -68,37 +68,41 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek,
68 { 68 {
69 unsigned char *key=NULL; 69 unsigned char *key=NULL;
70 int i,size=0,ret=0; 70 int i,size=0,ret=0;
71 71
72 if(type) {
73 EVP_CIPHER_CTX_init(ctx);
74 if(!EVP_DecryptInit(ctx,type,NULL,NULL)) return 0;
75 }
76
77 if(!priv) return 1;
78
72 if (priv->type != EVP_PKEY_RSA) 79 if (priv->type != EVP_PKEY_RSA)
73 { 80 {
74 EVPerr(EVP_F_EVP_OPENINIT,EVP_R_PUBLIC_KEY_NOT_RSA); 81 EVPerr(EVP_F_EVP_OPENINIT,EVP_R_PUBLIC_KEY_NOT_RSA);
75 ret= -1;
76 goto err; 82 goto err;
77 } 83 }
78 84
79 size=RSA_size(priv->pkey.rsa); 85 size=RSA_size(priv->pkey.rsa);
80 key=(unsigned char *)Malloc(size+2); 86 key=(unsigned char *)OPENSSL_malloc(size+2);
81 if (key == NULL) 87 if (key == NULL)
82 { 88 {
83 /* ERROR */ 89 /* ERROR */
84 EVPerr(EVP_F_EVP_OPENINIT,ERR_R_MALLOC_FAILURE); 90 EVPerr(EVP_F_EVP_OPENINIT,ERR_R_MALLOC_FAILURE);
85 ret= -1;
86 goto err; 91 goto err;
87 } 92 }
88 93
89 i=EVP_PKEY_decrypt(key,ek,ekl,priv); 94 i=EVP_PKEY_decrypt(key,ek,ekl,priv);
90 if (i != type->key_len) 95 if ((i <= 0) || !EVP_CIPHER_CTX_set_key_length(ctx, i))
91 { 96 {
92 /* ERROR */ 97 /* ERROR */
93 goto err; 98 goto err;
94 } 99 }
100 if(!EVP_DecryptInit(ctx,NULL,key,iv)) goto err;
95 101
96 EVP_CIPHER_CTX_init(ctx);
97 EVP_DecryptInit(ctx,type,key,iv);
98 ret=1; 102 ret=1;
99err: 103err:
100 if (key != NULL) memset(key,0,size); 104 if (key != NULL) memset(key,0,size);
101 Free(key); 105 OPENSSL_free(key);
102 return(ret); 106 return(ret);
103 } 107 }
104 108
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c
index d449e892bf..2fd1d7e0c2 100644
--- a/src/lib/libcrypto/evp/p_seal.c
+++ b/src/lib/libcrypto/evp/p_seal.c
@@ -72,18 +72,21 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char **ek,
72 unsigned char key[EVP_MAX_KEY_LENGTH]; 72 unsigned char key[EVP_MAX_KEY_LENGTH];
73 int i; 73 int i;
74 74
75 if(type) {
76 EVP_CIPHER_CTX_init(ctx);
77 if(!EVP_EncryptInit(ctx,type,NULL,NULL)) return 0;
78 }
75 if (npubk <= 0) return(0); 79 if (npubk <= 0) return(0);
76 if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0) 80 if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0)
77 return(0); 81 return(0);
78 if (type->iv_len > 0) 82 if (EVP_CIPHER_CTX_iv_length(ctx))
79 RAND_pseudo_bytes(iv,type->iv_len); 83 RAND_pseudo_bytes(iv,EVP_CIPHER_CTX_iv_length(ctx));
80 84
81 EVP_CIPHER_CTX_init(ctx); 85 if(!EVP_EncryptInit(ctx,NULL,key,iv)) return 0;
82 EVP_EncryptInit(ctx,type,key,iv);
83 86
84 for (i=0; i<npubk; i++) 87 for (i=0; i<npubk; i++)
85 { 88 {
86 ekl[i]=EVP_PKEY_encrypt(ek[i],key,EVP_CIPHER_key_length(type), 89 ekl[i]=EVP_PKEY_encrypt(ek[i],key,EVP_CIPHER_CTX_key_length(ctx),
87 pubk[i]); 90 pubk[i]);
88 if (ekl[i] <= 0) return(-1); 91 if (ekl[i] <= 0) return(-1);
89 } 92 }
diff --git a/src/lib/libcrypto/ex_data.c b/src/lib/libcrypto/ex_data.c
index a057dd3b68..1ee88da2a8 100644
--- a/src/lib/libcrypto/ex_data.c
+++ b/src/lib/libcrypto/ex_data.c
@@ -77,7 +77,7 @@ int CRYPTO_get_ex_new_index(int idx, STACK_OF(CRYPTO_EX_DATA_FUNCS) **skp, long
77 CRYPTOerr(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,ERR_R_MALLOC_FAILURE); 77 CRYPTOerr(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,ERR_R_MALLOC_FAILURE);
78 goto err; 78 goto err;
79 } 79 }
80 a=(CRYPTO_EX_DATA_FUNCS *)Malloc(sizeof(CRYPTO_EX_DATA_FUNCS)); 80 a=(CRYPTO_EX_DATA_FUNCS *)OPENSSL_malloc(sizeof(CRYPTO_EX_DATA_FUNCS));
81 if (a == NULL) 81 if (a == NULL)
82 { 82 {
83 CRYPTOerr(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,ERR_R_MALLOC_FAILURE); 83 CRYPTOerr(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,ERR_R_MALLOC_FAILURE);
@@ -93,7 +93,7 @@ int CRYPTO_get_ex_new_index(int idx, STACK_OF(CRYPTO_EX_DATA_FUNCS) **skp, long
93 if (!sk_CRYPTO_EX_DATA_FUNCS_push(*skp,NULL)) 93 if (!sk_CRYPTO_EX_DATA_FUNCS_push(*skp,NULL))
94 { 94 {
95 CRYPTOerr(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,ERR_R_MALLOC_FAILURE); 95 CRYPTOerr(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX,ERR_R_MALLOC_FAILURE);
96 Free(a); 96 OPENSSL_free(a);
97 goto err; 97 goto err;
98 } 98 }
99 } 99 }
diff --git a/src/lib/libcrypto/hmac/Makefile.ssl b/src/lib/libcrypto/hmac/Makefile.ssl
index 04b1b9be98..cf57311973 100644
--- a/src/lib/libcrypto/hmac/Makefile.ssl
+++ b/src/lib/libcrypto/hmac/Makefile.ssl
@@ -85,10 +85,11 @@ hmac.o: ../../include/openssl/des.h ../../include/openssl/dh.h
85hmac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 85hmac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
86hmac.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h 86hmac.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h
87hmac.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 87hmac.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
88hmac.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 88hmac.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
89hmac.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
89hmac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 90hmac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
90hmac.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h 91hmac.o: ../../include/openssl/opensslv.h ../../include/openssl/rc2.h
91hmac.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 92hmac.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
92hmac.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 93hmac.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
93hmac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 94hmac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
94hmac.o: ../../include/openssl/stack.h 95hmac.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
diff --git a/src/lib/libcrypto/hmac/hmac.h b/src/lib/libcrypto/hmac/hmac.h
index 223eeda7f3..328bad2608 100644
--- a/src/lib/libcrypto/hmac/hmac.h
+++ b/src/lib/libcrypto/hmac/hmac.h
@@ -58,10 +58,6 @@
58#ifndef HEADER_HMAC_H 58#ifndef HEADER_HMAC_H
59#define HEADER_HMAC_H 59#define HEADER_HMAC_H
60 60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65#ifdef NO_HMAC 61#ifdef NO_HMAC
66#error HMAC is disabled. 62#error HMAC is disabled.
67#endif 63#endif
@@ -70,6 +66,10 @@ extern "C" {
70 66
71#define HMAC_MAX_MD_CBLOCK 64 67#define HMAC_MAX_MD_CBLOCK 64
72 68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
73typedef struct hmac_ctx_st 73typedef struct hmac_ctx_st
74 { 74 {
75 const EVP_MD *md; 75 const EVP_MD *md;
diff --git a/src/lib/libcrypto/idea/idea.h b/src/lib/libcrypto/idea/idea.h
index ae32f5692e..f14adf8398 100644
--- a/src/lib/libcrypto/idea/idea.h
+++ b/src/lib/libcrypto/idea/idea.h
@@ -59,10 +59,6 @@
59#ifndef HEADER_IDEA_H 59#ifndef HEADER_IDEA_H
60#define HEADER_IDEA_H 60#define HEADER_IDEA_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_IDEA 62#ifdef NO_IDEA
67#error IDEA is disabled. 63#error IDEA is disabled.
68#endif 64#endif
@@ -74,22 +70,26 @@ extern "C" {
74#define IDEA_BLOCK 8 70#define IDEA_BLOCK 8
75#define IDEA_KEY_LENGTH 16 71#define IDEA_KEY_LENGTH 16
76 72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77typedef struct idea_key_st 77typedef struct idea_key_st
78 { 78 {
79 IDEA_INT data[9][6]; 79 IDEA_INT data[9][6];
80 } IDEA_KEY_SCHEDULE; 80 } IDEA_KEY_SCHEDULE;
81 81
82const char *idea_options(void); 82const char *idea_options(void);
83void idea_ecb_encrypt(unsigned char *in, unsigned char *out, 83void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
84 IDEA_KEY_SCHEDULE *ks); 84 IDEA_KEY_SCHEDULE *ks);
85void idea_set_encrypt_key(unsigned char *key, IDEA_KEY_SCHEDULE *ks); 85void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
86void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 86void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
87void idea_cbc_encrypt(unsigned char *in, unsigned char *out, 87void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
88 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc); 88 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,int enc);
89void idea_cfb64_encrypt(unsigned char *in, unsigned char *out, 89void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
90 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 90 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
91 int *num,int enc); 91 int *num,int enc);
92void idea_ofb64_encrypt(unsigned char *in, unsigned char *out, 92void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
93 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num); 93 long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
94void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 94void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
95#ifdef __cplusplus 95#ifdef __cplusplus
diff --git a/src/lib/libcrypto/install.com b/src/lib/libcrypto/install.com
index 44cfc4e89a..ea97665471 100644
--- a/src/lib/libcrypto/install.com
+++ b/src/lib/libcrypto/install.com
@@ -32,14 +32,14 @@ $ IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN -
32$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN - 32$ IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
33 CREATE/DIR/LOG WRK_SSLINCLUDE: 33 CREATE/DIR/LOG WRK_SSLINCLUDE:
34$ 34$
35$ SDIRS := ,MD2,MD5,SHA,MDC2,HMAC,RIPEMD,- 35$ SDIRS := ,MD2,MD4,MD5,SHA,MDC2,HMAC,RIPEMD,-
36 DES,RC2,RC4,RC5,IDEA,BF,CAST,- 36 DES,RC2,RC4,RC5,IDEA,BF,CAST,-
37 BN,RSA,DSA,DH,- 37 BN,RSA,DSA,DH,DSO,ENGINE,-
38 BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,- 38 BUFFER,BIO,STACK,LHASH,RAND,ERR,OBJECTS,-
39 EVP,ASN1,PEM,X509,X509V3,- 39 EVP,ASN1,PEM,X509,X509V3,CONF,TXT_DB,PKCS7,PKCS12,COMP
40 CONF,TXT_DB,PKCS7,PKCS12,COMP 40$ EXHEADER_ := crypto.h,tmdiff.h,opensslv.h,opensslconf.h,ebcdic.h,symhacks.h
41$ EXHEADER_ := crypto.h,tmdiff.h,opensslv.h,opensslconf.h,ebcdic.h
42$ EXHEADER_MD2 := md2.h 41$ EXHEADER_MD2 := md2.h
42$ EXHEADER_MD4 := md4.h
43$ EXHEADER_MD5 := md5.h 43$ EXHEADER_MD5 := md5.h
44$ EXHEADER_SHA := sha.h 44$ EXHEADER_SHA := sha.h
45$ EXHEADER_MDC2 := mdc2.h 45$ EXHEADER_MDC2 := mdc2.h
@@ -56,19 +56,21 @@ $ EXHEADER_BN := bn.h
56$ EXHEADER_RSA := rsa.h 56$ EXHEADER_RSA := rsa.h
57$ EXHEADER_DSA := dsa.h 57$ EXHEADER_DSA := dsa.h
58$ EXHEADER_DH := dh.h 58$ EXHEADER_DH := dh.h
59$ EXHEADER_DSO := dso.h
60$ EXHEADER_ENGINE := engine.h
59$ EXHEADER_BUFFER := buffer.h 61$ EXHEADER_BUFFER := buffer.h
60$ EXHEADER_BIO := bio.h 62$ EXHEADER_BIO := bio.h
61$ EXHEADER_STACK := stack.h,safestack.h 63$ EXHEADER_STACK := stack.h,safestack.h
62$ EXHEADER_LHASH := lhash.h 64$ EXHEADER_LHASH := lhash.h
63$ EXHEADER_RAND := rand.h 65$ EXHEADER_RAND := rand.h
64$ EXHEADER_ERR := err.h 66$ EXHEADER_ERR := err.h
65$ EXHEADER_OBJECTS := objects.h 67$ EXHEADER_OBJECTS := objects.h,obj_mac.h
66$ EXHEADER_EVP := evp.h 68$ EXHEADER_EVP := evp.h
67$ EXHEADER_ASN1 := asn1.h,asn1_mac.h 69$ EXHEADER_ASN1 := asn1.h,asn1_mac.h
68$ EXHEADER_PEM := pem.h,pem2.h 70$ EXHEADER_PEM := pem.h,pem2.h
69$ EXHEADER_X509 := x509.h,x509_vfy.h 71$ EXHEADER_X509 := x509.h,x509_vfy.h
70$ EXHEADER_X509V3 := x509v3.h 72$ EXHEADER_X509V3 := x509v3.h
71$ EXHEADER_CONF := conf.h 73$ EXHEADER_CONF := conf.h,conf_api.h
72$ EXHEADER_TXT_DB := txt_db.h 74$ EXHEADER_TXT_DB := txt_db.h
73$ EXHEADER_PKCS7 := pkcs7.h 75$ EXHEADER_PKCS7 := pkcs7.h
74$ EXHEADER_PKCS12 := pkcs12.h 76$ EXHEADER_PKCS12 := pkcs12.h
diff --git a/src/lib/libcrypto/lhash/Makefile.ssl b/src/lib/libcrypto/lhash/Makefile.ssl
index eef4000460..6c3d442e22 100644
--- a/src/lib/libcrypto/lhash/Makefile.ssl
+++ b/src/lib/libcrypto/lhash/Makefile.ssl
@@ -83,7 +83,9 @@ lh_stats.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
83lh_stats.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 83lh_stats.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
84lh_stats.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 84lh_stats.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
85lh_stats.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 85lh_stats.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
86lh_stats.o: ../../include/openssl/stack.h ../cryptlib.h 86lh_stats.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
87lhash.o: ../../include/openssl/crypto.h ../../include/openssl/lhash.h 87lh_stats.o: ../cryptlib.h
88lhash.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 88lhash.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
89lhash.o: ../../include/openssl/stack.h 89lhash.o: ../../include/openssl/lhash.h ../../include/openssl/opensslv.h
90lhash.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
91lhash.o: ../../include/openssl/symhacks.h
diff --git a/src/lib/libcrypto/lhash/lh_stats.c b/src/lib/libcrypto/lhash/lh_stats.c
index 80b931c12b..ee0600060e 100644
--- a/src/lib/libcrypto/lhash/lh_stats.c
+++ b/src/lib/libcrypto/lhash/lh_stats.c
@@ -63,9 +63,12 @@
63 * and things should work as expected */ 63 * and things should work as expected */
64#include "cryptlib.h" 64#include "cryptlib.h"
65 65
66#ifndef NO_BIO
67#include <openssl/bio.h>
68#endif
66#include <openssl/lhash.h> 69#include <openssl/lhash.h>
67 70
68#ifndef HEADER_BIO_H 71#ifdef NO_BIO
69 72
70void lh_stats(LHASH *lh, FILE *out) 73void lh_stats(LHASH *lh, FILE *out)
71 { 74 {
diff --git a/src/lib/libcrypto/lhash/lh_test.c b/src/lib/libcrypto/lhash/lh_test.c
index 08138b52c3..6008781e57 100644
--- a/src/lib/libcrypto/lhash/lh_test.c
+++ b/src/lib/libcrypto/lhash/lh_test.c
@@ -77,7 +77,7 @@ main()
77 if (buf[0] == '\0') break; 77 if (buf[0] == '\0') break;
78 buf[256]='\0'; 78 buf[256]='\0';
79 i=strlen(buf); 79 i=strlen(buf);
80 p=Malloc(i+1); 80 p=OPENSSL_malloc(i+1);
81 memcpy(p,buf,i+1); 81 memcpy(p,buf,i+1);
82 lh_insert(conf,p); 82 lh_insert(conf,p);
83 } 83 }
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c
index 7eb92a18bc..7da14620a4 100644
--- a/src/lib/libcrypto/lhash/lhash.c
+++ b/src/lib/libcrypto/lhash/lhash.c
@@ -116,9 +116,9 @@ LHASH *lh_new(unsigned long (*h)(), int (*c)())
116 LHASH *ret; 116 LHASH *ret;
117 int i; 117 int i;
118 118
119 if ((ret=(LHASH *)Malloc(sizeof(LHASH))) == NULL) 119 if ((ret=(LHASH *)OPENSSL_malloc(sizeof(LHASH))) == NULL)
120 goto err0; 120 goto err0;
121 if ((ret->b=(LHASH_NODE **)Malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL) 121 if ((ret->b=(LHASH_NODE **)OPENSSL_malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL)
122 goto err1; 122 goto err1;
123 for (i=0; i<MIN_NODES; i++) 123 for (i=0; i<MIN_NODES; i++)
124 ret->b[i]=NULL; 124 ret->b[i]=NULL;
@@ -149,7 +149,7 @@ LHASH *lh_new(unsigned long (*h)(), int (*c)())
149 ret->error=0; 149 ret->error=0;
150 return(ret); 150 return(ret);
151err1: 151err1:
152 Free(ret); 152 OPENSSL_free(ret);
153err0: 153err0:
154 return(NULL); 154 return(NULL);
155 } 155 }
@@ -168,12 +168,12 @@ void lh_free(LHASH *lh)
168 while (n != NULL) 168 while (n != NULL)
169 { 169 {
170 nn=n->next; 170 nn=n->next;
171 Free(n); 171 OPENSSL_free(n);
172 n=nn; 172 n=nn;
173 } 173 }
174 } 174 }
175 Free(lh->b); 175 OPENSSL_free(lh->b);
176 Free(lh); 176 OPENSSL_free(lh);
177 } 177 }
178 178
179void *lh_insert(LHASH *lh, void *data) 179void *lh_insert(LHASH *lh, void *data)
@@ -190,7 +190,7 @@ void *lh_insert(LHASH *lh, void *data)
190 190
191 if (*rn == NULL) 191 if (*rn == NULL)
192 { 192 {
193 if ((nn=(LHASH_NODE *)Malloc(sizeof(LHASH_NODE))) == NULL) 193 if ((nn=(LHASH_NODE *)OPENSSL_malloc(sizeof(LHASH_NODE))) == NULL)
194 { 194 {
195 lh->error++; 195 lh->error++;
196 return(NULL); 196 return(NULL);
@@ -233,7 +233,7 @@ void *lh_delete(LHASH *lh, void *data)
233 nn= *rn; 233 nn= *rn;
234 *rn=nn->next; 234 *rn=nn->next;
235 ret=nn->data; 235 ret=nn->data;
236 Free(nn); 236 OPENSSL_free(nn);
237 lh->num_delete++; 237 lh->num_delete++;
238 } 238 }
239 239
@@ -329,7 +329,7 @@ static void expand(LHASH *lh)
329 if ((lh->p) >= lh->pmax) 329 if ((lh->p) >= lh->pmax)
330 { 330 {
331 j=(int)lh->num_alloc_nodes*2; 331 j=(int)lh->num_alloc_nodes*2;
332 n=(LHASH_NODE **)Realloc(lh->b, 332 n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
333 (unsigned int)sizeof(LHASH_NODE *)*j); 333 (unsigned int)sizeof(LHASH_NODE *)*j);
334 if (n == NULL) 334 if (n == NULL)
335 { 335 {
@@ -357,7 +357,7 @@ static void contract(LHASH *lh)
357 lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */ 357 lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
358 if (lh->p == 0) 358 if (lh->p == 0)
359 { 359 {
360 n=(LHASH_NODE **)Realloc(lh->b, 360 n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
361 (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax)); 361 (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
362 if (n == NULL) 362 if (n == NULL)
363 { 363 {
diff --git a/src/lib/libcrypto/lhash/lhash.h b/src/lib/libcrypto/lhash/lhash.h
index d315fd9c6d..b8ff021906 100644
--- a/src/lib/libcrypto/lhash/lhash.h
+++ b/src/lib/libcrypto/lhash/lhash.h
@@ -63,14 +63,18 @@
63#ifndef HEADER_LHASH_H 63#ifndef HEADER_LHASH_H
64#define HEADER_LHASH_H 64#define HEADER_LHASH_H
65 65
66#ifdef __cplusplus
67extern "C" {
68#endif
69
70#ifndef NO_FP_API 66#ifndef NO_FP_API
71#include <stdio.h> 67#include <stdio.h>
72#endif 68#endif
73 69
70#ifndef NO_BIO
71#include <openssl/bio.h>
72#endif
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
74typedef struct lhash_node_st 78typedef struct lhash_node_st
75 { 79 {
76 void *data; 80 void *data;
@@ -132,7 +136,7 @@ void lh_node_stats(LHASH *lh, FILE *out);
132void lh_node_usage_stats(LHASH *lh, FILE *out); 136void lh_node_usage_stats(LHASH *lh, FILE *out);
133#endif 137#endif
134 138
135#ifdef HEADER_BIO_H 139#ifndef NO_BIO
136void lh_stats_bio(LHASH *lh, BIO *out); 140void lh_stats_bio(LHASH *lh, BIO *out);
137void lh_node_stats_bio(LHASH *lh, BIO *out); 141void lh_node_stats_bio(LHASH *lh, BIO *out);
138void lh_node_usage_stats_bio(LHASH *lh, BIO *out); 142void lh_node_usage_stats_bio(LHASH *lh, BIO *out);
diff --git a/src/lib/libcrypto/md2/Makefile.ssl b/src/lib/libcrypto/md2/Makefile.ssl
index eab615a5be..d46c73a9b9 100644
--- a/src/lib/libcrypto/md2/Makefile.ssl
+++ b/src/lib/libcrypto/md2/Makefile.ssl
@@ -83,6 +83,7 @@ md2_dgst.o: ../../include/openssl/opensslv.h
83md2_one.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 83md2_one.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
84md2_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 84md2_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
85md2_one.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 85md2_one.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
86md2_one.o: ../../include/openssl/md2.h ../../include/openssl/opensslconf.h 86md2_one.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
87md2_one.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 87md2_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
88md2_one.o: ../../include/openssl/stack.h ../cryptlib.h 88md2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
89md2_one.o: ../../include/openssl/symhacks.h ../cryptlib.h
diff --git a/src/lib/libcrypto/md2/md2.h b/src/lib/libcrypto/md2/md2.h
index 582bffb859..a00bd162b3 100644
--- a/src/lib/libcrypto/md2/md2.h
+++ b/src/lib/libcrypto/md2/md2.h
@@ -59,10 +59,6 @@
59#ifndef HEADER_MD2_H 59#ifndef HEADER_MD2_H
60#define HEADER_MD2_H 60#define HEADER_MD2_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_MD2 62#ifdef NO_MD2
67#error MD2 is disabled. 63#error MD2 is disabled.
68#endif 64#endif
@@ -71,6 +67,10 @@ extern "C" {
71#define MD2_BLOCK 16 67#define MD2_BLOCK 16
72#include <openssl/opensslconf.h> /* MD2_INT */ 68#include <openssl/opensslconf.h> /* MD2_INT */
73 69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74typedef struct MD2state_st 74typedef struct MD2state_st
75 { 75 {
76 int num; 76 int num;
diff --git a/src/lib/libcrypto/md4/Makefile.ssl b/src/lib/libcrypto/md4/Makefile.ssl
new file mode 100644
index 0000000000..5341bf5b46
--- /dev/null
+++ b/src/lib/libcrypto/md4/Makefile.ssl
@@ -0,0 +1,84 @@
1#
2# SSLeay/crypto/md4/Makefile
3#
4
5DIR= md4
6TOP= ../..
7CC= cc
8CPP= $(CC) -E
9INCLUDES=
10CFLAG=-g
11INSTALL_PREFIX=
12OPENSSLDIR= /usr/local/ssl
13INSTALLTOP=/usr/local/ssl
14MAKE= make -f Makefile.ssl
15MAKEDEPEND= $(TOP)/util/domd $(TOP)
16MAKEFILE= Makefile.ssl
17AR= ar r
18
19CFLAGS= $(INCLUDES) $(CFLAG)
20
21GENERAL=Makefile
22TEST=md4test.c
23APPS=md4.c
24
25LIB=$(TOP)/libcrypto.a
26LIBSRC=md4_dgst.c md4_one.c
27LIBOBJ=md4_dgst.o md4_one.o
28
29SRC= $(LIBSRC)
30
31EXHEADER= md4.h
32HEADER= md4_locl.h $(EXHEADER)
33
34ALL= $(GENERAL) $(SRC) $(HEADER)
35
36top:
37 (cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
38
39all: lib
40
41lib: $(LIBOBJ)
42 $(AR) $(LIB) $(LIBOBJ)
43 $(RANLIB) $(LIB)
44 @touch lib
45
46files:
47 $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
48
49links:
50 @$(TOP)/util/point.sh Makefile.ssl Makefile
51 @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
52 @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
53 @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
54
55install:
56 @for i in $(EXHEADER) ; \
57 do \
58 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
59 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
60 done;
61
62tags:
63 ctags $(SRC)
64
65tests:
66
67lint:
68 lint -DLINT $(INCLUDES) $(SRC)>fluff
69
70depend:
71 $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
72
73dclean:
74 $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
75 mv -f Makefile.new $(MAKEFILE)
76
77clean:
78 rm -f asm/mx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
79
80# DO NOT DELETE THIS LINE -- make depend depends on it.
81
82md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h
83md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_locl.h
84md4_one.o: ../../include/openssl/md4.h
diff --git a/src/lib/libcrypto/md4/md4.c b/src/lib/libcrypto/md4/md4.c
new file mode 100644
index 0000000000..e4b0aac011
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4.c
@@ -0,0 +1,127 @@
1/* crypto/md4/md4.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <stdlib.h>
61#include <openssl/md4.h>
62
63#define BUFSIZE 1024*16
64
65void do_fp(FILE *f);
66void pt(unsigned char *md);
67#ifndef _OSD_POSIX
68int read(int, void *, unsigned int);
69#endif
70
71int main(int argc, char **argv)
72 {
73 int i,err=0;
74 FILE *IN;
75
76 if (argc == 1)
77 {
78 do_fp(stdin);
79 }
80 else
81 {
82 for (i=1; i<argc; i++)
83 {
84 IN=fopen(argv[i],"r");
85 if (IN == NULL)
86 {
87 perror(argv[i]);
88 err++;
89 continue;
90 }
91 printf("MD4(%s)= ",argv[i]);
92 do_fp(IN);
93 fclose(IN);
94 }
95 }
96 exit(err);
97 }
98
99void do_fp(FILE *f)
100 {
101 MD4_CTX c;
102 unsigned char md[MD4_DIGEST_LENGTH];
103 int fd;
104 int i;
105 static unsigned char buf[BUFSIZE];
106
107 fd=fileno(f);
108 MD4_Init(&c);
109 for (;;)
110 {
111 i=read(fd,buf,BUFSIZE);
112 if (i <= 0) break;
113 MD4_Update(&c,buf,(unsigned long)i);
114 }
115 MD4_Final(&(md[0]),&c);
116 pt(md);
117 }
118
119void pt(unsigned char *md)
120 {
121 int i;
122
123 for (i=0; i<MD4_DIGEST_LENGTH; i++)
124 printf("%02x",md[i]);
125 printf("\n");
126 }
127
diff --git a/src/lib/libcrypto/md4/md4.h b/src/lib/libcrypto/md4/md4.h
new file mode 100644
index 0000000000..c794e186db
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4.h
@@ -0,0 +1,114 @@
1/* crypto/md4/md4.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#ifndef HEADER_MD4_H
60#define HEADER_MD4_H
61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_MD4
67#error MD4 is disabled.
68#endif
69
70/*
71 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
72 * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !
73 * ! MD4_LONG_LOG2 has to be defined along. !
74 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 */
76
77#if defined(WIN16) || defined(__LP32__)
78#define MD4_LONG unsigned long
79#elif defined(_CRAY) || defined(__ILP64__)
80#define MD4_LONG unsigned long
81#define MD4_LONG_LOG2 3
82/*
83 * _CRAY note. I could declare short, but I have no idea what impact
84 * does it have on performance on none-T3E machines. I could declare
85 * int, but at least on C90 sizeof(int) can be chosen at compile time.
86 * So I've chosen long...
87 * <appro@fy.chalmers.se>
88 */
89#else
90#define MD4_LONG unsigned int
91#endif
92
93#define MD4_CBLOCK 64
94#define MD4_LBLOCK (MD4_CBLOCK/4)
95#define MD4_DIGEST_LENGTH 16
96
97typedef struct MD4state_st
98 {
99 MD4_LONG A,B,C,D;
100 MD4_LONG Nl,Nh;
101 MD4_LONG data[MD4_LBLOCK];
102 int num;
103 } MD4_CTX;
104
105void MD4_Init(MD4_CTX *c);
106void MD4_Update(MD4_CTX *c, const void *data, unsigned long len);
107void MD4_Final(unsigned char *md, MD4_CTX *c);
108unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md);
109void MD4_Transform(MD4_CTX *c, const unsigned char *b);
110#ifdef __cplusplus
111}
112#endif
113
114#endif
diff --git a/src/lib/libcrypto/md4/md4_dgst.c b/src/lib/libcrypto/md4/md4_dgst.c
new file mode 100644
index 0000000000..81488ae2e2
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4_dgst.c
@@ -0,0 +1,285 @@
1/* crypto/md4/md4_dgst.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include "md4_locl.h"
61#include <openssl/opensslv.h>
62
63const char *MD4_version="MD4" OPENSSL_VERSION_PTEXT;
64
65/* Implemented from RFC1186 The MD4 Message-Digest Algorithm
66 */
67
68#define INIT_DATA_A (unsigned long)0x67452301L
69#define INIT_DATA_B (unsigned long)0xefcdab89L
70#define INIT_DATA_C (unsigned long)0x98badcfeL
71#define INIT_DATA_D (unsigned long)0x10325476L
72
73void MD4_Init(MD4_CTX *c)
74 {
75 c->A=INIT_DATA_A;
76 c->B=INIT_DATA_B;
77 c->C=INIT_DATA_C;
78 c->D=INIT_DATA_D;
79 c->Nl=0;
80 c->Nh=0;
81 c->num=0;
82 }
83
84#ifndef md4_block_host_order
85void md4_block_host_order (MD4_CTX *c, const void *data, int num)
86 {
87 const MD4_LONG *X=data;
88 register unsigned long A,B,C,D;
89 /*
90 * In case you wonder why A-D are declared as long and not
91 * as MD4_LONG. Doing so results in slight performance
92 * boost on LP64 architectures. The catch is we don't
93 * really care if 32 MSBs of a 64-bit register get polluted
94 * with eventual overflows as we *save* only 32 LSBs in
95 * *either* case. Now declaring 'em long excuses the compiler
96 * from keeping 32 MSBs zeroed resulting in 13% performance
97 * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
98 * Well, to be honest it should say that this *prevents*
99 * performance degradation.
100 *
101 * <appro@fy.chalmers.se>
102 */
103
104 A=c->A;
105 B=c->B;
106 C=c->C;
107 D=c->D;
108
109 for (;num--;X+=HASH_LBLOCK)
110 {
111 /* Round 0 */
112 R0(A,B,C,D,X[ 0], 3,0);
113 R0(D,A,B,C,X[ 1], 7,0);
114 R0(C,D,A,B,X[ 2],11,0);
115 R0(B,C,D,A,X[ 3],19,0);
116 R0(A,B,C,D,X[ 4], 3,0);
117 R0(D,A,B,C,X[ 5], 7,0);
118 R0(C,D,A,B,X[ 6],11,0);
119 R0(B,C,D,A,X[ 7],19,0);
120 R0(A,B,C,D,X[ 8], 3,0);
121 R0(D,A,B,C,X[ 9], 7,0);
122 R0(C,D,A,B,X[10],11,0);
123 R0(B,C,D,A,X[11],19,0);
124 R0(A,B,C,D,X[12], 3,0);
125 R0(D,A,B,C,X[13], 7,0);
126 R0(C,D,A,B,X[14],11,0);
127 R0(B,C,D,A,X[15],19,0);
128 /* Round 1 */
129 R1(A,B,C,D,X[ 0], 3,0x5A827999L);
130 R1(D,A,B,C,X[ 4], 5,0x5A827999L);
131 R1(C,D,A,B,X[ 8], 9,0x5A827999L);
132 R1(B,C,D,A,X[12],13,0x5A827999L);
133 R1(A,B,C,D,X[ 1], 3,0x5A827999L);
134 R1(D,A,B,C,X[ 5], 5,0x5A827999L);
135 R1(C,D,A,B,X[ 9], 9,0x5A827999L);
136 R1(B,C,D,A,X[13],13,0x5A827999L);
137 R1(A,B,C,D,X[ 2], 3,0x5A827999L);
138 R1(D,A,B,C,X[ 6], 5,0x5A827999L);
139 R1(C,D,A,B,X[10], 9,0x5A827999L);
140 R1(B,C,D,A,X[14],13,0x5A827999L);
141 R1(A,B,C,D,X[ 3], 3,0x5A827999L);
142 R1(D,A,B,C,X[ 7], 5,0x5A827999L);
143 R1(C,D,A,B,X[11], 9,0x5A827999L);
144 R1(B,C,D,A,X[15],13,0x5A827999L);
145 /* Round 2 */
146 R2(A,B,C,D,X[ 0], 3,0x6ED9EBA1);
147 R2(D,A,B,C,X[ 8], 9,0x6ED9EBA1);
148 R2(C,D,A,B,X[ 4],11,0x6ED9EBA1);
149 R2(B,C,D,A,X[12],15,0x6ED9EBA1);
150 R2(A,B,C,D,X[ 2], 3,0x6ED9EBA1);
151 R2(D,A,B,C,X[10], 9,0x6ED9EBA1);
152 R2(C,D,A,B,X[ 6],11,0x6ED9EBA1);
153 R2(B,C,D,A,X[14],15,0x6ED9EBA1);
154 R2(A,B,C,D,X[ 1], 3,0x6ED9EBA1);
155 R2(D,A,B,C,X[ 9], 9,0x6ED9EBA1);
156 R2(C,D,A,B,X[ 5],11,0x6ED9EBA1);
157 R2(B,C,D,A,X[13],15,0x6ED9EBA1);
158 R2(A,B,C,D,X[ 3], 3,0x6ED9EBA1);
159 R2(D,A,B,C,X[11], 9,0x6ED9EBA1);
160 R2(C,D,A,B,X[ 7],11,0x6ED9EBA1);
161 R2(B,C,D,A,X[15],15,0x6ED9EBA1);
162
163 A = c->A += A;
164 B = c->B += B;
165 C = c->C += C;
166 D = c->D += D;
167 }
168 }
169#endif
170
171#ifndef md4_block_data_order
172#ifdef X
173#undef X
174#endif
175void md4_block_data_order (MD4_CTX *c, const void *data_, int num)
176 {
177 const unsigned char *data=data_;
178 register unsigned long A,B,C,D,l;
179 /*
180 * In case you wonder why A-D are declared as long and not
181 * as MD4_LONG. Doing so results in slight performance
182 * boost on LP64 architectures. The catch is we don't
183 * really care if 32 MSBs of a 64-bit register get polluted
184 * with eventual overflows as we *save* only 32 LSBs in
185 * *either* case. Now declaring 'em long excuses the compiler
186 * from keeping 32 MSBs zeroed resulting in 13% performance
187 * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
188 * Well, to be honest it should say that this *prevents*
189 * performance degradation.
190 *
191 * <appro@fy.chalmers.se>
192 */
193#ifndef MD32_XARRAY
194 /* See comment in crypto/sha/sha_locl.h for details. */
195 unsigned long XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
196 XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15;
197# define X(i) XX##i
198#else
199 MD4_LONG XX[MD4_LBLOCK];
200# define X(i) XX[i]
201#endif
202
203 A=c->A;
204 B=c->B;
205 C=c->C;
206 D=c->D;
207
208 for (;num--;)
209 {
210 HOST_c2l(data,l); X( 0)=l; HOST_c2l(data,l); X( 1)=l;
211 /* Round 0 */
212 R0(A,B,C,D,X( 0), 3,0); HOST_c2l(data,l); X( 2)=l;
213 R0(D,A,B,C,X( 1), 7,0); HOST_c2l(data,l); X( 3)=l;
214 R0(C,D,A,B,X( 2),11,0); HOST_c2l(data,l); X( 4)=l;
215 R0(B,C,D,A,X( 3),19,0); HOST_c2l(data,l); X( 5)=l;
216 R0(A,B,C,D,X( 4), 3,0); HOST_c2l(data,l); X( 6)=l;
217 R0(D,A,B,C,X( 5), 7,0); HOST_c2l(data,l); X( 7)=l;
218 R0(C,D,A,B,X( 6),11,0); HOST_c2l(data,l); X( 8)=l;
219 R0(B,C,D,A,X( 7),19,0); HOST_c2l(data,l); X( 9)=l;
220 R0(A,B,C,D,X( 8), 3,0); HOST_c2l(data,l); X(10)=l;
221 R0(D,A,B,C,X( 9), 7,0); HOST_c2l(data,l); X(11)=l;
222 R0(C,D,A,B,X(10),11,0); HOST_c2l(data,l); X(12)=l;
223 R0(B,C,D,A,X(11),19,0); HOST_c2l(data,l); X(13)=l;
224 R0(A,B,C,D,X(12), 3,0); HOST_c2l(data,l); X(14)=l;
225 R0(D,A,B,C,X(13), 7,0); HOST_c2l(data,l); X(15)=l;
226 R0(C,D,A,B,X(14),11,0);
227 R0(B,C,D,A,X(15),19,0);
228 /* Round 1 */
229 R1(A,B,C,D,X( 0), 3,0x5A827999L);
230 R1(D,A,B,C,X( 4), 5,0x5A827999L);
231 R1(C,D,A,B,X( 8), 9,0x5A827999L);
232 R1(B,C,D,A,X(12),13,0x5A827999L);
233 R1(A,B,C,D,X( 1), 3,0x5A827999L);
234 R1(D,A,B,C,X( 5), 5,0x5A827999L);
235 R1(C,D,A,B,X( 9), 9,0x5A827999L);
236 R1(B,C,D,A,X(13),13,0x5A827999L);
237 R1(A,B,C,D,X( 2), 3,0x5A827999L);
238 R1(D,A,B,C,X( 6), 5,0x5A827999L);
239 R1(C,D,A,B,X(10), 9,0x5A827999L);
240 R1(B,C,D,A,X(14),13,0x5A827999L);
241 R1(A,B,C,D,X( 3), 3,0x5A827999L);
242 R1(D,A,B,C,X( 7), 5,0x5A827999L);
243 R1(C,D,A,B,X(11), 9,0x5A827999L);
244 R1(B,C,D,A,X(15),13,0x5A827999L);
245 /* Round 2 */
246 R2(A,B,C,D,X( 0), 3,0x6ED9EBA1L);
247 R2(D,A,B,C,X( 8), 9,0x6ED9EBA1L);
248 R2(C,D,A,B,X( 4),11,0x6ED9EBA1L);
249 R2(B,C,D,A,X(12),15,0x6ED9EBA1L);
250 R2(A,B,C,D,X( 2), 3,0x6ED9EBA1L);
251 R2(D,A,B,C,X(10), 9,0x6ED9EBA1L);
252 R2(C,D,A,B,X( 6),11,0x6ED9EBA1L);
253 R2(B,C,D,A,X(14),15,0x6ED9EBA1L);
254 R2(A,B,C,D,X( 1), 3,0x6ED9EBA1L);
255 R2(D,A,B,C,X( 9), 9,0x6ED9EBA1L);
256 R2(C,D,A,B,X( 5),11,0x6ED9EBA1L);
257 R2(B,C,D,A,X(13),15,0x6ED9EBA1L);
258 R2(A,B,C,D,X( 3), 3,0x6ED9EBA1L);
259 R2(D,A,B,C,X(11), 9,0x6ED9EBA1L);
260 R2(C,D,A,B,X( 7),11,0x6ED9EBA1L);
261 R2(B,C,D,A,X(15),15,0x6ED9EBA1L);
262
263 A = c->A += A;
264 B = c->B += B;
265 C = c->C += C;
266 D = c->D += D;
267 }
268 }
269#endif
270
271#ifdef undef
272int printit(unsigned long *l)
273 {
274 int i,ii;
275
276 for (i=0; i<2; i++)
277 {
278 for (ii=0; ii<8; ii++)
279 {
280 fprintf(stderr,"%08lx ",l[i*8+ii]);
281 }
282 fprintf(stderr,"\n");
283 }
284 }
285#endif
diff --git a/src/lib/libcrypto/md4/md4_locl.h b/src/lib/libcrypto/md4/md4_locl.h
new file mode 100644
index 0000000000..0a2b39018d
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4_locl.h
@@ -0,0 +1,154 @@
1/* crypto/md4/md4_locl.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdlib.h>
60#include <string.h>
61#include <openssl/opensslconf.h>
62#include <openssl/md4.h>
63
64#ifndef MD4_LONG_LOG2
65#define MD4_LONG_LOG2 2 /* default to 32 bits */
66#endif
67
68void md4_block_host_order (MD4_CTX *c, const void *p,int num);
69void md4_block_data_order (MD4_CTX *c, const void *p,int num);
70
71#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
72/*
73 * *_block_host_order is expected to handle aligned data while
74 * *_block_data_order - unaligned. As algorithm and host (x86)
75 * are in this case of the same "endianness" these two are
76 * otherwise indistinguishable. But normally you don't want to
77 * call the same function because unaligned access in places
78 * where alignment is expected is usually a "Bad Thing". Indeed,
79 * on RISCs you get punished with BUS ERROR signal or *severe*
80 * performance degradation. Intel CPUs are in turn perfectly
81 * capable of loading unaligned data without such drastic side
82 * effect. Yes, they say it's slower than aligned load, but no
83 * exception is generated and therefore performance degradation
84 * is *incomparable* with RISCs. What we should weight here is
85 * costs of unaligned access against costs of aligning data.
86 * According to my measurements allowing unaligned access results
87 * in ~9% performance improvement on Pentium II operating at
88 * 266MHz. I won't be surprised if the difference will be higher
89 * on faster systems:-)
90 *
91 * <appro@fy.chalmers.se>
92 */
93#define md4_block_data_order md4_block_host_order
94#endif
95
96#define DATA_ORDER_IS_LITTLE_ENDIAN
97
98#define HASH_LONG MD4_LONG
99#define HASH_LONG_LOG2 MD4_LONG_LOG2
100#define HASH_CTX MD4_CTX
101#define HASH_CBLOCK MD4_CBLOCK
102#define HASH_LBLOCK MD4_LBLOCK
103#define HASH_UPDATE MD4_Update
104#define HASH_TRANSFORM MD4_Transform
105#define HASH_FINAL MD4_Final
106#define HASH_MAKE_STRING(c,s) do { \
107 unsigned long ll; \
108 ll=(c)->A; HOST_l2c(ll,(s)); \
109 ll=(c)->B; HOST_l2c(ll,(s)); \
110 ll=(c)->C; HOST_l2c(ll,(s)); \
111 ll=(c)->D; HOST_l2c(ll,(s)); \
112 } while (0)
113#define HASH_BLOCK_HOST_ORDER md4_block_host_order
114#if !defined(L_ENDIAN) || defined(md4_block_data_order)
115#define HASH_BLOCK_DATA_ORDER md4_block_data_order
116/*
117 * Little-endians (Intel and Alpha) feel better without this.
118 * It looks like memcpy does better job than generic
119 * md4_block_data_order on copying-n-aligning input data.
120 * But frankly speaking I didn't expect such result on Alpha.
121 * On the other hand I've got this with egcs-1.0.2 and if
122 * program is compiled with another (better?) compiler it
123 * might turn out other way around.
124 *
125 * <appro@fy.chalmers.se>
126 */
127#endif
128
129#include "md32_common.h"
130
131/*
132#define F(x,y,z) (((x) & (y)) | ((~(x)) & (z)))
133#define G(x,y,z) (((x) & (y)) | ((x) & ((z))) | ((y) & ((z))))
134*/
135
136/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be
137 * simplified to the code below. Wei attributes these optimizations
138 * to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
139 */
140#define F(b,c,d) ((((c) ^ (d)) & (b)) ^ (d))
141#define G(b,c,d) (((b) & (c)) | ((b) & (d)) | ((c) & (d)))
142#define H(b,c,d) ((b) ^ (c) ^ (d))
143
144#define R0(a,b,c,d,k,s,t) { \
145 a+=((k)+(t)+F((b),(c),(d))); \
146 a=ROTATE(a,s); };
147
148#define R1(a,b,c,d,k,s,t) { \
149 a+=((k)+(t)+G((b),(c),(d))); \
150 a=ROTATE(a,s); };\
151
152#define R2(a,b,c,d,k,s,t) { \
153 a+=((k)+(t)+H((b),(c),(d))); \
154 a=ROTATE(a,s); };
diff --git a/src/lib/libcrypto/md4/md4_one.c b/src/lib/libcrypto/md4/md4_one.c
new file mode 100644
index 0000000000..87a995d38d
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4_one.c
@@ -0,0 +1,95 @@
1/* crypto/md4/md4_one.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <string.h>
61#include <openssl/md4.h>
62
63#ifdef CHARSET_EBCDIC
64#include <openssl/ebcdic.h>
65#endif
66
67unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md)
68 {
69 MD4_CTX c;
70 static unsigned char m[MD4_DIGEST_LENGTH];
71
72 if (md == NULL) md=m;
73 MD4_Init(&c);
74#ifndef CHARSET_EBCDIC
75 MD4_Update(&c,d,n);
76#else
77 {
78 char temp[1024];
79 unsigned long chunk;
80
81 while (n > 0)
82 {
83 chunk = (n > sizeof(temp)) ? sizeof(temp) : n;
84 ebcdic2ascii(temp, d, chunk);
85 MD4_Update(&c,temp,chunk);
86 n -= chunk;
87 d += chunk;
88 }
89 }
90#endif
91 MD4_Final(md,&c);
92 memset(&c,0,sizeof(c)); /* security consideration */
93 return(md);
94 }
95
diff --git a/src/lib/libcrypto/md4/md4s.cpp b/src/lib/libcrypto/md4/md4s.cpp
new file mode 100644
index 0000000000..c0ec97fc9f
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4s.cpp
@@ -0,0 +1,78 @@
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__)
10void GetTSC(unsigned long&);
11#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax];
12#elif defined(__GNUC__)
13inline
14void 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)
22inline
23void 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 <stdio.h>
34#include <stdlib.h>
35#include <openssl/md4.h>
36
37extern "C" {
38void md4_block_x86(MD4_CTX *ctx, unsigned char *buffer,int num);
39}
40
41void 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
diff --git a/src/lib/libcrypto/md4/md4test.c b/src/lib/libcrypto/md4/md4test.c
new file mode 100644
index 0000000000..97e6e21efd
--- /dev/null
+++ b/src/lib/libcrypto/md4/md4test.c
@@ -0,0 +1,131 @@
1/* crypto/md4/md4test.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdio.h>
60#include <string.h>
61#include <stdlib.h>
62
63#ifdef NO_MD4
64int main(int argc, char *argv[])
65{
66 printf("No MD4 support\n");
67 return(0);
68}
69#else
70#include <openssl/md4.h>
71
72static char *test[]={
73 "",
74 "a",
75 "abc",
76 "message digest",
77 "abcdefghijklmnopqrstuvwxyz",
78 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
79 "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
80 NULL,
81 };
82
83static char *ret[]={
84"31d6cfe0d16ae931b73c59d7e0c089c0",
85"bde52cb31de33e46245e05fbdbd6fb24",
86"a448017aaf21d8525fc10ae87aa6729d",
87"d9130a8164549fe818874806e1c7014b",
88"d79e1c308aa5bbcdeea8ed63df412da9",
89"043f8582f241db351ce627e153e7f0e4",
90"e33b4ddc9c38f2199c3e7b164fcc0536",
91};
92
93static char *pt(unsigned char *md);
94int main(int argc, char *argv[])
95 {
96 int i,err=0;
97 unsigned char **P,**R;
98 char *p;
99
100 P=(unsigned char **)test;
101 R=(unsigned char **)ret;
102 i=1;
103 while (*P != NULL)
104 {
105 p=pt(MD4(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL));
106 if (strcmp(p,(char *)*R) != 0)
107 {
108 printf("error calculating MD4 on '%s'\n",*P);
109 printf("got %s instead of %s\n",p,*R);
110 err++;
111 }
112 else
113 printf("test %d ok\n",i);
114 i++;
115 R++;
116 P++;
117 }
118 exit(err);
119 return(0);
120 }
121
122static char *pt(unsigned char *md)
123 {
124 int i;
125 static char buf[80];
126
127 for (i=0; i<MD4_DIGEST_LENGTH; i++)
128 sprintf(&(buf[i*2]),"%02x",md[i]);
129 return(buf);
130 }
131#endif
diff --git a/src/lib/libcrypto/md5/Makefile.ssl b/src/lib/libcrypto/md5/Makefile.ssl
index 45fbd04239..e8d0cced7f 100644
--- a/src/lib/libcrypto/md5/Makefile.ssl
+++ b/src/lib/libcrypto/md5/Makefile.ssl
@@ -30,7 +30,7 @@ ASFLAGS=$(CFLAGS)
30 30
31GENERAL=Makefile 31GENERAL=Makefile
32TEST=md5test.c 32TEST=md5test.c
33APPS=md5.c 33APPS=
34 34
35LIB=$(TOP)/libcrypto.a 35LIB=$(TOP)/libcrypto.a
36LIBSRC=md5_dgst.c md5_one.c 36LIBSRC=md5_dgst.c md5_one.c
diff --git a/src/lib/libcrypto/mdc2/Makefile.ssl b/src/lib/libcrypto/mdc2/Makefile.ssl
index 7c28103350..da11c4edea 100644
--- a/src/lib/libcrypto/mdc2/Makefile.ssl
+++ b/src/lib/libcrypto/mdc2/Makefile.ssl
@@ -81,9 +81,10 @@ clean:
81mdc2_one.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 81mdc2_one.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
82mdc2_one.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 82mdc2_one.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
83mdc2_one.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 83mdc2_one.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
84mdc2_one.o: ../../include/openssl/err.h ../../include/openssl/mdc2.h 84mdc2_one.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
85mdc2_one.o: ../../include/openssl/opensslconf.h 85mdc2_one.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h
86mdc2_one.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 86mdc2_one.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
87mdc2_one.o: ../../include/openssl/stack.h ../cryptlib.h 87mdc2_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
88mdc2_one.o: ../cryptlib.h
88mdc2dgst.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h 89mdc2dgst.o: ../../include/openssl/des.h ../../include/openssl/e_os2.h
89mdc2dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h 90mdc2dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h
diff --git a/src/lib/libcrypto/mdc2/mdc2.h b/src/lib/libcrypto/mdc2/mdc2.h
index 00acd707cd..5da8da72f5 100644
--- a/src/lib/libcrypto/mdc2/mdc2.h
+++ b/src/lib/libcrypto/mdc2/mdc2.h
@@ -59,12 +59,12 @@
59#ifndef HEADER_MDC2_H 59#ifndef HEADER_MDC2_H
60#define HEADER_MDC2_H 60#define HEADER_MDC2_H
61 61
62#include <openssl/des.h>
63
62#ifdef __cplusplus 64#ifdef __cplusplus
63extern "C" { 65extern "C" {
64#endif 66#endif
65 67
66#include <openssl/des.h>
67
68#ifdef NO_MDC2 68#ifdef NO_MDC2
69#error MDC2 is disabled. 69#error MDC2 is disabled.
70#endif 70#endif
diff --git a/src/lib/libcrypto/mem.c b/src/lib/libcrypto/mem.c
index 5a661e5f45..3b5b2bbc68 100644
--- a/src/lib/libcrypto/mem.c
+++ b/src/lib/libcrypto/mem.c
@@ -80,20 +80,23 @@ static void (*free_func)(void *) = free;
80/* may be changed as long as `allow_customize_debug' is set */ 80/* may be changed as long as `allow_customize_debug' is set */
81/* XXX use correct function pointer types */ 81/* XXX use correct function pointer types */
82#ifdef CRYPTO_MDEBUG 82#ifdef CRYPTO_MDEBUG
83 /* use default functions from mem_dbg.c */ 83/* use default functions from mem_dbg.c */
84 static void (*malloc_debug_func)()= (void (*)())CRYPTO_dbg_malloc; 84static void (*malloc_debug_func)(void *,int,const char *,int,int)
85 static void (*realloc_debug_func)()= (void (*)())CRYPTO_dbg_realloc; 85 = CRYPTO_dbg_malloc;
86 static void (*free_debug_func)()= (void (*)())CRYPTO_dbg_free; 86static void (*realloc_debug_func)(void *,void *,int,const char *,int,int)
87 static void (*set_debug_options_func)()= (void (*)())CRYPTO_dbg_set_options; 87 = CRYPTO_dbg_realloc;
88 static long (*get_debug_options_func)()= (long (*)())CRYPTO_dbg_get_options; 88static void (*free_debug_func)(void *,int) = CRYPTO_dbg_free;
89static void (*set_debug_options_func)(long) = CRYPTO_dbg_set_options;
90static long (*get_debug_options_func)(void) = CRYPTO_dbg_get_options;
89#else 91#else
90 /* applications can use CRYPTO_malloc_debug_init() to select above case 92/* applications can use CRYPTO_malloc_debug_init() to select above case
91 * at run-time */ 93 * at run-time */
92 static void (*malloc_debug_func)()= NULL; 94static void (*malloc_debug_func)(void *,int,const char *,int,int) = NULL;
93 static void (*realloc_debug_func)()= NULL; 95static void (*realloc_debug_func)(void *,void *,int,const char *,int,int)
94 static void (*free_debug_func)()= NULL; 96 = NULL;
95 static void (*set_debug_options_func)()= NULL; 97static void (*free_debug_func)(void *,int) = NULL;
96 static long (*get_debug_options_func)()= NULL; 98static void (*set_debug_options_func)(long) = NULL;
99static long (*get_debug_options_func)(void) = NULL;
97#endif 100#endif
98 101
99 102
@@ -123,7 +126,11 @@ int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*f)(void *))
123 return 1; 126 return 1;
124 } 127 }
125 128
126int CRYPTO_set_mem_debug_functions(void (*m)(), void (*r)(), void (*f)(),void (*so)(),long (*go)()) 129int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int),
130 void (*r)(void *,void *,int,const char *,int,int),
131 void (*f)(void *,int),
132 void (*so)(long),
133 long (*go)(void))
127 { 134 {
128 if (!allow_customize_debug) 135 if (!allow_customize_debug)
129 return 0; 136 return 0;
@@ -149,7 +156,11 @@ void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *))
149 if (f != NULL) *f=free_locked_func; 156 if (f != NULL) *f=free_locked_func;
150 } 157 }
151 158
152void CRYPTO_get_mem_debug_functions(void (**m)(), void (**r)(), void (**f)(),void (**so)(),long (**go)()) 159void CRYPTO_get_mem_debug_functions(void (**m)(void *,int,const char *,int,int),
160 void (**r)(void *,void *,int,const char *,int,int),
161 void (**f)(void *,int),
162 void (**so)(long),
163 long (**go)(void))
153 { 164 {
154 if (m != NULL) *m=malloc_debug_func; 165 if (m != NULL) *m=malloc_debug_func;
155 if (r != NULL) *r=realloc_debug_func; 166 if (r != NULL) *r=realloc_debug_func;
@@ -161,7 +172,7 @@ void CRYPTO_get_mem_debug_functions(void (**m)(), void (**r)(), void (**f)(),voi
161 172
162void *CRYPTO_malloc_locked(int num, const char *file, int line) 173void *CRYPTO_malloc_locked(int num, const char *file, int line)
163 { 174 {
164 char *ret = NULL; 175 void *ret = NULL;
165 176
166 allow_customize = 0; 177 allow_customize = 0;
167 if (malloc_debug_func != NULL) 178 if (malloc_debug_func != NULL)
@@ -193,7 +204,7 @@ void CRYPTO_free_locked(void *str)
193 204
194void *CRYPTO_malloc(int num, const char *file, int line) 205void *CRYPTO_malloc(int num, const char *file, int line)
195 { 206 {
196 char *ret = NULL; 207 void *ret = NULL;
197 208
198 allow_customize = 0; 209 allow_customize = 0;
199 if (malloc_debug_func != NULL) 210 if (malloc_debug_func != NULL)
@@ -213,7 +224,7 @@ void *CRYPTO_malloc(int num, const char *file, int line)
213 224
214void *CRYPTO_realloc(void *str, int num, const char *file, int line) 225void *CRYPTO_realloc(void *str, int num, const char *file, int line)
215 { 226 {
216 char *ret = NULL; 227 void *ret = NULL;
217 228
218 if (realloc_debug_func != NULL) 229 if (realloc_debug_func != NULL)
219 realloc_debug_func(str, NULL, num, file, line, 0); 230 realloc_debug_func(str, NULL, num, file, line, 0);
@@ -241,8 +252,8 @@ void CRYPTO_free(void *str)
241 252
242void *CRYPTO_remalloc(void *a, int num, const char *file, int line) 253void *CRYPTO_remalloc(void *a, int num, const char *file, int line)
243 { 254 {
244 if (a != NULL) Free(a); 255 if (a != NULL) OPENSSL_free(a);
245 a=(char *)Malloc(num); 256 a=(char *)OPENSSL_malloc(num);
246 return(a); 257 return(a);
247 } 258 }
248 259
diff --git a/src/lib/libcrypto/mem_dbg.c b/src/lib/libcrypto/mem_dbg.c
index a399485300..866c53e73a 100644
--- a/src/lib/libcrypto/mem_dbg.c
+++ b/src/lib/libcrypto/mem_dbg.c
@@ -108,7 +108,7 @@ static LHASH *amih=NULL; /* hash-table with those app_mem_info_st's
108typedef struct mem_st 108typedef struct mem_st
109/* memory-block description */ 109/* memory-block description */
110 { 110 {
111 char *addr; 111 void *addr;
112 int num; 112 int num;
113 const char *file; 113 const char *file;
114 int line; 114 int line;
@@ -221,7 +221,7 @@ long CRYPTO_dbg_get_options(void)
221 221
222static int mem_cmp(MEM *a, MEM *b) 222static int mem_cmp(MEM *a, MEM *b)
223 { 223 {
224 return(a->addr - b->addr); 224 return((char *)a->addr - (char *)b->addr);
225 } 225 }
226 226
227static unsigned long mem_hash(MEM *a) 227static unsigned long mem_hash(MEM *a)
@@ -279,7 +279,7 @@ static APP_INFO *pop_info()
279 ret->next = NULL; 279 ret->next = NULL;
280 if (next != NULL) 280 if (next != NULL)
281 next->references--; 281 next->references--;
282 Free(ret); 282 OPENSSL_free(ret);
283 } 283 }
284 } 284 }
285 } 285 }
@@ -295,7 +295,7 @@ int CRYPTO_push_info_(const char *info, const char *file, int line)
295 { 295 {
296 MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */ 296 MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */
297 297
298 if ((ami = (APP_INFO *)Malloc(sizeof(APP_INFO))) == NULL) 298 if ((ami = (APP_INFO *)OPENSSL_malloc(sizeof(APP_INFO))) == NULL)
299 { 299 {
300 ret=0; 300 ret=0;
301 goto err; 301 goto err;
@@ -304,7 +304,7 @@ int CRYPTO_push_info_(const char *info, const char *file, int line)
304 { 304 {
305 if ((amih=lh_new(app_info_hash,app_info_cmp)) == NULL) 305 if ((amih=lh_new(app_info_hash,app_info_cmp)) == NULL)
306 { 306 {
307 Free(ami); 307 OPENSSL_free(ami);
308 ret=0; 308 ret=0;
309 goto err; 309 goto err;
310 } 310 }
@@ -386,9 +386,9 @@ void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
386 if (is_MemCheck_on()) 386 if (is_MemCheck_on())
387 { 387 {
388 MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */ 388 MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */
389 if ((m=(MEM *)Malloc(sizeof(MEM))) == NULL) 389 if ((m=(MEM *)OPENSSL_malloc(sizeof(MEM))) == NULL)
390 { 390 {
391 Free(addr); 391 OPENSSL_free(addr);
392 MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */ 392 MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */
393 return; 393 return;
394 } 394 }
@@ -396,8 +396,8 @@ void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
396 { 396 {
397 if ((mh=lh_new(mem_hash,mem_cmp)) == NULL) 397 if ((mh=lh_new(mem_hash,mem_cmp)) == NULL)
398 { 398 {
399 Free(addr); 399 OPENSSL_free(addr);
400 Free(m); 400 OPENSSL_free(m);
401 addr=NULL; 401 addr=NULL;
402 goto err; 402 goto err;
403 } 403 }
@@ -445,7 +445,7 @@ void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
445 { 445 {
446 mm->app_info->references--; 446 mm->app_info->references--;
447 } 447 }
448 Free(mm); 448 OPENSSL_free(mm);
449 } 449 }
450 err: 450 err:
451 MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */ 451 MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */
@@ -481,7 +481,7 @@ void CRYPTO_dbg_free(void *addr, int before_p)
481 { 481 {
482 mp->app_info->references--; 482 mp->app_info->references--;
483 } 483 }
484 Free(mp); 484 OPENSSL_free(mp);
485 } 485 }
486 486
487 MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */ 487 MemCheck_on(); /* releases CRYPTO_LOCK_MALLOC2 */
@@ -696,32 +696,6 @@ void CRYPTO_mem_leaks(BIO *b)
696#endif 696#endif
697 } 697 }
698 698
699union void_fn_to_char_u
700 {
701 char *char_p;
702 void (*fn_p)();
703 };
704
705static void cb_leak(MEM *m, char *cb)
706 {
707 union void_fn_to_char_u mem_callback;
708
709 mem_callback.char_p=cb;
710 mem_callback.fn_p(m->order,m->file,m->line,m->num,m->addr);
711 }
712
713void CRYPTO_mem_leaks_cb(void (*cb)())
714 {
715 union void_fn_to_char_u mem_cb;
716
717 if (mh == NULL) return;
718 CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);
719 mem_cb.fn_p=cb;
720 lh_doall_arg(mh,(void (*)())cb_leak,mem_cb.char_p);
721 mem_cb.char_p=NULL;
722 CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
723 }
724
725#ifndef NO_FP_API 699#ifndef NO_FP_API
726void CRYPTO_mem_leaks_fp(FILE *fp) 700void CRYPTO_mem_leaks_fp(FILE *fp)
727 { 701 {
@@ -736,3 +710,21 @@ void CRYPTO_mem_leaks_fp(FILE *fp)
736 } 710 }
737#endif 711#endif
738 712
713
714
715/* FIXME: We really don't allow much to the callback. For example, it has
716 no chance of reaching the info stack for the item it processes. Should
717 it really be this way? -- Richard Levitte */
718static void cb_leak(MEM *m,
719 void (**cb)(unsigned long, const char *, int, int, void *))
720 {
721 (**cb)(m->order,m->file,m->line,m->num,m->addr);
722 }
723
724void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void *))
725 {
726 if (mh == NULL) return;
727 CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);
728 lh_doall_arg(mh,(void (*)())cb_leak,(void *)&cb);
729 CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
730 }
diff --git a/src/lib/libcrypto/objects/Makefile.ssl b/src/lib/libcrypto/objects/Makefile.ssl
index f05e15df96..bdb7aa94dc 100644
--- a/src/lib/libcrypto/objects/Makefile.ssl
+++ b/src/lib/libcrypto/objects/Makefile.ssl
@@ -27,7 +27,7 @@ LIBOBJ= o_names.o obj_dat.o obj_lib.o obj_err.o
27 27
28SRC= $(LIBSRC) 28SRC= $(LIBSRC)
29 29
30EXHEADER= objects.h 30EXHEADER= objects.h obj_mac.h
31HEADER= $(EXHEADER) obj_dat.h 31HEADER= $(EXHEADER) obj_dat.h
32 32
33ALL= $(GENERAL) $(SRC) $(HEADER) 33ALL= $(GENERAL) $(SRC) $(HEADER)
@@ -80,27 +80,32 @@ clean:
80 80
81o_names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 81o_names.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
82o_names.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 82o_names.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
83o_names.o: ../../include/openssl/lhash.h ../../include/openssl/objects.h 83o_names.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
84o_names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 84o_names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
85o_names.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 85o_names.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
86o_names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
86obj_dat.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 87obj_dat.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
87obj_dat.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 88obj_dat.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
88obj_dat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 89obj_dat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
89obj_dat.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 90obj_dat.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
90obj_dat.o: ../../include/openssl/lhash.h ../../include/openssl/objects.h 91obj_dat.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
91obj_dat.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 92obj_dat.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
92obj_dat.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 93obj_dat.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
94obj_dat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
93obj_dat.o: ../cryptlib.h obj_dat.h 95obj_dat.o: ../cryptlib.h obj_dat.h
94obj_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 96obj_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
95obj_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 97obj_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
96obj_err.o: ../../include/openssl/err.h ../../include/openssl/objects.h 98obj_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
99obj_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
97obj_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 100obj_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
98obj_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 101obj_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
102obj_err.o: ../../include/openssl/symhacks.h
99obj_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 103obj_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
100obj_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 104obj_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
101obj_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 105obj_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
102obj_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 106obj_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
103obj_lib.o: ../../include/openssl/lhash.h ../../include/openssl/objects.h 107obj_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
104obj_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 108obj_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
105obj_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 109obj_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
110obj_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
106obj_lib.o: ../cryptlib.h 111obj_lib.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/objects/o_names.c b/src/lib/libcrypto/objects/o_names.c
index d9389a5e5a..dca988230e 100644
--- a/src/lib/libcrypto/objects/o_names.c
+++ b/src/lib/libcrypto/objects/o_names.c
@@ -36,8 +36,9 @@ int OBJ_NAME_init(void)
36 return(names_lh != NULL); 36 return(names_lh != NULL);
37 } 37 }
38 38
39int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(), 39int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
40 void (*free_func)()) 40 int (*cmp_func)(const void *, const void *),
41 void (*free_func)(const char *, int, const char *))
41 { 42 {
42 int ret; 43 int ret;
43 int i; 44 int i;
@@ -59,7 +60,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(),
59 for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++) 60 for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
60 { 61 {
61 MemCheck_off(); 62 MemCheck_off();
62 name_funcs = Malloc(sizeof(NAME_FUNCS)); 63 name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
63 name_funcs->hash_func = lh_strhash; 64 name_funcs->hash_func = lh_strhash;
64 name_funcs->cmp_func = (int (*)())strcmp; 65 name_funcs->cmp_func = (int (*)())strcmp;
65 name_funcs->free_func = 0; /* NULL is often declared to 66 name_funcs->free_func = 0; /* NULL is often declared to
@@ -156,7 +157,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
156 alias=type&OBJ_NAME_ALIAS; 157 alias=type&OBJ_NAME_ALIAS;
157 type&= ~OBJ_NAME_ALIAS; 158 type&= ~OBJ_NAME_ALIAS;
158 159
159 onp=(OBJ_NAME *)Malloc(sizeof(OBJ_NAME)); 160 onp=(OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
160 if (onp == NULL) 161 if (onp == NULL)
161 { 162 {
162 /* ERROR */ 163 /* ERROR */
@@ -181,7 +182,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
181 sk_NAME_FUNCS_value(name_funcs_stack,ret->type) 182 sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
182 ->free_func(ret->name,ret->type,ret->data); 183 ->free_func(ret->name,ret->type,ret->data);
183 } 184 }
184 Free(ret); 185 OPENSSL_free(ret);
185 } 186 }
186 else 187 else
187 { 188 {
@@ -216,7 +217,7 @@ int OBJ_NAME_remove(const char *name, int type)
216 sk_NAME_FUNCS_value(name_funcs_stack,ret->type) 217 sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
217 ->free_func(ret->name,ret->type,ret->data); 218 ->free_func(ret->name,ret->type,ret->data);
218 } 219 }
219 Free(ret); 220 OPENSSL_free(ret);
220 return(1); 221 return(1);
221 } 222 }
222 else 223 else
@@ -238,7 +239,7 @@ static void names_lh_free(OBJ_NAME *onp, int type)
238 239
239static void name_funcs_free(NAME_FUNCS *ptr) 240static void name_funcs_free(NAME_FUNCS *ptr)
240 { 241 {
241 Free(ptr); 242 OPENSSL_free(ptr);
242 } 243 }
243 244
244void OBJ_NAME_cleanup(int type) 245void OBJ_NAME_cleanup(int type)
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index da6df3762a..4b1bb9583a 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -79,9 +79,9 @@ static ASN1_OBJECT *ln_objs[1];
79static ASN1_OBJECT *obj_objs[1]; 79static ASN1_OBJECT *obj_objs[1];
80#endif 80#endif
81 81
82static int sn_cmp(ASN1_OBJECT **a, ASN1_OBJECT **b); 82static int sn_cmp(const void *a, const void *b);
83static int ln_cmp(ASN1_OBJECT **a, ASN1_OBJECT **b); 83static int ln_cmp(const void *a, const void *b);
84static int obj_cmp(ASN1_OBJECT **a, ASN1_OBJECT **b); 84static int obj_cmp(const void *a, const void *b);
85#define ADDED_DATA 0 85#define ADDED_DATA 0
86#define ADDED_SNAME 1 86#define ADDED_SNAME 1
87#define ADDED_LNAME 2 87#define ADDED_LNAME 2
@@ -96,11 +96,17 @@ typedef struct added_obj_st
96static int new_nid=NUM_NID; 96static int new_nid=NUM_NID;
97static LHASH *added=NULL; 97static LHASH *added=NULL;
98 98
99static int sn_cmp(ASN1_OBJECT **ap, ASN1_OBJECT **bp) 99static int sn_cmp(const void *a, const void *b)
100 { return(strcmp((*ap)->sn,(*bp)->sn)); } 100 {
101 const ASN1_OBJECT * const *ap = a, * const *bp = b;
102 return(strcmp((*ap)->sn,(*bp)->sn));
103 }
101 104
102static int ln_cmp(ASN1_OBJECT **ap, ASN1_OBJECT **bp) 105static int ln_cmp(const void *a, const void *b)
103 { return(strcmp((*ap)->ln,(*bp)->ln)); } 106 {
107 const ASN1_OBJECT * const *ap = a, * const *bp = b;
108 return(strcmp((*ap)->ln,(*bp)->ln));
109 }
104 110
105static unsigned long add_hash(ADDED_OBJ *ca) 111static unsigned long add_hash(ADDED_OBJ *ca)
106 { 112 {
@@ -128,7 +134,8 @@ static unsigned long add_hash(ADDED_OBJ *ca)
128 ret=a->nid; 134 ret=a->nid;
129 break; 135 break;
130 default: 136 default:
131 abort(); 137 /* abort(); */
138 return 0;
132 } 139 }
133 ret&=0x3fffffffL; 140 ret&=0x3fffffffL;
134 ret|=ca->type<<30L; 141 ret|=ca->type<<30L;
@@ -161,7 +168,8 @@ static int add_cmp(ADDED_OBJ *ca, ADDED_OBJ *cb)
161 case ADDED_NID: 168 case ADDED_NID:
162 return(a->nid-b->nid); 169 return(a->nid-b->nid);
163 default: 170 default:
164 abort(); 171 /* abort(); */
172 return 0;
165 } 173 }
166 return(1); /* should not get here */ 174 return(1); /* should not get here */
167 } 175 }
@@ -188,7 +196,7 @@ static void cleanup3(ADDED_OBJ *a)
188 { 196 {
189 if (--a->obj->nid == 0) 197 if (--a->obj->nid == 0)
190 ASN1_OBJECT_free(a->obj); 198 ASN1_OBJECT_free(a->obj);
191 Free(a); 199 OPENSSL_free(a);
192 } 200 }
193 201
194void OBJ_cleanup(void) 202void OBJ_cleanup(void)
@@ -220,13 +228,13 @@ int OBJ_add_object(ASN1_OBJECT *obj)
220 if (added == NULL) 228 if (added == NULL)
221 if (!init_added()) return(0); 229 if (!init_added()) return(0);
222 if ((o=OBJ_dup(obj)) == NULL) goto err; 230 if ((o=OBJ_dup(obj)) == NULL) goto err;
223 ao[ADDED_NID]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); 231 ao[ADDED_NID]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
224 if ((o->length != 0) && (obj->data != NULL)) 232 if ((o->length != 0) && (obj->data != NULL))
225 ao[ADDED_DATA]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); 233 ao[ADDED_DATA]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
226 if (o->sn != NULL) 234 if (o->sn != NULL)
227 ao[ADDED_SNAME]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); 235 ao[ADDED_SNAME]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
228 if (o->ln != NULL) 236 if (o->ln != NULL)
229 ao[ADDED_LNAME]=(ADDED_OBJ *)Malloc(sizeof(ADDED_OBJ)); 237 ao[ADDED_LNAME]=(ADDED_OBJ *)OPENSSL_malloc(sizeof(ADDED_OBJ));
230 238
231 for (i=ADDED_DATA; i<=ADDED_NID; i++) 239 for (i=ADDED_DATA; i<=ADDED_NID; i++)
232 { 240 {
@@ -237,7 +245,7 @@ int OBJ_add_object(ASN1_OBJECT *obj)
237 aop=(ADDED_OBJ *)lh_insert(added,ao[i]); 245 aop=(ADDED_OBJ *)lh_insert(added,ao[i]);
238 /* memory leak, buit should not normally matter */ 246 /* memory leak, buit should not normally matter */
239 if (aop != NULL) 247 if (aop != NULL)
240 Free(aop); 248 OPENSSL_free(aop);
241 } 249 }
242 } 250 }
243 o->flags&= ~(ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS| 251 o->flags&= ~(ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|
@@ -246,8 +254,8 @@ int OBJ_add_object(ASN1_OBJECT *obj)
246 return(o->nid); 254 return(o->nid);
247err: 255err:
248 for (i=ADDED_DATA; i<=ADDED_NID; i++) 256 for (i=ADDED_DATA; i<=ADDED_NID; i++)
249 if (ao[i] != NULL) Free(ao[i]); 257 if (ao[i] != NULL) OPENSSL_free(ao[i]);
250 if (o != NULL) Free(o); 258 if (o != NULL) OPENSSL_free(o);
251 return(NID_undef); 259 return(NID_undef);
252 } 260 }
253 261
@@ -365,7 +373,7 @@ int OBJ_obj2nid(ASN1_OBJECT *a)
365 if (adp != NULL) return (adp->obj->nid); 373 if (adp != NULL) return (adp->obj->nid);
366 } 374 }
367 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ, 375 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&a,(char *)obj_objs,NUM_OBJ,
368 sizeof(ASN1_OBJECT *),(int (*)())obj_cmp); 376 sizeof(ASN1_OBJECT *),obj_cmp);
369 if (op == NULL) 377 if (op == NULL)
370 return(NID_undef); 378 return(NID_undef);
371 return((*op)->nid); 379 return((*op)->nid);
@@ -400,7 +408,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
400 /* Work out total size */ 408 /* Work out total size */
401 j = ASN1_object_size(0,i,V_ASN1_OBJECT); 409 j = ASN1_object_size(0,i,V_ASN1_OBJECT);
402 410
403 if((buf=(unsigned char *)Malloc(j)) == NULL) return NULL; 411 if((buf=(unsigned char *)OPENSSL_malloc(j)) == NULL) return NULL;
404 412
405 p = buf; 413 p = buf;
406 /* Write out tag+length */ 414 /* Write out tag+length */
@@ -410,7 +418,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name)
410 418
411 p=buf; 419 p=buf;
412 op=d2i_ASN1_OBJECT(NULL,&p,i); 420 op=d2i_ASN1_OBJECT(NULL,&p,i);
413 Free(buf); 421 OPENSSL_free(buf);
414 return op; 422 return op;
415 } 423 }
416 424
@@ -504,7 +512,7 @@ int OBJ_ln2nid(const char *s)
504 if (adp != NULL) return (adp->obj->nid); 512 if (adp != NULL) return (adp->obj->nid);
505 } 513 }
506 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN, 514 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)ln_objs,NUM_LN,
507 sizeof(ASN1_OBJECT *),(int (*)())ln_cmp); 515 sizeof(ASN1_OBJECT *),ln_cmp);
508 if (op == NULL) return(NID_undef); 516 if (op == NULL) return(NID_undef);
509 return((*op)->nid); 517 return((*op)->nid);
510 } 518 }
@@ -523,23 +531,23 @@ int OBJ_sn2nid(const char *s)
523 if (adp != NULL) return (adp->obj->nid); 531 if (adp != NULL) return (adp->obj->nid);
524 } 532 }
525 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)sn_objs,NUM_SN, 533 op=(ASN1_OBJECT **)OBJ_bsearch((char *)&oo,(char *)sn_objs,NUM_SN,
526 sizeof(ASN1_OBJECT *),(int (*)())sn_cmp); 534 sizeof(ASN1_OBJECT *),sn_cmp);
527 if (op == NULL) return(NID_undef); 535 if (op == NULL) return(NID_undef);
528 return((*op)->nid); 536 return((*op)->nid);
529 } 537 }
530 538
531static int obj_cmp(ASN1_OBJECT **ap, ASN1_OBJECT **bp) 539static int obj_cmp(const void *ap, const void *bp)
532 { 540 {
533 int j; 541 int j;
534 ASN1_OBJECT *a= *ap; 542 ASN1_OBJECT *a= *(ASN1_OBJECT **)ap;
535 ASN1_OBJECT *b= *bp; 543 ASN1_OBJECT *b= *(ASN1_OBJECT **)bp;
536 544
537 j=(a->length - b->length); 545 j=(a->length - b->length);
538 if (j) return(j); 546 if (j) return(j);
539 return(memcmp(a->data,b->data,a->length)); 547 return(memcmp(a->data,b->data,a->length));
540 } 548 }
541 549
542char *OBJ_bsearch(char *key, char *base, int num, int size, int (*cmp)()) 550char *OBJ_bsearch(char *key, char *base, int num, int size, int (*cmp)(const void *, const void *))
543 { 551 {
544 int l,h,i,c; 552 int l,h,i,c;
545 char *p; 553 char *p;
@@ -631,7 +639,7 @@ int OBJ_create(char *oid, char *sn, char *ln)
631 i=a2d_ASN1_OBJECT(NULL,0,oid,-1); 639 i=a2d_ASN1_OBJECT(NULL,0,oid,-1);
632 if (i <= 0) return(0); 640 if (i <= 0) return(0);
633 641
634 if ((buf=(unsigned char *)Malloc(i)) == NULL) 642 if ((buf=(unsigned char *)OPENSSL_malloc(i)) == NULL)
635 { 643 {
636 OBJerr(OBJ_F_OBJ_CREATE,OBJ_R_MALLOC_FAILURE); 644 OBJerr(OBJ_F_OBJ_CREATE,OBJ_R_MALLOC_FAILURE);
637 return(0); 645 return(0);
@@ -643,7 +651,7 @@ int OBJ_create(char *oid, char *sn, char *ln)
643 ok=OBJ_add_object(op); 651 ok=OBJ_add_object(op);
644err: 652err:
645 ASN1_OBJECT_free(op); 653 ASN1_OBJECT_free(op);
646 Free(buf); 654 OPENSSL_free(buf);
647 return(ok); 655 return(ok);
648 } 656 }
649 657
diff --git a/src/lib/libcrypto/objects/obj_dat.h.src b/src/lib/libcrypto/objects/obj_dat.h.src
new file mode 100644
index 0000000000..f0d824141c
--- /dev/null
+++ b/src/lib/libcrypto/objects/obj_dat.h.src
@@ -0,0 +1,2208 @@
1/* lib/obj/obj_dat.h */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59/* THIS FILE IS GENERATED FROM Objects.h by obj_dat.pl via the
60 * following command:
61 * perl obj_dat.pl objects.h obj_dat.h
62 */
63
64#define NUM_NID 393
65#define NUM_SN 392
66#define NUM_LN 392
67#define NUM_OBJ 366
68
69static unsigned char lvalues[2896]={
700x00, /* [ 0] OBJ_undef */
710x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */
720x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */
730x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02, /* [ 14] OBJ_md2 */
740x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x05, /* [ 22] OBJ_md5 */
750x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x04, /* [ 30] OBJ_rc4 */
760x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x01,/* [ 38] OBJ_rsaEncryption */
770x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x02,/* [ 47] OBJ_md2WithRSAEncryption */
780x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x04,/* [ 56] OBJ_md5WithRSAEncryption */
790x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x01,/* [ 65] OBJ_pbeWithMD2AndDES_CBC */
800x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x03,/* [ 74] OBJ_pbeWithMD5AndDES_CBC */
810x55, /* [ 83] OBJ_X500 */
820x55,0x04, /* [ 84] OBJ_X509 */
830x55,0x04,0x03, /* [ 86] OBJ_commonName */
840x55,0x04,0x06, /* [ 89] OBJ_countryName */
850x55,0x04,0x07, /* [ 92] OBJ_localityName */
860x55,0x04,0x08, /* [ 95] OBJ_stateOrProvinceName */
870x55,0x04,0x0A, /* [ 98] OBJ_organizationName */
880x55,0x04,0x0B, /* [101] OBJ_organizationalUnitName */
890x55,0x08,0x01,0x01, /* [104] OBJ_rsa */
900x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07, /* [108] OBJ_pkcs7 */
910x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x01,/* [116] OBJ_pkcs7_data */
920x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x02,/* [125] OBJ_pkcs7_signed */
930x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x03,/* [134] OBJ_pkcs7_enveloped */
940x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x04,/* [143] OBJ_pkcs7_signedAndEnveloped */
950x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x05,/* [152] OBJ_pkcs7_digest */
960x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x07,0x06,/* [161] OBJ_pkcs7_encrypted */
970x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x03, /* [170] OBJ_pkcs3 */
980x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x03,0x01,/* [178] OBJ_dhKeyAgreement */
990x2B,0x0E,0x03,0x02,0x06, /* [187] OBJ_des_ecb */
1000x2B,0x0E,0x03,0x02,0x09, /* [192] OBJ_des_cfb64 */
1010x2B,0x0E,0x03,0x02,0x07, /* [197] OBJ_des_cbc */
1020x2B,0x0E,0x03,0x02,0x11, /* [202] OBJ_des_ede */
1030x2B,0x06,0x01,0x04,0x01,0x81,0x3C,0x07,0x01,0x01,0x02,/* [207] OBJ_idea_cbc */
1040x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x02, /* [218] OBJ_rc2_cbc */
1050x2B,0x0E,0x03,0x02,0x12, /* [226] OBJ_sha */
1060x2B,0x0E,0x03,0x02,0x0F, /* [231] OBJ_shaWithRSAEncryption */
1070x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x07, /* [236] OBJ_des_ede3_cbc */
1080x2B,0x0E,0x03,0x02,0x08, /* [244] OBJ_des_ofb64 */
1090x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09, /* [249] OBJ_pkcs9 */
1100x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x01,/* [257] OBJ_pkcs9_emailAddress */
1110x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x02,/* [266] OBJ_pkcs9_unstructuredName */
1120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x03,/* [275] OBJ_pkcs9_contentType */
1130x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x04,/* [284] OBJ_pkcs9_messageDigest */
1140x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x05,/* [293] OBJ_pkcs9_signingTime */
1150x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x06,/* [302] OBJ_pkcs9_countersignature */
1160x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x07,/* [311] OBJ_pkcs9_challengePassword */
1170x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x08,/* [320] OBJ_pkcs9_unstructuredAddress */
1180x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x09,/* [329] OBJ_pkcs9_extCertAttributes */
1190x60,0x86,0x48,0x01,0x86,0xF8,0x42, /* [338] OBJ_netscape */
1200x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01, /* [345] OBJ_netscape_cert_extension */
1210x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x02, /* [353] OBJ_netscape_data_type */
1220x2B,0x0E,0x03,0x02,0x1A, /* [361] OBJ_sha1 */
1230x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x05,/* [366] OBJ_sha1WithRSAEncryption */
1240x2B,0x0E,0x03,0x02,0x0D, /* [375] OBJ_dsaWithSHA */
1250x2B,0x0E,0x03,0x02,0x0C, /* [380] OBJ_dsa_2 */
1260x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0B,/* [385] OBJ_pbeWithSHA1AndRC2_CBC */
1270x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0C,/* [394] OBJ_id_pbkdf2 */
1280x2B,0x0E,0x03,0x02,0x1B, /* [403] OBJ_dsaWithSHA1_2 */
1290x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x01,/* [408] OBJ_netscape_cert_type */
1300x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x02,/* [417] OBJ_netscape_base_url */
1310x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x03,/* [426] OBJ_netscape_revocation_url */
1320x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x04,/* [435] OBJ_netscape_ca_revocation_url */
1330x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x07,/* [444] OBJ_netscape_renewal_url */
1340x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x08,/* [453] OBJ_netscape_ca_policy_url */
1350x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0C,/* [462] OBJ_netscape_ssl_server_name */
1360x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x01,0x0D,/* [471] OBJ_netscape_comment */
1370x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x02,0x05,/* [480] OBJ_netscape_cert_sequence */
1380x55,0x1D, /* [489] OBJ_id_ce */
1390x55,0x1D,0x0E, /* [491] OBJ_subject_key_identifier */
1400x55,0x1D,0x0F, /* [494] OBJ_key_usage */
1410x55,0x1D,0x10, /* [497] OBJ_private_key_usage_period */
1420x55,0x1D,0x11, /* [500] OBJ_subject_alt_name */
1430x55,0x1D,0x12, /* [503] OBJ_issuer_alt_name */
1440x55,0x1D,0x13, /* [506] OBJ_basic_constraints */
1450x55,0x1D,0x14, /* [509] OBJ_crl_number */
1460x55,0x1D,0x20, /* [512] OBJ_certificate_policies */
1470x55,0x1D,0x23, /* [515] OBJ_authority_key_identifier */
1480x2B,0x06,0x01,0x04,0x01,0x97,0x55,0x01,0x02,/* [518] OBJ_bf_cbc */
1490x55,0x08,0x03,0x65, /* [527] OBJ_mdc2 */
1500x55,0x08,0x03,0x64, /* [531] OBJ_mdc2WithRSA */
1510x55,0x04,0x2A, /* [535] OBJ_givenName */
1520x55,0x04,0x04, /* [538] OBJ_surname */
1530x55,0x04,0x2B, /* [541] OBJ_initials */
1540x55,0x04,0x2D, /* [544] OBJ_uniqueIdentifier */
1550x55,0x1D,0x1F, /* [547] OBJ_crl_distribution_points */
1560x2B,0x0E,0x03,0x02,0x03, /* [550] OBJ_md5WithRSA */
1570x55,0x04,0x05, /* [555] OBJ_serialNumber */
1580x55,0x04,0x0C, /* [558] OBJ_title */
1590x55,0x04,0x0D, /* [561] OBJ_description */
1600x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0A,/* [564] OBJ_cast5_cbc */
1610x2A,0x86,0x48,0x86,0xF6,0x7D,0x07,0x42,0x0C,/* [573] OBJ_pbeWithMD5AndCast5_CBC */
1620x2A,0x86,0x48,0xCE,0x38,0x04,0x03, /* [582] OBJ_dsaWithSHA1 */
1630x2B,0x0E,0x03,0x02,0x1D, /* [589] OBJ_sha1WithRSA */
1640x2A,0x86,0x48,0xCE,0x38,0x04,0x01, /* [594] OBJ_dsa */
1650x2B,0x24,0x03,0x02,0x01, /* [601] OBJ_ripemd160 */
1660x2B,0x24,0x03,0x03,0x01,0x02, /* [606] OBJ_ripemd160WithRSA */
1670x2A,0x86,0x48,0x86,0xF7,0x0D,0x03,0x08, /* [612] OBJ_rc5_cbc */
1680x29,0x01,0x01,0x85,0x1A,0x01, /* [620] OBJ_rle_compression */
1690x29,0x01,0x01,0x85,0x1A,0x02, /* [626] OBJ_zlib_compression */
1700x55,0x1D,0x25, /* [632] OBJ_ext_key_usage */
1710x2B,0x06,0x01,0x05,0x05,0x07, /* [635] OBJ_id_pkix */
1720x2B,0x06,0x01,0x05,0x05,0x07,0x03, /* [641] OBJ_id_kp */
1730x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x01, /* [648] OBJ_server_auth */
1740x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x02, /* [656] OBJ_client_auth */
1750x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x03, /* [664] OBJ_code_sign */
1760x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x04, /* [672] OBJ_email_protect */
1770x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x08, /* [680] OBJ_time_stamp */
1780x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x15,/* [688] OBJ_ms_code_ind */
1790x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x16,/* [698] OBJ_ms_code_com */
1800x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x01,/* [708] OBJ_ms_ctl_sign */
1810x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x03,/* [718] OBJ_ms_sgc */
1820x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x0A,0x03,0x04,/* [728] OBJ_ms_efs */
1830x60,0x86,0x48,0x01,0x86,0xF8,0x42,0x04,0x01,/* [738] OBJ_ns_sgc */
1840x55,0x1D,0x1B, /* [747] OBJ_delta_crl */
1850x55,0x1D,0x15, /* [750] OBJ_crl_reason */
1860x55,0x1D,0x18, /* [753] OBJ_invalidity_date */
1870x2B,0x65,0x01,0x04,0x01, /* [756] OBJ_sxnet */
1880x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x01,/* [761] OBJ_pbe_WithSHA1And128BitRC4 */
1890x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x02,/* [771] OBJ_pbe_WithSHA1And40BitRC4 */
1900x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x03,/* [781] OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC */
1910x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x04,/* [791] OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC */
1920x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x05,/* [801] OBJ_pbe_WithSHA1And128BitRC2_CBC */
1930x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x01,0x06,/* [811] OBJ_pbe_WithSHA1And40BitRC2_CBC */
1940x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x01,/* [821] OBJ_keyBag */
1950x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x02,/* [832] OBJ_pkcs8ShroudedKeyBag */
1960x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x03,/* [843] OBJ_certBag */
1970x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x04,/* [854] OBJ_crlBag */
1980x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x05,/* [865] OBJ_secretBag */
1990x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x0C,0x0A,0x01,0x06,/* [876] OBJ_safeContentsBag */
2000x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x14,/* [887] OBJ_friendlyName */
2010x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x15,/* [896] OBJ_localKeyID */
2020x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x01,/* [905] OBJ_x509Certificate */
2030x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x16,0x02,/* [915] OBJ_sdsiCertificate */
2040x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x17,0x01,/* [925] OBJ_x509Crl */
2050x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0D,/* [935] OBJ_pbes2 */
2060x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0E,/* [944] OBJ_pbmac1 */
2070x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x07, /* [953] OBJ_hmacWithSHA1 */
2080x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x01, /* [961] OBJ_id_qt_cps */
2090x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x02, /* [969] OBJ_id_qt_unotice */
2100x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0F,/* [977] OBJ_SMIMECapabilities */
2110x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x04,/* [986] OBJ_pbeWithMD2AndRC2_CBC */
2120x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x06,/* [995] OBJ_pbeWithMD5AndRC2_CBC */
2130x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05,0x0A,/* [1004] OBJ_pbeWithSHA1AndDES_CBC */
2140x2B,0x06,0x01,0x04,0x01,0x82,0x37,0x02,0x01,0x0E,/* [1013] OBJ_ms_ext_req */
2150x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x0E,/* [1023] OBJ_ext_req */
2160x55,0x04,0x29, /* [1032] OBJ_name */
2170x55,0x04,0x2E, /* [1035] OBJ_dnQualifier */
2180x2B,0x06,0x01,0x05,0x05,0x07,0x01, /* [1038] OBJ_id_pe */
2190x2B,0x06,0x01,0x05,0x05,0x07,0x30, /* [1045] OBJ_id_ad */
2200x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x01, /* [1052] OBJ_info_access */
2210x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01, /* [1060] OBJ_ad_OCSP */
2220x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x02, /* [1068] OBJ_ad_ca_issuers */
2230x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x09, /* [1076] OBJ_OCSP_sign */
2240x28, /* [1084] OBJ_iso */
2250x2A, /* [1085] OBJ_member_body */
2260x2A,0x86,0x48, /* [1086] OBJ_ISO_US */
2270x2A,0x86,0x48,0xCE,0x38, /* [1089] OBJ_X9_57 */
2280x2A,0x86,0x48,0xCE,0x38,0x04, /* [1094] OBJ_X9cm */
2290x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01, /* [1100] OBJ_pkcs1 */
2300x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x05, /* [1108] OBJ_pkcs5 */
2310x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,/* [1116] OBJ_SMIME */
2320x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,/* [1125] OBJ_id_smime_mod */
2330x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,/* [1135] OBJ_id_smime_ct */
2340x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,/* [1145] OBJ_id_smime_aa */
2350x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,/* [1155] OBJ_id_smime_alg */
2360x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x04,/* [1165] OBJ_id_smime_cd */
2370x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,/* [1175] OBJ_id_smime_spq */
2380x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,/* [1185] OBJ_id_smime_cti */
2390x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x01,/* [1195] OBJ_id_smime_mod_cms */
2400x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x02,/* [1206] OBJ_id_smime_mod_ess */
2410x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x03,/* [1217] OBJ_id_smime_mod_oid */
2420x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x04,/* [1228] OBJ_id_smime_mod_msg_v3 */
2430x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x05,/* [1239] OBJ_id_smime_mod_ets_eSignature_88 */
2440x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x06,/* [1250] OBJ_id_smime_mod_ets_eSignature_97 */
2450x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x07,/* [1261] OBJ_id_smime_mod_ets_eSigPolicy_88 */
2460x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x00,0x08,/* [1272] OBJ_id_smime_mod_ets_eSigPolicy_97 */
2470x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x01,/* [1283] OBJ_id_smime_ct_receipt */
2480x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x02,/* [1294] OBJ_id_smime_ct_authData */
2490x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x03,/* [1305] OBJ_id_smime_ct_publishCert */
2500x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x04,/* [1316] OBJ_id_smime_ct_TSTInfo */
2510x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x05,/* [1327] OBJ_id_smime_ct_TDTInfo */
2520x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x06,/* [1338] OBJ_id_smime_ct_contentInfo */
2530x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x07,/* [1349] OBJ_id_smime_ct_DVCSRequestData */
2540x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x01,0x08,/* [1360] OBJ_id_smime_ct_DVCSResponseData */
2550x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x01,/* [1371] OBJ_id_smime_aa_receiptRequest */
2560x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x02,/* [1382] OBJ_id_smime_aa_securityLabel */
2570x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x03,/* [1393] OBJ_id_smime_aa_mlExpandHistory */
2580x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x04,/* [1404] OBJ_id_smime_aa_contentHint */
2590x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x05,/* [1415] OBJ_id_smime_aa_msgSigDigest */
2600x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x06,/* [1426] OBJ_id_smime_aa_encapContentType */
2610x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x07,/* [1437] OBJ_id_smime_aa_contentIdentifier */
2620x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x08,/* [1448] OBJ_id_smime_aa_macValue */
2630x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x09,/* [1459] OBJ_id_smime_aa_equivalentLabels */
2640x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0A,/* [1470] OBJ_id_smime_aa_contentReference */
2650x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0B,/* [1481] OBJ_id_smime_aa_encrypKeyPref */
2660x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0C,/* [1492] OBJ_id_smime_aa_signingCertificate */
2670x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0D,/* [1503] OBJ_id_smime_aa_smimeEncryptCerts */
2680x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0E,/* [1514] OBJ_id_smime_aa_timeStampToken */
2690x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x0F,/* [1525] OBJ_id_smime_aa_ets_sigPolicyId */
2700x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x10,/* [1536] OBJ_id_smime_aa_ets_commitmentType */
2710x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x11,/* [1547] OBJ_id_smime_aa_ets_signerLocation */
2720x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x12,/* [1558] OBJ_id_smime_aa_ets_signerAttr */
2730x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x13,/* [1569] OBJ_id_smime_aa_ets_otherSigCert */
2740x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x14,/* [1580] OBJ_id_smime_aa_ets_contentTimestamp */
2750x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x15,/* [1591] OBJ_id_smime_aa_ets_CertificateRefs */
2760x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x16,/* [1602] OBJ_id_smime_aa_ets_RevocationRefs */
2770x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x17,/* [1613] OBJ_id_smime_aa_ets_certValues */
2780x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x18,/* [1624] OBJ_id_smime_aa_ets_revocationValues */
2790x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x19,/* [1635] OBJ_id_smime_aa_ets_escTimeStamp */
2800x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1A,/* [1646] OBJ_id_smime_aa_ets_certCRLTimestamp */
2810x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1B,/* [1657] OBJ_id_smime_aa_ets_archiveTimeStamp */
2820x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1C,/* [1668] OBJ_id_smime_aa_signatureType */
2830x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x02,0x1D,/* [1679] OBJ_id_smime_aa_dvcs_dvc */
2840x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x01,/* [1690] OBJ_id_smime_alg_ESDHwith3DES */
2850x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x02,/* [1701] OBJ_id_smime_alg_ESDHwithRC2 */
2860x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x03,/* [1712] OBJ_id_smime_alg_3DESwrap */
2870x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x04,/* [1723] OBJ_id_smime_alg_RC2wrap */
2880x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x05,/* [1734] OBJ_id_smime_alg_ESDH */
2890x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x06,/* [1745] OBJ_id_smime_alg_CMS3DESwrap */
2900x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x07,/* [1756] OBJ_id_smime_alg_CMSRC2wrap */
2910x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x04,0x01,/* [1767] OBJ_id_smime_cd_ldap */
2920x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,0x01,/* [1778] OBJ_id_smime_spq_ets_sqt_uri */
2930x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x05,0x02,/* [1789] OBJ_id_smime_spq_ets_sqt_unotice */
2940x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x01,/* [1800] OBJ_id_smime_cti_ets_proofOfOrigin */
2950x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x02,/* [1811] OBJ_id_smime_cti_ets_proofOfReceipt */
2960x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x03,/* [1822] OBJ_id_smime_cti_ets_proofOfDelivery */
2970x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x04,/* [1833] OBJ_id_smime_cti_ets_proofOfSender */
2980x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x05,/* [1844] OBJ_id_smime_cti_ets_proofOfApproval */
2990x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x06,0x06,/* [1855] OBJ_id_smime_cti_ets_proofOfCreation */
3000x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x04, /* [1866] OBJ_md4 */
3010x2B,0x06,0x01,0x05,0x05,0x07,0x00, /* [1874] OBJ_id_pkix_mod */
3020x2B,0x06,0x01,0x05,0x05,0x07,0x02, /* [1881] OBJ_id_qt */
3030x2B,0x06,0x01,0x05,0x05,0x07,0x04, /* [1888] OBJ_id_it */
3040x2B,0x06,0x01,0x05,0x05,0x07,0x05, /* [1895] OBJ_id_pkip */
3050x2B,0x06,0x01,0x05,0x05,0x07,0x06, /* [1902] OBJ_id_alg */
3060x2B,0x06,0x01,0x05,0x05,0x07,0x07, /* [1909] OBJ_id_cmc */
3070x2B,0x06,0x01,0x05,0x05,0x07,0x08, /* [1916] OBJ_id_on */
3080x2B,0x06,0x01,0x05,0x05,0x07,0x09, /* [1923] OBJ_id_pda */
3090x2B,0x06,0x01,0x05,0x05,0x07,0x0A, /* [1930] OBJ_id_aca */
3100x2B,0x06,0x01,0x05,0x05,0x07,0x0B, /* [1937] OBJ_id_qcs */
3110x2B,0x06,0x01,0x05,0x05,0x07,0x0C, /* [1944] OBJ_id_cct */
3120x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x01, /* [1951] OBJ_id_pkix1_explicit_88 */
3130x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x02, /* [1959] OBJ_id_pkix1_implicit_88 */
3140x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x03, /* [1967] OBJ_id_pkix1_explicit_93 */
3150x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x04, /* [1975] OBJ_id_pkix1_implicit_93 */
3160x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x05, /* [1983] OBJ_id_mod_crmf */
3170x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x06, /* [1991] OBJ_id_mod_cmc */
3180x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x07, /* [1999] OBJ_id_mod_kea_profile_88 */
3190x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x08, /* [2007] OBJ_id_mod_kea_profile_93 */
3200x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x09, /* [2015] OBJ_id_mod_cmp */
3210x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0A, /* [2023] OBJ_id_mod_qualified_cert_88 */
3220x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0B, /* [2031] OBJ_id_mod_qualified_cert_93 */
3230x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0C, /* [2039] OBJ_id_mod_attribute_cert */
3240x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0D, /* [2047] OBJ_id_mod_timestamp_protocol */
3250x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0E, /* [2055] OBJ_id_mod_ocsp */
3260x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x0F, /* [2063] OBJ_id_mod_dvcs */
3270x2B,0x06,0x01,0x05,0x05,0x07,0x00,0x10, /* [2071] OBJ_id_mod_cmp2000 */
3280x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x02, /* [2079] OBJ_biometricInfo */
3290x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x03, /* [2087] OBJ_qcStatements */
3300x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x04, /* [2095] OBJ_ac_auditEntity */
3310x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x05, /* [2103] OBJ_ac_targeting */
3320x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x06, /* [2111] OBJ_aaControls */
3330x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x07, /* [2119] OBJ_sbqp_ipAddrBlock */
3340x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x08, /* [2127] OBJ_sbqp_autonomousSysNum */
3350x2B,0x06,0x01,0x05,0x05,0x07,0x01,0x09, /* [2135] OBJ_sbqp_routerIdentifier */
3360x2B,0x06,0x01,0x05,0x05,0x07,0x02,0x03, /* [2143] OBJ_textNotice */
3370x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x05, /* [2151] OBJ_ipsecEndSystem */
3380x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x06, /* [2159] OBJ_ipsecTunnel */
3390x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x07, /* [2167] OBJ_ipsecUser */
3400x2B,0x06,0x01,0x05,0x05,0x07,0x03,0x0A, /* [2175] OBJ_dvcs */
3410x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x01, /* [2183] OBJ_id_it_caProtEncCert */
3420x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x02, /* [2191] OBJ_id_it_signKeyPairTypes */
3430x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x03, /* [2199] OBJ_id_it_encKeyPairTypes */
3440x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x04, /* [2207] OBJ_id_it_preferredSymmAlg */
3450x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x05, /* [2215] OBJ_id_it_caKeyUpdateInfo */
3460x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x06, /* [2223] OBJ_id_it_currentCRL */
3470x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x07, /* [2231] OBJ_id_it_unsupportedOIDs */
3480x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x08, /* [2239] OBJ_id_it_subscriptionRequest */
3490x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x09, /* [2247] OBJ_id_it_subscriptionResponse */
3500x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0A, /* [2255] OBJ_id_it_keyPairParamReq */
3510x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0B, /* [2263] OBJ_id_it_keyPairParamRep */
3520x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0C, /* [2271] OBJ_id_it_revPassphrase */
3530x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0D, /* [2279] OBJ_id_it_implicitConfirm */
3540x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0E, /* [2287] OBJ_id_it_confirmWaitTime */
3550x2B,0x06,0x01,0x05,0x05,0x07,0x04,0x0F, /* [2295] OBJ_id_it_origPKIMessage */
3560x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01, /* [2303] OBJ_id_regCtrl */
3570x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02, /* [2311] OBJ_id_regInfo */
3580x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x01,/* [2319] OBJ_id_regCtrl_regToken */
3590x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x02,/* [2328] OBJ_id_regCtrl_authenticator */
3600x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x03,/* [2337] OBJ_id_regCtrl_pkiPublicationInfo */
3610x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x04,/* [2346] OBJ_id_regCtrl_pkiArchiveOptions */
3620x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x05,/* [2355] OBJ_id_regCtrl_oldCertID */
3630x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x01,0x06,/* [2364] OBJ_id_regCtrl_protocolEncrKey */
3640x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,0x01,/* [2373] OBJ_id_regInfo_utf8Pairs */
3650x2B,0x06,0x01,0x05,0x05,0x07,0x05,0x02,0x02,/* [2382] OBJ_id_regInfo_certReq */
3660x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x01, /* [2391] OBJ_id_alg_des40 */
3670x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x02, /* [2399] OBJ_id_alg_noSignature */
3680x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x03, /* [2407] OBJ_id_alg_dh_sig_hmac_sha1 */
3690x2B,0x06,0x01,0x05,0x05,0x07,0x06,0x04, /* [2415] OBJ_id_alg_dh_pop */
3700x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x01, /* [2423] OBJ_id_cmc_statusInfo */
3710x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x02, /* [2431] OBJ_id_cmc_identification */
3720x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x03, /* [2439] OBJ_id_cmc_identityProof */
3730x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x04, /* [2447] OBJ_id_cmc_dataReturn */
3740x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x05, /* [2455] OBJ_id_cmc_transactionId */
3750x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x06, /* [2463] OBJ_id_cmc_senderNonce */
3760x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x07, /* [2471] OBJ_id_cmc_recipientNonce */
3770x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x08, /* [2479] OBJ_id_cmc_addExtensions */
3780x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x09, /* [2487] OBJ_id_cmc_encryptedPOP */
3790x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0A, /* [2495] OBJ_id_cmc_decryptedPOP */
3800x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0B, /* [2503] OBJ_id_cmc_lraPOPWitness */
3810x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x0F, /* [2511] OBJ_id_cmc_getCert */
3820x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x10, /* [2519] OBJ_id_cmc_getCRL */
3830x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x11, /* [2527] OBJ_id_cmc_revokeRequest */
3840x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x12, /* [2535] OBJ_id_cmc_regInfo */
3850x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x13, /* [2543] OBJ_id_cmc_responseInfo */
3860x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x15, /* [2551] OBJ_id_cmc_queryPending */
3870x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x16, /* [2559] OBJ_id_cmc_popLinkRandom */
3880x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x17, /* [2567] OBJ_id_cmc_popLinkWitness */
3890x2B,0x06,0x01,0x05,0x05,0x07,0x07,0x18, /* [2575] OBJ_id_cmc_confirmCertAcceptance */
3900x2B,0x06,0x01,0x05,0x05,0x07,0x08,0x01, /* [2583] OBJ_id_on_personalData */
3910x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x01, /* [2591] OBJ_id_pda_dateOfBirth */
3920x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x02, /* [2599] OBJ_id_pda_placeOfBirth */
3930x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x03, /* [2607] OBJ_id_pda_pseudonym */
3940x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x04, /* [2615] OBJ_id_pda_gender */
3950x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x05, /* [2623] OBJ_id_pda_countryOfCitizenship */
3960x2B,0x06,0x01,0x05,0x05,0x07,0x09,0x06, /* [2631] OBJ_id_pda_countryOfResidence */
3970x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x01, /* [2639] OBJ_id_aca_authenticationInfo */
3980x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x02, /* [2647] OBJ_id_aca_accessIdentity */
3990x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x03, /* [2655] OBJ_id_aca_chargingIdentity */
4000x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x04, /* [2663] OBJ_id_aca_group */
4010x2B,0x06,0x01,0x05,0x05,0x07,0x0A,0x05, /* [2671] OBJ_id_aca_role */
4020x2B,0x06,0x01,0x05,0x05,0x07,0x0B,0x01, /* [2679] OBJ_id_qcs_pkixQCSyntax_v1 */
4030x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x01, /* [2687] OBJ_id_cct_crs */
4040x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x02, /* [2695] OBJ_id_cct_PKIData */
4050x2B,0x06,0x01,0x05,0x05,0x07,0x0C,0x03, /* [2703] OBJ_id_cct_PKIResponse */
4060x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x03, /* [2711] OBJ_ad_timeStamping */
4070x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x04, /* [2719] OBJ_ad_dvcs */
4080x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x01,/* [2727] OBJ_id_pkix_OCSP_basic */
4090x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x02,/* [2736] OBJ_id_pkix_OCSP_Nonce */
4100x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x03,/* [2745] OBJ_id_pkix_OCSP_CrlID */
4110x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x04,/* [2754] OBJ_id_pkix_OCSP_acceptableResponses */
4120x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x05,/* [2763] OBJ_id_pkix_OCSP_noCheck */
4130x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x06,/* [2772] OBJ_id_pkix_OCSP_archiveCutoff */
4140x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x07,/* [2781] OBJ_id_pkix_OCSP_serviceLocator */
4150x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x08,/* [2790] OBJ_id_pkix_OCSP_extendedStatus */
4160x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x09,/* [2799] OBJ_id_pkix_OCSP_valid */
4170x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x0A,/* [2808] OBJ_id_pkix_OCSP_path */
4180x2B,0x06,0x01,0x05,0x05,0x07,0x30,0x01,0x0B,/* [2817] OBJ_id_pkix_OCSP_trustRoot */
4190x2B,0x0E,0x03,0x02, /* [2826] OBJ_algorithm */
4200x2B,0x0E,0x03,0x02,0x0B, /* [2830] OBJ_rsaSignature */
4210x55,0x08, /* [2835] OBJ_X500algorithms */
4220x2B, /* [2837] OBJ_org */
4230x2B,0x06, /* [2838] OBJ_dod */
4240x2B,0x06,0x01, /* [2840] OBJ_iana */
4250x2B,0x06,0x01,0x01, /* [2843] OBJ_Directory */
4260x2B,0x06,0x01,0x02, /* [2847] OBJ_Management */
4270x2B,0x06,0x01,0x03, /* [2851] OBJ_Experimental */
4280x2B,0x06,0x01,0x04, /* [2855] OBJ_Private */
4290x2B,0x06,0x01,0x05, /* [2859] OBJ_Security */
4300x2B,0x06,0x01,0x06, /* [2863] OBJ_SNMPv2 */
4310x2B,0x06,0x01,0x07, /* [2867] OBJ_Mail */
4320x01, /* [2871] OBJ_Enterprises */
4330xBA,0x82,0x58, /* [2872] OBJ_dcObject */
4340x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x01,0x19,/* [2875] OBJ_domainComponent */
4350x09,0x92,0x26,0x89,0x93,0xF2,0x2C,0x64,0x04,0x0D,/* [2885] OBJ_Domain */
436};
437
438static ASN1_OBJECT nid_objs[NUM_NID]={
439{"UNDEF","undefined",NID_undef,1,&(lvalues[0]),0},
440{"rsadsi","RSA Data Security, Inc.",NID_rsadsi,6,&(lvalues[1]),0},
441{"pkcs","RSA Data Security, Inc. PKCS",NID_pkcs,7,&(lvalues[7]),0},
442{"MD2","md2",NID_md2,8,&(lvalues[14]),0},
443{"MD5","md5",NID_md5,8,&(lvalues[22]),0},
444{"RC4","rc4",NID_rc4,8,&(lvalues[30]),0},
445{"rsaEncryption","rsaEncryption",NID_rsaEncryption,9,&(lvalues[38]),0},
446{"RSA-MD2","md2WithRSAEncryption",NID_md2WithRSAEncryption,9,
447 &(lvalues[47]),0},
448{"RSA-MD5","md5WithRSAEncryption",NID_md5WithRSAEncryption,9,
449 &(lvalues[56]),0},
450{"PBE-MD2-DES","pbeWithMD2AndDES-CBC",NID_pbeWithMD2AndDES_CBC,9,
451 &(lvalues[65]),0},
452{"PBE-MD5-DES","pbeWithMD5AndDES-CBC",NID_pbeWithMD5AndDES_CBC,9,
453 &(lvalues[74]),0},
454{"X500","directory services (X.500)",NID_X500,1,&(lvalues[83]),0},
455{"X509","X509",NID_X509,2,&(lvalues[84]),0},
456{"CN","commonName",NID_commonName,3,&(lvalues[86]),0},
457{"C","countryName",NID_countryName,3,&(lvalues[89]),0},
458{"L","localityName",NID_localityName,3,&(lvalues[92]),0},
459{"ST","stateOrProvinceName",NID_stateOrProvinceName,3,&(lvalues[95]),0},
460{"O","organizationName",NID_organizationName,3,&(lvalues[98]),0},
461{"OU","organizationalUnitName",NID_organizationalUnitName,3,
462 &(lvalues[101]),0},
463{"RSA","rsa",NID_rsa,4,&(lvalues[104]),0},
464{"pkcs7","pkcs7",NID_pkcs7,8,&(lvalues[108]),0},
465{"pkcs7-data","pkcs7-data",NID_pkcs7_data,9,&(lvalues[116]),0},
466{"pkcs7-signedData","pkcs7-signedData",NID_pkcs7_signed,9,
467 &(lvalues[125]),0},
468{"pkcs7-envelopedData","pkcs7-envelopedData",NID_pkcs7_enveloped,9,
469 &(lvalues[134]),0},
470{"pkcs7-signedAndEnvelopedData","pkcs7-signedAndEnvelopedData",
471 NID_pkcs7_signedAndEnveloped,9,&(lvalues[143]),0},
472{"pkcs7-digestData","pkcs7-digestData",NID_pkcs7_digest,9,
473 &(lvalues[152]),0},
474{"pkcs7-encryptedData","pkcs7-encryptedData",NID_pkcs7_encrypted,9,
475 &(lvalues[161]),0},
476{"pkcs3","pkcs3",NID_pkcs3,8,&(lvalues[170]),0},
477{"dhKeyAgreement","dhKeyAgreement",NID_dhKeyAgreement,9,
478 &(lvalues[178]),0},
479{"DES-ECB","des-ecb",NID_des_ecb,5,&(lvalues[187]),0},
480{"DES-CFB","des-cfb",NID_des_cfb64,5,&(lvalues[192]),0},
481{"DES-CBC","des-cbc",NID_des_cbc,5,&(lvalues[197]),0},
482{"DES-EDE","des-ede",NID_des_ede,5,&(lvalues[202]),0},
483{"DES-EDE3","des-ede3",NID_des_ede3,0,NULL},
484{"IDEA-CBC","idea-cbc",NID_idea_cbc,11,&(lvalues[207]),0},
485{"IDEA-CFB","idea-cfb",NID_idea_cfb64,0,NULL},
486{"IDEA-ECB","idea-ecb",NID_idea_ecb,0,NULL},
487{"RC2-CBC","rc2-cbc",NID_rc2_cbc,8,&(lvalues[218]),0},
488{"RC2-ECB","rc2-ecb",NID_rc2_ecb,0,NULL},
489{"RC2-CFB","rc2-cfb",NID_rc2_cfb64,0,NULL},
490{"RC2-OFB","rc2-ofb",NID_rc2_ofb64,0,NULL},
491{"SHA","sha",NID_sha,5,&(lvalues[226]),0},
492{"RSA-SHA","shaWithRSAEncryption",NID_shaWithRSAEncryption,5,
493 &(lvalues[231]),0},
494{"DES-EDE-CBC","des-ede-cbc",NID_des_ede_cbc,0,NULL},
495{"DES-EDE3-CBC","des-ede3-cbc",NID_des_ede3_cbc,8,&(lvalues[236]),0},
496{"DES-OFB","des-ofb",NID_des_ofb64,5,&(lvalues[244]),0},
497{"IDEA-OFB","idea-ofb",NID_idea_ofb64,0,NULL},
498{"pkcs9","pkcs9",NID_pkcs9,8,&(lvalues[249]),0},
499{"Email","emailAddress",NID_pkcs9_emailAddress,9,&(lvalues[257]),0},
500{"unstructuredName","unstructuredName",NID_pkcs9_unstructuredName,9,
501 &(lvalues[266]),0},
502{"contentType","contentType",NID_pkcs9_contentType,9,&(lvalues[275]),0},
503{"messageDigest","messageDigest",NID_pkcs9_messageDigest,9,
504 &(lvalues[284]),0},
505{"signingTime","signingTime",NID_pkcs9_signingTime,9,&(lvalues[293]),0},
506{"countersignature","countersignature",NID_pkcs9_countersignature,9,
507 &(lvalues[302]),0},
508{"challengePassword","challengePassword",NID_pkcs9_challengePassword,
509 9,&(lvalues[311]),0},
510{"unstructuredAddress","unstructuredAddress",
511 NID_pkcs9_unstructuredAddress,9,&(lvalues[320]),0},
512{"extendedCertificateAttributes","extendedCertificateAttributes",
513 NID_pkcs9_extCertAttributes,9,&(lvalues[329]),0},
514{"Netscape","Netscape Communications Corp.",NID_netscape,7,
515 &(lvalues[338]),0},
516{"nsCertExt","Netscape Certificate Extension",
517 NID_netscape_cert_extension,8,&(lvalues[345]),0},
518{"nsDataType","Netscape Data Type",NID_netscape_data_type,8,
519 &(lvalues[353]),0},
520{"DES-EDE-CFB","des-ede-cfb",NID_des_ede_cfb64,0,NULL},
521{"DES-EDE3-CFB","des-ede3-cfb",NID_des_ede3_cfb64,0,NULL},
522{"DES-EDE-OFB","des-ede-ofb",NID_des_ede_ofb64,0,NULL},
523{"DES-EDE3-OFB","des-ede3-ofb",NID_des_ede3_ofb64,0,NULL},
524{"SHA1","sha1",NID_sha1,5,&(lvalues[361]),0},
525{"RSA-SHA1","sha1WithRSAEncryption",NID_sha1WithRSAEncryption,9,
526 &(lvalues[366]),0},
527{"DSA-SHA","dsaWithSHA",NID_dsaWithSHA,5,&(lvalues[375]),0},
528{"DSA-old","dsaEncryption-old",NID_dsa_2,5,&(lvalues[380]),0},
529{"PBE-SHA1-RC2-64","pbeWithSHA1AndRC2-CBC",NID_pbeWithSHA1AndRC2_CBC,
530 9,&(lvalues[385]),0},
531{"PBKDF2","PBKDF2",NID_id_pbkdf2,9,&(lvalues[394]),0},
532{"DSA-SHA1-old","dsaWithSHA1-old",NID_dsaWithSHA1_2,5,&(lvalues[403]),0},
533{"nsCertType","Netscape Cert Type",NID_netscape_cert_type,9,
534 &(lvalues[408]),0},
535{"nsBaseUrl","Netscape Base Url",NID_netscape_base_url,9,
536 &(lvalues[417]),0},
537{"nsRevocationUrl","Netscape Revocation Url",
538 NID_netscape_revocation_url,9,&(lvalues[426]),0},
539{"nsCaRevocationUrl","Netscape CA Revocation Url",
540 NID_netscape_ca_revocation_url,9,&(lvalues[435]),0},
541{"nsRenewalUrl","Netscape Renewal Url",NID_netscape_renewal_url,9,
542 &(lvalues[444]),0},
543{"nsCaPolicyUrl","Netscape CA Policy Url",NID_netscape_ca_policy_url,
544 9,&(lvalues[453]),0},
545{"nsSslServerName","Netscape SSL Server Name",
546 NID_netscape_ssl_server_name,9,&(lvalues[462]),0},
547{"nsComment","Netscape Comment",NID_netscape_comment,9,&(lvalues[471]),0},
548{"nsCertSequence","Netscape Certificate Sequence",
549 NID_netscape_cert_sequence,9,&(lvalues[480]),0},
550{"DESX-CBC","desx-cbc",NID_desx_cbc,0,NULL},
551{"id-ce","id-ce",NID_id_ce,2,&(lvalues[489]),0},
552{"subjectKeyIdentifier","X509v3 Subject Key Identifier",
553 NID_subject_key_identifier,3,&(lvalues[491]),0},
554{"keyUsage","X509v3 Key Usage",NID_key_usage,3,&(lvalues[494]),0},
555{"privateKeyUsagePeriod","X509v3 Private Key Usage Period",
556 NID_private_key_usage_period,3,&(lvalues[497]),0},
557{"subjectAltName","X509v3 Subject Alternative Name",
558 NID_subject_alt_name,3,&(lvalues[500]),0},
559{"issuerAltName","X509v3 Issuer Alternative Name",NID_issuer_alt_name,
560 3,&(lvalues[503]),0},
561{"basicConstraints","X509v3 Basic Constraints",NID_basic_constraints,
562 3,&(lvalues[506]),0},
563{"crlNumber","X509v3 CRL Number",NID_crl_number,3,&(lvalues[509]),0},
564{"certificatePolicies","X509v3 Certificate Policies",
565 NID_certificate_policies,3,&(lvalues[512]),0},
566{"authorityKeyIdentifier","X509v3 Authority Key Identifier",
567 NID_authority_key_identifier,3,&(lvalues[515]),0},
568{"BF-CBC","bf-cbc",NID_bf_cbc,9,&(lvalues[518]),0},
569{"BF-ECB","bf-ecb",NID_bf_ecb,0,NULL},
570{"BF-CFB","bf-cfb",NID_bf_cfb64,0,NULL},
571{"BF-OFB","bf-ofb",NID_bf_ofb64,0,NULL},
572{"MDC2","mdc2",NID_mdc2,4,&(lvalues[527]),0},
573{"RSA-MDC2","mdc2WithRSA",NID_mdc2WithRSA,4,&(lvalues[531]),0},
574{"RC4-40","rc4-40",NID_rc4_40,0,NULL},
575{"RC2-40-CBC","rc2-40-cbc",NID_rc2_40_cbc,0,NULL},
576{"G","givenName",NID_givenName,3,&(lvalues[535]),0},
577{"S","surname",NID_surname,3,&(lvalues[538]),0},
578{"I","initials",NID_initials,3,&(lvalues[541]),0},
579{"UID","uniqueIdentifier",NID_uniqueIdentifier,3,&(lvalues[544]),0},
580{"crlDistributionPoints","X509v3 CRL Distribution Points",
581 NID_crl_distribution_points,3,&(lvalues[547]),0},
582{"RSA-NP-MD5","md5WithRSA",NID_md5WithRSA,5,&(lvalues[550]),0},
583{"SN","serialNumber",NID_serialNumber,3,&(lvalues[555]),0},
584{"T","title",NID_title,3,&(lvalues[558]),0},
585{"D","description",NID_description,3,&(lvalues[561]),0},
586{"CAST5-CBC","cast5-cbc",NID_cast5_cbc,9,&(lvalues[564]),0},
587{"CAST5-ECB","cast5-ecb",NID_cast5_ecb,0,NULL},
588{"CAST5-CFB","cast5-cfb",NID_cast5_cfb64,0,NULL},
589{"CAST5-OFB","cast5-ofb",NID_cast5_ofb64,0,NULL},
590{"pbeWithMD5AndCast5CBC","pbeWithMD5AndCast5CBC",
591 NID_pbeWithMD5AndCast5_CBC,9,&(lvalues[573]),0},
592{"DSA-SHA1","dsaWithSHA1",NID_dsaWithSHA1,7,&(lvalues[582]),0},
593{"MD5-SHA1","md5-sha1",NID_md5_sha1,0,NULL},
594{"RSA-SHA1-2","sha1WithRSA",NID_sha1WithRSA,5,&(lvalues[589]),0},
595{"DSA","dsaEncryption",NID_dsa,7,&(lvalues[594]),0},
596{"RIPEMD160","ripemd160",NID_ripemd160,5,&(lvalues[601]),0},
597{NULL,NULL,NID_undef,0,NULL},
598{"RSA-RIPEMD160","ripemd160WithRSA",NID_ripemd160WithRSA,6,
599 &(lvalues[606]),0},
600{"RC5-CBC","rc5-cbc",NID_rc5_cbc,8,&(lvalues[612]),0},
601{"RC5-ECB","rc5-ecb",NID_rc5_ecb,0,NULL},
602{"RC5-CFB","rc5-cfb",NID_rc5_cfb64,0,NULL},
603{"RC5-OFB","rc5-ofb",NID_rc5_ofb64,0,NULL},
604{"RLE","run length compression",NID_rle_compression,6,&(lvalues[620]),0},
605{"ZLIB","zlib compression",NID_zlib_compression,6,&(lvalues[626]),0},
606{"extendedKeyUsage","X509v3 Extended Key Usage",NID_ext_key_usage,3,
607 &(lvalues[632]),0},
608{"PKIX","PKIX",NID_id_pkix,6,&(lvalues[635]),0},
609{"id-kp","id-kp",NID_id_kp,7,&(lvalues[641]),0},
610{"serverAuth","TLS Web Server Authentication",NID_server_auth,8,
611 &(lvalues[648]),0},
612{"clientAuth","TLS Web Client Authentication",NID_client_auth,8,
613 &(lvalues[656]),0},
614{"codeSigning","Code Signing",NID_code_sign,8,&(lvalues[664]),0},
615{"emailProtection","E-mail Protection",NID_email_protect,8,
616 &(lvalues[672]),0},
617{"timeStamping","Time Stamping",NID_time_stamp,8,&(lvalues[680]),0},
618{"msCodeInd","Microsoft Individual Code Signing",NID_ms_code_ind,10,
619 &(lvalues[688]),0},
620{"msCodeCom","Microsoft Commercial Code Signing",NID_ms_code_com,10,
621 &(lvalues[698]),0},
622{"msCTLSign","Microsoft Trust List Signing",NID_ms_ctl_sign,10,
623 &(lvalues[708]),0},
624{"msSGC","Microsoft Server Gated Crypto",NID_ms_sgc,10,&(lvalues[718]),0},
625{"msEFS","Microsoft Encrypted File System",NID_ms_efs,10,
626 &(lvalues[728]),0},
627{"nsSGC","Netscape Server Gated Crypto",NID_ns_sgc,9,&(lvalues[738]),0},
628{"deltaCRL","X509v3 Delta CRL Indicator",NID_delta_crl,3,
629 &(lvalues[747]),0},
630{"CRLReason","X509v3 CRL Reason Code",NID_crl_reason,3,&(lvalues[750]),0},
631{"invalidityDate","Invalidity Date",NID_invalidity_date,3,
632 &(lvalues[753]),0},
633{"SXNetID","Strong Extranet ID",NID_sxnet,5,&(lvalues[756]),0},
634{"PBE-SHA1-RC4-128","pbeWithSHA1And128BitRC4",
635 NID_pbe_WithSHA1And128BitRC4,10,&(lvalues[761]),0},
636{"PBE-SHA1-RC4-40","pbeWithSHA1And40BitRC4",
637 NID_pbe_WithSHA1And40BitRC4,10,&(lvalues[771]),0},
638{"PBE-SHA1-3DES","pbeWithSHA1And3-KeyTripleDES-CBC",
639 NID_pbe_WithSHA1And3_Key_TripleDES_CBC,10,&(lvalues[781]),0},
640{"PBE-SHA1-2DES","pbeWithSHA1And2-KeyTripleDES-CBC",
641 NID_pbe_WithSHA1And2_Key_TripleDES_CBC,10,&(lvalues[791]),0},
642{"PBE-SHA1-RC2-128","pbeWithSHA1And128BitRC2-CBC",
643 NID_pbe_WithSHA1And128BitRC2_CBC,10,&(lvalues[801]),0},
644{"PBE-SHA1-RC2-40","pbeWithSHA1And40BitRC2-CBC",
645 NID_pbe_WithSHA1And40BitRC2_CBC,10,&(lvalues[811]),0},
646{"keyBag","keyBag",NID_keyBag,11,&(lvalues[821]),0},
647{"pkcs8ShroudedKeyBag","pkcs8ShroudedKeyBag",NID_pkcs8ShroudedKeyBag,
648 11,&(lvalues[832]),0},
649{"certBag","certBag",NID_certBag,11,&(lvalues[843]),0},
650{"crlBag","crlBag",NID_crlBag,11,&(lvalues[854]),0},
651{"secretBag","secretBag",NID_secretBag,11,&(lvalues[865]),0},
652{"safeContentsBag","safeContentsBag",NID_safeContentsBag,11,
653 &(lvalues[876]),0},
654{"friendlyName","friendlyName",NID_friendlyName,9,&(lvalues[887]),0},
655{"localKeyID","localKeyID",NID_localKeyID,9,&(lvalues[896]),0},
656{"x509Certificate","x509Certificate",NID_x509Certificate,10,
657 &(lvalues[905]),0},
658{"sdsiCertificate","sdsiCertificate",NID_sdsiCertificate,10,
659 &(lvalues[915]),0},
660{"x509Crl","x509Crl",NID_x509Crl,10,&(lvalues[925]),0},
661{"PBES2","PBES2",NID_pbes2,9,&(lvalues[935]),0},
662{"PBMAC1","PBMAC1",NID_pbmac1,9,&(lvalues[944]),0},
663{"hmacWithSHA1","hmacWithSHA1",NID_hmacWithSHA1,8,&(lvalues[953]),0},
664{"id-qt-cps","Policy Qualifier CPS",NID_id_qt_cps,8,&(lvalues[961]),0},
665{"id-qt-unotice","Policy Qualifier User Notice",NID_id_qt_unotice,8,
666 &(lvalues[969]),0},
667{"RC2-64-CBC","rc2-64-cbc",NID_rc2_64_cbc,0,NULL},
668{"SMIME-CAPS","S/MIME Capabilities",NID_SMIMECapabilities,9,
669 &(lvalues[977]),0},
670{"PBE-MD2-RC2-64","pbeWithMD2AndRC2-CBC",NID_pbeWithMD2AndRC2_CBC,9,
671 &(lvalues[986]),0},
672{"PBE-MD5-RC2-64","pbeWithMD5AndRC2-CBC",NID_pbeWithMD5AndRC2_CBC,9,
673 &(lvalues[995]),0},
674{"PBE-SHA1-DES","pbeWithSHA1AndDES-CBC",NID_pbeWithSHA1AndDES_CBC,9,
675 &(lvalues[1004]),0},
676{"msExtReq","Microsoft Extension Request",NID_ms_ext_req,10,
677 &(lvalues[1013]),0},
678{"extReq","Extension Request",NID_ext_req,9,&(lvalues[1023]),0},
679{"name","name",NID_name,3,&(lvalues[1032]),0},
680{"dnQualifier","dnQualifier",NID_dnQualifier,3,&(lvalues[1035]),0},
681{"id-pe","id-pe",NID_id_pe,7,&(lvalues[1038]),0},
682{"id-ad","id-ad",NID_id_ad,7,&(lvalues[1045]),0},
683{"authorityInfoAccess","Authority Information Access",NID_info_access,
684 8,&(lvalues[1052]),0},
685{"OCSP","OCSP",NID_ad_OCSP,8,&(lvalues[1060]),0},
686{"caIssuers","CA Issuers",NID_ad_ca_issuers,8,&(lvalues[1068]),0},
687{"OCSPSigning","OCSP Signing",NID_OCSP_sign,8,&(lvalues[1076]),0},
688{"ISO","iso",NID_iso,1,&(lvalues[1084]),0},
689{"member-body","ISO Member Body",NID_member_body,1,&(lvalues[1085]),0},
690{"ISO-US","ISO US Member Body",NID_ISO_US,3,&(lvalues[1086]),0},
691{"X9-57","X9.57",NID_X9_57,5,&(lvalues[1089]),0},
692{"X9cm","X9.57 CM ?",NID_X9cm,6,&(lvalues[1094]),0},
693{"pkcs1","pkcs1",NID_pkcs1,8,&(lvalues[1100]),0},
694{"pkcs5","pkcs5",NID_pkcs5,8,&(lvalues[1108]),0},
695{"SMIME","S/MIME",NID_SMIME,9,&(lvalues[1116]),0},
696{"id-smime-mod","id-smime-mod",NID_id_smime_mod,10,&(lvalues[1125]),0},
697{"id-smime-ct","id-smime-ct",NID_id_smime_ct,10,&(lvalues[1135]),0},
698{"id-smime-aa","id-smime-aa",NID_id_smime_aa,10,&(lvalues[1145]),0},
699{"id-smime-alg","id-smime-alg",NID_id_smime_alg,10,&(lvalues[1155]),0},
700{"id-smime-cd","id-smime-cd",NID_id_smime_cd,10,&(lvalues[1165]),0},
701{"id-smime-spq","id-smime-spq",NID_id_smime_spq,10,&(lvalues[1175]),0},
702{"id-smime-cti","id-smime-cti",NID_id_smime_cti,10,&(lvalues[1185]),0},
703{"id-smime-mod-cms","id-smime-mod-cms",NID_id_smime_mod_cms,11,
704 &(lvalues[1195]),0},
705{"id-smime-mod-ess","id-smime-mod-ess",NID_id_smime_mod_ess,11,
706 &(lvalues[1206]),0},
707{"id-smime-mod-oid","id-smime-mod-oid",NID_id_smime_mod_oid,11,
708 &(lvalues[1217]),0},
709{"id-smime-mod-msg-v3","id-smime-mod-msg-v3",NID_id_smime_mod_msg_v3,
710 11,&(lvalues[1228]),0},
711{"id-smime-mod-ets-eSignature-88","id-smime-mod-ets-eSignature-88",
712 NID_id_smime_mod_ets_eSignature_88,11,&(lvalues[1239]),0},
713{"id-smime-mod-ets-eSignature-97","id-smime-mod-ets-eSignature-97",
714 NID_id_smime_mod_ets_eSignature_97,11,&(lvalues[1250]),0},
715{"id-smime-mod-ets-eSigPolicy-88","id-smime-mod-ets-eSigPolicy-88",
716 NID_id_smime_mod_ets_eSigPolicy_88,11,&(lvalues[1261]),0},
717{"id-smime-mod-ets-eSigPolicy-97","id-smime-mod-ets-eSigPolicy-97",
718 NID_id_smime_mod_ets_eSigPolicy_97,11,&(lvalues[1272]),0},
719{"id-smime-ct-receipt","id-smime-ct-receipt",NID_id_smime_ct_receipt,
720 11,&(lvalues[1283]),0},
721{"id-smime-ct-authData","id-smime-ct-authData",
722 NID_id_smime_ct_authData,11,&(lvalues[1294]),0},
723{"id-smime-ct-publishCert","id-smime-ct-publishCert",
724 NID_id_smime_ct_publishCert,11,&(lvalues[1305]),0},
725{"id-smime-ct-TSTInfo","id-smime-ct-TSTInfo",NID_id_smime_ct_TSTInfo,
726 11,&(lvalues[1316]),0},
727{"id-smime-ct-TDTInfo","id-smime-ct-TDTInfo",NID_id_smime_ct_TDTInfo,
728 11,&(lvalues[1327]),0},
729{"id-smime-ct-contentInfo","id-smime-ct-contentInfo",
730 NID_id_smime_ct_contentInfo,11,&(lvalues[1338]),0},
731{"id-smime-ct-DVCSRequestData","id-smime-ct-DVCSRequestData",
732 NID_id_smime_ct_DVCSRequestData,11,&(lvalues[1349]),0},
733{"id-smime-ct-DVCSResponseData","id-smime-ct-DVCSResponseData",
734 NID_id_smime_ct_DVCSResponseData,11,&(lvalues[1360]),0},
735{"id-smime-aa-receiptRequest","id-smime-aa-receiptRequest",
736 NID_id_smime_aa_receiptRequest,11,&(lvalues[1371]),0},
737{"id-smime-aa-securityLabel","id-smime-aa-securityLabel",
738 NID_id_smime_aa_securityLabel,11,&(lvalues[1382]),0},
739{"id-smime-aa-mlExpandHistory","id-smime-aa-mlExpandHistory",
740 NID_id_smime_aa_mlExpandHistory,11,&(lvalues[1393]),0},
741{"id-smime-aa-contentHint","id-smime-aa-contentHint",
742 NID_id_smime_aa_contentHint,11,&(lvalues[1404]),0},
743{"id-smime-aa-msgSigDigest","id-smime-aa-msgSigDigest",
744 NID_id_smime_aa_msgSigDigest,11,&(lvalues[1415]),0},
745{"id-smime-aa-encapContentType","id-smime-aa-encapContentType",
746 NID_id_smime_aa_encapContentType,11,&(lvalues[1426]),0},
747{"id-smime-aa-contentIdentifier","id-smime-aa-contentIdentifier",
748 NID_id_smime_aa_contentIdentifier,11,&(lvalues[1437]),0},
749{"id-smime-aa-macValue","id-smime-aa-macValue",
750 NID_id_smime_aa_macValue,11,&(lvalues[1448]),0},
751{"id-smime-aa-equivalentLabels","id-smime-aa-equivalentLabels",
752 NID_id_smime_aa_equivalentLabels,11,&(lvalues[1459]),0},
753{"id-smime-aa-contentReference","id-smime-aa-contentReference",
754 NID_id_smime_aa_contentReference,11,&(lvalues[1470]),0},
755{"id-smime-aa-encrypKeyPref","id-smime-aa-encrypKeyPref",
756 NID_id_smime_aa_encrypKeyPref,11,&(lvalues[1481]),0},
757{"id-smime-aa-signingCertificate","id-smime-aa-signingCertificate",
758 NID_id_smime_aa_signingCertificate,11,&(lvalues[1492]),0},
759{"id-smime-aa-smimeEncryptCerts","id-smime-aa-smimeEncryptCerts",
760 NID_id_smime_aa_smimeEncryptCerts,11,&(lvalues[1503]),0},
761{"id-smime-aa-timeStampToken","id-smime-aa-timeStampToken",
762 NID_id_smime_aa_timeStampToken,11,&(lvalues[1514]),0},
763{"id-smime-aa-ets-sigPolicyId","id-smime-aa-ets-sigPolicyId",
764 NID_id_smime_aa_ets_sigPolicyId,11,&(lvalues[1525]),0},
765{"id-smime-aa-ets-commitmentType","id-smime-aa-ets-commitmentType",
766 NID_id_smime_aa_ets_commitmentType,11,&(lvalues[1536]),0},
767{"id-smime-aa-ets-signerLocation","id-smime-aa-ets-signerLocation",
768 NID_id_smime_aa_ets_signerLocation,11,&(lvalues[1547]),0},
769{"id-smime-aa-ets-signerAttr","id-smime-aa-ets-signerAttr",
770 NID_id_smime_aa_ets_signerAttr,11,&(lvalues[1558]),0},
771{"id-smime-aa-ets-otherSigCert","id-smime-aa-ets-otherSigCert",
772 NID_id_smime_aa_ets_otherSigCert,11,&(lvalues[1569]),0},
773{"id-smime-aa-ets-contentTimestamp",
774 "id-smime-aa-ets-contentTimestamp",
775 NID_id_smime_aa_ets_contentTimestamp,11,&(lvalues[1580]),0},
776{"id-smime-aa-ets-CertificateRefs","id-smime-aa-ets-CertificateRefs",
777 NID_id_smime_aa_ets_CertificateRefs,11,&(lvalues[1591]),0},
778{"id-smime-aa-ets-RevocationRefs","id-smime-aa-ets-RevocationRefs",
779 NID_id_smime_aa_ets_RevocationRefs,11,&(lvalues[1602]),0},
780{"id-smime-aa-ets-certValues","id-smime-aa-ets-certValues",
781 NID_id_smime_aa_ets_certValues,11,&(lvalues[1613]),0},
782{"id-smime-aa-ets-revocationValues",
783 "id-smime-aa-ets-revocationValues",
784 NID_id_smime_aa_ets_revocationValues,11,&(lvalues[1624]),0},
785{"id-smime-aa-ets-escTimeStamp","id-smime-aa-ets-escTimeStamp",
786 NID_id_smime_aa_ets_escTimeStamp,11,&(lvalues[1635]),0},
787{"id-smime-aa-ets-certCRLTimestamp",
788 "id-smime-aa-ets-certCRLTimestamp",
789 NID_id_smime_aa_ets_certCRLTimestamp,11,&(lvalues[1646]),0},
790{"id-smime-aa-ets-archiveTimeStamp",
791 "id-smime-aa-ets-archiveTimeStamp",
792 NID_id_smime_aa_ets_archiveTimeStamp,11,&(lvalues[1657]),0},
793{"id-smime-aa-signatureType","id-smime-aa-signatureType",
794 NID_id_smime_aa_signatureType,11,&(lvalues[1668]),0},
795{"id-smime-aa-dvcs-dvc","id-smime-aa-dvcs-dvc",
796 NID_id_smime_aa_dvcs_dvc,11,&(lvalues[1679]),0},
797{"id-smime-alg-ESDHwith3DES","id-smime-alg-ESDHwith3DES",
798 NID_id_smime_alg_ESDHwith3DES,11,&(lvalues[1690]),0},
799{"id-smime-alg-ESDHwithRC2","id-smime-alg-ESDHwithRC2",
800 NID_id_smime_alg_ESDHwithRC2,11,&(lvalues[1701]),0},
801{"id-smime-alg-3DESwrap","id-smime-alg-3DESwrap",
802 NID_id_smime_alg_3DESwrap,11,&(lvalues[1712]),0},
803{"id-smime-alg-RC2wrap","id-smime-alg-RC2wrap",
804 NID_id_smime_alg_RC2wrap,11,&(lvalues[1723]),0},
805{"id-smime-alg-ESDH","id-smime-alg-ESDH",NID_id_smime_alg_ESDH,11,
806 &(lvalues[1734]),0},
807{"id-smime-alg-CMS3DESwrap","id-smime-alg-CMS3DESwrap",
808 NID_id_smime_alg_CMS3DESwrap,11,&(lvalues[1745]),0},
809{"id-smime-alg-CMSRC2wrap","id-smime-alg-CMSRC2wrap",
810 NID_id_smime_alg_CMSRC2wrap,11,&(lvalues[1756]),0},
811{"id-smime-cd-ldap","id-smime-cd-ldap",NID_id_smime_cd_ldap,11,
812 &(lvalues[1767]),0},
813{"id-smime-spq-ets-sqt-uri","id-smime-spq-ets-sqt-uri",
814 NID_id_smime_spq_ets_sqt_uri,11,&(lvalues[1778]),0},
815{"id-smime-spq-ets-sqt-unotice","id-smime-spq-ets-sqt-unotice",
816 NID_id_smime_spq_ets_sqt_unotice,11,&(lvalues[1789]),0},
817{"id-smime-cti-ets-proofOfOrigin","id-smime-cti-ets-proofOfOrigin",
818 NID_id_smime_cti_ets_proofOfOrigin,11,&(lvalues[1800]),0},
819{"id-smime-cti-ets-proofOfReceipt","id-smime-cti-ets-proofOfReceipt",
820 NID_id_smime_cti_ets_proofOfReceipt,11,&(lvalues[1811]),0},
821{"id-smime-cti-ets-proofOfDelivery",
822 "id-smime-cti-ets-proofOfDelivery",
823 NID_id_smime_cti_ets_proofOfDelivery,11,&(lvalues[1822]),0},
824{"id-smime-cti-ets-proofOfSender","id-smime-cti-ets-proofOfSender",
825 NID_id_smime_cti_ets_proofOfSender,11,&(lvalues[1833]),0},
826{"id-smime-cti-ets-proofOfApproval",
827 "id-smime-cti-ets-proofOfApproval",
828 NID_id_smime_cti_ets_proofOfApproval,11,&(lvalues[1844]),0},
829{"id-smime-cti-ets-proofOfCreation",
830 "id-smime-cti-ets-proofOfCreation",
831 NID_id_smime_cti_ets_proofOfCreation,11,&(lvalues[1855]),0},
832{"MD4","md4",NID_md4,8,&(lvalues[1866]),0},
833{"id-pkix-mod","id-pkix-mod",NID_id_pkix_mod,7,&(lvalues[1874]),0},
834{"id-qt","id-qt",NID_id_qt,7,&(lvalues[1881]),0},
835{"id-it","id-it",NID_id_it,7,&(lvalues[1888]),0},
836{"id-pkip","id-pkip",NID_id_pkip,7,&(lvalues[1895]),0},
837{"id-alg","id-alg",NID_id_alg,7,&(lvalues[1902]),0},
838{"id-cmc","id-cmc",NID_id_cmc,7,&(lvalues[1909]),0},
839{"id-on","id-on",NID_id_on,7,&(lvalues[1916]),0},
840{"id-pda","id-pda",NID_id_pda,7,&(lvalues[1923]),0},
841{"id-aca","id-aca",NID_id_aca,7,&(lvalues[1930]),0},
842{"id-qcs","id-qcs",NID_id_qcs,7,&(lvalues[1937]),0},
843{"id-cct","id-cct",NID_id_cct,7,&(lvalues[1944]),0},
844{"id-pkix1-explicit-88","id-pkix1-explicit-88",
845 NID_id_pkix1_explicit_88,8,&(lvalues[1951]),0},
846{"id-pkix1-implicit-88","id-pkix1-implicit-88",
847 NID_id_pkix1_implicit_88,8,&(lvalues[1959]),0},
848{"id-pkix1-explicit-93","id-pkix1-explicit-93",
849 NID_id_pkix1_explicit_93,8,&(lvalues[1967]),0},
850{"id-pkix1-implicit-93","id-pkix1-implicit-93",
851 NID_id_pkix1_implicit_93,8,&(lvalues[1975]),0},
852{"id-mod-crmf","id-mod-crmf",NID_id_mod_crmf,8,&(lvalues[1983]),0},
853{"id-mod-cmc","id-mod-cmc",NID_id_mod_cmc,8,&(lvalues[1991]),0},
854{"id-mod-kea-profile-88","id-mod-kea-profile-88",
855 NID_id_mod_kea_profile_88,8,&(lvalues[1999]),0},
856{"id-mod-kea-profile-93","id-mod-kea-profile-93",
857 NID_id_mod_kea_profile_93,8,&(lvalues[2007]),0},
858{"id-mod-cmp","id-mod-cmp",NID_id_mod_cmp,8,&(lvalues[2015]),0},
859{"id-mod-qualified-cert-88","id-mod-qualified-cert-88",
860 NID_id_mod_qualified_cert_88,8,&(lvalues[2023]),0},
861{"id-mod-qualified-cert-93","id-mod-qualified-cert-93",
862 NID_id_mod_qualified_cert_93,8,&(lvalues[2031]),0},
863{"id-mod-attribute-cert","id-mod-attribute-cert",
864 NID_id_mod_attribute_cert,8,&(lvalues[2039]),0},
865{"id-mod-timestamp-protocol","id-mod-timestamp-protocol",
866 NID_id_mod_timestamp_protocol,8,&(lvalues[2047]),0},
867{"id-mod-ocsp","id-mod-ocsp",NID_id_mod_ocsp,8,&(lvalues[2055]),0},
868{"id-mod-dvcs","id-mod-dvcs",NID_id_mod_dvcs,8,&(lvalues[2063]),0},
869{"id-mod-cmp2000","id-mod-cmp2000",NID_id_mod_cmp2000,8,
870 &(lvalues[2071]),0},
871{"biometricInfo","Biometric Info",NID_biometricInfo,8,&(lvalues[2079]),0},
872{"qcStatements","qcStatements",NID_qcStatements,8,&(lvalues[2087]),0},
873{"ac-auditEntity","ac-auditEntity",NID_ac_auditEntity,8,
874 &(lvalues[2095]),0},
875{"ac-targeting","ac-targeting",NID_ac_targeting,8,&(lvalues[2103]),0},
876{"aaControls","aaControls",NID_aaControls,8,&(lvalues[2111]),0},
877{"sbqp-ipAddrBlock","sbqp-ipAddrBlock",NID_sbqp_ipAddrBlock,8,
878 &(lvalues[2119]),0},
879{"sbqp-autonomousSysNum","sbqp-autonomousSysNum",
880 NID_sbqp_autonomousSysNum,8,&(lvalues[2127]),0},
881{"sbqp-routerIdentifier","sbqp-routerIdentifier",
882 NID_sbqp_routerIdentifier,8,&(lvalues[2135]),0},
883{"textNotice","textNotice",NID_textNotice,8,&(lvalues[2143]),0},
884{"ipsecEndSystem","IPSec End System",NID_ipsecEndSystem,8,
885 &(lvalues[2151]),0},
886{"ipsecTunnel","IPSec Tunnel",NID_ipsecTunnel,8,&(lvalues[2159]),0},
887{"ipsecUser","IPSec User",NID_ipsecUser,8,&(lvalues[2167]),0},
888{"DVCS","dvcs",NID_dvcs,8,&(lvalues[2175]),0},
889{"id-it-caProtEncCert","id-it-caProtEncCert",NID_id_it_caProtEncCert,
890 8,&(lvalues[2183]),0},
891{"id-it-signKeyPairTypes","id-it-signKeyPairTypes",
892 NID_id_it_signKeyPairTypes,8,&(lvalues[2191]),0},
893{"id-it-encKeyPairTypes","id-it-encKeyPairTypes",
894 NID_id_it_encKeyPairTypes,8,&(lvalues[2199]),0},
895{"id-it-preferredSymmAlg","id-it-preferredSymmAlg",
896 NID_id_it_preferredSymmAlg,8,&(lvalues[2207]),0},
897{"id-it-caKeyUpdateInfo","id-it-caKeyUpdateInfo",
898 NID_id_it_caKeyUpdateInfo,8,&(lvalues[2215]),0},
899{"id-it-currentCRL","id-it-currentCRL",NID_id_it_currentCRL,8,
900 &(lvalues[2223]),0},
901{"id-it-unsupportedOIDs","id-it-unsupportedOIDs",
902 NID_id_it_unsupportedOIDs,8,&(lvalues[2231]),0},
903{"id-it-subscriptionRequest","id-it-subscriptionRequest",
904 NID_id_it_subscriptionRequest,8,&(lvalues[2239]),0},
905{"id-it-subscriptionResponse","id-it-subscriptionResponse",
906 NID_id_it_subscriptionResponse,8,&(lvalues[2247]),0},
907{"id-it-keyPairParamReq","id-it-keyPairParamReq",
908 NID_id_it_keyPairParamReq,8,&(lvalues[2255]),0},
909{"id-it-keyPairParamRep","id-it-keyPairParamRep",
910 NID_id_it_keyPairParamRep,8,&(lvalues[2263]),0},
911{"id-it-revPassphrase","id-it-revPassphrase",NID_id_it_revPassphrase,
912 8,&(lvalues[2271]),0},
913{"id-it-implicitConfirm","id-it-implicitConfirm",
914 NID_id_it_implicitConfirm,8,&(lvalues[2279]),0},
915{"id-it-confirmWaitTime","id-it-confirmWaitTime",
916 NID_id_it_confirmWaitTime,8,&(lvalues[2287]),0},
917{"id-it-origPKIMessage","id-it-origPKIMessage",
918 NID_id_it_origPKIMessage,8,&(lvalues[2295]),0},
919{"id-regCtrl","id-regCtrl",NID_id_regCtrl,8,&(lvalues[2303]),0},
920{"id-regInfo","id-regInfo",NID_id_regInfo,8,&(lvalues[2311]),0},
921{"id-regCtrl-regToken","id-regCtrl-regToken",NID_id_regCtrl_regToken,
922 9,&(lvalues[2319]),0},
923{"id-regCtrl-authenticator","id-regCtrl-authenticator",
924 NID_id_regCtrl_authenticator,9,&(lvalues[2328]),0},
925{"id-regCtrl-pkiPublicationInfo","id-regCtrl-pkiPublicationInfo",
926 NID_id_regCtrl_pkiPublicationInfo,9,&(lvalues[2337]),0},
927{"id-regCtrl-pkiArchiveOptions","id-regCtrl-pkiArchiveOptions",
928 NID_id_regCtrl_pkiArchiveOptions,9,&(lvalues[2346]),0},
929{"id-regCtrl-oldCertID","id-regCtrl-oldCertID",
930 NID_id_regCtrl_oldCertID,9,&(lvalues[2355]),0},
931{"id-regCtrl-protocolEncrKey","id-regCtrl-protocolEncrKey",
932 NID_id_regCtrl_protocolEncrKey,9,&(lvalues[2364]),0},
933{"id-regInfo-utf8Pairs","id-regInfo-utf8Pairs",
934 NID_id_regInfo_utf8Pairs,9,&(lvalues[2373]),0},
935{"id-regInfo-certReq","id-regInfo-certReq",NID_id_regInfo_certReq,9,
936 &(lvalues[2382]),0},
937{"id-alg-des40","id-alg-des40",NID_id_alg_des40,8,&(lvalues[2391]),0},
938{"id-alg-noSignature","id-alg-noSignature",NID_id_alg_noSignature,8,
939 &(lvalues[2399]),0},
940{"id-alg-dh-sig-hmac-sha1","id-alg-dh-sig-hmac-sha1",
941 NID_id_alg_dh_sig_hmac_sha1,8,&(lvalues[2407]),0},
942{"id-alg-dh-pop","id-alg-dh-pop",NID_id_alg_dh_pop,8,&(lvalues[2415]),0},
943{"id-cmc-statusInfo","id-cmc-statusInfo",NID_id_cmc_statusInfo,8,
944 &(lvalues[2423]),0},
945{"id-cmc-identification","id-cmc-identification",
946 NID_id_cmc_identification,8,&(lvalues[2431]),0},
947{"id-cmc-identityProof","id-cmc-identityProof",
948 NID_id_cmc_identityProof,8,&(lvalues[2439]),0},
949{"id-cmc-dataReturn","id-cmc-dataReturn",NID_id_cmc_dataReturn,8,
950 &(lvalues[2447]),0},
951{"id-cmc-transactionId","id-cmc-transactionId",
952 NID_id_cmc_transactionId,8,&(lvalues[2455]),0},
953{"id-cmc-senderNonce","id-cmc-senderNonce",NID_id_cmc_senderNonce,8,
954 &(lvalues[2463]),0},
955{"id-cmc-recipientNonce","id-cmc-recipientNonce",
956 NID_id_cmc_recipientNonce,8,&(lvalues[2471]),0},
957{"id-cmc-addExtensions","id-cmc-addExtensions",
958 NID_id_cmc_addExtensions,8,&(lvalues[2479]),0},
959{"id-cmc-encryptedPOP","id-cmc-encryptedPOP",NID_id_cmc_encryptedPOP,
960 8,&(lvalues[2487]),0},
961{"id-cmc-decryptedPOP","id-cmc-decryptedPOP",NID_id_cmc_decryptedPOP,
962 8,&(lvalues[2495]),0},
963{"id-cmc-lraPOPWitness","id-cmc-lraPOPWitness",
964 NID_id_cmc_lraPOPWitness,8,&(lvalues[2503]),0},
965{"id-cmc-getCert","id-cmc-getCert",NID_id_cmc_getCert,8,
966 &(lvalues[2511]),0},
967{"id-cmc-getCRL","id-cmc-getCRL",NID_id_cmc_getCRL,8,&(lvalues[2519]),0},
968{"id-cmc-revokeRequest","id-cmc-revokeRequest",
969 NID_id_cmc_revokeRequest,8,&(lvalues[2527]),0},
970{"id-cmc-regInfo","id-cmc-regInfo",NID_id_cmc_regInfo,8,
971 &(lvalues[2535]),0},
972{"id-cmc-responseInfo","id-cmc-responseInfo",NID_id_cmc_responseInfo,
973 8,&(lvalues[2543]),0},
974{"id-cmc-queryPending","id-cmc-queryPending",NID_id_cmc_queryPending,
975 8,&(lvalues[2551]),0},
976{"id-cmc-popLinkRandom","id-cmc-popLinkRandom",
977 NID_id_cmc_popLinkRandom,8,&(lvalues[2559]),0},
978{"id-cmc-popLinkWitness","id-cmc-popLinkWitness",
979 NID_id_cmc_popLinkWitness,8,&(lvalues[2567]),0},
980{"id-cmc-confirmCertAcceptance","id-cmc-confirmCertAcceptance",
981 NID_id_cmc_confirmCertAcceptance,8,&(lvalues[2575]),0},
982{"id-on-personalData","id-on-personalData",NID_id_on_personalData,8,
983 &(lvalues[2583]),0},
984{"id-pda-dateOfBirth","id-pda-dateOfBirth",NID_id_pda_dateOfBirth,8,
985 &(lvalues[2591]),0},
986{"id-pda-placeOfBirth","id-pda-placeOfBirth",NID_id_pda_placeOfBirth,
987 8,&(lvalues[2599]),0},
988{"id-pda-pseudonym","id-pda-pseudonym",NID_id_pda_pseudonym,8,
989 &(lvalues[2607]),0},
990{"id-pda-gender","id-pda-gender",NID_id_pda_gender,8,&(lvalues[2615]),0},
991{"id-pda-countryOfCitizenship","id-pda-countryOfCitizenship",
992 NID_id_pda_countryOfCitizenship,8,&(lvalues[2623]),0},
993{"id-pda-countryOfResidence","id-pda-countryOfResidence",
994 NID_id_pda_countryOfResidence,8,&(lvalues[2631]),0},
995{"id-aca-authenticationInfo","id-aca-authenticationInfo",
996 NID_id_aca_authenticationInfo,8,&(lvalues[2639]),0},
997{"id-aca-accessIdentity","id-aca-accessIdentity",
998 NID_id_aca_accessIdentity,8,&(lvalues[2647]),0},
999{"id-aca-chargingIdentity","id-aca-chargingIdentity",
1000 NID_id_aca_chargingIdentity,8,&(lvalues[2655]),0},
1001{"id-aca-group","id-aca-group",NID_id_aca_group,8,&(lvalues[2663]),0},
1002{"id-aca-role","id-aca-role",NID_id_aca_role,8,&(lvalues[2671]),0},
1003{"id-qcs-pkixQCSyntax-v1","id-qcs-pkixQCSyntax-v1",
1004 NID_id_qcs_pkixQCSyntax_v1,8,&(lvalues[2679]),0},
1005{"id-cct-crs","id-cct-crs",NID_id_cct_crs,8,&(lvalues[2687]),0},
1006{"id-cct-PKIData","id-cct-PKIData",NID_id_cct_PKIData,8,
1007 &(lvalues[2695]),0},
1008{"id-cct-PKIResponse","id-cct-PKIResponse",NID_id_cct_PKIResponse,8,
1009 &(lvalues[2703]),0},
1010{"ad_timestamping","AD Time Stamping",NID_ad_timeStamping,8,
1011 &(lvalues[2711]),0},
1012{"AD_DVCS","ad dvcs",NID_ad_dvcs,8,&(lvalues[2719]),0},
1013{"basicOCSPResponse","Basic OCSP Response",NID_id_pkix_OCSP_basic,9,
1014 &(lvalues[2727]),0},
1015{"Nonce","OCSP Nonce",NID_id_pkix_OCSP_Nonce,9,&(lvalues[2736]),0},
1016{"CrlID","OCSP CRL ID",NID_id_pkix_OCSP_CrlID,9,&(lvalues[2745]),0},
1017{"acceptableResponses","Acceptable OCSP Responses",
1018 NID_id_pkix_OCSP_acceptableResponses,9,&(lvalues[2754]),0},
1019{"noCheck","noCheck",NID_id_pkix_OCSP_noCheck,9,&(lvalues[2763]),0},
1020{"archiveCutoff","OCSP Archive Cutoff",NID_id_pkix_OCSP_archiveCutoff,
1021 9,&(lvalues[2772]),0},
1022{"serviceLocator","OCSP Service Locator",
1023 NID_id_pkix_OCSP_serviceLocator,9,&(lvalues[2781]),0},
1024{"extendedStatus","Extended OCSP Status",
1025 NID_id_pkix_OCSP_extendedStatus,9,&(lvalues[2790]),0},
1026{"valid","valid",NID_id_pkix_OCSP_valid,9,&(lvalues[2799]),0},
1027{"path","path",NID_id_pkix_OCSP_path,9,&(lvalues[2808]),0},
1028{"trustRoot","Trust Root",NID_id_pkix_OCSP_trustRoot,9,
1029 &(lvalues[2817]),0},
1030{"algorithm","algorithm",NID_algorithm,4,&(lvalues[2826]),0},
1031{"rsaSignature","rsaSignature",NID_rsaSignature,5,&(lvalues[2830]),0},
1032{"X500algorithms","directory services - algorithms",
1033 NID_X500algorithms,2,&(lvalues[2835]),0},
1034{"ORG","org",NID_org,1,&(lvalues[2837]),0},
1035{"DOD","dod",NID_dod,2,&(lvalues[2838]),0},
1036{"IANA","iana",NID_iana,3,&(lvalues[2840]),0},
1037{"directory","Directory",NID_Directory,4,&(lvalues[2843]),0},
1038{"mgmt","Management",NID_Management,4,&(lvalues[2847]),0},
1039{"experimental","Experimental",NID_Experimental,4,&(lvalues[2851]),0},
1040{"private","Private",NID_Private,4,&(lvalues[2855]),0},
1041{"security","Security",NID_Security,4,&(lvalues[2859]),0},
1042{"snmpv2","SNMPv2",NID_SNMPv2,4,&(lvalues[2863]),0},
1043{"mail","Mail",NID_Mail,4,&(lvalues[2867]),0},
1044{"enterprises","Enterprises",NID_Enterprises,1,&(lvalues[2871]),0},
1045{"dcobject","dcObject",NID_dcObject,3,&(lvalues[2872]),0},
1046{"DC","domainComponent",NID_domainComponent,10,&(lvalues[2875]),0},
1047{"domain","Domain",NID_Domain,10,&(lvalues[2885]),0},
1048};
1049
1050static ASN1_OBJECT *sn_objs[NUM_SN]={
1051&(nid_objs[364]),/* "AD_DVCS" */
1052&(nid_objs[91]),/* "BF-CBC" */
1053&(nid_objs[93]),/* "BF-CFB" */
1054&(nid_objs[92]),/* "BF-ECB" */
1055&(nid_objs[94]),/* "BF-OFB" */
1056&(nid_objs[14]),/* "C" */
1057&(nid_objs[108]),/* "CAST5-CBC" */
1058&(nid_objs[110]),/* "CAST5-CFB" */
1059&(nid_objs[109]),/* "CAST5-ECB" */
1060&(nid_objs[111]),/* "CAST5-OFB" */
1061&(nid_objs[13]),/* "CN" */
1062&(nid_objs[141]),/* "CRLReason" */
1063&(nid_objs[367]),/* "CrlID" */
1064&(nid_objs[107]),/* "D" */
1065&(nid_objs[391]),/* "DC" */
1066&(nid_objs[31]),/* "DES-CBC" */
1067&(nid_objs[30]),/* "DES-CFB" */
1068&(nid_objs[29]),/* "DES-ECB" */
1069&(nid_objs[32]),/* "DES-EDE" */
1070&(nid_objs[43]),/* "DES-EDE-CBC" */
1071&(nid_objs[60]),/* "DES-EDE-CFB" */
1072&(nid_objs[62]),/* "DES-EDE-OFB" */
1073&(nid_objs[33]),/* "DES-EDE3" */
1074&(nid_objs[44]),/* "DES-EDE3-CBC" */
1075&(nid_objs[61]),/* "DES-EDE3-CFB" */
1076&(nid_objs[63]),/* "DES-EDE3-OFB" */
1077&(nid_objs[45]),/* "DES-OFB" */
1078&(nid_objs[80]),/* "DESX-CBC" */
1079&(nid_objs[380]),/* "DOD" */
1080&(nid_objs[116]),/* "DSA" */
1081&(nid_objs[66]),/* "DSA-SHA" */
1082&(nid_objs[113]),/* "DSA-SHA1" */
1083&(nid_objs[70]),/* "DSA-SHA1-old" */
1084&(nid_objs[67]),/* "DSA-old" */
1085&(nid_objs[297]),/* "DVCS" */
1086&(nid_objs[48]),/* "Email" */
1087&(nid_objs[99]),/* "G" */
1088&(nid_objs[101]),/* "I" */
1089&(nid_objs[381]),/* "IANA" */
1090&(nid_objs[34]),/* "IDEA-CBC" */
1091&(nid_objs[35]),/* "IDEA-CFB" */
1092&(nid_objs[36]),/* "IDEA-ECB" */
1093&(nid_objs[46]),/* "IDEA-OFB" */
1094&(nid_objs[181]),/* "ISO" */
1095&(nid_objs[183]),/* "ISO-US" */
1096&(nid_objs[15]),/* "L" */
1097&(nid_objs[ 3]),/* "MD2" */
1098&(nid_objs[257]),/* "MD4" */
1099&(nid_objs[ 4]),/* "MD5" */
1100&(nid_objs[114]),/* "MD5-SHA1" */
1101&(nid_objs[95]),/* "MDC2" */
1102&(nid_objs[57]),/* "Netscape" */
1103&(nid_objs[366]),/* "Nonce" */
1104&(nid_objs[17]),/* "O" */
1105&(nid_objs[178]),/* "OCSP" */
1106&(nid_objs[180]),/* "OCSPSigning" */
1107&(nid_objs[379]),/* "ORG" */
1108&(nid_objs[18]),/* "OU" */
1109&(nid_objs[ 9]),/* "PBE-MD2-DES" */
1110&(nid_objs[168]),/* "PBE-MD2-RC2-64" */
1111&(nid_objs[10]),/* "PBE-MD5-DES" */
1112&(nid_objs[169]),/* "PBE-MD5-RC2-64" */
1113&(nid_objs[147]),/* "PBE-SHA1-2DES" */
1114&(nid_objs[146]),/* "PBE-SHA1-3DES" */
1115&(nid_objs[170]),/* "PBE-SHA1-DES" */
1116&(nid_objs[148]),/* "PBE-SHA1-RC2-128" */
1117&(nid_objs[149]),/* "PBE-SHA1-RC2-40" */
1118&(nid_objs[68]),/* "PBE-SHA1-RC2-64" */
1119&(nid_objs[144]),/* "PBE-SHA1-RC4-128" */
1120&(nid_objs[145]),/* "PBE-SHA1-RC4-40" */
1121&(nid_objs[161]),/* "PBES2" */
1122&(nid_objs[69]),/* "PBKDF2" */
1123&(nid_objs[162]),/* "PBMAC1" */
1124&(nid_objs[127]),/* "PKIX" */
1125&(nid_objs[98]),/* "RC2-40-CBC" */
1126&(nid_objs[166]),/* "RC2-64-CBC" */
1127&(nid_objs[37]),/* "RC2-CBC" */
1128&(nid_objs[39]),/* "RC2-CFB" */
1129&(nid_objs[38]),/* "RC2-ECB" */
1130&(nid_objs[40]),/* "RC2-OFB" */
1131&(nid_objs[ 5]),/* "RC4" */
1132&(nid_objs[97]),/* "RC4-40" */
1133&(nid_objs[120]),/* "RC5-CBC" */
1134&(nid_objs[122]),/* "RC5-CFB" */
1135&(nid_objs[121]),/* "RC5-ECB" */
1136&(nid_objs[123]),/* "RC5-OFB" */
1137&(nid_objs[117]),/* "RIPEMD160" */
1138&(nid_objs[124]),/* "RLE" */
1139&(nid_objs[19]),/* "RSA" */
1140&(nid_objs[ 7]),/* "RSA-MD2" */
1141&(nid_objs[ 8]),/* "RSA-MD5" */
1142&(nid_objs[96]),/* "RSA-MDC2" */
1143&(nid_objs[104]),/* "RSA-NP-MD5" */
1144&(nid_objs[119]),/* "RSA-RIPEMD160" */
1145&(nid_objs[42]),/* "RSA-SHA" */
1146&(nid_objs[65]),/* "RSA-SHA1" */
1147&(nid_objs[115]),/* "RSA-SHA1-2" */
1148&(nid_objs[100]),/* "S" */
1149&(nid_objs[41]),/* "SHA" */
1150&(nid_objs[64]),/* "SHA1" */
1151&(nid_objs[188]),/* "SMIME" */
1152&(nid_objs[167]),/* "SMIME-CAPS" */
1153&(nid_objs[105]),/* "SN" */
1154&(nid_objs[16]),/* "ST" */
1155&(nid_objs[143]),/* "SXNetID" */
1156&(nid_objs[106]),/* "T" */
1157&(nid_objs[102]),/* "UID" */
1158&(nid_objs[ 0]),/* "UNDEF" */
1159&(nid_objs[11]),/* "X500" */
1160&(nid_objs[378]),/* "X500algorithms" */
1161&(nid_objs[12]),/* "X509" */
1162&(nid_objs[184]),/* "X9-57" */
1163&(nid_objs[185]),/* "X9cm" */
1164&(nid_objs[125]),/* "ZLIB" */
1165&(nid_objs[289]),/* "aaControls" */
1166&(nid_objs[287]),/* "ac-auditEntity" */
1167&(nid_objs[288]),/* "ac-targeting" */
1168&(nid_objs[368]),/* "acceptableResponses" */
1169&(nid_objs[363]),/* "ad_timestamping" */
1170&(nid_objs[376]),/* "algorithm" */
1171&(nid_objs[370]),/* "archiveCutoff" */
1172&(nid_objs[177]),/* "authorityInfoAccess" */
1173&(nid_objs[90]),/* "authorityKeyIdentifier" */
1174&(nid_objs[87]),/* "basicConstraints" */
1175&(nid_objs[365]),/* "basicOCSPResponse" */
1176&(nid_objs[285]),/* "biometricInfo" */
1177&(nid_objs[179]),/* "caIssuers" */
1178&(nid_objs[152]),/* "certBag" */
1179&(nid_objs[89]),/* "certificatePolicies" */
1180&(nid_objs[54]),/* "challengePassword" */
1181&(nid_objs[130]),/* "clientAuth" */
1182&(nid_objs[131]),/* "codeSigning" */
1183&(nid_objs[50]),/* "contentType" */
1184&(nid_objs[53]),/* "countersignature" */
1185&(nid_objs[153]),/* "crlBag" */
1186&(nid_objs[103]),/* "crlDistributionPoints" */
1187&(nid_objs[88]),/* "crlNumber" */
1188&(nid_objs[390]),/* "dcobject" */
1189&(nid_objs[140]),/* "deltaCRL" */
1190&(nid_objs[28]),/* "dhKeyAgreement" */
1191&(nid_objs[382]),/* "directory" */
1192&(nid_objs[174]),/* "dnQualifier" */
1193&(nid_objs[392]),/* "domain" */
1194&(nid_objs[132]),/* "emailProtection" */
1195&(nid_objs[389]),/* "enterprises" */
1196&(nid_objs[384]),/* "experimental" */
1197&(nid_objs[172]),/* "extReq" */
1198&(nid_objs[56]),/* "extendedCertificateAttributes" */
1199&(nid_objs[126]),/* "extendedKeyUsage" */
1200&(nid_objs[372]),/* "extendedStatus" */
1201&(nid_objs[156]),/* "friendlyName" */
1202&(nid_objs[163]),/* "hmacWithSHA1" */
1203&(nid_objs[266]),/* "id-aca" */
1204&(nid_objs[355]),/* "id-aca-accessIdentity" */
1205&(nid_objs[354]),/* "id-aca-authenticationInfo" */
1206&(nid_objs[356]),/* "id-aca-chargingIdentity" */
1207&(nid_objs[357]),/* "id-aca-group" */
1208&(nid_objs[358]),/* "id-aca-role" */
1209&(nid_objs[176]),/* "id-ad" */
1210&(nid_objs[262]),/* "id-alg" */
1211&(nid_objs[323]),/* "id-alg-des40" */
1212&(nid_objs[326]),/* "id-alg-dh-pop" */
1213&(nid_objs[325]),/* "id-alg-dh-sig-hmac-sha1" */
1214&(nid_objs[324]),/* "id-alg-noSignature" */
1215&(nid_objs[268]),/* "id-cct" */
1216&(nid_objs[361]),/* "id-cct-PKIData" */
1217&(nid_objs[362]),/* "id-cct-PKIResponse" */
1218&(nid_objs[360]),/* "id-cct-crs" */
1219&(nid_objs[81]),/* "id-ce" */
1220&(nid_objs[263]),/* "id-cmc" */
1221&(nid_objs[334]),/* "id-cmc-addExtensions" */
1222&(nid_objs[346]),/* "id-cmc-confirmCertAcceptance" */
1223&(nid_objs[330]),/* "id-cmc-dataReturn" */
1224&(nid_objs[336]),/* "id-cmc-decryptedPOP" */
1225&(nid_objs[335]),/* "id-cmc-encryptedPOP" */
1226&(nid_objs[339]),/* "id-cmc-getCRL" */
1227&(nid_objs[338]),/* "id-cmc-getCert" */
1228&(nid_objs[328]),/* "id-cmc-identification" */
1229&(nid_objs[329]),/* "id-cmc-identityProof" */
1230&(nid_objs[337]),/* "id-cmc-lraPOPWitness" */
1231&(nid_objs[344]),/* "id-cmc-popLinkRandom" */
1232&(nid_objs[345]),/* "id-cmc-popLinkWitness" */
1233&(nid_objs[343]),/* "id-cmc-queryPending" */
1234&(nid_objs[333]),/* "id-cmc-recipientNonce" */
1235&(nid_objs[341]),/* "id-cmc-regInfo" */
1236&(nid_objs[342]),/* "id-cmc-responseInfo" */
1237&(nid_objs[340]),/* "id-cmc-revokeRequest" */
1238&(nid_objs[332]),/* "id-cmc-senderNonce" */
1239&(nid_objs[327]),/* "id-cmc-statusInfo" */
1240&(nid_objs[331]),/* "id-cmc-transactionId" */
1241&(nid_objs[260]),/* "id-it" */
1242&(nid_objs[302]),/* "id-it-caKeyUpdateInfo" */
1243&(nid_objs[298]),/* "id-it-caProtEncCert" */
1244&(nid_objs[311]),/* "id-it-confirmWaitTime" */
1245&(nid_objs[303]),/* "id-it-currentCRL" */
1246&(nid_objs[300]),/* "id-it-encKeyPairTypes" */
1247&(nid_objs[310]),/* "id-it-implicitConfirm" */
1248&(nid_objs[308]),/* "id-it-keyPairParamRep" */
1249&(nid_objs[307]),/* "id-it-keyPairParamReq" */
1250&(nid_objs[312]),/* "id-it-origPKIMessage" */
1251&(nid_objs[301]),/* "id-it-preferredSymmAlg" */
1252&(nid_objs[309]),/* "id-it-revPassphrase" */
1253&(nid_objs[299]),/* "id-it-signKeyPairTypes" */
1254&(nid_objs[305]),/* "id-it-subscriptionRequest" */
1255&(nid_objs[306]),/* "id-it-subscriptionResponse" */
1256&(nid_objs[304]),/* "id-it-unsupportedOIDs" */
1257&(nid_objs[128]),/* "id-kp" */
1258&(nid_objs[280]),/* "id-mod-attribute-cert" */
1259&(nid_objs[274]),/* "id-mod-cmc" */
1260&(nid_objs[277]),/* "id-mod-cmp" */
1261&(nid_objs[284]),/* "id-mod-cmp2000" */
1262&(nid_objs[273]),/* "id-mod-crmf" */
1263&(nid_objs[283]),/* "id-mod-dvcs" */
1264&(nid_objs[275]),/* "id-mod-kea-profile-88" */
1265&(nid_objs[276]),/* "id-mod-kea-profile-93" */
1266&(nid_objs[282]),/* "id-mod-ocsp" */
1267&(nid_objs[278]),/* "id-mod-qualified-cert-88" */
1268&(nid_objs[279]),/* "id-mod-qualified-cert-93" */
1269&(nid_objs[281]),/* "id-mod-timestamp-protocol" */
1270&(nid_objs[264]),/* "id-on" */
1271&(nid_objs[347]),/* "id-on-personalData" */
1272&(nid_objs[265]),/* "id-pda" */
1273&(nid_objs[352]),/* "id-pda-countryOfCitizenship" */
1274&(nid_objs[353]),/* "id-pda-countryOfResidence" */
1275&(nid_objs[348]),/* "id-pda-dateOfBirth" */
1276&(nid_objs[351]),/* "id-pda-gender" */
1277&(nid_objs[349]),/* "id-pda-placeOfBirth" */
1278&(nid_objs[350]),/* "id-pda-pseudonym" */
1279&(nid_objs[175]),/* "id-pe" */
1280&(nid_objs[261]),/* "id-pkip" */
1281&(nid_objs[258]),/* "id-pkix-mod" */
1282&(nid_objs[269]),/* "id-pkix1-explicit-88" */
1283&(nid_objs[271]),/* "id-pkix1-explicit-93" */
1284&(nid_objs[270]),/* "id-pkix1-implicit-88" */
1285&(nid_objs[272]),/* "id-pkix1-implicit-93" */
1286&(nid_objs[267]),/* "id-qcs" */
1287&(nid_objs[359]),/* "id-qcs-pkixQCSyntax-v1" */
1288&(nid_objs[259]),/* "id-qt" */
1289&(nid_objs[164]),/* "id-qt-cps" */
1290&(nid_objs[165]),/* "id-qt-unotice" */
1291&(nid_objs[313]),/* "id-regCtrl" */
1292&(nid_objs[316]),/* "id-regCtrl-authenticator" */
1293&(nid_objs[319]),/* "id-regCtrl-oldCertID" */
1294&(nid_objs[318]),/* "id-regCtrl-pkiArchiveOptions" */
1295&(nid_objs[317]),/* "id-regCtrl-pkiPublicationInfo" */
1296&(nid_objs[320]),/* "id-regCtrl-protocolEncrKey" */
1297&(nid_objs[315]),/* "id-regCtrl-regToken" */
1298&(nid_objs[314]),/* "id-regInfo" */
1299&(nid_objs[322]),/* "id-regInfo-certReq" */
1300&(nid_objs[321]),/* "id-regInfo-utf8Pairs" */
1301&(nid_objs[191]),/* "id-smime-aa" */
1302&(nid_objs[215]),/* "id-smime-aa-contentHint" */
1303&(nid_objs[218]),/* "id-smime-aa-contentIdentifier" */
1304&(nid_objs[221]),/* "id-smime-aa-contentReference" */
1305&(nid_objs[240]),/* "id-smime-aa-dvcs-dvc" */
1306&(nid_objs[217]),/* "id-smime-aa-encapContentType" */
1307&(nid_objs[222]),/* "id-smime-aa-encrypKeyPref" */
1308&(nid_objs[220]),/* "id-smime-aa-equivalentLabels" */
1309&(nid_objs[232]),/* "id-smime-aa-ets-CertificateRefs" */
1310&(nid_objs[233]),/* "id-smime-aa-ets-RevocationRefs" */
1311&(nid_objs[238]),/* "id-smime-aa-ets-archiveTimeStamp" */
1312&(nid_objs[237]),/* "id-smime-aa-ets-certCRLTimestamp" */
1313&(nid_objs[234]),/* "id-smime-aa-ets-certValues" */
1314&(nid_objs[227]),/* "id-smime-aa-ets-commitmentType" */
1315&(nid_objs[231]),/* "id-smime-aa-ets-contentTimestamp" */
1316&(nid_objs[236]),/* "id-smime-aa-ets-escTimeStamp" */
1317&(nid_objs[230]),/* "id-smime-aa-ets-otherSigCert" */
1318&(nid_objs[235]),/* "id-smime-aa-ets-revocationValues" */
1319&(nid_objs[226]),/* "id-smime-aa-ets-sigPolicyId" */
1320&(nid_objs[229]),/* "id-smime-aa-ets-signerAttr" */
1321&(nid_objs[228]),/* "id-smime-aa-ets-signerLocation" */
1322&(nid_objs[219]),/* "id-smime-aa-macValue" */
1323&(nid_objs[214]),/* "id-smime-aa-mlExpandHistory" */
1324&(nid_objs[216]),/* "id-smime-aa-msgSigDigest" */
1325&(nid_objs[212]),/* "id-smime-aa-receiptRequest" */
1326&(nid_objs[213]),/* "id-smime-aa-securityLabel" */
1327&(nid_objs[239]),/* "id-smime-aa-signatureType" */
1328&(nid_objs[223]),/* "id-smime-aa-signingCertificate" */
1329&(nid_objs[224]),/* "id-smime-aa-smimeEncryptCerts" */
1330&(nid_objs[225]),/* "id-smime-aa-timeStampToken" */
1331&(nid_objs[192]),/* "id-smime-alg" */
1332&(nid_objs[243]),/* "id-smime-alg-3DESwrap" */
1333&(nid_objs[246]),/* "id-smime-alg-CMS3DESwrap" */
1334&(nid_objs[247]),/* "id-smime-alg-CMSRC2wrap" */
1335&(nid_objs[245]),/* "id-smime-alg-ESDH" */
1336&(nid_objs[241]),/* "id-smime-alg-ESDHwith3DES" */
1337&(nid_objs[242]),/* "id-smime-alg-ESDHwithRC2" */
1338&(nid_objs[244]),/* "id-smime-alg-RC2wrap" */
1339&(nid_objs[193]),/* "id-smime-cd" */
1340&(nid_objs[248]),/* "id-smime-cd-ldap" */
1341&(nid_objs[190]),/* "id-smime-ct" */
1342&(nid_objs[210]),/* "id-smime-ct-DVCSRequestData" */
1343&(nid_objs[211]),/* "id-smime-ct-DVCSResponseData" */
1344&(nid_objs[208]),/* "id-smime-ct-TDTInfo" */
1345&(nid_objs[207]),/* "id-smime-ct-TSTInfo" */
1346&(nid_objs[205]),/* "id-smime-ct-authData" */
1347&(nid_objs[209]),/* "id-smime-ct-contentInfo" */
1348&(nid_objs[206]),/* "id-smime-ct-publishCert" */
1349&(nid_objs[204]),/* "id-smime-ct-receipt" */
1350&(nid_objs[195]),/* "id-smime-cti" */
1351&(nid_objs[255]),/* "id-smime-cti-ets-proofOfApproval" */
1352&(nid_objs[256]),/* "id-smime-cti-ets-proofOfCreation" */
1353&(nid_objs[253]),/* "id-smime-cti-ets-proofOfDelivery" */
1354&(nid_objs[251]),/* "id-smime-cti-ets-proofOfOrigin" */
1355&(nid_objs[252]),/* "id-smime-cti-ets-proofOfReceipt" */
1356&(nid_objs[254]),/* "id-smime-cti-ets-proofOfSender" */
1357&(nid_objs[189]),/* "id-smime-mod" */
1358&(nid_objs[196]),/* "id-smime-mod-cms" */
1359&(nid_objs[197]),/* "id-smime-mod-ess" */
1360&(nid_objs[202]),/* "id-smime-mod-ets-eSigPolicy-88" */
1361&(nid_objs[203]),/* "id-smime-mod-ets-eSigPolicy-97" */
1362&(nid_objs[200]),/* "id-smime-mod-ets-eSignature-88" */
1363&(nid_objs[201]),/* "id-smime-mod-ets-eSignature-97" */
1364&(nid_objs[199]),/* "id-smime-mod-msg-v3" */
1365&(nid_objs[198]),/* "id-smime-mod-oid" */
1366&(nid_objs[194]),/* "id-smime-spq" */
1367&(nid_objs[250]),/* "id-smime-spq-ets-sqt-unotice" */
1368&(nid_objs[249]),/* "id-smime-spq-ets-sqt-uri" */
1369&(nid_objs[142]),/* "invalidityDate" */
1370&(nid_objs[294]),/* "ipsecEndSystem" */
1371&(nid_objs[295]),/* "ipsecTunnel" */
1372&(nid_objs[296]),/* "ipsecUser" */
1373&(nid_objs[86]),/* "issuerAltName" */
1374&(nid_objs[150]),/* "keyBag" */
1375&(nid_objs[83]),/* "keyUsage" */
1376&(nid_objs[157]),/* "localKeyID" */
1377&(nid_objs[388]),/* "mail" */
1378&(nid_objs[182]),/* "member-body" */
1379&(nid_objs[51]),/* "messageDigest" */
1380&(nid_objs[383]),/* "mgmt" */
1381&(nid_objs[136]),/* "msCTLSign" */
1382&(nid_objs[135]),/* "msCodeCom" */
1383&(nid_objs[134]),/* "msCodeInd" */
1384&(nid_objs[138]),/* "msEFS" */
1385&(nid_objs[171]),/* "msExtReq" */
1386&(nid_objs[137]),/* "msSGC" */
1387&(nid_objs[173]),/* "name" */
1388&(nid_objs[369]),/* "noCheck" */
1389&(nid_objs[72]),/* "nsBaseUrl" */
1390&(nid_objs[76]),/* "nsCaPolicyUrl" */
1391&(nid_objs[74]),/* "nsCaRevocationUrl" */
1392&(nid_objs[58]),/* "nsCertExt" */
1393&(nid_objs[79]),/* "nsCertSequence" */
1394&(nid_objs[71]),/* "nsCertType" */
1395&(nid_objs[78]),/* "nsComment" */
1396&(nid_objs[59]),/* "nsDataType" */
1397&(nid_objs[75]),/* "nsRenewalUrl" */
1398&(nid_objs[73]),/* "nsRevocationUrl" */
1399&(nid_objs[139]),/* "nsSGC" */
1400&(nid_objs[77]),/* "nsSslServerName" */
1401&(nid_objs[374]),/* "path" */
1402&(nid_objs[112]),/* "pbeWithMD5AndCast5CBC" */
1403&(nid_objs[ 2]),/* "pkcs" */
1404&(nid_objs[186]),/* "pkcs1" */
1405&(nid_objs[27]),/* "pkcs3" */
1406&(nid_objs[187]),/* "pkcs5" */
1407&(nid_objs[20]),/* "pkcs7" */
1408&(nid_objs[21]),/* "pkcs7-data" */
1409&(nid_objs[25]),/* "pkcs7-digestData" */
1410&(nid_objs[26]),/* "pkcs7-encryptedData" */
1411&(nid_objs[23]),/* "pkcs7-envelopedData" */
1412&(nid_objs[24]),/* "pkcs7-signedAndEnvelopedData" */
1413&(nid_objs[22]),/* "pkcs7-signedData" */
1414&(nid_objs[151]),/* "pkcs8ShroudedKeyBag" */
1415&(nid_objs[47]),/* "pkcs9" */
1416&(nid_objs[385]),/* "private" */
1417&(nid_objs[84]),/* "privateKeyUsagePeriod" */
1418&(nid_objs[286]),/* "qcStatements" */
1419&(nid_objs[ 6]),/* "rsaEncryption" */
1420&(nid_objs[377]),/* "rsaSignature" */
1421&(nid_objs[ 1]),/* "rsadsi" */
1422&(nid_objs[155]),/* "safeContentsBag" */
1423&(nid_objs[291]),/* "sbqp-autonomousSysNum" */
1424&(nid_objs[290]),/* "sbqp-ipAddrBlock" */
1425&(nid_objs[292]),/* "sbqp-routerIdentifier" */
1426&(nid_objs[159]),/* "sdsiCertificate" */
1427&(nid_objs[154]),/* "secretBag" */
1428&(nid_objs[386]),/* "security" */
1429&(nid_objs[129]),/* "serverAuth" */
1430&(nid_objs[371]),/* "serviceLocator" */
1431&(nid_objs[52]),/* "signingTime" */
1432&(nid_objs[387]),/* "snmpv2" */
1433&(nid_objs[85]),/* "subjectAltName" */
1434&(nid_objs[82]),/* "subjectKeyIdentifier" */
1435&(nid_objs[293]),/* "textNotice" */
1436&(nid_objs[133]),/* "timeStamping" */
1437&(nid_objs[375]),/* "trustRoot" */
1438&(nid_objs[55]),/* "unstructuredAddress" */
1439&(nid_objs[49]),/* "unstructuredName" */
1440&(nid_objs[373]),/* "valid" */
1441&(nid_objs[158]),/* "x509Certificate" */
1442&(nid_objs[160]),/* "x509Crl" */
1443};
1444
1445static ASN1_OBJECT *ln_objs[NUM_LN]={
1446&(nid_objs[363]),/* "AD Time Stamping" */
1447&(nid_objs[368]),/* "Acceptable OCSP Responses" */
1448&(nid_objs[177]),/* "Authority Information Access" */
1449&(nid_objs[365]),/* "Basic OCSP Response" */
1450&(nid_objs[285]),/* "Biometric Info" */
1451&(nid_objs[179]),/* "CA Issuers" */
1452&(nid_objs[131]),/* "Code Signing" */
1453&(nid_objs[382]),/* "Directory" */
1454&(nid_objs[392]),/* "Domain" */
1455&(nid_objs[132]),/* "E-mail Protection" */
1456&(nid_objs[389]),/* "Enterprises" */
1457&(nid_objs[384]),/* "Experimental" */
1458&(nid_objs[372]),/* "Extended OCSP Status" */
1459&(nid_objs[172]),/* "Extension Request" */
1460&(nid_objs[294]),/* "IPSec End System" */
1461&(nid_objs[295]),/* "IPSec Tunnel" */
1462&(nid_objs[296]),/* "IPSec User" */
1463&(nid_objs[182]),/* "ISO Member Body" */
1464&(nid_objs[183]),/* "ISO US Member Body" */
1465&(nid_objs[142]),/* "Invalidity Date" */
1466&(nid_objs[388]),/* "Mail" */
1467&(nid_objs[383]),/* "Management" */
1468&(nid_objs[135]),/* "Microsoft Commercial Code Signing" */
1469&(nid_objs[138]),/* "Microsoft Encrypted File System" */
1470&(nid_objs[171]),/* "Microsoft Extension Request" */
1471&(nid_objs[134]),/* "Microsoft Individual Code Signing" */
1472&(nid_objs[137]),/* "Microsoft Server Gated Crypto" */
1473&(nid_objs[136]),/* "Microsoft Trust List Signing" */
1474&(nid_objs[72]),/* "Netscape Base Url" */
1475&(nid_objs[76]),/* "Netscape CA Policy Url" */
1476&(nid_objs[74]),/* "Netscape CA Revocation Url" */
1477&(nid_objs[71]),/* "Netscape Cert Type" */
1478&(nid_objs[58]),/* "Netscape Certificate Extension" */
1479&(nid_objs[79]),/* "Netscape Certificate Sequence" */
1480&(nid_objs[78]),/* "Netscape Comment" */
1481&(nid_objs[57]),/* "Netscape Communications Corp." */
1482&(nid_objs[59]),/* "Netscape Data Type" */
1483&(nid_objs[75]),/* "Netscape Renewal Url" */
1484&(nid_objs[73]),/* "Netscape Revocation Url" */
1485&(nid_objs[77]),/* "Netscape SSL Server Name" */
1486&(nid_objs[139]),/* "Netscape Server Gated Crypto" */
1487&(nid_objs[178]),/* "OCSP" */
1488&(nid_objs[370]),/* "OCSP Archive Cutoff" */
1489&(nid_objs[367]),/* "OCSP CRL ID" */
1490&(nid_objs[366]),/* "OCSP Nonce" */
1491&(nid_objs[371]),/* "OCSP Service Locator" */
1492&(nid_objs[180]),/* "OCSP Signing" */
1493&(nid_objs[161]),/* "PBES2" */
1494&(nid_objs[69]),/* "PBKDF2" */
1495&(nid_objs[162]),/* "PBMAC1" */
1496&(nid_objs[127]),/* "PKIX" */
1497&(nid_objs[164]),/* "Policy Qualifier CPS" */
1498&(nid_objs[165]),/* "Policy Qualifier User Notice" */
1499&(nid_objs[385]),/* "Private" */
1500&(nid_objs[ 1]),/* "RSA Data Security, Inc." */
1501&(nid_objs[ 2]),/* "RSA Data Security, Inc. PKCS" */
1502&(nid_objs[188]),/* "S/MIME" */
1503&(nid_objs[167]),/* "S/MIME Capabilities" */
1504&(nid_objs[387]),/* "SNMPv2" */
1505&(nid_objs[386]),/* "Security" */
1506&(nid_objs[143]),/* "Strong Extranet ID" */
1507&(nid_objs[130]),/* "TLS Web Client Authentication" */
1508&(nid_objs[129]),/* "TLS Web Server Authentication" */
1509&(nid_objs[133]),/* "Time Stamping" */
1510&(nid_objs[375]),/* "Trust Root" */
1511&(nid_objs[12]),/* "X509" */
1512&(nid_objs[90]),/* "X509v3 Authority Key Identifier" */
1513&(nid_objs[87]),/* "X509v3 Basic Constraints" */
1514&(nid_objs[103]),/* "X509v3 CRL Distribution Points" */
1515&(nid_objs[88]),/* "X509v3 CRL Number" */
1516&(nid_objs[141]),/* "X509v3 CRL Reason Code" */
1517&(nid_objs[89]),/* "X509v3 Certificate Policies" */
1518&(nid_objs[140]),/* "X509v3 Delta CRL Indicator" */
1519&(nid_objs[126]),/* "X509v3 Extended Key Usage" */
1520&(nid_objs[86]),/* "X509v3 Issuer Alternative Name" */
1521&(nid_objs[83]),/* "X509v3 Key Usage" */
1522&(nid_objs[84]),/* "X509v3 Private Key Usage Period" */
1523&(nid_objs[85]),/* "X509v3 Subject Alternative Name" */
1524&(nid_objs[82]),/* "X509v3 Subject Key Identifier" */
1525&(nid_objs[184]),/* "X9.57" */
1526&(nid_objs[185]),/* "X9.57 CM ?" */
1527&(nid_objs[289]),/* "aaControls" */
1528&(nid_objs[287]),/* "ac-auditEntity" */
1529&(nid_objs[288]),/* "ac-targeting" */
1530&(nid_objs[364]),/* "ad dvcs" */
1531&(nid_objs[376]),/* "algorithm" */
1532&(nid_objs[91]),/* "bf-cbc" */
1533&(nid_objs[93]),/* "bf-cfb" */
1534&(nid_objs[92]),/* "bf-ecb" */
1535&(nid_objs[94]),/* "bf-ofb" */
1536&(nid_objs[108]),/* "cast5-cbc" */
1537&(nid_objs[110]),/* "cast5-cfb" */
1538&(nid_objs[109]),/* "cast5-ecb" */
1539&(nid_objs[111]),/* "cast5-ofb" */
1540&(nid_objs[152]),/* "certBag" */
1541&(nid_objs[54]),/* "challengePassword" */
1542&(nid_objs[13]),/* "commonName" */
1543&(nid_objs[50]),/* "contentType" */
1544&(nid_objs[53]),/* "countersignature" */
1545&(nid_objs[14]),/* "countryName" */
1546&(nid_objs[153]),/* "crlBag" */
1547&(nid_objs[390]),/* "dcObject" */
1548&(nid_objs[31]),/* "des-cbc" */
1549&(nid_objs[30]),/* "des-cfb" */
1550&(nid_objs[29]),/* "des-ecb" */
1551&(nid_objs[32]),/* "des-ede" */
1552&(nid_objs[43]),/* "des-ede-cbc" */
1553&(nid_objs[60]),/* "des-ede-cfb" */
1554&(nid_objs[62]),/* "des-ede-ofb" */
1555&(nid_objs[33]),/* "des-ede3" */
1556&(nid_objs[44]),/* "des-ede3-cbc" */
1557&(nid_objs[61]),/* "des-ede3-cfb" */
1558&(nid_objs[63]),/* "des-ede3-ofb" */
1559&(nid_objs[45]),/* "des-ofb" */
1560&(nid_objs[107]),/* "description" */
1561&(nid_objs[80]),/* "desx-cbc" */
1562&(nid_objs[28]),/* "dhKeyAgreement" */
1563&(nid_objs[11]),/* "directory services (X.500)" */
1564&(nid_objs[378]),/* "directory services - algorithms" */
1565&(nid_objs[174]),/* "dnQualifier" */
1566&(nid_objs[380]),/* "dod" */
1567&(nid_objs[391]),/* "domainComponent" */
1568&(nid_objs[116]),/* "dsaEncryption" */
1569&(nid_objs[67]),/* "dsaEncryption-old" */
1570&(nid_objs[66]),/* "dsaWithSHA" */
1571&(nid_objs[113]),/* "dsaWithSHA1" */
1572&(nid_objs[70]),/* "dsaWithSHA1-old" */
1573&(nid_objs[297]),/* "dvcs" */
1574&(nid_objs[48]),/* "emailAddress" */
1575&(nid_objs[56]),/* "extendedCertificateAttributes" */
1576&(nid_objs[156]),/* "friendlyName" */
1577&(nid_objs[99]),/* "givenName" */
1578&(nid_objs[163]),/* "hmacWithSHA1" */
1579&(nid_objs[381]),/* "iana" */
1580&(nid_objs[266]),/* "id-aca" */
1581&(nid_objs[355]),/* "id-aca-accessIdentity" */
1582&(nid_objs[354]),/* "id-aca-authenticationInfo" */
1583&(nid_objs[356]),/* "id-aca-chargingIdentity" */
1584&(nid_objs[357]),/* "id-aca-group" */
1585&(nid_objs[358]),/* "id-aca-role" */
1586&(nid_objs[176]),/* "id-ad" */
1587&(nid_objs[262]),/* "id-alg" */
1588&(nid_objs[323]),/* "id-alg-des40" */
1589&(nid_objs[326]),/* "id-alg-dh-pop" */
1590&(nid_objs[325]),/* "id-alg-dh-sig-hmac-sha1" */
1591&(nid_objs[324]),/* "id-alg-noSignature" */
1592&(nid_objs[268]),/* "id-cct" */
1593&(nid_objs[361]),/* "id-cct-PKIData" */
1594&(nid_objs[362]),/* "id-cct-PKIResponse" */
1595&(nid_objs[360]),/* "id-cct-crs" */
1596&(nid_objs[81]),/* "id-ce" */
1597&(nid_objs[263]),/* "id-cmc" */
1598&(nid_objs[334]),/* "id-cmc-addExtensions" */
1599&(nid_objs[346]),/* "id-cmc-confirmCertAcceptance" */
1600&(nid_objs[330]),/* "id-cmc-dataReturn" */
1601&(nid_objs[336]),/* "id-cmc-decryptedPOP" */
1602&(nid_objs[335]),/* "id-cmc-encryptedPOP" */
1603&(nid_objs[339]),/* "id-cmc-getCRL" */
1604&(nid_objs[338]),/* "id-cmc-getCert" */
1605&(nid_objs[328]),/* "id-cmc-identification" */
1606&(nid_objs[329]),/* "id-cmc-identityProof" */
1607&(nid_objs[337]),/* "id-cmc-lraPOPWitness" */
1608&(nid_objs[344]),/* "id-cmc-popLinkRandom" */
1609&(nid_objs[345]),/* "id-cmc-popLinkWitness" */
1610&(nid_objs[343]),/* "id-cmc-queryPending" */
1611&(nid_objs[333]),/* "id-cmc-recipientNonce" */
1612&(nid_objs[341]),/* "id-cmc-regInfo" */
1613&(nid_objs[342]),/* "id-cmc-responseInfo" */
1614&(nid_objs[340]),/* "id-cmc-revokeRequest" */
1615&(nid_objs[332]),/* "id-cmc-senderNonce" */
1616&(nid_objs[327]),/* "id-cmc-statusInfo" */
1617&(nid_objs[331]),/* "id-cmc-transactionId" */
1618&(nid_objs[260]),/* "id-it" */
1619&(nid_objs[302]),/* "id-it-caKeyUpdateInfo" */
1620&(nid_objs[298]),/* "id-it-caProtEncCert" */
1621&(nid_objs[311]),/* "id-it-confirmWaitTime" */
1622&(nid_objs[303]),/* "id-it-currentCRL" */
1623&(nid_objs[300]),/* "id-it-encKeyPairTypes" */
1624&(nid_objs[310]),/* "id-it-implicitConfirm" */
1625&(nid_objs[308]),/* "id-it-keyPairParamRep" */
1626&(nid_objs[307]),/* "id-it-keyPairParamReq" */
1627&(nid_objs[312]),/* "id-it-origPKIMessage" */
1628&(nid_objs[301]),/* "id-it-preferredSymmAlg" */
1629&(nid_objs[309]),/* "id-it-revPassphrase" */
1630&(nid_objs[299]),/* "id-it-signKeyPairTypes" */
1631&(nid_objs[305]),/* "id-it-subscriptionRequest" */
1632&(nid_objs[306]),/* "id-it-subscriptionResponse" */
1633&(nid_objs[304]),/* "id-it-unsupportedOIDs" */
1634&(nid_objs[128]),/* "id-kp" */
1635&(nid_objs[280]),/* "id-mod-attribute-cert" */
1636&(nid_objs[274]),/* "id-mod-cmc" */
1637&(nid_objs[277]),/* "id-mod-cmp" */
1638&(nid_objs[284]),/* "id-mod-cmp2000" */
1639&(nid_objs[273]),/* "id-mod-crmf" */
1640&(nid_objs[283]),/* "id-mod-dvcs" */
1641&(nid_objs[275]),/* "id-mod-kea-profile-88" */
1642&(nid_objs[276]),/* "id-mod-kea-profile-93" */
1643&(nid_objs[282]),/* "id-mod-ocsp" */
1644&(nid_objs[278]),/* "id-mod-qualified-cert-88" */
1645&(nid_objs[279]),/* "id-mod-qualified-cert-93" */
1646&(nid_objs[281]),/* "id-mod-timestamp-protocol" */
1647&(nid_objs[264]),/* "id-on" */
1648&(nid_objs[347]),/* "id-on-personalData" */
1649&(nid_objs[265]),/* "id-pda" */
1650&(nid_objs[352]),/* "id-pda-countryOfCitizenship" */
1651&(nid_objs[353]),/* "id-pda-countryOfResidence" */
1652&(nid_objs[348]),/* "id-pda-dateOfBirth" */
1653&(nid_objs[351]),/* "id-pda-gender" */
1654&(nid_objs[349]),/* "id-pda-placeOfBirth" */
1655&(nid_objs[350]),/* "id-pda-pseudonym" */
1656&(nid_objs[175]),/* "id-pe" */
1657&(nid_objs[261]),/* "id-pkip" */
1658&(nid_objs[258]),/* "id-pkix-mod" */
1659&(nid_objs[269]),/* "id-pkix1-explicit-88" */
1660&(nid_objs[271]),/* "id-pkix1-explicit-93" */
1661&(nid_objs[270]),/* "id-pkix1-implicit-88" */
1662&(nid_objs[272]),/* "id-pkix1-implicit-93" */
1663&(nid_objs[267]),/* "id-qcs" */
1664&(nid_objs[359]),/* "id-qcs-pkixQCSyntax-v1" */
1665&(nid_objs[259]),/* "id-qt" */
1666&(nid_objs[313]),/* "id-regCtrl" */
1667&(nid_objs[316]),/* "id-regCtrl-authenticator" */
1668&(nid_objs[319]),/* "id-regCtrl-oldCertID" */
1669&(nid_objs[318]),/* "id-regCtrl-pkiArchiveOptions" */
1670&(nid_objs[317]),/* "id-regCtrl-pkiPublicationInfo" */
1671&(nid_objs[320]),/* "id-regCtrl-protocolEncrKey" */
1672&(nid_objs[315]),/* "id-regCtrl-regToken" */
1673&(nid_objs[314]),/* "id-regInfo" */
1674&(nid_objs[322]),/* "id-regInfo-certReq" */
1675&(nid_objs[321]),/* "id-regInfo-utf8Pairs" */
1676&(nid_objs[191]),/* "id-smime-aa" */
1677&(nid_objs[215]),/* "id-smime-aa-contentHint" */
1678&(nid_objs[218]),/* "id-smime-aa-contentIdentifier" */
1679&(nid_objs[221]),/* "id-smime-aa-contentReference" */
1680&(nid_objs[240]),/* "id-smime-aa-dvcs-dvc" */
1681&(nid_objs[217]),/* "id-smime-aa-encapContentType" */
1682&(nid_objs[222]),/* "id-smime-aa-encrypKeyPref" */
1683&(nid_objs[220]),/* "id-smime-aa-equivalentLabels" */
1684&(nid_objs[232]),/* "id-smime-aa-ets-CertificateRefs" */
1685&(nid_objs[233]),/* "id-smime-aa-ets-RevocationRefs" */
1686&(nid_objs[238]),/* "id-smime-aa-ets-archiveTimeStamp" */
1687&(nid_objs[237]),/* "id-smime-aa-ets-certCRLTimestamp" */
1688&(nid_objs[234]),/* "id-smime-aa-ets-certValues" */
1689&(nid_objs[227]),/* "id-smime-aa-ets-commitmentType" */
1690&(nid_objs[231]),/* "id-smime-aa-ets-contentTimestamp" */
1691&(nid_objs[236]),/* "id-smime-aa-ets-escTimeStamp" */
1692&(nid_objs[230]),/* "id-smime-aa-ets-otherSigCert" */
1693&(nid_objs[235]),/* "id-smime-aa-ets-revocationValues" */
1694&(nid_objs[226]),/* "id-smime-aa-ets-sigPolicyId" */
1695&(nid_objs[229]),/* "id-smime-aa-ets-signerAttr" */
1696&(nid_objs[228]),/* "id-smime-aa-ets-signerLocation" */
1697&(nid_objs[219]),/* "id-smime-aa-macValue" */
1698&(nid_objs[214]),/* "id-smime-aa-mlExpandHistory" */
1699&(nid_objs[216]),/* "id-smime-aa-msgSigDigest" */
1700&(nid_objs[212]),/* "id-smime-aa-receiptRequest" */
1701&(nid_objs[213]),/* "id-smime-aa-securityLabel" */
1702&(nid_objs[239]),/* "id-smime-aa-signatureType" */
1703&(nid_objs[223]),/* "id-smime-aa-signingCertificate" */
1704&(nid_objs[224]),/* "id-smime-aa-smimeEncryptCerts" */
1705&(nid_objs[225]),/* "id-smime-aa-timeStampToken" */
1706&(nid_objs[192]),/* "id-smime-alg" */
1707&(nid_objs[243]),/* "id-smime-alg-3DESwrap" */
1708&(nid_objs[246]),/* "id-smime-alg-CMS3DESwrap" */
1709&(nid_objs[247]),/* "id-smime-alg-CMSRC2wrap" */
1710&(nid_objs[245]),/* "id-smime-alg-ESDH" */
1711&(nid_objs[241]),/* "id-smime-alg-ESDHwith3DES" */
1712&(nid_objs[242]),/* "id-smime-alg-ESDHwithRC2" */
1713&(nid_objs[244]),/* "id-smime-alg-RC2wrap" */
1714&(nid_objs[193]),/* "id-smime-cd" */
1715&(nid_objs[248]),/* "id-smime-cd-ldap" */
1716&(nid_objs[190]),/* "id-smime-ct" */
1717&(nid_objs[210]),/* "id-smime-ct-DVCSRequestData" */
1718&(nid_objs[211]),/* "id-smime-ct-DVCSResponseData" */
1719&(nid_objs[208]),/* "id-smime-ct-TDTInfo" */
1720&(nid_objs[207]),/* "id-smime-ct-TSTInfo" */
1721&(nid_objs[205]),/* "id-smime-ct-authData" */
1722&(nid_objs[209]),/* "id-smime-ct-contentInfo" */
1723&(nid_objs[206]),/* "id-smime-ct-publishCert" */
1724&(nid_objs[204]),/* "id-smime-ct-receipt" */
1725&(nid_objs[195]),/* "id-smime-cti" */
1726&(nid_objs[255]),/* "id-smime-cti-ets-proofOfApproval" */
1727&(nid_objs[256]),/* "id-smime-cti-ets-proofOfCreation" */
1728&(nid_objs[253]),/* "id-smime-cti-ets-proofOfDelivery" */
1729&(nid_objs[251]),/* "id-smime-cti-ets-proofOfOrigin" */
1730&(nid_objs[252]),/* "id-smime-cti-ets-proofOfReceipt" */
1731&(nid_objs[254]),/* "id-smime-cti-ets-proofOfSender" */
1732&(nid_objs[189]),/* "id-smime-mod" */
1733&(nid_objs[196]),/* "id-smime-mod-cms" */
1734&(nid_objs[197]),/* "id-smime-mod-ess" */
1735&(nid_objs[202]),/* "id-smime-mod-ets-eSigPolicy-88" */
1736&(nid_objs[203]),/* "id-smime-mod-ets-eSigPolicy-97" */
1737&(nid_objs[200]),/* "id-smime-mod-ets-eSignature-88" */
1738&(nid_objs[201]),/* "id-smime-mod-ets-eSignature-97" */
1739&(nid_objs[199]),/* "id-smime-mod-msg-v3" */
1740&(nid_objs[198]),/* "id-smime-mod-oid" */
1741&(nid_objs[194]),/* "id-smime-spq" */
1742&(nid_objs[250]),/* "id-smime-spq-ets-sqt-unotice" */
1743&(nid_objs[249]),/* "id-smime-spq-ets-sqt-uri" */
1744&(nid_objs[34]),/* "idea-cbc" */
1745&(nid_objs[35]),/* "idea-cfb" */
1746&(nid_objs[36]),/* "idea-ecb" */
1747&(nid_objs[46]),/* "idea-ofb" */
1748&(nid_objs[101]),/* "initials" */
1749&(nid_objs[181]),/* "iso" */
1750&(nid_objs[150]),/* "keyBag" */
1751&(nid_objs[157]),/* "localKeyID" */
1752&(nid_objs[15]),/* "localityName" */
1753&(nid_objs[ 3]),/* "md2" */
1754&(nid_objs[ 7]),/* "md2WithRSAEncryption" */
1755&(nid_objs[257]),/* "md4" */
1756&(nid_objs[ 4]),/* "md5" */
1757&(nid_objs[114]),/* "md5-sha1" */
1758&(nid_objs[104]),/* "md5WithRSA" */
1759&(nid_objs[ 8]),/* "md5WithRSAEncryption" */
1760&(nid_objs[95]),/* "mdc2" */
1761&(nid_objs[96]),/* "mdc2WithRSA" */
1762&(nid_objs[51]),/* "messageDigest" */
1763&(nid_objs[173]),/* "name" */
1764&(nid_objs[369]),/* "noCheck" */
1765&(nid_objs[379]),/* "org" */
1766&(nid_objs[17]),/* "organizationName" */
1767&(nid_objs[18]),/* "organizationalUnitName" */
1768&(nid_objs[374]),/* "path" */
1769&(nid_objs[ 9]),/* "pbeWithMD2AndDES-CBC" */
1770&(nid_objs[168]),/* "pbeWithMD2AndRC2-CBC" */
1771&(nid_objs[112]),/* "pbeWithMD5AndCast5CBC" */
1772&(nid_objs[10]),/* "pbeWithMD5AndDES-CBC" */
1773&(nid_objs[169]),/* "pbeWithMD5AndRC2-CBC" */
1774&(nid_objs[148]),/* "pbeWithSHA1And128BitRC2-CBC" */
1775&(nid_objs[144]),/* "pbeWithSHA1And128BitRC4" */
1776&(nid_objs[147]),/* "pbeWithSHA1And2-KeyTripleDES-CBC" */
1777&(nid_objs[146]),/* "pbeWithSHA1And3-KeyTripleDES-CBC" */
1778&(nid_objs[149]),/* "pbeWithSHA1And40BitRC2-CBC" */
1779&(nid_objs[145]),/* "pbeWithSHA1And40BitRC4" */
1780&(nid_objs[170]),/* "pbeWithSHA1AndDES-CBC" */
1781&(nid_objs[68]),/* "pbeWithSHA1AndRC2-CBC" */
1782&(nid_objs[186]),/* "pkcs1" */
1783&(nid_objs[27]),/* "pkcs3" */
1784&(nid_objs[187]),/* "pkcs5" */
1785&(nid_objs[20]),/* "pkcs7" */
1786&(nid_objs[21]),/* "pkcs7-data" */
1787&(nid_objs[25]),/* "pkcs7-digestData" */
1788&(nid_objs[26]),/* "pkcs7-encryptedData" */
1789&(nid_objs[23]),/* "pkcs7-envelopedData" */
1790&(nid_objs[24]),/* "pkcs7-signedAndEnvelopedData" */
1791&(nid_objs[22]),/* "pkcs7-signedData" */
1792&(nid_objs[151]),/* "pkcs8ShroudedKeyBag" */
1793&(nid_objs[47]),/* "pkcs9" */
1794&(nid_objs[286]),/* "qcStatements" */
1795&(nid_objs[98]),/* "rc2-40-cbc" */
1796&(nid_objs[166]),/* "rc2-64-cbc" */
1797&(nid_objs[37]),/* "rc2-cbc" */
1798&(nid_objs[39]),/* "rc2-cfb" */
1799&(nid_objs[38]),/* "rc2-ecb" */
1800&(nid_objs[40]),/* "rc2-ofb" */
1801&(nid_objs[ 5]),/* "rc4" */
1802&(nid_objs[97]),/* "rc4-40" */
1803&(nid_objs[120]),/* "rc5-cbc" */
1804&(nid_objs[122]),/* "rc5-cfb" */
1805&(nid_objs[121]),/* "rc5-ecb" */
1806&(nid_objs[123]),/* "rc5-ofb" */
1807&(nid_objs[117]),/* "ripemd160" */
1808&(nid_objs[119]),/* "ripemd160WithRSA" */
1809&(nid_objs[19]),/* "rsa" */
1810&(nid_objs[ 6]),/* "rsaEncryption" */
1811&(nid_objs[377]),/* "rsaSignature" */
1812&(nid_objs[124]),/* "run length compression" */
1813&(nid_objs[155]),/* "safeContentsBag" */
1814&(nid_objs[291]),/* "sbqp-autonomousSysNum" */
1815&(nid_objs[290]),/* "sbqp-ipAddrBlock" */
1816&(nid_objs[292]),/* "sbqp-routerIdentifier" */
1817&(nid_objs[159]),/* "sdsiCertificate" */
1818&(nid_objs[154]),/* "secretBag" */
1819&(nid_objs[105]),/* "serialNumber" */
1820&(nid_objs[41]),/* "sha" */
1821&(nid_objs[64]),/* "sha1" */
1822&(nid_objs[115]),/* "sha1WithRSA" */
1823&(nid_objs[65]),/* "sha1WithRSAEncryption" */
1824&(nid_objs[42]),/* "shaWithRSAEncryption" */
1825&(nid_objs[52]),/* "signingTime" */
1826&(nid_objs[16]),/* "stateOrProvinceName" */
1827&(nid_objs[100]),/* "surname" */
1828&(nid_objs[293]),/* "textNotice" */
1829&(nid_objs[106]),/* "title" */
1830&(nid_objs[ 0]),/* "undefined" */
1831&(nid_objs[102]),/* "uniqueIdentifier" */
1832&(nid_objs[55]),/* "unstructuredAddress" */
1833&(nid_objs[49]),/* "unstructuredName" */
1834&(nid_objs[373]),/* "valid" */
1835&(nid_objs[158]),/* "x509Certificate" */
1836&(nid_objs[160]),/* "x509Crl" */
1837&(nid_objs[125]),/* "zlib compression" */
1838};
1839
1840static ASN1_OBJECT *obj_objs[NUM_OBJ]={
1841&(nid_objs[ 0]),/* OBJ_undef 0 */
1842&(nid_objs[389]),/* OBJ_Enterprises 1 */
1843&(nid_objs[181]),/* OBJ_iso 1 */
1844&(nid_objs[182]),/* OBJ_member_body 1 2 */
1845&(nid_objs[379]),/* OBJ_org 1 3 */
1846&(nid_objs[11]),/* OBJ_X500 2 5 */
1847&(nid_objs[380]),/* OBJ_dod 1 3 6 */
1848&(nid_objs[12]),/* OBJ_X509 2 5 4 */
1849&(nid_objs[378]),/* OBJ_X500algorithms 2 5 8 */
1850&(nid_objs[81]),/* OBJ_id_ce 2 5 29 */
1851&(nid_objs[183]),/* OBJ_ISO_US 1 2 840 */
1852&(nid_objs[381]),/* OBJ_iana 1 3 6 1 */
1853&(nid_objs[13]),/* OBJ_commonName 2 5 4 3 */
1854&(nid_objs[100]),/* OBJ_surname 2 5 4 4 */
1855&(nid_objs[105]),/* OBJ_serialNumber 2 5 4 5 */
1856&(nid_objs[14]),/* OBJ_countryName 2 5 4 6 */
1857&(nid_objs[15]),/* OBJ_localityName 2 5 4 7 */
1858&(nid_objs[16]),/* OBJ_stateOrProvinceName 2 5 4 8 */
1859&(nid_objs[17]),/* OBJ_organizationName 2 5 4 10 */
1860&(nid_objs[18]),/* OBJ_organizationalUnitName 2 5 4 11 */
1861&(nid_objs[106]),/* OBJ_title 2 5 4 12 */
1862&(nid_objs[107]),/* OBJ_description 2 5 4 13 */
1863&(nid_objs[173]),/* OBJ_name 2 5 4 41 */
1864&(nid_objs[99]),/* OBJ_givenName 2 5 4 42 */
1865&(nid_objs[101]),/* OBJ_initials 2 5 4 43 */
1866&(nid_objs[102]),/* OBJ_uniqueIdentifier 2 5 4 45 */
1867&(nid_objs[174]),/* OBJ_dnQualifier 2 5 4 46 */
1868&(nid_objs[82]),/* OBJ_subject_key_identifier 2 5 29 14 */
1869&(nid_objs[83]),/* OBJ_key_usage 2 5 29 15 */
1870&(nid_objs[84]),/* OBJ_private_key_usage_period 2 5 29 16 */
1871&(nid_objs[85]),/* OBJ_subject_alt_name 2 5 29 17 */
1872&(nid_objs[86]),/* OBJ_issuer_alt_name 2 5 29 18 */
1873&(nid_objs[87]),/* OBJ_basic_constraints 2 5 29 19 */
1874&(nid_objs[88]),/* OBJ_crl_number 2 5 29 20 */
1875&(nid_objs[141]),/* OBJ_crl_reason 2 5 29 21 */
1876&(nid_objs[142]),/* OBJ_invalidity_date 2 5 29 24 */
1877&(nid_objs[140]),/* OBJ_delta_crl 2 5 29 27 */
1878&(nid_objs[103]),/* OBJ_crl_distribution_points 2 5 29 31 */
1879&(nid_objs[89]),/* OBJ_certificate_policies 2 5 29 32 */
1880&(nid_objs[90]),/* OBJ_authority_key_identifier 2 5 29 35 */
1881&(nid_objs[126]),/* OBJ_ext_key_usage 2 5 29 37 */
1882&(nid_objs[390]),/* OBJ_dcObject 1466 344 */
1883&(nid_objs[382]),/* OBJ_Directory 1 3 6 1 1 */
1884&(nid_objs[383]),/* OBJ_Management 1 3 6 1 2 */
1885&(nid_objs[384]),/* OBJ_Experimental 1 3 6 1 3 */
1886&(nid_objs[385]),/* OBJ_Private 1 3 6 1 4 */
1887&(nid_objs[386]),/* OBJ_Security 1 3 6 1 5 */
1888&(nid_objs[387]),/* OBJ_SNMPv2 1 3 6 1 6 */
1889&(nid_objs[388]),/* OBJ_Mail 1 3 6 1 7 */
1890&(nid_objs[376]),/* OBJ_algorithm 1 3 14 3 2 */
1891&(nid_objs[19]),/* OBJ_rsa 2 5 8 1 1 */
1892&(nid_objs[96]),/* OBJ_mdc2WithRSA 2 5 8 3 100 */
1893&(nid_objs[95]),/* OBJ_mdc2 2 5 8 3 101 */
1894&(nid_objs[184]),/* OBJ_X9_57 1 2 840 10040 */
1895&(nid_objs[104]),/* OBJ_md5WithRSA 1 3 14 3 2 3 */
1896&(nid_objs[29]),/* OBJ_des_ecb 1 3 14 3 2 6 */
1897&(nid_objs[31]),/* OBJ_des_cbc 1 3 14 3 2 7 */
1898&(nid_objs[45]),/* OBJ_des_ofb64 1 3 14 3 2 8 */
1899&(nid_objs[30]),/* OBJ_des_cfb64 1 3 14 3 2 9 */
1900&(nid_objs[377]),/* OBJ_rsaSignature 1 3 14 3 2 11 */
1901&(nid_objs[67]),/* OBJ_dsa_2 1 3 14 3 2 12 */
1902&(nid_objs[66]),/* OBJ_dsaWithSHA 1 3 14 3 2 13 */
1903&(nid_objs[42]),/* OBJ_shaWithRSAEncryption 1 3 14 3 2 15 */
1904&(nid_objs[32]),/* OBJ_des_ede 1 3 14 3 2 17 */
1905&(nid_objs[41]),/* OBJ_sha 1 3 14 3 2 18 */
1906&(nid_objs[64]),/* OBJ_sha1 1 3 14 3 2 26 */
1907&(nid_objs[70]),/* OBJ_dsaWithSHA1_2 1 3 14 3 2 27 */
1908&(nid_objs[115]),/* OBJ_sha1WithRSA 1 3 14 3 2 29 */
1909&(nid_objs[117]),/* OBJ_ripemd160 1 3 36 3 2 1 */
1910&(nid_objs[143]),/* OBJ_sxnet 1 3 101 1 4 1 */
1911&(nid_objs[124]),/* OBJ_rle_compression 1 1 1 1 666 1 */
1912&(nid_objs[125]),/* OBJ_zlib_compression 1 1 1 1 666 2 */
1913&(nid_objs[ 1]),/* OBJ_rsadsi 1 2 840 113549 */
1914&(nid_objs[185]),/* OBJ_X9cm 1 2 840 10040 4 */
1915&(nid_objs[127]),/* OBJ_id_pkix 1 3 6 1 5 5 7 */
1916&(nid_objs[119]),/* OBJ_ripemd160WithRSA 1 3 36 3 3 1 2 */
1917&(nid_objs[ 2]),/* OBJ_pkcs 1 2 840 113549 1 */
1918&(nid_objs[116]),/* OBJ_dsa 1 2 840 10040 4 1 */
1919&(nid_objs[113]),/* OBJ_dsaWithSHA1 1 2 840 10040 4 3 */
1920&(nid_objs[258]),/* OBJ_id_pkix_mod 1 3 6 1 5 5 7 0 */
1921&(nid_objs[175]),/* OBJ_id_pe 1 3 6 1 5 5 7 1 */
1922&(nid_objs[259]),/* OBJ_id_qt 1 3 6 1 5 5 7 2 */
1923&(nid_objs[128]),/* OBJ_id_kp 1 3 6 1 5 5 7 3 */
1924&(nid_objs[260]),/* OBJ_id_it 1 3 6 1 5 5 7 4 */
1925&(nid_objs[261]),/* OBJ_id_pkip 1 3 6 1 5 5 7 5 */
1926&(nid_objs[262]),/* OBJ_id_alg 1 3 6 1 5 5 7 6 */
1927&(nid_objs[263]),/* OBJ_id_cmc 1 3 6 1 5 5 7 7 */
1928&(nid_objs[264]),/* OBJ_id_on 1 3 6 1 5 5 7 8 */
1929&(nid_objs[265]),/* OBJ_id_pda 1 3 6 1 5 5 7 9 */
1930&(nid_objs[266]),/* OBJ_id_aca 1 3 6 1 5 5 7 10 */
1931&(nid_objs[267]),/* OBJ_id_qcs 1 3 6 1 5 5 7 11 */
1932&(nid_objs[268]),/* OBJ_id_cct 1 3 6 1 5 5 7 12 */
1933&(nid_objs[176]),/* OBJ_id_ad 1 3 6 1 5 5 7 48 */
1934&(nid_objs[57]),/* OBJ_netscape 2 16 840 1 113730 */
1935&(nid_objs[186]),/* OBJ_pkcs1 1 2 840 113549 1 1 */
1936&(nid_objs[27]),/* OBJ_pkcs3 1 2 840 113549 1 3 */
1937&(nid_objs[187]),/* OBJ_pkcs5 1 2 840 113549 1 5 */
1938&(nid_objs[20]),/* OBJ_pkcs7 1 2 840 113549 1 7 */
1939&(nid_objs[47]),/* OBJ_pkcs9 1 2 840 113549 1 9 */
1940&(nid_objs[ 3]),/* OBJ_md2 1 2 840 113549 2 2 */
1941&(nid_objs[257]),/* OBJ_md4 1 2 840 113549 2 4 */
1942&(nid_objs[ 4]),/* OBJ_md5 1 2 840 113549 2 5 */
1943&(nid_objs[163]),/* OBJ_hmacWithSHA1 1 2 840 113549 2 7 */
1944&(nid_objs[37]),/* OBJ_rc2_cbc 1 2 840 113549 3 2 */
1945&(nid_objs[ 5]),/* OBJ_rc4 1 2 840 113549 3 4 */
1946&(nid_objs[44]),/* OBJ_des_ede3_cbc 1 2 840 113549 3 7 */
1947&(nid_objs[120]),/* OBJ_rc5_cbc 1 2 840 113549 3 8 */
1948&(nid_objs[269]),/* OBJ_id_pkix1_explicit_88 1 3 6 1 5 5 7 0 1 */
1949&(nid_objs[270]),/* OBJ_id_pkix1_implicit_88 1 3 6 1 5 5 7 0 2 */
1950&(nid_objs[271]),/* OBJ_id_pkix1_explicit_93 1 3 6 1 5 5 7 0 3 */
1951&(nid_objs[272]),/* OBJ_id_pkix1_implicit_93 1 3 6 1 5 5 7 0 4 */
1952&(nid_objs[273]),/* OBJ_id_mod_crmf 1 3 6 1 5 5 7 0 5 */
1953&(nid_objs[274]),/* OBJ_id_mod_cmc 1 3 6 1 5 5 7 0 6 */
1954&(nid_objs[275]),/* OBJ_id_mod_kea_profile_88 1 3 6 1 5 5 7 0 7 */
1955&(nid_objs[276]),/* OBJ_id_mod_kea_profile_93 1 3 6 1 5 5 7 0 8 */
1956&(nid_objs[277]),/* OBJ_id_mod_cmp 1 3 6 1 5 5 7 0 9 */
1957&(nid_objs[278]),/* OBJ_id_mod_qualified_cert_88 1 3 6 1 5 5 7 0 10 */
1958&(nid_objs[279]),/* OBJ_id_mod_qualified_cert_93 1 3 6 1 5 5 7 0 11 */
1959&(nid_objs[280]),/* OBJ_id_mod_attribute_cert 1 3 6 1 5 5 7 0 12 */
1960&(nid_objs[281]),/* OBJ_id_mod_timestamp_protocol 1 3 6 1 5 5 7 0 13 */
1961&(nid_objs[282]),/* OBJ_id_mod_ocsp 1 3 6 1 5 5 7 0 14 */
1962&(nid_objs[283]),/* OBJ_id_mod_dvcs 1 3 6 1 5 5 7 0 15 */
1963&(nid_objs[284]),/* OBJ_id_mod_cmp2000 1 3 6 1 5 5 7 0 16 */
1964&(nid_objs[177]),/* OBJ_info_access 1 3 6 1 5 5 7 1 1 */
1965&(nid_objs[285]),/* OBJ_biometricInfo 1 3 6 1 5 5 7 1 2 */
1966&(nid_objs[286]),/* OBJ_qcStatements 1 3 6 1 5 5 7 1 3 */
1967&(nid_objs[287]),/* OBJ_ac_auditEntity 1 3 6 1 5 5 7 1 4 */
1968&(nid_objs[288]),/* OBJ_ac_targeting 1 3 6 1 5 5 7 1 5 */
1969&(nid_objs[289]),/* OBJ_aaControls 1 3 6 1 5 5 7 1 6 */
1970&(nid_objs[290]),/* OBJ_sbqp_ipAddrBlock 1 3 6 1 5 5 7 1 7 */
1971&(nid_objs[291]),/* OBJ_sbqp_autonomousSysNum 1 3 6 1 5 5 7 1 8 */
1972&(nid_objs[292]),/* OBJ_sbqp_routerIdentifier 1 3 6 1 5 5 7 1 9 */
1973&(nid_objs[164]),/* OBJ_id_qt_cps 1 3 6 1 5 5 7 2 1 */
1974&(nid_objs[165]),/* OBJ_id_qt_unotice 1 3 6 1 5 5 7 2 2 */
1975&(nid_objs[293]),/* OBJ_textNotice 1 3 6 1 5 5 7 2 3 */
1976&(nid_objs[129]),/* OBJ_server_auth 1 3 6 1 5 5 7 3 1 */
1977&(nid_objs[130]),/* OBJ_client_auth 1 3 6 1 5 5 7 3 2 */
1978&(nid_objs[131]),/* OBJ_code_sign 1 3 6 1 5 5 7 3 3 */
1979&(nid_objs[132]),/* OBJ_email_protect 1 3 6 1 5 5 7 3 4 */
1980&(nid_objs[294]),/* OBJ_ipsecEndSystem 1 3 6 1 5 5 7 3 5 */
1981&(nid_objs[295]),/* OBJ_ipsecTunnel 1 3 6 1 5 5 7 3 6 */
1982&(nid_objs[296]),/* OBJ_ipsecUser 1 3 6 1 5 5 7 3 7 */
1983&(nid_objs[133]),/* OBJ_time_stamp 1 3 6 1 5 5 7 3 8 */
1984&(nid_objs[180]),/* OBJ_OCSP_sign 1 3 6 1 5 5 7 3 9 */
1985&(nid_objs[297]),/* OBJ_dvcs 1 3 6 1 5 5 7 3 10 */
1986&(nid_objs[298]),/* OBJ_id_it_caProtEncCert 1 3 6 1 5 5 7 4 1 */
1987&(nid_objs[299]),/* OBJ_id_it_signKeyPairTypes 1 3 6 1 5 5 7 4 2 */
1988&(nid_objs[300]),/* OBJ_id_it_encKeyPairTypes 1 3 6 1 5 5 7 4 3 */
1989&(nid_objs[301]),/* OBJ_id_it_preferredSymmAlg 1 3 6 1 5 5 7 4 4 */
1990&(nid_objs[302]),/* OBJ_id_it_caKeyUpdateInfo 1 3 6 1 5 5 7 4 5 */
1991&(nid_objs[303]),/* OBJ_id_it_currentCRL 1 3 6 1 5 5 7 4 6 */
1992&(nid_objs[304]),/* OBJ_id_it_unsupportedOIDs 1 3 6 1 5 5 7 4 7 */
1993&(nid_objs[305]),/* OBJ_id_it_subscriptionRequest 1 3 6 1 5 5 7 4 8 */
1994&(nid_objs[306]),/* OBJ_id_it_subscriptionResponse 1 3 6 1 5 5 7 4 9 */
1995&(nid_objs[307]),/* OBJ_id_it_keyPairParamReq 1 3 6 1 5 5 7 4 10 */
1996&(nid_objs[308]),/* OBJ_id_it_keyPairParamRep 1 3 6 1 5 5 7 4 11 */
1997&(nid_objs[309]),/* OBJ_id_it_revPassphrase 1 3 6 1 5 5 7 4 12 */
1998&(nid_objs[310]),/* OBJ_id_it_implicitConfirm 1 3 6 1 5 5 7 4 13 */
1999&(nid_objs[311]),/* OBJ_id_it_confirmWaitTime 1 3 6 1 5 5 7 4 14 */
2000&(nid_objs[312]),/* OBJ_id_it_origPKIMessage 1 3 6 1 5 5 7 4 15 */
2001&(nid_objs[313]),/* OBJ_id_regCtrl 1 3 6 1 5 5 7 5 1 */
2002&(nid_objs[314]),/* OBJ_id_regInfo 1 3 6 1 5 5 7 5 2 */
2003&(nid_objs[323]),/* OBJ_id_alg_des40 1 3 6 1 5 5 7 6 1 */
2004&(nid_objs[324]),/* OBJ_id_alg_noSignature 1 3 6 1 5 5 7 6 2 */
2005&(nid_objs[325]),/* OBJ_id_alg_dh_sig_hmac_sha1 1 3 6 1 5 5 7 6 3 */
2006&(nid_objs[326]),/* OBJ_id_alg_dh_pop 1 3 6 1 5 5 7 6 4 */
2007&(nid_objs[327]),/* OBJ_id_cmc_statusInfo 1 3 6 1 5 5 7 7 1 */
2008&(nid_objs[328]),/* OBJ_id_cmc_identification 1 3 6 1 5 5 7 7 2 */
2009&(nid_objs[329]),/* OBJ_id_cmc_identityProof 1 3 6 1 5 5 7 7 3 */
2010&(nid_objs[330]),/* OBJ_id_cmc_dataReturn 1 3 6 1 5 5 7 7 4 */
2011&(nid_objs[331]),/* OBJ_id_cmc_transactionId 1 3 6 1 5 5 7 7 5 */
2012&(nid_objs[332]),/* OBJ_id_cmc_senderNonce 1 3 6 1 5 5 7 7 6 */
2013&(nid_objs[333]),/* OBJ_id_cmc_recipientNonce 1 3 6 1 5 5 7 7 7 */
2014&(nid_objs[334]),/* OBJ_id_cmc_addExtensions 1 3 6 1 5 5 7 7 8 */
2015&(nid_objs[335]),/* OBJ_id_cmc_encryptedPOP 1 3 6 1 5 5 7 7 9 */
2016&(nid_objs[336]),/* OBJ_id_cmc_decryptedPOP 1 3 6 1 5 5 7 7 10 */
2017&(nid_objs[337]),/* OBJ_id_cmc_lraPOPWitness 1 3 6 1 5 5 7 7 11 */
2018&(nid_objs[338]),/* OBJ_id_cmc_getCert 1 3 6 1 5 5 7 7 15 */
2019&(nid_objs[339]),/* OBJ_id_cmc_getCRL 1 3 6 1 5 5 7 7 16 */
2020&(nid_objs[340]),/* OBJ_id_cmc_revokeRequest 1 3 6 1 5 5 7 7 17 */
2021&(nid_objs[341]),/* OBJ_id_cmc_regInfo 1 3 6 1 5 5 7 7 18 */
2022&(nid_objs[342]),/* OBJ_id_cmc_responseInfo 1 3 6 1 5 5 7 7 19 */
2023&(nid_objs[343]),/* OBJ_id_cmc_queryPending 1 3 6 1 5 5 7 7 21 */
2024&(nid_objs[344]),/* OBJ_id_cmc_popLinkRandom 1 3 6 1 5 5 7 7 22 */
2025&(nid_objs[345]),/* OBJ_id_cmc_popLinkWitness 1 3 6 1 5 5 7 7 23 */
2026&(nid_objs[346]),/* OBJ_id_cmc_confirmCertAcceptance 1 3 6 1 5 5 7 7 24 */
2027&(nid_objs[347]),/* OBJ_id_on_personalData 1 3 6 1 5 5 7 8 1 */
2028&(nid_objs[348]),/* OBJ_id_pda_dateOfBirth 1 3 6 1 5 5 7 9 1 */
2029&(nid_objs[349]),/* OBJ_id_pda_placeOfBirth 1 3 6 1 5 5 7 9 2 */
2030&(nid_objs[350]),/* OBJ_id_pda_pseudonym 1 3 6 1 5 5 7 9 3 */
2031&(nid_objs[351]),/* OBJ_id_pda_gender 1 3 6 1 5 5 7 9 4 */
2032&(nid_objs[352]),/* OBJ_id_pda_countryOfCitizenship 1 3 6 1 5 5 7 9 5 */
2033&(nid_objs[353]),/* OBJ_id_pda_countryOfResidence 1 3 6 1 5 5 7 9 6 */
2034&(nid_objs[354]),/* OBJ_id_aca_authenticationInfo 1 3 6 1 5 5 7 10 1 */
2035&(nid_objs[355]),/* OBJ_id_aca_accessIdentity 1 3 6 1 5 5 7 10 2 */
2036&(nid_objs[356]),/* OBJ_id_aca_chargingIdentity 1 3 6 1 5 5 7 10 3 */
2037&(nid_objs[357]),/* OBJ_id_aca_group 1 3 6 1 5 5 7 10 4 */
2038&(nid_objs[358]),/* OBJ_id_aca_role 1 3 6 1 5 5 7 10 5 */
2039&(nid_objs[359]),/* OBJ_id_qcs_pkixQCSyntax_v1 1 3 6 1 5 5 7 11 1 */
2040&(nid_objs[360]),/* OBJ_id_cct_crs 1 3 6 1 5 5 7 12 1 */
2041&(nid_objs[361]),/* OBJ_id_cct_PKIData 1 3 6 1 5 5 7 12 2 */
2042&(nid_objs[362]),/* OBJ_id_cct_PKIResponse 1 3 6 1 5 5 7 12 3 */
2043&(nid_objs[178]),/* OBJ_ad_OCSP 1 3 6 1 5 5 7 48 1 */
2044&(nid_objs[179]),/* OBJ_ad_ca_issuers 1 3 6 1 5 5 7 48 2 */
2045&(nid_objs[363]),/* OBJ_ad_timeStamping 1 3 6 1 5 5 7 48 3 */
2046&(nid_objs[364]),/* OBJ_ad_dvcs 1 3 6 1 5 5 7 48 4 */
2047&(nid_objs[58]),/* OBJ_netscape_cert_extension 2 16 840 1 113730 1 */
2048&(nid_objs[59]),/* OBJ_netscape_data_type 2 16 840 1 113730 2 */
2049&(nid_objs[108]),/* OBJ_cast5_cbc 1 2 840 113533 7 66 10 */
2050&(nid_objs[112]),/* OBJ_pbeWithMD5AndCast5_CBC 1 2 840 113533 7 66 12 */
2051&(nid_objs[ 6]),/* OBJ_rsaEncryption 1 2 840 113549 1 1 1 */
2052&(nid_objs[ 7]),/* OBJ_md2WithRSAEncryption 1 2 840 113549 1 1 2 */
2053&(nid_objs[ 8]),/* OBJ_md5WithRSAEncryption 1 2 840 113549 1 1 4 */
2054&(nid_objs[65]),/* OBJ_sha1WithRSAEncryption 1 2 840 113549 1 1 5 */
2055&(nid_objs[28]),/* OBJ_dhKeyAgreement 1 2 840 113549 1 3 1 */
2056&(nid_objs[ 9]),/* OBJ_pbeWithMD2AndDES_CBC 1 2 840 113549 1 5 1 */
2057&(nid_objs[10]),/* OBJ_pbeWithMD5AndDES_CBC 1 2 840 113549 1 5 3 */
2058&(nid_objs[168]),/* OBJ_pbeWithMD2AndRC2_CBC 1 2 840 113549 1 5 4 */
2059&(nid_objs[169]),/* OBJ_pbeWithMD5AndRC2_CBC 1 2 840 113549 1 5 6 */
2060&(nid_objs[170]),/* OBJ_pbeWithSHA1AndDES_CBC 1 2 840 113549 1 5 10 */
2061&(nid_objs[68]),/* OBJ_pbeWithSHA1AndRC2_CBC 1 2 840 113549 1 5 11 */
2062&(nid_objs[69]),/* OBJ_id_pbkdf2 1 2 840 113549 1 5 12 */
2063&(nid_objs[161]),/* OBJ_pbes2 1 2 840 113549 1 5 13 */
2064&(nid_objs[162]),/* OBJ_pbmac1 1 2 840 113549 1 5 14 */
2065&(nid_objs[21]),/* OBJ_pkcs7_data 1 2 840 113549 1 7 1 */
2066&(nid_objs[22]),/* OBJ_pkcs7_signed 1 2 840 113549 1 7 2 */
2067&(nid_objs[23]),/* OBJ_pkcs7_enveloped 1 2 840 113549 1 7 3 */
2068&(nid_objs[24]),/* OBJ_pkcs7_signedAndEnveloped 1 2 840 113549 1 7 4 */
2069&(nid_objs[25]),/* OBJ_pkcs7_digest 1 2 840 113549 1 7 5 */
2070&(nid_objs[26]),/* OBJ_pkcs7_encrypted 1 2 840 113549 1 7 6 */
2071&(nid_objs[48]),/* OBJ_pkcs9_emailAddress 1 2 840 113549 1 9 1 */
2072&(nid_objs[49]),/* OBJ_pkcs9_unstructuredName 1 2 840 113549 1 9 2 */
2073&(nid_objs[50]),/* OBJ_pkcs9_contentType 1 2 840 113549 1 9 3 */
2074&(nid_objs[51]),/* OBJ_pkcs9_messageDigest 1 2 840 113549 1 9 4 */
2075&(nid_objs[52]),/* OBJ_pkcs9_signingTime 1 2 840 113549 1 9 5 */
2076&(nid_objs[53]),/* OBJ_pkcs9_countersignature 1 2 840 113549 1 9 6 */
2077&(nid_objs[54]),/* OBJ_pkcs9_challengePassword 1 2 840 113549 1 9 7 */
2078&(nid_objs[55]),/* OBJ_pkcs9_unstructuredAddress 1 2 840 113549 1 9 8 */
2079&(nid_objs[56]),/* OBJ_pkcs9_extCertAttributes 1 2 840 113549 1 9 9 */
2080&(nid_objs[172]),/* OBJ_ext_req 1 2 840 113549 1 9 14 */
2081&(nid_objs[167]),/* OBJ_SMIMECapabilities 1 2 840 113549 1 9 15 */
2082&(nid_objs[188]),/* OBJ_SMIME 1 2 840 113549 1 9 16 */
2083&(nid_objs[156]),/* OBJ_friendlyName 1 2 840 113549 1 9 20 */
2084&(nid_objs[157]),/* OBJ_localKeyID 1 2 840 113549 1 9 21 */
2085&(nid_objs[91]),/* OBJ_bf_cbc 1 3 6 1 4 1 3029 1 2 */
2086&(nid_objs[315]),/* OBJ_id_regCtrl_regToken 1 3 6 1 5 5 7 5 1 1 */
2087&(nid_objs[316]),/* OBJ_id_regCtrl_authenticator 1 3 6 1 5 5 7 5 1 2 */
2088&(nid_objs[317]),/* OBJ_id_regCtrl_pkiPublicationInfo 1 3 6 1 5 5 7 5 1 3 */
2089&(nid_objs[318]),/* OBJ_id_regCtrl_pkiArchiveOptions 1 3 6 1 5 5 7 5 1 4 */
2090&(nid_objs[319]),/* OBJ_id_regCtrl_oldCertID 1 3 6 1 5 5 7 5 1 5 */
2091&(nid_objs[320]),/* OBJ_id_regCtrl_protocolEncrKey 1 3 6 1 5 5 7 5 1 6 */
2092&(nid_objs[321]),/* OBJ_id_regInfo_utf8Pairs 1 3 6 1 5 5 7 5 2 1 */
2093&(nid_objs[322]),/* OBJ_id_regInfo_certReq 1 3 6 1 5 5 7 5 2 2 */
2094&(nid_objs[365]),/* OBJ_id_pkix_OCSP_basic 1 3 6 1 5 5 7 48 1 1 */
2095&(nid_objs[366]),/* OBJ_id_pkix_OCSP_Nonce 1 3 6 1 5 5 7 48 1 2 */
2096&(nid_objs[367]),/* OBJ_id_pkix_OCSP_CrlID 1 3 6 1 5 5 7 48 1 3 */
2097&(nid_objs[368]),/* OBJ_id_pkix_OCSP_acceptableResponses 1 3 6 1 5 5 7 48 1 4 */
2098&(nid_objs[369]),/* OBJ_id_pkix_OCSP_noCheck 1 3 6 1 5 5 7 48 1 5 */
2099&(nid_objs[370]),/* OBJ_id_pkix_OCSP_archiveCutoff 1 3 6 1 5 5 7 48 1 6 */
2100&(nid_objs[371]),/* OBJ_id_pkix_OCSP_serviceLocator 1 3 6 1 5 5 7 48 1 7 */
2101&(nid_objs[372]),/* OBJ_id_pkix_OCSP_extendedStatus 1 3 6 1 5 5 7 48 1 8 */
2102&(nid_objs[373]),/* OBJ_id_pkix_OCSP_valid 1 3 6 1 5 5 7 48 1 9 */
2103&(nid_objs[374]),/* OBJ_id_pkix_OCSP_path 1 3 6 1 5 5 7 48 1 10 */
2104&(nid_objs[375]),/* OBJ_id_pkix_OCSP_trustRoot 1 3 6 1 5 5 7 48 1 11 */
2105&(nid_objs[71]),/* OBJ_netscape_cert_type 2 16 840 1 113730 1 1 */
2106&(nid_objs[72]),/* OBJ_netscape_base_url 2 16 840 1 113730 1 2 */
2107&(nid_objs[73]),/* OBJ_netscape_revocation_url 2 16 840 1 113730 1 3 */
2108&(nid_objs[74]),/* OBJ_netscape_ca_revocation_url 2 16 840 1 113730 1 4 */
2109&(nid_objs[75]),/* OBJ_netscape_renewal_url 2 16 840 1 113730 1 7 */
2110&(nid_objs[76]),/* OBJ_netscape_ca_policy_url 2 16 840 1 113730 1 8 */
2111&(nid_objs[77]),/* OBJ_netscape_ssl_server_name 2 16 840 1 113730 1 12 */
2112&(nid_objs[78]),/* OBJ_netscape_comment 2 16 840 1 113730 1 13 */
2113&(nid_objs[79]),/* OBJ_netscape_cert_sequence 2 16 840 1 113730 2 5 */
2114&(nid_objs[139]),/* OBJ_ns_sgc 2 16 840 1 113730 4 1 */
2115&(nid_objs[391]),/* OBJ_domainComponent 0 9 2342 19200300 100 1 25 */
2116&(nid_objs[392]),/* OBJ_Domain 0 9 2342 19200300 100 4 13 */
2117&(nid_objs[189]),/* OBJ_id_smime_mod 1 2 840 113549 1 9 16 0 */
2118&(nid_objs[190]),/* OBJ_id_smime_ct 1 2 840 113549 1 9 16 1 */
2119&(nid_objs[191]),/* OBJ_id_smime_aa 1 2 840 113549 1 9 16 2 */
2120&(nid_objs[192]),/* OBJ_id_smime_alg 1 2 840 113549 1 9 16 3 */
2121&(nid_objs[193]),/* OBJ_id_smime_cd 1 2 840 113549 1 9 16 4 */
2122&(nid_objs[194]),/* OBJ_id_smime_spq 1 2 840 113549 1 9 16 5 */
2123&(nid_objs[195]),/* OBJ_id_smime_cti 1 2 840 113549 1 9 16 6 */
2124&(nid_objs[158]),/* OBJ_x509Certificate 1 2 840 113549 1 9 22 1 */
2125&(nid_objs[159]),/* OBJ_sdsiCertificate 1 2 840 113549 1 9 22 2 */
2126&(nid_objs[160]),/* OBJ_x509Crl 1 2 840 113549 1 9 23 1 */
2127&(nid_objs[144]),/* OBJ_pbe_WithSHA1And128BitRC4 1 2 840 113549 1 12 1 1 */
2128&(nid_objs[145]),/* OBJ_pbe_WithSHA1And40BitRC4 1 2 840 113549 1 12 1 2 */
2129&(nid_objs[146]),/* OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC 1 2 840 113549 1 12 1 3 */
2130&(nid_objs[147]),/* OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC 1 2 840 113549 1 12 1 4 */
2131&(nid_objs[148]),/* OBJ_pbe_WithSHA1And128BitRC2_CBC 1 2 840 113549 1 12 1 5 */
2132&(nid_objs[149]),/* OBJ_pbe_WithSHA1And40BitRC2_CBC 1 2 840 113549 1 12 1 6 */
2133&(nid_objs[171]),/* OBJ_ms_ext_req 1 3 6 1 4 1 311 2 1 14 */
2134&(nid_objs[134]),/* OBJ_ms_code_ind 1 3 6 1 4 1 311 2 1 21 */
2135&(nid_objs[135]),/* OBJ_ms_code_com 1 3 6 1 4 1 311 2 1 22 */
2136&(nid_objs[136]),/* OBJ_ms_ctl_sign 1 3 6 1 4 1 311 10 3 1 */
2137&(nid_objs[137]),/* OBJ_ms_sgc 1 3 6 1 4 1 311 10 3 3 */
2138&(nid_objs[138]),/* OBJ_ms_efs 1 3 6 1 4 1 311 10 3 4 */
2139&(nid_objs[196]),/* OBJ_id_smime_mod_cms 1 2 840 113549 1 9 16 0 1 */
2140&(nid_objs[197]),/* OBJ_id_smime_mod_ess 1 2 840 113549 1 9 16 0 2 */
2141&(nid_objs[198]),/* OBJ_id_smime_mod_oid 1 2 840 113549 1 9 16 0 3 */
2142&(nid_objs[199]),/* OBJ_id_smime_mod_msg_v3 1 2 840 113549 1 9 16 0 4 */
2143&(nid_objs[200]),/* OBJ_id_smime_mod_ets_eSignature_88 1 2 840 113549 1 9 16 0 5 */
2144&(nid_objs[201]),/* OBJ_id_smime_mod_ets_eSignature_97 1 2 840 113549 1 9 16 0 6 */
2145&(nid_objs[202]),/* OBJ_id_smime_mod_ets_eSigPolicy_88 1 2 840 113549 1 9 16 0 7 */
2146&(nid_objs[203]),/* OBJ_id_smime_mod_ets_eSigPolicy_97 1 2 840 113549 1 9 16 0 8 */
2147&(nid_objs[204]),/* OBJ_id_smime_ct_receipt 1 2 840 113549 1 9 16 1 1 */
2148&(nid_objs[205]),/* OBJ_id_smime_ct_authData 1 2 840 113549 1 9 16 1 2 */
2149&(nid_objs[206]),/* OBJ_id_smime_ct_publishCert 1 2 840 113549 1 9 16 1 3 */
2150&(nid_objs[207]),/* OBJ_id_smime_ct_TSTInfo 1 2 840 113549 1 9 16 1 4 */
2151&(nid_objs[208]),/* OBJ_id_smime_ct_TDTInfo 1 2 840 113549 1 9 16 1 5 */
2152&(nid_objs[209]),/* OBJ_id_smime_ct_contentInfo 1 2 840 113549 1 9 16 1 6 */
2153&(nid_objs[210]),/* OBJ_id_smime_ct_DVCSRequestData 1 2 840 113549 1 9 16 1 7 */
2154&(nid_objs[211]),/* OBJ_id_smime_ct_DVCSResponseData 1 2 840 113549 1 9 16 1 8 */
2155&(nid_objs[212]),/* OBJ_id_smime_aa_receiptRequest 1 2 840 113549 1 9 16 2 1 */
2156&(nid_objs[213]),/* OBJ_id_smime_aa_securityLabel 1 2 840 113549 1 9 16 2 2 */
2157&(nid_objs[214]),/* OBJ_id_smime_aa_mlExpandHistory 1 2 840 113549 1 9 16 2 3 */
2158&(nid_objs[215]),/* OBJ_id_smime_aa_contentHint 1 2 840 113549 1 9 16 2 4 */
2159&(nid_objs[216]),/* OBJ_id_smime_aa_msgSigDigest 1 2 840 113549 1 9 16 2 5 */
2160&(nid_objs[217]),/* OBJ_id_smime_aa_encapContentType 1 2 840 113549 1 9 16 2 6 */
2161&(nid_objs[218]),/* OBJ_id_smime_aa_contentIdentifier 1 2 840 113549 1 9 16 2 7 */
2162&(nid_objs[219]),/* OBJ_id_smime_aa_macValue 1 2 840 113549 1 9 16 2 8 */
2163&(nid_objs[220]),/* OBJ_id_smime_aa_equivalentLabels 1 2 840 113549 1 9 16 2 9 */
2164&(nid_objs[221]),/* OBJ_id_smime_aa_contentReference 1 2 840 113549 1 9 16 2 10 */
2165&(nid_objs[222]),/* OBJ_id_smime_aa_encrypKeyPref 1 2 840 113549 1 9 16 2 11 */
2166&(nid_objs[223]),/* OBJ_id_smime_aa_signingCertificate 1 2 840 113549 1 9 16 2 12 */
2167&(nid_objs[224]),/* OBJ_id_smime_aa_smimeEncryptCerts 1 2 840 113549 1 9 16 2 13 */
2168&(nid_objs[225]),/* OBJ_id_smime_aa_timeStampToken 1 2 840 113549 1 9 16 2 14 */
2169&(nid_objs[226]),/* OBJ_id_smime_aa_ets_sigPolicyId 1 2 840 113549 1 9 16 2 15 */
2170&(nid_objs[227]),/* OBJ_id_smime_aa_ets_commitmentType 1 2 840 113549 1 9 16 2 16 */
2171&(nid_objs[228]),/* OBJ_id_smime_aa_ets_signerLocation 1 2 840 113549 1 9 16 2 17 */
2172&(nid_objs[229]),/* OBJ_id_smime_aa_ets_signerAttr 1 2 840 113549 1 9 16 2 18 */
2173&(nid_objs[230]),/* OBJ_id_smime_aa_ets_otherSigCert 1 2 840 113549 1 9 16 2 19 */
2174&(nid_objs[231]),/* OBJ_id_smime_aa_ets_contentTimestamp 1 2 840 113549 1 9 16 2 20 */
2175&(nid_objs[232]),/* OBJ_id_smime_aa_ets_CertificateRefs 1 2 840 113549 1 9 16 2 21 */
2176&(nid_objs[233]),/* OBJ_id_smime_aa_ets_RevocationRefs 1 2 840 113549 1 9 16 2 22 */
2177&(nid_objs[234]),/* OBJ_id_smime_aa_ets_certValues 1 2 840 113549 1 9 16 2 23 */
2178&(nid_objs[235]),/* OBJ_id_smime_aa_ets_revocationValues 1 2 840 113549 1 9 16 2 24 */
2179&(nid_objs[236]),/* OBJ_id_smime_aa_ets_escTimeStamp 1 2 840 113549 1 9 16 2 25 */
2180&(nid_objs[237]),/* OBJ_id_smime_aa_ets_certCRLTimestamp 1 2 840 113549 1 9 16 2 26 */
2181&(nid_objs[238]),/* OBJ_id_smime_aa_ets_archiveTimeStamp 1 2 840 113549 1 9 16 2 27 */
2182&(nid_objs[239]),/* OBJ_id_smime_aa_signatureType 1 2 840 113549 1 9 16 2 28 */
2183&(nid_objs[240]),/* OBJ_id_smime_aa_dvcs_dvc 1 2 840 113549 1 9 16 2 29 */
2184&(nid_objs[241]),/* OBJ_id_smime_alg_ESDHwith3DES 1 2 840 113549 1 9 16 3 1 */
2185&(nid_objs[242]),/* OBJ_id_smime_alg_ESDHwithRC2 1 2 840 113549 1 9 16 3 2 */
2186&(nid_objs[243]),/* OBJ_id_smime_alg_3DESwrap 1 2 840 113549 1 9 16 3 3 */
2187&(nid_objs[244]),/* OBJ_id_smime_alg_RC2wrap 1 2 840 113549 1 9 16 3 4 */
2188&(nid_objs[245]),/* OBJ_id_smime_alg_ESDH 1 2 840 113549 1 9 16 3 5 */
2189&(nid_objs[246]),/* OBJ_id_smime_alg_CMS3DESwrap 1 2 840 113549 1 9 16 3 6 */
2190&(nid_objs[247]),/* OBJ_id_smime_alg_CMSRC2wrap 1 2 840 113549 1 9 16 3 7 */
2191&(nid_objs[248]),/* OBJ_id_smime_cd_ldap 1 2 840 113549 1 9 16 4 1 */
2192&(nid_objs[249]),/* OBJ_id_smime_spq_ets_sqt_uri 1 2 840 113549 1 9 16 5 1 */
2193&(nid_objs[250]),/* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */
2194&(nid_objs[251]),/* OBJ_id_smime_cti_ets_proofOfOrigin 1 2 840 113549 1 9 16 6 1 */
2195&(nid_objs[252]),/* OBJ_id_smime_cti_ets_proofOfReceipt 1 2 840 113549 1 9 16 6 2 */
2196&(nid_objs[253]),/* OBJ_id_smime_cti_ets_proofOfDelivery 1 2 840 113549 1 9 16 6 3 */
2197&(nid_objs[254]),/* OBJ_id_smime_cti_ets_proofOfSender 1 2 840 113549 1 9 16 6 4 */
2198&(nid_objs[255]),/* OBJ_id_smime_cti_ets_proofOfApproval 1 2 840 113549 1 9 16 6 5 */
2199&(nid_objs[256]),/* OBJ_id_smime_cti_ets_proofOfCreation 1 2 840 113549 1 9 16 6 6 */
2200&(nid_objs[150]),/* OBJ_keyBag 1 2 840 113549 1 12 10 1 1 */
2201&(nid_objs[151]),/* OBJ_pkcs8ShroudedKeyBag 1 2 840 113549 1 12 10 1 2 */
2202&(nid_objs[152]),/* OBJ_certBag 1 2 840 113549 1 12 10 1 3 */
2203&(nid_objs[153]),/* OBJ_crlBag 1 2 840 113549 1 12 10 1 4 */
2204&(nid_objs[154]),/* OBJ_secretBag 1 2 840 113549 1 12 10 1 5 */
2205&(nid_objs[155]),/* OBJ_safeContentsBag 1 2 840 113549 1 12 10 1 6 */
2206&(nid_objs[34]),/* OBJ_idea_cbc 1 3 6 1 4 1 188 7 1 1 2 */
2207};
2208
diff --git a/src/lib/libcrypto/objects/obj_dat.pl b/src/lib/libcrypto/objects/obj_dat.pl
index e6e3c3b9c0..11066df680 100644
--- a/src/lib/libcrypto/objects/obj_dat.pl
+++ b/src/lib/libcrypto/objects/obj_dat.pl
@@ -46,10 +46,28 @@ while (<IN>)
46 next unless /^\#define\s+(\S+)\s+(.*)$/; 46 next unless /^\#define\s+(\S+)\s+(.*)$/;
47 $v=$1; 47 $v=$1;
48 $d=$2; 48 $d=$2;
49 $d =~ s/^\"//;
50 $d =~ s/\"$//;
49 if ($v =~ /^SN_(.*)$/) 51 if ($v =~ /^SN_(.*)$/)
50 { $sn{$1}=$d; } 52 {
53 if(defined $snames{$d})
54 {
55 print "WARNING: Duplicate short name \"$d\"\n";
56 }
57 else
58 { $snames{$d} = "X"; }
59 $sn{$1}=$d;
60 }
51 elsif ($v =~ /^LN_(.*)$/) 61 elsif ($v =~ /^LN_(.*)$/)
52 { $ln{$1}=$d; } 62 {
63 if(defined $lnames{$d})
64 {
65 print "WARNING: Duplicate long name \"$d\"\n";
66 }
67 else
68 { $lnames{$d} = "X"; }
69 $ln{$1}=$d;
70 }
53 elsif ($v =~ /^NID_(.*)$/) 71 elsif ($v =~ /^NID_(.*)$/)
54 { $nid{$d}=$1; } 72 { $nid{$d}=$1; }
55 elsif ($v =~ /^OBJ_(.*)$/) 73 elsif ($v =~ /^OBJ_(.*)$/)
@@ -78,11 +96,20 @@ for ($i=0; $i<$n; $i++)
78 { 96 {
79 $sn=defined($sn{$nid{$i}})?"$sn{$nid{$i}}":"NULL"; 97 $sn=defined($sn{$nid{$i}})?"$sn{$nid{$i}}":"NULL";
80 $ln=defined($ln{$nid{$i}})?"$ln{$nid{$i}}":"NULL"; 98 $ln=defined($ln{$nid{$i}})?"$ln{$nid{$i}}":"NULL";
81 $sn=$ln if ($sn eq "NULL"); 99
82 $ln=$sn if ($ln eq "NULL"); 100 if ($sn eq "NULL") {
101 $sn=$ln;
102 $sn{$nid{$i}} = $ln;
103 }
104
105 if ($ln eq "NULL") {
106 $ln=$sn;
107 $ln{$nid{$i}} = $sn;
108 }
109
83 $out ="{"; 110 $out ="{";
84 $out.=$sn; 111 $out.="\"$sn\"";
85 $out.=",".$ln; 112 $out.=","."\"$ln\"";
86 $out.=",NID_$nid{$i},"; 113 $out.=",NID_$nid{$i},";
87 if (defined($obj{$nid{$i}})) 114 if (defined($obj{$nid{$i}}))
88 { 115 {
@@ -117,13 +144,13 @@ for ($i=0; $i<$n; $i++)
117@a=grep(defined($sn{$nid{$_}}),0 .. $n); 144@a=grep(defined($sn{$nid{$_}}),0 .. $n);
118foreach (sort { $sn{$nid{$a}} cmp $sn{$nid{$b}} } @a) 145foreach (sort { $sn{$nid{$a}} cmp $sn{$nid{$b}} } @a)
119 { 146 {
120 push(@sn,sprintf("&(nid_objs[%2d]),/* $sn{$nid{$_}} */\n",$_)); 147 push(@sn,sprintf("&(nid_objs[%2d]),/* \"$sn{$nid{$_}}\" */\n",$_));
121 } 148 }
122 149
123@a=grep(defined($ln{$nid{$_}}),0 .. $n); 150@a=grep(defined($ln{$nid{$_}}),0 .. $n);
124foreach (sort { $ln{$nid{$a}} cmp $ln{$nid{$b}} } @a) 151foreach (sort { $ln{$nid{$a}} cmp $ln{$nid{$b}} } @a)
125 { 152 {
126 push(@ln,sprintf("&(nid_objs[%2d]),/* $ln{$nid{$_}} */\n",$_)); 153 push(@ln,sprintf("&(nid_objs[%2d]),/* \"$ln{$nid{$_}}\" */\n",$_));
127 } 154 }
128 155
129@a=grep(defined($obj{$nid{$_}}),0 .. $n); 156@a=grep(defined($obj{$nid{$_}}),0 .. $n);
diff --git a/src/lib/libcrypto/objects/obj_lib.c b/src/lib/libcrypto/objects/obj_lib.c
index 1a1ba0fc06..0c71639eba 100644
--- a/src/lib/libcrypto/objects/obj_lib.c
+++ b/src/lib/libcrypto/objects/obj_lib.c
@@ -78,7 +78,7 @@ ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
78 OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB); 78 OBJerr(OBJ_F_OBJ_DUP,ERR_R_ASN1_LIB);
79 return(NULL); 79 return(NULL);
80 } 80 }
81 r->data=Malloc(o->length); 81 r->data=OPENSSL_malloc(o->length);
82 if (r->data == NULL) 82 if (r->data == NULL)
83 goto err; 83 goto err;
84 memcpy(r->data,o->data,o->length); 84 memcpy(r->data,o->data,o->length);
@@ -88,7 +88,7 @@ ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
88 if (o->ln != NULL) 88 if (o->ln != NULL)
89 { 89 {
90 i=strlen(o->ln)+1; 90 i=strlen(o->ln)+1;
91 r->ln=ln=Malloc(i); 91 r->ln=ln=OPENSSL_malloc(i);
92 if (r->ln == NULL) goto err; 92 if (r->ln == NULL) goto err;
93 memcpy(ln,o->ln,i); 93 memcpy(ln,o->ln,i);
94 } 94 }
@@ -98,7 +98,7 @@ ASN1_OBJECT *OBJ_dup(ASN1_OBJECT *o)
98 char *s; 98 char *s;
99 99
100 i=strlen(o->sn)+1; 100 i=strlen(o->sn)+1;
101 r->sn=s=Malloc(i); 101 r->sn=s=OPENSSL_malloc(i);
102 if (r->sn == NULL) goto err; 102 if (r->sn == NULL) goto err;
103 memcpy(s,o->sn,i); 103 memcpy(s,o->sn,i);
104 } 104 }
@@ -109,9 +109,9 @@ err:
109 OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE); 109 OBJerr(OBJ_F_OBJ_DUP,ERR_R_MALLOC_FAILURE);
110 if (r != NULL) 110 if (r != NULL)
111 { 111 {
112 if (ln != NULL) Free(ln); 112 if (ln != NULL) OPENSSL_free(ln);
113 if (r->data != NULL) Free(r->data); 113 if (r->data != NULL) OPENSSL_free(r->data);
114 Free(r); 114 OPENSSL_free(r);
115 } 115 }
116 return(NULL); 116 return(NULL);
117 } 117 }
diff --git a/src/lib/libcrypto/objects/obj_mac.h b/src/lib/libcrypto/objects/obj_mac.h
new file mode 100644
index 0000000000..401b1e5a1b
--- /dev/null
+++ b/src/lib/libcrypto/objects/obj_mac.h
@@ -0,0 +1,1798 @@
1/* lib/obj/obj_mac.h */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
60 * following command:
61 * perl objects.pl objects.txt obj_mac.num obj_mac.h
62 */
63
64#define SN_undef "UNDEF"
65#define LN_undef "undefined"
66#define NID_undef 0
67#define OBJ_undef 0L
68
69#define SN_iso "ISO"
70#define LN_iso "iso"
71#define NID_iso 181
72#define OBJ_iso 1L
73
74#define SN_member_body "member-body"
75#define LN_member_body "ISO Member Body"
76#define NID_member_body 182
77#define OBJ_member_body OBJ_iso,2L
78
79#define SN_ISO_US "ISO-US"
80#define LN_ISO_US "ISO US Member Body"
81#define NID_ISO_US 183
82#define OBJ_ISO_US OBJ_member_body,840L
83
84#define SN_X9_57 "X9-57"
85#define LN_X9_57 "X9.57"
86#define NID_X9_57 184
87#define OBJ_X9_57 OBJ_ISO_US,10040L
88
89#define SN_X9cm "X9cm"
90#define LN_X9cm "X9.57 CM ?"
91#define NID_X9cm 185
92#define OBJ_X9cm OBJ_X9_57,4L
93
94#define SN_dsa "DSA"
95#define LN_dsa "dsaEncryption"
96#define NID_dsa 116
97#define OBJ_dsa OBJ_X9cm,1L
98
99#define SN_dsaWithSHA1 "DSA-SHA1"
100#define LN_dsaWithSHA1 "dsaWithSHA1"
101#define NID_dsaWithSHA1 113
102#define OBJ_dsaWithSHA1 OBJ_X9cm,3L
103
104#define SN_cast5_cbc "CAST5-CBC"
105#define LN_cast5_cbc "cast5-cbc"
106#define NID_cast5_cbc 108
107#define OBJ_cast5_cbc OBJ_ISO_US,113533L,7L,66L,10L
108
109#define SN_cast5_ecb "CAST5-ECB"
110#define LN_cast5_ecb "cast5-ecb"
111#define NID_cast5_ecb 109
112
113#define SN_cast5_cfb64 "CAST5-CFB"
114#define LN_cast5_cfb64 "cast5-cfb"
115#define NID_cast5_cfb64 110
116
117#define SN_cast5_ofb64 "CAST5-OFB"
118#define LN_cast5_ofb64 "cast5-ofb"
119#define NID_cast5_ofb64 111
120
121#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC"
122#define NID_pbeWithMD5AndCast5_CBC 112
123#define OBJ_pbeWithMD5AndCast5_CBC OBJ_ISO_US,113533L,7L,66L,12L
124
125#define SN_rsadsi "rsadsi"
126#define LN_rsadsi "RSA Data Security, Inc."
127#define NID_rsadsi 1
128#define OBJ_rsadsi OBJ_ISO_US,113549L
129
130#define SN_pkcs "pkcs"
131#define LN_pkcs "RSA Data Security, Inc. PKCS"
132#define NID_pkcs 2
133#define OBJ_pkcs OBJ_rsadsi,1L
134
135#define SN_pkcs1 "pkcs1"
136#define NID_pkcs1 186
137#define OBJ_pkcs1 OBJ_pkcs,1L
138
139#define LN_rsaEncryption "rsaEncryption"
140#define NID_rsaEncryption 6
141#define OBJ_rsaEncryption OBJ_pkcs1,1L
142
143#define SN_md2WithRSAEncryption "RSA-MD2"
144#define LN_md2WithRSAEncryption "md2WithRSAEncryption"
145#define NID_md2WithRSAEncryption 7
146#define OBJ_md2WithRSAEncryption OBJ_pkcs1,2L
147
148#define SN_md5WithRSAEncryption "RSA-MD5"
149#define LN_md5WithRSAEncryption "md5WithRSAEncryption"
150#define NID_md5WithRSAEncryption 8
151#define OBJ_md5WithRSAEncryption OBJ_pkcs1,4L
152
153#define SN_sha1WithRSAEncryption "RSA-SHA1"
154#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption"
155#define NID_sha1WithRSAEncryption 65
156#define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L
157
158#define SN_pkcs3 "pkcs3"
159#define NID_pkcs3 27
160#define OBJ_pkcs3 OBJ_pkcs,3L
161
162#define LN_dhKeyAgreement "dhKeyAgreement"
163#define NID_dhKeyAgreement 28
164#define OBJ_dhKeyAgreement OBJ_pkcs3,1L
165
166#define SN_pkcs5 "pkcs5"
167#define NID_pkcs5 187
168#define OBJ_pkcs5 OBJ_pkcs,5L
169
170#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES"
171#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC"
172#define NID_pbeWithMD2AndDES_CBC 9
173#define OBJ_pbeWithMD2AndDES_CBC OBJ_pkcs5,1L
174
175#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES"
176#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC"
177#define NID_pbeWithMD5AndDES_CBC 10
178#define OBJ_pbeWithMD5AndDES_CBC OBJ_pkcs5,3L
179
180#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64"
181#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC"
182#define NID_pbeWithMD2AndRC2_CBC 168
183#define OBJ_pbeWithMD2AndRC2_CBC OBJ_pkcs5,4L
184
185#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64"
186#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC"
187#define NID_pbeWithMD5AndRC2_CBC 169
188#define OBJ_pbeWithMD5AndRC2_CBC OBJ_pkcs5,6L
189
190#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES"
191#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC"
192#define NID_pbeWithSHA1AndDES_CBC 170
193#define OBJ_pbeWithSHA1AndDES_CBC OBJ_pkcs5,10L
194
195#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64"
196#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC"
197#define NID_pbeWithSHA1AndRC2_CBC 68
198#define OBJ_pbeWithSHA1AndRC2_CBC OBJ_pkcs5,11L
199
200#define LN_id_pbkdf2 "PBKDF2"
201#define NID_id_pbkdf2 69
202#define OBJ_id_pbkdf2 OBJ_pkcs5,12L
203
204#define LN_pbes2 "PBES2"
205#define NID_pbes2 161
206#define OBJ_pbes2 OBJ_pkcs5,13L
207
208#define LN_pbmac1 "PBMAC1"
209#define NID_pbmac1 162
210#define OBJ_pbmac1 OBJ_pkcs5,14L
211
212#define SN_pkcs7 "pkcs7"
213#define NID_pkcs7 20
214#define OBJ_pkcs7 OBJ_pkcs,7L
215
216#define LN_pkcs7_data "pkcs7-data"
217#define NID_pkcs7_data 21
218#define OBJ_pkcs7_data OBJ_pkcs7,1L
219
220#define LN_pkcs7_signed "pkcs7-signedData"
221#define NID_pkcs7_signed 22
222#define OBJ_pkcs7_signed OBJ_pkcs7,2L
223
224#define LN_pkcs7_enveloped "pkcs7-envelopedData"
225#define NID_pkcs7_enveloped 23
226#define OBJ_pkcs7_enveloped OBJ_pkcs7,3L
227
228#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData"
229#define NID_pkcs7_signedAndEnveloped 24
230#define OBJ_pkcs7_signedAndEnveloped OBJ_pkcs7,4L
231
232#define LN_pkcs7_digest "pkcs7-digestData"
233#define NID_pkcs7_digest 25
234#define OBJ_pkcs7_digest OBJ_pkcs7,5L
235
236#define LN_pkcs7_encrypted "pkcs7-encryptedData"
237#define NID_pkcs7_encrypted 26
238#define OBJ_pkcs7_encrypted OBJ_pkcs7,6L
239
240#define SN_pkcs9 "pkcs9"
241#define NID_pkcs9 47
242#define OBJ_pkcs9 OBJ_pkcs,9L
243
244#define SN_pkcs9_emailAddress "Email"
245#define LN_pkcs9_emailAddress "emailAddress"
246#define NID_pkcs9_emailAddress 48
247#define OBJ_pkcs9_emailAddress OBJ_pkcs9,1L
248
249#define LN_pkcs9_unstructuredName "unstructuredName"
250#define NID_pkcs9_unstructuredName 49
251#define OBJ_pkcs9_unstructuredName OBJ_pkcs9,2L
252
253#define LN_pkcs9_contentType "contentType"
254#define NID_pkcs9_contentType 50
255#define OBJ_pkcs9_contentType OBJ_pkcs9,3L
256
257#define LN_pkcs9_messageDigest "messageDigest"
258#define NID_pkcs9_messageDigest 51
259#define OBJ_pkcs9_messageDigest OBJ_pkcs9,4L
260
261#define LN_pkcs9_signingTime "signingTime"
262#define NID_pkcs9_signingTime 52
263#define OBJ_pkcs9_signingTime OBJ_pkcs9,5L
264
265#define LN_pkcs9_countersignature "countersignature"
266#define NID_pkcs9_countersignature 53
267#define OBJ_pkcs9_countersignature OBJ_pkcs9,6L
268
269#define LN_pkcs9_challengePassword "challengePassword"
270#define NID_pkcs9_challengePassword 54
271#define OBJ_pkcs9_challengePassword OBJ_pkcs9,7L
272
273#define LN_pkcs9_unstructuredAddress "unstructuredAddress"
274#define NID_pkcs9_unstructuredAddress 55
275#define OBJ_pkcs9_unstructuredAddress OBJ_pkcs9,8L
276
277#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes"
278#define NID_pkcs9_extCertAttributes 56
279#define OBJ_pkcs9_extCertAttributes OBJ_pkcs9,9L
280
281#define SN_ext_req "extReq"
282#define LN_ext_req "Extension Request"
283#define NID_ext_req 172
284#define OBJ_ext_req OBJ_pkcs9,14L
285
286#define SN_SMIMECapabilities "SMIME-CAPS"
287#define LN_SMIMECapabilities "S/MIME Capabilities"
288#define NID_SMIMECapabilities 167
289#define OBJ_SMIMECapabilities OBJ_pkcs9,15L
290
291#define SN_SMIME "SMIME"
292#define LN_SMIME "S/MIME"
293#define NID_SMIME 188
294#define OBJ_SMIME OBJ_pkcs9,16L
295
296#define SN_id_smime_mod "id-smime-mod"
297#define NID_id_smime_mod 189
298#define OBJ_id_smime_mod OBJ_SMIME,0L
299
300#define SN_id_smime_ct "id-smime-ct"
301#define NID_id_smime_ct 190
302#define OBJ_id_smime_ct OBJ_SMIME,1L
303
304#define SN_id_smime_aa "id-smime-aa"
305#define NID_id_smime_aa 191
306#define OBJ_id_smime_aa OBJ_SMIME,2L
307
308#define SN_id_smime_alg "id-smime-alg"
309#define NID_id_smime_alg 192
310#define OBJ_id_smime_alg OBJ_SMIME,3L
311
312#define SN_id_smime_cd "id-smime-cd"
313#define NID_id_smime_cd 193
314#define OBJ_id_smime_cd OBJ_SMIME,4L
315
316#define SN_id_smime_spq "id-smime-spq"
317#define NID_id_smime_spq 194
318#define OBJ_id_smime_spq OBJ_SMIME,5L
319
320#define SN_id_smime_cti "id-smime-cti"
321#define NID_id_smime_cti 195
322#define OBJ_id_smime_cti OBJ_SMIME,6L
323
324#define SN_id_smime_mod_cms "id-smime-mod-cms"
325#define NID_id_smime_mod_cms 196
326#define OBJ_id_smime_mod_cms OBJ_id_smime_mod,1L
327
328#define SN_id_smime_mod_ess "id-smime-mod-ess"
329#define NID_id_smime_mod_ess 197
330#define OBJ_id_smime_mod_ess OBJ_id_smime_mod,2L
331
332#define SN_id_smime_mod_oid "id-smime-mod-oid"
333#define NID_id_smime_mod_oid 198
334#define OBJ_id_smime_mod_oid OBJ_id_smime_mod,3L
335
336#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3"
337#define NID_id_smime_mod_msg_v3 199
338#define OBJ_id_smime_mod_msg_v3 OBJ_id_smime_mod,4L
339
340#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88"
341#define NID_id_smime_mod_ets_eSignature_88 200
342#define OBJ_id_smime_mod_ets_eSignature_88 OBJ_id_smime_mod,5L
343
344#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97"
345#define NID_id_smime_mod_ets_eSignature_97 201
346#define OBJ_id_smime_mod_ets_eSignature_97 OBJ_id_smime_mod,6L
347
348#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88"
349#define NID_id_smime_mod_ets_eSigPolicy_88 202
350#define OBJ_id_smime_mod_ets_eSigPolicy_88 OBJ_id_smime_mod,7L
351
352#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97"
353#define NID_id_smime_mod_ets_eSigPolicy_97 203
354#define OBJ_id_smime_mod_ets_eSigPolicy_97 OBJ_id_smime_mod,8L
355
356#define SN_id_smime_ct_receipt "id-smime-ct-receipt"
357#define NID_id_smime_ct_receipt 204
358#define OBJ_id_smime_ct_receipt OBJ_id_smime_ct,1L
359
360#define SN_id_smime_ct_authData "id-smime-ct-authData"
361#define NID_id_smime_ct_authData 205
362#define OBJ_id_smime_ct_authData OBJ_id_smime_ct,2L
363
364#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert"
365#define NID_id_smime_ct_publishCert 206
366#define OBJ_id_smime_ct_publishCert OBJ_id_smime_ct,3L
367
368#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo"
369#define NID_id_smime_ct_TSTInfo 207
370#define OBJ_id_smime_ct_TSTInfo OBJ_id_smime_ct,4L
371
372#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo"
373#define NID_id_smime_ct_TDTInfo 208
374#define OBJ_id_smime_ct_TDTInfo OBJ_id_smime_ct,5L
375
376#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo"
377#define NID_id_smime_ct_contentInfo 209
378#define OBJ_id_smime_ct_contentInfo OBJ_id_smime_ct,6L
379
380#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData"
381#define NID_id_smime_ct_DVCSRequestData 210
382#define OBJ_id_smime_ct_DVCSRequestData OBJ_id_smime_ct,7L
383
384#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData"
385#define NID_id_smime_ct_DVCSResponseData 211
386#define OBJ_id_smime_ct_DVCSResponseData OBJ_id_smime_ct,8L
387
388#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest"
389#define NID_id_smime_aa_receiptRequest 212
390#define OBJ_id_smime_aa_receiptRequest OBJ_id_smime_aa,1L
391
392#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel"
393#define NID_id_smime_aa_securityLabel 213
394#define OBJ_id_smime_aa_securityLabel OBJ_id_smime_aa,2L
395
396#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory"
397#define NID_id_smime_aa_mlExpandHistory 214
398#define OBJ_id_smime_aa_mlExpandHistory OBJ_id_smime_aa,3L
399
400#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint"
401#define NID_id_smime_aa_contentHint 215
402#define OBJ_id_smime_aa_contentHint OBJ_id_smime_aa,4L
403
404#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest"
405#define NID_id_smime_aa_msgSigDigest 216
406#define OBJ_id_smime_aa_msgSigDigest OBJ_id_smime_aa,5L
407
408#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType"
409#define NID_id_smime_aa_encapContentType 217
410#define OBJ_id_smime_aa_encapContentType OBJ_id_smime_aa,6L
411
412#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier"
413#define NID_id_smime_aa_contentIdentifier 218
414#define OBJ_id_smime_aa_contentIdentifier OBJ_id_smime_aa,7L
415
416#define SN_id_smime_aa_macValue "id-smime-aa-macValue"
417#define NID_id_smime_aa_macValue 219
418#define OBJ_id_smime_aa_macValue OBJ_id_smime_aa,8L
419
420#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels"
421#define NID_id_smime_aa_equivalentLabels 220
422#define OBJ_id_smime_aa_equivalentLabels OBJ_id_smime_aa,9L
423
424#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference"
425#define NID_id_smime_aa_contentReference 221
426#define OBJ_id_smime_aa_contentReference OBJ_id_smime_aa,10L
427
428#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref"
429#define NID_id_smime_aa_encrypKeyPref 222
430#define OBJ_id_smime_aa_encrypKeyPref OBJ_id_smime_aa,11L
431
432#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate"
433#define NID_id_smime_aa_signingCertificate 223
434#define OBJ_id_smime_aa_signingCertificate OBJ_id_smime_aa,12L
435
436#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts"
437#define NID_id_smime_aa_smimeEncryptCerts 224
438#define OBJ_id_smime_aa_smimeEncryptCerts OBJ_id_smime_aa,13L
439
440#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken"
441#define NID_id_smime_aa_timeStampToken 225
442#define OBJ_id_smime_aa_timeStampToken OBJ_id_smime_aa,14L
443
444#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId"
445#define NID_id_smime_aa_ets_sigPolicyId 226
446#define OBJ_id_smime_aa_ets_sigPolicyId OBJ_id_smime_aa,15L
447
448#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType"
449#define NID_id_smime_aa_ets_commitmentType 227
450#define OBJ_id_smime_aa_ets_commitmentType OBJ_id_smime_aa,16L
451
452#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation"
453#define NID_id_smime_aa_ets_signerLocation 228
454#define OBJ_id_smime_aa_ets_signerLocation OBJ_id_smime_aa,17L
455
456#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr"
457#define NID_id_smime_aa_ets_signerAttr 229
458#define OBJ_id_smime_aa_ets_signerAttr OBJ_id_smime_aa,18L
459
460#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert"
461#define NID_id_smime_aa_ets_otherSigCert 230
462#define OBJ_id_smime_aa_ets_otherSigCert OBJ_id_smime_aa,19L
463
464#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp"
465#define NID_id_smime_aa_ets_contentTimestamp 231
466#define OBJ_id_smime_aa_ets_contentTimestamp OBJ_id_smime_aa,20L
467
468#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs"
469#define NID_id_smime_aa_ets_CertificateRefs 232
470#define OBJ_id_smime_aa_ets_CertificateRefs OBJ_id_smime_aa,21L
471
472#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs"
473#define NID_id_smime_aa_ets_RevocationRefs 233
474#define OBJ_id_smime_aa_ets_RevocationRefs OBJ_id_smime_aa,22L
475
476#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues"
477#define NID_id_smime_aa_ets_certValues 234
478#define OBJ_id_smime_aa_ets_certValues OBJ_id_smime_aa,23L
479
480#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues"
481#define NID_id_smime_aa_ets_revocationValues 235
482#define OBJ_id_smime_aa_ets_revocationValues OBJ_id_smime_aa,24L
483
484#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp"
485#define NID_id_smime_aa_ets_escTimeStamp 236
486#define OBJ_id_smime_aa_ets_escTimeStamp OBJ_id_smime_aa,25L
487
488#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp"
489#define NID_id_smime_aa_ets_certCRLTimestamp 237
490#define OBJ_id_smime_aa_ets_certCRLTimestamp OBJ_id_smime_aa,26L
491
492#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp"
493#define NID_id_smime_aa_ets_archiveTimeStamp 238
494#define OBJ_id_smime_aa_ets_archiveTimeStamp OBJ_id_smime_aa,27L
495
496#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType"
497#define NID_id_smime_aa_signatureType 239
498#define OBJ_id_smime_aa_signatureType OBJ_id_smime_aa,28L
499
500#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc"
501#define NID_id_smime_aa_dvcs_dvc 240
502#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L
503
504#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES"
505#define NID_id_smime_alg_ESDHwith3DES 241
506#define OBJ_id_smime_alg_ESDHwith3DES OBJ_id_smime_alg,1L
507
508#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2"
509#define NID_id_smime_alg_ESDHwithRC2 242
510#define OBJ_id_smime_alg_ESDHwithRC2 OBJ_id_smime_alg,2L
511
512#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap"
513#define NID_id_smime_alg_3DESwrap 243
514#define OBJ_id_smime_alg_3DESwrap OBJ_id_smime_alg,3L
515
516#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap"
517#define NID_id_smime_alg_RC2wrap 244
518#define OBJ_id_smime_alg_RC2wrap OBJ_id_smime_alg,4L
519
520#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH"
521#define NID_id_smime_alg_ESDH 245
522#define OBJ_id_smime_alg_ESDH OBJ_id_smime_alg,5L
523
524#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap"
525#define NID_id_smime_alg_CMS3DESwrap 246
526#define OBJ_id_smime_alg_CMS3DESwrap OBJ_id_smime_alg,6L
527
528#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap"
529#define NID_id_smime_alg_CMSRC2wrap 247
530#define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L
531
532#define SN_id_smime_cd_ldap "id-smime-cd-ldap"
533#define NID_id_smime_cd_ldap 248
534#define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L
535
536#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri"
537#define NID_id_smime_spq_ets_sqt_uri 249
538#define OBJ_id_smime_spq_ets_sqt_uri OBJ_id_smime_spq,1L
539
540#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice"
541#define NID_id_smime_spq_ets_sqt_unotice 250
542#define OBJ_id_smime_spq_ets_sqt_unotice OBJ_id_smime_spq,2L
543
544#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin"
545#define NID_id_smime_cti_ets_proofOfOrigin 251
546#define OBJ_id_smime_cti_ets_proofOfOrigin OBJ_id_smime_cti,1L
547
548#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt"
549#define NID_id_smime_cti_ets_proofOfReceipt 252
550#define OBJ_id_smime_cti_ets_proofOfReceipt OBJ_id_smime_cti,2L
551
552#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery"
553#define NID_id_smime_cti_ets_proofOfDelivery 253
554#define OBJ_id_smime_cti_ets_proofOfDelivery OBJ_id_smime_cti,3L
555
556#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender"
557#define NID_id_smime_cti_ets_proofOfSender 254
558#define OBJ_id_smime_cti_ets_proofOfSender OBJ_id_smime_cti,4L
559
560#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval"
561#define NID_id_smime_cti_ets_proofOfApproval 255
562#define OBJ_id_smime_cti_ets_proofOfApproval OBJ_id_smime_cti,5L
563
564#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation"
565#define NID_id_smime_cti_ets_proofOfCreation 256
566#define OBJ_id_smime_cti_ets_proofOfCreation OBJ_id_smime_cti,6L
567
568#define LN_friendlyName "friendlyName"
569#define NID_friendlyName 156
570#define OBJ_friendlyName OBJ_pkcs9,20L
571
572#define LN_localKeyID "localKeyID"
573#define NID_localKeyID 157
574#define OBJ_localKeyID OBJ_pkcs9,21L
575
576#define OBJ_certTypes OBJ_pkcs9,22L
577
578#define LN_x509Certificate "x509Certificate"
579#define NID_x509Certificate 158
580#define OBJ_x509Certificate OBJ_certTypes,1L
581
582#define LN_sdsiCertificate "sdsiCertificate"
583#define NID_sdsiCertificate 159
584#define OBJ_sdsiCertificate OBJ_certTypes,2L
585
586#define OBJ_crlTypes OBJ_pkcs9,23L
587
588#define LN_x509Crl "x509Crl"
589#define NID_x509Crl 160
590#define OBJ_x509Crl OBJ_crlTypes,1L
591
592#define OBJ_pkcs12 OBJ_pkcs,12L
593
594#define OBJ_pkcs12_pbeids OBJ_pkcs12,1L
595
596#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128"
597#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4"
598#define NID_pbe_WithSHA1And128BitRC4 144
599#define OBJ_pbe_WithSHA1And128BitRC4 OBJ_pkcs12_pbeids,1L
600
601#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40"
602#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4"
603#define NID_pbe_WithSHA1And40BitRC4 145
604#define OBJ_pbe_WithSHA1And40BitRC4 OBJ_pkcs12_pbeids,2L
605
606#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES"
607#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC"
608#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146
609#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC OBJ_pkcs12_pbeids,3L
610
611#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES"
612#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC"
613#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147
614#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC OBJ_pkcs12_pbeids,4L
615
616#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128"
617#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC"
618#define NID_pbe_WithSHA1And128BitRC2_CBC 148
619#define OBJ_pbe_WithSHA1And128BitRC2_CBC OBJ_pkcs12_pbeids,5L
620
621#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40"
622#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC"
623#define NID_pbe_WithSHA1And40BitRC2_CBC 149
624#define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids,6L
625
626#define OBJ_pkcs12_Version1 OBJ_pkcs12,10L
627
628#define OBJ_pkcs12_BagIds OBJ_pkcs12_Version1,1L
629
630#define LN_keyBag "keyBag"
631#define NID_keyBag 150
632#define OBJ_keyBag OBJ_pkcs12_BagIds,1L
633
634#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag"
635#define NID_pkcs8ShroudedKeyBag 151
636#define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds,2L
637
638#define LN_certBag "certBag"
639#define NID_certBag 152
640#define OBJ_certBag OBJ_pkcs12_BagIds,3L
641
642#define LN_crlBag "crlBag"
643#define NID_crlBag 153
644#define OBJ_crlBag OBJ_pkcs12_BagIds,4L
645
646#define LN_secretBag "secretBag"
647#define NID_secretBag 154
648#define OBJ_secretBag OBJ_pkcs12_BagIds,5L
649
650#define LN_safeContentsBag "safeContentsBag"
651#define NID_safeContentsBag 155
652#define OBJ_safeContentsBag OBJ_pkcs12_BagIds,6L
653
654#define SN_md2 "MD2"
655#define LN_md2 "md2"
656#define NID_md2 3
657#define OBJ_md2 OBJ_rsadsi,2L,2L
658
659#define SN_md4 "MD4"
660#define LN_md4 "md4"
661#define NID_md4 257
662#define OBJ_md4 OBJ_rsadsi,2L,4L
663
664#define SN_md5 "MD5"
665#define LN_md5 "md5"
666#define NID_md5 4
667#define OBJ_md5 OBJ_rsadsi,2L,5L
668
669#define SN_md5_sha1 "MD5-SHA1"
670#define LN_md5_sha1 "md5-sha1"
671#define NID_md5_sha1 114
672
673#define LN_hmacWithSHA1 "hmacWithSHA1"
674#define NID_hmacWithSHA1 163
675#define OBJ_hmacWithSHA1 OBJ_rsadsi,2L,7L
676
677#define SN_rc2_cbc "RC2-CBC"
678#define LN_rc2_cbc "rc2-cbc"
679#define NID_rc2_cbc 37
680#define OBJ_rc2_cbc OBJ_rsadsi,3L,2L
681
682#define SN_rc2_ecb "RC2-ECB"
683#define LN_rc2_ecb "rc2-ecb"
684#define NID_rc2_ecb 38
685
686#define SN_rc2_cfb64 "RC2-CFB"
687#define LN_rc2_cfb64 "rc2-cfb"
688#define NID_rc2_cfb64 39
689
690#define SN_rc2_ofb64 "RC2-OFB"
691#define LN_rc2_ofb64 "rc2-ofb"
692#define NID_rc2_ofb64 40
693
694#define SN_rc2_40_cbc "RC2-40-CBC"
695#define LN_rc2_40_cbc "rc2-40-cbc"
696#define NID_rc2_40_cbc 98
697
698#define SN_rc2_64_cbc "RC2-64-CBC"
699#define LN_rc2_64_cbc "rc2-64-cbc"
700#define NID_rc2_64_cbc 166
701
702#define SN_rc4 "RC4"
703#define LN_rc4 "rc4"
704#define NID_rc4 5
705#define OBJ_rc4 OBJ_rsadsi,3L,4L
706
707#define SN_rc4_40 "RC4-40"
708#define LN_rc4_40 "rc4-40"
709#define NID_rc4_40 97
710
711#define SN_des_ede3_cbc "DES-EDE3-CBC"
712#define LN_des_ede3_cbc "des-ede3-cbc"
713#define NID_des_ede3_cbc 44
714#define OBJ_des_ede3_cbc OBJ_rsadsi,3L,7L
715
716#define SN_rc5_cbc "RC5-CBC"
717#define LN_rc5_cbc "rc5-cbc"
718#define NID_rc5_cbc 120
719#define OBJ_rc5_cbc OBJ_rsadsi,3L,8L
720
721#define SN_rc5_ecb "RC5-ECB"
722#define LN_rc5_ecb "rc5-ecb"
723#define NID_rc5_ecb 121
724
725#define SN_rc5_cfb64 "RC5-CFB"
726#define LN_rc5_cfb64 "rc5-cfb"
727#define NID_rc5_cfb64 122
728
729#define SN_rc5_ofb64 "RC5-OFB"
730#define LN_rc5_ofb64 "rc5-ofb"
731#define NID_rc5_ofb64 123
732
733#define SN_ms_ext_req "msExtReq"
734#define LN_ms_ext_req "Microsoft Extension Request"
735#define NID_ms_ext_req 171
736#define OBJ_ms_ext_req 1L,3L,6L,1L,4L,1L,311L,2L,1L,14L
737
738#define SN_ms_code_ind "msCodeInd"
739#define LN_ms_code_ind "Microsoft Individual Code Signing"
740#define NID_ms_code_ind 134
741#define OBJ_ms_code_ind 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L
742
743#define SN_ms_code_com "msCodeCom"
744#define LN_ms_code_com "Microsoft Commercial Code Signing"
745#define NID_ms_code_com 135
746#define OBJ_ms_code_com 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L
747
748#define SN_ms_ctl_sign "msCTLSign"
749#define LN_ms_ctl_sign "Microsoft Trust List Signing"
750#define NID_ms_ctl_sign 136
751#define OBJ_ms_ctl_sign 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L
752
753#define SN_ms_sgc "msSGC"
754#define LN_ms_sgc "Microsoft Server Gated Crypto"
755#define NID_ms_sgc 137
756#define OBJ_ms_sgc 1L,3L,6L,1L,4L,1L,311L,10L,3L,3L
757
758#define SN_ms_efs "msEFS"
759#define LN_ms_efs "Microsoft Encrypted File System"
760#define NID_ms_efs 138
761#define OBJ_ms_efs 1L,3L,6L,1L,4L,1L,311L,10L,3L,4L
762
763#define SN_idea_cbc "IDEA-CBC"
764#define LN_idea_cbc "idea-cbc"
765#define NID_idea_cbc 34
766#define OBJ_idea_cbc 1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L
767
768#define SN_idea_ecb "IDEA-ECB"
769#define LN_idea_ecb "idea-ecb"
770#define NID_idea_ecb 36
771
772#define SN_idea_cfb64 "IDEA-CFB"
773#define LN_idea_cfb64 "idea-cfb"
774#define NID_idea_cfb64 35
775
776#define SN_idea_ofb64 "IDEA-OFB"
777#define LN_idea_ofb64 "idea-ofb"
778#define NID_idea_ofb64 46
779
780#define SN_bf_cbc "BF-CBC"
781#define LN_bf_cbc "bf-cbc"
782#define NID_bf_cbc 91
783#define OBJ_bf_cbc 1L,3L,6L,1L,4L,1L,3029L,1L,2L
784
785#define SN_bf_ecb "BF-ECB"
786#define LN_bf_ecb "bf-ecb"
787#define NID_bf_ecb 92
788
789#define SN_bf_cfb64 "BF-CFB"
790#define LN_bf_cfb64 "bf-cfb"
791#define NID_bf_cfb64 93
792
793#define SN_bf_ofb64 "BF-OFB"
794#define LN_bf_ofb64 "bf-ofb"
795#define NID_bf_ofb64 94
796
797#define SN_id_pkix "PKIX"
798#define NID_id_pkix 127
799#define OBJ_id_pkix 1L,3L,6L,1L,5L,5L,7L
800
801#define SN_id_pkix_mod "id-pkix-mod"
802#define NID_id_pkix_mod 258
803#define OBJ_id_pkix_mod OBJ_id_pkix,0L
804
805#define SN_id_pe "id-pe"
806#define NID_id_pe 175
807#define OBJ_id_pe OBJ_id_pkix,1L
808
809#define SN_id_qt "id-qt"
810#define NID_id_qt 259
811#define OBJ_id_qt OBJ_id_pkix,2L
812
813#define SN_id_kp "id-kp"
814#define NID_id_kp 128
815#define OBJ_id_kp OBJ_id_pkix,3L
816
817#define SN_id_it "id-it"
818#define NID_id_it 260
819#define OBJ_id_it OBJ_id_pkix,4L
820
821#define SN_id_pkip "id-pkip"
822#define NID_id_pkip 261
823#define OBJ_id_pkip OBJ_id_pkix,5L
824
825#define SN_id_alg "id-alg"
826#define NID_id_alg 262
827#define OBJ_id_alg OBJ_id_pkix,6L
828
829#define SN_id_cmc "id-cmc"
830#define NID_id_cmc 263
831#define OBJ_id_cmc OBJ_id_pkix,7L
832
833#define SN_id_on "id-on"
834#define NID_id_on 264
835#define OBJ_id_on OBJ_id_pkix,8L
836
837#define SN_id_pda "id-pda"
838#define NID_id_pda 265
839#define OBJ_id_pda OBJ_id_pkix,9L
840
841#define SN_id_aca "id-aca"
842#define NID_id_aca 266
843#define OBJ_id_aca OBJ_id_pkix,10L
844
845#define SN_id_qcs "id-qcs"
846#define NID_id_qcs 267
847#define OBJ_id_qcs OBJ_id_pkix,11L
848
849#define SN_id_cct "id-cct"
850#define NID_id_cct 268
851#define OBJ_id_cct OBJ_id_pkix,12L
852
853#define SN_id_ad "id-ad"
854#define NID_id_ad 176
855#define OBJ_id_ad OBJ_id_pkix,48L
856
857#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88"
858#define NID_id_pkix1_explicit_88 269
859#define OBJ_id_pkix1_explicit_88 OBJ_id_pkix_mod,1L
860
861#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88"
862#define NID_id_pkix1_implicit_88 270
863#define OBJ_id_pkix1_implicit_88 OBJ_id_pkix_mod,2L
864
865#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93"
866#define NID_id_pkix1_explicit_93 271
867#define OBJ_id_pkix1_explicit_93 OBJ_id_pkix_mod,3L
868
869#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93"
870#define NID_id_pkix1_implicit_93 272
871#define OBJ_id_pkix1_implicit_93 OBJ_id_pkix_mod,4L
872
873#define SN_id_mod_crmf "id-mod-crmf"
874#define NID_id_mod_crmf 273
875#define OBJ_id_mod_crmf OBJ_id_pkix_mod,5L
876
877#define SN_id_mod_cmc "id-mod-cmc"
878#define NID_id_mod_cmc 274
879#define OBJ_id_mod_cmc OBJ_id_pkix_mod,6L
880
881#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88"
882#define NID_id_mod_kea_profile_88 275
883#define OBJ_id_mod_kea_profile_88 OBJ_id_pkix_mod,7L
884
885#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93"
886#define NID_id_mod_kea_profile_93 276
887#define OBJ_id_mod_kea_profile_93 OBJ_id_pkix_mod,8L
888
889#define SN_id_mod_cmp "id-mod-cmp"
890#define NID_id_mod_cmp 277
891#define OBJ_id_mod_cmp OBJ_id_pkix_mod,9L
892
893#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88"
894#define NID_id_mod_qualified_cert_88 278
895#define OBJ_id_mod_qualified_cert_88 OBJ_id_pkix_mod,10L
896
897#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93"
898#define NID_id_mod_qualified_cert_93 279
899#define OBJ_id_mod_qualified_cert_93 OBJ_id_pkix_mod,11L
900
901#define SN_id_mod_attribute_cert "id-mod-attribute-cert"
902#define NID_id_mod_attribute_cert 280
903#define OBJ_id_mod_attribute_cert OBJ_id_pkix_mod,12L
904
905#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol"
906#define NID_id_mod_timestamp_protocol 281
907#define OBJ_id_mod_timestamp_protocol OBJ_id_pkix_mod,13L
908
909#define SN_id_mod_ocsp "id-mod-ocsp"
910#define NID_id_mod_ocsp 282
911#define OBJ_id_mod_ocsp OBJ_id_pkix_mod,14L
912
913#define SN_id_mod_dvcs "id-mod-dvcs"
914#define NID_id_mod_dvcs 283
915#define OBJ_id_mod_dvcs OBJ_id_pkix_mod,15L
916
917#define SN_id_mod_cmp2000 "id-mod-cmp2000"
918#define NID_id_mod_cmp2000 284
919#define OBJ_id_mod_cmp2000 OBJ_id_pkix_mod,16L
920
921#define SN_info_access "authorityInfoAccess"
922#define LN_info_access "Authority Information Access"
923#define NID_info_access 177
924#define OBJ_info_access OBJ_id_pe,1L
925
926#define SN_biometricInfo "biometricInfo"
927#define LN_biometricInfo "Biometric Info"
928#define NID_biometricInfo 285
929#define OBJ_biometricInfo OBJ_id_pe,2L
930
931#define SN_qcStatements "qcStatements"
932#define NID_qcStatements 286
933#define OBJ_qcStatements OBJ_id_pe,3L
934
935#define SN_ac_auditEntity "ac-auditEntity"
936#define NID_ac_auditEntity 287
937#define OBJ_ac_auditEntity OBJ_id_pe,4L
938
939#define SN_ac_targeting "ac-targeting"
940#define NID_ac_targeting 288
941#define OBJ_ac_targeting OBJ_id_pe,5L
942
943#define SN_aaControls "aaControls"
944#define NID_aaControls 289
945#define OBJ_aaControls OBJ_id_pe,6L
946
947#define SN_sbqp_ipAddrBlock "sbqp-ipAddrBlock"
948#define NID_sbqp_ipAddrBlock 290
949#define OBJ_sbqp_ipAddrBlock OBJ_id_pe,7L
950
951#define SN_sbqp_autonomousSysNum "sbqp-autonomousSysNum"
952#define NID_sbqp_autonomousSysNum 291
953#define OBJ_sbqp_autonomousSysNum OBJ_id_pe,8L
954
955#define SN_sbqp_routerIdentifier "sbqp-routerIdentifier"
956#define NID_sbqp_routerIdentifier 292
957#define OBJ_sbqp_routerIdentifier OBJ_id_pe,9L
958
959#define SN_id_qt_cps "id-qt-cps"
960#define LN_id_qt_cps "Policy Qualifier CPS"
961#define NID_id_qt_cps 164
962#define OBJ_id_qt_cps OBJ_id_qt,1L
963
964#define SN_id_qt_unotice "id-qt-unotice"
965#define LN_id_qt_unotice "Policy Qualifier User Notice"
966#define NID_id_qt_unotice 165
967#define OBJ_id_qt_unotice OBJ_id_qt,2L
968
969#define SN_textNotice "textNotice"
970#define NID_textNotice 293
971#define OBJ_textNotice OBJ_id_qt,3L
972
973#define SN_server_auth "serverAuth"
974#define LN_server_auth "TLS Web Server Authentication"
975#define NID_server_auth 129
976#define OBJ_server_auth OBJ_id_kp,1L
977
978#define SN_client_auth "clientAuth"
979#define LN_client_auth "TLS Web Client Authentication"
980#define NID_client_auth 130
981#define OBJ_client_auth OBJ_id_kp,2L
982
983#define SN_code_sign "codeSigning"
984#define LN_code_sign "Code Signing"
985#define NID_code_sign 131
986#define OBJ_code_sign OBJ_id_kp,3L
987
988#define SN_email_protect "emailProtection"
989#define LN_email_protect "E-mail Protection"
990#define NID_email_protect 132
991#define OBJ_email_protect OBJ_id_kp,4L
992
993#define SN_ipsecEndSystem "ipsecEndSystem"
994#define LN_ipsecEndSystem "IPSec End System"
995#define NID_ipsecEndSystem 294
996#define OBJ_ipsecEndSystem OBJ_id_kp,5L
997
998#define SN_ipsecTunnel "ipsecTunnel"
999#define LN_ipsecTunnel "IPSec Tunnel"
1000#define NID_ipsecTunnel 295
1001#define OBJ_ipsecTunnel OBJ_id_kp,6L
1002
1003#define SN_ipsecUser "ipsecUser"
1004#define LN_ipsecUser "IPSec User"
1005#define NID_ipsecUser 296
1006#define OBJ_ipsecUser OBJ_id_kp,7L
1007
1008#define SN_time_stamp "timeStamping"
1009#define LN_time_stamp "Time Stamping"
1010#define NID_time_stamp 133
1011#define OBJ_time_stamp OBJ_id_kp,8L
1012
1013#define SN_OCSP_sign "OCSPSigning"
1014#define LN_OCSP_sign "OCSP Signing"
1015#define NID_OCSP_sign 180
1016#define OBJ_OCSP_sign OBJ_id_kp,9L
1017
1018#define SN_dvcs "DVCS"
1019#define LN_dvcs "dvcs"
1020#define NID_dvcs 297
1021#define OBJ_dvcs OBJ_id_kp,10L
1022
1023#define SN_id_it_caProtEncCert "id-it-caProtEncCert"
1024#define NID_id_it_caProtEncCert 298
1025#define OBJ_id_it_caProtEncCert OBJ_id_it,1L
1026
1027#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes"
1028#define NID_id_it_signKeyPairTypes 299
1029#define OBJ_id_it_signKeyPairTypes OBJ_id_it,2L
1030
1031#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes"
1032#define NID_id_it_encKeyPairTypes 300
1033#define OBJ_id_it_encKeyPairTypes OBJ_id_it,3L
1034
1035#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg"
1036#define NID_id_it_preferredSymmAlg 301
1037#define OBJ_id_it_preferredSymmAlg OBJ_id_it,4L
1038
1039#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo"
1040#define NID_id_it_caKeyUpdateInfo 302
1041#define OBJ_id_it_caKeyUpdateInfo OBJ_id_it,5L
1042
1043#define SN_id_it_currentCRL "id-it-currentCRL"
1044#define NID_id_it_currentCRL 303
1045#define OBJ_id_it_currentCRL OBJ_id_it,6L
1046
1047#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs"
1048#define NID_id_it_unsupportedOIDs 304
1049#define OBJ_id_it_unsupportedOIDs OBJ_id_it,7L
1050
1051#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest"
1052#define NID_id_it_subscriptionRequest 305
1053#define OBJ_id_it_subscriptionRequest OBJ_id_it,8L
1054
1055#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse"
1056#define NID_id_it_subscriptionResponse 306
1057#define OBJ_id_it_subscriptionResponse OBJ_id_it,9L
1058
1059#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq"
1060#define NID_id_it_keyPairParamReq 307
1061#define OBJ_id_it_keyPairParamReq OBJ_id_it,10L
1062
1063#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep"
1064#define NID_id_it_keyPairParamRep 308
1065#define OBJ_id_it_keyPairParamRep OBJ_id_it,11L
1066
1067#define SN_id_it_revPassphrase "id-it-revPassphrase"
1068#define NID_id_it_revPassphrase 309
1069#define OBJ_id_it_revPassphrase OBJ_id_it,12L
1070
1071#define SN_id_it_implicitConfirm "id-it-implicitConfirm"
1072#define NID_id_it_implicitConfirm 310
1073#define OBJ_id_it_implicitConfirm OBJ_id_it,13L
1074
1075#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime"
1076#define NID_id_it_confirmWaitTime 311
1077#define OBJ_id_it_confirmWaitTime OBJ_id_it,14L
1078
1079#define SN_id_it_origPKIMessage "id-it-origPKIMessage"
1080#define NID_id_it_origPKIMessage 312
1081#define OBJ_id_it_origPKIMessage OBJ_id_it,15L
1082
1083#define SN_id_regCtrl "id-regCtrl"
1084#define NID_id_regCtrl 313
1085#define OBJ_id_regCtrl OBJ_id_pkip,1L
1086
1087#define SN_id_regInfo "id-regInfo"
1088#define NID_id_regInfo 314
1089#define OBJ_id_regInfo OBJ_id_pkip,2L
1090
1091#define SN_id_regCtrl_regToken "id-regCtrl-regToken"
1092#define NID_id_regCtrl_regToken 315
1093#define OBJ_id_regCtrl_regToken OBJ_id_regCtrl,1L
1094
1095#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator"
1096#define NID_id_regCtrl_authenticator 316
1097#define OBJ_id_regCtrl_authenticator OBJ_id_regCtrl,2L
1098
1099#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo"
1100#define NID_id_regCtrl_pkiPublicationInfo 317
1101#define OBJ_id_regCtrl_pkiPublicationInfo OBJ_id_regCtrl,3L
1102
1103#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions"
1104#define NID_id_regCtrl_pkiArchiveOptions 318
1105#define OBJ_id_regCtrl_pkiArchiveOptions OBJ_id_regCtrl,4L
1106
1107#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID"
1108#define NID_id_regCtrl_oldCertID 319
1109#define OBJ_id_regCtrl_oldCertID OBJ_id_regCtrl,5L
1110
1111#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey"
1112#define NID_id_regCtrl_protocolEncrKey 320
1113#define OBJ_id_regCtrl_protocolEncrKey OBJ_id_regCtrl,6L
1114
1115#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs"
1116#define NID_id_regInfo_utf8Pairs 321
1117#define OBJ_id_regInfo_utf8Pairs OBJ_id_regInfo,1L
1118
1119#define SN_id_regInfo_certReq "id-regInfo-certReq"
1120#define NID_id_regInfo_certReq 322
1121#define OBJ_id_regInfo_certReq OBJ_id_regInfo,2L
1122
1123#define SN_id_alg_des40 "id-alg-des40"
1124#define NID_id_alg_des40 323
1125#define OBJ_id_alg_des40 OBJ_id_alg,1L
1126
1127#define SN_id_alg_noSignature "id-alg-noSignature"
1128#define NID_id_alg_noSignature 324
1129#define OBJ_id_alg_noSignature OBJ_id_alg,2L
1130
1131#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1"
1132#define NID_id_alg_dh_sig_hmac_sha1 325
1133#define OBJ_id_alg_dh_sig_hmac_sha1 OBJ_id_alg,3L
1134
1135#define SN_id_alg_dh_pop "id-alg-dh-pop"
1136#define NID_id_alg_dh_pop 326
1137#define OBJ_id_alg_dh_pop OBJ_id_alg,4L
1138
1139#define SN_id_cmc_statusInfo "id-cmc-statusInfo"
1140#define NID_id_cmc_statusInfo 327
1141#define OBJ_id_cmc_statusInfo OBJ_id_cmc,1L
1142
1143#define SN_id_cmc_identification "id-cmc-identification"
1144#define NID_id_cmc_identification 328
1145#define OBJ_id_cmc_identification OBJ_id_cmc,2L
1146
1147#define SN_id_cmc_identityProof "id-cmc-identityProof"
1148#define NID_id_cmc_identityProof 329
1149#define OBJ_id_cmc_identityProof OBJ_id_cmc,3L
1150
1151#define SN_id_cmc_dataReturn "id-cmc-dataReturn"
1152#define NID_id_cmc_dataReturn 330
1153#define OBJ_id_cmc_dataReturn OBJ_id_cmc,4L
1154
1155#define SN_id_cmc_transactionId "id-cmc-transactionId"
1156#define NID_id_cmc_transactionId 331
1157#define OBJ_id_cmc_transactionId OBJ_id_cmc,5L
1158
1159#define SN_id_cmc_senderNonce "id-cmc-senderNonce"
1160#define NID_id_cmc_senderNonce 332
1161#define OBJ_id_cmc_senderNonce OBJ_id_cmc,6L
1162
1163#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce"
1164#define NID_id_cmc_recipientNonce 333
1165#define OBJ_id_cmc_recipientNonce OBJ_id_cmc,7L
1166
1167#define SN_id_cmc_addExtensions "id-cmc-addExtensions"
1168#define NID_id_cmc_addExtensions 334
1169#define OBJ_id_cmc_addExtensions OBJ_id_cmc,8L
1170
1171#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP"
1172#define NID_id_cmc_encryptedPOP 335
1173#define OBJ_id_cmc_encryptedPOP OBJ_id_cmc,9L
1174
1175#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP"
1176#define NID_id_cmc_decryptedPOP 336
1177#define OBJ_id_cmc_decryptedPOP OBJ_id_cmc,10L
1178
1179#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness"
1180#define NID_id_cmc_lraPOPWitness 337
1181#define OBJ_id_cmc_lraPOPWitness OBJ_id_cmc,11L
1182
1183#define SN_id_cmc_getCert "id-cmc-getCert"
1184#define NID_id_cmc_getCert 338
1185#define OBJ_id_cmc_getCert OBJ_id_cmc,15L
1186
1187#define SN_id_cmc_getCRL "id-cmc-getCRL"
1188#define NID_id_cmc_getCRL 339
1189#define OBJ_id_cmc_getCRL OBJ_id_cmc,16L
1190
1191#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest"
1192#define NID_id_cmc_revokeRequest 340
1193#define OBJ_id_cmc_revokeRequest OBJ_id_cmc,17L
1194
1195#define SN_id_cmc_regInfo "id-cmc-regInfo"
1196#define NID_id_cmc_regInfo 341
1197#define OBJ_id_cmc_regInfo OBJ_id_cmc,18L
1198
1199#define SN_id_cmc_responseInfo "id-cmc-responseInfo"
1200#define NID_id_cmc_responseInfo 342
1201#define OBJ_id_cmc_responseInfo OBJ_id_cmc,19L
1202
1203#define SN_id_cmc_queryPending "id-cmc-queryPending"
1204#define NID_id_cmc_queryPending 343
1205#define OBJ_id_cmc_queryPending OBJ_id_cmc,21L
1206
1207#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom"
1208#define NID_id_cmc_popLinkRandom 344
1209#define OBJ_id_cmc_popLinkRandom OBJ_id_cmc,22L
1210
1211#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness"
1212#define NID_id_cmc_popLinkWitness 345
1213#define OBJ_id_cmc_popLinkWitness OBJ_id_cmc,23L
1214
1215#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance"
1216#define NID_id_cmc_confirmCertAcceptance 346
1217#define OBJ_id_cmc_confirmCertAcceptance OBJ_id_cmc,24L
1218
1219#define SN_id_on_personalData "id-on-personalData"
1220#define NID_id_on_personalData 347
1221#define OBJ_id_on_personalData OBJ_id_on,1L
1222
1223#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth"
1224#define NID_id_pda_dateOfBirth 348
1225#define OBJ_id_pda_dateOfBirth OBJ_id_pda,1L
1226
1227#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth"
1228#define NID_id_pda_placeOfBirth 349
1229#define OBJ_id_pda_placeOfBirth OBJ_id_pda,2L
1230
1231#define SN_id_pda_pseudonym "id-pda-pseudonym"
1232#define NID_id_pda_pseudonym 350
1233#define OBJ_id_pda_pseudonym OBJ_id_pda,3L
1234
1235#define SN_id_pda_gender "id-pda-gender"
1236#define NID_id_pda_gender 351
1237#define OBJ_id_pda_gender OBJ_id_pda,4L
1238
1239#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship"
1240#define NID_id_pda_countryOfCitizenship 352
1241#define OBJ_id_pda_countryOfCitizenship OBJ_id_pda,5L
1242
1243#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence"
1244#define NID_id_pda_countryOfResidence 353
1245#define OBJ_id_pda_countryOfResidence OBJ_id_pda,6L
1246
1247#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo"
1248#define NID_id_aca_authenticationInfo 354
1249#define OBJ_id_aca_authenticationInfo OBJ_id_aca,1L
1250
1251#define SN_id_aca_accessIdentity "id-aca-accessIdentity"
1252#define NID_id_aca_accessIdentity 355
1253#define OBJ_id_aca_accessIdentity OBJ_id_aca,2L
1254
1255#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity"
1256#define NID_id_aca_chargingIdentity 356
1257#define OBJ_id_aca_chargingIdentity OBJ_id_aca,3L
1258
1259#define SN_id_aca_group "id-aca-group"
1260#define NID_id_aca_group 357
1261#define OBJ_id_aca_group OBJ_id_aca,4L
1262
1263#define SN_id_aca_role "id-aca-role"
1264#define NID_id_aca_role 358
1265#define OBJ_id_aca_role OBJ_id_aca,5L
1266
1267#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1"
1268#define NID_id_qcs_pkixQCSyntax_v1 359
1269#define OBJ_id_qcs_pkixQCSyntax_v1 OBJ_id_qcs,1L
1270
1271#define SN_id_cct_crs "id-cct-crs"
1272#define NID_id_cct_crs 360
1273#define OBJ_id_cct_crs OBJ_id_cct,1L
1274
1275#define SN_id_cct_PKIData "id-cct-PKIData"
1276#define NID_id_cct_PKIData 361
1277#define OBJ_id_cct_PKIData OBJ_id_cct,2L
1278
1279#define SN_id_cct_PKIResponse "id-cct-PKIResponse"
1280#define NID_id_cct_PKIResponse 362
1281#define OBJ_id_cct_PKIResponse OBJ_id_cct,3L
1282
1283#define SN_ad_OCSP "OCSP"
1284#define LN_ad_OCSP "OCSP"
1285#define NID_ad_OCSP 178
1286#define OBJ_ad_OCSP OBJ_id_ad,1L
1287
1288#define SN_ad_ca_issuers "caIssuers"
1289#define LN_ad_ca_issuers "CA Issuers"
1290#define NID_ad_ca_issuers 179
1291#define OBJ_ad_ca_issuers OBJ_id_ad,2L
1292
1293#define SN_ad_timeStamping "ad_timestamping"
1294#define LN_ad_timeStamping "AD Time Stamping"
1295#define NID_ad_timeStamping 363
1296#define OBJ_ad_timeStamping OBJ_id_ad,3L
1297
1298#define SN_ad_dvcs "AD_DVCS"
1299#define LN_ad_dvcs "ad dvcs"
1300#define NID_ad_dvcs 364
1301#define OBJ_ad_dvcs OBJ_id_ad,4L
1302
1303#define OBJ_id_pkix_OCSP OBJ_ad_OCSP
1304
1305#define SN_id_pkix_OCSP_basic "basicOCSPResponse"
1306#define LN_id_pkix_OCSP_basic "Basic OCSP Response"
1307#define NID_id_pkix_OCSP_basic 365
1308#define OBJ_id_pkix_OCSP_basic OBJ_id_pkix_OCSP,1L
1309
1310#define SN_id_pkix_OCSP_Nonce "Nonce"
1311#define LN_id_pkix_OCSP_Nonce "OCSP Nonce"
1312#define NID_id_pkix_OCSP_Nonce 366
1313#define OBJ_id_pkix_OCSP_Nonce OBJ_id_pkix_OCSP,2L
1314
1315#define SN_id_pkix_OCSP_CrlID "CrlID"
1316#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID"
1317#define NID_id_pkix_OCSP_CrlID 367
1318#define OBJ_id_pkix_OCSP_CrlID OBJ_id_pkix_OCSP,3L
1319
1320#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses"
1321#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses"
1322#define NID_id_pkix_OCSP_acceptableResponses 368
1323#define OBJ_id_pkix_OCSP_acceptableResponses OBJ_id_pkix_OCSP,4L
1324
1325#define SN_id_pkix_OCSP_noCheck "noCheck"
1326#define NID_id_pkix_OCSP_noCheck 369
1327#define OBJ_id_pkix_OCSP_noCheck OBJ_id_pkix_OCSP,5L
1328
1329#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff"
1330#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff"
1331#define NID_id_pkix_OCSP_archiveCutoff 370
1332#define OBJ_id_pkix_OCSP_archiveCutoff OBJ_id_pkix_OCSP,6L
1333
1334#define SN_id_pkix_OCSP_serviceLocator "serviceLocator"
1335#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator"
1336#define NID_id_pkix_OCSP_serviceLocator 371
1337#define OBJ_id_pkix_OCSP_serviceLocator OBJ_id_pkix_OCSP,7L
1338
1339#define SN_id_pkix_OCSP_extendedStatus "extendedStatus"
1340#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status"
1341#define NID_id_pkix_OCSP_extendedStatus 372
1342#define OBJ_id_pkix_OCSP_extendedStatus OBJ_id_pkix_OCSP,8L
1343
1344#define SN_id_pkix_OCSP_valid "valid"
1345#define NID_id_pkix_OCSP_valid 373
1346#define OBJ_id_pkix_OCSP_valid OBJ_id_pkix_OCSP,9L
1347
1348#define SN_id_pkix_OCSP_path "path"
1349#define NID_id_pkix_OCSP_path 374
1350#define OBJ_id_pkix_OCSP_path OBJ_id_pkix_OCSP,10L
1351
1352#define SN_id_pkix_OCSP_trustRoot "trustRoot"
1353#define LN_id_pkix_OCSP_trustRoot "Trust Root"
1354#define NID_id_pkix_OCSP_trustRoot 375
1355#define OBJ_id_pkix_OCSP_trustRoot OBJ_id_pkix_OCSP,11L
1356
1357#define SN_algorithm "algorithm"
1358#define LN_algorithm "algorithm"
1359#define NID_algorithm 376
1360#define OBJ_algorithm 1L,3L,14L,3L,2L
1361
1362#define SN_md5WithRSA "RSA-NP-MD5"
1363#define LN_md5WithRSA "md5WithRSA"
1364#define NID_md5WithRSA 104
1365#define OBJ_md5WithRSA OBJ_algorithm,3L
1366
1367#define SN_des_ecb "DES-ECB"
1368#define LN_des_ecb "des-ecb"
1369#define NID_des_ecb 29
1370#define OBJ_des_ecb OBJ_algorithm,6L
1371
1372#define SN_des_cbc "DES-CBC"
1373#define LN_des_cbc "des-cbc"
1374#define NID_des_cbc 31
1375#define OBJ_des_cbc OBJ_algorithm,7L
1376
1377#define SN_des_ofb64 "DES-OFB"
1378#define LN_des_ofb64 "des-ofb"
1379#define NID_des_ofb64 45
1380#define OBJ_des_ofb64 OBJ_algorithm,8L
1381
1382#define SN_des_cfb64 "DES-CFB"
1383#define LN_des_cfb64 "des-cfb"
1384#define NID_des_cfb64 30
1385#define OBJ_des_cfb64 OBJ_algorithm,9L
1386
1387#define SN_rsaSignature "rsaSignature"
1388#define NID_rsaSignature 377
1389#define OBJ_rsaSignature OBJ_algorithm,11L
1390
1391#define SN_dsa_2 "DSA-old"
1392#define LN_dsa_2 "dsaEncryption-old"
1393#define NID_dsa_2 67
1394#define OBJ_dsa_2 OBJ_algorithm,12L
1395
1396#define SN_dsaWithSHA "DSA-SHA"
1397#define LN_dsaWithSHA "dsaWithSHA"
1398#define NID_dsaWithSHA 66
1399#define OBJ_dsaWithSHA OBJ_algorithm,13L
1400
1401#define SN_shaWithRSAEncryption "RSA-SHA"
1402#define LN_shaWithRSAEncryption "shaWithRSAEncryption"
1403#define NID_shaWithRSAEncryption 42
1404#define OBJ_shaWithRSAEncryption OBJ_algorithm,15L
1405
1406#define SN_des_ede "DES-EDE"
1407#define LN_des_ede "des-ede"
1408#define NID_des_ede 32
1409#define OBJ_des_ede OBJ_algorithm,17L
1410
1411#define SN_des_ede3 "DES-EDE3"
1412#define LN_des_ede3 "des-ede3"
1413#define NID_des_ede3 33
1414
1415#define SN_des_ede_cbc "DES-EDE-CBC"
1416#define LN_des_ede_cbc "des-ede-cbc"
1417#define NID_des_ede_cbc 43
1418
1419#define SN_des_ede_cfb64 "DES-EDE-CFB"
1420#define LN_des_ede_cfb64 "des-ede-cfb"
1421#define NID_des_ede_cfb64 60
1422
1423#define SN_des_ede3_cfb64 "DES-EDE3-CFB"
1424#define LN_des_ede3_cfb64 "des-ede3-cfb"
1425#define NID_des_ede3_cfb64 61
1426
1427#define SN_des_ede_ofb64 "DES-EDE-OFB"
1428#define LN_des_ede_ofb64 "des-ede-ofb"
1429#define NID_des_ede_ofb64 62
1430
1431#define SN_des_ede3_ofb64 "DES-EDE3-OFB"
1432#define LN_des_ede3_ofb64 "des-ede3-ofb"
1433#define NID_des_ede3_ofb64 63
1434
1435#define SN_desx_cbc "DESX-CBC"
1436#define LN_desx_cbc "desx-cbc"
1437#define NID_desx_cbc 80
1438
1439#define SN_sha "SHA"
1440#define LN_sha "sha"
1441#define NID_sha 41
1442#define OBJ_sha OBJ_algorithm,18L
1443
1444#define SN_sha1 "SHA1"
1445#define LN_sha1 "sha1"
1446#define NID_sha1 64
1447#define OBJ_sha1 OBJ_algorithm,26L
1448
1449#define SN_dsaWithSHA1_2 "DSA-SHA1-old"
1450#define LN_dsaWithSHA1_2 "dsaWithSHA1-old"
1451#define NID_dsaWithSHA1_2 70
1452#define OBJ_dsaWithSHA1_2 OBJ_algorithm,27L
1453
1454#define SN_sha1WithRSA "RSA-SHA1-2"
1455#define LN_sha1WithRSA "sha1WithRSA"
1456#define NID_sha1WithRSA 115
1457#define OBJ_sha1WithRSA OBJ_algorithm,29L
1458
1459#define SN_ripemd160 "RIPEMD160"
1460#define LN_ripemd160 "ripemd160"
1461#define NID_ripemd160 117
1462#define OBJ_ripemd160 1L,3L,36L,3L,2L,1L
1463
1464#define SN_ripemd160WithRSA "RSA-RIPEMD160"
1465#define LN_ripemd160WithRSA "ripemd160WithRSA"
1466#define NID_ripemd160WithRSA 119
1467#define OBJ_ripemd160WithRSA 1L,3L,36L,3L,3L,1L,2L
1468
1469#define SN_sxnet "SXNetID"
1470#define LN_sxnet "Strong Extranet ID"
1471#define NID_sxnet 143
1472#define OBJ_sxnet 1L,3L,101L,1L,4L,1L
1473
1474#define SN_X500 "X500"
1475#define LN_X500 "directory services (X.500)"
1476#define NID_X500 11
1477#define OBJ_X500 2L,5L
1478
1479#define SN_X509 "X509"
1480#define NID_X509 12
1481#define OBJ_X509 OBJ_X500,4L
1482
1483#define SN_commonName "CN"
1484#define LN_commonName "commonName"
1485#define NID_commonName 13
1486#define OBJ_commonName OBJ_X509,3L
1487
1488#define SN_surname "S"
1489#define LN_surname "surname"
1490#define NID_surname 100
1491#define OBJ_surname OBJ_X509,4L
1492
1493#define SN_serialNumber "SN"
1494#define LN_serialNumber "serialNumber"
1495#define NID_serialNumber 105
1496#define OBJ_serialNumber OBJ_X509,5L
1497
1498#define SN_countryName "C"
1499#define LN_countryName "countryName"
1500#define NID_countryName 14
1501#define OBJ_countryName OBJ_X509,6L
1502
1503#define SN_localityName "L"
1504#define LN_localityName "localityName"
1505#define NID_localityName 15
1506#define OBJ_localityName OBJ_X509,7L
1507
1508#define SN_stateOrProvinceName "ST"
1509#define LN_stateOrProvinceName "stateOrProvinceName"
1510#define NID_stateOrProvinceName 16
1511#define OBJ_stateOrProvinceName OBJ_X509,8L
1512
1513#define SN_organizationName "O"
1514#define LN_organizationName "organizationName"
1515#define NID_organizationName 17
1516#define OBJ_organizationName OBJ_X509,10L
1517
1518#define SN_organizationalUnitName "OU"
1519#define LN_organizationalUnitName "organizationalUnitName"
1520#define NID_organizationalUnitName 18
1521#define OBJ_organizationalUnitName OBJ_X509,11L
1522
1523#define SN_title "T"
1524#define LN_title "title"
1525#define NID_title 106
1526#define OBJ_title OBJ_X509,12L
1527
1528#define SN_description "D"
1529#define LN_description "description"
1530#define NID_description 107
1531#define OBJ_description OBJ_X509,13L
1532
1533#define SN_name "name"
1534#define LN_name "name"
1535#define NID_name 173
1536#define OBJ_name OBJ_X509,41L
1537
1538#define SN_givenName "G"
1539#define LN_givenName "givenName"
1540#define NID_givenName 99
1541#define OBJ_givenName OBJ_X509,42L
1542
1543#define SN_initials "I"
1544#define LN_initials "initials"
1545#define NID_initials 101
1546#define OBJ_initials OBJ_X509,43L
1547
1548#define SN_uniqueIdentifier "UID"
1549#define LN_uniqueIdentifier "uniqueIdentifier"
1550#define NID_uniqueIdentifier 102
1551#define OBJ_uniqueIdentifier OBJ_X509,45L
1552
1553#define SN_dnQualifier "dnQualifier"
1554#define LN_dnQualifier "dnQualifier"
1555#define NID_dnQualifier 174
1556#define OBJ_dnQualifier OBJ_X509,46L
1557
1558#define SN_X500algorithms "X500algorithms"
1559#define LN_X500algorithms "directory services - algorithms"
1560#define NID_X500algorithms 378
1561#define OBJ_X500algorithms OBJ_X500,8L
1562
1563#define SN_rsa "RSA"
1564#define LN_rsa "rsa"
1565#define NID_rsa 19
1566#define OBJ_rsa OBJ_X500algorithms,1L,1L
1567
1568#define SN_mdc2WithRSA "RSA-MDC2"
1569#define LN_mdc2WithRSA "mdc2WithRSA"
1570#define NID_mdc2WithRSA 96
1571#define OBJ_mdc2WithRSA OBJ_X500algorithms,3L,100L
1572
1573#define SN_mdc2 "MDC2"
1574#define LN_mdc2 "mdc2"
1575#define NID_mdc2 95
1576#define OBJ_mdc2 OBJ_X500algorithms,3L,101L
1577
1578#define SN_id_ce "id-ce"
1579#define NID_id_ce 81
1580#define OBJ_id_ce OBJ_X500,29L
1581
1582#define SN_subject_key_identifier "subjectKeyIdentifier"
1583#define LN_subject_key_identifier "X509v3 Subject Key Identifier"
1584#define NID_subject_key_identifier 82
1585#define OBJ_subject_key_identifier OBJ_id_ce,14L
1586
1587#define SN_key_usage "keyUsage"
1588#define LN_key_usage "X509v3 Key Usage"
1589#define NID_key_usage 83
1590#define OBJ_key_usage OBJ_id_ce,15L
1591
1592#define SN_private_key_usage_period "privateKeyUsagePeriod"
1593#define LN_private_key_usage_period "X509v3 Private Key Usage Period"
1594#define NID_private_key_usage_period 84
1595#define OBJ_private_key_usage_period OBJ_id_ce,16L
1596
1597#define SN_subject_alt_name "subjectAltName"
1598#define LN_subject_alt_name "X509v3 Subject Alternative Name"
1599#define NID_subject_alt_name 85
1600#define OBJ_subject_alt_name OBJ_id_ce,17L
1601
1602#define SN_issuer_alt_name "issuerAltName"
1603#define LN_issuer_alt_name "X509v3 Issuer Alternative Name"
1604#define NID_issuer_alt_name 86
1605#define OBJ_issuer_alt_name OBJ_id_ce,18L
1606
1607#define SN_basic_constraints "basicConstraints"
1608#define LN_basic_constraints "X509v3 Basic Constraints"
1609#define NID_basic_constraints 87
1610#define OBJ_basic_constraints OBJ_id_ce,19L
1611
1612#define SN_crl_number "crlNumber"
1613#define LN_crl_number "X509v3 CRL Number"
1614#define NID_crl_number 88
1615#define OBJ_crl_number OBJ_id_ce,20L
1616
1617#define SN_crl_reason "CRLReason"
1618#define LN_crl_reason "X509v3 CRL Reason Code"
1619#define NID_crl_reason 141
1620#define OBJ_crl_reason OBJ_id_ce,21L
1621
1622#define SN_invalidity_date "invalidityDate"
1623#define LN_invalidity_date "Invalidity Date"
1624#define NID_invalidity_date 142
1625#define OBJ_invalidity_date OBJ_id_ce,24L
1626
1627#define SN_delta_crl "deltaCRL"
1628#define LN_delta_crl "X509v3 Delta CRL Indicator"
1629#define NID_delta_crl 140
1630#define OBJ_delta_crl OBJ_id_ce,27L
1631
1632#define SN_crl_distribution_points "crlDistributionPoints"
1633#define LN_crl_distribution_points "X509v3 CRL Distribution Points"
1634#define NID_crl_distribution_points 103
1635#define OBJ_crl_distribution_points OBJ_id_ce,31L
1636
1637#define SN_certificate_policies "certificatePolicies"
1638#define LN_certificate_policies "X509v3 Certificate Policies"
1639#define NID_certificate_policies 89
1640#define OBJ_certificate_policies OBJ_id_ce,32L
1641
1642#define SN_authority_key_identifier "authorityKeyIdentifier"
1643#define LN_authority_key_identifier "X509v3 Authority Key Identifier"
1644#define NID_authority_key_identifier 90
1645#define OBJ_authority_key_identifier OBJ_id_ce,35L
1646
1647#define SN_ext_key_usage "extendedKeyUsage"
1648#define LN_ext_key_usage "X509v3 Extended Key Usage"
1649#define NID_ext_key_usage 126
1650#define OBJ_ext_key_usage OBJ_id_ce,37L
1651
1652#define SN_netscape "Netscape"
1653#define LN_netscape "Netscape Communications Corp."
1654#define NID_netscape 57
1655#define OBJ_netscape 2L,16L,840L,1L,113730L
1656
1657#define SN_netscape_cert_extension "nsCertExt"
1658#define LN_netscape_cert_extension "Netscape Certificate Extension"
1659#define NID_netscape_cert_extension 58
1660#define OBJ_netscape_cert_extension OBJ_netscape,1L
1661
1662#define SN_netscape_data_type "nsDataType"
1663#define LN_netscape_data_type "Netscape Data Type"
1664#define NID_netscape_data_type 59
1665#define OBJ_netscape_data_type OBJ_netscape,2L
1666
1667#define SN_netscape_cert_type "nsCertType"
1668#define LN_netscape_cert_type "Netscape Cert Type"
1669#define NID_netscape_cert_type 71
1670#define OBJ_netscape_cert_type OBJ_netscape_cert_extension,1L
1671
1672#define SN_netscape_base_url "nsBaseUrl"
1673#define LN_netscape_base_url "Netscape Base Url"
1674#define NID_netscape_base_url 72
1675#define OBJ_netscape_base_url OBJ_netscape_cert_extension,2L
1676
1677#define SN_netscape_revocation_url "nsRevocationUrl"
1678#define LN_netscape_revocation_url "Netscape Revocation Url"
1679#define NID_netscape_revocation_url 73
1680#define OBJ_netscape_revocation_url OBJ_netscape_cert_extension,3L
1681
1682#define SN_netscape_ca_revocation_url "nsCaRevocationUrl"
1683#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url"
1684#define NID_netscape_ca_revocation_url 74
1685#define OBJ_netscape_ca_revocation_url OBJ_netscape_cert_extension,4L
1686
1687#define SN_netscape_renewal_url "nsRenewalUrl"
1688#define LN_netscape_renewal_url "Netscape Renewal Url"
1689#define NID_netscape_renewal_url 75
1690#define OBJ_netscape_renewal_url OBJ_netscape_cert_extension,7L
1691
1692#define SN_netscape_ca_policy_url "nsCaPolicyUrl"
1693#define LN_netscape_ca_policy_url "Netscape CA Policy Url"
1694#define NID_netscape_ca_policy_url 76
1695#define OBJ_netscape_ca_policy_url OBJ_netscape_cert_extension,8L
1696
1697#define SN_netscape_ssl_server_name "nsSslServerName"
1698#define LN_netscape_ssl_server_name "Netscape SSL Server Name"
1699#define NID_netscape_ssl_server_name 77
1700#define OBJ_netscape_ssl_server_name OBJ_netscape_cert_extension,12L
1701
1702#define SN_netscape_comment "nsComment"
1703#define LN_netscape_comment "Netscape Comment"
1704#define NID_netscape_comment 78
1705#define OBJ_netscape_comment OBJ_netscape_cert_extension,13L
1706
1707#define SN_netscape_cert_sequence "nsCertSequence"
1708#define LN_netscape_cert_sequence "Netscape Certificate Sequence"
1709#define NID_netscape_cert_sequence 79
1710#define OBJ_netscape_cert_sequence OBJ_netscape_data_type,5L
1711
1712#define SN_ns_sgc "nsSGC"
1713#define LN_ns_sgc "Netscape Server Gated Crypto"
1714#define NID_ns_sgc 139
1715#define OBJ_ns_sgc OBJ_netscape,4L,1L
1716
1717#define SN_org "ORG"
1718#define LN_org "org"
1719#define NID_org 379
1720#define OBJ_org OBJ_iso,3L
1721
1722#define SN_dod "DOD"
1723#define LN_dod "dod"
1724#define NID_dod 380
1725#define OBJ_dod OBJ_org,6L
1726
1727#define SN_iana "IANA"
1728#define LN_iana "iana"
1729#define NID_iana 381
1730#define OBJ_iana OBJ_dod,1L
1731
1732#define OBJ_internet OBJ_iana
1733
1734#define SN_Directory "directory"
1735#define LN_Directory "Directory"
1736#define NID_Directory 382
1737#define OBJ_Directory OBJ_internet,1L
1738
1739#define SN_Management "mgmt"
1740#define LN_Management "Management"
1741#define NID_Management 383
1742#define OBJ_Management OBJ_internet,2L
1743
1744#define SN_Experimental "experimental"
1745#define LN_Experimental "Experimental"
1746#define NID_Experimental 384
1747#define OBJ_Experimental OBJ_internet,3L
1748
1749#define SN_Private "private"
1750#define LN_Private "Private"
1751#define NID_Private 385
1752#define OBJ_Private OBJ_internet,4L
1753
1754#define SN_Security "security"
1755#define LN_Security "Security"
1756#define NID_Security 386
1757#define OBJ_Security OBJ_internet,5L
1758
1759#define SN_SNMPv2 "snmpv2"
1760#define LN_SNMPv2 "SNMPv2"
1761#define NID_SNMPv2 387
1762#define OBJ_SNMPv2 OBJ_internet,6L
1763
1764#define SN_Mail "mail"
1765#define LN_Mail "Mail"
1766#define NID_Mail 388
1767#define OBJ_Mail OBJ_internet,7L
1768
1769#define SN_Enterprises "enterprises"
1770#define LN_Enterprises "Enterprises"
1771#define NID_Enterprises 389
1772#define OBJ_Enterprises OBJ_private,1L
1773
1774#define SN_dcObject "dcobject"
1775#define LN_dcObject "dcObject"
1776#define NID_dcObject 390
1777#define OBJ_dcObject OBJ_enterprises,1466L,344L
1778
1779#define SN_domainComponent "DC"
1780#define LN_domainComponent "domainComponent"
1781#define NID_domainComponent 391
1782#define OBJ_domainComponent 0L,9L,2342L,19200300L,100L,1L,25L
1783
1784#define SN_Domain "domain"
1785#define LN_Domain "Domain"
1786#define NID_Domain 392
1787#define OBJ_Domain 0L,9L,2342L,19200300L,100L,4L,13L
1788
1789#define SN_rle_compression "RLE"
1790#define LN_rle_compression "run length compression"
1791#define NID_rle_compression 124
1792#define OBJ_rle_compression 1L,1L,1L,1L,666L,1L
1793
1794#define SN_zlib_compression "ZLIB"
1795#define LN_zlib_compression "zlib compression"
1796#define NID_zlib_compression 125
1797#define OBJ_zlib_compression 1L,1L,1L,1L,666L,2L
1798
diff --git a/src/lib/libcrypto/objects/obj_mac.num b/src/lib/libcrypto/objects/obj_mac.num
new file mode 100644
index 0000000000..d73a51370f
--- /dev/null
+++ b/src/lib/libcrypto/objects/obj_mac.num
@@ -0,0 +1,392 @@
1undef 0
2rsadsi 1
3pkcs 2
4md2 3
5md5 4
6rc4 5
7rsaEncryption 6
8md2WithRSAEncryption 7
9md5WithRSAEncryption 8
10pbeWithMD2AndDES_CBC 9
11pbeWithMD5AndDES_CBC 10
12X500 11
13X509 12
14commonName 13
15countryName 14
16localityName 15
17stateOrProvinceName 16
18organizationName 17
19organizationalUnitName 18
20rsa 19
21pkcs7 20
22pkcs7_data 21
23pkcs7_signed 22
24pkcs7_enveloped 23
25pkcs7_signedAndEnveloped 24
26pkcs7_digest 25
27pkcs7_encrypted 26
28pkcs3 27
29dhKeyAgreement 28
30des_ecb 29
31des_cfb64 30
32des_cbc 31
33des_ede 32
34des_ede3 33
35idea_cbc 34
36idea_cfb64 35
37idea_ecb 36
38rc2_cbc 37
39rc2_ecb 38
40rc2_cfb64 39
41rc2_ofb64 40
42sha 41
43shaWithRSAEncryption 42
44des_ede_cbc 43
45des_ede3_cbc 44
46des_ofb64 45
47idea_ofb64 46
48pkcs9 47
49pkcs9_emailAddress 48
50pkcs9_unstructuredName 49
51pkcs9_contentType 50
52pkcs9_messageDigest 51
53pkcs9_signingTime 52
54pkcs9_countersignature 53
55pkcs9_challengePassword 54
56pkcs9_unstructuredAddress 55
57pkcs9_extCertAttributes 56
58netscape 57
59netscape_cert_extension 58
60netscape_data_type 59
61des_ede_cfb64 60
62des_ede3_cfb64 61
63des_ede_ofb64 62
64des_ede3_ofb64 63
65sha1 64
66sha1WithRSAEncryption 65
67dsaWithSHA 66
68dsa_2 67
69pbeWithSHA1AndRC2_CBC 68
70id_pbkdf2 69
71dsaWithSHA1_2 70
72netscape_cert_type 71
73netscape_base_url 72
74netscape_revocation_url 73
75netscape_ca_revocation_url 74
76netscape_renewal_url 75
77netscape_ca_policy_url 76
78netscape_ssl_server_name 77
79netscape_comment 78
80netscape_cert_sequence 79
81desx_cbc 80
82id_ce 81
83subject_key_identifier 82
84key_usage 83
85private_key_usage_period 84
86subject_alt_name 85
87issuer_alt_name 86
88basic_constraints 87
89crl_number 88
90certificate_policies 89
91authority_key_identifier 90
92bf_cbc 91
93bf_ecb 92
94bf_cfb64 93
95bf_ofb64 94
96mdc2 95
97mdc2WithRSA 96
98rc4_40 97
99rc2_40_cbc 98
100givenName 99
101surname 100
102initials 101
103uniqueIdentifier 102
104crl_distribution_points 103
105md5WithRSA 104
106serialNumber 105
107title 106
108description 107
109cast5_cbc 108
110cast5_ecb 109
111cast5_cfb64 110
112cast5_ofb64 111
113pbeWithMD5AndCast5_CBC 112
114dsaWithSHA1 113
115md5_sha1 114
116sha1WithRSA 115
117dsa 116
118ripemd160 117
119ripemd160WithRSA 119
120rc5_cbc 120
121rc5_ecb 121
122rc5_cfb64 122
123rc5_ofb64 123
124rle_compression 124
125zlib_compression 125
126ext_key_usage 126
127id_pkix 127
128id_kp 128
129server_auth 129
130client_auth 130
131code_sign 131
132email_protect 132
133time_stamp 133
134ms_code_ind 134
135ms_code_com 135
136ms_ctl_sign 136
137ms_sgc 137
138ms_efs 138
139ns_sgc 139
140delta_crl 140
141crl_reason 141
142invalidity_date 142
143sxnet 143
144pbe_WithSHA1And128BitRC4 144
145pbe_WithSHA1And40BitRC4 145
146pbe_WithSHA1And3_Key_TripleDES_CBC 146
147pbe_WithSHA1And2_Key_TripleDES_CBC 147
148pbe_WithSHA1And128BitRC2_CBC 148
149pbe_WithSHA1And40BitRC2_CBC 149
150keyBag 150
151pkcs8ShroudedKeyBag 151
152certBag 152
153crlBag 153
154secretBag 154
155safeContentsBag 155
156friendlyName 156
157localKeyID 157
158x509Certificate 158
159sdsiCertificate 159
160x509Crl 160
161pbes2 161
162pbmac1 162
163hmacWithSHA1 163
164id_qt_cps 164
165id_qt_unotice 165
166rc2_64_cbc 166
167SMIMECapabilities 167
168pbeWithMD2AndRC2_CBC 168
169pbeWithMD5AndRC2_CBC 169
170pbeWithSHA1AndDES_CBC 170
171ms_ext_req 171
172ext_req 172
173name 173
174dnQualifier 174
175id_pe 175
176id_ad 176
177info_access 177
178ad_OCSP 178
179ad_ca_issuers 179
180OCSP_sign 180
181iso 181
182member_body 182
183ISO_US 183
184X9_57 184
185X9cm 185
186pkcs1 186
187pkcs5 187
188SMIME 188
189id_smime_mod 189
190id_smime_ct 190
191id_smime_aa 191
192id_smime_alg 192
193id_smime_cd 193
194id_smime_spq 194
195id_smime_cti 195
196id_smime_mod_cms 196
197id_smime_mod_ess 197
198id_smime_mod_oid 198
199id_smime_mod_msg_v3 199
200id_smime_mod_ets_eSignature_88 200
201id_smime_mod_ets_eSignature_97 201
202id_smime_mod_ets_eSigPolicy_88 202
203id_smime_mod_ets_eSigPolicy_97 203
204id_smime_ct_receipt 204
205id_smime_ct_authData 205
206id_smime_ct_publishCert 206
207id_smime_ct_TSTInfo 207
208id_smime_ct_TDTInfo 208
209id_smime_ct_contentInfo 209
210id_smime_ct_DVCSRequestData 210
211id_smime_ct_DVCSResponseData 211
212id_smime_aa_receiptRequest 212
213id_smime_aa_securityLabel 213
214id_smime_aa_mlExpandHistory 214
215id_smime_aa_contentHint 215
216id_smime_aa_msgSigDigest 216
217id_smime_aa_encapContentType 217
218id_smime_aa_contentIdentifier 218
219id_smime_aa_macValue 219
220id_smime_aa_equivalentLabels 220
221id_smime_aa_contentReference 221
222id_smime_aa_encrypKeyPref 222
223id_smime_aa_signingCertificate 223
224id_smime_aa_smimeEncryptCerts 224
225id_smime_aa_timeStampToken 225
226id_smime_aa_ets_sigPolicyId 226
227id_smime_aa_ets_commitmentType 227
228id_smime_aa_ets_signerLocation 228
229id_smime_aa_ets_signerAttr 229
230id_smime_aa_ets_otherSigCert 230
231id_smime_aa_ets_contentTimestamp 231
232id_smime_aa_ets_CertificateRefs 232
233id_smime_aa_ets_RevocationRefs 233
234id_smime_aa_ets_certValues 234
235id_smime_aa_ets_revocationValues 235
236id_smime_aa_ets_escTimeStamp 236
237id_smime_aa_ets_certCRLTimestamp 237
238id_smime_aa_ets_archiveTimeStamp 238
239id_smime_aa_signatureType 239
240id_smime_aa_dvcs_dvc 240
241id_smime_alg_ESDHwith3DES 241
242id_smime_alg_ESDHwithRC2 242
243id_smime_alg_3DESwrap 243
244id_smime_alg_RC2wrap 244
245id_smime_alg_ESDH 245
246id_smime_alg_CMS3DESwrap 246
247id_smime_alg_CMSRC2wrap 247
248id_smime_cd_ldap 248
249id_smime_spq_ets_sqt_uri 249
250id_smime_spq_ets_sqt_unotice 250
251id_smime_cti_ets_proofOfOrigin 251
252id_smime_cti_ets_proofOfReceipt 252
253id_smime_cti_ets_proofOfDelivery 253
254id_smime_cti_ets_proofOfSender 254
255id_smime_cti_ets_proofOfApproval 255
256id_smime_cti_ets_proofOfCreation 256
257md4 257
258id_pkix_mod 258
259id_qt 259
260id_it 260
261id_pkip 261
262id_alg 262
263id_cmc 263
264id_on 264
265id_pda 265
266id_aca 266
267id_qcs 267
268id_cct 268
269id_pkix1_explicit_88 269
270id_pkix1_implicit_88 270
271id_pkix1_explicit_93 271
272id_pkix1_implicit_93 272
273id_mod_crmf 273
274id_mod_cmc 274
275id_mod_kea_profile_88 275
276id_mod_kea_profile_93 276
277id_mod_cmp 277
278id_mod_qualified_cert_88 278
279id_mod_qualified_cert_93 279
280id_mod_attribute_cert 280
281id_mod_timestamp_protocol 281
282id_mod_ocsp 282
283id_mod_dvcs 283
284id_mod_cmp2000 284
285biometricInfo 285
286qcStatements 286
287ac_auditEntity 287
288ac_targeting 288
289aaControls 289
290sbqp_ipAddrBlock 290
291sbqp_autonomousSysNum 291
292sbqp_routerIdentifier 292
293textNotice 293
294ipsecEndSystem 294
295ipsecTunnel 295
296ipsecUser 296
297dvcs 297
298id_it_caProtEncCert 298
299id_it_signKeyPairTypes 299
300id_it_encKeyPairTypes 300
301id_it_preferredSymmAlg 301
302id_it_caKeyUpdateInfo 302
303id_it_currentCRL 303
304id_it_unsupportedOIDs 304
305id_it_subscriptionRequest 305
306id_it_subscriptionResponse 306
307id_it_keyPairParamReq 307
308id_it_keyPairParamRep 308
309id_it_revPassphrase 309
310id_it_implicitConfirm 310
311id_it_confirmWaitTime 311
312id_it_origPKIMessage 312
313id_regCtrl 313
314id_regInfo 314
315id_regCtrl_regToken 315
316id_regCtrl_authenticator 316
317id_regCtrl_pkiPublicationInfo 317
318id_regCtrl_pkiArchiveOptions 318
319id_regCtrl_oldCertID 319
320id_regCtrl_protocolEncrKey 320
321id_regInfo_utf8Pairs 321
322id_regInfo_certReq 322
323id_alg_des40 323
324id_alg_noSignature 324
325id_alg_dh_sig_hmac_sha1 325
326id_alg_dh_pop 326
327id_cmc_statusInfo 327
328id_cmc_identification 328
329id_cmc_identityProof 329
330id_cmc_dataReturn 330
331id_cmc_transactionId 331
332id_cmc_senderNonce 332
333id_cmc_recipientNonce 333
334id_cmc_addExtensions 334
335id_cmc_encryptedPOP 335
336id_cmc_decryptedPOP 336
337id_cmc_lraPOPWitness 337
338id_cmc_getCert 338
339id_cmc_getCRL 339
340id_cmc_revokeRequest 340
341id_cmc_regInfo 341
342id_cmc_responseInfo 342
343id_cmc_queryPending 343
344id_cmc_popLinkRandom 344
345id_cmc_popLinkWitness 345
346id_cmc_confirmCertAcceptance 346
347id_on_personalData 347
348id_pda_dateOfBirth 348
349id_pda_placeOfBirth 349
350id_pda_pseudonym 350
351id_pda_gender 351
352id_pda_countryOfCitizenship 352
353id_pda_countryOfResidence 353
354id_aca_authenticationInfo 354
355id_aca_accessIdentity 355
356id_aca_chargingIdentity 356
357id_aca_group 357
358id_aca_role 358
359id_qcs_pkixQCSyntax_v1 359
360id_cct_crs 360
361id_cct_PKIData 361
362id_cct_PKIResponse 362
363ad_timeStamping 363
364ad_dvcs 364
365id_pkix_OCSP_basic 365
366id_pkix_OCSP_Nonce 366
367id_pkix_OCSP_CrlID 367
368id_pkix_OCSP_acceptableResponses 368
369id_pkix_OCSP_noCheck 369
370id_pkix_OCSP_archiveCutoff 370
371id_pkix_OCSP_serviceLocator 371
372id_pkix_OCSP_extendedStatus 372
373id_pkix_OCSP_valid 373
374id_pkix_OCSP_path 374
375id_pkix_OCSP_trustRoot 375
376algorithm 376
377rsaSignature 377
378X500algorithms 378
379org 379
380dod 380
381iana 381
382Directory 382
383Management 383
384Experimental 384
385Private 385
386Security 386
387SNMPv2 387
388Mail 388
389Enterprises 389
390dcObject 390
391domainComponent 391
392Domain 392
diff --git a/src/lib/libcrypto/objects/objects.README b/src/lib/libcrypto/objects/objects.README
new file mode 100644
index 0000000000..4d745508d8
--- /dev/null
+++ b/src/lib/libcrypto/objects/objects.README
@@ -0,0 +1,44 @@
1objects.txt syntax
2------------------
3
4To cover all the naming hacks that were previously in objects.h needed some
5kind of hacks in objects.txt.
6
7The 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
21Then 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
42Lines starting with # are treated as comments, as well as any line starting
43with ! and not matching the commands above.
44
diff --git a/src/lib/libcrypto/objects/objects.h b/src/lib/libcrypto/objects/objects.h
index 95c8a21568..c099e2e84e 100644
--- a/src/lib/libcrypto/objects/objects.h
+++ b/src/lib/libcrypto/objects/objects.h
@@ -59,10 +59,11 @@
59#ifndef HEADER_OBJECTS_H 59#ifndef HEADER_OBJECTS_H
60#define HEADER_OBJECTS_H 60#define HEADER_OBJECTS_H
61 61
62#ifdef __cplusplus 62#define USE_OBJ_MAC
63extern "C" {
64#endif
65 63
64#ifdef USE_OBJ_MAC
65#include <openssl/obj_mac.h>
66#else
66#define SN_undef "UNDEF" 67#define SN_undef "UNDEF"
67#define LN_undef "undefined" 68#define LN_undef "undefined"
68#define NID_undef 0 69#define NID_undef 0
@@ -953,6 +954,7 @@ extern "C" {
953#define LN_OCSP_sign "OCSP Signing" 954#define LN_OCSP_sign "OCSP Signing"
954#define NID_OCSP_sign 180 955#define NID_OCSP_sign 180
955#define OBJ_OCSP_sign OBJ_id_kp,9L 956#define OBJ_OCSP_sign OBJ_id_kp,9L
957#endif /* USE_OBJ_MAC */
956 958
957#include <openssl/bio.h> 959#include <openssl/bio.h>
958#include <openssl/asn1.h> 960#include <openssl/asn1.h>
@@ -967,6 +969,10 @@ extern "C" {
967#define OBJ_NAME_ALIAS 0x8000 969#define OBJ_NAME_ALIAS 0x8000
968 970
969 971
972#ifdef __cplusplus
973extern "C" {
974#endif
975
970typedef struct obj_name_st 976typedef struct obj_name_st
971 { 977 {
972 int type; 978 int type;
@@ -979,8 +985,8 @@ typedef struct obj_name_st
979 985
980 986
981int OBJ_NAME_init(void); 987int OBJ_NAME_init(void);
982int OBJ_NAME_new_index(unsigned long (*hash_func)(),int (*cmp_func)(), 988int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),int (*cmp_func)(const void *, const void *),
983 void (*free_func)()); 989 void (*free_func)(const char *, int, const char *));
984const char *OBJ_NAME_get(const char *name,int type); 990const char *OBJ_NAME_get(const char *name,int type);
985int OBJ_NAME_add(const char *name,int type,const char *data); 991int OBJ_NAME_add(const char *name,int type,const char *data);
986int OBJ_NAME_remove(const char *name,int type); 992int OBJ_NAME_remove(const char *name,int type);
@@ -997,7 +1003,7 @@ int OBJ_txt2nid(char *s);
997int OBJ_ln2nid(const char *s); 1003int OBJ_ln2nid(const char *s);
998int OBJ_sn2nid(const char *s); 1004int OBJ_sn2nid(const char *s);
999int OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b); 1005int OBJ_cmp(ASN1_OBJECT *a,ASN1_OBJECT *b);
1000char * OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)()); 1006char * OBJ_bsearch(char *key,char *base,int num,int size,int (*cmp)(const void *, const void *));
1001 1007
1002void ERR_load_OBJ_strings(void ); 1008void ERR_load_OBJ_strings(void );
1003 1009
diff --git a/src/lib/libcrypto/objects/objects.pl b/src/lib/libcrypto/objects/objects.pl
new file mode 100644
index 0000000000..c956bbb841
--- /dev/null
+++ b/src/lib/libcrypto/objects/objects.pl
@@ -0,0 +1,224 @@
1#!/usr/local/bin/perl
2
3open (NUMIN,"$ARGV[1]") || die "Can't open number file $ARGV[1]";
4$max_nid=0;
5$o=0;
6while(<NUMIN>)
7 {
8 chop;
9 $o++;
10 s/#.*$//;
11 next if /^\s*$/;
12 ($Cname,$mynum) = split;
13 if (defined($nidn{$mynum}))
14 { die "$ARGV[1]:$o:There's already an object with NID ",$mynum," on line ",$order{$mynum},"\n"; }
15 $nid{$Cname} = $mynum;
16 $nidn{$mynum} = $Cname;
17 $order{$mynum} = $o;
18 $max_nid = $mynum if $mynum > $max_nid;
19 }
20close NUMIN;
21
22open (IN,"$ARGV[0]") || die "Can't open input file $ARGV[0]";
23$Cname="";
24$o=0;
25while (<IN>)
26 {
27 chop;
28 $o++;
29 if (/^!module\s+(.*)$/)
30 {
31 $module = $1."-";
32 $module =~ s/\./_/g;
33 $module =~ s/-/_/g;
34 }
35 if (/^!global$/)
36 { $module = ""; }
37 if (/^!Cname\s+(.*)$/)
38 { $Cname = $1; }
39 if (/^!Alias\s+(.+?)\s+(.*)$/)
40 {
41 $Cname = $module.$1;
42 $myoid = $2;
43 $myoid = &process_oid($myoid);
44 $Cname =~ s/-/_/g;
45 $ordern{$o} = $Cname;
46 $order{$Cname} = $o;
47 $obj{$Cname} = $myoid;
48 $_ = "";
49 $Cname = "";
50 }
51 s/!.*$//;
52 s/#.*$//;
53 next if /^\s*$/;
54 ($myoid,$mysn,$myln) = split ':';
55 $mysn =~ s/^\s*//;
56 $mysn =~ s/\s*$//;
57 $myln =~ s/^\s*//;
58 $myln =~ s/\s*$//;
59 $myoid =~ s/^\s*//;
60 $myoid =~ s/\s*$//;
61 if ($myoid ne "")
62 {
63 $myoid = &process_oid($myoid);
64 }
65
66 if ($Cname eq "" && !($myln =~ / /))
67 {
68 $Cname = $myln;
69 $Cname =~ s/\./_/g;
70 $Cname =~ s/-/_/g;
71 if ($Cname ne "" && defined($ln{$module.$Cname}))
72 { die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
73 }
74 if ($Cname eq "")
75 {
76 $Cname = $mysn;
77 $Cname =~ s/-/_/g;
78 if ($Cname ne "" && defined($sn{$module.$Cname}))
79 { die "objects.txt:$o:There's already an object with short name ",$sn{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
80 }
81 if ($Cname eq "")
82 {
83 $Cname = $myln;
84 $Cname =~ s/-/_/g;
85 $Cname =~ s/\./_/g;
86 $Cname =~ s/ /_/g;
87 if ($Cname ne "" && defined($ln{$module.$Cname}))
88 { die "objects.txt:$o:There's already an object with long name ",$ln{$module.$Cname}," on line ",$order{$module.$Cname},"\n"; }
89 }
90 $Cname =~ s/\./_/g;
91 $Cname =~ s/-/_/g;
92 $Cname = $module.$Cname;
93 $ordern{$o} = $Cname;
94 $order{$Cname} = $o;
95 $sn{$Cname} = $mysn;
96 $ln{$Cname} = $myln;
97 $obj{$Cname} = $myoid;
98 if (!defined($nid{$Cname}))
99 {
100 $max_nid++;
101 $nid{$Cname} = $max_nid;
102 $nidn{$max_nid} = $Cname;
103 }
104 $Cname="";
105 }
106close IN;
107
108open (NUMOUT,">$ARGV[1]") || die "Can't open output file $ARGV[1]";
109foreach (sort { $a <=> $b } keys %nidn)
110 {
111 print NUMOUT $nidn{$_},"\t\t",$_,"\n";
112 }
113close NUMOUT;
114
115open (OUT,">$ARGV[2]") || die "Can't open output file $ARGV[2]";
116print OUT <<'EOF';
117/* lib/obj/obj_mac.h */
118/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
119 * All rights reserved.
120 *
121 * This package is an SSL implementation written
122 * by Eric Young (eay@cryptsoft.com).
123 * The implementation was written so as to conform with Netscapes SSL.
124 *
125 * This library is free for commercial and non-commercial use as long as
126 * the following conditions are aheared to. The following conditions
127 * apply to all code found in this distribution, be it the RC4, RSA,
128 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
129 * included with this distribution is covered by the same copyright terms
130 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
131 *
132 * Copyright remains Eric Young's, and as such any Copyright notices in
133 * the code are not to be removed.
134 * If this package is used in a product, Eric Young should be given attribution
135 * as the author of the parts of the library used.
136 * This can be in the form of a textual message at program startup or
137 * in documentation (online or textual) provided with the package.
138 *
139 * Redistribution and use in source and binary forms, with or without
140 * modification, are permitted provided that the following conditions
141 * are met:
142 * 1. Redistributions of source code must retain the copyright
143 * notice, this list of conditions and the following disclaimer.
144 * 2. Redistributions in binary form must reproduce the above copyright
145 * notice, this list of conditions and the following disclaimer in the
146 * documentation and/or other materials provided with the distribution.
147 * 3. All advertising materials mentioning features or use of this software
148 * must display the following acknowledgement:
149 * "This product includes cryptographic software written by
150 * Eric Young (eay@cryptsoft.com)"
151 * The word 'cryptographic' can be left out if the rouines from the library
152 * being used are not cryptographic related :-).
153 * 4. If you include any Windows specific code (or a derivative thereof) from
154 * the apps directory (application code) you must include an acknowledgement:
155 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
156 *
157 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
158 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
159 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
160 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
161 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
162 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
163 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
164 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
165 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
166 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
167 * SUCH DAMAGE.
168 *
169 * The licence and distribution terms for any publically available version or
170 * derivative of this code cannot be changed. i.e. this code cannot simply be
171 * copied and put under another distribution licence
172 * [including the GNU Public Licence.]
173 */
174
175/* THIS FILE IS GENERATED FROM objects.txt by objects.pl via the
176 * following command:
177 * perl objects.pl objects.txt obj_mac.num obj_mac.h
178 */
179
180#define SN_undef "UNDEF"
181#define LN_undef "undefined"
182#define NID_undef 0
183#define OBJ_undef 0L
184
185EOF
186
187foreach (sort { $a <=> $b } keys %ordern)
188 {
189 $Cname=$ordern{$_};
190 print OUT "#define SN_",$Cname,"\t\t\"",$sn{$Cname},"\"\n" if $sn{$Cname} ne "";
191 print OUT "#define LN_",$Cname,"\t\t\"",$ln{$Cname},"\"\n" if $ln{$Cname} ne "";
192 print OUT "#define NID_",$Cname,"\t\t",$nid{$Cname},"\n" if $nid{$Cname} ne "";
193 print OUT "#define OBJ_",$Cname,"\t\t",$obj{$Cname},"\n" if $obj{$Cname} ne "";
194 print OUT "\n";
195 }
196
197close OUT;
198
199sub process_oid
200 {
201 local($oid)=@_;
202 local(@a,$oid_pref);
203
204 @a = split(/\s+/,$myoid);
205 $pref_oid = "";
206 $pref_sep = "";
207 if (!($a[0] =~ /^[0-9]+$/))
208 {
209 $a[0] =~ s/-/_/g;
210 $pref_oid = "OBJ_" . $a[0];
211 $pref_sep = ",";
212 shift @a;
213 }
214 $oids = join('L,',@a) . "L";
215 if ($oids ne "L")
216 {
217 $oids = $pref_oid . $pref_sep . $oids;
218 }
219 else
220 {
221 $oids = $pref_oid;
222 }
223 return($oids);
224 }
diff --git a/src/lib/libcrypto/objects/objects.txt b/src/lib/libcrypto/objects/objects.txt
index cb276e90e9..3d443cf884 100644
--- a/src/lib/libcrypto/objects/objects.txt
+++ b/src/lib/libcrypto/objects/objects.txt
@@ -1,40 +1,593 @@
11 2 : ISO member bodies 11 : ISO : iso
21 2 840 : US (ANSI) 2
31 2 840 113549 : rsadsi : RSA Data Security, Inc. 3iso 2 : member-body : ISO Member Body
41 2 840 113549 1 : pkcs : RSA Data Security, Inc. PKCS 4
51 2 840 113549 1 1 1 : rsaEncryption 5member-body 840 : ISO-US : ISO US Member Body
61 2 840 113549 1 1 2 : md2withRSAEncryption 6ISO-US 10040 : X9-57 : X9.57
71 2 840 113549 1 1 4 : md5withRSAEncryption 7X9-57 4 : X9cm : X9.57 CM ?
81 2 840 113549 1 7 : pkcs-7 8
91 2 840 113549 1 7 1 : pkcs-7-data 9!Cname dsa
101 2 840 113549 1 7 2 : pkcs-7-signedData 10X9cm 1 : DSA : dsaEncryption
111 2 840 113549 1 7 3 : pkcs-7-envelopedData 11X9cm 3 : DSA-SHA1 : dsaWithSHA1
121 2 840 113549 1 7 4 : pkcs-7-signedAndEnvelopedData 12
131 2 840 113549 1 7 5 : pkcs-7-digestData 13ISO-US 113533 7 66 10 : CAST5-CBC : cast5-cbc
141 2 840 113549 1 7 6 : pkcs-7-encryptedData 14 : CAST5-ECB : cast5-ecb
151 2 840 113549 2 2 : md2 15!Cname cast5-cfb64
161 2 840 113549 2 4 : md4 16 : CAST5-CFB : cast5-cfb
171 2 840 113549 2 5 : md5 17!Cname cast5-ofb64
181 2 840 113549 3 4 : rc4 18 : CAST5-OFB : cast5-ofb
191 2 840 113549 5 1 : pbeWithMD2AndDES_CBC 19!Cname pbeWithMD5AndCast5-CBC
201 2 840 113549 5 3 : pbeWithMD5AndDES_CBC 20ISO-US 113533 7 66 12 : : pbeWithMD5AndCast5CBC
212 5 : X500 : directory services (X.500) 21
222 5 4 : X509 22ISO-US 113549 : rsadsi : RSA Data Security, Inc.
232 5 4 3 : commonName 23
242 5 4 6 : countryName 24rsadsi 1 : pkcs : RSA Data Security, Inc. PKCS
252 5 4 7 : localityName 25
262 5 4 8 : stateOrProvinceName 26pkcs 1 : pkcs1
272 5 4 10 : organizationName 27pkcs1 1 : : rsaEncryption
282 5 4 11 : organizationalUnitName 28pkcs1 2 : RSA-MD2 : md2WithRSAEncryption
292 5 8 : directory services - algorithms 29pkcs1 4 : RSA-MD5 : md5WithRSAEncryption
302 5 8 1 1 : rsa 30pkcs1 5 : RSA-SHA1 : sha1WithRSAEncryption
31 31
32algorithm 18 : sha 32pkcs 3 : pkcs3
33encryptionAlgorithm 1 : rsa 33pkcs3 1 : : dhKeyAgreement
34
35pkcs 5 : pkcs5
36pkcs5 1 : PBE-MD2-DES : pbeWithMD2AndDES-CBC
37pkcs5 3 : PBE-MD5-DES : pbeWithMD5AndDES-CBC
38pkcs5 4 : PBE-MD2-RC2-64 : pbeWithMD2AndRC2-CBC
39pkcs5 6 : PBE-MD5-RC2-64 : pbeWithMD5AndRC2-CBC
40pkcs5 10 : PBE-SHA1-DES : pbeWithSHA1AndDES-CBC
41pkcs5 11 : PBE-SHA1-RC2-64 : pbeWithSHA1AndRC2-CBC
42!Cname id_pbkdf2
43pkcs5 12 : : PBKDF2
44!Cname pbes2
45pkcs5 13 : : PBES2
46!Cname pbmac1
47pkcs5 14 : : PBMAC1
48
49pkcs 7 : pkcs7
50pkcs7 1 : : pkcs7-data
51!Cname pkcs7-signed
52pkcs7 2 : : pkcs7-signedData
53!Cname pkcs7-enveloped
54pkcs7 3 : : pkcs7-envelopedData
55!Cname pkcs7-signedAndEnveloped
56pkcs7 4 : : pkcs7-signedAndEnvelopedData
57!Cname pkcs7-digest
58pkcs7 5 : : pkcs7-digestData
59!Cname pkcs7-encrypted
60pkcs7 6 : : pkcs7-encryptedData
61
62pkcs 9 : pkcs9
63!module pkcs9
64pkcs9 1 : Email : emailAddress
65pkcs9 2 : : unstructuredName
66pkcs9 3 : : contentType
67pkcs9 4 : : messageDigest
68pkcs9 5 : : signingTime
69pkcs9 6 : : countersignature
70pkcs9 7 : : challengePassword
71pkcs9 8 : : unstructuredAddress
72!Cname extCertAttributes
73pkcs9 9 : : extendedCertificateAttributes
74!global
75
76!Cname ext-req
77pkcs9 14 : extReq : Extension Request
78
79!Cname SMIMECapabilities
80pkcs9 15 : SMIME-CAPS : S/MIME Capabilities
81
82# S/MIME
83!Cname SMIME
84pkcs9 16 : SMIME : S/MIME
85SMIME 0 : id-smime-mod
86SMIME 1 : id-smime-ct
87SMIME 2 : id-smime-aa
88SMIME 3 : id-smime-alg
89SMIME 4 : id-smime-cd
90SMIME 5 : id-smime-spq
91SMIME 6 : id-smime-cti
92
93# S/MIME Modules
94id-smime-mod 1 : id-smime-mod-cms
95id-smime-mod 2 : id-smime-mod-ess
96id-smime-mod 3 : id-smime-mod-oid
97id-smime-mod 4 : id-smime-mod-msg-v3
98id-smime-mod 5 : id-smime-mod-ets-eSignature-88
99id-smime-mod 6 : id-smime-mod-ets-eSignature-97
100id-smime-mod 7 : id-smime-mod-ets-eSigPolicy-88
101id-smime-mod 8 : id-smime-mod-ets-eSigPolicy-97
102
103# S/MIME Content Types
104id-smime-ct 1 : id-smime-ct-receipt
105id-smime-ct 2 : id-smime-ct-authData
106id-smime-ct 3 : id-smime-ct-publishCert
107id-smime-ct 4 : id-smime-ct-TSTInfo
108id-smime-ct 5 : id-smime-ct-TDTInfo
109id-smime-ct 6 : id-smime-ct-contentInfo
110id-smime-ct 7 : id-smime-ct-DVCSRequestData
111id-smime-ct 8 : id-smime-ct-DVCSResponseData
112
113# S/MIME Attributes
114id-smime-aa 1 : id-smime-aa-receiptRequest
115id-smime-aa 2 : id-smime-aa-securityLabel
116id-smime-aa 3 : id-smime-aa-mlExpandHistory
117id-smime-aa 4 : id-smime-aa-contentHint
118id-smime-aa 5 : id-smime-aa-msgSigDigest
119# obsolete
120id-smime-aa 6 : id-smime-aa-encapContentType
121id-smime-aa 7 : id-smime-aa-contentIdentifier
122# obsolete
123id-smime-aa 8 : id-smime-aa-macValue
124id-smime-aa 9 : id-smime-aa-equivalentLabels
125id-smime-aa 10 : id-smime-aa-contentReference
126id-smime-aa 11 : id-smime-aa-encrypKeyPref
127id-smime-aa 12 : id-smime-aa-signingCertificate
128id-smime-aa 13 : id-smime-aa-smimeEncryptCerts
129id-smime-aa 14 : id-smime-aa-timeStampToken
130id-smime-aa 15 : id-smime-aa-ets-sigPolicyId
131id-smime-aa 16 : id-smime-aa-ets-commitmentType
132id-smime-aa 17 : id-smime-aa-ets-signerLocation
133id-smime-aa 18 : id-smime-aa-ets-signerAttr
134id-smime-aa 19 : id-smime-aa-ets-otherSigCert
135id-smime-aa 20 : id-smime-aa-ets-contentTimestamp
136id-smime-aa 21 : id-smime-aa-ets-CertificateRefs
137id-smime-aa 22 : id-smime-aa-ets-RevocationRefs
138id-smime-aa 23 : id-smime-aa-ets-certValues
139id-smime-aa 24 : id-smime-aa-ets-revocationValues
140id-smime-aa 25 : id-smime-aa-ets-escTimeStamp
141id-smime-aa 26 : id-smime-aa-ets-certCRLTimestamp
142id-smime-aa 27 : id-smime-aa-ets-archiveTimeStamp
143id-smime-aa 28 : id-smime-aa-signatureType
144id-smime-aa 29 : id-smime-aa-dvcs-dvc
145
146# S/MIME Algorithm Identifiers
147# obsolete
148id-smime-alg 1 : id-smime-alg-ESDHwith3DES
149# obsolete
150id-smime-alg 2 : id-smime-alg-ESDHwithRC2
151# obsolete
152id-smime-alg 3 : id-smime-alg-3DESwrap
153# obsolete
154id-smime-alg 4 : id-smime-alg-RC2wrap
155id-smime-alg 5 : id-smime-alg-ESDH
156id-smime-alg 6 : id-smime-alg-CMS3DESwrap
157id-smime-alg 7 : id-smime-alg-CMSRC2wrap
158
159# S/MIME Certificate Distribution
160id-smime-cd 1 : id-smime-cd-ldap
161
162# S/MIME Signature Policy Qualifier
163id-smime-spq 1 : id-smime-spq-ets-sqt-uri
164id-smime-spq 2 : id-smime-spq-ets-sqt-unotice
165
166# S/MIME Commitment Type Identifier
167id-smime-cti 1 : id-smime-cti-ets-proofOfOrigin
168id-smime-cti 2 : id-smime-cti-ets-proofOfReceipt
169id-smime-cti 3 : id-smime-cti-ets-proofOfDelivery
170id-smime-cti 4 : id-smime-cti-ets-proofOfSender
171id-smime-cti 5 : id-smime-cti-ets-proofOfApproval
172id-smime-cti 6 : id-smime-cti-ets-proofOfCreation
173
174pkcs9 20 : : friendlyName
175pkcs9 21 : : localKeyID
176!Alias certTypes pkcs9 22
177certTypes 1 : : x509Certificate
178certTypes 2 : : sdsiCertificate
179!Alias crlTypes pkcs9 23
180crlTypes 1 : : x509Crl
181
182!Alias pkcs12 pkcs 12
183!Alias pkcs12-pbeids pkcs12 1
184
185!Cname pbe-WithSHA1And128BitRC4
186pkcs12-pbeids 1 : PBE-SHA1-RC4-128 : pbeWithSHA1And128BitRC4
187!Cname pbe-WithSHA1And40BitRC4
188pkcs12-pbeids 2 : PBE-SHA1-RC4-40 : pbeWithSHA1And40BitRC4
189!Cname pbe-WithSHA1And3_Key_TripleDES-CBC
190pkcs12-pbeids 3 : PBE-SHA1-3DES : pbeWithSHA1And3-KeyTripleDES-CBC
191!Cname pbe-WithSHA1And2_Key_TripleDES-CBC
192pkcs12-pbeids 4 : PBE-SHA1-2DES : pbeWithSHA1And2-KeyTripleDES-CBC
193!Cname pbe-WithSHA1And128BitRC2-CBC
194pkcs12-pbeids 5 : PBE-SHA1-RC2-128 : pbeWithSHA1And128BitRC2-CBC
195!Cname pbe-WithSHA1And40BitRC2-CBC
196pkcs12-pbeids 6 : PBE-SHA1-RC2-40 : pbeWithSHA1And40BitRC2-CBC
197
198!Alias pkcs12-Version1 pkcs12 10
199!Alias pkcs12-BagIds pkcs12-Version1 1
200pkcs12-BagIds 1 : : keyBag
201pkcs12-BagIds 2 : : pkcs8ShroudedKeyBag
202pkcs12-BagIds 3 : : certBag
203pkcs12-BagIds 4 : : crlBag
204pkcs12-BagIds 5 : : secretBag
205pkcs12-BagIds 6 : : safeContentsBag
206
207rsadsi 2 2 : MD2 : md2
208rsadsi 2 4 : MD4 : md4
209rsadsi 2 5 : MD5 : md5
210 : MD5-SHA1 : md5-sha1
211rsadsi 2 7 : : hmacWithSHA1
212rsadsi 3 2 : RC2-CBC : rc2-cbc
213 : RC2-ECB : rc2-ecb
214!Cname rc2-cfb64
215 : RC2-CFB : rc2-cfb
216!Cname rc2-ofb64
217 : RC2-OFB : rc2-ofb
218 : RC2-40-CBC : rc2-40-cbc
219 : RC2-64-CBC : rc2-64-cbc
220rsadsi 3 4 : RC4 : rc4
221 : RC4-40 : rc4-40
222rsadsi 3 7 : DES-EDE3-CBC : des-ede3-cbc
223rsadsi 3 8 : RC5-CBC : rc5-cbc
224 : RC5-ECB : rc5-ecb
225!Cname rc5-cfb64
226 : RC5-CFB : rc5-cfb
227!Cname rc5-ofb64
228 : RC5-OFB : rc5-ofb
229
230!Cname ms-ext-req
2311 3 6 1 4 1 311 2 1 14 : msExtReq : Microsoft Extension Request
232!Cname ms-code-ind
2331 3 6 1 4 1 311 2 1 21 : msCodeInd : Microsoft Individual Code Signing
234!Cname ms-code-com
2351 3 6 1 4 1 311 2 1 22 : msCodeCom : Microsoft Commercial Code Signing
236!Cname ms-ctl-sign
2371 3 6 1 4 1 311 10 3 1 : msCTLSign : Microsoft Trust List Signing
238!Cname ms-sgc
2391 3 6 1 4 1 311 10 3 3 : msSGC : Microsoft Server Gated Crypto
240!Cname ms-efs
2411 3 6 1 4 1 311 10 3 4 : msEFS : Microsoft Encrypted File System
242
2431 3 6 1 4 1 188 7 1 1 2 : IDEA-CBC : idea-cbc
244 : IDEA-ECB : idea-ecb
245!Cname idea-cfb64
246 : IDEA-CFB : idea-cfb
247!Cname idea-ofb64
248 : IDEA-OFB : idea-ofb
249
2501 3 6 1 4 1 3029 1 2 : BF-CBC : bf-cbc
251 : BF-ECB : bf-ecb
252!Cname bf-cfb64
253 : BF-CFB : bf-cfb
254!Cname bf-ofb64
255 : BF-OFB : bf-ofb
256
257!Cname id-pkix
2581 3 6 1 5 5 7 : PKIX
259
260# PKIX Arcs
261id-pkix 0 : id-pkix-mod
262id-pkix 1 : id-pe
263id-pkix 2 : id-qt
264id-pkix 3 : id-kp
265id-pkix 4 : id-it
266id-pkix 5 : id-pkip
267id-pkix 6 : id-alg
268id-pkix 7 : id-cmc
269id-pkix 8 : id-on
270id-pkix 9 : id-pda
271id-pkix 10 : id-aca
272id-pkix 11 : id-qcs
273id-pkix 12 : id-cct
274id-pkix 48 : id-ad
275
276# PKIX Modules
277id-pkix-mod 1 : id-pkix1-explicit-88
278id-pkix-mod 2 : id-pkix1-implicit-88
279id-pkix-mod 3 : id-pkix1-explicit-93
280id-pkix-mod 4 : id-pkix1-implicit-93
281id-pkix-mod 5 : id-mod-crmf
282id-pkix-mod 6 : id-mod-cmc
283id-pkix-mod 7 : id-mod-kea-profile-88
284id-pkix-mod 8 : id-mod-kea-profile-93
285id-pkix-mod 9 : id-mod-cmp
286id-pkix-mod 10 : id-mod-qualified-cert-88
287id-pkix-mod 11 : id-mod-qualified-cert-93
288id-pkix-mod 12 : id-mod-attribute-cert
289id-pkix-mod 13 : id-mod-timestamp-protocol
290id-pkix-mod 14 : id-mod-ocsp
291id-pkix-mod 15 : id-mod-dvcs
292id-pkix-mod 16 : id-mod-cmp2000
293
294# PKIX Private Extensions
295!Cname info-access
296id-pe 1 : authorityInfoAccess : Authority Information Access
297id-pe 2 : biometricInfo : Biometric Info
298id-pe 3 : qcStatements
299id-pe 4 : ac-auditEntity
300id-pe 5 : ac-targeting
301id-pe 6 : aaControls
302id-pe 7 : sbqp-ipAddrBlock
303id-pe 8 : sbqp-autonomousSysNum
304id-pe 9 : sbqp-routerIdentifier
305
306# PKIX policyQualifiers for Internet policy qualifiers
307id-qt 1 : id-qt-cps : Policy Qualifier CPS
308id-qt 2 : id-qt-unotice : Policy Qualifier User Notice
309id-qt 3 : textNotice
310
311# PKIX key purpose identifiers
312!Cname server-auth
313id-kp 1 : serverAuth : TLS Web Server Authentication
314!Cname client-auth
315id-kp 2 : clientAuth : TLS Web Client Authentication
316!Cname code-sign
317id-kp 3 : codeSigning : Code Signing
318!Cname email-protect
319id-kp 4 : emailProtection : E-mail Protection
320id-kp 5 : ipsecEndSystem : IPSec End System
321id-kp 6 : ipsecTunnel : IPSec Tunnel
322id-kp 7 : ipsecUser : IPSec User
323!Cname time-stamp
324id-kp 8 : timeStamping : Time Stamping
325# From OCSP spec RFC2560
326!Cname OCSP-sign
327id-kp 9 : OCSPSigning : OCSP Signing
328id-kp 10 : DVCS : dvcs
329
330# CMP information types
331id-it 1 : id-it-caProtEncCert
332id-it 2 : id-it-signKeyPairTypes
333id-it 3 : id-it-encKeyPairTypes
334id-it 4 : id-it-preferredSymmAlg
335id-it 5 : id-it-caKeyUpdateInfo
336id-it 6 : id-it-currentCRL
337id-it 7 : id-it-unsupportedOIDs
338# obsolete
339id-it 8 : id-it-subscriptionRequest
340# obsolete
341id-it 9 : id-it-subscriptionResponse
342id-it 10 : id-it-keyPairParamReq
343id-it 11 : id-it-keyPairParamRep
344id-it 12 : id-it-revPassphrase
345id-it 13 : id-it-implicitConfirm
346id-it 14 : id-it-confirmWaitTime
347id-it 15 : id-it-origPKIMessage
348
349# CRMF registration
350id-pkip 1 : id-regCtrl
351id-pkip 2 : id-regInfo
352
353# CRMF registration controls
354id-regCtrl 1 : id-regCtrl-regToken
355id-regCtrl 2 : id-regCtrl-authenticator
356id-regCtrl 3 : id-regCtrl-pkiPublicationInfo
357id-regCtrl 4 : id-regCtrl-pkiArchiveOptions
358id-regCtrl 5 : id-regCtrl-oldCertID
359id-regCtrl 6 : id-regCtrl-protocolEncrKey
360
361# CRMF registration information
362id-regInfo 1 : id-regInfo-utf8Pairs
363id-regInfo 2 : id-regInfo-certReq
364
365# algorithms
366id-alg 1 : id-alg-des40
367id-alg 2 : id-alg-noSignature
368id-alg 3 : id-alg-dh-sig-hmac-sha1
369id-alg 4 : id-alg-dh-pop
370
371# CMC controls
372id-cmc 1 : id-cmc-statusInfo
373id-cmc 2 : id-cmc-identification
374id-cmc 3 : id-cmc-identityProof
375id-cmc 4 : id-cmc-dataReturn
376id-cmc 5 : id-cmc-transactionId
377id-cmc 6 : id-cmc-senderNonce
378id-cmc 7 : id-cmc-recipientNonce
379id-cmc 8 : id-cmc-addExtensions
380id-cmc 9 : id-cmc-encryptedPOP
381id-cmc 10 : id-cmc-decryptedPOP
382id-cmc 11 : id-cmc-lraPOPWitness
383id-cmc 15 : id-cmc-getCert
384id-cmc 16 : id-cmc-getCRL
385id-cmc 17 : id-cmc-revokeRequest
386id-cmc 18 : id-cmc-regInfo
387id-cmc 19 : id-cmc-responseInfo
388id-cmc 21 : id-cmc-queryPending
389id-cmc 22 : id-cmc-popLinkRandom
390id-cmc 23 : id-cmc-popLinkWitness
391id-cmc 24 : id-cmc-confirmCertAcceptance
392
393# other names
394id-on 1 : id-on-personalData
395
396# personal data attributes
397id-pda 1 : id-pda-dateOfBirth
398id-pda 2 : id-pda-placeOfBirth
399id-pda 3 : id-pda-pseudonym
400id-pda 4 : id-pda-gender
401id-pda 5 : id-pda-countryOfCitizenship
402id-pda 6 : id-pda-countryOfResidence
403
404# attribute certificate attributes
405id-aca 1 : id-aca-authenticationInfo
406id-aca 2 : id-aca-accessIdentity
407id-aca 3 : id-aca-chargingIdentity
408id-aca 4 : id-aca-group
409id-aca 5 : id-aca-role
410
411# qualified certificate statements
412id-qcs 1 : id-qcs-pkixQCSyntax-v1
413
414# CMC content types
415id-cct 1 : id-cct-crs
416id-cct 2 : id-cct-PKIData
417id-cct 3 : id-cct-PKIResponse
418
419# access descriptors for authority info access extension
420!Cname ad-OCSP
421id-ad 1 : OCSP : OCSP
422!Cname ad-ca-issuers
423id-ad 2 : caIssuers : CA Issuers
424!Cname ad-timeStamping
425id-ad 3 : ad_timestamping : AD Time Stamping
426!Cname ad-dvcs
427id-ad 4 : AD_DVCS : ad dvcs
428
429
430!Alias id-pkix-OCSP ad-OCSP
431!module id-pkix-OCSP
432!Cname basic
433id-pkix-OCSP 1 : basicOCSPResponse : Basic OCSP Response
434id-pkix-OCSP 2 : Nonce : OCSP Nonce
435id-pkix-OCSP 3 : CrlID : OCSP CRL ID
436id-pkix-OCSP 4 : acceptableResponses : Acceptable OCSP Responses
437id-pkix-OCSP 5 : noCheck
438id-pkix-OCSP 6 : archiveCutoff : OCSP Archive Cutoff
439id-pkix-OCSP 7 : serviceLocator : OCSP Service Locator
440id-pkix-OCSP 8 : extendedStatus : Extended OCSP Status
441id-pkix-OCSP 9 : valid
442id-pkix-OCSP 10 : path
443id-pkix-OCSP 11 : trustRoot : Trust Root
444!global
445
4461 3 14 3 2 : algorithm : algorithm
447algorithm 3 : RSA-NP-MD5 : md5WithRSA
448algorithm 6 : DES-ECB : des-ecb
449algorithm 7 : DES-CBC : des-cbc
450!Cname des-ofb64
451algorithm 8 : DES-OFB : des-ofb
452!Cname des-cfb64
453algorithm 9 : DES-CFB : des-cfb
34algorithm 11 : rsaSignature 454algorithm 11 : rsaSignature
455!Cname dsa-2
456algorithm 12 : DSA-old : dsaEncryption-old
457algorithm 13 : DSA-SHA : dsaWithSHA
458algorithm 15 : RSA-SHA : shaWithRSAEncryption
459algorithm 17 : DES-EDE : des-ede
460 : DES-EDE3 : des-ede3
461 : DES-EDE-CBC : des-ede-cbc
462!Cname des-ede-cfb64
463 : DES-EDE-CFB : des-ede-cfb
464!Cname des-ede3-cfb64
465 : DES-EDE3-CFB : des-ede3-cfb
466!Cname des-ede-ofb64
467 : DES-EDE-OFB : des-ede-ofb
468!Cname des-ede3-ofb64
469 : DES-EDE3-OFB : des-ede3-ofb
470 : DESX-CBC : desx-cbc
471algorithm 18 : SHA : sha
472algorithm 26 : SHA1 : sha1
473!Cname dsaWithSHA1-2
474algorithm 27 : DSA-SHA1-old : dsaWithSHA1-old
475algorithm 29 : RSA-SHA1-2 : sha1WithRSA
476
4771 3 36 3 2 1 : RIPEMD160 : ripemd160
4781 3 36 3 3 1 2 : RSA-RIPEMD160 : ripemd160WithRSA
479
480!Cname sxnet
4811 3 101 1 4 1 : SXNetID : Strong Extranet ID
482
4832 5 : X500 : directory services (X.500)
484
485X500 4 : X509
486X509 3 : CN : commonName
487X509 4 : S : surname
488X509 5 : SN : serialNumber
489X509 6 : C : countryName
490X509 7 : L : localityName
491X509 8 : ST : stateOrProvinceName
492X509 10 : O : organizationName
493X509 11 : OU : organizationalUnitName
494X509 12 : T : title
495X509 13 : D : description
496X509 41 : name : name
497X509 42 : G : givenName
498X509 43 : I : initials
499X509 45 : UID : uniqueIdentifier
500X509 46 : dnQualifier : dnQualifier
501
502X500 8 : X500algorithms : directory services - algorithms
503X500algorithms 1 1 : RSA : rsa
504X500algorithms 3 100 : RSA-MDC2 : mdc2WithRSA
505X500algorithms 3 101 : MDC2 : mdc2
506
507X500 29 : id-ce
508!Cname subject-key-identifier
509id-ce 14 : subjectKeyIdentifier : X509v3 Subject Key Identifier
510!Cname key-usage
511id-ce 15 : keyUsage : X509v3 Key Usage
512!Cname private-key-usage-period
513id-ce 16 : privateKeyUsagePeriod : X509v3 Private Key Usage Period
514!Cname subject-alt-name
515id-ce 17 : subjectAltName : X509v3 Subject Alternative Name
516!Cname issuer-alt-name
517id-ce 18 : issuerAltName : X509v3 Issuer Alternative Name
518!Cname basic-constraints
519id-ce 19 : basicConstraints : X509v3 Basic Constraints
520!Cname crl-number
521id-ce 20 : crlNumber : X509v3 CRL Number
522!Cname crl-reason
523id-ce 21 : CRLReason : X509v3 CRL Reason Code
524!Cname invalidity-date
525id-ce 24 : invalidityDate : Invalidity Date
526!Cname delta-crl
527id-ce 27 : deltaCRL : X509v3 Delta CRL Indicator
528!Cname crl-distribution-points
529id-ce 31 : crlDistributionPoints : X509v3 CRL Distribution Points
530!Cname certificate-policies
531id-ce 32 : certificatePolicies : X509v3 Certificate Policies
532!Cname authority-key-identifier
533id-ce 35 : authorityKeyIdentifier : X509v3 Authority Key Identifier
534!Cname ext-key-usage
535id-ce 37 : extendedKeyUsage : X509v3 Extended Key Usage
536
537!Cname netscape
5382 16 840 1 113730 : Netscape : Netscape Communications Corp.
539!Cname netscape-cert-extension
540netscape 1 : nsCertExt : Netscape Certificate Extension
541!Cname netscape-data-type
542netscape 2 : nsDataType : Netscape Data Type
543!Cname netscape-cert-type
544netscape-cert-extension 1 : nsCertType : Netscape Cert Type
545!Cname netscape-base-url
546netscape-cert-extension 2 : nsBaseUrl : Netscape Base Url
547!Cname netscape-revocation-url
548netscape-cert-extension 3 : nsRevocationUrl : Netscape Revocation Url
549!Cname netscape-ca-revocation-url
550netscape-cert-extension 4 : nsCaRevocationUrl : Netscape CA Revocation Url
551!Cname netscape-renewal-url
552netscape-cert-extension 7 : nsRenewalUrl : Netscape Renewal Url
553!Cname netscape-ca-policy-url
554netscape-cert-extension 8 : nsCaPolicyUrl : Netscape CA Policy Url
555!Cname netscape-ssl-server-name
556netscape-cert-extension 12 : nsSslServerName : Netscape SSL Server Name
557!Cname netscape-comment
558netscape-cert-extension 13 : nsComment : Netscape Comment
559!Cname netscape-cert-sequence
560netscape-data-type 5 : nsCertSequence : Netscape Certificate Sequence
561!Cname ns-sgc
562netscape 4 1 : nsSGC : Netscape Server Gated Crypto
563
564# iso(1)
565iso 3 : ORG : org
566org 6 : DOD : dod
567dod 1 : IANA : iana
568!Alias internet iana
569
570internet 1 : directory : Directory
571internet 2 : mgmt : Management
572internet 3 : experimental : Experimental
573internet 4 : private : Private
574internet 5 : security : Security
575internet 6 : snmpv2 : SNMPv2
576internet 7 : mail : Mail
577
578private 1 : enterprises : Enterprises
579
580# RFC 2247
581enterprises 1466 344 : dcobject : dcObject
582
583# Stray OIDs we don't know the full name of each step for
584# RFC 2247
5850 9 2342 19200300 100 1 25 : DC : domainComponent
5860 9 2342 19200300 100 4 13 : domain : Domain
587
588# What the hell are these OIDs, really?
589!Cname rle-compression
5901 1 1 1 666 1 : RLE : run length compression
591!Cname zlib-compression
5921 1 1 1 666 2 : ZLIB : zlib compression
35 593
36algorithm 6 : desECB
37algorithm 7 : desCBC
38algorithm 8 : desOFB
39algorithm 9 : desCFB
40algorithm 17 : desEDE2
diff --git a/src/lib/libcrypto/opensslv.h b/src/lib/libcrypto/opensslv.h
index 55ec97389f..6b5aedeea6 100644
--- a/src/lib/libcrypto/opensslv.h
+++ b/src/lib/libcrypto/opensslv.h
@@ -25,8 +25,61 @@
25 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 25 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
26 * major minor fix final patch/beta) 26 * major minor fix final patch/beta)
27 */ 27 */
28#define OPENSSL_VERSION_NUMBER 0x0090581fL 28#define OPENSSL_VERSION_NUMBER 0x0090600fL
29#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.5a 1 Apr 2000" 29#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.6 [engine] 24 Sep 2000"
30#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 30#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
31 31
32
33/* The macros below are to be used for shared library (.so, .dll, ...)
34 * versioning. That kind of versioning works a bit differently between
35 * operating systems. The most usual scheme is to set a major and a minor
36 * number, and have the runtime loader check that the major number is equal
37 * to what it was at application link time, while the minor number has to
38 * be greater or equal to what it was at application link time. With this
39 * scheme, the version number is usually part of the file name, like this:
40 *
41 * libcrypto.so.0.9
42 *
43 * Some unixen also make a softlink with the major verson number only:
44 *
45 * libcrypto.so.0
46 *
47 * On True64 it works a little bit differently. There, the shared library
48 * version is stored in the file, and is actually a series of versions,
49 * separated by colons. The rightmost version present in the library when
50 * linking an application is stored in the application to be matched at
51 * run time. When the application is run, a check is done to see if the
52 * library version stored in the application matches any of the versions
53 * in the version string of the library itself.
54 * This version string can be constructed in any way, depending on what
55 * kind of matching is desired. However, to implement the same scheme as
56 * the one used in the other unixen, all compatible versions, from lowest
57 * to highest, should be part of the string. Consecutive builds would
58 * give the following versions strings:
59 *
60 * 3.0
61 * 3.0:3.1
62 * 3.0:3.1:3.2
63 * 4.0
64 * 4.0:4.1
65 *
66 * Notice how version 4 is completely incompatible with version, and
67 * therefore give the breach you can see.
68 *
69 * There may be other schemes as well that I haven't yet discovered.
70 *
71 * So, here's the way it works here: first of all, the library version
72 * number doesn't need at all to match the overall OpenSSL version.
73 * However, it's nice and more understandable if it actually does.
74 * The current library version is stored in the macro SHLIB_VERSION_NUMBER,
75 * which is just a piece of text in the format "M.m.e" (Major, minor, edit).
76 * For the sake of True64 and any other OS that behaves in similar ways,
77 * we need to keep a history of version numbers, which is done in the
78 * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and
79 * should only keep the versions that are binary compatible with the current.
80 */
81#define SHLIB_VERSION_HISTORY ""
82#define SHLIB_VERSION_NUMBER "0.9.6"
83
84
32#endif /* HEADER_OPENSSLV_H */ 85#endif /* HEADER_OPENSSLV_H */
diff --git a/src/lib/libcrypto/pem/Makefile.ssl b/src/lib/libcrypto/pem/Makefile.ssl
index b95b2b615a..97af8255a3 100644
--- a/src/lib/libcrypto/pem/Makefile.ssl
+++ b/src/lib/libcrypto/pem/Makefile.ssl
@@ -86,25 +86,29 @@ pem_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
86pem_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 86pem_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
87pem_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 87pem_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
88pem_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 88pem_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
89pem_all.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 89pem_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
90pem_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
90pem_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 91pem_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
91pem_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 92pem_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
92pem_all.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 93pem_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
93pem_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 94pem_all.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
94pem_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 95pem_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
95pem_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 96pem_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
96pem_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 97pem_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
97pem_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 98pem_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
99pem_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
98pem_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 100pem_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
99pem_all.o: ../cryptlib.h 101pem_all.o: ../cryptlib.h
100pem_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 102pem_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
101pem_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 103pem_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
102pem_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 104pem_err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
103pem_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h 105pem_err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
104pem_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 106pem_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
105pem_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 107pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
106pem_err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 108pem_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
107pem_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 109pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
110pem_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
111pem_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
108pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 112pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
109pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 113pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
110pem_err.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 114pem_err.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
@@ -112,7 +116,8 @@ pem_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
112pem_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 116pem_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
113pem_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 117pem_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
114pem_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 118pem_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
115pem_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 119pem_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
120pem_err.o: ../../include/openssl/x509_vfy.h
116pem_info.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 121pem_info.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
117pem_info.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 122pem_info.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
118pem_info.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 123pem_info.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -120,17 +125,19 @@ pem_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
120pem_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 125pem_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
121pem_info.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 126pem_info.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
122pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h 127pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
123pem_info.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 128pem_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
129pem_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
124pem_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 130pem_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
125pem_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 131pem_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
132pem_info.o: ../../include/openssl/opensslconf.h
126pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 133pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
127pem_info.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 134pem_info.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
128pem_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 135pem_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
129pem_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 136pem_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
130pem_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 137pem_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
131pem_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 138pem_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
132pem_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 139pem_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
133pem_info.o: ../cryptlib.h 140pem_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
134pem_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 141pem_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
135pem_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 142pem_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
136pem_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 143pem_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -138,16 +145,18 @@ pem_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
138pem_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 145pem_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
139pem_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 146pem_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
140pem_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h 147pem_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
141pem_lib.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 148pem_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
149pem_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
142pem_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 150pem_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
143pem_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 151pem_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
144pem_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 152pem_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
145pem_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h 153pem_lib.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
146pem_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h 154pem_lib.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
147pem_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 155pem_lib.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
148pem_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 156pem_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
149pem_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 157pem_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
150pem_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 158pem_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
159pem_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
151pem_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 160pem_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
152pem_lib.o: ../cryptlib.h 161pem_lib.o: ../cryptlib.h
153pem_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 162pem_seal.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -157,17 +166,20 @@ pem_seal.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
157pem_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 166pem_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
158pem_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 167pem_seal.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
159pem_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h 168pem_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h
160pem_seal.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 169pem_seal.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
170pem_seal.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
161pem_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 171pem_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
162pem_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 172pem_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
173pem_seal.o: ../../include/openssl/opensslconf.h
163pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 174pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
164pem_seal.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 175pem_seal.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
165pem_seal.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 176pem_seal.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
166pem_seal.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 177pem_seal.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
167pem_seal.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 178pem_seal.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
168pem_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 179pem_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
169pem_seal.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 180pem_seal.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
170pem_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 181pem_seal.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
182pem_seal.o: ../cryptlib.h
171pem_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 183pem_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
172pem_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 184pem_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
173pem_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 185pem_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -175,14 +187,17 @@ pem_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
175pem_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 187pem_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
176pem_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 188pem_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
177pem_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h 189pem_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
178pem_sign.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 190pem_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
191pem_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
179pem_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 192pem_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
180pem_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 193pem_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
194pem_sign.o: ../../include/openssl/opensslconf.h
181pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 195pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
182pem_sign.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 196pem_sign.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
183pem_sign.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 197pem_sign.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
184pem_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 198pem_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
185pem_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 199pem_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
186pem_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 200pem_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
187pem_sign.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 201pem_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
188pem_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 202pem_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
203pem_sign.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/pem/pem.h b/src/lib/libcrypto/pem/pem.h
index e4bae0b4aa..6d3c446577 100644
--- a/src/lib/libcrypto/pem/pem.h
+++ b/src/lib/libcrypto/pem/pem.h
@@ -59,14 +59,20 @@
59#ifndef HEADER_PEM_H 59#ifndef HEADER_PEM_H
60#define HEADER_PEM_H 60#define HEADER_PEM_H
61 61
62#ifdef __cplusplus 62#ifndef NO_BIO
63extern "C" { 63#include <openssl/bio.h>
64#endif
65#ifndef NO_STACK
66#include <openssl/stack.h>
64#endif 67#endif
65
66#include <openssl/evp.h> 68#include <openssl/evp.h>
67#include <openssl/x509.h> 69#include <openssl/x509.h>
68#include <openssl/pem2.h> 70#include <openssl/pem2.h>
69 71
72#ifdef __cplusplus
73extern "C" {
74#endif
75
70#define PEM_BUFSIZE 1024 76#define PEM_BUFSIZE 1024
71 77
72#define PEM_OBJ_UNDEF 0 78#define PEM_OBJ_UNDEF 0
@@ -165,7 +171,7 @@ typedef struct pem_ctx_st
165 int num_recipient; 171 int num_recipient;
166 PEM_USER **recipient; 172 PEM_USER **recipient;
167 173
168#ifdef HEADER_STACK_H 174#ifndef NO_STACK
169 STACK *x509_chain; /* certificate chain */ 175 STACK *x509_chain; /* certificate chain */
170#else 176#else
171 char *x509_chain; /* certificate chain */ 177 char *x509_chain; /* certificate chain */
@@ -289,7 +295,7 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
289 295
290#endif 296#endif
291 297
292#ifdef HEADER_BIO_H 298#ifndef NO_BIO
293#define DECLARE_PEM_read_bio(name, type) \ 299#define DECLARE_PEM_read_bio(name, type) \
294 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); 300 type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);
295 301
@@ -477,7 +483,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);
477int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, 483int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len,
478 pem_password_cb *callback,void *u); 484 pem_password_cb *callback,void *u);
479 485
480#ifdef HEADER_BIO_H 486#ifndef NO_BIO
481int PEM_read_bio(BIO *bp, char **name, char **header, 487int PEM_read_bio(BIO *bp, char **name, char **header,
482 unsigned char **data,long *len); 488 unsigned char **data,long *len);
483int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data, 489int PEM_write_bio(BIO *bp,const char *name,char *hdr,unsigned char *data,
@@ -525,9 +531,7 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str);
525 531
526#ifndef SSLEAY_MACROS 532#ifndef SSLEAY_MACROS
527 533
528#ifdef VMS 534#include <openssl/symhacks.h>
529#include <openssl/vms_idhacks.h>
530#endif
531 535
532DECLARE_PEM_rw(X509, X509) 536DECLARE_PEM_rw(X509, X509)
533 537
diff --git a/src/lib/libcrypto/pem/pem2.h b/src/lib/libcrypto/pem/pem2.h
index 4a016aacd2..4e484bcd82 100644
--- a/src/lib/libcrypto/pem/pem2.h
+++ b/src/lib/libcrypto/pem/pem2.h
@@ -57,4 +57,12 @@
57 * Ben 30 Jan 1999. 57 * Ben 30 Jan 1999.
58 */ 58 */
59 59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
60void ERR_load_PEM_strings(void); 64void ERR_load_PEM_strings(void);
65
66#ifdef __cplusplus
67}
68#endif
diff --git a/src/lib/libcrypto/pem/pem_info.c b/src/lib/libcrypto/pem/pem_info.c
index b65239a920..1c5c6dea00 100644
--- a/src/lib/libcrypto/pem/pem_info.c
+++ b/src/lib/libcrypto/pem/pem_info.c
@@ -237,9 +237,9 @@ start:
237 else { 237 else {
238 /* unknown */ 238 /* unknown */
239 } 239 }
240 if (name != NULL) Free(name); 240 if (name != NULL) OPENSSL_free(name);
241 if (header != NULL) Free(header); 241 if (header != NULL) OPENSSL_free(header);
242 if (data != NULL) Free(data); 242 if (data != NULL) OPENSSL_free(data);
243 name=NULL; 243 name=NULL;
244 header=NULL; 244 header=NULL;
245 data=NULL; 245 data=NULL;
@@ -268,9 +268,9 @@ err:
268 ret=NULL; 268 ret=NULL;
269 } 269 }
270 270
271 if (name != NULL) Free(name); 271 if (name != NULL) OPENSSL_free(name);
272 if (header != NULL) Free(header); 272 if (header != NULL) OPENSSL_free(header);
273 if (data != NULL) Free(data); 273 if (data != NULL) OPENSSL_free(data);
274 return(ret); 274 return(ret);
275 } 275 }
276 276
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index b5e0a650f8..a17c3ed57f 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -242,9 +242,9 @@ char *PEM_ASN1_read_bio(char *(*d2i)(), const char *name, BIO *bp, char **x,
242 return(NULL); 242 return(NULL);
243 } 243 }
244 if(check_pem(nm, name)) break; 244 if(check_pem(nm, name)) break;
245 Free(nm); 245 OPENSSL_free(nm);
246 Free(header); 246 OPENSSL_free(header);
247 Free(data); 247 OPENSSL_free(data);
248 } 248 }
249 if (!PEM_get_EVP_CIPHER_INFO(header,&cipher)) goto err; 249 if (!PEM_get_EVP_CIPHER_INFO(header,&cipher)) goto err;
250 if (!PEM_do_header(&cipher,data,&len,cb,u)) goto err; 250 if (!PEM_do_header(&cipher,data,&len,cb,u)) goto err;
@@ -289,9 +289,9 @@ p8err:
289 if (ret == NULL) 289 if (ret == NULL)
290 PEMerr(PEM_F_PEM_ASN1_READ_BIO,ERR_R_ASN1_LIB); 290 PEMerr(PEM_F_PEM_ASN1_READ_BIO,ERR_R_ASN1_LIB);
291err: 291err:
292 Free(nm); 292 OPENSSL_free(nm);
293 Free(header); 293 OPENSSL_free(header);
294 Free(data); 294 OPENSSL_free(data);
295 return(ret); 295 return(ret);
296 } 296 }
297 297
@@ -344,7 +344,7 @@ int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x,
344 goto err; 344 goto err;
345 } 345 }
346 /* dzise + 8 bytes are needed */ 346 /* dzise + 8 bytes are needed */
347 data=(unsigned char *)Malloc((unsigned int)dsize+20); 347 data=(unsigned char *)OPENSSL_malloc((unsigned int)dsize+20);
348 if (data == NULL) 348 if (data == NULL)
349 { 349 {
350 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_MALLOC_FAILURE); 350 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_MALLOC_FAILURE);
@@ -405,7 +405,7 @@ err:
405 memset((char *)&ctx,0,sizeof(ctx)); 405 memset((char *)&ctx,0,sizeof(ctx));
406 memset(buf,0,PEM_BUFSIZE); 406 memset(buf,0,PEM_BUFSIZE);
407 memset(data,0,(unsigned int)dsize); 407 memset(data,0,(unsigned int)dsize);
408 Free(data); 408 OPENSSL_free(data);
409 return(ret); 409 return(ret);
410 } 410 }
411 411
@@ -583,7 +583,7 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
583 goto err; 583 goto err;
584 } 584 }
585 585
586 buf=(unsigned char *)Malloc(PEM_BUFSIZE*8); 586 buf=(unsigned char *)OPENSSL_malloc(PEM_BUFSIZE*8);
587 if (buf == NULL) 587 if (buf == NULL)
588 { 588 {
589 reason=ERR_R_MALLOC_FAILURE; 589 reason=ERR_R_MALLOC_FAILURE;
@@ -603,7 +603,7 @@ int PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data,
603 } 603 }
604 EVP_EncodeFinal(&ctx,buf,&outl); 604 EVP_EncodeFinal(&ctx,buf,&outl);
605 if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err; 605 if ((outl > 0) && (BIO_write(bp,(char *)buf,outl) != outl)) goto err;
606 Free(buf); 606 OPENSSL_free(buf);
607 if ( (BIO_write(bp,"-----END ",9) != 9) || 607 if ( (BIO_write(bp,"-----END ",9) != 9) ||
608 (BIO_write(bp,name,nlen) != nlen) || 608 (BIO_write(bp,name,nlen) != nlen) ||
609 (BIO_write(bp,"-----\n",6) != 6)) 609 (BIO_write(bp,"-----\n",6) != 6))
@@ -784,9 +784,9 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,
784 *header=headerB->data; 784 *header=headerB->data;
785 *data=(unsigned char *)dataB->data; 785 *data=(unsigned char *)dataB->data;
786 *len=bl; 786 *len=bl;
787 Free(nameB); 787 OPENSSL_free(nameB);
788 Free(headerB); 788 OPENSSL_free(headerB);
789 Free(dataB); 789 OPENSSL_free(dataB);
790 return(1); 790 return(1);
791err: 791err:
792 BUF_MEM_free(nameB); 792 BUF_MEM_free(nameB);
diff --git a/src/lib/libcrypto/pem/pem_seal.c b/src/lib/libcrypto/pem/pem_seal.c
index 126e29d375..2a6c513348 100644
--- a/src/lib/libcrypto/pem/pem_seal.c
+++ b/src/lib/libcrypto/pem/pem_seal.c
@@ -84,7 +84,7 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
84 j=RSA_size(pubk[i]->pkey.rsa); 84 j=RSA_size(pubk[i]->pkey.rsa);
85 if (j > max) max=j; 85 if (j > max) max=j;
86 } 86 }
87 s=(char *)Malloc(max*2); 87 s=(char *)OPENSSL_malloc(max*2);
88 if (s == NULL) 88 if (s == NULL)
89 { 89 {
90 PEMerr(PEM_F_PEM_SEALINIT,ERR_R_MALLOC_FAILURE); 90 PEMerr(PEM_F_PEM_SEALINIT,ERR_R_MALLOC_FAILURE);
@@ -108,7 +108,7 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
108 108
109 ret=npubk; 109 ret=npubk;
110err: 110err:
111 if (s != NULL) Free(s); 111 if (s != NULL) OPENSSL_free(s);
112 memset(key,0,EVP_MAX_KEY_LENGTH); 112 memset(key,0,EVP_MAX_KEY_LENGTH);
113 return(ret); 113 return(ret);
114 } 114 }
@@ -151,7 +151,7 @@ int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,
151 } 151 }
152 i=RSA_size(priv->pkey.rsa); 152 i=RSA_size(priv->pkey.rsa);
153 if (i < 100) i=100; 153 if (i < 100) i=100;
154 s=(unsigned char *)Malloc(i*2); 154 s=(unsigned char *)OPENSSL_malloc(i*2);
155 if (s == NULL) 155 if (s == NULL)
156 { 156 {
157 PEMerr(PEM_F_PEM_SEALFINAL,ERR_R_MALLOC_FAILURE); 157 PEMerr(PEM_F_PEM_SEALFINAL,ERR_R_MALLOC_FAILURE);
@@ -172,7 +172,7 @@ int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,
172err: 172err:
173 memset((char *)&(ctx->md),0,sizeof(ctx->md)); 173 memset((char *)&(ctx->md),0,sizeof(ctx->md));
174 memset((char *)&(ctx->cipher),0,sizeof(ctx->cipher)); 174 memset((char *)&(ctx->cipher),0,sizeof(ctx->cipher));
175 if (s != NULL) Free(s); 175 if (s != NULL) OPENSSL_free(s);
176 return(ret); 176 return(ret);
177 } 177 }
178#else /* !NO_RSA */ 178#else /* !NO_RSA */
diff --git a/src/lib/libcrypto/pem/pem_sign.c b/src/lib/libcrypto/pem/pem_sign.c
index aabafb702d..42d598dd78 100644
--- a/src/lib/libcrypto/pem/pem_sign.c
+++ b/src/lib/libcrypto/pem/pem_sign.c
@@ -82,7 +82,7 @@ int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
82 int i,ret=0; 82 int i,ret=0;
83 unsigned int m_len; 83 unsigned int m_len;
84 84
85 m=(unsigned char *)Malloc(EVP_PKEY_size(pkey)+2); 85 m=(unsigned char *)OPENSSL_malloc(EVP_PKEY_size(pkey)+2);
86 if (m == NULL) 86 if (m == NULL)
87 { 87 {
88 PEMerr(PEM_F_PEM_SIGNFINAL,ERR_R_MALLOC_FAILURE); 88 PEMerr(PEM_F_PEM_SIGNFINAL,ERR_R_MALLOC_FAILURE);
@@ -96,7 +96,7 @@ int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
96 ret=1; 96 ret=1;
97err: 97err:
98 /* ctx has been zeroed by EVP_SignFinal() */ 98 /* ctx has been zeroed by EVP_SignFinal() */
99 if (m != NULL) Free(m); 99 if (m != NULL) OPENSSL_free(m);
100 return(ret); 100 return(ret);
101 } 101 }
102 102
diff --git a/src/lib/libcrypto/pkcs12/Makefile.ssl b/src/lib/libcrypto/pkcs12/Makefile.ssl
index 5716f608b6..67869f204f 100644
--- a/src/lib/libcrypto/pkcs12/Makefile.ssl
+++ b/src/lib/libcrypto/pkcs12/Makefile.ssl
@@ -91,15 +91,17 @@ p12_add.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
91p12_add.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 91p12_add.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
92p12_add.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 92p12_add.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
93p12_add.o: ../../include/openssl/err.h ../../include/openssl/evp.h 93p12_add.o: ../../include/openssl/err.h ../../include/openssl/evp.h
94p12_add.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 94p12_add.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
95p12_add.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
95p12_add.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 96p12_add.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
96p12_add.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 97p12_add.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
97p12_add.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 98p12_add.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
98p12_add.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 99p12_add.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
99p12_add.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 100p12_add.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
100p12_add.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 101p12_add.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
101p12_add.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 102p12_add.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
102p12_add.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 103p12_add.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
104p12_add.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
103p12_add.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 105p12_add.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
104p12_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 106p12_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
105p12_attr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 107p12_attr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -108,16 +110,19 @@ p12_attr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
108p12_attr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 110p12_attr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
109p12_attr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 111p12_attr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
110p12_attr.o: ../../include/openssl/err.h ../../include/openssl/evp.h 112p12_attr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
111p12_attr.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 113p12_attr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
114p12_attr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
112p12_attr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 115p12_attr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
113p12_attr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 116p12_attr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
117p12_attr.o: ../../include/openssl/opensslconf.h
114p12_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 118p12_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
115p12_attr.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 119p12_attr.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
116p12_attr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 120p12_attr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
117p12_attr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 121p12_attr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
118p12_attr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 122p12_attr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
119p12_attr.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 123p12_attr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
120p12_attr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 124p12_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
125p12_attr.o: ../cryptlib.h
121p12_bags.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 126p12_bags.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
122p12_bags.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 127p12_bags.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
123p12_bags.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 128p12_bags.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -126,16 +131,18 @@ p12_bags.o: ../../include/openssl/des.h ../../include/openssl/dh.h
126p12_bags.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 131p12_bags.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
127p12_bags.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 132p12_bags.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
128p12_bags.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 133p12_bags.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
129p12_bags.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 134p12_bags.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
130p12_bags.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 135p12_bags.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
131p12_bags.o: ../../include/openssl/opensslconf.h 136p12_bags.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
137p12_bags.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
132p12_bags.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 138p12_bags.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
133p12_bags.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 139p12_bags.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
134p12_bags.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 140p12_bags.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
135p12_bags.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 141p12_bags.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
136p12_bags.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 142p12_bags.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
137p12_bags.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 143p12_bags.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
138p12_bags.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 144p12_bags.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
145p12_bags.o: ../cryptlib.h
139p12_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 146p12_crpt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
140p12_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 147p12_crpt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
141p12_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 148p12_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -143,16 +150,19 @@ p12_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
143p12_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 150p12_crpt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
144p12_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 151p12_crpt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
145p12_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h 152p12_crpt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
146p12_crpt.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 153p12_crpt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
154p12_crpt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
147p12_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 155p12_crpt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
148p12_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 156p12_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
157p12_crpt.o: ../../include/openssl/opensslconf.h
149p12_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 158p12_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
150p12_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 159p12_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
151p12_crpt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 160p12_crpt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
152p12_crpt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 161p12_crpt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
153p12_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 162p12_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
154p12_crpt.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 163p12_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
155p12_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 164p12_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
165p12_crpt.o: ../cryptlib.h
156p12_crt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 166p12_crt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
157p12_crt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 167p12_crt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
158p12_crt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 168p12_crt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -160,15 +170,17 @@ p12_crt.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
160p12_crt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 170p12_crt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
161p12_crt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 171p12_crt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
162p12_crt.o: ../../include/openssl/err.h ../../include/openssl/evp.h 172p12_crt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
163p12_crt.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 173p12_crt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
174p12_crt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
164p12_crt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 175p12_crt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
165p12_crt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 176p12_crt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
166p12_crt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 177p12_crt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
167p12_crt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 178p12_crt.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
168p12_crt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 179p12_crt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
169p12_crt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 180p12_crt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
170p12_crt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 181p12_crt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
171p12_crt.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 182p12_crt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
183p12_crt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
172p12_crt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 184p12_crt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
173p12_decr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 185p12_decr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
174p12_decr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 186p12_decr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -177,16 +189,19 @@ p12_decr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
177p12_decr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 189p12_decr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
178p12_decr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 190p12_decr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
179p12_decr.o: ../../include/openssl/err.h ../../include/openssl/evp.h 191p12_decr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
180p12_decr.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 192p12_decr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
193p12_decr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
181p12_decr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 194p12_decr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
182p12_decr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 195p12_decr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
196p12_decr.o: ../../include/openssl/opensslconf.h
183p12_decr.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 197p12_decr.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
184p12_decr.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 198p12_decr.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
185p12_decr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 199p12_decr.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
186p12_decr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 200p12_decr.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
187p12_decr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 201p12_decr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
188p12_decr.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 202p12_decr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
189p12_decr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 203p12_decr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
204p12_decr.o: ../cryptlib.h
190p12_init.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 205p12_init.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
191p12_init.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 206p12_init.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
192p12_init.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 207p12_init.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -194,16 +209,19 @@ p12_init.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
194p12_init.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 209p12_init.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
195p12_init.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 210p12_init.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
196p12_init.o: ../../include/openssl/err.h ../../include/openssl/evp.h 211p12_init.o: ../../include/openssl/err.h ../../include/openssl/evp.h
197p12_init.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 212p12_init.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
213p12_init.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
198p12_init.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 214p12_init.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
199p12_init.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 215p12_init.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
216p12_init.o: ../../include/openssl/opensslconf.h
200p12_init.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 217p12_init.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
201p12_init.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 218p12_init.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
202p12_init.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 219p12_init.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
203p12_init.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 220p12_init.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
204p12_init.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 221p12_init.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
205p12_init.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 222p12_init.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
206p12_init.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 223p12_init.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
224p12_init.o: ../cryptlib.h
207p12_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 225p12_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
208p12_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 226p12_key.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
209p12_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 227p12_key.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -211,15 +229,17 @@ p12_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
211p12_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 229p12_key.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
212p12_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 230p12_key.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
213p12_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h 231p12_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h
214p12_key.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 232p12_key.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
233p12_key.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
215p12_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 234p12_key.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
216p12_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 235p12_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
217p12_key.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 236p12_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
218p12_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 237p12_key.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
219p12_key.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 238p12_key.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
220p12_key.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 239p12_key.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
221p12_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 240p12_key.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
222p12_key.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 241p12_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
242p12_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
223p12_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 243p12_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
224p12_kiss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 244p12_kiss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
225p12_kiss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 245p12_kiss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
@@ -228,16 +248,19 @@ p12_kiss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
228p12_kiss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 248p12_kiss.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
229p12_kiss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 249p12_kiss.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
230p12_kiss.o: ../../include/openssl/err.h ../../include/openssl/evp.h 250p12_kiss.o: ../../include/openssl/err.h ../../include/openssl/evp.h
231p12_kiss.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 251p12_kiss.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
252p12_kiss.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
232p12_kiss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 253p12_kiss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
233p12_kiss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 254p12_kiss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
255p12_kiss.o: ../../include/openssl/opensslconf.h
234p12_kiss.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 256p12_kiss.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
235p12_kiss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 257p12_kiss.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
236p12_kiss.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 258p12_kiss.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
237p12_kiss.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 259p12_kiss.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
238p12_kiss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 260p12_kiss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
239p12_kiss.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 261p12_kiss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
240p12_kiss.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 262p12_kiss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
263p12_kiss.o: ../cryptlib.h
241p12_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 264p12_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
242p12_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 265p12_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
243p12_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 266p12_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -246,14 +269,16 @@ p12_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
246p12_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 269p12_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
247p12_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 270p12_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
248p12_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 271p12_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
249p12_lib.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 272p12_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
250p12_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 273p12_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
251p12_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 274p12_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
252p12_lib.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h 275p12_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
253p12_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 276p12_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
254p12_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 277p12_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
255p12_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 278p12_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
256p12_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 279p12_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
280p12_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
281p12_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
257p12_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 282p12_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
258p12_lib.o: ../cryptlib.h 283p12_lib.o: ../cryptlib.h
259p12_mac.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 284p12_mac.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -264,14 +289,16 @@ p12_mac.o: ../../include/openssl/des.h ../../include/openssl/dh.h
264p12_mac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 289p12_mac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
265p12_mac.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 290p12_mac.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
266p12_mac.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 291p12_mac.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
267p12_mac.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 292p12_mac.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
268p12_mac.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 293p12_mac.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
269p12_mac.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 294p12_mac.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
270p12_mac.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h 295p12_mac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
271p12_mac.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 296p12_mac.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
272p12_mac.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 297p12_mac.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
273p12_mac.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 298p12_mac.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
274p12_mac.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 299p12_mac.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
300p12_mac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
301p12_mac.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
275p12_mac.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 302p12_mac.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
276p12_mac.o: ../cryptlib.h 303p12_mac.o: ../cryptlib.h
277p12_mutl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 304p12_mutl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -282,25 +309,28 @@ p12_mutl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
282p12_mutl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 309p12_mutl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
283p12_mutl.o: ../../include/openssl/err.h ../../include/openssl/evp.h 310p12_mutl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
284p12_mutl.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h 311p12_mutl.o: ../../include/openssl/hmac.h ../../include/openssl/idea.h
285p12_mutl.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 312p12_mutl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
286p12_mutl.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 313p12_mutl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
287p12_mutl.o: ../../include/openssl/opensslconf.h 314p12_mutl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
315p12_mutl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
288p12_mutl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 316p12_mutl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
289p12_mutl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h 317p12_mutl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
290p12_mutl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 318p12_mutl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
291p12_mutl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 319p12_mutl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
292p12_mutl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 320p12_mutl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
293p12_mutl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 321p12_mutl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
294p12_mutl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 322p12_mutl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
295p12_mutl.o: ../cryptlib.h 323p12_mutl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
296p12_npas.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 324p12_npas.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
297p12_npas.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 325p12_npas.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
298p12_npas.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 326p12_npas.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
299p12_npas.o: ../../include/openssl/des.h ../../include/openssl/dh.h 327p12_npas.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
300p12_npas.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 328p12_npas.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
301p12_npas.o: ../../include/openssl/err.h ../../include/openssl/evp.h 329p12_npas.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
302p12_npas.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 330p12_npas.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
303p12_npas.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 331p12_npas.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
332p12_npas.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
333p12_npas.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
304p12_npas.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 334p12_npas.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
305p12_npas.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 335p12_npas.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
306p12_npas.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h 336p12_npas.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
@@ -308,8 +338,8 @@ p12_npas.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
308p12_npas.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 338p12_npas.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
309p12_npas.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 339p12_npas.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
310p12_npas.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 340p12_npas.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
311p12_npas.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 341p12_npas.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
312p12_npas.o: ../../include/openssl/x509_vfy.h 342p12_npas.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
313p12_sbag.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 343p12_sbag.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
314p12_sbag.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 344p12_sbag.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
315p12_sbag.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 345p12_sbag.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -318,16 +348,18 @@ p12_sbag.o: ../../include/openssl/des.h ../../include/openssl/dh.h
318p12_sbag.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 348p12_sbag.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
319p12_sbag.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 349p12_sbag.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
320p12_sbag.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 350p12_sbag.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
321p12_sbag.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 351p12_sbag.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
322p12_sbag.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 352p12_sbag.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
323p12_sbag.o: ../../include/openssl/opensslconf.h 353p12_sbag.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
354p12_sbag.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
324p12_sbag.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 355p12_sbag.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
325p12_sbag.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 356p12_sbag.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
326p12_sbag.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 357p12_sbag.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
327p12_sbag.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 358p12_sbag.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
328p12_sbag.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 359p12_sbag.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
329p12_sbag.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 360p12_sbag.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
330p12_sbag.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 361p12_sbag.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
362p12_sbag.o: ../cryptlib.h
331p12_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 363p12_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
332p12_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 364p12_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
333p12_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 365p12_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -335,29 +367,33 @@ p12_utl.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
335p12_utl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 367p12_utl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
336p12_utl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 368p12_utl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
337p12_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h 369p12_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
338p12_utl.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 370p12_utl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
371p12_utl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
339p12_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 372p12_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
340p12_utl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 373p12_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
341p12_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 374p12_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
342p12_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 375p12_utl.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
343p12_utl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 376p12_utl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
344p12_utl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 377p12_utl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
345p12_utl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 378p12_utl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
346p12_utl.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 379p12_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
380p12_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
347p12_utl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 381p12_utl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
348pk12err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 382pk12err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
349pk12err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 383pk12err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
350pk12err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 384pk12err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
351pk12err.o: ../../include/openssl/des.h ../../include/openssl/dh.h 385pk12err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
352pk12err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 386pk12err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
353pk12err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 387pk12err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
354pk12err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 388pk12err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
355pk12err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 389pk12err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
390pk12err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
391pk12err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
356pk12err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 392pk12err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
357pk12err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h 393pk12err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs12.h
358pk12err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 394pk12err.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
359pk12err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 395pk12err.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
360pk12err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 396pk12err.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
361pk12err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 397pk12err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
362pk12err.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 398pk12err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
363pk12err.o: ../../include/openssl/x509_vfy.h 399pk12err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
diff --git a/src/lib/libcrypto/pkcs12/p12_add.c b/src/lib/libcrypto/pkcs12/p12_add.c
index d045cbba8d..b563656895 100644
--- a/src/lib/libcrypto/pkcs12/p12_add.c
+++ b/src/lib/libcrypto/pkcs12/p12_add.c
@@ -125,7 +125,7 @@ PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG (int pbe_nid, const char *pass,
125} 125}
126 126
127/* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */ 127/* Turn a stack of SAFEBAGS into a PKCS#7 data Contentinfo */
128PKCS7 *PKCS12_pack_p7data (STACK *sk) 128PKCS7 *PKCS12_pack_p7data (STACK_OF(PKCS12_SAFEBAG) *sk)
129{ 129{
130 PKCS7 *p7; 130 PKCS7 *p7;
131 if (!(p7 = PKCS7_new())) { 131 if (!(p7 = PKCS7_new())) {
@@ -138,8 +138,9 @@ PKCS7 *PKCS12_pack_p7data (STACK *sk)
138 return NULL; 138 return NULL;
139 } 139 }
140 140
141 if (!ASN1_seq_pack(sk, i2d_PKCS12_SAFEBAG, &p7->d.data->data, 141 if (!ASN1_seq_pack_PKCS12_SAFEBAG(sk, i2d_PKCS12_SAFEBAG,
142 &p7->d.data->length)) { 142 &p7->d.data->data,
143 &p7->d.data->length)) {
143 PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE); 144 PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE);
144 return NULL; 145 return NULL;
145 } 146 }
@@ -149,7 +150,8 @@ PKCS7 *PKCS12_pack_p7data (STACK *sk)
149/* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */ 150/* Turn a stack of SAFEBAGS into a PKCS#7 encrypted data ContentInfo */
150 151
151PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen, 152PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen,
152 unsigned char *salt, int saltlen, int iter, STACK *bags) 153 unsigned char *salt, int saltlen, int iter,
154 STACK_OF(PKCS12_SAFEBAG) *bags)
153{ 155{
154 PKCS7 *p7; 156 PKCS7 *p7;
155 X509_ALGOR *pbe; 157 X509_ALGOR *pbe;
diff --git a/src/lib/libcrypto/pkcs12/p12_attr.c b/src/lib/libcrypto/pkcs12/p12_attr.c
index f559351d18..f1a210b5d2 100644
--- a/src/lib/libcrypto/pkcs12/p12_attr.c
+++ b/src/lib/libcrypto/pkcs12/p12_attr.c
@@ -87,13 +87,13 @@ int PKCS12_add_localkeyid (PKCS12_SAFEBAG *bag, unsigned char *name,
87 return 0; 87 return 0;
88 } 88 }
89 attrib->object = OBJ_nid2obj(NID_localKeyID); 89 attrib->object = OBJ_nid2obj(NID_localKeyID);
90 if (!(attrib->value.set = sk_ASN1_TYPE_new(NULL))) { 90 if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) {
91 PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); 91 PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
92 return 0; 92 return 0;
93 } 93 }
94 sk_ASN1_TYPE_push (attrib->value.set,keyid); 94 sk_ASN1_TYPE_push (attrib->value.set,keyid);
95 attrib->set = 1; 95 attrib->set = 1;
96 if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new (NULL))) { 96 if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) {
97 PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE); 97 PKCS12err(PKCS12_F_PKCS12_ADD_LOCALKEYID, ERR_R_MALLOC_FAILURE);
98 return 0; 98 return 0;
99 } 99 }
@@ -129,14 +129,14 @@ int PKCS8_add_keyusage (PKCS8_PRIV_KEY_INFO *p8, int usage)
129 return 0; 129 return 0;
130 } 130 }
131 attrib->object = OBJ_nid2obj(NID_key_usage); 131 attrib->object = OBJ_nid2obj(NID_key_usage);
132 if (!(attrib->value.set = sk_ASN1_TYPE_new(NULL))) { 132 if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) {
133 PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); 133 PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
134 return 0; 134 return 0;
135 } 135 }
136 sk_ASN1_TYPE_push (attrib->value.set,keyid); 136 sk_ASN1_TYPE_push (attrib->value.set,keyid);
137 attrib->set = 1; 137 attrib->set = 1;
138 if (!p8->attributes 138 if (!p8->attributes
139 && !(p8->attributes = sk_X509_ATTRIBUTE_new (NULL))) { 139 && !(p8->attributes = sk_X509_ATTRIBUTE_new_null ())) {
140 PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE); 140 PKCS12err(PKCS12_F_PKCS8_ADD_KEYUSAGE, ERR_R_MALLOC_FAILURE);
141 return 0; 141 return 0;
142 } 142 }
@@ -157,7 +157,7 @@ int PKCS12_add_friendlyname_asc (PKCS12_SAFEBAG *bag, const char *name,
157 return 0; 157 return 0;
158 } 158 }
159 ret = PKCS12_add_friendlyname_uni (bag, uniname, unilen); 159 ret = PKCS12_add_friendlyname_uni (bag, uniname, unilen);
160 Free(uniname); 160 OPENSSL_free(uniname);
161 return ret; 161 return ret;
162} 162}
163 163
@@ -181,7 +181,7 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag,
181 ERR_R_MALLOC_FAILURE); 181 ERR_R_MALLOC_FAILURE);
182 return 0; 182 return 0;
183 } 183 }
184 if (!(bmp->data = Malloc (namelen))) { 184 if (!(bmp->data = OPENSSL_malloc (namelen))) {
185 PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, 185 PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI,
186 ERR_R_MALLOC_FAILURE); 186 ERR_R_MALLOC_FAILURE);
187 return 0; 187 return 0;
@@ -195,14 +195,14 @@ int PKCS12_add_friendlyname_uni (PKCS12_SAFEBAG *bag,
195 return 0; 195 return 0;
196 } 196 }
197 attrib->object = OBJ_nid2obj(NID_friendlyName); 197 attrib->object = OBJ_nid2obj(NID_friendlyName);
198 if (!(attrib->value.set = sk_ASN1_TYPE_new(NULL))) { 198 if (!(attrib->value.set = sk_ASN1_TYPE_new_null())) {
199 PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME, 199 PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME,
200 ERR_R_MALLOC_FAILURE); 200 ERR_R_MALLOC_FAILURE);
201 return 0; 201 return 0;
202 } 202 }
203 sk_ASN1_TYPE_push (attrib->value.set,fname); 203 sk_ASN1_TYPE_push (attrib->value.set,fname);
204 attrib->set = 1; 204 attrib->set = 1;
205 if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new (NULL))) { 205 if (!bag->attrib && !(bag->attrib = sk_X509_ATTRIBUTE_new_null ())) {
206 PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI, 206 PKCS12err(PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI,
207 ERR_R_MALLOC_FAILURE); 207 ERR_R_MALLOC_FAILURE);
208 return 0; 208 return 0;
diff --git a/src/lib/libcrypto/pkcs12/p12_bags.c b/src/lib/libcrypto/pkcs12/p12_bags.c
index c358b06735..56547ef933 100644
--- a/src/lib/libcrypto/pkcs12/p12_bags.c
+++ b/src/lib/libcrypto/pkcs12/p12_bags.c
@@ -188,5 +188,5 @@ void PKCS12_BAGS_free (PKCS12_BAGS *a)
188 } 188 }
189 189
190 ASN1_OBJECT_free (a->type); 190 ASN1_OBJECT_free (a->type);
191 Free (a); 191 OPENSSL_free (a);
192} 192}
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c
index ee8aed54c7..a8f7b48882 100644
--- a/src/lib/libcrypto/pkcs12/p12_crt.c
+++ b/src/lib/libcrypto/pkcs12/p12_crt.c
@@ -65,7 +65,8 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
65 int keytype) 65 int keytype)
66{ 66{
67 PKCS12 *p12; 67 PKCS12 *p12;
68 STACK *bags, *safes; 68 STACK_OF(PKCS12_SAFEBAG) *bags;
69 STACK_OF(PKCS7) *safes;
69 PKCS12_SAFEBAG *bag; 70 PKCS12_SAFEBAG *bag;
70 PKCS8_PRIV_KEY_INFO *p8; 71 PKCS8_PRIV_KEY_INFO *p8;
71 PKCS7 *authsafe; 72 PKCS7 *authsafe;
@@ -85,7 +86,9 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
85 return NULL; 86 return NULL;
86 } 87 }
87 88
88 if(!(bags = sk_new (NULL))) { 89 if(!X509_check_private_key(cert, pkey)) return NULL;
90
91 if(!(bags = sk_PKCS12_SAFEBAG_new_null ())) {
89 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); 92 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
90 return NULL; 93 return NULL;
91 } 94 }
@@ -96,7 +99,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
96 X509_digest(cert, EVP_sha1(), keyid, &keyidlen); 99 X509_digest(cert, EVP_sha1(), keyid, &keyidlen);
97 if(!PKCS12_add_localkeyid(bag, keyid, keyidlen)) return NULL; 100 if(!PKCS12_add_localkeyid(bag, keyid, keyidlen)) return NULL;
98 101
99 if(!sk_push(bags, (char *)bag)) { 102 if(!sk_PKCS12_SAFEBAG_push(bags, bag)) {
100 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); 103 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
101 return NULL; 104 return NULL;
102 } 105 }
@@ -106,7 +109,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
106 for(i = 0; i < sk_X509_num(ca); i++) { 109 for(i = 0; i < sk_X509_num(ca); i++) {
107 tcert = sk_X509_value(ca, i); 110 tcert = sk_X509_value(ca, i);
108 if(!(bag = M_PKCS12_x5092certbag(tcert))) return NULL; 111 if(!(bag = M_PKCS12_x5092certbag(tcert))) return NULL;
109 if(!sk_push(bags, (char *)bag)) { 112 if(!sk_PKCS12_SAFEBAG_push(bags, bag)) {
110 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); 113 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
111 return NULL; 114 return NULL;
112 } 115 }
@@ -116,11 +119,12 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
116 /* Turn certbags into encrypted authsafe */ 119 /* Turn certbags into encrypted authsafe */
117 authsafe = PKCS12_pack_p7encdata (nid_cert, pass, -1, NULL, 0, 120 authsafe = PKCS12_pack_p7encdata (nid_cert, pass, -1, NULL, 0,
118 iter, bags); 121 iter, bags);
119 sk_pop_free(bags, PKCS12_SAFEBAG_free); 122 sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
120 123
121 if (!authsafe) return NULL; 124 if (!authsafe) return NULL;
122 125
123 if(!(safes = sk_new (NULL)) || !sk_push(safes, (char *)authsafe)) { 126 if(!(safes = sk_PKCS7_new_null ())
127 || !sk_PKCS7_push(safes, authsafe)) {
124 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); 128 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
125 return NULL; 129 return NULL;
126 } 130 }
@@ -133,14 +137,15 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
133 PKCS8_PRIV_KEY_INFO_free(p8); 137 PKCS8_PRIV_KEY_INFO_free(p8);
134 if (name && !PKCS12_add_friendlyname (bag, name, -1)) return NULL; 138 if (name && !PKCS12_add_friendlyname (bag, name, -1)) return NULL;
135 if(!PKCS12_add_localkeyid (bag, keyid, keyidlen)) return NULL; 139 if(!PKCS12_add_localkeyid (bag, keyid, keyidlen)) return NULL;
136 if(!(bags = sk_new(NULL)) || !sk_push (bags, (char *)bag)) { 140 if(!(bags = sk_PKCS12_SAFEBAG_new_null())
141 || !sk_PKCS12_SAFEBAG_push (bags, bag)) {
137 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); 142 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
138 return NULL; 143 return NULL;
139 } 144 }
140 /* Turn it into unencrypted safe bag */ 145 /* Turn it into unencrypted safe bag */
141 if(!(authsafe = PKCS12_pack_p7data (bags))) return NULL; 146 if(!(authsafe = PKCS12_pack_p7data (bags))) return NULL;
142 sk_pop_free(bags, PKCS12_SAFEBAG_free); 147 sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
143 if(!sk_push(safes, (char *)authsafe)) { 148 if(!sk_PKCS7_push(safes, authsafe)) {
144 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE); 149 PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);
145 return NULL; 150 return NULL;
146 } 151 }
@@ -149,7 +154,7 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
149 154
150 if(!M_PKCS12_pack_authsafes (p12, safes)) return NULL; 155 if(!M_PKCS12_pack_authsafes (p12, safes)) return NULL;
151 156
152 sk_pop_free(safes, PKCS7_free); 157 sk_PKCS7_pop_free(safes, PKCS7_free);
153 158
154 if(!PKCS12_set_mac (p12, pass, -1, NULL, 0, mac_iter, NULL)) 159 if(!PKCS12_set_mac (p12, pass, -1, NULL, 0, mac_iter, NULL))
155 return NULL; 160 return NULL;
diff --git a/src/lib/libcrypto/pkcs12/p12_decr.c b/src/lib/libcrypto/pkcs12/p12_decr.c
index 4be44eac50..8cd7e2f414 100644
--- a/src/lib/libcrypto/pkcs12/p12_decr.c
+++ b/src/lib/libcrypto/pkcs12/p12_decr.c
@@ -65,7 +65,7 @@
65 65
66 66
67/* Encrypt/Decrypt a buffer based on password and algor, result in a 67/* Encrypt/Decrypt a buffer based on password and algor, result in a
68 * Malloc'ed buffer 68 * OPENSSL_malloc'ed buffer
69 */ 69 */
70 70
71unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass, 71unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass,
@@ -83,7 +83,7 @@ unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass,
83 return NULL; 83 return NULL;
84 } 84 }
85 85
86 if(!(out = Malloc (inlen + EVP_CIPHER_CTX_block_size(&ctx)))) { 86 if(!(out = OPENSSL_malloc (inlen + EVP_CIPHER_CTX_block_size(&ctx)))) {
87 PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_MALLOC_FAILURE); 87 PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_MALLOC_FAILURE);
88 return NULL; 88 return NULL;
89 } 89 }
@@ -91,7 +91,7 @@ unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass,
91 EVP_CipherUpdate (&ctx, out, &i, in, inlen); 91 EVP_CipherUpdate (&ctx, out, &i, in, inlen);
92 outlen = i; 92 outlen = i;
93 if(!EVP_CipherFinal (&ctx, out + i, &i)) { 93 if(!EVP_CipherFinal (&ctx, out + i, &i)) {
94 Free (out); 94 OPENSSL_free (out);
95 PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_CIPHERFINAL_ERROR); 95 PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,PKCS12_R_PKCS12_CIPHERFINAL_ERROR);
96 return NULL; 96 return NULL;
97 } 97 }
@@ -109,7 +109,7 @@ unsigned char * PKCS12_pbe_crypt (X509_ALGOR *algor, const char *pass,
109 */ 109 */
110 110
111char * PKCS12_decrypt_d2i (X509_ALGOR *algor, char * (*d2i)(), 111char * PKCS12_decrypt_d2i (X509_ALGOR *algor, char * (*d2i)(),
112 void (*free_func)(), const char *pass, int passlen, 112 void (*free_func)(void *), const char *pass, int passlen,
113 ASN1_OCTET_STRING *oct, int seq) 113 ASN1_OCTET_STRING *oct, int seq)
114{ 114{
115 unsigned char *out, *p; 115 unsigned char *out, *p;
@@ -139,7 +139,7 @@ char * PKCS12_decrypt_d2i (X509_ALGOR *algor, char * (*d2i)(),
139 else ret = d2i(NULL, &p, outlen); 139 else ret = d2i(NULL, &p, outlen);
140 if (seq & 2) memset(out, 0, outlen); 140 if (seq & 2) memset(out, 0, outlen);
141 if(!ret) PKCS12err(PKCS12_F_PKCS12_DECRYPT_D2I,PKCS12_R_DECODE_ERROR); 141 if(!ret) PKCS12err(PKCS12_F_PKCS12_DECRYPT_D2I,PKCS12_R_DECODE_ERROR);
142 Free (out); 142 OPENSSL_free (out);
143 return ret; 143 return ret;
144} 144}
145 145
@@ -166,7 +166,7 @@ ASN1_OCTET_STRING *PKCS12_i2d_encrypt (X509_ALGOR *algor, int (*i2d)(),
166 PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCODE_ERROR); 166 PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCODE_ERROR);
167 return NULL; 167 return NULL;
168 } 168 }
169 if (!(in = Malloc (inlen))) { 169 if (!(in = OPENSSL_malloc (inlen))) {
170 PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE); 170 PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,ERR_R_MALLOC_FAILURE);
171 return NULL; 171 return NULL;
172 } 172 }
@@ -177,9 +177,11 @@ ASN1_OCTET_STRING *PKCS12_i2d_encrypt (X509_ALGOR *algor, int (*i2d)(),
177 if (!PKCS12_pbe_crypt (algor, pass, passlen, in, inlen, &oct->data, 177 if (!PKCS12_pbe_crypt (algor, pass, passlen, in, inlen, &oct->data,
178 &oct->length, 1)) { 178 &oct->length, 1)) {
179 PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCRYPT_ERROR); 179 PKCS12err(PKCS12_F_PKCS12_I2D_ENCRYPT,PKCS12_R_ENCRYPT_ERROR);
180 Free(in); 180 OPENSSL_free(in);
181 return NULL; 181 return NULL;
182 } 182 }
183 Free (in); 183 OPENSSL_free (in);
184 return oct; 184 return oct;
185} 185}
186
187IMPLEMENT_PKCS12_STACK_OF(PKCS7)
diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c
index b364671ed2..b042dcf05c 100644
--- a/src/lib/libcrypto/pkcs12/p12_key.c
+++ b/src/lib/libcrypto/pkcs12/p12_key.c
@@ -74,25 +74,30 @@ void h__dump (unsigned char *p, int len);
74#define min(a,b) ((a) < (b) ? (a) : (b)) 74#define min(a,b) ((a) < (b) ? (a) : (b))
75#endif 75#endif
76 76
77int PKCS12_key_gen_asc (const char *pass, int passlen, unsigned char *salt, 77int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
78 int saltlen, int id, int iter, int n, unsigned char *out, 78 int saltlen, int id, int iter, int n, unsigned char *out,
79 const EVP_MD *md_type) 79 const EVP_MD *md_type)
80{ 80{
81 int ret; 81 int ret;
82 unsigned char *unipass; 82 unsigned char *unipass;
83 int uniplen; 83 int uniplen;
84 if (!asc2uni (pass, &unipass, &uniplen)) { 84 if(!pass) {
85 unipass = NULL;
86 uniplen = 0;
87 } else if (!asc2uni(pass, &unipass, &uniplen)) {
85 PKCS12err(PKCS12_F_PKCS12_KEY_GEN_ASC,ERR_R_MALLOC_FAILURE); 88 PKCS12err(PKCS12_F_PKCS12_KEY_GEN_ASC,ERR_R_MALLOC_FAILURE);
86 return 0; 89 return 0;
87 } 90 }
88 ret = PKCS12_key_gen_uni (unipass, uniplen, salt, saltlen, 91 ret = PKCS12_key_gen_uni(unipass, uniplen, salt, saltlen,
89 id, iter, n, out, md_type); 92 id, iter, n, out, md_type);
90 memset(unipass, 0, uniplen); /* Clear password from memory */ 93 if(unipass) {
91 Free(unipass); 94 memset(unipass, 0, uniplen); /* Clear password from memory */
95 OPENSSL_free(unipass);
96 }
92 return ret; 97 return ret;
93} 98}
94 99
95int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt, 100int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,
96 int saltlen, int id, int iter, int n, unsigned char *out, 101 int saltlen, int id, int iter, int n, unsigned char *out,
97 const EVP_MD *md_type) 102 const EVP_MD *md_type)
98{ 103{
@@ -106,10 +111,12 @@ int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt,
106 int tmpn = n; 111 int tmpn = n;
107#endif 112#endif
108 113
114#if 0
109 if (!pass) { 115 if (!pass) {
110 PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_PASSED_NULL_PARAMETER); 116 PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_PASSED_NULL_PARAMETER);
111 return 0; 117 return 0;
112 } 118 }
119#endif
113 120
114#ifdef DEBUG_KEYGEN 121#ifdef DEBUG_KEYGEN
115 fprintf(stderr, "KEYGEN DEBUG\n"); 122 fprintf(stderr, "KEYGEN DEBUG\n");
@@ -121,13 +128,14 @@ int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt,
121#endif 128#endif
122 v = EVP_MD_block_size (md_type); 129 v = EVP_MD_block_size (md_type);
123 u = EVP_MD_size (md_type); 130 u = EVP_MD_size (md_type);
124 D = Malloc (v); 131 D = OPENSSL_malloc (v);
125 Ai = Malloc (u); 132 Ai = OPENSSL_malloc (u);
126 B = Malloc (v + 1); 133 B = OPENSSL_malloc (v + 1);
127 Slen = v * ((saltlen+v-1)/v); 134 Slen = v * ((saltlen+v-1)/v);
128 Plen = v * ((passlen+v-1)/v); 135 if(passlen) Plen = v * ((passlen+v-1)/v);
136 else Plen = 0;
129 Ilen = Slen + Plen; 137 Ilen = Slen + Plen;
130 I = Malloc (Ilen); 138 I = OPENSSL_malloc (Ilen);
131 Ij = BN_new(); 139 Ij = BN_new();
132 Bpl1 = BN_new(); 140 Bpl1 = BN_new();
133 if (!D || !Ai || !B || !I || !Ij || !Bpl1) { 141 if (!D || !Ai || !B || !I || !Ij || !Bpl1) {
@@ -150,10 +158,10 @@ int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt,
150 } 158 }
151 memcpy (out, Ai, min (n, u)); 159 memcpy (out, Ai, min (n, u));
152 if (u >= n) { 160 if (u >= n) {
153 Free (Ai); 161 OPENSSL_free (Ai);
154 Free (B); 162 OPENSSL_free (B);
155 Free (D); 163 OPENSSL_free (D);
156 Free (I); 164 OPENSSL_free (I);
157 BN_free (Ij); 165 BN_free (Ij);
158 BN_free (Bpl1); 166 BN_free (Bpl1);
159#ifdef DEBUG_KEYGEN 167#ifdef DEBUG_KEYGEN
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c
index ee257ffbad..1fbbd6c99f 100644
--- a/src/lib/libcrypto/pkcs12/p12_kiss.c
+++ b/src/lib/libcrypto/pkcs12/p12_kiss.c
@@ -65,9 +65,10 @@
65static int parse_pk12( PKCS12 *p12, const char *pass, int passlen, 65static int parse_pk12( PKCS12 *p12, const char *pass, int passlen,
66 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca); 66 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca);
67 67
68static int parse_bags( STACK *bags, const char *pass, int passlen, 68static int parse_bags( STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass,
69 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, 69 int passlen, EVP_PKEY **pkey, X509 **cert,
70 ASN1_OCTET_STRING **keyid, char *keymatch); 70 STACK_OF(X509) **ca, ASN1_OCTET_STRING **keyid,
71 char *keymatch);
71 72
72static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen, 73static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen,
73 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, 74 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca,
@@ -85,32 +86,41 @@ int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
85 86
86 /* Check for NULL PKCS12 structure */ 87 /* Check for NULL PKCS12 structure */
87 88
88 if(!p12) 89 if(!p12) {
89 {
90 PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_INVALID_NULL_PKCS12_POINTER); 90 PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_INVALID_NULL_PKCS12_POINTER);
91 return 0; 91 return 0;
92 } 92 }
93 93
94 /* Allocate stack for ca certificates if needed */ 94 /* Allocate stack for ca certificates if needed */
95 if ((ca != NULL) && (*ca == NULL)) 95 if ((ca != NULL) && (*ca == NULL)) {
96 { 96 if (!(*ca = sk_X509_new_null())) {
97 if (!(*ca = sk_X509_new(NULL)))
98 {
99 PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE); 97 PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE);
100 return 0; 98 return 0;
101 }
102 } 99 }
100 }
103 101
104 if(pkey) *pkey = NULL; 102 if(pkey) *pkey = NULL;
105 if(cert) *cert = NULL; 103 if(cert) *cert = NULL;
106 104
107 /* Check the mac */ 105 /* Check the mac */
108 106
109 if (!PKCS12_verify_mac (p12, pass, -1)) 107 /* If password is zero length or NULL then try verifying both cases
110 { 108 * to determine which password is correct. The reason for this is that
109 * under PKCS#12 password based encryption no password and a zero length
110 * password are two different things...
111 */
112
113 if(!pass || !*pass) {
114 if(PKCS12_verify_mac(p12, NULL, 0)) pass = NULL;
115 else if(PKCS12_verify_mac(p12, "", 0)) pass = "";
116 else {
117 PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_MAC_VERIFY_FAILURE);
118 goto err;
119 }
120 } else if (!PKCS12_verify_mac(p12, pass, -1)) {
111 PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_MAC_VERIFY_FAILURE); 121 PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_MAC_VERIFY_FAILURE);
112 goto err; 122 goto err;
113 } 123 }
114 124
115 if (!parse_pk12 (p12, pass, -1, pkey, cert, ca)) 125 if (!parse_pk12 (p12, pass, -1, pkey, cert, ca))
116 { 126 {
@@ -122,9 +132,9 @@ int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
122 132
123 err: 133 err:
124 134
125 if (pkey && *pkey) EVP_PKEY_free (*pkey); 135 if (pkey && *pkey) EVP_PKEY_free(*pkey);
126 if (cert && *cert) X509_free (*cert); 136 if (cert && *cert) X509_free(*cert);
127 if (ca) sk_X509_pop_free (*ca, X509_free); 137 if (ca) sk_X509_pop_free(*ca, X509_free);
128 return 0; 138 return 0;
129 139
130} 140}
@@ -134,45 +144,48 @@ int PKCS12_parse (PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
134static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen, 144static int parse_pk12 (PKCS12 *p12, const char *pass, int passlen,
135 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca) 145 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
136{ 146{
137 STACK *asafes, *bags; 147 STACK_OF(PKCS7) *asafes;
148 STACK_OF(PKCS12_SAFEBAG) *bags;
138 int i, bagnid; 149 int i, bagnid;
139 PKCS7 *p7; 150 PKCS7 *p7;
140 ASN1_OCTET_STRING *keyid = NULL; 151 ASN1_OCTET_STRING *keyid = NULL;
152
141 char keymatch = 0; 153 char keymatch = 0;
142 if (!( asafes = M_PKCS12_unpack_authsafes (p12))) return 0; 154 if (!( asafes = M_PKCS12_unpack_authsafes (p12))) return 0;
143 for (i = 0; i < sk_num (asafes); i++) { 155 for (i = 0; i < sk_PKCS7_num (asafes); i++) {
144 p7 = (PKCS7 *) sk_value (asafes, i); 156 p7 = sk_PKCS7_value (asafes, i);
145 bagnid = OBJ_obj2nid (p7->type); 157 bagnid = OBJ_obj2nid (p7->type);
146 if (bagnid == NID_pkcs7_data) { 158 if (bagnid == NID_pkcs7_data) {
147 bags = M_PKCS12_unpack_p7data (p7); 159 bags = M_PKCS12_unpack_p7data(p7);
148 } else if (bagnid == NID_pkcs7_encrypted) { 160 } else if (bagnid == NID_pkcs7_encrypted) {
149 bags = M_PKCS12_unpack_p7encdata (p7, pass, passlen); 161 bags = M_PKCS12_unpack_p7encdata(p7, pass, passlen);
150 } else continue; 162 } else continue;
151 if (!bags) { 163 if (!bags) {
152 sk_pop_free (asafes, PKCS7_free); 164 sk_PKCS7_pop_free(asafes, PKCS7_free);
153 return 0; 165 return 0;
154 } 166 }
155 if (!parse_bags(bags, pass, passlen, pkey, cert, ca, 167 if (!parse_bags(bags, pass, passlen, pkey, cert, ca,
156 &keyid, &keymatch)) { 168 &keyid, &keymatch)) {
157 sk_pop_free(bags, PKCS12_SAFEBAG_free); 169 sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
158 sk_pop_free(asafes, PKCS7_free); 170 sk_PKCS7_pop_free(asafes, PKCS7_free);
159 return 0; 171 return 0;
160 } 172 }
161 sk_pop_free(bags, PKCS12_SAFEBAG_free); 173 sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
162 } 174 }
163 sk_pop_free(asafes, PKCS7_free); 175 sk_PKCS7_pop_free(asafes, PKCS7_free);
164 if (keyid) M_ASN1_OCTET_STRING_free(keyid); 176 if (keyid) M_ASN1_OCTET_STRING_free(keyid);
165 return 1; 177 return 1;
166} 178}
167 179
168 180
169static int parse_bags (STACK *bags, const char *pass, int passlen, 181static int parse_bags (STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass,
170 EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca, 182 int passlen, EVP_PKEY **pkey, X509 **cert,
171 ASN1_OCTET_STRING **keyid, char *keymatch) 183 STACK_OF(X509) **ca, ASN1_OCTET_STRING **keyid,
184 char *keymatch)
172{ 185{
173 int i; 186 int i;
174 for (i = 0; i < sk_num(bags); i++) { 187 for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
175 if (!parse_bag((PKCS12_SAFEBAG *)sk_value (bags, i), 188 if (!parse_bag(sk_PKCS12_SAFEBAG_value (bags, i),
176 pass, passlen, pkey, cert, ca, keyid, 189 pass, passlen, pkey, cert, ca, keyid,
177 keymatch)) return 0; 190 keymatch)) return 0;
178 } 191 }
@@ -190,12 +203,17 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
190{ 203{
191 PKCS8_PRIV_KEY_INFO *p8; 204 PKCS8_PRIV_KEY_INFO *p8;
192 X509 *x509; 205 X509 *x509;
193 ASN1_OCTET_STRING *lkey = NULL; 206 ASN1_OCTET_STRING *lkey = NULL, *ckid = NULL;
194 ASN1_TYPE *attrib; 207 ASN1_TYPE *attrib;
208 ASN1_BMPSTRING *fname = NULL;
195 209
210 if ((attrib = PKCS12_get_attr (bag, NID_friendlyName)))
211 fname = attrib->value.bmpstring;
196 212
197 if ((attrib = PKCS12_get_attr (bag, NID_localKeyID))) 213 if ((attrib = PKCS12_get_attr (bag, NID_localKeyID))) {
198 lkey = attrib->value.octet_string; 214 lkey = attrib->value.octet_string;
215 ckid = lkey;
216 }
199 217
200 /* Check for any local key id matching (if needed) */ 218 /* Check for any local key id matching (if needed) */
201 if (lkey && ((*keymatch & MATCH_ALL) != MATCH_ALL)) { 219 if (lkey && ((*keymatch & MATCH_ALL) != MATCH_ALL)) {
@@ -231,6 +249,18 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
231 if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate ) 249 if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate )
232 return 1; 250 return 1;
233 if (!(x509 = M_PKCS12_certbag2x509(bag))) return 0; 251 if (!(x509 = M_PKCS12_certbag2x509(bag))) return 0;
252 if(ckid) X509_keyid_set1(x509, ckid->data, ckid->length);
253 if(fname) {
254 int len;
255 unsigned char *data;
256 len = ASN1_STRING_to_UTF8(&data, fname);
257 if(len > 0) {
258 X509_alias_set1(x509, data, len);
259 OPENSSL_free(data);
260 }
261 }
262
263
234 if (lkey) { 264 if (lkey) {
235 *keymatch |= MATCH_CERT; 265 *keymatch |= MATCH_CERT;
236 if (cert) *cert = x509; 266 if (cert) *cert = x509;
diff --git a/src/lib/libcrypto/pkcs12/p12_lib.c b/src/lib/libcrypto/pkcs12/p12_lib.c
index 7ca9c14908..7d464e3a32 100644
--- a/src/lib/libcrypto/pkcs12/p12_lib.c
+++ b/src/lib/libcrypto/pkcs12/p12_lib.c
@@ -107,5 +107,5 @@ void PKCS12_free (PKCS12 *a)
107 M_ASN1_INTEGER_free(a->version); 107 M_ASN1_INTEGER_free(a->version);
108 PKCS12_MAC_DATA_free (a->mac); 108 PKCS12_MAC_DATA_free (a->mac);
109 PKCS7_free (a->authsafes); 109 PKCS7_free (a->authsafes);
110 Free (a); 110 OPENSSL_free (a);
111} 111}
diff --git a/src/lib/libcrypto/pkcs12/p12_mac.c b/src/lib/libcrypto/pkcs12/p12_mac.c
index f5ab0d6464..fbd1eca24f 100644
--- a/src/lib/libcrypto/pkcs12/p12_mac.c
+++ b/src/lib/libcrypto/pkcs12/p12_mac.c
@@ -106,5 +106,5 @@ void PKCS12_MAC_DATA_free (PKCS12_MAC_DATA *a)
106 X509_SIG_free (a->dinfo); 106 X509_SIG_free (a->dinfo);
107 M_ASN1_OCTET_STRING_free(a->salt); 107 M_ASN1_OCTET_STRING_free(a->salt);
108 M_ASN1_INTEGER_free(a->iter); 108 M_ASN1_INTEGER_free(a->iter);
109 Free (a); 109 OPENSSL_free (a);
110} 110}
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c
index 369257ed4c..13d866da51 100644
--- a/src/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/src/lib/libcrypto/pkcs12/p12_mutl.c
@@ -106,10 +106,7 @@ int PKCS12_verify_mac (PKCS12 *p12, const char *pass, int passlen)
106 return 0; 106 return 0;
107 } 107 }
108 if ((maclen != (unsigned int)p12->mac->dinfo->digest->length) 108 if ((maclen != (unsigned int)p12->mac->dinfo->digest->length)
109 || memcmp (mac, p12->mac->dinfo->digest->data, maclen)) { 109 || memcmp (mac, p12->mac->dinfo->digest->data, maclen)) return 0;
110 PKCS12err(PKCS12_F_VERIFY_MAC,PKCS12_R_MAC_VERIFY_ERROR);
111 return 0;
112 }
113 return 1; 110 return 1;
114} 111}
115 112
@@ -152,7 +149,7 @@ int PKCS12_setup_mac (PKCS12 *p12, int iter, unsigned char *salt, int saltlen,
152 } 149 }
153 if (!saltlen) saltlen = PKCS12_SALT_LEN; 150 if (!saltlen) saltlen = PKCS12_SALT_LEN;
154 p12->mac->salt->length = saltlen; 151 p12->mac->salt->length = saltlen;
155 if (!(p12->mac->salt->data = Malloc (saltlen))) { 152 if (!(p12->mac->salt->data = OPENSSL_malloc (saltlen))) {
156 PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE); 153 PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE);
157 return 0; 154 return 0;
158 } 155 }
diff --git a/src/lib/libcrypto/pkcs12/p12_npas.c b/src/lib/libcrypto/pkcs12/p12_npas.c
index ee71707e2c..84e31a7f21 100644
--- a/src/lib/libcrypto/pkcs12/p12_npas.c
+++ b/src/lib/libcrypto/pkcs12/p12_npas.c
@@ -66,7 +66,8 @@
66/* PKCS#12 password change routine */ 66/* PKCS#12 password change routine */
67 67
68static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass); 68static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass);
69static int newpass_bags(STACK *bags, char *oldpass, char *newpass); 69static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass,
70 char *newpass);
70static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass); 71static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass);
71static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); 72static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen);
72 73
@@ -104,16 +105,18 @@ return 1;
104 105
105static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) 106static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
106{ 107{
107 STACK *asafes, *newsafes, *bags; 108 STACK_OF(PKCS7) *asafes, *newsafes;
109 STACK_OF(PKCS12_SAFEBAG) *bags;
108 int i, bagnid, pbe_nid, pbe_iter, pbe_saltlen; 110 int i, bagnid, pbe_nid, pbe_iter, pbe_saltlen;
109 PKCS7 *p7, *p7new; 111 PKCS7 *p7, *p7new;
110 ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL; 112 ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL;
111 unsigned char mac[EVP_MAX_MD_SIZE]; 113 unsigned char mac[EVP_MAX_MD_SIZE];
112 unsigned int maclen; 114 unsigned int maclen;
115
113 if (!(asafes = M_PKCS12_unpack_authsafes(p12))) return 0; 116 if (!(asafes = M_PKCS12_unpack_authsafes(p12))) return 0;
114 if(!(newsafes = sk_new(NULL))) return 0; 117 if(!(newsafes = sk_PKCS7_new_null())) return 0;
115 for (i = 0; i < sk_num (asafes); i++) { 118 for (i = 0; i < sk_PKCS7_num (asafes); i++) {
116 p7 = (PKCS7 *) sk_value(asafes, i); 119 p7 = sk_PKCS7_value(asafes, i);
117 bagnid = OBJ_obj2nid(p7->type); 120 bagnid = OBJ_obj2nid(p7->type);
118 if (bagnid == NID_pkcs7_data) { 121 if (bagnid == NID_pkcs7_data) {
119 bags = M_PKCS12_unpack_p7data(p7); 122 bags = M_PKCS12_unpack_p7data(p7);
@@ -123,26 +126,26 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
123 &pbe_nid, &pbe_iter, &pbe_saltlen); 126 &pbe_nid, &pbe_iter, &pbe_saltlen);
124 } else continue; 127 } else continue;
125 if (!bags) { 128 if (!bags) {
126 sk_pop_free(asafes, PKCS7_free); 129 sk_PKCS7_pop_free(asafes, PKCS7_free);
127 return 0; 130 return 0;
128 } 131 }
129 if (!newpass_bags(bags, oldpass, newpass)) { 132 if (!newpass_bags(bags, oldpass, newpass)) {
130 sk_pop_free(bags, PKCS12_SAFEBAG_free); 133 sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
131 sk_pop_free(asafes, PKCS7_free); 134 sk_PKCS7_pop_free(asafes, PKCS7_free);
132 return 0; 135 return 0;
133 } 136 }
134 /* Repack bag in same form with new password */ 137 /* Repack bag in same form with new password */
135 if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags); 138 if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags);
136 else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL, 139 else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL,
137 pbe_saltlen, pbe_iter, bags); 140 pbe_saltlen, pbe_iter, bags);
138 sk_pop_free(bags, PKCS12_SAFEBAG_free); 141 sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
139 if(!p7new) { 142 if(!p7new) {
140 sk_pop_free(asafes, PKCS7_free); 143 sk_PKCS7_pop_free(asafes, PKCS7_free);
141 return 0; 144 return 0;
142 } 145 }
143 sk_push(newsafes, (char *)p7new); 146 sk_PKCS7_push(newsafes, p7new);
144 } 147 }
145 sk_pop_free(asafes, PKCS7_free); 148 sk_PKCS7_pop_free(asafes, PKCS7_free);
146 149
147 /* Repack safe: save old safe in case of error */ 150 /* Repack safe: save old safe in case of error */
148 151
@@ -169,12 +172,14 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass)
169} 172}
170 173
171 174
172static int newpass_bags(STACK *bags, char *oldpass, char *newpass) 175static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass,
176 char *newpass)
173{ 177{
174 int i; 178 int i;
175 for (i = 0; i < sk_num(bags); i++) { 179 for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
176 if (!newpass_bag((PKCS12_SAFEBAG *)sk_value(bags, i), 180 if (!newpass_bag(sk_PKCS12_SAFEBAG_value(bags, i),
177 oldpass, newpass)) return 0; 181 oldpass, newpass))
182 return 0;
178 } 183 }
179 return 1; 184 return 1;
180} 185}
diff --git a/src/lib/libcrypto/pkcs12/p12_sbag.c b/src/lib/libcrypto/pkcs12/p12_sbag.c
index 1b3addece1..64ac32ee6f 100644
--- a/src/lib/libcrypto/pkcs12/p12_sbag.c
+++ b/src/lib/libcrypto/pkcs12/p12_sbag.c
@@ -81,8 +81,9 @@ int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp)
81 break; 81 break;
82 82
83 case NID_safeContentsBag: 83 case NID_safeContentsBag:
84 M_ASN1_I2D_len_EXP_SEQUENCE_opt (a->value.safes, 84 M_ASN1_I2D_len_EXP_SEQUENCE_opt_type
85 i2d_PKCS12_SAFEBAG, 0, V_ASN1_SEQUENCE, v); 85 (PKCS12_SAFEBAG, a->value.safes, i2d_PKCS12_SAFEBAG,
86 0, V_ASN1_SEQUENCE, v);
86 break; 87 break;
87 88
88 case NID_certBag: 89 case NID_certBag:
@@ -117,8 +118,9 @@ int i2d_PKCS12_SAFEBAG(PKCS12_SAFEBAG *a, unsigned char **pp)
117 break; 118 break;
118 119
119 case NID_safeContentsBag: 120 case NID_safeContentsBag:
120 M_ASN1_I2D_put_EXP_SEQUENCE_opt (a->value.safes, 121 M_ASN1_I2D_put_EXP_SEQUENCE_opt_type
121 i2d_PKCS12_SAFEBAG, 0, V_ASN1_SEQUENCE, v); 122 (PKCS12_SAFEBAG, a->value.safes, i2d_PKCS12_SAFEBAG,
123 0, V_ASN1_SEQUENCE, v);
122 break; 124 break;
123 125
124 case NID_certBag: 126 case NID_certBag:
@@ -175,9 +177,10 @@ PKCS12_SAFEBAG *d2i_PKCS12_SAFEBAG(PKCS12_SAFEBAG **a, unsigned char **pp,
175 break; 177 break;
176 178
177 case NID_safeContentsBag: 179 case NID_safeContentsBag:
178 M_ASN1_D2I_get_EXP_set_opt(ret->value.safes, 180 M_ASN1_D2I_get_EXP_set_opt_type
179 d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free, 181 (PKCS12_SAFEBAG, ret->value.safes,
180 0, V_ASN1_SEQUENCE); 182 d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free, 0,
183 V_ASN1_SEQUENCE);
181 break; 184 break;
182 185
183 case NID_certBag: 186 case NID_certBag:
@@ -223,5 +226,9 @@ void PKCS12_SAFEBAG_free (PKCS12_SAFEBAG *a)
223 226
224 ASN1_OBJECT_free (a->type); 227 ASN1_OBJECT_free (a->type);
225 sk_X509_ATTRIBUTE_pop_free (a->attrib, X509_ATTRIBUTE_free); 228 sk_X509_ATTRIBUTE_pop_free (a->attrib, X509_ATTRIBUTE_free);
226 Free (a); 229 OPENSSL_free (a);
227} 230}
231
232IMPLEMENT_STACK_OF(PKCS12_SAFEBAG)
233IMPLEMENT_ASN1_SET_OF(PKCS12_SAFEBAG)
234IMPLEMENT_PKCS12_STACK_OF(PKCS12_SAFEBAG)
diff --git a/src/lib/libcrypto/pkcs12/p12_utl.c b/src/lib/libcrypto/pkcs12/p12_utl.c
index 2adcbc95e1..17f41b4549 100644
--- a/src/lib/libcrypto/pkcs12/p12_utl.c
+++ b/src/lib/libcrypto/pkcs12/p12_utl.c
@@ -67,7 +67,7 @@ unsigned char *asc2uni (const char *asc, unsigned char **uni, int *unilen)
67 int ulen, i; 67 int ulen, i;
68 unsigned char *unitmp; 68 unsigned char *unitmp;
69 ulen = strlen(asc)*2 + 2; 69 ulen = strlen(asc)*2 + 2;
70 if (!(unitmp = Malloc (ulen))) return NULL; 70 if (!(unitmp = OPENSSL_malloc (ulen))) return NULL;
71 for (i = 0; i < ulen; i+=2) { 71 for (i = 0; i < ulen; i+=2) {
72 unitmp[i] = 0; 72 unitmp[i] = 0;
73 unitmp[i + 1] = asc[i>>1]; 73 unitmp[i + 1] = asc[i>>1];
@@ -85,7 +85,7 @@ char *uni2asc (unsigned char *uni, int unilen)
85 /* If no terminating zero allow for one */ 85 /* If no terminating zero allow for one */
86 if (uni[unilen - 1]) asclen++; 86 if (uni[unilen - 1]) asclen++;
87 uni++; 87 uni++;
88 if (!(asctmp = Malloc (asclen))) return NULL; 88 if (!(asctmp = OPENSSL_malloc (asclen))) return NULL;
89 for (i = 0; i < unilen; i+=2) asctmp[i>>1] = uni[i]; 89 for (i = 0; i < unilen; i+=2) asctmp[i>>1] = uni[i];
90 asctmp[asclen - 1] = 0; 90 asctmp[asclen - 1] = 0;
91 return asctmp; 91 return asctmp;
diff --git a/src/lib/libcrypto/pkcs12/pkcs12.h b/src/lib/libcrypto/pkcs12/pkcs12.h
index dad356c00f..502fceff95 100644
--- a/src/lib/libcrypto/pkcs12/pkcs12.h
+++ b/src/lib/libcrypto/pkcs12/pkcs12.h
@@ -59,13 +59,13 @@
59#ifndef HEADER_PKCS12_H 59#ifndef HEADER_PKCS12_H
60#define HEADER_PKCS12_H 60#define HEADER_PKCS12_H
61 61
62#include <openssl/bio.h>
63#include <openssl/x509.h>
64
62#ifdef __cplusplus 65#ifdef __cplusplus
63extern "C" { 66extern "C" {
64#endif 67#endif
65 68
66#include <openssl/bio.h>
67#include <openssl/x509.h>
68
69#define PKCS12_KEY_ID 1 69#define PKCS12_KEY_ID 1
70#define PKCS12_IV_ID 2 70#define PKCS12_IV_ID 2
71#define PKCS12_MAC_ID 3 71#define PKCS12_MAC_ID 3
@@ -108,19 +108,25 @@ PKCS12_MAC_DATA *mac;
108PKCS7 *authsafes; 108PKCS7 *authsafes;
109} PKCS12; 109} PKCS12;
110 110
111PREDECLARE_STACK_OF(PKCS12_SAFEBAG)
112
111typedef struct { 113typedef struct {
112ASN1_OBJECT *type; 114ASN1_OBJECT *type;
113union { 115union {
114 struct pkcs12_bag_st *bag; /* secret, crl and certbag */ 116 struct pkcs12_bag_st *bag; /* secret, crl and certbag */
115 struct pkcs8_priv_key_info_st *keybag; /* keybag */ 117 struct pkcs8_priv_key_info_st *keybag; /* keybag */
116 X509_SIG *shkeybag; /* shrouded key bag */ 118 X509_SIG *shkeybag; /* shrouded key bag */
117 STACK /* PKCS12_SAFEBAG */ *safes; 119 STACK_OF(PKCS12_SAFEBAG) *safes;
118 ASN1_TYPE *other; 120 ASN1_TYPE *other;
119}value; 121}value;
120STACK_OF(X509_ATTRIBUTE) *attrib; 122STACK_OF(X509_ATTRIBUTE) *attrib;
121ASN1_TYPE *rest; 123ASN1_TYPE *rest;
122} PKCS12_SAFEBAG; 124} PKCS12_SAFEBAG;
123 125
126DECLARE_STACK_OF(PKCS12_SAFEBAG)
127DECLARE_ASN1_SET_OF(PKCS12_SAFEBAG)
128DECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG)
129
124typedef struct pkcs12_bag_st { 130typedef struct pkcs12_bag_st {
125ASN1_OBJECT *type; 131ASN1_OBJECT *type;
126union { 132union {
@@ -140,50 +146,49 @@ union {
140#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type 146#define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type
141 147
142#define M_PKCS12_x5092certbag(x509) \ 148#define M_PKCS12_x5092certbag(x509) \
143PKCS12_pack_safebag ((char *)(x509), i2d_X509, NID_x509Certificate, NID_certBag) 149PKCS12_pack_safebag((char *)(x509), i2d_X509, NID_x509Certificate, NID_certBag)
144 150
145#define M_PKCS12_x509crl2certbag(crl) \ 151#define M_PKCS12_x509crl2certbag(crl) \
146PKCS12_pack_safebag ((char *)(crl), i2d_X509CRL, NID_x509Crl, NID_crlBag) 152PKCS12_pack_safebag((char *)(crl), i2d_X509CRL, NID_x509Crl, NID_crlBag)
147 153
148#define M_PKCS12_certbag2x509(bg) \ 154#define M_PKCS12_certbag2x509(bg) \
149(X509 *) ASN1_unpack_string ((bg)->value.bag->value.octet, \ 155(X509 *) ASN1_unpack_string((bg)->value.bag->value.octet, \
150(char *(*)())d2i_X509) 156(char *(*)())d2i_X509)
151 157
152#define M_PKCS12_certbag2x509crl(bg) \ 158#define M_PKCS12_certbag2x509crl(bg) \
153(X509CRL *) ASN1_unpack_string ((bg)->value.bag->value.octet, \ 159(X509CRL *) ASN1_unpack_string((bg)->value.bag->value.octet, \
154(char *(*)())d2i_X509CRL) 160(char *(*)())d2i_X509CRL)
155 161
156/*#define M_PKCS12_pkcs82rsa(p8) \ 162/*#define M_PKCS12_pkcs82rsa(p8) \
157(RSA *) ASN1_unpack_string ((p8)->pkey, (char *(*)())d2i_RSAPrivateKey)*/ 163(RSA *) ASN1_unpack_string((p8)->pkey, (char *(*)())d2i_RSAPrivateKey)*/
158 164
159#define M_PKCS12_unpack_p7data(p7) \ 165#define M_PKCS12_unpack_p7data(p7) \
160ASN1_seq_unpack ((p7)->d.data->data, p7->d.data->length, \ 166ASN1_seq_unpack_PKCS12_SAFEBAG((p7)->d.data->data, p7->d.data->length, \
161 (char *(*)())d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free) 167 d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free)
162 168
163#define M_PKCS12_pack_authsafes(p12, safes) \ 169#define M_PKCS12_pack_authsafes(p12, safes) \
164ASN1_seq_pack((safes), (int (*)())i2d_PKCS7,\ 170ASN1_seq_pack_PKCS7((safes), i2d_PKCS7,\
165 &(p12)->authsafes->d.data->data, &(p12)->authsafes->d.data->length) 171 &(p12)->authsafes->d.data->data, &(p12)->authsafes->d.data->length)
166 172
167#define M_PKCS12_unpack_authsafes(p12) \ 173#define M_PKCS12_unpack_authsafes(p12) \
168ASN1_seq_unpack((p12)->authsafes->d.data->data, \ 174ASN1_seq_unpack_PKCS7((p12)->authsafes->d.data->data, \
169 (p12)->authsafes->d.data->length, (char *(*)())d2i_PKCS7, \ 175 (p12)->authsafes->d.data->length, d2i_PKCS7, PKCS7_free)
170 PKCS7_free)
171 176
172#define M_PKCS12_unpack_p7encdata(p7, pass, passlen) \ 177#define M_PKCS12_unpack_p7encdata(p7, pass, passlen) \
173(STACK *) PKCS12_decrypt_d2i ((p7)->d.encrypted->enc_data->algorithm,\ 178PKCS12_decrypt_d2i_PKCS12_SAFEBAG((p7)->d.encrypted->enc_data->algorithm,\
174 (char *(*)())d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free, \ 179 d2i_PKCS12_SAFEBAG, PKCS12_SAFEBAG_free, \
175 (pass), (passlen), \ 180 (pass), (passlen), \
176 (p7)->d.encrypted->enc_data->enc_data, 3) 181 (p7)->d.encrypted->enc_data->enc_data, 3)
177 182
178#define M_PKCS12_decrypt_skey(bag, pass, passlen) \ 183#define M_PKCS12_decrypt_skey(bag, pass, passlen) \
179(PKCS8_PRIV_KEY_INFO *) PKCS12_decrypt_d2i ((bag)->value.shkeybag->algor, \ 184(PKCS8_PRIV_KEY_INFO *) PKCS12_decrypt_d2i((bag)->value.shkeybag->algor, \
180(char *(*)())d2i_PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free, \ 185(char *(*)())d2i_PKCS8_PRIV_KEY_INFO, (void (*)(void *))PKCS8_PRIV_KEY_INFO_free, \
181 (pass), (passlen), \ 186 (pass), (passlen), \
182 (bag)->value.shkeybag->digest, 2) 187 (bag)->value.shkeybag->digest, 2)
183 188
184#define M_PKCS8_decrypt(p8, pass, passlen) \ 189#define M_PKCS8_decrypt(p8, pass, passlen) \
185(PKCS8_PRIV_KEY_INFO *) PKCS12_decrypt_d2i ((p8)->algor, \ 190(PKCS8_PRIV_KEY_INFO *) PKCS12_decrypt_d2i((p8)->algor, \
186(char *(*)())d2i_PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free,\ 191(char *(*)())d2i_PKCS8_PRIV_KEY_INFO, (void (*)(void *))PKCS8_PRIV_KEY_INFO_free,\
187 (pass), (passlen), (p8)->digest, 2) 192 (pass), (passlen), (p8)->digest, 2)
188 193
189#define PKCS12_get_attr(bag, attr_nid) \ 194#define PKCS12_get_attr(bag, attr_nid) \
@@ -205,10 +210,10 @@ PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,
205 int passlen, unsigned char *salt, 210 int passlen, unsigned char *salt,
206 int saltlen, int iter, 211 int saltlen, int iter,
207 PKCS8_PRIV_KEY_INFO *p8); 212 PKCS8_PRIV_KEY_INFO *p8);
208PKCS7 *PKCS12_pack_p7data(STACK *sk); 213PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);
209PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, 214PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,
210 unsigned char *salt, int saltlen, int iter, 215 unsigned char *salt, int saltlen, int iter,
211 STACK *bags); 216 STACK_OF(PKCS12_SAFEBAG) *bags);
212int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen); 217int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name, int namelen);
213int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name, 218int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
214 int namelen); 219 int namelen);
@@ -221,7 +226,7 @@ unsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,
221 int passlen, unsigned char *in, int inlen, 226 int passlen, unsigned char *in, int inlen,
222 unsigned char **data, int *datalen, int en_de); 227 unsigned char **data, int *datalen, int en_de);
223char *PKCS12_decrypt_d2i(X509_ALGOR *algor, char *(*d2i)(), 228char *PKCS12_decrypt_d2i(X509_ALGOR *algor, char *(*d2i)(),
224 void (*free_func)(), const char *pass, int passlen, 229 void (*free_func)(void *), const char *pass, int passlen,
225 ASN1_STRING *oct, int seq); 230 ASN1_STRING *oct, int seq);
226ASN1_STRING *PKCS12_i2d_encrypt(X509_ALGOR *algor, int (*i2d)(), 231ASN1_STRING *PKCS12_i2d_encrypt(X509_ALGOR *algor, int (*i2d)(),
227 const char *pass, int passlen, char *obj, 232 const char *pass, int passlen, char *obj,
diff --git a/src/lib/libcrypto/pkcs7/Makefile.ssl b/src/lib/libcrypto/pkcs7/Makefile.ssl
index 0e508386e8..6cd18b671e 100644
--- a/src/lib/libcrypto/pkcs7/Makefile.ssl
+++ b/src/lib/libcrypto/pkcs7/Makefile.ssl
@@ -99,12 +99,14 @@ clean:
99 99
100pk7_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 100pk7_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
101pk7_attr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 101pk7_attr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
102pk7_attr.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 102pk7_attr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
103pk7_attr.o: ../../include/openssl/des.h ../../include/openssl/dh.h 103pk7_attr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
104pk7_attr.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 104pk7_attr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
105pk7_attr.o: ../../include/openssl/err.h ../../include/openssl/evp.h 105pk7_attr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
106pk7_attr.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 106pk7_attr.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
107pk7_attr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 107pk7_attr.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
108pk7_attr.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
109pk7_attr.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
108pk7_attr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 110pk7_attr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
109pk7_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 111pk7_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
110pk7_attr.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 112pk7_attr.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
@@ -112,26 +114,29 @@ pk7_attr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
112pk7_attr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 114pk7_attr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
113pk7_attr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 115pk7_attr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
114pk7_attr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 116pk7_attr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
115pk7_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 117pk7_attr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
118pk7_attr.o: ../../include/openssl/x509_vfy.h
116pk7_doit.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 119pk7_doit.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
117pk7_doit.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 120pk7_doit.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
118pk7_doit.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 121pk7_doit.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
119pk7_doit.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 122pk7_doit.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
120pk7_doit.o: ../../include/openssl/des.h ../../include/openssl/dh.h 123pk7_doit.o: ../../include/openssl/des.h ../../include/openssl/dh.h
121pk7_doit.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 124pk7_doit.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
122pk7_doit.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 125pk7_doit.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
123pk7_doit.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 126pk7_doit.o: ../../include/openssl/err.h ../../include/openssl/evp.h
124pk7_doit.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 127pk7_doit.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
128pk7_doit.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
125pk7_doit.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 129pk7_doit.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
126pk7_doit.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 130pk7_doit.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
131pk7_doit.o: ../../include/openssl/opensslconf.h
127pk7_doit.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 132pk7_doit.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
128pk7_doit.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 133pk7_doit.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
129pk7_doit.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 134pk7_doit.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
130pk7_doit.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 135pk7_doit.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
131pk7_doit.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 136pk7_doit.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
132pk7_doit.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 137pk7_doit.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
133pk7_doit.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 138pk7_doit.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
134pk7_doit.o: ../cryptlib.h 139pk7_doit.o: ../../include/openssl/x509v3.h ../cryptlib.h
135pk7_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 140pk7_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
136pk7_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 141pk7_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
137pk7_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 142pk7_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -139,14 +144,16 @@ pk7_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
139pk7_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 144pk7_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
140pk7_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 145pk7_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
141pk7_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h 146pk7_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
142pk7_lib.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 147pk7_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
148pk7_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
143pk7_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 149pk7_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
144pk7_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 150pk7_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
145pk7_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 151pk7_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
146pk7_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 152pk7_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
147pk7_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 153pk7_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
148pk7_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 154pk7_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
149pk7_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 155pk7_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
156pk7_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
150pk7_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 157pk7_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
151pk7_lib.o: ../cryptlib.h 158pk7_lib.o: ../cryptlib.h
152pk7_mime.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 159pk7_mime.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -156,47 +163,55 @@ pk7_mime.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
156pk7_mime.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 163pk7_mime.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
157pk7_mime.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 164pk7_mime.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
158pk7_mime.o: ../../include/openssl/err.h ../../include/openssl/evp.h 165pk7_mime.o: ../../include/openssl/err.h ../../include/openssl/evp.h
159pk7_mime.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 166pk7_mime.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
167pk7_mime.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
160pk7_mime.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 168pk7_mime.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
161pk7_mime.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 169pk7_mime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
170pk7_mime.o: ../../include/openssl/opensslconf.h
162pk7_mime.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 171pk7_mime.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
163pk7_mime.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h 172pk7_mime.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
164pk7_mime.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 173pk7_mime.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
165pk7_mime.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 174pk7_mime.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
166pk7_mime.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 175pk7_mime.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
167pk7_mime.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 176pk7_mime.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
168pk7_mime.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 177pk7_mime.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
178pk7_mime.o: ../cryptlib.h
169pk7_smime.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 179pk7_smime.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
170pk7_smime.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 180pk7_smime.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
171pk7_smime.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 181pk7_smime.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
172pk7_smime.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 182pk7_smime.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
173pk7_smime.o: ../../include/openssl/des.h ../../include/openssl/dh.h 183pk7_smime.o: ../../include/openssl/des.h ../../include/openssl/dh.h
174pk7_smime.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 184pk7_smime.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
175pk7_smime.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 185pk7_smime.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
176pk7_smime.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 186pk7_smime.o: ../../include/openssl/err.h ../../include/openssl/evp.h
177pk7_smime.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 187pk7_smime.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
188pk7_smime.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
178pk7_smime.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 189pk7_smime.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
179pk7_smime.o: ../../include/openssl/objects.h 190pk7_smime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
180pk7_smime.o: ../../include/openssl/opensslconf.h 191pk7_smime.o: ../../include/openssl/opensslconf.h
181pk7_smime.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 192pk7_smime.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
182pk7_smime.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 193pk7_smime.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
183pk7_smime.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 194pk7_smime.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
184pk7_smime.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 195pk7_smime.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
185pk7_smime.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 196pk7_smime.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
186pk7_smime.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 197pk7_smime.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
187pk7_smime.o: ../../include/openssl/x509v3.h ../cryptlib.h 198pk7_smime.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
199pk7_smime.o: ../cryptlib.h
188pkcs7err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 200pkcs7err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
189pkcs7err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 201pkcs7err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
190pkcs7err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 202pkcs7err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
191pkcs7err.o: ../../include/openssl/des.h ../../include/openssl/dh.h 203pkcs7err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
192pkcs7err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 204pkcs7err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
193pkcs7err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 205pkcs7err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
194pkcs7err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 206pkcs7err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
195pkcs7err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 207pkcs7err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
208pkcs7err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
209pkcs7err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
196pkcs7err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 210pkcs7err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
197pkcs7err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 211pkcs7err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
198pkcs7err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 212pkcs7err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
199pkcs7err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 213pkcs7err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
200pkcs7err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 214pkcs7err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
201pkcs7err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 215pkcs7err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
202pkcs7err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 216pkcs7err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
217pkcs7err.o: ../../include/openssl/x509_vfy.h
diff --git a/src/lib/libcrypto/pkcs7/bio_ber.c b/src/lib/libcrypto/pkcs7/bio_ber.c
index 4803966fd2..5447e69818 100644
--- a/src/lib/libcrypto/pkcs7/bio_ber.c
+++ b/src/lib/libcrypto/pkcs7/bio_ber.c
@@ -128,7 +128,7 @@ static int ber_new(BIO *bi)
128 { 128 {
129 BIO_BER_CTX *ctx; 129 BIO_BER_CTX *ctx;
130 130
131 ctx=(BIO_BER_CTX *)Malloc(sizeof(BIO_BER_CTX)); 131 ctx=(BIO_BER_CTX *)OPENSSL_malloc(sizeof(BIO_BER_CTX));
132 if (ctx == NULL) return(0); 132 if (ctx == NULL) return(0);
133 133
134 memset((char *)ctx,0,sizeof(BIO_BER_CTX)); 134 memset((char *)ctx,0,sizeof(BIO_BER_CTX));
@@ -146,7 +146,7 @@ static int ber_free(BIO *a)
146 if (a == NULL) return(0); 146 if (a == NULL) return(0);
147 b=(BIO_BER_CTX *)a->ptr; 147 b=(BIO_BER_CTX *)a->ptr;
148 memset(a->ptr,0,sizeof(BIO_BER_CTX)); 148 memset(a->ptr,0,sizeof(BIO_BER_CTX));
149 Free(a->ptr); 149 OPENSSL_free(a->ptr);
150 a->ptr=NULL; 150 a->ptr=NULL;
151 a->init=0; 151 a->init=0;
152 a->flags=0; 152 a->flags=0;
diff --git a/src/lib/libcrypto/pkcs7/pk7_attr.c b/src/lib/libcrypto/pkcs7/pk7_attr.c
index 3b9c0fe3f2..6ae264cbf9 100644
--- a/src/lib/libcrypto/pkcs7/pk7_attr.c
+++ b/src/lib/libcrypto/pkcs7/pk7_attr.c
@@ -12,22 +12,24 @@
12#include <openssl/asn1.h> 12#include <openssl/asn1.h>
13#include <openssl/pem.h> 13#include <openssl/pem.h>
14#include <openssl/pkcs7.h> 14#include <openssl/pkcs7.h>
15#include <openssl/x509.h>
15#include <openssl/err.h> 16#include <openssl/err.h>
16 17
17int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK *cap) 18int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK_OF(X509_ALGOR) *cap)
18{ 19{
19 ASN1_STRING *seq; 20 ASN1_STRING *seq;
20 unsigned char *p, *pp; 21 unsigned char *p, *pp;
21 int len; 22 int len;
22 len=i2d_ASN1_SET(cap,NULL,i2d_X509_ALGOR, V_ASN1_SEQUENCE, 23 len=i2d_ASN1_SET_OF_X509_ALGOR(cap,NULL,i2d_X509_ALGOR,
23 V_ASN1_UNIVERSAL, IS_SEQUENCE); 24 V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL,
24 if(!(pp=(unsigned char *)Malloc(len))) { 25 IS_SEQUENCE);
26 if(!(pp=(unsigned char *)OPENSSL_malloc(len))) {
25 PKCS7err(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP,ERR_R_MALLOC_FAILURE); 27 PKCS7err(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP,ERR_R_MALLOC_FAILURE);
26 return 0; 28 return 0;
27 } 29 }
28 p=pp; 30 p=pp;
29 i2d_ASN1_SET(cap,&p,i2d_X509_ALGOR, V_ASN1_SEQUENCE, 31 i2d_ASN1_SET_OF_X509_ALGOR(cap,&p,i2d_X509_ALGOR, V_ASN1_SEQUENCE,
30 V_ASN1_UNIVERSAL, IS_SEQUENCE); 32 V_ASN1_UNIVERSAL, IS_SEQUENCE);
31 if(!(seq = ASN1_STRING_new())) { 33 if(!(seq = ASN1_STRING_new())) {
32 PKCS7err(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP,ERR_R_MALLOC_FAILURE); 34 PKCS7err(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP,ERR_R_MALLOC_FAILURE);
33 return 0; 35 return 0;
@@ -36,27 +38,29 @@ int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK *cap)
36 PKCS7err(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP,ERR_R_MALLOC_FAILURE); 38 PKCS7err(PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP,ERR_R_MALLOC_FAILURE);
37 return 0; 39 return 0;
38 } 40 }
39 Free (pp); 41 OPENSSL_free (pp);
40 return PKCS7_add_signed_attribute(si, NID_SMIMECapabilities, 42 return PKCS7_add_signed_attribute(si, NID_SMIMECapabilities,
41 V_ASN1_SEQUENCE, seq); 43 V_ASN1_SEQUENCE, seq);
42} 44}
43 45
44STACK *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si) 46STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si)
45{ 47{
46 ASN1_TYPE *cap; 48 ASN1_TYPE *cap;
47 unsigned char *p; 49 unsigned char *p;
48 cap = PKCS7_get_signed_attribute(si, NID_SMIMECapabilities); 50 cap = PKCS7_get_signed_attribute(si, NID_SMIMECapabilities);
49 if (!cap) return NULL; 51 if (!cap) return NULL;
50 p = cap->value.sequence->data; 52 p = cap->value.sequence->data;
51 return d2i_ASN1_SET (NULL, &p, cap->value.sequence->length, 53 return d2i_ASN1_SET_OF_X509_ALGOR(NULL, &p,
52 (char *(*)())d2i_X509_ALGOR, X509_ALGOR_free, V_ASN1_SEQUENCE, 54 cap->value.sequence->length,
53 V_ASN1_UNIVERSAL); 55 d2i_X509_ALGOR, X509_ALGOR_free,
56 V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL);
54} 57}
55 58
56/* Basic smime-capabilities OID and optional integer arg */ 59/* Basic smime-capabilities OID and optional integer arg */
57int PKCS7_simple_smimecap(STACK *sk, int nid, int arg) 60int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg)
58{ 61{
59 X509_ALGOR *alg; 62 X509_ALGOR *alg;
63
60 if(!(alg = X509_ALGOR_new())) { 64 if(!(alg = X509_ALGOR_new())) {
61 PKCS7err(PKCS7_F_PKCS7_SIMPLE_SMIMECAP,ERR_R_MALLOC_FAILURE); 65 PKCS7err(PKCS7_F_PKCS7_SIMPLE_SMIMECAP,ERR_R_MALLOC_FAILURE);
62 return 0; 66 return 0;
@@ -80,6 +84,6 @@ int PKCS7_simple_smimecap(STACK *sk, int nid, int arg)
80 alg->parameter->value.integer = nbit; 84 alg->parameter->value.integer = nbit;
81 alg->parameter->type = V_ASN1_INTEGER; 85 alg->parameter->type = V_ASN1_INTEGER;
82 } 86 }
83 sk_push (sk, (char *)alg); 87 sk_X509_ALGOR_push (sk, alg);
84 return 1; 88 return 1;
85} 89}
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c
index 4ab24a86f5..099e9651c1 100644
--- a/src/lib/libcrypto/pkcs7/pk7_doit.c
+++ b/src/lib/libcrypto/pkcs7/pk7_doit.c
@@ -189,7 +189,7 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
189 EVP_PKEY_free(pkey); 189 EVP_PKEY_free(pkey);
190 if (max < jj) max=jj; 190 if (max < jj) max=jj;
191 } 191 }
192 if ((tmp=(unsigned char *)Malloc(max)) == NULL) 192 if ((tmp=(unsigned char *)OPENSSL_malloc(max)) == NULL)
193 { 193 {
194 PKCS7err(PKCS7_F_PKCS7_DATAINIT,ERR_R_MALLOC_FAILURE); 194 PKCS7err(PKCS7_F_PKCS7_DATAINIT,ERR_R_MALLOC_FAILURE);
195 goto err; 195 goto err;
@@ -203,12 +203,12 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio)
203 if (jj <= 0) 203 if (jj <= 0)
204 { 204 {
205 PKCS7err(PKCS7_F_PKCS7_DATAINIT,ERR_R_EVP_LIB); 205 PKCS7err(PKCS7_F_PKCS7_DATAINIT,ERR_R_EVP_LIB);
206 Free(tmp); 206 OPENSSL_free(tmp);
207 goto err; 207 goto err;
208 } 208 }
209 M_ASN1_OCTET_STRING_set(ri->enc_key,tmp,jj); 209 M_ASN1_OCTET_STRING_set(ri->enc_key,tmp,jj);
210 } 210 }
211 Free(tmp); 211 OPENSSL_free(tmp);
212 memset(key, 0, keylen); 212 memset(key, 0, keylen);
213 213
214 if (out == NULL) 214 if (out == NULL)
@@ -265,13 +265,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
265 STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL; 265 STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL;
266 X509_ALGOR *xalg=NULL; 266 X509_ALGOR *xalg=NULL;
267 PKCS7_RECIP_INFO *ri=NULL; 267 PKCS7_RECIP_INFO *ri=NULL;
268#ifndef NO_RC2
269 char is_rc2 = 0;
270#endif
271/* EVP_PKEY *pkey; */
272#if 0
273 X509_STORE_CTX s_ctx;
274#endif
275 268
276 i=OBJ_obj2nid(p7->type); 269 i=OBJ_obj2nid(p7->type);
277 p7->state=PKCS7_S_HEADER; 270 p7->state=PKCS7_S_HEADER;
@@ -312,16 +305,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
312 goto err; 305 goto err;
313 } 306 }
314 307
315 if(EVP_CIPHER_nid(evp_cipher) == NID_rc2_cbc)
316 {
317#ifndef NO_RC2
318 is_rc2 = 1;
319#else
320 PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE);
321 goto err;
322#endif
323 }
324
325 /* We will be checking the signature */ 308 /* We will be checking the signature */
326 if (md_sk != NULL) 309 if (md_sk != NULL)
327 { 310 {
@@ -391,7 +374,7 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
391 } 374 }
392 375
393 jj=EVP_PKEY_size(pkey); 376 jj=EVP_PKEY_size(pkey);
394 tmp=(unsigned char *)Malloc(jj+10); 377 tmp=(unsigned char *)OPENSSL_malloc(jj+10);
395 if (tmp == NULL) 378 if (tmp == NULL)
396 { 379 {
397 PKCS7err(PKCS7_F_PKCS7_DATADECODE,ERR_R_MALLOC_FAILURE); 380 PKCS7err(PKCS7_F_PKCS7_DATADECODE,ERR_R_MALLOC_FAILURE);
@@ -413,24 +396,18 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert)
413 return(NULL); 396 return(NULL);
414 397
415 if (jj != EVP_CIPHER_CTX_key_length(evp_ctx)) { 398 if (jj != EVP_CIPHER_CTX_key_length(evp_ctx)) {
416 /* HACK: some S/MIME clients don't use the same key 399 /* Some S/MIME clients don't use the same key
417 * and effective key length. The key length is 400 * and effective key length. The key length is
418 * determined by the size of the decrypted RSA key. 401 * determined by the size of the decrypted RSA key.
419 * So we hack things to manually set the RC2 key
420 * because we currently can't do this with the EVP
421 * interface.
422 */ 402 */
423#ifndef NO_RC2 403 if(!EVP_CIPHER_CTX_set_key_length(evp_ctx, jj))
424 if(is_rc2) RC2_set_key(&(evp_ctx->c.rc2_ks),jj, tmp,
425 EVP_CIPHER_CTX_key_length(evp_ctx)*8);
426 else
427#endif
428 { 404 {
429 PKCS7err(PKCS7_F_PKCS7_DATADECODE, 405 PKCS7err(PKCS7_F_PKCS7_DATADECODE,
430 PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH); 406 PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH);
431 goto err; 407 goto err;
432 } 408 }
433 } else EVP_CipherInit(evp_ctx,NULL,tmp,NULL,0); 409 }
410 EVP_CipherInit(evp_ctx,NULL,tmp,NULL,0);
434 411
435 memset(tmp,0,jj); 412 memset(tmp,0,jj);
436 413
@@ -479,7 +456,7 @@ err:
479 out=NULL; 456 out=NULL;
480 } 457 }
481 if (tmp != NULL) 458 if (tmp != NULL)
482 Free(tmp); 459 OPENSSL_free(tmp);
483 return(out); 460 return(out);
484 } 461 }
485 462
@@ -557,7 +534,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
557 if (EVP_MD_CTX_type(mdc) == j) 534 if (EVP_MD_CTX_type(mdc) == j)
558 break; 535 break;
559 else 536 else
560 btmp=btmp->next_bio; 537 btmp=BIO_next(btmp);
561 } 538 }
562 539
563 /* We now have the EVP_MD_CTX, lets do the 540 /* We now have the EVP_MD_CTX, lets do the
@@ -601,13 +578,13 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
601 x=i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,NULL, 578 x=i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,NULL,
602 i2d_X509_ATTRIBUTE, 579 i2d_X509_ATTRIBUTE,
603 V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); 580 V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
604 pp=(unsigned char *)Malloc(x); 581 pp=(unsigned char *)OPENSSL_malloc(x);
605 p=pp; 582 p=pp;
606 i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,&p, 583 i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,&p,
607 i2d_X509_ATTRIBUTE, 584 i2d_X509_ATTRIBUTE,
608 V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); 585 V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);
609 EVP_SignUpdate(&ctx_tmp,pp,x); 586 EVP_SignUpdate(&ctx_tmp,pp,x);
610 Free(pp); 587 OPENSSL_free(pp);
611 pp=NULL; 588 pp=NULL;
612 } 589 }
613 590
@@ -650,7 +627,7 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio)
650 (unsigned char *)buf_mem->data,buf_mem->length); 627 (unsigned char *)buf_mem->data,buf_mem->length);
651#endif 628#endif
652 } 629 }
653 if (pp != NULL) Free(pp); 630 if (pp != NULL) OPENSSL_free(pp);
654 pp=NULL; 631 pp=NULL;
655 632
656 ret=1; 633 ret=1;
@@ -749,7 +726,7 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
749 } 726 }
750 if (EVP_MD_CTX_type(mdc) == md_type) 727 if (EVP_MD_CTX_type(mdc) == md_type)
751 break; 728 break;
752 btmp=btmp->next_bio; 729 btmp=BIO_next(btmp);
753 } 730 }
754 731
755 /* mdc is the digest ctx that we want, unless there are attributes, 732 /* mdc is the digest ctx that we want, unless there are attributes,
@@ -795,13 +772,13 @@ for (ii=0; ii<md_len; ii++) printf("%02X",md_dat[ii]); printf(" calc\n");
795 */ 772 */
796 i=i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,NULL,i2d_X509_ATTRIBUTE, 773 i=i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,NULL,i2d_X509_ATTRIBUTE,
797 V_ASN1_SET,V_ASN1_UNIVERSAL, IS_SEQUENCE); 774 V_ASN1_SET,V_ASN1_UNIVERSAL, IS_SEQUENCE);
798 pp=Malloc(i); 775 pp=OPENSSL_malloc(i);
799 p=pp; 776 p=pp;
800 i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,&p,i2d_X509_ATTRIBUTE, 777 i2d_ASN1_SET_OF_X509_ATTRIBUTE(sk,&p,i2d_X509_ATTRIBUTE,
801 V_ASN1_SET,V_ASN1_UNIVERSAL, IS_SEQUENCE); 778 V_ASN1_SET,V_ASN1_UNIVERSAL, IS_SEQUENCE);
802 EVP_VerifyUpdate(&mdc_tmp,pp,i); 779 EVP_VerifyUpdate(&mdc_tmp,pp,i);
803 780
804 Free(pp); 781 OPENSSL_free(pp);
805 } 782 }
806 783
807 os=si->enc_digest; 784 os=si->enc_digest;
@@ -932,7 +909,7 @@ static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
932 909
933 if (*sk == NULL) 910 if (*sk == NULL)
934 { 911 {
935 *sk = sk_X509_ATTRIBUTE_new(NULL); 912 *sk = sk_X509_ATTRIBUTE_new_null();
936new_attrib: 913new_attrib:
937 attr=X509_ATTRIBUTE_create(nid,atrtype,value); 914 attr=X509_ATTRIBUTE_create(nid,atrtype,value);
938 sk_X509_ATTRIBUTE_push(*sk,attr); 915 sk_X509_ATTRIBUTE_push(*sk,attr);
diff --git a/src/lib/libcrypto/pkcs7/pk7_mime.c b/src/lib/libcrypto/pkcs7/pk7_mime.c
index 734643be28..994473c0bd 100644
--- a/src/lib/libcrypto/pkcs7/pk7_mime.c
+++ b/src/lib/libcrypto/pkcs7/pk7_mime.c
@@ -70,16 +70,21 @@
70 */ 70 */
71 71
72typedef struct { 72typedef struct {
73char *name; /* Name of line e.g. "content-type" */
74char *value; /* Value of line e.g. "text/plain" */
75STACK /* MIME_PARAM */ *params; /* Zero or more parameters */
76} MIME_HEADER;
77
78typedef struct {
79char *param_name; /* Param name e.g. "micalg" */ 73char *param_name; /* Param name e.g. "micalg" */
80char *param_value; /* Param value e.g. "sha1" */ 74char *param_value; /* Param value e.g. "sha1" */
81} MIME_PARAM; 75} MIME_PARAM;
82 76
77DECLARE_STACK_OF(MIME_PARAM)
78IMPLEMENT_STACK_OF(MIME_PARAM)
79
80typedef struct {
81char *name; /* Name of line e.g. "content-type" */
82char *value; /* Value of line e.g. "text/plain" */
83STACK_OF(MIME_PARAM) *params; /* Zero or more parameters */
84} MIME_HEADER;
85
86DECLARE_STACK_OF(MIME_HEADER)
87IMPLEMENT_STACK_OF(MIME_HEADER)
83 88
84static int B64_write_PKCS7(BIO *bio, PKCS7 *p7); 89static int B64_write_PKCS7(BIO *bio, PKCS7 *p7);
85static PKCS7 *B64_read_PKCS7(BIO *bio); 90static PKCS7 *B64_read_PKCS7(BIO *bio);
@@ -88,14 +93,16 @@ static char * strip_start(char *name);
88static char * strip_end(char *name); 93static char * strip_end(char *name);
89static MIME_HEADER *mime_hdr_new(char *name, char *value); 94static MIME_HEADER *mime_hdr_new(char *name, char *value);
90static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value); 95static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value);
91static STACK *mime_parse_hdr(BIO *bio); 96static STACK_OF(MIME_HEADER) *mime_parse_hdr(BIO *bio);
92static int mime_hdr_cmp(MIME_HEADER **a, MIME_HEADER **b); 97static int mime_hdr_cmp(const MIME_HEADER * const *a,
93static int mime_param_cmp(MIME_PARAM **a, MIME_PARAM **b); 98 const MIME_HEADER * const *b);
99static int mime_param_cmp(const MIME_PARAM * const *a,
100 const MIME_PARAM * const *b);
94static void mime_param_free(MIME_PARAM *param); 101static void mime_param_free(MIME_PARAM *param);
95static int mime_bound_check(char *line, int linelen, char *bound, int blen); 102static int mime_bound_check(char *line, int linelen, char *bound, int blen);
96static int multi_split(BIO *bio, char *bound, STACK **ret); 103static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret);
97static int iscrlf(char c); 104static int iscrlf(char c);
98static MIME_HEADER *mime_hdr_find(STACK *hdrs, char *name); 105static MIME_HEADER *mime_hdr_find(STACK_OF(MIME_HEADER) *hdrs, char *name);
99static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, char *name); 106static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, char *name);
100static void mime_hdr_free(MIME_HEADER *hdr); 107static void mime_hdr_free(MIME_HEADER *hdr);
101 108
@@ -163,7 +170,7 @@ int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags)
163 BIO_printf(bio, "micalg=sha1 ; boundary=\"----%s\"\n\n", bound); 170 BIO_printf(bio, "micalg=sha1 ; boundary=\"----%s\"\n\n", bound);
164 BIO_printf(bio, "This is an S/MIME signed message\n\n"); 171 BIO_printf(bio, "This is an S/MIME signed message\n\n");
165 /* Now write out the first part */ 172 /* Now write out the first part */
166 BIO_printf(bio, "------%s\r\n", bound); 173 BIO_printf(bio, "------%s\n", bound);
167 if(flags & PKCS7_TEXT) BIO_printf(bio, "Content-Type: text/plain\n\n"); 174 if(flags & PKCS7_TEXT) BIO_printf(bio, "Content-Type: text/plain\n\n");
168 while((i = BIO_read(data, linebuf, MAX_SMLEN)) > 0) 175 while((i = BIO_read(data, linebuf, MAX_SMLEN)) > 0)
169 BIO_write(bio, linebuf, i); 176 BIO_write(bio, linebuf, i);
@@ -196,8 +203,8 @@ int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags)
196PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont) 203PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
197{ 204{
198 BIO *p7in; 205 BIO *p7in;
199 STACK *headers = NULL; 206 STACK_OF(MIME_HEADER) *headers = NULL;
200 STACK *parts = NULL; 207 STACK_OF(BIO) *parts = NULL;
201 MIME_HEADER *hdr; 208 MIME_HEADER *hdr;
202 MIME_PARAM *prm; 209 MIME_PARAM *prm;
203 PKCS7 *p7; 210 PKCS7 *p7;
@@ -211,7 +218,7 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
211 } 218 }
212 219
213 if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) { 220 if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) {
214 sk_pop_free(headers, mime_hdr_free); 221 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
215 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_CONTENT_TYPE); 222 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_CONTENT_TYPE);
216 return NULL; 223 return NULL;
217 } 224 }
@@ -222,24 +229,24 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
222 /* Split into two parts */ 229 /* Split into two parts */
223 prm = mime_param_find(hdr, "boundary"); 230 prm = mime_param_find(hdr, "boundary");
224 if(!prm || !prm->param_value) { 231 if(!prm || !prm->param_value) {
225 sk_pop_free(headers, mime_hdr_free); 232 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
226 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BOUNDARY); 233 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BOUNDARY);
227 return NULL; 234 return NULL;
228 } 235 }
229 ret = multi_split(bio, prm->param_value, &parts); 236 ret = multi_split(bio, prm->param_value, &parts);
230 sk_pop_free(headers, mime_hdr_free); 237 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
231 if(!ret || (sk_num(parts) != 2) ) { 238 if(!ret || (sk_BIO_num(parts) != 2) ) {
232 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BODY_FAILURE); 239 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_MULTIPART_BODY_FAILURE);
233 sk_pop_free(parts, (stkfree)BIO_free); 240 sk_BIO_pop_free(parts, BIO_vfree);
234 return NULL; 241 return NULL;
235 } 242 }
236 243
237 /* Parse the signature piece */ 244 /* Parse the signature piece */
238 p7in = (BIO *)sk_value(parts, 1); 245 p7in = sk_BIO_value(parts, 1);
239 246
240 if (!(headers = mime_parse_hdr(p7in))) { 247 if (!(headers = mime_parse_hdr(p7in))) {
241 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_MIME_SIG_PARSE_ERROR); 248 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_MIME_SIG_PARSE_ERROR);
242 sk_pop_free(parts, (stkfree)BIO_free); 249 sk_BIO_pop_free(parts, BIO_vfree);
243 return NULL; 250 return NULL;
244 } 251 }
245 252
@@ -247,32 +254,32 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
247 254
248 if(!(hdr = mime_hdr_find(headers, "content-type")) || 255 if(!(hdr = mime_hdr_find(headers, "content-type")) ||
249 !hdr->value) { 256 !hdr->value) {
250 sk_pop_free(headers, mime_hdr_free); 257 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
251 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_SIG_CONTENT_TYPE); 258 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_NO_SIG_CONTENT_TYPE);
252 return NULL; 259 return NULL;
253 } 260 }
254 261
255 if(strcmp(hdr->value, "application/x-pkcs7-signature") && 262 if(strcmp(hdr->value, "application/x-pkcs7-signature") &&
256 strcmp(hdr->value, "application/pkcs7-signature")) { 263 strcmp(hdr->value, "application/pkcs7-signature")) {
257 sk_pop_free(headers, mime_hdr_free); 264 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
258 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_SIG_INVALID_MIME_TYPE); 265 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_SIG_INVALID_MIME_TYPE);
259 ERR_add_error_data(2, "type: ", hdr->value); 266 ERR_add_error_data(2, "type: ", hdr->value);
260 sk_pop_free(parts, (stkfree)BIO_free); 267 sk_BIO_pop_free(parts, BIO_vfree);
261 return NULL; 268 return NULL;
262 } 269 }
263 sk_pop_free(headers, mime_hdr_free); 270 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
264 /* Read in PKCS#7 */ 271 /* Read in PKCS#7 */
265 if(!(p7 = B64_read_PKCS7(p7in))) { 272 if(!(p7 = B64_read_PKCS7(p7in))) {
266 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_PKCS7_SIG_PARSE_ERROR); 273 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_PKCS7_SIG_PARSE_ERROR);
267 sk_pop_free(parts, (stkfree)BIO_free); 274 sk_BIO_pop_free(parts, BIO_vfree);
268 return NULL; 275 return NULL;
269 } 276 }
270 277
271 if(bcont) { 278 if(bcont) {
272 *bcont = (BIO *)sk_value(parts, 0); 279 *bcont = sk_BIO_value(parts, 0);
273 BIO_free(p7in); 280 BIO_free(p7in);
274 sk_free(parts); 281 sk_BIO_free(parts);
275 } else sk_pop_free(parts, (stkfree)BIO_free); 282 } else sk_BIO_pop_free(parts, BIO_vfree);
276 return p7; 283 return p7;
277 } 284 }
278 285
@@ -282,11 +289,11 @@ PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont)
282 strcmp (hdr->value, "application/pkcs7-mime")) { 289 strcmp (hdr->value, "application/pkcs7-mime")) {
283 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_INVALID_MIME_TYPE); 290 PKCS7err(PKCS7_F_SMIME_READ_PKCS7,PKCS7_R_INVALID_MIME_TYPE);
284 ERR_add_error_data(2, "type: ", hdr->value); 291 ERR_add_error_data(2, "type: ", hdr->value);
285 sk_pop_free(headers, mime_hdr_free); 292 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
286 return NULL; 293 return NULL;
287 } 294 }
288 295
289 sk_pop_free(headers, mime_hdr_free); 296 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
290 297
291 if(!(p7 = B64_read_PKCS7(bio))) { 298 if(!(p7 = B64_read_PKCS7(bio))) {
292 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_PKCS7_PARSE_ERROR); 299 PKCS7err(PKCS7_F_SMIME_READ_PKCS7, PKCS7_R_PKCS7_PARSE_ERROR);
@@ -325,24 +332,25 @@ int SMIME_text(BIO *in, BIO *out)
325{ 332{
326 char iobuf[4096]; 333 char iobuf[4096];
327 int len; 334 int len;
328 STACK *headers; 335 STACK_OF(MIME_HEADER) *headers;
329 MIME_HEADER *hdr; 336 MIME_HEADER *hdr;
337
330 if (!(headers = mime_parse_hdr(in))) { 338 if (!(headers = mime_parse_hdr(in))) {
331 PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_MIME_PARSE_ERROR); 339 PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_MIME_PARSE_ERROR);
332 return 0; 340 return 0;
333 } 341 }
334 if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) { 342 if(!(hdr = mime_hdr_find(headers, "content-type")) || !hdr->value) {
335 PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_MIME_NO_CONTENT_TYPE); 343 PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_MIME_NO_CONTENT_TYPE);
336 sk_pop_free(headers, mime_hdr_free); 344 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
337 return 0; 345 return 0;
338 } 346 }
339 if (strcmp (hdr->value, "text/plain")) { 347 if (strcmp (hdr->value, "text/plain")) {
340 PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_INVALID_MIME_TYPE); 348 PKCS7err(PKCS7_F_SMIME_TEXT,PKCS7_R_INVALID_MIME_TYPE);
341 ERR_add_error_data(2, "type: ", hdr->value); 349 ERR_add_error_data(2, "type: ", hdr->value);
342 sk_pop_free(headers, mime_hdr_free); 350 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
343 return 0; 351 return 0;
344 } 352 }
345 sk_pop_free(headers, mime_hdr_free); 353 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
346 while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0) 354 while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0)
347 BIO_write(out, iobuf, len); 355 BIO_write(out, iobuf, len);
348 return 1; 356 return 1;
@@ -352,18 +360,19 @@ int SMIME_text(BIO *in, BIO *out)
352 * canonical parts in a STACK of bios 360 * canonical parts in a STACK of bios
353 */ 361 */
354 362
355static int multi_split(BIO *bio, char *bound, STACK **ret) 363static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret)
356{ 364{
357 char linebuf[MAX_SMLEN]; 365 char linebuf[MAX_SMLEN];
358 int len, blen; 366 int len, blen;
359 BIO *bpart = NULL; 367 BIO *bpart = NULL;
360 STACK *parts; 368 STACK_OF(BIO) *parts;
361 char state, part, first; 369 char state, part, first;
370
362 blen = strlen(bound); 371 blen = strlen(bound);
363 part = 0; 372 part = 0;
364 state = 0; 373 state = 0;
365 first = 1; 374 first = 1;
366 parts = sk_new(NULL); 375 parts = sk_BIO_new_null();
367 *ret = parts; 376 *ret = parts;
368 while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) { 377 while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
369 state = mime_bound_check(linebuf, len, bound, blen); 378 state = mime_bound_check(linebuf, len, bound, blen);
@@ -371,12 +380,12 @@ static int multi_split(BIO *bio, char *bound, STACK **ret)
371 first = 1; 380 first = 1;
372 part++; 381 part++;
373 } else if(state == 2) { 382 } else if(state == 2) {
374 sk_push(parts, (char *)bpart); 383 sk_BIO_push(parts, bpart);
375 return 1; 384 return 1;
376 } else if(part) { 385 } else if(part) {
377 if(first) { 386 if(first) {
378 first = 0; 387 first = 0;
379 if(bpart) sk_push(parts, (char *)bpart); 388 if(bpart) sk_BIO_push(parts, bpart);
380 bpart = BIO_new(BIO_s_mem()); 389 bpart = BIO_new(BIO_s_mem());
381 390
382 } else BIO_write(bpart, "\r\n", 2); 391 } else BIO_write(bpart, "\r\n", 2);
@@ -405,15 +414,16 @@ static int iscrlf(char c)
405#define MIME_COMMENT 6 414#define MIME_COMMENT 6
406 415
407 416
408static STACK *mime_parse_hdr(BIO *bio) 417static STACK_OF(MIME_HEADER) *mime_parse_hdr(BIO *bio)
409{ 418{
410 char *p, *q, c; 419 char *p, *q, c;
411 char *ntmp; 420 char *ntmp;
412 char linebuf[MAX_SMLEN]; 421 char linebuf[MAX_SMLEN];
413 MIME_HEADER *mhdr = NULL; 422 MIME_HEADER *mhdr = NULL;
414 STACK *headers; 423 STACK_OF(MIME_HEADER) *headers;
415 int len, state, save_state = 0; 424 int len, state, save_state = 0;
416 headers = sk_new(mime_hdr_cmp); 425
426 headers = sk_MIME_HEADER_new(mime_hdr_cmp);
417 while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) { 427 while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) {
418 /* If whitespace at line start then continuation line */ 428 /* If whitespace at line start then continuation line */
419 if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME; 429 if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME;
@@ -441,7 +451,7 @@ static STACK *mime_parse_hdr(BIO *bio)
441 mime_debug("Found End Value\n"); 451 mime_debug("Found End Value\n");
442 *p = 0; 452 *p = 0;
443 mhdr = mime_hdr_new(ntmp, strip_ends(q)); 453 mhdr = mime_hdr_new(ntmp, strip_ends(q));
444 sk_push(headers, (char *)mhdr); 454 sk_MIME_HEADER_push(headers, mhdr);
445 ntmp = NULL; 455 ntmp = NULL;
446 q = p + 1; 456 q = p + 1;
447 state = MIME_NAME; 457 state = MIME_NAME;
@@ -493,7 +503,7 @@ static STACK *mime_parse_hdr(BIO *bio)
493 503
494 if(state == MIME_TYPE) { 504 if(state == MIME_TYPE) {
495 mhdr = mime_hdr_new(ntmp, strip_ends(q)); 505 mhdr = mime_hdr_new(ntmp, strip_ends(q));
496 sk_push(headers, (char *)mhdr); 506 sk_MIME_HEADER_push(headers, mhdr);
497 } else if(state == MIME_VALUE) 507 } else if(state == MIME_VALUE)
498 mime_hdr_addparam(mhdr, ntmp, strip_ends(q)); 508 mime_hdr_addparam(mhdr, ntmp, strip_ends(q));
499 if(p == linebuf) break; /* Blank line means end of headers */ 509 if(p == linebuf) break; /* Blank line means end of headers */
@@ -569,11 +579,11 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
569 } 579 }
570 } 580 }
571 } else tmpval = NULL; 581 } else tmpval = NULL;
572 mhdr = (MIME_HEADER *) Malloc(sizeof(MIME_HEADER)); 582 mhdr = (MIME_HEADER *) OPENSSL_malloc(sizeof(MIME_HEADER));
573 if(!mhdr) return NULL; 583 if(!mhdr) return NULL;
574 mhdr->name = tmpname; 584 mhdr->name = tmpname;
575 mhdr->value = tmpval; 585 mhdr->value = tmpval;
576 if(!(mhdr->params = sk_new(mime_param_cmp))) return NULL; 586 if(!(mhdr->params = sk_MIME_PARAM_new(mime_param_cmp))) return NULL;
577 return mhdr; 587 return mhdr;
578} 588}
579 589
@@ -598,34 +608,36 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
598 if(!tmpval) return 0; 608 if(!tmpval) return 0;
599 } else tmpval = NULL; 609 } else tmpval = NULL;
600 /* Parameter values are case sensitive so leave as is */ 610 /* Parameter values are case sensitive so leave as is */
601 mparam = (MIME_PARAM *) Malloc(sizeof(MIME_PARAM)); 611 mparam = (MIME_PARAM *) OPENSSL_malloc(sizeof(MIME_PARAM));
602 if(!mparam) return 0; 612 if(!mparam) return 0;
603 mparam->param_name = tmpname; 613 mparam->param_name = tmpname;
604 mparam->param_value = tmpval; 614 mparam->param_value = tmpval;
605 sk_push(mhdr->params, (char *)mparam); 615 sk_MIME_PARAM_push(mhdr->params, mparam);
606 return 1; 616 return 1;
607} 617}
608 618
609static int mime_hdr_cmp(MIME_HEADER **a, MIME_HEADER **b) 619static int mime_hdr_cmp(const MIME_HEADER * const *a,
620 const MIME_HEADER * const *b)
610{ 621{
611 return(strcmp((*a)->name, (*b)->name)); 622 return(strcmp((*a)->name, (*b)->name));
612} 623}
613 624
614static int mime_param_cmp(MIME_PARAM **a, MIME_PARAM **b) 625static int mime_param_cmp(const MIME_PARAM * const *a,
626 const MIME_PARAM * const *b)
615{ 627{
616 return(strcmp((*a)->param_name, (*b)->param_name)); 628 return(strcmp((*a)->param_name, (*b)->param_name));
617} 629}
618 630
619/* Find a header with a given name (if possible) */ 631/* Find a header with a given name (if possible) */
620 632
621static MIME_HEADER *mime_hdr_find(STACK *hdrs, char *name) 633static MIME_HEADER *mime_hdr_find(STACK_OF(MIME_HEADER) *hdrs, char *name)
622{ 634{
623 MIME_HEADER htmp; 635 MIME_HEADER htmp;
624 int idx; 636 int idx;
625 htmp.name = name; 637 htmp.name = name;
626 idx = sk_find(hdrs, (char *)&htmp); 638 idx = sk_MIME_HEADER_find(hdrs, &htmp);
627 if(idx < 0) return NULL; 639 if(idx < 0) return NULL;
628 return (MIME_HEADER *)sk_value(hdrs, idx); 640 return sk_MIME_HEADER_value(hdrs, idx);
629} 641}
630 642
631static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, char *name) 643static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, char *name)
@@ -633,24 +645,24 @@ static MIME_PARAM *mime_param_find(MIME_HEADER *hdr, char *name)
633 MIME_PARAM param; 645 MIME_PARAM param;
634 int idx; 646 int idx;
635 param.param_name = name; 647 param.param_name = name;
636 idx = sk_find(hdr->params, (char *)&param); 648 idx = sk_MIME_PARAM_find(hdr->params, &param);
637 if(idx < 0) return NULL; 649 if(idx < 0) return NULL;
638 return (MIME_PARAM *)sk_value(hdr->params, idx); 650 return sk_MIME_PARAM_value(hdr->params, idx);
639} 651}
640 652
641static void mime_hdr_free(MIME_HEADER *hdr) 653static void mime_hdr_free(MIME_HEADER *hdr)
642{ 654{
643 if(hdr->name) Free(hdr->name); 655 if(hdr->name) OPENSSL_free(hdr->name);
644 if(hdr->value) Free(hdr->value); 656 if(hdr->value) OPENSSL_free(hdr->value);
645 if(hdr->params) sk_pop_free(hdr->params, mime_param_free); 657 if(hdr->params) sk_MIME_PARAM_pop_free(hdr->params, mime_param_free);
646 Free(hdr); 658 OPENSSL_free(hdr);
647} 659}
648 660
649static void mime_param_free(MIME_PARAM *param) 661static void mime_param_free(MIME_PARAM *param)
650{ 662{
651 if(param->param_name) Free(param->param_name); 663 if(param->param_name) OPENSSL_free(param->param_name);
652 if(param->param_value) Free(param->param_value); 664 if(param->param_value) OPENSSL_free(param->param_value);
653 Free(param); 665 OPENSSL_free(param);
654} 666}
655 667
656/* Check for a multipart boundary. Returns: 668/* Check for a multipart boundary. Returns:
diff --git a/src/lib/libcrypto/pkcs7/pk7_smime.c b/src/lib/libcrypto/pkcs7/pk7_smime.c
index b41f42ed04..d716f9faeb 100644
--- a/src/lib/libcrypto/pkcs7/pk7_smime.c
+++ b/src/lib/libcrypto/pkcs7/pk7_smime.c
@@ -64,12 +64,12 @@
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 66PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
67 BIO *data, int flags) 67 BIO *data, int flags)
68{ 68{
69 PKCS7 *p7; 69 PKCS7 *p7;
70 PKCS7_SIGNER_INFO *si; 70 PKCS7_SIGNER_INFO *si;
71 BIO *p7bio; 71 BIO *p7bio;
72 STACK *smcap; 72 STACK_OF(X509_ALGOR) *smcap;
73 int i; 73 int i;
74 74
75 if(!X509_check_private_key(signcert, pkey)) { 75 if(!X509_check_private_key(signcert, pkey)) {
@@ -109,7 +109,9 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
109 PKCS7_add_signed_attribute(si, NID_pkcs9_contentType, 109 PKCS7_add_signed_attribute(si, NID_pkcs9_contentType,
110 V_ASN1_OBJECT, OBJ_nid2obj(NID_pkcs7_data)); 110 V_ASN1_OBJECT, OBJ_nid2obj(NID_pkcs7_data));
111 /* Add SMIMECapabilities */ 111 /* Add SMIMECapabilities */
112 if(!(smcap = sk_new(NULL))) { 112 if(!(flags & PKCS7_NOSMIMECAP))
113 {
114 if(!(smcap = sk_X509_ALGOR_new_null())) {
113 PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE); 115 PKCS7err(PKCS7_F_PKCS7_SIGN,ERR_R_MALLOC_FAILURE);
114 return NULL; 116 return NULL;
115 } 117 }
@@ -127,7 +129,8 @@ PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
127 PKCS7_simple_smimecap (smcap, NID_rc2_cbc, 40); 129 PKCS7_simple_smimecap (smcap, NID_rc2_cbc, 40);
128#endif 130#endif
129 PKCS7_add_attrib_smimecap (si, smcap); 131 PKCS7_add_attrib_smimecap (si, smcap);
130 sk_pop_free(smcap, X509_ALGOR_free); 132 sk_X509_ALGOR_pop_free(smcap, X509_ALGOR_free);
133 }
131 } 134 }
132 135
133 if(flags & PKCS7_DETACHED)PKCS7_set_detached(p7, 1); 136 if(flags & PKCS7_DETACHED)PKCS7_set_detached(p7, 1);
@@ -150,7 +153,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
150 PKCS7_SIGNER_INFO *si; 153 PKCS7_SIGNER_INFO *si;
151 X509_STORE_CTX cert_ctx; 154 X509_STORE_CTX cert_ctx;
152 char buf[4096]; 155 char buf[4096];
153 int i, j=0; 156 int i, j=0, k;
154 BIO *p7bio; 157 BIO *p7bio;
155 BIO *tmpout; 158 BIO *tmpout;
156 159
@@ -169,12 +172,17 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
169 PKCS7err(PKCS7_F_PKCS7_VERIFY,PKCS7_R_NO_CONTENT); 172 PKCS7err(PKCS7_F_PKCS7_VERIFY,PKCS7_R_NO_CONTENT);
170 return 0; 173 return 0;
171 } 174 }
175#if 0
176 /* NB: this test commented out because some versions of Netscape
177 * illegally include zero length content when signing data.
178 */
172 179
173 /* Check for data and content: two sets of data */ 180 /* Check for data and content: two sets of data */
174 if(!PKCS7_get_detached(p7) && indata) { 181 if(!PKCS7_get_detached(p7) && indata) {
175 PKCS7err(PKCS7_F_PKCS7_VERIFY,PKCS7_R_CONTENT_AND_DATA_PRESENT); 182 PKCS7err(PKCS7_F_PKCS7_VERIFY,PKCS7_R_CONTENT_AND_DATA_PRESENT);
176 return 0; 183 return 0;
177 } 184 }
185#endif
178 186
179 sinfos = PKCS7_get_signer_info(p7); 187 sinfos = PKCS7_get_signer_info(p7);
180 188
@@ -190,8 +198,8 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
190 198
191 /* Now verify the certificates */ 199 /* Now verify the certificates */
192 200
193 if (!(flags & PKCS7_NOVERIFY)) for (i = 0; i < sk_X509_num(signers); i++) { 201 if (!(flags & PKCS7_NOVERIFY)) for (k = 0; k < sk_X509_num(signers); k++) {
194 signer = sk_X509_value (signers, i); 202 signer = sk_X509_value (signers, k);
195 if (!(flags & PKCS7_NOCHAIN)) { 203 if (!(flags & PKCS7_NOCHAIN)) {
196 X509_STORE_CTX_init(&cert_ctx, store, signer, 204 X509_STORE_CTX_init(&cert_ctx, store, signer,
197 p7->d.sign->cert); 205 p7->d.sign->cert);
@@ -282,7 +290,7 @@ STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags)
282 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE); 290 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,PKCS7_R_WRONG_CONTENT_TYPE);
283 return NULL; 291 return NULL;
284 } 292 }
285 if(!(signers = sk_X509_new(NULL))) { 293 if(!(signers = sk_X509_new_null())) {
286 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,ERR_R_MALLOC_FAILURE); 294 PKCS7err(PKCS7_F_PKCS7_GET0_SIGNERS,ERR_R_MALLOC_FAILURE);
287 return NULL; 295 return NULL;
288 } 296 }
diff --git a/src/lib/libcrypto/pkcs7/pkcs7.h b/src/lib/libcrypto/pkcs7/pkcs7.h
index 3ec725d226..1b817e605d 100644
--- a/src/lib/libcrypto/pkcs7/pkcs7.h
+++ b/src/lib/libcrypto/pkcs7/pkcs7.h
@@ -59,15 +59,13 @@
59#ifndef HEADER_PKCS7_H 59#ifndef HEADER_PKCS7_H
60#define HEADER_PKCS7_H 60#define HEADER_PKCS7_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#include <openssl/bio.h> 62#include <openssl/bio.h>
67#include <openssl/x509.h> 63#include <openssl/x509.h>
68 64
69#ifdef VMS 65#include <openssl/symhacks.h>
70#include <openssl/vms_idhacks.h> 66
67#ifdef __cplusplus
68extern "C" {
71#endif 69#endif
72 70
73#ifdef WIN32 71#ifdef WIN32
@@ -210,9 +208,16 @@ typedef struct pkcs7_st
210 208
211 /* NID_pkcs7_encrypted */ 209 /* NID_pkcs7_encrypted */
212 PKCS7_ENCRYPT *encrypted; 210 PKCS7_ENCRYPT *encrypted;
211
212 /* Anything else */
213 ASN1_TYPE *other;
213 } d; 214 } d;
214 } PKCS7; 215 } PKCS7;
215 216
217DECLARE_STACK_OF(PKCS7)
218DECLARE_ASN1_SET_OF(PKCS7)
219DECLARE_PKCS12_STACK_OF(PKCS7)
220
216#define PKCS7_OP_SET_DETACHED_SIGNATURE 1 221#define PKCS7_OP_SET_DETACHED_SIGNATURE 1
217#define PKCS7_OP_GET_DETACHED_SIGNATURE 2 222#define PKCS7_OP_GET_DETACHED_SIGNATURE 2
218 223
@@ -240,15 +245,16 @@ typedef struct pkcs7_st
240 245
241/* S/MIME related flags */ 246/* S/MIME related flags */
242 247
243#define PKCS7_TEXT 0x1 248#define PKCS7_TEXT 0x1
244#define PKCS7_NOCERTS 0x2 249#define PKCS7_NOCERTS 0x2
245#define PKCS7_NOSIGS 0x4 250#define PKCS7_NOSIGS 0x4
246#define PKCS7_NOCHAIN 0x8 251#define PKCS7_NOCHAIN 0x8
247#define PKCS7_NOINTERN 0x10 252#define PKCS7_NOINTERN 0x10
248#define PKCS7_NOVERIFY 0x20 253#define PKCS7_NOVERIFY 0x20
249#define PKCS7_DETACHED 0x40 254#define PKCS7_DETACHED 0x40
250#define PKCS7_BINARY 0x80 255#define PKCS7_BINARY 0x80
251#define PKCS7_NOATTR 0x100 256#define PKCS7_NOATTR 0x100
257#define PKCS7_NOSMIMECAP 0x200
252 258
253/* Flags: for compatibility with older code */ 259/* Flags: for compatibility with older code */
254 260
@@ -402,9 +408,10 @@ PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, EVP_CIPHER *cipher,
402 int flags); 408 int flags);
403int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags); 409int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
404 410
405int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, STACK *cap); 411int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
406STACK *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); 412 STACK_OF(X509_ALGOR) *cap);
407int PKCS7_simple_smimecap(STACK *sk, int nid, int arg); 413STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
414int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
408 415
409int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); 416int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
410PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); 417PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
diff --git a/src/lib/libcrypto/rand/Makefile.ssl b/src/lib/libcrypto/rand/Makefile.ssl
index be8eea34a2..5f6199a35f 100644
--- a/src/lib/libcrypto/rand/Makefile.ssl
+++ b/src/lib/libcrypto/rand/Makefile.ssl
@@ -22,8 +22,8 @@ TEST= randtest.c
22APPS= 22APPS=
23 23
24LIB=$(TOP)/libcrypto.a 24LIB=$(TOP)/libcrypto.a
25LIBSRC=md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c 25LIBSRC=md_rand.c randfile.c rand_lib.c rand_err.c rand_egd.c rand_win.c
26LIBOBJ=md_rand.o randfile.o rand_lib.o rand_err.o rand_egd.o 26LIBOBJ=md_rand.o randfile.o rand_lib.o rand_err.o rand_egd.o rand_win.o
27 27
28SRC= $(LIBSRC) 28SRC= $(LIBSRC)
29 29
@@ -78,15 +78,45 @@ clean:
78 78
79# DO NOT DELETE THIS LINE -- make depend depends on it. 79# DO NOT DELETE THIS LINE -- make depend depends on it.
80 80
81md_rand.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 81md_rand.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
82md_rand.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 82md_rand.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
83md_rand.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
83md_rand.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 84md_rand.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
84md_rand.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 85md_rand.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
85md_rand.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 86md_rand.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
87md_rand.o: ../../include/openssl/symhacks.h rand_lcl.h
86rand_egd.o: ../../include/openssl/opensslconf.h ../../include/openssl/rand.h 88rand_egd.o: ../../include/openssl/opensslconf.h ../../include/openssl/rand.h
87rand_err.o: ../../include/openssl/err.h ../../include/openssl/rand.h 89rand_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
88rand_lib.o: ../../include/openssl/rand.h 90rand_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
91rand_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
92rand_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
93rand_err.o: ../../include/openssl/symhacks.h
94rand_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
95rand_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
96rand_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h
97rand_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
98rand_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
99rand_lib.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
100rand_lib.o: ../../include/openssl/idea.h ../../include/openssl/md2.h
101rand_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
102rand_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
103rand_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
104rand_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
105rand_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
106rand_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
107rand_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
108rand_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
109rand_lib.o: ../../include/openssl/symhacks.h
110rand_win.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
111rand_win.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
112rand_win.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
113rand_win.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
114rand_win.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
115rand_win.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
116rand_win.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
117rand_win.o: ../cryptlib.h rand_lcl.h
89randfile.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 118randfile.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
90randfile.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h 119randfile.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
91randfile.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 120randfile.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
92randfile.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 121randfile.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
122randfile.o: ../../include/openssl/symhacks.h
diff --git a/src/lib/libcrypto/rand/md_rand.c b/src/lib/libcrypto/rand/md_rand.c
index da4258c479..d167dea77d 100644
--- a/src/lib/libcrypto/rand/md_rand.c
+++ b/src/lib/libcrypto/rand/md_rand.c
@@ -109,9 +109,7 @@
109 * 109 *
110 */ 110 */
111 111
112#define ENTROPY_NEEDED 16 /* require 128 bits = 16 bytes of randomness */ 112#ifdef MD_RAND_DEBUG
113
114#ifndef MD_RAND_DEBUG
115# ifndef NDEBUG 113# ifndef NDEBUG
116# define NDEBUG 114# define NDEBUG
117# endif 115# endif
@@ -119,75 +117,20 @@
119 117
120#include <assert.h> 118#include <assert.h>
121#include <stdio.h> 119#include <stdio.h>
122#include <time.h>
123#include <string.h> 120#include <string.h>
124 121
125#include "openssl/e_os.h" 122#include "openssl/e_os.h"
126 123
124#include <openssl/rand.h>
125#include "rand_lcl.h"
126
127#include <openssl/crypto.h> 127#include <openssl/crypto.h>
128#include <openssl/err.h> 128#include <openssl/err.h>
129 129
130#if !defined(USE_MD5_RAND) && !defined(USE_SHA1_RAND) && !defined(USE_MDC2_RAND) && !defined(USE_MD2_RAND)
131#if !defined(NO_SHA) && !defined(NO_SHA1)
132#define USE_SHA1_RAND
133#elif !defined(NO_MD5)
134#define USE_MD5_RAND
135#elif !defined(NO_MDC2) && !defined(NO_DES)
136#define USE_MDC2_RAND
137#elif !defined(NO_MD2)
138#define USE_MD2_RAND
139#else
140#error No message digest algorithm available
141#endif
142#endif
143
144/* Changed how the state buffer used. I now attempt to 'wrap' such
145 * that I don't run over the same locations the next time go through
146 * the 1023 bytes - many thanks to
147 * Robert J. LeBlanc <rjl@renaissoft.com> for his comments
148 */
149
150#if defined(USE_MD5_RAND)
151#include <openssl/md5.h>
152#define MD_DIGEST_LENGTH MD5_DIGEST_LENGTH
153#define MD_CTX MD5_CTX
154#define MD_Init(a) MD5_Init(a)
155#define MD_Update(a,b,c) MD5_Update(a,b,c)
156#define MD_Final(a,b) MD5_Final(a,b)
157#define MD(a,b,c) MD5(a,b,c)
158#elif defined(USE_SHA1_RAND)
159#include <openssl/sha.h>
160#define MD_DIGEST_LENGTH SHA_DIGEST_LENGTH
161#define MD_CTX SHA_CTX
162#define MD_Init(a) SHA1_Init(a)
163#define MD_Update(a,b,c) SHA1_Update(a,b,c)
164#define MD_Final(a,b) SHA1_Final(a,b)
165#define MD(a,b,c) SHA1(a,b,c)
166#elif defined(USE_MDC2_RAND)
167#include <openssl/mdc2.h>
168#define MD_DIGEST_LENGTH MDC2_DIGEST_LENGTH
169#define MD_CTX MDC2_CTX
170#define MD_Init(a) MDC2_Init(a)
171#define MD_Update(a,b,c) MDC2_Update(a,b,c)
172#define MD_Final(a,b) MDC2_Final(a,b)
173#define MD(a,b,c) MDC2(a,b,c)
174#elif defined(USE_MD2_RAND)
175#include <openssl/md2.h>
176#define MD_DIGEST_LENGTH MD2_DIGEST_LENGTH
177#define MD_CTX MD2_CTX
178#define MD_Init(a) MD2_Init(a)
179#define MD_Update(a,b,c) MD2_Update(a,b,c)
180#define MD_Final(a,b) MD2_Final(a,b)
181#define MD(a,b,c) MD2(a,b,c)
182#endif
183
184#include <openssl/rand.h>
185
186#ifdef BN_DEBUG 130#ifdef BN_DEBUG
187# define PREDICT 131# define PREDICT
188#endif 132#endif
189 133
190/* #define NORAND 1 */
191/* #define PREDICT 1 */ 134/* #define PREDICT 1 */
192 135
193#define STATE_SIZE 1023 136#define STATE_SIZE 1023
@@ -198,6 +141,11 @@ static long md_count[2]={0,0};
198static double entropy=0; 141static double entropy=0;
199static int initialized=0; 142static int initialized=0;
200 143
144/* This should be set to 1 only when ssleay_rand_add() is called inside
145 an already locked state, so it doesn't try to lock and thereby cause
146 a hang. And it should always be reset back to 0 before unlocking. */
147static int add_do_not_lock=0;
148
201#ifdef PREDICT 149#ifdef PREDICT
202int rand_predictable=0; 150int rand_predictable=0;
203#endif 151#endif
@@ -234,6 +182,7 @@ static void ssleay_rand_cleanup(void)
234 md_count[0]=0; 182 md_count[0]=0;
235 md_count[1]=0; 183 md_count[1]=0;
236 entropy=0; 184 entropy=0;
185 initialized=0;
237 } 186 }
238 187
239static void ssleay_rand_add(const void *buf, int num, double add) 188static void ssleay_rand_add(const void *buf, int num, double add)
@@ -243,10 +192,6 @@ static void ssleay_rand_add(const void *buf, int num, double add)
243 unsigned char local_md[MD_DIGEST_LENGTH]; 192 unsigned char local_md[MD_DIGEST_LENGTH];
244 MD_CTX m; 193 MD_CTX m;
245 194
246#ifdef NORAND
247 return;
248#endif
249
250 /* 195 /*
251 * (Based on the rand(3) manpage) 196 * (Based on the rand(3) manpage)
252 * 197 *
@@ -262,7 +207,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
262 * hash function. 207 * hash function.
263 */ 208 */
264 209
265 CRYPTO_w_lock(CRYPTO_LOCK_RAND); 210 if (!add_do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
266 st_idx=state_index; 211 st_idx=state_index;
267 212
268 /* use our own copies of the counters so that even 213 /* use our own copies of the counters so that even
@@ -294,7 +239,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
294 239
295 md_count[1] += (num / MD_DIGEST_LENGTH) + (num % MD_DIGEST_LENGTH > 0); 240 md_count[1] += (num / MD_DIGEST_LENGTH) + (num % MD_DIGEST_LENGTH > 0);
296 241
297 CRYPTO_w_unlock(CRYPTO_LOCK_RAND); 242 if (!add_do_not_lock) CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
298 243
299 for (i=0; i<num; i+=MD_DIGEST_LENGTH) 244 for (i=0; i<num; i+=MD_DIGEST_LENGTH)
300 { 245 {
@@ -336,7 +281,7 @@ static void ssleay_rand_add(const void *buf, int num, double add)
336 } 281 }
337 memset((char *)&m,0,sizeof(m)); 282 memset((char *)&m,0,sizeof(m));
338 283
339 CRYPTO_w_lock(CRYPTO_LOCK_RAND); 284 if (!add_do_not_lock) CRYPTO_w_lock(CRYPTO_LOCK_RAND);
340 /* Don't just copy back local_md into md -- this could mean that 285 /* Don't just copy back local_md into md -- this could mean that
341 * other thread's seeding remains without effect (except for 286 * other thread's seeding remains without effect (except for
342 * the incremented counter). By XORing it we keep at least as 287 * the incremented counter). By XORing it we keep at least as
@@ -347,9 +292,9 @@ static void ssleay_rand_add(const void *buf, int num, double add)
347 } 292 }
348 if (entropy < ENTROPY_NEEDED) /* stop counting when we have enough */ 293 if (entropy < ENTROPY_NEEDED) /* stop counting when we have enough */
349 entropy += add; 294 entropy += add;
350 CRYPTO_w_unlock(CRYPTO_LOCK_RAND); 295 if (!add_do_not_lock) CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
351 296
352#ifndef THREADS 297#if !defined(THREADS) && !defined(WIN32)
353 assert(md_c[1] == md_count[1]); 298 assert(md_c[1] == md_count[1]);
354#endif 299#endif
355 } 300 }
@@ -359,58 +304,9 @@ static void ssleay_rand_seed(const void *buf, int num)
359 ssleay_rand_add(buf, num, num); 304 ssleay_rand_add(buf, num, num);
360 } 305 }
361 306
362static void ssleay_rand_initialize(void)
363 {
364 unsigned long l;
365#ifndef GETPID_IS_MEANINGLESS
366 pid_t curr_pid = getpid();
367#endif
368#ifdef DEVRANDOM
369 FILE *fh;
370#endif
371
372#ifdef NORAND
373 return;
374#endif
375
376 CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
377 /* put in some default random data, we need more than just this */
378#ifndef GETPID_IS_MEANINGLESS
379 l=curr_pid;
380 RAND_add(&l,sizeof(l),0);
381 l=getuid();
382 RAND_add(&l,sizeof(l),0);
383#endif
384 l=time(NULL);
385 RAND_add(&l,sizeof(l),0);
386
387#ifdef DEVRANDOM
388 /* Use a random entropy pool device. Linux, FreeBSD and OpenBSD
389 * have this. Use /dev/urandom if you can as /dev/random may block
390 * if it runs out of random entries. */
391
392 if ((fh = fopen(DEVRANDOM, "r")) != NULL)
393 {
394 unsigned char tmpbuf[ENTROPY_NEEDED];
395 int n;
396
397 setvbuf(fh, NULL, _IONBF, 0);
398 n=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
399 fclose(fh);
400 RAND_add(tmpbuf,sizeof tmpbuf,n);
401 memset(tmpbuf,0,n);
402 }
403#endif
404#ifdef PURIFY
405 memset(state,0,STATE_SIZE);
406 memset(md,0,MD_DIGEST_LENGTH);
407#endif
408 CRYPTO_w_lock(CRYPTO_LOCK_RAND);
409 initialized=1;
410 }
411
412static int ssleay_rand_bytes(unsigned char *buf, int num) 307static int ssleay_rand_bytes(unsigned char *buf, int num)
413 { 308 {
309 static volatile int stirred_pool = 0;
414 int i,j,k,st_num,st_idx; 310 int i,j,k,st_num,st_idx;
415 int ok; 311 int ok;
416 long md_c[2]; 312 long md_c[2];
@@ -419,6 +315,7 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
419#ifndef GETPID_IS_MEANINGLESS 315#ifndef GETPID_IS_MEANINGLESS
420 pid_t curr_pid = getpid(); 316 pid_t curr_pid = getpid();
421#endif 317#endif
318 int do_stir_pool = 0;
422 319
423#ifdef PREDICT 320#ifdef PREDICT
424 if (rand_predictable) 321 if (rand_predictable)
@@ -450,11 +347,17 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
450 * global 'md'. 347 * global 'md'.
451 */ 348 */
452 349
453 CRYPTO_w_lock(CRYPTO_LOCK_RAND);
454
455 if (!initialized) 350 if (!initialized)
456 ssleay_rand_initialize(); 351 RAND_poll();
352
353 CRYPTO_w_lock(CRYPTO_LOCK_RAND);
354 add_do_not_lock = 1; /* Since we call ssleay_rand_add while in
355 this locked state. */
457 356
357 initialized = 1;
358 if (!stirred_pool)
359 do_stir_pool = 1;
360
458 ok = (entropy >= ENTROPY_NEEDED); 361 ok = (entropy >= ENTROPY_NEEDED);
459 if (!ok) 362 if (!ok)
460 { 363 {
@@ -464,12 +367,42 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
464 * Once we've had enough initial seeding we don't bother to 367 * Once we've had enough initial seeding we don't bother to
465 * adjust the entropy count, though, because we're not ambitious 368 * adjust the entropy count, though, because we're not ambitious
466 * to provide *information-theoretic* randomness. 369 * to provide *information-theoretic* randomness.
370 *
371 * NOTE: This approach fails if the program forks before
372 * we have enough entropy. Entropy should be collected
373 * in a separate input pool and be transferred to the
374 * output pool only when the entropy limit has been reached.
467 */ 375 */
468 entropy -= num; 376 entropy -= num;
469 if (entropy < 0) 377 if (entropy < 0)
470 entropy = 0; 378 entropy = 0;
471 } 379 }
472 380
381 if (do_stir_pool)
382 {
383 /* Our output function chains only half of 'md', so we better
384 * make sure that the required entropy gets 'evenly distributed'
385 * through 'state', our randomness pool. The input function
386 * (ssleay_rand_add) chains all of 'md', which makes it more
387 * suitable for this purpose.
388 */
389
390 int n = STATE_SIZE; /* so that the complete pool gets accessed */
391 while (n > 0)
392 {
393#if MD_DIGEST_LENGTH > 20
394# error "Please adjust DUMMY_SEED."
395#endif
396#define DUMMY_SEED "...................." /* at least MD_DIGEST_LENGTH */
397 /* Note that the seed does not matter, it's just that
398 * ssleay_rand_add expects to have something to hash. */
399 ssleay_rand_add(DUMMY_SEED, MD_DIGEST_LENGTH, 0.0);
400 n -= MD_DIGEST_LENGTH;
401 }
402 if (ok)
403 stirred_pool = 1;
404 }
405
473 st_idx=state_index; 406 st_idx=state_index;
474 st_num=state_num; 407 st_num=state_num;
475 md_c[0] = md_count[0]; 408 md_c[0] = md_count[0];
@@ -484,6 +417,9 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
484 * are now ours (but other threads may use them too) */ 417 * are now ours (but other threads may use them too) */
485 418
486 md_count[0] += 1; 419 md_count[0] += 1;
420
421 add_do_not_lock = 0; /* If this would ever be forgotten, we can
422 expect any evil god to eat our souls. */
487 CRYPTO_w_unlock(CRYPTO_LOCK_RAND); 423 CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
488 424
489 while (num > 0) 425 while (num > 0)
@@ -536,6 +472,8 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
536 else 472 else
537 { 473 {
538 RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED); 474 RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED);
475 ERR_add_error_data(1, "You need to read the OpenSSL FAQ, "
476 "http://www.openssl.org/support/faq.html");
539 return(0); 477 return(0);
540 } 478 }
541 } 479 }
@@ -561,152 +499,13 @@ static int ssleay_rand_status(void)
561 { 499 {
562 int ret; 500 int ret;
563 501
564 CRYPTO_w_lock(CRYPTO_LOCK_RAND);
565
566 if (!initialized) 502 if (!initialized)
567 ssleay_rand_initialize(); 503 RAND_poll();
568 ret = entropy >= ENTROPY_NEEDED;
569 504
505 CRYPTO_w_lock(CRYPTO_LOCK_RAND);
506 initialized = 1;
507 ret = entropy >= ENTROPY_NEEDED;
570 CRYPTO_w_unlock(CRYPTO_LOCK_RAND); 508 CRYPTO_w_unlock(CRYPTO_LOCK_RAND);
571 509
572 return ret; 510 return ret;
573 } 511 }
574
575#ifdef WINDOWS
576#include <windows.h>
577#include <openssl/rand.h>
578
579int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
580 {
581 double add_entropy=0;
582 SYSTEMTIME t;
583
584 switch (iMsg)
585 {
586 case WM_KEYDOWN:
587 {
588 static WPARAM key;
589 if (key != wParam)
590 add_entropy = 0.05;
591 key = wParam;
592 }
593 break;
594 case WM_MOUSEMOVE:
595 {
596 static int lastx,lasty,lastdx,lastdy;
597 int x,y,dx,dy;
598
599 x=LOWORD(lParam);
600 y=HIWORD(lParam);
601 dx=lastx-x;
602 dy=lasty-y;
603 if (dx != 0 && dy != 0 && dx-lastdx != 0 && dy-lastdy != 0)
604 add_entropy=.2;
605 lastx=x, lasty=y;
606 lastdx=dx, lastdy=dy;
607 }
608 break;
609 }
610
611 GetSystemTime(&t);
612 RAND_add(&iMsg, sizeof(iMsg), add_entropy);
613 RAND_add(&wParam, sizeof(wParam), 0);
614 RAND_add(&lParam, sizeof(lParam), 0);
615 RAND_add(&t, sizeof(t), 0);
616
617 return (RAND_status());
618 }
619
620/*****************************************************************************
621 * Initialisation function for the SSL random generator. Takes the contents
622 * of the screen as random seed.
623 *
624 * Created 960901 by Gertjan van Oosten, gertjan@West.NL, West Consulting B.V.
625 *
626 * Code adapted from
627 * <URL:http://www.microsoft.com/kb/developr/win_dk/q97193.htm>;
628 * the original copyright message is:
629 *
630 * (C) Copyright Microsoft Corp. 1993. All rights reserved.
631 *
632 * You have a royalty-free right to use, modify, reproduce and
633 * distribute the Sample Files (and/or any modified version) in
634 * any way you find useful, provided that you agree that
635 * Microsoft has no warranty obligations or liability for any
636 * Sample Application Files which are modified.
637 */
638/*
639 * I have modified the loading of bytes via RAND_seed() mechanism since
640 * the original would have been very very CPU intensive since RAND_seed()
641 * does an MD5 per 16 bytes of input. The cost to digest 16 bytes is the same
642 * as that to digest 56 bytes. So under the old system, a screen of
643 * 1024*768*256 would have been CPU cost of approximately 49,000 56 byte MD5
644 * digests or digesting 2.7 mbytes. What I have put in place would
645 * be 48 16k MD5 digests, or effectively 48*16+48 MD5 bytes or 816 kbytes
646 * or about 3.5 times as much.
647 * - eric
648 */
649void RAND_screen(void)
650{
651 HDC hScrDC; /* screen DC */
652 HDC hMemDC; /* memory DC */
653 HBITMAP hBitmap; /* handle for our bitmap */
654 HBITMAP hOldBitmap; /* handle for previous bitmap */
655 BITMAP bm; /* bitmap properties */
656 unsigned int size; /* size of bitmap */
657 char *bmbits; /* contents of bitmap */
658 int w; /* screen width */
659 int h; /* screen height */
660 int y; /* y-coordinate of screen lines to grab */
661 int n = 16; /* number of screen lines to grab at a time */
662
663 /* Create a screen DC and a memory DC compatible to screen DC */
664 hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL);
665 hMemDC = CreateCompatibleDC(hScrDC);
666
667 /* Get screen resolution */
668 w = GetDeviceCaps(hScrDC, HORZRES);
669 h = GetDeviceCaps(hScrDC, VERTRES);
670
671 /* Create a bitmap compatible with the screen DC */
672 hBitmap = CreateCompatibleBitmap(hScrDC, w, n);
673
674 /* Select new bitmap into memory DC */
675 hOldBitmap = SelectObject(hMemDC, hBitmap);
676
677 /* Get bitmap properties */
678 GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
679 size = (unsigned int)bm.bmWidthBytes * bm.bmHeight * bm.bmPlanes;
680
681 bmbits = Malloc(size);
682 if (bmbits) {
683 /* Now go through the whole screen, repeatedly grabbing n lines */
684 for (y = 0; y < h-n; y += n)
685 {
686 unsigned char md[MD_DIGEST_LENGTH];
687
688 /* Bitblt screen DC to memory DC */
689 BitBlt(hMemDC, 0, 0, w, n, hScrDC, 0, y, SRCCOPY);
690
691 /* Copy bitmap bits from memory DC to bmbits */
692 GetBitmapBits(hBitmap, size, bmbits);
693
694 /* Get the MD5 of the bitmap */
695 MD(bmbits,size,md);
696
697 /* Seed the random generator with the MD5 digest */
698 RAND_seed(md, MD_DIGEST_LENGTH);
699 }
700
701 Free(bmbits);
702 }
703
704 /* Select old bitmap back into memory DC */
705 hBitmap = SelectObject(hMemDC, hOldBitmap);
706
707 /* Clean up */
708 DeleteObject(hBitmap);
709 DeleteDC(hMemDC);
710 DeleteDC(hScrDC);
711}
712#endif
diff --git a/src/lib/libcrypto/rand/rand.h b/src/lib/libcrypto/rand/rand.h
index 2973ee90e4..eb9c8c034d 100644
--- a/src/lib/libcrypto/rand/rand.h
+++ b/src/lib/libcrypto/rand/rand.h
@@ -77,7 +77,9 @@ typedef struct rand_meth_st
77extern int rand_predictable; 77extern int rand_predictable;
78#endif 78#endif
79 79
80void RAND_set_rand_method(RAND_METHOD *meth); 80struct engine_st;
81
82int RAND_set_rand_method(struct engine_st *meth);
81RAND_METHOD *RAND_get_rand_method(void ); 83RAND_METHOD *RAND_get_rand_method(void );
82RAND_METHOD *RAND_SSLeay(void); 84RAND_METHOD *RAND_SSLeay(void);
83void RAND_cleanup(void ); 85void RAND_cleanup(void );
@@ -90,12 +92,28 @@ int RAND_write_file(const char *file);
90const char *RAND_file_name(char *file,int num); 92const char *RAND_file_name(char *file,int num);
91int RAND_status(void); 93int RAND_status(void);
92int RAND_egd(const char *path); 94int RAND_egd(const char *path);
95int RAND_egd_bytes(const char *path,int bytes);
96void ERR_load_RAND_strings(void);
97int RAND_poll(void);
98
99#ifdef __cplusplus
100}
101#endif
102
93#if defined(WINDOWS) || defined(WIN32) 103#if defined(WINDOWS) || defined(WIN32)
94#include <windows.h> 104#include <windows.h>
105
106#ifdef __cplusplus
107extern "C" {
108#endif
109
95void RAND_screen(void); 110void RAND_screen(void);
96int RAND_event(UINT, WPARAM, LPARAM); 111int RAND_event(UINT, WPARAM, LPARAM);
112
113#ifdef __cplusplus
114}
115#endif
97#endif 116#endif
98void ERR_load_RAND_strings(void);
99 117
100/* BEGIN ERROR CODES */ 118/* BEGIN ERROR CODES */
101/* The following lines are auto generated by the script mkerr.pl. Any changes 119/* The following lines are auto generated by the script mkerr.pl. Any changes
@@ -110,8 +128,5 @@ void ERR_load_RAND_strings(void);
110/* Reason codes. */ 128/* Reason codes. */
111#define RAND_R_PRNG_NOT_SEEDED 100 129#define RAND_R_PRNG_NOT_SEEDED 100
112 130
113#ifdef __cplusplus
114}
115#endif
116#endif 131#endif
117 132
diff --git a/src/lib/libcrypto/rand/rand_egd.c b/src/lib/libcrypto/rand/rand_egd.c
index 380c7828c3..02a0d86fa3 100644
--- a/src/lib/libcrypto/rand/rand_egd.c
+++ b/src/lib/libcrypto/rand/rand_egd.c
@@ -64,6 +64,11 @@ int RAND_egd(const char *path)
64 { 64 {
65 return(-1); 65 return(-1);
66 } 66 }
67
68int RAND_egd_bytes(const char *path,int bytes)
69 {
70 return(-1);
71 }
67#else 72#else
68#include <openssl/opensslconf.h> 73#include <openssl/opensslconf.h>
69#include OPENSSL_UNISTD 74#include OPENSSL_UNISTD
@@ -107,4 +112,56 @@ int RAND_egd(const char *path)
107 if (fd != -1) close(fd); 112 if (fd != -1) close(fd);
108 return(ret); 113 return(ret);
109 } 114 }
115
116int RAND_egd_bytes(const char *path,int bytes)
117 {
118 int ret = 0;
119 struct sockaddr_un addr;
120 int len, num;
121 int fd = -1;
122 unsigned char buf[255];
123
124 memset(&addr, 0, sizeof(addr));
125 addr.sun_family = AF_UNIX;
126 if (strlen(path) > sizeof(addr.sun_path))
127 return (-1);
128 strcpy(addr.sun_path,path);
129 len = offsetof(struct sockaddr_un, sun_path) + strlen(path);
130 fd = socket(AF_UNIX, SOCK_STREAM, 0);
131 if (fd == -1) return (-1);
132 if (connect(fd, (struct sockaddr *)&addr, len) == -1) goto err;
133
134 while(bytes > 0)
135 {
136 buf[0] = 1;
137 buf[1] = bytes < 255 ? bytes : 255;
138 write(fd, buf, 2);
139 if (read(fd, buf, 1) != 1)
140 {
141 ret=-1;
142 goto err;
143 }
144 if(buf[0] == 0)
145 goto err;
146 num = read(fd, buf, buf[0]);
147 if (num < 1)
148 {
149 ret=-1;
150 goto err;
151 }
152 RAND_seed(buf, num);
153 if (RAND_status() != 1)
154 {
155 ret=-1;
156 goto err;
157 }
158 ret += num;
159 bytes-=num;
160 }
161 err:
162 if (fd != -1) close(fd);
163 return(ret);
164 }
165
166
110#endif 167#endif
diff --git a/src/lib/libcrypto/rand/rand_lcl.h b/src/lib/libcrypto/rand/rand_lcl.h
new file mode 100644
index 0000000000..120e9366d2
--- /dev/null
+++ b/src/lib/libcrypto/rand/rand_lcl.h
@@ -0,0 +1,184 @@
1/* crypto/rand/md_rand.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58/* ====================================================================
59 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111
112#ifndef HEADER_RAND_LCL_H
113#define HEADER_RAND_LCL_H
114
115#define ENTROPY_NEEDED 20 /* require 160 bits = 20 bytes of randomness */
116
117
118#if !defined(USE_MD5_RAND) && !defined(USE_SHA1_RAND) && !defined(USE_MDC2_RAND) && !defined(USE_MD2_RAND)
119#if !defined(NO_SHA) && !defined(NO_SHA1)
120#define USE_SHA1_RAND
121#elif !defined(NO_MD5)
122#define USE_MD5_RAND
123#elif !defined(NO_MDC2) && !defined(NO_DES)
124#define USE_MDC2_RAND
125#elif !defined(NO_MD2)
126#define USE_MD2_RAND
127#else
128#error No message digest algorithm available
129#endif
130#endif
131
132#if defined(USE_MD5_RAND)
133#include <openssl/md5.h>
134#define MD_DIGEST_LENGTH MD5_DIGEST_LENGTH
135#define MD(a,b,c) MD5(a,b,c)
136#elif defined(USE_SHA1_RAND)
137#include <openssl/sha.h>
138#define MD_DIGEST_LENGTH SHA_DIGEST_LENGTH
139#define MD(a,b,c) SHA1(a,b,c)
140#elif defined(USE_MDC2_RAND)
141#include <openssl/mdc2.h>
142#define MD_DIGEST_LENGTH MDC2_DIGEST_LENGTH
143#define MD(a,b,c) MDC2(a,b,c)
144#elif defined(USE_MD2_RAND)
145#include <openssl/md2.h>
146#define MD_DIGEST_LENGTH MD2_DIGEST_LENGTH
147#define MD(a,b,c) MD2(a,b,c)
148#endif
149#if defined(USE_MD5_RAND)
150#include <openssl/md5.h>
151#define MD_DIGEST_LENGTH MD5_DIGEST_LENGTH
152#define MD_CTX MD5_CTX
153#define MD_Init(a) MD5_Init(a)
154#define MD_Update(a,b,c) MD5_Update(a,b,c)
155#define MD_Final(a,b) MD5_Final(a,b)
156#define MD(a,b,c) MD5(a,b,c)
157#elif defined(USE_SHA1_RAND)
158#include <openssl/sha.h>
159#define MD_DIGEST_LENGTH SHA_DIGEST_LENGTH
160#define MD_CTX SHA_CTX
161#define MD_Init(a) SHA1_Init(a)
162#define MD_Update(a,b,c) SHA1_Update(a,b,c)
163#define MD_Final(a,b) SHA1_Final(a,b)
164#define MD(a,b,c) SHA1(a,b,c)
165#elif defined(USE_MDC2_RAND)
166#include <openssl/mdc2.h>
167#define MD_DIGEST_LENGTH MDC2_DIGEST_LENGTH
168#define MD_CTX MDC2_CTX
169#define MD_Init(a) MDC2_Init(a)
170#define MD_Update(a,b,c) MDC2_Update(a,b,c)
171#define MD_Final(a,b) MDC2_Final(a,b)
172#define MD(a,b,c) MDC2(a,b,c)
173#elif defined(USE_MD2_RAND)
174#include <openssl/md2.h>
175#define MD_DIGEST_LENGTH MD2_DIGEST_LENGTH
176#define MD_CTX MD2_CTX
177#define MD_Init(a) MD2_Init(a)
178#define MD_Update(a,b,c) MD2_Update(a,b,c)
179#define MD_Final(a,b) MD2_Final(a,b)
180#define MD(a,b,c) MD2(a,b,c)
181#endif
182
183
184#endif
diff --git a/src/lib/libcrypto/rand/rand_lib.c b/src/lib/libcrypto/rand/rand_lib.c
index 7da74aab0e..57eff0f132 100644
--- a/src/lib/libcrypto/rand/rand_lib.c
+++ b/src/lib/libcrypto/rand/rand_lib.c
@@ -59,59 +59,78 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <time.h> 60#include <time.h>
61#include <openssl/rand.h> 61#include <openssl/rand.h>
62#include <openssl/engine.h>
62 63
63#ifdef NO_RAND 64static ENGINE *rand_engine=NULL;
64static RAND_METHOD *rand_meth=NULL;
65#else
66extern RAND_METHOD rand_ssleay_meth;
67static RAND_METHOD *rand_meth= &rand_ssleay_meth;
68#endif
69 65
66#if 0
70void RAND_set_rand_method(RAND_METHOD *meth) 67void RAND_set_rand_method(RAND_METHOD *meth)
71 { 68 {
72 rand_meth=meth; 69 rand_meth=meth;
73 } 70 }
71#else
72int RAND_set_rand_method(ENGINE *engine)
73 {
74 ENGINE *mtmp;
75 mtmp = rand_engine;
76 if (!ENGINE_init(engine))
77 return 0;
78 rand_engine = engine;
79 /* SHOULD ERROR CHECK THIS!!! */
80 ENGINE_finish(mtmp);
81 return 1;
82 }
83#endif
74 84
75RAND_METHOD *RAND_get_rand_method(void) 85RAND_METHOD *RAND_get_rand_method(void)
76 { 86 {
77 return(rand_meth); 87 if (rand_engine == NULL
88 && (rand_engine = ENGINE_get_default_RAND()) == NULL)
89 return NULL;
90 return ENGINE_get_RAND(rand_engine);
78 } 91 }
79 92
80void RAND_cleanup(void) 93void RAND_cleanup(void)
81 { 94 {
82 if (rand_meth != NULL) 95 RAND_METHOD *meth = RAND_get_rand_method();
83 rand_meth->cleanup(); 96 if (meth && meth->cleanup)
97 meth->cleanup();
84 } 98 }
85 99
86void RAND_seed(const void *buf, int num) 100void RAND_seed(const void *buf, int num)
87 { 101 {
88 if (rand_meth != NULL) 102 RAND_METHOD *meth = RAND_get_rand_method();
89 rand_meth->seed(buf,num); 103 if (meth && meth->seed)
104 meth->seed(buf,num);
90 } 105 }
91 106
92void RAND_add(const void *buf, int num, double entropy) 107void RAND_add(const void *buf, int num, double entropy)
93 { 108 {
94 if (rand_meth != NULL) 109 RAND_METHOD *meth = RAND_get_rand_method();
95 rand_meth->add(buf,num,entropy); 110 if (meth && meth->add)
111 meth->add(buf,num,entropy);
96 } 112 }
97 113
98int RAND_bytes(unsigned char *buf, int num) 114int RAND_bytes(unsigned char *buf, int num)
99 { 115 {
100 if (rand_meth != NULL) 116 RAND_METHOD *meth = RAND_get_rand_method();
101 return rand_meth->bytes(buf,num); 117 if (meth && meth->bytes)
118 return meth->bytes(buf,num);
102 return(-1); 119 return(-1);
103 } 120 }
104 121
105int RAND_pseudo_bytes(unsigned char *buf, int num) 122int RAND_pseudo_bytes(unsigned char *buf, int num)
106 { 123 {
107 if (rand_meth != NULL) 124 RAND_METHOD *meth = RAND_get_rand_method();
108 return rand_meth->pseudorand(buf,num); 125 if (meth && meth->pseudorand)
126 return meth->pseudorand(buf,num);
109 return(-1); 127 return(-1);
110 } 128 }
111 129
112int RAND_status(void) 130int RAND_status(void)
113 { 131 {
114 if (rand_meth != NULL) 132 RAND_METHOD *meth = RAND_get_rand_method();
115 return rand_meth->status(); 133 if (meth && meth->status)
134 return meth->status();
116 return 0; 135 return 0;
117 } 136 }
diff --git a/src/lib/libcrypto/rand/rand_win.c b/src/lib/libcrypto/rand/rand_win.c
new file mode 100644
index 0000000000..9f2dcff9a9
--- /dev/null
+++ b/src/lib/libcrypto/rand/rand_win.c
@@ -0,0 +1,732 @@
1/* crypto/rand/rand_win.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58/* ====================================================================
59 * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved.
60 *
61 * Redistribution and use in source and binary forms, with or without
62 * modification, are permitted provided that the following conditions
63 * are met:
64 *
65 * 1. Redistributions of source code must retain the above copyright
66 * notice, this list of conditions and the following disclaimer.
67 *
68 * 2. Redistributions in binary form must reproduce the above copyright
69 * notice, this list of conditions and the following disclaimer in
70 * the documentation and/or other materials provided with the
71 * distribution.
72 *
73 * 3. All advertising materials mentioning features or use of this
74 * software must display the following acknowledgment:
75 * "This product includes software developed by the OpenSSL Project
76 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77 *
78 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79 * endorse or promote products derived from this software without
80 * prior written permission. For written permission, please contact
81 * openssl-core@openssl.org.
82 *
83 * 5. Products derived from this software may not be called "OpenSSL"
84 * nor may "OpenSSL" appear in their names without prior written
85 * permission of the OpenSSL Project.
86 *
87 * 6. Redistributions of any form whatsoever must retain the following
88 * acknowledgment:
89 * "This product includes software developed by the OpenSSL Project
90 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91 *
92 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
96 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103 * OF THE POSSIBILITY OF SUCH DAMAGE.
104 * ====================================================================
105 *
106 * This product includes cryptographic software written by Eric Young
107 * (eay@cryptsoft.com). This product includes software written by Tim
108 * Hudson (tjh@cryptsoft.com).
109 *
110 */
111
112#include "cryptlib.h"
113#include <openssl/rand.h>
114#include "rand_lcl.h"
115
116#if defined(WINDOWS) || defined(WIN32)
117#include <windows.h>
118#ifndef _WIN32_WINNT
119# define _WIN32_WINNT 0x0400
120#endif
121#include <wincrypt.h>
122#include <tlhelp32.h>
123
124/* Intel hardware RNG CSP -- available from
125 * http://developer.intel.com/design/security/rng/redist_license.htm
126 */
127#define PROV_INTEL_SEC 22
128#define INTEL_DEF_PROV "Intel Hardware Cryptographic Service Provider"
129
130static void readtimer(void);
131static void readscreen(void);
132
133/* It appears like CURSORINFO, PCURSORINFO and LPCURSORINFO are only defined
134 when WINVER is 0x0500 and up, which currently only happens on Win2000.
135 Unfortunately, those are typedefs, so they're a little bit difficult to
136 detect properly. On the other hand, the macro CURSOR_SHOWING is defined
137 within the same conditional, so it can be use to detect the absence of said
138 typedefs. */
139
140#ifndef CURSOR_SHOWING
141/*
142 * Information about the global cursor.
143 */
144typedef struct tagCURSORINFO
145{
146 DWORD cbSize;
147 DWORD flags;
148 HCURSOR hCursor;
149 POINT ptScreenPos;
150} CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
151
152#define CURSOR_SHOWING 0x00000001
153#endif /* CURSOR_SHOWING */
154
155typedef BOOL (WINAPI *CRYPTACQUIRECONTEXT)(HCRYPTPROV *, LPCTSTR, LPCTSTR,
156 DWORD, DWORD);
157typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV, DWORD, BYTE *);
158typedef BOOL (WINAPI *CRYPTRELEASECONTEXT)(HCRYPTPROV, DWORD);
159
160typedef HWND (WINAPI *GETFOREGROUNDWINDOW)(VOID);
161typedef BOOL (WINAPI *GETCURSORINFO)(PCURSORINFO);
162typedef DWORD (WINAPI *GETQUEUESTATUS)(UINT);
163
164typedef HANDLE (WINAPI *CREATETOOLHELP32SNAPSHOT)(DWORD, DWORD);
165typedef BOOL (WINAPI *HEAP32FIRST)(LPHEAPENTRY32, DWORD, DWORD);
166typedef BOOL (WINAPI *HEAP32NEXT)(LPHEAPENTRY32);
167typedef BOOL (WINAPI *HEAP32LIST)(HANDLE, LPHEAPLIST32);
168typedef BOOL (WINAPI *PROCESS32)(HANDLE, LPPROCESSENTRY32);
169typedef BOOL (WINAPI *THREAD32)(HANDLE, LPTHREADENTRY32);
170typedef BOOL (WINAPI *MODULE32)(HANDLE, LPMODULEENTRY32);
171
172#include <lmcons.h>
173#include <lmstats.h>
174#if 1 /* The NET API is Unicode only. It requires the use of the UNICODE
175 * macro. When UNICODE is defined LPTSTR becomes LPWSTR. LMSTR was
176 * was added to the Platform SDK to allow the NET API to be used in
177 * non-Unicode applications provided that Unicode strings were still
178 * used for input. LMSTR is defined as LPWSTR.
179 */
180typedef NET_API_STATUS (NET_API_FUNCTION * NETSTATGET)
181 (LPWSTR, LPWSTR, DWORD, DWORD, LPBYTE*);
182typedef NET_API_STATUS (NET_API_FUNCTION * NETFREE)(LPBYTE);
183#endif /* 1 */
184
185int RAND_poll(void)
186{
187 MEMORYSTATUS m;
188 HCRYPTPROV hProvider = 0;
189 BYTE buf[64];
190 DWORD w;
191 HWND h;
192
193 HMODULE advapi, kernel, user, netapi;
194 CRYPTACQUIRECONTEXT acquire = 0;
195 CRYPTGENRANDOM gen = 0;
196 CRYPTRELEASECONTEXT release = 0;
197#if 1 /* There was previously a problem with NETSTATGET. Currently, this
198 * section is still experimental, but if all goes well, this conditional
199 * will be removed
200 */
201 NETSTATGET netstatget = 0;
202 NETFREE netfree = 0;
203#endif /* 1 */
204
205 /* Determine the OS version we are on so we can turn off things
206 * that do not work properly.
207 */
208 OSVERSIONINFO osverinfo ;
209 osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO) ;
210 GetVersionEx( &osverinfo ) ;
211
212 /* load functions dynamically - not available on all systems */
213 advapi = LoadLibrary("ADVAPI32.DLL");
214 kernel = LoadLibrary("KERNEL32.DLL");
215 user = LoadLibrary("USER32.DLL");
216 netapi = LoadLibrary("NETAPI32.DLL");
217
218#if 1 /* There was previously a problem with NETSTATGET. Currently, this
219 * section is still experimental, but if all goes well, this conditional
220 * will be removed
221 */
222 if (netapi)
223 {
224 netstatget = (NETSTATGET) GetProcAddress(netapi,"NetStatisticsGet");
225 netfree = (NETFREE) GetProcAddress(netapi,"NetApiBufferFree");
226 }
227
228 if (netstatget && netfree)
229 {
230 LPBYTE outbuf;
231 /* NetStatisticsGet() is a Unicode only function
232 * STAT_WORKSTATION_0 contains 45 fields and STAT_SERVER_0
233 * contains 17 fields. We treat each field as a source of
234 * one byte of entropy.
235 */
236
237 if (netstatget(NULL, L"LanmanWorkstation", 0, 0, &outbuf) == 0)
238 {
239 RAND_add(outbuf, sizeof(STAT_WORKSTATION_0), 45);
240 netfree(outbuf);
241 }
242 if (netstatget(NULL, L"LanmanServer", 0, 0, &outbuf) == 0)
243 {
244 RAND_add(outbuf, sizeof(STAT_SERVER_0), 17);
245 netfree(outbuf);
246 }
247 }
248
249 if (netapi)
250 FreeLibrary(netapi);
251#endif /* 1 */
252
253 /* It appears like this can cause an exception deep within ADVAPI32.DLL
254 * at random times on Windows 2000. Reported by Jeffrey Altman.
255 * Only use it on NT.
256 */
257 if ( osverinfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
258 osverinfo.dwMajorVersion < 5)
259 {
260 /* Read Performance Statistics from NT/2000 registry
261 * The size of the performance data can vary from call
262 * to call so we must guess the size of the buffer to use
263 * and increase its size if we get an ERROR_MORE_DATA
264 * return instead of ERROR_SUCCESS.
265 */
266 LONG rc=ERROR_MORE_DATA;
267 char * buf=NULL;
268 DWORD bufsz=0;
269 DWORD length;
270
271 while (rc == ERROR_MORE_DATA)
272 {
273 buf = realloc(buf,bufsz+8192);
274 if (!buf)
275 break;
276 bufsz += 8192;
277
278 length = bufsz;
279 rc = RegQueryValueEx(HKEY_PERFORMANCE_DATA, "Global",
280 NULL, NULL, buf, &length);
281 }
282 if (rc == ERROR_SUCCESS)
283 {
284 /* For entropy count assume only least significant
285 * byte of each DWORD is random.
286 */
287 RAND_add(&length, sizeof(length), 0);
288 RAND_add(buf, length, length / 4.0);
289 }
290 if (buf)
291 free(buf);
292 }
293
294 if (advapi)
295 {
296 acquire = (CRYPTACQUIRECONTEXT) GetProcAddress(advapi,
297 "CryptAcquireContextA");
298 gen = (CRYPTGENRANDOM) GetProcAddress(advapi,
299 "CryptGenRandom");
300 release = (CRYPTRELEASECONTEXT) GetProcAddress(advapi,
301 "CryptReleaseContext");
302 }
303
304 if (acquire && gen && release)
305 {
306 /* poll the CryptoAPI PRNG */
307 /* The CryptoAPI returns sizeof(buf) bytes of randomness */
308 if (acquire(&hProvider, 0, 0, PROV_RSA_FULL,
309 CRYPT_VERIFYCONTEXT))
310 {
311 if (gen(hProvider, sizeof(buf), buf) != 0)
312 {
313 RAND_add(buf, sizeof(buf), sizeof(buf));
314#ifdef DEBUG
315 printf("randomness from PROV_RSA_FULL\n");
316#endif
317 }
318 release(hProvider, 0);
319 }
320
321 /* poll the Pentium PRG with CryptoAPI */
322 if (acquire(&hProvider, 0, INTEL_DEF_PROV, PROV_INTEL_SEC, 0))
323 {
324 if (gen(hProvider, sizeof(buf), buf) != 0)
325 {
326 RAND_add(buf, sizeof(buf), sizeof(buf));
327#ifdef DEBUG
328 printf("randomness from PROV_INTEL_SEC\n");
329#endif
330 }
331 release(hProvider, 0);
332 }
333 }
334
335 if (advapi)
336 FreeLibrary(advapi);
337
338 /* timer data */
339 readtimer();
340
341 /* memory usage statistics */
342 GlobalMemoryStatus(&m);
343 RAND_add(&m, sizeof(m), 1);
344
345 /* process ID */
346 w = GetCurrentProcessId();
347 RAND_add(&w, sizeof(w), 1);
348
349 if (user)
350 {
351 GETCURSORINFO cursor;
352 GETFOREGROUNDWINDOW win;
353 GETQUEUESTATUS queue;
354
355 win = (GETFOREGROUNDWINDOW) GetProcAddress(user, "GetForegroundWindow");
356 cursor = (GETCURSORINFO) GetProcAddress(user, "GetCursorInfo");
357 queue = (GETQUEUESTATUS) GetProcAddress(user, "GetQueueStatus");
358
359 if (win)
360 {
361 /* window handle */
362 h = win();
363 RAND_add(&h, sizeof(h), 0);
364 }
365 if (cursor)
366 {
367 /* unfortunately, its not safe to call GetCursorInfo()
368 * on NT4 even though it exists in SP3 (or SP6) and
369 * higher.
370 */
371 if ( osverinfo.dwPlatformId == VER_PLATFORM_WIN32_NT &&
372 osverinfo.dwMajorVersion < 5)
373 cursor = 0;
374 }
375 if (cursor)
376 {
377 /* cursor position */
378 /* assume 2 bytes of entropy */
379 CURSORINFO ci;
380 ci.cbSize = sizeof(CURSORINFO);
381 if (cursor(&ci))
382 RAND_add(&ci, ci.cbSize, 2);
383 }
384
385 if (queue)
386 {
387 /* message queue status */
388 /* assume 1 byte of entropy */
389 w = queue(QS_ALLEVENTS);
390 RAND_add(&w, sizeof(w), 1);
391 }
392
393 FreeLibrary(user);
394 }
395
396 /* Toolhelp32 snapshot: enumerate processes, threads, modules and heap
397 * http://msdn.microsoft.com/library/psdk/winbase/toolhelp_5pfd.htm
398 * (Win 9x and 2000 only, not available on NT)
399 *
400 * This seeding method was proposed in Peter Gutmann, Software
401 * Generation of Practically Strong Random Numbers,
402 * http://www.usenix.org/publications/library/proceedings/sec98/gutmann.html
403 * revised version at http://www.cryptoengines.com/~peter/06_random.pdf
404 * (The assignment of entropy estimates below is arbitrary, but based
405 * on Peter's analysis the full poll appears to be safe. Additional
406 * interactive seeding is encouraged.)
407 */
408
409 if (kernel)
410 {
411 CREATETOOLHELP32SNAPSHOT snap;
412 HANDLE handle;
413
414 HEAP32FIRST heap_first;
415 HEAP32NEXT heap_next;
416 HEAP32LIST heaplist_first, heaplist_next;
417 PROCESS32 process_first, process_next;
418 THREAD32 thread_first, thread_next;
419 MODULE32 module_first, module_next;
420
421 HEAPLIST32 hlist;
422 HEAPENTRY32 hentry;
423 PROCESSENTRY32 p;
424 THREADENTRY32 t;
425 MODULEENTRY32 m;
426
427 snap = (CREATETOOLHELP32SNAPSHOT)
428 GetProcAddress(kernel, "CreateToolhelp32Snapshot");
429 heap_first = (HEAP32FIRST) GetProcAddress(kernel, "Heap32First");
430 heap_next = (HEAP32NEXT) GetProcAddress(kernel, "Heap32Next");
431 heaplist_first = (HEAP32LIST) GetProcAddress(kernel, "Heap32ListFirst");
432 heaplist_next = (HEAP32LIST) GetProcAddress(kernel, "Heap32ListNext");
433 process_first = (PROCESS32) GetProcAddress(kernel, "Process32First");
434 process_next = (PROCESS32) GetProcAddress(kernel, "Process32Next");
435 thread_first = (THREAD32) GetProcAddress(kernel, "Thread32First");
436 thread_next = (THREAD32) GetProcAddress(kernel, "Thread32Next");
437 module_first = (MODULE32) GetProcAddress(kernel, "Module32First");
438 module_next = (MODULE32) GetProcAddress(kernel, "Module32Next");
439
440 if (snap && heap_first && heap_next && heaplist_first &&
441 heaplist_next && process_first && process_next &&
442 thread_first && thread_next && module_first &&
443 module_next && (handle = snap(TH32CS_SNAPALL,0))
444 != NULL)
445 {
446 /* heap list and heap walking */
447 /* HEAPLIST32 contains 3 fields that will change with
448 * each entry. Consider each field a source of 1 byte
449 * of entropy.
450 * HEAPENTRY32 contains 5 fields that will change with
451 * each entry. Consider each field a source of 1 byte
452 * of entropy.
453 */
454 hlist.dwSize = sizeof(HEAPLIST32);
455 if (heaplist_first(handle, &hlist))
456 do
457 {
458 RAND_add(&hlist, hlist.dwSize, 3);
459 hentry.dwSize = sizeof(HEAPENTRY32);
460 if (heap_first(&hentry,
461 hlist.th32ProcessID,
462 hlist.th32HeapID))
463 {
464 int entrycnt = 50;
465 do
466 RAND_add(&hentry,
467 hentry.dwSize, 5);
468 while (heap_next(&hentry)
469 && --entrycnt > 0);
470 }
471 } while (heaplist_next(handle,
472 &hlist));
473
474 /* process walking */
475 /* PROCESSENTRY32 contains 9 fields that will change
476 * with each entry. Consider each field a source of
477 * 1 byte of entropy.
478 */
479 p.dwSize = sizeof(PROCESSENTRY32);
480 if (process_first(handle, &p))
481 do
482 RAND_add(&p, p.dwSize, 9);
483 while (process_next(handle, &p));
484
485 /* thread walking */
486 /* THREADENTRY32 contains 6 fields that will change
487 * with each entry. Consider each field a source of
488 * 1 byte of entropy.
489 */
490 t.dwSize = sizeof(THREADENTRY32);
491 if (thread_first(handle, &t))
492 do
493 RAND_add(&t, t.dwSize, 6);
494 while (thread_next(handle, &t));
495
496 /* module walking */
497 /* MODULEENTRY32 contains 9 fields that will change
498 * with each entry. Consider each field a source of
499 * 1 byte of entropy.
500 */
501 m.dwSize = sizeof(MODULEENTRY32);
502 if (module_first(handle, &m))
503 do
504 RAND_add(&m, m.dwSize, 9);
505 while (module_next(handle, &m));
506
507 CloseHandle(handle);
508 }
509
510 FreeLibrary(kernel);
511 }
512
513#ifdef DEBUG
514 printf("Exiting RAND_poll\n");
515#endif
516
517 return(1);
518}
519
520int RAND_event(UINT iMsg, WPARAM wParam, LPARAM lParam)
521 {
522 double add_entropy=0;
523
524 switch (iMsg)
525 {
526 case WM_KEYDOWN:
527 {
528 static WPARAM key;
529 if (key != wParam)
530 add_entropy = 0.05;
531 key = wParam;
532 }
533 break;
534 case WM_MOUSEMOVE:
535 {
536 static int lastx,lasty,lastdx,lastdy;
537 int x,y,dx,dy;
538
539 x=LOWORD(lParam);
540 y=HIWORD(lParam);
541 dx=lastx-x;
542 dy=lasty-y;
543 if (dx != 0 && dy != 0 && dx-lastdx != 0 && dy-lastdy != 0)
544 add_entropy=.2;
545 lastx=x, lasty=y;
546 lastdx=dx, lastdy=dy;
547 }
548 break;
549 }
550
551 readtimer();
552 RAND_add(&iMsg, sizeof(iMsg), add_entropy);
553 RAND_add(&wParam, sizeof(wParam), 0);
554 RAND_add(&lParam, sizeof(lParam), 0);
555
556 return (RAND_status());
557 }
558
559
560void RAND_screen(void) /* function available for backward compatibility */
561{
562 RAND_poll();
563 readscreen();
564}
565
566
567/* feed timing information to the PRNG */
568static void readtimer(void)
569{
570 DWORD w;
571 LARGE_INTEGER l;
572 static int have_perfc = 1;
573#ifndef __GNUC__
574 static int have_tsc = 1;
575 DWORD cyclecount;
576
577 if (have_tsc) {
578 __try {
579 __asm {
580 rdtsc
581 mov cyclecount, eax
582 }
583 RAND_add(&cyclecount, sizeof(cyclecount), 1);
584 } __except(EXCEPTION_EXECUTE_HANDLER) {
585 have_tsc = 0;
586 }
587 }
588#else
589# define have_tsc 0
590#endif
591
592 if (have_perfc) {
593 if (QueryPerformanceCounter(&l) == 0)
594 have_perfc = 0;
595 else
596 RAND_add(&l, sizeof(l), 0);
597 }
598
599 if (!have_tsc && !have_perfc) {
600 w = GetTickCount();
601 RAND_add(&w, sizeof(w), 0);
602 }
603}
604
605/* feed screen contents to PRNG */
606/*****************************************************************************
607 *
608 * Created 960901 by Gertjan van Oosten, gertjan@West.NL, West Consulting B.V.
609 *
610 * Code adapted from
611 * <URL:http://www.microsoft.com/kb/developr/win_dk/q97193.htm>;
612 * the original copyright message is:
613 *
614 * (C) Copyright Microsoft Corp. 1993. All rights reserved.
615 *
616 * You have a royalty-free right to use, modify, reproduce and
617 * distribute the Sample Files (and/or any modified version) in
618 * any way you find useful, provided that you agree that
619 * Microsoft has no warranty obligations or liability for any
620 * Sample Application Files which are modified.
621 */
622
623static void readscreen(void)
624{
625 HDC hScrDC; /* screen DC */
626 HDC hMemDC; /* memory DC */
627 HBITMAP hBitmap; /* handle for our bitmap */
628 HBITMAP hOldBitmap; /* handle for previous bitmap */
629 BITMAP bm; /* bitmap properties */
630 unsigned int size; /* size of bitmap */
631 char *bmbits; /* contents of bitmap */
632 int w; /* screen width */
633 int h; /* screen height */
634 int y; /* y-coordinate of screen lines to grab */
635 int n = 16; /* number of screen lines to grab at a time */
636
637 /* Create a screen DC and a memory DC compatible to screen DC */
638 hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL);
639 hMemDC = CreateCompatibleDC(hScrDC);
640
641 /* Get screen resolution */
642 w = GetDeviceCaps(hScrDC, HORZRES);
643 h = GetDeviceCaps(hScrDC, VERTRES);
644
645 /* Create a bitmap compatible with the screen DC */
646 hBitmap = CreateCompatibleBitmap(hScrDC, w, n);
647
648 /* Select new bitmap into memory DC */
649 hOldBitmap = SelectObject(hMemDC, hBitmap);
650
651 /* Get bitmap properties */
652 GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
653 size = (unsigned int)bm.bmWidthBytes * bm.bmHeight * bm.bmPlanes;
654
655 bmbits = OPENSSL_malloc(size);
656 if (bmbits) {
657 /* Now go through the whole screen, repeatedly grabbing n lines */
658 for (y = 0; y < h-n; y += n)
659 {
660 unsigned char md[MD_DIGEST_LENGTH];
661
662 /* Bitblt screen DC to memory DC */
663 BitBlt(hMemDC, 0, 0, w, n, hScrDC, 0, y, SRCCOPY);
664
665 /* Copy bitmap bits from memory DC to bmbits */
666 GetBitmapBits(hBitmap, size, bmbits);
667
668 /* Get the hash of the bitmap */
669 MD(bmbits,size,md);
670
671 /* Seed the random generator with the hash value */
672 RAND_add(md, MD_DIGEST_LENGTH, 0);
673 }
674
675 OPENSSL_free(bmbits);
676 }
677
678 /* Select old bitmap back into memory DC */
679 hBitmap = SelectObject(hMemDC, hOldBitmap);
680
681 /* Clean up */
682 DeleteObject(hBitmap);
683 DeleteDC(hMemDC);
684 DeleteDC(hScrDC);
685}
686
687#else /* Unix version */
688
689#include <time.h>
690
691int RAND_poll(void)
692{
693 unsigned long l;
694 pid_t curr_pid = getpid();
695#ifdef DEVRANDOM
696 FILE *fh;
697#endif
698
699#ifdef DEVRANDOM
700 /* Use a random entropy pool device. Linux, FreeBSD and OpenBSD
701 * have this. Use /dev/urandom if you can as /dev/random may block
702 * if it runs out of random entries. */
703
704 if ((fh = fopen(DEVRANDOM, "r")) != NULL)
705 {
706 unsigned char tmpbuf[ENTROPY_NEEDED];
707 int n;
708
709 setvbuf(fh, NULL, _IONBF, 0);
710 n=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
711 fclose(fh);
712 RAND_add(tmpbuf,sizeof tmpbuf,n);
713 memset(tmpbuf,0,n);
714 }
715#endif
716
717 /* put in some default random data, we need more than just this */
718 l=curr_pid;
719 RAND_add(&l,sizeof(l),0);
720 l=getuid();
721 RAND_add(&l,sizeof(l),0);
722
723 l=time(NULL);
724 RAND_add(&l,sizeof(l),0);
725
726#ifdef DEVRANDOM
727 return 1;
728#endif
729 return 0;
730}
731
732#endif
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index c6ff27be0e..29718bdb9d 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -61,8 +61,6 @@
61#include <stdlib.h> 61#include <stdlib.h>
62#include <string.h> 62#include <string.h>
63 63
64#include "openssl/e_os.h"
65
66#ifdef VMS 64#ifdef VMS
67#include <unixio.h> 65#include <unixio.h>
68#endif 66#endif
@@ -75,6 +73,7 @@
75# include <sys/stat.h> 73# include <sys/stat.h>
76#endif 74#endif
77 75
76#include <openssl/e_os.h>
78#include <openssl/crypto.h> 77#include <openssl/crypto.h>
79#include <openssl/rand.h> 78#include <openssl/rand.h>
80 79
@@ -139,7 +138,7 @@ err:
139int RAND_write_file(const char *file) 138int RAND_write_file(const char *file)
140 { 139 {
141 unsigned char buf[BUFSIZE]; 140 unsigned char buf[BUFSIZE];
142 int i,ret=0,err=0; 141 int i,ret=0,rand_err=0;
143 FILE *out = NULL; 142 FILE *out = NULL;
144 int n; 143 int n;
145 struct stat sb; 144 struct stat sb;
@@ -156,18 +155,18 @@ int RAND_write_file(const char *file)
156 } 155 }
157 } 156 }
158 157
159#if defined(O_CREAT) && defined(O_EXCL) && !defined(WIN32) 158#if defined(O_CREAT) && !defined(WIN32)
160 /* For some reason Win32 can't write to files created this way */ 159 /* For some reason Win32 can't write to files created this way */
161 160
162 /* chmod(..., 0600) is too late to protect the file, 161 /* chmod(..., 0600) is too late to protect the file,
163 * permissions should be restrictive from the start */ 162 * permissions should be restrictive from the start */
164 int fd = open(file, O_CREAT | O_EXCL, 0600); 163 int fd = open(file, O_CREAT, 0600);
165 if (fd != -1) 164 if (fd != -1)
166 out = fdopen(fd, "wb"); 165 out = fdopen(fd, "wb");
167#endif 166#endif
168 if (out == NULL) 167 if (out == NULL)
169 out = fopen(file,"wb"); 168 out = fopen(file,"wb");
170 if (out == NULL) goto err; 169 if (out == NULL) goto err;
171 170
172#ifndef NO_CHMOD 171#ifndef NO_CHMOD
173 chmod(file,0600); 172 chmod(file,0600);
@@ -178,7 +177,7 @@ int RAND_write_file(const char *file)
178 i=(n > BUFSIZE)?BUFSIZE:n; 177 i=(n > BUFSIZE)?BUFSIZE:n;
179 n-=BUFSIZE; 178 n-=BUFSIZE;
180 if (RAND_bytes(buf,i) <= 0) 179 if (RAND_bytes(buf,i) <= 0)
181 err=1; 180 rand_err=1;
182 i=fwrite(buf,1,i,out); 181 i=fwrite(buf,1,i,out);
183 if (i <= 0) 182 if (i <= 0)
184 { 183 {
@@ -194,7 +193,7 @@ int RAND_write_file(const char *file)
194 { 193 {
195 char *tmpf; 194 char *tmpf;
196 195
197 tmpf = Malloc(strlen(file) + 4); /* to add ";-1" and a nul */ 196 tmpf = OPENSSL_malloc(strlen(file) + 4); /* to add ";-1" and a nul */
198 if (tmpf) 197 if (tmpf)
199 { 198 {
200 strcpy(tmpf, file); 199 strcpy(tmpf, file);
@@ -211,7 +210,7 @@ int RAND_write_file(const char *file)
211 fclose(out); 210 fclose(out);
212 memset(buf,0,BUFSIZE); 211 memset(buf,0,BUFSIZE);
213err: 212err:
214 return(err ? -1 : ret); 213 return (rand_err ? -1 : ret);
215 } 214 }
216 215
217const char *RAND_file_name(char *buf, int size) 216const char *RAND_file_name(char *buf, int size)
diff --git a/src/lib/libcrypto/rc2/rc2.h b/src/lib/libcrypto/rc2/rc2.h
index 9571efb755..076c0a067c 100644
--- a/src/lib/libcrypto/rc2/rc2.h
+++ b/src/lib/libcrypto/rc2/rc2.h
@@ -59,10 +59,6 @@
59#ifndef HEADER_RC2_H 59#ifndef HEADER_RC2_H
60#define HEADER_RC2_H 60#define HEADER_RC2_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_RC2 62#ifdef NO_RC2
67#error RC2 is disabled. 63#error RC2 is disabled.
68#endif 64#endif
@@ -74,23 +70,29 @@ extern "C" {
74#define RC2_BLOCK 8 70#define RC2_BLOCK 8
75#define RC2_KEY_LENGTH 16 71#define RC2_KEY_LENGTH 16
76 72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77typedef struct rc2_key_st 77typedef struct rc2_key_st
78 { 78 {
79 RC2_INT data[64]; 79 RC2_INT data[64];
80 } RC2_KEY; 80 } RC2_KEY;
81 81
82 82
83void RC2_set_key(RC2_KEY *key, int len, unsigned char *data,int bits); 83void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits);
84void RC2_ecb_encrypt(unsigned char *in,unsigned char *out,RC2_KEY *key, 84void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key,
85 int enc); 85 int enc);
86void RC2_encrypt(unsigned long *data,RC2_KEY *key); 86void RC2_encrypt(unsigned long *data,RC2_KEY *key);
87void RC2_decrypt(unsigned long *data,RC2_KEY *key); 87void RC2_decrypt(unsigned long *data,RC2_KEY *key);
88void RC2_cbc_encrypt(unsigned char *in, unsigned char *out, long length, 88void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
89 RC2_KEY *ks, unsigned char *iv, int enc); 89 RC2_KEY *ks, unsigned char *iv, int enc);
90void RC2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, 90void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
91 RC2_KEY *schedule, unsigned char *ivec, int *num, int enc); 91 long length, RC2_KEY *schedule, unsigned char *ivec,
92void RC2_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, 92 int *num, int enc);
93 RC2_KEY *schedule, unsigned char *ivec, int *num); 93void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
94 long length, RC2_KEY *schedule, unsigned char *ivec,
95 int *num);
94 96
95#ifdef __cplusplus 97#ifdef __cplusplus
96} 98}
diff --git a/src/lib/libcrypto/rc2/rc2_cbc.c b/src/lib/libcrypto/rc2/rc2_cbc.c
index 1202184e85..74f48d3d87 100644
--- a/src/lib/libcrypto/rc2/rc2_cbc.c
+++ b/src/lib/libcrypto/rc2/rc2_cbc.c
@@ -59,7 +59,7 @@
59#include <openssl/rc2.h> 59#include <openssl/rc2.h>
60#include "rc2_locl.h" 60#include "rc2_locl.h"
61 61
62void RC2_cbc_encrypt(unsigned char *in, unsigned char *out, long length, 62void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
63 RC2_KEY *ks, unsigned char *iv, int encrypt) 63 RC2_KEY *ks, unsigned char *iv, int encrypt)
64 { 64 {
65 register unsigned long tin0,tin1; 65 register unsigned long tin0,tin1;
diff --git a/src/lib/libcrypto/rc2/rc2_ecb.c b/src/lib/libcrypto/rc2/rc2_ecb.c
index 7d77b9186c..d3e8c2718a 100644
--- a/src/lib/libcrypto/rc2/rc2_ecb.c
+++ b/src/lib/libcrypto/rc2/rc2_ecb.c
@@ -70,8 +70,8 @@ const char *RC2_version="RC2" OPENSSL_VERSION_PTEXT;
70 * Date: 11 Feb 1996 06:45:03 GMT 70 * Date: 11 Feb 1996 06:45:03 GMT
71 */ 71 */
72 72
73void RC2_ecb_encrypt(unsigned char *in, unsigned char *out, RC2_KEY *ks, 73void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, RC2_KEY *ks,
74 int encrypt) 74 int encrypt)
75 { 75 {
76 unsigned long l,d[2]; 76 unsigned long l,d[2];
77 77
diff --git a/src/lib/libcrypto/rc2/rc2_skey.c b/src/lib/libcrypto/rc2/rc2_skey.c
index 7143c4e591..cab3080c73 100644
--- a/src/lib/libcrypto/rc2/rc2_skey.c
+++ b/src/lib/libcrypto/rc2/rc2_skey.c
@@ -90,7 +90,7 @@ static unsigned char key_table[256]={
90 * BSAFE uses the 'retarded' version. What I previously shipped is 90 * BSAFE uses the 'retarded' version. What I previously shipped is
91 * the same as specifying 1024 for the 'bits' parameter. Bsafe uses 91 * the same as specifying 1024 for the 'bits' parameter. Bsafe uses
92 * a version where the bits parameter is the same as len*8 */ 92 * a version where the bits parameter is the same as len*8 */
93void RC2_set_key(RC2_KEY *key, int len, unsigned char *data, int bits) 93void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits)
94 { 94 {
95 int i,j; 95 int i,j;
96 unsigned char *k; 96 unsigned char *k;
diff --git a/src/lib/libcrypto/rc2/rc2cfb64.c b/src/lib/libcrypto/rc2/rc2cfb64.c
index 5e3fa07d90..b3a0158a6e 100644
--- a/src/lib/libcrypto/rc2/rc2cfb64.c
+++ b/src/lib/libcrypto/rc2/rc2cfb64.c
@@ -64,8 +64,9 @@
64 * 64bit block we have used is contained in *num; 64 * 64bit block we have used is contained in *num;
65 */ 65 */
66 66
67void RC2_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, 67void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,
68 RC2_KEY *schedule, unsigned char *ivec, int *num, int encrypt) 68 long length, RC2_KEY *schedule, unsigned char *ivec,
69 int *num, int encrypt)
69 { 70 {
70 register unsigned long v0,v1,t; 71 register unsigned long v0,v1,t;
71 register int n= *num; 72 register int n= *num;
diff --git a/src/lib/libcrypto/rc2/rc2ofb64.c b/src/lib/libcrypto/rc2/rc2ofb64.c
index 42cdd40cdd..9e297867ed 100644
--- a/src/lib/libcrypto/rc2/rc2ofb64.c
+++ b/src/lib/libcrypto/rc2/rc2ofb64.c
@@ -63,8 +63,9 @@
63 * used. The extra state information to record how much of the 63 * used. The extra state information to record how much of the
64 * 64bit block we have used is contained in *num; 64 * 64bit block we have used is contained in *num;
65 */ 65 */
66void RC2_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, 66void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,
67 RC2_KEY *schedule, unsigned char *ivec, int *num) 67 long length, RC2_KEY *schedule, unsigned char *ivec,
68 int *num)
68 { 69 {
69 register unsigned long v0,v1,t; 70 register unsigned long v0,v1,t;
70 register int n= *num; 71 register int n= *num;
diff --git a/src/lib/libcrypto/rc4/rc4.h b/src/lib/libcrypto/rc4/rc4.h
index 8556dddab0..40251024a4 100644
--- a/src/lib/libcrypto/rc4/rc4.h
+++ b/src/lib/libcrypto/rc4/rc4.h
@@ -59,16 +59,16 @@
59#ifndef HEADER_RC4_H 59#ifndef HEADER_RC4_H
60#define HEADER_RC4_H 60#define HEADER_RC4_H
61 61
62#ifdef __cplusplus
63extern "C" {
64#endif
65
66#ifdef NO_RC4 62#ifdef NO_RC4
67#error RC4 is disabled. 63#error RC4 is disabled.
68#endif 64#endif
69 65
70#include <openssl/opensslconf.h> /* RC4_INT */ 66#include <openssl/opensslconf.h> /* RC4_INT */
71 67
68#ifdef __cplusplus
69extern "C" {
70#endif
71
72typedef struct rc4_key_st 72typedef struct rc4_key_st
73 { 73 {
74 RC4_INT x,y; 74 RC4_INT x,y;
diff --git a/src/lib/libcrypto/rc5/rc5.h b/src/lib/libcrypto/rc5/rc5.h
index 38e901502b..fc4cea5e36 100644
--- a/src/lib/libcrypto/rc5/rc5.h
+++ b/src/lib/libcrypto/rc5/rc5.h
@@ -93,18 +93,21 @@ typedef struct rc5_key_st
93 } RC5_32_KEY; 93 } RC5_32_KEY;
94 94
95 95
96void RC5_32_set_key(RC5_32_KEY *key, int len, unsigned char *data, 96void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
97 int rounds); 97 int rounds);
98void RC5_32_ecb_encrypt(unsigned char *in,unsigned char *out,RC5_32_KEY *key, 98void RC5_32_ecb_encrypt(const unsigned char *in,unsigned char *out,RC5_32_KEY *key,
99 int enc); 99 int enc);
100void RC5_32_encrypt(unsigned long *data,RC5_32_KEY *key); 100void RC5_32_encrypt(unsigned long *data,RC5_32_KEY *key);
101void RC5_32_decrypt(unsigned long *data,RC5_32_KEY *key); 101void RC5_32_decrypt(unsigned long *data,RC5_32_KEY *key);
102void RC5_32_cbc_encrypt(unsigned char *in, unsigned char *out, long length, 102void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
103 RC5_32_KEY *ks, unsigned char *iv, int enc); 103 long length, RC5_32_KEY *ks, unsigned char *iv,
104void RC5_32_cfb64_encrypt(unsigned char *in, unsigned char *out, long length, 104 int enc);
105 RC5_32_KEY *schedule, unsigned char *ivec, int *num, int enc); 105void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out,
106void RC5_32_ofb64_encrypt(unsigned char *in, unsigned char *out, long length, 106 long length, RC5_32_KEY *schedule,
107 RC5_32_KEY *schedule, unsigned char *ivec, int *num); 107 unsigned char *ivec, int *num, int enc);
108void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out,
109 long length, RC5_32_KEY *schedule,
110 unsigned char *ivec, int *num);
108 111
109#ifdef __cplusplus 112#ifdef __cplusplus
110} 113}
diff --git a/src/lib/libcrypto/ripemd/Makefile.ssl b/src/lib/libcrypto/ripemd/Makefile.ssl
index 6ada9f067b..de01a953ec 100644
--- a/src/lib/libcrypto/ripemd/Makefile.ssl
+++ b/src/lib/libcrypto/ripemd/Makefile.ssl
@@ -22,7 +22,7 @@ CFLAGS= $(INCLUDES) $(CFLAG)
22 22
23GENERAL=Makefile 23GENERAL=Makefile
24TEST=rmdtest.c 24TEST=rmdtest.c
25APPS=rmd160.c 25APPS=
26 26
27LIB=$(TOP)/libcrypto.a 27LIB=$(TOP)/libcrypto.a
28LIBSRC=rmd_dgst.c rmd_one.c 28LIBSRC=rmd_dgst.c rmd_one.c
diff --git a/src/lib/libcrypto/rsa/Makefile.ssl b/src/lib/libcrypto/rsa/Makefile.ssl
index 7b3960e70d..c159eedafe 100644
--- a/src/lib/libcrypto/rsa/Makefile.ssl
+++ b/src/lib/libcrypto/rsa/Makefile.ssl
@@ -80,64 +80,97 @@ clean:
80 80
81# DO NOT DELETE THIS LINE -- make depend depends on it. 81# DO NOT DELETE THIS LINE -- make depend depends on it.
82 82
83rsa_chk.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 83rsa_chk.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
84rsa_chk.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 84rsa_chk.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
85rsa_chk.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
85rsa_chk.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 86rsa_chk.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
86rsa_chk.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 87rsa_chk.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
87rsa_eay.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 88rsa_chk.o: ../../include/openssl/symhacks.h
88rsa_eay.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 89rsa_eay.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
90rsa_eay.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
91rsa_eay.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
92rsa_eay.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
93rsa_eay.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
89rsa_eay.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 94rsa_eay.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
90rsa_eay.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 95rsa_eay.o: ../../include/openssl/engine.h ../../include/openssl/err.h
96rsa_eay.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
97rsa_eay.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
98rsa_eay.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
99rsa_eay.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
100rsa_eay.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
91rsa_eay.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 101rsa_eay.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
102rsa_eay.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
103rsa_eay.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
92rsa_eay.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 104rsa_eay.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
93rsa_eay.o: ../../include/openssl/stack.h ../cryptlib.h 105rsa_eay.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
94rsa_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 106rsa_eay.o: ../../include/openssl/symhacks.h ../cryptlib.h
95rsa_err.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 107rsa_err.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
108rsa_err.o: ../../include/openssl/crypto.h ../../include/openssl/err.h
109rsa_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
96rsa_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 110rsa_err.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h
97rsa_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 111rsa_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
112rsa_err.o: ../../include/openssl/symhacks.h
98rsa_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 113rsa_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
99rsa_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 114rsa_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
100rsa_gen.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 115rsa_gen.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
101rsa_gen.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 116rsa_gen.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
102rsa_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h 117rsa_gen.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
103rsa_gen.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 118rsa_gen.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
119rsa_gen.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
104rsa_gen.o: ../cryptlib.h 120rsa_gen.o: ../cryptlib.h
105rsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 121rsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
106rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 122rsa_lib.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
123rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
124rsa_lib.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
125rsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
107rsa_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 126rsa_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
108rsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 127rsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
109rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 128rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
129rsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
130rsa_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
131rsa_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
132rsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
133rsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
134rsa_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
135rsa_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
110rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 136rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
111rsa_lib.o: ../../include/openssl/stack.h ../cryptlib.h 137rsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
138rsa_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h
112rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 139rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
113rsa_none.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 140rsa_none.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
114rsa_none.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 141rsa_none.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
115rsa_none.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 142rsa_none.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
143rsa_none.o: ../../include/openssl/opensslconf.h
116rsa_none.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 144rsa_none.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
117rsa_none.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 145rsa_none.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
118rsa_none.o: ../../include/openssl/stack.h ../cryptlib.h 146rsa_none.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
147rsa_none.o: ../cryptlib.h
119rsa_null.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 148rsa_null.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
120rsa_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 149rsa_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
121rsa_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 150rsa_null.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
122rsa_null.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 151rsa_null.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
152rsa_null.o: ../../include/openssl/opensslconf.h
123rsa_null.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 153rsa_null.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
124rsa_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 154rsa_null.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
125rsa_null.o: ../../include/openssl/stack.h ../cryptlib.h 155rsa_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
156rsa_null.o: ../cryptlib.h
126rsa_oaep.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 157rsa_oaep.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
127rsa_oaep.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 158rsa_oaep.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
128rsa_oaep.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 159rsa_oaep.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
129rsa_oaep.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 160rsa_oaep.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
161rsa_oaep.o: ../../include/openssl/opensslconf.h
130rsa_oaep.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 162rsa_oaep.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
131rsa_oaep.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 163rsa_oaep.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
132rsa_oaep.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 164rsa_oaep.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
133rsa_oaep.o: ../cryptlib.h 165rsa_oaep.o: ../../include/openssl/symhacks.h ../cryptlib.h
134rsa_pk1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 166rsa_pk1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
135rsa_pk1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 167rsa_pk1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
136rsa_pk1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 168rsa_pk1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
137rsa_pk1.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 169rsa_pk1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
138rsa_pk1.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 170rsa_pk1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
139rsa_pk1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 171rsa_pk1.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
140rsa_pk1.o: ../../include/openssl/stack.h ../cryptlib.h 172rsa_pk1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
173rsa_pk1.o: ../../include/openssl/symhacks.h ../cryptlib.h
141rsa_saos.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 174rsa_saos.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
142rsa_saos.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 175rsa_saos.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
143rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 176rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -145,37 +178,43 @@ rsa_saos.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
145rsa_saos.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 178rsa_saos.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
146rsa_saos.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 179rsa_saos.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
147rsa_saos.o: ../../include/openssl/err.h ../../include/openssl/evp.h 180rsa_saos.o: ../../include/openssl/err.h ../../include/openssl/evp.h
148rsa_saos.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 181rsa_saos.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
182rsa_saos.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
149rsa_saos.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 183rsa_saos.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
150rsa_saos.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 184rsa_saos.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
185rsa_saos.o: ../../include/openssl/opensslconf.h
151rsa_saos.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 186rsa_saos.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
152rsa_saos.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 187rsa_saos.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
153rsa_saos.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 188rsa_saos.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
154rsa_saos.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 189rsa_saos.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
155rsa_saos.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 190rsa_saos.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
156rsa_saos.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 191rsa_saos.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
157rsa_saos.o: ../cryptlib.h 192rsa_saos.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
158rsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 193rsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
159rsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 194rsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
160rsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 195rsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
161rsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 196rsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
162rsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 197rsa_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
163rsa_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 198rsa_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
164rsa_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h 199rsa_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
165rsa_sign.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 200rsa_sign.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
166rsa_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 201rsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
202rsa_sign.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
203rsa_sign.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
167rsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 204rsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
168rsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 205rsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
169rsa_sign.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 206rsa_sign.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h
170rsa_sign.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 207rsa_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
171rsa_sign.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 208rsa_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
172rsa_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 209rsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
210rsa_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
173rsa_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 211rsa_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
174rsa_sign.o: ../cryptlib.h 212rsa_sign.o: ../cryptlib.h
175rsa_ssl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 213rsa_ssl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
176rsa_ssl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 214rsa_ssl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
177rsa_ssl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 215rsa_ssl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
178rsa_ssl.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h 216rsa_ssl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
179rsa_ssl.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h 217rsa_ssl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
180rsa_ssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 218rsa_ssl.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
181rsa_ssl.o: ../../include/openssl/stack.h ../cryptlib.h 219rsa_ssl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
220rsa_ssl.o: ../../include/openssl/symhacks.h ../cryptlib.h
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h
index f9f9b5cfe9..bda636a365 100644
--- a/src/lib/libcrypto/rsa/rsa.h
+++ b/src/lib/libcrypto/rsa/rsa.h
@@ -59,10 +59,9 @@
59#ifndef HEADER_RSA_H 59#ifndef HEADER_RSA_H
60#define HEADER_RSA_H 60#define HEADER_RSA_H
61 61
62#ifdef __cplusplus 62#ifndef NO_BIO
63extern "C" { 63#include <openssl/bio.h>
64#endif 64#endif
65
66#include <openssl/bn.h> 65#include <openssl/bn.h>
67#include <openssl/crypto.h> 66#include <openssl/crypto.h>
68 67
@@ -70,6 +69,10 @@ extern "C" {
70#error RSA is disabled. 69#error RSA is disabled.
71#endif 70#endif
72 71
72#ifdef __cplusplus
73extern "C" {
74#endif
75
73typedef struct rsa_st RSA; 76typedef struct rsa_st RSA;
74 77
75typedef struct rsa_meth_st 78typedef struct rsa_meth_st
@@ -111,7 +114,11 @@ struct rsa_st
111 * this is passed instead of aEVP_PKEY, it is set to 0 */ 114 * this is passed instead of aEVP_PKEY, it is set to 0 */
112 int pad; 115 int pad;
113 int version; 116 int version;
117#if 0
114 RSA_METHOD *meth; 118 RSA_METHOD *meth;
119#else
120 struct engine_st *engine;
121#endif
115 BIGNUM *n; 122 BIGNUM *n;
116 BIGNUM *e; 123 BIGNUM *e;
117 BIGNUM *d; 124 BIGNUM *d;
@@ -165,7 +172,11 @@ struct rsa_st
165#define RSA_get_app_data(s) RSA_get_ex_data(s,0) 172#define RSA_get_app_data(s) RSA_get_ex_data(s,0)
166 173
167RSA * RSA_new(void); 174RSA * RSA_new(void);
175#if 0
168RSA * RSA_new_method(RSA_METHOD *method); 176RSA * RSA_new_method(RSA_METHOD *method);
177#else
178RSA * RSA_new_method(struct engine_st *engine);
179#endif
169int RSA_size(RSA *); 180int RSA_size(RSA *);
170RSA * RSA_generate_key(int bits, unsigned long e,void 181RSA * RSA_generate_key(int bits, unsigned long e,void
171 (*callback)(int,int,void *),void *cb_arg); 182 (*callback)(int,int,void *),void *cb_arg);
@@ -183,10 +194,14 @@ void RSA_free (RSA *r);
183 194
184int RSA_flags(RSA *r); 195int RSA_flags(RSA *r);
185 196
186void RSA_set_default_method(RSA_METHOD *meth); 197void RSA_set_default_openssl_method(RSA_METHOD *meth);
187RSA_METHOD *RSA_get_default_method(void); 198RSA_METHOD *RSA_get_default_openssl_method(void);
188RSA_METHOD *RSA_get_method(RSA *rsa); 199RSA_METHOD *RSA_get_method(RSA *rsa);
200#if 0
189RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth); 201RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth);
202#else
203int RSA_set_method(RSA *rsa, struct engine_st *engine);
204#endif
190 205
191/* This function needs the memory locking malloc callbacks to be installed */ 206/* This function needs the memory locking malloc callbacks to be installed */
192int RSA_memory_lock(RSA *r); 207int RSA_memory_lock(RSA *r);
@@ -209,10 +224,14 @@ int i2d_RSAPrivateKey(RSA *a, unsigned char **pp);
209int RSA_print_fp(FILE *fp, RSA *r,int offset); 224int RSA_print_fp(FILE *fp, RSA *r,int offset);
210#endif 225#endif
211 226
212#ifdef HEADER_BIO_H 227#ifndef NO_BIO
213int RSA_print(BIO *bp, RSA *r,int offset); 228int RSA_print(BIO *bp, RSA *r,int offset);
214#endif 229#endif
215 230
231int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey);
232RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey);
233RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey);
234
216int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); 235int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)());
217RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); 236RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)());
218/* Naughty internal function required elsewhere, to handle a MS structure 237/* Naughty internal function required elsewhere, to handle a MS structure
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c
index b7d2460754..8b8a1e279a 100644
--- a/src/lib/libcrypto/rsa/rsa_eay.c
+++ b/src/lib/libcrypto/rsa/rsa_eay.c
@@ -61,6 +61,7 @@
61#include <openssl/bn.h> 61#include <openssl/bn.h>
62#include <openssl/rsa.h> 62#include <openssl/rsa.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/engine.h>
64 65
65#ifndef RSA_NULL 66#ifndef RSA_NULL
66 67
@@ -97,16 +98,18 @@ RSA_METHOD *RSA_PKCS1_SSLeay(void)
97static int RSA_eay_public_encrypt(int flen, unsigned char *from, 98static int RSA_eay_public_encrypt(int flen, unsigned char *from,
98 unsigned char *to, RSA *rsa, int padding) 99 unsigned char *to, RSA *rsa, int padding)
99 { 100 {
101 const RSA_METHOD *meth;
100 BIGNUM f,ret; 102 BIGNUM f,ret;
101 int i,j,k,num=0,r= -1; 103 int i,j,k,num=0,r= -1;
102 unsigned char *buf=NULL; 104 unsigned char *buf=NULL;
103 BN_CTX *ctx=NULL; 105 BN_CTX *ctx=NULL;
104 106
107 meth = ENGINE_get_RSA(rsa->engine);
105 BN_init(&f); 108 BN_init(&f);
106 BN_init(&ret); 109 BN_init(&ret);
107 if ((ctx=BN_CTX_new()) == NULL) goto err; 110 if ((ctx=BN_CTX_new()) == NULL) goto err;
108 num=BN_num_bytes(rsa->n); 111 num=BN_num_bytes(rsa->n);
109 if ((buf=(unsigned char *)Malloc(num)) == NULL) 112 if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
110 { 113 {
111 RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE); 114 RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);
112 goto err; 115 goto err;
@@ -143,7 +146,7 @@ static int RSA_eay_public_encrypt(int flen, unsigned char *from,
143 goto err; 146 goto err;
144 } 147 }
145 148
146 if (!rsa->meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx, 149 if (!meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx,
147 rsa->_method_mod_n)) goto err; 150 rsa->_method_mod_n)) goto err;
148 151
149 /* put in leading 0 bytes if the number is less than the 152 /* put in leading 0 bytes if the number is less than the
@@ -161,7 +164,7 @@ err:
161 if (buf != NULL) 164 if (buf != NULL)
162 { 165 {
163 memset(buf,0,num); 166 memset(buf,0,num);
164 Free(buf); 167 OPENSSL_free(buf);
165 } 168 }
166 return(r); 169 return(r);
167 } 170 }
@@ -169,17 +172,19 @@ err:
169static int RSA_eay_private_encrypt(int flen, unsigned char *from, 172static int RSA_eay_private_encrypt(int flen, unsigned char *from,
170 unsigned char *to, RSA *rsa, int padding) 173 unsigned char *to, RSA *rsa, int padding)
171 { 174 {
175 const RSA_METHOD *meth;
172 BIGNUM f,ret; 176 BIGNUM f,ret;
173 int i,j,k,num=0,r= -1; 177 int i,j,k,num=0,r= -1;
174 unsigned char *buf=NULL; 178 unsigned char *buf=NULL;
175 BN_CTX *ctx=NULL; 179 BN_CTX *ctx=NULL;
176 180
181 meth = ENGINE_get_RSA(rsa->engine);
177 BN_init(&f); 182 BN_init(&f);
178 BN_init(&ret); 183 BN_init(&ret);
179 184
180 if ((ctx=BN_CTX_new()) == NULL) goto err; 185 if ((ctx=BN_CTX_new()) == NULL) goto err;
181 num=BN_num_bytes(rsa->n); 186 num=BN_num_bytes(rsa->n);
182 if ((buf=(unsigned char *)Malloc(num)) == NULL) 187 if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
183 { 188 {
184 RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,ERR_R_MALLOC_FAILURE); 189 RSAerr(RSA_F_RSA_EAY_PRIVATE_ENCRYPT,ERR_R_MALLOC_FAILURE);
185 goto err; 190 goto err;
@@ -213,10 +218,10 @@ static int RSA_eay_private_encrypt(int flen, unsigned char *from,
213 (rsa->dmp1 != NULL) && 218 (rsa->dmp1 != NULL) &&
214 (rsa->dmq1 != NULL) && 219 (rsa->dmq1 != NULL) &&
215 (rsa->iqmp != NULL)) ) 220 (rsa->iqmp != NULL)) )
216 { if (!rsa->meth->rsa_mod_exp(&ret,&f,rsa)) goto err; } 221 { if (!meth->rsa_mod_exp(&ret,&f,rsa)) goto err; }
217 else 222 else
218 { 223 {
219 if (!rsa->meth->bn_mod_exp(&ret,&f,rsa->d,rsa->n,ctx,NULL)) goto err; 224 if (!meth->bn_mod_exp(&ret,&f,rsa->d,rsa->n,ctx,NULL)) goto err;
220 } 225 }
221 226
222 if (rsa->flags & RSA_FLAG_BLINDING) 227 if (rsa->flags & RSA_FLAG_BLINDING)
@@ -237,7 +242,7 @@ err:
237 if (buf != NULL) 242 if (buf != NULL)
238 { 243 {
239 memset(buf,0,num); 244 memset(buf,0,num);
240 Free(buf); 245 OPENSSL_free(buf);
241 } 246 }
242 return(r); 247 return(r);
243 } 248 }
@@ -245,12 +250,14 @@ err:
245static int RSA_eay_private_decrypt(int flen, unsigned char *from, 250static int RSA_eay_private_decrypt(int flen, unsigned char *from,
246 unsigned char *to, RSA *rsa, int padding) 251 unsigned char *to, RSA *rsa, int padding)
247 { 252 {
253 const RSA_METHOD *meth;
248 BIGNUM f,ret; 254 BIGNUM f,ret;
249 int j,num=0,r= -1; 255 int j,num=0,r= -1;
250 unsigned char *p; 256 unsigned char *p;
251 unsigned char *buf=NULL; 257 unsigned char *buf=NULL;
252 BN_CTX *ctx=NULL; 258 BN_CTX *ctx=NULL;
253 259
260 meth = ENGINE_get_RSA(rsa->engine);
254 BN_init(&f); 261 BN_init(&f);
255 BN_init(&ret); 262 BN_init(&ret);
256 ctx=BN_CTX_new(); 263 ctx=BN_CTX_new();
@@ -258,7 +265,7 @@ static int RSA_eay_private_decrypt(int flen, unsigned char *from,
258 265
259 num=BN_num_bytes(rsa->n); 266 num=BN_num_bytes(rsa->n);
260 267
261 if ((buf=(unsigned char *)Malloc(num)) == NULL) 268 if ((buf=(unsigned char *)OPENSSL_malloc(num)) == NULL)
262 { 269 {
263 RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,ERR_R_MALLOC_FAILURE); 270 RSAerr(RSA_F_RSA_EAY_PRIVATE_DECRYPT,ERR_R_MALLOC_FAILURE);
264 goto err; 271 goto err;
@@ -287,10 +294,10 @@ static int RSA_eay_private_decrypt(int flen, unsigned char *from,
287 (rsa->dmp1 != NULL) && 294 (rsa->dmp1 != NULL) &&
288 (rsa->dmq1 != NULL) && 295 (rsa->dmq1 != NULL) &&
289 (rsa->iqmp != NULL)) ) 296 (rsa->iqmp != NULL)) )
290 { if (!rsa->meth->rsa_mod_exp(&ret,&f,rsa)) goto err; } 297 { if (!meth->rsa_mod_exp(&ret,&f,rsa)) goto err; }
291 else 298 else
292 { 299 {
293 if (!rsa->meth->bn_mod_exp(&ret,&f,rsa->d,rsa->n,ctx,NULL)) 300 if (!meth->bn_mod_exp(&ret,&f,rsa->d,rsa->n,ctx,NULL))
294 goto err; 301 goto err;
295 } 302 }
296 303
@@ -330,7 +337,7 @@ err:
330 if (buf != NULL) 337 if (buf != NULL)
331 { 338 {
332 memset(buf,0,num); 339 memset(buf,0,num);
333 Free(buf); 340 OPENSSL_free(buf);
334 } 341 }
335 return(r); 342 return(r);
336 } 343 }
@@ -338,19 +345,21 @@ err:
338static int RSA_eay_public_decrypt(int flen, unsigned char *from, 345static int RSA_eay_public_decrypt(int flen, unsigned char *from,
339 unsigned char *to, RSA *rsa, int padding) 346 unsigned char *to, RSA *rsa, int padding)
340 { 347 {
348 const RSA_METHOD *meth;
341 BIGNUM f,ret; 349 BIGNUM f,ret;
342 int i,num=0,r= -1; 350 int i,num=0,r= -1;
343 unsigned char *p; 351 unsigned char *p;
344 unsigned char *buf=NULL; 352 unsigned char *buf=NULL;
345 BN_CTX *ctx=NULL; 353 BN_CTX *ctx=NULL;
346 354
355 meth = ENGINE_get_RSA(rsa->engine);
347 BN_init(&f); 356 BN_init(&f);
348 BN_init(&ret); 357 BN_init(&ret);
349 ctx=BN_CTX_new(); 358 ctx=BN_CTX_new();
350 if (ctx == NULL) goto err; 359 if (ctx == NULL) goto err;
351 360
352 num=BN_num_bytes(rsa->n); 361 num=BN_num_bytes(rsa->n);
353 buf=(unsigned char *)Malloc(num); 362 buf=(unsigned char *)OPENSSL_malloc(num);
354 if (buf == NULL) 363 if (buf == NULL)
355 { 364 {
356 RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE); 365 RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE);
@@ -374,7 +383,7 @@ static int RSA_eay_public_decrypt(int flen, unsigned char *from,
374 goto err; 383 goto err;
375 } 384 }
376 385
377 if (!rsa->meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx, 386 if (!meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx,
378 rsa->_method_mod_n)) goto err; 387 rsa->_method_mod_n)) goto err;
379 388
380 p=buf; 389 p=buf;
@@ -402,17 +411,19 @@ err:
402 if (buf != NULL) 411 if (buf != NULL)
403 { 412 {
404 memset(buf,0,num); 413 memset(buf,0,num);
405 Free(buf); 414 OPENSSL_free(buf);
406 } 415 }
407 return(r); 416 return(r);
408 } 417 }
409 418
410static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) 419static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
411 { 420 {
421 const RSA_METHOD *meth;
412 BIGNUM r1,m1; 422 BIGNUM r1,m1;
413 int ret=0; 423 int ret=0;
414 BN_CTX *ctx; 424 BN_CTX *ctx;
415 425
426 meth = ENGINE_get_RSA(rsa->engine);
416 if ((ctx=BN_CTX_new()) == NULL) goto err; 427 if ((ctx=BN_CTX_new()) == NULL) goto err;
417 BN_init(&m1); 428 BN_init(&m1);
418 BN_init(&r1); 429 BN_init(&r1);
@@ -436,11 +447,11 @@ static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
436 } 447 }
437 448
438 if (!BN_mod(&r1,I,rsa->q,ctx)) goto err; 449 if (!BN_mod(&r1,I,rsa->q,ctx)) goto err;
439 if (!rsa->meth->bn_mod_exp(&m1,&r1,rsa->dmq1,rsa->q,ctx, 450 if (!meth->bn_mod_exp(&m1,&r1,rsa->dmq1,rsa->q,ctx,
440 rsa->_method_mod_q)) goto err; 451 rsa->_method_mod_q)) goto err;
441 452
442 if (!BN_mod(&r1,I,rsa->p,ctx)) goto err; 453 if (!BN_mod(&r1,I,rsa->p,ctx)) goto err;
443 if (!rsa->meth->bn_mod_exp(r0,&r1,rsa->dmp1,rsa->p,ctx, 454 if (!meth->bn_mod_exp(r0,&r1,rsa->dmp1,rsa->p,ctx,
444 rsa->_method_mod_p)) goto err; 455 rsa->_method_mod_p)) goto err;
445 456
446 if (!BN_sub(r0,r0,&m1)) goto err; 457 if (!BN_sub(r0,r0,&m1)) goto err;
diff --git a/src/lib/libcrypto/rsa/rsa_gen.c b/src/lib/libcrypto/rsa/rsa_gen.c
index 95e636d3f0..00c25adbc5 100644
--- a/src/lib/libcrypto/rsa/rsa_gen.c
+++ b/src/lib/libcrypto/rsa/rsa_gen.c
@@ -95,7 +95,7 @@ RSA *RSA_generate_key(int bits, unsigned long e_value,
95 * unsigned long can be larger */ 95 * unsigned long can be larger */
96 for (i=0; i<sizeof(unsigned long)*8; i++) 96 for (i=0; i<sizeof(unsigned long)*8; i++)
97 { 97 {
98 if (e_value & (1<<i)) 98 if (e_value & (1UL<<i))
99 BN_set_bit(rsa->e,i); 99 BN_set_bit(rsa->e,i);
100 } 100 }
101#else 101#else
diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c
index 074a4f5074..5e1e8fcdf3 100644
--- a/src/lib/libcrypto/rsa/rsa_lib.c
+++ b/src/lib/libcrypto/rsa/rsa_lib.c
@@ -62,6 +62,7 @@
62#include <openssl/lhash.h> 62#include <openssl/lhash.h>
63#include <openssl/bn.h> 63#include <openssl/bn.h>
64#include <openssl/rsa.h> 64#include <openssl/rsa.h>
65#include <openssl/engine.h>
65 66
66const char *RSA_version="RSA" OPENSSL_VERSION_PTEXT; 67const char *RSA_version="RSA" OPENSSL_VERSION_PTEXT;
67 68
@@ -74,21 +75,49 @@ RSA *RSA_new(void)
74 return(RSA_new_method(NULL)); 75 return(RSA_new_method(NULL));
75 } 76 }
76 77
77void RSA_set_default_method(RSA_METHOD *meth) 78void RSA_set_default_openssl_method(RSA_METHOD *meth)
78 { 79 {
79 default_RSA_meth=meth; 80 ENGINE *e;
81 /* We'll need to notify the "openssl" ENGINE of this
82 * change too. We won't bother locking things down at
83 * our end as there was never any locking in these
84 * functions! */
85 if(default_RSA_meth != meth)
86 {
87 default_RSA_meth = meth;
88 e = ENGINE_by_id("openssl");
89 if(e)
90 {
91 ENGINE_set_RSA(e, meth);
92 ENGINE_free(e);
93 }
94 }
80 } 95 }
81 96
82RSA_METHOD *RSA_get_default_method(void) 97RSA_METHOD *RSA_get_default_openssl_method(void)
83{ 98{
99 if (default_RSA_meth == NULL)
100 {
101#ifdef RSA_NULL
102 default_RSA_meth=RSA_null_method();
103#else
104#ifdef RSAref
105 default_RSA_meth=RSA_PKCS1_RSAref();
106#else
107 default_RSA_meth=RSA_PKCS1_SSLeay();
108#endif
109#endif
110 }
111
84 return default_RSA_meth; 112 return default_RSA_meth;
85} 113}
86 114
87RSA_METHOD *RSA_get_method(RSA *rsa) 115RSA_METHOD *RSA_get_method(RSA *rsa)
88{ 116{
89 return rsa->meth; 117 return ENGINE_get_RSA(rsa->engine);
90} 118}
91 119
120#if 0
92RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth) 121RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth)
93{ 122{
94 RSA_METHOD *mtmp; 123 RSA_METHOD *mtmp;
@@ -98,34 +127,52 @@ RSA_METHOD *RSA_set_method(RSA *rsa, RSA_METHOD *meth)
98 if (meth->init) meth->init(rsa); 127 if (meth->init) meth->init(rsa);
99 return mtmp; 128 return mtmp;
100} 129}
130#else
131int RSA_set_method(RSA *rsa, ENGINE *engine)
132{
133 ENGINE *mtmp;
134 RSA_METHOD *meth;
135 mtmp = rsa->engine;
136 meth = ENGINE_get_RSA(mtmp);
137 if (!ENGINE_init(engine))
138 return 0;
139 if (meth->finish) meth->finish(rsa);
140 rsa->engine = engine;
141 meth = ENGINE_get_RSA(engine);
142 if (meth->init) meth->init(rsa);
143 /* SHOULD ERROR CHECK THIS!!! */
144 ENGINE_finish(mtmp);
145 return 1;
146}
147#endif
101 148
149#if 0
102RSA *RSA_new_method(RSA_METHOD *meth) 150RSA *RSA_new_method(RSA_METHOD *meth)
151#else
152RSA *RSA_new_method(ENGINE *engine)
153#endif
103 { 154 {
155 RSA_METHOD *meth;
104 RSA *ret; 156 RSA *ret;
105 157
106 if (default_RSA_meth == NULL) 158 ret=(RSA *)OPENSSL_malloc(sizeof(RSA));
107 {
108#ifdef RSA_NULL
109 default_RSA_meth=RSA_null_method();
110#else
111#ifdef RSAref
112 default_RSA_meth=RSA_PKCS1_RSAref();
113#else
114 default_RSA_meth=RSA_PKCS1_SSLeay();
115#endif
116#endif
117 }
118 ret=(RSA *)Malloc(sizeof(RSA));
119 if (ret == NULL) 159 if (ret == NULL)
120 { 160 {
121 RSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE); 161 RSAerr(RSA_F_RSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
122 return(NULL); 162 return(NULL);
123 } 163 }
124 164
125 if (meth == NULL) 165 if (engine == NULL)
126 ret->meth=default_RSA_meth; 166 {
167 if((ret->engine=ENGINE_get_default_RSA()) == NULL)
168 {
169 OPENSSL_free(ret);
170 return NULL;
171 }
172 }
127 else 173 else
128 ret->meth=meth; 174 ret->engine=engine;
175 meth = ENGINE_get_RSA(ret->engine);
129 176
130 ret->pad=0; 177 ret->pad=0;
131 ret->version=0; 178 ret->version=0;
@@ -143,10 +190,10 @@ RSA *RSA_new_method(RSA_METHOD *meth)
143 ret->_method_mod_q=NULL; 190 ret->_method_mod_q=NULL;
144 ret->blinding=NULL; 191 ret->blinding=NULL;
145 ret->bignum_data=NULL; 192 ret->bignum_data=NULL;
146 ret->flags=ret->meth->flags; 193 ret->flags=meth->flags;
147 if ((ret->meth->init != NULL) && !ret->meth->init(ret)) 194 if ((meth->init != NULL) && !meth->init(ret))
148 { 195 {
149 Free(ret); 196 OPENSSL_free(ret);
150 ret=NULL; 197 ret=NULL;
151 } 198 }
152 else 199 else
@@ -156,6 +203,7 @@ RSA *RSA_new_method(RSA_METHOD *meth)
156 203
157void RSA_free(RSA *r) 204void RSA_free(RSA *r)
158 { 205 {
206 RSA_METHOD *meth;
159 int i; 207 int i;
160 208
161 if (r == NULL) return; 209 if (r == NULL) return;
@@ -175,8 +223,10 @@ void RSA_free(RSA *r)
175 223
176 CRYPTO_free_ex_data(rsa_meth,r,&r->ex_data); 224 CRYPTO_free_ex_data(rsa_meth,r,&r->ex_data);
177 225
178 if (r->meth->finish != NULL) 226 meth = ENGINE_get_RSA(r->engine);
179 r->meth->finish(r); 227 if (meth->finish != NULL)
228 meth->finish(r);
229 ENGINE_finish(r->engine);
180 230
181 if (r->n != NULL) BN_clear_free(r->n); 231 if (r->n != NULL) BN_clear_free(r->n);
182 if (r->e != NULL) BN_clear_free(r->e); 232 if (r->e != NULL) BN_clear_free(r->e);
@@ -187,8 +237,8 @@ void RSA_free(RSA *r)
187 if (r->dmq1 != NULL) BN_clear_free(r->dmq1); 237 if (r->dmq1 != NULL) BN_clear_free(r->dmq1);
188 if (r->iqmp != NULL) BN_clear_free(r->iqmp); 238 if (r->iqmp != NULL) BN_clear_free(r->iqmp);
189 if (r->blinding != NULL) BN_BLINDING_free(r->blinding); 239 if (r->blinding != NULL) BN_BLINDING_free(r->blinding);
190 if (r->bignum_data != NULL) Free_locked(r->bignum_data); 240 if (r->bignum_data != NULL) OPENSSL_free_locked(r->bignum_data);
191 Free(r); 241 OPENSSL_free(r);
192 } 242 }
193 243
194int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 244int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
@@ -217,30 +267,34 @@ int RSA_size(RSA *r)
217int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to, 267int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to,
218 RSA *rsa, int padding) 268 RSA *rsa, int padding)
219 { 269 {
220 return(rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding)); 270 return(ENGINE_get_RSA(rsa->engine)->rsa_pub_enc(flen,
271 from, to, rsa, padding));
221 } 272 }
222 273
223int RSA_private_encrypt(int flen, unsigned char *from, unsigned char *to, 274int RSA_private_encrypt(int flen, unsigned char *from, unsigned char *to,
224 RSA *rsa, int padding) 275 RSA *rsa, int padding)
225 { 276 {
226 return(rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding)); 277 return(ENGINE_get_RSA(rsa->engine)->rsa_priv_enc(flen,
278 from, to, rsa, padding));
227 } 279 }
228 280
229int RSA_private_decrypt(int flen, unsigned char *from, unsigned char *to, 281int RSA_private_decrypt(int flen, unsigned char *from, unsigned char *to,
230 RSA *rsa, int padding) 282 RSA *rsa, int padding)
231 { 283 {
232 return(rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding)); 284 return(ENGINE_get_RSA(rsa->engine)->rsa_priv_dec(flen,
285 from, to, rsa, padding));
233 } 286 }
234 287
235int RSA_public_decrypt(int flen, unsigned char *from, unsigned char *to, 288int RSA_public_decrypt(int flen, unsigned char *from, unsigned char *to,
236 RSA *rsa, int padding) 289 RSA *rsa, int padding)
237 { 290 {
238 return(rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding)); 291 return(ENGINE_get_RSA(rsa->engine)->rsa_pub_dec(flen,
292 from, to, rsa, padding));
239 } 293 }
240 294
241int RSA_flags(RSA *r) 295int RSA_flags(RSA *r)
242 { 296 {
243 return((r == NULL)?0:r->meth->flags); 297 return((r == NULL)?0:ENGINE_get_RSA(r->engine)->flags);
244 } 298 }
245 299
246void RSA_blinding_off(RSA *rsa) 300void RSA_blinding_off(RSA *rsa)
@@ -274,7 +328,8 @@ int RSA_blinding_on(RSA *rsa, BN_CTX *p_ctx)
274 if (!BN_rand(A,BN_num_bits(rsa->n)-1,1,0)) goto err; 328 if (!BN_rand(A,BN_num_bits(rsa->n)-1,1,0)) goto err;
275 if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err; 329 if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err;
276 330
277 if (!rsa->meth->bn_mod_exp(A,A,rsa->e,rsa->n,ctx,rsa->_method_mod_n)) 331 if (!ENGINE_get_RSA(rsa->engine)->bn_mod_exp(A,A,
332 rsa->e,rsa->n,ctx,rsa->_method_mod_n))
278 goto err; 333 goto err;
279 rsa->blinding=BN_BLINDING_new(A,Ai,rsa->n); 334 rsa->blinding=BN_BLINDING_new(A,Ai,rsa->n);
280 rsa->flags|=RSA_FLAG_BLINDING; 335 rsa->flags|=RSA_FLAG_BLINDING;
@@ -305,7 +360,7 @@ int RSA_memory_lock(RSA *r)
305 j=1; 360 j=1;
306 for (i=0; i<6; i++) 361 for (i=0; i<6; i++)
307 j+= (*t[i])->top; 362 j+= (*t[i])->top;
308 if ((p=Malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL) 363 if ((p=OPENSSL_malloc_locked((off+j)*sizeof(BN_ULONG))) == NULL)
309 { 364 {
310 RSAerr(RSA_F_MEMORY_LOCK,ERR_R_MALLOC_FAILURE); 365 RSAerr(RSA_F_MEMORY_LOCK,ERR_R_MALLOC_FAILURE);
311 return(0); 366 return(0);
diff --git a/src/lib/libcrypto/rsa/rsa_oaep.c b/src/lib/libcrypto/rsa/rsa_oaep.c
index 1465c01f4f..fd0b7f361f 100644
--- a/src/lib/libcrypto/rsa/rsa_oaep.c
+++ b/src/lib/libcrypto/rsa/rsa_oaep.c
@@ -34,7 +34,7 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
34 return (0); 34 return (0);
35 } 35 }
36 36
37 dbmask = Malloc(emlen - SHA_DIGEST_LENGTH); 37 dbmask = OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
38 if (dbmask == NULL) 38 if (dbmask == NULL)
39 { 39 {
40 RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE); 40 RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
@@ -66,7 +66,7 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
66 for (i = 0; i < SHA_DIGEST_LENGTH; i++) 66 for (i = 0; i < SHA_DIGEST_LENGTH; i++)
67 seed[i] ^= seedmask[i]; 67 seed[i] ^= seedmask[i];
68 68
69 Free(dbmask); 69 OPENSSL_free(dbmask);
70 return (1); 70 return (1);
71 } 71 }
72 72
@@ -86,7 +86,7 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
86 } 86 }
87 87
88 dblen = num - SHA_DIGEST_LENGTH; 88 dblen = num - SHA_DIGEST_LENGTH;
89 db = Malloc(dblen); 89 db = OPENSSL_malloc(dblen);
90 if (db == NULL) 90 if (db == NULL)
91 { 91 {
92 RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE); 92 RSAerr(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP, ERR_R_MALLOC_FAILURE);
@@ -128,7 +128,7 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
128 memcpy(to, db + i, mlen); 128 memcpy(to, db + i, mlen);
129 } 129 }
130 } 130 }
131 Free(db); 131 OPENSSL_free(db);
132 return (mlen); 132 return (mlen);
133 } 133 }
134 134
diff --git a/src/lib/libcrypto/rsa/rsa_saos.c b/src/lib/libcrypto/rsa/rsa_saos.c
index 61efb0b00f..c77f4381ff 100644
--- a/src/lib/libcrypto/rsa/rsa_saos.c
+++ b/src/lib/libcrypto/rsa/rsa_saos.c
@@ -81,7 +81,7 @@ int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len,
81 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); 81 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
82 return(0); 82 return(0);
83 } 83 }
84 s=(unsigned char *)Malloc((unsigned int)j+1); 84 s=(unsigned char *)OPENSSL_malloc((unsigned int)j+1);
85 if (s == NULL) 85 if (s == NULL)
86 { 86 {
87 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE); 87 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE);
@@ -96,7 +96,7 @@ int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len,
96 *siglen=i; 96 *siglen=i;
97 97
98 memset(s,0,(unsigned int)j+1); 98 memset(s,0,(unsigned int)j+1);
99 Free(s); 99 OPENSSL_free(s);
100 return(ret); 100 return(ret);
101 } 101 }
102 102
@@ -114,7 +114,7 @@ int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m,
114 return(0); 114 return(0);
115 } 115 }
116 116
117 s=(unsigned char *)Malloc((unsigned int)siglen); 117 s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen);
118 if (s == NULL) 118 if (s == NULL)
119 { 119 {
120 RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE); 120 RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING,ERR_R_MALLOC_FAILURE);
@@ -138,7 +138,7 @@ int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m,
138err: 138err:
139 if (sig != NULL) M_ASN1_OCTET_STRING_free(sig); 139 if (sig != NULL) M_ASN1_OCTET_STRING_free(sig);
140 memset(s,0,(unsigned int)siglen); 140 memset(s,0,(unsigned int)siglen);
141 Free(s); 141 OPENSSL_free(s);
142 return(ret); 142 return(ret);
143 } 143 }
144 144
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c
index 05bb7fb74a..cf00876292 100644
--- a/src/lib/libcrypto/rsa/rsa_sign.c
+++ b/src/lib/libcrypto/rsa/rsa_sign.c
@@ -62,6 +62,7 @@
62#include <openssl/rsa.h> 62#include <openssl/rsa.h>
63#include <openssl/objects.h> 63#include <openssl/objects.h>
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65#include <openssl/engine.h>
65 66
66/* Size of an SSL signature: MD5+SHA1 */ 67/* Size of an SSL signature: MD5+SHA1 */
67#define SSL_SIG_LENGTH 36 68#define SSL_SIG_LENGTH 36
@@ -76,7 +77,8 @@ int RSA_sign(int type, unsigned char *m, unsigned int m_len,
76 X509_ALGOR algor; 77 X509_ALGOR algor;
77 ASN1_OCTET_STRING digest; 78 ASN1_OCTET_STRING digest;
78 if(rsa->flags & RSA_FLAG_SIGN_VER) 79 if(rsa->flags & RSA_FLAG_SIGN_VER)
79 return rsa->meth->rsa_sign(type, m, m_len, sigret, siglen, rsa); 80 return ENGINE_get_RSA(rsa->engine)->rsa_sign(type,
81 m, m_len, sigret, siglen, rsa);
80 /* Special case: SSL signature, just check the length */ 82 /* Special case: SSL signature, just check the length */
81 if(type == NID_md5_sha1) { 83 if(type == NID_md5_sha1) {
82 if(m_len != SSL_SIG_LENGTH) { 84 if(m_len != SSL_SIG_LENGTH) {
@@ -115,7 +117,7 @@ int RSA_sign(int type, unsigned char *m, unsigned int m_len,
115 return(0); 117 return(0);
116 } 118 }
117 if(type != NID_md5_sha1) { 119 if(type != NID_md5_sha1) {
118 s=(unsigned char *)Malloc((unsigned int)j+1); 120 s=(unsigned char *)OPENSSL_malloc((unsigned int)j+1);
119 if (s == NULL) 121 if (s == NULL)
120 { 122 {
121 RSAerr(RSA_F_RSA_SIGN,ERR_R_MALLOC_FAILURE); 123 RSAerr(RSA_F_RSA_SIGN,ERR_R_MALLOC_FAILURE);
@@ -132,7 +134,7 @@ int RSA_sign(int type, unsigned char *m, unsigned int m_len,
132 134
133 if(type != NID_md5_sha1) { 135 if(type != NID_md5_sha1) {
134 memset(s,0,(unsigned int)j+1); 136 memset(s,0,(unsigned int)j+1);
135 Free(s); 137 OPENSSL_free(s);
136 } 138 }
137 return(ret); 139 return(ret);
138 } 140 }
@@ -151,9 +153,10 @@ int RSA_verify(int dtype, unsigned char *m, unsigned int m_len,
151 } 153 }
152 154
153 if(rsa->flags & RSA_FLAG_SIGN_VER) 155 if(rsa->flags & RSA_FLAG_SIGN_VER)
154 return rsa->meth->rsa_verify(dtype, m, m_len, sigbuf, siglen, rsa); 156 return ENGINE_get_RSA(rsa->engine)->rsa_verify(dtype,
157 m, m_len, sigbuf, siglen, rsa);
155 158
156 s=(unsigned char *)Malloc((unsigned int)siglen); 159 s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen);
157 if (s == NULL) 160 if (s == NULL)
158 { 161 {
159 RSAerr(RSA_F_RSA_VERIFY,ERR_R_MALLOC_FAILURE); 162 RSAerr(RSA_F_RSA_VERIFY,ERR_R_MALLOC_FAILURE);
@@ -215,7 +218,7 @@ int RSA_verify(int dtype, unsigned char *m, unsigned int m_len,
215err: 218err:
216 if (sig != NULL) X509_SIG_free(sig); 219 if (sig != NULL) X509_SIG_free(sig);
217 memset(s,0,(unsigned int)siglen); 220 memset(s,0,(unsigned int)siglen);
218 Free(s); 221 OPENSSL_free(s);
219 return(ret); 222 return(ret);
220 } 223 }
221 224
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c
index 81a857c813..482f4a8273 100644
--- a/src/lib/libcrypto/rsa/rsa_ssl.c
+++ b/src/lib/libcrypto/rsa/rsa_ssl.c
@@ -134,7 +134,7 @@ int RSA_padding_check_SSLv23(unsigned char *to, int tlen, unsigned char *from,
134 { 134 {
135 if (p[k] != 0x03) break; 135 if (p[k] != 0x03) break;
136 } 136 }
137 if (k == 0) 137 if (k == -1)
138 { 138 {
139 RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_SSLV3_ROLLBACK_ATTACK); 139 RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_SSLV3_ROLLBACK_ATTACK);
140 return(-1); 140 return(-1);
diff --git a/src/lib/libcrypto/stack/Makefile.ssl b/src/lib/libcrypto/stack/Makefile.ssl
index 64a93b33ac..86ed928750 100644
--- a/src/lib/libcrypto/stack/Makefile.ssl
+++ b/src/lib/libcrypto/stack/Makefile.ssl
@@ -81,6 +81,7 @@ clean:
81stack.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 81stack.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
82stack.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h 82stack.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
83stack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 83stack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
84stack.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 84stack.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
85stack.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 85stack.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
86stack.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
86stack.o: ../cryptlib.h 87stack.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/stack/safestack.h b/src/lib/libcrypto/stack/safestack.h
index 38934981e3..9fa63e1be5 100644
--- a/src/lib/libcrypto/stack/safestack.h
+++ b/src/lib/libcrypto/stack/safestack.h
@@ -57,73 +57,1078 @@
57 57
58#include <openssl/stack.h> 58#include <openssl/stack.h>
59 59
60#define STACK_OF(type) STACK_##type 60#ifdef DEBUG_SAFESTACK
61
62#define STACK_OF(type) struct stack_st_##type
63#define PREDECLARE_STACK_OF(type) STACK_OF(type);
61 64
62#define DECLARE_STACK_OF(type) \ 65#define DECLARE_STACK_OF(type) \
63typedef struct stack_st_##type \ 66STACK_OF(type) \
64 { \ 67 { \
65 STACK stack; \ 68 STACK stack; \
66 } STACK_OF(type); \ 69 };
67STACK_OF(type) *sk_##type##_new(int (*cmp)(type **,type **)); \ 70
68STACK_OF(type) *sk_##type##_new_null(void); \ 71#define IMPLEMENT_STACK_OF(type) /* nada (obsolete in new safestack approach)*/
69void sk_##type##_free(STACK_OF(type) *sk); \ 72
70int sk_##type##_num(const STACK_OF(type) *sk); \ 73/* SKM_sk_... stack macros are internal to safestack.h:
71type *sk_##type##_value(const STACK_OF(type) *sk,int n); \ 74 * never use them directly, use sk_<type>_... instead */
72type *sk_##type##_set(STACK_OF(type) *sk,int n,type *v); \ 75#define SKM_sk_new(type, cmp) \
73void sk_##type##_zero(STACK_OF(type) *sk); \ 76 ((STACK_OF(type) * (*)(int (*)(const type * const *, const type * const *)))sk_new)(cmp)
74int sk_##type##_push(STACK_OF(type) *sk,type *v); \ 77#define SKM_sk_new_null(type) \
75int sk_##type##_unshift(STACK_OF(type) *sk,type *v); \ 78 ((STACK_OF(type) * (*)(void))sk_new_null)()
76int sk_##type##_find(STACK_OF(type) *sk,type *v); \ 79#define SKM_sk_free(type, st) \
77type *sk_##type##_delete(STACK_OF(type) *sk,int n); \ 80 ((void (*)(STACK_OF(type) *))sk_free)(st)
78void sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v); \ 81#define SKM_sk_num(type, st) \
79int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n); \ 82 ((int (*)(const STACK_OF(type) *))sk_num)(st)
80int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \ 83#define SKM_sk_value(type, st,i) \
81 int (*cmp)(type **,type **)))(type **,type **); \ 84 ((type * (*)(const STACK_OF(type) *, int))sk_value)(st, i)
82STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk); \ 85#define SKM_sk_set(type, st,i,val) \
83void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)); \ 86 ((type * (*)(STACK_OF(type) *, int, type *))sk_set)(st, i, val)
84type *sk_##type##_shift(STACK_OF(type) *sk); \ 87#define SKM_sk_zero(type, st) \
85type *sk_##type##_pop(STACK_OF(type) *sk); \ 88 ((void (*)(STACK_OF(type) *))sk_zero)(st)
86void sk_##type##_sort(STACK_OF(type) *sk); 89#define SKM_sk_push(type, st,val) \
87 90 ((int (*)(STACK_OF(type) *, type *))sk_push)(st, val)
88#define IMPLEMENT_STACK_OF(type) \ 91#define SKM_sk_unshift(type, st,val) \
89STACK_OF(type) *sk_##type##_new(int (*cmp)(type **,type **)) \ 92 ((int (*)(STACK_OF(type) *, type *))sk_unshift)(st, val)
90 { return (STACK_OF(type) *)sk_new(cmp); } \ 93#define SKM_sk_find(type, st,val) \
91STACK_OF(type) *sk_##type##_new_null() \ 94 ((int (*)(STACK_OF(type) *, type *))sk_find)(st, val)
92 { return (STACK_OF(type) *)sk_new_null(); } \ 95#define SKM_sk_delete(type, st,i) \
93void sk_##type##_free(STACK_OF(type) *sk) \ 96 ((type * (*)(STACK_OF(type) *, int))sk_delete)(st, i)
94 { sk_free((STACK *)sk); } \ 97#define SKM_sk_delete_ptr(type, st,ptr) \
95int sk_##type##_num(const STACK_OF(type) *sk) \ 98 ((type * (*)(STACK_OF(type) *, type *))sk_delete_ptr)(st, ptr)
96 { return M_sk_num((const STACK *)sk); } \ 99#define SKM_sk_insert(type, st,val,i) \
97type *sk_##type##_value(const STACK_OF(type) *sk,int n) \ 100 ((int (*)(STACK_OF(type) *, type *, int))sk_insert)(st, val, i)
98 { return (type *)sk_value((STACK *)sk,n); } \ 101#define SKM_sk_set_cmp_func(type, st,cmp) \
99type *sk_##type##_set(STACK_OF(type) *sk,int n,type *v) \ 102 ((int (*(*)(STACK_OF(type) *, int (*)(const type * const *, const type * const *))) \
100 { return (type *)(sk_set((STACK *)sk,n,(char *)v)); } \ 103 (const type * const *, const type * const *))sk_set_cmp_func)\
101void sk_##type##_zero(STACK_OF(type) *sk) \ 104 (st, cmp)
102 { sk_zero((STACK *)sk); } \ 105#define SKM_sk_dup(type, st) \
103int sk_##type##_push(STACK_OF(type) *sk,type *v) \ 106 ((STACK_OF(type) *(*)(STACK_OF(type) *))sk_dup)(st)
104 { return sk_push((STACK *)sk,(char *)v); } \ 107#define SKM_sk_pop_free(type, st,free_func) \
105int sk_##type##_unshift(STACK_OF(type) *sk,type *v) \ 108 ((void (*)(STACK_OF(type) *, void (*)(type *)))sk_pop_free)\
106 { return sk_unshift((STACK *)sk,(char *)v); } \ 109 (st, free_func)
107int sk_##type##_find(STACK_OF(type) *sk,type *v) \ 110#define SKM_sk_shift(type, st) \
108 { return sk_find((STACK *)sk,(char *)v); } \ 111 ((type * (*)(STACK_OF(type) *))sk_shift)(st)
109type *sk_##type##_delete(STACK_OF(type) *sk,int n) \ 112#define SKM_sk_pop(type, st) \
110 { return (type *)sk_delete((STACK *)sk,n); } \ 113 ((type * (*)(STACK_OF(type) *))sk_pop)(st)
111void sk_##type##_delete_ptr(STACK_OF(type) *sk,type *v) \ 114#define SKM_sk_sort(type, st) \
112 { sk_delete_ptr((STACK *)sk,(char *)v); } \ 115 ((void (*)(STACK_OF(type) *))sk_sort)(st)
113int sk_##type##_insert(STACK_OF(type) *sk,type *v,int n) \ 116
114 { return sk_insert((STACK *)sk,(char *)v,n); } \ 117#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
115int (*sk_##type##_set_cmp_func(STACK_OF(type) *sk, \ 118 ((STACK_OF(type) * (*) (STACK_OF(type) **,unsigned char **, long , \
116 int (*cmp)(type **,type **)))(type **,type **) \ 119 type *(*)(type **, unsigned char **,long), \
117 { return (int (*)(type **,type **))sk_set_cmp_func((STACK *)sk,cmp); } \ 120 void (*)(type *), int ,int )) d2i_ASN1_SET) \
118STACK_OF(type) *sk_##type##_dup(STACK_OF(type) *sk) \ 121 (st,pp,length, d2i_func, free_func, ex_tag,ex_class)
119 { return (STACK_OF(type) *)sk_dup((STACK *)sk); } \ 122#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
120void sk_##type##_pop_free(STACK_OF(type) *sk,void (*func)(type *)) \ 123 ((int (*)(STACK_OF(type) *,unsigned char **, \
121 { sk_pop_free((STACK *)sk,func); } \ 124 int (*)(type *,unsigned char **), int , int , int)) i2d_ASN1_SET) \
122type *sk_##type##_shift(STACK_OF(type) *sk) \ 125 (st,pp,i2d_func,ex_tag,ex_class,is_set)
123 { return (type *)sk_shift((STACK *)sk); } \ 126
124type *sk_##type##_pop(STACK_OF(type) *sk) \ 127#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
125 { return (type *)sk_pop((STACK *)sk); } \ 128 ((unsigned char *(*)(STACK_OF(type) *, \
126void sk_##type##_sort(STACK_OF(type) *sk) \ 129 int (*)(type *,unsigned char **), unsigned char **,int *)) ASN1_seq_pack) \
127 { sk_sort((STACK *)sk); } 130 (st, i2d_func, buf, len)
128 131#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
129#endif /* ndef HEADER_SAFESTACK_H */ 132 ((STACK_OF(type) * (*)(unsigned char *,int, \
133 type *(*)(type **,unsigned char **, long), \
134 void (*)(type *)))ASN1_seq_unpack) \
135 (buf,len,d2i_func, free_func)
136
137#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
138 ((STACK_OF(type) * (*)(X509_ALGOR *, \
139 type *(*)(type **, unsigned char **, long), void (*)(type *), \
140 const char *, int, \
141 ASN1_STRING *, int))PKCS12_decrypt_d2i) \
142 (algor,d2i_func,free_func,pass,passlen,oct,seq)
143
144#else
145
146#define STACK_OF(type) STACK
147#define PREDECLARE_STACK_OF(type) /* nada */
148#define DECLARE_STACK_OF(type) /* nada */
149#define IMPLEMENT_STACK_OF(type) /* nada */
150
151#define SKM_sk_new(type, cmp) \
152 sk_new((int (*)(const char * const *, const char * const *))(cmp))
153#define SKM_sk_new_null(type) \
154 sk_new_null()
155#define SKM_sk_free(type, st) \
156 sk_free(st)
157#define SKM_sk_num(type, st) \
158 sk_num(st)
159#define SKM_sk_value(type, st,i) \
160 ((type *)sk_value(st, i))
161#define SKM_sk_set(type, st,i,val) \
162 ((type *)sk_set(st, i,(char *)val))
163#define SKM_sk_zero(type, st) \
164 sk_zero(st)
165#define SKM_sk_push(type, st,val) \
166 sk_push(st, (char *)val)
167#define SKM_sk_unshift(type, st,val) \
168 sk_unshift(st, val)
169#define SKM_sk_find(type, st,val) \
170 sk_find(st, (char *)val)
171#define SKM_sk_delete(type, st,i) \
172 ((type *)sk_delete(st, i))
173#define SKM_sk_delete_ptr(type, st,ptr) \
174 ((type *)sk_delete_ptr(st,(char *)ptr))
175#define SKM_sk_insert(type, st,val,i) \
176 sk_insert(st, (char *)val, i)
177#define SKM_sk_set_cmp_func(type, st,cmp) \
178 ((int (*)(const type * const *,const type * const *)) \
179 sk_set_cmp_func(st, (int (*)(const char * const *, const char * const *))(cmp)))
180#define SKM_sk_dup(type, st) \
181 sk_dup(st)
182#define SKM_sk_pop_free(type, st,free_func) \
183 sk_pop_free(st, (void (*)(void *))free_func)
184#define SKM_sk_shift(type, st) \
185 ((type *)sk_shift(st))
186#define SKM_sk_pop(type, st) \
187 ((type *)sk_pop(st))
188#define SKM_sk_sort(type, st) \
189 sk_sort(st)
190
191#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
192 d2i_ASN1_SET(st,pp,length, (char *(*)())d2i_func, (void (*)(void *))free_func, ex_tag,ex_class)
193#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
194 i2d_ASN1_SET(st,pp,i2d_func,ex_tag,ex_class,is_set)
195
196#define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \
197 ASN1_seq_pack(st, i2d_func, buf, len)
198#define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \
199 ASN1_seq_unpack(buf,len,(char *(*)())d2i_func, (void(*)(void *))free_func)
200
201#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
202 ((STACK *)PKCS12_decrypt_d2i(algor,(char *(*)())d2i_func, (void(*)(void *))free_func,pass,passlen,oct,seq))
203
204#endif
205
206/* This block of defines is updated by util/mkstack.pl, please do not touch! */
207#define sk_ACCESS_DESCRIPTION_new(st) SKM_sk_new(ACCESS_DESCRIPTION, (st))
208#define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION)
209#define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st))
210#define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st))
211#define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i))
212#define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val))
213#define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st))
214#define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val))
215#define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val))
216#define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val))
217#define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i))
218#define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr))
219#define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i))
220#define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp))
221#define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st)
222#define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func))
223#define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st))
224#define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st))
225#define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st))
226
227#define sk_ASN1_INTEGER_new(st) SKM_sk_new(ASN1_INTEGER, (st))
228#define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER)
229#define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st))
230#define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st))
231#define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i))
232#define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val))
233#define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st))
234#define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val))
235#define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val))
236#define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val))
237#define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i))
238#define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr))
239#define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i))
240#define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp))
241#define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st)
242#define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func))
243#define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st))
244#define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st))
245#define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st))
246
247#define sk_ASN1_OBJECT_new(st) SKM_sk_new(ASN1_OBJECT, (st))
248#define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT)
249#define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st))
250#define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st))
251#define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i))
252#define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val))
253#define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st))
254#define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val))
255#define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val))
256#define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val))
257#define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i))
258#define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr))
259#define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i))
260#define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp))
261#define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st)
262#define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func))
263#define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st))
264#define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st))
265#define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st))
266
267#define sk_ASN1_STRING_TABLE_new(st) SKM_sk_new(ASN1_STRING_TABLE, (st))
268#define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE)
269#define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st))
270#define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st))
271#define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i))
272#define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val))
273#define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st))
274#define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val))
275#define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val))
276#define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val))
277#define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i))
278#define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr))
279#define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i))
280#define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp))
281#define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st)
282#define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func))
283#define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st))
284#define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st))
285#define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st))
286
287#define sk_ASN1_TYPE_new(st) SKM_sk_new(ASN1_TYPE, (st))
288#define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE)
289#define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st))
290#define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st))
291#define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i))
292#define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val))
293#define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st))
294#define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val))
295#define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val))
296#define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val))
297#define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i))
298#define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr))
299#define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i))
300#define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp))
301#define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st)
302#define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func))
303#define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st))
304#define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st))
305#define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st))
306
307#define sk_BIO_new(st) SKM_sk_new(BIO, (st))
308#define sk_BIO_new_null() SKM_sk_new_null(BIO)
309#define sk_BIO_free(st) SKM_sk_free(BIO, (st))
310#define sk_BIO_num(st) SKM_sk_num(BIO, (st))
311#define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i))
312#define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val))
313#define sk_BIO_zero(st) SKM_sk_zero(BIO, (st))
314#define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val))
315#define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val))
316#define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val))
317#define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i))
318#define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr))
319#define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i))
320#define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp))
321#define sk_BIO_dup(st) SKM_sk_dup(BIO, st)
322#define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func))
323#define sk_BIO_shift(st) SKM_sk_shift(BIO, (st))
324#define sk_BIO_pop(st) SKM_sk_pop(BIO, (st))
325#define sk_BIO_sort(st) SKM_sk_sort(BIO, (st))
326
327#define sk_CONF_VALUE_new(st) SKM_sk_new(CONF_VALUE, (st))
328#define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE)
329#define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st))
330#define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st))
331#define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i))
332#define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val))
333#define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st))
334#define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val))
335#define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val))
336#define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val))
337#define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i))
338#define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr))
339#define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i))
340#define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp))
341#define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st)
342#define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func))
343#define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st))
344#define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st))
345#define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st))
346
347#define sk_CRYPTO_EX_DATA_FUNCS_new(st) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (st))
348#define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS)
349#define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st))
350#define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st))
351#define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i))
352#define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val))
353#define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st))
354#define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val))
355#define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val))
356#define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val))
357#define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i))
358#define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr))
359#define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i))
360#define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp))
361#define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st)
362#define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func))
363#define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st))
364#define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st))
365#define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st))
366
367#define sk_CRYPTO_dynlock_new(st) SKM_sk_new(CRYPTO_dynlock, (st))
368#define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock)
369#define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st))
370#define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st))
371#define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i))
372#define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val))
373#define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st))
374#define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val))
375#define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val))
376#define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val))
377#define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i))
378#define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr))
379#define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i))
380#define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp))
381#define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st)
382#define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func))
383#define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st))
384#define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st))
385#define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st))
386
387#define sk_DIST_POINT_new(st) SKM_sk_new(DIST_POINT, (st))
388#define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT)
389#define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st))
390#define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st))
391#define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i))
392#define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val))
393#define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st))
394#define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val))
395#define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val))
396#define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val))
397#define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i))
398#define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr))
399#define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i))
400#define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp))
401#define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st)
402#define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func))
403#define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st))
404#define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st))
405#define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st))
406
407#define sk_GENERAL_NAME_new(st) SKM_sk_new(GENERAL_NAME, (st))
408#define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME)
409#define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st))
410#define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st))
411#define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i))
412#define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val))
413#define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st))
414#define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val))
415#define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val))
416#define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val))
417#define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i))
418#define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr))
419#define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i))
420#define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp))
421#define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st)
422#define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func))
423#define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st))
424#define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st))
425#define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st))
426
427#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st))
428#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER)
429#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st))
430#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st))
431#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i))
432#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val))
433#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st))
434#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val))
435#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val))
436#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val))
437#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i))
438#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr))
439#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i))
440#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp))
441#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st)
442#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func))
443#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st))
444#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st))
445#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
446
447#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st))
448#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
449#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
450#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st))
451#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i))
452#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val))
453#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st))
454#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val))
455#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val))
456#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val))
457#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i))
458#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr))
459#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i))
460#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp))
461#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st)
462#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func))
463#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st))
464#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st))
465#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st))
466
467#define sk_NAME_FUNCS_new(st) SKM_sk_new(NAME_FUNCS, (st))
468#define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS)
469#define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st))
470#define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st))
471#define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i))
472#define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val))
473#define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st))
474#define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val))
475#define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val))
476#define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val))
477#define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i))
478#define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr))
479#define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i))
480#define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp))
481#define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st)
482#define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func))
483#define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st))
484#define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st))
485#define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st))
486
487#define sk_PKCS12_SAFEBAG_new(st) SKM_sk_new(PKCS12_SAFEBAG, (st))
488#define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG)
489#define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st))
490#define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st))
491#define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i))
492#define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val))
493#define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st))
494#define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val))
495#define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val))
496#define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val))
497#define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i))
498#define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr))
499#define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i))
500#define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp))
501#define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st)
502#define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func))
503#define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st))
504#define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st))
505#define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st))
506
507#define sk_PKCS7_new(st) SKM_sk_new(PKCS7, (st))
508#define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7)
509#define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st))
510#define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st))
511#define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i))
512#define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val))
513#define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st))
514#define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val))
515#define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val))
516#define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val))
517#define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i))
518#define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr))
519#define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i))
520#define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp))
521#define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st)
522#define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func))
523#define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st))
524#define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st))
525#define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st))
526
527#define sk_PKCS7_RECIP_INFO_new(st) SKM_sk_new(PKCS7_RECIP_INFO, (st))
528#define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO)
529#define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st))
530#define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st))
531#define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i))
532#define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val))
533#define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st))
534#define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val))
535#define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val))
536#define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val))
537#define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i))
538#define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr))
539#define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i))
540#define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp))
541#define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st)
542#define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func))
543#define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st))
544#define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st))
545#define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st))
546
547#define sk_PKCS7_SIGNER_INFO_new(st) SKM_sk_new(PKCS7_SIGNER_INFO, (st))
548#define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO)
549#define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st))
550#define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st))
551#define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i))
552#define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val))
553#define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st))
554#define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val))
555#define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val))
556#define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val))
557#define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i))
558#define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr))
559#define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i))
560#define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp))
561#define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st)
562#define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func))
563#define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st))
564#define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st))
565#define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st))
566
567#define sk_POLICYINFO_new(st) SKM_sk_new(POLICYINFO, (st))
568#define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO)
569#define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st))
570#define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st))
571#define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i))
572#define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val))
573#define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st))
574#define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val))
575#define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val))
576#define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val))
577#define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i))
578#define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr))
579#define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i))
580#define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp))
581#define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st)
582#define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func))
583#define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st))
584#define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st))
585#define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st))
586
587#define sk_POLICYQUALINFO_new(st) SKM_sk_new(POLICYQUALINFO, (st))
588#define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO)
589#define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st))
590#define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st))
591#define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i))
592#define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val))
593#define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st))
594#define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val))
595#define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val))
596#define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val))
597#define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i))
598#define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr))
599#define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i))
600#define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp))
601#define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st)
602#define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func))
603#define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st))
604#define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st))
605#define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st))
606
607#define sk_SSL_CIPHER_new(st) SKM_sk_new(SSL_CIPHER, (st))
608#define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER)
609#define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st))
610#define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st))
611#define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i))
612#define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val))
613#define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st))
614#define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val))
615#define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val))
616#define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val))
617#define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i))
618#define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr))
619#define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i))
620#define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp))
621#define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st)
622#define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func))
623#define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st))
624#define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st))
625#define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st))
626
627#define sk_SSL_COMP_new(st) SKM_sk_new(SSL_COMP, (st))
628#define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP)
629#define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st))
630#define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st))
631#define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i))
632#define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val))
633#define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st))
634#define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val))
635#define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val))
636#define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val))
637#define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i))
638#define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr))
639#define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i))
640#define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp))
641#define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st)
642#define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func))
643#define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st))
644#define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st))
645#define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st))
646
647#define sk_SXNETID_new(st) SKM_sk_new(SXNETID, (st))
648#define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID)
649#define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st))
650#define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st))
651#define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i))
652#define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val))
653#define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st))
654#define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val))
655#define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val))
656#define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val))
657#define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i))
658#define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr))
659#define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i))
660#define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp))
661#define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st)
662#define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func))
663#define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st))
664#define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st))
665#define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st))
666
667#define sk_X509_new(st) SKM_sk_new(X509, (st))
668#define sk_X509_new_null() SKM_sk_new_null(X509)
669#define sk_X509_free(st) SKM_sk_free(X509, (st))
670#define sk_X509_num(st) SKM_sk_num(X509, (st))
671#define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i))
672#define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val))
673#define sk_X509_zero(st) SKM_sk_zero(X509, (st))
674#define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val))
675#define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val))
676#define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val))
677#define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i))
678#define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr))
679#define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i))
680#define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp))
681#define sk_X509_dup(st) SKM_sk_dup(X509, st)
682#define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func))
683#define sk_X509_shift(st) SKM_sk_shift(X509, (st))
684#define sk_X509_pop(st) SKM_sk_pop(X509, (st))
685#define sk_X509_sort(st) SKM_sk_sort(X509, (st))
686
687#define sk_X509V3_EXT_METHOD_new(st) SKM_sk_new(X509V3_EXT_METHOD, (st))
688#define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD)
689#define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st))
690#define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st))
691#define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i))
692#define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val))
693#define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st))
694#define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val))
695#define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val))
696#define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val))
697#define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i))
698#define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr))
699#define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i))
700#define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp))
701#define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st)
702#define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func))
703#define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st))
704#define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st))
705#define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st))
706
707#define sk_X509_ALGOR_new(st) SKM_sk_new(X509_ALGOR, (st))
708#define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR)
709#define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st))
710#define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st))
711#define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i))
712#define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val))
713#define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st))
714#define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val))
715#define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val))
716#define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val))
717#define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i))
718#define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr))
719#define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i))
720#define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp))
721#define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st)
722#define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func))
723#define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st))
724#define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st))
725#define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st))
726
727#define sk_X509_ATTRIBUTE_new(st) SKM_sk_new(X509_ATTRIBUTE, (st))
728#define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE)
729#define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st))
730#define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st))
731#define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i))
732#define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val))
733#define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st))
734#define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val))
735#define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val))
736#define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val))
737#define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i))
738#define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr))
739#define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i))
740#define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp))
741#define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st)
742#define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func))
743#define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st))
744#define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st))
745#define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st))
746
747#define sk_X509_CRL_new(st) SKM_sk_new(X509_CRL, (st))
748#define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL)
749#define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st))
750#define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st))
751#define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i))
752#define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val))
753#define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st))
754#define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val))
755#define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val))
756#define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val))
757#define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i))
758#define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr))
759#define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i))
760#define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp))
761#define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st)
762#define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func))
763#define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st))
764#define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st))
765#define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st))
766
767#define sk_X509_EXTENSION_new(st) SKM_sk_new(X509_EXTENSION, (st))
768#define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION)
769#define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st))
770#define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st))
771#define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i))
772#define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val))
773#define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st))
774#define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val))
775#define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val))
776#define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val))
777#define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i))
778#define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr))
779#define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i))
780#define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp))
781#define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st)
782#define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func))
783#define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st))
784#define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st))
785#define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st))
786
787#define sk_X509_INFO_new(st) SKM_sk_new(X509_INFO, (st))
788#define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO)
789#define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st))
790#define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st))
791#define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i))
792#define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val))
793#define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st))
794#define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val))
795#define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val))
796#define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val))
797#define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i))
798#define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr))
799#define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i))
800#define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp))
801#define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st)
802#define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func))
803#define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st))
804#define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st))
805#define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st))
806
807#define sk_X509_LOOKUP_new(st) SKM_sk_new(X509_LOOKUP, (st))
808#define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP)
809#define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st))
810#define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st))
811#define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i))
812#define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val))
813#define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st))
814#define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val))
815#define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val))
816#define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val))
817#define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i))
818#define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr))
819#define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i))
820#define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp))
821#define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st)
822#define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func))
823#define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st))
824#define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st))
825#define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st))
826
827#define sk_X509_NAME_new(st) SKM_sk_new(X509_NAME, (st))
828#define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME)
829#define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st))
830#define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st))
831#define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i))
832#define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val))
833#define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st))
834#define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val))
835#define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val))
836#define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val))
837#define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i))
838#define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr))
839#define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i))
840#define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp))
841#define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st)
842#define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func))
843#define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st))
844#define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st))
845#define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st))
846
847#define sk_X509_NAME_ENTRY_new(st) SKM_sk_new(X509_NAME_ENTRY, (st))
848#define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY)
849#define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st))
850#define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st))
851#define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i))
852#define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val))
853#define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st))
854#define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val))
855#define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val))
856#define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val))
857#define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i))
858#define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr))
859#define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i))
860#define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp))
861#define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st)
862#define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func))
863#define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st))
864#define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st))
865#define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st))
866
867#define sk_X509_OBJECT_new(st) SKM_sk_new(X509_OBJECT, (st))
868#define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT)
869#define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st))
870#define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st))
871#define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i))
872#define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val))
873#define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st))
874#define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val))
875#define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val))
876#define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val))
877#define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i))
878#define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr))
879#define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i))
880#define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp))
881#define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st)
882#define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func))
883#define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st))
884#define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st))
885#define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st))
886
887#define sk_X509_PURPOSE_new(st) SKM_sk_new(X509_PURPOSE, (st))
888#define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE)
889#define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st))
890#define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st))
891#define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i))
892#define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val))
893#define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st))
894#define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val))
895#define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val))
896#define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val))
897#define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i))
898#define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr))
899#define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i))
900#define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp))
901#define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st)
902#define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func))
903#define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st))
904#define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st))
905#define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st))
906
907#define sk_X509_REVOKED_new(st) SKM_sk_new(X509_REVOKED, (st))
908#define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED)
909#define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st))
910#define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st))
911#define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i))
912#define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val))
913#define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st))
914#define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val))
915#define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val))
916#define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val))
917#define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i))
918#define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr))
919#define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i))
920#define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp))
921#define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st)
922#define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func))
923#define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st))
924#define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st))
925#define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st))
926
927#define sk_X509_TRUST_new(st) SKM_sk_new(X509_TRUST, (st))
928#define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST)
929#define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st))
930#define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st))
931#define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i))
932#define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val))
933#define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st))
934#define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val))
935#define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val))
936#define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val))
937#define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i))
938#define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr))
939#define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i))
940#define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp))
941#define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st)
942#define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func))
943#define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st))
944#define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st))
945#define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st))
946
947#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
948 SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
949#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
950 SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
951#define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \
952 SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len))
953#define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \
954 SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func))
955
956#define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
957 SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
958#define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \
959 SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
960#define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \
961 SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len))
962#define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \
963 SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func))
964
965#define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
966 SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
967#define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
968 SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
969#define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \
970 SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len))
971#define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \
972 SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func))
973
974#define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
975 SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
976#define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
977 SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
978#define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \
979 SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len))
980#define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \
981 SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func))
982
983#define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
984 SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
985#define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \
986 SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
987#define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \
988 SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len))
989#define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \
990 SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func))
991
992#define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
993 SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
994#define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \
995 SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
996#define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \
997 SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len))
998#define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \
999 SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func))
1000
1001#define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1002 SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1003#define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1004 SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1005#define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \
1006 SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len))
1007#define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \
1008 SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func))
1009
1010#define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1011 SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1012#define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1013 SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1014#define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \
1015 SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len))
1016#define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \
1017 SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func))
1018
1019#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1020 SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1021#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1022 SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1023#define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \
1024 SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len))
1025#define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \
1026 SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func))
1027
1028#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1029 SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1030#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1031 SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1032#define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \
1033 SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len))
1034#define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \
1035 SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func))
1036
1037#define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1038 SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1039#define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1040 SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1041#define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \
1042 SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len))
1043#define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \
1044 SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func))
1045
1046#define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1047 SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1048#define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1049 SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1050#define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \
1051 SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len))
1052#define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \
1053 SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func))
1054
1055#define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1056 SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1057#define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1058 SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1059#define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \
1060 SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len))
1061#define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \
1062 SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func))
1063
1064#define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1065 SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1066#define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1067 SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1068#define ASN1_seq_pack_X509(st, i2d_func, buf, len) \
1069 SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len))
1070#define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \
1071 SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func))
1072
1073#define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1074 SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1075#define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1076 SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1077#define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \
1078 SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len))
1079#define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \
1080 SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func))
1081
1082#define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1083 SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1084#define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1085 SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1086#define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \
1087 SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len))
1088#define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \
1089 SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func))
1090
1091#define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1092 SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1093#define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1094 SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1095#define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \
1096 SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len))
1097#define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \
1098 SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func))
1099
1100#define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1101 SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1102#define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1103 SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1104#define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \
1105 SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len))
1106#define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \
1107 SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func))
1108
1109#define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1110 SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1111#define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1112 SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1113#define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \
1114 SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len))
1115#define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \
1116 SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func))
1117
1118#define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
1119 SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
1120#define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \
1121 SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
1122#define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \
1123 SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len))
1124#define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \
1125 SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func))
1126
1127#define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \
1128 SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
1129
1130#define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \
1131 SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
1132/* End of util/mkstack.pl block, you may now edit :-) */
1133
1134#endif /* !defined HEADER_SAFESTACK_H */
diff --git a/src/lib/libcrypto/stack/stack.c b/src/lib/libcrypto/stack/stack.c
index 58e9126339..02857f0446 100644
--- a/src/lib/libcrypto/stack/stack.c
+++ b/src/lib/libcrypto/stack/stack.c
@@ -74,12 +74,12 @@
74 74
75const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT; 75const char *STACK_version="Stack" OPENSSL_VERSION_PTEXT;
76 76
77#define FP_ICC (int (*)(const void *,const void *))
78#include <errno.h> 77#include <errno.h>
79 78
80int (*sk_set_cmp_func(STACK *sk, int (*c)()))(void) 79int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,const char * const *)))
80 (const char * const *, const char * const *)
81 { 81 {
82 int (*old)()=sk->comp; 82 int (*old)(const char * const *,const char * const *)=sk->comp;
83 83
84 if (sk->comp != c) 84 if (sk->comp != c)
85 sk->sorted=0; 85 sk->sorted=0;
@@ -94,7 +94,7 @@ STACK *sk_dup(STACK *sk)
94 char **s; 94 char **s;
95 95
96 if ((ret=sk_new(sk->comp)) == NULL) goto err; 96 if ((ret=sk_new(sk->comp)) == NULL) goto err;
97 s=(char **)Realloc((char *)ret->data, 97 s=(char **)OPENSSL_realloc((char *)ret->data,
98 (unsigned int)sizeof(char *)*sk->num_alloc); 98 (unsigned int)sizeof(char *)*sk->num_alloc);
99 if (s == NULL) goto err; 99 if (s == NULL) goto err;
100 ret->data=s; 100 ret->data=s;
@@ -109,14 +109,19 @@ err:
109 return(NULL); 109 return(NULL);
110 } 110 }
111 111
112STACK *sk_new(int (*c)()) 112STACK *sk_new_null(void)
113 {
114 return sk_new((int (*)(const char * const *, const char * const *))0);
115 }
116
117STACK *sk_new(int (*c)(const char * const *, const char * const *))
113 { 118 {
114 STACK *ret; 119 STACK *ret;
115 int i; 120 int i;
116 121
117 if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL) 122 if ((ret=(STACK *)OPENSSL_malloc(sizeof(STACK))) == NULL)
118 goto err0; 123 goto err0;
119 if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL) 124 if ((ret->data=(char **)OPENSSL_malloc(sizeof(char *)*MIN_NODES)) == NULL)
120 goto err1; 125 goto err1;
121 for (i=0; i<MIN_NODES; i++) 126 for (i=0; i<MIN_NODES; i++)
122 ret->data[i]=NULL; 127 ret->data[i]=NULL;
@@ -126,7 +131,7 @@ STACK *sk_new(int (*c)())
126 ret->sorted=0; 131 ret->sorted=0;
127 return(ret); 132 return(ret);
128err1: 133err1:
129 Free(ret); 134 OPENSSL_free(ret);
130err0: 135err0:
131 return(NULL); 136 return(NULL);
132 } 137 }
@@ -138,7 +143,7 @@ int sk_insert(STACK *st, char *data, int loc)
138 if(st == NULL) return 0; 143 if(st == NULL) return 0;
139 if (st->num_alloc <= st->num+1) 144 if (st->num_alloc <= st->num+1)
140 { 145 {
141 s=(char **)Realloc((char *)st->data, 146 s=(char **)OPENSSL_realloc((char *)st->data,
142 (unsigned int)sizeof(char *)*st->num_alloc*2); 147 (unsigned int)sizeof(char *)*st->num_alloc*2);
143 if (s == NULL) 148 if (s == NULL)
144 return(0); 149 return(0);
@@ -207,7 +212,7 @@ int sk_find(STACK *st, char *data)
207 { 212 {
208 char **r; 213 char **r;
209 int i; 214 int i;
210 int (*comp_func)(); 215 int (*comp_func)(const void *,const void *);
211 if(st == NULL) return -1; 216 if(st == NULL) return -1;
212 217
213 if (st->comp == NULL) 218 if (st->comp == NULL)
@@ -219,13 +224,24 @@ int sk_find(STACK *st, char *data)
219 } 224 }
220 sk_sort(st); 225 sk_sort(st);
221 if (data == NULL) return(-1); 226 if (data == NULL) return(-1);
222 comp_func=(int (*)())st->comp; 227 /* This (and the "qsort" below) are the two places in OpenSSL
228 * where we need to convert from our standard (type **,type **)
229 * compare callback type to the (void *,void *) type required by
230 * bsearch. However, the "data" it is being called(back) with are
231 * not (type *) pointers, but the *pointers* to (type *) pointers,
232 * so we get our extra level of pointer dereferencing that way. */
233 comp_func=(int (*)(const void *,const void *))(st->comp);
223 r=(char **)bsearch(&data,(char *)st->data, 234 r=(char **)bsearch(&data,(char *)st->data,
224 st->num,sizeof(char *),FP_ICC comp_func); 235 st->num,sizeof(char *), comp_func);
225 if (r == NULL) return(-1); 236 if (r == NULL) return(-1);
226 i=(int)(r-st->data); 237 i=(int)(r-st->data);
227 for ( ; i>0; i--) 238 for ( ; i>0; i--)
228 if ((*st->comp)(&(st->data[i-1]),&data) < 0) 239 /* This needs a cast because the type being pointed to from
240 * the "&" expressions are (char *) rather than (const char *).
241 * For an explanation, read:
242 * http://www.eskimo.com/~scs/C-faq/q11.10.html :-) */
243 if ((*st->comp)((const char * const *)&(st->data[i-1]),
244 (const char * const *)&data) < 0)
229 break; 245 break;
230 return(i); 246 return(i);
231 } 247 }
@@ -262,7 +278,7 @@ void sk_zero(STACK *st)
262 st->num=0; 278 st->num=0;
263 } 279 }
264 280
265void sk_pop_free(STACK *st, void (*func)()) 281void sk_pop_free(STACK *st, void (*func)(void *))
266 { 282 {
267 int i; 283 int i;
268 284
@@ -276,17 +292,17 @@ void sk_pop_free(STACK *st, void (*func)())
276void sk_free(STACK *st) 292void sk_free(STACK *st)
277 { 293 {
278 if (st == NULL) return; 294 if (st == NULL) return;
279 if (st->data != NULL) Free(st->data); 295 if (st->data != NULL) OPENSSL_free(st->data);
280 Free(st); 296 OPENSSL_free(st);
281 } 297 }
282 298
283int sk_num(STACK *st) 299int sk_num(const STACK *st)
284{ 300{
285 if(st == NULL) return -1; 301 if(st == NULL) return -1;
286 return st->num; 302 return st->num;
287} 303}
288 304
289char *sk_value(STACK *st, int i) 305char *sk_value(const STACK *st, int i)
290{ 306{
291 if(st == NULL) return NULL; 307 if(st == NULL) return NULL;
292 return st->data[i]; 308 return st->data[i];
@@ -299,13 +315,18 @@ char *sk_set(STACK *st, int i, char *value)
299} 315}
300 316
301void sk_sort(STACK *st) 317void sk_sort(STACK *st)
302 {
303 if (!st->sorted)
304 { 318 {
305 int (*comp_func)(); 319 if (!st->sorted)
306 320 {
307 comp_func=(int (*)())st->comp; 321 int (*comp_func)(const void *,const void *);
308 qsort(st->data,st->num,sizeof(char *),FP_ICC comp_func); 322
309 st->sorted=1; 323 /* same comment as in sk_find ... previously st->comp was declared
324 * as a (void*,void*) callback type, but this made the population
325 * of the callback pointer illogical - our callbacks compare
326 * type** with type**, so we leave the casting until absolutely
327 * necessary (ie. "now"). */
328 comp_func=(int (*)(const void *,const void *))(st->comp);
329 qsort(st->data,st->num,sizeof(char *), comp_func);
330 st->sorted=1;
331 }
310 } 332 }
311 }
diff --git a/src/lib/libcrypto/stack/stack.h b/src/lib/libcrypto/stack/stack.h
index a615d9b4c9..8b436ca4b9 100644
--- a/src/lib/libcrypto/stack/stack.h
+++ b/src/lib/libcrypto/stack/stack.h
@@ -70,23 +70,21 @@ typedef struct stack_st
70 int sorted; 70 int sorted;
71 71
72 int num_alloc; 72 int num_alloc;
73 int (*comp)(); 73 int (*comp)(const char * const *, const char * const *);
74 } STACK; 74 } STACK;
75 75
76
77#define sk_new_null() sk_new(NULL)
78
79#define M_sk_num(sk) ((sk) ? (sk)->num:-1) 76#define M_sk_num(sk) ((sk) ? (sk)->num:-1)
80#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL) 77#define M_sk_value(sk,n) ((sk) ? (sk)->data[n] : NULL)
81 78
82int sk_num(STACK *); 79int sk_num(const STACK *);
83char *sk_value(STACK *, int); 80char *sk_value(const STACK *, int);
84 81
85char *sk_set(STACK *, int, char *); 82char *sk_set(STACK *, int, char *);
86 83
87STACK *sk_new(int (*cmp)()); 84STACK *sk_new(int (*cmp)(const char * const *, const char * const *));
85STACK *sk_new_null(void);
88void sk_free(STACK *); 86void sk_free(STACK *);
89void sk_pop_free(STACK *st, void (*func)()); 87void sk_pop_free(STACK *st, void (*func)(void *));
90int sk_insert(STACK *sk,char *data,int where); 88int sk_insert(STACK *sk,char *data,int where);
91char *sk_delete(STACK *st,int loc); 89char *sk_delete(STACK *st,int loc);
92char *sk_delete_ptr(STACK *st, char *p); 90char *sk_delete_ptr(STACK *st, char *p);
@@ -96,7 +94,9 @@ int sk_unshift(STACK *st,char *data);
96char *sk_shift(STACK *st); 94char *sk_shift(STACK *st);
97char *sk_pop(STACK *st); 95char *sk_pop(STACK *st);
98void sk_zero(STACK *st); 96void sk_zero(STACK *st);
99int (*sk_set_cmp_func(STACK *sk, int (*c)()))(); 97int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,
98 const char * const *)))
99 (const char * const *, const char * const *);
100STACK *sk_dup(STACK *st); 100STACK *sk_dup(STACK *st);
101void sk_sort(STACK *st); 101void sk_sort(STACK *st);
102 102
diff --git a/src/lib/libcrypto/symhacks.h b/src/lib/libcrypto/symhacks.h
new file mode 100644
index 0000000000..358ad355bb
--- /dev/null
+++ b/src/lib/libcrypto/symhacks.h
@@ -0,0 +1,154 @@
1/* ====================================================================
2 * Copyright (c) 1999 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#ifndef HEADER_SYMHACKS_H
56#define HEADER_SYMHACKS_H
57
58/* Hacks to solve the problem with linkers incapable of handling very long
59 symbol names. In the case of VMS, the limit is 31 characters on VMS for
60 VAX. */
61#ifdef VMS
62
63/* Hack a long name in crypto/asn1/a_mbstr.c */
64#undef ASN1_STRING_set_default_mask_asc
65#define ASN1_STRING_set_default_mask_asc ASN1_STRING_set_def_mask_asc
66
67#if 0 /* No longer needed, since safestack macro magic does the job */
68/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */
69#undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO
70#define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO i2d_ASN1_SET_OF_PKCS7_SIGINF
71#undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO
72#define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO d2i_ASN1_SET_OF_PKCS7_SIGINF
73#endif
74
75#if 0 /* No longer needed, since safestack macro magic does the job */
76/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */
77#undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO
78#define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO i2d_ASN1_SET_OF_PKCS7_RECINF
79#undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO
80#define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO d2i_ASN1_SET_OF_PKCS7_RECINF
81#endif
82
83#if 0 /* No longer needed, since safestack macro magic does the job */
84/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */
85#undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION
86#define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION i2d_ASN1_SET_OF_ACC_DESC
87#undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION
88#define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION d2i_ASN1_SET_OF_ACC_DESC
89#endif
90
91/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */
92#undef PEM_read_NETSCAPE_CERT_SEQUENCE
93#define PEM_read_NETSCAPE_CERT_SEQUENCE PEM_read_NS_CERT_SEQ
94#undef PEM_write_NETSCAPE_CERT_SEQUENCE
95#define PEM_write_NETSCAPE_CERT_SEQUENCE PEM_write_NS_CERT_SEQ
96#undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE
97#define PEM_read_bio_NETSCAPE_CERT_SEQUENCE PEM_read_bio_NS_CERT_SEQ
98#undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE
99#define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NS_CERT_SEQ
100#undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE
101#define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ
102
103/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */
104#undef PEM_read_PKCS8_PRIV_KEY_INFO
105#define PEM_read_PKCS8_PRIV_KEY_INFO PEM_read_P8_PRIV_KEY_INFO
106#undef PEM_write_PKCS8_PRIV_KEY_INFO
107#define PEM_write_PKCS8_PRIV_KEY_INFO PEM_write_P8_PRIV_KEY_INFO
108#undef PEM_read_bio_PKCS8_PRIV_KEY_INFO
109#define PEM_read_bio_PKCS8_PRIV_KEY_INFO PEM_read_bio_P8_PRIV_KEY_INFO
110#undef PEM_write_bio_PKCS8_PRIV_KEY_INFO
111#define PEM_write_bio_PKCS8_PRIV_KEY_INFO PEM_write_bio_P8_PRIV_KEY_INFO
112#undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO
113#define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO PEM_wrt_cb_bio_P8_PRIV_KEY_INFO
114
115/* Hack other PEM names */
116#undef PEM_write_bio_PKCS8PrivateKey_nid
117#define PEM_write_bio_PKCS8PrivateKey_nid PEM_write_bio_PKCS8PrivKey_nid
118
119/* Hack some long X509 names */
120#undef X509_REVOKED_get_ext_by_critical
121#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
122
123/* Hack some long CRYPTO names */
124#define CRYPTO_set_dynlock_destroy_callback CRYPTO_set_dynlock_destroy_cb
125#define CRYPTO_set_dynlock_create_callback CRYPTO_set_dynlock_create_cb
126#define CRYPTO_set_dynlock_lock_callback CRYPTO_set_dynlock_lock_cb
127#define CRYPTO_get_dynlock_lock_callback CRYPTO_get_dynlock_lock_cb
128#define CRYPTO_get_dynlock_destroy_callback CRYPTO_get_dynlock_destroy_cb
129#define CRYPTO_get_dynlock_create_callback CRYPTO_get_dynlock_create_cb
130
131/* Hack some long SSL names */
132#define SSL_CTX_set_default_verify_paths SSL_CTX_set_def_verify_paths
133#define SSL_get_ex_data_X509_STORE_CTX_idx SSL_get_ex_d_X509_STORE_CTX_idx
134#define SSL_add_file_cert_subjects_to_stack SSL_add_file_cert_subjs_to_stk
135#define SSL_add_dir_cert_subjects_to_stack SSL_add_dir_cert_subjs_to_stk
136#define SSL_CTX_use_certificate_chain_file SSL_CTX_use_cert_chain_file
137#define SSL_CTX_set_cert_verify_callback SSL_CTX_set_cert_verify_cb
138#define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud
139
140/* Hack some long ENGINE names */
141#define ENGINE_get_default_BN_mod_exp_crt ENGINE_get_def_BN_mod_exp_crt
142#define ENGINE_set_default_BN_mod_exp_crt ENGINE_set_def_BN_mod_exp_crt
143
144#endif /* defined VMS */
145
146
147/* Case insensiteve linking causes problems.... */
148#if defined(WIN16) || defined(VMS)
149#undef ERR_load_CRYPTO_strings
150#define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings
151#endif
152
153
154#endif /* ! defined HEADER_VMS_IDHACKS_H */
diff --git a/src/lib/libcrypto/threads/mttest.c b/src/lib/libcrypto/threads/mttest.c
index 24713a3157..100165948c 100644
--- a/src/lib/libcrypto/threads/mttest.c
+++ b/src/lib/libcrypto/threads/mttest.c
@@ -699,7 +699,7 @@ void thread_setup(void)
699 { 699 {
700 int i; 700 int i;
701 701
702 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(HANDLE)); 702 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(HANDLE));
703 for (i=0; i<CRYPTO_num_locks(); i++) 703 for (i=0; i<CRYPTO_num_locks(); i++)
704 { 704 {
705 lock_cs[i]=CreateMutex(NULL,FALSE,NULL); 705 lock_cs[i]=CreateMutex(NULL,FALSE,NULL);
@@ -716,7 +716,7 @@ void thread_cleanup(void)
716 CRYPTO_set_locking_callback(NULL); 716 CRYPTO_set_locking_callback(NULL);
717 for (i=0; i<CRYPTO_num_locks(); i++) 717 for (i=0; i<CRYPTO_num_locks(); i++)
718 CloseHandle(lock_cs[i]); 718 CloseHandle(lock_cs[i]);
719 Free(lock_cs); 719 OPENSSL_free(lock_cs);
720 } 720 }
721 721
722void win32_locking_callback(int mode, int type, char *file, int line) 722void win32_locking_callback(int mode, int type, char *file, int line)
@@ -794,8 +794,8 @@ void thread_setup(void)
794 { 794 {
795 int i; 795 int i;
796 796
797 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(mutex_t)); 797 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(mutex_t));
798 lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); 798 lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
799 for (i=0; i<CRYPTO_num_locks(); i++) 799 for (i=0; i<CRYPTO_num_locks(); i++)
800 { 800 {
801 lock_count[i]=0; 801 lock_count[i]=0;
@@ -821,8 +821,8 @@ void thread_cleanup(void)
821 mutex_destroy(&(lock_cs[i])); 821 mutex_destroy(&(lock_cs[i]));
822 fprintf(stderr,"%8ld:%s\n",lock_count[i],CRYPTO_get_lock_name(i)); 822 fprintf(stderr,"%8ld:%s\n",lock_count[i],CRYPTO_get_lock_name(i));
823 } 823 }
824 Free(lock_cs); 824 OPENSSL_free(lock_cs);
825 Free(lock_count); 825 OPENSSL_free(lock_count);
826 826
827 fprintf(stderr,"done cleanup\n"); 827 fprintf(stderr,"done cleanup\n");
828 828
@@ -919,7 +919,7 @@ void thread_setup(void)
919 arena=usinit(filename); 919 arena=usinit(filename);
920 unlink(filename); 920 unlink(filename);
921 921
922 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(usema_t *)); 922 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *));
923 for (i=0; i<CRYPTO_num_locks(); i++) 923 for (i=0; i<CRYPTO_num_locks(); i++)
924 { 924 {
925 lock_cs[i]=usnewsema(arena,1); 925 lock_cs[i]=usnewsema(arena,1);
@@ -942,7 +942,7 @@ void thread_cleanup(void)
942 usdumpsema(lock_cs[i],stdout,buf); 942 usdumpsema(lock_cs[i],stdout,buf);
943 usfreesema(lock_cs[i],arena); 943 usfreesema(lock_cs[i],arena);
944 } 944 }
945 Free(lock_cs); 945 OPENSSL_free(lock_cs);
946 } 946 }
947 947
948void irix_locking_callback(int mode, int type, char *file, int line) 948void irix_locking_callback(int mode, int type, char *file, int line)
@@ -1002,8 +1002,8 @@ void thread_setup(void)
1002 { 1002 {
1003 int i; 1003 int i;
1004 1004
1005 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); 1005 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
1006 lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); 1006 lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
1007 for (i=0; i<CRYPTO_num_locks(); i++) 1007 for (i=0; i<CRYPTO_num_locks(); i++)
1008 { 1008 {
1009 lock_count[i]=0; 1009 lock_count[i]=0;
@@ -1026,8 +1026,8 @@ void thread_cleanup(void)
1026 fprintf(stderr,"%8ld:%s\n",lock_count[i], 1026 fprintf(stderr,"%8ld:%s\n",lock_count[i],
1027 CRYPTO_get_lock_name(i)); 1027 CRYPTO_get_lock_name(i));
1028 } 1028 }
1029 Free(lock_cs); 1029 OPENSSL_free(lock_cs);
1030 Free(lock_count); 1030 OPENSSL_free(lock_count);
1031 1031
1032 fprintf(stderr,"done cleanup\n"); 1032 fprintf(stderr,"done cleanup\n");
1033 } 1033 }
diff --git a/src/lib/libcrypto/threads/th-lock.c b/src/lib/libcrypto/threads/th-lock.c
index 3ee978060c..553d2218de 100644
--- a/src/lib/libcrypto/threads/th-lock.c
+++ b/src/lib/libcrypto/threads/th-lock.c
@@ -113,7 +113,7 @@ void CRYPTO_thread_setup(void)
113 { 113 {
114 int i; 114 int i;
115 115
116 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(HANDLE)); 116 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(HANDLE));
117 for (i=0; i<CRYPTO_num_locks(); i++) 117 for (i=0; i<CRYPTO_num_locks(); i++)
118 { 118 {
119 lock_cs[i]=CreateMutex(NULL,FALSE,NULL); 119 lock_cs[i]=CreateMutex(NULL,FALSE,NULL);
@@ -131,7 +131,7 @@ static void CRYPTO_thread_cleanup(void)
131 CRYPTO_set_locking_callback(NULL); 131 CRYPTO_set_locking_callback(NULL);
132 for (i=0; i<CRYPTO_num_locks(); i++) 132 for (i=0; i<CRYPTO_num_locks(); i++)
133 CloseHandle(lock_cs[i]); 133 CloseHandle(lock_cs[i]);
134 Free(lock_cs); 134 OPENSSL_free(lock_cs);
135 } 135 }
136 136
137void win32_locking_callback(int mode, int type, char *file, int line) 137void win32_locking_callback(int mode, int type, char *file, int line)
@@ -164,11 +164,11 @@ void CRYPTO_thread_setup(void)
164 int i; 164 int i;
165 165
166#ifdef USE_MUTEX 166#ifdef USE_MUTEX
167 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(mutex_t)); 167 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(mutex_t));
168#else 168#else
169 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(rwlock_t)); 169 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(rwlock_t));
170#endif 170#endif
171 lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); 171 lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
172 for (i=0; i<CRYPTO_num_locks(); i++) 172 for (i=0; i<CRYPTO_num_locks(); i++)
173 { 173 {
174 lock_count[i]=0; 174 lock_count[i]=0;
@@ -196,8 +196,8 @@ void CRYPTO_thread_cleanup(void)
196 rwlock_destroy(&(lock_cs[i])); 196 rwlock_destroy(&(lock_cs[i]));
197#endif 197#endif
198 } 198 }
199 Free(lock_cs); 199 OPENSSL_free(lock_cs);
200 Free(lock_count); 200 OPENSSL_free(lock_count);
201 } 201 }
202 202
203void solaris_locking_callback(int mode, int type, char *file, int line) 203void solaris_locking_callback(int mode, int type, char *file, int line)
@@ -267,7 +267,7 @@ void CRYPTO_thread_setup(void)
267 arena=usinit(filename); 267 arena=usinit(filename);
268 unlink(filename); 268 unlink(filename);
269 269
270 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(usema_t *)); 270 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(usema_t *));
271 for (i=0; i<CRYPTO_num_locks(); i++) 271 for (i=0; i<CRYPTO_num_locks(); i++)
272 { 272 {
273 lock_cs[i]=usnewsema(arena,1); 273 lock_cs[i]=usnewsema(arena,1);
@@ -290,7 +290,7 @@ void CRYPTO_thread_cleanup(void)
290 usdumpsema(lock_cs[i],stdout,buf); 290 usdumpsema(lock_cs[i],stdout,buf);
291 usfreesema(lock_cs[i],arena); 291 usfreesema(lock_cs[i],arena);
292 } 292 }
293 Free(lock_cs); 293 OPENSSL_free(lock_cs);
294 } 294 }
295 295
296void irix_locking_callback(int mode, int type, char *file, int line) 296void irix_locking_callback(int mode, int type, char *file, int line)
@@ -324,8 +324,8 @@ void CRYPTO_thread_setup(void)
324 { 324 {
325 int i; 325 int i;
326 326
327 lock_cs=Malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t)); 327 lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(pthread_mutex_t));
328 lock_count=Malloc(CRYPTO_num_locks() * sizeof(long)); 328 lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long));
329 for (i=0; i<CRYPTO_num_locks(); i++) 329 for (i=0; i<CRYPTO_num_locks(); i++)
330 { 330 {
331 lock_count[i]=0; 331 lock_count[i]=0;
@@ -345,8 +345,8 @@ void thread_cleanup(void)
345 { 345 {
346 pthread_mutex_destroy(&(lock_cs[i])); 346 pthread_mutex_destroy(&(lock_cs[i]));
347 } 347 }
348 Free(lock_cs); 348 OPENSSL_free(lock_cs);
349 Free(lock_count); 349 OPENSSL_free(lock_count);
350 } 350 }
351 351
352void pthreads_locking_callback(int mode, int type, char *file, 352void pthreads_locking_callback(int mode, int type, char *file,
diff --git a/src/lib/libcrypto/tmdiff.c b/src/lib/libcrypto/tmdiff.c
index 0ad8a9ed8d..7773928666 100644
--- a/src/lib/libcrypto/tmdiff.c
+++ b/src/lib/libcrypto/tmdiff.c
@@ -134,7 +134,7 @@ char *ms_time_new(void)
134 { 134 {
135 MS_TM *ret; 135 MS_TM *ret;
136 136
137 ret=(MS_TM *)Malloc(sizeof(MS_TM)); 137 ret=(MS_TM *)OPENSSL_malloc(sizeof(MS_TM));
138 if (ret == NULL) 138 if (ret == NULL)
139 return(NULL); 139 return(NULL);
140 memset(ret,0,sizeof(MS_TM)); 140 memset(ret,0,sizeof(MS_TM));
@@ -147,7 +147,7 @@ char *ms_time_new(void)
147void ms_time_free(char *a) 147void ms_time_free(char *a)
148 { 148 {
149 if (a != NULL) 149 if (a != NULL)
150 Free(a); 150 OPENSSL_free(a);
151 } 151 }
152 152
153void ms_time_get(char *a) 153void ms_time_get(char *a)
diff --git a/src/lib/libcrypto/txt_db/Makefile.ssl b/src/lib/libcrypto/txt_db/Makefile.ssl
index a631dce6f2..cb54d53323 100644
--- a/src/lib/libcrypto/txt_db/Makefile.ssl
+++ b/src/lib/libcrypto/txt_db/Makefile.ssl
@@ -83,5 +83,5 @@ txt_db.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
83txt_db.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 83txt_db.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
84txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 84txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
85txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h 85txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h
86txt_db.o: ../../include/openssl/stack.h ../../include/openssl/txt_db.h 86txt_db.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
87txt_db.o: ../cryptlib.h 87txt_db.o: ../../include/openssl/txt_db.h ../cryptlib.h
diff --git a/src/lib/libcrypto/txt_db/txt_db.c b/src/lib/libcrypto/txt_db/txt_db.c
index 33acc81f3f..3b04fe280c 100644
--- a/src/lib/libcrypto/txt_db/txt_db.c
+++ b/src/lib/libcrypto/txt_db/txt_db.c
@@ -83,16 +83,16 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
83 if ((buf=BUF_MEM_new()) == NULL) goto err; 83 if ((buf=BUF_MEM_new()) == NULL) goto err;
84 if (!BUF_MEM_grow(buf,size)) goto err; 84 if (!BUF_MEM_grow(buf,size)) goto err;
85 85
86 if ((ret=(TXT_DB *)Malloc(sizeof(TXT_DB))) == NULL) 86 if ((ret=(TXT_DB *)OPENSSL_malloc(sizeof(TXT_DB))) == NULL)
87 goto err; 87 goto err;
88 ret->num_fields=num; 88 ret->num_fields=num;
89 ret->index=NULL; 89 ret->index=NULL;
90 ret->qual=NULL; 90 ret->qual=NULL;
91 if ((ret->data=sk_new_null()) == NULL) 91 if ((ret->data=sk_new_null()) == NULL)
92 goto err; 92 goto err;
93 if ((ret->index=(LHASH **)Malloc(sizeof(LHASH *)*num)) == NULL) 93 if ((ret->index=(LHASH **)OPENSSL_malloc(sizeof(LHASH *)*num)) == NULL)
94 goto err; 94 goto err;
95 if ((ret->qual=(int (**)())Malloc(sizeof(int (**)())*num)) == NULL) 95 if ((ret->qual=(int (**)())OPENSSL_malloc(sizeof(int (**)())*num)) == NULL)
96 goto err; 96 goto err;
97 for (i=0; i<num; i++) 97 for (i=0; i<num; i++)
98 { 98 {
@@ -122,7 +122,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
122 else 122 else
123 { 123 {
124 buf->data[offset-1]='\0'; /* blat the '\n' */ 124 buf->data[offset-1]='\0'; /* blat the '\n' */
125 p=(char *)Malloc(add+offset); 125 p=(char *)OPENSSL_malloc(add+offset);
126 offset=0; 126 offset=0;
127 } 127 }
128 pp=(char **)p; 128 pp=(char **)p;
@@ -177,12 +177,12 @@ err:
177 if (er) 177 if (er)
178 { 178 {
179#if !defined(NO_STDIO) && !defined(WIN16) 179#if !defined(NO_STDIO) && !defined(WIN16)
180 if (er == 1) fprintf(stderr,"Malloc failure\n"); 180 if (er == 1) fprintf(stderr,"OPENSSL_malloc failure\n");
181#endif 181#endif
182 if (ret->data != NULL) sk_free(ret->data); 182 if (ret->data != NULL) sk_free(ret->data);
183 if (ret->index != NULL) Free(ret->index); 183 if (ret->index != NULL) OPENSSL_free(ret->index);
184 if (ret->qual != NULL) Free(ret->qual); 184 if (ret->qual != NULL) OPENSSL_free(ret->qual);
185 if (ret != NULL) Free(ret); 185 if (ret != NULL) OPENSSL_free(ret);
186 return(NULL); 186 return(NULL);
187 } 187 }
188 else 188 else
@@ -349,10 +349,10 @@ void TXT_DB_free(TXT_DB *db)
349 { 349 {
350 for (i=db->num_fields-1; i>=0; i--) 350 for (i=db->num_fields-1; i>=0; i--)
351 if (db->index[i] != NULL) lh_free(db->index[i]); 351 if (db->index[i] != NULL) lh_free(db->index[i]);
352 Free(db->index); 352 OPENSSL_free(db->index);
353 } 353 }
354 if (db->qual != NULL) 354 if (db->qual != NULL)
355 Free(db->qual); 355 OPENSSL_free(db->qual);
356 if (db->data != NULL) 356 if (db->data != NULL)
357 { 357 {
358 for (i=sk_num(db->data)-1; i>=0; i--) 358 for (i=sk_num(db->data)-1; i>=0; i--)
@@ -364,7 +364,7 @@ void TXT_DB_free(TXT_DB *db)
364 if (max == NULL) /* new row */ 364 if (max == NULL) /* new row */
365 { 365 {
366 for (n=0; n<db->num_fields; n++) 366 for (n=0; n<db->num_fields; n++)
367 if (p[n] != NULL) Free(p[n]); 367 if (p[n] != NULL) OPENSSL_free(p[n]);
368 } 368 }
369 else 369 else
370 { 370 {
@@ -372,12 +372,12 @@ void TXT_DB_free(TXT_DB *db)
372 { 372 {
373 if (((p[n] < (char *)p) || (p[n] > max)) 373 if (((p[n] < (char *)p) || (p[n] > max))
374 && (p[n] != NULL)) 374 && (p[n] != NULL))
375 Free(p[n]); 375 OPENSSL_free(p[n]);
376 } 376 }
377 } 377 }
378 Free(sk_value(db->data,i)); 378 OPENSSL_free(sk_value(db->data,i));
379 } 379 }
380 sk_free(db->data); 380 sk_free(db->data);
381 } 381 }
382 Free(db); 382 OPENSSL_free(db);
383 } 383 }
diff --git a/src/lib/libcrypto/txt_db/txt_db.h b/src/lib/libcrypto/txt_db/txt_db.h
index 58b9de1353..342533d40d 100644
--- a/src/lib/libcrypto/txt_db/txt_db.h
+++ b/src/lib/libcrypto/txt_db/txt_db.h
@@ -59,10 +59,9 @@
59#ifndef HEADER_TXT_DB_H 59#ifndef HEADER_TXT_DB_H
60#define HEADER_TXT_DB_H 60#define HEADER_TXT_DB_H
61 61
62#ifdef __cplusplus 62#ifndef NO_BIO
63extern "C" { 63#include <openssl/bio.h>
64#endif 64#endif
65
66#include <openssl/stack.h> 65#include <openssl/stack.h>
67#include <openssl/lhash.h> 66#include <openssl/lhash.h>
68 67
@@ -73,6 +72,10 @@ extern "C" {
73#define DB_ERROR_NO_INDEX 4 72#define DB_ERROR_NO_INDEX 4
74#define DB_ERROR_INSERT_INDEX_CLASH 5 73#define DB_ERROR_INSERT_INDEX_CLASH 5
75 74
75#ifdef __cplusplus
76extern "C" {
77#endif
78
76typedef struct txt_db_st 79typedef struct txt_db_st
77 { 80 {
78 int num_fields; 81 int num_fields;
@@ -85,7 +88,7 @@ typedef struct txt_db_st
85 char **arg_row; 88 char **arg_row;
86 } TXT_DB; 89 } TXT_DB;
87 90
88#ifdef HEADER_BIO_H 91#ifndef NO_BIO
89TXT_DB *TXT_DB_read(BIO *in, int num); 92TXT_DB *TXT_DB_read(BIO *in, int num);
90long TXT_DB_write(BIO *out, TXT_DB *db); 93long TXT_DB_write(BIO *out, TXT_DB *db);
91#else 94#else
diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num
index f611d6b283..e8eebbf50c 100644
--- a/src/lib/libcrypto/util/libeay.num
+++ b/src/lib/libcrypto/util/libeay.num
@@ -1,2232 +1,1930 @@
1SSLeay 1 1SSLeay 1 EXIST::FUNCTION:
2SSLeay_version 2 2SSLeay_version 2 EXIST::FUNCTION:
3ASN1_BIT_STRING_asn1_meth 3 3ASN1_BIT_STRING_asn1_meth 3 EXIST::FUNCTION:
4ASN1_HEADER_free 4 4ASN1_HEADER_free 4 EXIST::FUNCTION:
5ASN1_HEADER_new 5 5ASN1_HEADER_new 5 EXIST::FUNCTION:
6ASN1_IA5STRING_asn1_meth 6 6ASN1_IA5STRING_asn1_meth 6 EXIST::FUNCTION:
7ASN1_INTEGER_get 7 7ASN1_INTEGER_get 7 EXIST::FUNCTION:
8ASN1_INTEGER_set 8 8ASN1_INTEGER_set 8 EXIST::FUNCTION:
9ASN1_INTEGER_to_BN 9 9ASN1_INTEGER_to_BN 9 EXIST::FUNCTION:
10ASN1_OBJECT_create 10 10ASN1_OBJECT_create 10 EXIST::FUNCTION:
11ASN1_OBJECT_free 11 11ASN1_OBJECT_free 11 EXIST::FUNCTION:
12ASN1_OBJECT_new 12 12ASN1_OBJECT_new 12 EXIST::FUNCTION:
13ASN1_PRINTABLE_type 13 13ASN1_PRINTABLE_type 13 EXIST::FUNCTION:
14ASN1_STRING_cmp 14 14ASN1_STRING_cmp 14 EXIST::FUNCTION:
15ASN1_STRING_dup 15 15ASN1_STRING_dup 15 EXIST::FUNCTION:
16ASN1_STRING_free 16 16ASN1_STRING_free 16 EXIST::FUNCTION:
17ASN1_STRING_new 17 17ASN1_STRING_new 17 EXIST::FUNCTION:
18ASN1_STRING_print 18 18ASN1_STRING_print 18 EXIST::FUNCTION:
19ASN1_STRING_set 19 19ASN1_STRING_set 19 EXIST::FUNCTION:
20ASN1_STRING_type_new 20 20ASN1_STRING_type_new 20 EXIST::FUNCTION:
21ASN1_TYPE_free 21 21ASN1_TYPE_free 21 EXIST::FUNCTION:
22ASN1_TYPE_new 22 22ASN1_TYPE_new 22 EXIST::FUNCTION:
23ASN1_UNIVERSALSTRING_to_string 23 23ASN1_UNIVERSALSTRING_to_string 23 EXIST::FUNCTION:
24ASN1_UTCTIME_check 24 24ASN1_UTCTIME_check 24 EXIST::FUNCTION:
25ASN1_UTCTIME_print 25 25ASN1_UTCTIME_print 25 EXIST::FUNCTION:
26ASN1_UTCTIME_set 26 26ASN1_UTCTIME_set 26 EXIST::FUNCTION:
27ASN1_check_infinite_end 27 27ASN1_check_infinite_end 27 EXIST::FUNCTION:
28ASN1_d2i_bio 28 28ASN1_d2i_bio 28 EXIST::FUNCTION:
29ASN1_d2i_fp 29 29ASN1_d2i_fp 29 EXIST::FUNCTION:FP_API
30ASN1_digest 30 30ASN1_digest 30 EXIST::FUNCTION:
31ASN1_dup 31 31ASN1_dup 31 EXIST::FUNCTION:
32ASN1_get_object 32 32ASN1_get_object 32 EXIST::FUNCTION:
33ASN1_i2d_bio 33 33ASN1_i2d_bio 33 EXIST::FUNCTION:
34ASN1_i2d_fp 34 34ASN1_i2d_fp 34 EXIST::FUNCTION:FP_API
35ASN1_object_size 35 35ASN1_object_size 35 EXIST::FUNCTION:
36ASN1_parse 36 36ASN1_parse 36 EXIST::FUNCTION:
37ASN1_put_object 37 37ASN1_put_object 37 EXIST::FUNCTION:
38ASN1_sign 38 38ASN1_sign 38 EXIST::FUNCTION:
39ASN1_verify 39 39ASN1_verify 39 EXIST::FUNCTION:
40BF_cbc_encrypt 40 40BF_cbc_encrypt 40 EXIST::FUNCTION:BF
41BF_cfb64_encrypt 41 41BF_cfb64_encrypt 41 EXIST::FUNCTION:BF
42BF_ecb_encrypt 42 42BF_ecb_encrypt 42 EXIST::FUNCTION:BF
43BF_encrypt 43 43BF_encrypt 43 EXIST::FUNCTION:BF
44BF_ofb64_encrypt 44 44BF_ofb64_encrypt 44 EXIST::FUNCTION:BF
45BF_options 45 45BF_options 45 EXIST::FUNCTION:BF
46BF_set_key 46 46BF_set_key 46 EXIST::FUNCTION:BF
47BIO_CONNECT_free 47 47BIO_CONNECT_free 47 NOEXIST::FUNCTION:
48BIO_CONNECT_new 48 48BIO_CONNECT_new 48 NOEXIST::FUNCTION:
49BIO_accept 51 49BIO_accept 51 EXIST::FUNCTION:
50BIO_ctrl 52 50BIO_ctrl 52 EXIST::FUNCTION:
51BIO_int_ctrl 53 51BIO_int_ctrl 53 EXIST::FUNCTION:
52BIO_debug_callback 54 52BIO_debug_callback 54 EXIST::FUNCTION:
53BIO_dump 55 53BIO_dump 55 EXIST::FUNCTION:
54BIO_dup_chain 56 54BIO_dup_chain 56 EXIST::FUNCTION:
55BIO_f_base64 57 55BIO_f_base64 57 EXIST::FUNCTION:
56BIO_f_buffer 58 56BIO_f_buffer 58 EXIST::FUNCTION:
57BIO_f_cipher 59 57BIO_f_cipher 59 EXIST::FUNCTION:
58BIO_f_md 60 58BIO_f_md 60 EXIST::FUNCTION:
59BIO_f_null 61 59BIO_f_null 61 EXIST::FUNCTION:
60BIO_f_proxy_server 62 60BIO_f_proxy_server 62 NOEXIST::FUNCTION:
61BIO_fd_non_fatal_error 63 61BIO_fd_non_fatal_error 63 EXIST::FUNCTION:
62BIO_fd_should_retry 64 62BIO_fd_should_retry 64 EXIST::FUNCTION:
63BIO_find_type 65 63BIO_find_type 65 EXIST::FUNCTION:
64BIO_free 66 64BIO_free 66 EXIST::FUNCTION:
65BIO_free_all 67 65BIO_free_all 67 EXIST::FUNCTION:
66BIO_get_accept_socket 69 66BIO_get_accept_socket 69 EXIST::FUNCTION:
67BIO_get_filter_bio 70 67BIO_get_filter_bio 70 NOEXIST::FUNCTION:
68BIO_get_host_ip 71 68BIO_get_host_ip 71 EXIST::FUNCTION:
69BIO_get_port 72 69BIO_get_port 72 EXIST::FUNCTION:
70BIO_get_retry_BIO 73 70BIO_get_retry_BIO 73 EXIST::FUNCTION:
71BIO_get_retry_reason 74 71BIO_get_retry_reason 74 EXIST::FUNCTION:
72BIO_gethostbyname 75 72BIO_gethostbyname 75 EXIST::FUNCTION:
73BIO_gets 76 73BIO_gets 76 EXIST::FUNCTION:
74BIO_new 78 74BIO_new 78 EXIST::FUNCTION:
75BIO_new_accept 79 75BIO_new_accept 79 EXIST::FUNCTION:
76BIO_new_connect 80 76BIO_new_connect 80 EXIST::FUNCTION:
77BIO_new_fd 81 77BIO_new_fd 81 EXIST::FUNCTION:
78BIO_new_file 82 78BIO_new_file 82 EXIST:!WIN16:FUNCTION:FP_API
79BIO_new_fp 83 79BIO_new_fp 83 EXIST:!WIN16:FUNCTION:FP_API
80BIO_new_socket 84 80BIO_new_socket 84 EXIST::FUNCTION:
81BIO_pop 85 81BIO_pop 85 EXIST::FUNCTION:
82BIO_printf 86 82BIO_printf 86 EXIST::FUNCTION:
83BIO_push 87 83BIO_push 87 EXIST::FUNCTION:
84BIO_puts 88 84BIO_puts 88 EXIST::FUNCTION:
85BIO_read 89 85BIO_read 89 EXIST::FUNCTION:
86BIO_s_accept 90 86BIO_s_accept 90 EXIST::FUNCTION:
87BIO_s_connect 91 87BIO_s_connect 91 EXIST::FUNCTION:
88BIO_s_fd 92 88BIO_s_fd 92 EXIST::FUNCTION:
89BIO_s_file 93 89BIO_s_file 93 EXIST:!WIN16:FUNCTION:FP_API
90BIO_s_mem 95 90BIO_s_mem 95 EXIST::FUNCTION:
91BIO_s_null 96 91BIO_s_null 96 EXIST::FUNCTION:
92BIO_s_proxy_client 97 92BIO_s_proxy_client 97 NOEXIST::FUNCTION:
93BIO_s_socket 98 93BIO_s_socket 98 EXIST::FUNCTION:
94BIO_set 100 94BIO_set 100 EXIST::FUNCTION:
95BIO_set_cipher 101 95BIO_set_cipher 101 EXIST::FUNCTION:
96BIO_set_tcp_ndelay 102 96BIO_set_tcp_ndelay 102 EXIST::FUNCTION:
97BIO_sock_cleanup 103 97BIO_sock_cleanup 103 EXIST::FUNCTION:
98BIO_sock_error 104 98BIO_sock_error 104 EXIST::FUNCTION:
99BIO_sock_init 105 99BIO_sock_init 105 EXIST::FUNCTION:
100BIO_sock_non_fatal_error 106 100BIO_sock_non_fatal_error 106 EXIST::FUNCTION:
101BIO_sock_should_retry 107 101BIO_sock_should_retry 107 EXIST::FUNCTION:
102BIO_socket_ioctl 108 102BIO_socket_ioctl 108 EXIST::FUNCTION:
103BIO_write 109 103BIO_write 109 EXIST::FUNCTION:
104BN_CTX_free 110 104BN_CTX_free 110 EXIST::FUNCTION:
105BN_CTX_new 111 105BN_CTX_new 111 EXIST::FUNCTION:
106BN_MONT_CTX_free 112 106BN_MONT_CTX_free 112 EXIST::FUNCTION:
107BN_MONT_CTX_new 113 107BN_MONT_CTX_new 113 EXIST::FUNCTION:
108BN_MONT_CTX_set 114 108BN_MONT_CTX_set 114 EXIST::FUNCTION:
109BN_add 115 109BN_add 115 EXIST::FUNCTION:
110BN_add_word 116 110BN_add_word 116 EXIST::FUNCTION:
111BN_hex2bn 117 111BN_hex2bn 117 EXIST::FUNCTION:
112BN_bin2bn 118 112BN_bin2bn 118 EXIST::FUNCTION:
113BN_bn2hex 119 113BN_bn2hex 119 EXIST::FUNCTION:
114BN_bn2bin 120 114BN_bn2bin 120 EXIST::FUNCTION:
115BN_clear 121 115BN_clear 121 EXIST::FUNCTION:
116BN_clear_bit 122 116BN_clear_bit 122 EXIST::FUNCTION:
117BN_clear_free 123 117BN_clear_free 123 EXIST::FUNCTION:
118BN_cmp 124 118BN_cmp 124 EXIST::FUNCTION:
119BN_copy 125 119BN_copy 125 EXIST::FUNCTION:
120BN_div 126 120BN_div 126 EXIST::FUNCTION:
121BN_div_word 127 121BN_div_word 127 EXIST::FUNCTION:
122BN_dup 128 122BN_dup 128 EXIST::FUNCTION:
123BN_free 129 123BN_free 129 EXIST::FUNCTION:
124BN_from_montgomery 130 124BN_from_montgomery 130 EXIST::FUNCTION:
125BN_gcd 131 125BN_gcd 131 EXIST::FUNCTION:
126BN_generate_prime 132 126BN_generate_prime 132 EXIST::FUNCTION:
127BN_get_word 133 127BN_get_word 133 EXIST::FUNCTION:
128BN_is_bit_set 134 128BN_is_bit_set 134 EXIST::FUNCTION:
129BN_is_prime 135 129BN_is_prime 135 EXIST::FUNCTION:
130BN_lshift 136 130BN_lshift 136 EXIST::FUNCTION:
131BN_lshift1 137 131BN_lshift1 137 EXIST::FUNCTION:
132BN_mask_bits 138 132BN_mask_bits 138 EXIST::FUNCTION:
133BN_mod 139 133BN_mod 139 EXIST::FUNCTION:
134BN_mod_exp 140 134BN_mod_exp 140 EXIST::FUNCTION:
135BN_mod_exp_mont 141 135BN_mod_exp_mont 141 EXIST::FUNCTION:
136BN_mod_exp_recp 142 136BN_mod_exp_simple 143 EXIST::FUNCTION:
137BN_mod_exp_simple 143 137BN_mod_inverse 144 EXIST::FUNCTION:
138BN_mod_inverse 144 138BN_mod_mul 145 EXIST::FUNCTION:
139BN_mod_mul 145 139BN_mod_mul_montgomery 146 EXIST::FUNCTION:
140BN_mod_mul_montgomery 146 140BN_mod_word 148 EXIST::FUNCTION:
141BN_mod_mul_reciprocal 147 141BN_mul 149 EXIST::FUNCTION:
142BN_mod_word 148 142BN_new 150 EXIST::FUNCTION:
143BN_mul 149 143BN_num_bits 151 EXIST::FUNCTION:
144BN_new 150 144BN_num_bits_word 152 EXIST::FUNCTION:
145BN_num_bits 151 145BN_options 153 EXIST::FUNCTION:
146BN_num_bits_word 152 146BN_print 154 EXIST::FUNCTION:
147BN_options 153 147BN_print_fp 155 EXIST::FUNCTION:FP_API
148BN_print 154 148BN_rand 156 EXIST::FUNCTION:
149BN_print_fp 155 149BN_reciprocal 157 EXIST::FUNCTION:
150BN_rand 156 150BN_rshift 158 EXIST::FUNCTION:
151BN_reciprocal 157 151BN_rshift1 159 EXIST::FUNCTION:
152BN_rshift 158 152BN_set_bit 160 EXIST::FUNCTION:
153BN_rshift1 159 153BN_set_word 161 EXIST::FUNCTION:
154BN_set_bit 160 154BN_sqr 162 EXIST::FUNCTION:
155BN_set_word 161 155BN_sub 163 EXIST::FUNCTION:
156BN_sqr 162 156BN_to_ASN1_INTEGER 164 EXIST::FUNCTION:
157BN_sub 163 157BN_ucmp 165 EXIST::FUNCTION:
158BN_to_ASN1_INTEGER 164 158BN_value_one 166 EXIST::FUNCTION:
159BN_ucmp 165 159BUF_MEM_free 167 EXIST::FUNCTION:
160BN_value_one 166 160BUF_MEM_grow 168 EXIST::FUNCTION:
161BUF_MEM_free 167 161BUF_MEM_new 169 EXIST::FUNCTION:
162BUF_MEM_grow 168 162BUF_strdup 170 EXIST::FUNCTION:
163BUF_MEM_new 169 163CONF_free 171 EXIST::FUNCTION:
164BUF_strdup 170 164CONF_get_number 172 EXIST::FUNCTION:
165CONF_free 171 165CONF_get_section 173 EXIST::FUNCTION:
166CONF_get_number 172 166CONF_get_string 174 EXIST::FUNCTION:
167CONF_get_section 173 167CONF_load 175 EXIST::FUNCTION:
168CONF_get_string 174 168CRYPTO_add_lock 176 EXIST::FUNCTION:
169CONF_load 175 169CRYPTO_dbg_free 177 EXIST::FUNCTION:
170CRYPTO_add_lock 176 170CRYPTO_dbg_malloc 178 EXIST::FUNCTION:
171CRYPTO_dbg_free 177 171CRYPTO_dbg_realloc 179 EXIST::FUNCTION:
172CRYPTO_dbg_malloc 178 172CRYPTO_dbg_remalloc 180 NOEXIST::FUNCTION:
173CRYPTO_dbg_realloc 179 173CRYPTO_free 181 EXIST::FUNCTION:
174CRYPTO_dbg_remalloc 180 174CRYPTO_get_add_lock_callback 182 EXIST::FUNCTION:
175CRYPTO_free 181 175CRYPTO_get_id_callback 183 EXIST::FUNCTION:
176CRYPTO_get_add_lock_callback 182 176CRYPTO_get_lock_name 184 EXIST::FUNCTION:
177CRYPTO_get_id_callback 183 177CRYPTO_get_locking_callback 185 EXIST::FUNCTION:
178CRYPTO_get_lock_name 184 178CRYPTO_get_mem_functions 186 EXIST::FUNCTION:
179CRYPTO_get_locking_callback 185 179CRYPTO_lock 187 EXIST::FUNCTION:
180CRYPTO_get_mem_functions 186 180CRYPTO_malloc 188 EXIST::FUNCTION:
181CRYPTO_lock 187 181CRYPTO_mem_ctrl 189 EXIST::FUNCTION:
182CRYPTO_malloc 188 182CRYPTO_mem_leaks 190 EXIST::FUNCTION:
183CRYPTO_mem_ctrl 189 183CRYPTO_mem_leaks_cb 191 EXIST::FUNCTION:
184CRYPTO_mem_leaks 190 184CRYPTO_mem_leaks_fp 192 EXIST::FUNCTION:FP_API
185CRYPTO_mem_leaks_cb 191 185CRYPTO_realloc 193 EXIST::FUNCTION:
186CRYPTO_mem_leaks_fp 192 186CRYPTO_remalloc 194 EXIST::FUNCTION:
187CRYPTO_realloc 193 187CRYPTO_set_add_lock_callback 195 EXIST::FUNCTION:
188CRYPTO_remalloc 194 188CRYPTO_set_id_callback 196 EXIST::FUNCTION:
189CRYPTO_set_add_lock_callback 195 189CRYPTO_set_locking_callback 197 EXIST::FUNCTION:
190CRYPTO_set_id_callback 196 190CRYPTO_set_mem_functions 198 EXIST::FUNCTION:
191CRYPTO_set_locking_callback 197 191CRYPTO_thread_id 199 EXIST::FUNCTION:
192CRYPTO_set_mem_functions 198 192DH_check 200 EXIST::FUNCTION:DH
193CRYPTO_thread_id 199 193DH_compute_key 201 EXIST::FUNCTION:DH
194DH_check 200 194DH_free 202 EXIST::FUNCTION:DH
195DH_compute_key 201 195DH_generate_key 203 EXIST::FUNCTION:DH
196DH_free 202 196DH_generate_parameters 204 EXIST::FUNCTION:DH
197DH_generate_key 203 197DH_new 205 EXIST::FUNCTION:DH
198DH_generate_parameters 204 198DH_size 206 EXIST::FUNCTION:DH
199DH_new 205 199DHparams_print 207 EXIST::FUNCTION:DH
200DH_size 206 200DHparams_print_fp 208 EXIST::FUNCTION:DH,FP_API
201DHparams_print 207 201DSA_free 209 EXIST::FUNCTION:DSA
202DHparams_print_fp 208 202DSA_generate_key 210 EXIST::FUNCTION:DSA
203DSA_free 209 203DSA_generate_parameters 211 EXIST::FUNCTION:DSA
204DSA_generate_key 210 204DSA_is_prime 212 NOEXIST::FUNCTION:
205DSA_generate_parameters 211 205DSA_new 213 EXIST::FUNCTION:DSA
206DSA_is_prime 212 206DSA_print 214 EXIST::FUNCTION:DSA
207DSA_new 213 207DSA_print_fp 215 EXIST::FUNCTION:DSA,FP_API
208DSA_print 214 208DSA_sign 216 EXIST::FUNCTION:DSA
209DSA_print_fp 215 209DSA_sign_setup 217 EXIST::FUNCTION:DSA
210DSA_sign 216 210DSA_size 218 EXIST::FUNCTION:DSA
211DSA_sign_setup 217 211DSA_verify 219 EXIST::FUNCTION:DSA
212DSA_size 218 212DSAparams_print 220 EXIST::FUNCTION:DSA
213DSA_verify 219 213DSAparams_print_fp 221 EXIST::FUNCTION:DSA,FP_API
214DSAparams_print 220 214ERR_clear_error 222 EXIST::FUNCTION:
215DSAparams_print_fp 221 215ERR_error_string 223 EXIST::FUNCTION:
216ERR_clear_error 222 216ERR_free_strings 224 EXIST::FUNCTION:
217ERR_error_string 223 217ERR_func_error_string 225 EXIST::FUNCTION:
218ERR_free_strings 224 218ERR_get_err_state_table 226 EXIST::FUNCTION:
219ERR_func_error_string 225 219ERR_get_error 227 EXIST::FUNCTION:
220ERR_get_err_state_table 226 220ERR_get_error_line 228 EXIST::FUNCTION:
221ERR_get_error 227 221ERR_get_state 229 EXIST::FUNCTION:
222ERR_get_error_line 228 222ERR_get_string_table 230 EXIST::FUNCTION:
223ERR_get_state 229 223ERR_lib_error_string 231 EXIST::FUNCTION:
224ERR_get_string_table 230 224ERR_load_ASN1_strings 232 EXIST::FUNCTION:
225ERR_lib_error_string 231 225ERR_load_BIO_strings 233 EXIST::FUNCTION:
226ERR_load_ASN1_strings 232 226ERR_load_BN_strings 234 EXIST::FUNCTION:
227ERR_load_BIO_strings 233 227ERR_load_BUF_strings 235 EXIST::FUNCTION:
228ERR_load_BN_strings 234 228ERR_load_CONF_strings 236 EXIST::FUNCTION:
229ERR_load_BUF_strings 235 229ERR_load_DH_strings 237 EXIST::FUNCTION:DH
230ERR_load_CONF_strings 236 230ERR_load_DSA_strings 238 EXIST::FUNCTION:DSA
231ERR_load_DH_strings 237 231ERR_load_ERR_strings 239 EXIST::FUNCTION:
232ERR_load_DSA_strings 238 232ERR_load_EVP_strings 240 EXIST::FUNCTION:
233ERR_load_ERR_strings 239 233ERR_load_OBJ_strings 241 EXIST::FUNCTION:
234ERR_load_EVP_strings 240 234ERR_load_PEM_strings 242 EXIST::FUNCTION:
235ERR_load_OBJ_strings 241 235ERR_load_PROXY_strings 243 NOEXIST::FUNCTION:
236ERR_load_PEM_strings 242 236ERR_load_RSA_strings 244 EXIST::FUNCTION:RSA
237ERR_load_PROXY_strings 243 237ERR_load_X509_strings 245 EXIST::FUNCTION:
238ERR_load_RSA_strings 244 238ERR_load_crypto_strings 246 EXIST::FUNCTION:
239ERR_load_X509_strings 245 239ERR_load_strings 247 EXIST::FUNCTION:
240ERR_load_crypto_strings 246 240ERR_peek_error 248 EXIST::FUNCTION:
241ERR_load_strings 247 241ERR_peek_error_line 249 EXIST::FUNCTION:
242ERR_peek_error 248 242ERR_print_errors 250 EXIST::FUNCTION:
243ERR_peek_error_line 249 243ERR_print_errors_fp 251 EXIST::FUNCTION:FP_API
244ERR_print_errors 250 244ERR_put_error 252 EXIST::FUNCTION:
245ERR_print_errors_fp 251 245ERR_reason_error_string 253 EXIST::FUNCTION:
246ERR_put_error 252 246ERR_remove_state 254 EXIST::FUNCTION:
247ERR_reason_error_string 253 247EVP_BytesToKey 255 EXIST::FUNCTION:
248ERR_remove_state 254 248EVP_CIPHER_CTX_cleanup 256 EXIST::FUNCTION:
249EVP_BytesToKey 255 249EVP_CipherFinal 257 EXIST::FUNCTION:
250EVP_CIPHER_CTX_cleanup 256 250EVP_CipherInit 258 EXIST::FUNCTION:
251EVP_CipherFinal 257 251EVP_CipherUpdate 259 EXIST::FUNCTION:
252EVP_CipherInit 258 252EVP_DecodeBlock 260 EXIST::FUNCTION:
253EVP_CipherUpdate 259 253EVP_DecodeFinal 261 EXIST::FUNCTION:
254EVP_DecodeBlock 260 254EVP_DecodeInit 262 EXIST::FUNCTION:
255EVP_DecodeFinal 261 255EVP_DecodeUpdate 263 EXIST::FUNCTION:
256EVP_DecodeInit 262 256EVP_DecryptFinal 264 EXIST::FUNCTION:
257EVP_DecodeUpdate 263 257EVP_DecryptInit 265 EXIST::FUNCTION:
258EVP_DecryptFinal 264 258EVP_DecryptUpdate 266 EXIST::FUNCTION:
259EVP_DecryptInit 265 259EVP_DigestFinal 267 EXIST::FUNCTION:
260EVP_DecryptUpdate 266 260EVP_DigestInit 268 EXIST::FUNCTION:
261EVP_DigestFinal 267 261EVP_DigestUpdate 269 EXIST::FUNCTION:
262EVP_DigestInit 268 262EVP_EncodeBlock 270 EXIST::FUNCTION:
263EVP_DigestUpdate 269 263EVP_EncodeFinal 271 EXIST::FUNCTION:
264EVP_EncodeBlock 270 264EVP_EncodeInit 272 EXIST::FUNCTION:
265EVP_EncodeFinal 271 265EVP_EncodeUpdate 273 EXIST::FUNCTION:
266EVP_EncodeInit 272 266EVP_EncryptFinal 274 EXIST::FUNCTION:
267EVP_EncodeUpdate 273 267EVP_EncryptInit 275 EXIST::FUNCTION:
268EVP_EncryptFinal 274 268EVP_EncryptUpdate 276 EXIST::FUNCTION:
269EVP_EncryptInit 275 269EVP_OpenFinal 277 EXIST::FUNCTION:RSA
270EVP_EncryptUpdate 276 270EVP_OpenInit 278 EXIST::FUNCTION:RSA
271EVP_OpenFinal 277 271EVP_PKEY_assign 279 EXIST::FUNCTION:
272EVP_OpenInit 278 272EVP_PKEY_copy_parameters 280 EXIST::FUNCTION:
273EVP_PKEY_assign 279 273EVP_PKEY_free 281 EXIST::FUNCTION:
274EVP_PKEY_copy_parameters 280 274EVP_PKEY_missing_parameters 282 EXIST::FUNCTION:
275EVP_PKEY_free 281 275EVP_PKEY_new 283 EXIST::FUNCTION:
276EVP_PKEY_missing_parameters 282 276EVP_PKEY_save_parameters 284 EXIST::FUNCTION:
277EVP_PKEY_new 283 277EVP_PKEY_size 285 EXIST::FUNCTION:
278EVP_PKEY_save_parameters 284 278EVP_PKEY_type 286 EXIST::FUNCTION:
279EVP_PKEY_size 285 279EVP_SealFinal 287 EXIST::FUNCTION:RSA
280EVP_PKEY_type 286 280EVP_SealInit 288 EXIST::FUNCTION:RSA
281EVP_SealFinal 287 281EVP_SignFinal 289 EXIST::FUNCTION:
282EVP_SealInit 288 282EVP_VerifyFinal 290 EXIST::FUNCTION:
283EVP_SignFinal 289 283EVP_add_alias 291 NOEXIST::FUNCTION:
284EVP_VerifyFinal 290 284EVP_add_cipher 292 EXIST::FUNCTION:
285EVP_add_alias 291 285EVP_add_digest 293 EXIST::FUNCTION:
286EVP_add_cipher 292 286EVP_bf_cbc 294 EXIST::FUNCTION:BF
287EVP_add_digest 293 287EVP_bf_cfb 295 EXIST::FUNCTION:BF
288EVP_bf_cbc 294 288EVP_bf_ecb 296 EXIST::FUNCTION:BF
289EVP_bf_cfb 295 289EVP_bf_ofb 297 EXIST::FUNCTION:BF
290EVP_bf_ecb 296 290EVP_cleanup 298 EXIST::FUNCTION:
291EVP_bf_ofb 297 291EVP_des_cbc 299 EXIST::FUNCTION:DES
292EVP_cleanup 298 292EVP_des_cfb 300 EXIST::FUNCTION:DES
293EVP_des_cbc 299 293EVP_des_ecb 301 EXIST::FUNCTION:DES
294EVP_des_cfb 300 294EVP_des_ede 302 EXIST::FUNCTION:DES
295EVP_des_ecb 301 295EVP_des_ede3 303 EXIST::FUNCTION:DES
296EVP_des_ede 302 296EVP_des_ede3_cbc 304 EXIST::FUNCTION:DES
297EVP_des_ede3 303 297EVP_des_ede3_cfb 305 EXIST::FUNCTION:DES
298EVP_des_ede3_cbc 304 298EVP_des_ede3_ofb 306 EXIST::FUNCTION:DES
299EVP_des_ede3_cfb 305 299EVP_des_ede_cbc 307 EXIST::FUNCTION:DES
300EVP_des_ede3_ofb 306 300EVP_des_ede_cfb 308 EXIST::FUNCTION:DES
301EVP_des_ede_cbc 307 301EVP_des_ede_ofb 309 EXIST::FUNCTION:DES
302EVP_des_ede_cfb 308 302EVP_des_ofb 310 EXIST::FUNCTION:DES
303EVP_des_ede_ofb 309 303EVP_desx_cbc 311 EXIST::FUNCTION:DES
304EVP_des_ofb 310 304EVP_dss 312 EXIST::FUNCTION:DSA
305EVP_desx_cbc 311 305EVP_dss1 313 EXIST::FUNCTION:DSA
306EVP_dss 312 306EVP_enc_null 314 EXIST::FUNCTION:
307EVP_dss1 313 307EVP_get_cipherbyname 315 EXIST::FUNCTION:
308EVP_enc_null 314 308EVP_get_digestbyname 316 EXIST::FUNCTION:
309EVP_get_cipherbyname 315 309EVP_get_pw_prompt 317 EXIST::FUNCTION:
310EVP_get_digestbyname 316 310EVP_idea_cbc 318 EXIST::FUNCTION:IDEA
311EVP_get_pw_prompt 317 311EVP_idea_cfb 319 EXIST::FUNCTION:IDEA
312EVP_idea_cbc 318 312EVP_idea_ecb 320 EXIST::FUNCTION:IDEA
313EVP_idea_cfb 319 313EVP_idea_ofb 321 EXIST::FUNCTION:IDEA
314EVP_idea_ecb 320 314EVP_md2 322 EXIST::FUNCTION:MD2
315EVP_idea_ofb 321 315EVP_md5 323 EXIST::FUNCTION:MD5
316EVP_md2 322 316EVP_md_null 324 EXIST::FUNCTION:
317EVP_md5 323 317EVP_rc2_cbc 325 EXIST::FUNCTION:RC2
318EVP_md_null 324 318EVP_rc2_cfb 326 EXIST::FUNCTION:RC2
319EVP_rc2_cbc 325 319EVP_rc2_ecb 327 EXIST::FUNCTION:RC2
320EVP_rc2_cfb 326 320EVP_rc2_ofb 328 EXIST::FUNCTION:RC2
321EVP_rc2_ecb 327 321EVP_rc4 329 EXIST::FUNCTION:RC4
322EVP_rc2_ofb 328 322EVP_read_pw_string 330 EXIST::FUNCTION:
323EVP_rc4 329 323EVP_set_pw_prompt 331 EXIST::FUNCTION:
324EVP_read_pw_string 330 324EVP_sha 332 EXIST::FUNCTION:SHA
325EVP_set_pw_prompt 331 325EVP_sha1 333 EXIST::FUNCTION:SHA
326EVP_sha 332 326MD2 334 EXIST::FUNCTION:MD2
327EVP_sha1 333 327MD2_Final 335 EXIST::FUNCTION:MD2
328MD2 334 328MD2_Init 336 EXIST::FUNCTION:MD2
329MD2_Final 335 329MD2_Update 337 EXIST::FUNCTION:MD2
330MD2_Init 336 330MD2_options 338 EXIST::FUNCTION:MD2
331MD2_Update 337 331MD5 339 EXIST::FUNCTION:MD5
332MD2_options 338 332MD5_Final 340 EXIST::FUNCTION:MD5
333MD5 339 333MD5_Init 341 EXIST::FUNCTION:MD5
334MD5_Final 340 334MD5_Update 342 EXIST::FUNCTION:MD5
335MD5_Init 341 335MDC2 343 EXIST::FUNCTION:MDC2
336MD5_Update 342 336MDC2_Final 344 EXIST::FUNCTION:MDC2
337MDC2 343 337MDC2_Init 345 EXIST::FUNCTION:MDC2
338MDC2_Final 344 338MDC2_Update 346 EXIST::FUNCTION:MDC2
339MDC2_Init 345 339NETSCAPE_SPKAC_free 347 EXIST::FUNCTION:
340MDC2_Update 346 340NETSCAPE_SPKAC_new 348 EXIST::FUNCTION:
341NETSCAPE_SPKAC_free 347 341NETSCAPE_SPKI_free 349 EXIST::FUNCTION:
342NETSCAPE_SPKAC_new 348 342NETSCAPE_SPKI_new 350 EXIST::FUNCTION:
343NETSCAPE_SPKI_free 349 343NETSCAPE_SPKI_sign 351 EXIST::FUNCTION:
344NETSCAPE_SPKI_new 350 344NETSCAPE_SPKI_verify 352 EXIST::FUNCTION:
345NETSCAPE_SPKI_sign 351 345OBJ_add_object 353 EXIST::FUNCTION:
346NETSCAPE_SPKI_verify 352 346OBJ_bsearch 354 EXIST::FUNCTION:
347OBJ_add_object 353 347OBJ_cleanup 355 EXIST::FUNCTION:
348OBJ_bsearch 354 348OBJ_cmp 356 EXIST::FUNCTION:
349OBJ_cleanup 355 349OBJ_create 357 EXIST::FUNCTION:
350OBJ_cmp 356 350OBJ_dup 358 EXIST::FUNCTION:
351OBJ_create 357 351OBJ_ln2nid 359 EXIST::FUNCTION:
352OBJ_dup 358 352OBJ_new_nid 360 EXIST::FUNCTION:
353OBJ_ln2nid 359 353OBJ_nid2ln 361 EXIST::FUNCTION:
354OBJ_new_nid 360 354OBJ_nid2obj 362 EXIST::FUNCTION:
355OBJ_nid2ln 361 355OBJ_nid2sn 363 EXIST::FUNCTION:
356OBJ_nid2obj 362 356OBJ_obj2nid 364 EXIST::FUNCTION:
357OBJ_nid2sn 363 357OBJ_sn2nid 365 EXIST::FUNCTION:
358OBJ_obj2nid 364 358OBJ_txt2nid 366 EXIST::FUNCTION:
359OBJ_sn2nid 365 359PEM_ASN1_read 367 EXIST:!WIN16:FUNCTION:
360OBJ_txt2nid 366 360PEM_ASN1_read_bio 368 EXIST::FUNCTION:
361PEM_ASN1_read 367 361PEM_ASN1_write 369 EXIST:!WIN16:FUNCTION:
362PEM_ASN1_read_bio 368 362PEM_ASN1_write_bio 370 EXIST::FUNCTION:
363PEM_ASN1_write 369 363PEM_SealFinal 371 EXIST::FUNCTION:RSA
364PEM_ASN1_write_bio 370 364PEM_SealInit 372 EXIST::FUNCTION:RSA
365PEM_SealFinal 371 365PEM_SealUpdate 373 EXIST::FUNCTION:RSA
366PEM_SealInit 372 366PEM_SignFinal 374 EXIST::FUNCTION:
367PEM_SealUpdate 373 367PEM_SignInit 375 EXIST::FUNCTION:
368PEM_SignFinal 374 368PEM_SignUpdate 376 EXIST::FUNCTION:
369PEM_SignInit 375 369PEM_X509_INFO_read 377 EXIST:!WIN16:FUNCTION:
370PEM_SignUpdate 376 370PEM_X509_INFO_read_bio 378 EXIST::FUNCTION:
371PEM_X509_INFO_read 377 371PEM_X509_INFO_write_bio 379 EXIST::FUNCTION:
372PEM_X509_INFO_read_bio 378 372PEM_dek_info 380 EXIST::FUNCTION:
373PEM_X509_INFO_write_bio 379 373PEM_do_header 381 EXIST::FUNCTION:
374PEM_dek_info 380 374PEM_get_EVP_CIPHER_INFO 382 EXIST::FUNCTION:
375PEM_do_header 381 375PEM_proc_type 383 EXIST::FUNCTION:
376PEM_get_EVP_CIPHER_INFO 382 376PEM_read 384 EXIST:!WIN16:FUNCTION:
377PEM_proc_type 383 377PEM_read_DHparams 385 EXIST:!WIN16:FUNCTION:DH
378PEM_read 384 378PEM_read_DSAPrivateKey 386 EXIST:!WIN16:FUNCTION:DSA
379PEM_read_DHparams 385 379PEM_read_DSAparams 387 EXIST:!WIN16:FUNCTION:DSA
380PEM_read_DSAPrivateKey 386 380PEM_read_PKCS7 388 EXIST:!WIN16:FUNCTION:
381PEM_read_DSAparams 387 381PEM_read_PrivateKey 389 EXIST:!WIN16:FUNCTION:
382PEM_read_PKCS7 388 382PEM_read_RSAPrivateKey 390 EXIST:!WIN16:FUNCTION:RSA
383PEM_read_PrivateKey 389 383PEM_read_X509 391 EXIST:!WIN16:FUNCTION:
384PEM_read_RSAPrivateKey 390 384PEM_read_X509_CRL 392 EXIST:!WIN16:FUNCTION:
385PEM_read_X509 391 385PEM_read_X509_REQ 393 EXIST:!WIN16:FUNCTION:
386PEM_read_X509_CRL 392 386PEM_read_bio 394 EXIST::FUNCTION:
387PEM_read_X509_REQ 393 387PEM_read_bio_DHparams 395 EXIST::FUNCTION:DH
388PEM_read_bio 394 388PEM_read_bio_DSAPrivateKey 396 EXIST::FUNCTION:DSA
389PEM_read_bio_DHparams 395 389PEM_read_bio_DSAparams 397 EXIST::FUNCTION:DSA
390PEM_read_bio_DSAPrivateKey 396 390PEM_read_bio_PKCS7 398 EXIST::FUNCTION:
391PEM_read_bio_DSAparams 397 391PEM_read_bio_PrivateKey 399 EXIST::FUNCTION:
392PEM_read_bio_PKCS7 398 392PEM_read_bio_RSAPrivateKey 400 EXIST::FUNCTION:RSA
393PEM_read_bio_PrivateKey 399 393PEM_read_bio_X509 401 EXIST::FUNCTION:
394PEM_read_bio_RSAPrivateKey 400 394PEM_read_bio_X509_CRL 402 EXIST::FUNCTION:
395PEM_read_bio_X509 401 395PEM_read_bio_X509_REQ 403 EXIST::FUNCTION:
396PEM_read_bio_X509_CRL 402 396PEM_write 404 EXIST:!WIN16:FUNCTION:
397PEM_read_bio_X509_REQ 403 397PEM_write_DHparams 405 EXIST:!WIN16:FUNCTION:DH
398PEM_write 404 398PEM_write_DSAPrivateKey 406 EXIST:!WIN16:FUNCTION:DSA
399PEM_write_DHparams 405 399PEM_write_DSAparams 407 EXIST:!WIN16:FUNCTION:DSA
400PEM_write_DSAPrivateKey 406 400PEM_write_PKCS7 408 EXIST:!WIN16:FUNCTION:
401PEM_write_DSAparams 407 401PEM_write_PrivateKey 409 EXIST:!WIN16:FUNCTION:
402PEM_write_PKCS7 408 402PEM_write_RSAPrivateKey 410 EXIST:!WIN16:FUNCTION:RSA
403PEM_write_PrivateKey 409 403PEM_write_X509 411 EXIST:!WIN16:FUNCTION:
404PEM_write_RSAPrivateKey 410 404PEM_write_X509_CRL 412 EXIST:!WIN16:FUNCTION:
405PEM_write_X509 411 405PEM_write_X509_REQ 413 EXIST:!WIN16:FUNCTION:
406PEM_write_X509_CRL 412 406PEM_write_bio 414 EXIST::FUNCTION:
407PEM_write_X509_REQ 413 407PEM_write_bio_DHparams 415 EXIST::FUNCTION:DH
408PEM_write_bio 414 408PEM_write_bio_DSAPrivateKey 416 EXIST::FUNCTION:DSA
409PEM_write_bio_DHparams 415 409PEM_write_bio_DSAparams 417 EXIST::FUNCTION:DSA
410PEM_write_bio_DSAPrivateKey 416 410PEM_write_bio_PKCS7 418 EXIST::FUNCTION:
411PEM_write_bio_DSAparams 417 411PEM_write_bio_PrivateKey 419 EXIST::FUNCTION:
412PEM_write_bio_PKCS7 418 412PEM_write_bio_RSAPrivateKey 420 EXIST::FUNCTION:RSA
413PEM_write_bio_PrivateKey 419 413PEM_write_bio_X509 421 EXIST::FUNCTION:
414PEM_write_bio_RSAPrivateKey 420 414PEM_write_bio_X509_CRL 422 EXIST::FUNCTION:
415PEM_write_bio_X509 421 415PEM_write_bio_X509_REQ 423 EXIST::FUNCTION:
416PEM_write_bio_X509_CRL 422 416PKCS7_DIGEST_free 424 EXIST::FUNCTION:
417PEM_write_bio_X509_REQ 423 417PKCS7_DIGEST_new 425 EXIST::FUNCTION:
418PKCS7_DIGEST_free 424 418PKCS7_ENCRYPT_free 426 EXIST::FUNCTION:
419PKCS7_DIGEST_new 425 419PKCS7_ENCRYPT_new 427 EXIST::FUNCTION:
420PKCS7_ENCRYPT_free 426 420PKCS7_ENC_CONTENT_free 428 EXIST::FUNCTION:
421PKCS7_ENCRYPT_new 427 421PKCS7_ENC_CONTENT_new 429 EXIST::FUNCTION:
422PKCS7_ENC_CONTENT_free 428 422PKCS7_ENVELOPE_free 430 EXIST::FUNCTION:
423PKCS7_ENC_CONTENT_new 429 423PKCS7_ENVELOPE_new 431 EXIST::FUNCTION:
424PKCS7_ENVELOPE_free 430 424PKCS7_ISSUER_AND_SERIAL_digest 432 EXIST::FUNCTION:
425PKCS7_ENVELOPE_new 431 425PKCS7_ISSUER_AND_SERIAL_free 433 EXIST::FUNCTION:
426PKCS7_ISSUER_AND_SERIAL_digest 432 426PKCS7_ISSUER_AND_SERIAL_new 434 EXIST::FUNCTION:
427PKCS7_ISSUER_AND_SERIAL_free 433 427PKCS7_RECIP_INFO_free 435 EXIST::FUNCTION:
428PKCS7_ISSUER_AND_SERIAL_new 434 428PKCS7_RECIP_INFO_new 436 EXIST::FUNCTION:
429PKCS7_RECIP_INFO_free 435 429PKCS7_SIGNED_free 437 EXIST::FUNCTION:
430PKCS7_RECIP_INFO_new 436 430PKCS7_SIGNED_new 438 EXIST::FUNCTION:
431PKCS7_SIGNED_free 437 431PKCS7_SIGNER_INFO_free 439 EXIST::FUNCTION:
432PKCS7_SIGNED_new 438 432PKCS7_SIGNER_INFO_new 440 EXIST::FUNCTION:
433PKCS7_SIGNER_INFO_free 439 433PKCS7_SIGN_ENVELOPE_free 441 EXIST::FUNCTION:
434PKCS7_SIGNER_INFO_new 440 434PKCS7_SIGN_ENVELOPE_new 442 EXIST::FUNCTION:
435PKCS7_SIGN_ENVELOPE_free 441 435PKCS7_dup 443 EXIST::FUNCTION:
436PKCS7_SIGN_ENVELOPE_new 442 436PKCS7_free 444 EXIST::FUNCTION:
437PKCS7_dup 443 437PKCS7_new 445 EXIST::FUNCTION:
438PKCS7_free 444 438PROXY_ENTRY_add_noproxy 446 NOEXIST::FUNCTION:
439PKCS7_new 445 439PROXY_ENTRY_clear_noproxy 447 NOEXIST::FUNCTION:
440PROXY_ENTRY_add_noproxy 446 440PROXY_ENTRY_free 448 NOEXIST::FUNCTION:
441PROXY_ENTRY_clear_noproxy 447 441PROXY_ENTRY_get_noproxy 449 NOEXIST::FUNCTION:
442PROXY_ENTRY_free 448 442PROXY_ENTRY_new 450 NOEXIST::FUNCTION:
443PROXY_ENTRY_get_noproxy 449 443PROXY_ENTRY_set_server 451 NOEXIST::FUNCTION:
444PROXY_ENTRY_new 450 444PROXY_add_noproxy 452 NOEXIST::FUNCTION:
445PROXY_ENTRY_set_server 451 445PROXY_add_server 453 NOEXIST::FUNCTION:
446PROXY_add_noproxy 452 446PROXY_check_by_host 454 NOEXIST::FUNCTION:
447PROXY_add_server 453 447PROXY_check_url 455 NOEXIST::FUNCTION:
448PROXY_check_by_host 454 448PROXY_clear_noproxy 456 NOEXIST::FUNCTION:
449PROXY_check_url 455 449PROXY_free 457 NOEXIST::FUNCTION:
450PROXY_clear_noproxy 456 450PROXY_get_noproxy 458 NOEXIST::FUNCTION:
451PROXY_free 457 451PROXY_get_proxies 459 NOEXIST::FUNCTION:
452PROXY_get_noproxy 458 452PROXY_get_proxy_entry 460 NOEXIST::FUNCTION:
453PROXY_get_proxies 459 453PROXY_load_conf 461 NOEXIST::FUNCTION:
454PROXY_get_proxy_entry 460 454PROXY_new 462 NOEXIST::FUNCTION:
455PROXY_load_conf 461 455PROXY_print 463 NOEXIST::FUNCTION:
456PROXY_new 462 456RAND_bytes 464 EXIST::FUNCTION:
457PROXY_print 463 457RAND_cleanup 465 EXIST::FUNCTION:
458RAND_bytes 464 458RAND_file_name 466 EXIST::FUNCTION:
459RAND_cleanup 465 459RAND_load_file 467 EXIST::FUNCTION:
460RAND_file_name 466 460RAND_screen 468 EXIST::FUNCTION:
461RAND_load_file 467 461RAND_seed 469 EXIST::FUNCTION:
462RAND_screen 468 462RAND_write_file 470 EXIST::FUNCTION:
463RAND_seed 469 463RC2_cbc_encrypt 471 EXIST::FUNCTION:RC2
464RAND_write_file 470 464RC2_cfb64_encrypt 472 EXIST::FUNCTION:RC2
465RC2_cbc_encrypt 471 465RC2_ecb_encrypt 473 EXIST::FUNCTION:RC2
466RC2_cfb64_encrypt 472 466RC2_encrypt 474 EXIST::FUNCTION:RC2
467RC2_ecb_encrypt 473 467RC2_ofb64_encrypt 475 EXIST::FUNCTION:RC2
468RC2_encrypt 474 468RC2_set_key 476 EXIST::FUNCTION:RC2
469RC2_ofb64_encrypt 475 469RC4 477 EXIST::FUNCTION:RC4
470RC2_set_key 476 470RC4_options 478 EXIST::FUNCTION:RC4
471RC4 477 471RC4_set_key 479 EXIST::FUNCTION:RC4
472RC4_options 478 472RSAPrivateKey_asn1_meth 480 EXIST::FUNCTION:RSA
473RC4_set_key 479 473RSAPrivateKey_dup 481 EXIST::FUNCTION:RSA
474RSAPrivateKey_asn1_meth 480 474RSAPublicKey_dup 482 EXIST::FUNCTION:RSA
475RSAPrivateKey_dup 481 475RSA_PKCS1_SSLeay 483 EXIST::FUNCTION:RSA
476RSAPublicKey_dup 482 476RSA_free 484 EXIST::FUNCTION:RSA
477RSA_PKCS1_SSLeay 483 477RSA_generate_key 485 EXIST::FUNCTION:RSA
478RSA_free 484 478RSA_new 486 EXIST::FUNCTION:RSA
479RSA_generate_key 485 479RSA_new_method 487 EXIST::FUNCTION:RSA
480RSA_new 486 480RSA_print 488 EXIST::FUNCTION:RSA
481RSA_new_method 487 481RSA_print_fp 489 EXIST::FUNCTION:RSA,FP_API
482RSA_print 488 482RSA_private_decrypt 490 EXIST::FUNCTION:RSA
483RSA_print_fp 489 483RSA_private_encrypt 491 EXIST::FUNCTION:RSA
484RSA_private_decrypt 490 484RSA_public_decrypt 492 EXIST::FUNCTION:RSA
485RSA_private_encrypt 491 485RSA_public_encrypt 493 EXIST::FUNCTION:RSA
486RSA_public_decrypt 492 486RSA_set_default_method 494 EXIST::FUNCTION:RSA
487RSA_public_encrypt 493 487RSA_sign 495 EXIST::FUNCTION:RSA
488RSA_set_default_method 494 488RSA_sign_ASN1_OCTET_STRING 496 EXIST::FUNCTION:RSA
489RSA_sign 495 489RSA_size 497 EXIST::FUNCTION:RSA
490RSA_sign_ASN1_OCTET_STRING 496 490RSA_verify 498 EXIST::FUNCTION:RSA
491RSA_size 497 491RSA_verify_ASN1_OCTET_STRING 499 EXIST::FUNCTION:RSA
492RSA_verify 498 492SHA 500 EXIST::FUNCTION:SHA
493RSA_verify_ASN1_OCTET_STRING 499 493SHA1 501 EXIST::FUNCTION:SHA
494SHA 500 494SHA1_Final 502 EXIST::FUNCTION:SHA
495SHA1 501 495SHA1_Init 503 EXIST::FUNCTION:SHA
496SHA1_Final 502 496SHA1_Update 504 EXIST::FUNCTION:SHA
497SHA1_Init 503 497SHA_Final 505 EXIST::FUNCTION:SHA
498SHA1_Update 504 498SHA_Init 506 EXIST::FUNCTION:SHA
499SHA_Final 505 499SHA_Update 507 EXIST::FUNCTION:SHA
500SHA_Init 506 500OpenSSL_add_all_algorithms 508 EXIST::FUNCTION:
501SHA_Update 507 501OpenSSL_add_all_ciphers 509 EXIST::FUNCTION:
502OpenSSL_add_all_algorithms 508 502OpenSSL_add_all_digests 510 EXIST::FUNCTION:
503OpenSSL_add_all_ciphers 509 503TXT_DB_create_index 511 EXIST::FUNCTION:
504OpenSSL_add_all_digests 510 504TXT_DB_free 512 EXIST::FUNCTION:
505TXT_DB_create_index 511 505TXT_DB_get_by_index 513 EXIST::FUNCTION:
506TXT_DB_free 512 506TXT_DB_insert 514 EXIST::FUNCTION:
507TXT_DB_get_by_index 513 507TXT_DB_read 515 EXIST::FUNCTION:
508TXT_DB_insert 514 508TXT_DB_write 516 EXIST::FUNCTION:
509TXT_DB_read 515 509X509_ALGOR_free 517 EXIST::FUNCTION:
510TXT_DB_write 516 510X509_ALGOR_new 518 EXIST::FUNCTION:
511X509_ALGOR_free 517 511X509_ATTRIBUTE_free 519 EXIST::FUNCTION:
512X509_ALGOR_new 518 512X509_ATTRIBUTE_new 520 EXIST::FUNCTION:
513X509_ATTRIBUTE_free 519 513X509_CINF_free 521 EXIST::FUNCTION:
514X509_ATTRIBUTE_new 520 514X509_CINF_new 522 EXIST::FUNCTION:
515X509_CINF_free 521 515X509_CRL_INFO_free 523 EXIST::FUNCTION:
516X509_CINF_new 522 516X509_CRL_INFO_new 524 EXIST::FUNCTION:
517X509_CRL_INFO_free 523 517X509_CRL_add_ext 525 EXIST::FUNCTION:
518X509_CRL_INFO_new 524 518X509_CRL_cmp 526 EXIST::FUNCTION:
519X509_CRL_add_ext 525 519X509_CRL_delete_ext 527 EXIST::FUNCTION:
520X509_CRL_cmp 526 520X509_CRL_dup 528 EXIST::FUNCTION:
521X509_CRL_delete_ext 527 521X509_CRL_free 529 EXIST::FUNCTION:
522X509_CRL_dup 528 522X509_CRL_get_ext 530 EXIST::FUNCTION:
523X509_CRL_free 529 523X509_CRL_get_ext_by_NID 531 EXIST::FUNCTION:
524X509_CRL_get_ext 530 524X509_CRL_get_ext_by_OBJ 532 EXIST::FUNCTION:
525X509_CRL_get_ext_by_NID 531 525X509_CRL_get_ext_by_critical 533 EXIST::FUNCTION:
526X509_CRL_get_ext_by_OBJ 532 526X509_CRL_get_ext_count 534 EXIST::FUNCTION:
527X509_CRL_get_ext_by_critical 533 527X509_CRL_new 535 EXIST::FUNCTION:
528X509_CRL_get_ext_count 534 528X509_CRL_sign 536 EXIST::FUNCTION:
529X509_CRL_new 535 529X509_CRL_verify 537 EXIST::FUNCTION:
530X509_CRL_sign 536 530X509_EXTENSION_create_by_NID 538 EXIST::FUNCTION:
531X509_CRL_verify 537 531X509_EXTENSION_create_by_OBJ 539 EXIST::FUNCTION:
532X509_EXTENSION_create_by_NID 538 532X509_EXTENSION_dup 540 EXIST::FUNCTION:
533X509_EXTENSION_create_by_OBJ 539 533X509_EXTENSION_free 541 EXIST::FUNCTION:
534X509_EXTENSION_dup 540 534X509_EXTENSION_get_critical 542 EXIST::FUNCTION:
535X509_EXTENSION_free 541 535X509_EXTENSION_get_data 543 EXIST::FUNCTION:
536X509_EXTENSION_get_critical 542 536X509_EXTENSION_get_object 544 EXIST::FUNCTION:
537X509_EXTENSION_get_data 543 537X509_EXTENSION_new 545 EXIST::FUNCTION:
538X509_EXTENSION_get_object 544 538X509_EXTENSION_set_critical 546 EXIST::FUNCTION:
539X509_EXTENSION_new 545 539X509_EXTENSION_set_data 547 EXIST::FUNCTION:
540X509_EXTENSION_set_critical 546 540X509_EXTENSION_set_object 548 EXIST::FUNCTION:
541X509_EXTENSION_set_data 547 541X509_INFO_free 549 EXIST::FUNCTION:
542X509_EXTENSION_set_object 548 542X509_INFO_new 550 EXIST::FUNCTION:
543X509_INFO_free 549 543X509_LOOKUP_by_alias 551 EXIST::FUNCTION:
544X509_INFO_new 550 544X509_LOOKUP_by_fingerprint 552 EXIST::FUNCTION:
545X509_LOOKUP_by_alias 551 545X509_LOOKUP_by_issuer_serial 553 EXIST::FUNCTION:
546X509_LOOKUP_by_fingerprint 552 546X509_LOOKUP_by_subject 554 EXIST::FUNCTION:
547X509_LOOKUP_by_issuer_serial 553 547X509_LOOKUP_ctrl 555 EXIST::FUNCTION:
548X509_LOOKUP_by_subject 554 548X509_LOOKUP_file 556 EXIST::FUNCTION:
549X509_LOOKUP_ctrl 555 549X509_LOOKUP_free 557 EXIST::FUNCTION:
550X509_LOOKUP_file 556 550X509_LOOKUP_hash_dir 558 EXIST::FUNCTION:
551X509_LOOKUP_free 557 551X509_LOOKUP_init 559 EXIST::FUNCTION:
552X509_LOOKUP_hash_dir 558 552X509_LOOKUP_new 560 EXIST::FUNCTION:
553X509_LOOKUP_init 559 553X509_LOOKUP_shutdown 561 EXIST::FUNCTION:
554X509_LOOKUP_new 560 554X509_NAME_ENTRY_create_by_NID 562 EXIST::FUNCTION:
555X509_LOOKUP_shutdown 561 555X509_NAME_ENTRY_create_by_OBJ 563 EXIST::FUNCTION:
556X509_NAME_ENTRY_create_by_NID 562 556X509_NAME_ENTRY_dup 564 EXIST::FUNCTION:
557X509_NAME_ENTRY_create_by_OBJ 563 557X509_NAME_ENTRY_free 565 EXIST::FUNCTION:
558X509_NAME_ENTRY_dup 564 558X509_NAME_ENTRY_get_data 566 EXIST::FUNCTION:
559X509_NAME_ENTRY_free 565 559X509_NAME_ENTRY_get_object 567 EXIST::FUNCTION:
560X509_NAME_ENTRY_get_data 566 560X509_NAME_ENTRY_new 568 EXIST::FUNCTION:
561X509_NAME_ENTRY_get_object 567 561X509_NAME_ENTRY_set_data 569 EXIST::FUNCTION:
562X509_NAME_ENTRY_new 568 562X509_NAME_ENTRY_set_object 570 EXIST::FUNCTION:
563X509_NAME_ENTRY_set_data 569 563X509_NAME_add_entry 571 EXIST::FUNCTION:
564X509_NAME_ENTRY_set_object 570 564X509_NAME_cmp 572 EXIST::FUNCTION:
565X509_NAME_add_entry 571 565X509_NAME_delete_entry 573 EXIST::FUNCTION:
566X509_NAME_cmp 572 566X509_NAME_digest 574 EXIST::FUNCTION:
567X509_NAME_delete_entry 573 567X509_NAME_dup 575 EXIST::FUNCTION:
568X509_NAME_digest 574 568X509_NAME_entry_count 576 EXIST::FUNCTION:
569X509_NAME_dup 575 569X509_NAME_free 577 EXIST::FUNCTION:
570X509_NAME_entry_count 576 570X509_NAME_get_entry 578 EXIST::FUNCTION:
571X509_NAME_free 577 571X509_NAME_get_index_by_NID 579 EXIST::FUNCTION:
572X509_NAME_get_entry 578 572X509_NAME_get_index_by_OBJ 580 EXIST::FUNCTION:
573X509_NAME_get_index_by_NID 579 573X509_NAME_get_text_by_NID 581 EXIST::FUNCTION:
574X509_NAME_get_index_by_OBJ 580 574X509_NAME_get_text_by_OBJ 582 EXIST::FUNCTION:
575X509_NAME_get_text_by_NID 581 575X509_NAME_hash 583 EXIST::FUNCTION:
576X509_NAME_get_text_by_OBJ 582 576X509_NAME_new 584 EXIST::FUNCTION:
577X509_NAME_hash 583 577X509_NAME_oneline 585 EXIST::FUNCTION:
578X509_NAME_new 584 578X509_NAME_print 586 EXIST::FUNCTION:
579X509_NAME_oneline 585 579X509_NAME_set 587 EXIST::FUNCTION:
580X509_NAME_print 586 580X509_OBJECT_free_contents 588 EXIST::FUNCTION:
581X509_NAME_set 587 581X509_OBJECT_retrieve_by_subject 589 EXIST::FUNCTION:
582X509_OBJECT_free_contents 588 582X509_OBJECT_up_ref_count 590 EXIST::FUNCTION:
583X509_OBJECT_retrieve_by_subject 589 583X509_PKEY_free 591 EXIST::FUNCTION:
584X509_OBJECT_up_ref_count 590 584X509_PKEY_new 592 EXIST::FUNCTION:
585X509_PKEY_free 591 585X509_PUBKEY_free 593 EXIST::FUNCTION:
586X509_PKEY_new 592 586X509_PUBKEY_get 594 EXIST::FUNCTION:
587X509_PUBKEY_free 593 587X509_PUBKEY_new 595 EXIST::FUNCTION:
588X509_PUBKEY_get 594 588X509_PUBKEY_set 596 EXIST::FUNCTION:
589X509_PUBKEY_new 595 589X509_REQ_INFO_free 597 EXIST::FUNCTION:
590X509_PUBKEY_set 596 590X509_REQ_INFO_new 598 EXIST::FUNCTION:
591X509_REQ_INFO_free 597 591X509_REQ_dup 599 EXIST::FUNCTION:
592X509_REQ_INFO_new 598 592X509_REQ_free 600 EXIST::FUNCTION:
593X509_REQ_dup 599 593X509_REQ_get_pubkey 601 EXIST::FUNCTION:
594X509_REQ_free 600 594X509_REQ_new 602 EXIST::FUNCTION:
595X509_REQ_get_pubkey 601 595X509_REQ_print 603 EXIST::FUNCTION:
596X509_REQ_new 602 596X509_REQ_print_fp 604 EXIST::FUNCTION:FP_API
597X509_REQ_print 603 597X509_REQ_set_pubkey 605 EXIST::FUNCTION:
598X509_REQ_print_fp 604 598X509_REQ_set_subject_name 606 EXIST::FUNCTION:
599X509_REQ_set_pubkey 605 599X509_REQ_set_version 607 EXIST::FUNCTION:
600X509_REQ_set_subject_name 606 600X509_REQ_sign 608 EXIST::FUNCTION:
601X509_REQ_set_version 607 601X509_REQ_to_X509 609 EXIST::FUNCTION:
602X509_REQ_sign 608 602X509_REQ_verify 610 EXIST::FUNCTION:
603X509_REQ_to_X509 609 603X509_REVOKED_add_ext 611 EXIST::FUNCTION:
604X509_REQ_verify 610 604X509_REVOKED_delete_ext 612 EXIST::FUNCTION:
605X509_REVOKED_add_ext 611 605X509_REVOKED_free 613 EXIST::FUNCTION:
606X509_REVOKED_delete_ext 612 606X509_REVOKED_get_ext 614 EXIST::FUNCTION:
607X509_REVOKED_free 613 607X509_REVOKED_get_ext_by_NID 615 EXIST::FUNCTION:
608X509_REVOKED_get_ext 614 608X509_REVOKED_get_ext_by_OBJ 616 EXIST::FUNCTION:
609X509_REVOKED_get_ext_by_NID 615 609X509_REVOKED_get_ext_by_critical 617 EXIST:!VMS:FUNCTION:
610X509_REVOKED_get_ext_by_OBJ 616 610X509_REVOKED_get_ext_by_critic 617 EXIST:VMS:FUNCTION:
611X509_REVOKED_get_ext_by_critical 617 611X509_REVOKED_get_ext_count 618 EXIST::FUNCTION:
612X509_REVOKED_get_ext_count 618 612X509_REVOKED_new 619 EXIST::FUNCTION:
613X509_REVOKED_new 619 613X509_SIG_free 620 EXIST::FUNCTION:
614X509_SIG_free 620 614X509_SIG_new 621 EXIST::FUNCTION:
615X509_SIG_new 621 615X509_STORE_CTX_cleanup 622 EXIST::FUNCTION:
616X509_STORE_CTX_cleanup 622 616X509_STORE_CTX_init 623 EXIST::FUNCTION:
617X509_STORE_CTX_init 623 617X509_STORE_add_cert 624 EXIST::FUNCTION:
618X509_STORE_add_cert 624 618X509_STORE_add_lookup 625 EXIST::FUNCTION:
619X509_STORE_add_lookup 625 619X509_STORE_free 626 EXIST::FUNCTION:
620X509_STORE_free 626 620X509_STORE_get_by_subject 627 EXIST::FUNCTION:
621X509_STORE_get_by_subject 627 621X509_STORE_load_locations 628 EXIST::FUNCTION:
622X509_STORE_load_locations 628 622X509_STORE_new 629 EXIST::FUNCTION:
623X509_STORE_new 629 623X509_STORE_set_default_paths 630 EXIST::FUNCTION:
624X509_STORE_set_default_paths 630 624X509_VAL_free 631 EXIST::FUNCTION:
625X509_VAL_free 631 625X509_VAL_new 632 EXIST::FUNCTION:
626X509_VAL_new 632 626X509_add_ext 633 EXIST::FUNCTION:
627X509_add_ext 633 627X509_asn1_meth 634 EXIST::FUNCTION:
628X509_asn1_meth 634 628X509_certificate_type 635 EXIST::FUNCTION:
629X509_certificate_type 635 629X509_check_private_key 636 EXIST::FUNCTION:
630X509_check_private_key 636 630X509_cmp_current_time 637 EXIST::FUNCTION:
631X509_cmp_current_time 637 631X509_delete_ext 638 EXIST::FUNCTION:
632X509_delete_ext 638 632X509_digest 639 EXIST::FUNCTION:
633X509_digest 639 633X509_dup 640 EXIST::FUNCTION:
634X509_dup 640 634X509_free 641 EXIST::FUNCTION:
635X509_free 641 635X509_get_default_cert_area 642 EXIST::FUNCTION:
636X509_get_default_cert_area 642 636X509_get_default_cert_dir 643 EXIST::FUNCTION:
637X509_get_default_cert_dir 643 637X509_get_default_cert_dir_env 644 EXIST::FUNCTION:
638X509_get_default_cert_dir_env 644 638X509_get_default_cert_file 645 EXIST::FUNCTION:
639X509_get_default_cert_file 645 639X509_get_default_cert_file_env 646 EXIST::FUNCTION:
640X509_get_default_cert_file_env 646 640X509_get_default_private_dir 647 EXIST::FUNCTION:
641X509_get_default_private_dir 647 641X509_get_ext 648 EXIST::FUNCTION:
642X509_get_ext 648 642X509_get_ext_by_NID 649 EXIST::FUNCTION:
643X509_get_ext_by_NID 649 643X509_get_ext_by_OBJ 650 EXIST::FUNCTION:
644X509_get_ext_by_OBJ 650 644X509_get_ext_by_critical 651 EXIST::FUNCTION:
645X509_get_ext_by_critical 651 645X509_get_ext_count 652 EXIST::FUNCTION:
646X509_get_ext_count 652 646X509_get_issuer_name 653 EXIST::FUNCTION:
647X509_get_issuer_name 653 647X509_get_pubkey 654 EXIST::FUNCTION:
648X509_get_pubkey 654 648X509_get_pubkey_parameters 655 EXIST::FUNCTION:
649X509_get_pubkey_parameters 655 649X509_get_serialNumber 656 EXIST::FUNCTION:
650X509_get_serialNumber 656 650X509_get_subject_name 657 EXIST::FUNCTION:
651X509_get_subject_name 657 651X509_gmtime_adj 658 EXIST::FUNCTION:
652X509_gmtime_adj 658 652X509_issuer_and_serial_cmp 659 EXIST::FUNCTION:
653X509_issuer_and_serial_cmp 659 653X509_issuer_and_serial_hash 660 EXIST::FUNCTION:
654X509_issuer_and_serial_hash 660 654X509_issuer_name_cmp 661 EXIST::FUNCTION:
655X509_issuer_name_cmp 661 655X509_issuer_name_hash 662 EXIST::FUNCTION:
656X509_issuer_name_hash 662 656X509_load_cert_file 663 EXIST::FUNCTION:
657X509_load_cert_file 663 657X509_new 664 EXIST::FUNCTION:
658X509_new 664 658X509_print 665 EXIST::FUNCTION:
659X509_print 665 659X509_print_fp 666 EXIST::FUNCTION:FP_API
660X509_print_fp 666 660X509_set_issuer_name 667 EXIST::FUNCTION:
661X509_set_issuer_name 667 661X509_set_notAfter 668 EXIST::FUNCTION:
662X509_set_notAfter 668 662X509_set_notBefore 669 EXIST::FUNCTION:
663X509_set_notBefore 669 663X509_set_pubkey 670 EXIST::FUNCTION:
664X509_set_pubkey 670 664X509_set_serialNumber 671 EXIST::FUNCTION:
665X509_set_serialNumber 671 665X509_set_subject_name 672 EXIST::FUNCTION:
666X509_set_subject_name 672 666X509_set_version 673 EXIST::FUNCTION:
667X509_set_version 673 667X509_sign 674 EXIST::FUNCTION:
668X509_sign 674 668X509_subject_name_cmp 675 EXIST::FUNCTION:
669X509_subject_name_cmp 675 669X509_subject_name_hash 676 EXIST::FUNCTION:
670X509_subject_name_hash 676 670X509_to_X509_REQ 677 EXIST::FUNCTION:
671X509_to_X509_REQ 677 671X509_verify 678 EXIST::FUNCTION:
672X509_verify 678 672X509_verify_cert 679 EXIST::FUNCTION:
673X509_verify_cert 679 673X509_verify_cert_error_string 680 EXIST::FUNCTION:
674X509_verify_cert_error_string 680 674X509v3_add_ext 681 EXIST::FUNCTION:
675X509v3_add_ext 681 675X509v3_add_extension 682 NOEXIST::FUNCTION:
676X509v3_add_extension 682 676X509v3_add_netscape_extensions 683 NOEXIST::FUNCTION:
677X509v3_add_netscape_extensions 683 677X509v3_add_standard_extensions 684 NOEXIST::FUNCTION:
678X509v3_add_standard_extensions 684 678X509v3_cleanup_extensions 685 NOEXIST::FUNCTION:
679X509v3_cleanup_extensions 685 679X509v3_data_type_by_NID 686 NOEXIST::FUNCTION:
680X509v3_data_type_by_NID 686 680X509v3_data_type_by_OBJ 687 NOEXIST::FUNCTION:
681X509v3_data_type_by_OBJ 687 681X509v3_delete_ext 688 EXIST::FUNCTION:
682X509v3_delete_ext 688 682X509v3_get_ext 689 EXIST::FUNCTION:
683X509v3_get_ext 689 683X509v3_get_ext_by_NID 690 EXIST::FUNCTION:
684X509v3_get_ext_by_NID 690 684X509v3_get_ext_by_OBJ 691 EXIST::FUNCTION:
685X509v3_get_ext_by_OBJ 691 685X509v3_get_ext_by_critical 692 EXIST::FUNCTION:
686X509v3_get_ext_by_critical 692 686X509v3_get_ext_count 693 EXIST::FUNCTION:
687X509v3_get_ext_count 693 687X509v3_pack_string 694 NOEXIST::FUNCTION:
688X509v3_pack_string 694 688X509v3_pack_type_by_NID 695 NOEXIST::FUNCTION:
689X509v3_pack_type_by_NID 695 689X509v3_pack_type_by_OBJ 696 NOEXIST::FUNCTION:
690X509v3_pack_type_by_OBJ 696 690X509v3_unpack_string 697 NOEXIST::FUNCTION:
691X509v3_unpack_string 697 691_des_crypt 698 NOEXIST::FUNCTION:
692_des_crypt 698 692a2d_ASN1_OBJECT 699 EXIST::FUNCTION:
693a2d_ASN1_OBJECT 699 693a2i_ASN1_INTEGER 700 EXIST::FUNCTION:
694a2i_ASN1_INTEGER 700 694a2i_ASN1_STRING 701 EXIST::FUNCTION:
695a2i_ASN1_STRING 701 695asn1_Finish 702 EXIST::FUNCTION:
696asn1_Finish 702 696asn1_GetSequence 703 EXIST::FUNCTION:
697asn1_GetSequence 703 697bn_div_words 704 EXIST::FUNCTION:
698bn_div_words 704 698bn_expand2 705 EXIST::FUNCTION:
699bn_expand2 705 699bn_mul_add_words 706 EXIST::FUNCTION:
700bn_mul_add_words 706 700bn_mul_words 707 EXIST::FUNCTION:
701bn_mul_words 707 701BN_uadd 708 EXIST::FUNCTION:
702BN_uadd 708 702BN_usub 709 EXIST::FUNCTION:
703BN_usub 709 703bn_sqr_words 710 EXIST::FUNCTION:
704bn_sqr_words 710 704crypt 711 EXIST:!PERL5,!NeXT,!__FreeBSD__:FUNCTION:DES
705crypt 711 705d2i_ASN1_BIT_STRING 712 EXIST::FUNCTION:
706d2i_ASN1_BIT_STRING 712 706d2i_ASN1_BOOLEAN 713 EXIST::FUNCTION:
707d2i_ASN1_BOOLEAN 713 707d2i_ASN1_HEADER 714 EXIST::FUNCTION:
708d2i_ASN1_HEADER 714 708d2i_ASN1_IA5STRING 715 EXIST::FUNCTION:
709d2i_ASN1_IA5STRING 715 709d2i_ASN1_INTEGER 716 EXIST::FUNCTION:
710d2i_ASN1_INTEGER 716 710d2i_ASN1_OBJECT 717 EXIST::FUNCTION:
711d2i_ASN1_OBJECT 717 711d2i_ASN1_OCTET_STRING 718 EXIST::FUNCTION:
712d2i_ASN1_OCTET_STRING 718 712d2i_ASN1_PRINTABLE 719 EXIST::FUNCTION:
713d2i_ASN1_PRINTABLE 719 713d2i_ASN1_PRINTABLESTRING 720 EXIST::FUNCTION:
714d2i_ASN1_PRINTABLESTRING 720 714d2i_ASN1_SET 721 EXIST::FUNCTION:
715d2i_ASN1_SET 721 715d2i_ASN1_T61STRING 722 EXIST::FUNCTION:
716d2i_ASN1_T61STRING 722 716d2i_ASN1_TYPE 723 EXIST::FUNCTION:
717d2i_ASN1_TYPE 723 717d2i_ASN1_UTCTIME 724 EXIST::FUNCTION:
718d2i_ASN1_UTCTIME 724 718d2i_ASN1_bytes 725 EXIST::FUNCTION:
719d2i_ASN1_bytes 725 719d2i_ASN1_type_bytes 726 EXIST::FUNCTION:
720d2i_ASN1_type_bytes 726 720d2i_DHparams 727 EXIST::FUNCTION:DH
721d2i_DHparams 727 721d2i_DSAPrivateKey 728 EXIST::FUNCTION:DSA
722d2i_DSAPrivateKey 728 722d2i_DSAPrivateKey_bio 729 EXIST::FUNCTION:DSA
723d2i_DSAPrivateKey_bio 729 723d2i_DSAPrivateKey_fp 730 EXIST::FUNCTION:DSA,FP_API
724d2i_DSAPrivateKey_fp 730 724d2i_DSAPublicKey 731 EXIST::FUNCTION:DSA
725d2i_DSAPublicKey 731 725d2i_DSAparams 732 EXIST::FUNCTION:DSA
726d2i_DSAparams 732 726d2i_NETSCAPE_SPKAC 733 EXIST::FUNCTION:
727d2i_NETSCAPE_SPKAC 733 727d2i_NETSCAPE_SPKI 734 EXIST::FUNCTION:
728d2i_NETSCAPE_SPKI 734 728d2i_Netscape_RSA 735 EXIST::FUNCTION:RSA
729d2i_Netscape_RSA 735 729d2i_PKCS7 736 EXIST::FUNCTION:
730d2i_PKCS7 736 730d2i_PKCS7_DIGEST 737 EXIST::FUNCTION:
731d2i_PKCS7_DIGEST 737 731d2i_PKCS7_ENCRYPT 738 EXIST::FUNCTION:
732d2i_PKCS7_ENCRYPT 738 732d2i_PKCS7_ENC_CONTENT 739 EXIST::FUNCTION:
733d2i_PKCS7_ENC_CONTENT 739 733d2i_PKCS7_ENVELOPE 740 EXIST::FUNCTION:
734d2i_PKCS7_ENVELOPE 740 734d2i_PKCS7_ISSUER_AND_SERIAL 741 EXIST::FUNCTION:
735d2i_PKCS7_ISSUER_AND_SERIAL 741 735d2i_PKCS7_RECIP_INFO 742 EXIST::FUNCTION:
736d2i_PKCS7_RECIP_INFO 742 736d2i_PKCS7_SIGNED 743 EXIST::FUNCTION:
737d2i_PKCS7_SIGNED 743 737d2i_PKCS7_SIGNER_INFO 744 EXIST::FUNCTION:
738d2i_PKCS7_SIGNER_INFO 744 738d2i_PKCS7_SIGN_ENVELOPE 745 EXIST::FUNCTION:
739d2i_PKCS7_SIGN_ENVELOPE 745 739d2i_PKCS7_bio 746 EXIST::FUNCTION:
740d2i_PKCS7_bio 746 740d2i_PKCS7_fp 747 EXIST::FUNCTION:FP_API
741d2i_PKCS7_fp 747 741d2i_PrivateKey 748 EXIST::FUNCTION:
742d2i_PrivateKey 748 742d2i_PublicKey 749 EXIST::FUNCTION:
743d2i_PublicKey 749 743d2i_RSAPrivateKey 750 EXIST::FUNCTION:RSA
744d2i_RSAPrivateKey 750 744d2i_RSAPrivateKey_bio 751 EXIST::FUNCTION:RSA
745d2i_RSAPrivateKey_bio 751 745d2i_RSAPrivateKey_fp 752 EXIST::FUNCTION:RSA,FP_API
746d2i_RSAPrivateKey_fp 752 746d2i_RSAPublicKey 753 EXIST::FUNCTION:RSA
747d2i_RSAPublicKey 753 747d2i_X509 754 EXIST::FUNCTION:
748d2i_X509 754 748d2i_X509_ALGOR 755 EXIST::FUNCTION:
749d2i_X509_ALGOR 755 749d2i_X509_ATTRIBUTE 756 EXIST::FUNCTION:
750d2i_X509_ATTRIBUTE 756 750d2i_X509_CINF 757 EXIST::FUNCTION:
751d2i_X509_CINF 757 751d2i_X509_CRL 758 EXIST::FUNCTION:
752d2i_X509_CRL 758 752d2i_X509_CRL_INFO 759 EXIST::FUNCTION:
753d2i_X509_CRL_INFO 759 753d2i_X509_CRL_bio 760 EXIST::FUNCTION:
754d2i_X509_CRL_bio 760 754d2i_X509_CRL_fp 761 EXIST::FUNCTION:FP_API
755d2i_X509_CRL_fp 761 755d2i_X509_EXTENSION 762 EXIST::FUNCTION:
756d2i_X509_EXTENSION 762 756d2i_X509_NAME 763 EXIST::FUNCTION:
757d2i_X509_NAME 763 757d2i_X509_NAME_ENTRY 764 EXIST::FUNCTION:
758d2i_X509_NAME_ENTRY 764 758d2i_X509_PKEY 765 EXIST::FUNCTION:
759d2i_X509_PKEY 765 759d2i_X509_PUBKEY 766 EXIST::FUNCTION:
760d2i_X509_PUBKEY 766 760d2i_X509_REQ 767 EXIST::FUNCTION:
761d2i_X509_REQ 767 761d2i_X509_REQ_INFO 768 EXIST::FUNCTION:
762d2i_X509_REQ_INFO 768 762d2i_X509_REQ_bio 769 EXIST::FUNCTION:
763d2i_X509_REQ_bio 769 763d2i_X509_REQ_fp 770 EXIST::FUNCTION:FP_API
764d2i_X509_REQ_fp 770 764d2i_X509_REVOKED 771 EXIST::FUNCTION:
765d2i_X509_REVOKED 771 765d2i_X509_SIG 772 EXIST::FUNCTION:
766d2i_X509_SIG 772 766d2i_X509_VAL 773 EXIST::FUNCTION:
767d2i_X509_VAL 773 767d2i_X509_bio 774 EXIST::FUNCTION:
768d2i_X509_bio 774 768d2i_X509_fp 775 EXIST::FUNCTION:FP_API
769d2i_X509_fp 775 769des_cbc_cksum 777 EXIST::FUNCTION:DES
770des_cbc_cksum 777 770des_cbc_encrypt 778 EXIST::FUNCTION:DES
771des_cbc_encrypt 778 771des_cblock_print_file 779 NOEXIST::FUNCTION:
772des_cblock_print_file 779 772des_cfb64_encrypt 780 EXIST::FUNCTION:DES
773des_cfb64_encrypt 780 773des_cfb_encrypt 781 EXIST::FUNCTION:DES
774des_cfb_encrypt 781 774des_decrypt3 782 EXIST::FUNCTION:DES
775des_decrypt3 782 775des_ecb3_encrypt 783 EXIST::FUNCTION:DES
776des_ecb3_encrypt 783 776des_ecb_encrypt 784 EXIST::FUNCTION:DES
777des_ecb_encrypt 784 777des_ede3_cbc_encrypt 785 EXIST::FUNCTION:DES
778des_ede3_cbc_encrypt 785 778des_ede3_cfb64_encrypt 786 EXIST::FUNCTION:DES
779des_ede3_cfb64_encrypt 786 779des_ede3_ofb64_encrypt 787 EXIST::FUNCTION:DES
780des_ede3_ofb64_encrypt 787 780des_enc_read 788 EXIST::FUNCTION:DES
781des_enc_read 788 781des_enc_write 789 EXIST::FUNCTION:DES
782des_enc_write 789 782des_encrypt 790 EXIST::FUNCTION:DES
783des_encrypt 790 783des_encrypt2 791 EXIST::FUNCTION:DES
784des_encrypt2 791 784des_encrypt3 792 EXIST::FUNCTION:DES
785des_encrypt3 792 785des_fcrypt 793 EXIST::FUNCTION:DES
786des_fcrypt 793 786des_is_weak_key 794 EXIST::FUNCTION:DES
787des_is_weak_key 794 787des_key_sched 795 EXIST::FUNCTION:DES
788des_key_sched 795 788des_ncbc_encrypt 796 EXIST::FUNCTION:DES
789des_ncbc_encrypt 796 789des_ofb64_encrypt 797 EXIST::FUNCTION:DES
790des_ofb64_encrypt 797 790des_ofb_encrypt 798 EXIST::FUNCTION:DES
791des_ofb_encrypt 798 791des_options 799 EXIST::FUNCTION:DES
792des_options 799 792des_pcbc_encrypt 800 EXIST::FUNCTION:DES
793des_pcbc_encrypt 800 793des_quad_cksum 801 EXIST::FUNCTION:DES
794des_quad_cksum 801 794des_random_key 802 EXIST::FUNCTION:DES
795des_random_key 802 795des_random_seed 803 EXIST::FUNCTION:DES
796des_random_seed 803 796des_read_2passwords 804 EXIST::FUNCTION:DES
797des_read_2passwords 804 797des_read_password 805 EXIST::FUNCTION:DES
798des_read_password 805 798des_read_pw 806 EXIST::FUNCTION:DES
799des_read_pw 806 799des_read_pw_string 807 EXIST::FUNCTION:DES
800des_read_pw_string 807 800des_set_key 808 EXIST::FUNCTION:DES
801des_set_key 808 801des_set_odd_parity 809 EXIST::FUNCTION:DES
802des_set_odd_parity 809 802des_string_to_2keys 810 EXIST::FUNCTION:DES
803des_string_to_2keys 810 803des_string_to_key 811 EXIST::FUNCTION:DES
804des_string_to_key 811 804des_xcbc_encrypt 812 EXIST::FUNCTION:DES
805des_xcbc_encrypt 812 805des_xwhite_in2out 813 EXIST::FUNCTION:DES
806des_xwhite_in2out 813 806fcrypt_body 814 NOEXIST::FUNCTION:
807fcrypt_body 814 807i2a_ASN1_INTEGER 815 EXIST::FUNCTION:
808i2a_ASN1_INTEGER 815 808i2a_ASN1_OBJECT 816 EXIST::FUNCTION:
809i2a_ASN1_OBJECT 816 809i2a_ASN1_STRING 817 EXIST::FUNCTION:
810i2a_ASN1_STRING 817 810i2d_ASN1_BIT_STRING 818 EXIST::FUNCTION:
811i2d_ASN1_BIT_STRING 818 811i2d_ASN1_BOOLEAN 819 EXIST::FUNCTION:
812i2d_ASN1_BOOLEAN 819 812i2d_ASN1_HEADER 820 EXIST::FUNCTION:
813i2d_ASN1_HEADER 820 813i2d_ASN1_IA5STRING 821 EXIST::FUNCTION:
814i2d_ASN1_IA5STRING 821 814i2d_ASN1_INTEGER 822 EXIST::FUNCTION:
815i2d_ASN1_INTEGER 822 815i2d_ASN1_OBJECT 823 EXIST::FUNCTION:
816i2d_ASN1_OBJECT 823 816i2d_ASN1_OCTET_STRING 824 EXIST::FUNCTION:
817i2d_ASN1_OCTET_STRING 824 817i2d_ASN1_PRINTABLE 825 EXIST::FUNCTION:
818i2d_ASN1_PRINTABLE 825 818i2d_ASN1_SET 826 EXIST::FUNCTION:
819i2d_ASN1_SET 826 819i2d_ASN1_TYPE 827 EXIST::FUNCTION:
820i2d_ASN1_TYPE 827 820i2d_ASN1_UTCTIME 828 EXIST::FUNCTION:
821i2d_ASN1_UTCTIME 828 821i2d_ASN1_bytes 829 EXIST::FUNCTION:
822i2d_ASN1_bytes 829 822i2d_DHparams 830 EXIST::FUNCTION:DH
823i2d_DHparams 830 823i2d_DSAPrivateKey 831 EXIST::FUNCTION:DSA
824i2d_DSAPrivateKey 831 824i2d_DSAPrivateKey_bio 832 EXIST::FUNCTION:DSA
825i2d_DSAPrivateKey_bio 832 825i2d_DSAPrivateKey_fp 833 EXIST::FUNCTION:DSA,FP_API
826i2d_DSAPrivateKey_fp 833 826i2d_DSAPublicKey 834 EXIST::FUNCTION:DSA
827i2d_DSAPublicKey 834 827i2d_DSAparams 835 EXIST::FUNCTION:DSA
828i2d_DSAparams 835 828i2d_NETSCAPE_SPKAC 836 EXIST::FUNCTION:
829i2d_NETSCAPE_SPKAC 836 829i2d_NETSCAPE_SPKI 837 EXIST::FUNCTION:
830i2d_NETSCAPE_SPKI 837 830i2d_Netscape_RSA 838 EXIST::FUNCTION:RSA
831i2d_Netscape_RSA 838 831i2d_PKCS7 839 EXIST::FUNCTION:
832i2d_PKCS7 839 832i2d_PKCS7_DIGEST 840 EXIST::FUNCTION:
833i2d_PKCS7_DIGEST 840 833i2d_PKCS7_ENCRYPT 841 EXIST::FUNCTION:
834i2d_PKCS7_ENCRYPT 841 834i2d_PKCS7_ENC_CONTENT 842 EXIST::FUNCTION:
835i2d_PKCS7_ENC_CONTENT 842 835i2d_PKCS7_ENVELOPE 843 EXIST::FUNCTION:
836i2d_PKCS7_ENVELOPE 843 836i2d_PKCS7_ISSUER_AND_SERIAL 844 EXIST::FUNCTION:
837i2d_PKCS7_ISSUER_AND_SERIAL 844 837i2d_PKCS7_RECIP_INFO 845 EXIST::FUNCTION:
838i2d_PKCS7_RECIP_INFO 845 838i2d_PKCS7_SIGNED 846 EXIST::FUNCTION:
839i2d_PKCS7_SIGNED 846 839i2d_PKCS7_SIGNER_INFO 847 EXIST::FUNCTION:
840i2d_PKCS7_SIGNER_INFO 847 840i2d_PKCS7_SIGN_ENVELOPE 848 EXIST::FUNCTION:
841i2d_PKCS7_SIGN_ENVELOPE 848 841i2d_PKCS7_bio 849 EXIST::FUNCTION:
842i2d_PKCS7_bio 849 842i2d_PKCS7_fp 850 EXIST::FUNCTION:FP_API
843i2d_PKCS7_fp 850 843i2d_PrivateKey 851 EXIST::FUNCTION:
844i2d_PrivateKey 851 844i2d_PublicKey 852 EXIST::FUNCTION:
845i2d_PublicKey 852 845i2d_RSAPrivateKey 853 EXIST::FUNCTION:RSA
846i2d_RSAPrivateKey 853 846i2d_RSAPrivateKey_bio 854 EXIST::FUNCTION:RSA
847i2d_RSAPrivateKey_bio 854 847i2d_RSAPrivateKey_fp 855 EXIST::FUNCTION:RSA,FP_API
848i2d_RSAPrivateKey_fp 855 848i2d_RSAPublicKey 856 EXIST::FUNCTION:RSA
849i2d_RSAPublicKey 856 849i2d_X509 857 EXIST::FUNCTION:
850i2d_X509 857 850i2d_X509_ALGOR 858 EXIST::FUNCTION:
851i2d_X509_ALGOR 858 851i2d_X509_ATTRIBUTE 859 EXIST::FUNCTION:
852i2d_X509_ATTRIBUTE 859 852i2d_X509_CINF 860 EXIST::FUNCTION:
853i2d_X509_CINF 860 853i2d_X509_CRL 861 EXIST::FUNCTION:
854i2d_X509_CRL 861 854i2d_X509_CRL_INFO 862 EXIST::FUNCTION:
855i2d_X509_CRL_INFO 862 855i2d_X509_CRL_bio 863 EXIST::FUNCTION:
856i2d_X509_CRL_bio 863 856i2d_X509_CRL_fp 864 EXIST::FUNCTION:FP_API
857i2d_X509_CRL_fp 864 857i2d_X509_EXTENSION 865 EXIST::FUNCTION:
858i2d_X509_EXTENSION 865 858i2d_X509_NAME 866 EXIST::FUNCTION:
859i2d_X509_NAME 866 859i2d_X509_NAME_ENTRY 867 EXIST::FUNCTION:
860i2d_X509_NAME_ENTRY 867 860i2d_X509_PKEY 868 EXIST::FUNCTION:
861i2d_X509_PKEY 868 861i2d_X509_PUBKEY 869 EXIST::FUNCTION:
862i2d_X509_PUBKEY 869 862i2d_X509_REQ 870 EXIST::FUNCTION:
863i2d_X509_REQ 870 863i2d_X509_REQ_INFO 871 EXIST::FUNCTION:
864i2d_X509_REQ_INFO 871 864i2d_X509_REQ_bio 872 EXIST::FUNCTION:
865i2d_X509_REQ_bio 872 865i2d_X509_REQ_fp 873 EXIST::FUNCTION:FP_API
866i2d_X509_REQ_fp 873 866i2d_X509_REVOKED 874 EXIST::FUNCTION:
867i2d_X509_REVOKED 874 867i2d_X509_SIG 875 EXIST::FUNCTION:
868i2d_X509_SIG 875 868i2d_X509_VAL 876 EXIST::FUNCTION:
869i2d_X509_VAL 876 869i2d_X509_bio 877 EXIST::FUNCTION:
870i2d_X509_bio 877 870i2d_X509_fp 878 EXIST::FUNCTION:FP_API
871i2d_X509_fp 878 871idea_cbc_encrypt 879 EXIST::FUNCTION:IDEA
872idea_cbc_encrypt 879 872idea_cfb64_encrypt 880 EXIST::FUNCTION:IDEA
873idea_cfb64_encrypt 880 873idea_ecb_encrypt 881 EXIST::FUNCTION:IDEA
874idea_ecb_encrypt 881 874idea_encrypt 882 EXIST::FUNCTION:IDEA
875idea_encrypt 882 875idea_ofb64_encrypt 883 EXIST::FUNCTION:IDEA
876idea_ofb64_encrypt 883 876idea_options 884 EXIST::FUNCTION:IDEA
877idea_options 884 877idea_set_decrypt_key 885 EXIST::FUNCTION:IDEA
878idea_set_decrypt_key 885 878idea_set_encrypt_key 886 EXIST::FUNCTION:IDEA
879idea_set_encrypt_key 886 879lh_delete 887 EXIST::FUNCTION:
880lh_delete 887 880lh_doall 888 EXIST::FUNCTION:
881lh_doall 888 881lh_doall_arg 889 EXIST::FUNCTION:
882lh_doall_arg 889 882lh_free 890 EXIST::FUNCTION:
883lh_free 890 883lh_insert 891 EXIST::FUNCTION:
884lh_insert 891 884lh_new 892 EXIST::FUNCTION:
885lh_new 892 885lh_node_stats 893 EXIST::FUNCTION:FP_API
886lh_node_stats 893 886lh_node_stats_bio 894 EXIST::FUNCTION:
887lh_node_stats_bio 894 887lh_node_usage_stats 895 EXIST::FUNCTION:FP_API
888lh_node_usage_stats 895 888lh_node_usage_stats_bio 896 EXIST::FUNCTION:
889lh_node_usage_stats_bio 896 889lh_retrieve 897 EXIST::FUNCTION:
890lh_retrieve 897 890lh_stats 898 EXIST::FUNCTION:FP_API
891lh_stats 898 891lh_stats_bio 899 EXIST::FUNCTION:
892lh_stats_bio 899 892lh_strhash 900 EXIST::FUNCTION:
893lh_strhash 900 893sk_delete 901 EXIST::FUNCTION:
894sk_delete 901 894sk_delete_ptr 902 EXIST::FUNCTION:
895sk_delete_ptr 902 895sk_dup 903 EXIST::FUNCTION:
896sk_dup 903 896sk_find 904 EXIST::FUNCTION:
897sk_find 904 897sk_free 905 EXIST::FUNCTION:
898sk_free 905 898sk_insert 906 EXIST::FUNCTION:
899sk_insert 906 899sk_new 907 EXIST::FUNCTION:
900sk_new 907 900sk_pop 908 EXIST::FUNCTION:
901sk_pop 908 901sk_pop_free 909 EXIST::FUNCTION:
902sk_pop_free 909 902sk_push 910 EXIST::FUNCTION:
903sk_push 910 903sk_set_cmp_func 911 EXIST::FUNCTION:
904sk_set_cmp_func 911 904sk_shift 912 EXIST::FUNCTION:
905sk_shift 912 905sk_unshift 913 EXIST::FUNCTION:
906sk_unshift 913 906sk_zero 914 EXIST::FUNCTION:
907sk_zero 914 907BIO_f_nbio_test 915 EXIST::FUNCTION:
908BIO_f_nbio_test 915 908ASN1_TYPE_get 916 EXIST::FUNCTION:
909ASN1_TYPE_get 916 909ASN1_TYPE_set 917 EXIST::FUNCTION:
910ASN1_TYPE_set 917 910PKCS7_content_free 918 EXIST::FUNCTION:
911PKCS7_content_free 918 911ERR_load_PKCS7_strings 919 EXIST::FUNCTION:
912ERR_load_PKCS7_strings 919 912X509_find_by_issuer_and_serial 920 EXIST::FUNCTION:
913X509_find_by_issuer_and_serial 920 913X509_find_by_subject 921 EXIST::FUNCTION:
914X509_find_by_subject 921 914PKCS7_ctrl 927 EXIST::FUNCTION:
915PKCS7_ctrl 927 915PKCS7_set_type 928 EXIST::FUNCTION:
916PKCS7_set_type 928 916PKCS7_set_content 929 EXIST::FUNCTION:
917PKCS7_set_content 929 917PKCS7_SIGNER_INFO_set 930 EXIST::FUNCTION:
918PKCS7_SIGNER_INFO_set 930 918PKCS7_add_signer 931 EXIST::FUNCTION:
919PKCS7_add_signer 931 919PKCS7_add_certificate 932 EXIST::FUNCTION:
920PKCS7_add_certificate 932 920PKCS7_add_crl 933 EXIST::FUNCTION:
921PKCS7_add_crl 933 921PKCS7_content_new 934 EXIST::FUNCTION:
922PKCS7_content_new 934 922PKCS7_dataSign 935 NOEXIST::FUNCTION:
923PKCS7_dataSign 935 923PKCS7_dataVerify 936 EXIST::FUNCTION:
924PKCS7_dataVerify 936 924PKCS7_dataInit 937 EXIST::FUNCTION:
925PKCS7_dataInit 937 925PKCS7_add_signature 938 EXIST::FUNCTION:
926PKCS7_add_signature 938 926PKCS7_cert_from_signer_info 939 EXIST::FUNCTION:
927PKCS7_cert_from_signer_info 939 927PKCS7_get_signer_info 940 EXIST::FUNCTION:
928PKCS7_get_signer_info 940 928EVP_delete_alias 941 NOEXIST::FUNCTION:
929EVP_delete_alias 941 929EVP_mdc2 942 EXIST::FUNCTION:
930EVP_mdc2 942 930PEM_read_bio_RSAPublicKey 943 EXIST::FUNCTION:RSA
931PEM_read_bio_RSAPublicKey 943 931PEM_write_bio_RSAPublicKey 944 EXIST::FUNCTION:RSA
932PEM_write_bio_RSAPublicKey 944 932d2i_RSAPublicKey_bio 945 EXIST::FUNCTION:RSA
933d2i_RSAPublicKey_bio 945 933i2d_RSAPublicKey_bio 946 EXIST::FUNCTION:RSA
934i2d_RSAPublicKey_bio 946 934PEM_read_RSAPublicKey 947 EXIST:!WIN16:FUNCTION:RSA
935PEM_read_RSAPublicKey 947 935PEM_write_RSAPublicKey 949 EXIST:!WIN16:FUNCTION:RSA
936PEM_write_RSAPublicKey 949 936d2i_RSAPublicKey_fp 952 EXIST::FUNCTION:RSA,FP_API
937d2i_RSAPublicKey_fp 952 937i2d_RSAPublicKey_fp 954 EXIST::FUNCTION:RSA,FP_API
938i2d_RSAPublicKey_fp 954 938BIO_copy_next_retry 955 EXIST::FUNCTION:
939BIO_copy_next_retry 955 939RSA_flags 956 EXIST::FUNCTION:RSA
940RSA_flags 956 940X509_STORE_add_crl 957 EXIST::FUNCTION:
941X509_STORE_add_crl 957 941X509_load_crl_file 958 EXIST::FUNCTION:
942X509_load_crl_file 958 942EVP_rc2_40_cbc 959 EXIST::FUNCTION:RC2
943EVP_rc2_40_cbc 959 943EVP_rc4_40 960 EXIST::FUNCTION:RC4
944EVP_rc4_40 960 944EVP_CIPHER_CTX_init 961 EXIST::FUNCTION:
945EVP_CIPHER_CTX_init 961 945HMAC 962 EXIST::FUNCTION:HMAC
946HMAC 962 946HMAC_Init 963 EXIST::FUNCTION:HMAC
947HMAC_Init 963 947HMAC_Update 964 EXIST::FUNCTION:HMAC
948HMAC_Update 964 948HMAC_Final 965 EXIST::FUNCTION:HMAC
949HMAC_Final 965 949ERR_get_next_error_library 966 EXIST::FUNCTION:
950ERR_get_next_error_library 966 950EVP_PKEY_cmp_parameters 967 EXIST::FUNCTION:
951EVP_PKEY_cmp_parameters 967 951HMAC_cleanup 968 EXIST::FUNCTION:HMAC
952HMAC_cleanup 968 952BIO_ptr_ctrl 969 EXIST::FUNCTION:
953BIO_ptr_ctrl 969 953BIO_new_file_internal 970 EXIST:WIN16:FUNCTION:FP_API
954BIO_new_file_internal 970 954BIO_new_fp_internal 971 EXIST:WIN16:FUNCTION:FP_API
955BIO_new_fp_internal 971 955BIO_s_file_internal 972 EXIST:WIN16:FUNCTION:FP_API
956BIO_s_file_internal 972 956BN_BLINDING_convert 973 EXIST::FUNCTION:
957BN_BLINDING_convert 973 957BN_BLINDING_invert 974 EXIST::FUNCTION:
958BN_BLINDING_invert 974 958BN_BLINDING_update 975 EXIST::FUNCTION:
959BN_BLINDING_update 975 959RSA_blinding_on 977 EXIST::FUNCTION:RSA
960RSA_blinding_on 977 960RSA_blinding_off 978 EXIST::FUNCTION:RSA
961RSA_blinding_off 978 961i2t_ASN1_OBJECT 979 EXIST::FUNCTION:
962i2t_ASN1_OBJECT 979 962BN_BLINDING_new 980 EXIST::FUNCTION:
963BN_BLINDING_new 980 963BN_BLINDING_free 981 EXIST::FUNCTION:
964BN_BLINDING_free 981 964EVP_cast5_cbc 983 EXIST::FUNCTION:CAST
965EVP_cast5_cbc 983 965EVP_cast5_cfb 984 EXIST::FUNCTION:CAST
966EVP_cast5_cfb 984 966EVP_cast5_ecb 985 EXIST::FUNCTION:CAST
967EVP_cast5_ecb 985 967EVP_cast5_ofb 986 EXIST::FUNCTION:CAST
968EVP_cast5_ofb 986 968BF_decrypt 987 EXIST::FUNCTION:BF
969BF_decrypt 987 969CAST_set_key 988 EXIST::FUNCTION:CAST
970CAST_set_key 988 970CAST_encrypt 989 EXIST::FUNCTION:CAST
971CAST_encrypt 989 971CAST_decrypt 990 EXIST::FUNCTION:CAST
972CAST_decrypt 990 972CAST_ecb_encrypt 991 EXIST::FUNCTION:CAST
973CAST_ecb_encrypt 991 973CAST_cbc_encrypt 992 EXIST::FUNCTION:CAST
974CAST_cbc_encrypt 992 974CAST_cfb64_encrypt 993 EXIST::FUNCTION:CAST
975CAST_cfb64_encrypt 993 975CAST_ofb64_encrypt 994 EXIST::FUNCTION:CAST
976CAST_ofb64_encrypt 994 976RC2_decrypt 995 EXIST::FUNCTION:RC2
977RC2_decrypt 995 977OBJ_create_objects 997 EXIST::FUNCTION:
978OBJ_create_objects 997 978BN_exp 998 EXIST::FUNCTION:
979BN_exp 998 979BN_mul_word 999 EXIST::FUNCTION:
980BN_mul_word 999 980BN_sub_word 1000 EXIST::FUNCTION:
981BN_sub_word 1000 981BN_dec2bn 1001 EXIST::FUNCTION:
982BN_dec2bn 1001 982BN_bn2dec 1002 EXIST::FUNCTION:
983BN_bn2dec 1002 983BIO_ghbn_ctrl 1003 EXIST::FUNCTION:
984BIO_ghbn_ctrl 1003 984CRYPTO_free_ex_data 1004 EXIST::FUNCTION:
985CRYPTO_free_ex_data 1004 985CRYPTO_get_ex_data 1005 EXIST::FUNCTION:
986CRYPTO_get_ex_data 1005 986CRYPTO_set_ex_data 1007 EXIST::FUNCTION:
987CRYPTO_set_ex_data 1007 987ERR_load_CRYPTO_strings 1009 EXIST:!WIN16,!VMS:FUNCTION:
988ERR_load_CRYPTO_strings 1009 988ERR_load_CRYPTOlib_strings 1009 EXIST:WIN16,VMS:FUNCTION:
989ERR_load_CRYPTOlib_strings 1009 989EVP_PKEY_bits 1010 EXIST::FUNCTION:
990EVP_PKEY_bits 1010 990MD5_Transform 1011 EXIST::FUNCTION:MD5
991MD5_Transform 1011 991SHA1_Transform 1012 EXIST::FUNCTION:SHA
992SHA1_Transform 1012 992SHA_Transform 1013 EXIST::FUNCTION:SHA
993SHA_Transform 1013 993X509_STORE_CTX_get_chain 1014 EXIST::FUNCTION:
994X509_STORE_CTX_get_chain 1014 994X509_STORE_CTX_get_current_cert 1015 EXIST::FUNCTION:
995X509_STORE_CTX_get_current_cert 1015 995X509_STORE_CTX_get_error 1016 EXIST::FUNCTION:
996X509_STORE_CTX_get_error 1016 996X509_STORE_CTX_get_error_depth 1017 EXIST::FUNCTION:
997X509_STORE_CTX_get_error_depth 1017 997X509_STORE_CTX_get_ex_data 1018 EXIST::FUNCTION:
998X509_STORE_CTX_get_ex_data 1018 998X509_STORE_CTX_set_cert 1020 EXIST::FUNCTION:
999X509_STORE_CTX_set_cert 1020 999X509_STORE_CTX_set_chain 1021 EXIST::FUNCTION:
1000X509_STORE_CTX_set_chain 1021 1000X509_STORE_CTX_set_error 1022 EXIST::FUNCTION:
1001X509_STORE_CTX_set_error 1022 1001X509_STORE_CTX_set_ex_data 1023 EXIST::FUNCTION:
1002X509_STORE_CTX_set_ex_data 1023 1002CRYPTO_dup_ex_data 1025 EXIST::FUNCTION:
1003CRYPTO_dup_ex_data 1025 1003CRYPTO_get_new_lockid 1026 EXIST::FUNCTION:
1004CRYPTO_get_new_lockid 1026 1004CRYPTO_new_ex_data 1027 EXIST::FUNCTION:
1005CRYPTO_new_ex_data 1027 1005RSA_set_ex_data 1028 EXIST::FUNCTION:RSA
1006RSA_set_ex_data 1028 1006RSA_get_ex_data 1029 EXIST::FUNCTION:RSA
1007RSA_get_ex_data 1029 1007RSA_get_ex_new_index 1030 EXIST::FUNCTION:RSA
1008RSA_get_ex_new_index 1030 1008RSA_padding_add_PKCS1_type_1 1031 EXIST::FUNCTION:RSA
1009RSA_padding_add_PKCS1_type_1 1031 1009RSA_padding_add_PKCS1_type_2 1032 EXIST::FUNCTION:RSA
1010RSA_padding_add_PKCS1_type_2 1032 1010RSA_padding_add_SSLv23 1033 EXIST::FUNCTION:RSA
1011RSA_padding_add_SSLv23 1033 1011RSA_padding_add_none 1034 EXIST::FUNCTION:RSA
1012RSA_padding_add_none 1034 1012RSA_padding_check_PKCS1_type_1 1035 EXIST::FUNCTION:RSA
1013RSA_padding_check_PKCS1_type_1 1035 1013RSA_padding_check_PKCS1_type_2 1036 EXIST::FUNCTION:RSA
1014RSA_padding_check_PKCS1_type_2 1036 1014RSA_padding_check_SSLv23 1037 EXIST::FUNCTION:RSA
1015RSA_padding_check_SSLv23 1037 1015RSA_padding_check_none 1038 EXIST::FUNCTION:RSA
1016RSA_padding_check_none 1038 1016bn_add_words 1039 EXIST::FUNCTION:
1017bn_add_words 1039 1017d2i_Netscape_RSA_2 1040 EXIST::FUNCTION:RSA
1018d2i_Netscape_RSA_2 1040 1018CRYPTO_get_ex_new_index 1041 EXIST::FUNCTION:
1019CRYPTO_get_ex_new_index 1041 1019RIPEMD160_Init 1042 EXIST::FUNCTION:RIPEMD
1020RIPEMD160_Init 1042 1020RIPEMD160_Update 1043 EXIST::FUNCTION:RIPEMD
1021RIPEMD160_Update 1043 1021RIPEMD160_Final 1044 EXIST::FUNCTION:RIPEMD
1022RIPEMD160_Final 1044 1022RIPEMD160 1045 EXIST::FUNCTION:RIPEMD
1023RIPEMD160 1045 1023RIPEMD160_Transform 1046 EXIST::FUNCTION:RIPEMD
1024RIPEMD160_Transform 1046 1024RC5_32_set_key 1047 EXIST::FUNCTION:RC5
1025RC5_32_set_key 1047 1025RC5_32_ecb_encrypt 1048 EXIST::FUNCTION:RC5
1026RC5_32_ecb_encrypt 1048 1026RC5_32_encrypt 1049 EXIST::FUNCTION:RC5
1027RC5_32_encrypt 1049 1027RC5_32_decrypt 1050 EXIST::FUNCTION:RC5
1028RC5_32_decrypt 1050 1028RC5_32_cbc_encrypt 1051 EXIST::FUNCTION:RC5
1029RC5_32_cbc_encrypt 1051 1029RC5_32_cfb64_encrypt 1052 EXIST::FUNCTION:RC5
1030RC5_32_cfb64_encrypt 1052 1030RC5_32_ofb64_encrypt 1053 EXIST::FUNCTION:RC5
1031RC5_32_ofb64_encrypt 1053 1031BN_bn2mpi 1058 EXIST::FUNCTION:
1032BN_bn2mpi 1058 1032BN_mpi2bn 1059 EXIST::FUNCTION:
1033BN_mpi2bn 1059 1033ASN1_BIT_STRING_get_bit 1060 EXIST::FUNCTION:
1034ASN1_BIT_STRING_get_bit 1060 1034ASN1_BIT_STRING_set_bit 1061 EXIST::FUNCTION:
1035ASN1_BIT_STRING_set_bit 1061 1035BIO_get_ex_data 1062 EXIST::FUNCTION:
1036BIO_get_ex_data 1062 1036BIO_get_ex_new_index 1063 EXIST::FUNCTION:
1037BIO_get_ex_new_index 1063 1037BIO_set_ex_data 1064 EXIST::FUNCTION:
1038BIO_set_ex_data 1064 1038X509v3_get_key_usage 1066 NOEXIST::FUNCTION:
1039X509_STORE_CTX_get_ex_new_index 1065 1039X509v3_set_key_usage 1067 NOEXIST::FUNCTION:
1040X509v3_get_key_usage 1066 1040a2i_X509v3_key_usage 1068 NOEXIST::FUNCTION:
1041X509v3_set_key_usage 1067 1041i2a_X509v3_key_usage 1069 NOEXIST::FUNCTION:
1042a2i_X509v3_key_usage 1068 1042EVP_PKEY_decrypt 1070 EXIST::FUNCTION:
1043i2a_X509v3_key_usage 1069 1043EVP_PKEY_encrypt 1071 EXIST::FUNCTION:
1044EVP_PKEY_decrypt 1070 1044PKCS7_RECIP_INFO_set 1072 EXIST::FUNCTION:
1045EVP_PKEY_encrypt 1071 1045PKCS7_add_recipient 1073 EXIST::FUNCTION:
1046PKCS7_RECIP_INFO_set 1072 1046PKCS7_add_recipient_info 1074 EXIST::FUNCTION:
1047PKCS7_add_recipient 1073 1047PKCS7_set_cipher 1075 EXIST::FUNCTION:
1048PKCS7_add_recipient_info 1074 1048ASN1_TYPE_get_int_octetstring 1076 EXIST::FUNCTION:
1049PKCS7_set_cipher 1075 1049ASN1_TYPE_get_octetstring 1077 EXIST::FUNCTION:
1050ASN1_TYPE_get_int_octetstring 1076 1050ASN1_TYPE_set_int_octetstring 1078 EXIST::FUNCTION:
1051ASN1_TYPE_get_octetstring 1077 1051ASN1_TYPE_set_octetstring 1079 EXIST::FUNCTION:
1052ASN1_TYPE_set_int_octetstring 1078 1052ASN1_UTCTIME_set_string 1080 EXIST::FUNCTION:
1053ASN1_TYPE_set_octetstring 1079 1053ERR_add_error_data 1081 EXIST::FUNCTION:
1054ASN1_UTCTIME_set_string 1080 1054ERR_set_error_data 1082 EXIST::FUNCTION:
1055ERR_add_error_data 1081 1055EVP_CIPHER_asn1_to_param 1083 EXIST::FUNCTION:
1056ERR_set_error_data 1082 1056EVP_CIPHER_param_to_asn1 1084 EXIST::FUNCTION:
1057EVP_CIPHER_asn1_to_param 1083 1057EVP_CIPHER_get_asn1_iv 1085 EXIST::FUNCTION:
1058EVP_CIPHER_param_to_asn1 1084 1058EVP_CIPHER_set_asn1_iv 1086 EXIST::FUNCTION:
1059EVP_CIPHER_get_asn1_iv 1085 1059EVP_rc5_32_12_16_cbc 1087 EXIST::FUNCTION:RC5
1060EVP_CIPHER_set_asn1_iv 1086 1060EVP_rc5_32_12_16_cfb 1088 EXIST::FUNCTION:RC5
1061EVP_rc5_32_12_16_cbc 1087 1061EVP_rc5_32_12_16_ecb 1089 EXIST::FUNCTION:RC5
1062EVP_rc5_32_12_16_cfb 1088 1062EVP_rc5_32_12_16_ofb 1090 EXIST::FUNCTION:RC5
1063EVP_rc5_32_12_16_ecb 1089 1063asn1_add_error 1091 EXIST::FUNCTION:
1064EVP_rc5_32_12_16_ofb 1090 1064d2i_ASN1_BMPSTRING 1092 EXIST::FUNCTION:
1065asn1_add_error 1091 1065i2d_ASN1_BMPSTRING 1093 EXIST::FUNCTION:
1066d2i_ASN1_BMPSTRING 1092 1066BIO_f_ber 1094 NOEXIST::FUNCTION:
1067i2d_ASN1_BMPSTRING 1093 1067BN_init 1095 EXIST::FUNCTION:
1068BIO_f_ber 1094 1068COMP_CTX_new 1096 EXIST::FUNCTION:
1069BN_init 1095 1069COMP_CTX_free 1097 EXIST::FUNCTION:
1070COMP_CTX_new 1096 1070COMP_CTX_compress_block 1098 NOEXIST::FUNCTION:
1071COMP_CTX_free 1097 1071COMP_CTX_expand_block 1099 NOEXIST::FUNCTION:
1072COMP_CTX_compress_block 1098 1072X509_STORE_CTX_get_ex_new_index 1100 EXIST::FUNCTION:
1073COMP_CTX_expand_block 1099 1073OBJ_NAME_add 1101 EXIST::FUNCTION:
1074X509_STORE_CTX_get_ex_new_index 1100 1074BIO_socket_nbio 1102 EXIST::FUNCTION:
1075OBJ_NAME_add 1101 1075EVP_rc2_64_cbc 1103 EXIST::FUNCTION:RC2
1076BIO_socket_nbio 1102 1076OBJ_NAME_cleanup 1104 EXIST::FUNCTION:
1077EVP_rc2_64_cbc 1103 1077OBJ_NAME_get 1105 EXIST::FUNCTION:
1078OBJ_NAME_cleanup 1104 1078OBJ_NAME_init 1106 EXIST::FUNCTION:
1079OBJ_NAME_get 1105 1079OBJ_NAME_new_index 1107 EXIST::FUNCTION:
1080OBJ_NAME_init 1106 1080OBJ_NAME_remove 1108 EXIST::FUNCTION:
1081OBJ_NAME_new_index 1107 1081BN_MONT_CTX_copy 1109 EXIST::FUNCTION:
1082OBJ_NAME_remove 1108 1082BIO_new_socks4a_connect 1110 NOEXIST::FUNCTION:
1083BN_MONT_CTX_copy 1109 1083BIO_s_socks4a_connect 1111 NOEXIST::FUNCTION:
1084BIO_new_socks4a_connect 1110 1084PROXY_set_connect_mode 1112 NOEXIST::FUNCTION:
1085BIO_s_socks4a_connect 1111 1085RAND_SSLeay 1113 EXIST::FUNCTION:
1086PROXY_set_connect_mode 1112 1086RAND_set_rand_method 1114 EXIST::FUNCTION:
1087RAND_SSLeay 1113 1087RSA_memory_lock 1115 EXIST::FUNCTION:RSA
1088RAND_set_rand_method 1114 1088bn_sub_words 1116 EXIST::FUNCTION:
1089RSA_memory_lock 1115 1089bn_mul_normal 1117 NOEXIST::FUNCTION:
1090bn_sub_words 1116 1090bn_mul_comba8 1118 NOEXIST::FUNCTION:
1091bn_mul_normal 1117 1091bn_mul_comba4 1119 NOEXIST::FUNCTION:
1092bn_mul_comba8 1118 1092bn_sqr_normal 1120 NOEXIST::FUNCTION:
1093bn_mul_comba4 1119 1093bn_sqr_comba8 1121 NOEXIST::FUNCTION:
1094bn_sqr_normal 1120 1094bn_sqr_comba4 1122 NOEXIST::FUNCTION:
1095bn_sqr_comba8 1121 1095bn_cmp_words 1123 NOEXIST::FUNCTION:
1096bn_sqr_comba4 1122 1096bn_mul_recursive 1124 NOEXIST::FUNCTION:
1097bn_cmp_words 1123 1097bn_mul_part_recursive 1125 NOEXIST::FUNCTION:
1098bn_mul_recursive 1124 1098bn_sqr_recursive 1126 NOEXIST::FUNCTION:
1099bn_mul_part_recursive 1125 1099bn_mul_low_normal 1127 NOEXIST::FUNCTION:
1100bn_sqr_recursive 1126 1100BN_RECP_CTX_init 1128 EXIST::FUNCTION:
1101bn_mul_low_normal 1127 1101BN_RECP_CTX_new 1129 EXIST::FUNCTION:
1102BN_RECP_CTX_init 1128 1102BN_RECP_CTX_free 1130 EXIST::FUNCTION:
1103BN_RECP_CTX_new 1129 1103BN_RECP_CTX_set 1131 EXIST::FUNCTION:
1104BN_RECP_CTX_free 1130 1104BN_mod_mul_reciprocal 1132 EXIST::FUNCTION:
1105BN_RECP_CTX_set 1131 1105BN_mod_exp_recp 1133 EXIST::FUNCTION:
1106BN_mod_mul_reciprocal 1132 1106BN_div_recp 1134 EXIST::FUNCTION:
1107BN_mod_exp_recp 1133 1107BN_CTX_init 1135 EXIST::FUNCTION:
1108BN_div_recp 1134 1108BN_MONT_CTX_init 1136 EXIST::FUNCTION:
1109BN_CTX_init 1135 1109RAND_get_rand_method 1137 EXIST::FUNCTION:
1110BN_MONT_CTX_init 1136 1110PKCS7_add_attribute 1138 EXIST::FUNCTION:
1111RAND_get_rand_method 1137 1111PKCS7_add_signed_attribute 1139 EXIST::FUNCTION:
1112PKCS7_add_attribute 1138 1112PKCS7_digest_from_attributes 1140 EXIST::FUNCTION:
1113PKCS7_add_signed_attribute 1139 1113PKCS7_get_attribute 1141 EXIST::FUNCTION:
1114PKCS7_digest_from_attributes 1140 1114PKCS7_get_issuer_and_serial 1142 EXIST::FUNCTION:
1115PKCS7_get_attribute 1141 1115PKCS7_get_signed_attribute 1143 EXIST::FUNCTION:
1116PKCS7_get_issuer_and_serial 1142 1116COMP_compress_block 1144 EXIST::FUNCTION:
1117PKCS7_get_signed_attribute 1143 1117COMP_expand_block 1145 EXIST::FUNCTION:
1118COMP_compress_block 1144 1118COMP_rle 1146 EXIST::FUNCTION:
1119COMP_expand_block 1145 1119COMP_zlib 1147 EXIST::FUNCTION:
1120COMP_rle 1146 1120ms_time_diff 1148 EXIST::FUNCTION:
1121COMP_zlib 1147 1121ms_time_new 1149 EXIST::FUNCTION:
1122ms_time_diff 1148 1122ms_time_free 1150 EXIST::FUNCTION:
1123ms_time_new 1149 1123ms_time_cmp 1151 EXIST::FUNCTION:
1124ms_time_free 1150 1124ms_time_get 1152 EXIST::FUNCTION:
1125ms_time_cmp 1151 1125PKCS7_set_attributes 1153 EXIST::FUNCTION:
1126ms_time_get 1152 1126PKCS7_set_signed_attributes 1154 EXIST::FUNCTION:
1127PKCS7_set_attributes 1153 1127X509_ATTRIBUTE_create 1155 EXIST::FUNCTION:
1128PKCS7_set_signed_attributes 1154 1128X509_ATTRIBUTE_dup 1156 EXIST::FUNCTION:
1129X509_ATTRIBUTE_create 1155 1129ASN1_GENERALIZEDTIME_check 1157 EXIST::FUNCTION:
1130X509_ATTRIBUTE_dup 1156 1130ASN1_GENERALIZEDTIME_print 1158 EXIST::FUNCTION:
1131ASN1_GENERALIZEDTIME_check 1157 1131ASN1_GENERALIZEDTIME_set 1159 EXIST::FUNCTION:
1132ASN1_GENERALIZEDTIME_print 1158 1132ASN1_GENERALIZEDTIME_set_string 1160 EXIST::FUNCTION:
1133ASN1_GENERALIZEDTIME_set 1159 1133ASN1_TIME_print 1161 EXIST::FUNCTION:
1134ASN1_GENERALIZEDTIME_set_string 1160 1134BASIC_CONSTRAINTS_free 1162 EXIST::FUNCTION:
1135ASN1_TIME_print 1161 1135BASIC_CONSTRAINTS_new 1163 EXIST::FUNCTION:
1136BASIC_CONSTRAINTS_free 1162 1136ERR_load_X509V3_strings 1164 EXIST::FUNCTION:
1137BASIC_CONSTRAINTS_new 1163 1137NETSCAPE_CERT_SEQUENCE_free 1165 EXIST::FUNCTION:
1138ERR_load_X509V3_strings 1164 1138NETSCAPE_CERT_SEQUENCE_new 1166 EXIST::FUNCTION:
1139NETSCAPE_CERT_SEQUENCE_free 1165 1139OBJ_txt2obj 1167 EXIST::FUNCTION:
1140NETSCAPE_CERT_SEQUENCE_new 1166 1140PEM_read_NETSCAPE_CERT_SEQUENCE 1168 EXIST:!WIN16:FUNCTION:
1141OBJ_txt2obj 1167 1141PEM_read_bio_NETSCAPE_CERT_SEQUENCE 1169 EXIST::FUNCTION:
1142PEM_read_NETSCAPE_CERT_SEQUENCE 1168 1142PEM_write_NETSCAPE_CERT_SEQUENCE 1170 EXIST:!WIN16:FUNCTION:
1143PEM_read_bio_NETSCAPE_CERT_SEQUENCE 1169 1143PEM_write_bio_NETSCAPE_CERT_SEQUENCE 1171 EXIST::FUNCTION:
1144PEM_write_NETSCAPE_CERT_SEQUENCE 1170 1144X509V3_EXT_add 1172 EXIST::FUNCTION:
1145PEM_write_bio_NETSCAPE_CERT_SEQUENCE 1171 1145X509V3_EXT_add_alias 1173 EXIST::FUNCTION:
1146X509V3_EXT_add 1172 1146X509V3_EXT_add_conf 1174 EXIST::FUNCTION:
1147X509V3_EXT_add_alias 1173 1147X509V3_EXT_cleanup 1175 EXIST::FUNCTION:
1148X509V3_EXT_add_conf 1174 1148X509V3_EXT_conf 1176 EXIST::FUNCTION:
1149X509V3_EXT_cleanup 1175 1149X509V3_EXT_conf_nid 1177 EXIST::FUNCTION:
1150X509V3_EXT_conf 1176 1150X509V3_EXT_get 1178 EXIST::FUNCTION:
1151X509V3_EXT_conf_nid 1177 1151X509V3_EXT_get_nid 1179 EXIST::FUNCTION:
1152X509V3_EXT_get 1178 1152X509V3_EXT_print 1180 EXIST::FUNCTION:
1153X509V3_EXT_get_nid 1179 1153X509V3_EXT_print_fp 1181 EXIST::FUNCTION:
1154X509V3_EXT_print 1180 1154X509V3_add_standard_extensions 1182 EXIST::FUNCTION:
1155X509V3_EXT_print_fp 1181 1155X509V3_add_value 1183 EXIST::FUNCTION:
1156X509V3_add_standard_extensions 1182 1156X509V3_add_value_bool 1184 EXIST::FUNCTION:
1157X509V3_add_value 1183 1157X509V3_add_value_int 1185 EXIST::FUNCTION:
1158X509V3_add_value_bool 1184 1158X509V3_conf_free 1186 EXIST::FUNCTION:
1159X509V3_add_value_int 1185 1159X509V3_get_value_bool 1187 EXIST::FUNCTION:
1160X509V3_conf_free 1186 1160X509V3_get_value_int 1188 EXIST::FUNCTION:
1161X509V3_get_value_bool 1187 1161X509V3_parse_list 1189 EXIST::FUNCTION:
1162X509V3_get_value_int 1188 1162d2i_ASN1_GENERALIZEDTIME 1190 EXIST::FUNCTION:
1163X509V3_parse_list 1189 1163d2i_ASN1_TIME 1191 EXIST::FUNCTION:
1164d2i_ASN1_GENERALIZEDTIME 1190 1164d2i_BASIC_CONSTRAINTS 1192 EXIST::FUNCTION:
1165d2i_ASN1_TIME 1191 1165d2i_NETSCAPE_CERT_SEQUENCE 1193 EXIST::FUNCTION:
1166d2i_BASIC_CONSTRAINTS 1192 1166d2i_ext_ku 1194 EXIST::FUNCTION:
1167d2i_NETSCAPE_CERT_SEQUENCE 1193 1167ext_ku_free 1195 EXIST::FUNCTION:
1168d2i_ext_ku 1194 1168ext_ku_new 1196 EXIST::FUNCTION:
1169ext_ku_free 1195 1169i2d_ASN1_GENERALIZEDTIME 1197 EXIST::FUNCTION:
1170ext_ku_new 1196 1170i2d_ASN1_TIME 1198 EXIST::FUNCTION:
1171i2d_ASN1_GENERALIZEDTIME 1197 1171i2d_BASIC_CONSTRAINTS 1199 EXIST::FUNCTION:
1172i2d_ASN1_TIME 1198 1172i2d_NETSCAPE_CERT_SEQUENCE 1200 EXIST::FUNCTION:
1173i2d_BASIC_CONSTRAINTS 1199 1173i2d_ext_ku 1201 EXIST::FUNCTION:
1174i2d_NETSCAPE_CERT_SEQUENCE 1200 1174EVP_MD_CTX_copy 1202 EXIST::FUNCTION:
1175i2d_ext_ku 1201 1175i2d_ASN1_ENUMERATED 1203 EXIST::FUNCTION:
1176EVP_MD_CTX_copy 1202 1176d2i_ASN1_ENUMERATED 1204 EXIST::FUNCTION:
1177i2d_ASN1_ENUMERATED 1203 1177ASN1_ENUMERATED_set 1205 EXIST::FUNCTION:
1178d2i_ASN1_ENUMERATED 1204 1178ASN1_ENUMERATED_get 1206 EXIST::FUNCTION:
1179ASN1_ENUMERATED_set 1205 1179BN_to_ASN1_ENUMERATED 1207 EXIST::FUNCTION:
1180ASN1_ENUMERATED_get 1206 1180ASN1_ENUMERATED_to_BN 1208 EXIST::FUNCTION:
1181BN_to_ASN1_ENUMERATED 1207 1181i2a_ASN1_ENUMERATED 1209 EXIST::FUNCTION:
1182ASN1_ENUMERATED_to_BN 1208 1182a2i_ASN1_ENUMERATED 1210 EXIST::FUNCTION:
1183i2a_ASN1_ENUMERATED 1209 1183i2d_GENERAL_NAME 1211 EXIST::FUNCTION:
1184a2i_ASN1_ENUMERATED 1210 1184d2i_GENERAL_NAME 1212 EXIST::FUNCTION:
1185i2d_GENERAL_NAME 1211 1185GENERAL_NAME_new 1213 EXIST::FUNCTION:
1186d2i_GENERAL_NAME 1212 1186GENERAL_NAME_free 1214 EXIST::FUNCTION:
1187GENERAL_NAME_new 1213 1187GENERAL_NAMES_new 1215 EXIST::FUNCTION:
1188GENERAL_NAME_free 1214 1188GENERAL_NAMES_free 1216 EXIST::FUNCTION:
1189GENERAL_NAMES_new 1215 1189d2i_GENERAL_NAMES 1217 EXIST::FUNCTION:
1190GENERAL_NAMES_free 1216 1190i2d_GENERAL_NAMES 1218 EXIST::FUNCTION:
1191d2i_GENERAL_NAMES 1217 1191i2v_GENERAL_NAMES 1219 EXIST::FUNCTION:
1192i2d_GENERAL_NAMES 1218 1192i2s_ASN1_OCTET_STRING 1220 EXIST::FUNCTION:
1193i2v_GENERAL_NAMES 1219 1193s2i_ASN1_OCTET_STRING 1221 EXIST::FUNCTION:
1194i2s_ASN1_OCTET_STRING 1220 1194X509V3_EXT_check_conf 1222 NOEXIST::FUNCTION:
1195s2i_ASN1_OCTET_STRING 1221 1195hex_to_string 1223 EXIST::FUNCTION:
1196X509V3_EXT_check_conf 1222 1196string_to_hex 1224 EXIST::FUNCTION:
1197hex_to_string 1223 1197des_ede3_cbcm_encrypt 1225 EXIST::FUNCTION:DES
1198string_to_hex 1224 1198RSA_padding_add_PKCS1_OAEP 1226 EXIST::FUNCTION:RSA
1199des_ede3_cbcm_encrypt 1225 1199RSA_padding_check_PKCS1_OAEP 1227 EXIST::FUNCTION:RSA
1200RSA_padding_add_PKCS1_OAEP 1226 1200X509_CRL_print_fp 1228 EXIST::FUNCTION:FP_API
1201RSA_padding_check_PKCS1_OAEP 1227 1201X509_CRL_print 1229 EXIST::FUNCTION:
1202X509_CRL_print_fp 1228 1202i2v_GENERAL_NAME 1230 EXIST::FUNCTION:
1203X509_CRL_print 1229 1203v2i_GENERAL_NAME 1231 EXIST::FUNCTION:
1204i2v_GENERAL_NAME 1230 1204i2d_PKEY_USAGE_PERIOD 1232 EXIST::FUNCTION:
1205v2i_GENERAL_NAME 1231 1205d2i_PKEY_USAGE_PERIOD 1233 EXIST::FUNCTION:
1206i2d_PKEY_USAGE_PERIOD 1232 1206PKEY_USAGE_PERIOD_new 1234 EXIST::FUNCTION:
1207d2i_PKEY_USAGE_PERIOD 1233 1207PKEY_USAGE_PERIOD_free 1235 EXIST::FUNCTION:
1208PKEY_USAGE_PERIOD_new 1234 1208v2i_GENERAL_NAMES 1236 EXIST::FUNCTION:
1209PKEY_USAGE_PERIOD_free 1235 1209i2s_ASN1_INTEGER 1237 EXIST::FUNCTION:
1210v2i_GENERAL_NAMES 1236 1210X509V3_EXT_d2i 1238 EXIST::FUNCTION:
1211i2s_ASN1_INTEGER 1237 1211name_cmp 1239 EXIST::FUNCTION:
1212X509V3_EXT_d2i 1238 1212str_dup 1240 NOEXIST::FUNCTION:
1213name_cmp 1239 1213i2s_ASN1_ENUMERATED 1241 EXIST::FUNCTION:
1214str_dup 1240 1214i2s_ASN1_ENUMERATED_TABLE 1242 EXIST::FUNCTION:
1215i2s_ASN1_ENUMERATED 1241 1215BIO_s_log 1243 EXIST:!WIN32,!WIN16,!macintosh:FUNCTION:
1216i2s_ASN1_ENUMERATED_TABLE 1242 1216BIO_f_reliable 1244 EXIST::FUNCTION:
1217BIO_s_log 1243 1217PKCS7_dataFinal 1245 EXIST::FUNCTION:
1218BIO_f_reliable 1244 1218PKCS7_dataDecode 1246 EXIST::FUNCTION:
1219PKCS7_dataFinal 1245 1219X509V3_EXT_CRL_add_conf 1247 EXIST::FUNCTION:
1220PKCS7_dataDecode 1246 1220BN_set_params 1248 EXIST::FUNCTION:
1221X509V3_EXT_CRL_add_conf 1247 1221BN_get_params 1249 EXIST::FUNCTION:
1222BN_set_params 1248 1222BIO_get_ex_num 1250 NOEXIST::FUNCTION:
1223BN_get_params 1249 1223BIO_set_ex_free_func 1251 NOEXIST::FUNCTION:
1224BIO_get_ex_num 1250 1224EVP_ripemd160 1252 EXIST::FUNCTION:RIPEMD
1225BIO_set_ex_free_func 1251 1225ASN1_TIME_set 1253 EXIST::FUNCTION:
1226EVP_ripemd160 1252 1226i2d_AUTHORITY_KEYID 1254 EXIST::FUNCTION:
1227ASN1_TIME_set 1253 1227d2i_AUTHORITY_KEYID 1255 EXIST::FUNCTION:
1228i2d_AUTHORITY_KEYID 1254 1228AUTHORITY_KEYID_new 1256 EXIST::FUNCTION:
1229d2i_AUTHORITY_KEYID 1255 1229AUTHORITY_KEYID_free 1257 EXIST::FUNCTION:
1230AUTHORITY_KEYID_new 1256 1230ASN1_seq_unpack 1258 EXIST::FUNCTION:
1231AUTHORITY_KEYID_free 1257 1231ASN1_seq_pack 1259 EXIST::FUNCTION:
1232ASN1_seq_unpack 1258 1232ASN1_unpack_string 1260 EXIST::FUNCTION:
1233ASN1_seq_pack 1259 1233ASN1_pack_string 1261 EXIST::FUNCTION:
1234ASN1_unpack_string 1260 1234PKCS12_pack_safebag 1262 EXIST::FUNCTION:
1235ASN1_pack_string 1261 1235PKCS12_MAKE_KEYBAG 1263 EXIST::FUNCTION:
1236PKCS12_pack_safebag 1262 1236PKCS8_encrypt 1264 EXIST::FUNCTION:
1237PKCS12_MAKE_KEYBAG 1263 1237PKCS12_MAKE_SHKEYBAG 1265 EXIST::FUNCTION:
1238PKCS8_encrypt 1264 1238PKCS12_pack_p7data 1266 EXIST::FUNCTION:
1239PKCS12_MAKE_SHKEYBAG 1265 1239PKCS12_pack_p7encdata 1267 EXIST::FUNCTION:
1240PKCS12_pack_p7data 1266 1240PKCS12_add_localkeyid 1268 EXIST::FUNCTION:
1241PKCS12_pack_p7encdata 1267 1241PKCS12_add_friendlyname_asc 1269 EXIST::FUNCTION:
1242PKCS12_add_localkeyid 1268 1242PKCS12_add_friendlyname_uni 1270 EXIST::FUNCTION:
1243PKCS12_add_friendlyname_asc 1269 1243PKCS12_get_friendlyname 1271 EXIST::FUNCTION:
1244PKCS12_add_friendlyname_uni 1270 1244PKCS12_pbe_crypt 1272 EXIST::FUNCTION:
1245PKCS12_get_friendlyname 1271 1245PKCS12_decrypt_d2i 1273 EXIST::FUNCTION:
1246PKCS12_pbe_crypt 1272 1246PKCS12_i2d_encrypt 1274 EXIST::FUNCTION:
1247PKCS12_decrypt_d2i 1273 1247PKCS12_init 1275 EXIST::FUNCTION:
1248PKCS12_i2d_encrypt 1274 1248PKCS12_key_gen_asc 1276 EXIST::FUNCTION:
1249PKCS12_init 1275 1249PKCS12_key_gen_uni 1277 EXIST::FUNCTION:
1250PKCS12_key_gen_asc 1276 1250PKCS12_gen_mac 1278 EXIST::FUNCTION:
1251PKCS12_key_gen_uni 1277 1251PKCS12_verify_mac 1279 EXIST::FUNCTION:
1252PKCS12_gen_mac 1278 1252PKCS12_set_mac 1280 EXIST::FUNCTION:
1253PKCS12_verify_mac 1279 1253PKCS12_setup_mac 1281 EXIST::FUNCTION:
1254PKCS12_set_mac 1280 1254asc2uni 1282 EXIST::FUNCTION:
1255PKCS12_setup_mac 1281 1255uni2asc 1283 EXIST::FUNCTION:
1256asc2uni 1282 1256i2d_PKCS12_BAGS 1284 EXIST::FUNCTION:
1257uni2asc 1283 1257PKCS12_BAGS_new 1285 EXIST::FUNCTION:
1258i2d_PKCS12_BAGS 1284 1258d2i_PKCS12_BAGS 1286 EXIST::FUNCTION:
1259PKCS12_BAGS_new 1285 1259PKCS12_BAGS_free 1287 EXIST::FUNCTION:
1260d2i_PKCS12_BAGS 1286 1260i2d_PKCS12 1288 EXIST::FUNCTION:
1261PKCS12_BAGS_free 1287 1261d2i_PKCS12 1289 EXIST::FUNCTION:
1262i2d_PKCS12 1288 1262PKCS12_new 1290 EXIST::FUNCTION:
1263d2i_PKCS12 1289 1263PKCS12_free 1291 EXIST::FUNCTION:
1264PKCS12_new 1290 1264i2d_PKCS12_MAC_DATA 1292 EXIST::FUNCTION:
1265PKCS12_free 1291 1265PKCS12_MAC_DATA_new 1293 EXIST::FUNCTION:
1266i2d_PKCS12_MAC_DATA 1292 1266d2i_PKCS12_MAC_DATA 1294 EXIST::FUNCTION:
1267PKCS12_MAC_DATA_new 1293 1267PKCS12_MAC_DATA_free 1295 EXIST::FUNCTION:
1268d2i_PKCS12_MAC_DATA 1294 1268i2d_PKCS12_SAFEBAG 1296 EXIST::FUNCTION:
1269PKCS12_MAC_DATA_free 1295 1269PKCS12_SAFEBAG_new 1297 EXIST::FUNCTION:
1270i2d_PKCS12_SAFEBAG 1296 1270d2i_PKCS12_SAFEBAG 1298 EXIST::FUNCTION:
1271PKCS12_SAFEBAG_new 1297 1271PKCS12_SAFEBAG_free 1299 EXIST::FUNCTION:
1272d2i_PKCS12_SAFEBAG 1298 1272ERR_load_PKCS12_strings 1300 EXIST::FUNCTION:
1273PKCS12_SAFEBAG_free 1299 1273PKCS12_PBE_add 1301 EXIST::FUNCTION:
1274ERR_load_PKCS12_strings 1300 1274PKCS8_add_keyusage 1302 EXIST::FUNCTION:
1275PKCS12_PBE_add 1301 1275PKCS12_get_attr_gen 1303 EXIST::FUNCTION:
1276PKCS8_add_keyusage 1302 1276PKCS12_parse 1304 EXIST::FUNCTION:
1277PKCS12_get_attr_gen 1303 1277PKCS12_create 1305 EXIST::FUNCTION:
1278PKCS12_parse 1304 1278i2d_PKCS12_bio 1306 EXIST::FUNCTION:
1279PKCS12_create 1305 1279i2d_PKCS12_fp 1307 EXIST::FUNCTION:
1280i2d_PKCS12_bio 1306 1280d2i_PKCS12_bio 1308 EXIST::FUNCTION:
1281i2d_PKCS12_fp 1307 1281d2i_PKCS12_fp 1309 EXIST::FUNCTION:
1282d2i_PKCS12_bio 1308 1282i2d_PBEPARAM 1310 EXIST::FUNCTION:
1283d2i_PKCS12_fp 1309 1283PBEPARAM_new 1311 EXIST::FUNCTION:
1284i2d_PBEPARAM 1310 1284d2i_PBEPARAM 1312 EXIST::FUNCTION:
1285PBEPARAM_new 1311 1285PBEPARAM_free 1313 EXIST::FUNCTION:
1286d2i_PBEPARAM 1312 1286i2d_PKCS8_PRIV_KEY_INFO 1314 EXIST::FUNCTION:
1287PBEPARAM_free 1313 1287PKCS8_PRIV_KEY_INFO_new 1315 EXIST::FUNCTION:
1288i2d_PKCS8_PRIV_KEY_INFO 1314 1288d2i_PKCS8_PRIV_KEY_INFO 1316 EXIST::FUNCTION:
1289PKCS8_PRIV_KEY_INFO_new 1315 1289PKCS8_PRIV_KEY_INFO_free 1317 EXIST::FUNCTION:
1290d2i_PKCS8_PRIV_KEY_INFO 1316 1290EVP_PKCS82PKEY 1318 EXIST::FUNCTION:
1291PKCS8_PRIV_KEY_INFO_free 1317 1291EVP_PKEY2PKCS8 1319 EXIST::FUNCTION:
1292EVP_PKCS82PKEY 1318 1292PKCS8_set_broken 1320 EXIST::FUNCTION:
1293EVP_PKEY2PKCS8 1319 1293EVP_PBE_ALGOR_CipherInit 1321 NOEXIST::FUNCTION:
1294PKCS8_set_broken 1320 1294EVP_PBE_alg_add 1322 EXIST::FUNCTION:
1295EVP_PBE_ALGOR_CipherInit 1321 1295PKCS5_pbe_set 1323 EXIST::FUNCTION:
1296EVP_PBE_alg_add 1322 1296EVP_PBE_cleanup 1324 EXIST::FUNCTION:
1297PKCS5_pbe_set 1323 1297i2d_SXNET 1325 EXIST::FUNCTION:
1298EVP_PBE_cleanup 1324 1298d2i_SXNET 1326 EXIST::FUNCTION:
1299i2d_SXNET 1325 1299SXNET_new 1327 EXIST::FUNCTION:
1300d2i_SXNET 1326 1300SXNET_free 1328 EXIST::FUNCTION:
1301SXNET_new 1327 1301i2d_SXNETID 1329 EXIST::FUNCTION:
1302SXNET_free 1328 1302d2i_SXNETID 1330 EXIST::FUNCTION:
1303i2d_SXNETID 1329 1303SXNETID_new 1331 EXIST::FUNCTION:
1304d2i_SXNETID 1330 1304SXNETID_free 1332 EXIST::FUNCTION:
1305SXNETID_new 1331 1305DSA_SIG_new 1333 EXIST::FUNCTION:DSA
1306SXNETID_free 1332 1306DSA_SIG_free 1334 EXIST::FUNCTION:DSA
1307DSA_SIG_new 1333 1307DSA_do_sign 1335 EXIST::FUNCTION:DSA
1308DSA_SIG_free 1334 1308DSA_do_verify 1336 EXIST::FUNCTION:DSA
1309DSA_do_sign 1335 1309d2i_DSA_SIG 1337 EXIST::FUNCTION:DSA
1310DSA_do_verify 1336 1310i2d_DSA_SIG 1338 EXIST::FUNCTION:DSA
1311d2i_DSA_SIG 1337 1311i2d_ASN1_VISIBLESTRING 1339 EXIST::FUNCTION:
1312i2d_DSA_SIG 1338 1312d2i_ASN1_VISIBLESTRING 1340 EXIST::FUNCTION:
1313i2d_ASN1_VISIBLESTRING 1339 1313i2d_ASN1_UTF8STRING 1341 EXIST::FUNCTION:
1314d2i_ASN1_VISIBLESTRING 1340 1314d2i_ASN1_UTF8STRING 1342 EXIST::FUNCTION:
1315i2d_ASN1_UTF8STRING 1341 1315i2d_DIRECTORYSTRING 1343 EXIST::FUNCTION:
1316d2i_ASN1_UTF8STRING 1342 1316d2i_DIRECTORYSTRING 1344 EXIST::FUNCTION:
1317i2d_DIRECTORYSTRING 1343 1317i2d_DISPLAYTEXT 1345 EXIST::FUNCTION:
1318d2i_DIRECTORYSTRING 1344 1318d2i_DISPLAYTEXT 1346 EXIST::FUNCTION:
1319i2d_DISPLAYTEXT 1345 1319d2i_ASN1_SET_OF_X509 1379 NOEXIST::FUNCTION:
1320d2i_DISPLAYTEXT 1346 1320i2d_ASN1_SET_OF_X509 1380 NOEXIST::FUNCTION:
1321sk_X509_NAME_new 1347 1321i2d_PBKDF2PARAM 1397 EXIST::FUNCTION:
1322sk_X509_NAME_new_null 1348 1322PBKDF2PARAM_new 1398 EXIST::FUNCTION:
1323sk_X509_NAME_free 1349 1323d2i_PBKDF2PARAM 1399 EXIST::FUNCTION:
1324sk_X509_NAME_num 1350 1324PBKDF2PARAM_free 1400 EXIST::FUNCTION:
1325sk_X509_NAME_value 1351 1325i2d_PBE2PARAM 1401 EXIST::FUNCTION:
1326sk_X509_NAME_set 1352 1326PBE2PARAM_new 1402 EXIST::FUNCTION:
1327sk_X509_NAME_zero 1353 1327d2i_PBE2PARAM 1403 EXIST::FUNCTION:
1328sk_X509_NAME_push 1354 1328PBE2PARAM_free 1404 EXIST::FUNCTION:
1329sk_X509_NAME_pop 1355 1329d2i_ASN1_SET_OF_GENERAL_NAME 1421 NOEXIST::FUNCTION:
1330sk_X509_NAME_find 1356 1330i2d_ASN1_SET_OF_GENERAL_NAME 1422 NOEXIST::FUNCTION:
1331sk_X509_NAME_delete 1357 1331d2i_ASN1_SET_OF_SXNETID 1439 NOEXIST::FUNCTION:
1332sk_X509_NAME_delete_ptr 1358 1332i2d_ASN1_SET_OF_SXNETID 1440 NOEXIST::FUNCTION:
1333sk_X509_NAME_set_cmp_func 1359 1333d2i_ASN1_SET_OF_POLICYQUALINFO 1457 NOEXIST::FUNCTION:
1334sk_X509_NAME_dup 1360 1334i2d_ASN1_SET_OF_POLICYQUALINFO 1458 NOEXIST::FUNCTION:
1335sk_X509_NAME_pop_free 1361 1335d2i_ASN1_SET_OF_POLICYINFO 1475 NOEXIST::FUNCTION:
1336sk_X509_NAME_shift 1362 1336i2d_ASN1_SET_OF_POLICYINFO 1476 NOEXIST::FUNCTION:
1337sk_X509_new 1363 1337SXNET_add_id_asc 1477 EXIST::FUNCTION:
1338sk_X509_new_null 1364 1338SXNET_add_id_ulong 1478 EXIST::FUNCTION:
1339sk_X509_free 1365 1339SXNET_add_id_INTEGER 1479 EXIST::FUNCTION:
1340sk_X509_num 1366 1340SXNET_get_id_asc 1480 EXIST::FUNCTION:
1341sk_X509_value 1367 1341SXNET_get_id_ulong 1481 EXIST::FUNCTION:
1342sk_X509_set 1368 1342SXNET_get_id_INTEGER 1482 EXIST::FUNCTION:
1343sk_X509_zero 1369 1343X509V3_set_conf_lhash 1483 EXIST::FUNCTION:
1344sk_X509_push 1370 1344i2d_CERTIFICATEPOLICIES 1484 EXIST::FUNCTION:
1345sk_X509_pop 1371 1345CERTIFICATEPOLICIES_new 1485 EXIST::FUNCTION:
1346sk_X509_find 1372 1346CERTIFICATEPOLICIES_free 1486 EXIST::FUNCTION:
1347sk_X509_delete 1373 1347d2i_CERTIFICATEPOLICIES 1487 EXIST::FUNCTION:
1348sk_X509_delete_ptr 1374 1348i2d_POLICYINFO 1488 EXIST::FUNCTION:
1349sk_X509_set_cmp_func 1375 1349POLICYINFO_new 1489 EXIST::FUNCTION:
1350sk_X509_dup 1376 1350d2i_POLICYINFO 1490 EXIST::FUNCTION:
1351sk_X509_pop_free 1377 1351POLICYINFO_free 1491 EXIST::FUNCTION:
1352sk_X509_shift 1378 1352i2d_POLICYQUALINFO 1492 EXIST::FUNCTION:
1353d2i_ASN1_SET_OF_X509 1379 1353POLICYQUALINFO_new 1493 EXIST::FUNCTION:
1354i2d_ASN1_SET_OF_X509 1380 1354d2i_POLICYQUALINFO 1494 EXIST::FUNCTION:
1355sk_X509_ATTRIBUTE_new 1381 1355POLICYQUALINFO_free 1495 EXIST::FUNCTION:
1356sk_X509_ATTRIBUTE_new_null 1382 1356i2d_USERNOTICE 1496 EXIST::FUNCTION:
1357sk_X509_ATTRIBUTE_free 1383 1357USERNOTICE_new 1497 EXIST::FUNCTION:
1358sk_X509_ATTRIBUTE_num 1384 1358d2i_USERNOTICE 1498 EXIST::FUNCTION:
1359sk_X509_ATTRIBUTE_value 1385 1359USERNOTICE_free 1499 EXIST::FUNCTION:
1360sk_X509_ATTRIBUTE_set 1386 1360i2d_NOTICEREF 1500 EXIST::FUNCTION:
1361sk_X509_ATTRIBUTE_zero 1387 1361NOTICEREF_new 1501 EXIST::FUNCTION:
1362sk_X509_ATTRIBUTE_push 1388 1362d2i_NOTICEREF 1502 EXIST::FUNCTION:
1363sk_X509_ATTRIBUTE_pop 1389 1363NOTICEREF_free 1503 EXIST::FUNCTION:
1364sk_X509_ATTRIBUTE_find 1390 1364X509V3_get_string 1504 EXIST::FUNCTION:
1365sk_X509_ATTRIBUTE_delete 1391 1365X509V3_get_section 1505 EXIST::FUNCTION:
1366sk_X509_ATTRIBUTE_delete_ptr 1392 1366X509V3_string_free 1506 EXIST::FUNCTION:
1367sk_X509_ATTRIBUTE_set_cmp_func 1393 1367X509V3_section_free 1507 EXIST::FUNCTION:
1368sk_X509_ATTRIBUTE_dup 1394 1368X509V3_set_ctx 1508 EXIST::FUNCTION:
1369sk_X509_ATTRIBUTE_pop_free 1395 1369s2i_ASN1_INTEGER 1509 EXIST::FUNCTION:
1370sk_X509_ATTRIBUTE_shift 1396 1370CRYPTO_set_locked_mem_functions 1510 EXIST::FUNCTION:
1371i2d_PBKDF2PARAM 1397 1371CRYPTO_get_locked_mem_functions 1511 EXIST::FUNCTION:
1372PBKDF2PARAM_new 1398 1372CRYPTO_malloc_locked 1512 EXIST::FUNCTION:
1373d2i_PBKDF2PARAM 1399 1373CRYPTO_free_locked 1513 EXIST::FUNCTION:
1374PBKDF2PARAM_free 1400 1374BN_mod_exp2_mont 1514 EXIST::FUNCTION:
1375i2d_PBE2PARAM 1401 1375ERR_get_error_line_data 1515 EXIST::FUNCTION:
1376PBE2PARAM_new 1402 1376ERR_peek_error_line_data 1516 EXIST::FUNCTION:
1377d2i_PBE2PARAM 1403 1377PKCS12_PBE_keyivgen 1517 EXIST::FUNCTION:
1378PBE2PARAM_free 1404 1378X509_ALGOR_dup 1518 EXIST::FUNCTION:
1379sk_GENERAL_NAME_new 1405 1379d2i_ASN1_SET_OF_DIST_POINT 1535 NOEXIST::FUNCTION:
1380sk_GENERAL_NAME_new_null 1406 1380i2d_ASN1_SET_OF_DIST_POINT 1536 NOEXIST::FUNCTION:
1381sk_GENERAL_NAME_free 1407 1381i2d_CRL_DIST_POINTS 1537 EXIST::FUNCTION:
1382sk_GENERAL_NAME_num 1408 1382CRL_DIST_POINTS_new 1538 EXIST::FUNCTION:
1383sk_GENERAL_NAME_value 1409 1383CRL_DIST_POINTS_free 1539 EXIST::FUNCTION:
1384sk_GENERAL_NAME_set 1410 1384d2i_CRL_DIST_POINTS 1540 EXIST::FUNCTION:
1385sk_GENERAL_NAME_zero 1411 1385i2d_DIST_POINT 1541 EXIST::FUNCTION:
1386sk_GENERAL_NAME_push 1412 1386DIST_POINT_new 1542 EXIST::FUNCTION:
1387sk_GENERAL_NAME_pop 1413 1387d2i_DIST_POINT 1543 EXIST::FUNCTION:
1388sk_GENERAL_NAME_find 1414 1388DIST_POINT_free 1544 EXIST::FUNCTION:
1389sk_GENERAL_NAME_delete 1415 1389i2d_DIST_POINT_NAME 1545 EXIST::FUNCTION:
1390sk_GENERAL_NAME_delete_ptr 1416 1390DIST_POINT_NAME_new 1546 EXIST::FUNCTION:
1391sk_GENERAL_NAME_set_cmp_func 1417 1391DIST_POINT_NAME_free 1547 EXIST::FUNCTION:
1392sk_GENERAL_NAME_dup 1418 1392d2i_DIST_POINT_NAME 1548 EXIST::FUNCTION:
1393sk_GENERAL_NAME_pop_free 1419 1393X509V3_add_value_uchar 1549 EXIST::FUNCTION:
1394sk_GENERAL_NAME_shift 1420 1394d2i_ASN1_SET_OF_X509_ATTRIBUTE 1555 NOEXIST::FUNCTION:
1395d2i_ASN1_SET_OF_GENERAL_NAME 1421 1395i2d_ASN1_SET_OF_ASN1_TYPE 1560 NOEXIST::FUNCTION:
1396i2d_ASN1_SET_OF_GENERAL_NAME 1422 1396d2i_ASN1_SET_OF_X509_EXTENSION 1567 NOEXIST::FUNCTION:
1397sk_SXNETID_new 1423 1397d2i_ASN1_SET_OF_X509_NAME_ENTRY 1574 NOEXIST::FUNCTION:
1398sk_SXNETID_new_null 1424 1398d2i_ASN1_SET_OF_ASN1_TYPE 1589 NOEXIST::FUNCTION:
1399sk_SXNETID_free 1425 1399i2d_ASN1_SET_OF_X509_ATTRIBUTE 1615 NOEXIST::FUNCTION:
1400sk_SXNETID_num 1426 1400i2d_ASN1_SET_OF_X509_EXTENSION 1624 NOEXIST::FUNCTION:
1401sk_SXNETID_value 1427 1401i2d_ASN1_SET_OF_X509_NAME_ENTRY 1633 NOEXIST::FUNCTION:
1402sk_SXNETID_set 1428 1402X509V3_EXT_i2d 1646 EXIST::FUNCTION:
1403sk_SXNETID_zero 1429 1403X509V3_EXT_val_prn 1647 EXIST::FUNCTION:
1404sk_SXNETID_push 1430 1404X509V3_EXT_add_list 1648 EXIST::FUNCTION:
1405sk_SXNETID_pop 1431 1405EVP_CIPHER_type 1649 EXIST::FUNCTION:
1406sk_SXNETID_find 1432 1406EVP_PBE_CipherInit 1650 EXIST::FUNCTION:
1407sk_SXNETID_delete 1433 1407X509V3_add_value_bool_nf 1651 EXIST::FUNCTION:
1408sk_SXNETID_delete_ptr 1434 1408d2i_ASN1_UINTEGER 1652 EXIST::FUNCTION:
1409sk_SXNETID_set_cmp_func 1435 1409sk_value 1653 EXIST::FUNCTION:
1410sk_SXNETID_dup 1436 1410sk_num 1654 EXIST::FUNCTION:
1411sk_SXNETID_pop_free 1437 1411sk_set 1655 EXIST::FUNCTION:
1412sk_SXNETID_shift 1438 1412i2d_ASN1_SET_OF_X509_REVOKED 1661 NOEXIST::FUNCTION:
1413d2i_ASN1_SET_OF_SXNETID 1439 1413sk_sort 1671 EXIST::FUNCTION:
1414i2d_ASN1_SET_OF_SXNETID 1440 1414d2i_ASN1_SET_OF_X509_REVOKED 1674 NOEXIST::FUNCTION:
1415sk_POLICYQUALINFO_new 1441 1415i2d_ASN1_SET_OF_X509_ALGOR 1682 NOEXIST::FUNCTION:
1416sk_POLICYQUALINFO_new_null 1442 1416i2d_ASN1_SET_OF_X509_CRL 1685 NOEXIST::FUNCTION:
1417sk_POLICYQUALINFO_free 1443 1417d2i_ASN1_SET_OF_X509_ALGOR 1696 NOEXIST::FUNCTION:
1418sk_POLICYQUALINFO_num 1444 1418d2i_ASN1_SET_OF_X509_CRL 1702 NOEXIST::FUNCTION:
1419sk_POLICYQUALINFO_value 1445 1419i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO 1723 NOEXIST::FUNCTION:
1420sk_POLICYQUALINFO_set 1446 1420i2d_ASN1_SET_OF_PKCS7_RECIP_INFO 1738 NOEXIST::FUNCTION:
1421sk_POLICYQUALINFO_zero 1447 1421d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO 1748 NOEXIST::FUNCTION:
1422sk_POLICYQUALINFO_push 1448 1422d2i_ASN1_SET_OF_PKCS7_RECIP_INFO 1753 NOEXIST::FUNCTION:
1423sk_POLICYQUALINFO_pop 1449 1423PKCS5_PBE_add 1775 EXIST::FUNCTION:
1424sk_POLICYQUALINFO_find 1450 1424PEM_write_bio_PKCS8 1776 EXIST::FUNCTION:
1425sk_POLICYQUALINFO_delete 1451 1425i2d_PKCS8_fp 1777 EXIST::FUNCTION:FP_API
1426sk_POLICYQUALINFO_delete_ptr 1452 1426PEM_read_bio_PKCS8_PRIV_KEY_INFO 1778 EXIST::FUNCTION:
1427sk_POLICYQUALINFO_set_cmp_func 1453 1427d2i_PKCS8_bio 1779 EXIST::FUNCTION:
1428sk_POLICYQUALINFO_dup 1454 1428d2i_PKCS8_PRIV_KEY_INFO_fp 1780 EXIST::FUNCTION:FP_API
1429sk_POLICYQUALINFO_pop_free 1455 1429PEM_write_bio_PKCS8_PRIV_KEY_INFO 1781 EXIST::FUNCTION:
1430sk_POLICYQUALINFO_shift 1456 1430PEM_read_PKCS8 1782 EXIST:!WIN16:FUNCTION:
1431d2i_ASN1_SET_OF_POLICYQUALINFO 1457 1431d2i_PKCS8_PRIV_KEY_INFO_bio 1783 EXIST::FUNCTION:
1432i2d_ASN1_SET_OF_POLICYQUALINFO 1458 1432d2i_PKCS8_fp 1784 EXIST::FUNCTION:FP_API
1433sk_POLICYINFO_new 1459 1433PEM_write_PKCS8 1785 EXIST:!WIN16:FUNCTION:
1434sk_POLICYINFO_new_null 1460 1434PEM_read_PKCS8_PRIV_KEY_INFO 1786 EXIST:!WIN16:FUNCTION:
1435sk_POLICYINFO_free 1461 1435PEM_read_bio_PKCS8 1787 EXIST::FUNCTION:
1436sk_POLICYINFO_num 1462 1436PEM_write_PKCS8_PRIV_KEY_INFO 1788 EXIST:!WIN16:FUNCTION:
1437sk_POLICYINFO_value 1463 1437PKCS5_PBE_keyivgen 1789 EXIST::FUNCTION:
1438sk_POLICYINFO_set 1464 1438i2d_PKCS8_bio 1790 EXIST::FUNCTION:
1439sk_POLICYINFO_zero 1465 1439i2d_PKCS8_PRIV_KEY_INFO_fp 1791 EXIST::FUNCTION:FP_API
1440sk_POLICYINFO_push 1466 1440i2d_PKCS8_PRIV_KEY_INFO_bio 1792 EXIST::FUNCTION:
1441sk_POLICYINFO_pop 1467 1441BIO_s_bio 1793 EXIST::FUNCTION:
1442sk_POLICYINFO_find 1468 1442PKCS5_pbe2_set 1794 EXIST::FUNCTION:
1443sk_POLICYINFO_delete 1469 1443PKCS5_PBKDF2_HMAC_SHA1 1795 EXIST::FUNCTION:
1444sk_POLICYINFO_delete_ptr 1470 1444PKCS5_v2_PBE_keyivgen 1796 EXIST::FUNCTION:
1445sk_POLICYINFO_set_cmp_func 1471 1445PEM_write_bio_PKCS8PrivateKey 1797 EXIST::FUNCTION:
1446sk_POLICYINFO_dup 1472 1446PEM_write_PKCS8PrivateKey 1798 EXIST::FUNCTION:
1447sk_POLICYINFO_pop_free 1473 1447BIO_ctrl_get_read_request 1799 EXIST::FUNCTION:
1448sk_POLICYINFO_shift 1474 1448BIO_ctrl_pending 1800 EXIST::FUNCTION:
1449d2i_ASN1_SET_OF_POLICYINFO 1475 1449BIO_ctrl_wpending 1801 EXIST::FUNCTION:
1450i2d_ASN1_SET_OF_POLICYINFO 1476 1450BIO_new_bio_pair 1802 EXIST::FUNCTION:
1451SXNET_add_id_asc 1477 1451BIO_ctrl_get_write_guarantee 1803 EXIST::FUNCTION:
1452SXNET_add_id_ulong 1478 1452CRYPTO_num_locks 1804 EXIST::FUNCTION:
1453SXNET_add_id_INTEGER 1479 1453CONF_load_bio 1805 EXIST::FUNCTION:
1454SXNET_get_id_asc 1480 1454CONF_load_fp 1806 EXIST::FUNCTION:FP_API
1455SXNET_get_id_ulong 1481 1455i2d_ASN1_SET_OF_ASN1_OBJECT 1837 NOEXIST::FUNCTION:
1456SXNET_get_id_INTEGER 1482 1456d2i_ASN1_SET_OF_ASN1_OBJECT 1844 NOEXIST::FUNCTION:
1457X509V3_set_conf_lhash 1483 1457PKCS7_signatureVerify 1845 EXIST::FUNCTION:
1458i2d_CERTIFICATEPOLICIES 1484 1458RSA_set_method 1846 EXIST::FUNCTION:RSA
1459CERTIFICATEPOLICIES_new 1485 1459RSA_get_method 1847 EXIST::FUNCTION:RSA
1460CERTIFICATEPOLICIES_free 1486 1460RSA_get_default_method 1848 EXIST::FUNCTION:RSA
1461d2i_CERTIFICATEPOLICIES 1487 1461RSA_check_key 1869 EXIST::FUNCTION:RSA
1462i2d_POLICYINFO 1488 1462OBJ_obj2txt 1870 EXIST::FUNCTION:
1463POLICYINFO_new 1489 1463DSA_dup_DH 1871 EXIST::FUNCTION:DSA,DH
1464d2i_POLICYINFO 1490 1464X509_REQ_get_extensions 1872 EXIST::FUNCTION:
1465POLICYINFO_free 1491 1465X509_REQ_set_extension_nids 1873 EXIST::FUNCTION:
1466i2d_POLICYQUALINFO 1492 1466BIO_nwrite 1874 EXIST::FUNCTION:
1467POLICYQUALINFO_new 1493 1467X509_REQ_extension_nid 1875 EXIST::FUNCTION:
1468d2i_POLICYQUALINFO 1494 1468BIO_nread 1876 EXIST::FUNCTION:
1469POLICYQUALINFO_free 1495 1469X509_REQ_get_extension_nids 1877 EXIST::FUNCTION:
1470i2d_USERNOTICE 1496 1470BIO_nwrite0 1878 EXIST::FUNCTION:
1471USERNOTICE_new 1497 1471X509_REQ_add_extensions_nid 1879 EXIST::FUNCTION:
1472d2i_USERNOTICE 1498 1472BIO_nread0 1880 EXIST::FUNCTION:
1473USERNOTICE_free 1499 1473X509_REQ_add_extensions 1881 EXIST::FUNCTION:
1474i2d_NOTICEREF 1500 1474BIO_new_mem_buf 1882 EXIST::FUNCTION:
1475NOTICEREF_new 1501 1475DH_set_ex_data 1883 EXIST::FUNCTION:DH
1476d2i_NOTICEREF 1502 1476DH_set_method 1884 EXIST::FUNCTION:DH
1477NOTICEREF_free 1503 1477DSA_OpenSSL 1885 EXIST::FUNCTION:DSA
1478X509V3_get_string 1504 1478DH_get_ex_data 1886 EXIST::FUNCTION:DH
1479X509V3_get_section 1505 1479DH_get_ex_new_index 1887 EXIST::FUNCTION:DH
1480X509V3_string_free 1506 1480DSA_new_method 1888 EXIST::FUNCTION:DSA
1481X509V3_section_free 1507 1481DH_new_method 1889 EXIST::FUNCTION:DH
1482X509V3_set_ctx 1508 1482DH_OpenSSL 1890 EXIST::FUNCTION:DH
1483s2i_ASN1_INTEGER 1509 1483DSA_get_ex_new_index 1891 EXIST::FUNCTION:DSA
1484CRYPTO_set_locked_mem_functions 1510 1484DH_get_default_method 1892 EXIST::FUNCTION:DH
1485CRYPTO_get_locked_mem_functions 1511 1485DSA_set_ex_data 1893 EXIST::FUNCTION:DSA
1486CRYPTO_malloc_locked 1512 1486DH_set_default_method 1894 EXIST::FUNCTION:DH
1487CRYPTO_free_locked 1513 1487DSA_get_ex_data 1895 EXIST::FUNCTION:DSA
1488BN_mod_exp2_mont 1514 1488X509V3_EXT_REQ_add_conf 1896 EXIST::FUNCTION:
1489ERR_get_error_line_data 1515 1489NETSCAPE_SPKI_print 1897 EXIST::FUNCTION:
1490ERR_peek_error_line_data 1516 1490NETSCAPE_SPKI_set_pubkey 1898 EXIST::FUNCTION:
1491PKCS12_PBE_keyivgen 1517 1491NETSCAPE_SPKI_b64_encode 1899 EXIST::FUNCTION:
1492X509_ALGOR_dup 1518 1492NETSCAPE_SPKI_get_pubkey 1900 EXIST::FUNCTION:
1493sk_DIST_POINT_new 1519 1493NETSCAPE_SPKI_b64_decode 1901 EXIST::FUNCTION:
1494sk_DIST_POINT_new_null 1520 1494UTF8_putc 1902 EXIST::FUNCTION:
1495sk_DIST_POINT_free 1521 1495UTF8_getc 1903 EXIST::FUNCTION:
1496sk_DIST_POINT_num 1522 1496RSA_null_method 1904 EXIST::FUNCTION:RSA
1497sk_DIST_POINT_value 1523 1497ASN1_tag2str 1905 EXIST::FUNCTION:
1498sk_DIST_POINT_set 1524 1498BIO_ctrl_reset_read_request 1906 EXIST::FUNCTION:
1499sk_DIST_POINT_zero 1525 1499DISPLAYTEXT_new 1907 EXIST::FUNCTION:
1500sk_DIST_POINT_push 1526 1500ASN1_GENERALIZEDTIME_free 1908 EXIST::FUNCTION:
1501sk_DIST_POINT_pop 1527 1501X509_REVOKED_get_ext_d2i 1909 EXIST::FUNCTION:
1502sk_DIST_POINT_find 1528 1502X509_set_ex_data 1910 EXIST::FUNCTION:
1503sk_DIST_POINT_delete 1529 1503X509_reject_set_bit_asc 1911 NOEXIST::FUNCTION:
1504sk_DIST_POINT_delete_ptr 1530 1504X509_NAME_add_entry_by_txt 1912 EXIST::FUNCTION:
1505sk_DIST_POINT_set_cmp_func 1531 1505X509_NAME_add_entry_by_NID 1914 EXIST::FUNCTION:
1506sk_DIST_POINT_dup 1532 1506X509_PURPOSE_get0 1915 EXIST::FUNCTION:
1507sk_DIST_POINT_pop_free 1533 1507PEM_read_X509_AUX 1917 EXIST:!WIN16:FUNCTION:
1508sk_DIST_POINT_shift 1534 1508d2i_AUTHORITY_INFO_ACCESS 1918 EXIST::FUNCTION:
1509d2i_ASN1_SET_OF_DIST_POINT 1535 1509PEM_write_PUBKEY 1921 EXIST:!WIN16:FUNCTION:
1510i2d_ASN1_SET_OF_DIST_POINT 1536 1510ACCESS_DESCRIPTION_new 1925 EXIST::FUNCTION:
1511i2d_CRL_DIST_POINTS 1537 1511X509_CERT_AUX_free 1926 EXIST::FUNCTION:
1512CRL_DIST_POINTS_new 1538 1512d2i_ACCESS_DESCRIPTION 1927 EXIST::FUNCTION:
1513CRL_DIST_POINTS_free 1539 1513X509_trust_clear 1928 EXIST::FUNCTION:
1514d2i_CRL_DIST_POINTS 1540 1514X509_TRUST_add 1931 EXIST::FUNCTION:
1515i2d_DIST_POINT 1541 1515ASN1_VISIBLESTRING_new 1932 EXIST::FUNCTION:
1516DIST_POINT_new 1542 1516X509_alias_set1 1933 EXIST::FUNCTION:
1517d2i_DIST_POINT 1543 1517ASN1_PRINTABLESTRING_free 1934 EXIST::FUNCTION:
1518DIST_POINT_free 1544 1518EVP_PKEY_get1_DSA 1935 EXIST::FUNCTION:DSA
1519i2d_DIST_POINT_NAME 1545 1519ASN1_BMPSTRING_new 1936 EXIST::FUNCTION:
1520DIST_POINT_NAME_new 1546 1520ASN1_mbstring_copy 1937 EXIST::FUNCTION:
1521DIST_POINT_NAME_free 1547 1521ASN1_UTF8STRING_new 1938 EXIST::FUNCTION:
1522d2i_DIST_POINT_NAME 1548 1522DSA_get_default_method 1941 EXIST::FUNCTION:DSA
1523X509V3_add_value_uchar 1549 1523i2d_ASN1_SET_OF_ACCESS_DESCRIPTION 1945 NOEXIST::FUNCTION:
1524sk_X509_INFO_new 1550 1524ASN1_T61STRING_free 1946 EXIST::FUNCTION:
1525sk_X509_EXTENSION_new 1551 1525DSA_set_method 1949 EXIST::FUNCTION:DSA
1526sk_X509_NAME_ENTRY_unshift 1552 1526X509_get_ex_data 1950 EXIST::FUNCTION:
1527sk_ASN1_TYPE_value 1553 1527ASN1_STRING_type 1951 EXIST::FUNCTION:
1528sk_X509_EXTENSION_find 1554 1528X509_PURPOSE_get_by_sname 1952 EXIST::FUNCTION:
1529d2i_ASN1_SET_OF_X509_ATTRIBUTE 1555 1529ASN1_TIME_free 1954 EXIST::FUNCTION:
1530sk_ASN1_TYPE_pop 1556 1530ASN1_OCTET_STRING_cmp 1955 EXIST::FUNCTION:
1531sk_X509_EXTENSION_set_cmp_func 1557 1531ASN1_BIT_STRING_new 1957 EXIST::FUNCTION:
1532sk_ASN1_TYPE_new_null 1558 1532X509_get_ext_d2i 1958 EXIST::FUNCTION:
1533sk_X509_NAME_ENTRY_delete 1559 1533PEM_read_bio_X509_AUX 1959 EXIST::FUNCTION:
1534i2d_ASN1_SET_OF_ASN1_TYPE 1560 1534ASN1_STRING_set_default_mask_asc 1960 EXIST:!VMS:FUNCTION:
1535sk_X509_NAME_ENTRY_dup 1561 1535ASN1_STRING_set_def_mask_asc 1960 EXIST:VMS:FUNCTION:
1536sk_X509_unshift 1562 1536PEM_write_bio_RSA_PUBKEY 1961 EXIST::FUNCTION:RSA
1537sk_X509_NAME_unshift 1563 1537ASN1_INTEGER_cmp 1963 EXIST::FUNCTION:
1538sk_ASN1_TYPE_num 1564 1538d2i_RSA_PUBKEY_fp 1964 EXIST::FUNCTION:RSA,FP_API
1539sk_X509_EXTENSION_new_null 1565 1539X509_trust_set_bit_asc 1967 NOEXIST::FUNCTION:
1540sk_X509_INFO_value 1566 1540PEM_write_bio_DSA_PUBKEY 1968 EXIST::FUNCTION:
1541d2i_ASN1_SET_OF_X509_EXTENSION 1567 1541X509_STORE_CTX_free 1969 EXIST::FUNCTION:
1542sk_X509_INFO_delete_ptr 1568 1542EVP_PKEY_set1_DSA 1970 EXIST::FUNCTION:DSA
1543sk_X509_NAME_ENTRY_new 1569 1543i2d_DSA_PUBKEY_fp 1971 EXIST::FUNCTION:DSA,FP_API
1544sk_DIST_POINT_insert 1570 1544X509_load_cert_crl_file 1972 EXIST::FUNCTION:
1545sk_ASN1_TYPE_set_cmp_func 1571 1545ASN1_TIME_new 1973 EXIST::FUNCTION:
1546sk_X509_EXTENSION_value 1572 1546i2d_RSA_PUBKEY 1974 EXIST::FUNCTION:RSA
1547sk_DIST_POINT_unshift 1573 1547X509_STORE_CTX_purpose_inherit 1976 EXIST::FUNCTION:
1548d2i_ASN1_SET_OF_X509_NAME_ENTRY 1574 1548PEM_read_RSA_PUBKEY 1977 EXIST:!WIN16:FUNCTION:RSA
1549sk_X509_INFO_pop 1575 1549d2i_X509_AUX 1980 EXIST::FUNCTION:
1550sk_X509_EXTENSION_pop 1576 1550i2d_DSA_PUBKEY 1981 EXIST::FUNCTION:DSA
1551sk_X509_NAME_ENTRY_shift 1577 1551X509_CERT_AUX_print 1982 EXIST::FUNCTION:
1552sk_X509_INFO_num 1578 1552PEM_read_DSA_PUBKEY 1984 EXIST:!WIN16:FUNCTION:
1553sk_X509_EXTENSION_num 1579 1553i2d_RSA_PUBKEY_bio 1985 EXIST::FUNCTION:RSA
1554sk_X509_INFO_pop_free 1580 1554ASN1_BIT_STRING_num_asc 1986 EXIST::FUNCTION:
1555sk_POLICYQUALINFO_unshift 1581 1555i2d_PUBKEY 1987 EXIST::FUNCTION:
1556sk_POLICYINFO_unshift 1582 1556ASN1_UTCTIME_free 1988 EXIST::FUNCTION:
1557sk_X509_NAME_ENTRY_new_null 1583 1557DSA_set_default_method 1989 EXIST::FUNCTION:DSA
1558sk_X509_NAME_ENTRY_pop 1584 1558X509_PURPOSE_get_by_id 1990 EXIST::FUNCTION:
1559sk_X509_ATTRIBUTE_unshift 1585 1559ACCESS_DESCRIPTION_free 1994 EXIST::FUNCTION:
1560sk_X509_NAME_ENTRY_num 1586 1560PEM_read_bio_PUBKEY 1995 EXIST::FUNCTION:
1561sk_GENERAL_NAME_unshift 1587 1561ASN1_STRING_set_by_NID 1996 EXIST::FUNCTION:
1562sk_X509_INFO_free 1588 1562X509_PURPOSE_get_id 1997 EXIST::FUNCTION:
1563d2i_ASN1_SET_OF_ASN1_TYPE 1589 1563DISPLAYTEXT_free 1998 EXIST::FUNCTION:
1564sk_X509_INFO_insert 1590 1564OTHERNAME_new 1999 EXIST::FUNCTION:
1565sk_X509_NAME_ENTRY_value 1591 1565X509_CERT_AUX_new 2001 EXIST::FUNCTION:
1566sk_POLICYQUALINFO_insert 1592 1566X509_TRUST_cleanup 2007 EXIST::FUNCTION:
1567sk_ASN1_TYPE_set 1593 1567X509_NAME_add_entry_by_OBJ 2008 EXIST::FUNCTION:
1568sk_X509_EXTENSION_delete_ptr 1594 1568X509_CRL_get_ext_d2i 2009 EXIST::FUNCTION:
1569sk_X509_INFO_unshift 1595 1569X509_PURPOSE_get0_name 2011 EXIST::FUNCTION:
1570sk_ASN1_TYPE_unshift 1596 1570PEM_read_PUBKEY 2012 EXIST:!WIN16:FUNCTION:
1571sk_ASN1_TYPE_free 1597 1571i2d_DSA_PUBKEY_bio 2014 EXIST::FUNCTION:DSA
1572sk_ASN1_TYPE_delete_ptr 1598 1572i2d_OTHERNAME 2015 EXIST::FUNCTION:
1573sk_ASN1_TYPE_pop_free 1599 1573ASN1_OCTET_STRING_free 2016 EXIST::FUNCTION:
1574sk_X509_EXTENSION_unshift 1600 1574ASN1_BIT_STRING_set_asc 2017 EXIST::FUNCTION:
1575sk_X509_EXTENSION_pop_free 1601 1575X509_get_ex_new_index 2019 EXIST::FUNCTION:
1576sk_X509_NAME_ENTRY_set_cmp_func 1602 1576ASN1_STRING_TABLE_cleanup 2020 EXIST::FUNCTION:
1577sk_ASN1_TYPE_insert 1603 1577X509_TRUST_get_by_id 2021 EXIST::FUNCTION:
1578sk_X509_NAME_ENTRY_free 1604 1578X509_PURPOSE_get_trust 2022 EXIST::FUNCTION:
1579sk_SXNETID_insert 1605 1579ASN1_STRING_length 2023 EXIST::FUNCTION:
1580sk_X509_NAME_insert 1606 1580d2i_ASN1_SET_OF_ACCESS_DESCRIPTION 2024 NOEXIST::FUNCTION:
1581sk_X509_insert 1607 1581ASN1_PRINTABLESTRING_new 2025 EXIST::FUNCTION:
1582sk_X509_INFO_delete 1608 1582X509V3_get_d2i 2026 EXIST::FUNCTION:
1583sk_X509_INFO_set_cmp_func 1609 1583ASN1_ENUMERATED_free 2027 EXIST::FUNCTION:
1584sk_X509_ATTRIBUTE_insert 1610 1584i2d_X509_CERT_AUX 2028 EXIST::FUNCTION:
1585sk_X509_INFO_zero 1611 1585X509_STORE_CTX_set_trust 2030 EXIST::FUNCTION:
1586sk_X509_INFO_set 1612 1586ASN1_STRING_set_default_mask 2032 EXIST::FUNCTION:
1587sk_X509_EXTENSION_set 1613 1587X509_STORE_CTX_new 2033 EXIST::FUNCTION:
1588sk_X509_EXTENSION_free 1614 1588EVP_PKEY_get1_RSA 2034 EXIST::FUNCTION:RSA
1589i2d_ASN1_SET_OF_X509_ATTRIBUTE 1615 1589DIRECTORYSTRING_free 2038 EXIST::FUNCTION:
1590sk_SXNETID_unshift 1616 1590PEM_write_X509_AUX 2039 EXIST:!WIN16:FUNCTION:
1591sk_X509_INFO_push 1617 1591ASN1_OCTET_STRING_set 2040 EXIST::FUNCTION:
1592sk_X509_EXTENSION_insert 1618 1592d2i_DSA_PUBKEY_fp 2041 EXIST::FUNCTION:DSA,FP_API
1593sk_X509_INFO_new_null 1619 1593d2i_RSA_PUBKEY 2044 EXIST::FUNCTION:RSA
1594sk_ASN1_TYPE_dup 1620 1594X509_TRUST_get0_name 2046 EXIST::FUNCTION:
1595sk_X509_INFO_find 1621 1595X509_TRUST_get0 2047 EXIST::FUNCTION:
1596sk_POLICYINFO_insert 1622 1596AUTHORITY_INFO_ACCESS_free 2048 EXIST::FUNCTION:
1597sk_ASN1_TYPE_zero 1623 1597ASN1_IA5STRING_new 2049 EXIST::FUNCTION:
1598i2d_ASN1_SET_OF_X509_EXTENSION 1624 1598d2i_DSA_PUBKEY 2050 EXIST::FUNCTION:DSA
1599sk_X509_NAME_ENTRY_set 1625 1599X509_check_purpose 2051 EXIST::FUNCTION:
1600sk_ASN1_TYPE_push 1626 1600ASN1_ENUMERATED_new 2052 EXIST::FUNCTION:
1601sk_X509_NAME_ENTRY_insert 1627 1601d2i_RSA_PUBKEY_bio 2053 EXIST::FUNCTION:RSA
1602sk_ASN1_TYPE_new 1628 1602d2i_PUBKEY 2054 EXIST::FUNCTION:
1603sk_GENERAL_NAME_insert 1629 1603X509_TRUST_get_trust 2055 EXIST::FUNCTION:
1604sk_ASN1_TYPE_shift 1630 1604X509_TRUST_get_flags 2056 EXIST::FUNCTION:
1605sk_ASN1_TYPE_delete 1631 1605ASN1_BMPSTRING_free 2057 EXIST::FUNCTION:
1606sk_X509_NAME_ENTRY_pop_free 1632 1606ASN1_T61STRING_new 2058 EXIST::FUNCTION:
1607i2d_ASN1_SET_OF_X509_NAME_ENTRY 1633 1607ASN1_UTCTIME_new 2060 EXIST::FUNCTION:
1608sk_X509_NAME_ENTRY_zero 1634 1608i2d_AUTHORITY_INFO_ACCESS 2062 EXIST::FUNCTION:
1609sk_ASN1_TYPE_find 1635 1609EVP_PKEY_set1_RSA 2063 EXIST::FUNCTION:RSA
1610sk_X509_NAME_ENTRY_delete_ptr 1636 1610X509_STORE_CTX_set_purpose 2064 EXIST::FUNCTION:
1611sk_X509_NAME_ENTRY_push 1637 1611ASN1_IA5STRING_free 2065 EXIST::FUNCTION:
1612sk_X509_EXTENSION_zero 1638 1612PEM_write_bio_X509_AUX 2066 EXIST::FUNCTION:
1613sk_X509_INFO_shift 1639 1613X509_PURPOSE_get_count 2067 EXIST::FUNCTION:
1614sk_X509_INFO_dup 1640 1614CRYPTO_add_info 2068 NOEXIST::FUNCTION:
1615sk_X509_EXTENSION_dup 1641 1615X509_NAME_ENTRY_create_by_txt 2071 EXIST::FUNCTION:
1616sk_X509_EXTENSION_delete 1642 1616ASN1_STRING_get_default_mask 2072 EXIST::FUNCTION:
1617sk_X509_EXTENSION_shift 1643 1617X509_alias_get0 2074 EXIST::FUNCTION:
1618sk_X509_EXTENSION_push 1644 1618ASN1_STRING_data 2075 EXIST::FUNCTION:
1619sk_X509_NAME_ENTRY_find 1645 1619i2d_ACCESS_DESCRIPTION 2077 EXIST::FUNCTION:
1620X509V3_EXT_i2d 1646 1620X509_trust_set_bit 2078 NOEXIST::FUNCTION:
1621X509V3_EXT_val_prn 1647 1621ASN1_BIT_STRING_free 2080 EXIST::FUNCTION:
1622X509V3_EXT_add_list 1648 1622PEM_read_bio_RSA_PUBKEY 2081 EXIST::FUNCTION:RSA
1623EVP_CIPHER_type 1649 1623X509_add1_reject_object 2082 EXIST::FUNCTION:
1624EVP_PBE_CipherInit 1650 1624X509_check_trust 2083 EXIST::FUNCTION:
1625X509V3_add_value_bool_nf 1651 1625PEM_read_bio_DSA_PUBKEY 2088 EXIST::FUNCTION:
1626d2i_ASN1_UINTEGER 1652 1626X509_PURPOSE_add 2090 EXIST::FUNCTION:
1627sk_value 1653 1627ASN1_STRING_TABLE_get 2091 EXIST::FUNCTION:
1628sk_num 1654 1628ASN1_UTF8STRING_free 2092 EXIST::FUNCTION:
1629sk_set 1655 1629d2i_DSA_PUBKEY_bio 2093 EXIST::FUNCTION:DSA
1630sk_X509_REVOKED_set_cmp_func 1656 1630PEM_write_RSA_PUBKEY 2095 EXIST:!WIN16:FUNCTION:RSA
1631sk_X509_REVOKED_unshift 1657 1631d2i_OTHERNAME 2096 EXIST::FUNCTION:
1632sk_X509_REVOKED_dup 1658 1632X509_reject_set_bit 2098 NOEXIST::FUNCTION:
1633sk_X509_REVOKED_free 1659 1633PEM_write_DSA_PUBKEY 2101 EXIST:!WIN16:FUNCTION:
1634sk_X509_REVOKED_new 1660 1634X509_PURPOSE_get0_sname 2105 EXIST::FUNCTION:
1635i2d_ASN1_SET_OF_X509_REVOKED 1661 1635EVP_PKEY_set1_DH 2107 EXIST::FUNCTION:DH
1636sk_X509_REVOKED_shift 1662 1636ASN1_OCTET_STRING_dup 2108 EXIST::FUNCTION:
1637sk_X509_REVOKED_delete_ptr 1663 1637ASN1_BIT_STRING_set 2109 EXIST::FUNCTION:
1638sk_X509_REVOKED_pop_free 1664 1638X509_TRUST_get_count 2110 EXIST::FUNCTION:
1639sk_X509_REVOKED_insert 1665 1639ASN1_INTEGER_free 2111 EXIST::FUNCTION:
1640sk_X509_REVOKED_zero 1666 1640OTHERNAME_free 2112 EXIST::FUNCTION:
1641sk_X509_REVOKED_pop 1667 1641i2d_RSA_PUBKEY_fp 2113 EXIST::FUNCTION:RSA,FP_API
1642sk_X509_REVOKED_value 1668 1642ASN1_INTEGER_dup 2114 EXIST::FUNCTION:
1643sk_X509_REVOKED_num 1669 1643d2i_X509_CERT_AUX 2115 EXIST::FUNCTION:
1644sk_X509_REVOKED_push 1670 1644PEM_write_bio_PUBKEY 2117 EXIST::FUNCTION:
1645sk_sort 1671 1645ASN1_VISIBLESTRING_free 2118 EXIST::FUNCTION:
1646sk_X509_REVOKED_find 1672 1646X509_PURPOSE_cleanup 2119 EXIST::FUNCTION:
1647sk_X509_REVOKED_delete 1673 1647ASN1_mbstring_ncopy 2123 EXIST::FUNCTION:
1648d2i_ASN1_SET_OF_X509_REVOKED 1674 1648ASN1_GENERALIZEDTIME_new 2126 EXIST::FUNCTION:
1649sk_X509_REVOKED_new_null 1675 1649EVP_PKEY_get1_DH 2128 EXIST::FUNCTION:DH
1650sk_X509_REVOKED_set 1676 1650ASN1_OCTET_STRING_new 2130 EXIST::FUNCTION:
1651sk_X509_ALGOR_new 1677 1651ASN1_INTEGER_new 2131 EXIST::FUNCTION:
1652sk_X509_CRL_set_cmp_func 1678 1652i2d_X509_AUX 2132 EXIST::FUNCTION:
1653sk_X509_CRL_set 1679 1653ASN1_BIT_STRING_name_print 2134 EXIST::FUNCTION:
1654sk_X509_ALGOR_unshift 1680 1654X509_cmp 2135 EXIST::FUNCTION:
1655sk_X509_CRL_free 1681 1655ASN1_STRING_length_set 2136 EXIST::FUNCTION:
1656i2d_ASN1_SET_OF_X509_ALGOR 1682 1656DIRECTORYSTRING_new 2137 EXIST::FUNCTION:
1657sk_X509_ALGOR_pop 1683 1657X509_add1_trust_object 2140 EXIST::FUNCTION:
1658sk_X509_CRL_unshift 1684 1658PKCS12_newpass 2141 EXIST::FUNCTION:
1659i2d_ASN1_SET_OF_X509_CRL 1685 1659SMIME_write_PKCS7 2142 EXIST::FUNCTION:
1660sk_X509_ALGOR_num 1686 1660SMIME_read_PKCS7 2143 EXIST::FUNCTION:
1661sk_X509_CRL_insert 1687 1661des_set_key_checked 2144 EXIST::FUNCTION:DES
1662sk_X509_CRL_pop_free 1688 1662PKCS7_verify 2145 EXIST::FUNCTION:
1663sk_X509_CRL_delete_ptr 1689 1663PKCS7_encrypt 2146 EXIST::FUNCTION:
1664sk_X509_ALGOR_insert 1690 1664des_set_key_unchecked 2147 EXIST::FUNCTION:DES
1665sk_X509_CRL_dup 1691 1665SMIME_crlf_copy 2148 EXIST::FUNCTION:
1666sk_X509_CRL_zero 1692 1666i2d_ASN1_PRINTABLESTRING 2149 EXIST::FUNCTION:
1667sk_X509_CRL_new 1693 1667PKCS7_get0_signers 2150 EXIST::FUNCTION:
1668sk_X509_CRL_push 1694 1668PKCS7_decrypt 2151 EXIST::FUNCTION:
1669sk_X509_ALGOR_new_null 1695 1669SMIME_text 2152 EXIST::FUNCTION:
1670d2i_ASN1_SET_OF_X509_ALGOR 1696 1670PKCS7_simple_smimecap 2153 EXIST::FUNCTION:
1671sk_X509_CRL_shift 1697 1671PKCS7_get_smimecap 2154 EXIST::FUNCTION:
1672sk_X509_CRL_find 1698 1672PKCS7_sign 2155 EXIST::FUNCTION:
1673sk_X509_CRL_delete 1699 1673PKCS7_add_attrib_smimecap 2156 EXIST::FUNCTION:
1674sk_X509_ALGOR_free 1700 1674CRYPTO_dbg_set_options 2157 EXIST::FUNCTION:
1675sk_X509_ALGOR_delete 1701 1675CRYPTO_remove_all_info 2158 EXIST::FUNCTION:
1676d2i_ASN1_SET_OF_X509_CRL 1702 1676CRYPTO_get_mem_debug_functions 2159 EXIST::FUNCTION:
1677sk_X509_ALGOR_delete_ptr 1703 1677CRYPTO_is_mem_check_on 2160 EXIST::FUNCTION:
1678sk_X509_CRL_pop 1704 1678CRYPTO_set_mem_debug_functions 2161 EXIST::FUNCTION:
1679sk_X509_ALGOR_set 1705 1679CRYPTO_pop_info 2162 EXIST::FUNCTION:
1680sk_X509_CRL_num 1706 1680CRYPTO_push_info_ 2163 EXIST::FUNCTION:
1681sk_X509_CRL_value 1707 1681CRYPTO_set_mem_debug_options 2164 EXIST::FUNCTION:
1682sk_X509_ALGOR_shift 1708 1682PEM_write_PKCS8PrivateKey_nid 2165 EXIST::FUNCTION:
1683sk_X509_ALGOR_zero 1709 1683PEM_write_bio_PKCS8PrivateKey_nid 2166 EXIST:!VMS:FUNCTION:
1684sk_X509_CRL_new_null 1710 1684PEM_write_bio_PKCS8PrivKey_nid 2166 EXIST:VMS:FUNCTION:
1685sk_X509_ALGOR_push 1711 1685d2i_PKCS8PrivateKey_bio 2167 EXIST::FUNCTION:
1686sk_X509_ALGOR_value 1712 1686ASN1_NULL_free 2168 EXIST::FUNCTION:
1687sk_X509_ALGOR_find 1713 1687d2i_ASN1_NULL 2169 EXIST::FUNCTION:
1688sk_X509_ALGOR_set_cmp_func 1714 1688ASN1_NULL_new 2170 EXIST::FUNCTION:
1689sk_X509_ALGOR_dup 1715 1689i2d_PKCS8PrivateKey_bio 2171 EXIST::FUNCTION:
1690sk_X509_ALGOR_pop_free 1716 1690i2d_PKCS8PrivateKey_fp 2172 EXIST::FUNCTION:
1691sk_PKCS7_SIGNER_INFO_new 1717 1691i2d_ASN1_NULL 2173 EXIST::FUNCTION:
1692sk_PKCS7_SIGNER_INFO_zero 1718 1692i2d_PKCS8PrivateKey_nid_fp 2174 EXIST::FUNCTION:
1693sk_PKCS7_SIGNER_INFO_unshift 1719 1693d2i_PKCS8PrivateKey_fp 2175 EXIST::FUNCTION:
1694sk_PKCS7_RECIP_INFO_dup 1720 1694i2d_PKCS8PrivateKey_nid_bio 2176 EXIST::FUNCTION:
1695sk_PKCS7_SIGNER_INFO_insert 1721 1695i2d_PKCS8PrivateKeyInfo_fp 2177 EXIST::FUNCTION:FP_API
1696sk_PKCS7_SIGNER_INFO_push 1722 1696i2d_PKCS8PrivateKeyInfo_bio 2178 EXIST::FUNCTION:
1697i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO 1723 1697PEM_cb 2179 NOEXIST::FUNCTION:
1698sk_PKCS7_RECIP_INFO_new 1724 1698i2d_PrivateKey_fp 2180 EXIST::FUNCTION:FP_API
1699sk_X509_LOOKUP_new_null 1725 1699d2i_PrivateKey_bio 2181 EXIST::FUNCTION:
1700sk_PKCS7_SIGNER_INFO_find 1726 1700d2i_PrivateKey_fp 2182 EXIST::FUNCTION:FP_API
1701sk_PKCS7_SIGNER_INFO_set_cmp_func 1727 1701i2d_PrivateKey_bio 2183 EXIST::FUNCTION:
1702sk_X509_LOOKUP_zero 1728 1702X509_reject_clear 2184 EXIST::FUNCTION:
1703sk_PKCS7_RECIP_INFO_shift 1729 1703X509_TRUST_set_default 2185 EXIST::FUNCTION:
1704sk_PKCS7_RECIP_INFO_new_null 1730 1704d2i_AutoPrivateKey 2186 EXIST::FUNCTION:
1705sk_PKCS7_SIGNER_INFO_shift 1731 1705X509_ATTRIBUTE_get0_type 2187 EXIST::FUNCTION:
1706sk_PKCS7_SIGNER_INFO_pop 1732 1706X509_ATTRIBUTE_set1_data 2188 EXIST::FUNCTION:
1707sk_PKCS7_SIGNER_INFO_pop_free 1733 1707X509at_get_attr 2189 EXIST::FUNCTION:
1708sk_X509_LOOKUP_push 1734 1708X509at_get_attr_count 2190 EXIST::FUNCTION:
1709sk_X509_LOOKUP_dup 1735 1709X509_ATTRIBUTE_create_by_NID 2191 EXIST::FUNCTION:
1710sk_PKCS7_SIGNER_INFO_num 1736 1710X509_ATTRIBUTE_set1_object 2192 EXIST::FUNCTION:
1711sk_X509_LOOKUP_find 1737 1711X509_ATTRIBUTE_count 2193 EXIST::FUNCTION:
1712i2d_ASN1_SET_OF_PKCS7_RECIP_INFO 1738 1712X509_ATTRIBUTE_create_by_OBJ 2194 EXIST::FUNCTION:
1713sk_X509_LOOKUP_new 1739 1713X509_ATTRIBUTE_get0_object 2195 EXIST::FUNCTION:
1714sk_PKCS7_SIGNER_INFO_delete 1740 1714X509at_get_attr_by_NID 2196 EXIST::FUNCTION:
1715sk_PKCS7_RECIP_INFO_set_cmp_func 1741 1715X509at_add1_attr 2197 EXIST::FUNCTION:
1716sk_PKCS7_SIGNER_INFO_delete_ptr 1742 1716X509_ATTRIBUTE_get0_data 2198 EXIST::FUNCTION:
1717sk_PKCS7_RECIP_INFO_pop 1743 1717X509at_delete_attr 2199 EXIST::FUNCTION:
1718sk_X509_LOOKUP_insert 1744 1718X509at_get_attr_by_OBJ 2200 EXIST::FUNCTION:
1719sk_PKCS7_RECIP_INFO_value 1745 1719RAND_add 2201 EXIST::FUNCTION:
1720sk_PKCS7_RECIP_INFO_num 1746 1720BIO_number_written 2202 EXIST::FUNCTION:
1721sk_PKCS7_SIGNER_INFO_value 1747 1721BIO_number_read 2203 EXIST::FUNCTION:
1722d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO 1748 1722X509_STORE_CTX_get1_chain 2204 EXIST::FUNCTION:
1723sk_X509_LOOKUP_pop 1749 1723ERR_load_RAND_strings 2205 EXIST::FUNCTION:
1724sk_X509_LOOKUP_num 1750 1724RAND_pseudo_bytes 2206 EXIST::FUNCTION:
1725sk_X509_LOOKUP_delete 1751 1725X509_REQ_get_attr_by_NID 2207 EXIST::FUNCTION:
1726sk_PKCS7_RECIP_INFO_free 1752 1726X509_REQ_get_attr 2208 EXIST::FUNCTION:
1727d2i_ASN1_SET_OF_PKCS7_RECIP_INFO 1753 1727X509_REQ_add1_attr_by_NID 2209 EXIST::FUNCTION:
1728sk_PKCS7_SIGNER_INFO_set 1754 1728X509_REQ_get_attr_by_OBJ 2210 EXIST::FUNCTION:
1729sk_X509_LOOKUP_pop_free 1755 1729X509at_add1_attr_by_NID 2211 EXIST::FUNCTION:
1730sk_X509_LOOKUP_shift 1756 1730X509_REQ_add1_attr_by_OBJ 2212 EXIST::FUNCTION:
1731sk_X509_LOOKUP_unshift 1757 1731X509_REQ_get_attr_count 2213 EXIST::FUNCTION:
1732sk_PKCS7_SIGNER_INFO_new_null 1758 1732X509_REQ_add1_attr 2214 EXIST::FUNCTION:
1733sk_PKCS7_RECIP_INFO_delete_ptr 1759 1733X509_REQ_delete_attr 2215 EXIST::FUNCTION:
1734sk_PKCS7_RECIP_INFO_pop_free 1760 1734X509at_add1_attr_by_OBJ 2216 EXIST::FUNCTION:
1735sk_PKCS7_RECIP_INFO_insert 1761 1735X509_REQ_add1_attr_by_txt 2217 EXIST::FUNCTION:
1736sk_PKCS7_SIGNER_INFO_free 1762 1736X509_ATTRIBUTE_create_by_txt 2218 EXIST::FUNCTION:
1737sk_PKCS7_RECIP_INFO_set 1763 1737X509at_add1_attr_by_txt 2219 EXIST::FUNCTION:
1738sk_PKCS7_RECIP_INFO_zero 1764 1738BN_pseudo_rand 2239 EXIST::FUNCTION:
1739sk_X509_LOOKUP_value 1765 1739BN_is_prime_fasttest 2240 EXIST::FUNCTION:
1740sk_PKCS7_RECIP_INFO_push 1766 1740BN_CTX_end 2241 EXIST::FUNCTION:
1741sk_PKCS7_RECIP_INFO_unshift 1767 1741BN_CTX_start 2242 EXIST::FUNCTION:
1742sk_X509_LOOKUP_set_cmp_func 1768 1742BN_CTX_get 2243 EXIST::FUNCTION:
1743sk_X509_LOOKUP_free 1769 1743EVP_PKEY2PKCS8_broken 2244 EXIST::FUNCTION:
1744sk_PKCS7_SIGNER_INFO_dup 1770 1744ASN1_STRING_TABLE_add 2245 EXIST::FUNCTION:
1745sk_X509_LOOKUP_delete_ptr 1771 1745CRYPTO_dbg_get_options 2246 EXIST::FUNCTION:
1746sk_X509_LOOKUP_set 1772 1746AUTHORITY_INFO_ACCESS_new 2247 EXIST::FUNCTION:
1747sk_PKCS7_RECIP_INFO_find 1773 1747CRYPTO_get_mem_debug_options 2248 EXIST::FUNCTION:
1748sk_PKCS7_RECIP_INFO_delete 1774 1748des_crypt 2249 EXIST::FUNCTION:DES
1749PKCS5_PBE_add 1775 1749PEM_write_bio_X509_REQ_NEW 2250 EXIST::FUNCTION:
1750PEM_write_bio_PKCS8 1776 1750PEM_write_X509_REQ_NEW 2251 EXIST:!WIN16:FUNCTION:
1751i2d_PKCS8_fp 1777 1751BIO_callback_ctrl 2252 EXIST::FUNCTION:
1752PEM_read_bio_PKCS8_PRIV_KEY_INFO 1778 1752RAND_egd 2253 EXIST::FUNCTION:
1753d2i_PKCS8_bio 1779 1753RAND_status 2254 EXIST::FUNCTION:
1754d2i_PKCS8_PRIV_KEY_INFO_fp 1780 1754bn_dump1 2255 NOEXIST::FUNCTION:
1755PEM_write_bio_PKCS8_PRIV_KEY_INFO 1781 1755des_check_key_parity 2256 EXIST::FUNCTION:DES
1756PEM_read_PKCS8 1782 1756lh_num_items 2257 EXIST::FUNCTION:
1757d2i_PKCS8_PRIV_KEY_INFO_bio 1783 1757RAND_event 2258 EXIST::FUNCTION:
1758d2i_PKCS8_fp 1784 1758DSO_new 2259 EXIST::FUNCTION:
1759PEM_write_PKCS8 1785 1759DSO_new_method 2260 EXIST::FUNCTION:
1760PEM_read_PKCS8_PRIV_KEY_INFO 1786 1760DSO_free 2261 EXIST::FUNCTION:
1761PEM_read_bio_PKCS8 1787 1761DSO_flags 2262 EXIST::FUNCTION:
1762PEM_write_PKCS8_PRIV_KEY_INFO 1788 1762DSO_up 2263 EXIST::FUNCTION:
1763PKCS5_PBE_keyivgen 1789 1763DSO_set_default_method 2264 EXIST::FUNCTION:
1764i2d_PKCS8_bio 1790 1764DSO_get_default_method 2265 EXIST::FUNCTION:
1765i2d_PKCS8_PRIV_KEY_INFO_fp 1791 1765DSO_get_method 2266 EXIST::FUNCTION:
1766i2d_PKCS8_PRIV_KEY_INFO_bio 1792 1766DSO_set_method 2267 EXIST::FUNCTION:
1767BIO_s_bio 1793 1767DSO_load 2268 EXIST::FUNCTION:
1768PKCS5_pbe2_set 1794 1768DSO_bind_var 2269 EXIST::FUNCTION:
1769PKCS5_PBKDF2_HMAC_SHA1 1795 1769DSO_METHOD_null 2270 EXIST::FUNCTION:
1770PKCS5_v2_PBE_keyivgen 1796 1770DSO_METHOD_openssl 2271 EXIST::FUNCTION:
1771PEM_write_bio_PKCS8PrivateKey 1797 1771DSO_METHOD_dlfcn 2272 EXIST::FUNCTION:
1772PEM_write_PKCS8PrivateKey 1798 1772DSO_METHOD_win32 2273 EXIST::FUNCTION:
1773BIO_ctrl_get_read_request 1799 1773ERR_load_DSO_strings 2274 EXIST::FUNCTION:
1774BIO_ctrl_pending 1800 1774DSO_METHOD_dl 2275 EXIST::FUNCTION:
1775BIO_ctrl_wpending 1801 1775NCONF_load 2276 EXIST::FUNCTION:
1776BIO_new_bio_pair 1802 1776NCONF_load_fp 2278 EXIST::FUNCTION:FP_API
1777BIO_ctrl_get_write_guarantee 1803 1777NCONF_new 2279 EXIST::FUNCTION:
1778CRYPTO_num_locks 1804 1778NCONF_get_string 2280 EXIST::FUNCTION:
1779CONF_load_bio 1805 1779NCONF_free 2281 EXIST::FUNCTION:
1780CONF_load_fp 1806 1780NCONF_get_number 2282 EXIST::FUNCTION:
1781sk_CONF_VALUE_delete 1807 1781CONF_dump_fp 2283 EXIST::FUNCTION:
1782sk_CONF_VALUE_pop 1808 1782NCONF_load_bio 2284 EXIST::FUNCTION:
1783sk_CONF_VALUE_num 1809 1783NCONF_dump_fp 2285 EXIST::FUNCTION:
1784sk_CONF_VALUE_pop_free 1810 1784NCONF_get_section 2286 EXIST::FUNCTION:
1785sk_CONF_VALUE_free 1811 1785NCONF_dump_bio 2287 EXIST::FUNCTION:
1786sk_CONF_VALUE_shift 1812 1786CONF_dump_bio 2288 EXIST::FUNCTION:
1787sk_CONF_VALUE_unshift 1813 1787NCONF_free_data 2289 EXIST::FUNCTION:
1788sk_CONF_VALUE_value 1814 1788CONF_set_default_method 2290 EXIST::FUNCTION:
1789sk_CONF_VALUE_set 1815 1789ERR_error_string_n 2291 EXIST::FUNCTION:
1790sk_CONF_VALUE_zero 1816 1790BIO_snprintf 2292 EXIST::FUNCTION:
1791sk_CONF_VALUE_push 1817 1791DSO_ctrl 2293 EXIST::FUNCTION:
1792sk_CONF_VALUE_delete_ptr 1818 1792i2d_ASN1_SET_OF_ASN1_INTEGER 2317 NOEXIST::FUNCTION:
1793sk_CONF_VALUE_find 1819 1793i2d_ASN1_SET_OF_PKCS12_SAFEBAG 2320 NOEXIST::FUNCTION:
1794sk_CONF_VALUE_set_cmp_func 1820 1794i2d_ASN1_SET_OF_PKCS7 2328 NOEXIST::FUNCTION:
1795sk_CONF_VALUE_new_null 1821 1795BIO_vfree 2334 EXIST::FUNCTION:
1796sk_CONF_VALUE_dup 1822 1796d2i_ASN1_SET_OF_ASN1_INTEGER 2339 NOEXIST::FUNCTION:
1797sk_CONF_VALUE_insert 1823 1797d2i_ASN1_SET_OF_PKCS12_SAFEBAG 2341 NOEXIST::FUNCTION:
1798sk_CONF_VALUE_new 1824 1798ASN1_UTCTIME_get 2350 EXIST::FUNCTION:
1799sk_ASN1_OBJECT_find 1825 1799X509_REQ_digest 2362 EXIST::FUNCTION:
1800sk_ASN1_OBJECT_pop_free 1826 1800X509_CRL_digest 2391 EXIST::FUNCTION:
1801sk_ASN1_OBJECT_dup 1827 1801d2i_ASN1_SET_OF_PKCS7 2397 NOEXIST::FUNCTION:
1802sk_ASN1_OBJECT_delete_ptr 1828 1802EVP_CIPHER_CTX_set_key_length 2399 EXIST::FUNCTION:
1803sk_ASN1_OBJECT_new 1829 1803EVP_CIPHER_CTX_ctrl 2400 EXIST::FUNCTION:
1804sk_ASN1_OBJECT_unshift 1830 1804BN_mod_exp_mont_word 2401 EXIST::FUNCTION:
1805sk_ASN1_OBJECT_delete 1831 1805RAND_egd_bytes 2402 EXIST::FUNCTION:
1806sk_ASN1_OBJECT_shift 1832 1806X509_REQ_get1_email 2403 EXIST::FUNCTION:
1807sk_ASN1_OBJECT_pop 1833 1807X509_get1_email 2404 EXIST::FUNCTION:
1808sk_ASN1_OBJECT_num 1834 1808X509_email_free 2405 EXIST::FUNCTION:
1809sk_ASN1_OBJECT_value 1835 1809i2d_RSA_NET 2406 EXIST::FUNCTION:RSA
1810sk_ASN1_OBJECT_new_null 1836 1810d2i_RSA_NET_2 2407 EXIST::FUNCTION:RSA
1811i2d_ASN1_SET_OF_ASN1_OBJECT 1837 1811d2i_RSA_NET 2408 EXIST::FUNCTION:RSA
1812sk_ASN1_OBJECT_free 1838 1812DSO_bind_func 2409 EXIST::FUNCTION:
1813sk_ASN1_OBJECT_set 1839 1813CRYPTO_get_new_dynlockid 2410 EXIST::FUNCTION:
1814sk_ASN1_OBJECT_set_cmp_func 1840 1814sk_new_null 2411 EXIST::FUNCTION:
1815sk_ASN1_OBJECT_zero 1841 1815CRYPTO_set_dynlock_destroy_callback 2412 EXIST:!VMS:FUNCTION:
1816sk_ASN1_OBJECT_insert 1842 1816CRYPTO_set_dynlock_destroy_cb 2412 EXIST:VMS:FUNCTION:
1817sk_ASN1_OBJECT_push 1843 1817CRYPTO_destroy_dynlockid 2413 EXIST::FUNCTION:
1818d2i_ASN1_SET_OF_ASN1_OBJECT 1844 1818CRYPTO_set_dynlock_size 2414 NOEXIST::FUNCTION:
1819PKCS7_signatureVerify 1845 1819CRYPTO_set_dynlock_create_callback 2415 EXIST:!VMS:FUNCTION:
1820RSA_set_method 1846 1820CRYPTO_set_dynlock_create_cb 2415 EXIST:VMS:FUNCTION:
1821RSA_get_method 1847 1821CRYPTO_set_dynlock_lock_callback 2416 EXIST:!VMS:FUNCTION:
1822RSA_get_default_method 1848 1822CRYPTO_set_dynlock_lock_cb 2416 EXIST:VMS:FUNCTION:
1823sk_CONF_VALUE_sort 1849 1823CRYPTO_get_dynlock_lock_callback 2417 EXIST:!VMS:FUNCTION:
1824sk_X509_REVOKED_sort 1850 1824CRYPTO_get_dynlock_lock_cb 2417 EXIST:VMS:FUNCTION:
1825sk_X509_ATTRIBUTE_sort 1851 1825CRYPTO_get_dynlock_destroy_callback 2418 EXIST:!VMS:FUNCTION:
1826sk_X509_INFO_sort 1852 1826CRYPTO_get_dynlock_destroy_cb 2418 EXIST:VMS:FUNCTION:
1827sk_POLICYINFO_sort 1853 1827CRYPTO_get_dynlock_value 2419 EXIST::FUNCTION:
1828sk_GENERAL_NAME_sort 1854 1828CRYPTO_get_dynlock_create_callback 2420 EXIST:!VMS:FUNCTION:
1829sk_X509_sort 1855 1829CRYPTO_get_dynlock_create_cb 2420 EXIST:VMS:FUNCTION:
1830sk_X509_NAME_sort 1856 1830c2i_ASN1_BIT_STRING 2421 EXIST::FUNCTION:
1831sk_ASN1_TYPE_sort 1857 1831i2c_ASN1_BIT_STRING 2422 EXIST::FUNCTION:
1832sk_X509_ALGOR_sort 1858 1832RAND_poll 2423 EXIST::FUNCTION:
1833sk_PKCS7_RECIP_INFO_sort 1859 1833c2i_ASN1_INTEGER 2424 EXIST::FUNCTION:
1834sk_X509_NAME_ENTRY_sort 1860 1834i2c_ASN1_INTEGER 2425 EXIST::FUNCTION:
1835sk_X509_EXTENSION_sort 1861 1835BIO_dump_indent 2426 EXIST::FUNCTION:
1836sk_SXNETID_sort 1862 1836ASN1_parse_dump 2427 EXIST::FUNCTION:
1837sk_ASN1_OBJECT_sort 1863 1837c2i_ASN1_OBJECT 2428 EXIST::FUNCTION:
1838sk_PKCS7_SIGNER_INFO_sort 1864 1838X509_NAME_print_ex_fp 2429 EXIST::FUNCTION:FP_API
1839sk_X509_LOOKUP_sort 1865 1839ASN1_STRING_print_ex_fp 2430 EXIST::FUNCTION:FP_API
1840sk_POLICYQUALINFO_sort 1866 1840X509_NAME_print_ex 2431 EXIST::FUNCTION:
1841sk_X509_CRL_sort 1867 1841ASN1_STRING_print_ex 2432 EXIST::FUNCTION:
1842sk_DIST_POINT_sort 1868 1842MD4 2433 EXIST::FUNCTION:MD4
1843RSA_check_key 1869 1843MD4_Transform 2434 EXIST::FUNCTION:MD4
1844OBJ_obj2txt 1870 1844MD4_Final 2435 EXIST::FUNCTION:MD4
1845DSA_dup_DH 1871 1845MD4_Update 2436 EXIST::FUNCTION:MD4
1846X509_REQ_get_extensions 1872 1846MD4_Init 2437 EXIST::FUNCTION:MD4
1847X509_REQ_set_extension_nids 1873 1847EVP_md4 2438 EXIST::FUNCTION:MD4
1848BIO_nwrite 1874 1848i2d_PUBKEY_bio 2439 EXIST::FUNCTION:
1849X509_REQ_extension_nid 1875 1849i2d_PUBKEY_fp 2440 EXIST::FUNCTION:FP_API
1850BIO_nread 1876 1850d2i_PUBKEY_bio 2441 EXIST::FUNCTION:
1851X509_REQ_get_extension_nids 1877 1851ASN1_STRING_to_UTF8 2442 EXIST::FUNCTION:
1852BIO_nwrite0 1878 1852BIO_vprintf 2443 EXIST::FUNCTION:
1853X509_REQ_add_extensions_nid 1879 1853BIO_vsnprintf 2444 EXIST::FUNCTION:
1854BIO_nread0 1880 1854d2i_PUBKEY_fp 2445 EXIST::FUNCTION:FP_API
1855X509_REQ_add_extensions 1881 1855X509_cmp_time 2446 EXIST::FUNCTION:
1856BIO_new_mem_buf 1882 1856X509_STORE_CTX_set_time 2447 EXIST::FUNCTION:
1857DH_set_ex_data 1883 1857X509_STORE_CTX_get1_issuer 2448 EXIST::FUNCTION:
1858DH_set_method 1884 1858X509_OBJECT_retrieve_match 2449 EXIST::FUNCTION:
1859DSA_OpenSSL 1885 1859X509_OBJECT_idx_by_subject 2450 EXIST::FUNCTION:
1860DH_get_ex_data 1886 1860X509_STORE_CTX_set_flags 2451 EXIST::FUNCTION:
1861DH_get_ex_new_index 1887 1861X509_STORE_CTX_trusted_stack 2452 EXIST::FUNCTION:
1862DSA_new_method 1888 1862X509_time_adj 2453 EXIST::FUNCTION:
1863DH_new_method 1889 1863X509_check_issued 2454 EXIST::FUNCTION:
1864DH_OpenSSL 1890 1864ASN1_UTCTIME_cmp_time_t 2455 EXIST::FUNCTION:
1865DSA_get_ex_new_index 1891 1865des_set_weak_key_flag 2456 EXIST::VARIABLE:DES
1866DH_get_default_method 1892 1866des_check_key 2457 EXIST::VARIABLE:DES
1867DSA_set_ex_data 1893 1867des_rw_mode 2458 EXIST::VARIABLE:DES
1868DH_set_default_method 1894 1868RSA_PKCS1_RSAref 2459 EXIST:RSAREF:FUNCTION:RSA
1869DSA_get_ex_data 1895 1869X509_keyid_set1 2460 EXIST::FUNCTION:
1870X509V3_EXT_REQ_add_conf 1896 1870BIO_next 2461 EXIST::FUNCTION:
1871NETSCAPE_SPKI_print 1897 1871DSO_METHOD_vms 2462 EXIST::FUNCTION:
1872NETSCAPE_SPKI_set_pubkey 1898 1872BIO_f_linebuffer 2463 EXIST:VMS:FUNCTION:
1873NETSCAPE_SPKI_b64_encode 1899 1873ERR_load_ENGINE_strings 2464 EXIST::FUNCTION:
1874NETSCAPE_SPKI_get_pubkey 1900 1874ENGINE_set_DSA 2465 EXIST::FUNCTION:
1875NETSCAPE_SPKI_b64_decode 1901 1875ENGINE_get_finish_function 2466 EXIST::FUNCTION:
1876UTF8_putc 1902 1876ENGINE_get_default_RSA 2467 EXIST::FUNCTION:
1877UTF8_getc 1903 1877ENGINE_get_BN_mod_exp 2468 EXIST::FUNCTION:
1878RSA_null_method 1904 1878DSA_get_default_openssl_method 2469 EXIST::FUNCTION:DSA
1879ASN1_tag2str 1905 1879ENGINE_set_DH 2470 EXIST::FUNCTION:
1880BIO_ctrl_reset_read_request 1906 1880ENGINE_set_default_BN_mod_exp_crt 2471 EXIST:!VMS:FUNCTION:
1881DISPLAYTEXT_new 1907 1881ENGINE_set_def_BN_mod_exp_crt 2471 EXIST:VMS:FUNCTION:
1882ASN1_GENERALIZEDTIME_free 1908 1882ENGINE_init 2472 EXIST::FUNCTION:
1883X509_REVOKED_get_ext_d2i 1909 1883DH_get_default_openssl_method 2473 EXIST::FUNCTION:DH
1884X509_set_ex_data 1910 1884RSA_set_default_openssl_method 2474 EXIST::FUNCTION:RSA
1885X509_reject_set_bit_asc 1911 1885ENGINE_finish 2475 EXIST::FUNCTION:
1886X509_NAME_add_entry_by_txt 1912 1886ENGINE_load_public_key 2476 EXIST::FUNCTION:
1887sk_X509_TRUST_pop 1913 1887ENGINE_get_DH 2477 EXIST::FUNCTION:
1888X509_NAME_add_entry_by_NID 1914 1888ENGINE_ctrl 2478 EXIST::FUNCTION:
1889X509_PURPOSE_get0 1915 1889ENGINE_get_init_function 2479 EXIST::FUNCTION:
1890sk_ACCESS_DESCRIPTION_shift 1916 1890ENGINE_set_init_function 2480 EXIST::FUNCTION:
1891PEM_read_X509_AUX 1917 1891ENGINE_set_default_DSA 2481 EXIST::FUNCTION:
1892d2i_AUTHORITY_INFO_ACCESS 1918 1892ENGINE_get_name 2482 EXIST::FUNCTION:
1893sk_X509_TRUST_set_cmp_func 1919 1893ENGINE_get_last 2483 EXIST::FUNCTION:
1894sk_X509_TRUST_free 1920 1894ENGINE_get_prev 2484 EXIST::FUNCTION:
1895PEM_write_PUBKEY 1921 1895ENGINE_get_default_DH 2485 EXIST::FUNCTION:
1896sk_X509_TRUST_num 1922 1896ENGINE_get_RSA 2486 EXIST::FUNCTION:
1897sk_ACCESS_DESCRIPTION_delete 1923 1897ENGINE_set_default 2487 EXIST::FUNCTION:
1898sk_ASN1_STRING_TABLE_value 1924 1898ENGINE_get_RAND 2488 EXIST::FUNCTION:
1899ACCESS_DESCRIPTION_new 1925 1899ENGINE_get_first 2489 EXIST::FUNCTION:
1900X509_CERT_AUX_free 1926 1900ENGINE_by_id 2490 EXIST::FUNCTION:
1901d2i_ACCESS_DESCRIPTION 1927 1901ENGINE_set_finish_function 2491 EXIST::FUNCTION:
1902X509_trust_clear 1928 1902ENGINE_get_default_BN_mod_exp_crt 2492 EXIST:!VMS:FUNCTION:
1903sk_X509_PURPOSE_value 1929 1903ENGINE_get_def_BN_mod_exp_crt 2492 EXIST:VMS:FUNCTION:
1904sk_X509_PURPOSE_zero 1930 1904RSA_get_default_openssl_method 2493 EXIST::FUNCTION:RSA
1905X509_TRUST_add 1931 1905ENGINE_set_RSA 2494 EXIST::FUNCTION:
1906ASN1_VISIBLESTRING_new 1932 1906ENGINE_load_private_key 2495 EXIST::FUNCTION:
1907X509_alias_set1 1933 1907ENGINE_set_default_RAND 2496 EXIST::FUNCTION:
1908ASN1_PRINTABLESTRING_free 1934 1908ENGINE_set_BN_mod_exp 2497 EXIST::FUNCTION:
1909EVP_PKEY_get1_DSA 1935 1909ENGINE_remove 2498 EXIST::FUNCTION:
1910ASN1_BMPSTRING_new 1936 1910ENGINE_free 2499 EXIST::FUNCTION:
1911ASN1_mbstring_copy 1937 1911ENGINE_get_BN_mod_exp_crt 2500 EXIST::FUNCTION:
1912ASN1_UTF8STRING_new 1938 1912ENGINE_get_next 2501 EXIST::FUNCTION:
1913sk_ACCESS_DESCRIPTION_set 1939 1913ENGINE_set_name 2502 EXIST::FUNCTION:
1914sk_X509_PURPOSE_pop 1940 1914ENGINE_get_default_DSA 2503 EXIST::FUNCTION:
1915DSA_get_default_method 1941 1915ENGINE_set_default_BN_mod_exp 2504 EXIST::FUNCTION:
1916sk_X509_PURPOSE_push 1942 1916ENGINE_set_default_RSA 2505 EXIST::FUNCTION:
1917sk_X509_PURPOSE_delete 1943 1917ENGINE_get_default_RAND 2506 EXIST::FUNCTION:
1918sk_X509_PURPOSE_num 1944 1918ENGINE_get_default_BN_mod_exp 2507 EXIST::FUNCTION:
1919i2d_ASN1_SET_OF_ACCESS_DESCRIPTION 1945 1919ENGINE_set_RAND 2508 EXIST::FUNCTION:
1920ASN1_T61STRING_free 1946 1920ENGINE_set_id 2509 EXIST::FUNCTION:
1921sk_ACCESS_DESCRIPTION_free 1947 1921ENGINE_set_BN_mod_exp_crt 2510 EXIST::FUNCTION:
1922sk_ASN1_STRING_TABLE_pop 1948 1922ENGINE_set_default_DH 2511 EXIST::FUNCTION:
1923DSA_set_method 1949 1923ENGINE_new 2512 EXIST::FUNCTION:
1924X509_get_ex_data 1950 1924ENGINE_get_id 2513 EXIST::FUNCTION:
1925ASN1_STRING_type 1951 1925DSA_set_default_openssl_method 2514 EXIST::FUNCTION:DSA
1926X509_PURPOSE_get_by_sname 1952 1926ENGINE_add 2515 EXIST::FUNCTION:
1927sk_X509_PURPOSE_find 1953 1927DH_set_default_openssl_method 2516 EXIST::FUNCTION:DH
1928ASN1_TIME_free 1954 1928ENGINE_get_DSA 2517 EXIST::FUNCTION:
1929ASN1_OCTET_STRING_cmp 1955 1929ENGINE_get_ctrl_function 2518 EXIST::FUNCTION:
1930sk_ACCESS_DESCRIPTION_value 1956 1930ENGINE_set_ctrl_function 2519 EXIST::FUNCTION:
1931ASN1_BIT_STRING_new 1957
1932X509_get_ext_d2i 1958
1933PEM_read_bio_X509_AUX 1959
1934ASN1_STRING_set_default_mask_asc 1960
1935PEM_write_bio_RSA_PUBKEY 1961
1936sk_ASN1_STRING_TABLE_num 1962
1937ASN1_INTEGER_cmp 1963
1938d2i_RSA_PUBKEY_fp 1964
1939sk_ACCESS_DESCRIPTION_unshift 1965
1940sk_ASN1_STRING_TABLE_delete_ptr 1966
1941X509_trust_set_bit_asc 1967
1942PEM_write_bio_DSA_PUBKEY 1968
1943X509_STORE_CTX_free 1969
1944EVP_PKEY_set1_DSA 1970
1945i2d_DSA_PUBKEY_fp 1971
1946X509_load_cert_crl_file 1972
1947ASN1_TIME_new 1973
1948i2d_RSA_PUBKEY 1974
1949sk_X509_TRUST_pop_free 1975
1950X509_STORE_CTX_purpose_inherit 1976
1951PEM_read_RSA_PUBKEY 1977
1952sk_X509_TRUST_zero 1978
1953sk_ACCESS_DESCRIPTION_pop_free 1979
1954d2i_X509_AUX 1980
1955i2d_DSA_PUBKEY 1981
1956X509_CERT_AUX_print 1982
1957sk_X509_PURPOSE_new_null 1983
1958PEM_read_DSA_PUBKEY 1984
1959i2d_RSA_PUBKEY_bio 1985
1960ASN1_BIT_STRING_num_asc 1986
1961i2d_PUBKEY 1987
1962ASN1_UTCTIME_free 1988
1963DSA_set_default_method 1989
1964X509_PURPOSE_get_by_id 1990
1965sk_X509_TRUST_push 1991
1966sk_ASN1_STRING_TABLE_sort 1992
1967sk_X509_PURPOSE_set_cmp_func 1993
1968ACCESS_DESCRIPTION_free 1994
1969PEM_read_bio_PUBKEY 1995
1970ASN1_STRING_set_by_NID 1996
1971X509_PURPOSE_get_id 1997
1972DISPLAYTEXT_free 1998
1973OTHERNAME_new 1999
1974sk_X509_TRUST_find 2000
1975X509_CERT_AUX_new 2001
1976sk_ACCESS_DESCRIPTION_dup 2002
1977sk_ASN1_STRING_TABLE_pop_free 2003
1978sk_ASN1_STRING_TABLE_unshift 2004
1979sk_X509_TRUST_shift 2005
1980sk_ACCESS_DESCRIPTION_zero 2006
1981X509_TRUST_cleanup 2007
1982X509_NAME_add_entry_by_OBJ 2008
1983X509_CRL_get_ext_d2i 2009
1984sk_X509_TRUST_set 2010
1985X509_PURPOSE_get0_name 2011
1986PEM_read_PUBKEY 2012
1987sk_ACCESS_DESCRIPTION_new 2013
1988i2d_DSA_PUBKEY_bio 2014
1989i2d_OTHERNAME 2015
1990ASN1_OCTET_STRING_free 2016
1991ASN1_BIT_STRING_set_asc 2017
1992sk_ACCESS_DESCRIPTION_push 2018
1993X509_get_ex_new_index 2019
1994ASN1_STRING_TABLE_cleanup 2020
1995X509_TRUST_get_by_id 2021
1996X509_PURPOSE_get_trust 2022
1997ASN1_STRING_length 2023
1998d2i_ASN1_SET_OF_ACCESS_DESCRIPTION 2024
1999ASN1_PRINTABLESTRING_new 2025
2000X509V3_get_d2i 2026
2001ASN1_ENUMERATED_free 2027
2002i2d_X509_CERT_AUX 2028
2003sk_ACCESS_DESCRIPTION_find 2029
2004X509_STORE_CTX_set_trust 2030
2005sk_X509_PURPOSE_unshift 2031
2006ASN1_STRING_set_default_mask 2032
2007X509_STORE_CTX_new 2033
2008EVP_PKEY_get1_RSA 2034
2009sk_X509_PURPOSE_set 2035
2010sk_ASN1_STRING_TABLE_insert 2036
2011sk_X509_PURPOSE_sort 2037
2012DIRECTORYSTRING_free 2038
2013PEM_write_X509_AUX 2039
2014ASN1_OCTET_STRING_set 2040
2015d2i_DSA_PUBKEY_fp 2041
2016sk_ASN1_STRING_TABLE_free 2042
2017sk_X509_TRUST_value 2043
2018d2i_RSA_PUBKEY 2044
2019sk_ASN1_STRING_TABLE_set 2045
2020X509_TRUST_get0_name 2046
2021X509_TRUST_get0 2047
2022AUTHORITY_INFO_ACCESS_free 2048
2023ASN1_IA5STRING_new 2049
2024d2i_DSA_PUBKEY 2050
2025X509_check_purpose 2051
2026ASN1_ENUMERATED_new 2052
2027d2i_RSA_PUBKEY_bio 2053
2028d2i_PUBKEY 2054
2029X509_TRUST_get_trust 2055
2030X509_TRUST_get_flags 2056
2031ASN1_BMPSTRING_free 2057
2032ASN1_T61STRING_new 2058
2033sk_X509_TRUST_unshift 2059
2034ASN1_UTCTIME_new 2060
2035sk_ACCESS_DESCRIPTION_pop 2061
2036i2d_AUTHORITY_INFO_ACCESS 2062
2037EVP_PKEY_set1_RSA 2063
2038X509_STORE_CTX_set_purpose 2064
2039ASN1_IA5STRING_free 2065
2040PEM_write_bio_X509_AUX 2066
2041X509_PURPOSE_get_count 2067
2042CRYPTO_add_info 2068
2043sk_ACCESS_DESCRIPTION_num 2069
2044sk_ASN1_STRING_TABLE_set_cmp_func 2070
2045X509_NAME_ENTRY_create_by_txt 2071
2046ASN1_STRING_get_default_mask 2072
2047sk_X509_TRUST_dup 2073
2048X509_alias_get0 2074
2049ASN1_STRING_data 2075
2050sk_X509_TRUST_insert 2076
2051i2d_ACCESS_DESCRIPTION 2077
2052X509_trust_set_bit 2078
2053sk_X509_PURPOSE_delete_ptr 2079
2054ASN1_BIT_STRING_free 2080
2055PEM_read_bio_RSA_PUBKEY 2081
2056X509_add1_reject_object 2082
2057X509_check_trust 2083
2058sk_X509_TRUST_new_null 2084
2059sk_ACCESS_DESCRIPTION_new_null 2085
2060sk_ACCESS_DESCRIPTION_delete_ptr 2086
2061sk_X509_TRUST_sort 2087
2062PEM_read_bio_DSA_PUBKEY 2088
2063sk_X509_TRUST_new 2089
2064X509_PURPOSE_add 2090
2065ASN1_STRING_TABLE_get 2091
2066ASN1_UTF8STRING_free 2092
2067d2i_DSA_PUBKEY_bio 2093
2068sk_ASN1_STRING_TABLE_delete 2094
2069PEM_write_RSA_PUBKEY 2095
2070d2i_OTHERNAME 2096
2071sk_ACCESS_DESCRIPTION_insert 2097
2072X509_reject_set_bit 2098
2073sk_X509_TRUST_delete_ptr 2099
2074sk_X509_PURPOSE_pop_free 2100
2075PEM_write_DSA_PUBKEY 2101
2076sk_X509_PURPOSE_free 2102
2077sk_X509_PURPOSE_dup 2103
2078sk_ASN1_STRING_TABLE_zero 2104
2079X509_PURPOSE_get0_sname 2105
2080sk_ASN1_STRING_TABLE_shift 2106
2081EVP_PKEY_set1_DH 2107
2082ASN1_OCTET_STRING_dup 2108
2083ASN1_BIT_STRING_set 2109
2084X509_TRUST_get_count 2110
2085ASN1_INTEGER_free 2111
2086OTHERNAME_free 2112
2087i2d_RSA_PUBKEY_fp 2113
2088ASN1_INTEGER_dup 2114
2089d2i_X509_CERT_AUX 2115
2090sk_ASN1_STRING_TABLE_new_null 2116
2091PEM_write_bio_PUBKEY 2117
2092ASN1_VISIBLESTRING_free 2118
2093X509_PURPOSE_cleanup 2119
2094sk_ASN1_STRING_TABLE_push 2120
2095sk_ASN1_STRING_TABLE_dup 2121
2096sk_X509_PURPOSE_shift 2122
2097ASN1_mbstring_ncopy 2123
2098sk_X509_PURPOSE_new 2124
2099sk_X509_PURPOSE_insert 2125
2100ASN1_GENERALIZEDTIME_new 2126
2101sk_ACCESS_DESCRIPTION_sort 2127
2102EVP_PKEY_get1_DH 2128
2103sk_ACCESS_DESCRIPTION_set_cmp_func 2129
2104ASN1_OCTET_STRING_new 2130
2105ASN1_INTEGER_new 2131
2106i2d_X509_AUX 2132
2107sk_ASN1_STRING_TABLE_find 2133
2108ASN1_BIT_STRING_name_print 2134
2109X509_cmp 2135
2110ASN1_STRING_length_set 2136
2111DIRECTORYSTRING_new 2137
2112sk_ASN1_STRING_TABLE_new 2138
2113sk_X509_TRUST_delete 2139
2114X509_add1_trust_object 2140
2115PKCS12_newpass 2141
2116SMIME_write_PKCS7 2142
2117SMIME_read_PKCS7 2143
2118des_set_key_checked 2144
2119PKCS7_verify 2145
2120PKCS7_encrypt 2146
2121des_set_key_unchecked 2147
2122SMIME_crlf_copy 2148
2123i2d_ASN1_PRINTABLESTRING 2149
2124PKCS7_get0_signers 2150
2125PKCS7_decrypt 2151
2126SMIME_text 2152
2127PKCS7_simple_smimecap 2153
2128PKCS7_get_smimecap 2154
2129PKCS7_sign 2155
2130PKCS7_add_attrib_smimecap 2156
2131CRYPTO_dbg_set_options 2157
2132CRYPTO_remove_all_info 2158
2133CRYPTO_get_mem_debug_functions 2159
2134CRYPTO_is_mem_check_on 2160
2135CRYPTO_set_mem_debug_functions 2161
2136CRYPTO_pop_info 2162
2137CRYPTO_push_info_ 2163
2138CRYPTO_set_mem_debug_options 2164
2139PEM_write_PKCS8PrivateKey_nid 2165
2140PEM_write_bio_PKCS8PrivateKey_nid 2166
2141d2i_PKCS8PrivateKey_bio 2167
2142ASN1_NULL_free 2168
2143d2i_ASN1_NULL 2169
2144ASN1_NULL_new 2170
2145i2d_PKCS8PrivateKey_bio 2171
2146i2d_PKCS8PrivateKey_fp 2172
2147i2d_ASN1_NULL 2173
2148i2d_PKCS8PrivateKey_nid_fp 2174
2149d2i_PKCS8PrivateKey_fp 2175
2150i2d_PKCS8PrivateKey_nid_bio 2176
2151i2d_PKCS8PrivateKeyInfo_fp 2177
2152i2d_PKCS8PrivateKeyInfo_bio 2178
2153PEM_cb 2179
2154i2d_PrivateKey_fp 2180
2155d2i_PrivateKey_bio 2181
2156d2i_PrivateKey_fp 2182
2157i2d_PrivateKey_bio 2183
2158X509_reject_clear 2184
2159X509_TRUST_set_default 2185
2160d2i_AutoPrivateKey 2186
2161X509_ATTRIBUTE_get0_type 2187
2162X509_ATTRIBUTE_set1_data 2188
2163X509at_get_attr 2189
2164X509at_get_attr_count 2190
2165X509_ATTRIBUTE_create_by_NID 2191
2166X509_ATTRIBUTE_set1_object 2192
2167X509_ATTRIBUTE_count 2193
2168X509_ATTRIBUTE_create_by_OBJ 2194
2169X509_ATTRIBUTE_get0_object 2195
2170X509at_get_attr_by_NID 2196
2171X509at_add1_attr 2197
2172X509_ATTRIBUTE_get0_data 2198
2173X509at_delete_attr 2199
2174X509at_get_attr_by_OBJ 2200
2175RAND_add 2201
2176BIO_number_written 2202
2177BIO_number_read 2203
2178X509_STORE_CTX_get1_chain 2204
2179ERR_load_RAND_strings 2205
2180RAND_pseudo_bytes 2206
2181X509_REQ_get_attr_by_NID 2207
2182X509_REQ_get_attr 2208
2183X509_REQ_add1_attr_by_NID 2209
2184X509_REQ_get_attr_by_OBJ 2210
2185X509at_add1_attr_by_NID 2211
2186X509_REQ_add1_attr_by_OBJ 2212
2187X509_REQ_get_attr_count 2213
2188X509_REQ_add1_attr 2214
2189X509_REQ_delete_attr 2215
2190X509at_add1_attr_by_OBJ 2216
2191X509_REQ_add1_attr_by_txt 2217
2192X509_ATTRIBUTE_create_by_txt 2218
2193X509at_add1_attr_by_txt 2219
2194sk_CRYPTO_EX_DATA_FUNCS_delete 2220
2195sk_CRYPTO_EX_DATA_FUNCS_set 2221
2196sk_CRYPTO_EX_DATA_FUNCS_unshift 2222
2197sk_CRYPTO_EX_DATA_FUNCS_new_null 2223
2198sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func 2224
2199sk_CRYPTO_EX_DATA_FUNCS_sort 2225
2200sk_CRYPTO_EX_DATA_FUNCS_dup 2226
2201sk_CRYPTO_EX_DATA_FUNCS_shift 2227
2202sk_CRYPTO_EX_DATA_FUNCS_value 2228
2203sk_CRYPTO_EX_DATA_FUNCS_pop 2229
2204sk_CRYPTO_EX_DATA_FUNCS_push 2230
2205sk_CRYPTO_EX_DATA_FUNCS_find 2231
2206sk_CRYPTO_EX_DATA_FUNCS_new 2232
2207sk_CRYPTO_EX_DATA_FUNCS_free 2233
2208sk_CRYPTO_EX_DATA_FUNCS_delete_ptr 2234
2209sk_CRYPTO_EX_DATA_FUNCS_num 2235
2210sk_CRYPTO_EX_DATA_FUNCS_pop_free 2236
2211sk_CRYPTO_EX_DATA_FUNCS_insert 2237
2212sk_CRYPTO_EX_DATA_FUNCS_zero 2238
2213BN_pseudo_rand 2239
2214BN_is_prime_fasttest 2240
2215BN_CTX_end 2241
2216BN_CTX_start 2242
2217BN_CTX_get 2243
2218EVP_PKEY2PKCS8_broken 2244
2219ASN1_STRING_TABLE_add 2245
2220CRYPTO_dbg_get_options 2246
2221AUTHORITY_INFO_ACCESS_new 2247
2222CRYPTO_get_mem_debug_options 2248
2223des_crypt 2249
2224PEM_write_bio_X509_REQ_NEW 2250
2225PEM_write_X509_REQ_NEW 2251
2226BIO_callback_ctrl 2252
2227RAND_egd 2253
2228RAND_status 2254
2229bn_dump1 2255
2230des_check_key_parity 2256
2231lh_num_items 2257
2232RAND_event 2258
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl
index 100d76f279..46755fa287 100644
--- a/src/lib/libcrypto/util/mk1mf.pl
+++ b/src/lib/libcrypto/util/mk1mf.pl
@@ -52,7 +52,8 @@ foreach (@ARGV)
52 { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; } 52 { printf STDERR "\t%-10s\t%s\n",$i,$ops{$i}; }
53 print STDERR <<"EOF"; 53 print STDERR <<"EOF";
54and [options] can be one of 54and [options] can be one of
55 no-md2 no-md5 no-sha no-mdc2 no-ripemd - Skip this digest 55 no-md2 no-md4 no-md5 no-sha no-mdc2 - Skip this digest
56 no-ripemd
56 no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher 57 no-rc2 no-rc4 no-idea no-des no-bf no-cast - Skip this symetric cipher
57 no-rc5 58 no-rc5
58 no-rsa no-dsa no-dh - Skip this public key cipher 59 no-rsa no-dsa no-dh - Skip this public key cipher
@@ -65,6 +66,7 @@ and [options] can be one of
65 no-err - No error strings 66 no-err - No error strings
66 dll/shlib - Build shared libraries (MS) 67 dll/shlib - Build shared libraries (MS)
67 debug - Debug build 68 debug - Debug build
69 profile - Profiling build
68 gcc - Use Gcc (unix) 70 gcc - Use Gcc (unix)
69 rsaref - Build to require RSAref 71 rsaref - Build to require RSAref
70 72
@@ -200,6 +202,7 @@ $cflags.=" -DNO_RC2" if $no_rc2;
200$cflags.=" -DNO_RC4" if $no_rc4; 202$cflags.=" -DNO_RC4" if $no_rc4;
201$cflags.=" -DNO_RC5" if $no_rc5; 203$cflags.=" -DNO_RC5" if $no_rc5;
202$cflags.=" -DNO_MD2" if $no_md2; 204$cflags.=" -DNO_MD2" if $no_md2;
205$cflags.=" -DNO_MD4" if $no_md4;
203$cflags.=" -DNO_MD5" if $no_md5; 206$cflags.=" -DNO_MD5" if $no_md5;
204$cflags.=" -DNO_SHA" if $no_sha; 207$cflags.=" -DNO_SHA" if $no_sha;
205$cflags.=" -DNO_SHA1" if $no_sha1; 208$cflags.=" -DNO_SHA1" if $no_sha1;
@@ -217,9 +220,10 @@ $cflags.=" -DNO_SSL3" if $no_ssl3;
217$cflags.=" -DNO_ERR" if $no_err; 220$cflags.=" -DNO_ERR" if $no_err;
218$cflags.=" -DRSAref" if $rsaref ne ""; 221$cflags.=" -DRSAref" if $rsaref ne "";
219 222
220if ($unix) 223## if ($unix)
221 { $cflags="$c_flags" if ($c_flags ne ""); } 224## { $cflags="$c_flags" if ($c_flags ne ""); }
222else { $cflags="$c_flags$cflags" if ($c_flags ne ""); } 225##else
226 { $cflags="$c_flags$cflags" if ($c_flags ne ""); }
223 227
224$ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); 228$ex_libs="$l_flags$ex_libs" if ($l_flags ne "");
225 229
@@ -273,6 +277,8 @@ LFLAGS=$lflags
273 277
274BN_ASM_OBJ=$bn_asm_obj 278BN_ASM_OBJ=$bn_asm_obj
275BN_ASM_SRC=$bn_asm_src 279BN_ASM_SRC=$bn_asm_src
280BNCO_ASM_OBJ=$bnco_asm_obj
281BNCO_ASM_SRC=$bnco_asm_src
276DES_ENC_OBJ=$des_enc_obj 282DES_ENC_OBJ=$des_enc_obj
277DES_ENC_SRC=$des_enc_src 283DES_ENC_SRC=$des_enc_src
278BF_ENC_OBJ=$bf_enc_obj 284BF_ENC_OBJ=$bf_enc_obj
@@ -379,6 +385,7 @@ $banner
379 \$(MKDIR) \$(INC_D) 385 \$(MKDIR) \$(INC_D)
380 386
381headers: \$(HEADER) \$(EXHEADER) 387headers: \$(HEADER) \$(EXHEADER)
388 @
382 389
383lib: \$(LIBS_DEP) 390lib: \$(LIBS_DEP)
384 391
@@ -539,6 +546,11 @@ foreach (values %lib_nam)
539 $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/; 546 $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/;
540 $rules.=&do_asm_rule($bn_asm_obj,$bn_asm_src); 547 $rules.=&do_asm_rule($bn_asm_obj,$bn_asm_src);
541 } 548 }
549 if (($bnco_asm_obj ne "") && ($_ eq "CRYPTO"))
550 {
551 $lib_obj .= "\$(BNCO_ASM_OBJ)";
552 $rules.=&do_asm_rule($bnco_asm_obj,$bnco_asm_src);
553 }
542 if (($des_enc_obj ne "") && ($_ eq "CRYPTO")) 554 if (($des_enc_obj ne "") && ($_ eq "CRYPTO"))
543 { 555 {
544 $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/; 556 $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/;
@@ -601,6 +613,14 @@ $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPT
601$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); 613$rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)");
602 614
603print $defs; 615print $defs;
616
617if ($platform eq "linux-elf") {
618 print <<"EOF";
619# Generate perlasm output files
620%.cpp:
621 (cd \$(\@D)/..; PERL=perl make -f Makefile.ssl asm/\$(\@F))
622EOF
623}
604print "###################################################################\n"; 624print "###################################################################\n";
605print $rules; 625print $rules;
606 626
@@ -652,6 +672,7 @@ sub var_add
652 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock; 672 @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock;
653 673
654 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2; 674 @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2;
675 @a=grep(!/(^md4)|(_md4$)/,@a) if $no_md4;
655 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5; 676 @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5;
656 @a=grep(!/(rmd)|(ripemd)/,@a) if $no_rmd160; 677 @a=grep(!/(rmd)|(ripemd)/,@a) if $no_rmd160;
657 678
@@ -717,6 +738,7 @@ sub do_defs
717 { $pf=".c"; } 738 { $pf=".c"; }
718 else { $pf=$postfix; } 739 else { $pf=$postfix; }
719 if ($_ =~ /BN_ASM/) { $t="$_ "; } 740 if ($_ =~ /BN_ASM/) { $t="$_ "; }
741 elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; }
720 elsif ($_ =~ /DES_ENC/) { $t="$_ "; } 742 elsif ($_ =~ /DES_ENC/) { $t="$_ "; }
721 elsif ($_ =~ /BF_ENC/) { $t="$_ "; } 743 elsif ($_ =~ /BF_ENC/) { $t="$_ "; }
722 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; } 744 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; }
@@ -840,6 +862,7 @@ sub read_options
840 elsif (/^no-bf$/) { $no_bf=1; } 862 elsif (/^no-bf$/) { $no_bf=1; }
841 elsif (/^no-cast$/) { $no_cast=1; } 863 elsif (/^no-cast$/) { $no_cast=1; }
842 elsif (/^no-md2$/) { $no_md2=1; } 864 elsif (/^no-md2$/) { $no_md2=1; }
865 elsif (/^no-md4$/) { $no_md4=1; }
843 elsif (/^no-md5$/) { $no_md5=1; } 866 elsif (/^no-md5$/) { $no_md5=1; }
844 elsif (/^no-sha$/) { $no_sha=1; } 867 elsif (/^no-sha$/) { $no_sha=1; }
845 elsif (/^no-sha1$/) { $no_sha1=1; } 868 elsif (/^no-sha1$/) { $no_sha1=1; }
@@ -865,8 +888,10 @@ sub read_options
865 elsif (/^rsaref$/) { $rsaref=1; } 888 elsif (/^rsaref$/) { $rsaref=1; }
866 elsif (/^gcc$/) { $gcc=1; } 889 elsif (/^gcc$/) { $gcc=1; }
867 elsif (/^debug$/) { $debug=1; } 890 elsif (/^debug$/) { $debug=1; }
891 elsif (/^profile$/) { $profile=1; }
868 elsif (/^shlib$/) { $shlib=1; } 892 elsif (/^shlib$/) { $shlib=1; }
869 elsif (/^dll$/) { $shlib=1; } 893 elsif (/^dll$/) { $shlib=1; }
894 elsif (/^shared$/) { } # We just need to ignore it for now...
870 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } 895 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; }
871 elsif (/^-[lL].*$/) { $l_flags.="$_ "; } 896 elsif (/^-[lL].*$/) { $l_flags.="$_ "; }
872 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/) 897 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl
index 4e2845a4e1..cc41a1813e 100644
--- a/src/lib/libcrypto/util/mkdef.pl
+++ b/src/lib/libcrypto/util/mkdef.pl
@@ -5,20 +5,78 @@
5# It does this by parsing the header files and looking for the 5# It does this by parsing the header files and looking for the
6# prototyped functions: it then prunes the output. 6# prototyped functions: it then prunes the output.
7# 7#
8# Intermediary files are created, call libeay.num and ssleay.num,...
9# Previously, they had the following format:
10#
11# routine-name nnnn
12#
13# But that isn't enough for a number of reasons, the first on being that
14# this format is (needlessly) very Win32-centric, and even then...
15# One of the biggest problems is that there's no information about what
16# routines should actually be used, which varies with what crypto algorithms
17# are disabled. Also, some operating systems (for example VMS with VAX C)
18# need to keep track of the global variables as well as the functions.
19#
20# So, a remake of this script is done so as to include information on the
21# kind of symbol it is (function or variable) and what algorithms they're
22# part of. This will allow easy translating to .def files or the corresponding
23# file in other operating systems (a .opt file for VMS, possibly with a .mar
24# file).
25#
26# The format now becomes:
27#
28# routine-name nnnn info
29#
30# and the "info" part is actually a colon-separated string of fields with
31# the following meaning:
32#
33# existence:platform:kind:algorithms
34#
35# - "existence" can be "EXIST" or "NOEXIST" depending on if the symbol is
36# found somewhere in the source,
37# - "platforms" is empty if it exists on all platforms, otherwise it contains
38# comma-separated list of the platform, just as they are if the symbol exists
39# for those platforms, or prepended with a "!" if not. This helps resolve
40# symbol name replacements for platforms where the names are too long for the
41# compiler or linker, or if the systems is case insensitive and there is a
42# clash. This script assumes those redefinitions are place in the file
43# crypto/symhacks.h.
44# The semantics for the platforms list is a bit complicated. The rule of
45# thumb is that the list is exclusive, but it seems to mean different things.
46# So, if the list is all negatives (like "!VMS,!WIN16"), the symbol exists
47# on all platforms except those listed. If the list is all positives (like
48# "VMS,WIN16"), the symbol exists only on those platforms and nowhere else.
49# The combination of positives and negatives will act as if the positives
50# weren't there.
51# - "kind" is "FUNCTION" or "VARIABLE". The meaning of that is obvious.
52# - "algorithms" is a comma-separated list of algorithm names. This helps
53# exclude symbols that are part of an algorithm that some user wants to
54# exclude.
55#
8 56
9my $crypto_num="util/libeay.num"; 57my $crypto_num= "util/libeay.num";
10my $ssl_num= "util/ssleay.num"; 58my $ssl_num= "util/ssleay.num";
11 59
12my $do_update = 0; 60my $do_update = 0;
61my $do_rewrite = 0;
13my $do_crypto = 0; 62my $do_crypto = 0;
14my $do_ssl = 0; 63my $do_ssl = 0;
15my $do_ctest = 0; 64my $do_ctest = 0;
65my $do_ctestall = 0;
16my $rsaref = 0; 66my $rsaref = 0;
17 67
18my $W32=1; 68my $VMS=0;
69my $W32=0;
70my $W16=0;
19my $NT=0; 71my $NT=0;
20# Set this to make typesafe STACK definitions appear in DEF 72# Set this to make typesafe STACK definitions appear in DEF
21my $safe_stack_def = 1; 73my $safe_stack_def = 0;
74
75my @known_platforms = ( "__FreeBSD__", "VMS", "WIN16", "WIN32",
76 "WINNT", "PERL5", "NeXT" );
77my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
78 "CAST", "MD2", "MD4", "MD5", "SHA", "RIPEMD",
79 "MDC2", "RSA", "DSA", "DH", "HMAC", "FP_API" );
22 80
23my $options=""; 81my $options="";
24open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n"; 82open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n";
@@ -31,24 +89,31 @@ close(IN);
31# defined with ifndef(NO_XXX) are not included in the .def file, and everything 89# defined with ifndef(NO_XXX) are not included in the .def file, and everything
32# in directory xxx is ignored. 90# in directory xxx is ignored.
33my $no_rc2; my $no_rc4; my $no_rc5; my $no_idea; my $no_des; my $no_bf; 91my $no_rc2; my $no_rc4; my $no_rc5; my $no_idea; my $no_des; my $no_bf;
34my $no_cast; my $no_md2; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2; 92my $no_cast;
93my $no_md2; my $no_md4; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2;
35my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; 94my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0;
95my $no_fp_api;
36 96
37foreach (@ARGV, split(/ /, $options)) 97foreach (@ARGV, split(/ /, $options))
38 { 98 {
39 $W32=1 if $_ eq "32"; 99 $W32=1 if $_ eq "32";
40 $W32=0 if $_ eq "16"; 100 $W16=1 if $_ eq "16";
41 if($_ eq "NT") { 101 if($_ eq "NT") {
42 $W32 = 1; 102 $W32 = 1;
43 $NT = 1; 103 $NT = 1;
44 } 104 }
105 $VMS=1 if $_ eq "VMS";
106 $rsaref=1 if $_ eq "rsaref";
107
45 $do_ssl=1 if $_ eq "ssleay"; 108 $do_ssl=1 if $_ eq "ssleay";
46 $do_ssl=1 if $_ eq "ssl"; 109 $do_ssl=1 if $_ eq "ssl";
47 $do_crypto=1 if $_ eq "libeay"; 110 $do_crypto=1 if $_ eq "libeay";
48 $do_crypto=1 if $_ eq "crypto"; 111 $do_crypto=1 if $_ eq "crypto";
49 $do_update=1 if $_ eq "update"; 112 $do_update=1 if $_ eq "update";
113 $do_rewrite=1 if $_ eq "rewrite";
50 $do_ctest=1 if $_ eq "ctest"; 114 $do_ctest=1 if $_ eq "ctest";
51 $rsaref=1 if $_ eq "rsaref"; 115 $do_ctestall=1 if $_ eq "ctestall";
116 #$safe_stack_def=1 if $_ eq "-DDEBUG_SAFESTACK";
52 117
53 if (/^no-rc2$/) { $no_rc2=1; } 118 if (/^no-rc2$/) { $no_rc2=1; }
54 elsif (/^no-rc4$/) { $no_rc4=1; } 119 elsif (/^no-rc4$/) { $no_rc4=1; }
@@ -58,6 +123,7 @@ foreach (@ARGV, split(/ /, $options))
58 elsif (/^no-bf$/) { $no_bf=1; } 123 elsif (/^no-bf$/) { $no_bf=1; }
59 elsif (/^no-cast$/) { $no_cast=1; } 124 elsif (/^no-cast$/) { $no_cast=1; }
60 elsif (/^no-md2$/) { $no_md2=1; } 125 elsif (/^no-md2$/) { $no_md2=1; }
126 elsif (/^no-md4$/) { $no_md4=1; }
61 elsif (/^no-md5$/) { $no_md5=1; } 127 elsif (/^no-md5$/) { $no_md5=1; }
62 elsif (/^no-sha$/) { $no_sha=1; } 128 elsif (/^no-sha$/) { $no_sha=1; }
63 elsif (/^no-ripemd$/) { $no_ripemd=1; } 129 elsif (/^no-ripemd$/) { $no_ripemd=1; }
@@ -69,6 +135,16 @@ foreach (@ARGV, split(/ /, $options))
69 } 135 }
70 136
71 137
138# If no platform is given, assume WIN32
139if ($W32 + $W16 + $VMS == 0) {
140 $W32 = 1;
141}
142
143# Add extra knowledge
144if ($W16) {
145 $no_fp_api=1;
146}
147
72if (!$do_ssl && !$do_crypto) 148if (!$do_ssl && !$do_crypto)
73 { 149 {
74 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT ] [rsaref]\n"; 150 print STDERR "usage: $0 ( ssl | crypto ) [ 16 | 32 | NT ] [rsaref]\n";
@@ -91,6 +167,7 @@ $crypto.=" crypto/rc2/rc2.h" unless $no_rc2;
91$crypto.=" crypto/bf/blowfish.h" unless $no_bf; 167$crypto.=" crypto/bf/blowfish.h" unless $no_bf;
92$crypto.=" crypto/cast/cast.h" unless $no_cast; 168$crypto.=" crypto/cast/cast.h" unless $no_cast;
93$crypto.=" crypto/md2/md2.h" unless $no_md2; 169$crypto.=" crypto/md2/md2.h" unless $no_md2;
170$crypto.=" crypto/md4/md4.h" unless $no_md4;
94$crypto.=" crypto/md5/md5.h" unless $no_md5; 171$crypto.=" crypto/md5/md5.h" unless $no_md5;
95$crypto.=" crypto/mdc2/mdc2.h" unless $no_mdc2; 172$crypto.=" crypto/mdc2/mdc2.h" unless $no_mdc2;
96$crypto.=" crypto/sha/sha.h" unless $no_sha; 173$crypto.=" crypto/sha/sha.h" unless $no_sha;
@@ -102,9 +179,11 @@ $crypto.=" crypto/dsa/dsa.h" unless $no_dsa;
102$crypto.=" crypto/dh/dh.h" unless $no_dh; 179$crypto.=" crypto/dh/dh.h" unless $no_dh;
103$crypto.=" crypto/hmac/hmac.h" unless $no_hmac; 180$crypto.=" crypto/hmac/hmac.h" unless $no_hmac;
104 181
182$crypto.=" crypto/engine/engine.h";
105$crypto.=" crypto/stack/stack.h"; 183$crypto.=" crypto/stack/stack.h";
106$crypto.=" crypto/buffer/buffer.h"; 184$crypto.=" crypto/buffer/buffer.h";
107$crypto.=" crypto/bio/bio.h"; 185$crypto.=" crypto/bio/bio.h";
186$crypto.=" crypto/dso/dso.h";
108$crypto.=" crypto/lhash/lhash.h"; 187$crypto.=" crypto/lhash/lhash.h";
109$crypto.=" crypto/conf/conf.h"; 188$crypto.=" crypto/conf/conf.h";
110$crypto.=" crypto/txt_db/txt_db.h"; 189$crypto.=" crypto/txt_db/txt_db.h";
@@ -125,25 +204,41 @@ $crypto.=" crypto/rand/rand.h";
125$crypto.=" crypto/comp/comp.h"; 204$crypto.=" crypto/comp/comp.h";
126$crypto.=" crypto/tmdiff.h"; 205$crypto.=" crypto/tmdiff.h";
127 206
128my @ssl_func = &do_defs("SSLEAY", $ssl); 207my $symhacks="crypto/symhacks.h";
129my @crypto_func = &do_defs("LIBEAY", $crypto);
130 208
209my @ssl_symbols = &do_defs("SSLEAY", $ssl, $symhacks);
210my @crypto_symbols = &do_defs("LIBEAY", $crypto, $symhacks);
131 211
132if ($do_update) { 212if ($do_update) {
133 213
134if ($do_ssl == 1) { 214if ($do_ssl == 1) {
135 open(OUT, ">>$ssl_num"); 215
136 &update_numbers(*OUT,"SSLEAY",*ssl_list,$max_ssl, @ssl_func); 216 &maybe_add_info("SSLEAY",*ssl_list,@ssl_symbols);
217 if ($do_rewrite == 1) {
218 open(OUT, ">$ssl_num");
219 &rewrite_numbers(*OUT,"SSLEAY",*ssl_list,@ssl_symbols);
220 close OUT;
221 } else {
222 open(OUT, ">>$ssl_num");
223 }
224 &update_numbers(*OUT,"SSLEAY",*ssl_list,$max_ssl,@ssl_symbols);
137 close OUT; 225 close OUT;
138} 226}
139 227
140if($do_crypto == 1) { 228if($do_crypto == 1) {
141 open(OUT, ">>$crypto_num"); 229
142 &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto, @crypto_func); 230 &maybe_add_info("LIBEAY",*crypto_list,@crypto_symbols);
231 if ($do_rewrite == 1) {
232 open(OUT, ">$crypto_num");
233 &rewrite_numbers(*OUT,"LIBEAY",*crypto_list,@crypto_symbols);
234 } else {
235 open(OUT, ">>$crypto_num");
236 }
237 &update_numbers(*OUT,"LIBEAY",*crypto_list,$max_crypto,@crypto_symbols);
143 close OUT; 238 close OUT;
144} 239}
145 240
146} elsif ($do_ctest) { 241} elsif ($do_ctest || $do_ctestall) {
147 242
148 print <<"EOF"; 243 print <<"EOF";
149 244
@@ -154,20 +249,20 @@ if($do_crypto == 1) {
154int main() 249int main()
155{ 250{
156EOF 251EOF
157 &print_test_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func) 252 &print_test_file(*STDOUT,"SSLEAY",*ssl_list,$do_ctestall,@ssl_symbols)
158 if $do_ssl == 1; 253 if $do_ssl == 1;
159 254
160 &print_test_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func) 255 &print_test_file(*STDOUT,"LIBEAY",*crypto_list,$do_ctestall,@crypto_symbols)
161 if $do_crypto == 1; 256 if $do_crypto == 1;
162 257
163 print "}\n"; 258 print "}\n";
164 259
165} else { 260} else {
166 261
167 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_func) 262 &print_def_file(*STDOUT,"SSLEAY",*ssl_list,@ssl_symbols)
168 if $do_ssl == 1; 263 if $do_ssl == 1;
169 264
170 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_func) 265 &print_def_file(*STDOUT,"LIBEAY",*crypto_list,@crypto_symbols)
171 if $do_crypto == 1; 266 if $do_crypto == 1;
172 267
173} 268}
@@ -175,42 +270,30 @@ EOF
175 270
176sub do_defs 271sub do_defs
177{ 272{
178 my($name,$files)=@_; 273 my($name,$files,$symhacksfile)=@_;
179 my $file; 274 my $file;
180 my @ret; 275 my @ret;
181 my %funcs; 276 my %syms;
277 my %platform; # For anything undefined, we assume ""
278 my %kind; # For anything undefined, we assume "FUNCTION"
279 my %algorithm; # For anything undefined, we assume ""
280 my %rename;
182 my $cpp; 281 my $cpp;
183 282
184 foreach $file (split(/\s+/,$files)) 283 foreach $file (split(/\s+/,$symhacksfile." ".$files))
185 { 284 {
186 open(IN,"<$file") || die "unable to open $file:$!\n"; 285 open(IN,"<$file") || die "unable to open $file:$!\n";
187 my $line = "", my $def= ""; 286 my $line = "", my $def= "";
188 my %tag = ( 287 my %tag = (
189 FreeBSD => 0, 288 (map { $_ => 0 } @known_platforms),
289 (map { "NO_".$_ => 0 } @known_algorithms),
190 NOPROTO => 0, 290 NOPROTO => 0,
191 WIN16 => 0,
192 PERL5 => 0, 291 PERL5 => 0,
193 _WINDLL => 0, 292 _WINDLL => 0,
194 NO_FP_API => 0,
195 CONST_STRICT => 0, 293 CONST_STRICT => 0,
196 TRUE => 1, 294 TRUE => 1,
197 NO_RC2 => 0,
198 NO_RC4 => 0,
199 NO_RC5 => 0,
200 NO_IDEA => 0,
201 NO_DES => 0,
202 NO_BF => 0,
203 NO_CAST => 0,
204 NO_MD2 => 0,
205 NO_MD5 => 0,
206 NO_SHA => 0,
207 NO_RIPEMD => 0,
208 NO_MDC2 => 0,
209 NO_RSA => 0,
210 NO_DSA => 0,
211 NO_DH => 0,
212 NO_HMAC => 0,
213 ); 295 );
296 my $symhacking = $file eq $symhacksfile;
214 while(<IN>) { 297 while(<IN>) {
215 last if (/BEGIN ERROR CODES/); 298 last if (/BEGIN ERROR CODES/);
216 if ($line ne '') { 299 if ($line ne '') {
@@ -223,9 +306,9 @@ sub do_defs
223 next; 306 next;
224 } 307 }
225 308
226 $cpp = 1 if /^#.*ifdef.*cplusplus/; 309 $cpp = 1 if /^\#.*ifdef.*cplusplus/;
227 if ($cpp) { 310 if ($cpp) {
228 $cpp = 0 if /^#.*endif/; 311 $cpp = 0 if /^\#.*endif/;
229 next; 312 next;
230 } 313 }
231 314
@@ -234,115 +317,132 @@ sub do_defs
234 if (/^\#\s*ifndef (.*)/) { 317 if (/^\#\s*ifndef (.*)/) {
235 push(@tag,$1); 318 push(@tag,$1);
236 $tag{$1}=-1; 319 $tag{$1}=-1;
237 next;
238 } elsif (/^\#\s*if !defined\(([^\)]+)\)/) { 320 } elsif (/^\#\s*if !defined\(([^\)]+)\)/) {
239 push(@tag,$1); 321 push(@tag,$1);
240 $tag{$1}=-1; 322 $tag{$1}=-1;
241 next;
242 } elsif (/^\#\s*ifdef (.*)/) { 323 } elsif (/^\#\s*ifdef (.*)/) {
243 push(@tag,$1); 324 push(@tag,$1);
244 $tag{$1}=1; 325 $tag{$1}=1;
245 next; 326 } elsif (/^\#\s*if defined\(([^\)]+)\)/) {
246 } elsif (/^\#\s*if defined(.*)/) {
247 push(@tag,$1); 327 push(@tag,$1);
248 $tag{$1}=1; 328 $tag{$1}=1;
249 next; 329 } elsif (/^\#\s*error\s+(\w+) is disabled\./) {
330 if ($tag[$#tag] eq "NO_".$1) {
331 $tag{$tag[$#tag]}=2;
332 }
250 } elsif (/^\#\s*endif/) { 333 } elsif (/^\#\s*endif/) {
251 $tag{$tag[$#tag]}=0; 334 if ($tag{$tag[$#tag]}==2) {
335 $tag{$tag[$#tag]}=-1;
336 } else {
337 $tag{$tag[$#tag]}=0;
338 }
252 pop(@tag); 339 pop(@tag);
253 next;
254 } elsif (/^\#\s*else/) { 340 } elsif (/^\#\s*else/) {
255 my $t=$tag[$#tag]; 341 my $t=$tag[$#tag];
256 $tag{$t}= -$tag{$t}; 342 $tag{$t}= -$tag{$t};
257 next;
258 } elsif (/^\#\s*if\s+1/) { 343 } elsif (/^\#\s*if\s+1/) {
259 # Dummy tag 344 # Dummy tag
260 push(@tag,"TRUE"); 345 push(@tag,"TRUE");
261 $tag{"TRUE"}=1; 346 $tag{"TRUE"}=1;
262 next;
263 } elsif (/^\#\s*if\s+0/) { 347 } elsif (/^\#\s*if\s+0/) {
264 # Dummy tag 348 # Dummy tag
265 push(@tag,"TRUE"); 349 push(@tag,"TRUE");
266 $tag{"TRUE"}=-1; 350 $tag{"TRUE"}=-1;
267 next; 351 } elsif (/^\#\s*define\s+(\w+)\s+(\w+)/
268 } elsif (/^\#/) { 352 && $symhacking) {
353 my $s = $1;
354 my $a =
355 $2.":".join(",", grep(!/^$/,
356 map { $tag{$_} == 1 ?
357 $_ : "" }
358 @known_platforms));
359 $rename{$s} = $a;
360 }
361 if (/^\#/) {
362 my @p = grep(!/^$/,
363 map { $tag{$_} == 1 ? $_ :
364 $tag{$_} == -1 ? "!".$_ : "" }
365 @known_platforms);
366 my @a = grep(!/^$/,
367 map { $tag{"NO_".$_} == -1 ? $_ : "" }
368 @known_algorithms);
369 $def .= "#INFO:".join(',',@p).":".join(',',@a).";";
269 next; 370 next;
270 } 371 }
271 if ($safe_stack_def && 372 if (/^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) {
272 /^\s*DECLARE_STACK_OF\s*\(\s*(\w*)\s*\)/) { 373 next;
273 $funcs{"sk_${1}_new"} = 1; 374 } elsif (/^\s*DECLARE_PKCS12_STACK_OF\s*\(\s*(\w*)\s*\)/) {
274 $funcs{"sk_${1}_new_null"} = 1; 375 next;
275 $funcs{"sk_${1}_free"} = 1; 376 } elsif (/^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) {
276 $funcs{"sk_${1}_num"} = 1; 377 next;
277 $funcs{"sk_${1}_value"} = 1;
278 $funcs{"sk_${1}_set"} = 1;
279 $funcs{"sk_${1}_zero"} = 1;
280 $funcs{"sk_${1}_push"} = 1;
281 $funcs{"sk_${1}_unshift"} = 1;
282 $funcs{"sk_${1}_find"} = 1;
283 $funcs{"sk_${1}_delete"} = 1;
284 $funcs{"sk_${1}_delete_ptr"} = 1;
285 $funcs{"sk_${1}_insert"} = 1;
286 $funcs{"sk_${1}_set_cmp_func"} = 1;
287 $funcs{"sk_${1}_dup"} = 1;
288 $funcs{"sk_${1}_pop_free"} = 1;
289 $funcs{"sk_${1}_shift"} = 1;
290 $funcs{"sk_${1}_pop"} = 1;
291 $funcs{"sk_${1}_sort"} = 1;
292 } elsif ($safe_stack_def &&
293 /^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) {
294 $funcs{"d2i_ASN1_SET_OF_${1}"} = 1;
295 $funcs{"i2d_ASN1_SET_OF_${1}"} = 1;
296 } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ || 378 } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
297 /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) { 379 /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) {
298 if($W32) { 380 # Things not in Win16
299 $funcs{"PEM_read_${1}"} = 1; 381 $syms{"PEM_read_${1}"} = 1;
300 $funcs{"PEM_write_${1}"} = 1; 382 $platform{"PEM_read_${1}"} = "!WIN16";
383 $syms{"PEM_write_${1}"} = 1;
384 $platform{"PEM_write_${1}"} = "!WIN16";
385 # Things that are everywhere
386 $syms{"PEM_read_bio_${1}"} = 1;
387 $syms{"PEM_write_bio_${1}"} = 1;
388 if ($1 eq "RSAPrivateKey" ||
389 $1 eq "RSAPublicKey" ||
390 $1 eq "RSA_PUBKEY") {
391 $algorithm{"PEM_read_${1}"} = "RSA";
392 $algorithm{"PEM_write_${1}"} = "RSA";
393 $algorithm{"PEM_read_bio_${1}"} = "RSA";
394 $algorithm{"PEM_write_bio_${1}"} = "RSA";
395 }
396 elsif ($1 eq "DSAPrivateKey" ||
397 $1 eq "DSAparams" ||
398 $1 eq "RSA_PUBKEY") {
399 $algorithm{"PEM_read_${1}"} = "DSA";
400 $algorithm{"PEM_write_${1}"} = "DSA";
401 $algorithm{"PEM_read_bio_${1}"} = "DSA";
402 $algorithm{"PEM_write_bio_${1}"} = "DSA";
403 }
404 elsif ($1 eq "DHparams") {
405 $algorithm{"PEM_read_${1}"} = "DH";
406 $algorithm{"PEM_write_${1}"} = "DH";
407 $algorithm{"PEM_read_bio_${1}"} = "DH";
408 $algorithm{"PEM_write_bio_${1}"} = "DH";
301 } 409 }
302 $funcs{"PEM_read_bio_${1}"} = 1;
303 $funcs{"PEM_write_bio_${1}"} = 1;
304 } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ || 410 } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ ||
305 /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) { 411 /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) {
306 if($W32) { 412 # Things not in Win16
307 $funcs{"PEM_write_${1}"} = 1; 413 $syms{"PEM_write_${1}"} = 1;
414 $platform{"PEM_write_${1}"} .= ",!WIN16";
415 # Things that are everywhere
416 $syms{"PEM_write_bio_${1}"} = 1;
417 if ($1 eq "RSAPrivateKey" ||
418 $1 eq "RSAPublicKey" ||
419 $1 eq "RSA_PUBKEY") {
420 $algorithm{"PEM_write_${1}"} = "RSA";
421 $algorithm{"PEM_write_bio_${1}"} = "RSA";
422 }
423 elsif ($1 eq "DSAPrivateKey" ||
424 $1 eq "DSAparams" ||
425 $1 eq "RSA_PUBKEY") {
426 $algorithm{"PEM_write_${1}"} = "DSA";
427 $algorithm{"PEM_write_bio_${1}"} = "DSA";
428 }
429 elsif ($1 eq "DHparams") {
430 $algorithm{"PEM_write_${1}"} = "DH";
431 $algorithm{"PEM_write_bio_${1}"} = "DH";
308 } 432 }
309 $funcs{"PEM_write_bio_${1}"} = 1;
310 } elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ || 433 } elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ ||
311 /^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) { 434 /^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) {
312 if($W32) { 435 # Things not in Win16
313 $funcs{"PEM_read_${1}"} = 1; 436 $syms{"PEM_read_${1}"} = 1;
314 } 437 $platform{"PEM_read_${1}"} .= ",!WIN16";
315 $funcs{"PEM_read_bio_${1}"} = 1; 438 # Things that are everywhere
439 $syms{"PEM_read_bio_${1}"} = 1;
316 } elsif ( 440 } elsif (
317 ($tag{'TRUE'} != -1) && 441 ($tag{'TRUE'} != -1)
318 ($tag{'FreeBSD'} != 1) && 442 && ($tag{'CONST_STRICT'} != 1)
319 ($tag{'CONST_STRICT'} != 1) && 443 )
320 (($W32 && ($tag{'WIN16'} != 1)) ||
321 (!$W32 && ($tag{'WIN16'} != -1))) &&
322 ($tag{'PERL5'} != 1) &&
323# ($tag{'_WINDLL'} != -1) &&
324 ((!$W32 && $tag{'_WINDLL'} != -1) ||
325 ($W32 && $tag{'_WINDLL'} != 1)) &&
326 ((($tag{'NO_FP_API'} != 1) && $W32) ||
327 (($tag{'NO_FP_API'} != -1) && !$W32)) &&
328 ($tag{'NO_RC2'} == 0 || !$no_rc2) &&
329 ($tag{'NO_RC4'} == 0 || !$no_rc4) &&
330 ($tag{'NO_RC5'} == 0 || !$no_rc5) &&
331 ($tag{'NO_IDEA'} == 0 || !$no_idea) &&
332 ($tag{'NO_DES'} == 0 || !$no_des) &&
333 ($tag{'NO_BF'} == 0 || !$no_bf) &&
334 ($tag{'NO_CAST'} == 0 || !$no_cast) &&
335 ($tag{'NO_MD2'} == 0 || !$no_md2) &&
336 ($tag{'NO_MD5'} == 0 || !$no_md5) &&
337 ($tag{'NO_SHA'} == 0 || !$no_sha) &&
338 ($tag{'NO_RIPEMD'} == 0 || !$no_ripemd) &&
339 ($tag{'NO_MDC2'} == 0 || !$no_mdc2) &&
340 ($tag{'NO_RSA'} == 0 || !$no_rsa) &&
341 ($tag{'NO_DSA'} == 0 || !$no_dsa) &&
342 ($tag{'NO_DH'} == 0 || !$no_dh) &&
343 ($tag{'NO_HMAC'} == 0 || !$no_hmac))
344 { 444 {
345 if (/{|\/\*/) { # } 445 if (/\{|\/\*|\([^\)]*$/) {
346 $line = $_; 446 $line = $_;
347 } else { 447 } else {
348 $def .= $_; 448 $def .= $_;
@@ -351,24 +451,26 @@ sub do_defs
351 } 451 }
352 close(IN); 452 close(IN);
353 453
454 my $algs;
455 my $plays;
456
354 foreach (split /;/, $def) { 457 foreach (split /;/, $def) {
458 my $s; my $k = "FUNCTION"; my $p; my $a;
355 s/^[\n\s]*//g; 459 s/^[\n\s]*//g;
356 s/[\n\s]*$//g; 460 s/[\n\s]*$//g;
461 next if(/\#undef/);
357 next if(/typedef\W/); 462 next if(/typedef\W/);
358 next if(/EVP_bf/ and $no_bf); 463 next if(/\#define/);
359 next if(/EVP_cast/ and $no_cast); 464
360 next if(/EVP_des/ and $no_des); 465 if (/^\#INFO:([^:]*):(.*)$/) {
361 next if(/EVP_dss/ and $no_dsa); 466 $plats = $1;
362 next if(/EVP_idea/ and $no_idea); 467 $algs = $2;
363 next if(/EVP_md2/ and $no_md2); 468 next;
364 next if(/EVP_md5/ and $no_md5); 469 } elsif (/^\s*OPENSSL_EXTERN\s.*?(\w+)(\[[0-9]*\])*\s*$/) {
365 next if(/EVP_rc2/ and $no_rc2); 470 $s = $1;
366 next if(/EVP_rc4/ and $no_rc4); 471 $k = "VARIABLE";
367 next if(/EVP_rc5/ and $no_rc5); 472 } elsif (/\(\*(\w*)\([^\)]+/) {
368 next if(/EVP_ripemd/ and $no_ripemd); 473 $s = $1;
369 next if(/EVP_sha/ and $no_sha);
370 if (/\(\*(\w*)\([^\)]+/) {
371 $funcs{$1} = 1;
372 } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s) { 474 } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s) {
373 # K&R C 475 # K&R C
374 next; 476 next;
@@ -379,65 +481,184 @@ sub do_defs
379 } 481 }
380 s/\(void\)//; 482 s/\(void\)//;
381 /(\w+)\W*\(\)/s; 483 /(\w+)\W*\(\)/s;
382 $funcs{$1} = 1; 484 $s = $1;
383 } elsif (/\(/ and not (/=/)) { 485 } elsif (/\(/ and not (/=/)) {
384 print STDERR "File $file: cannot parse: $_;\n"; 486 print STDERR "File $file: cannot parse: $_;\n";
487 next;
488 } else {
489 next;
490 }
491
492 $syms{$s} = 1;
493 $kind{$s} = $k;
494
495 $p = $plats;
496 $a = $algs;
497 $a .= ",BF" if($s =~ /EVP_bf/);
498 $a .= ",CAST" if($s =~ /EVP_cast/);
499 $a .= ",DES" if($s =~ /EVP_des/);
500 $a .= ",DSA" if($s =~ /EVP_dss/);
501 $a .= ",IDEA" if($s =~ /EVP_idea/);
502 $a .= ",MD2" if($s =~ /EVP_md2/);
503 $a .= ",MD4" if($s =~ /EVP_md4/);
504 $a .= ",MD5" if($s =~ /EVP_md5/);
505 $a .= ",RC2" if($s =~ /EVP_rc2/);
506 $a .= ",RC4" if($s =~ /EVP_rc4/);
507 $a .= ",RC5" if($s =~ /EVP_rc5/);
508 $a .= ",RIPEMD" if($s =~ /EVP_ripemd/);
509 $a .= ",SHA" if($s =~ /EVP_sha/);
510 $a .= ",RSA" if($s =~ /EVP_(Open|Seal)(Final|Init)/);
511 $a .= ",RSA" if($s =~ /PEM_Seal(Final|Init|Update)/);
512 $a .= ",RSA" if($s =~ /RSAPrivateKey/);
513 $a .= ",RSA" if($s =~ /SSLv23?_((client|server)_)?method/);
514
515 $platform{$s} .= ','.$p;
516 $algorithm{$s} .= ','.$a;
517
518 if (defined($rename{$s})) {
519 (my $r, my $p) = split(/:/,$rename{$s});
520 my @ip = map { /^!(.*)$/ ? $1 : "!".$_ } split /,/, $p;
521 $syms{$r} = 1;
522 $kind{$r} = $kind{$s}."(".$s.")";
523 $algorithm{$r} = $algorithm{$s};
524 $platform{$r} = $platform{$s}.",".$p;
525 $platform{$s} .= ','.join(',', @ip).','.join(',', @ip);
385 } 526 }
386 } 527 }
387 } 528 }
388 529
389 # Prune the returned functions 530 # Prune the returned symbols
390 531
391 delete $funcs{"SSL_add_dir_cert_subjects_to_stack"}; 532 $platform{"crypt"} .= ",!PERL5,!__FreeBSD__,!NeXT";
392 delete $funcs{"RSA_PKCS1_RSAref"} unless $rsaref;
393 delete $funcs{"bn_dump1"};
394 533
395 if($W32) { 534 delete $syms{"SSL_add_dir_cert_subjects_to_stack"};
396 delete $funcs{"BIO_s_file_internal"}; 535 delete $syms{"bn_dump1"};
397 delete $funcs{"BIO_new_file_internal"}; 536
398 delete $funcs{"BIO_new_fp_internal"}; 537 $platform{"BIO_s_file_internal"} .= ",WIN16";
399 } else { 538 $platform{"BIO_new_file_internal"} .= ",WIN16";
400 if(exists $funcs{"ERR_load_CRYPTO_strings"}) { 539 $platform{"BIO_new_fp_internal"} .= ",WIN16";
401 delete $funcs{"ERR_load_CRYPTO_strings"}; 540
402 $funcs{"ERR_load_CRYPTOlib_strings"} = 1; 541 $platform{"BIO_s_file"} .= ",!WIN16";
542 $platform{"BIO_new_file"} .= ",!WIN16";
543 $platform{"BIO_new_fp"} .= ",!WIN16";
544
545 $platform{"BIO_s_log"} .= ",!WIN32,!WIN16,!macintosh";
546
547 if(exists $syms{"ERR_load_CRYPTO_strings"}) {
548 $platform{"ERR_load_CRYPTO_strings"} .= ",!VMS,!WIN16";
549 $syms{"ERR_load_CRYPTOlib_strings"} = 1;
550 $platform{"ERR_load_CRYPTOlib_strings"} .= ",VMS,WIN16";
551 }
552
553 # Info we know about
554
555 $platform{"RSA_PKCS1_RSAref"} = "RSAREF";
556 $algorithm{"RSA_PKCS1_RSAref"} = "RSA";
557
558 push @ret, map { $_."\\".&info_string($_,"EXIST",
559 $platform{$_},
560 $kind{$_},
561 $algorithm{$_}) } keys %syms;
562
563 return(@ret);
564}
565
566sub info_string {
567 (my $symbol, my $exist, my $platforms, my $kind, my $algorithms) = @_;
568
569 my %a = defined($algorithms) ?
570 map { $_ => 1 } split /,/, $algorithms : ();
571 my $pl = defined($platforms) ? $platforms : "";
572 my %p = map { $_ => 0 } split /,/, $pl;
573 my $k = defined($kind) ? $kind : "FUNCTION";
574 my $ret;
575
576 # We do this, because if there's code like the following, it really
577 # means the function exists in all cases and should therefore be
578 # everywhere. By increasing and decreasing, we may attain 0:
579 #
580 # ifndef WIN16
581 # int foo();
582 # else
583 # int _fat foo();
584 # endif
585 foreach $platform (split /,/, $pl) {
586 if ($platform =~ /^!(.*)$/) {
587 $p{$1}--;
588 } else {
589 $p{$platform}++;
403 } 590 }
404 delete $funcs{"BIO_s_file"};
405 delete $funcs{"BIO_new_file"};
406 delete $funcs{"BIO_new_fp"};
407 } 591 }
408 if (!$NT) { 592 foreach $platform (keys %p) {
409 delete $funcs{"BIO_s_log"}; 593 if ($p{$platform} == 0) { delete $p{$platform}; }
410 } 594 }
411 595
412 push @ret, keys %funcs; 596 delete $p{""};
597 delete $a{""};
413 598
414 return(@ret); 599 $ret = $exist;
600 $ret .= ":".join(',',map { $p{$_} < 0 ? "!".$_ : $_ } keys %p);
601 $ret .= ":".$k;
602 $ret .= ":".join(',',keys %a);
603 return $ret;
604}
605
606sub maybe_add_info {
607 (my $name, *nums, my @symbols) = @_;
608 my $sym;
609 my $new_info = 0;
610
611 print STDERR "Updating $name info\n";
612 foreach $sym (@symbols) {
613 (my $s, my $i) = split /\\/, $sym;
614 $i =~ s/^(.*?:.*?:\w+)(\(\w+\))?/$1/;
615 if (defined($nums{$s})) {
616 (my $n, my $dummy) = split /\\/, $nums{$s};
617 if (!defined($dummy) || $i ne $dummy) {
618 $nums{$s} = $n."\\".$i;
619 $new_info++;
620 #print STDERR "DEBUG: maybe_add_info for $s: \"$dummy\" => \"$i\"\n";
621 }
622 }
623 }
624 if ($new_info) {
625 print STDERR "$new_info old symbols got an info update\n";
626 if (!$do_rewrite) {
627 print STDERR "You should do a rewrite to fix this.\n";
628 }
629 } else {
630 print STDERR "No old symbols needed info update\n";
631 }
415} 632}
416 633
417sub print_test_file 634sub print_test_file
418{ 635{
419 (*OUT,my $name,*nums,my @functions)=@_; 636 (*OUT,my $name,*nums,my @symbols)=@_;
420 my $n = 1; my @e; my @r; 637 my $n = 1; my @e; my @r;
421 my $func; 638 my $sym; my $prev = ""; my $prefSSLeay;
422 639
423 (@e)=grep(/^SSLeay/,@functions); 640 (@e)=grep(/^SSLeay\\.*?:.*?:FUNCTION/,@symbols);
424 (@r)=grep(!/^SSLeay/,@functions); 641 (@r)=grep(/^\w+\\.*?:.*?:FUNCTION/ && !/^SSLeay\\.*?:.*?:FUNCTION/,@symbols);
425 @functions=((sort @e),(sort @r)); 642 @symbols=((sort @e),(sort @r));
426 643
427 foreach $func (@functions) { 644 foreach $sym (@symbols) {
428 if (!defined($nums{$func})) { 645 (my $s, my $i) = $sym =~ /^(.*?)\\(.*)$/;
429 printf STDERR "$func does not have a number assigned\n" 646 if ($s ne $prev) {
430 if(!$do_update); 647 if (!defined($nums{$sym})) {
431 } else { 648 printf STDERR "Warning: $sym does not have a number assigned\n"
432 $n=$nums{$func}; 649 if(!$do_update);
433 print OUT "\t$func();\n"; 650 } else {
651 $n=$nums{$s};
652 print OUT "\t$s();\n";
653 }
434 } 654 }
655 $prev = $s; # To avoid duplicates...
435 } 656 }
436} 657}
437 658
438sub print_def_file 659sub print_def_file
439{ 660{
440 (*OUT,my $name,*nums,my @functions)=@_; 661 (*OUT,my $name,*nums,my @symbols)=@_;
441 my $n = 1; my @e; my @r; 662 my $n = 1; my @e; my @r;
442 663
443 if ($W32) 664 if ($W32)
@@ -471,18 +692,61 @@ EOF
471 692
472 print "EXPORTS\n"; 693 print "EXPORTS\n";
473 694
695 (@e)=grep(/^SSLeay\\.*?:.*?:FUNCTION/,@symbols);
696 (@r)=grep(/^\w+\\.*?:.*?:FUNCTION/ && !/^SSLeay\\.*?:.*?:FUNCTION/,@symbols);
697 @symbols=((sort @e),(sort @r));
474 698
475 (@e)=grep(/^SSLeay/,@functions);
476 (@r)=grep(!/^SSLeay/,@functions);
477 @functions=((sort @e),(sort @r));
478 699
479 foreach $func (@functions) { 700 foreach $sym (@symbols) {
480 if (!defined($nums{$func})) { 701 (my $s, my $i) = $sym =~ /^(.*?)\\(.*)$/;
481 printf STDERR "$func does not have a number assigned\n" 702 if (!defined($nums{$s})) {
703 printf STDERR "Warning: $s does not have a number assigned\n"
482 if(!$do_update); 704 if(!$do_update);
483 } else { 705 } else {
484 $n=$nums{$func}; 706 (my $n, my $i) = split /\\/, $nums{$s};
485 printf OUT " %s%-40s@%d\n",($W32)?"":"_",$func,$n; 707 my %pf = ();
708 my @p = split(/,/, ($i =~ /^.*?:(.*?):/,$1));
709 # @p_purged must contain hardware platforms only
710 my @p_purged = ();
711 foreach $ptmp (@p) {
712 next if $ptmp =~ /^!?RSAREF$/;
713 push @p_purged, $ptmp;
714 }
715 my $negatives = !!grep(/^!/,@p);
716 # It is very important to check NT before W32
717 if ((($NT && (!@p_purged
718 || (!$negatives && grep(/^WINNT$/,@p))
719 || ($negatives && !grep(/^!WINNT$/,@p))))
720 || ($W32 && (!@p_purged
721 || (!$negatives && grep(/^WIN32$/,@p))
722 || ($negatives && !grep(/^!WIN32$/,@p))))
723 || ($W16 && (!@p_purged
724 || (!$negatives && grep(/^WIN16$/,@p))
725 || ($negatives && !grep(/^!WIN16$/,@p)))))
726 && (!@p
727 || (!$negatives
728 && ($rsaref || !grep(/^RSAREF$/,@p)))
729 || ($negatives
730 && (!$rsaref || !grep(/^!RSAREF$/,@p))))) {
731 printf OUT " %s%-40s@%d\n",($W32)?"":"_",$s,$n;
732# } else {
733# print STDERR "DEBUG: \"$sym\" (@p):",
734# " rsaref:", !!(!@p
735# || (!$negatives
736# && ($rsaref || !grep(/^RSAREF$/,@p)))
737# || ($negatives
738# && (!$rsaref || !grep(/^!RSAREF$/,@p))))?1:0,
739# " 16:", !!($W16 && (!@p_purged
740# || (!$negatives && grep(/^WIN16$/,@p))
741# || ($negatives && !grep(/^!WIN16$/,@p)))),
742# " 32:", !!($W32 && (!@p_purged
743# || (!$negatives && grep(/^WIN32$/,@p))
744# || ($negatives && !grep(/^!WIN32$/,@p)))),
745# " NT:", !!($NT && (!@p_purged
746# || (!$negatives && grep(/^WINNT$/,@p))
747# || ($negatives && !grep(/^!WINNT$/,@p)))),
748# "\n";
749 }
486 } 750 }
487 } 751 }
488 printf OUT "\n"; 752 printf OUT "\n";
@@ -494,6 +758,8 @@ sub load_numbers
494 my(@a,%ret); 758 my(@a,%ret);
495 759
496 $max_num = 0; 760 $max_num = 0;
761 $num_noinfo = 0;
762 $prev = "";
497 763
498 open(IN,"<$name") || die "unable to open $name:$!\n"; 764 open(IN,"<$name") || die "unable to open $name:$!\n";
499 while (<IN>) { 765 while (<IN>) {
@@ -501,27 +767,138 @@ sub load_numbers
501 s/#.*$//; 767 s/#.*$//;
502 next if /^\s*$/; 768 next if /^\s*$/;
503 @a=split; 769 @a=split;
504 $ret{$a[0]}=$a[1]; 770 if (defined $ret{$a[0]}) {
771 print STDERR "Warning: Symbol '",$a[0],"' redefined. old=",$ret{$a[0]},", new=",$a[1],"\n";
772 }
773 if ($max_num > $a[1]) {
774 print STDERR "Warning: Number decreased from ",$max_num," to ",$a[1],"\n";
775 }
776 if ($max_num == $a[1]) {
777 # This is actually perfectly OK
778 #print STDERR "Warning: Symbol ",$a[0]," has same number as previous ",$prev,": ",$a[1],"\n";
779 }
780 if ($#a < 2) {
781 # Existence will be proven later, in do_defs
782 $ret{$a[0]}=$a[1];
783 $num_noinfo++;
784 } else {
785 $ret{$a[0]}=$a[1]."\\".$a[2]; # \\ is a special marker
786 }
505 $max_num = $a[1] if $a[1] > $max_num; 787 $max_num = $a[1] if $a[1] > $max_num;
788 $prev=$a[0];
789 }
790 if ($num_noinfo) {
791 print STDERR "Warning: $num_noinfo symbols were without info.";
792 if ($do_rewrite) {
793 printf STDERR " The rewrite will fix this.\n";
794 } else {
795 printf STDERR " You should do a rewrite to fix this.\n";
796 }
506 } 797 }
507 close(IN); 798 close(IN);
508 return(%ret); 799 return(%ret);
509} 800}
510 801
802sub parse_number
803{
804 (my $str, my $what) = @_;
805 (my $n, my $i) = split(/\\/,$str);
806 if ($what eq "n") {
807 return $n;
808 } else {
809 return $i;
810 }
811}
812
813sub rewrite_numbers
814{
815 (*OUT,$name,*nums,@symbols)=@_;
816 my $thing;
817
818 print STDERR "Rewriting $name\n";
819
820 my @r = grep(/^\w+\\.*?:.*?:\w+\(\w+\)/,@symbols);
821 my $r; my %r; my %rsyms;
822 foreach $r (@r) {
823 (my $s, my $i) = split /\\/, $r;
824 my $a = $1 if $i =~ /^.*?:.*?:\w+\((\w+)\)/;
825 $i =~ s/^(.*?:.*?:\w+)\(\w+\)/$1/;
826 $r{$a} = $s."\\".$i;
827 $rsyms{$s} = 1;
828 }
829
830 my @s=sort { &parse_number($nums{$a},"n") <=> &parse_number($nums{$b},"n") } keys %nums;
831 foreach $sym (@s) {
832 (my $n, my $i) = split /\\/, $nums{$sym};
833 next if defined($i) && $i =~ /^.*?:.*?:\w+\(\w+\)/;
834 next if defined($rsyms{$sym});
835 $i="NOEXIST::FUNCTION:" if !defined($i) || $i eq "";
836 printf OUT "%s%-40s%d\t%s\n","",$sym,$n,$i;
837 if (exists $r{$sym}) {
838 (my $s, $i) = split /\\/,$r{$sym};
839 printf OUT "%s%-40s%d\t%s\n","",$s,$n,$i;
840 }
841 }
842}
843
511sub update_numbers 844sub update_numbers
512{ 845{
513 (*OUT,$name,*nums,my $start_num, my @functions)=@_; 846 (*OUT,$name,*nums,my $start_num, my @symbols)=@_;
514 my $new_funcs = 0; 847 my $new_syms = 0;
515 print STDERR "Updating $name\n"; 848
516 foreach $func (@functions) { 849 print STDERR "Updating $name numbers\n";
517 if (!exists $nums{$func}) { 850
518 $new_funcs++; 851 my @r = grep(/^\w+\\.*?:.*?:\w+\(\w+\)/,@symbols);
519 printf OUT "%s%-40s%d\n","",$func, ++$start_num; 852 my $r; my %r; my %rsyms;
853 foreach $r (@r) {
854 (my $s, my $i) = split /\\/, $r;
855 my $a = $1 if $i =~ /^.*?:.*?:\w+\((\w+)\)/;
856 $i =~ s/^(.*?:.*?:\w+)\(\w+\)/$1/;
857 $r{$a} = $s."\\".$i;
858 $rsyms{$s} = 1;
859 }
860
861 foreach $sym (@symbols) {
862 (my $s, my $i) = $sym =~ /^(.*?)\\(.*)$/;
863 next if $i =~ /^.*?:.*?:\w+\(\w+\)/;
864 next if defined($rsyms{$sym});
865 die "ERROR: Symbol $sym had no info attached to it."
866 if $i eq "";
867 if (!exists $nums{$s}) {
868 $new_syms++;
869 printf OUT "%s%-40s%d\t%s\n","",$s, ++$start_num,$i;
870 if (exists $r{$s}) {
871 ($s, $i) = split /\\/,$r{$s};
872 printf OUT "%s%-40s%d\t%s\n","",$s, $start_num,$i;
873 }
520 } 874 }
521 } 875 }
522 if($new_funcs) { 876 if($new_syms) {
523 print STDERR "$new_funcs New Functions added\n"; 877 print STDERR "$new_syms New symbols added\n";
524 } else { 878 } else {
525 print STDERR "No New Functions Added\n"; 879 print STDERR "No New symbols Added\n";
526 } 880 }
527} 881}
882
883sub check_existing
884{
885 (*nums, my @symbols)=@_;
886 my %existing; my @remaining;
887 @remaining=();
888 foreach $sym (@symbols) {
889 (my $s, my $i) = $sym =~ /^(.*?)\\(.*)$/;
890 $existing{$s}=1;
891 }
892 foreach $sym (keys %nums) {
893 if (!exists $existing{$sym}) {
894 push @remaining, $sym;
895 }
896 }
897 if(@remaining) {
898 print STDERR "The following symbols do not seem to exist:\n";
899 foreach $sym (@remaining) {
900 print STDERR "\t",$sym,"\n";
901 }
902 }
903}
904
diff --git a/src/lib/libcrypto/util/mkerr.pl b/src/lib/libcrypto/util/mkerr.pl
index 8e18f3c2df..7d98b5234d 100644
--- a/src/lib/libcrypto/util/mkerr.pl
+++ b/src/lib/libcrypto/util/mkerr.pl
@@ -38,7 +38,7 @@ while (@ARGV) {
38} 38}
39 39
40if($recurse) { 40if($recurse) {
41 @source = (<crypto/*.c>, <crypto/*/*.c>, ,<rsaref/*.c>, <ssl/*.c>); 41 @source = (<crypto/*.c>, <crypto/*/*.c>, <rsaref/*.c>, <ssl/*.c>);
42} else { 42} else {
43 @source = @ARGV; 43 @source = @ARGV;
44} 44}
@@ -79,8 +79,11 @@ while (($lib, $hdr) = each %hinc)
79 next if($hdr eq "NONE"); 79 next if($hdr eq "NONE");
80 print STDERR "Scanning header file $hdr\n" if $debug; 80 print STDERR "Scanning header file $hdr\n" if $debug;
81 open(IN, "<$hdr") || die "Can't open Header file $hdr\n"; 81 open(IN, "<$hdr") || die "Can't open Header file $hdr\n";
82 my $line = "", $def= ""; 82 my $line = "", $def= "", $linenr = 0;
83 while(<IN>) { 83 while(<IN>) {
84 $linenr++;
85 print STDERR "line: $linenr\r" if $debug;
86
84 last if(/BEGIN\s+ERROR\s+CODES/); 87 last if(/BEGIN\s+ERROR\s+CODES/);
85 if ($line ne '') { 88 if ($line ne '') {
86 $_ = $line . $_; 89 $_ = $line . $_;
@@ -110,7 +113,12 @@ while (($lib, $hdr) = each %hinc)
110 } 113 }
111 } 114 }
112 115
116 print STDERR " \r" if $debug;
117 $defnr = 0;
113 foreach (split /;/, $def) { 118 foreach (split /;/, $def) {
119 $defnr++;
120 print STDERR "def: $defnr\r" if $debug;
121
114 s/^[\n\s]*//g; 122 s/^[\n\s]*//g;
115 s/[\n\s]*$//g; 123 s/[\n\s]*$//g;
116 next if(/typedef\W/); 124 next if(/typedef\W/);
@@ -136,6 +144,8 @@ while (($lib, $hdr) = each %hinc)
136 } 144 }
137 } 145 }
138 146
147 print STDERR " \r" if $debug;
148
139 next if $reindex; 149 next if $reindex;
140 150
141 # Scan function and reason codes and store them: keep a note of the 151 # Scan function and reason codes and store them: keep a note of the
diff --git a/src/lib/libcrypto/util/mkfiles.pl b/src/lib/libcrypto/util/mkfiles.pl
index 6fa424bd19..470feea76f 100644
--- a/src/lib/libcrypto/util/mkfiles.pl
+++ b/src/lib/libcrypto/util/mkfiles.pl
@@ -10,6 +10,7 @@ my @dirs = (
10".", 10".",
11"crypto", 11"crypto",
12"crypto/md2", 12"crypto/md2",
13"crypto/md4",
13"crypto/md5", 14"crypto/md5",
14"crypto/sha", 15"crypto/sha",
15"crypto/mdc2", 16"crypto/mdc2",
@@ -25,6 +26,7 @@ my @dirs = (
25"crypto/bn", 26"crypto/bn",
26"crypto/rsa", 27"crypto/rsa",
27"crypto/dsa", 28"crypto/dsa",
29"crypto/dso",
28"crypto/dh", 30"crypto/dh",
29"crypto/buffer", 31"crypto/buffer",
30"crypto/bio", 32"crypto/bio",
@@ -43,6 +45,7 @@ my @dirs = (
43"crypto/pkcs7", 45"crypto/pkcs7",
44"crypto/pkcs12", 46"crypto/pkcs12",
45"crypto/comp", 47"crypto/comp",
48"crypto/engine",
46"ssl", 49"ssl",
47"rsaref", 50"rsaref",
48"apps", 51"apps",
diff --git a/src/lib/libcrypto/util/mklink.pl b/src/lib/libcrypto/util/mklink.pl
index de555820ec..d7b997ada7 100644
--- a/src/lib/libcrypto/util/mklink.pl
+++ b/src/lib/libcrypto/util/mklink.pl
@@ -49,7 +49,7 @@ my $to = join('/', @to_path);
49 49
50my $file; 50my $file;
51foreach $file (@files) { 51foreach $file (@files) {
52# print "ln -s $to/$file $from/$file\n"; 52 my $err = "";
53 symlink("$to/$file", "$from/$file"); 53 symlink("$to/$file", "$from/$file") or $err = " [$!]";
54 print $file . " => $from/$file\n"; 54 print $file . " => $from/$file$err\n";
55} 55}
diff --git a/src/lib/libcrypto/util/mkstack.pl b/src/lib/libcrypto/util/mkstack.pl
new file mode 100644
index 0000000000..3ee13fe7c9
--- /dev/null
+++ b/src/lib/libcrypto/util/mkstack.pl
@@ -0,0 +1,124 @@
1#!/usr/local/bin/perl -w
2
3# This is a utility that searches out "DECLARE_STACK_OF()"
4# declarations in .h and .c files, and updates/creates/replaces
5# the corresponding macro declarations in crypto/stack/safestack.h.
6# As it's not generally possible to have macros that generate macros,
7# we need to control this from the "outside", here in this script.
8#
9# Geoff Thorpe, June, 2000 (with massive Perl-hacking
10# help from Steve Robb)
11
12my $safestack = "crypto/stack/safestack";
13
14my $do_write;
15while (@ARGV) {
16 my $arg = $ARGV[0];
17 if($arg eq "-write") {
18 $do_write = 1;
19 }
20 shift @ARGV;
21}
22
23
24@source = (<crypto/*.[ch]>, <crypto/*/*.[ch]>, <rsaref/*.[ch]>, <ssl/*.[ch]>);
25foreach $file (@source) {
26 next if -l $file;
27
28 # Open the .c/.h file for reading
29 open(IN, "< $file") || die "Can't open $file for reading: $!";
30
31 while(<IN>) {
32 if (/^DECLARE_STACK_OF\(([^)]+)\)/) {
33 push @stacklst, $1;
34 } if (/^DECLARE_ASN1_SET_OF\(([^)]+)\)/) {
35 push @asn1setlst, $1;
36 } if (/^DECLARE_PKCS12_STACK_OF\(([^)]+)\)/) {
37 push @p12stklst, $1;
38 }
39 }
40 close(IN);
41}
42
43
44
45my $old_stackfile = "";
46my $new_stackfile = "";
47my $inside_block = 0;
48my $type_thing;
49
50open(IN, "< $safestack.h") || die "Can't open input file: $!";
51while(<IN>) {
52 $old_stackfile .= $_;
53
54 if (m|^/\* This block of defines is updated by util/mkstack.pl, please do not touch! \*/|) {
55 $inside_block = 1;
56 }
57 if (m|^/\* End of util/mkstack.pl block, you may now edit :-\) \*/|) {
58 $inside_block = 0;
59 } elsif ($inside_block == 0) {
60 $new_stackfile .= $_;
61 }
62 next if($inside_block != 1);
63 $new_stackfile .= "/* This block of defines is updated by util/mkstack.pl, please do not touch! */";
64
65 foreach $type_thing (sort @stacklst) {
66 $new_stackfile .= <<EOF;
67
68#define sk_${type_thing}_new(st) SKM_sk_new($type_thing, (st))
69#define sk_${type_thing}_new_null() SKM_sk_new_null($type_thing)
70#define sk_${type_thing}_free(st) SKM_sk_free($type_thing, (st))
71#define sk_${type_thing}_num(st) SKM_sk_num($type_thing, (st))
72#define sk_${type_thing}_value(st, i) SKM_sk_value($type_thing, (st), (i))
73#define sk_${type_thing}_set(st, i, val) SKM_sk_set($type_thing, (st), (i), (val))
74#define sk_${type_thing}_zero(st) SKM_sk_zero($type_thing, (st))
75#define sk_${type_thing}_push(st, val) SKM_sk_push($type_thing, (st), (val))
76#define sk_${type_thing}_unshift(st, val) SKM_sk_unshift($type_thing, (st), (val))
77#define sk_${type_thing}_find(st, val) SKM_sk_find($type_thing, (st), (val))
78#define sk_${type_thing}_delete(st, i) SKM_sk_delete($type_thing, (st), (i))
79#define sk_${type_thing}_delete_ptr(st, ptr) SKM_sk_delete_ptr($type_thing, (st), (ptr))
80#define sk_${type_thing}_insert(st, val, i) SKM_sk_insert($type_thing, (st), (val), (i))
81#define sk_${type_thing}_set_cmp_func(st, cmp) SKM_sk_set_cmp_func($type_thing, (st), (cmp))
82#define sk_${type_thing}_dup(st) SKM_sk_dup($type_thing, st)
83#define sk_${type_thing}_pop_free(st, free_func) SKM_sk_pop_free($type_thing, (st), (free_func))
84#define sk_${type_thing}_shift(st) SKM_sk_shift($type_thing, (st))
85#define sk_${type_thing}_pop(st) SKM_sk_pop($type_thing, (st))
86#define sk_${type_thing}_sort(st) SKM_sk_sort($type_thing, (st))
87EOF
88 }
89 foreach $type_thing (sort @asn1setlst) {
90 $new_stackfile .= <<EOF;
91
92#define d2i_ASN1_SET_OF_${type_thing}(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\
93 SKM_ASN1_SET_OF_d2i($type_thing, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))
94#define i2d_ASN1_SET_OF_${type_thing}(st, pp, i2d_func, ex_tag, ex_class, is_set) \\
95 SKM_ASN1_SET_OF_i2d($type_thing, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))
96#define ASN1_seq_pack_${type_thing}(st, i2d_func, buf, len) \\
97 SKM_ASN1_seq_pack($type_thing, (st), (i2d_func), (buf), (len))
98#define ASN1_seq_unpack_${type_thing}(buf, len, d2i_func, free_func) \\
99 SKM_ASN1_seq_unpack($type_thing, (buf), (len), (d2i_func), (free_func))
100EOF
101 }
102 foreach $type_thing (sort @p12stklst) {
103 $new_stackfile .= <<EOF;
104
105#define PKCS12_decrypt_d2i_${type_thing}(algor, d2i_func, free_func, pass, passlen, oct, seq) \\
106 SKM_PKCS12_decrypt_d2i($type_thing, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))
107EOF
108 }
109 $new_stackfile .= "/* End of util/mkstack.pl block, you may now edit :-) */\n";
110 $inside_block = 2;
111}
112
113
114if ($new_stackfile eq $old_stackfile) {
115 print "No changes to $safestack.h.\n";
116 exit 0; # avoid unnecessary rebuild
117}
118
119if ($do_write) {
120 print "Writing new $safestack.h.\n";
121 open OUT, ">$safestack.h" || die "Can't open output file";
122 print OUT $new_stackfile;
123 close OUT;
124}
diff --git a/src/lib/libcrypto/util/pl/BC-32.pl b/src/lib/libcrypto/util/pl/BC-32.pl
index 7f57809a16..20cb3a9c50 100644
--- a/src/lib/libcrypto/util/pl/BC-32.pl
+++ b/src/lib/libcrypto/util/pl/BC-32.pl
@@ -19,7 +19,7 @@ $out_def="out32";
19$tmp_def="tmp32"; 19$tmp_def="tmp32";
20$inc_def="inc32"; 20$inc_def="inc32";
21#enable max error messages, disable most common warnings 21#enable max error messages, disable most common warnings
22$cflags="-DWIN32_LEAN_AND_MEAN -q -w-aus -w-par -w-inl -c -tWC -tWM -DWINDOWS -DWIN32 -DL_ENDIAN "; 22$cflags="-DWIN32_LEAN_AND_MEAN -q -w-aus -w-par -w-inl -c -tWC -tWM -DWINDOWS -DWIN32 -DL_ENDIAN -DDSO_WIN32 ";
23if ($debug) 23if ($debug)
24{ 24{
25 $cflags.="-Od -y -v -vi- -D_DEBUG"; 25 $cflags.="-Od -y -v -vi- -D_DEBUG";
diff --git a/src/lib/libcrypto/util/pl/Mingw32.pl b/src/lib/libcrypto/util/pl/Mingw32.pl
index c687d9b118..37f36126f3 100644
--- a/src/lib/libcrypto/util/pl/Mingw32.pl
+++ b/src/lib/libcrypto/util/pl/Mingw32.pl
@@ -17,9 +17,9 @@ $mkdir='gmkdir';
17 17
18$cc='gcc'; 18$cc='gcc';
19if ($debug) 19if ($debug)
20 { $cflags="-DL_ENDIAN -g2 -ggdb"; } 20 { $cflags="-DL_ENDIAN -DDSO_WIN32 -g2 -ggdb"; }
21else 21else
22 { $cflags="-DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall"; } 22 { $cflags="-DL_ENDIAN -DDSO_WIN32 -fomit-frame-pointer -O3 -m486 -Wall"; }
23 23
24if ($gaswin and !$no_asm) 24if ($gaswin and !$no_asm)
25 { 25 {
diff --git a/src/lib/libcrypto/util/pl/Mingw32f.pl b/src/lib/libcrypto/util/pl/Mingw32f.pl
index a53c537646..44f5673d7a 100644
--- a/src/lib/libcrypto/util/pl/Mingw32f.pl
+++ b/src/lib/libcrypto/util/pl/Mingw32f.pl
@@ -11,9 +11,9 @@ $rm='del';
11 11
12$cc='gcc'; 12$cc='gcc';
13if ($debug) 13if ($debug)
14 { $cflags="-g2 -ggdb"; } 14 { $cflags="-g2 -ggdb -DDSO_WIN32"; }
15else 15else
16 { $cflags="-O3 -fomit-frame-pointer"; } 16 { $cflags="-O3 -fomit-frame-pointer -DDSO_WIN32"; }
17 17
18$obj='.o'; 18$obj='.o';
19$ofile='-o '; 19$ofile='-o ';
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl
index 046f0e253c..7c6674b971 100644
--- a/src/lib/libcrypto/util/pl/VC-32.pl
+++ b/src/lib/libcrypto/util/pl/VC-32.pl
@@ -12,7 +12,7 @@ $rm='del';
12 12
13# C compiler stuff 13# C compiler stuff
14$cc='cl'; 14$cc='cl';
15$cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN'; 15$cflags=' /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32';
16$lflags="/nologo /subsystem:console /machine:I386 /opt:ref"; 16$lflags="/nologo /subsystem:console /machine:I386 /opt:ref";
17$mlflags=''; 17$mlflags='';
18 18
@@ -22,7 +22,7 @@ $inc_def="inc32";
22 22
23if ($debug) 23if ($debug)
24 { 24 {
25 $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG"; 25 $cflags=" /MDd /W3 /WX /Zi /Yd /Od /nologo -DWIN32 -D_DEBUG -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DDEBUG -DDSO_WIN32";
26 $lflags.=" /debug"; 26 $lflags.=" /debug";
27 $mlflags.=' /debug'; 27 $mlflags.=' /debug';
28 } 28 }
@@ -112,7 +112,8 @@ sub do_lib_rule
112 if (!$shlib) 112 if (!$shlib)
113 { 113 {
114# $ret.="\t\$(RM) \$(O_$Name)\n"; 114# $ret.="\t\$(RM) \$(O_$Name)\n";
115 $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; 115 $ex =' advapi32.lib';
116 $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs $ex\n<<\n";
116 } 117 }
117 else 118 else
118 { 119 {
diff --git a/src/lib/libcrypto/util/pl/linux.pl b/src/lib/libcrypto/util/pl/linux.pl
index a8cfdc578a..8924ed5480 100644
--- a/src/lib/libcrypto/util/pl/linux.pl
+++ b/src/lib/libcrypto/util/pl/linux.pl
@@ -12,6 +12,8 @@ $rm='/bin/rm -f';
12$cc='gcc'; 12$cc='gcc';
13if ($debug) 13if ($debug)
14 { $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; } 14 { $cflags="-g2 -ggdb -DREF_CHECK -DCRYPTO_MDEBUG"; }
15elsif ($profile)
16 { $cflags="-pg -O3"; }
15else 17else
16 { $cflags="-O3 -fomit-frame-pointer"; } 18 { $cflags="-O3 -fomit-frame-pointer"; }
17 19
@@ -19,6 +21,8 @@ if (!$no_asm)
19 { 21 {
20 $bn_asm_obj='$(OBJ_D)/bn86-elf.o'; 22 $bn_asm_obj='$(OBJ_D)/bn86-elf.o';
21 $bn_asm_src='crypto/bn/asm/bn86unix.cpp'; 23 $bn_asm_src='crypto/bn/asm/bn86unix.cpp';
24 $bnco_asm_obj='$(OBJ_D)/co86-elf.o';
25 $bnco_asm_src='crypto/bn/asm/co86unix.cpp';
22 $des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o'; 26 $des_enc_obj='$(OBJ_D)/dx86-elf.o $(OBJ_D)/yx86-elf.o';
23 $des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp'; 27 $des_enc_src='crypto/des/asm/dx86unix.cpp crypto/des/asm/yx86unix.cpp';
24 $bf_enc_obj='$(OBJ_D)/bx86-elf.o'; 28 $bf_enc_obj='$(OBJ_D)/bx86-elf.o';
diff --git a/src/lib/libcrypto/util/selftest.pl b/src/lib/libcrypto/util/selftest.pl
index 04b4425d7e..eb50d52ff8 100644
--- a/src/lib/libcrypto/util/selftest.pl
+++ b/src/lib/libcrypto/util/selftest.pl
@@ -19,6 +19,7 @@ my $ok=0;
19my $cc="cc"; 19my $cc="cc";
20my $cversion="??"; 20my $cversion="??";
21my $sep="-----------------------------------------------------------------------------\n"; 21my $sep="-----------------------------------------------------------------------------\n";
22my $not_our_fault="\nPlease ask your system administrator/vendor for more information.\n[Problems with your operating system setup should not be reported\nto the OpenSSL project.]\n";
22 23
23open(OUT,">$report") or die; 24open(OUT,">$report") or die;
24 25
@@ -76,16 +77,18 @@ print OUT "\n";
76 77
77print "Checking compiler...\n"; 78print "Checking compiler...\n";
78if (open(TEST,">cctest.c")) { 79if (open(TEST,">cctest.c")) {
79 print TEST "#include <stdio.h>\nmain(){printf(\"Hello world\\n\");}\n"; 80 print TEST "#include <stdio.h>\n#include <errno.h>\nmain(){printf(\"Hello world\\n\");}\n";
80 close(TEST); 81 close(TEST);
81 system("$cc -o cctest cctest.c"); 82 system("$cc -o cctest cctest.c");
82 if (`./cctest` !~ /Hello world/) { 83 if (`./cctest` !~ /Hello world/) {
83 print OUT "Compiler doesn't work.\n"; 84 print OUT "Compiler doesn't work.\n";
85 print OUT $not_our_fault;
84 goto err; 86 goto err;
85 } 87 }
86 system("ar r cctest.a /dev/null"); 88 system("ar r cctest.a /dev/null");
87 if (not -f "cctest.a") { 89 if (not -f "cctest.a") {
88 print OUT "Check your archive tool (ar).\n"; 90 print OUT "Check your archive tool (ar).\n";
91 print OUT $not_our_fault;
89 goto err; 92 goto err;
90 } 93 }
91} else { 94} else {
@@ -102,6 +105,7 @@ if (open(TEST,">cctest.c")) {
102 } else { 105 } else {
103 print OUT "Can't compile test program!\n"; 106 print OUT "Can't compile test program!\n";
104 } 107 }
108 print OUT $not_our_fault;
105 goto err; 109 goto err;
106 } 110 }
107} else { 111} else {
@@ -133,6 +137,13 @@ if (/no-/)
133 goto err; 137 goto err;
134} 138}
135 139
140if (`echo 4+1 | bc` != 5)
141{
142 print OUT "Can't run bc! Test skipped.\n";
143 print OUT $not_our_fault;
144 goto err;
145}
146
136print "Running make test...\n"; 147print "Running make test...\n";
137if (system("make test 2>&1 | tee maketest.log") > 255) 148if (system("make test 2>&1 | tee maketest.log") > 255)
138 { 149 {
diff --git a/src/lib/libcrypto/util/sp-diff.pl b/src/lib/libcrypto/util/sp-diff.pl
index f81e50201b..9d6c60387f 100644
--- a/src/lib/libcrypto/util/sp-diff.pl
+++ b/src/lib/libcrypto/util/sp-diff.pl
@@ -11,7 +11,7 @@
11%two=&loadfile($ARGV[1]); 11%two=&loadfile($ARGV[1]);
12 12
13$line=0; 13$line=0;
14foreach $a ("md2","md5","sha","sha1","rc4","des cfb","des cbc","des ede3", 14foreach $a ("md2","md4","md5","sha","sha1","rc4","des cfb","des cbc","des ede3",
15 "idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc") 15 "idea cfb","idea cbc","rc2 cfb","rc2 cbc","blowfish cbc","cast cbc")
16 { 16 {
17 if (defined($one{$a,8}) && defined($two{$a,8})) 17 if (defined($one{$a,8}) && defined($two{$a,8}))
diff --git a/src/lib/libcrypto/util/ssleay.num b/src/lib/libcrypto/util/ssleay.num
index 32b2e960c4..561bac2ec9 100644
--- a/src/lib/libcrypto/util/ssleay.num
+++ b/src/lib/libcrypto/util/ssleay.num
@@ -1,227 +1,195 @@
1ERR_load_SSL_strings 1 1ERR_load_SSL_strings 1 EXIST::FUNCTION:
2SSL_CIPHER_description 2 2SSL_CIPHER_description 2 EXIST::FUNCTION:
3SSL_CTX_add_client_CA 3 3SSL_CTX_add_client_CA 3 EXIST::FUNCTION:
4SSL_CTX_add_session 4 4SSL_CTX_add_session 4 EXIST::FUNCTION:
5SSL_CTX_check_private_key 5 5SSL_CTX_check_private_key 5 EXIST::FUNCTION:
6SSL_CTX_ctrl 6 6SSL_CTX_ctrl 6 EXIST::FUNCTION:
7SSL_CTX_flush_sessions 7 7SSL_CTX_flush_sessions 7 EXIST::FUNCTION:
8SSL_CTX_free 8 8SSL_CTX_free 8 EXIST::FUNCTION:
9SSL_CTX_get_client_CA_list 9 9SSL_CTX_get_client_CA_list 9 EXIST::FUNCTION:
10SSL_CTX_get_verify_callback 10 10SSL_CTX_get_verify_callback 10 EXIST::FUNCTION:
11SSL_CTX_get_verify_mode 11 11SSL_CTX_get_verify_mode 11 EXIST::FUNCTION:
12SSL_CTX_new 12 12SSL_CTX_new 12 EXIST::FUNCTION:
13SSL_CTX_remove_session 13 13SSL_CTX_remove_session 13 EXIST::FUNCTION:
14SSL_CTX_set_cert_verify_cb 14 14SSL_CTX_set_cipher_list 15 EXIST::FUNCTION:
15SSL_CTX_set_cipher_list 15 15SSL_CTX_set_client_CA_list 16 EXIST::FUNCTION:
16SSL_CTX_set_client_CA_list 16 16SSL_CTX_set_default_passwd_cb 17 EXIST::FUNCTION:
17SSL_CTX_set_default_passwd_cb 17 17SSL_CTX_set_ssl_version 19 EXIST::FUNCTION:
18SSL_CTX_set_ssl_version 19 18SSL_CTX_set_verify 21 EXIST::FUNCTION:
19SSL_CTX_set_verify 21 19SSL_CTX_use_PrivateKey 22 EXIST::FUNCTION:
20SSL_CTX_use_PrivateKey 22 20SSL_CTX_use_PrivateKey_ASN1 23 EXIST::FUNCTION:
21SSL_CTX_use_PrivateKey_ASN1 23 21SSL_CTX_use_PrivateKey_file 24 EXIST::FUNCTION:
22SSL_CTX_use_PrivateKey_file 24 22SSL_CTX_use_RSAPrivateKey 25 EXIST::FUNCTION:RSA
23SSL_CTX_use_RSAPrivateKey 25 23SSL_CTX_use_RSAPrivateKey_ASN1 26 EXIST::FUNCTION:RSA
24SSL_CTX_use_RSAPrivateKey_ASN1 26 24SSL_CTX_use_RSAPrivateKey_file 27 EXIST::FUNCTION:RSA
25SSL_CTX_use_RSAPrivateKey_file 27 25SSL_CTX_use_certificate 28 EXIST::FUNCTION:
26SSL_CTX_use_certificate 28 26SSL_CTX_use_certificate_ASN1 29 EXIST::FUNCTION:
27SSL_CTX_use_certificate_ASN1 29 27SSL_CTX_use_certificate_file 30 EXIST::FUNCTION:
28SSL_CTX_use_certificate_file 30 28SSL_SESSION_free 31 EXIST::FUNCTION:
29SSL_SESSION_free 31 29SSL_SESSION_new 32 EXIST::FUNCTION:
30SSL_SESSION_new 32 30SSL_SESSION_print 33 EXIST::FUNCTION:
31SSL_SESSION_print 33 31SSL_SESSION_print_fp 34 EXIST::FUNCTION:FP_API
32SSL_SESSION_print_fp 34 32SSL_accept 35 EXIST::FUNCTION:
33SSL_accept 35 33SSL_add_client_CA 36 EXIST::FUNCTION:
34SSL_add_client_CA 36 34SSL_alert_desc_string 37 EXIST::FUNCTION:
35SSL_alert_desc_string 37 35SSL_alert_desc_string_long 38 EXIST::FUNCTION:
36SSL_alert_desc_string_long 38 36SSL_alert_type_string 39 EXIST::FUNCTION:
37SSL_alert_type_string 39 37SSL_alert_type_string_long 40 EXIST::FUNCTION:
38SSL_alert_type_string_long 40 38SSL_check_private_key 41 EXIST::FUNCTION:
39SSL_check_private_key 41 39SSL_clear 42 EXIST::FUNCTION:
40SSL_clear 42 40SSL_connect 43 EXIST::FUNCTION:
41SSL_connect 43 41SSL_copy_session_id 44 EXIST::FUNCTION:
42SSL_copy_session_id 44 42SSL_ctrl 45 EXIST::FUNCTION:
43SSL_ctrl 45 43SSL_dup 46 EXIST::FUNCTION:
44SSL_dup 46 44SSL_dup_CA_list 47 EXIST::FUNCTION:
45SSL_dup_CA_list 47 45SSL_free 48 EXIST::FUNCTION:
46SSL_free 48 46SSL_get_certificate 49 EXIST::FUNCTION:
47SSL_get_certificate 49 47SSL_get_cipher_list 52 EXIST::FUNCTION:
48SSL_get_cipher_list 52 48SSL_get_ciphers 55 EXIST::FUNCTION:
49SSL_get_ciphers 55 49SSL_get_client_CA_list 56 EXIST::FUNCTION:
50SSL_get_client_CA_list 56 50SSL_get_default_timeout 57 EXIST::FUNCTION:
51SSL_get_default_timeout 57 51SSL_get_error 58 EXIST::FUNCTION:
52SSL_get_error 58 52SSL_get_fd 59 EXIST::FUNCTION:
53SSL_get_fd 59 53SSL_get_peer_cert_chain 60 EXIST::FUNCTION:
54SSL_get_peer_cert_chain 60 54SSL_get_peer_certificate 61 EXIST::FUNCTION:
55SSL_get_peer_certificate 61 55SSL_get_rbio 63 EXIST::FUNCTION:
56SSL_get_rbio 63 56SSL_get_read_ahead 64 EXIST::FUNCTION:
57SSL_get_read_ahead 64 57SSL_get_shared_ciphers 65 EXIST::FUNCTION:
58SSL_get_shared_ciphers 65 58SSL_get_ssl_method 66 EXIST::FUNCTION:
59SSL_get_ssl_method 66 59SSL_get_verify_callback 69 EXIST::FUNCTION:
60SSL_get_verify_callback 69 60SSL_get_verify_mode 70 EXIST::FUNCTION:
61SSL_get_verify_mode 70 61SSL_get_version 71 EXIST::FUNCTION:
62SSL_get_version 71 62SSL_get_wbio 72 EXIST::FUNCTION:
63SSL_get_wbio 72 63SSL_load_client_CA_file 73 EXIST::FUNCTION:
64SSL_load_client_CA_file 73 64SSL_load_error_strings 74 EXIST::FUNCTION:
65SSL_load_error_strings 74 65SSL_new 75 EXIST::FUNCTION:
66SSL_new 75 66SSL_peek 76 EXIST::FUNCTION:
67SSL_peek 76 67SSL_pending 77 EXIST::FUNCTION:
68SSL_pending 77 68SSL_read 78 EXIST::FUNCTION:
69SSL_read 78 69SSL_renegotiate 79 EXIST::FUNCTION:
70SSL_renegotiate 79 70SSL_rstate_string 80 EXIST::FUNCTION:
71SSL_rstate_string 80 71SSL_rstate_string_long 81 EXIST::FUNCTION:
72SSL_rstate_string_long 81 72SSL_set_accept_state 82 EXIST::FUNCTION:
73SSL_set_accept_state 82 73SSL_set_bio 83 EXIST::FUNCTION:
74SSL_set_bio 83 74SSL_set_cipher_list 84 EXIST::FUNCTION:
75SSL_set_cipher_list 84 75SSL_set_client_CA_list 85 EXIST::FUNCTION:
76SSL_set_client_CA_list 85 76SSL_set_connect_state 86 EXIST::FUNCTION:
77SSL_set_connect_state 86 77SSL_set_fd 87 EXIST::FUNCTION:
78SSL_set_fd 87 78SSL_set_read_ahead 88 EXIST::FUNCTION:
79SSL_set_read_ahead 88 79SSL_set_rfd 89 EXIST::FUNCTION:
80SSL_set_rfd 89 80SSL_set_session 90 EXIST::FUNCTION:
81SSL_set_session 90 81SSL_set_ssl_method 91 EXIST::FUNCTION:
82SSL_set_ssl_method 91 82SSL_set_verify 94 EXIST::FUNCTION:
83SSL_set_verify 94 83SSL_set_wfd 95 EXIST::FUNCTION:
84SSL_set_wfd 95 84SSL_shutdown 96 EXIST::FUNCTION:
85SSL_shutdown 96 85SSL_state_string 97 EXIST::FUNCTION:
86SSL_state_string 97 86SSL_state_string_long 98 EXIST::FUNCTION:
87SSL_state_string_long 98 87SSL_use_PrivateKey 99 EXIST::FUNCTION:
88SSL_use_PrivateKey 99 88SSL_use_PrivateKey_ASN1 100 EXIST::FUNCTION:
89SSL_use_PrivateKey_ASN1 100 89SSL_use_PrivateKey_file 101 EXIST::FUNCTION:
90SSL_use_PrivateKey_file 101 90SSL_use_RSAPrivateKey 102 EXIST::FUNCTION:RSA
91SSL_use_RSAPrivateKey 102 91SSL_use_RSAPrivateKey_ASN1 103 EXIST::FUNCTION:RSA
92SSL_use_RSAPrivateKey_ASN1 103 92SSL_use_RSAPrivateKey_file 104 EXIST::FUNCTION:RSA
93SSL_use_RSAPrivateKey_file 104 93SSL_use_certificate 105 EXIST::FUNCTION:
94SSL_use_certificate 105 94SSL_use_certificate_ASN1 106 EXIST::FUNCTION:
95SSL_use_certificate_ASN1 106 95SSL_use_certificate_file 107 EXIST::FUNCTION:
96SSL_use_certificate_file 107 96SSL_write 108 EXIST::FUNCTION:
97SSL_write 108 97SSLeay_add_ssl_algorithms 109 NOEXIST::FUNCTION:
98SSLeay_add_ssl_algorithms 109 98SSLv23_client_method 110 EXIST::FUNCTION:RSA
99SSLv23_client_method 110 99SSLv23_method 111 EXIST::FUNCTION:RSA
100SSLv23_method 111 100SSLv23_server_method 112 EXIST::FUNCTION:RSA
101SSLv23_server_method 112 101SSLv2_client_method 113 EXIST::FUNCTION:RSA
102SSLv2_client_method 113 102SSLv2_method 114 EXIST::FUNCTION:RSA
103SSLv2_method 114 103SSLv2_server_method 115 EXIST::FUNCTION:RSA
104SSLv2_server_method 115 104SSLv3_client_method 116 EXIST::FUNCTION:
105SSLv3_client_method 116 105SSLv3_method 117 EXIST::FUNCTION:
106SSLv3_method 117 106SSLv3_server_method 118 EXIST::FUNCTION:
107SSLv3_server_method 118 107d2i_SSL_SESSION 119 EXIST::FUNCTION:
108d2i_SSL_SESSION 119 108i2d_SSL_SESSION 120 EXIST::FUNCTION:
109i2d_SSL_SESSION 120 109BIO_f_ssl 121 EXIST::FUNCTION:
110BIO_f_ssl 121 110BIO_new_ssl 122 EXIST::FUNCTION:
111BIO_new_ssl 122 111BIO_proxy_ssl_copy_session_id 123 NOEXIST::FUNCTION:
112BIO_proxy_ssl_copy_session_id 123 112BIO_ssl_copy_session_id 124 EXIST::FUNCTION:
113BIO_ssl_copy_session_id 124 113SSL_do_handshake 125 EXIST::FUNCTION:
114SSL_do_handshake 125 114SSL_get_privatekey 126 EXIST::FUNCTION:
115SSL_get_privatekey 126 115SSL_get_current_cipher 127 EXIST::FUNCTION:
116SSL_get_current_cipher 127 116SSL_CIPHER_get_bits 128 EXIST::FUNCTION:
117SSL_CIPHER_get_bits 128 117SSL_CIPHER_get_version 129 EXIST::FUNCTION:
118SSL_CIPHER_get_version 129 118SSL_CIPHER_get_name 130 EXIST::FUNCTION:
119SSL_CIPHER_get_name 130 119BIO_ssl_shutdown 131 EXIST::FUNCTION:
120BIO_ssl_shutdown 131 120SSL_SESSION_cmp 132 EXIST::FUNCTION:
121SSL_SESSION_cmp 132 121SSL_SESSION_hash 133 EXIST::FUNCTION:
122SSL_SESSION_hash 133 122SSL_SESSION_get_time 134 EXIST::FUNCTION:
123SSL_SESSION_get_time 134 123SSL_SESSION_set_time 135 EXIST::FUNCTION:
124SSL_SESSION_set_time 135 124SSL_SESSION_get_timeout 136 EXIST::FUNCTION:
125SSL_SESSION_get_timeout 136 125SSL_SESSION_set_timeout 137 EXIST::FUNCTION:
126SSL_SESSION_set_timeout 137 126SSL_CTX_get_ex_data 138 EXIST::FUNCTION:
127SSL_CTX_get_ex_data 138 127SSL_CTX_get_quiet_shutdown 140 EXIST::FUNCTION:
128SSL_CTX_get_quiet_shutdown 140 128SSL_CTX_load_verify_locations 141 EXIST::FUNCTION:
129SSL_CTX_load_verify_locations 141 129SSL_CTX_set_default_verify_paths 142 EXIST:!VMS:FUNCTION:
130SSL_CTX_set_default_verify_paths 142 130SSL_CTX_set_def_verify_paths 142 EXIST:VMS:FUNCTION:
131SSL_CTX_set_ex_data 143 131SSL_CTX_set_ex_data 143 EXIST::FUNCTION:
132SSL_CTX_set_quiet_shutdown 145 132SSL_CTX_set_quiet_shutdown 145 EXIST::FUNCTION:
133SSL_SESSION_get_ex_data 146 133SSL_SESSION_get_ex_data 146 EXIST::FUNCTION:
134SSL_SESSION_set_ex_data 148 134SSL_SESSION_set_ex_data 148 EXIST::FUNCTION:
135SSL_get_SSL_CTX 150 135SSL_get_SSL_CTX 150 EXIST::FUNCTION:
136SSL_get_ex_data 151 136SSL_get_ex_data 151 EXIST::FUNCTION:
137SSL_get_quiet_shutdown 153 137SSL_get_quiet_shutdown 153 EXIST::FUNCTION:
138SSL_get_session 154 138SSL_get_session 154 EXIST::FUNCTION:
139SSL_get_shutdown 155 139SSL_get_shutdown 155 EXIST::FUNCTION:
140SSL_get_verify_result 157 140SSL_get_verify_result 157 EXIST::FUNCTION:
141SSL_set_ex_data 158 141SSL_set_ex_data 158 EXIST::FUNCTION:
142SSL_set_info_callback 160 142SSL_set_info_callback 160 EXIST::FUNCTION:
143SSL_set_quiet_shutdown 161 143SSL_set_quiet_shutdown 161 EXIST::FUNCTION:
144SSL_set_shutdown 162 144SSL_set_shutdown 162 EXIST::FUNCTION:
145SSL_set_verify_result 163 145SSL_set_verify_result 163 EXIST::FUNCTION:
146SSL_version 164 146SSL_version 164 EXIST::FUNCTION:
147SSL_get_info_callback 165 147SSL_get_info_callback 165 EXIST::FUNCTION:
148SSL_state 166 148SSL_state 166 EXIST::FUNCTION:
149SSL_CTX_get_ex_new_index 167 149SSL_CTX_get_ex_new_index 167 EXIST::FUNCTION:
150SSL_SESSION_get_ex_new_index 168 150SSL_SESSION_get_ex_new_index 168 EXIST::FUNCTION:
151SSL_get_ex_new_index 169 151SSL_get_ex_new_index 169 EXIST::FUNCTION:
152TLSv1_method 170 152TLSv1_method 170 EXIST::FUNCTION:
153TLSv1_server_method 171 153TLSv1_server_method 171 EXIST::FUNCTION:
154TLSv1_client_method 172 154TLSv1_client_method 172 EXIST::FUNCTION:
155BIO_new_buffer_ssl_connect 173 155BIO_new_buffer_ssl_connect 173 EXIST::FUNCTION:
156BIO_new_ssl_connect 174 156BIO_new_ssl_connect 174 EXIST::FUNCTION:
157SSL_get_ex_data_X509_STORE_CTX_idx 175 157SSL_get_ex_data_X509_STORE_CTX_idx 175 EXIST:!VMS:FUNCTION:
158SSL_CTX_set_tmp_dh_callback 176 158SSL_get_ex_d_X509_STORE_CTX_idx 175 EXIST:VMS:FUNCTION:
159SSL_CTX_set_tmp_rsa_callback 177 159SSL_CTX_set_tmp_dh_callback 176 EXIST::FUNCTION:DH
160SSL_CTX_set_timeout 178 160SSL_CTX_set_tmp_rsa_callback 177 EXIST::FUNCTION:RSA
161SSL_CTX_get_timeout 179 161SSL_CTX_set_timeout 178 EXIST::FUNCTION:
162SSL_CTX_get_cert_store 180 162SSL_CTX_get_timeout 179 EXIST::FUNCTION:
163SSL_CTX_set_cert_store 181 163SSL_CTX_get_cert_store 180 EXIST::FUNCTION:
164SSL_want 182 164SSL_CTX_set_cert_store 181 EXIST::FUNCTION:
165SSL_library_init 183 165SSL_want 182 EXIST::FUNCTION:
166SSL_COMP_add_compression_method 184 166SSL_library_init 183 EXIST::FUNCTION:
167SSL_add_file_cert_subjects_to_stack 185 167SSL_COMP_add_compression_method 184 EXIST::FUNCTION:
168SSL_set_tmp_rsa_callback 186 168SSL_add_file_cert_subjects_to_stack 185 EXIST:!VMS:FUNCTION:
169SSL_set_tmp_dh_callback 187 169SSL_add_file_cert_subjs_to_stk 185 EXIST:VMS:FUNCTION:
170SSL_add_dir_cert_subjects_to_stack 188 170SSL_set_tmp_rsa_callback 186 EXIST::FUNCTION:RSA
171SSL_set_session_id_context 189 171SSL_set_tmp_dh_callback 187 EXIST::FUNCTION:DH
172sk_SSL_CIPHER_new 190 172SSL_add_dir_cert_subjects_to_stack 188 NOEXIST::FUNCTION:
173sk_SSL_CIPHER_new_null 191 173SSL_add_dir_cert_subjs_to_stk 188 EXIST:VMS:FUNCTION:
174sk_SSL_CIPHER_free 192 174SSL_set_session_id_context 189 EXIST::FUNCTION:
175sk_SSL_CIPHER_num 193 175SSL_CTX_use_certificate_chain_file 222 EXIST:!VMS:FUNCTION:
176sk_SSL_CIPHER_value 194 176SSL_CTX_use_cert_chain_file 222 EXIST:VMS:FUNCTION:
177sk_SSL_CIPHER_set 195 177SSL_CTX_set_verify_depth 225 EXIST::FUNCTION:
178sk_SSL_CIPHER_zero 196 178SSL_set_verify_depth 226 EXIST::FUNCTION:
179sk_SSL_CIPHER_push 197 179SSL_CTX_get_verify_depth 228 EXIST::FUNCTION:
180sk_SSL_CIPHER_pop 198 180SSL_get_verify_depth 229 EXIST::FUNCTION:
181sk_SSL_CIPHER_find 199 181SSL_CTX_set_session_id_context 231 EXIST::FUNCTION:
182sk_SSL_CIPHER_delete 200 182SSL_CTX_set_cert_verify_callback 232 EXIST:!VMS:FUNCTION:
183sk_SSL_CIPHER_delete_ptr 201 183SSL_CTX_set_cert_verify_cb 232 EXIST:VMS:FUNCTION:
184sk_SSL_CIPHER_set_cmp_func 202 184SSL_CTX_set_default_passwd_cb_userdata 235 EXIST:!VMS:FUNCTION:
185sk_SSL_CIPHER_dup 203 185SSL_CTX_set_def_passwd_cb_ud 235 EXIST:VMS:FUNCTION:
186sk_SSL_CIPHER_pop_free 204 186SSL_set_purpose 236 EXIST::FUNCTION:
187sk_SSL_CIPHER_shift 205 187SSL_CTX_set_trust 237 EXIST::FUNCTION:
188sk_SSL_COMP_new 206 188SSL_CTX_set_purpose 238 EXIST::FUNCTION:
189sk_SSL_COMP_new_null 207 189SSL_set_trust 239 EXIST::FUNCTION:
190sk_SSL_COMP_free 208 190SSL_get_finished 240 EXIST::FUNCTION:
191sk_SSL_COMP_num 209 191SSL_get_peer_finished 241 EXIST::FUNCTION:
192sk_SSL_COMP_value 210 192SSL_get1_session 242 EXIST::FUNCTION:
193sk_SSL_COMP_set 211 193SSL_CTX_callback_ctrl 243 EXIST::FUNCTION:
194sk_SSL_COMP_zero 212 194SSL_callback_ctrl 244 EXIST::FUNCTION:
195sk_SSL_COMP_push 213 195SSL_CTX_sessions 245 EXIST::FUNCTION:
196sk_SSL_COMP_pop 214
197sk_SSL_COMP_find 215
198sk_SSL_COMP_delete 216
199sk_SSL_COMP_delete_ptr 217
200sk_SSL_COMP_set_cmp_func 218
201sk_SSL_COMP_dup 219
202sk_SSL_COMP_pop_free 220
203sk_SSL_COMP_shift 221
204SSL_CTX_use_certificate_chain_file 222
205sk_SSL_COMP_insert 223
206sk_SSL_CIPHER_insert 224
207SSL_CTX_set_verify_depth 225
208SSL_set_verify_depth 226
209sk_SSL_CIPHER_unshift 227
210SSL_CTX_get_verify_depth 228
211SSL_get_verify_depth 229
212sk_SSL_COMP_unshift 230
213SSL_CTX_set_session_id_context 231
214SSL_CTX_set_cert_verify_callback 232
215sk_SSL_COMP_sort 233
216sk_SSL_CIPHER_sort 234
217SSL_CTX_set_default_passwd_cb_userdata 235
218SSL_set_purpose 236
219SSL_CTX_set_trust 237
220SSL_CTX_set_purpose 238
221SSL_set_trust 239
222SSL_get_finished 240
223SSL_get_peer_finished 241
224SSL_get1_session 242
225SSL_CTX_callback_ctrl 243
226SSL_callback_ctrl 244
227SSL_CTX_sessions 245
diff --git a/src/lib/libcrypto/x509/Makefile.ssl b/src/lib/libcrypto/x509/Makefile.ssl
index 48937b43af..4619693733 100644
--- a/src/lib/libcrypto/x509/Makefile.ssl
+++ b/src/lib/libcrypto/x509/Makefile.ssl
@@ -96,15 +96,17 @@ by_dir.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
96by_dir.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 96by_dir.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
97by_dir.o: ../../include/openssl/err.h ../../include/openssl/evp.h 97by_dir.o: ../../include/openssl/err.h ../../include/openssl/evp.h
98by_dir.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 98by_dir.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
99by_dir.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 99by_dir.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
100by_dir.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 100by_dir.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
101by_dir.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
101by_dir.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 102by_dir.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
102by_dir.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 103by_dir.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
103by_dir.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 104by_dir.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
104by_dir.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 105by_dir.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
105by_dir.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 106by_dir.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
106by_dir.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 107by_dir.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
107by_dir.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 108by_dir.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
109by_dir.o: ../cryptlib.h
108by_file.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 110by_file.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
109by_file.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 111by_file.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
110by_file.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 112by_file.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -113,52 +115,60 @@ by_file.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
113by_file.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 115by_file.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
114by_file.o: ../../include/openssl/err.h ../../include/openssl/evp.h 116by_file.o: ../../include/openssl/err.h ../../include/openssl/evp.h
115by_file.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 117by_file.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
116by_file.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 118by_file.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
117by_file.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 119by_file.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
120by_file.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
118by_file.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 121by_file.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
119by_file.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h 122by_file.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
120by_file.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 123by_file.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
121by_file.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 124by_file.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
122by_file.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 125by_file.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
123by_file.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 126by_file.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
124by_file.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 127by_file.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
125by_file.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 128by_file.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
129by_file.o: ../cryptlib.h
126x509_att.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 130x509_att.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
127x509_att.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 131x509_att.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
128x509_att.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 132x509_att.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
129x509_att.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 133x509_att.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
130x509_att.o: ../../include/openssl/des.h ../../include/openssl/dh.h 134x509_att.o: ../../include/openssl/des.h ../../include/openssl/dh.h
131x509_att.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 135x509_att.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
132x509_att.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 136x509_att.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
133x509_att.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 137x509_att.o: ../../include/openssl/err.h ../../include/openssl/evp.h
134x509_att.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 138x509_att.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
139x509_att.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
135x509_att.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 140x509_att.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
136x509_att.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 141x509_att.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
142x509_att.o: ../../include/openssl/opensslconf.h
137x509_att.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 143x509_att.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
138x509_att.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 144x509_att.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
139x509_att.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 145x509_att.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
140x509_att.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 146x509_att.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
141x509_att.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 147x509_att.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
142x509_att.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 148x509_att.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
143x509_att.o: ../../include/openssl/x509v3.h ../cryptlib.h 149x509_att.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
150x509_att.o: ../cryptlib.h
144x509_cmp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 151x509_cmp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
145x509_cmp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 152x509_cmp.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
146x509_cmp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 153x509_cmp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
147x509_cmp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 154x509_cmp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
148x509_cmp.o: ../../include/openssl/des.h ../../include/openssl/dh.h 155x509_cmp.o: ../../include/openssl/des.h ../../include/openssl/dh.h
149x509_cmp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 156x509_cmp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
150x509_cmp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 157x509_cmp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
151x509_cmp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 158x509_cmp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
152x509_cmp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 159x509_cmp.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
160x509_cmp.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
153x509_cmp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 161x509_cmp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
154x509_cmp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 162x509_cmp.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
163x509_cmp.o: ../../include/openssl/opensslconf.h
155x509_cmp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 164x509_cmp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
156x509_cmp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 165x509_cmp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
157x509_cmp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 166x509_cmp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
158x509_cmp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 167x509_cmp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
159x509_cmp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 168x509_cmp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
160x509_cmp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 169x509_cmp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
161x509_cmp.o: ../../include/openssl/x509v3.h ../cryptlib.h 170x509_cmp.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
171x509_cmp.o: ../cryptlib.h
162x509_d2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 172x509_d2.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
163x509_d2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 173x509_d2.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
164x509_d2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 174x509_d2.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -166,14 +176,16 @@ x509_d2.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
166x509_d2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 176x509_d2.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
167x509_d2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 177x509_d2.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
168x509_d2.o: ../../include/openssl/err.h ../../include/openssl/evp.h 178x509_d2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
169x509_d2.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 179x509_d2.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
180x509_d2.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
170x509_d2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 181x509_d2.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
171x509_d2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 182x509_d2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
172x509_d2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 183x509_d2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
173x509_d2.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 184x509_d2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
174x509_d2.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 185x509_d2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
175x509_d2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 186x509_d2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
176x509_d2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 187x509_d2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
188x509_d2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
177x509_d2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 189x509_d2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
178x509_d2.o: ../cryptlib.h 190x509_d2.o: ../cryptlib.h
179x509_def.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 191x509_def.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -183,49 +195,57 @@ x509_def.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
183x509_def.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 195x509_def.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
184x509_def.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 196x509_def.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
185x509_def.o: ../../include/openssl/err.h ../../include/openssl/evp.h 197x509_def.o: ../../include/openssl/err.h ../../include/openssl/evp.h
186x509_def.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 198x509_def.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
199x509_def.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
187x509_def.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 200x509_def.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
188x509_def.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 201x509_def.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
202x509_def.o: ../../include/openssl/opensslconf.h
189x509_def.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 203x509_def.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
190x509_def.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 204x509_def.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
191x509_def.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 205x509_def.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
192x509_def.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 206x509_def.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
193x509_def.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 207x509_def.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
194x509_def.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 208x509_def.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
195x509_def.o: ../cryptlib.h 209x509_def.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
196x509_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 210x509_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
197x509_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 211x509_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
198x509_err.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h 212x509_err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
199x509_err.o: ../../include/openssl/des.h ../../include/openssl/dh.h 213x509_err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
200x509_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h 214x509_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
201x509_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 215x509_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
202x509_err.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 216x509_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
203x509_err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 217x509_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
218x509_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
219x509_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
204x509_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 220x509_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
205x509_err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 221x509_err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
206x509_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 222x509_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
207x509_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 223x509_err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
208x509_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 224x509_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
209x509_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 225x509_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
210x509_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 226x509_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
227x509_err.o: ../../include/openssl/x509_vfy.h
211x509_ext.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 228x509_ext.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
212x509_ext.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 229x509_ext.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
213x509_ext.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 230x509_ext.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
214x509_ext.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 231x509_ext.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
215x509_ext.o: ../../include/openssl/des.h ../../include/openssl/dh.h 232x509_ext.o: ../../include/openssl/des.h ../../include/openssl/dh.h
216x509_ext.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 233x509_ext.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
217x509_ext.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 234x509_ext.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
218x509_ext.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 235x509_ext.o: ../../include/openssl/err.h ../../include/openssl/evp.h
219x509_ext.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 236x509_ext.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
237x509_ext.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
220x509_ext.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 238x509_ext.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
221x509_ext.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 239x509_ext.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
240x509_ext.o: ../../include/openssl/opensslconf.h
222x509_ext.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 241x509_ext.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
223x509_ext.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 242x509_ext.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
224x509_ext.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 243x509_ext.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
225x509_ext.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 244x509_ext.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
226x509_ext.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 245x509_ext.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
227x509_ext.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 246x509_ext.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
228x509_ext.o: ../../include/openssl/x509v3.h ../cryptlib.h 247x509_ext.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
248x509_ext.o: ../cryptlib.h
229x509_lu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 249x509_lu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
230x509_lu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 250x509_lu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
231x509_lu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 251x509_lu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -234,15 +254,17 @@ x509_lu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
234x509_lu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 254x509_lu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
235x509_lu.o: ../../include/openssl/err.h ../../include/openssl/evp.h 255x509_lu.o: ../../include/openssl/err.h ../../include/openssl/evp.h
236x509_lu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 256x509_lu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
237x509_lu.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 257x509_lu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
238x509_lu.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 258x509_lu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
259x509_lu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
239x509_lu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 260x509_lu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
240x509_lu.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 261x509_lu.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
241x509_lu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 262x509_lu.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
242x509_lu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 263x509_lu.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
243x509_lu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 264x509_lu.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
244x509_lu.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 265x509_lu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
245x509_lu.o: ../../include/openssl/x509_vfy.h ../cryptlib.h 266x509_lu.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
267x509_lu.o: ../cryptlib.h
246x509_obj.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 268x509_obj.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
247x509_obj.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 269x509_obj.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
248x509_obj.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 270x509_obj.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -251,16 +273,17 @@ x509_obj.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
251x509_obj.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 273x509_obj.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
252x509_obj.o: ../../include/openssl/err.h ../../include/openssl/evp.h 274x509_obj.o: ../../include/openssl/err.h ../../include/openssl/evp.h
253x509_obj.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 275x509_obj.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
254x509_obj.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 276x509_obj.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
255x509_obj.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 277x509_obj.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
278x509_obj.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
256x509_obj.o: ../../include/openssl/opensslconf.h 279x509_obj.o: ../../include/openssl/opensslconf.h
257x509_obj.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 280x509_obj.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
258x509_obj.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 281x509_obj.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
259x509_obj.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 282x509_obj.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
260x509_obj.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 283x509_obj.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
261x509_obj.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 284x509_obj.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
262x509_obj.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 285x509_obj.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
263x509_obj.o: ../cryptlib.h 286x509_obj.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
264x509_r2x.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 287x509_r2x.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
265x509_r2x.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 288x509_r2x.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
266x509_r2x.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 289x509_r2x.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -268,16 +291,18 @@ x509_r2x.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
268x509_r2x.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 291x509_r2x.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
269x509_r2x.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 292x509_r2x.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
270x509_r2x.o: ../../include/openssl/err.h ../../include/openssl/evp.h 293x509_r2x.o: ../../include/openssl/err.h ../../include/openssl/evp.h
271x509_r2x.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 294x509_r2x.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
295x509_r2x.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
272x509_r2x.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 296x509_r2x.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
273x509_r2x.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 297x509_r2x.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
298x509_r2x.o: ../../include/openssl/opensslconf.h
274x509_r2x.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 299x509_r2x.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
275x509_r2x.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 300x509_r2x.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
276x509_r2x.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 301x509_r2x.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
277x509_r2x.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 302x509_r2x.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
278x509_r2x.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 303x509_r2x.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
279x509_r2x.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 304x509_r2x.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
280x509_r2x.o: ../cryptlib.h 305x509_r2x.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
281x509_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 306x509_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
282x509_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 307x509_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
283x509_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 308x509_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -285,17 +310,19 @@ x509_req.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
285x509_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 310x509_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
286x509_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 311x509_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
287x509_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h 312x509_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
288x509_req.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 313x509_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
314x509_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
289x509_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 315x509_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
290x509_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 316x509_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
317x509_req.o: ../../include/openssl/opensslconf.h
291x509_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h 318x509_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pem.h
292x509_req.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h 319x509_req.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
293x509_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 320x509_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
294x509_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 321x509_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
295x509_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 322x509_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
296x509_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 323x509_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
297x509_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 324x509_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
298x509_req.o: ../cryptlib.h 325x509_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
299x509_set.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 326x509_set.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
300x509_set.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 327x509_set.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
301x509_set.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 328x509_set.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -303,34 +330,39 @@ x509_set.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
303x509_set.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 330x509_set.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
304x509_set.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 331x509_set.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
305x509_set.o: ../../include/openssl/err.h ../../include/openssl/evp.h 332x509_set.o: ../../include/openssl/err.h ../../include/openssl/evp.h
306x509_set.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 333x509_set.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
334x509_set.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
307x509_set.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 335x509_set.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
308x509_set.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 336x509_set.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
337x509_set.o: ../../include/openssl/opensslconf.h
309x509_set.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 338x509_set.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
310x509_set.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 339x509_set.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
311x509_set.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 340x509_set.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
312x509_set.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 341x509_set.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
313x509_set.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 342x509_set.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
314x509_set.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 343x509_set.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
315x509_set.o: ../cryptlib.h 344x509_set.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
316x509_trs.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 345x509_trs.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
317x509_trs.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 346x509_trs.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
318x509_trs.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 347x509_trs.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
319x509_trs.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 348x509_trs.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
320x509_trs.o: ../../include/openssl/des.h ../../include/openssl/dh.h 349x509_trs.o: ../../include/openssl/des.h ../../include/openssl/dh.h
321x509_trs.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 350x509_trs.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
322x509_trs.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 351x509_trs.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
323x509_trs.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 352x509_trs.o: ../../include/openssl/err.h ../../include/openssl/evp.h
324x509_trs.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 353x509_trs.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
354x509_trs.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
325x509_trs.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 355x509_trs.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
326x509_trs.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 356x509_trs.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
357x509_trs.o: ../../include/openssl/opensslconf.h
327x509_trs.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 358x509_trs.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
328x509_trs.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 359x509_trs.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
329x509_trs.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 360x509_trs.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
330x509_trs.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 361x509_trs.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
331x509_trs.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 362x509_trs.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
332x509_trs.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 363x509_trs.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
333x509_trs.o: ../../include/openssl/x509v3.h ../cryptlib.h 364x509_trs.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
365x509_trs.o: ../cryptlib.h
334x509_txt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 366x509_txt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
335x509_txt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 367x509_txt.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
336x509_txt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 368x509_txt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -339,32 +371,35 @@ x509_txt.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
339x509_txt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 371x509_txt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
340x509_txt.o: ../../include/openssl/err.h ../../include/openssl/evp.h 372x509_txt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
341x509_txt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 373x509_txt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
342x509_txt.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 374x509_txt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
343x509_txt.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 375x509_txt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
376x509_txt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
344x509_txt.o: ../../include/openssl/opensslconf.h 377x509_txt.o: ../../include/openssl/opensslconf.h
345x509_txt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 378x509_txt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
346x509_txt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 379x509_txt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
347x509_txt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 380x509_txt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
348x509_txt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 381x509_txt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
349x509_txt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 382x509_txt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
350x509_txt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 383x509_txt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
351x509_txt.o: ../cryptlib.h 384x509_txt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
352x509_v3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 385x509_v3.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
353x509_v3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 386x509_v3.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
354x509_v3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 387x509_v3.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
355x509_v3.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 388x509_v3.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
356x509_v3.o: ../../include/openssl/des.h ../../include/openssl/dh.h 389x509_v3.o: ../../include/openssl/des.h ../../include/openssl/dh.h
357x509_v3.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 390x509_v3.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
358x509_v3.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 391x509_v3.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
359x509_v3.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 392x509_v3.o: ../../include/openssl/err.h ../../include/openssl/evp.h
360x509_v3.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 393x509_v3.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
394x509_v3.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
361x509_v3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 395x509_v3.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
362x509_v3.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 396x509_v3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
363x509_v3.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 397x509_v3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
364x509_v3.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 398x509_v3.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
365x509_v3.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 399x509_v3.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
366x509_v3.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 400x509_v3.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
367x509_v3.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 401x509_v3.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
402x509_v3.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
368x509_v3.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 403x509_v3.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
369x509_v3.o: ../../include/openssl/x509v3.h ../cryptlib.h 404x509_v3.o: ../../include/openssl/x509v3.h ../cryptlib.h
370x509_vfy.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 405x509_vfy.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -373,18 +408,21 @@ x509_vfy.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
373x509_vfy.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 408x509_vfy.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
374x509_vfy.o: ../../include/openssl/des.h ../../include/openssl/dh.h 409x509_vfy.o: ../../include/openssl/des.h ../../include/openssl/dh.h
375x509_vfy.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 410x509_vfy.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
376x509_vfy.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 411x509_vfy.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
377x509_vfy.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 412x509_vfy.o: ../../include/openssl/err.h ../../include/openssl/evp.h
378x509_vfy.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 413x509_vfy.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
414x509_vfy.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
379x509_vfy.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 415x509_vfy.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
380x509_vfy.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 416x509_vfy.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
417x509_vfy.o: ../../include/openssl/opensslconf.h
381x509_vfy.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 418x509_vfy.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
382x509_vfy.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 419x509_vfy.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
383x509_vfy.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 420x509_vfy.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
384x509_vfy.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 421x509_vfy.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
385x509_vfy.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 422x509_vfy.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
386x509_vfy.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 423x509_vfy.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
387x509_vfy.o: ../../include/openssl/x509v3.h ../cryptlib.h 424x509_vfy.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
425x509_vfy.o: ../cryptlib.h
388x509name.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 426x509name.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
389x509name.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 427x509name.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
390x509name.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 428x509name.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -392,16 +430,18 @@ x509name.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
392x509name.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 430x509name.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
393x509name.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 431x509name.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
394x509name.o: ../../include/openssl/err.h ../../include/openssl/evp.h 432x509name.o: ../../include/openssl/err.h ../../include/openssl/evp.h
395x509name.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 433x509name.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
434x509name.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
396x509name.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 435x509name.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
397x509name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 436x509name.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
437x509name.o: ../../include/openssl/opensslconf.h
398x509name.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 438x509name.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
399x509name.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 439x509name.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
400x509name.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 440x509name.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
401x509name.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 441x509name.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
402x509name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 442x509name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
403x509name.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 443x509name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
404x509name.o: ../cryptlib.h 444x509name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
405x509rset.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 445x509rset.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
406x509rset.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 446x509rset.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
407x509rset.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 447x509rset.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -409,16 +449,18 @@ x509rset.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
409x509rset.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 449x509rset.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
410x509rset.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 450x509rset.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
411x509rset.o: ../../include/openssl/err.h ../../include/openssl/evp.h 451x509rset.o: ../../include/openssl/err.h ../../include/openssl/evp.h
412x509rset.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 452x509rset.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
453x509rset.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
413x509rset.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 454x509rset.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
414x509rset.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 455x509rset.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
456x509rset.o: ../../include/openssl/opensslconf.h
415x509rset.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 457x509rset.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
416x509rset.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 458x509rset.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
417x509rset.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 459x509rset.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
418x509rset.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 460x509rset.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
419x509rset.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 461x509rset.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
420x509rset.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 462x509rset.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
421x509rset.o: ../cryptlib.h 463x509rset.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
422x509spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 464x509spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
423x509spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 465x509spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
424x509spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 466x509spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -427,16 +469,17 @@ x509spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h
427x509spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 469x509spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
428x509spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 470x509spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
429x509spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 471x509spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
430x509spki.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 472x509spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
431x509spki.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 473x509spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
432x509spki.o: ../../include/openssl/opensslconf.h 474x509spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
475x509spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
433x509spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 476x509spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
434x509spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 477x509spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
435x509spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 478x509spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
436x509spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 479x509spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
437x509spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 480x509spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
438x509spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 481x509spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
439x509spki.o: ../cryptlib.h 482x509spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
440x509type.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 483x509type.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
441x509type.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 484x509type.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
442x509type.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 485x509type.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -444,16 +487,18 @@ x509type.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
444x509type.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 487x509type.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
445x509type.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 488x509type.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
446x509type.o: ../../include/openssl/err.h ../../include/openssl/evp.h 489x509type.o: ../../include/openssl/err.h ../../include/openssl/evp.h
447x509type.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 490x509type.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
491x509type.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
448x509type.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 492x509type.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
449x509type.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 493x509type.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
494x509type.o: ../../include/openssl/opensslconf.h
450x509type.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 495x509type.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
451x509type.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 496x509type.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
452x509type.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 497x509type.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
453x509type.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 498x509type.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
454x509type.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 499x509type.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
455x509type.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 500x509type.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
456x509type.o: ../cryptlib.h 501x509type.o: ../../include/openssl/x509_vfy.h ../cryptlib.h
457x_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 502x_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
458x_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 503x_all.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
459x_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 504x_all.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
@@ -461,13 +506,15 @@ x_all.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
461x_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 506x_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
462x_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 507x_all.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
463x_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 508x_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
464x_all.o: ../../include/openssl/idea.h ../../include/openssl/md2.h 509x_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
510x_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
465x_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 511x_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
466x_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 512x_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
467x_all.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 513x_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
468x_all.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 514x_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
469x_all.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 515x_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
470x_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 516x_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
471x_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 517x_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
518x_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
472x_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 519x_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
473x_all.o: ../cryptlib.h 520x_all.o: ../cryptlib.h
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c
index 14d12c56bd..cac64a6f40 100644
--- a/src/lib/libcrypto/x509/by_dir.c
+++ b/src/lib/libcrypto/x509/by_dir.c
@@ -146,11 +146,11 @@ static int new_dir(X509_LOOKUP *lu)
146 { 146 {
147 BY_DIR *a; 147 BY_DIR *a;
148 148
149 if ((a=(BY_DIR *)Malloc(sizeof(BY_DIR))) == NULL) 149 if ((a=(BY_DIR *)OPENSSL_malloc(sizeof(BY_DIR))) == NULL)
150 return(0); 150 return(0);
151 if ((a->buffer=BUF_MEM_new()) == NULL) 151 if ((a->buffer=BUF_MEM_new()) == NULL)
152 { 152 {
153 Free(a); 153 OPENSSL_free(a);
154 return(0); 154 return(0);
155 } 155 }
156 a->num_dirs=0; 156 a->num_dirs=0;
@@ -168,11 +168,11 @@ static void free_dir(X509_LOOKUP *lu)
168 168
169 a=(BY_DIR *)lu->method_data; 169 a=(BY_DIR *)lu->method_data;
170 for (i=0; i<a->num_dirs; i++) 170 for (i=0; i<a->num_dirs; i++)
171 if (a->dirs[i] != NULL) Free(a->dirs[i]); 171 if (a->dirs[i] != NULL) OPENSSL_free(a->dirs[i]);
172 if (a->dirs != NULL) Free(a->dirs); 172 if (a->dirs != NULL) OPENSSL_free(a->dirs);
173 if (a->dirs_type != NULL) Free(a->dirs_type); 173 if (a->dirs_type != NULL) OPENSSL_free(a->dirs_type);
174 if (a->buffer != NULL) BUF_MEM_free(a->buffer); 174 if (a->buffer != NULL) BUF_MEM_free(a->buffer);
175 Free(a); 175 OPENSSL_free(a);
176 } 176 }
177 177
178static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) 178static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
@@ -204,9 +204,9 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
204 if (ctx->num_dirs_alloced < (ctx->num_dirs+1)) 204 if (ctx->num_dirs_alloced < (ctx->num_dirs+1))
205 { 205 {
206 ctx->num_dirs_alloced+=10; 206 ctx->num_dirs_alloced+=10;
207 pp=(char **)Malloc(ctx->num_dirs_alloced* 207 pp=(char **)OPENSSL_malloc(ctx->num_dirs_alloced*
208 sizeof(char *)); 208 sizeof(char *));
209 ip=(int *)Malloc(ctx->num_dirs_alloced* 209 ip=(int *)OPENSSL_malloc(ctx->num_dirs_alloced*
210 sizeof(int)); 210 sizeof(int));
211 if ((pp == NULL) || (ip == NULL)) 211 if ((pp == NULL) || (ip == NULL))
212 { 212 {
@@ -218,14 +218,14 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type)
218 memcpy(ip,ctx->dirs_type,(ctx->num_dirs_alloced-10)* 218 memcpy(ip,ctx->dirs_type,(ctx->num_dirs_alloced-10)*
219 sizeof(int)); 219 sizeof(int));
220 if (ctx->dirs != NULL) 220 if (ctx->dirs != NULL)
221 Free(ctx->dirs); 221 OPENSSL_free(ctx->dirs);
222 if (ctx->dirs_type != NULL) 222 if (ctx->dirs_type != NULL)
223 Free(ctx->dirs_type); 223 OPENSSL_free(ctx->dirs_type);
224 ctx->dirs=pp; 224 ctx->dirs=pp;
225 ctx->dirs_type=ip; 225 ctx->dirs_type=ip;
226 } 226 }
227 ctx->dirs_type[ctx->num_dirs]=type; 227 ctx->dirs_type[ctx->num_dirs]=type;
228 ctx->dirs[ctx->num_dirs]=(char *)Malloc((unsigned int)len+1); 228 ctx->dirs[ctx->num_dirs]=(char *)OPENSSL_malloc((unsigned int)len+1);
229 if (ctx->dirs[ctx->num_dirs] == NULL) return(0); 229 if (ctx->dirs[ctx->num_dirs] == NULL) return(0);
230 strncpy(ctx->dirs[ctx->num_dirs],ss,(unsigned int)len); 230 strncpy(ctx->dirs[ctx->num_dirs],ss,(unsigned int)len);
231 ctx->dirs[ctx->num_dirs][len]='\0'; 231 ctx->dirs[ctx->num_dirs][len]='\0';
@@ -326,7 +326,9 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
326 /* we have added it to the cache so now pull 326 /* we have added it to the cache so now pull
327 * it out again */ 327 * it out again */
328 CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE); 328 CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
329 tmp=(X509_OBJECT *)lh_retrieve(xl->store_ctx->certs,&stmp); 329 j = sk_X509_OBJECT_find(xl->store_ctx->objs,&stmp);
330 if(j != -1) tmp=sk_X509_OBJECT_value(xl->store_ctx->objs,i);
331 else tmp = NULL;
330 CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE); 332 CRYPTO_r_unlock(CRYPTO_LOCK_X509_STORE);
331 333
332 if (tmp != NULL) 334 if (tmp != NULL)
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 0192272e7c..813c8adffd 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -59,15 +59,16 @@
59#ifndef HEADER_X509_H 59#ifndef HEADER_X509_H
60#define HEADER_X509_H 60#define HEADER_X509_H
61 61
62#ifdef __cplusplus 62#include <openssl/symhacks.h>
63extern "C" { 63#ifndef NO_BUFFER
64#include <openssl/buffer.h>
64#endif 65#endif
65 66#ifndef NO_EVP
66#ifdef VMS 67#include <openssl/evp.h>
67#undef X509_REVOKED_get_ext_by_critical 68#endif
68#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic 69#ifndef NO_BIO
70#include <openssl/bio.h>
69#endif 71#endif
70
71#include <openssl/stack.h> 72#include <openssl/stack.h>
72#include <openssl/asn1.h> 73#include <openssl/asn1.h>
73#include <openssl/safestack.h> 74#include <openssl/safestack.h>
@@ -87,11 +88,19 @@ extern "C" {
87#include <openssl/evp.h> 88#include <openssl/evp.h>
88 89
89 90
91#ifdef __cplusplus
92extern "C" {
93#endif
94
90#ifdef WIN32 95#ifdef WIN32
91/* Under Win32 this is defined in wincrypt.h */ 96/* Under Win32 this is defined in wincrypt.h */
92#undef X509_NAME 97#undef X509_NAME
93#endif 98#endif
94 99
100 /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */
101#define DECLARE_PKCS12_STACK_OF(type) /* Nothing */
102#define IMPLEMENT_PKCS12_STACK_OF(type) /* Nothing */
103
95#define X509_FILETYPE_PEM 1 104#define X509_FILETYPE_PEM 1
96#define X509_FILETYPE_ASN1 2 105#define X509_FILETYPE_ASN1 2
97#define X509_FILETYPE_DEFAULT 3 106#define X509_FILETYPE_DEFAULT 3
@@ -125,8 +134,8 @@ DECLARE_ASN1_SET_OF(X509_ALGOR)
125 134
126typedef struct X509_val_st 135typedef struct X509_val_st
127 { 136 {
128 ASN1_UTCTIME *notBefore; 137 ASN1_TIME *notBefore;
129 ASN1_UTCTIME *notAfter; 138 ASN1_TIME *notAfter;
130 } X509_VAL; 139 } X509_VAL;
131 140
132typedef struct X509_pubkey_st 141typedef struct X509_pubkey_st
@@ -158,7 +167,7 @@ typedef struct X509_name_st
158 { 167 {
159 STACK_OF(X509_NAME_ENTRY) *entries; 168 STACK_OF(X509_NAME_ENTRY) *entries;
160 int modified; /* true if 'bytes' needs to be built */ 169 int modified; /* true if 'bytes' needs to be built */
161#ifdef HEADER_BUFFER_H 170#ifndef NO_BUFFER
162 BUF_MEM *bytes; 171 BUF_MEM *bytes;
163#else 172#else
164 char *bytes; 173 char *bytes;
@@ -200,6 +209,8 @@ DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
200 209
201typedef struct X509_req_info_st 210typedef struct X509_req_info_st
202 { 211 {
212 unsigned char *asn1;
213 int length;
203 ASN1_INTEGER *version; 214 ASN1_INTEGER *version;
204 X509_NAME *subject; 215 X509_NAME *subject;
205 X509_PUBKEY *pubkey; 216 X509_PUBKEY *pubkey;
@@ -260,6 +271,8 @@ typedef struct x509_st
260 unsigned long ex_kusage; 271 unsigned long ex_kusage;
261 unsigned long ex_xkusage; 272 unsigned long ex_xkusage;
262 unsigned long ex_nscert; 273 unsigned long ex_nscert;
274 ASN1_OCTET_STRING *skid;
275 struct AUTHORITY_KEYID_st *akid;
263#ifndef NO_SHA 276#ifndef NO_SHA
264 unsigned char sha1_hash[SHA_DIGEST_LENGTH]; 277 unsigned char sha1_hash[SHA_DIGEST_LENGTH];
265#endif 278#endif
@@ -307,10 +320,65 @@ DECLARE_STACK_OF(X509_TRUST)
307#define X509_TRUST_REJECTED 2 320#define X509_TRUST_REJECTED 2
308#define X509_TRUST_UNTRUSTED 3 321#define X509_TRUST_UNTRUSTED 3
309 322
323/* Flags specific to X509_NAME_print_ex() */
324
325/* The field separator information */
326
327#define XN_FLAG_SEP_MASK (0xf << 16)
328
329#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */
330#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */
331#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */
332#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */
333#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */
334
335#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */
336
337/* How the field name is shown */
338
339#define XN_FLAG_FN_MASK (0x3 << 21)
340
341#define XN_FLAG_FN_SN 0 /* Object short name */
342#define XN_FLAG_FN_LN (1 << 21) /* Object long name */
343#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */
344#define XN_FLAG_FN_NONE (3 << 21) /* No field names */
345
346#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */
347
348/* This determines if we dump fields we don't recognise:
349 * RFC2253 requires this.
350 */
351
352#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
353
354/* Complete set of RFC2253 flags */
355
356#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
357 XN_FLAG_SEP_COMMA_PLUS | \
358 XN_FLAG_DN_REV | \
359 XN_FLAG_FN_SN | \
360 XN_FLAG_DUMP_UNKNOWN_FIELDS)
361
362/* readable oneline form */
363
364#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
365 ASN1_STRFLGS_ESC_QUOTE | \
366 XN_FLAG_SEP_CPLUS_SPC | \
367 XN_FLAG_SPC_EQ | \
368 XN_FLAG_FN_SN)
369
370/* readable multiline form */
371
372#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
373 ASN1_STRFLGS_ESC_MSB | \
374 XN_FLAG_SEP_MULTILINE | \
375 XN_FLAG_SPC_EQ | \
376 XN_FLAG_FN_LN)
377
310typedef struct X509_revoked_st 378typedef struct X509_revoked_st
311 { 379 {
312 ASN1_INTEGER *serialNumber; 380 ASN1_INTEGER *serialNumber;
313 ASN1_UTCTIME *revocationDate; 381 ASN1_TIME *revocationDate;
314 STACK_OF(X509_EXTENSION) /* optional */ *extensions; 382 STACK_OF(X509_EXTENSION) /* optional */ *extensions;
315 int sequence; /* load sequence */ 383 int sequence; /* load sequence */
316 } X509_REVOKED; 384 } X509_REVOKED;
@@ -323,8 +391,8 @@ typedef struct X509_crl_info_st
323 ASN1_INTEGER *version; 391 ASN1_INTEGER *version;
324 X509_ALGOR *sig_alg; 392 X509_ALGOR *sig_alg;
325 X509_NAME *issuer; 393 X509_NAME *issuer;
326 ASN1_UTCTIME *lastUpdate; 394 ASN1_TIME *lastUpdate;
327 ASN1_UTCTIME *nextUpdate; 395 ASN1_TIME *nextUpdate;
328 STACK_OF(X509_REVOKED) *revoked; 396 STACK_OF(X509_REVOKED) *revoked;
329 STACK_OF(X509_EXTENSION) /* [0] */ *extensions; 397 STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
330 } X509_CRL_INFO; 398 } X509_CRL_INFO;
@@ -362,7 +430,7 @@ typedef struct private_key_st
362 int references; 430 int references;
363 } X509_PKEY; 431 } X509_PKEY;
364 432
365#ifdef HEADER_ENVELOPE_H 433#ifndef NO_EVP
366typedef struct X509_info_st 434typedef struct X509_info_st
367 { 435 {
368 X509 *x509; 436 X509 *x509;
@@ -445,9 +513,17 @@ typedef struct pkcs8_priv_key_info_st
445 STACK_OF(X509_ATTRIBUTE) *attributes; 513 STACK_OF(X509_ATTRIBUTE) *attributes;
446 } PKCS8_PRIV_KEY_INFO; 514 } PKCS8_PRIV_KEY_INFO;
447 515
516#ifdef __cplusplus
517}
518#endif
519
448#include <openssl/x509_vfy.h> 520#include <openssl/x509_vfy.h>
449#include <openssl/pkcs7.h> 521#include <openssl/pkcs7.h>
450 522
523#ifdef __cplusplus
524extern "C" {
525#endif
526
451#ifdef SSLEAY_MACROS 527#ifdef SSLEAY_MACROS
452#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\ 528#define X509_verify(a,r) ASN1_verify((int (*)())i2d_X509_CINF,a->sig_alg,\
453 a->signature,(char *)a->cert_info,r) 529 a->signature,(char *)a->cert_info,r)
@@ -610,7 +686,7 @@ typedef struct pkcs8_priv_key_info_st
610const char *X509_verify_cert_error_string(long n); 686const char *X509_verify_cert_error_string(long n);
611 687
612#ifndef SSLEAY_MACROS 688#ifndef SSLEAY_MACROS
613#ifdef HEADER_ENVELOPE_H 689#ifndef NO_EVP
614int X509_verify(X509 *a, EVP_PKEY *r); 690int X509_verify(X509 *a, EVP_PKEY *r);
615 691
616int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); 692int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
@@ -629,9 +705,14 @@ int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);
629int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); 705int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);
630int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); 706int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);
631 707
632int X509_digest(X509 *data,const EVP_MD *type,unsigned char *md,unsigned int *len); 708int X509_digest(const X509 *data,const EVP_MD *type,
633int X509_NAME_digest(X509_NAME *data,const EVP_MD *type, 709 unsigned char *md, unsigned int *len);
634 unsigned char *md,unsigned int *len); 710int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type,
711 unsigned char *md, unsigned int *len);
712int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type,
713 unsigned char *md, unsigned int *len);
714int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type,
715 unsigned char *md, unsigned int *len);
635#endif 716#endif
636 717
637#ifndef NO_FP_API 718#ifndef NO_FP_API
@@ -663,9 +744,11 @@ int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf);
663int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); 744int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);
664int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); 745int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);
665EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); 746EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
747int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);
748EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
666#endif 749#endif
667 750
668#ifdef HEADER_BIO_H 751#ifndef NO_BIO
669X509 *d2i_X509_bio(BIO *bp,X509 **x509); 752X509 *d2i_X509_bio(BIO *bp,X509 **x509);
670int i2d_X509_bio(BIO *bp,X509 *x509); 753int i2d_X509_bio(BIO *bp,X509 *x509);
671X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); 754X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl);
@@ -694,6 +777,8 @@ int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf);
694int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); 777int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);
695int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); 778int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);
696EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); 779EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
780int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);
781EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
697#endif 782#endif
698 783
699X509 *X509_dup(X509 *x509); 784X509 *X509_dup(X509 *x509);
@@ -711,8 +796,10 @@ RSA *RSAPrivateKey_dup(RSA *rsa);
711 796
712#endif /* !SSLEAY_MACROS */ 797#endif /* !SSLEAY_MACROS */
713 798
714int X509_cmp_current_time(ASN1_UTCTIME *s); 799int X509_cmp_time(ASN1_TIME *s, time_t *t);
715ASN1_UTCTIME * X509_gmtime_adj(ASN1_UTCTIME *s, long adj); 800int X509_cmp_current_time(ASN1_TIME *s);
801ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t);
802ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj);
716 803
717const char * X509_get_default_cert_area(void ); 804const char * X509_get_default_cert_area(void );
718const char * X509_get_default_cert_dir(void ); 805const char * X509_get_default_cert_dir(void );
@@ -825,6 +912,7 @@ int i2d_X509_CERT_AUX(X509_CERT_AUX *a,unsigned char **pp);
825X509_CERT_AUX * d2i_X509_CERT_AUX(X509_CERT_AUX **a,unsigned char **pp, 912X509_CERT_AUX * d2i_X509_CERT_AUX(X509_CERT_AUX **a,unsigned char **pp,
826 long length); 913 long length);
827int X509_alias_set1(X509 *x, unsigned char *name, int len); 914int X509_alias_set1(X509 *x, unsigned char *name, int len);
915int X509_keyid_set1(X509 *x, unsigned char *id, int len);
828unsigned char * X509_alias_get0(X509 *x, int *len); 916unsigned char * X509_alias_get0(X509 *x, int *len);
829int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); 917int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int);
830int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); 918int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);
@@ -871,7 +959,7 @@ NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void);
871NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length); 959NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, unsigned char **pp, long length);
872void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a); 960void NETSCAPE_CERT_SEQUENCE_free(NETSCAPE_CERT_SEQUENCE *a);
873 961
874#ifdef HEADER_ENVELOPE_H 962#ifndef NO_EVP
875X509_INFO * X509_INFO_new(void); 963X509_INFO * X509_INFO_new(void);
876void X509_INFO_free(X509_INFO *a); 964void X509_INFO_free(X509_INFO *a);
877char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); 965char * X509_NAME_oneline(X509_NAME *a,char *buf,int size);
@@ -894,8 +982,8 @@ int X509_set_issuer_name(X509 *x, X509_NAME *name);
894X509_NAME * X509_get_issuer_name(X509 *a); 982X509_NAME * X509_get_issuer_name(X509 *a);
895int X509_set_subject_name(X509 *x, X509_NAME *name); 983int X509_set_subject_name(X509 *x, X509_NAME *name);
896X509_NAME * X509_get_subject_name(X509 *a); 984X509_NAME * X509_get_subject_name(X509 *a);
897int X509_set_notBefore(X509 *x, ASN1_UTCTIME *tm); 985int X509_set_notBefore(X509 *x, ASN1_TIME *tm);
898int X509_set_notAfter(X509 *x, ASN1_UTCTIME *tm); 986int X509_set_notAfter(X509 *x, ASN1_TIME *tm);
899int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); 987int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
900EVP_PKEY * X509_get_pubkey(X509 *x); 988EVP_PKEY * X509_get_pubkey(X509 *x);
901int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); 989int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */);
@@ -931,28 +1019,30 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req,
931 1019
932int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); 1020int X509_check_private_key(X509 *x509,EVP_PKEY *pkey);
933 1021
934int X509_issuer_and_serial_cmp(X509 *a, X509 *b); 1022int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);
935unsigned long X509_issuer_and_serial_hash(X509 *a); 1023unsigned long X509_issuer_and_serial_hash(X509 *a);
936 1024
937int X509_issuer_name_cmp(X509 *a, X509 *b); 1025int X509_issuer_name_cmp(const X509 *a, const X509 *b);
938unsigned long X509_issuer_name_hash(X509 *a); 1026unsigned long X509_issuer_name_hash(X509 *a);
939 1027
940int X509_subject_name_cmp(X509 *a,X509 *b); 1028int X509_subject_name_cmp(const X509 *a, const X509 *b);
941unsigned long X509_subject_name_hash(X509 *x); 1029unsigned long X509_subject_name_hash(X509 *x);
942 1030
943int X509_cmp (X509 *a, X509 *b); 1031int X509_cmp(const X509 *a, const X509 *b);
944int X509_NAME_cmp (X509_NAME *a, X509_NAME *b); 1032int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
945unsigned long X509_NAME_hash(X509_NAME *x); 1033unsigned long X509_NAME_hash(X509_NAME *x);
946 1034
947int X509_CRL_cmp(X509_CRL *a,X509_CRL *b); 1035int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
948#ifndef NO_FP_API 1036#ifndef NO_FP_API
949int X509_print_fp(FILE *bp,X509 *x); 1037int X509_print_fp(FILE *bp,X509 *x);
950int X509_CRL_print_fp(FILE *bp,X509_CRL *x); 1038int X509_CRL_print_fp(FILE *bp,X509_CRL *x);
951int X509_REQ_print_fp(FILE *bp,X509_REQ *req); 1039int X509_REQ_print_fp(FILE *bp,X509_REQ *req);
1040int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags);
952#endif 1041#endif
953 1042
954#ifdef HEADER_BIO_H 1043#ifndef NO_BIO
955int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); 1044int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
1045int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags);
956int X509_print(BIO *bp,X509 *x); 1046int X509_print(BIO *bp,X509 *x);
957int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); 1047int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent);
958int X509_CRL_print(BIO *bp,X509_CRL *x); 1048int X509_CRL_print(BIO *bp,X509_CRL *x);
diff --git a/src/lib/libcrypto/x509/x509_cmp.c b/src/lib/libcrypto/x509/x509_cmp.c
index a8a5ca8b03..b147d573d2 100644
--- a/src/lib/libcrypto/x509/x509_cmp.c
+++ b/src/lib/libcrypto/x509/x509_cmp.c
@@ -63,7 +63,7 @@
63#include <openssl/x509.h> 63#include <openssl/x509.h>
64#include <openssl/x509v3.h> 64#include <openssl/x509v3.h>
65 65
66int X509_issuer_and_serial_cmp(X509 *a, X509 *b) 66int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
67 { 67 {
68 int i; 68 int i;
69 X509_CINF *ai,*bi; 69 X509_CINF *ai,*bi;
@@ -97,17 +97,17 @@ unsigned long X509_issuer_and_serial_hash(X509 *a)
97 } 97 }
98#endif 98#endif
99 99
100int X509_issuer_name_cmp(X509 *a, X509 *b) 100int X509_issuer_name_cmp(const X509 *a, const X509 *b)
101 { 101 {
102 return(X509_NAME_cmp(a->cert_info->issuer,b->cert_info->issuer)); 102 return(X509_NAME_cmp(a->cert_info->issuer,b->cert_info->issuer));
103 } 103 }
104 104
105int X509_subject_name_cmp(X509 *a, X509 *b) 105int X509_subject_name_cmp(const X509 *a, const X509 *b)
106 { 106 {
107 return(X509_NAME_cmp(a->cert_info->subject,b->cert_info->subject)); 107 return(X509_NAME_cmp(a->cert_info->subject,b->cert_info->subject));
108 } 108 }
109 109
110int X509_CRL_cmp(X509_CRL *a, X509_CRL *b) 110int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b)
111 { 111 {
112 return(X509_NAME_cmp(a->crl->issuer,b->crl->issuer)); 112 return(X509_NAME_cmp(a->crl->issuer,b->crl->issuer));
113 } 113 }
@@ -139,19 +139,25 @@ unsigned long X509_subject_name_hash(X509 *x)
139 139
140#ifndef NO_SHA 140#ifndef NO_SHA
141/* Compare two certificates: they must be identical for 141/* Compare two certificates: they must be identical for
142 * this to work. 142 * this to work. NB: Although "cmp" operations are generally
143 * prototyped to take "const" arguments (eg. for use in
144 * STACKs), the way X509 handling is - these operations may
145 * involve ensuring the hashes are up-to-date and ensuring
146 * certain cert information is cached. So this is the point
147 * where the "depth-first" constification tree has to halt
148 * with an evil cast.
143 */ 149 */
144int X509_cmp(X509 *a, X509 *b) 150int X509_cmp(const X509 *a, const X509 *b)
145{ 151{
146 /* ensure hash is valid */ 152 /* ensure hash is valid */
147 X509_check_purpose(a, -1, 0); 153 X509_check_purpose((X509 *)a, -1, 0);
148 X509_check_purpose(b, -1, 0); 154 X509_check_purpose((X509 *)b, -1, 0);
149 155
150 return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH); 156 return memcmp(a->sha1_hash, b->sha1_hash, SHA_DIGEST_LENGTH);
151} 157}
152#endif 158#endif
153 159
154int X509_NAME_cmp(X509_NAME *a, X509_NAME *b) 160int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
155 { 161 {
156 int i,j; 162 int i,j;
157 X509_NAME_ENTRY *na,*nb; 163 X509_NAME_ENTRY *na,*nb;
@@ -198,14 +204,14 @@ unsigned long X509_NAME_hash(X509_NAME *x)
198 204
199 i=i2d_X509_NAME(x,NULL); 205 i=i2d_X509_NAME(x,NULL);
200 if (i > sizeof(str)) 206 if (i > sizeof(str))
201 p=Malloc(i); 207 p=OPENSSL_malloc(i);
202 else 208 else
203 p=str; 209 p=str;
204 210
205 pp=p; 211 pp=p;
206 i2d_X509_NAME(x,&pp); 212 i2d_X509_NAME(x,&pp);
207 MD5((unsigned char *)p,i,&(md[0])); 213 MD5((unsigned char *)p,i,&(md[0]));
208 if (p != str) Free(p); 214 if (p != str) OPENSSL_free(p);
209 215
210 ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| 216 ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)|
211 ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) 217 ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L)
diff --git a/src/lib/libcrypto/x509/x509_lu.c b/src/lib/libcrypto/x509/x509_lu.c
index a20006d67e..863c738cad 100644
--- a/src/lib/libcrypto/x509/x509_lu.c
+++ b/src/lib/libcrypto/x509/x509_lu.c
@@ -62,14 +62,13 @@
62#include <openssl/x509.h> 62#include <openssl/x509.h>
63 63
64static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_meth=NULL; 64static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_meth=NULL;
65static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_store_ctx_meth=NULL;
66 65
67X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) 66X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
68 { 67 {
69 X509_LOOKUP *ret; 68 X509_LOOKUP *ret;
70 69
71 ret=(X509_LOOKUP *)Malloc(sizeof(X509_LOOKUP)); 70 ret=(X509_LOOKUP *)OPENSSL_malloc(sizeof(X509_LOOKUP));
72 if (ret == NULL) return(NULL); 71 if (ret == NULL) return NULL;
73 72
74 ret->init=0; 73 ret->init=0;
75 ret->skip=0; 74 ret->skip=0;
@@ -78,10 +77,10 @@ X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
78 ret->store_ctx=NULL; 77 ret->store_ctx=NULL;
79 if ((method->new_item != NULL) && !method->new_item(ret)) 78 if ((method->new_item != NULL) && !method->new_item(ret))
80 { 79 {
81 Free(ret); 80 OPENSSL_free(ret);
82 return(NULL); 81 return NULL;
83 } 82 }
84 return(ret); 83 return ret;
85 } 84 }
86 85
87void X509_LOOKUP_free(X509_LOOKUP *ctx) 86void X509_LOOKUP_free(X509_LOOKUP *ctx)
@@ -90,44 +89,44 @@ void X509_LOOKUP_free(X509_LOOKUP *ctx)
90 if ( (ctx->method != NULL) && 89 if ( (ctx->method != NULL) &&
91 (ctx->method->free != NULL)) 90 (ctx->method->free != NULL))
92 ctx->method->free(ctx); 91 ctx->method->free(ctx);
93 Free(ctx); 92 OPENSSL_free(ctx);
94 } 93 }
95 94
96int X509_LOOKUP_init(X509_LOOKUP *ctx) 95int X509_LOOKUP_init(X509_LOOKUP *ctx)
97 { 96 {
98 if (ctx->method == NULL) return(0); 97 if (ctx->method == NULL) return 0;
99 if (ctx->method->init != NULL) 98 if (ctx->method->init != NULL)
100 return(ctx->method->init(ctx)); 99 return ctx->method->init(ctx);
101 else 100 else
102 return(1); 101 return 1;
103 } 102 }
104 103
105int X509_LOOKUP_shutdown(X509_LOOKUP *ctx) 104int X509_LOOKUP_shutdown(X509_LOOKUP *ctx)
106 { 105 {
107 if (ctx->method == NULL) return(0); 106 if (ctx->method == NULL) return 0;
108 if (ctx->method->shutdown != NULL) 107 if (ctx->method->shutdown != NULL)
109 return(ctx->method->shutdown(ctx)); 108 return ctx->method->shutdown(ctx);
110 else 109 else
111 return(1); 110 return 1;
112 } 111 }
113 112
114int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, 113int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
115 char **ret) 114 char **ret)
116 { 115 {
117 if (ctx->method == NULL) return(-1); 116 if (ctx->method == NULL) return -1;
118 if (ctx->method->ctrl != NULL) 117 if (ctx->method->ctrl != NULL)
119 return(ctx->method->ctrl(ctx,cmd,argc,argl,ret)); 118 return ctx->method->ctrl(ctx,cmd,argc,argl,ret);
120 else 119 else
121 return(1); 120 return 1;
122 } 121 }
123 122
124int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, 123int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,
125 X509_OBJECT *ret) 124 X509_OBJECT *ret)
126 { 125 {
127 if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL)) 126 if ((ctx->method == NULL) || (ctx->method->get_by_subject == NULL))
128 return(X509_LU_FAIL); 127 return X509_LU_FAIL;
129 if (ctx->skip) return(0); 128 if (ctx->skip) return 0;
130 return(ctx->method->get_by_subject(ctx,type,name,ret)); 129 return ctx->method->get_by_subject(ctx,type,name,ret);
131 } 130 }
132 131
133int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, 132int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,
@@ -135,71 +134,55 @@ int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,
135 { 134 {
136 if ((ctx->method == NULL) || 135 if ((ctx->method == NULL) ||
137 (ctx->method->get_by_issuer_serial == NULL)) 136 (ctx->method->get_by_issuer_serial == NULL))
138 return(X509_LU_FAIL); 137 return X509_LU_FAIL;
139 return(ctx->method->get_by_issuer_serial(ctx,type,name,serial,ret)); 138 return ctx->method->get_by_issuer_serial(ctx,type,name,serial,ret);
140 } 139 }
141 140
142int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, 141int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type,
143 unsigned char *bytes, int len, X509_OBJECT *ret) 142 unsigned char *bytes, int len, X509_OBJECT *ret)
144 { 143 {
145 if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL)) 144 if ((ctx->method == NULL) || (ctx->method->get_by_fingerprint == NULL))
146 return(X509_LU_FAIL); 145 return X509_LU_FAIL;
147 return(ctx->method->get_by_fingerprint(ctx,type,bytes,len,ret)); 146 return ctx->method->get_by_fingerprint(ctx,type,bytes,len,ret);
148 } 147 }
149 148
150int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len, 149int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len,
151 X509_OBJECT *ret) 150 X509_OBJECT *ret)
152 { 151 {
153 if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL)) 152 if ((ctx->method == NULL) || (ctx->method->get_by_alias == NULL))
154 return(X509_LU_FAIL); 153 return X509_LU_FAIL;
155 return(ctx->method->get_by_alias(ctx,type,str,len,ret)); 154 return ctx->method->get_by_alias(ctx,type,str,len,ret);
156 } 155 }
157 156
158static unsigned long x509_object_hash(X509_OBJECT *a) 157
159 { 158static int x509_object_cmp(const X509_OBJECT * const *a, const X509_OBJECT * const *b)
160 unsigned long h; 159 {
161 160 int ret;
162 switch (a->type) 161
163 { 162 ret=((*a)->type - (*b)->type);
164 case X509_LU_X509: 163 if (ret) return ret;
165 h=X509_NAME_hash(a->data.x509->cert_info->subject); 164 switch ((*a)->type)
166 break; 165 {
167 case X509_LU_CRL: 166 case X509_LU_X509:
168 h=X509_NAME_hash(a->data.crl->crl->issuer); 167 ret=X509_subject_name_cmp((*a)->data.x509,(*b)->data.x509);
169 break; 168 break;
170 default: 169 case X509_LU_CRL:
171 abort(); 170 ret=X509_CRL_cmp((*a)->data.crl,(*b)->data.crl);
172 } 171 break;
173 return(h);
174 }
175
176static int x509_object_cmp(X509_OBJECT *a, X509_OBJECT *b)
177 {
178 int ret;
179
180 ret=(a->type - b->type);
181 if (ret) return(ret);
182 switch (a->type)
183 {
184 case X509_LU_X509:
185 ret=X509_subject_name_cmp(a->data.x509,b->data.x509);
186 break;
187 case X509_LU_CRL:
188 ret=X509_CRL_cmp(a->data.crl,b->data.crl);
189 break;
190 default: 172 default:
191 abort(); 173 /* abort(); */
174 return 0;
192 } 175 }
193 return(ret); 176 return ret;
194 } 177 }
195 178
196X509_STORE *X509_STORE_new(void) 179X509_STORE *X509_STORE_new(void)
197 { 180 {
198 X509_STORE *ret; 181 X509_STORE *ret;
199 182
200 if ((ret=(X509_STORE *)Malloc(sizeof(X509_STORE))) == NULL) 183 if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
201 return(NULL); 184 return NULL;
202 ret->certs=lh_new(x509_object_hash,x509_object_cmp); 185 ret->objs = sk_X509_OBJECT_new(x509_object_cmp);
203 ret->cache=1; 186 ret->cache=1;
204 ret->get_cert_methods=sk_X509_LOOKUP_new_null(); 187 ret->get_cert_methods=sk_X509_LOOKUP_new_null();
205 ret->verify=NULL; 188 ret->verify=NULL;
@@ -207,7 +190,7 @@ X509_STORE *X509_STORE_new(void)
207 memset(&ret->ex_data,0,sizeof(CRYPTO_EX_DATA)); 190 memset(&ret->ex_data,0,sizeof(CRYPTO_EX_DATA));
208 ret->references=1; 191 ret->references=1;
209 ret->depth=0; 192 ret->depth=0;
210 return(ret); 193 return ret;
211 } 194 }
212 195
213static void cleanup(X509_OBJECT *a) 196static void cleanup(X509_OBJECT *a)
@@ -221,9 +204,11 @@ static void cleanup(X509_OBJECT *a)
221 X509_CRL_free(a->data.crl); 204 X509_CRL_free(a->data.crl);
222 } 205 }
223 else 206 else
224 abort(); 207 {
208 /* abort(); */
209 }
225 210
226 Free(a); 211 OPENSSL_free(a);
227 } 212 }
228 213
229void X509_STORE_free(X509_STORE *vfy) 214void X509_STORE_free(X509_STORE *vfy)
@@ -232,7 +217,7 @@ void X509_STORE_free(X509_STORE *vfy)
232 STACK_OF(X509_LOOKUP) *sk; 217 STACK_OF(X509_LOOKUP) *sk;
233 X509_LOOKUP *lu; 218 X509_LOOKUP *lu;
234 219
235 if(vfy == NULL) 220 if (vfy == NULL)
236 return; 221 return;
237 222
238 sk=vfy->get_cert_methods; 223 sk=vfy->get_cert_methods;
@@ -243,11 +228,10 @@ void X509_STORE_free(X509_STORE *vfy)
243 X509_LOOKUP_free(lu); 228 X509_LOOKUP_free(lu);
244 } 229 }
245 sk_X509_LOOKUP_free(sk); 230 sk_X509_LOOKUP_free(sk);
231 sk_X509_OBJECT_pop_free(vfy->objs, cleanup);
246 232
247 CRYPTO_free_ex_data(x509_store_meth,vfy,&vfy->ex_data); 233 CRYPTO_free_ex_data(x509_store_meth,vfy,&vfy->ex_data);
248 lh_doall(vfy->certs,cleanup); 234 OPENSSL_free(vfy);
249 lh_free(vfy->certs);
250 Free(vfy);
251 } 235 }
252 236
253X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m) 237X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m)
@@ -262,22 +246,22 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m)
262 lu=sk_X509_LOOKUP_value(sk,i); 246 lu=sk_X509_LOOKUP_value(sk,i);
263 if (m == lu->method) 247 if (m == lu->method)
264 { 248 {
265 return(lu); 249 return lu;
266 } 250 }
267 } 251 }
268 /* a new one */ 252 /* a new one */
269 lu=X509_LOOKUP_new(m); 253 lu=X509_LOOKUP_new(m);
270 if (lu == NULL) 254 if (lu == NULL)
271 return(NULL); 255 return NULL;
272 else 256 else
273 { 257 {
274 lu->store_ctx=v; 258 lu->store_ctx=v;
275 if (sk_X509_LOOKUP_push(v->get_cert_methods,lu)) 259 if (sk_X509_LOOKUP_push(v->get_cert_methods,lu))
276 return(lu); 260 return lu;
277 else 261 else
278 { 262 {
279 X509_LOOKUP_free(lu); 263 X509_LOOKUP_free(lu);
280 return(NULL); 264 return NULL;
281 } 265 }
282 } 266 }
283 } 267 }
@@ -290,7 +274,7 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
290 X509_OBJECT stmp,*tmp; 274 X509_OBJECT stmp,*tmp;
291 int i,j; 275 int i,j;
292 276
293 tmp=X509_OBJECT_retrieve_by_subject(ctx->certs,type,name); 277 tmp=X509_OBJECT_retrieve_by_subject(ctx->objs,type,name);
294 278
295 if (tmp == NULL) 279 if (tmp == NULL)
296 { 280 {
@@ -301,7 +285,7 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
301 if (j < 0) 285 if (j < 0)
302 { 286 {
303 vs->current_method=j; 287 vs->current_method=j;
304 return(j); 288 return j;
305 } 289 }
306 else if (j) 290 else if (j)
307 { 291 {
@@ -311,7 +295,7 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
311 } 295 }
312 vs->current_method=0; 296 vs->current_method=0;
313 if (tmp == NULL) 297 if (tmp == NULL)
314 return(0); 298 return 0;
315 } 299 }
316 300
317/* if (ret->data.ptr != NULL) 301/* if (ret->data.ptr != NULL)
@@ -322,7 +306,74 @@ int X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,
322 306
323 X509_OBJECT_up_ref_count(ret); 307 X509_OBJECT_up_ref_count(ret);
324 308
325 return(1); 309 return 1;
310 }
311
312int X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
313 {
314 X509_OBJECT *obj;
315 int ret=1;
316
317 if (x == NULL) return 0;
318 obj=(X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT));
319 if (obj == NULL)
320 {
321 X509err(X509_F_X509_STORE_ADD_CERT,ERR_R_MALLOC_FAILURE);
322 return 0;
323 }
324 obj->type=X509_LU_X509;
325 obj->data.x509=x;
326
327 CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
328
329 X509_OBJECT_up_ref_count(obj);
330
331
332 if (X509_OBJECT_retrieve_match(ctx->objs, obj))
333 {
334 X509_OBJECT_free_contents(obj);
335 OPENSSL_free(obj);
336 X509err(X509_F_X509_STORE_ADD_CERT,X509_R_CERT_ALREADY_IN_HASH_TABLE);
337 ret=0;
338 }
339 else sk_X509_OBJECT_push(ctx->objs, obj);
340
341 CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
342
343 return ret;
344 }
345
346int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
347 {
348 X509_OBJECT *obj;
349 int ret=1;
350
351 if (x == NULL) return 0;
352 obj=(X509_OBJECT *)OPENSSL_malloc(sizeof(X509_OBJECT));
353 if (obj == NULL)
354 {
355 X509err(X509_F_X509_STORE_ADD_CRL,ERR_R_MALLOC_FAILURE);
356 return 0;
357 }
358 obj->type=X509_LU_CRL;
359 obj->data.crl=x;
360
361 CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
362
363 X509_OBJECT_up_ref_count(obj);
364
365 if (X509_OBJECT_retrieve_match(ctx->objs, obj))
366 {
367 X509_OBJECT_free_contents(obj);
368 OPENSSL_free(obj);
369 X509err(X509_F_X509_STORE_ADD_CRL,X509_R_CERT_ALREADY_IN_HASH_TABLE);
370 ret=0;
371 }
372 else sk_X509_OBJECT_push(ctx->objs, obj);
373
374 CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
375
376 return ret;
326 } 377 }
327 378
328void X509_OBJECT_up_ref_count(X509_OBJECT *a) 379void X509_OBJECT_up_ref_count(X509_OBJECT *a)
@@ -351,10 +402,10 @@ void X509_OBJECT_free_contents(X509_OBJECT *a)
351 } 402 }
352 } 403 }
353 404
354X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h, int type, 405int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
355 X509_NAME *name) 406 X509_NAME *name)
356 { 407 {
357 X509_OBJECT stmp,*tmp; 408 X509_OBJECT stmp;
358 X509 x509_s; 409 X509 x509_s;
359 X509_CINF cinf_s; 410 X509_CINF cinf_s;
360 X509_CRL crl_s; 411 X509_CRL crl_s;
@@ -374,54 +425,105 @@ X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h, int type,
374 crl_info_s.issuer=name; 425 crl_info_s.issuer=name;
375 break; 426 break;
376 default: 427 default:
377 abort(); 428 /* abort(); */
429 return -1;
378 } 430 }
379 431
380 tmp=(X509_OBJECT *)lh_retrieve(h,&stmp); 432 return sk_X509_OBJECT_find(h,&stmp);
381 return(tmp);
382 } 433 }
383 434
384X509_STORE_CTX *X509_STORE_CTX_new(void) 435X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type,
436 X509_NAME *name)
385{ 437{
386 X509_STORE_CTX *ctx; 438 int idx;
387 ctx = (X509_STORE_CTX *)Malloc(sizeof(X509_STORE_CTX)); 439 idx = X509_OBJECT_idx_by_subject(h, type, name);
388 if(ctx) memset(ctx, 0, sizeof(X509_STORE_CTX)); 440 if (idx==-1) return NULL;
389 return ctx; 441 return sk_X509_OBJECT_value(h, idx);
390} 442}
391 443
392void X509_STORE_CTX_free(X509_STORE_CTX *ctx) 444X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x)
393{ 445{
394 X509_STORE_CTX_cleanup(ctx); 446 int idx, i;
395 Free(ctx); 447 X509_OBJECT *obj;
448 idx = sk_X509_OBJECT_find(h, x);
449 if (idx == -1) return NULL;
450 if (x->type != X509_LU_X509) return sk_X509_OBJECT_value(h, idx);
451 for (i = idx; i < sk_X509_OBJECT_num(h); i++)
452 {
453 obj = sk_X509_OBJECT_value(h, i);
454 if (x509_object_cmp((const X509_OBJECT **)&obj, (const X509_OBJECT **)&x))
455 return NULL;
456 if ((x->type != X509_LU_X509) || !X509_cmp(obj->data.x509, x->data.x509))
457 return obj;
458 }
459 return NULL;
396} 460}
397 461
398void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
399 STACK_OF(X509) *chain)
400 {
401 ctx->ctx=store;
402 ctx->current_method=0;
403 ctx->cert=x509;
404 ctx->untrusted=chain;
405 ctx->last_untrusted=0;
406 ctx->purpose=0;
407 ctx->trust=0;
408 ctx->valid=0;
409 ctx->chain=NULL;
410 ctx->depth=9;
411 ctx->error=0;
412 ctx->current_cert=NULL;
413 memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA));
414 }
415 462
416void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) 463/* Try to get issuer certificate from store. Due to limitations
417 { 464 * of the API this can only retrieve a single certificate matching
418 if (ctx->chain != NULL) 465 * a given subject name. However it will fill the cache with all
466 * matching certificates, so we can examine the cache for all
467 * matches.
468 *
469 * Return values are:
470 * 1 lookup successful.
471 * 0 certificate not found.
472 * -1 some other error.
473 */
474
475
476int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
477{
478 X509_NAME *xn;
479 X509_OBJECT obj, *pobj;
480 int i, ok, idx;
481 xn=X509_get_issuer_name(x);
482 ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj);
483 if (ok != X509_LU_X509)
484 {
485 if (ok == X509_LU_RETRY)
486 {
487 X509_OBJECT_free_contents(&obj);
488 X509err(X509_F_X509_VERIFY_CERT,X509_R_SHOULD_RETRY);
489 return -1;
490 }
491 else if (ok != X509_LU_FAIL)
492 {
493 X509_OBJECT_free_contents(&obj);
494 /* not good :-(, break anyway */
495 return -1;
496 }
497 return 0;
498 }
499 /* If certificate matches all OK */
500 if (ctx->check_issued(ctx, x, obj.data.x509))
419 { 501 {
420 sk_X509_pop_free(ctx->chain,X509_free); 502 *issuer = obj.data.x509;
421 ctx->chain=NULL; 503 return 1;
422 } 504 }
423 CRYPTO_free_ex_data(x509_store_ctx_meth,ctx,&(ctx->ex_data)); 505 X509_OBJECT_free_contents(&obj);
424 memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA)); 506 /* Else find index of first matching cert */
425 } 507 idx = X509_OBJECT_idx_by_subject(ctx->ctx->objs, X509_LU_X509, xn);
508 /* This shouldn't normally happen since we already have one match */
509 if (idx == -1) return 0;
510
511 /* Look through all matching certificates for a suitable issuer */
512 for (i = idx; i < sk_X509_OBJECT_num(ctx->ctx->objs); i++)
513 {
514 pobj = sk_X509_OBJECT_value(ctx->ctx->objs, i);
515 /* See if we've ran out of matches */
516 if (pobj->type != X509_LU_X509) return 0;
517 if (X509_NAME_cmp(xn, X509_get_subject_name(pobj->data.x509))) return 0;
518 if (ctx->check_issued(ctx, x, pobj->data.x509))
519 {
520 *issuer = pobj->data.x509;
521 X509_OBJECT_up_ref_count(pobj);
522 return 1;
523 }
524 }
525 return 0;
526}
426 527
427IMPLEMENT_STACK_OF(X509_LOOKUP) 528IMPLEMENT_STACK_OF(X509_LOOKUP)
529IMPLEMENT_STACK_OF(X509_OBJECT)
diff --git a/src/lib/libcrypto/x509/x509_obj.c b/src/lib/libcrypto/x509/x509_obj.c
index 691b71f031..6a3ba8eb15 100644
--- a/src/lib/libcrypto/x509/x509_obj.c
+++ b/src/lib/libcrypto/x509/x509_obj.c
@@ -91,7 +91,7 @@ int i;
91 if(b) 91 if(b)
92 { 92 {
93 buf=b->data; 93 buf=b->data;
94 Free(b); 94 OPENSSL_free(b);
95 } 95 }
96 strncpy(buf,"NO X509_NAME",len); 96 strncpy(buf,"NO X509_NAME",len);
97 return buf; 97 return buf;
@@ -210,7 +210,7 @@ int i;
210 if (b != NULL) 210 if (b != NULL)
211 { 211 {
212 p=b->data; 212 p=b->data;
213 Free(b); 213 OPENSSL_free(b);
214 } 214 }
215 else 215 else
216 p=buf; 216 p=buf;
diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c
index baef8790eb..7eca1bd57a 100644
--- a/src/lib/libcrypto/x509/x509_req.c
+++ b/src/lib/libcrypto/x509/x509_req.c
@@ -83,7 +83,7 @@ X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
83 ri=ret->req_info; 83 ri=ret->req_info;
84 84
85 ri->version->length=1; 85 ri->version->length=1;
86 ri->version->data=(unsigned char *)Malloc(1); 86 ri->version->data=(unsigned char *)OPENSSL_malloc(1);
87 if (ri->version->data == NULL) goto err; 87 if (ri->version->data == NULL) goto err;
88 ri->version->data[0]=0; /* version == 0 */ 88 ri->version->data[0]=0; /* version == 0 */
89 89
@@ -188,7 +188,7 @@ int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
188 /* Generate encoding of extensions */ 188 /* Generate encoding of extensions */
189 len = i2d_ASN1_SET_OF_X509_EXTENSION(exts, NULL, i2d_X509_EXTENSION, 189 len = i2d_ASN1_SET_OF_X509_EXTENSION(exts, NULL, i2d_X509_EXTENSION,
190 V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE); 190 V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE);
191 if(!(p = Malloc(len))) goto err; 191 if(!(p = OPENSSL_malloc(len))) goto err;
192 q = p; 192 q = p;
193 i2d_ASN1_SET_OF_X509_EXTENSION(exts, &q, i2d_X509_EXTENSION, 193 i2d_ASN1_SET_OF_X509_EXTENSION(exts, &q, i2d_X509_EXTENSION,
194 V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE); 194 V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE);
@@ -204,7 +204,7 @@ int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
204 if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err; 204 if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err;
205 return 1; 205 return 1;
206 err: 206 err:
207 if(p) Free(p); 207 if(p) OPENSSL_free(p);
208 X509_ATTRIBUTE_free(attr); 208 X509_ATTRIBUTE_free(attr);
209 ASN1_TYPE_free(at); 209 ASN1_TYPE_free(at);
210 return 0; 210 return 0;
diff --git a/src/lib/libcrypto/x509/x509_set.c b/src/lib/libcrypto/x509/x509_set.c
index add842d17a..aaf61ca062 100644
--- a/src/lib/libcrypto/x509/x509_set.c
+++ b/src/lib/libcrypto/x509/x509_set.c
@@ -104,36 +104,36 @@ int X509_set_subject_name(X509 *x, X509_NAME *name)
104 return(X509_NAME_set(&x->cert_info->subject,name)); 104 return(X509_NAME_set(&x->cert_info->subject,name));
105 } 105 }
106 106
107int X509_set_notBefore(X509 *x, ASN1_UTCTIME *tm) 107int X509_set_notBefore(X509 *x, ASN1_TIME *tm)
108 { 108 {
109 ASN1_UTCTIME *in; 109 ASN1_TIME *in;
110 110
111 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0); 111 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0);
112 in=x->cert_info->validity->notBefore; 112 in=x->cert_info->validity->notBefore;
113 if (in != tm) 113 if (in != tm)
114 { 114 {
115 in=M_ASN1_UTCTIME_dup(tm); 115 in=M_ASN1_TIME_dup(tm);
116 if (in != NULL) 116 if (in != NULL)
117 { 117 {
118 M_ASN1_UTCTIME_free(x->cert_info->validity->notBefore); 118 M_ASN1_TIME_free(x->cert_info->validity->notBefore);
119 x->cert_info->validity->notBefore=in; 119 x->cert_info->validity->notBefore=in;
120 } 120 }
121 } 121 }
122 return(in != NULL); 122 return(in != NULL);
123 } 123 }
124 124
125int X509_set_notAfter(X509 *x, ASN1_UTCTIME *tm) 125int X509_set_notAfter(X509 *x, ASN1_TIME *tm)
126 { 126 {
127 ASN1_UTCTIME *in; 127 ASN1_TIME *in;
128 128
129 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0); 129 if ((x == NULL) || (x->cert_info->validity == NULL)) return(0);
130 in=x->cert_info->validity->notAfter; 130 in=x->cert_info->validity->notAfter;
131 if (in != tm) 131 if (in != tm)
132 { 132 {
133 in=M_ASN1_UTCTIME_dup(tm); 133 in=M_ASN1_TIME_dup(tm);
134 if (in != NULL) 134 if (in != NULL)
135 { 135 {
136 M_ASN1_UTCTIME_free(x->cert_info->validity->notAfter); 136 M_ASN1_TIME_free(x->cert_info->validity->notAfter);
137 x->cert_info->validity->notAfter=in; 137 x->cert_info->validity->notAfter=in;
138 } 138 }
139 } 139 }
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c
index c779aaf94d..a7b1543461 100644
--- a/src/lib/libcrypto/x509/x509_trs.c
+++ b/src/lib/libcrypto/x509/x509_trs.c
@@ -61,7 +61,8 @@
61#include <openssl/x509v3.h> 61#include <openssl/x509v3.h>
62 62
63 63
64static int tr_cmp(X509_TRUST **a, X509_TRUST **b); 64static int tr_cmp(const X509_TRUST * const *a,
65 const X509_TRUST * const *b);
65static void trtable_free(X509_TRUST *p); 66static void trtable_free(X509_TRUST *p);
66 67
67static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags); 68static int trust_1oidany(X509_TRUST *trust, X509 *x, int flags);
@@ -88,7 +89,8 @@ IMPLEMENT_STACK_OF(X509_TRUST)
88 89
89static STACK_OF(X509_TRUST) *trtable = NULL; 90static STACK_OF(X509_TRUST) *trtable = NULL;
90 91
91static int tr_cmp(X509_TRUST **a, X509_TRUST **b) 92static int tr_cmp(const X509_TRUST * const *a,
93 const X509_TRUST * const *b)
92{ 94{
93 return (*a)->trust - (*b)->trust; 95 return (*a)->trust - (*b)->trust;
94} 96}
@@ -152,15 +154,15 @@ int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
152 idx = X509_TRUST_get_by_id(id); 154 idx = X509_TRUST_get_by_id(id);
153 /* Need a new entry */ 155 /* Need a new entry */
154 if(idx == -1) { 156 if(idx == -1) {
155 if(!(trtmp = Malloc(sizeof(X509_TRUST)))) { 157 if(!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) {
156 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); 158 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE);
157 return 0; 159 return 0;
158 } 160 }
159 trtmp->flags = X509_TRUST_DYNAMIC; 161 trtmp->flags = X509_TRUST_DYNAMIC;
160 } else trtmp = X509_TRUST_get0(idx); 162 } else trtmp = X509_TRUST_get0(idx);
161 163
162 /* Free existing name if dynamic */ 164 /* OPENSSL_free existing name if dynamic */
163 if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) Free(trtmp->name); 165 if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) OPENSSL_free(trtmp->name);
164 /* dup supplied name */ 166 /* dup supplied name */
165 if(!(trtmp->name = BUF_strdup(name))) { 167 if(!(trtmp->name = BUF_strdup(name))) {
166 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); 168 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE);
@@ -196,8 +198,8 @@ static void trtable_free(X509_TRUST *p)
196 if (p->flags & X509_TRUST_DYNAMIC) 198 if (p->flags & X509_TRUST_DYNAMIC)
197 { 199 {
198 if (p->flags & X509_TRUST_DYNAMIC_NAME) 200 if (p->flags & X509_TRUST_DYNAMIC_NAME)
199 Free(p->name); 201 OPENSSL_free(p->name);
200 Free(p); 202 OPENSSL_free(p);
201 } 203 }
202 } 204 }
203 205
diff --git a/src/lib/libcrypto/x509/x509_txt.c b/src/lib/libcrypto/x509/x509_txt.c
index 209cf53191..cfb478d4bc 100644
--- a/src/lib/libcrypto/x509/x509_txt.c
+++ b/src/lib/libcrypto/x509/x509_txt.c
@@ -132,6 +132,15 @@ const char *X509_verify_cert_error_string(long n)
132 return ("certificate rejected"); 132 return ("certificate rejected");
133 case X509_V_ERR_APPLICATION_VERIFICATION: 133 case X509_V_ERR_APPLICATION_VERIFICATION:
134 return("application verification failure"); 134 return("application verification failure");
135 case X509_V_ERR_SUBJECT_ISSUER_MISMATCH:
136 return("subject issuer mismatch");
137 case X509_V_ERR_AKID_SKID_MISMATCH:
138 return("authority and subject key identifier mismatch");
139 case X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH:
140 return("authority and issuer serial number mismatch");
141 case X509_V_ERR_KEYUSAGE_NO_CERTSIGN:
142 return("key usage does not include certificate signing");
143
135 default: 144 default:
136 sprintf(buf,"error number %ld",n); 145 sprintf(buf,"error number %ld",n);
137 return(buf); 146 return(buf);
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 3ddb2303d3..0f4110cc64 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -71,6 +71,8 @@
71#include <openssl/objects.h> 71#include <openssl/objects.h>
72 72
73static int null_callback(int ok,X509_STORE_CTX *e); 73static int null_callback(int ok,X509_STORE_CTX *e);
74static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer);
75static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x);
74static int check_chain_purpose(X509_STORE_CTX *ctx); 76static int check_chain_purpose(X509_STORE_CTX *ctx);
75static int check_trust(X509_STORE_CTX *ctx); 77static int check_trust(X509_STORE_CTX *ctx);
76static int internal_verify(X509_STORE_CTX *ctx); 78static int internal_verify(X509_STORE_CTX *ctx);
@@ -85,13 +87,13 @@ static STACK *x509_store_method=NULL;
85 87
86static int null_callback(int ok, X509_STORE_CTX *e) 88static int null_callback(int ok, X509_STORE_CTX *e)
87 { 89 {
88 return(ok); 90 return ok;
89 } 91 }
90 92
91#if 0 93#if 0
92static int x509_subject_cmp(X509 **a, X509 **b) 94static int x509_subject_cmp(X509 **a, X509 **b)
93 { 95 {
94 return(X509_subject_name_cmp(*a,*b)); 96 return X509_subject_name_cmp(*a,*b);
95 } 97 }
96#endif 98#endif
97 99
@@ -99,7 +101,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
99 { 101 {
100 X509 *x,*xtmp,*chain_ss=NULL; 102 X509 *x,*xtmp,*chain_ss=NULL;
101 X509_NAME *xn; 103 X509_NAME *xn;
102 X509_OBJECT obj;
103 int depth,i,ok=0; 104 int depth,i,ok=0;
104 int num; 105 int num;
105 int (*cb)(); 106 int (*cb)();
@@ -108,10 +109,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
108 if (ctx->cert == NULL) 109 if (ctx->cert == NULL)
109 { 110 {
110 X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); 111 X509err(X509_F_X509_VERIFY_CERT,X509_R_NO_CERT_SET_FOR_US_TO_VERIFY);
111 return(-1); 112 return -1;
112 } 113 }
113 114
114 cb=ctx->ctx->verify_cb; 115 cb=ctx->verify_cb;
115 if (cb == NULL) cb=null_callback; 116 if (cb == NULL) cb=null_callback;
116 117
117 /* first we make sure the chain we are going to build is 118 /* first we make sure the chain we are going to build is
@@ -152,13 +153,12 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
152 153
153 /* If we are self signed, we break */ 154 /* If we are self signed, we break */
154 xn=X509_get_issuer_name(x); 155 xn=X509_get_issuer_name(x);
155 if (X509_NAME_cmp(X509_get_subject_name(x),xn) == 0) 156 if (ctx->check_issued(ctx, x,x)) break;
156 break;
157 157
158 /* If we were passed a cert chain, use it first */ 158 /* If we were passed a cert chain, use it first */
159 if (ctx->untrusted != NULL) 159 if (ctx->untrusted != NULL)
160 { 160 {
161 xtmp=X509_find_by_subject(sktmp,xn); 161 xtmp=find_issuer(ctx, sktmp,x);
162 if (xtmp != NULL) 162 if (xtmp != NULL)
163 { 163 {
164 if (!sk_X509_push(ctx->chain,xtmp)) 164 if (!sk_X509_push(ctx->chain,xtmp))
@@ -183,11 +183,14 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
183 * certificates. We now need to add at least one trusted one, 183 * certificates. We now need to add at least one trusted one,
184 * if possible, otherwise we complain. */ 184 * if possible, otherwise we complain. */
185 185
186 /* Examine last certificate in chain and see if it
187 * is self signed.
188 */
189
186 i=sk_X509_num(ctx->chain); 190 i=sk_X509_num(ctx->chain);
187 x=sk_X509_value(ctx->chain,i-1); 191 x=sk_X509_value(ctx->chain,i-1);
188 xn = X509_get_subject_name(x); 192 xn = X509_get_subject_name(x);
189 if (X509_NAME_cmp(xn,X509_get_issuer_name(x)) 193 if (ctx->check_issued(ctx, x, x))
190 == 0)
191 { 194 {
192 /* we have a self signed certificate */ 195 /* we have a self signed certificate */
193 if (sk_X509_num(ctx->chain) == 1) 196 if (sk_X509_num(ctx->chain) == 1)
@@ -196,13 +199,13 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
196 * we can find it in the store. We must have an exact 199 * we can find it in the store. We must have an exact
197 * match to avoid possible impersonation. 200 * match to avoid possible impersonation.
198 */ 201 */
199 ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj); 202 ok = ctx->get_issuer(&xtmp, ctx, x);
200 if ((ok != X509_LU_X509) || X509_cmp(x, obj.data.x509)) 203 if ((ok <= 0) || X509_cmp(x, xtmp))
201 { 204 {
202 ctx->error=X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT; 205 ctx->error=X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT;
203 ctx->current_cert=x; 206 ctx->current_cert=x;
204 ctx->error_depth=i-1; 207 ctx->error_depth=i-1;
205 if(ok == X509_LU_X509) X509_OBJECT_free_contents(&obj); 208 if (ok == 1) X509_free(xtmp);
206 ok=cb(0,ctx); 209 ok=cb(0,ctx);
207 if (!ok) goto end; 210 if (!ok) goto end;
208 } 211 }
@@ -212,14 +215,14 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
212 * so we get any trust settings. 215 * so we get any trust settings.
213 */ 216 */
214 X509_free(x); 217 X509_free(x);
215 x = obj.data.x509; 218 x = xtmp;
216 sk_X509_set(ctx->chain, i - 1, x); 219 sk_X509_set(ctx->chain, i - 1, x);
217 ctx->last_untrusted=0; 220 ctx->last_untrusted=0;
218 } 221 }
219 } 222 }
220 else 223 else
221 { 224 {
222 /* worry more about this one elsewhere */ 225 /* extract and save self signed certificate for later use */
223 chain_ss=sk_X509_pop(ctx->chain); 226 chain_ss=sk_X509_pop(ctx->chain);
224 ctx->last_untrusted--; 227 ctx->last_untrusted--;
225 num--; 228 num--;
@@ -235,41 +238,30 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
235 238
236 /* If we are self signed, we break */ 239 /* If we are self signed, we break */
237 xn=X509_get_issuer_name(x); 240 xn=X509_get_issuer_name(x);
238 if (X509_NAME_cmp(X509_get_subject_name(x),xn) == 0) 241 if (ctx->check_issued(ctx,x,x)) break;
239 break;
240 242
241 ok=X509_STORE_get_by_subject(ctx,X509_LU_X509,xn,&obj); 243 ok = ctx->get_issuer(&xtmp, ctx, x);
242 if (ok != X509_LU_X509) 244
243 { 245 if (ok < 0) return ok;
244 if (ok == X509_LU_RETRY) 246 if (ok == 0) break;
245 { 247
246 X509_OBJECT_free_contents(&obj); 248 x = xtmp;
247 X509err(X509_F_X509_VERIFY_CERT,X509_R_SHOULD_RETRY); 249 if (!sk_X509_push(ctx->chain,x))
248 return(ok);
249 }
250 else if (ok != X509_LU_FAIL)
251 {
252 X509_OBJECT_free_contents(&obj);
253 /* not good :-(, break anyway */
254 return(ok);
255 }
256 break;
257 }
258 x=obj.data.x509;
259 if (!sk_X509_push(ctx->chain,obj.data.x509))
260 { 250 {
261 X509_OBJECT_free_contents(&obj); 251 X509_free(xtmp);
262 X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE); 252 X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);
263 return(0); 253 return 0;
264 } 254 }
265 num++; 255 num++;
266 } 256 }
267 257
268 /* we now have our chain, lets check it... */ 258 /* we now have our chain, lets check it... */
269 xn=X509_get_issuer_name(x); 259 xn=X509_get_issuer_name(x);
270 if (X509_NAME_cmp(X509_get_subject_name(x),xn) != 0) 260
261 /* Is last certificate looked up self signed? */
262 if (!ctx->check_issued(ctx,x,x))
271 { 263 {
272 if ((chain_ss == NULL) || (X509_NAME_cmp(X509_get_subject_name(chain_ss),xn) != 0)) 264 if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss))
273 { 265 {
274 if (ctx->last_untrusted >= num) 266 if (ctx->last_untrusted >= num)
275 ctx->error=X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY; 267 ctx->error=X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY;
@@ -294,22 +286,22 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
294 } 286 }
295 287
296 /* We have the chain complete: now we need to check its purpose */ 288 /* We have the chain complete: now we need to check its purpose */
297 if(ctx->purpose > 0) ok = check_chain_purpose(ctx); 289 if (ctx->purpose > 0) ok = check_chain_purpose(ctx);
298 290
299 if(!ok) goto end; 291 if (!ok) goto end;
300 292
301 /* The chain extensions are OK: check trust */ 293 /* The chain extensions are OK: check trust */
302 294
303 if(ctx->trust > 0) ok = check_trust(ctx); 295 if (ctx->trust > 0) ok = check_trust(ctx);
304 296
305 if(!ok) goto end; 297 if (!ok) goto end;
306 298
307 /* We may as well copy down any DSA parameters that are required */ 299 /* We may as well copy down any DSA parameters that are required */
308 X509_get_pubkey_parameters(NULL,ctx->chain); 300 X509_get_pubkey_parameters(NULL,ctx->chain);
309 301
310 /* At this point, we have a chain and just need to verify it */ 302 /* At this point, we have a chain and just need to verify it */
311 if (ctx->ctx->verify != NULL) 303 if (ctx->verify != NULL)
312 ok=ctx->ctx->verify(ctx); 304 ok=ctx->verify(ctx);
313 else 305 else
314 ok=internal_verify(ctx); 306 ok=internal_verify(ctx);
315 if (0) 307 if (0)
@@ -319,9 +311,61 @@ end:
319 } 311 }
320 if (sktmp != NULL) sk_X509_free(sktmp); 312 if (sktmp != NULL) sk_X509_free(sktmp);
321 if (chain_ss != NULL) X509_free(chain_ss); 313 if (chain_ss != NULL) X509_free(chain_ss);
322 return(ok); 314 return ok;
323 } 315 }
324 316
317
318/* Given a STACK_OF(X509) find the issuer of cert (if any)
319 */
320
321static X509 *find_issuer(X509_STORE_CTX *ctx, STACK_OF(X509) *sk, X509 *x)
322{
323 int i;
324 X509 *issuer;
325 for (i = 0; i < sk_X509_num(sk); i++)
326 {
327 issuer = sk_X509_value(sk, i);
328 if (ctx->check_issued(ctx, x, issuer))
329 return issuer;
330 }
331 return NULL;
332}
333
334/* Given a possible certificate and issuer check them */
335
336static int check_issued(X509_STORE_CTX *ctx, X509 *x, X509 *issuer)
337{
338 int ret;
339 ret = X509_check_issued(issuer, x);
340 if (ret == X509_V_OK)
341 return 1;
342 /* If we haven't asked for issuer errors don't set ctx */
343 if (!(ctx->flags & X509_V_FLAG_CB_ISSUER_CHECK))
344 return 0;
345
346 ctx->error = ret;
347 ctx->current_cert = x;
348 ctx->current_issuer = issuer;
349 if (ctx->verify_cb)
350 return ctx->verify_cb(0, ctx);
351 return 0;
352}
353
354/* Alternative lookup method: look from a STACK stored in other_ctx */
355
356static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x)
357{
358 *issuer = find_issuer(ctx, ctx->other_ctx, x);
359 if (*issuer)
360 {
361 CRYPTO_add(&(*issuer)->references,1,CRYPTO_LOCK_X509);
362 return 1;
363 }
364 else
365 return 0;
366}
367
368
325/* Check a certificate chains extensions for consistency 369/* Check a certificate chains extensions for consistency
326 * with the supplied purpose 370 * with the supplied purpose
327 */ 371 */
@@ -334,32 +378,37 @@ static int check_chain_purpose(X509_STORE_CTX *ctx)
334 int i, ok=0; 378 int i, ok=0;
335 X509 *x; 379 X509 *x;
336 int (*cb)(); 380 int (*cb)();
337 cb=ctx->ctx->verify_cb; 381 cb=ctx->verify_cb;
338 if (cb == NULL) cb=null_callback; 382 if (cb == NULL) cb=null_callback;
339 /* Check all untrusted certificates */ 383 /* Check all untrusted certificates */
340 for(i = 0; i < ctx->last_untrusted; i++) { 384 for (i = 0; i < ctx->last_untrusted; i++)
385 {
341 x = sk_X509_value(ctx->chain, i); 386 x = sk_X509_value(ctx->chain, i);
342 if(!X509_check_purpose(x, ctx->purpose, i)) { 387 if (!X509_check_purpose(x, ctx->purpose, i))
343 if(i) ctx->error = X509_V_ERR_INVALID_CA; 388 {
344 else ctx->error = X509_V_ERR_INVALID_PURPOSE; 389 if (i)
390 ctx->error = X509_V_ERR_INVALID_CA;
391 else
392 ctx->error = X509_V_ERR_INVALID_PURPOSE;
345 ctx->error_depth = i; 393 ctx->error_depth = i;
346 ctx->current_cert = x; 394 ctx->current_cert = x;
347 ok=cb(0,ctx); 395 ok=cb(0,ctx);
348 if(!ok) goto end; 396 if (!ok) goto end;
349 } 397 }
350 /* Check pathlen */ 398 /* Check pathlen */
351 if((i > 1) && (x->ex_pathlen != -1) 399 if ((i > 1) && (x->ex_pathlen != -1)
352 && (i > (x->ex_pathlen + 1))) { 400 && (i > (x->ex_pathlen + 1)))
401 {
353 ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; 402 ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED;
354 ctx->error_depth = i; 403 ctx->error_depth = i;
355 ctx->current_cert = x; 404 ctx->current_cert = x;
356 ok=cb(0,ctx); 405 ok=cb(0,ctx);
357 if(!ok) goto end; 406 if (!ok) goto end;
407 }
358 } 408 }
359 }
360 ok = 1; 409 ok = 1;
361 end: 410 end:
362 return(ok); 411 return ok;
363#endif 412#endif
364} 413}
365 414
@@ -371,19 +420,22 @@ static int check_trust(X509_STORE_CTX *ctx)
371 int i, ok; 420 int i, ok;
372 X509 *x; 421 X509 *x;
373 int (*cb)(); 422 int (*cb)();
374 cb=ctx->ctx->verify_cb; 423 cb=ctx->verify_cb;
375 if (cb == NULL) cb=null_callback; 424 if (cb == NULL) cb=null_callback;
376/* For now just check the last certificate in the chain */ 425/* For now just check the last certificate in the chain */
377 i = sk_X509_num(ctx->chain) - 1; 426 i = sk_X509_num(ctx->chain) - 1;
378 x = sk_X509_value(ctx->chain, i); 427 x = sk_X509_value(ctx->chain, i);
379 ok = X509_check_trust(x, ctx->trust, 0); 428 ok = X509_check_trust(x, ctx->trust, 0);
380 if(ok == X509_TRUST_TRUSTED) return 1; 429 if (ok == X509_TRUST_TRUSTED)
430 return 1;
381 ctx->error_depth = sk_X509_num(ctx->chain) - 1; 431 ctx->error_depth = sk_X509_num(ctx->chain) - 1;
382 ctx->current_cert = x; 432 ctx->current_cert = x;
383 if(ok == X509_TRUST_REJECTED) ctx->error = X509_V_ERR_CERT_REJECTED; 433 if (ok == X509_TRUST_REJECTED)
384 else ctx->error = X509_V_ERR_CERT_UNTRUSTED; 434 ctx->error = X509_V_ERR_CERT_REJECTED;
435 else
436 ctx->error = X509_V_ERR_CERT_UNTRUSTED;
385 ok = cb(0, ctx); 437 ok = cb(0, ctx);
386 return(ok); 438 return ok;
387#endif 439#endif
388} 440}
389 441
@@ -392,17 +444,21 @@ static int internal_verify(X509_STORE_CTX *ctx)
392 int i,ok=0,n; 444 int i,ok=0,n;
393 X509 *xs,*xi; 445 X509 *xs,*xi;
394 EVP_PKEY *pkey=NULL; 446 EVP_PKEY *pkey=NULL;
447 time_t *ptime;
395 int (*cb)(); 448 int (*cb)();
396 449
397 cb=ctx->ctx->verify_cb; 450 cb=ctx->verify_cb;
398 if (cb == NULL) cb=null_callback; 451 if (cb == NULL) cb=null_callback;
399 452
400 n=sk_X509_num(ctx->chain); 453 n=sk_X509_num(ctx->chain);
401 ctx->error_depth=n-1; 454 ctx->error_depth=n-1;
402 n--; 455 n--;
403 xi=sk_X509_value(ctx->chain,n); 456 xi=sk_X509_value(ctx->chain,n);
404 if (X509_NAME_cmp(X509_get_subject_name(xi), 457 if (ctx->flags & X509_V_FLAG_USE_CHECK_TIME)
405 X509_get_issuer_name(xi)) == 0) 458 ptime = &ctx->check_time;
459 else
460 ptime = NULL;
461 if (ctx->check_issued(ctx, xi, xi))
406 xs=xi; 462 xs=xi;
407 else 463 else
408 { 464 {
@@ -448,7 +504,7 @@ static int internal_verify(X509_STORE_CTX *ctx)
448 EVP_PKEY_free(pkey); 504 EVP_PKEY_free(pkey);
449 pkey=NULL; 505 pkey=NULL;
450 506
451 i=X509_cmp_current_time(X509_get_notBefore(xs)); 507 i=X509_cmp_time(X509_get_notBefore(xs), ptime);
452 if (i == 0) 508 if (i == 0)
453 { 509 {
454 ctx->error=X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD; 510 ctx->error=X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD;
@@ -466,7 +522,7 @@ static int internal_verify(X509_STORE_CTX *ctx)
466 xs->valid=1; 522 xs->valid=1;
467 } 523 }
468 524
469 i=X509_cmp_current_time(X509_get_notAfter(xs)); 525 i=X509_cmp_time(X509_get_notAfter(xs), ptime);
470 if (i == 0) 526 if (i == 0)
471 { 527 {
472 ctx->error=X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD; 528 ctx->error=X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD;
@@ -499,13 +555,18 @@ static int internal_verify(X509_STORE_CTX *ctx)
499 } 555 }
500 ok=1; 556 ok=1;
501end: 557end:
502 return(ok); 558 return ok;
503 } 559 }
504 560
505int X509_cmp_current_time(ASN1_UTCTIME *ctm) 561int X509_cmp_current_time(ASN1_TIME *ctm)
562{
563 return X509_cmp_time(ctm, NULL);
564}
565
566int X509_cmp_time(ASN1_TIME *ctm, time_t *cmp_time)
506 { 567 {
507 char *str; 568 char *str;
508 ASN1_UTCTIME atm; 569 ASN1_TIME atm;
509 time_t offset; 570 time_t offset;
510 char buff1[24],buff2[24],*p; 571 char buff1[24],buff2[24],*p;
511 int i,j; 572 int i,j;
@@ -513,14 +574,35 @@ int X509_cmp_current_time(ASN1_UTCTIME *ctm)
513 p=buff1; 574 p=buff1;
514 i=ctm->length; 575 i=ctm->length;
515 str=(char *)ctm->data; 576 str=(char *)ctm->data;
516 if ((i < 11) || (i > 17)) return(0); 577 if (ctm->type == V_ASN1_UTCTIME)
517 memcpy(p,str,10); 578 {
518 p+=10; 579 if ((i < 11) || (i > 17)) return 0;
519 str+=10; 580 memcpy(p,str,10);
581 p+=10;
582 str+=10;
583 }
584 else
585 {
586 if (i < 13) return 0;
587 memcpy(p,str,12);
588 p+=12;
589 str+=12;
590 }
520 591
521 if ((*str == 'Z') || (*str == '-') || (*str == '+')) 592 if ((*str == 'Z') || (*str == '-') || (*str == '+'))
522 { *(p++)='0'; *(p++)='0'; } 593 { *(p++)='0'; *(p++)='0'; }
523 else { *(p++)= *(str++); *(p++)= *(str++); } 594 else
595 {
596 *(p++)= *(str++);
597 *(p++)= *(str++);
598 /* Skip any fractional seconds... */
599 if (*str == '.')
600 {
601 str++;
602 while ((*str >= '0') && (*str <= '9')) str++;
603 }
604
605 }
524 *(p++)='Z'; 606 *(p++)='Z';
525 *(p++)='\0'; 607 *(p++)='\0';
526 608
@@ -529,39 +611,51 @@ int X509_cmp_current_time(ASN1_UTCTIME *ctm)
529 else 611 else
530 { 612 {
531 if ((*str != '+') && (str[5] != '-')) 613 if ((*str != '+') && (str[5] != '-'))
532 return(0); 614 return 0;
533 offset=((str[1]-'0')*10+(str[2]-'0'))*60; 615 offset=((str[1]-'0')*10+(str[2]-'0'))*60;
534 offset+=(str[3]-'0')*10+(str[4]-'0'); 616 offset+=(str[3]-'0')*10+(str[4]-'0');
535 if (*str == '-') 617 if (*str == '-')
536 offset= -offset; 618 offset= -offset;
537 } 619 }
538 atm.type=V_ASN1_UTCTIME; 620 atm.type=ctm->type;
539 atm.length=sizeof(buff2); 621 atm.length=sizeof(buff2);
540 atm.data=(unsigned char *)buff2; 622 atm.data=(unsigned char *)buff2;
541 623
542 X509_gmtime_adj(&atm,-offset*60); 624 X509_time_adj(&atm,-offset*60, cmp_time);
543 625
544 i=(buff1[0]-'0')*10+(buff1[1]-'0'); 626 if (ctm->type == V_ASN1_UTCTIME)
545 if (i < 50) i+=100; /* cf. RFC 2459 */ 627 {
546 j=(buff2[0]-'0')*10+(buff2[1]-'0'); 628 i=(buff1[0]-'0')*10+(buff1[1]-'0');
547 if (j < 50) j+=100; 629 if (i < 50) i+=100; /* cf. RFC 2459 */
630 j=(buff2[0]-'0')*10+(buff2[1]-'0');
631 if (j < 50) j+=100;
548 632
549 if (i < j) return (-1); 633 if (i < j) return -1;
550 if (i > j) return (1); 634 if (i > j) return 1;
635 }
551 i=strcmp(buff1,buff2); 636 i=strcmp(buff1,buff2);
552 if (i == 0) /* wait a second then return younger :-) */ 637 if (i == 0) /* wait a second then return younger :-) */
553 return(-1); 638 return -1;
554 else 639 else
555 return(i); 640 return i;
556 } 641 }
557 642
558ASN1_UTCTIME *X509_gmtime_adj(ASN1_UTCTIME *s, long adj) 643ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj)
644{
645 return X509_time_adj(s, adj, NULL);
646}
647
648ASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *in_tm)
559 { 649 {
560 time_t t; 650 time_t t;
561 651
562 time(&t); 652 if (in_tm) t = *in_tm;
653 else time(&t);
654
563 t+=adj; 655 t+=adj;
564 return(ASN1_UTCTIME_set(s,t)); 656 if (!s) return ASN1_TIME_set(s, t);
657 if (s->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_set(s,t);
658 return ASN1_GENERALIZEDTIME_set(s, t);
565 } 659 }
566 660
567int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain) 661int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
@@ -569,7 +663,7 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
569 EVP_PKEY *ktmp=NULL,*ktmp2; 663 EVP_PKEY *ktmp=NULL,*ktmp2;
570 int i,j; 664 int i,j;
571 665
572 if ((pkey != NULL) && !EVP_PKEY_missing_parameters(pkey)) return(1); 666 if ((pkey != NULL) && !EVP_PKEY_missing_parameters(pkey)) return 1;
573 667
574 for (i=0; i<sk_X509_num(chain); i++) 668 for (i=0; i<sk_X509_num(chain); i++)
575 { 669 {
@@ -577,7 +671,7 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
577 if (ktmp == NULL) 671 if (ktmp == NULL)
578 { 672 {
579 X509err(X509_F_X509_GET_PUBKEY_PARAMETERS,X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY); 673 X509err(X509_F_X509_GET_PUBKEY_PARAMETERS,X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY);
580 return(0); 674 return 0;
581 } 675 }
582 if (!EVP_PKEY_missing_parameters(ktmp)) 676 if (!EVP_PKEY_missing_parameters(ktmp))
583 break; 677 break;
@@ -590,7 +684,7 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
590 if (ktmp == NULL) 684 if (ktmp == NULL)
591 { 685 {
592 X509err(X509_F_X509_GET_PUBKEY_PARAMETERS,X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN); 686 X509err(X509_F_X509_GET_PUBKEY_PARAMETERS,X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN);
593 return(0); 687 return 0;
594 } 688 }
595 689
596 /* first, populate the other certs */ 690 /* first, populate the other certs */
@@ -603,101 +697,31 @@ int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain)
603 697
604 if (pkey != NULL) EVP_PKEY_copy_parameters(pkey,ktmp); 698 if (pkey != NULL) EVP_PKEY_copy_parameters(pkey,ktmp);
605 EVP_PKEY_free(ktmp); 699 EVP_PKEY_free(ktmp);
606 return(1); 700 return 1;
607 }
608
609int X509_STORE_add_cert(X509_STORE *ctx, X509 *x)
610 {
611 X509_OBJECT *obj,*r;
612 int ret=1;
613
614 if (x == NULL) return(0);
615 obj=(X509_OBJECT *)Malloc(sizeof(X509_OBJECT));
616 if (obj == NULL)
617 {
618 X509err(X509_F_X509_STORE_ADD_CERT,ERR_R_MALLOC_FAILURE);
619 return(0);
620 }
621 obj->type=X509_LU_X509;
622 obj->data.x509=x;
623
624 CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
625
626 X509_OBJECT_up_ref_count(obj);
627
628 r=(X509_OBJECT *)lh_insert(ctx->certs,obj);
629 if (r != NULL)
630 { /* oops, put it back */
631 lh_delete(ctx->certs,obj);
632 X509_OBJECT_free_contents(obj);
633 Free(obj);
634 lh_insert(ctx->certs,r);
635 X509err(X509_F_X509_STORE_ADD_CERT,X509_R_CERT_ALREADY_IN_HASH_TABLE);
636 ret=0;
637 }
638
639 CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
640
641 return(ret);
642 }
643
644int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x)
645 {
646 X509_OBJECT *obj,*r;
647 int ret=1;
648
649 if (x == NULL) return(0);
650 obj=(X509_OBJECT *)Malloc(sizeof(X509_OBJECT));
651 if (obj == NULL)
652 {
653 X509err(X509_F_X509_STORE_ADD_CRL,ERR_R_MALLOC_FAILURE);
654 return(0);
655 }
656 obj->type=X509_LU_CRL;
657 obj->data.crl=x;
658
659 CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE);
660
661 X509_OBJECT_up_ref_count(obj);
662
663 r=(X509_OBJECT *)lh_insert(ctx->certs,obj);
664 if (r != NULL)
665 { /* oops, put it back */
666 lh_delete(ctx->certs,obj);
667 X509_OBJECT_free_contents(obj);
668 Free(obj);
669 lh_insert(ctx->certs,r);
670 X509err(X509_F_X509_STORE_ADD_CRL,X509_R_CERT_ALREADY_IN_HASH_TABLE);
671 ret=0;
672 }
673
674 CRYPTO_w_unlock(CRYPTO_LOCK_X509_STORE);
675
676 return(ret);
677 } 701 }
678 702
679int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 703int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
680 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) 704 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
681 { 705 {
682 x509_store_ctx_num++; 706 x509_store_ctx_num++;
683 return(CRYPTO_get_ex_new_index(x509_store_ctx_num-1, 707 return CRYPTO_get_ex_new_index(x509_store_ctx_num-1,
684 &x509_store_ctx_method, 708 &x509_store_ctx_method,
685 argl,argp,new_func,dup_func,free_func)); 709 argl,argp,new_func,dup_func,free_func);
686 } 710 }
687 711
688int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data) 712int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data)
689 { 713 {
690 return(CRYPTO_set_ex_data(&ctx->ex_data,idx,data)); 714 return CRYPTO_set_ex_data(&ctx->ex_data,idx,data);
691 } 715 }
692 716
693void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx) 717void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx)
694 { 718 {
695 return(CRYPTO_get_ex_data(&ctx->ex_data,idx)); 719 return CRYPTO_get_ex_data(&ctx->ex_data,idx);
696 } 720 }
697 721
698int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx) 722int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx)
699 { 723 {
700 return(ctx->error); 724 return ctx->error;
701 } 725 }
702 726
703void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int err) 727void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int err)
@@ -707,17 +731,17 @@ void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int err)
707 731
708int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx) 732int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx)
709 { 733 {
710 return(ctx->error_depth); 734 return ctx->error_depth;
711 } 735 }
712 736
713X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx) 737X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx)
714 { 738 {
715 return(ctx->current_cert); 739 return ctx->current_cert;
716 } 740 }
717 741
718STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx) 742STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx)
719 { 743 {
720 return(ctx->chain); 744 return ctx->chain;
721 } 745 }
722 746
723STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx) 747STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx)
@@ -725,12 +749,13 @@ STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx)
725 int i; 749 int i;
726 X509 *x; 750 X509 *x;
727 STACK_OF(X509) *chain; 751 STACK_OF(X509) *chain;
728 if(!ctx->chain || !(chain = sk_X509_dup(ctx->chain))) return NULL; 752 if (!ctx->chain || !(chain = sk_X509_dup(ctx->chain))) return NULL;
729 for(i = 0; i < sk_X509_num(chain); i++) { 753 for (i = 0; i < sk_X509_num(chain); i++)
754 {
730 x = sk_X509_value(chain, i); 755 x = sk_X509_value(chain, i);
731 CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509); 756 CRYPTO_add(&x->references, 1, CRYPTO_LOCK_X509);
732 } 757 }
733 return(chain); 758 return chain;
734 } 759 }
735 760
736void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x) 761void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *x)
@@ -768,43 +793,123 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
768{ 793{
769 int idx; 794 int idx;
770 /* If purpose not set use default */ 795 /* If purpose not set use default */
771 if(!purpose) purpose = def_purpose; 796 if (!purpose) purpose = def_purpose;
772 /* If we have a purpose then check it is valid */ 797 /* If we have a purpose then check it is valid */
773 if(purpose) { 798 if (purpose)
799 {
774 X509_PURPOSE *ptmp; 800 X509_PURPOSE *ptmp;
775 idx = X509_PURPOSE_get_by_id(purpose); 801 idx = X509_PURPOSE_get_by_id(purpose);
776 if(idx == -1) { 802 if (idx == -1)
803 {
777 X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT, 804 X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT,
778 X509_R_UNKNOWN_PURPOSE_ID); 805 X509_R_UNKNOWN_PURPOSE_ID);
779 return 0; 806 return 0;
780 } 807 }
781 ptmp = X509_PURPOSE_get0(idx); 808 ptmp = X509_PURPOSE_get0(idx);
782 if(ptmp->trust == X509_TRUST_DEFAULT) { 809 if (ptmp->trust == X509_TRUST_DEFAULT)
810 {
783 idx = X509_PURPOSE_get_by_id(def_purpose); 811 idx = X509_PURPOSE_get_by_id(def_purpose);
784 if(idx == -1) { 812 if (idx == -1)
813 {
785 X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT, 814 X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT,
786 X509_R_UNKNOWN_PURPOSE_ID); 815 X509_R_UNKNOWN_PURPOSE_ID);
787 return 0; 816 return 0;
788 } 817 }
789 ptmp = X509_PURPOSE_get0(idx); 818 ptmp = X509_PURPOSE_get0(idx);
790 } 819 }
791 /* If trust not set then get from purpose default */ 820 /* If trust not set then get from purpose default */
792 if(!trust) trust = ptmp->trust; 821 if (!trust) trust = ptmp->trust;
793 } 822 }
794 if(trust) { 823 if (trust)
824 {
795 idx = X509_TRUST_get_by_id(trust); 825 idx = X509_TRUST_get_by_id(trust);
796 if(idx == -1) { 826 if (idx == -1)
827 {
797 X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT, 828 X509err(X509_F_X509_STORE_CTX_PURPOSE_INHERIT,
798 X509_R_UNKNOWN_TRUST_ID); 829 X509_R_UNKNOWN_TRUST_ID);
799 return 0; 830 return 0;
831 }
800 } 832 }
801 }
802 833
803 if(purpose) ctx->purpose = purpose; 834 if (purpose) ctx->purpose = purpose;
804 if(trust) ctx->trust = trust; 835 if (trust) ctx->trust = trust;
805 return 1; 836 return 1;
806} 837}
807 838
839X509_STORE_CTX *X509_STORE_CTX_new(void)
840{
841 X509_STORE_CTX *ctx;
842 ctx = (X509_STORE_CTX *)OPENSSL_malloc(sizeof(X509_STORE_CTX));
843 if (ctx) memset(ctx, 0, sizeof(X509_STORE_CTX));
844 return ctx;
845}
846
847void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
848{
849 X509_STORE_CTX_cleanup(ctx);
850 OPENSSL_free(ctx);
851}
852
853void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
854 STACK_OF(X509) *chain)
855 {
856 ctx->ctx=store;
857 ctx->current_method=0;
858 ctx->cert=x509;
859 ctx->untrusted=chain;
860 ctx->last_untrusted=0;
861 ctx->purpose=0;
862 ctx->trust=0;
863 ctx->check_time=0;
864 ctx->flags=0;
865 ctx->other_ctx=NULL;
866 ctx->valid=0;
867 ctx->chain=NULL;
868 ctx->depth=9;
869 ctx->error=0;
870 ctx->error_depth=0;
871 ctx->current_cert=NULL;
872 ctx->current_issuer=NULL;
873 ctx->check_issued = check_issued;
874 ctx->get_issuer = X509_STORE_CTX_get1_issuer;
875 ctx->verify_cb = store->verify_cb;
876 ctx->verify = store->verify;
877 ctx->cleanup = 0;
878 memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA));
879 }
880
881/* Set alternative lookup method: just a STACK of trusted certificates.
882 * This avoids X509_STORE nastiness where it isn't needed.
883 */
884
885void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk)
886{
887 ctx->other_ctx = sk;
888 ctx->get_issuer = get_issuer_sk;
889}
890
891void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx)
892 {
893 if (ctx->cleanup) ctx->cleanup(ctx);
894 if (ctx->chain != NULL)
895 {
896 sk_X509_pop_free(ctx->chain,X509_free);
897 ctx->chain=NULL;
898 }
899 CRYPTO_free_ex_data(x509_store_ctx_method,ctx,&(ctx->ex_data));
900 memset(&ctx->ex_data,0,sizeof(CRYPTO_EX_DATA));
901 }
902
903void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, long flags)
904 {
905 ctx->flags |= flags;
906 }
907
908void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t)
909 {
910 ctx->check_time = t;
911 ctx->flags |= X509_V_FLAG_USE_CHECK_TIME;
912 }
808 913
809IMPLEMENT_STACK_OF(X509) 914IMPLEMENT_STACK_OF(X509)
810IMPLEMENT_ASN1_SET_OF(X509) 915IMPLEMENT_ASN1_SET_OF(X509)
diff --git a/src/lib/libcrypto/x509/x509_vfy.h b/src/lib/libcrypto/x509/x509_vfy.h
index 4637aecedf..e289d5309a 100644
--- a/src/lib/libcrypto/x509/x509_vfy.h
+++ b/src/lib/libcrypto/x509/x509_vfy.h
@@ -65,13 +65,16 @@
65#ifndef HEADER_X509_VFY_H 65#ifndef HEADER_X509_VFY_H
66#define HEADER_X509_VFY_H 66#define HEADER_X509_VFY_H
67 67
68#ifdef __cplusplus 68#ifndef NO_LHASH
69extern "C" { 69#include <openssl/lhash.h>
70#endif 70#endif
71
72#include <openssl/bio.h> 71#include <openssl/bio.h>
73#include <openssl/crypto.h> 72#include <openssl/crypto.h>
74 73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
75/* Outer object */ 78/* Outer object */
76typedef struct x509_hash_dir_st 79typedef struct x509_hash_dir_st
77 { 80 {
@@ -128,6 +131,7 @@ typedef struct x509_object_st
128typedef struct x509_lookup_st X509_LOOKUP; 131typedef struct x509_lookup_st X509_LOOKUP;
129 132
130DECLARE_STACK_OF(X509_LOOKUP) 133DECLARE_STACK_OF(X509_LOOKUP)
134DECLARE_STACK_OF(X509_OBJECT)
131 135
132/* This is a static that defines the function interface */ 136/* This is a static that defines the function interface */
133typedef struct x509_lookup_method_st 137typedef struct x509_lookup_method_st
@@ -150,7 +154,7 @@ typedef struct x509_lookup_method_st
150 X509_OBJECT *ret); 154 X509_OBJECT *ret);
151 } X509_LOOKUP_METHOD; 155 } X509_LOOKUP_METHOD;
152 156
153typedef struct x509_store_state_st X509_STORE_CTX; 157typedef struct x509_store_ctx_st X509_STORE_CTX;
154 158
155/* This is used to hold everything. It is used for all certificate 159/* This is used to hold everything. It is used for all certificate
156 * validation. Once we have a certificate chain, the 'verify' 160 * validation. Once we have a certificate chain, the 'verify'
@@ -159,11 +163,7 @@ typedef struct x509_store_st
159 { 163 {
160 /* The following is a cache of trusted certs */ 164 /* The following is a cache of trusted certs */
161 int cache; /* if true, stash any hits */ 165 int cache; /* if true, stash any hits */
162#ifdef HEADER_LHASH_H 166 STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */
163 LHASH *certs; /* cached certs; */
164#else
165 char *certs;
166#endif
167 167
168 /* These are external lookup methods */ 168 /* These are external lookup methods */
169 STACK_OF(X509_LOOKUP) *get_cert_methods; 169 STACK_OF(X509_LOOKUP) *get_cert_methods;
@@ -191,10 +191,10 @@ struct x509_lookup_st
191 X509_STORE *store_ctx; /* who owns us */ 191 X509_STORE *store_ctx; /* who owns us */
192 }; 192 };
193 193
194/* This is a temporary used when processing cert chains. Since the 194/* This is a used when verifying cert chains. Since the
195 * gathering of the cert chain can take some time (and have to be 195 * gathering of the cert chain can take some time (and have to be
196 * 'retried', this needs to be kept and passed around. */ 196 * 'retried', this needs to be kept and passed around. */
197struct x509_store_state_st /* X509_STORE_CTX */ 197struct x509_store_ctx_st /* X509_STORE_CTX */
198 { 198 {
199 X509_STORE *ctx; 199 X509_STORE *ctx;
200 int current_method; /* used when looking up certs */ 200 int current_method; /* used when looking up certs */
@@ -204,6 +204,16 @@ struct x509_store_state_st /* X509_STORE_CTX */
204 STACK_OF(X509) *untrusted; /* chain of X509s - untrusted - passed in */ 204 STACK_OF(X509) *untrusted; /* chain of X509s - untrusted - passed in */
205 int purpose; /* purpose to check untrusted certificates */ 205 int purpose; /* purpose to check untrusted certificates */
206 int trust; /* trust setting to check */ 206 int trust; /* trust setting to check */
207 time_t check_time; /* time to make verify at */
208 unsigned long flags; /* Various verify flags */
209 void *other_ctx; /* Other info for use with get_issuer() */
210
211 /* Callbacks for various operations */
212 int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */
213 int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */
214 int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */
215 int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */
216 int (*cleanup)(X509_STORE_CTX *ctx);
207 217
208 /* The following is built up */ 218 /* The following is built up */
209 int depth; /* how far to go looking up certs */ 219 int depth; /* how far to go looking up certs */
@@ -215,6 +225,7 @@ struct x509_store_state_st /* X509_STORE_CTX */
215 int error_depth; 225 int error_depth;
216 int error; 226 int error;
217 X509 *current_cert; 227 X509 *current_cert;
228 X509 *current_issuer; /* cert currently being tested as valid issuer */
218 229
219 CRYPTO_EX_DATA ex_data; 230 CRYPTO_EX_DATA ex_data;
220 }; 231 };
@@ -265,10 +276,20 @@ struct x509_store_state_st /* X509_STORE_CTX */
265#define X509_V_ERR_INVALID_PURPOSE 26 276#define X509_V_ERR_INVALID_PURPOSE 26
266#define X509_V_ERR_CERT_UNTRUSTED 27 277#define X509_V_ERR_CERT_UNTRUSTED 27
267#define X509_V_ERR_CERT_REJECTED 28 278#define X509_V_ERR_CERT_REJECTED 28
279/* These are 'informational' when looking for issuer cert */
280#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
281#define X509_V_ERR_AKID_SKID_MISMATCH 30
282#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
283#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
268 284
269/* The application is not happy */ 285/* The application is not happy */
270#define X509_V_ERR_APPLICATION_VERIFICATION 50 286#define X509_V_ERR_APPLICATION_VERIFICATION 50
271 287
288/* Certificate verify flags */
289
290#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 /* Send issuer+subject checks to verify_cb */
291#define X509_V_FLAG_USE_CHECK_TIME 0x2 /* Use check time instead of current time */
292
272 /* These functions are being redefined in another directory, 293 /* These functions are being redefined in another directory,
273 and clash when the linker is case-insensitive, so let's 294 and clash when the linker is case-insensitive, so let's
274 hide them a little, by giving them an extra 'o' at the 295 hide them a little, by giving them an extra 'o' at the
@@ -284,18 +305,23 @@ struct x509_store_state_st /* X509_STORE_CTX */
284#define X509v3_add_standard_extensions oX509v3_add_standard_extensions 305#define X509v3_add_standard_extensions oX509v3_add_standard_extensions
285#endif 306#endif
286 307
287#ifdef HEADER_LHASH_H 308int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,
288X509_OBJECT *X509_OBJECT_retrieve_by_subject(LHASH *h,int type,X509_NAME *name); 309 X509_NAME *name);
289#endif 310X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name);
311X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x);
290void X509_OBJECT_up_ref_count(X509_OBJECT *a); 312void X509_OBJECT_up_ref_count(X509_OBJECT *a);
291void X509_OBJECT_free_contents(X509_OBJECT *a); 313void X509_OBJECT_free_contents(X509_OBJECT *a);
292X509_STORE *X509_STORE_new(void ); 314X509_STORE *X509_STORE_new(void );
293void X509_STORE_free(X509_STORE *v); 315void X509_STORE_free(X509_STORE *v);
294 316
295X509_STORE_CTX *X509_STORE_CTX_new(void); 317X509_STORE_CTX *X509_STORE_CTX_new(void);
318
319int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
320
296void X509_STORE_CTX_free(X509_STORE_CTX *ctx); 321void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
297void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, 322void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
298 X509 *x509, STACK_OF(X509) *chain); 323 X509 *x509, STACK_OF(X509) *chain);
324void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
299void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); 325void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
300 326
301X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); 327X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
@@ -354,6 +380,8 @@ int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
354int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); 380int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
355int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, 381int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
356 int purpose, int trust); 382 int purpose, int trust);
383void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, long flags);
384void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, long flags, time_t t);
357 385
358#ifdef __cplusplus 386#ifdef __cplusplus
359} 387}
diff --git a/src/lib/libcrypto/x509/x509spki.c b/src/lib/libcrypto/x509/x509spki.c
index b35c3f92e7..fd0a534d88 100644
--- a/src/lib/libcrypto/x509/x509spki.c
+++ b/src/lib/libcrypto/x509/x509spki.c
@@ -82,7 +82,7 @@ NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len)
82 int spki_len; 82 int spki_len;
83 NETSCAPE_SPKI *spki; 83 NETSCAPE_SPKI *spki;
84 if(len <= 0) len = strlen(str); 84 if(len <= 0) len = strlen(str);
85 if (!(spki_der = Malloc(len + 1))) { 85 if (!(spki_der = OPENSSL_malloc(len + 1))) {
86 X509err(X509_F_NETSCAPE_SPKI_B64_DECODE, ERR_R_MALLOC_FAILURE); 86 X509err(X509_F_NETSCAPE_SPKI_B64_DECODE, ERR_R_MALLOC_FAILURE);
87 return NULL; 87 return NULL;
88 } 88 }
@@ -90,12 +90,12 @@ NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len)
90 if(spki_len < 0) { 90 if(spki_len < 0) {
91 X509err(X509_F_NETSCAPE_SPKI_B64_DECODE, 91 X509err(X509_F_NETSCAPE_SPKI_B64_DECODE,
92 X509_R_BASE64_DECODE_ERROR); 92 X509_R_BASE64_DECODE_ERROR);
93 Free(spki_der); 93 OPENSSL_free(spki_der);
94 return NULL; 94 return NULL;
95 } 95 }
96 p = spki_der; 96 p = spki_der;
97 spki = d2i_NETSCAPE_SPKI(NULL, &p, spki_len); 97 spki = d2i_NETSCAPE_SPKI(NULL, &p, spki_len);
98 Free(spki_der); 98 OPENSSL_free(spki_der);
99 return spki; 99 return spki;
100} 100}
101 101
@@ -107,8 +107,8 @@ char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
107 char *b64_str; 107 char *b64_str;
108 int der_len; 108 int der_len;
109 der_len = i2d_NETSCAPE_SPKI(spki, NULL); 109 der_len = i2d_NETSCAPE_SPKI(spki, NULL);
110 der_spki = Malloc(der_len); 110 der_spki = OPENSSL_malloc(der_len);
111 b64_str = Malloc(der_len * 2); 111 b64_str = OPENSSL_malloc(der_len * 2);
112 if(!der_spki || !b64_str) { 112 if(!der_spki || !b64_str) {
113 X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE); 113 X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE);
114 return NULL; 114 return NULL;
@@ -116,6 +116,6 @@ char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki)
116 p = der_spki; 116 p = der_spki;
117 i2d_NETSCAPE_SPKI(spki, &p); 117 i2d_NETSCAPE_SPKI(spki, &p);
118 EVP_EncodeBlock((unsigned char *)b64_str, der_spki, der_len); 118 EVP_EncodeBlock((unsigned char *)b64_str, der_spki, der_len);
119 Free(der_spki); 119 OPENSSL_free(der_spki);
120 return b64_str; 120 return b64_str;
121} 121}
diff --git a/src/lib/libcrypto/x509/x_all.c b/src/lib/libcrypto/x509/x_all.c
index d2bf3c8e1c..9bd6e2a39b 100644
--- a/src/lib/libcrypto/x509/x_all.c
+++ b/src/lib/libcrypto/x509/x_all.c
@@ -411,13 +411,25 @@ X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne)
411 (char *(*)())d2i_X509_NAME_ENTRY,(char *)ne)); 411 (char *(*)())d2i_X509_NAME_ENTRY,(char *)ne));
412 } 412 }
413 413
414int X509_digest(X509 *data, const EVP_MD *type, unsigned char *md, 414int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md,
415 unsigned int *len) 415 unsigned int *len)
416 { 416 {
417 return(ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len)); 417 return(ASN1_digest((int (*)())i2d_X509,type,(char *)data,md,len));
418 } 418 }
419 419
420int X509_NAME_digest(X509_NAME *data, const EVP_MD *type, unsigned char *md, 420int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md,
421 unsigned int *len)
422 {
423 return(ASN1_digest((int (*)())i2d_X509_CRL,type,(char *)data,md,len));
424 }
425
426int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, unsigned char *md,
427 unsigned int *len)
428 {
429 return(ASN1_digest((int (*)())i2d_X509_REQ,type,(char *)data,md,len));
430 }
431
432int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, unsigned char *md,
421 unsigned int *len) 433 unsigned int *len)
422 { 434 {
423 return(ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len)); 435 return(ASN1_digest((int (*)())i2d_X509_NAME,type,(char *)data,md,len));
@@ -492,6 +504,17 @@ EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a)
492 (char *(*)())d2i_AutoPrivateKey, (fp),(unsigned char **)(a))); 504 (char *(*)())d2i_AutoPrivateKey, (fp),(unsigned char **)(a)));
493} 505}
494 506
507int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey)
508 {
509 return(ASN1_i2d_fp(i2d_PUBKEY,fp,(unsigned char *)pkey));
510 }
511
512EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a)
513{
514 return((EVP_PKEY *)ASN1_d2i_fp((char *(*)())EVP_PKEY_new,
515 (char *(*)())d2i_PUBKEY, (fp),(unsigned char **)(a)));
516}
517
495#endif 518#endif
496 519
497PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, 520PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
@@ -529,3 +552,14 @@ EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a)
529 return((EVP_PKEY *)ASN1_d2i_bio((char *(*)())EVP_PKEY_new, 552 return((EVP_PKEY *)ASN1_d2i_bio((char *(*)())EVP_PKEY_new,
530 (char *(*)())d2i_AutoPrivateKey, (bp),(unsigned char **)(a))); 553 (char *(*)())d2i_AutoPrivateKey, (bp),(unsigned char **)(a)));
531 } 554 }
555
556int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey)
557 {
558 return(ASN1_i2d_bio(i2d_PUBKEY,bp,(unsigned char *)pkey));
559 }
560
561EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a)
562 {
563 return((EVP_PKEY *)ASN1_d2i_bio((char *(*)())EVP_PKEY_new,
564 (char *(*)())d2i_PUBKEY, (bp),(unsigned char **)(a)));
565 }
diff --git a/src/lib/libcrypto/x509v3/Makefile.ssl b/src/lib/libcrypto/x509v3/Makefile.ssl
index 1bb746d52d..f7c3a6ca13 100644
--- a/src/lib/libcrypto/x509v3/Makefile.ssl
+++ b/src/lib/libcrypto/x509v3/Makefile.ssl
@@ -88,17 +88,19 @@ v3_akey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
88v3_akey.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 88v3_akey.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
89v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 89v3_akey.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
90v3_akey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 90v3_akey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
91v3_akey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 91v3_akey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
92v3_akey.o: ../../include/openssl/err.h ../../include/openssl/evp.h 92v3_akey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
93v3_akey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 93v3_akey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
94v3_akey.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 94v3_akey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
95v3_akey.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 95v3_akey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
96v3_akey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 96v3_akey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
97v3_akey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 97v3_akey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
98v3_akey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 98v3_akey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
99v3_akey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 99v3_akey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
100v3_akey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 100v3_akey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
101v3_akey.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 101v3_akey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
102v3_akey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
103v3_akey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
102v3_akey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 104v3_akey.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
103v3_akey.o: ../cryptlib.h 105v3_akey.o: ../cryptlib.h
104v3_alt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 106v3_alt.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -107,16 +109,18 @@ v3_alt.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
107v3_alt.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 109v3_alt.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
108v3_alt.o: ../../include/openssl/des.h ../../include/openssl/dh.h 110v3_alt.o: ../../include/openssl/des.h ../../include/openssl/dh.h
109v3_alt.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 111v3_alt.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
110v3_alt.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 112v3_alt.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
111v3_alt.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 113v3_alt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
112v3_alt.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 114v3_alt.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
115v3_alt.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
113v3_alt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 116v3_alt.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
114v3_alt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 117v3_alt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
115v3_alt.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 118v3_alt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
116v3_alt.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 119v3_alt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
117v3_alt.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 120v3_alt.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
118v3_alt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 121v3_alt.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
119v3_alt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 122v3_alt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
123v3_alt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
120v3_alt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 124v3_alt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
121v3_alt.o: ../../include/openssl/x509v3.h ../cryptlib.h 125v3_alt.o: ../../include/openssl/x509v3.h ../cryptlib.h
122v3_bcons.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 126v3_bcons.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -125,53 +129,60 @@ v3_bcons.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
125v3_bcons.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 129v3_bcons.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
126v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 130v3_bcons.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
127v3_bcons.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 131v3_bcons.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
128v3_bcons.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 132v3_bcons.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
129v3_bcons.o: ../../include/openssl/err.h ../../include/openssl/evp.h 133v3_bcons.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
130v3_bcons.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 134v3_bcons.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
131v3_bcons.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 135v3_bcons.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
132v3_bcons.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 136v3_bcons.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
133v3_bcons.o: ../../include/openssl/opensslconf.h 137v3_bcons.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
138v3_bcons.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
134v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 139v3_bcons.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
135v3_bcons.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 140v3_bcons.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
136v3_bcons.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 141v3_bcons.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
137v3_bcons.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 142v3_bcons.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
138v3_bcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 143v3_bcons.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
139v3_bcons.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 144v3_bcons.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
140v3_bcons.o: ../../include/openssl/x509v3.h ../cryptlib.h 145v3_bcons.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
146v3_bcons.o: ../cryptlib.h
141v3_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 147v3_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
142v3_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 148v3_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
143v3_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 149v3_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
144v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 150v3_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
145v3_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h 151v3_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h
146v3_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 152v3_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
147v3_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 153v3_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
148v3_bitst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 154v3_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
149v3_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 155v3_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
156v3_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
150v3_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 157v3_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
151v3_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 158v3_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
159v3_bitst.o: ../../include/openssl/opensslconf.h
152v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 160v3_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
153v3_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 161v3_bitst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
154v3_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 162v3_bitst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
155v3_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 163v3_bitst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
156v3_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 164v3_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
157v3_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 165v3_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
158v3_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h 166v3_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
167v3_bitst.o: ../cryptlib.h
159v3_conf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 168v3_conf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
160v3_conf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 169v3_conf.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
161v3_conf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 170v3_conf.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
162v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 171v3_conf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
163v3_conf.o: ../../include/openssl/des.h ../../include/openssl/dh.h 172v3_conf.o: ../../include/openssl/des.h ../../include/openssl/dh.h
164v3_conf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 173v3_conf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
165v3_conf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 174v3_conf.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
166v3_conf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 175v3_conf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
167v3_conf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 176v3_conf.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
177v3_conf.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
168v3_conf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 178v3_conf.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
169v3_conf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 179v3_conf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
170v3_conf.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 180v3_conf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
171v3_conf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 181v3_conf.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
172v3_conf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 182v3_conf.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
173v3_conf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 183v3_conf.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
174v3_conf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 184v3_conf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
185v3_conf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
175v3_conf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 186v3_conf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
176v3_conf.o: ../../include/openssl/x509v3.h ../cryptlib.h 187v3_conf.o: ../../include/openssl/x509v3.h ../cryptlib.h
177v3_cpols.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 188v3_cpols.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -180,36 +191,40 @@ v3_cpols.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
180v3_cpols.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 191v3_cpols.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
181v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 192v3_cpols.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
182v3_cpols.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 193v3_cpols.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
183v3_cpols.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 194v3_cpols.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
184v3_cpols.o: ../../include/openssl/err.h ../../include/openssl/evp.h 195v3_cpols.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
185v3_cpols.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 196v3_cpols.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
186v3_cpols.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 197v3_cpols.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
187v3_cpols.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 198v3_cpols.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
188v3_cpols.o: ../../include/openssl/opensslconf.h 199v3_cpols.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
200v3_cpols.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
189v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 201v3_cpols.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
190v3_cpols.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 202v3_cpols.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
191v3_cpols.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 203v3_cpols.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
192v3_cpols.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 204v3_cpols.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
193v3_cpols.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 205v3_cpols.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
194v3_cpols.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 206v3_cpols.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
195v3_cpols.o: ../../include/openssl/x509v3.h ../cryptlib.h 207v3_cpols.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
208v3_cpols.o: ../cryptlib.h
196v3_crld.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 209v3_crld.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
197v3_crld.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 210v3_crld.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
198v3_crld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 211v3_crld.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
199v3_crld.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 212v3_crld.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
200v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 213v3_crld.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
201v3_crld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 214v3_crld.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
202v3_crld.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 215v3_crld.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
203v3_crld.o: ../../include/openssl/err.h ../../include/openssl/evp.h 216v3_crld.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
204v3_crld.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 217v3_crld.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
205v3_crld.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 218v3_crld.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
206v3_crld.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 219v3_crld.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
207v3_crld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 220v3_crld.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
208v3_crld.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 221v3_crld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
209v3_crld.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 222v3_crld.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
210v3_crld.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 223v3_crld.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
211v3_crld.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 224v3_crld.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
212v3_crld.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 225v3_crld.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
226v3_crld.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
227v3_crld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
213v3_crld.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 228v3_crld.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
214v3_crld.o: ../cryptlib.h 229v3_crld.o: ../cryptlib.h
215v3_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 230v3_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -218,16 +233,18 @@ v3_enum.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
218v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 233v3_enum.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
219v3_enum.o: ../../include/openssl/des.h ../../include/openssl/dh.h 234v3_enum.o: ../../include/openssl/des.h ../../include/openssl/dh.h
220v3_enum.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 235v3_enum.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
221v3_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 236v3_enum.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
222v3_enum.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 237v3_enum.o: ../../include/openssl/err.h ../../include/openssl/evp.h
223v3_enum.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 238v3_enum.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
239v3_enum.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
224v3_enum.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 240v3_enum.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
225v3_enum.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 241v3_enum.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
226v3_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 242v3_enum.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
227v3_enum.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 243v3_enum.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
228v3_enum.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 244v3_enum.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
229v3_enum.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 245v3_enum.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
230v3_enum.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 246v3_enum.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
247v3_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
231v3_enum.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 248v3_enum.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
232v3_enum.o: ../../include/openssl/x509v3.h ../cryptlib.h 249v3_enum.o: ../../include/openssl/x509v3.h ../cryptlib.h
233v3_extku.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 250v3_extku.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -236,35 +253,40 @@ v3_extku.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
236v3_extku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 253v3_extku.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
237v3_extku.o: ../../include/openssl/des.h ../../include/openssl/dh.h 254v3_extku.o: ../../include/openssl/des.h ../../include/openssl/dh.h
238v3_extku.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 255v3_extku.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
239v3_extku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 256v3_extku.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
240v3_extku.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 257v3_extku.o: ../../include/openssl/err.h ../../include/openssl/evp.h
241v3_extku.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 258v3_extku.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
259v3_extku.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
242v3_extku.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 260v3_extku.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
243v3_extku.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 261v3_extku.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
262v3_extku.o: ../../include/openssl/opensslconf.h
244v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 263v3_extku.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
245v3_extku.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 264v3_extku.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
246v3_extku.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 265v3_extku.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
247v3_extku.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 266v3_extku.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
248v3_extku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 267v3_extku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
249v3_extku.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 268v3_extku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
250v3_extku.o: ../../include/openssl/x509v3.h ../cryptlib.h 269v3_extku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
270v3_extku.o: ../cryptlib.h
251v3_genn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 271v3_genn.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
252v3_genn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h 272v3_genn.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h
253v3_genn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h 273v3_genn.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
254v3_genn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 274v3_genn.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
255v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 275v3_genn.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
256v3_genn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 276v3_genn.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
257v3_genn.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 277v3_genn.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
258v3_genn.o: ../../include/openssl/err.h ../../include/openssl/evp.h 278v3_genn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
259v3_genn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 279v3_genn.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
260v3_genn.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 280v3_genn.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
261v3_genn.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 281v3_genn.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
262v3_genn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 282v3_genn.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
263v3_genn.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 283v3_genn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
264v3_genn.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 284v3_genn.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
265v3_genn.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 285v3_genn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
266v3_genn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 286v3_genn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
267v3_genn.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 287v3_genn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
288v3_genn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
289v3_genn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
268v3_genn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 290v3_genn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
269v3_genn.o: ../cryptlib.h 291v3_genn.o: ../cryptlib.h
270v3_ia5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 292v3_ia5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -273,16 +295,18 @@ v3_ia5.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
273v3_ia5.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 295v3_ia5.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
274v3_ia5.o: ../../include/openssl/des.h ../../include/openssl/dh.h 296v3_ia5.o: ../../include/openssl/des.h ../../include/openssl/dh.h
275v3_ia5.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 297v3_ia5.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
276v3_ia5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 298v3_ia5.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
277v3_ia5.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 299v3_ia5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
278v3_ia5.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 300v3_ia5.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
301v3_ia5.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
279v3_ia5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 302v3_ia5.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
280v3_ia5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 303v3_ia5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
281v3_ia5.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 304v3_ia5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
282v3_ia5.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 305v3_ia5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
283v3_ia5.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 306v3_ia5.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
284v3_ia5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 307v3_ia5.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
285v3_ia5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 308v3_ia5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
309v3_ia5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
286v3_ia5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 310v3_ia5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
287v3_ia5.o: ../../include/openssl/x509v3.h ../cryptlib.h 311v3_ia5.o: ../../include/openssl/x509v3.h ../cryptlib.h
288v3_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 312v3_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -291,17 +315,19 @@ v3_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
291v3_info.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 315v3_info.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
292v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 316v3_info.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
293v3_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 317v3_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
294v3_info.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 318v3_info.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
295v3_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h 319v3_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
296v3_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 320v3_info.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
297v3_info.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 321v3_info.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
298v3_info.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 322v3_info.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
299v3_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 323v3_info.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
300v3_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 324v3_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
301v3_info.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 325v3_info.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
302v3_info.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 326v3_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
303v3_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 327v3_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
304v3_info.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 328v3_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
329v3_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
330v3_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
305v3_info.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 331v3_info.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
306v3_info.o: ../cryptlib.h 332v3_info.o: ../cryptlib.h
307v3_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 333v3_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -310,16 +336,18 @@ v3_int.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
310v3_int.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 336v3_int.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
311v3_int.o: ../../include/openssl/des.h ../../include/openssl/dh.h 337v3_int.o: ../../include/openssl/des.h ../../include/openssl/dh.h
312v3_int.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 338v3_int.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
313v3_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 339v3_int.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
314v3_int.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 340v3_int.o: ../../include/openssl/err.h ../../include/openssl/evp.h
315v3_int.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 341v3_int.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
342v3_int.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
316v3_int.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 343v3_int.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
317v3_int.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 344v3_int.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
318v3_int.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 345v3_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
319v3_int.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 346v3_int.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
320v3_int.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 347v3_int.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
321v3_int.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 348v3_int.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
322v3_int.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 349v3_int.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
350v3_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
323v3_int.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 351v3_int.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
324v3_int.o: ../../include/openssl/x509v3.h ../cryptlib.h 352v3_int.o: ../../include/openssl/x509v3.h ../cryptlib.h
325v3_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 353v3_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -328,16 +356,18 @@ v3_lib.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
328v3_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 356v3_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
329v3_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h 357v3_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h
330v3_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 358v3_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
331v3_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 359v3_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
332v3_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 360v3_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
333v3_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 361v3_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
362v3_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
334v3_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 363v3_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
335v3_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 364v3_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
336v3_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 365v3_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
337v3_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 366v3_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
338v3_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 367v3_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
339v3_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 368v3_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
340v3_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 369v3_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
370v3_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
341v3_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 371v3_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
342v3_lib.o: ../../include/openssl/x509v3.h ../cryptlib.h ext_dat.h 372v3_lib.o: ../../include/openssl/x509v3.h ../cryptlib.h ext_dat.h
343v3_pku.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 373v3_pku.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -346,17 +376,19 @@ v3_pku.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
346v3_pku.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 376v3_pku.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
347v3_pku.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 377v3_pku.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
348v3_pku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 378v3_pku.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
349v3_pku.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 379v3_pku.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
350v3_pku.o: ../../include/openssl/err.h ../../include/openssl/evp.h 380v3_pku.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
351v3_pku.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 381v3_pku.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
352v3_pku.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 382v3_pku.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
353v3_pku.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 383v3_pku.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
354v3_pku.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 384v3_pku.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
355v3_pku.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h 385v3_pku.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
356v3_pku.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h 386v3_pku.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
357v3_pku.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h 387v3_pku.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
358v3_pku.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h 388v3_pku.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
359v3_pku.o: ../../include/openssl/stack.h ../../include/openssl/x509.h 389v3_pku.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
390v3_pku.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
391v3_pku.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
360v3_pku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h 392v3_pku.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
361v3_pku.o: ../cryptlib.h 393v3_pku.o: ../cryptlib.h
362v3_prn.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 394v3_prn.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -365,16 +397,18 @@ v3_prn.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
365v3_prn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 397v3_prn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
366v3_prn.o: ../../include/openssl/des.h ../../include/openssl/dh.h 398v3_prn.o: ../../include/openssl/des.h ../../include/openssl/dh.h
367v3_prn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 399v3_prn.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
368v3_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 400v3_prn.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
369v3_prn.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 401v3_prn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
370v3_prn.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 402v3_prn.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
403v3_prn.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
371v3_prn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 404v3_prn.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
372v3_prn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 405v3_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
373v3_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 406v3_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
374v3_prn.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 407v3_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
375v3_prn.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 408v3_prn.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
376v3_prn.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 409v3_prn.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
377v3_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 410v3_prn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
411v3_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
378v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 412v3_prn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
379v3_prn.o: ../../include/openssl/x509v3.h ../cryptlib.h 413v3_prn.o: ../../include/openssl/x509v3.h ../cryptlib.h
380v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 414v3_purp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -383,16 +417,18 @@ v3_purp.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
383v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 417v3_purp.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
384v3_purp.o: ../../include/openssl/des.h ../../include/openssl/dh.h 418v3_purp.o: ../../include/openssl/des.h ../../include/openssl/dh.h
385v3_purp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 419v3_purp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
386v3_purp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 420v3_purp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
387v3_purp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 421v3_purp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
388v3_purp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 422v3_purp.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
423v3_purp.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
389v3_purp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 424v3_purp.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
390v3_purp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 425v3_purp.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
391v3_purp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 426v3_purp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
392v3_purp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 427v3_purp.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
393v3_purp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 428v3_purp.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
394v3_purp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 429v3_purp.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
395v3_purp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 430v3_purp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
431v3_purp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
396v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 432v3_purp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
397v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h 433v3_purp.o: ../../include/openssl/x509v3.h ../cryptlib.h
398v3_skey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 434v3_skey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -401,16 +437,18 @@ v3_skey.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
401v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 437v3_skey.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
402v3_skey.o: ../../include/openssl/des.h ../../include/openssl/dh.h 438v3_skey.o: ../../include/openssl/des.h ../../include/openssl/dh.h
403v3_skey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 439v3_skey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
404v3_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 440v3_skey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
405v3_skey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 441v3_skey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
406v3_skey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 442v3_skey.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
443v3_skey.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
407v3_skey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 444v3_skey.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
408v3_skey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 445v3_skey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
409v3_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 446v3_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
410v3_skey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 447v3_skey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
411v3_skey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 448v3_skey.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
412v3_skey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 449v3_skey.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
413v3_skey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 450v3_skey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
451v3_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
414v3_skey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 452v3_skey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
415v3_skey.o: ../../include/openssl/x509v3.h ../cryptlib.h 453v3_skey.o: ../../include/openssl/x509v3.h ../cryptlib.h
416v3_sxnet.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h 454v3_sxnet.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h
@@ -419,51 +457,57 @@ v3_sxnet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
419v3_sxnet.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 457v3_sxnet.o: ../../include/openssl/cast.h ../../include/openssl/conf.h
420v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 458v3_sxnet.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
421v3_sxnet.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 459v3_sxnet.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
422v3_sxnet.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h 460v3_sxnet.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h
423v3_sxnet.o: ../../include/openssl/err.h ../../include/openssl/evp.h 461v3_sxnet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
424v3_sxnet.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h 462v3_sxnet.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
425v3_sxnet.o: ../../include/openssl/md2.h ../../include/openssl/md5.h 463v3_sxnet.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
426v3_sxnet.o: ../../include/openssl/mdc2.h ../../include/openssl/objects.h 464v3_sxnet.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
427v3_sxnet.o: ../../include/openssl/opensslconf.h 465v3_sxnet.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
466v3_sxnet.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
428v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 467v3_sxnet.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
429v3_sxnet.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 468v3_sxnet.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
430v3_sxnet.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 469v3_sxnet.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
431v3_sxnet.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 470v3_sxnet.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
432v3_sxnet.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 471v3_sxnet.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
433v3_sxnet.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 472v3_sxnet.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
434v3_sxnet.o: ../../include/openssl/x509v3.h ../cryptlib.h 473v3_sxnet.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
474v3_sxnet.o: ../cryptlib.h
435v3_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 475v3_utl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
436v3_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 476v3_utl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
437v3_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h 477v3_utl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
438v3_utl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h 478v3_utl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
439v3_utl.o: ../../include/openssl/des.h ../../include/openssl/dh.h 479v3_utl.o: ../../include/openssl/des.h ../../include/openssl/dh.h
440v3_utl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h 480v3_utl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
441v3_utl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 481v3_utl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
442v3_utl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 482v3_utl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
443v3_utl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 483v3_utl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h
484v3_utl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h
444v3_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 485v3_utl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h
445v3_utl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 486v3_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
446v3_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 487v3_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
447v3_utl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 488v3_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h
448v3_utl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 489v3_utl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h
449v3_utl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 490v3_utl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h
450v3_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 491v3_utl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
492v3_utl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
451v3_utl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 493v3_utl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
452v3_utl.o: ../../include/openssl/x509v3.h ../cryptlib.h 494v3_utl.o: ../../include/openssl/x509v3.h ../cryptlib.h
453v3err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 495v3err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
454v3err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h 496v3err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h
455v3err.o: ../../include/openssl/cast.h ../../include/openssl/conf.h 497v3err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h
456v3err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h 498v3err.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
457v3err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 499v3err.o: ../../include/openssl/des.h ../../include/openssl/dh.h
500v3err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h
458v3err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 501v3err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
459v3err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h 502v3err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h
460v3err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h 503v3err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
461v3err.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h 504v3err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h
505v3err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
462v3err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 506v3err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
463v3err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h 507v3err.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h
464v3err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h 508v3err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h
465v3err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h 509v3err.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h
466v3err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 510v3err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
467v3err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h 511v3err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
468v3err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h 512v3err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
469v3err.o: ../../include/openssl/x509v3.h 513v3err.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
diff --git a/src/lib/libcrypto/x509v3/v3_akey.c b/src/lib/libcrypto/x509v3/v3_akey.c
index 96c04fe4f5..0889a18993 100644
--- a/src/lib/libcrypto/x509v3/v3_akey.c
+++ b/src/lib/libcrypto/x509v3/v3_akey.c
@@ -132,7 +132,7 @@ void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a)
132 M_ASN1_OCTET_STRING_free(a->keyid); 132 M_ASN1_OCTET_STRING_free(a->keyid);
133 sk_GENERAL_NAME_pop_free(a->issuer, GENERAL_NAME_free); 133 sk_GENERAL_NAME_pop_free(a->issuer, GENERAL_NAME_free);
134 M_ASN1_INTEGER_free (a->serial); 134 M_ASN1_INTEGER_free (a->serial);
135 Free (a); 135 OPENSSL_free (a);
136} 136}
137 137
138static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, 138static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
@@ -142,7 +142,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
142 if(akeyid->keyid) { 142 if(akeyid->keyid) {
143 tmp = hex_to_string(akeyid->keyid->data, akeyid->keyid->length); 143 tmp = hex_to_string(akeyid->keyid->data, akeyid->keyid->length);
144 X509V3_add_value("keyid", tmp, &extlist); 144 X509V3_add_value("keyid", tmp, &extlist);
145 Free(tmp); 145 OPENSSL_free(tmp);
146 } 146 }
147 if(akeyid->issuer) 147 if(akeyid->issuer)
148 extlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist); 148 extlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist);
@@ -150,7 +150,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
150 tmp = hex_to_string(akeyid->serial->data, 150 tmp = hex_to_string(akeyid->serial->data,
151 akeyid->serial->length); 151 akeyid->serial->length);
152 X509V3_add_value("serial", tmp, &extlist); 152 X509V3_add_value("serial", tmp, &extlist);
153 Free(tmp); 153 OPENSSL_free(tmp);
154 } 154 }
155 return extlist; 155 return extlist;
156} 156}
@@ -224,7 +224,7 @@ if((issuer && !ikeyid) || (issuer == 2)) {
224if(!(akeyid = AUTHORITY_KEYID_new())) goto err; 224if(!(akeyid = AUTHORITY_KEYID_new())) goto err;
225 225
226if(isname) { 226if(isname) {
227 if(!(gens = sk_GENERAL_NAME_new(NULL)) || !(gen = GENERAL_NAME_new()) 227 if(!(gens = sk_GENERAL_NAME_new_null()) || !(gen = GENERAL_NAME_new())
228 || !sk_GENERAL_NAME_push(gens, gen)) { 228 || !sk_GENERAL_NAME_push(gens, gen)) {
229 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,ERR_R_MALLOC_FAILURE); 229 X509V3err(X509V3_F_V2I_AUTHORITY_KEYID,ERR_R_MALLOC_FAILURE);
230 goto err; 230 goto err;
diff --git a/src/lib/libcrypto/x509v3/v3_alt.c b/src/lib/libcrypto/x509v3/v3_alt.c
index 5ccd1e0e3d..733919f250 100644
--- a/src/lib/libcrypto/x509v3/v3_alt.c
+++ b/src/lib/libcrypto/x509v3/v3_alt.c
@@ -160,7 +160,7 @@ static STACK_OF(GENERAL_NAME) *v2i_issuer_alt(X509V3_EXT_METHOD *method,
160 STACK_OF(GENERAL_NAME) *gens = NULL; 160 STACK_OF(GENERAL_NAME) *gens = NULL;
161 CONF_VALUE *cnf; 161 CONF_VALUE *cnf;
162 int i; 162 int i;
163 if(!(gens = sk_GENERAL_NAME_new(NULL))) { 163 if(!(gens = sk_GENERAL_NAME_new_null())) {
164 X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE); 164 X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
165 return NULL; 165 return NULL;
166 } 166 }
@@ -225,7 +225,7 @@ static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method,
225 STACK_OF(GENERAL_NAME) *gens = NULL; 225 STACK_OF(GENERAL_NAME) *gens = NULL;
226 CONF_VALUE *cnf; 226 CONF_VALUE *cnf;
227 int i; 227 int i;
228 if(!(gens = sk_GENERAL_NAME_new(NULL))) { 228 if(!(gens = sk_GENERAL_NAME_new_null())) {
229 X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE); 229 X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
230 return NULL; 230 return NULL;
231 } 231 }
@@ -304,7 +304,7 @@ STACK_OF(GENERAL_NAME) *v2i_GENERAL_NAMES(X509V3_EXT_METHOD *method,
304 STACK_OF(GENERAL_NAME) *gens = NULL; 304 STACK_OF(GENERAL_NAME) *gens = NULL;
305 CONF_VALUE *cnf; 305 CONF_VALUE *cnf;
306 int i; 306 int i;
307 if(!(gens = sk_GENERAL_NAME_new(NULL))) { 307 if(!(gens = sk_GENERAL_NAME_new_null())) {
308 X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE); 308 X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
309 return NULL; 309 return NULL;
310 } 310 }
diff --git a/src/lib/libcrypto/x509v3/v3_bcons.c b/src/lib/libcrypto/x509v3/v3_bcons.c
index 1e3edc205f..c576b8e955 100644
--- a/src/lib/libcrypto/x509v3/v3_bcons.c
+++ b/src/lib/libcrypto/x509v3/v3_bcons.c
@@ -123,7 +123,7 @@ void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a)
123{ 123{
124 if (a == NULL) return; 124 if (a == NULL) return;
125 M_ASN1_INTEGER_free (a->pathlen); 125 M_ASN1_INTEGER_free (a->pathlen);
126 Free (a); 126 OPENSSL_free (a);
127} 127}
128 128
129static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method, 129static STACK_OF(CONF_VALUE) *i2v_BASIC_CONSTRAINTS(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c
index b2f03010cc..bdc9c1cbc1 100644
--- a/src/lib/libcrypto/x509v3/v3_conf.c
+++ b/src/lib/libcrypto/x509v3/v3_conf.c
@@ -167,7 +167,7 @@ static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
167 X509_EXTENSION *ext; 167 X509_EXTENSION *ext;
168 /* Convert internal representation to DER */ 168 /* Convert internal representation to DER */
169 ext_len = method->i2d(ext_struc, NULL); 169 ext_len = method->i2d(ext_struc, NULL);
170 if(!(ext_der = Malloc(ext_len))) goto merr; 170 if(!(ext_der = OPENSSL_malloc(ext_len))) goto merr;
171 p = ext_der; 171 p = ext_der;
172 method->i2d(ext_struc, &p); 172 method->i2d(ext_struc, &p);
173 if(!(ext_oct = M_ASN1_OCTET_STRING_new())) goto merr; 173 if(!(ext_oct = M_ASN1_OCTET_STRING_new())) goto merr;
@@ -255,7 +255,7 @@ extension = X509_EXTENSION_create_by_OBJ(NULL, obj, crit, oct);
255err: 255err:
256ASN1_OBJECT_free(obj); 256ASN1_OBJECT_free(obj);
257M_ASN1_OCTET_STRING_free(oct); 257M_ASN1_OCTET_STRING_free(oct);
258if(ext_der) Free(ext_der); 258if(ext_der) OPENSSL_free(ext_der);
259return extension; 259return extension;
260} 260}
261 261
diff --git a/src/lib/libcrypto/x509v3/v3_cpols.c b/src/lib/libcrypto/x509v3/v3_cpols.c
index 466713b50d..8203ed7571 100644
--- a/src/lib/libcrypto/x509v3/v3_cpols.c
+++ b/src/lib/libcrypto/x509v3/v3_cpols.c
@@ -73,7 +73,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx,
73 STACK_OF(CONF_VALUE) *polstrs, int ia5org); 73 STACK_OF(CONF_VALUE) *polstrs, int ia5org);
74static POLICYQUALINFO *notice_section(X509V3_CTX *ctx, 74static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
75 STACK_OF(CONF_VALUE) *unot, int ia5org); 75 STACK_OF(CONF_VALUE) *unot, int ia5org);
76static STACK *nref_nos(STACK_OF(CONF_VALUE) *nos); 76static STACK_OF(ASN1_INTEGER) *nref_nos(STACK_OF(CONF_VALUE) *nos);
77 77
78X509V3_EXT_METHOD v3_cpols = { 78X509V3_EXT_METHOD v3_cpols = {
79NID_certificate_policies, 0, 79NID_certificate_policies, 0,
@@ -282,20 +282,22 @@ static POLICYQUALINFO *notice_section(X509V3_CTX *ctx,
282 return NULL; 282 return NULL;
283} 283}
284 284
285static STACK *nref_nos(STACK_OF(CONF_VALUE) *nos) 285static STACK_OF(ASN1_INTEGER) *nref_nos(STACK_OF(CONF_VALUE) *nos)
286{ 286{
287 STACK *nnums; 287 STACK_OF(ASN1_INTEGER) *nnums;
288 CONF_VALUE *cnf; 288 CONF_VALUE *cnf;
289 ASN1_INTEGER *aint; 289 ASN1_INTEGER *aint;
290
290 int i; 291 int i;
291 if(!(nnums = sk_new_null())) goto merr; 292
293 if(!(nnums = sk_ASN1_INTEGER_new_null())) goto merr;
292 for(i = 0; i < sk_CONF_VALUE_num(nos); i++) { 294 for(i = 0; i < sk_CONF_VALUE_num(nos); i++) {
293 cnf = sk_CONF_VALUE_value(nos, i); 295 cnf = sk_CONF_VALUE_value(nos, i);
294 if(!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) { 296 if(!(aint = s2i_ASN1_INTEGER(NULL, cnf->name))) {
295 X509V3err(X509V3_F_NREF_NOS,X509V3_R_INVALID_NUMBER); 297 X509V3err(X509V3_F_NREF_NOS,X509V3_R_INVALID_NUMBER);
296 goto err; 298 goto err;
297 } 299 }
298 if(!sk_push(nnums, (char *)aint)) goto merr; 300 if(!sk_ASN1_INTEGER_push(nnums, aint)) goto merr;
299 } 301 }
300 return nnums; 302 return nnums;
301 303
@@ -303,7 +305,7 @@ static STACK *nref_nos(STACK_OF(CONF_VALUE) *nos)
303 X509V3err(X509V3_F_NOTICE_SECTION,ERR_R_MALLOC_FAILURE); 305 X509V3err(X509V3_F_NOTICE_SECTION,ERR_R_MALLOC_FAILURE);
304 306
305 err: 307 err:
306 sk_pop_free(nnums, ASN1_STRING_free); 308 sk_ASN1_INTEGER_pop_free(nnums, ASN1_STRING_free);
307 return NULL; 309 return NULL;
308} 310}
309 311
@@ -399,7 +401,7 @@ void POLICYINFO_free(POLICYINFO *a)
399 if (a == NULL) return; 401 if (a == NULL) return;
400 ASN1_OBJECT_free(a->policyid); 402 ASN1_OBJECT_free(a->policyid);
401 sk_POLICYQUALINFO_pop_free(a->qualifiers, POLICYQUALINFO_free); 403 sk_POLICYQUALINFO_pop_free(a->qualifiers, POLICYQUALINFO_free);
402 Free (a); 404 OPENSSL_free (a);
403} 405}
404 406
405static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, 407static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals,
@@ -441,15 +443,15 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent)
441 BIO_printf(out, "%*sOrganization: %s\n", indent, "", 443 BIO_printf(out, "%*sOrganization: %s\n", indent, "",
442 ref->organization->data); 444 ref->organization->data);
443 BIO_printf(out, "%*sNumber%s: ", indent, "", 445 BIO_printf(out, "%*sNumber%s: ", indent, "",
444 (sk_num(ref->noticenos) > 1) ? "s" : ""); 446 sk_ASN1_INTEGER_num(ref->noticenos) > 1 ? "s" : "");
445 for(i = 0; i < sk_num(ref->noticenos); i++) { 447 for(i = 0; i < sk_ASN1_INTEGER_num(ref->noticenos); i++) {
446 ASN1_INTEGER *num; 448 ASN1_INTEGER *num;
447 char *tmp; 449 char *tmp;
448 num = (ASN1_INTEGER *)sk_value(ref->noticenos, i); 450 num = sk_ASN1_INTEGER_value(ref->noticenos, i);
449 if(i) BIO_puts(out, ", "); 451 if(i) BIO_puts(out, ", ");
450 tmp = i2s_ASN1_INTEGER(NULL, num); 452 tmp = i2s_ASN1_INTEGER(NULL, num);
451 BIO_puts(out, tmp); 453 BIO_puts(out, tmp);
452 Free(tmp); 454 OPENSSL_free(tmp);
453 } 455 }
454 BIO_puts(out, "\n"); 456 BIO_puts(out, "\n");
455 } 457 }
@@ -551,7 +553,7 @@ void POLICYQUALINFO_free(POLICYQUALINFO *a)
551 } 553 }
552 554
553 ASN1_OBJECT_free(a->pqualid); 555 ASN1_OBJECT_free(a->pqualid);
554 Free (a); 556 OPENSSL_free (a);
555} 557}
556 558
557int i2d_USERNOTICE(USERNOTICE *a, unsigned char **pp) 559int i2d_USERNOTICE(USERNOTICE *a, unsigned char **pp)
@@ -597,7 +599,7 @@ void USERNOTICE_free(USERNOTICE *a)
597 if (a == NULL) return; 599 if (a == NULL) return;
598 NOTICEREF_free(a->noticeref); 600 NOTICEREF_free(a->noticeref);
599 M_DISPLAYTEXT_free(a->exptext); 601 M_DISPLAYTEXT_free(a->exptext);
600 Free (a); 602 OPENSSL_free (a);
601} 603}
602 604
603int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp) 605int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp)
@@ -605,12 +607,14 @@ int i2d_NOTICEREF(NOTICEREF *a, unsigned char **pp)
605 M_ASN1_I2D_vars(a); 607 M_ASN1_I2D_vars(a);
606 608
607 M_ASN1_I2D_len (a->organization, i2d_DISPLAYTEXT); 609 M_ASN1_I2D_len (a->organization, i2d_DISPLAYTEXT);
608 M_ASN1_I2D_len_SEQUENCE(a->noticenos, i2d_ASN1_INTEGER); 610 M_ASN1_I2D_len_SEQUENCE_type(ASN1_INTEGER, a->noticenos,
611 i2d_ASN1_INTEGER);
609 612
610 M_ASN1_I2D_seq_total(); 613 M_ASN1_I2D_seq_total();
611 614
612 M_ASN1_I2D_put (a->organization, i2d_DISPLAYTEXT); 615 M_ASN1_I2D_put (a->organization, i2d_DISPLAYTEXT);
613 M_ASN1_I2D_put_SEQUENCE(a->noticenos, i2d_ASN1_INTEGER); 616 M_ASN1_I2D_put_SEQUENCE_type(ASN1_INTEGER, a->noticenos,
617 i2d_ASN1_INTEGER);
614 618
615 M_ASN1_I2D_finish(); 619 M_ASN1_I2D_finish();
616} 620}
@@ -639,7 +643,8 @@ NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, unsigned char **pp,long length)
639 if(!ret->organization) { 643 if(!ret->organization) {
640 M_ASN1_D2I_get(ret->organization, d2i_DISPLAYTEXT); 644 M_ASN1_D2I_get(ret->organization, d2i_DISPLAYTEXT);
641 } 645 }
642 M_ASN1_D2I_get_seq(ret->noticenos, d2i_ASN1_INTEGER, ASN1_STRING_free); 646 M_ASN1_D2I_get_seq_type(ASN1_INTEGER, ret->noticenos, d2i_ASN1_INTEGER,
647 ASN1_STRING_free);
643 M_ASN1_D2I_Finish(a, NOTICEREF_free, ASN1_F_D2I_NOTICEREF); 648 M_ASN1_D2I_Finish(a, NOTICEREF_free, ASN1_F_D2I_NOTICEREF);
644} 649}
645 650
@@ -647,8 +652,8 @@ void NOTICEREF_free(NOTICEREF *a)
647{ 652{
648 if (a == NULL) return; 653 if (a == NULL) return;
649 M_DISPLAYTEXT_free(a->organization); 654 M_DISPLAYTEXT_free(a->organization);
650 sk_pop_free(a->noticenos, ASN1_STRING_free); 655 sk_ASN1_INTEGER_pop_free(a->noticenos, ASN1_STRING_free);
651 Free (a); 656 OPENSSL_free (a);
652} 657}
653 658
654IMPLEMENT_STACK_OF(POLICYQUALINFO) 659IMPLEMENT_STACK_OF(POLICYQUALINFO)
diff --git a/src/lib/libcrypto/x509v3/v3_crld.c b/src/lib/libcrypto/x509v3/v3_crld.c
index e459d2595a..67feea4017 100644
--- a/src/lib/libcrypto/x509v3/v3_crld.c
+++ b/src/lib/libcrypto/x509v3/v3_crld.c
@@ -87,7 +87,7 @@ static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
87 int i; 87 int i;
88 for(i = 0; i < sk_DIST_POINT_num(crld); i++) { 88 for(i = 0; i < sk_DIST_POINT_num(crld); i++) {
89 point = sk_DIST_POINT_value(crld, i); 89 point = sk_DIST_POINT_value(crld, i);
90 if(point->distpoint->fullname) { 90 if(point->distpoint && point->distpoint->fullname) {
91 exts = i2v_GENERAL_NAMES(NULL, 91 exts = i2v_GENERAL_NAMES(NULL,
92 point->distpoint->fullname, exts); 92 point->distpoint->fullname, exts);
93 } 93 }
@@ -95,7 +95,7 @@ static STACK_OF(CONF_VALUE) *i2v_crld(X509V3_EXT_METHOD *method,
95 X509V3_add_value("reasons","<UNSUPPORTED>", &exts); 95 X509V3_add_value("reasons","<UNSUPPORTED>", &exts);
96 if(point->CRLissuer) 96 if(point->CRLissuer)
97 X509V3_add_value("CRLissuer","<UNSUPPORTED>", &exts); 97 X509V3_add_value("CRLissuer","<UNSUPPORTED>", &exts);
98 if(point->distpoint->relativename) 98 if(point->distpoint && point->distpoint->relativename)
99 X509V3_add_value("RelativeName","<UNSUPPORTED>", &exts); 99 X509V3_add_value("RelativeName","<UNSUPPORTED>", &exts);
100 } 100 }
101 return exts; 101 return exts;
@@ -109,7 +109,7 @@ static STACK_OF(DIST_POINT) *v2i_crld(X509V3_EXT_METHOD *method,
109 GENERAL_NAME *gen = NULL; 109 GENERAL_NAME *gen = NULL;
110 CONF_VALUE *cnf; 110 CONF_VALUE *cnf;
111 int i; 111 int i;
112 if(!(crld = sk_DIST_POINT_new(NULL))) goto merr; 112 if(!(crld = sk_DIST_POINT_new_null())) goto merr;
113 for(i = 0; i < sk_CONF_VALUE_num(nval); i++) { 113 for(i = 0; i < sk_CONF_VALUE_num(nval); i++) {
114 DIST_POINT *point; 114 DIST_POINT *point;
115 cnf = sk_CONF_VALUE_value(nval, i); 115 cnf = sk_CONF_VALUE_value(nval, i);
@@ -213,7 +213,7 @@ void DIST_POINT_free(DIST_POINT *a)
213 DIST_POINT_NAME_free(a->distpoint); 213 DIST_POINT_NAME_free(a->distpoint);
214 M_ASN1_BIT_STRING_free(a->reasons); 214 M_ASN1_BIT_STRING_free(a->reasons);
215 sk_GENERAL_NAME_pop_free(a->CRLissuer, GENERAL_NAME_free); 215 sk_GENERAL_NAME_pop_free(a->CRLissuer, GENERAL_NAME_free);
216 Free (a); 216 OPENSSL_free (a);
217} 217}
218 218
219int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **pp) 219int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **pp)
@@ -256,7 +256,7 @@ void DIST_POINT_NAME_free(DIST_POINT_NAME *a)
256 if (a == NULL) return; 256 if (a == NULL) return;
257 sk_X509_NAME_ENTRY_pop_free(a->relativename, X509_NAME_ENTRY_free); 257 sk_X509_NAME_ENTRY_pop_free(a->relativename, X509_NAME_ENTRY_free);
258 sk_GENERAL_NAME_pop_free(a->fullname, GENERAL_NAME_free); 258 sk_GENERAL_NAME_pop_free(a->fullname, GENERAL_NAME_free);
259 Free (a); 259 OPENSSL_free (a);
260} 260}
261 261
262DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, unsigned char **pp, 262DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, unsigned char **pp,
diff --git a/src/lib/libcrypto/x509v3/v3_extku.c b/src/lib/libcrypto/x509v3/v3_extku.c
index e039d21cbf..53ec40a027 100644
--- a/src/lib/libcrypto/x509v3/v3_extku.c
+++ b/src/lib/libcrypto/x509v3/v3_extku.c
@@ -129,7 +129,7 @@ ASN1_OBJECT *objtmp;
129CONF_VALUE *val; 129CONF_VALUE *val;
130int i; 130int i;
131 131
132if(!(extku = sk_ASN1_OBJECT_new(NULL))) { 132if(!(extku = sk_ASN1_OBJECT_new_null())) {
133 X509V3err(X509V3_F_V2I_EXT_KU,ERR_R_MALLOC_FAILURE); 133 X509V3err(X509V3_F_V2I_EXT_KU,ERR_R_MALLOC_FAILURE);
134 return NULL; 134 return NULL;
135} 135}
diff --git a/src/lib/libcrypto/x509v3/v3_genn.c b/src/lib/libcrypto/x509v3/v3_genn.c
index 894afa7e03..d44751458e 100644
--- a/src/lib/libcrypto/x509v3/v3_genn.c
+++ b/src/lib/libcrypto/x509v3/v3_genn.c
@@ -211,7 +211,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
211 break; 211 break;
212 212
213 } 213 }
214 Free (a); 214 OPENSSL_free (a);
215} 215}
216 216
217/* Now the GeneralNames versions: a SEQUENCE OF GeneralName. These are needed as 217/* Now the GeneralNames versions: a SEQUENCE OF GeneralName. These are needed as
@@ -220,7 +220,7 @@ void GENERAL_NAME_free(GENERAL_NAME *a)
220 220
221STACK_OF(GENERAL_NAME) *GENERAL_NAMES_new() 221STACK_OF(GENERAL_NAME) *GENERAL_NAMES_new()
222{ 222{
223 return sk_GENERAL_NAME_new(NULL); 223 return sk_GENERAL_NAME_new_null();
224} 224}
225 225
226void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a) 226void GENERAL_NAMES_free(STACK_OF(GENERAL_NAME) *a)
@@ -286,6 +286,6 @@ void OTHERNAME_free(OTHERNAME *a)
286 if (a == NULL) return; 286 if (a == NULL) return;
287 ASN1_OBJECT_free(a->type_id); 287 ASN1_OBJECT_free(a->type_id);
288 ASN1_TYPE_free(a->value); 288 ASN1_TYPE_free(a->value);
289 Free (a); 289 OPENSSL_free (a);
290} 290}
291 291
diff --git a/src/lib/libcrypto/x509v3/v3_ia5.c b/src/lib/libcrypto/x509v3/v3_ia5.c
index af3525f33e..f3bba38269 100644
--- a/src/lib/libcrypto/x509v3/v3_ia5.c
+++ b/src/lib/libcrypto/x509v3/v3_ia5.c
@@ -82,7 +82,7 @@ static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
82{ 82{
83 char *tmp; 83 char *tmp;
84 if(!ia5 || !ia5->length) return NULL; 84 if(!ia5 || !ia5->length) return NULL;
85 tmp = Malloc(ia5->length + 1); 85 tmp = OPENSSL_malloc(ia5->length + 1);
86 memcpy(tmp, ia5->data, ia5->length); 86 memcpy(tmp, ia5->data, ia5->length);
87 tmp[ia5->length] = 0; 87 tmp[ia5->length] = 0;
88 return tmp; 88 return tmp;
diff --git a/src/lib/libcrypto/x509v3/v3_info.c b/src/lib/libcrypto/x509v3/v3_info.c
index 78d2135046..a045a629ee 100644
--- a/src/lib/libcrypto/x509v3/v3_info.c
+++ b/src/lib/libcrypto/x509v3/v3_info.c
@@ -94,7 +94,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
94 if(!ret) break; 94 if(!ret) break;
95 vtmp = sk_CONF_VALUE_value(ret, i); 95 vtmp = sk_CONF_VALUE_value(ret, i);
96 i2t_ASN1_OBJECT(objtmp, 80, desc->method); 96 i2t_ASN1_OBJECT(objtmp, 80, desc->method);
97 ntmp = Malloc(strlen(objtmp) + strlen(vtmp->name) + 5); 97 ntmp = OPENSSL_malloc(strlen(objtmp) + strlen(vtmp->name) + 5);
98 if(!ntmp) { 98 if(!ntmp) {
99 X509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS, 99 X509V3err(X509V3_F_I2V_AUTHORITY_INFO_ACCESS,
100 ERR_R_MALLOC_FAILURE); 100 ERR_R_MALLOC_FAILURE);
@@ -103,7 +103,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
103 strcpy(ntmp, objtmp); 103 strcpy(ntmp, objtmp);
104 strcat(ntmp, " - "); 104 strcat(ntmp, " - ");
105 strcat(ntmp, vtmp->name); 105 strcat(ntmp, vtmp->name);
106 Free(vtmp->name); 106 OPENSSL_free(vtmp->name);
107 vtmp->name = ntmp; 107 vtmp->name = ntmp;
108 108
109 } 109 }
@@ -119,7 +119,7 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
119 ACCESS_DESCRIPTION *acc; 119 ACCESS_DESCRIPTION *acc;
120 int i, objlen; 120 int i, objlen;
121 char *objtmp, *ptmp; 121 char *objtmp, *ptmp;
122 if(!(ainfo = sk_ACCESS_DESCRIPTION_new(NULL))) { 122 if(!(ainfo = sk_ACCESS_DESCRIPTION_new_null())) {
123 X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE); 123 X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE);
124 return NULL; 124 return NULL;
125 } 125 }
@@ -140,7 +140,7 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
140 ctmp.value = cnf->value; 140 ctmp.value = cnf->value;
141 if(!(acc->location = v2i_GENERAL_NAME(method, ctx, &ctmp))) 141 if(!(acc->location = v2i_GENERAL_NAME(method, ctx, &ctmp)))
142 goto err; 142 goto err;
143 if(!(objtmp = Malloc(objlen + 1))) { 143 if(!(objtmp = OPENSSL_malloc(objlen + 1))) {
144 X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE); 144 X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,ERR_R_MALLOC_FAILURE);
145 goto err; 145 goto err;
146 } 146 }
@@ -150,10 +150,10 @@ static STACK_OF(ACCESS_DESCRIPTION) *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
150 if(!acc->method) { 150 if(!acc->method) {
151 X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,X509V3_R_BAD_OBJECT); 151 X509V3err(X509V3_F_V2I_ACCESS_DESCRIPTION,X509V3_R_BAD_OBJECT);
152 ERR_add_error_data(2, "value=", objtmp); 152 ERR_add_error_data(2, "value=", objtmp);
153 Free(objtmp); 153 OPENSSL_free(objtmp);
154 goto err; 154 goto err;
155 } 155 }
156 Free(objtmp); 156 OPENSSL_free(objtmp);
157 157
158 } 158 }
159 return ainfo; 159 return ainfo;
@@ -204,12 +204,12 @@ void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a)
204 if (a == NULL) return; 204 if (a == NULL) return;
205 ASN1_OBJECT_free(a->method); 205 ASN1_OBJECT_free(a->method);
206 GENERAL_NAME_free(a->location); 206 GENERAL_NAME_free(a->location);
207 Free (a); 207 OPENSSL_free (a);
208} 208}
209 209
210STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void) 210STACK_OF(ACCESS_DESCRIPTION) *AUTHORITY_INFO_ACCESS_new(void)
211{ 211{
212 return sk_ACCESS_DESCRIPTION_new(NULL); 212 return sk_ACCESS_DESCRIPTION_new_null();
213} 213}
214 214
215void AUTHORITY_INFO_ACCESS_free(STACK_OF(ACCESS_DESCRIPTION) *a) 215void AUTHORITY_INFO_ACCESS_free(STACK_OF(ACCESS_DESCRIPTION) *a)
diff --git a/src/lib/libcrypto/x509v3/v3_lib.c b/src/lib/libcrypto/x509v3/v3_lib.c
index 4242d130a2..ea86b9ebb9 100644
--- a/src/lib/libcrypto/x509v3/v3_lib.c
+++ b/src/lib/libcrypto/x509v3/v3_lib.c
@@ -64,25 +64,27 @@
64 64
65#include "ext_dat.h" 65#include "ext_dat.h"
66 66
67static STACK *ext_list = NULL; 67static STACK_OF(X509V3_EXT_METHOD) *ext_list = NULL;
68 68
69static int ext_cmp(X509V3_EXT_METHOD **a, X509V3_EXT_METHOD **b); 69static int ext_cmp(const X509V3_EXT_METHOD * const *a,
70 const X509V3_EXT_METHOD * const *b);
70static void ext_list_free(X509V3_EXT_METHOD *ext); 71static void ext_list_free(X509V3_EXT_METHOD *ext);
71 72
72int X509V3_EXT_add(X509V3_EXT_METHOD *ext) 73int X509V3_EXT_add(X509V3_EXT_METHOD *ext)
73{ 74{
74 if(!ext_list && !(ext_list = sk_new(ext_cmp))) { 75 if(!ext_list && !(ext_list = sk_X509V3_EXT_METHOD_new(ext_cmp))) {
75 X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE); 76 X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE);
76 return 0; 77 return 0;
77 } 78 }
78 if(!sk_push(ext_list, (char *)ext)) { 79 if(!sk_X509V3_EXT_METHOD_push(ext_list, ext)) {
79 X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE); 80 X509V3err(X509V3_F_X509V3_EXT_ADD,ERR_R_MALLOC_FAILURE);
80 return 0; 81 return 0;
81 } 82 }
82 return 1; 83 return 1;
83} 84}
84 85
85static int ext_cmp(X509V3_EXT_METHOD **a, X509V3_EXT_METHOD **b) 86static int ext_cmp(const X509V3_EXT_METHOD * const *a,
87 const X509V3_EXT_METHOD * const *b)
86{ 88{
87 return ((*a)->ext_nid - (*b)->ext_nid); 89 return ((*a)->ext_nid - (*b)->ext_nid);
88} 90}
@@ -95,12 +97,12 @@ X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
95 tmp.ext_nid = nid; 97 tmp.ext_nid = nid;
96 ret = (X509V3_EXT_METHOD **) OBJ_bsearch((char *)&t, 98 ret = (X509V3_EXT_METHOD **) OBJ_bsearch((char *)&t,
97 (char *)standard_exts, STANDARD_EXTENSION_COUNT, 99 (char *)standard_exts, STANDARD_EXTENSION_COUNT,
98 sizeof(X509V3_EXT_METHOD *), (int (*)())ext_cmp); 100 sizeof(X509V3_EXT_METHOD *), (int (*)(const void *, const void *))ext_cmp);
99 if(ret) return *ret; 101 if(ret) return *ret;
100 if(!ext_list) return NULL; 102 if(!ext_list) return NULL;
101 idx = sk_find(ext_list, (char *)&tmp); 103 idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp);
102 if(idx == -1) return NULL; 104 if(idx == -1) return NULL;
103 return (X509V3_EXT_METHOD *)sk_value(ext_list, idx); 105 return sk_X509V3_EXT_METHOD_value(ext_list, idx);
104} 106}
105 107
106X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext) 108X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext)
@@ -125,7 +127,7 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from)
125 X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND); 127 X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND);
126 return 0; 128 return 0;
127 } 129 }
128 if(!(tmpext = (X509V3_EXT_METHOD *)Malloc(sizeof(X509V3_EXT_METHOD)))) { 130 if(!(tmpext = (X509V3_EXT_METHOD *)OPENSSL_malloc(sizeof(X509V3_EXT_METHOD)))) {
129 X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,ERR_R_MALLOC_FAILURE); 131 X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,ERR_R_MALLOC_FAILURE);
130 return 0; 132 return 0;
131 } 133 }
@@ -137,13 +139,13 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from)
137 139
138void X509V3_EXT_cleanup(void) 140void X509V3_EXT_cleanup(void)
139{ 141{
140 sk_pop_free(ext_list, ext_list_free); 142 sk_X509V3_EXT_METHOD_pop_free(ext_list, ext_list_free);
141 ext_list = NULL; 143 ext_list = NULL;
142} 144}
143 145
144static void ext_list_free(X509V3_EXT_METHOD *ext) 146static void ext_list_free(X509V3_EXT_METHOD *ext)
145{ 147{
146 if(ext->ext_flags & X509V3_EXT_DYNAMIC) Free(ext); 148 if(ext->ext_flags & X509V3_EXT_DYNAMIC) OPENSSL_free(ext);
147} 149}
148 150
149/* Legacy function: we don't need to add standard extensions 151/* Legacy function: we don't need to add standard extensions
@@ -213,9 +215,11 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx)
213 if(crit) *crit = found_ex->critical; 215 if(crit) *crit = found_ex->critical;
214 return X509V3_EXT_d2i(found_ex); 216 return X509V3_EXT_d2i(found_ex);
215 } 217 }
216 218
217 /* Extension not found */ 219 /* Extension not found */
218 if(idx) *idx = -1; 220 if(idx) *idx = -1;
219 if(crit) *crit = -1; 221 if(crit) *crit = -1;
220 return NULL; 222 return NULL;
221} 223}
224
225IMPLEMENT_STACK_OF(X509V3_EXT_METHOD)
diff --git a/src/lib/libcrypto/x509v3/v3_pku.c b/src/lib/libcrypto/x509v3/v3_pku.c
index 30a62c6090..47f9e8f123 100644
--- a/src/lib/libcrypto/x509v3/v3_pku.c
+++ b/src/lib/libcrypto/x509v3/v3_pku.c
@@ -121,7 +121,7 @@ void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a)
121 if (a == NULL) return; 121 if (a == NULL) return;
122 M_ASN1_GENERALIZEDTIME_free(a->notBefore); 122 M_ASN1_GENERALIZEDTIME_free(a->notBefore);
123 M_ASN1_GENERALIZEDTIME_free(a->notAfter); 123 M_ASN1_GENERALIZEDTIME_free(a->notAfter);
124 Free (a); 124 OPENSSL_free (a);
125} 125}
126 126
127static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, 127static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
diff --git a/src/lib/libcrypto/x509v3/v3_prn.c b/src/lib/libcrypto/x509v3/v3_prn.c
index bee624c6be..dbc4fb1f16 100644
--- a/src/lib/libcrypto/x509v3/v3_prn.c
+++ b/src/lib/libcrypto/x509v3/v3_prn.c
@@ -133,7 +133,7 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent)
133 133
134 err: 134 err:
135 sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); 135 sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
136 if(value) Free(value); 136 if(value) OPENSSL_free(value);
137 method->ext_free(ext_str); 137 method->ext_free(ext_str);
138 return ok; 138 return ok;
139} 139}
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c
index 5594a1d64f..867699b26f 100644
--- a/src/lib/libcrypto/x509v3/v3_purp.c
+++ b/src/lib/libcrypto/x509v3/v3_purp.c
@@ -59,21 +59,24 @@
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60#include "cryptlib.h"
61#include <openssl/x509v3.h> 61#include <openssl/x509v3.h>
62#include <openssl/x509_vfy.h>
62 63
63 64
64static void x509v3_cache_extensions(X509 *x); 65static void x509v3_cache_extensions(X509 *x);
65 66
66static int ca_check(X509 *x); 67static int ca_check(const X509 *x);
67static int check_purpose_ssl_client(X509_PURPOSE *xp, X509 *x, int ca); 68static int check_ssl_ca(const X509 *x);
68static int check_purpose_ssl_server(X509_PURPOSE *xp, X509 *x, int ca); 69static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca);
69static int check_purpose_ns_ssl_server(X509_PURPOSE *xp, X509 *x, int ca); 70static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, int ca);
70static int purpose_smime(X509 *x, int ca); 71static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, int ca);
71static int check_purpose_smime_sign(X509_PURPOSE *xp, X509 *x, int ca); 72static int purpose_smime(const X509 *x, int ca);
72static int check_purpose_smime_encrypt(X509_PURPOSE *xp, X509 *x, int ca); 73static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
73static int check_purpose_crl_sign(X509_PURPOSE *xp, X509 *x, int ca); 74static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca);
74static int no_check(X509_PURPOSE *xp, X509 *x, int ca); 75static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca);
75 76static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca);
76static int xp_cmp(X509_PURPOSE **a, X509_PURPOSE **b); 77
78static int xp_cmp(const X509_PURPOSE * const *a,
79 const X509_PURPOSE * const *b);
77static void xptable_free(X509_PURPOSE *p); 80static void xptable_free(X509_PURPOSE *p);
78 81
79static X509_PURPOSE xstandard[] = { 82static X509_PURPOSE xstandard[] = {
@@ -92,15 +95,19 @@ IMPLEMENT_STACK_OF(X509_PURPOSE)
92 95
93static STACK_OF(X509_PURPOSE) *xptable = NULL; 96static STACK_OF(X509_PURPOSE) *xptable = NULL;
94 97
95static int xp_cmp(X509_PURPOSE **a, X509_PURPOSE **b) 98static int xp_cmp(const X509_PURPOSE * const *a,
99 const X509_PURPOSE * const *b)
96{ 100{
97 return (*a)->purpose - (*b)->purpose; 101 return (*a)->purpose - (*b)->purpose;
98} 102}
99 103
104/* As much as I'd like to make X509_check_purpose use a "const" X509*
105 * I really can't because it does recalculate hashes and do other non-const
106 * things. */
100int X509_check_purpose(X509 *x, int id, int ca) 107int X509_check_purpose(X509 *x, int id, int ca)
101{ 108{
102 int idx; 109 int idx;
103 X509_PURPOSE *pt; 110 const X509_PURPOSE *pt;
104 if(!(x->ex_flags & EXFLAG_SET)) { 111 if(!(x->ex_flags & EXFLAG_SET)) {
105 CRYPTO_w_lock(CRYPTO_LOCK_X509); 112 CRYPTO_w_lock(CRYPTO_LOCK_X509);
106 x509v3_cache_extensions(x); 113 x509v3_cache_extensions(x);
@@ -152,7 +159,7 @@ int X509_PURPOSE_get_by_id(int purpose)
152} 159}
153 160
154int X509_PURPOSE_add(int id, int trust, int flags, 161int X509_PURPOSE_add(int id, int trust, int flags,
155 int (*ck)(X509_PURPOSE *, X509 *, int), 162 int (*ck)(const X509_PURPOSE *, const X509 *, int),
156 char *name, char *sname, void *arg) 163 char *name, char *sname, void *arg)
157{ 164{
158 int idx; 165 int idx;
@@ -165,17 +172,17 @@ int X509_PURPOSE_add(int id, int trust, int flags,
165 idx = X509_PURPOSE_get_by_id(id); 172 idx = X509_PURPOSE_get_by_id(id);
166 /* Need a new entry */ 173 /* Need a new entry */
167 if(idx == -1) { 174 if(idx == -1) {
168 if(!(ptmp = Malloc(sizeof(X509_PURPOSE)))) { 175 if(!(ptmp = OPENSSL_malloc(sizeof(X509_PURPOSE)))) {
169 X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE); 176 X509V3err(X509V3_F_X509_PURPOSE_ADD,ERR_R_MALLOC_FAILURE);
170 return 0; 177 return 0;
171 } 178 }
172 ptmp->flags = X509_PURPOSE_DYNAMIC; 179 ptmp->flags = X509_PURPOSE_DYNAMIC;
173 } else ptmp = X509_PURPOSE_get0(idx); 180 } else ptmp = X509_PURPOSE_get0(idx);
174 181
175 /* Free existing name if dynamic */ 182 /* OPENSSL_free existing name if dynamic */
176 if(ptmp->flags & X509_PURPOSE_DYNAMIC_NAME) { 183 if(ptmp->flags & X509_PURPOSE_DYNAMIC_NAME) {
177 Free(ptmp->name); 184 OPENSSL_free(ptmp->name);
178 Free(ptmp->sname); 185 OPENSSL_free(ptmp->sname);
179 } 186 }
180 /* dup supplied name */ 187 /* dup supplied name */
181 ptmp->name = BUF_strdup(name); 188 ptmp->name = BUF_strdup(name);
@@ -214,10 +221,10 @@ static void xptable_free(X509_PURPOSE *p)
214 if (p->flags & X509_PURPOSE_DYNAMIC) 221 if (p->flags & X509_PURPOSE_DYNAMIC)
215 { 222 {
216 if (p->flags & X509_PURPOSE_DYNAMIC_NAME) { 223 if (p->flags & X509_PURPOSE_DYNAMIC_NAME) {
217 Free(p->name); 224 OPENSSL_free(p->name);
218 Free(p->sname); 225 OPENSSL_free(p->sname);
219 } 226 }
220 Free(p); 227 OPENSSL_free(p);
221 } 228 }
222 } 229 }
223 230
@@ -249,16 +256,18 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp)
249 return xp->trust; 256 return xp->trust;
250} 257}
251 258
252#ifndef NO_SHA
253static void x509v3_cache_extensions(X509 *x) 259static void x509v3_cache_extensions(X509 *x)
254{ 260{
255 BASIC_CONSTRAINTS *bs; 261 BASIC_CONSTRAINTS *bs;
256 ASN1_BIT_STRING *usage; 262 ASN1_BIT_STRING *usage;
257 ASN1_BIT_STRING *ns; 263 ASN1_BIT_STRING *ns;
258 STACK_OF(ASN1_OBJECT) *extusage; 264 STACK_OF(ASN1_OBJECT) *extusage;
265
259 int i; 266 int i;
260 if(x->ex_flags & EXFLAG_SET) return; 267 if(x->ex_flags & EXFLAG_SET) return;
268#ifndef NO_SHA
261 X509_digest(x, EVP_sha1(), x->sha1_hash, NULL); 269 X509_digest(x, EVP_sha1(), x->sha1_hash, NULL);
270#endif
262 /* Does subject name match issuer ? */ 271 /* Does subject name match issuer ? */
263 if(!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) 272 if(!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x)))
264 x->ex_flags |= EXFLAG_SS; 273 x->ex_flags |= EXFLAG_SS;
@@ -322,9 +331,10 @@ static void x509v3_cache_extensions(X509 *x)
322 x->ex_flags |= EXFLAG_NSCERT; 331 x->ex_flags |= EXFLAG_NSCERT;
323 ASN1_BIT_STRING_free(ns); 332 ASN1_BIT_STRING_free(ns);
324 } 333 }
334 x->skid =X509_get_ext_d2i(x, NID_subject_key_identifier, NULL, NULL);
335 x->akid =X509_get_ext_d2i(x, NID_authority_key_identifier, NULL, NULL);
325 x->ex_flags |= EXFLAG_SET; 336 x->ex_flags |= EXFLAG_SET;
326} 337}
327#endif
328 338
329/* CA checks common to all purposes 339/* CA checks common to all purposes
330 * return codes: 340 * return codes:
@@ -342,7 +352,7 @@ static void x509v3_cache_extensions(X509 *x)
342#define ns_reject(x, usage) \ 352#define ns_reject(x, usage) \
343 (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage))) 353 (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage)))
344 354
345static int ca_check(X509 *x) 355static int ca_check(const X509 *x)
346{ 356{
347 /* keyUsage if present should allow cert signing */ 357 /* keyUsage if present should allow cert signing */
348 if(ku_reject(x, KU_KEY_CERT_SIGN)) return 0; 358 if(ku_reject(x, KU_KEY_CERT_SIGN)) return 0;
@@ -356,22 +366,26 @@ static int ca_check(X509 *x)
356 } 366 }
357} 367}
358 368
369/* Check SSL CA: common checks for SSL client and server */
370static int check_ssl_ca(const X509 *x)
371{
372 int ca_ret;
373 ca_ret = ca_check(x);
374 if(!ca_ret) return 0;
375 /* check nsCertType if present */
376 if(x->ex_flags & EXFLAG_NSCERT) {
377 if(x->ex_nscert & NS_SSL_CA) return ca_ret;
378 return 0;
379 }
380 if(ca_ret != 2) return ca_ret;
381 else return 0;
382}
383
359 384
360static int check_purpose_ssl_client(X509_PURPOSE *xp, X509 *x, int ca) 385static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca)
361{ 386{
362 if(xku_reject(x,XKU_SSL_CLIENT)) return 0; 387 if(xku_reject(x,XKU_SSL_CLIENT)) return 0;
363 if(ca) { 388 if(ca) return check_ssl_ca(x);
364 int ca_ret;
365 ca_ret = ca_check(x);
366 if(!ca_ret) return 0;
367 /* check nsCertType if present */
368 if(x->ex_flags & EXFLAG_NSCERT) {
369 if(x->ex_nscert & NS_SSL_CA) return ca_ret;
370 return 0;
371 }
372 if(ca_ret != 2) return ca_ret;
373 else return 0;
374 }
375 /* We need to do digital signatures with it */ 389 /* We need to do digital signatures with it */
376 if(ku_reject(x,KU_DIGITAL_SIGNATURE)) return 0; 390 if(ku_reject(x,KU_DIGITAL_SIGNATURE)) return 0;
377 /* nsCertType if present should allow SSL client use */ 391 /* nsCertType if present should allow SSL client use */
@@ -379,11 +393,10 @@ static int check_purpose_ssl_client(X509_PURPOSE *xp, X509 *x, int ca)
379 return 1; 393 return 1;
380} 394}
381 395
382static int check_purpose_ssl_server(X509_PURPOSE *xp, X509 *x, int ca) 396static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, int ca)
383{ 397{
384 if(xku_reject(x,XKU_SSL_SERVER|XKU_SGC)) return 0; 398 if(xku_reject(x,XKU_SSL_SERVER|XKU_SGC)) return 0;
385 /* Otherwise same as SSL client for a CA */ 399 if(ca) return check_ssl_ca(x);
386 if(ca) return check_purpose_ssl_client(xp, x, 1);
387 400
388 if(ns_reject(x, NS_SSL_SERVER)) return 0; 401 if(ns_reject(x, NS_SSL_SERVER)) return 0;
389 /* Now as for keyUsage: we'll at least need to sign OR encipher */ 402 /* Now as for keyUsage: we'll at least need to sign OR encipher */
@@ -393,7 +406,7 @@ static int check_purpose_ssl_server(X509_PURPOSE *xp, X509 *x, int ca)
393 406
394} 407}
395 408
396static int check_purpose_ns_ssl_server(X509_PURPOSE *xp, X509 *x, int ca) 409static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, int ca)
397{ 410{
398 int ret; 411 int ret;
399 ret = check_purpose_ssl_server(xp, x, ca); 412 ret = check_purpose_ssl_server(xp, x, ca);
@@ -404,7 +417,7 @@ static int check_purpose_ns_ssl_server(X509_PURPOSE *xp, X509 *x, int ca)
404} 417}
405 418
406/* common S/MIME checks */ 419/* common S/MIME checks */
407static int purpose_smime(X509 *x, int ca) 420static int purpose_smime(const X509 *x, int ca)
408{ 421{
409 if(xku_reject(x,XKU_SMIME)) return 0; 422 if(xku_reject(x,XKU_SMIME)) return 0;
410 if(ca) { 423 if(ca) {
@@ -428,7 +441,7 @@ static int purpose_smime(X509 *x, int ca)
428 return 1; 441 return 1;
429} 442}
430 443
431static int check_purpose_smime_sign(X509_PURPOSE *xp, X509 *x, int ca) 444static int check_purpose_smime_sign(const X509_PURPOSE *xp, const X509 *x, int ca)
432{ 445{
433 int ret; 446 int ret;
434 ret = purpose_smime(x, ca); 447 ret = purpose_smime(x, ca);
@@ -437,7 +450,7 @@ static int check_purpose_smime_sign(X509_PURPOSE *xp, X509 *x, int ca)
437 return ret; 450 return ret;
438} 451}
439 452
440static int check_purpose_smime_encrypt(X509_PURPOSE *xp, X509 *x, int ca) 453static int check_purpose_smime_encrypt(const X509_PURPOSE *xp, const X509 *x, int ca)
441{ 454{
442 int ret; 455 int ret;
443 ret = purpose_smime(x, ca); 456 ret = purpose_smime(x, ca);
@@ -446,7 +459,7 @@ static int check_purpose_smime_encrypt(X509_PURPOSE *xp, X509 *x, int ca)
446 return ret; 459 return ret;
447} 460}
448 461
449static int check_purpose_crl_sign(X509_PURPOSE *xp, X509 *x, int ca) 462static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca)
450{ 463{
451 if(ca) { 464 if(ca) {
452 int ca_ret; 465 int ca_ret;
@@ -457,7 +470,64 @@ static int check_purpose_crl_sign(X509_PURPOSE *xp, X509 *x, int ca)
457 return 1; 470 return 1;
458} 471}
459 472
460static int no_check(X509_PURPOSE *xp, X509 *x, int ca) 473static int no_check(const X509_PURPOSE *xp, const X509 *x, int ca)
461{ 474{
462 return 1; 475 return 1;
463} 476}
477
478/* Various checks to see if one certificate issued the second.
479 * This can be used to prune a set of possible issuer certificates
480 * which have been looked up using some simple method such as by
481 * subject name.
482 * These are:
483 * 1. Check issuer_name(subject) == subject_name(issuer)
484 * 2. If akid(subject) exists check it matches issuer
485 * 3. If key_usage(issuer) exists check it supports certificate signing
486 * returns 0 for OK, positive for reason for mismatch, reasons match
487 * codes for X509_verify_cert()
488 */
489
490int X509_check_issued(X509 *issuer, X509 *subject)
491{
492 if(X509_NAME_cmp(X509_get_subject_name(issuer),
493 X509_get_issuer_name(subject)))
494 return X509_V_ERR_SUBJECT_ISSUER_MISMATCH;
495 x509v3_cache_extensions(issuer);
496 x509v3_cache_extensions(subject);
497 if(subject->akid) {
498 /* Check key ids (if present) */
499 if(subject->akid->keyid && issuer->skid &&
500 ASN1_OCTET_STRING_cmp(subject->akid->keyid, issuer->skid) )
501 return X509_V_ERR_AKID_SKID_MISMATCH;
502 /* Check serial number */
503 if(subject->akid->serial &&
504 ASN1_INTEGER_cmp(X509_get_serialNumber(issuer),
505 subject->akid->serial))
506 return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
507 /* Check issuer name */
508 if(subject->akid->issuer) {
509 /* Ugh, for some peculiar reason AKID includes
510 * SEQUENCE OF GeneralName. So look for a DirName.
511 * There may be more than one but we only take any
512 * notice of the first.
513 */
514 STACK_OF(GENERAL_NAME) *gens;
515 GENERAL_NAME *gen;
516 X509_NAME *nm = NULL;
517 int i;
518 gens = subject->akid->issuer;
519 for(i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
520 gen = sk_GENERAL_NAME_value(gens, i);
521 if(gen->type == GEN_DIRNAME) {
522 nm = gen->d.dirn;
523 break;
524 }
525 }
526 if(nm && X509_NAME_cmp(nm, X509_get_issuer_name(issuer)))
527 return X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH;
528 }
529 }
530 if(ku_reject(issuer, KU_KEY_CERT_SIGN)) return X509_V_ERR_KEYUSAGE_NO_CERTSIGN;
531 return X509_V_OK;
532}
533
diff --git a/src/lib/libcrypto/x509v3/v3_sxnet.c b/src/lib/libcrypto/x509v3/v3_sxnet.c
index 20ba8ac8d6..bfecacd336 100644
--- a/src/lib/libcrypto/x509v3/v3_sxnet.c
+++ b/src/lib/libcrypto/x509v3/v3_sxnet.c
@@ -132,7 +132,7 @@ void SXNET_free(SXNET *a)
132 if (a == NULL) return; 132 if (a == NULL) return;
133 M_ASN1_INTEGER_free(a->version); 133 M_ASN1_INTEGER_free(a->version);
134 sk_SXNETID_pop_free(a->ids, SXNETID_free); 134 sk_SXNETID_pop_free(a->ids, SXNETID_free);
135 Free (a); 135 OPENSSL_free (a);
136} 136}
137 137
138int i2d_SXNETID(SXNETID *a, unsigned char **pp) 138int i2d_SXNETID(SXNETID *a, unsigned char **pp)
@@ -176,7 +176,7 @@ void SXNETID_free(SXNETID *a)
176 if (a == NULL) return; 176 if (a == NULL) return;
177 M_ASN1_INTEGER_free(a->zone); 177 M_ASN1_INTEGER_free(a->zone);
178 M_ASN1_OCTET_STRING_free(a->user); 178 M_ASN1_OCTET_STRING_free(a->user);
179 Free (a); 179 OPENSSL_free (a);
180} 180}
181 181
182static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out, 182static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
@@ -192,7 +192,7 @@ static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
192 id = sk_SXNETID_value(sx->ids, i); 192 id = sk_SXNETID_value(sx->ids, i);
193 tmp = i2s_ASN1_INTEGER(NULL, id->zone); 193 tmp = i2s_ASN1_INTEGER(NULL, id->zone);
194 BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp); 194 BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
195 Free(tmp); 195 OPENSSL_free(tmp);
196 M_ASN1_OCTET_STRING_print(out, id->user); 196 M_ASN1_OCTET_STRING_print(out, id->user);
197 } 197 }
198 return 1; 198 return 1;
diff --git a/src/lib/libcrypto/x509v3/v3_utl.c b/src/lib/libcrypto/x509v3/v3_utl.c
index 4c2c4a9483..619f161b58 100644
--- a/src/lib/libcrypto/x509v3/v3_utl.c
+++ b/src/lib/libcrypto/x509v3/v3_utl.c
@@ -65,6 +65,10 @@
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67static char *strip_spaces(char *name); 67static char *strip_spaces(char *name);
68static int sk_strcmp(const char * const *a, const char * const *b);
69static STACK *get_email(X509_NAME *name, STACK_OF(GENERAL_NAME) *gens);
70static void str_free(void *str);
71static int append_ia5(STACK **sk, ASN1_IA5STRING *email);
68 72
69/* Add a CONF_VALUE name value pair to stack */ 73/* Add a CONF_VALUE name value pair to stack */
70 74
@@ -75,8 +79,8 @@ int X509V3_add_value(const char *name, const char *value,
75 char *tname = NULL, *tvalue = NULL; 79 char *tname = NULL, *tvalue = NULL;
76 if(name && !(tname = BUF_strdup(name))) goto err; 80 if(name && !(tname = BUF_strdup(name))) goto err;
77 if(value && !(tvalue = BUF_strdup(value))) goto err;; 81 if(value && !(tvalue = BUF_strdup(value))) goto err;;
78 if(!(vtmp = (CONF_VALUE *)Malloc(sizeof(CONF_VALUE)))) goto err; 82 if(!(vtmp = (CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE)))) goto err;
79 if(!*extlist && !(*extlist = sk_CONF_VALUE_new(NULL))) goto err; 83 if(!*extlist && !(*extlist = sk_CONF_VALUE_new_null())) goto err;
80 vtmp->section = NULL; 84 vtmp->section = NULL;
81 vtmp->name = tname; 85 vtmp->name = tname;
82 vtmp->value = tvalue; 86 vtmp->value = tvalue;
@@ -84,9 +88,9 @@ int X509V3_add_value(const char *name, const char *value,
84 return 1; 88 return 1;
85 err: 89 err:
86 X509V3err(X509V3_F_X509V3_ADD_VALUE,ERR_R_MALLOC_FAILURE); 90 X509V3err(X509V3_F_X509V3_ADD_VALUE,ERR_R_MALLOC_FAILURE);
87 if(vtmp) Free(vtmp); 91 if(vtmp) OPENSSL_free(vtmp);
88 if(tname) Free(tname); 92 if(tname) OPENSSL_free(tname);
89 if(tvalue) Free(tvalue); 93 if(tvalue) OPENSSL_free(tvalue);
90 return 0; 94 return 0;
91} 95}
92 96
@@ -101,10 +105,10 @@ int X509V3_add_value_uchar(const char *name, const unsigned char *value,
101void X509V3_conf_free(CONF_VALUE *conf) 105void X509V3_conf_free(CONF_VALUE *conf)
102{ 106{
103 if(!conf) return; 107 if(!conf) return;
104 if(conf->name) Free(conf->name); 108 if(conf->name) OPENSSL_free(conf->name);
105 if(conf->value) Free(conf->value); 109 if(conf->value) OPENSSL_free(conf->value);
106 if(conf->section) Free(conf->section); 110 if(conf->section) OPENSSL_free(conf->section);
107 Free(conf); 111 OPENSSL_free(conf);
108} 112}
109 113
110int X509V3_add_value_bool(const char *name, int asn1_bool, 114int X509V3_add_value_bool(const char *name, int asn1_bool,
@@ -176,7 +180,7 @@ int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
176 if(!aint) return 1; 180 if(!aint) return 1;
177 if(!(strtmp = i2s_ASN1_INTEGER(NULL, aint))) return 0; 181 if(!(strtmp = i2s_ASN1_INTEGER(NULL, aint))) return 0;
178 ret = X509V3_add_value(name, strtmp, extlist); 182 ret = X509V3_add_value(name, strtmp, extlist);
179 Free(strtmp); 183 OPENSSL_free(strtmp);
180 return ret; 184 return ret;
181} 185}
182 186
@@ -298,11 +302,11 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line)
298 } 302 }
299 X509V3_add_value(ntmp, NULL, &values); 303 X509V3_add_value(ntmp, NULL, &values);
300 } 304 }
301Free(linebuf); 305OPENSSL_free(linebuf);
302return values; 306return values;
303 307
304err: 308err:
305Free(linebuf); 309OPENSSL_free(linebuf);
306sk_CONF_VALUE_pop_free(values, X509V3_conf_free); 310sk_CONF_VALUE_pop_free(values, X509V3_conf_free);
307return NULL; 311return NULL;
308 312
@@ -325,8 +329,9 @@ static char *strip_spaces(char *name)
325 329
326/* hex string utilities */ 330/* hex string utilities */
327 331
328/* Given a buffer of length 'len' return a Malloc'ed string with its 332/* Given a buffer of length 'len' return a OPENSSL_malloc'ed string with its
329 * hex representation 333 * hex representation
334 * @@@ (Contents of buffer are always kept in ASCII, also on EBCDIC machines)
330 */ 335 */
331 336
332char *hex_to_string(unsigned char *buffer, long len) 337char *hex_to_string(unsigned char *buffer, long len)
@@ -336,7 +341,7 @@ char *hex_to_string(unsigned char *buffer, long len)
336 int i; 341 int i;
337 static char hexdig[] = "0123456789ABCDEF"; 342 static char hexdig[] = "0123456789ABCDEF";
338 if(!buffer || !len) return NULL; 343 if(!buffer || !len) return NULL;
339 if(!(tmp = Malloc(len * 3 + 1))) { 344 if(!(tmp = OPENSSL_malloc(len * 3 + 1))) {
340 X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE); 345 X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE);
341 return NULL; 346 return NULL;
342 } 347 }
@@ -347,6 +352,10 @@ char *hex_to_string(unsigned char *buffer, long len)
347 *q++ = ':'; 352 *q++ = ':';
348 } 353 }
349 q[-1] = 0; 354 q[-1] = 0;
355#ifdef CHARSET_EBCDIC
356 ebcdic2ascii(tmp, tmp, q - tmp - 1);
357#endif
358
350 return tmp; 359 return tmp;
351} 360}
352 361
@@ -362,14 +371,20 @@ unsigned char *string_to_hex(char *str, long *len)
362 X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_INVALID_NULL_ARGUMENT); 371 X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_INVALID_NULL_ARGUMENT);
363 return NULL; 372 return NULL;
364 } 373 }
365 if(!(hexbuf = Malloc(strlen(str) >> 1))) goto err; 374 if(!(hexbuf = OPENSSL_malloc(strlen(str) >> 1))) goto err;
366 for(p = (unsigned char *)str, q = hexbuf; *p;) { 375 for(p = (unsigned char *)str, q = hexbuf; *p;) {
367 ch = *p++; 376 ch = *p++;
377#ifdef CHARSET_EBCDIC
378 ch = os_toebcdic[ch];
379#endif
368 if(ch == ':') continue; 380 if(ch == ':') continue;
369 cl = *p++; 381 cl = *p++;
382#ifdef CHARSET_EBCDIC
383 cl = os_toebcdic[cl];
384#endif
370 if(!cl) { 385 if(!cl) {
371 X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ODD_NUMBER_OF_DIGITS); 386 X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ODD_NUMBER_OF_DIGITS);
372 Free(hexbuf); 387 OPENSSL_free(hexbuf);
373 return NULL; 388 return NULL;
374 } 389 }
375 if(isupper(ch)) ch = tolower(ch); 390 if(isupper(ch)) ch = tolower(ch);
@@ -391,12 +406,12 @@ unsigned char *string_to_hex(char *str, long *len)
391 return hexbuf; 406 return hexbuf;
392 407
393 err: 408 err:
394 if(hexbuf) Free(hexbuf); 409 if(hexbuf) OPENSSL_free(hexbuf);
395 X509V3err(X509V3_F_STRING_TO_HEX,ERR_R_MALLOC_FAILURE); 410 X509V3err(X509V3_F_STRING_TO_HEX,ERR_R_MALLOC_FAILURE);
396 return NULL; 411 return NULL;
397 412
398 badhex: 413 badhex:
399 Free(hexbuf); 414 OPENSSL_free(hexbuf);
400 X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ILLEGAL_HEX_DIGIT); 415 X509V3err(X509V3_F_STRING_TO_HEX,X509V3_R_ILLEGAL_HEX_DIGIT);
401 return NULL; 416 return NULL;
402 417
@@ -416,3 +431,86 @@ int name_cmp(const char *name, const char *cmp)
416 if(!c || (c=='.')) return 0; 431 if(!c || (c=='.')) return 0;
417 return 1; 432 return 1;
418} 433}
434
435static int sk_strcmp(const char * const *a, const char * const *b)
436{
437 return strcmp(*a, *b);
438}
439
440STACK *X509_get1_email(X509 *x)
441{
442 STACK_OF(GENERAL_NAME) *gens;
443 STACK *ret;
444 gens = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL);
445 ret = get_email(X509_get_subject_name(x), gens);
446 sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
447 return ret;
448}
449
450STACK *X509_REQ_get1_email(X509_REQ *x)
451{
452 STACK_OF(GENERAL_NAME) *gens;
453 STACK_OF(X509_EXTENSION) *exts;
454 STACK *ret;
455 exts = X509_REQ_get_extensions(x);
456 gens = X509V3_get_d2i(exts, NID_subject_alt_name, NULL, NULL);
457 ret = get_email(X509_REQ_get_subject_name(x), gens);
458 sk_GENERAL_NAME_pop_free(gens, GENERAL_NAME_free);
459 sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
460 return ret;
461}
462
463
464static STACK *get_email(X509_NAME *name, STACK_OF(GENERAL_NAME) *gens)
465{
466 STACK *ret = NULL;
467 X509_NAME_ENTRY *ne;
468 ASN1_IA5STRING *email;
469 GENERAL_NAME *gen;
470 int i;
471 /* Now add any email address(es) to STACK */
472 i = -1;
473 /* First supplied X509_NAME */
474 while((i = X509_NAME_get_index_by_NID(name,
475 NID_pkcs9_emailAddress, i)) > 0) {
476 ne = X509_NAME_get_entry(name, i);
477 email = X509_NAME_ENTRY_get_data(ne);
478 if(!append_ia5(&ret, email)) return NULL;
479 }
480 for(i = 0; i < sk_GENERAL_NAME_num(gens); i++)
481 {
482 gen = sk_GENERAL_NAME_value(gens, i);
483 if(gen->type != GEN_EMAIL) continue;
484 if(!append_ia5(&ret, gen->d.ia5)) return NULL;
485 }
486 return ret;
487}
488
489static void str_free(void *str)
490{
491 OPENSSL_free(str);
492}
493
494static int append_ia5(STACK **sk, ASN1_IA5STRING *email)
495{
496 char *emtmp;
497 /* First some sanity checks */
498 if(email->type != V_ASN1_IA5STRING) return 1;
499 if(!email->data || !email->length) return 1;
500 if(!*sk) *sk = sk_new(sk_strcmp);
501 if(!*sk) return 0;
502 /* Don't add duplicates */
503 if(sk_find(*sk, (char *)email->data) != -1) return 1;
504 emtmp = BUF_strdup((char *)email->data);
505 if(!emtmp || !sk_push(*sk, emtmp)) {
506 X509_email_free(*sk);
507 *sk = NULL;
508 return 0;
509 }
510 return 1;
511}
512
513void X509_email_free(STACK *sk)
514{
515 sk_pop_free(sk, str_free);
516}
diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h
index 96ceb7c4fb..0453b12d63 100644
--- a/src/lib/libcrypto/x509v3/x509v3.h
+++ b/src/lib/libcrypto/x509v3/x509v3.h
@@ -58,14 +58,14 @@
58#ifndef HEADER_X509V3_H 58#ifndef HEADER_X509V3_H
59#define HEADER_X509V3_H 59#define HEADER_X509V3_H
60 60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65#include <openssl/bio.h> 61#include <openssl/bio.h>
66#include <openssl/x509.h> 62#include <openssl/x509.h>
67#include <openssl/conf.h> 63#include <openssl/conf.h>
68 64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69/* Forward reference */ 69/* Forward reference */
70struct v3_ext_method; 70struct v3_ext_method;
71struct v3_ext_ctx; 71struct v3_ext_ctx;
@@ -131,6 +131,8 @@ void *db;
131typedef struct v3_ext_method X509V3_EXT_METHOD; 131typedef struct v3_ext_method X509V3_EXT_METHOD;
132typedef struct v3_ext_ctx X509V3_CTX; 132typedef struct v3_ext_ctx X509V3_CTX;
133 133
134DECLARE_STACK_OF(X509V3_EXT_METHOD)
135
134/* ext_flags values */ 136/* ext_flags values */
135#define X509V3_EXT_DYNAMIC 0x1 137#define X509V3_EXT_DYNAMIC 0x1
136#define X509V3_EXT_CTX_DEP 0x2 138#define X509V3_EXT_CTX_DEP 0x2
@@ -227,7 +229,7 @@ typedef struct SXNET_st {
227 229
228typedef struct NOTICEREF_st { 230typedef struct NOTICEREF_st {
229 ASN1_STRING *organization; 231 ASN1_STRING *organization;
230 STACK *noticenos; 232 STACK_OF(ASN1_INTEGER) *noticenos;
231} NOTICEREF; 233} NOTICEREF;
232 234
233typedef struct USERNOTICE_st { 235typedef struct USERNOTICE_st {
@@ -332,7 +334,8 @@ typedef struct x509_purpose_st {
332 int purpose; 334 int purpose;
333 int trust; /* Default trust ID */ 335 int trust; /* Default trust ID */
334 int flags; 336 int flags;
335 int (*check_purpose)(struct x509_purpose_st *, X509 *, int); 337 int (*check_purpose)(const struct x509_purpose_st *,
338 const X509 *, int);
336 char *name; 339 char *name;
337 char *sname; 340 char *sname;
338 void *usr_data; 341 void *usr_data;
@@ -529,12 +532,13 @@ int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, int flag, int indent);
529int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); 532int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
530 533
531int X509_check_purpose(X509 *x, int id, int ca); 534int X509_check_purpose(X509 *x, int id, int ca);
535int X509_check_issued(X509 *issuer, X509 *subject);
532int X509_PURPOSE_get_count(void); 536int X509_PURPOSE_get_count(void);
533X509_PURPOSE * X509_PURPOSE_get0(int idx); 537X509_PURPOSE * X509_PURPOSE_get0(int idx);
534int X509_PURPOSE_get_by_sname(char *sname); 538int X509_PURPOSE_get_by_sname(char *sname);
535int X509_PURPOSE_get_by_id(int id); 539int X509_PURPOSE_get_by_id(int id);
536int X509_PURPOSE_add(int id, int trust, int flags, 540int X509_PURPOSE_add(int id, int trust, int flags,
537 int (*ck)(X509_PURPOSE *, X509 *, int), 541 int (*ck)(const X509_PURPOSE *, const X509 *, int),
538 char *name, char *sname, void *arg); 542 char *name, char *sname, void *arg);
539char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); 543char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
540char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); 544char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
@@ -542,6 +546,11 @@ int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
542void X509_PURPOSE_cleanup(void); 546void X509_PURPOSE_cleanup(void);
543int X509_PURPOSE_get_id(X509_PURPOSE *); 547int X509_PURPOSE_get_id(X509_PURPOSE *);
544 548
549STACK *X509_get1_email(X509 *x);
550STACK *X509_REQ_get1_email(X509_REQ *x);
551void X509_email_free(STACK *sk);
552
553
545/* BEGIN ERROR CODES */ 554/* BEGIN ERROR CODES */
546/* The following lines are auto generated by the script mkerr.pl. Any changes 555/* The following lines are auto generated by the script mkerr.pl. Any changes
547 * made after this point may be overwritten when the script is next run. 556 * made after this point may be overwritten when the script is next run.