1d9246288SBernhard Schmidt# $FreeBSD$ 2d9246288SBernhard Schmidt 3d9246288SBernhard Schmidt.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) 4*f05cddf9SRui PauloSRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c 5d9246288SBernhard SchmidtDPADD+= ${LIBSSL} ${LIBCRYPTO} 6d9246288SBernhard SchmidtLDADD+= -lssl -lcrypto 7*f05cddf9SRui PauloCFLAGS+= -DCONFIG_SHA256 8d9246288SBernhard Schmidt.else 9d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_CRYPTO_INTERNAL 10*f05cddf9SRui PauloSRCS+= crypto_internal.c random.c 11d9246288SBernhard SchmidtCONFIG_INTERNAL_AES=y 12d9246288SBernhard SchmidtCONFIG_INTERNAL_DES=y 13d9246288SBernhard SchmidtCONFIG_INTERNAL_MD4=y 14d9246288SBernhard SchmidtCONFIG_INTERNAL_MD5=y 15d9246288SBernhard SchmidtCONFIG_INTERNAL_RC4=y 16d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA1=y 17*f05cddf9SRui PauloNEED_SHA256=y 18d9246288SBernhard SchmidtCONFIG_INTERNAL_SHA256=y 19d9246288SBernhard SchmidtCONFIG_INTERNAL_TLS=y 20*f05cddf9SRui PauloCONFIG_INTERNAL_DH5=y 21*f05cddf9SRui PauloCONFIG_INTERNAL_DH=y 22d9246288SBernhard SchmidtNEED_AES_ENC=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) 57d9246288SBernhard SchmidtSRCS+= aes-internal.c \ 58d9246288SBernhard Schmidt aes-internal-dec.c \ 59d9246288SBernhard Schmidt aes-internal-enc.c 60d9246288SBernhard Schmidt.endif 61d9246288SBernhard Schmidt 62d9246288SBernhard Schmidt.if defined(NEED_AES_CBC) 63d9246288SBernhard SchmidtSRCS+= aes-cbc.c 64d9246288SBernhard Schmidt.endif 65d9246288SBernhard Schmidt 66d9246288SBernhard Schmidt.if defined(NEED_AES_EAX) 67d9246288SBernhard SchmidtSRCS+= aes-eax.c 68d9246288SBernhard SchmidtNEED_AES_CTR=y 69d9246288SBernhard Schmidt.endif 70d9246288SBernhard Schmidt 71d9246288SBernhard Schmidt.if defined(NEED_AES_CTR) 72d9246288SBernhard SchmidtSRCS+= aes-ctr.c 73d9246288SBernhard Schmidt.endif 74d9246288SBernhard Schmidt 75d9246288SBernhard Schmidt.if defined(NEED_AES_ENCBLOCK) 76d9246288SBernhard SchmidtSRCS+= aes-encblock.c 77d9246288SBernhard Schmidt.endif 78d9246288SBernhard Schmidt 79d9246288SBernhard Schmidt.if defined(NEED_AES_OMAC1) 80d9246288SBernhard SchmidtSRCS+= aes-omac1.c 81d9246288SBernhard Schmidt.endif 82d9246288SBernhard Schmidt 83d9246288SBernhard Schmidt.if defined(NEED_DES) 84d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_DES) 85d9246288SBernhard SchmidtSRCS+= des-internal.c 86d9246288SBernhard Schmidt.endif 87d9246288SBernhard Schmidt.endif 88d9246288SBernhard Schmidt 89d9246288SBernhard Schmidt.if defined(NEED_MD4) 90d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD4) 91d9246288SBernhard SchmidtSRCS+= md4-internal.c 92d9246288SBernhard Schmidt.endif 93d9246288SBernhard Schmidt.endif 94d9246288SBernhard Schmidt 95d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_MD5) 96d9246288SBernhard SchmidtSRCS+= md5-internal.c 97d9246288SBernhard Schmidt.endif 98d9246288SBernhard Schmidt 99d9246288SBernhard Schmidt.if defined(NEED_FIPS186_2_PRF) 100d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1) 101d9246288SBernhard SchmidtSRCS+= fips_prf_internal.c 102d9246288SBernhard Schmidt.else 103d9246288SBernhard SchmidtSRCS+= fips_prf_openssl.c 104d9246288SBernhard Schmidt.endif 105d9246288SBernhard Schmidt.endif 106d9246288SBernhard Schmidt 107d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_RC4) 108d9246288SBernhard SchmidtSRCS+= rc4.c 109d9246288SBernhard Schmidt.endif 110d9246288SBernhard Schmidt 111d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA1) 112*f05cddf9SRui PauloSRCS+= sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c 113d9246288SBernhard Schmidt.endif 114d9246288SBernhard Schmidt 115d9246288SBernhard Schmidt.if defined(NEED_SHA256) 116d9246288SBernhard SchmidtCFLAGS+=-DCONFIG_SHA256 117d9246288SBernhard SchmidtSRCS+= sha256.c 118d9246288SBernhard Schmidt.if defined(CONFIG_INTERNAL_SHA256) 119*f05cddf9SRui PauloSRCS+= sha256-internal.c sha256-prf.c 120d9246288SBernhard Schmidt.endif 121d9246288SBernhard Schmidt.endif 122d9246288SBernhard Schmidt 123d9246288SBernhard Schmidt.if defined(NEED_TLS_PRF) 124d9246288SBernhard SchmidtSRCS+= sha1-tlsprf.c 125d9246288SBernhard Schmidt.endif 126*f05cddf9SRui Paulo 127*f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH5) 128*f05cddf9SRui PauloSRCS+= dh_group5.c 129*f05cddf9SRui Paulo.endif 130*f05cddf9SRui Paulo 131*f05cddf9SRui Paulo.if defined(CONFIG_INTERNAL_DH) 132*f05cddf9SRui PauloSRCS+= dh_groups.c 133*f05cddf9SRui Paulo.endif 134