diff options
author | Brent Cook <busterb@gmail.com> | 2014-07-10 06:07:09 -0500 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2014-07-10 06:07:09 -0500 |
commit | e9eff5016a4ec2153c037c1b888acd2755965755 (patch) | |
tree | 2b452b71a3fe94a9b25ce06404c55e1d0ea2dd95 /update.sh | |
download | portable-e9eff5016a4ec2153c037c1b888acd2755965755.tar.gz portable-e9eff5016a4ec2153c037c1b888acd2755965755.tar.bz2 portable-e9eff5016a4ec2153c037c1b888acd2755965755.zip |
initial top-level import
Diffstat (limited to 'update.sh')
-rwxr-xr-x | update.sh | 385 |
1 files changed, 385 insertions, 0 deletions
diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..1c09f7f --- /dev/null +++ b/update.sh | |||
@@ -0,0 +1,385 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | set -e | ||
3 | |||
4 | # resync this library with the upstream project, remove old submodule dirs | ||
5 | git submodule init | ||
6 | git submodule update | ||
7 | rm -fr *-openbsd | ||
8 | |||
9 | libssl_src=openbsd/libssl | ||
10 | libssl_regress=openbsd/libssl-regress | ||
11 | libc_src=openbsd/libc | ||
12 | libc_regress=openbsd/libc-regress | ||
13 | libcrypto_src=openbsd/libcrypto | ||
14 | libcrypto_regress=openbsd/libcrypto-regress | ||
15 | |||
16 | source $libssl_src/ssl/shlib_version | ||
17 | libssl_version=$major:$minor:0 | ||
18 | echo libssl version $libssl_version | ||
19 | |||
20 | source $libcrypto_src/crypto/shlib_version | ||
21 | libcrypto_version=$major:$minor:0 | ||
22 | echo libcrypto version $libcrypto_version | ||
23 | |||
24 | crypto_subdirs= | ||
25 | |||
26 | copy_src() { | ||
27 | mkdir -p $1 | ||
28 | rm -f $1/*.c | ||
29 | for file in $2; do | ||
30 | cp $libssl_src/src/$1/$file $1 | ||
31 | done | ||
32 | } | ||
33 | |||
34 | copy_hdrs() { | ||
35 | for file in $2; do | ||
36 | cp $libssl_src/src/$1/$file include/openssl | ||
37 | done | ||
38 | } | ||
39 | |||
40 | copy_crypto() { | ||
41 | copy_src crypto/$1 "$2" | ||
42 | crypto_subdirs="$crypto_subdirs $1" | ||
43 | } | ||
44 | |||
45 | cp $libssl_src/src/LICENSE COPYING | ||
46 | cp $libssl_src/src/CHANGES ChangeLog | ||
47 | |||
48 | cp $libcrypto_src/crypto/arch/amd64/opensslconf.h include/openssl | ||
49 | cp $libssl_src/src/e_os2.h include/openssl | ||
50 | cp $libssl_src/src/ssl/pqueue.h include | ||
51 | |||
52 | for i in explicit_bzero.c strlcpy.c strlcat.c timingsafe_bcmp.c timingsafe_memcmp.c; do | ||
53 | cp $libc_src/string/$i crypto/compat | ||
54 | done | ||
55 | cp $libc_src/stdlib/reallocarray.c crypto/compat | ||
56 | cp $libc_src/stdlib/strtonum.c crypto/compat | ||
57 | cp $libc_src/crypt/arc4random.c crypto/compat | ||
58 | cp $libc_src/crypt/chacha_private.h crypto/compat | ||
59 | cp $libcrypto_src/crypto/getentropy_*.c crypto/compat | ||
60 | |||
61 | (cd ./$libssl_src/src/crypto/objects/; | ||
62 | perl objects.pl objects.txt obj_mac.num obj_mac.h; | ||
63 | perl obj_dat.pl obj_mac.h obj_dat.h ) | ||
64 | mkdir -p include/openssl crypto/objects | ||
65 | mv $libssl_src/src/crypto/objects/obj_mac.h ./include/openssl/obj_mac.h | ||
66 | mv $libssl_src/src/crypto/objects/obj_dat.h ./crypto/objects/obj_dat.h | ||
67 | |||
68 | copy_hdrs crypto "stack/stack.h lhash/lhash.h stack/safestack.h opensslv.h | ||
69 | ossl_typ.h err/err.h crypto.h comp/comp.h x509/x509.h buffer/buffer.h | ||
70 | objects/objects.h asn1/asn1.h bn/bn.h ec/ec.h ecdsa/ecdsa.h | ||
71 | ecdh/ecdh.h rsa/rsa.h sha/sha.h x509/x509_vfy.h pkcs7/pkcs7.h pem/pem.h | ||
72 | pem/pem2.h hmac/hmac.h rand/rand.h md5/md5.h | ||
73 | krb5/krb5_asn.h asn1/asn1_mac.h x509v3/x509v3.h conf/conf.h ocsp/ocsp.h | ||
74 | aes/aes.h modes/modes.h asn1/asn1t.h dso/dso.h bf/blowfish.h | ||
75 | bio/bio.h cast/cast.h cmac/cmac.h conf/conf_api.h des/des.h dh/dh.h | ||
76 | dsa/dsa.h cms/cms.h engine/engine.h ui/ui.h pkcs12/pkcs12.h ts/ts.h | ||
77 | md4/md4.h ripemd/ripemd.h whrlpool/whrlpool.h idea/idea.h mdc2/mdc2.h | ||
78 | rc2/rc2.h rc4/rc4.h rc5/rc5.h ui/ui_compat.h txt_db/txt_db.h chacha/chacha.h evp/evp.h | ||
79 | poly1305/poly1305.h" | ||
80 | |||
81 | copy_hdrs ssl "srtp.h ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h" | ||
82 | |||
83 | for i in ssl/srtp.h \ | ||
84 | ssl/ssl_locl.h; do | ||
85 | cp $libssl_src/src/$i ssl | ||
86 | done | ||
87 | |||
88 | copy_src ssl "s3_meth.c s3_srvr.c s3_clnt.c s3_lib.c s3_enc.c s3_pkt.c | ||
89 | s3_both.c s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c s23_pkt.c t1_meth.c | ||
90 | t1_srvr.c t1_clnt.c t1_lib.c t1_enc.c d1_meth.c d1_srvr.c d1_clnt.c | ||
91 | d1_lib.c d1_pkt.c d1_both.c d1_enc.c d1_srtp.c ssl_lib.c ssl_err2.c | ||
92 | ssl_cert.c ssl_sess.c ssl_ciph.c ssl_stat.c ssl_rsa.c ssl_asn1.c ssl_txt.c | ||
93 | ssl_algs.c bio_ssl.c ssl_err.c t1_reneg.c s3_cbc.c pqueue.c" | ||
94 | |||
95 | copy_src crypto "cryptlib.h cryptlib.c malloc-wrapper.c mem_clr.c mem_dbg.c cversion.c | ||
96 | ex_data.c cpt_err.c o_time.c o_time.h o_str.c o_init.c md32_common.h" | ||
97 | |||
98 | copy_crypto aes "aes_cbc.c aes_core.c aes_misc.c aes_ecb.c aes_cfb.c aes_ofb.c aes_ctr.c | ||
99 | aes_ige.c aes_wrap.c aes_locl.h" | ||
100 | |||
101 | copy_crypto asn1 "a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c | ||
102 | a_int.c a_octet.c a_print.c a_type.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_enum.c | ||
103 | a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c x_algor.c | ||
104 | x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c x_bignum.c x_long.c x_name.c | ||
105 | x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c x_nx509.c d2i_pu.c | ||
106 | d2i_pr.c i2d_pu.c i2d_pr.c t_req.c t_x509.c t_x509a.c t_crl.c t_pkey.c | ||
107 | t_spki.c t_bitst.c tasn_new.c tasn_fre.c tasn_enc.c tasn_dec.c tasn_utl.c | ||
108 | tasn_typ.c tasn_prn.c ameth_lib.c f_int.c f_string.c n_pkey.c f_enum.c | ||
109 | x_pkey.c a_bool.c x_exten.c bio_asn1.c bio_ndef.c asn_mime.c asn1_gen.c | ||
110 | asn1_par.c asn1_lib.c asn1_err.c a_bytes.c a_strnid.c evp_asn1.c asn_pack.c | ||
111 | p5_pbe.c p5_pbev2.c p8_pkey.c asn_moid.c a_set.c asn1_locl.h charmap.h" | ||
112 | |||
113 | copy_crypto bf "bf_skey.c bf_ecb.c bf_enc.c bf_cfb64.c bf_ofb64.c bf_locl.h bf_pi.h" | ||
114 | |||
115 | copy_crypto bio "bio_lib.c bio_cb.c bio_err.c bss_mem.c bss_null.c bss_fd.c | ||
116 | bss_file.c bss_sock.c bss_conn.c bf_null.c bf_buff.c b_dump.c | ||
117 | b_sock.c bss_acpt.c bf_nbio.c bss_log.c bss_bio.c bss_dgram.c b_print.c" | ||
118 | |||
119 | copy_crypto bn "bn_add.c bn_asm.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c | ||
120 | bn_mod.c bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c bn_kron.c | ||
121 | bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_recp.c bn_mont.c | ||
122 | bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c bn_depr.c bn_const.c bn_x931p.c | ||
123 | bn_lcl.h bn_prime.h" | ||
124 | |||
125 | copy_crypto buffer "buffer.c buf_err.c buf_str.c" | ||
126 | |||
127 | copy_crypto cast "c_skey.c c_ecb.c c_enc.c c_cfb64.c c_ofb64.c cast_lcl.h | ||
128 | cast_s.h" | ||
129 | |||
130 | copy_crypto chacha "chacha.c chacha-merged.c" | ||
131 | |||
132 | copy_crypto cmac "cmac.c cm_ameth.c cm_pmeth.c" | ||
133 | |||
134 | #copy_crypto cms "cms_lib.c cms_asn1.c cms_att.c cms_io.c cms_smime.c cms_err.c | ||
135 | # cms_sd.c cms_dd.c cms_cd.c cms_env.c cms_enc.c cms_ess.c cms_pwri.c cms.h cms_lcl.h" | ||
136 | |||
137 | copy_crypto comp "comp_lib.c comp_err.c c_rle.c c_zlib.c" | ||
138 | |||
139 | copy_crypto conf "conf_err.c conf_lib.c conf_api.c conf_def.c conf_mod.c | ||
140 | conf_mall.c conf_sap.c conf_def.h" | ||
141 | |||
142 | copy_crypto des "cbc_cksm.c cbc_enc.c cfb64enc.c cfb_enc.c ecb3_enc.c | ||
143 | ecb_enc.c enc_read.c enc_writ.c fcrypt.c fcrypt_b.c ofb64enc.c ofb_enc.c | ||
144 | pcbc_enc.c qud_cksm.c rand_key.c set_key.c xcbc_enc.c str2key.c | ||
145 | cfb64ede.c ofb64ede.c ede_cbcm_enc.c des_enc.c des_locl.h ncbc_enc.c | ||
146 | spr.h" | ||
147 | |||
148 | copy_crypto dh "dh_asn1.c dh_gen.c dh_key.c dh_lib.c dh_check.c dh_err.c | ||
149 | dh_depr.c dh_ameth.c dh_pmeth.c dh_prn.c" | ||
150 | |||
151 | copy_crypto dsa "dsa_gen.c dsa_key.c dsa_lib.c dsa_asn1.c dsa_vrf.c | ||
152 | dsa_sign.c dsa_err.c dsa_ossl.c dsa_depr.c dsa_ameth.c dsa_pmeth.c | ||
153 | dsa_prn.c dsa_locl.h" | ||
154 | |||
155 | copy_crypto dso "dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c" | ||
156 | |||
157 | copy_crypto ec "ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c | ||
158 | ec_err.c ec_curve.c ec_check.c ec_print.c ec_asn1.c ec_key.c ec2_smpl.c | ||
159 | ec2_mult.c ec_ameth.c ec_pmeth.c eck_prn.c ecp_oct.c ec2_oct.c ec_oct.c | ||
160 | ec_lcl.h" | ||
161 | |||
162 | copy_crypto ecdh "ech_lib.c ech_ossl.c ech_key.c ech_err.c ech_locl.h" | ||
163 | |||
164 | copy_crypto ecdsa "ecs_lib.c ecs_asn1.c ecs_ossl.c ecs_sign.c ecs_vrf.c | ||
165 | ecs_err.c ecs_locl.h" | ||
166 | |||
167 | # Engine interface is disabled | ||
168 | copy_crypto engine "eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c | ||
169 | eng_table.c eng_pkey.c eng_fat.c eng_all.c tb_rsa.c tb_dsa.c tb_ecdsa.c | ||
170 | tb_dh.c tb_ecdh.c tb_rand.c tb_store.c tb_cipher.c tb_digest.c tb_pkmeth.c | ||
171 | tb_asnmth.c eng_openssl.c eng_cnf.c eng_dyn.c eng_rsax.c eng_int.h" | ||
172 | |||
173 | copy_crypto err "err.c err_all.c err_prn.c" | ||
174 | |||
175 | copy_crypto evp "encode.c digest.c evp_enc.c evp_key.c e_des.c e_bf.c | ||
176 | e_idea.c e_des3.c e_rc4.c e_aes.c names.c e_xcbc_d.c e_rc2.c e_cast.c | ||
177 | m_null.c m_md4.c m_md5.c m_sha.c m_sha1.c m_wp.c m_dss.c m_dss1.c m_mdc2.c | ||
178 | m_ripemd.c m_ecdsa.c p_open.c p_seal.c p_sign.c p_verify.c p_lib.c p_enc.c | ||
179 | p_dec.c bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c c_all.c c_allc.c | ||
180 | c_alld.c evp_lib.c evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c | ||
181 | e_old.c pmeth_lib.c pmeth_fn.c pmeth_gn.c m_sigver.c e_aes_cbc_hmac_sha1.c | ||
182 | e_rc4_hmac_md5.c evp_locl.h e_chacha.c evp_aead.c e_chacha20poly1305.c" | ||
183 | |||
184 | copy_crypto hmac "hmac.c hm_ameth.c hm_pmeth.c" | ||
185 | |||
186 | copy_crypto idea "i_cbc.c i_cfb64.c i_ofb64.c i_ecb.c i_skey.c idea_lcl.h" | ||
187 | |||
188 | copy_crypto krb5 "krb5_asn.c" | ||
189 | |||
190 | copy_crypto lhash "lhash.c lh_stats.c" | ||
191 | |||
192 | copy_crypto md4 "md4_dgst.c md4_one.c md4_locl.h" | ||
193 | |||
194 | copy_crypto md5 "md5_dgst.c md5_one.c md5_locl.h" | ||
195 | |||
196 | copy_crypto mdc2 "mdc2dgst.c mdc2_one.c" | ||
197 | |||
198 | copy_crypto modes "cbc128.c ctr128.c cts128.c cfb128.c ofb128.c gcm128.c | ||
199 | ccm128.c xts128.c modes_lcl.h" | ||
200 | |||
201 | copy_crypto objects "o_names.c obj_dat.c obj_lib.c obj_err.c obj_xref.c obj_xref.h" | ||
202 | |||
203 | copy_crypto ocsp "ocsp_asn.c ocsp_ext.c ocsp_ht.c ocsp_lib.c ocsp_cl.c | ||
204 | ocsp_srv.c ocsp_prn.c ocsp_vfy.c ocsp_err.c" | ||
205 | |||
206 | copy_crypto pem "pem_sign.c pem_seal.c pem_info.c pem_lib.c pem_all.c pem_err.c | ||
207 | pem_x509.c pem_xaux.c pem_oth.c pem_pk8.c pem_pkey.c pvkfmt.c" | ||
208 | |||
209 | copy_crypto pkcs12 "p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c | ||
210 | p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c p12_utl.c p12_npas.c | ||
211 | pk12err.c p12_p8d.c p12_p8e.c" | ||
212 | |||
213 | copy_crypto pkcs7 "pk7_asn1.c pk7_lib.c pkcs7err.c pk7_doit.c pk7_smime.c | ||
214 | pk7_attr.c pk7_mime.c bio_pk7.c" | ||
215 | |||
216 | copy_crypto poly1305 "poly1305-donna.c poly1305.c" | ||
217 | |||
218 | copy_crypto rand "randfile.c rand_err.c rand_lib.c" | ||
219 | |||
220 | copy_crypto rc2 "rc2_ecb.c rc2_skey.c rc2_cbc.c rc2cfb64.c rc2ofb64.c rc2_locl.h" | ||
221 | |||
222 | copy_crypto rc4 "rc4_enc.c rc4_skey.c rc4_utl.c rc4_locl.h" | ||
223 | |||
224 | copy_crypto ripemd "rmd_dgst.c rmd_one.c rmd_locl.h rmdconst.h" | ||
225 | |||
226 | copy_crypto rsa "rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c | ||
227 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_pss.c | ||
228 | rsa_x931.c rsa_asn1.c rsa_depr.c rsa_ameth.c rsa_prn.c rsa_pmeth.c | ||
229 | rsa_crpt.c rsa_locl.h" | ||
230 | |||
231 | copy_crypto sha "sha_dgst.c sha1dgst.c sha_one.c sha1_one.c sha256.c sha512.c sha_locl.h" | ||
232 | |||
233 | copy_crypto stack "stack.c" | ||
234 | |||
235 | copy_crypto ts "ts_err.c ts_req_utils.c ts_req_print.c ts_rsp_utils.c | ||
236 | ts_rsp_print.c ts_rsp_sign.c ts_rsp_verify.c ts_verify_ctx.c ts_lib.c | ||
237 | ts_conf.c ts_asn1.c" | ||
238 | |||
239 | copy_crypto txt_db "txt_db.c" | ||
240 | |||
241 | copy_crypto ui "ui_err.c ui_lib.c ui_openssl.c ui_util.c ui_locl.h" | ||
242 | |||
243 | copy_crypto whrlpool "wp_block.c wp_dgst.c wp_locl.h" | ||
244 | |||
245 | copy_crypto x509 "x509_def.c x509_d2.c x509_r2x.c x509_cmp.c x509_obj.c | ||
246 | x509_req.c x509spki.c x509_vfy.c x509_set.c x509cset.c x509rset.c | ||
247 | x509_err.c x509name.c x509_v3.c x509_ext.c x509_att.c x509type.c x509_lu.c | ||
248 | x_all.c x509_txt.c x509_trs.c by_file.c by_dir.c x509_vpm.c" | ||
249 | |||
250 | copy_crypto x509v3 "v3_bcons.c v3_bitst.c v3_conf.c v3_extku.c v3_ia5.c v3_lib.c | ||
251 | v3_prn.c v3_utl.c v3err.c v3_genn.c v3_alt.c v3_skey.c v3_akey.c v3_pku.c | ||
252 | v3_int.c v3_enum.c v3_sxnet.c v3_cpols.c v3_crld.c v3_purp.c v3_info.c | ||
253 | v3_ocsp.c v3_akeya.c v3_pmaps.c v3_pcons.c v3_ncons.c v3_pcia.c v3_pci.c | ||
254 | pcy_cache.c pcy_node.c pcy_data.c pcy_map.c pcy_tree.c pcy_lib.c | ||
255 | pcy_int.h ext_dat.h" | ||
256 | |||
257 | copy_src apps "apps.c apps.h asn1pars.c ca.c ciphers.c cms.c crl.c crl2p7.c | ||
258 | dgst.c dh.c dhparam.c dsa.c dsaparam.c ec.c ecparam.c enc.c engine.c | ||
259 | errstr.c gendh.c gendsa.c genpkey.c genrsa.c nseq.c ocsp.c openssl.c | ||
260 | openssl.cnf passwd.c pkcs12.c pkcs7.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c | ||
261 | prime.c progs.h rand.c req.c rsa.c rsautl.c s_apps.h s_cb.c s_client.c | ||
262 | s_server.c s_socket.c s_time.c sess_id.c smime.c speed.c spkac.c | ||
263 | testdsa.h testrsa.h timeouts.h ts.c verify.c version.c x509.c" | ||
264 | |||
265 | rm -f tests/*.c | ||
266 | for i in aead/aeadtest.c aeswrap/aes_wrap.c base64/base64test.c bf/bftest.c \ | ||
267 | bio/biotest.c bn/general/bntest.c bn/mont/mont.c \ | ||
268 | cast/casttest.c chacha/chachatest.c cts128/cts128test.c \ | ||
269 | des/destest.c dh/dhtest.c dsa/dsatest.c ec/ectest.c ecdh/ecdhtest.c \ | ||
270 | ecdsa/ecdsatest.c engine/enginetest.c evp/evptest.c exp/exptest.c \ | ||
271 | gcm128/gcm128test.c hmac/hmactest.c idea/ideatest.c ige/igetest.c \ | ||
272 | md4/md4test.c md5/md5test.c mdc2/mdc2test.c poly1305/poly1305test.c \ | ||
273 | pkcs7/pkcs7test.c pqueue/pq_test.c rand/randtest.c rc2/rc2test.c \ | ||
274 | rc4/rc4test.c rmd/rmdtest.c sha/shatest.c sha1/sha1test.c \ | ||
275 | sha256/sha256test.c sha512/sha512test.c utf8/utf8test.c; do | ||
276 | cp $libcrypto_regress/$i tests | ||
277 | done | ||
278 | cp $libc_regress/arc4random-fork/arc4random-fork.c tests/arc4randomforktest.c | ||
279 | cp $libc_regress/explicit_bzero/explicit_bzero.c tests | ||
280 | cp $libc_regress/timingsafe/timingsafe.c tests | ||
281 | |||
282 | for i in ssl/ssltest.c ssl/testssl certs/ca.pem certs/server.pem; do | ||
283 | cp $libssl_regress/$i tests | ||
284 | done | ||
285 | |||
286 | # do not directly run all test programs | ||
287 | test_excludes=(aeadtest evptest pq_test ssltest arc4randomforktest) | ||
288 | (cd tests | ||
289 | cp Makefile.am.tpl Makefile.am | ||
290 | |||
291 | for i in `ls -1 *.c|sort`; do | ||
292 | TEST=`echo $i|sed -e "s/\.c//"` | ||
293 | if ! [[ ${test_excludes[*]} =~ "$TEST" ]]; then | ||
294 | echo "TESTS += $TEST" >> Makefile.am | ||
295 | fi | ||
296 | echo "check_PROGRAMS += $TEST" >> Makefile.am | ||
297 | echo "${TEST}_SOURCES = $i" >> Makefile.am | ||
298 | echo "${TEST}_LDADD = \$(PLATFORM_LDADD)" >> Makefile.am | ||
299 | echo "${TEST}_LDADD += \$(top_builddir)/ssl/libssl.la" >> Makefile.am | ||
300 | echo "${TEST}_LDADD += \$(top_builddir)/crypto/libcrypto.la" >> Makefile.am | ||
301 | done | ||
302 | ) | ||
303 | cp $libcrypto_regress/evp/evptests.txt tests | ||
304 | cp $libcrypto_regress/aead/aeadtests.txt tests | ||
305 | cp $libcrypto_regress/pqueue/expected.txt tests/pq_expected.txt | ||
306 | chmod 755 tests/testssl | ||
307 | for i in "${test_excludes[@]}"; do | ||
308 | echo "TESTS += ${i}.sh" >> tests/Makefile.am | ||
309 | echo "EXTRA_DIST += ${i}.sh" >> tests/Makefile.am | ||
310 | done | ||
311 | echo "EXTRA_DIST += aeadtests.txt" >> tests/Makefile.am | ||
312 | echo "EXTRA_DIST += evptests.txt" >> tests/Makefile.am | ||
313 | echo "EXTRA_DIST += pq_expected.txt" >> tests/Makefile.am | ||
314 | echo "EXTRA_DIST += testssl ca.pem server.pem" >> tests/Makefile.am | ||
315 | |||
316 | (cd include/openssl | ||
317 | cp Makefile.am.tpl Makefile.am | ||
318 | for i in `ls -1 *.h|sort`; do | ||
319 | echo "opensslinclude_HEADERS += $i" >> Makefile.am | ||
320 | done | ||
321 | ) | ||
322 | |||
323 | # remove unsupported __bounded__ attributes | ||
324 | bounded_excludes=( | ||
325 | include/openssl/bio.h | ||
326 | include/openssl/buffer.h | ||
327 | include/openssl/md5.h | ||
328 | include/openssl/sha.h | ||
329 | crypto/chacha/chacha-merged.c | ||
330 | ) | ||
331 | for i in "${bounded_excludes[@]}"; do | ||
332 | sed -ie 's/__attribute__.*((__bounded__.*/;/' $i | ||
333 | done | ||
334 | |||
335 | (cd ssl | ||
336 | sed -e "s/libssl-version/${libssl_version}/" Makefile.am.tpl > Makefile.am | ||
337 | for i in `ls -1 *.c|sort`; do | ||
338 | echo "libssl_la_SOURCES += $i" >> Makefile.am | ||
339 | done | ||
340 | for i in `ls -1 *.h|sort`; do | ||
341 | echo "noinst_HEADERS += $i" >> Makefile.am | ||
342 | done | ||
343 | ) | ||
344 | |||
345 | # do not directly compile C files that are included in other C files | ||
346 | crypto_excludes=( | ||
347 | des/ncbc_enc.c | ||
348 | chacha/chacha-merged.c | ||
349 | poly1305/poly1305-donna.c | ||
350 | ) | ||
351 | (cd crypto | ||
352 | sed -e "s/libcrypto-version/${libcrypto_version}/" Makefile.am.tpl > Makefile.am | ||
353 | for i in `ls -1 *.c|sort`; do | ||
354 | echo "libcrypto_la_SOURCES += $i" >> Makefile.am | ||
355 | done | ||
356 | for i in `ls -1 *.h|sort`; do | ||
357 | echo "noinst_HEADERS += $i" >> Makefile.am | ||
358 | done | ||
359 | for subdir in $crypto_subdirs; do | ||
360 | for i in `ls -1 $subdir/*.c|sort`; do | ||
361 | if ! [[ ${crypto_excludes[*]} =~ $i ]]; then | ||
362 | echo "libcrypto_la_SOURCES += $i" >> Makefile.am | ||
363 | fi | ||
364 | done | ||
365 | headers=`ls -1 $subdir/*.h 2>/dev/null |sort` | ||
366 | if [ "$headers" != "" ]; then | ||
367 | for i in $headers; do | ||
368 | echo "noinst_HEADERS += $i" >> Makefile.am | ||
369 | done | ||
370 | fi | ||
371 | done | ||
372 | for i in "${crypto_excludes[@]}"; do | ||
373 | echo "EXTRA_libcrypto_la_SOURCES += ${i}" >> Makefile.am | ||
374 | done | ||
375 | ) | ||
376 | |||
377 | (cd apps | ||
378 | cp Makefile.am.tpl Makefile.am | ||
379 | for i in `ls -1 *.c|sort`; do | ||
380 | echo "openssl_SOURCES += $i" >> Makefile.am | ||
381 | done | ||
382 | for i in `ls -1 *.h|sort`; do | ||
383 | echo "noinst_HEADERS += $i" >> Makefile.am | ||
384 | done | ||
385 | ) | ||