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