1# $FreeBSD$ 2 3SHLIBDIR?= /lib 4SUBDIR= engines 5 6.include <bsd.own.mk> 7 8LIB= crypto 9SHLIB_MAJOR= 5 10 11NO_LINT= 12 13.if exists(Makefile.man) 14.include "Makefile.man" 15.endif 16.if defined(NOTYET) 17MAN+= config.5 des_modes.7 18.endif 19 20.include "Makefile.inc" 21 22# base sources 23SRCS= cpt_err.c cryptlib.c cversion.c ebcdic.c ex_data.c mem.c mem_clr.c \ 24 mem_dbg.c o_dir.c o_str.c o_time.c tmdiff.c uid.c 25INCS= crypto.h ebcdic.h opensslv.h ossl_typ.h symhacks.h tmdiff.h \ 26 ../e_os.h ../e_os2.h 27 28# aes 29SRCS+= aes_cbc.c aes_cfb.c aes_core.c aes_ctr.c aes_ecb.c aes_ige.c \ 30 aes_misc.c aes_ofb.c 31INCS+= aes.h aes_locl.h 32 33# asn1 34SRCS+= a_bitstr.c a_bool.c a_bytes.c a_d2i_fp.c a_digest.c a_dup.c \ 35 a_enum.c a_gentm.c a_hdr.c a_i2d_fp.c a_int.c a_mbstr.c \ 36 a_meth.c a_object.c a_octet.c a_print.c a_set.c a_sign.c \ 37 a_strex.c a_strnid.c a_time.c a_type.c a_utctm.c a_utf8.c \ 38 a_verify.c asn1_err.c asn1_gen.c asn1_lib.c asn1_par.c \ 39 asn_moid.c asn_pack.c d2i_pr.c d2i_pu.c evp_asn1.c f_enum.c \ 40 f_int.c f_string.c i2d_pr.c i2d_pu.c n_pkey.c nsseq.c p5_pbe.c \ 41 p5_pbev2.c p8_pkey.c t_bitst.c t_crl.c t_pkey.c t_req.c \ 42 t_spki.c t_x509.c t_x509a.c tasn_dec.c tasn_enc.c tasn_fre.c \ 43 tasn_new.c tasn_typ.c tasn_utl.c x_algor.c x_attrib.c \ 44 x_bignum.c x_crl.c x_exten.c x_info.c x_long.c x_name.c \ 45 x_pkey.c x_pubkey.c x_req.c x_sig.c x_spki.c x_val.c x_x509.c \ 46 x_x509a.c 47INCS+= asn1.h asn1_mac.h asn1t.h 48 49# bf 50SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c 51.if ${MACHINE_ARCH} == "i386" 52.if ${MACHINE_CPU:Mi686} 53SRCS+= bf-686.s 54.else 55SRCS+= bf-586.s 56.endif 57.else 58SRCS+= bf_enc.c 59.endif 60INCS+= blowfish.h 61 62# bio 63SRCS+= b_dump.c b_print.c b_sock.c bf_buff.c bf_lbuf.c bf_nbio.c \ 64 bf_null.c bio_cb.c bio_err.c bio_lib.c bss_acpt.c bss_bio.c \ 65 bss_conn.c bss_dgram.c bss_fd.c bss_file.c bss_log.c bss_mem.c \ 66 bss_null.c bss_sock.c 67INCS+= bio.h bio_lcl.h 68 69# bn 70SRCS+= bn_add.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c bn_div.c \ 71 bn_err.c bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c \ 72 bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c \ 73 bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_shift.c bn_sqr.c \ 74 bn_sqrt.c bn_word.c 75.if ${MACHINE_ARCH} == "i386" 76SRCS+= bn-586.s co-586.s 77.elif ${MACHINE_ARCH} == "amd64" 78SRCS+= x86_64-gcc.c 79.else 80SRCS+= bn_asm.c 81.endif 82 83INCS+= bn.h 84 85# buffer 86SRCS+= buf_err.c buffer.c 87INCS+= buffer.h 88 89# cast 90SRCS+= c_cfb64.c c_ecb.c c_ofb64.c c_skey.c 91.if ${MACHINE_ARCH} == "i386" 92SRCS+= cast-586.s 93.else 94SRCS+= c_enc.c 95.endif 96INCS+= cast.h 97 98# camellia 99.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" 100SRCS+= camellia.c cmll_cbc.c cmll_cfb.c cmll_ctr.c cmll_ecb.c \ 101 cmll_misc.c cmll_ofb.c 102INCS+= camellia.h 103.endif 104 105# comp 106SRCS+= c_rle.c c_zlib.c comp_err.c comp_lib.c 107INCS+= comp.h 108 109# conf 110SRCS+= conf_api.c conf_def.c conf_err.c conf_lib.c conf_mall.c conf_mod.c conf_sap.c 111INCS+= conf.h conf_api.h 112 113# des 114SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \ 115 des_old.c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c \ 116 enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \ 117 ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \ 118 rpc_enc.c set_key.c str2key.c xcbc_enc.c 119.if ${MACHINE_ARCH} == "i386" 120SRCS+= des-586.s crypt586.s 121.else 122SRCS+= des_enc.c fcrypt_b.c 123.endif 124INCS+= des.h des_old.h 125 126# dh 127SRCS+= dh_asn1.c dh_check.c dh_err.c dh_depr.c dh_gen.c dh_key.c dh_lib.c 128INCS+= dh.h 129 130# dsa 131SRCS+= dsa_asn1.c dsa_err.c dsa_depr.c dsa_gen.c dsa_key.c dsa_lib.c \ 132 dsa_ossl.c dsa_sign.c dsa_vrf.c 133INCS+= dsa.h 134 135# dso 136SRCS+= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c 137INCS+= dso.h 138 139# ec 140SRCS+= ec_asn1.c ec_check.c ec_curve.c ec_cvt.c ec_err.c ec_key.c \ 141 ec_lib.c ec_mult.c ec_print.c ecp_mont.c ecp_nist.c \ 142 ecp_smpl.c ec2_mult.c ec2_smpl.c 143INCS+= ec.h 144 145# ecdh 146SRCS+= ech_err.c ech_key.c ech_lib.c ech_ossl.c 147INCS+= ecdh.h 148 149# ecdsa 150SRCS+= ecs_asn1.c ecs_err.c ecs_lib.c ecs_ossl.c ecs_sign.c ecs_vrf.c 151INCS+= ecdsa.h 152 153# engine 154SRCS+= eng_all.c eng_cnf.c eng_cryptodev.c eng_ctrl.c eng_dyn.c \ 155 eng_err.c eng_fat.c eng_init.c eng_lib.c eng_list.c \ 156 eng_openssl.c eng_padlock.c eng_pkey.c eng_table.c tb_cipher.c \ 157 tb_dh.c tb_digest.c tb_dsa.c tb_ecdh.c tb_ecdsa.c tb_rand.c \ 158 tb_rsa.c tb_store.c 159INCS+= engine.h 160 161# err 162SRCS+= err.c err_all.c err_prn.c 163INCS+= err.h 164 165# evp 166SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \ 167 digest.c e_aes.c e_bf.c e_cast.c e_des.c e_des3.c e_idea.c \ 168 e_null.c e_old.c e_rc2.c e_rc4.c e_rc5.c e_xcbc_d.c encode.c \ 169 evp_acnf.c evp_enc.c evp_err.c evp_key.c evp_lib.c evp_pbe.c \ 170 evp_pkey.c m_dss.c m_dss1.c m_ecdsa.c m_md2.c m_md4.c m_md5.c \ 171 m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c \ 172 openbsd_hw.c p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c \ 173 p_open.c p_seal.c p_sign.c p_verify.c 174.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" 175SRCS+= e_camellia.c 176.endif 177INCS+= evp.h 178 179# fips 180INCS+= fips.h fips_rand.h 181 182# hmac 183SRCS+= hmac.c 184INCS+= hmac.h 185 186# idea 187.if ${MK_IDEA} != "no" 188SRCS+= i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c 189INCS+= idea.h 190.endif 191 192# krb5 193#SRCS+= krb5_asn.c 194INCS+= krb5_asn.h 195 196# lhash 197SRCS+= lh_stats.c lhash.c 198INCS+= lhash.h 199 200# md2 201SRCS+= md2_dgst.c md2_one.c 202INCS+= md2.h 203 204# md4 205SRCS+= md4_dgst.c md4_one.c 206INCS+= md4.h 207 208# md5 209SRCS+= md5_dgst.c md5_one.c 210.if ${MACHINE_ARCH} == "i386" 211SRCS+= md5-586.s 212.endif 213INCS+= md5.h 214 215# mdc2 216SRCS+= mdc2_one.c mdc2dgst.c 217INCS+= mdc2.h 218 219# objects 220SRCS+= o_names.c obj_dat.c obj_err.c obj_lib.c 221INCS+= objects.h obj_mac.h 222 223# ocsp 224SRCS+= ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \ 225 ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c 226INCS+= ocsp.h 227 228# pem 229SRCS+= pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \ 230 pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c 231INCS+= pem.h pem2.h 232 233# pkcs12 234SRCS+= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \ 235 p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \ 236 p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c 237INCS+= pkcs12.h pkcs7.h 238 239# pkcs7 240SRCS+= example.c pk7_asn1.c pk7_attr.c pk7_dgst.c pk7_doit.c \ 241 pk7_lib.c pk7_mime.c pk7_smime.c pkcs7err.c 242 243# pqueue 244SRCS+= pqueue.c 245INCS+= pqueue.h pq_compat.h 246 247# rand 248SRCS+= md_rand.c rand_egd.c rand_err.c rand_lib.c rand_unix.c randfile.c 249INCS+= rand.h 250 251# rc2 252SRCS+= rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c 253INCS+= rc2.h 254 255# rc4 256SRCS+= rc4_skey.c 257.if ${MACHINE_ARCH} == "i386" 258SRCS+= rc4-586.s 259.else 260SRCS+= rc4_enc.c 261.endif 262INCS+= rc4.h 263 264# rc5 265SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c 266.if ${MACHINE_ARCH} == "i386" 267SRCS+= rc5-586.s 268.else 269SRCS+= rc5_enc.c 270.endif 271INCS+= rc5.h 272 273# ripemd 274SRCS+= rmd_dgst.c rmd_one.c 275INCS+= ripemd.h 276 277# rsa 278SRCS+= rsa_asn1.c rsa_chk.c rsa_eay.c rsa_err.c rsa_gen.c rsa_lib.c \ 279 rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_saos.c \ 280 rsa_sign.c rsa_ssl.c rsa_depr.c rsa_pss.c rsa_x931.c 281INCS+= rsa.h 282 283# sha 284SRCS+= sha1_one.c sha1dgst.c sha_dgst.c sha_one.c sha256.c sha512.c 285.if ${MACHINE_ARCH} == "i386" 286SRCS+= sha1-586.s 287.endif 288INCS+= sha.h 289 290# stack 291SRCS+= stack.c 292INCS+= stack.h safestack.h 293 294# store 295SRCS+= str_err.c str_lib.c str_meth.c str_mem.c 296INCS+= store.h 297 298# threads 299SRCS+= th-lock.c 300 301# txt_db 302SRCS+= txt_db.c 303INCS+= txt_db.h 304 305# ui 306SRCS+= ui_compat.c ui_err.c ui_lib.c ui_openssl.c ui_util.c 307INCS+= ui.h ui_compat.h ui_locl.h 308 309# x509 310SRCS+= by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \ 311 x509_def.c x509_err.c x509_ext.c x509_lu.c x509_obj.c \ 312 x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \ 313 x509_v3.c x509_vfy.c x509cset.c x509name.c x509rset.c \ 314 x509spki.c x509type.c x_all.c x509_vpm.c 315INCS+= x509.h x509_vfy.h 316 317# x509v3 318SRCS+= pcy_cache.c pcy_data.c pcy_lib.c pcy_map.c pcy_node.c \ 319 pcy_tree.c v3_addr.c v3_akey.c v3_akeya.c v3_alt.c v3_asid.c \ 320 v3_bcons.c v3_bitst.c \ 321 v3_conf.c v3_cpols.c v3_crld.c v3_enum.c v3_extku.c v3_genn.c \ 322 v3_ia5.c v3_info.c v3_int.c v3_lib.c v3_ncons.c v3_ocsp.c \ 323 v3_pci.c v3_pcia.c v3_pcons.c v3_pku.c v3_pmaps.c v3_prn.c \ 324 v3_purp.c v3_skey.c v3_sxnet.c v3_utl.c v3err.c 325INCS+= x509v3.h 326 327SRCS+= buildinf.h 328INCS+= opensslconf.h evp.h 329INCSDIR= ${INCLUDEDIR}/openssl 330 331CSTD= gnu89 332 333CLEANFILES= buildinf.h opensslconf.h evp.h 334 335buildinf.h: ${.CURDIR}/Makefile 336 ( echo "#ifndef MK1MF_BUILD"; \ 337 echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \ 338 echo " #define CFLAGS \"$(CC)\""; \ 339 echo " #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \ 340 echo " #define DATE \"`LC_ALL=C date`\""; \ 341 echo "#endif" ) > ${.TARGET} 342 343opensslconf.h: opensslconf-${MACHINE_ARCH}.h 344 cp ${.ALLSRC} ${.TARGET} 345 346evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h 347.if ${MK_IDEA} == "no" 348 sed '/^#ifndef OPENSSL_NO_IDEA$$/,/^#endif$$/d' ${.ALLSRC} > ${.TARGET} 349.else 350 cp ${.ALLSRC} ${.TARGET} 351.endif 352 353# No FIPS support for now 354fips.h: 355 echo '/* dummy fips.h */' > ${.TARGET} 356 357fips_rand.h: 358 echo '/* dummy fips_rand.h */' > ${.TARGET} 359 360CLEANFILES+= fips.h fips_rand.h 361 362OLDSYMLINKS+= libdes.a libdes.so libdes.so.3 libdes_p.a 363afterinstall: 364 @${ECHO} "Removing stale symlinks." 365 rm -f ${DESTDIR}${INCLUDEDIR}/des.h 366.for symlink in ${OLDSYMLINKS} 367 rm -f ${DESTDIR}${LIBDIR}/${symlink} 368.endfor 369 370.include <bsd.lib.mk> 371 372.if ${MACHINE_ARCH} == "i386" 373.PATH: ${.CURDIR}/i386 374.endif 375 376.if ${MACHINE_ARCH} == "amd64" 377_bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm 378.endif 379 380.if ${MK_IDEA} != "no" 381_ideapath= ${LCRYPTO_SRC}/crypto/idea 382.endif 383 384.PATH: \ 385 ${LCRYPTO_SRC}/crypto \ 386 ${LCRYPTO_SRC}/crypto/aes \ 387 ${LCRYPTO_SRC}/crypto/asn1 \ 388 ${LCRYPTO_SRC}/crypto/bf \ 389 ${LCRYPTO_SRC}/crypto/bio \ 390 ${_bn_asmpath} \ 391 ${LCRYPTO_SRC}/crypto/bn \ 392 ${LCRYPTO_SRC}/crypto/buffer \ 393 ${LCRYPTO_SRC}/crypto/cast \ 394 ${LCRYPTO_SRC}/crypto/camellia \ 395 ${LCRYPTO_SRC}/crypto/comp \ 396 ${LCRYPTO_SRC}/crypto/conf \ 397 ${LCRYPTO_SRC}/crypto/des \ 398 ${LCRYPTO_SRC}/crypto/dh \ 399 ${LCRYPTO_SRC}/crypto/dsa \ 400 ${LCRYPTO_SRC}/crypto/dso \ 401 ${LCRYPTO_SRC}/crypto/ec \ 402 ${LCRYPTO_SRC}/crypto/ecdh \ 403 ${LCRYPTO_SRC}/crypto/ecdsa \ 404 ${LCRYPTO_SRC}/crypto/engine \ 405 ${LCRYPTO_SRC}/crypto/err \ 406 ${LCRYPTO_SRC}/crypto/evp \ 407 ${LCRYPTO_SRC}/crypto/hmac \ 408 ${_ideapath} \ 409 ${LCRYPTO_SRC}/crypto/krb5 \ 410 ${LCRYPTO_SRC}/crypto/lhash \ 411 ${LCRYPTO_SRC}/crypto/md2 \ 412 ${LCRYPTO_SRC}/crypto/md4 \ 413 ${LCRYPTO_SRC}/crypto/md5 \ 414 ${LCRYPTO_SRC}/crypto/mdc2 \ 415 ${LCRYPTO_SRC}/crypto/objects \ 416 ${LCRYPTO_SRC}/crypto/ocsp \ 417 ${LCRYPTO_SRC}/crypto/pem \ 418 ${LCRYPTO_SRC}/crypto/pkcs12 \ 419 ${LCRYPTO_SRC}/crypto/pkcs7 \ 420 ${LCRYPTO_SRC}/crypto/pqueue \ 421 ${LCRYPTO_SRC}/crypto/rand \ 422 ${LCRYPTO_SRC}/crypto/rc2 \ 423 ${LCRYPTO_SRC}/crypto/rc4 \ 424 ${LCRYPTO_SRC}/crypto/rc5 \ 425 ${LCRYPTO_SRC}/crypto/ripemd \ 426 ${LCRYPTO_SRC}/crypto/rsa \ 427 ${LCRYPTO_SRC}/crypto/sha \ 428 ${LCRYPTO_SRC}/crypto/stack \ 429 ${LCRYPTO_SRC}/crypto/store \ 430 ${LCRYPTO_SRC}/crypto/threads \ 431 ${LCRYPTO_SRC}/crypto/txt_db \ 432 ${LCRYPTO_SRC}/crypto/ui \ 433 ${LCRYPTO_SRC}/crypto/x509 \ 434 ${LCRYPTO_SRC}/crypto/x509v3 \ 435 ${LCRYPTO_SRC}/engines \ 436 ${LCRYPTO_SRC} \ 437 ${.CURDIR}/man 438