freebsd-ports/security/openssl/Makefile

236 lines
6.2 KiB
Makefile
Raw Normal View History

2013-01-26 17:34:39 +01:00
# Created by: Dirk Froemberg <dirk@FreeBSD.org>
1999-08-31 03:53:22 +02:00
# $FreeBSD$
PORTNAME= openssl
2012-04-11 23:06:35 +02:00
PORTVERSION= 1.0.1
DISTVERSIONSUFFIX= h
PORTREVISION= 13
CATEGORIES= security devel
MASTER_SITES= http://www.openssl.org/%SUBDIR%/ \
ftp://ftp.openssl.org/%SUBDIR%/ \
ftp://ftp.cert.dfn.de/pub/tools/net/openssl/%SUBDIR%/
2008-03-29 12:27:32 +01:00
MASTER_SITE_SUBDIR= source
DIST_SUBDIR= ${DISTNAME}
- Update to 0.9.6c - more manpages - shift FORBIDDEN Excerpt of Changes between 0.9.6b and 0.9.6c [21 dec 2001] *) Fix BN_rand_range bug pointed out by Dominikus Scherkl *) Only add signing time to PKCS7 structures if it is not already present. *) Fix crypto/objects/objects.h: "ld-ce" should be "id-ce", OBJ_ld_ce should be OBJ_id_ce. Also some ip-pda OIDs in crypto/objects/objects.txt were incorrect (cf. RFC 3039). *) Release CRYPTO_LOCK_DYNLOCK when CRYPTO_destroy_dynlockid() returns early because it has nothing to do. *) Fix mutex callback return values in crypto/engine/hw_ncipher.c. *) Change ssl/s2_clnt.c and ssl/s2_srvr.c so that received handshake messages are stored in a single piece (fixed-length part and variable-length part combined) and fix various bugs found on the way. *) Disable caching in BIO_gethostbyname(), directly use gethostbyname() instead. BIO_gethostbyname() does not know what timeouts are appropriate, so entries would stay in cache even when they have become invalid. *) Change ssl23_get_client_hello (ssl/s23_srvr.c) behaviour when faced with a pathologically small ClientHello fragment that does not contain client_version: Instead of aborting with an error, simply choose the highest available protocol version (i.e., TLS 1.0 unless it is disabled). *) Fix SSL handshake functions and SSL_clear() such that SSL_clear() never resets s->method to s->ctx->method when called from within one of the SSL handshake functions. *) In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert (sent using the client's version number) if client_version is smaller than the protocol version in use. Also change ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0 if the client demanded SSL 3.0 but only TLS 1.0 is enabled; then the client will at least see that alert. *) Fix ssl3_get_message (ssl/s3_both.c) to handle message fragmentation correctly. *) Avoid infinite loop in ssl3_get_message (ssl/s3_both.c) if a client receives HelloRequest while in a handshake. *) Bugfix in ssl3_accept (ssl/s3_srvr.c): Case SSL3_ST_SW_HELLO_REQ_C should end in 'break', not 'goto end' which circuments various cleanups done in state SSL_ST_OK. But session related stuff must be disabled for SSL_ST_OK in the case that we just sent a HelloRequest. Also avoid some overhead by not calling ssl_init_wbio_buffer() before just sending a HelloRequest. *) Fix ssl/s3_enc.c, ssl/t1_enc.c and ssl/s3_pkt.c so that we don't reveal whether illegal block cipher padding was found or a MAC verification error occured. (Neither SSLerr() codes nor alerts are directly visible to potential attackers, but the information may leak via logfiles.) ssl/s2_pkt.c failed to verify that the purported number of padding bytes is in the legal range. *) Improve RSA_padding_check_PKCS1_OAEP() check again to avoid 'wristwatch attack' using huge encoding parameters (cf. James H. Manger's CRYPTO 2001 paper). Note that the RSA_PKCS1_OAEP_PADDING case of RSA_private_decrypt() does not use encoding parameters and hence was not vulnerable. *) BN_sqr() bug fix. *) Rabin-Miller test analyses assume uniformly distributed witnesses, so use BN_pseudo_rand_range() instead of using BN_pseudo_rand() followed by modular reduction. *) Add BN_pseudo_rand_range() with obvious functionality: BN_rand_range() equivalent based on BN_pseudo_rand() instead of BN_rand(). *) s3_srvr.c: allow sending of large client certificate lists (> 16 kB). This function was broken, as the check for a new client hello message to handle SGC did not allow these large messages. *) Add alert descriptions for TLSv1 to SSL_alert_desc_string[_long](). *) Fix buggy behaviour of BIO_get_num_renegotiates() and BIO_ctrl() for BIO_C_GET_WRITE_BUF_SIZE ("Stephen Hinton" <shinton@netopia.com>). *) In ssl3_get_key_exchange (ssl/s3_clnt.c), call ssl3_get_message() with the same message size as in ssl3_get_certificate_request(). Otherwise, if no ServerKeyExchange message occurs, CertificateRequest messages might inadvertently be reject as too long. *) Modified SSL library such that the verify_callback that has been set specificly for an SSL object with SSL_set_verify() is actually being used. Before the change, a verify_callback set with this function was ignored and the verify_callback() set in the SSL_CTX at the time of the call was used. New function X509_STORE_CTX_set_verify_cb() introduced to allow the necessary settings. *) In OpenSSL 0.9.6a and 0.9.6b, crypto/dh/dh_key.c ignored dh->length and always used BN_rand_range(priv_key, dh->p). So switch back to BN_rand(priv_key, l, ...) where 'l' is dh->length if this is defined, or BN_num_bits(dh->p)-1 otherwise. *) In RSA_eay_public_encrypt, RSA_eay_private_decrypt, RSA_eay_private_encrypt RSA_eay_public_decrypt always reject numbers >= n. *) In crypto/rand/md_rand.c, use a new short-time lock CRYPTO_LOCK_RAND2 to synchronize access to 'locking_thread'. *) In crypto/rand/md_rand.c, set 'locking_thread' to current thread's ID *before* setting the 'crypto_lock_rand' flag. The previous code had a race condition if 0 is a valid thread ID.
2002-04-21 15:02:08 +02:00
MAINTAINER= dinoex@FreeBSD.org
2003-02-20 19:26:42 +01:00
COMMENT= SSL and crypto library
.ifdef USE_OPENSSL
.error You have `USE_OPENSSL' variable defined either in environment or in make(1) arguments. Please undefine and try again.
.endif
OPTIONS_DEFINE= SHARED THREADS I386 SSE2 ASM PADLOCK ZLIB SCTP MD2 RC5 RFC3779 GMP
OPTIONS_DEFAULT=SHARED THREADS SSE2 ASM ZLIB SCTP MD2
.for a in amd64 ia64
OPTIONS_DEFINE_${a}= EC
OPTIONS_DEFAULT_${a}= EC
.endfor
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == "mips64el"
OPTIONS_DEFINE_mips= EC
OPTIONS_DEFAULT_mips= EC
.endif
NO_OPTIONS_SORT=yes
OPTIONS_SUB= yes
I386_DESC?= Optimize for i386 (instead of i486+)
SSE2_DESC?= runtime SSE2 detection
ASM_DESC?= optimized Assembler code
PADLOCK_DESC?= VIA Padlock support
SHARED_DESC?= build of shared libs
ZLIB_DESC?= zlib compression support
SCTP_DESC?= SCTP protocol support
MD2_DESC?= MD2 hash (obsolete)
RC5_DESC?= RC5 cipher (patented)
RFC3779_DESC?= RFC3779 support
GMP_DESC?= gmp support (LGPLv3)
EC_DESC?= Optimize NIST elliptic curves
GMP_LIB_DEPENDS= libgmp.so:${PORTSDIR}/math/gmp
MAKE_JOBS_UNSAFE= yes
2003-02-09 06:45:04 +01:00
NOPRECIOUSMAKEVARS= Too many _MLINKS for fetch
NOPRECIOUSSOFTMAKEVARS= Too many _MLINKS for fetch
USES= perl5 cpe
USE_PERL5= build
MAKE_ARGS+= WHOLE_ARCHIVE_FLAG=--whole-archive
2014-03-28 19:23:44 +01:00
MAKE_ENV+= LIBRPATH="${PREFIX}/lib" GREP_OPTIONS=
SUB_FILES= pkg-message
OPENSSLDIR= ${PREFIX}/openssl
FIX_POD=apps/cms.pod \
apps/smime.pod \
ssl/SSL_COMP_add_compression_method.pod \
ssl/SSL_CTX_add_session.pod \
ssl/SSL_CTX_load_verify_locations.pod \
ssl/SSL_CTX_set_client_CA_list.pod \
ssl/SSL_CTX_set_session_id_context.pod \
ssl/SSL_CTX_set_ssl_version.pod \
ssl/SSL_CTX_use_psk_identity_hint.pod \
ssl/SSL_accept.pod \
ssl/SSL_clear.pod \
ssl/SSL_connect.pod \
ssl/SSL_do_handshake.pod \
ssl/SSL_read.pod \
ssl/SSL_session_reused.pod \
ssl/SSL_set_fd.pod \
ssl/SSL_set_session.pod \
ssl/SSL_shutdown.pod \
ssl/SSL_write.pod
.include <bsd.port.pre.mk>
.if ${PREFIX} == /usr
IGNORE= OpenSSL can not be installed over the base version
.endif
2007-08-06 12:39:24 +02:00
OPENSSL_BASE_SONAME!= readlink ${DESTDIR}/usr/lib/libcrypto.so || true
OPENSSL_SHLIBVER_BASE= ${OPENSSL_BASE_SONAME:E}
OPENSSL_BASE_SOPATH= ${OPENSSL_BASE_SONAME:H}
2012-04-11 23:06:35 +02:00
OPENSSL_SHLIBVER?= 8
.if ${PORT_OPTIONS:MI386}
.if ${ARCH} == "i386"
EXTRACONFIGURE+= 386
.endif
.endif
.if empty(PORT_OPTIONS:MSSE2)
# disable runtime SSE2 detection
EXTRACONFIGURE+= no-sse2
.endif
.if ${PORT_OPTIONS:MASM}
EXTRACONFIGURE+= enable-asm
.else
EXTRACONFIGURE+= no-asm
2010-04-06 21:16:05 +02:00
.endif
.if ${PORT_OPTIONS:MTHREADS}
EXTRACONFIGURE+= threads
.else
EXTRACONFIGURE+= no-threads
.endif
.if ${PORT_OPTIONS:MSHARED}
EXTRACONFIGURE+= shared
MAKE_ENV+= SHLIBVER=${OPENSSL_SHLIBVER}
PLIST_SUB+= SHLIBVER=${OPENSSL_SHLIBVER}
2007-02-12 04:39:09 +01:00
USE_LDCONFIG= yes
.endif
.if ${PORT_OPTIONS:MZLIB}
EXTRACONFIGURE+= zlib zlib-dynamic
.else
EXTRACONFIGURE+= no-zlib no-zlib-dynamic
.endif
.if ${PORT_OPTIONS:MSCTP}
2012-04-11 23:06:35 +02:00
EXTRACONFIGURE+= sctp
.else
EXTRACONFIGURE+= no-sctp
.endif
.if ${PORT_OPTIONS:MMD2}
EXTRACONFIGURE+= enable-md2
.else
EXTRACONFIGURE+= no-md2
.endif
.if ${PORT_OPTIONS:MRC5}
EXTRACONFIGURE+= enable-rc5
.else
EXTRACONFIGURE+= no-rc5
.endif
.if ${PORT_OPTIONS:MPADLOCK}
#BROKEN= does not build with openssl-1.0.1f
PATCH_DIST_STRIP= -p1
PATCH_SITES+= http://git.alpinelinux.org/cgit/aports/plain/main/openssl/:padlock
PATCHFILES+= 0001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch:padlock \
0002-engines-e_padlock-backport-cvs-head-changes.patch:padlock \
0003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch:padlock \
0004-crypto-engine-autoload-padlock-dynamic-engine.patch:padlock
.endif
.if ${PORT_OPTIONS:MGMP}
EXTRACONFIGURE+= enable-gmp -I${LOCALBASE}/include
IGNORE= GMP is LGPLv3 and can not be linked
.else
EXTRACONFIGURE+= no-gmp
.endif
.if ${PORT_OPTIONS:MRFC3779}
EXTRACONFIGURE+= enable-rfc3779
.else
EXTRACONFIGURE+= no-rfc3779
.endif
.if ${PORT_OPTIONS:MEC}
EXTRACONFIGURE+= enable-ec_nistp_64_gcc_128
.else
EXTRACONFIGURE+= no-ec_nistp_64_gcc_128
.endif
.if ${OPENSSL_SHLIBVER_BASE} > ${OPENSSL_SHLIBVER}
pre-everything::
@${ECHO_CMD} "#"
@${ECHO_CMD} "# this ports conflicts with your base system"
@${ECHO_CMD} "# please undefine OPENSSL_OVERWRITE_PORT"
@${ECHO_CMD} "# and use WITH_OPENSSL_BASE=yes instead."
@${ECHO_CMD} "#"
@${FALSE}
.endif
post-patch:
${REINPLACE_CMD} -E -e 's|^=item ([0-9])[[:blank:]]*$$|=item Z<>\1|' \
${FIX_POD:S,^,${WRKSRC}/doc/,}
${REINPLACE_CMD} -e 's|m4 -B 8192|m4|g' \
${WRKSRC}/crypto/des/Makefile
${REINPLACE_CMD} -e 's|SHLIB_VERSION_NUMBER "1.0.0"|SHLIB_VERSION_NUMBER "${OPENSSL_SHLIBVER}"|' \
${WRKSRC}/crypto/opensslv.h
do-configure:
${REINPLACE_CMD} -e "s|options 386|options|" \
${WRKSRC}/config
.if ${PORT_OPTIONS:MTHREADS}
cd ${WRKSRC} \
&& ${SETENV} CC="${CC}" FREEBSDCC="${CC}" CFLAGS="${CFLAGS}" PERL="${PERL}" \
PTHREAD_CFLAGS=${PTHREAD_CFLAGS} PTHREAD_LIBS=${PTHREAD_LIBS} \
./config --prefix=${PREFIX} --openssldir=${OPENSSLDIR} \
--install_prefix=${STAGEDIR} \
-L${PREFIX}/lib ${EXTRACONFIGURE}
.else
cd ${WRKSRC} \
&& ${SETENV} CC="${CC}" FREEBSDCC="${CC}" CFLAGS="${CFLAGS}" PERL="${PERL}" \
./config --prefix=${PREFIX} --openssldir=${OPENSSLDIR} \
--install_prefix=${STAGEDIR} \
-L${PREFIX}/lib ${EXTRACONFIGURE}
.endif
${REINPLACE_CMD} \
2014-03-04 07:51:37 +01:00
-e 's|^MANDIR=.*$$|MANDIR=$$(PREFIX)/man|' \
-e 's|$$(LIBDIR)/pkgconfig|libdata/pkgconfig|g' \
-e 's|LIBVERSION=[^ ]* |LIBVERSION=$(OPENSSL_SHLIBVER) |' \
${WRKSRC}/Makefile
post-install:
.if ${PORT_OPTIONS:MSHARED}
.for i in libcrypto libssl
${INSTALL_DATA} ${WRKSRC}/$i.so.${OPENSSL_SHLIBVER} ${STAGEDIR}${PREFIX}/lib
${LN} -sf $i.so.${OPENSSL_SHLIBVER} ${STAGEDIR}${PREFIX}/lib/$i.so
.endfor
.endif
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/doc/openssl.txt ${STAGEDIR}${DOCSDIR}/
.endif
${SED} -e 's|/usr/local|${PREFIX}|g' ${PKGMESSAGE}
test: build
cd ${WRKSRC} && ${MAKE} test
2006-06-24 10:27:11 +02:00
regression-test: test
.include <bsd.port.post.mk>