Files
Gordon Tetlow ba9a5169d1 openssl: build libcrypto and libssl from upstream's source set
Compared the bmake source lists of libcrypto and libssl with upstream's
own build of 3.5.8 (configured with the options in
crypto/openssl/BSDmakefile), and fix the differences that are not
intentional.

libcrypto:
- aarch64: build bsaes-armv8.S and md5-aarch64.S, and define BSAES_ASM
  and MD5_ASM, as upstream does.  Both files have been generated into
  sys/crypto/openssl/aarch64 since the 3.5.1 import, but were never
  compiled.
- Stop compiling der_digests_gen.c, der_dsa_key.c and der_ec_key.c.
  Upstream keeps them in libcommon.a, but the linker does not extract
  them into libcrypto (checked with --why-extract) as nothing in
  libcrypto references them.

libssl:
- Fix the "SRSC" typo that left out ssl3_cbc.c and tls_pad.c.
- Build libssl's own copy of crypto/thread/arch*.c, as upstream does.
  Before this change, libssl got these functions from libcrypto, which
  exports them only for this purpose.  A planned later change removes
  those exports.

crypto/openssl:
- crypto/bio/bio_sock2.c: remove the local ktls_enable() call in
  BIO_socket() it does nothing on FreeBSD.  The file is now identical
  to upstream.
- Remove the empty file "patch", committed by mistake in f775385aff.

With this change, libssl no longer imports any libcrypto internals.

Reviewed by:	ngie, markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D60395
2026-10-08 11:25:57 -07:00

107 lines
2.5 KiB
Makefile

.include <src.opts.mk>
LIB= ssl
SHLIB_MAJOR= 35
VERSION_MAP= ${.CURDIR}/Version.map
NO_LINT=
PCFILES= libssl.pc openssl.pc
.include "../libcrypto/Makefile.inc"
SRCS= pqueue.c \
statem_srvr.c statem_clnt.c s3_lib.c s3_enc.c \
statem_lib.c extensions.c extensions_srvr.c \
extensions_clnt.c extensions_cust.c s3_msg.c \
methods.c t1_lib.c t1_enc.c tls13_enc.c \
d1_lib.c d1_msg.c \
statem_dtls.c d1_srtp.c \
ssl_lib.c ssl_cert.c ssl_sess.c \
ssl_ciph.c ssl_stat.c ssl_rsa.c \
ssl_asn1.c ssl_txt.c ssl_init.c ssl_conf.c ssl_mcnf.c \
bio_ssl.c ssl_err_legacy.c tls_srp.c t1_trce.c ssl_utst.c \
statem.c \
ssl_cert_comp.c \
tls_depr.c
SRCS+= packet.c quic_vlint.c time.c
SRCS+= ssl_rsa_legacy.c
SRCS+= priority_queue.c
SRCS+= hashfunc.c
SRCS+= siphash.c
# crypto/thread: libssl has its own copy, as upstream does
SRCS+= arch.c thread_none.c thread_posix.c thread_win.c
# quic
SRCS+= quic_method.c quic_impl.c quic_wire.c quic_ackm.c quic_statm.c
SRCS+= cc_newreno.c quic_demux.c quic_record_rx.c
SRCS+= quic_record_tx.c quic_record_util.c quic_record_shared.c quic_wire_pkt.c
SRCS+= quic_rx_depack.c
SRCS+= quic_fc.c uint_set.c
SRCS+= quic_cfq.c quic_txpim.c quic_fifd.c quic_txp.c
SRCS+= quic_stream_map.c
SRCS+= quic_rstream.c quic_sstream.c
SRCS+= quic_reactor.c
SRCS+= quic_reactor_wait_ctx.c
SRCS+= quic_channel.c quic_port.c quic_engine.c
SRCS+= quic_tserver.c
SRCS+= quic_thread_assist.c
SRCS+= quic_trace.c
SRCS+= quic_srtm.c quic_srt_gen.c
SRCS+= quic_lcidm.c quic_rcidm.c
SRCS+= quic_tls.c quic_tls_api.c
SRCS+= quic_types.c
SRCS+= qlog_event_helpers.c
SRCS+= json_enc.c qlog.c
SRCS+= getenv.c ctype.c
SRCS+= quic_obj.c
SRCS+= quic_strm_reas.c
# rbtree
SRCS+= rbtree.c
# record
SRCS+= rec_layer_d1.c rec_layer_s3.c
# record/methods
SRCS+= tls_common.c ssl3_meth.c tls1_meth.c tls13_meth.c tlsany_meth.c
SRCS+= dtls_meth.c tls_multib.c
SRCS+= ssl3_cbc.c
SRCS+= tls_pad.c
# rio
SRCS+= poll_immediate.c
SRCS+= rio_notifier.c poll_builder.c
.if ${MK_OPENSSL_KTLS} == "no" || defined(BOOTSTRAPPING)
CFLAGS+=-DOPENSSL_NO_KTLS
.else
SRCS+= ktls_meth.c
.endif
LIBADD= pthread crypto
CFLAGS+= -I${LCRYPTO_SRC}/ssl
CFLAGS+= -I${.OBJDIR:H}/libcrypto
.include <bsd.lib.mk>
PICFLAG+= -DOPENSSL_PIC
.PATH: ${LCRYPTO_SRC}/crypto \
${LCRYPTO_SRC}/crypto/hashtable \
${LCRYPTO_SRC}/crypto/rbtree \
${LCRYPTO_SRC}/crypto/siphash \
${LCRYPTO_SRC}/crypto/thread \
${LCRYPTO_SRC}/crypto/thread/arch \
${LCRYPTO_SRC}/ssl \
${LCRYPTO_SRC}/ssl/quic \
${LCRYPTO_SRC}/ssl/record \
${LCRYPTO_SRC}/ssl/record/methods \
${LCRYPTO_SRC}/ssl/rio \
${LCRYPTO_SRC}/ssl/statem