1d9246288SBernhard Schmidt# $FreeBSD$ 2d9246288SBernhard Schmidt 3d9246288SBernhard Schmidt.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) 4*325151a3SRui PauloSRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c 5c6db8143SBaptiste DaroussinLIBADD+= ssl crypto 6f05cddf9SRui PauloCFLAGS+= -DCONFIG_SHA256 7d9246288SBernhard Schmidt.else 8d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_CRYPTO_INTERNAL 9f05cddf9SRui PauloSRCS+= crypto_internal.c random.c 10d9246288SBernhard SchmidtCONFIG_INTERNAL_AES=y 11d9246288SBernhard SchmidtCONFIG_INTERNAL_DES=y 12d9246288SBernhard SchmidtCONFIG_INTERNAL_MD4=y 13d9246288SBernhard SchmidtCONFIG_INTERNAL_MD5=y 14d9246288SBernhard SchmidtCONFIG_INTERNAL_RC4=y 15d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA1=y 16f05cddf9SRui PauloNEED_SHA256=y 17d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA256=y 18d9246288SBernhard SchmidtCONFIG_INTERNAL_TLS=y 19f05cddf9SRui PauloCONFIG_INTERNAL_DH5=y 20f05cddf9SRui PauloCONFIG_INTERNAL_DH=y 21d9246288SBernhard SchmidtNEED_AES_ENC=true 22*325151a3SRui PauloNEED_AES_CBC=true 23d9246288SBernhard Schmidt.endif 24d9246288SBernhard Schmidt 25d9246288SBernhard Schmidt.if defined(TLS_FUNCS) 26d9246288SBernhard SchmidtNEED_TLS_PRF=y 27d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_TLS) 28d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ 29d9246288SBernhard Schmidt -DCONFIG_TLS_INTERNAL_CLIENT 30d9246288SBernhard SchmidtSRCS+= asn1.c \ 31d9246288SBernhard Schmidt bignum.c \ 32d9246288SBernhard Schmidt crypto_internal-cipher.c \ 33d9246288SBernhard Schmidt crypto_internal-modexp.c \ 34d9246288SBernhard Schmidt crypto_internal-rsa.c \ 35d9246288SBernhard Schmidt pkcs1.c \ 36d9246288SBernhard Schmidt pkcs5.c \ 37d9246288SBernhard Schmidt pkcs8.c \ 38d9246288SBernhard Schmidt rsa.c \ 39d9246288SBernhard Schmidt tls_internal.c \ 40d9246288SBernhard Schmidt tlsv1_common.c \ 41d9246288SBernhard Schmidt tlsv1_record.c \ 42d9246288SBernhard Schmidt tlsv1_cred.c \ 43d9246288SBernhard Schmidt tlsv1_client.c \ 44d9246288SBernhard Schmidt tlsv1_client_write.c \ 45d9246288SBernhard Schmidt tlsv1_client_read.c \ 46d9246288SBernhard Schmidt x509v3.c 47d9246288SBernhard SchmidtNEED_DES=y 48d9246288SBernhard SchmidtNEED_MD4=y 49d9246288SBernhard SchmidtNEED_RC4=y 50d9246288SBernhard Schmidt.else 51d9246288SBernhard SchmidtCFLAGS+=-DEAP_TLS_OPENSSL 52d9246288SBernhard SchmidtSRCS+= tls_openssl.c 53d9246288SBernhard Schmidt.endif 54d9246288SBernhard Schmidt.endif 55d9246288SBernhard Schmidt 56d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_AES) 57cd4308d2SRui PauloSRCS+= aes-unwrap.c aes-wrap.c \ 58cd4308d2SRui Paulo aes-internal.c \ 59d9246288SBernhard Schmidt aes-internal-dec.c \ 60d9246288SBernhard Schmidt aes-internal-enc.c 61d9246288SBernhard Schmidt.endif 62d9246288SBernhard Schmidt 63d9246288SBernhard Schmidt.if defined(NEED_AES_CBC) 64d9246288SBernhard SchmidtSRCS+= aes-cbc.c 65d9246288SBernhard Schmidt.endif 66d9246288SBernhard Schmidt 67d9246288SBernhard Schmidt.if defined(NEED_AES_EAX) 68d9246288SBernhard SchmidtSRCS+= aes-eax.c 69d9246288SBernhard SchmidtNEED_AES_CTR=y 70d9246288SBernhard Schmidt.endif 71d9246288SBernhard Schmidt 72d9246288SBernhard Schmidt.if defined(NEED_AES_CTR) 73d9246288SBernhard SchmidtSRCS+= aes-ctr.c 74d9246288SBernhard Schmidt.endif 75d9246288SBernhard Schmidt 76d9246288SBernhard Schmidt.if defined(NEED_AES_ENCBLOCK) 77d9246288SBernhard SchmidtSRCS+= aes-encblock.c 78d9246288SBernhard Schmidt.endif 79d9246288SBernhard Schmidt 80d9246288SBernhard Schmidt.if defined(NEED_AES_OMAC1) 81d9246288SBernhard SchmidtSRCS+= aes-omac1.c 82d9246288SBernhard Schmidt.endif 83d9246288SBernhard Schmidt 84d9246288SBernhard Schmidt.if defined(NEED_DES) 85d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_DES) 86d9246288SBernhard SchmidtSRCS+= des-internal.c 87d9246288SBernhard Schmidt.endif 88d9246288SBernhard Schmidt.endif 89d9246288SBernhard Schmidt 90d9246288SBernhard Schmidt.if defined(NEED_MD4) 91d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD4) 92d9246288SBernhard SchmidtSRCS+= md4-internal.c 93d9246288SBernhard Schmidt.endif 94d9246288SBernhard Schmidt.endif 95d9246288SBernhard Schmidt 96d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD5) 97cd4308d2SRui PauloSRCS+= md5.c md5-internal.c 98d9246288SBernhard Schmidt.endif 99d9246288SBernhard Schmidt 100d9246288SBernhard Schmidt.if defined(NEED_FIPS186_2_PRF) 101d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1) 102d9246288SBernhard SchmidtSRCS+= fips_prf_internal.c 103d9246288SBernhard Schmidt.else 104d9246288SBernhard SchmidtSRCS+= fips_prf_openssl.c 105d9246288SBernhard Schmidt.endif 106d9246288SBernhard Schmidt.endif 107d9246288SBernhard Schmidt 108d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_RC4) 109d9246288SBernhard SchmidtSRCS+= rc4.c 110d9246288SBernhard Schmidt.endif 111d9246288SBernhard Schmidt 112d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1) 113f05cddf9SRui PauloSRCS+= sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c 114d9246288SBernhard Schmidt.endif 115d9246288SBernhard Schmidt 116d9246288SBernhard Schmidt.if defined(NEED_SHA256) 117d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_SHA256 118d9246288SBernhard SchmidtSRCS+= sha256.c 119d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA256) 120f05cddf9SRui PauloSRCS+= sha256-internal.c sha256-prf.c 121d9246288SBernhard Schmidt.endif 122d9246288SBernhard Schmidt.endif 123d9246288SBernhard Schmidt 124d9246288SBernhard Schmidt.if defined(NEED_TLS_PRF) 125d9246288SBernhard SchmidtSRCS+= sha1-tlsprf.c 126d9246288SBernhard Schmidt.endif 127f05cddf9SRui Paulo 128f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH5) 129f05cddf9SRui PauloSRCS+= dh_group5.c 130f05cddf9SRui Paulo.endif 131f05cddf9SRui Paulo 132f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH) 133f05cddf9SRui PauloSRCS+= dh_groups.c 134f05cddf9SRui Paulo.endif 135