aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/coverity.yml2
-rw-r--r--.github/workflows/rust-openssl.yml4
-rw-r--r--.github/workflows/windows.yml7
-rw-r--r--.gitignore119
-rw-r--r--CMakeLists.txt45
-rw-r--r--COPYING133
-rw-r--r--ChangeLog52
-rw-r--r--Makefile.am15
-rw-r--r--Makefile.am.common15
-rw-r--r--apps/CMakeLists.txt15
-rw-r--r--apps/nc/CMakeLists.txt15
-rw-r--r--apps/nc/Makefile.am15
-rw-r--r--apps/ocspcheck/CMakeLists.txt15
-rw-r--r--apps/ocspcheck/Makefile.am15
-rw-r--r--apps/openssl/CMakeLists.txt15
-rw-r--r--apps/openssl/Makefile.am15
-rwxr-xr-xcheck-release.sh15
-rw-r--r--cmake_export_symbol.cmake15
-rw-r--r--cmake_uninstall.cmake.in15
-rw-r--r--configure.ac3
-rw-r--r--crypto/CMakeLists.txt88
-rw-r--r--crypto/Makefile.am58
-rw-r--r--crypto/Makefile.am.elf-arm18
-rw-r--r--crypto/Makefile.am.elf-x86_647
-rw-r--r--crypto/Makefile.am.macosx-x86_647
-rw-r--r--crypto/Makefile.am.masm-x86_645
-rw-r--r--crypto/Makefile.am.mingw64-x86_645
-rw-r--r--crypto/arch/aarch64/crypto_cpu_caps_darwin.c60
-rw-r--r--crypto/arch/aarch64/crypto_cpu_caps_linux.c62
-rw-r--r--crypto/arch/aarch64/crypto_cpu_caps_none.c26
-rw-r--r--crypto/arch/aarch64/crypto_cpu_caps_windows.c36
-rw-r--r--crypto/compat/.gitignore31
-rw-r--r--crypto/compat/b_win.c5
-rw-r--r--crypto/compat/posix_win.c85
-rwxr-xr-xdist.sh15
-rwxr-xr-xgen-coverage-report.sh15
-rw-r--r--include/CMakeLists.txt15
-rw-r--r--include/Makefile.am16
-rw-r--r--include/arch/loongarch64/opensslconf.h131
-rw-r--r--include/arch/mips/opensslconf.h131
-rw-r--r--include/compat/sys/stat.h8
-rw-r--r--libcrypto.pc.in15
-rw-r--r--libssl.pc.in15
-rw-r--r--libtls.pc.in15
-rw-r--r--m4/check-libc.m415
-rw-r--r--m4/check-os-options.m421
-rw-r--r--m4/disable-compiler-warnings.m415
-rw-r--r--man/CMakeLists.txt15
-rw-r--r--man/links92
-rw-r--r--patches/aarch64_crypto_arch.h.patch16
-rw-r--r--patches/amd64_crypto_arch.h.patch18
-rw-r--r--patches/crypto_arch.h.patch34
-rw-r--r--patches/modes_local.h.patch18
-rw-r--r--patches/netcat.c.patch28
-rw-r--r--patches/openssl.c.patch6
-rw-r--r--patches/opensslfeatures.h.patch11
-rw-r--r--patches/patch-aarch64-crypto-cpu-caps.c.patch39
-rw-r--r--patches/patch-i386-crypto-cpu-caps.c.patch8
-rw-r--r--patches/speed.c.patch26
-rw-r--r--ssl/CMakeLists.txt15
-rw-r--r--ssl/Makefile.am17
-rw-r--r--tests/CMakeLists.txt50
-rw-r--r--tests/Makefile.am36
-rwxr-xr-xtests/aeadtest.sh15
-rwxr-xr-xtests/arc4randomforktest.sh15
-rw-r--r--tests/cmake/CMakeLists.txt15
-rw-r--r--tests/compat/pipe2.c19
-rwxr-xr-xtests/dtlstest.sh15
-rwxr-xr-xtests/evptest.sh15
-rwxr-xr-xtests/keypairtest.sh15
-rwxr-xr-xtests/mlkem_tests.sh15
-rw-r--r--tests/ocsptest.bat15
-rwxr-xr-xtests/ocsptest.sh15
-rwxr-xr-xtests/pidwraptest.sh15
-rw-r--r--tests/pq_test.bat15
-rwxr-xr-xtests/pq_test.sh9
-rw-r--r--tests/quictest.bat15
-rwxr-xr-xtests/quictest.sh15
-rw-r--r--tests/renegotiation_test.bat15
-rwxr-xr-xtests/renegotiation_test.sh15
-rw-r--r--tests/servertest.bat15
-rwxr-xr-xtests/servertest.sh15
-rw-r--r--tests/shutdowntest.bat15
-rwxr-xr-xtests/shutdowntest.sh15
-rw-r--r--tests/ssltest.bat15
-rwxr-xr-xtests/ssltest.sh15
-rw-r--r--tests/testdsa.bat18
-rwxr-xr-xtests/testdsa.sh16
-rw-r--r--tests/testenc.bat15
-rwxr-xr-xtests/testenc.sh15
-rw-r--r--tests/testrsa.bat18
-rwxr-xr-xtests/testrsa.sh16
-rw-r--r--tests/testssl.bat15
-rw-r--r--tests/tlstest.bat15
-rwxr-xr-xtests/tlstest.sh15
-rw-r--r--tls/CMakeLists.txt15
-rw-r--r--tls/Makefile.am17
-rwxr-xr-xupdate.sh38
98 files changed, 1723 insertions, 727 deletions
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
index 8d0ad11..ae43398 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -31,7 +31,7 @@ jobs:
31 PROJECT: "libressl-portable%2Fportable" 31 PROJECT: "libressl-portable%2Fportable"
32 COVERITY_SCAN_TOKEN: "${{ secrets.COVERITY_SCAN_TOKEN }}" 32 COVERITY_SCAN_TOKEN: "${{ secrets.COVERITY_SCAN_TOKEN }}"
33 run: | 33 run: |
34 wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$PROJECT" -O coverity_tool.tar.gz 34 wget -nv https://scan.coverity.com/download/linux64 --post-data "token=$COVERITY_SCAN_TOKEN&project=$PROJECT" -O coverity_tool.tar.gz
35 mkdir coverity_tool 35 mkdir coverity_tool
36 tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool 36 tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool
37 37
diff --git a/.github/workflows/rust-openssl.yml b/.github/workflows/rust-openssl.yml
index 4ff41c0..d3b2bee 100644
--- a/.github/workflows/rust-openssl.yml
+++ b/.github/workflows/rust-openssl.yml
@@ -34,6 +34,10 @@ jobs:
34 - name: "Run rust-openssl tests" 34 - name: "Run rust-openssl tests"
35 run: | 35 run: |
36 cd rust-openssl 36 cd rust-openssl
37
38 # apply patch - see #1187
39 curl -L https://raw.githubusercontent.com/openbsd/ports/refs/heads/master/security/rust-openssl-tests/patches/patch-openssl-sys_src_handwritten_evp_rs | patch -p0
40
37 # instead of erroring use the last supported version 41 # instead of erroring use the last supported version
38 ed -s openssl-sys/build/main.rs <<-EOF 42 ed -s openssl-sys/build/main.rs <<-EOF
39 /_ => version_error/-1 43 /_ => version_error/-1
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index c4c7d72..7494a21 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -21,14 +21,15 @@ jobs:
21 strategy: 21 strategy:
22 fail-fast: false 22 fail-fast: false
23 matrix: 23 matrix:
24 os: ["windows-2022", "windows-2019"] 24 os: ["windows-2022", "windows-2025"]
25 arch: ["ARM64", "x64", "Win32"] 25 arch: ["ARM64", "x64", "Win32"]
26 shared: ["ON", "OFF"] 26 shared: ["ON", "OFF"]
27 include: 27 include:
28 - os: "windows-2022" 28 - os: "windows-2022"
29 generator: "Visual Studio 17 2022" 29 generator: "Visual Studio 17 2022"
30 - os: "windows-2019" 30 - os: "windows-2025"
31 generator: "Visual Studio 16 2019" 31 # XXX - use appropriate value
32 generator: "Visual Studio 17 2022"
32 steps: 33 steps:
33 - name: "Checkout repository" 34 - name: "Checkout repository"
34 uses: actions/checkout@v4 35 uses: actions/checkout@v4
diff --git a/.gitignore b/.gitignore
index 7aff24f..c83a56d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,7 +38,7 @@ Makefile
38Makefile.in 38Makefile.in
39 39
40# CMake stuff 40# CMake stuff
41build 41build*
42cmake-build-debug/ 42cmake-build-debug/
43 43
44# Libtool stuff 44# Libtool stuff
@@ -133,6 +133,7 @@ tests/tls_ext_alpn*
133tests/tls_prf* 133tests/tls_prf*
134tests/*test 134tests/*test
135tests/tests.h 135tests/tests.h
136tests/test.h
136tests/*test.c 137tests/*test.c
137tests/pbkdf2* 138tests/pbkdf2*
138tests/*.pem 139tests/*.pem
@@ -153,7 +154,7 @@ tests/x509req_ext*
153tests/client.c 154tests/client.c
154tests/init_pledge.c 155tests/init_pledge.c
155tests/server.c 156tests/server.c
156tests/util.c 157tests/*util.c
157tests/valid_handshakes_terminate* 158tests/valid_handshakes_terminate*
158tests/handshake_table* 159tests/handshake_table*
159 160
@@ -173,7 +174,6 @@ autom4te.cache
173 174
174# Libtool adds these, at least sometimes 175# Libtool adds these, at least sometimes
175INSTALL 176INSTALL
176/COPYING
177!m4/check*.m4 177!m4/check*.m4
178m4/l* 178m4/l*
179 179
@@ -204,6 +204,7 @@ ssl/VERSION
204tls/VERSION 204tls/VERSION
205libtls-standalone/VERSION 205libtls-standalone/VERSION
206 206
207crypto/*.mk
207ssl/hidden 208ssl/hidden
208ssl/*.c 209ssl/*.c
209ssl/*.h 210ssl/*.h
@@ -237,35 +238,89 @@ include/openssl/*.h
237!/apps/openssl/apps_win.c 238!/apps/openssl/apps_win.c
238!/apps/openssl/certhash_win.c 239!/apps/openssl/certhash_win.c
239 240
240/crypto/* 241/crypto/*.c
241!/crypto/Makefile.am.* 242/crypto/*.h
242!/crypto/arch/ 243/crypto/aes/
243!/crypto/arch/mips/* 244/crypto/arch/aarch64/crypto_arch.h
244!/crypto/compat/ 245/crypto/arch/aarch64/crypto_cpu_caps.c
245/crypto/compat/* 246/crypto/arch/alpha/
246!/crypto/compat/arc4random.h 247/crypto/arch/amd64/
247!/crypto/compat/b_win.c 248/crypto/arch/arm/
248!/crypto/compat/explicit_bzero_win.c 249/crypto/arch/hppa/
249!/crypto/compat/freezero.c 250/crypto/arch/i386/
250!/crypto/compat/getdelim.c 251/crypto/arch/m88k/
251!/crypto/compat/getline.c 252/crypto/arch/mips64/
252!/crypto/compat/getpagesize.c 253/crypto/arch/powerpc/
253!/crypto/compat/posix_win.c 254/crypto/arch/powerpc64/
254!/crypto/compat/bsd_asprintf.c 255/crypto/arch/riscv64/
255!/crypto/compat/ui_openssl_win.c 256/crypto/arch/sh/
256!/crypto/compat/crypto_lock_win.c 257/crypto/arch/sparc64/
257!/crypto/CMakeLists.txt 258/crypto/asn1/
258 259/crypto/bf/
259!/libtls-standalone/compat/Makefile.am 260/crypto/bio/
260/libtls-standalone/include/*.h 261/crypto/bn/*.c
261/libtls-standalone/src/*.c 262/crypto/bn/*.h
262/libtls-standalone/src/*.h 263/crypto/bn/arch/aarch64/
263/libtls-standalone/src 264/crypto/bn/arch/alpha/
264/libtls-standalone/tests/test 265/crypto/bn/arch/amd64/
265/libtls-standalone/compat 266/crypto/bn/arch/arm/
266/libtls-standalone/VERSION 267/crypto/bn/arch/hppa/
267/libtls-standalone/m4 268/crypto/bn/arch/i386/
268/libtls-standalone/man 269/crypto/bn/arch/m88k/
270/crypto/bn/arch/mips64/
271/crypto/bn/arch/powerpc/
272/crypto/bn/arch/powerpc64/
273/crypto/bn/arch/riscv64/
274/crypto/bn/arch/sh/
275/crypto/bn/arch/sparc64/
276/crypto/buffer/
277/crypto/bytestring/
278/crypto/camellia/
279/crypto/cast/
280/crypto/chacha/
281/crypto/cmac/
282/crypto/cms/
283/crypto/conf/
284/crypto/ct/
285/crypto/curve25519/
286/crypto/des/
287/crypto/dh/
288/crypto/dsa/
289/crypto/ec/
290/crypto/ecdh/
291/crypto/ecdsa/
292/crypto/engine/
293/crypto/err/
294/crypto/evp/
295/crypto/hidden/
296/crypto/hkdf/
297/crypto/hmac/
298/crypto/idea/
299/crypto/kdf/
300/crypto/lhash/
301/crypto/md4/
302/crypto/md5/
303/crypto/mlkem/
304/crypto/modes/
305/crypto/objects/
306/crypto/ocsp/
307/crypto/pem/
308/crypto/pkcs12/
309/crypto/pkcs7/
310/crypto/poly1305/
311/crypto/rand/
312/crypto/rc2/
313/crypto/rc4/
314/crypto/ripemd/
315/crypto/rsa/
316/crypto/sha/
317/crypto/sm3/
318/crypto/sm4/
319/crypto/stack/
320/crypto/ts/
321/crypto/txt_db/
322/crypto/ui/
323/crypto/x509/
269 324
270openbsd/ 325openbsd/
271 326
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8437e02..17e5a0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,20 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1cmake_minimum_required (VERSION 3.16.4) 16cmake_minimum_required (VERSION 3.16.4)
17
2if(MSVC) 18if(MSVC)
3 cmake_policy(SET CMP0091 NEW) 19 cmake_policy(SET CMP0091 NEW)
4endif() 20endif()
@@ -127,7 +143,7 @@ add_definitions(-D__END_HIDDEN_DECLS=)
127set(CMAKE_POSITION_INDEPENDENT_CODE true) 143set(CMAKE_POSITION_INDEPENDENT_CODE true)
128 144
129if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") 145if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
130 add_compile_options(-Wno-pointer-sign) 146 add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wno-pointer-sign>)
131endif() 147endif()
132 148
133if(WIN32) 149if(WIN32)
@@ -362,6 +378,16 @@ if(HAVE_NETINET_IP_H)
362 add_definitions(-DHAVE_NETINET_IP_H) 378 add_definitions(-DHAVE_NETINET_IP_H)
363endif() 379endif()
364 380
381check_include_files(resolv.h HAVE_RESOLV_H)
382if(HAVE_RESOLV_H)
383 add_definitions(-DHAVE_RESOLV_H)
384endif()
385
386check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H)
387if(HAVE_ARPA_NAMESER_H)
388 add_definitions(-DHAVE_ARPA_NAMESER_H)
389endif()
390
365# This isn't ready for universal binaries yet, since we do conditional 391# This isn't ready for universal binaries yet, since we do conditional
366# compilation based on the architecture, but this makes cross compiling for a 392# compilation based on the architecture, but this makes cross compiling for a
367# single architecture work on macOS at least. 393# single architecture work on macOS at least.
@@ -371,18 +397,23 @@ if(APPLE AND (NOT CMAKE_OSX_ARCHITECTURES STREQUAL ""))
371 set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}") 397 set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
372endif() 398endif()
373 399
400# CMAKE_SYSTEM_PROCESSOR is not consistently set to the target architecture.
401# https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html
402if (WIN32 AND (NOT CMAKE_GENERATOR_PLATFORM STREQUAL ""))
403 message("CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
404 message("CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}")
405 set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_GENERATOR_PLATFORM}")
406endif()
407
374if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64|ARM64)") 408if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64|ARM64)")
375 set(HOST_AARCH64 true) 409 set(HOST_AARCH64 true)
376 if(WIN32)
377 set(ENABLE_ASM false)
378 endif()
379elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") 410elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
380 set(HOST_ARM true) 411 set(HOST_ARM true)
381elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386") 412elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
382 set(HOST_X86_64 true) 413 set(HOST_X86_64 true)
383elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64)") 414elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|x64|amd64|AMD64)")
384 set(HOST_X86_64 true) 415 set(HOST_X86_64 true)
385elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|[xX]86)") 416elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|[xX]86|Win32)")
386 set(ENABLE_ASM false) 417 set(ENABLE_ASM false)
387 set(HOST_I386 true) 418 set(HOST_I386 true)
388elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64") 419elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64")
@@ -407,8 +438,6 @@ if(ENABLE_ASM)
407 if(CMAKE_C_COMPILER_ABI STREQUAL "ELF") 438 if(CMAKE_C_COMPILER_ABI STREQUAL "ELF")
408 if(HOST_X86_64) 439 if(HOST_X86_64)
409 set(HOST_ASM_ELF_X86_64 true) 440 set(HOST_ASM_ELF_X86_64 true)
410 elseif(HOST_ARM)
411 set(HOST_ASM_ELF_ARMV4 true)
412 elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND HOST_I386) 441 elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND HOST_I386)
413 set(HOST_ASM_ELF_X86_64 true) 442 set(HOST_ASM_ELF_X86_64 true)
414 endif() 443 endif()
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..c41ff4d
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,133 @@
1
2 LibreSSL files are retained under the copyright of the authors. New
3 additions are ISC licensed as per OpenBSD's normal licensing policy,
4 or are placed in the public domain.
5
6 The OpenSSL code is distributed under the terms of the original OpenSSL
7 licenses which follow:
8
9 LICENSE ISSUES
10 ==============
11
12 The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
13 the OpenSSL License and the original SSLeay license apply to the toolkit.
14 See below for the actual license texts. In case of any license issues
15 related to OpenSSL please contact openssl-core@openssl.org.
16
17 OpenSSL License
18 ---------------
19
20/* ====================================================================
21 * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 *
27 * 1. Redistributions of source code must retain the above copyright
28 * notice, this list of conditions and the following disclaimer.
29 *
30 * 2. Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in
32 * the documentation and/or other materials provided with the
33 * distribution.
34 *
35 * 3. All advertising materials mentioning features or use of this
36 * software must display the following acknowledgment:
37 * "This product includes software developed by the OpenSSL Project
38 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
39 *
40 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
41 * endorse or promote products derived from this software without
42 * prior written permission. For written permission, please contact
43 * openssl-core@openssl.org.
44 *
45 * 5. Products derived from this software may not be called "OpenSSL"
46 * nor may "OpenSSL" appear in their names without prior written
47 * permission of the OpenSSL Project.
48 *
49 * 6. Redistributions of any form whatsoever must retain the following
50 * acknowledgment:
51 * "This product includes software developed by the OpenSSL Project
52 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
53 *
54 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
55 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
57 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
58 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
59 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
60 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
61 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
63 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
64 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
65 * OF THE POSSIBILITY OF SUCH DAMAGE.
66 * ====================================================================
67 *
68 * This product includes cryptographic software written by Eric Young
69 * (eay@cryptsoft.com). This product includes software written by Tim
70 * Hudson (tjh@cryptsoft.com).
71 *
72 */
73
74 Original SSLeay License
75 -----------------------
76
77/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
78 * All rights reserved.
79 *
80 * This package is an SSL implementation written
81 * by Eric Young (eay@cryptsoft.com).
82 * The implementation was written so as to conform with Netscapes SSL.
83 *
84 * This library is free for commercial and non-commercial use as long as
85 * the following conditions are aheared to. The following conditions
86 * apply to all code found in this distribution, be it the RC4, RSA,
87 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
88 * included with this distribution is covered by the same copyright terms
89 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
90 *
91 * Copyright remains Eric Young's, and as such any Copyright notices in
92 * the code are not to be removed.
93 * If this package is used in a product, Eric Young should be given attribution
94 * as the author of the parts of the library used.
95 * This can be in the form of a textual message at program startup or
96 * in documentation (online or textual) provided with the package.
97 *
98 * Redistribution and use in source and binary forms, with or without
99 * modification, are permitted provided that the following conditions
100 * are met:
101 * 1. Redistributions of source code must retain the copyright
102 * notice, this list of conditions and the following disclaimer.
103 * 2. Redistributions in binary form must reproduce the above copyright
104 * notice, this list of conditions and the following disclaimer in the
105 * documentation and/or other materials provided with the distribution.
106 * 3. All advertising materials mentioning features or use of this software
107 * must display the following acknowledgement:
108 * "This product includes cryptographic software written by
109 * Eric Young (eay@cryptsoft.com)"
110 * The word 'cryptographic' can be left out if the rouines from the library
111 * being used are not cryptographic related :-).
112 * 4. If you include any Windows specific code (or a derivative thereof) from
113 * the apps directory (application code) you must include an acknowledgement:
114 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
115 *
116 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
117 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
118 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
119 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
120 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
121 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
122 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
123 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
124 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
125 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
126 * SUCH DAMAGE.
127 *
128 * The licence and distribution terms for any publically available version or
129 * derivative of this code cannot be changed. i.e. this code cannot simply be
130 * copied and put under another distribution licence
131 * [including the GNU Public Licence.]
132 */
133
diff --git a/ChangeLog b/ChangeLog
index d9c4421..1739cfc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,10 +28,54 @@ history is also available from Git.
28 28
29LibreSSL Portable Release Notes: 29LibreSSL Portable Release Notes:
30 30
314.1.0 - In development 314.2.0 - In development
32
33 * Portable changes
34 * Internal improvements
35 - Cleaned up code implementing block cipher modes of operation.
36 Includes untangling a horrible #ifdef mess and removing a few
37 instances of undefined behavior.
38 - Removed assembly implementations of AES using bit slicing (BS-AES)
39 and vector permutation (VP-AES).
40 - Integrated AES-NI into the AES API.
41 - Removed OPENSSL_SMALL_FOOTPRINT and OPENSSL_FIPSAPI.
42 - Lots of cleanup and removal of code with undefined behavior in
43 the block cipher modes of operation implementations.
44 - Implemented constant time EC field element operations to allow
45 implementing elliptic curve operations without bignum arithmetic.
46 - Implemented an EC method using homogeneous projective coordinates.
47 This allows exception-free elliptic curve arithmetic in constant
48 time.
49 - Started cleaning up the openssl speed implementation.
50 - The last SIGILL-based CPU capability detection was removed.
51 Instead, capabilities are now detected using a constructor on
52 library load, which improves the incomplete coverage by calls
53 to OPENSSL_init_crypto() on various entry points.
54 * Compatibility changes
55 - Removed the -msie_hack option from the openssl(1) ca subcommand.
56 - Removed parameters of the 239-bit prime curves from X9.62, H.5.2:
57 prime239v1, prime239v2, prime239v3.
58 - Increased default MAC salt length used by PKCS12_set_mac(3) to 16
59 per recommendation of NIST SP 800-132.
60 - Encrypted PKCS#8 key files now use a default password-based key
61 derivation function that is acceptable in the present millenium.
62 - Of the old *err() only PEMerr(), RSAerr(), and SSLerr() remain.
63 * New features
64 - Allow specifying ALPN in nc(1) via -Talpn="http/1.1,http:/1.0".
65 * Bug fixes
66 - Avoid pointer arithmetic on NULL for memory BIOs.
67 * Documentation
68 - Rewrote most of the EC documentation from scratch to be at least
69 somewhat accurate and intelligible.
70 * Testing and proactive security
71 - Added a testing framework that will help deduplicating lots of
72 ad-hoc code in the regression tests.
73
744.1.0 - Stable release
32 75
33 * Portable changes 76 * Portable changes
34 - Added initial experimental support for loongarch64. 77 - Added initial experimental support for loongarch64.
78 - Fixed compilation for mips32 and reenable CI.
35 - Fixed CMake builds on FreeBSD. 79 - Fixed CMake builds on FreeBSD.
36 - Fixed the --prefix option for cmake --install. 80 - Fixed the --prefix option for cmake --install.
37 - Fixed tests for MinGW due to missing sh(1). 81 - Fixed tests for MinGW due to missing sh(1).
@@ -62,9 +106,8 @@ LibreSSL Portable Release Notes:
62 - Replaced combinations of BN_MONT_CTX_new/set with an internal 106 - Replaced combinations of BN_MONT_CTX_new/set with an internal
63 BN_MONT_CTX_create(). 107 BN_MONT_CTX_create().
64 - Replaced BN_bn2hex() reimplementation in openssl(1) ca with 108 - Replaced BN_bn2hex() reimplementation in openssl(1) ca with
65 a poper API call. 109 a proper API call.
66 - Fixed integer overflows due to signed shift in obj_dat.c. 110 - Fixed integer overflows due to signed shift in obj_dat.c.
67 - Fixed a few memory leaks in legacy code.
68 - Improved some X509_VERIFY_PARAM internals and avoid an out of 111 - Improved some X509_VERIFY_PARAM internals and avoid an out of
69 bounds read from public API. 112 bounds read from public API.
70 - Imported ML-KEM 768 and 1024 from BoringSSL (not yet public API). 113 - Imported ML-KEM 768 and 1024 from BoringSSL (not yet public API).
@@ -102,9 +145,10 @@ LibreSSL Portable Release Notes:
102 - Plugged a leak in eckey_compute_pubkey(). 145 - Plugged a leak in eckey_compute_pubkey().
103 - Again allow the magic values -1, -2 and -3 for the salt length 146 - Again allow the magic values -1, -2 and -3 for the salt length
104 of an RSA-PSS key in the EVP_PKEY_CTX_ctrl_str() interface. 147 of an RSA-PSS key in the EVP_PKEY_CTX_ctrl_str() interface.
148 - Fixed a few memory leaks in legacy code.
105 * Documentation 149 * Documentation
106 - The remaining undocumented public EVP API is now documented. 150 - The remaining undocumented public EVP API is now documented.
107 Reorganization of existing documentation for clarity and accuracy. 151 - Reorganization of existing documentation for clarity and accuracy.
108 * Testing and proactive security 152 * Testing and proactive security
109 - Improved regress coverage of the EC code. 153 - Improved regress coverage of the EC code.
110 154
diff --git a/Makefile.am b/Makefile.am
index 3f62cd9..eca5a27 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1SUBDIRS = include crypto ssl tls apps man 16SUBDIRS = include crypto ssl tls apps man
2if ENABLE_TESTS 17if ENABLE_TESTS
3SUBDIRS += tests 18SUBDIRS += tests
diff --git a/Makefile.am.common b/Makefile.am.common
index 5405704..4257cf8 100644
--- a/Makefile.am.common
+++ b/Makefile.am.common
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1AM_CFLAGS = 16AM_CFLAGS =
2AM_CPPFLAGS = -I$(top_srcdir)/include 17AM_CPPFLAGS = -I$(top_srcdir)/include
3AM_CPPFLAGS += -I$(abs_top_builddir)/include 18AM_CPPFLAGS += -I$(abs_top_builddir)/include
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt
index 08a5a41..754990a 100644
--- a/apps/CMakeLists.txt
+++ b/apps/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1add_subdirectory(ocspcheck) 16add_subdirectory(ocspcheck)
2add_subdirectory(openssl) 17add_subdirectory(openssl)
3add_subdirectory(nc) 18add_subdirectory(nc)
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt
index d5f7813..b1eed1b 100644
--- a/apps/nc/CMakeLists.txt
+++ b/apps/nc/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2016 Kinichiro Inoguchi
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1if(BUILD_NC) 16if(BUILD_NC)
2 17
3set( 18set(
diff --git a/apps/nc/Makefile.am b/apps/nc/Makefile.am
index aba306e..a3911a2 100644
--- a/apps/nc/Makefile.am
+++ b/apps/nc/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2015 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk 18-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt
index 778e837..ed2ec1b 100644
--- a/apps/ocspcheck/CMakeLists.txt
+++ b/apps/ocspcheck/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2017 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1set( 16set(
2 OCSPCHECK_SRC 17 OCSPCHECK_SRC
3 http.c 18 http.c
diff --git a/apps/ocspcheck/Makefile.am b/apps/ocspcheck/Makefile.am
index e6f3c54..554bd5c 100644
--- a/apps/ocspcheck/Makefile.am
+++ b/apps/ocspcheck/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2017 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk 18-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt
index bca60e1..3040d01 100644
--- a/apps/openssl/CMakeLists.txt
+++ b/apps/openssl/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2016 Kinichiro Inoguchi
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1set( 16set(
2 OPENSSL_SRC 17 OPENSSL_SRC
3 apps.c 18 apps.c
diff --git a/apps/openssl/Makefile.am b/apps/openssl/Makefile.am
index ee1b65b..40804c5 100644
--- a/apps/openssl/Makefile.am
+++ b/apps/openssl/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2015 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk 18-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
diff --git a/check-release.sh b/check-release.sh
index c5f9c5f..723a051 100755
--- a/check-release.sh
+++ b/check-release.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4ver=$1 19ver=$1
diff --git a/cmake_export_symbol.cmake b/cmake_export_symbol.cmake
index 0883001..9fe61f2 100644
--- a/cmake_export_symbol.cmake
+++ b/cmake_export_symbol.cmake
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2017 Kinichiro Inoguchi
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1macro(export_symbol TARGET SYMBOLS_PATH) 16macro(export_symbol TARGET SYMBOLS_PATH)
2 17
3 set(FLAG "") 18 set(FLAG "")
diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in
index bb8055d..2887382 100644
--- a/cmake_uninstall.cmake.in
+++ b/cmake_uninstall.cmake.in
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2016 Kinichiro Inoguchi
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 16if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
2 message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 17 message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
3endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 18endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
diff --git a/configure.ac b/configure.ac
index 7a88f27..8d347b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,4 @@
1#
1# Copyright (c) 2014-2015 Brent Cook 2# Copyright (c) 2014-2015 Brent Cook
2# 3#
3# Permission to use, copy, modify, and distribute this software for any 4# Permission to use, copy, modify, and distribute this software for any
@@ -114,8 +115,6 @@ AC_ARG_ENABLE([asm], AS_HELP_STRING([--disable-asm], [Disable assembly]))
114AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) 115AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"])
115 116
116# Conditionally enable assembly by default 117# Conditionally enable assembly by default
117AM_CONDITIONAL([HOST_ASM_ELF_ARM],
118 [test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "arm" -a "x$enable_asm" != "xno"])
119AM_CONDITIONAL([HOST_ASM_ELF_MIPS], 118AM_CONDITIONAL([HOST_ASM_ELF_MIPS],
120 [test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "mips" -a "x$enable_asm" != "xno"]) 119 [test "x$HOST_ABI" = "xelf" -a "$host_cpu" = "mips" -a "x$enable_asm" != "xno"])
121AM_CONDITIONAL([HOST_ASM_ELF_MIPS64], 120AM_CONDITIONAL([HOST_ASM_ELF_MIPS64],
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 64bccd8..047c228 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -1,30 +1,28 @@
1add_definitions(-DLIBRESSL_CRYPTO_INTERNAL) 1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2 15
3if(HOST_ASM_ELF_ARMV4) 16add_definitions(-DLIBRESSL_CRYPTO_INTERNAL)
4 set(
5 ASM_ARMV4_ELF_SRC
6 aes/aes-elf-armv4.S
7 bn/mont-elf-armv4.S
8 sha/sha1-elf-armv4.S
9 sha/sha512-elf-armv4.S
10 sha/sha256-elf-armv4.S
11 modes/ghash-elf-armv4.S
12 armv4cpuid.S
13 armcap.c
14 )
15 add_definitions(-DAES_ASM)
16 add_definitions(-DOPENSSL_BN_ASM_MONT)
17 add_definitions(-DGHASH_ASM)
18 add_definitions(-DOPENSSL_CPUID_OBJ)
19 set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_ARMV4_ELF_SRC})
20endif()
21 17
22if(HOST_ASM_ELF_X86_64) 18if(HOST_ASM_ELF_X86_64)
19 set(CRYPTO_SRC ${CRYPTO_SRC} aes/aes_amd64.c)
20 set(CRYPTO_SRC ${CRYPTO_SRC} bn/arch/amd64/bn_arch.c)
21 set(CRYPTO_SRC ${CRYPTO_SRC} modes/gcm128_amd64.c)
22
23 set( 23 set(
24 ASM_X86_64_ELF_SRC 24 ASM_X86_64_ELF_SRC
25 aes/aes-elf-x86_64.S 25 aes/aes-elf-x86_64.S
26 aes/bsaes-elf-x86_64.S
27 aes/vpaes-elf-x86_64.S
28 aes/aesni-elf-x86_64.S 26 aes/aesni-elf-x86_64.S
29 bn/modexp512-elf-x86_64.S 27 bn/modexp512-elf-x86_64.S
30 bn/mont-elf-x86_64.S 28 bn/mont-elf-x86_64.S
@@ -43,7 +41,6 @@ if(HOST_ASM_ELF_X86_64)
43 bn/arch/amd64/bignum_sqr_8_16_alt.S 41 bn/arch/amd64/bignum_sqr_8_16_alt.S
44 bn/arch/amd64/bignum_sub.S 42 bn/arch/amd64/bignum_sub.S
45 bn/arch/amd64/word_clz.S 43 bn/arch/amd64/word_clz.S
46 bn/arch/amd64/bn_arch.c
47 ) 44 )
48 add_definitions(-DAES_ASM) 45 add_definitions(-DAES_ASM)
49 add_definitions(-DBSAES_ASM) 46 add_definitions(-DBSAES_ASM)
@@ -57,11 +54,13 @@ if(HOST_ASM_ELF_X86_64)
57endif() 54endif()
58 55
59if(HOST_ASM_MACOSX_X86_64) 56if(HOST_ASM_MACOSX_X86_64)
57 set(CRYPTO_SRC ${CRYPTO_SRC} aes/aes_amd64.c)
58 set(CRYPTO_SRC ${CRYPTO_SRC} bn/arch/amd64/bn_arch.c)
59 set(CRYPTO_SRC ${CRYPTO_SRC} modes/gcm128_amd64.c)
60
60 set( 61 set(
61 ASM_X86_64_MACOSX_SRC 62 ASM_X86_64_MACOSX_SRC
62 aes/aes-macosx-x86_64.S 63 aes/aes-macosx-x86_64.S
63 aes/bsaes-macosx-x86_64.S
64 aes/vpaes-macosx-x86_64.S
65 aes/aesni-macosx-x86_64.S 64 aes/aesni-macosx-x86_64.S
66 bn/modexp512-macosx-x86_64.S 65 bn/modexp512-macosx-x86_64.S
67 bn/mont-macosx-x86_64.S 66 bn/mont-macosx-x86_64.S
@@ -80,7 +79,6 @@ if(HOST_ASM_MACOSX_X86_64)
80 bn/arch/amd64/bignum_sqr_8_16_alt.S 79 bn/arch/amd64/bignum_sqr_8_16_alt.S
81 bn/arch/amd64/bignum_sub.S 80 bn/arch/amd64/bignum_sub.S
82 bn/arch/amd64/word_clz.S 81 bn/arch/amd64/word_clz.S
83 bn/arch/amd64/bn_arch.c
84 ) 82 )
85 add_definitions(-DAES_ASM) 83 add_definitions(-DAES_ASM)
86 add_definitions(-DBSAES_ASM) 84 add_definitions(-DBSAES_ASM)
@@ -95,11 +93,12 @@ if(HOST_ASM_MACOSX_X86_64)
95endif() 93endif()
96 94
97if(HOST_ASM_MASM_X86_64) 95if(HOST_ASM_MASM_X86_64)
96 set(CRYPTO_SRC ${CRYPTO_SRC} aes/aes_amd64.c)
97 set(CRYPTO_SRC ${CRYPTO_SRC} modes/gcm128_amd64.c)
98
98 set( 99 set(
99 ASM_X86_64_MASM_SRC 100 ASM_X86_64_MASM_SRC
100 aes/aes-masm-x86_64.S 101 aes/aes-masm-x86_64.S
101 aes/bsaes-masm-x86_64.S
102 aes/vpaes-masm-x86_64.S
103 aes/aesni-masm-x86_64.S 102 aes/aesni-masm-x86_64.S
104 #bn/modexp512-masm-x86_64.S 103 #bn/modexp512-masm-x86_64.S
105 #bn/mont-masm-x86_64.S 104 #bn/mont-masm-x86_64.S
@@ -121,11 +120,12 @@ if(HOST_ASM_MASM_X86_64)
121endif() 120endif()
122 121
123if(HOST_ASM_MINGW64_X86_64) 122if(HOST_ASM_MINGW64_X86_64)
123 set(CRYPTO_SRC ${CRYPTO_SRC} aes/aes_amd64.c)
124 set(CRYPTO_SRC ${CRYPTO_SRC} modes/gcm128_amd64.c)
125
124 set( 126 set(
125 ASM_X86_64_MINGW64_SRC 127 ASM_X86_64_MINGW64_SRC
126 aes/aes-mingw64-x86_64.S 128 aes/aes-mingw64-x86_64.S
127 aes/bsaes-mingw64-x86_64.S
128 aes/vpaes-mingw64-x86_64.S
129 aes/aesni-mingw64-x86_64.S 129 aes/aesni-mingw64-x86_64.S
130 #bn/modexp512-mingw64-x86_64.S 130 #bn/modexp512-mingw64-x86_64.S
131 #bn/mont-mingw64-x86_64.S 131 #bn/mont-mingw64-x86_64.S
@@ -146,7 +146,17 @@ if(HOST_ASM_MINGW64_X86_64)
146endif() 146endif()
147 147
148if(HOST_AARCH64) 148if(HOST_AARCH64)
149 set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps.c) 149 if(APPLE)
150 set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps_darwin.c)
151 elseif(LINUX)
152 set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps_linux.c)
153 elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
154 set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps.c)
155 elseif(WIN32)
156 set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps_windows.c)
157 else()
158 set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps_none.c)
159 endif()
150elseif(HOST_X86_64) 160elseif(HOST_X86_64)
151 set(CRYPTO_SRC ${CRYPTO_SRC} arch/amd64/crypto_cpu_caps.c) 161 set(CRYPTO_SRC ${CRYPTO_SRC} arch/amd64/crypto_cpu_caps.c)
152elseif(HOST_I386) 162elseif(HOST_I386)
@@ -163,7 +173,6 @@ set(
163 crypto_memory.c 173 crypto_memory.c
164 aes/aes.c 174 aes/aes.c
165 aes/aes_core.c 175 aes/aes_core.c
166 aes/aes_ige.c
167 asn1/a_bitstr.c 176 asn1/a_bitstr.c
168 asn1/a_enum.c 177 asn1/a_enum.c
169 asn1/a_int.c 178 asn1/a_int.c
@@ -213,10 +222,8 @@ set(
213 asn1/x_bignum.c 222 asn1/x_bignum.c
214 asn1/x_crl.c 223 asn1/x_crl.c
215 asn1/x_exten.c 224 asn1/x_exten.c
216 asn1/x_info.c
217 asn1/x_long.c 225 asn1/x_long.c
218 asn1/x_name.c 226 asn1/x_name.c
219 asn1/x_pkey.c
220 asn1/x_pubkey.c 227 asn1/x_pubkey.c
221 asn1/x_req.c 228 asn1/x_req.c
222 asn1/x_sig.c 229 asn1/x_sig.c
@@ -245,6 +252,7 @@ set(
245 bio/bss_null.c 252 bio/bss_null.c
246 bio/bss_sock.c 253 bio/bss_sock.c
247 bn/bn_add.c 254 bn/bn_add.c
255 bn/bn_add_sub.c
248 bn/bn_bpsw.c 256 bn/bn_bpsw.c
249 bn/bn_const.c 257 bn/bn_const.c
250 bn/bn_convert.c 258 bn/bn_convert.c
@@ -258,6 +266,7 @@ set(
258 bn/bn_lib.c 266 bn/bn_lib.c
259 bn/bn_mod.c 267 bn/bn_mod.c
260 bn/bn_mod_sqrt.c 268 bn/bn_mod_sqrt.c
269 bn/bn_mod_words.c
261 bn/bn_mont.c 270 bn/bn_mont.c
262 bn/bn_mul.c 271 bn/bn_mul.c
263 bn/bn_prime.c 272 bn/bn_prime.c
@@ -339,11 +348,13 @@ set(
339 ec/ec_convert.c 348 ec/ec_convert.c
340 ec/ec_curve.c 349 ec/ec_curve.c
341 ec/ec_err.c 350 ec/ec_err.c
351 ec/ec_field.c
342 ec/ec_key.c 352 ec/ec_key.c
343 ec/ec_lib.c 353 ec/ec_lib.c
344 ec/ec_mult.c 354 ec/ec_mult.c
345 ec/ec_pmeth.c 355 ec/ec_pmeth.c
346 ec/eck_prn.c 356 ec/eck_prn.c
357 ec/ecp_hp_methods.c
347 ec/ecp_methods.c 358 ec/ecp_methods.c
348 ec/ecx_methods.c 359 ec/ecx_methods.c
349 ecdh/ecdh.c 360 ecdh/ecdh.c
@@ -464,11 +475,7 @@ set(
464 rand/rand_err.c 475 rand/rand_err.c
465 rand/rand_lib.c 476 rand/rand_lib.c
466 rand/randfile.c 477 rand/randfile.c
467 rc2/rc2_cbc.c 478 rc2/rc2.c
468 rc2/rc2_ecb.c
469 rc2/rc2_skey.c
470 rc2/rc2cfb64.c
471 rc2/rc2ofb64.c
472 rc4/rc4.c 479 rc4/rc4.c
473 ripemd/ripemd.c 480 ripemd/ripemd.c
474 rsa/rsa_ameth.c 481 rsa/rsa_ameth.c
@@ -570,17 +577,17 @@ set(
570 577
571set(COMPAT_SRC empty.c) 578set(COMPAT_SRC empty.c)
572 579
580set(CRYPTO_UNEXPORT ${CRYPTO_UNEXPORT} BIO_s_log)
581
573if(UNIX) 582if(UNIX)
574 set(CRYPTO_SRC ${CRYPTO_SRC} crypto_lock.c) 583 set(CRYPTO_SRC ${CRYPTO_SRC} crypto_lock.c)
575 set(CRYPTO_SRC ${CRYPTO_SRC} bio/b_posix.c) 584 set(CRYPTO_SRC ${CRYPTO_SRC} bio/b_posix.c)
576 set(CRYPTO_SRC ${CRYPTO_SRC} bio/bss_log.c)
577 set(CRYPTO_SRC ${CRYPTO_SRC} ui/ui_openssl.c) 585 set(CRYPTO_SRC ${CRYPTO_SRC} ui/ui_openssl.c)
578endif() 586endif()
579 587
580if(WIN32) 588if(WIN32)
581 set(CRYPTO_SRC ${CRYPTO_SRC} compat/crypto_lock_win.c) 589 set(CRYPTO_SRC ${CRYPTO_SRC} compat/crypto_lock_win.c)
582 set(CRYPTO_SRC ${CRYPTO_SRC} bio/b_win.c) 590 set(CRYPTO_SRC ${CRYPTO_SRC} bio/b_win.c)
583 set(CRYPTO_UNEXPORT ${CRYPTO_UNEXPORT} BIO_s_log)
584 set(CRYPTO_SRC ${CRYPTO_SRC} ui/ui_openssl_win.c) 591 set(CRYPTO_SRC ${CRYPTO_SRC} ui/ui_openssl_win.c)
585endif() 592endif()
586 593
@@ -736,6 +743,7 @@ add_library(crypto_obj OBJECT ${CRYPTO_SRC})
736target_include_directories(crypto_obj 743target_include_directories(crypto_obj
737 PRIVATE 744 PRIVATE
738 . 745 .
746 aes
739 asn1 747 asn1
740 bio 748 bio
741 bn 749 bn
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index d1c5b76..ad241ab 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -1,6 +1,22 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3AM_CPPFLAGS += -DLIBRESSL_CRYPTO_INTERNAL 18AM_CPPFLAGS += -DLIBRESSL_CRYPTO_INTERNAL
19AM_CPPFLAGS += -I$(top_srcdir)/crypto/aes
4AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1 20AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1
5AM_CPPFLAGS += -I$(top_srcdir)/crypto/bio 21AM_CPPFLAGS += -I$(top_srcdir)/crypto/bio
6AM_CPPFLAGS += -I$(top_srcdir)/crypto/bn 22AM_CPPFLAGS += -I$(top_srcdir)/crypto/bn
@@ -51,20 +67,18 @@ crypto_portable.sym: crypto.sym Makefile
51 -echo "generating crypto_portable.sym ..." 67 -echo "generating crypto_portable.sym ..."
52 -cp $(top_srcdir)/crypto/crypto.sym crypto_portable.sym 68 -cp $(top_srcdir)/crypto/crypto.sym crypto_portable.sym
53 -chmod u+w crypto_portable.sym 69 -chmod u+w crypto_portable.sym
54if HOST_WIN
55 -grep -v BIO_s_log crypto_portable.sym > crypto_portable.sym.tmp 70 -grep -v BIO_s_log crypto_portable.sym > crypto_portable.sym.tmp
56 -mv crypto_portable.sym.tmp crypto_portable.sym 71 -mv crypto_portable.sym.tmp crypto_portable.sym
57endif
58 72
59libcrypto_la_objects.mk: Makefile 73libcrypto_la_objects.mk: Makefile
60 @echo "libcrypto_la_objects= $(libcrypto_la_OBJECTS)" \ 74 @echo "libcrypto_la_objects= $(libcrypto_la_OBJECTS)" \
61 | sed 's/ */ $$\(abs_top_builddir\)\/crypto\//g' \ 75 | sed 's/ */ $$\(top_builddir\)\/crypto\//g' \
62 > libcrypto_la_objects.mk 76 > libcrypto_la_objects.mk
63 @echo "libcompat_la_objects= $(libcompat_la_OBJECTS)" \ 77 @echo "libcompat_la_objects= $(libcompat_la_OBJECTS)" \
64 | sed 's/compat\// $$\(abs_top_builddir\)\/crypto\/&/g' \ 78 | sed 's/compat\// $$\(top_builddir\)\/crypto\/&/g' \
65 >> libcrypto_la_objects.mk 79 >> libcrypto_la_objects.mk
66 @echo "libcompatnoopt_la_objects= $(libcompatnoopt_la_OBJECTS)" \ 80 @echo "libcompatnoopt_la_objects= $(libcompatnoopt_la_OBJECTS)" \
67 | sed 's/compat\// $$\(abs_top_builddir\)\/crypto\/&/g' \ 81 | sed 's/compat\// $$\(top_builddir\)\/crypto\/&/g' \
68 >> libcrypto_la_objects.mk 82 >> libcrypto_la_objects.mk
69 83
70libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym 84libcrypto_la_LDFLAGS = -version-info @LIBCRYPTO_VERSION@ -no-undefined -export-symbols crypto_portable.sym
@@ -187,7 +201,6 @@ include Makefile.am.arc4random
187libcrypto_la_SOURCES = 201libcrypto_la_SOURCES =
188EXTRA_libcrypto_la_SOURCES = 202EXTRA_libcrypto_la_SOURCES =
189 203
190include Makefile.am.elf-arm
191include Makefile.am.elf-mips 204include Makefile.am.elf-mips
192include Makefile.am.elf-mips64 205include Makefile.am.elf-mips64
193include Makefile.am.elf-x86_64 206include Makefile.am.elf-x86_64
@@ -195,7 +208,6 @@ include Makefile.am.macosx-x86_64
195include Makefile.am.masm-x86_64 208include Makefile.am.masm-x86_64
196include Makefile.am.mingw64-x86_64 209include Makefile.am.mingw64-x86_64
197 210
198if !HOST_ASM_ELF_ARM
199if !HOST_ASM_ELF_MIPS 211if !HOST_ASM_ELF_MIPS
200if !HOST_ASM_ELF_MIPS64 212if !HOST_ASM_ELF_MIPS64
201if !HOST_ASM_ELF_X86_64 213if !HOST_ASM_ELF_X86_64
@@ -209,11 +221,23 @@ endif
209endif 221endif
210endif 222endif
211endif 223endif
212endif
213 224
214if HOST_AARCH64 225if HOST_AARCH64
226if HOST_DARWIN
227libcrypto_la_SOURCES += arch/aarch64/crypto_cpu_caps_darwin.c
228else
229if HOST_LINUX
230libcrypto_la_SOURCES += arch/aarch64/crypto_cpu_caps_linux.c
231else
232if HOST_OPENBSD
215libcrypto_la_SOURCES += arch/aarch64/crypto_cpu_caps.c 233libcrypto_la_SOURCES += arch/aarch64/crypto_cpu_caps.c
234else
235libcrypto_la_SOURCES += arch/aarch64/crypto_cpu_caps_none.c
236endif
237endif
238endif
216endif 239endif
240
217if HOST_X86_64 241if HOST_X86_64
218libcrypto_la_SOURCES += arch/amd64/crypto_cpu_caps.c 242libcrypto_la_SOURCES += arch/amd64/crypto_cpu_caps.c
219endif 243endif
@@ -231,7 +255,6 @@ else
231libcrypto_la_SOURCES += compat/crypto_lock_win.c 255libcrypto_la_SOURCES += compat/crypto_lock_win.c
232endif 256endif
233libcrypto_la_SOURCES += crypto_memory.c 257libcrypto_la_SOURCES += crypto_memory.c
234noinst_HEADERS += arm_arch.h
235noinst_HEADERS += constant_time.h 258noinst_HEADERS += constant_time.h
236noinst_HEADERS += crypto_internal.h 259noinst_HEADERS += crypto_internal.h
237noinst_HEADERS += crypto_local.h 260noinst_HEADERS += crypto_local.h
@@ -240,7 +263,6 @@ noinst_HEADERS += x86_arch.h
240# aes 263# aes
241libcrypto_la_SOURCES += aes/aes.c 264libcrypto_la_SOURCES += aes/aes.c
242libcrypto_la_SOURCES += aes/aes_core.c 265libcrypto_la_SOURCES += aes/aes_core.c
243libcrypto_la_SOURCES += aes/aes_ige.c
244noinst_HEADERS += aes/aes_local.h 266noinst_HEADERS += aes/aes_local.h
245 267
246# asn1 268# asn1
@@ -293,10 +315,8 @@ libcrypto_la_SOURCES += asn1/x_attrib.c
293libcrypto_la_SOURCES += asn1/x_bignum.c 315libcrypto_la_SOURCES += asn1/x_bignum.c
294libcrypto_la_SOURCES += asn1/x_crl.c 316libcrypto_la_SOURCES += asn1/x_crl.c
295libcrypto_la_SOURCES += asn1/x_exten.c 317libcrypto_la_SOURCES += asn1/x_exten.c
296libcrypto_la_SOURCES += asn1/x_info.c
297libcrypto_la_SOURCES += asn1/x_long.c 318libcrypto_la_SOURCES += asn1/x_long.c
298libcrypto_la_SOURCES += asn1/x_name.c 319libcrypto_la_SOURCES += asn1/x_name.c
299libcrypto_la_SOURCES += asn1/x_pkey.c
300libcrypto_la_SOURCES += asn1/x_pubkey.c 320libcrypto_la_SOURCES += asn1/x_pubkey.c
301libcrypto_la_SOURCES += asn1/x_req.c 321libcrypto_la_SOURCES += asn1/x_req.c
302libcrypto_la_SOURCES += asn1/x_sig.c 322libcrypto_la_SOURCES += asn1/x_sig.c
@@ -334,9 +354,6 @@ libcrypto_la_SOURCES += bio/bss_conn.c
334libcrypto_la_SOURCES += bio/bss_dgram.c 354libcrypto_la_SOURCES += bio/bss_dgram.c
335libcrypto_la_SOURCES += bio/bss_fd.c 355libcrypto_la_SOURCES += bio/bss_fd.c
336libcrypto_la_SOURCES += bio/bss_file.c 356libcrypto_la_SOURCES += bio/bss_file.c
337if !HOST_WIN
338libcrypto_la_SOURCES += bio/bss_log.c
339endif
340libcrypto_la_SOURCES += bio/bss_mem.c 357libcrypto_la_SOURCES += bio/bss_mem.c
341libcrypto_la_SOURCES += bio/bss_null.c 358libcrypto_la_SOURCES += bio/bss_null.c
342libcrypto_la_SOURCES += bio/bss_sock.c 359libcrypto_la_SOURCES += bio/bss_sock.c
@@ -344,6 +361,7 @@ noinst_HEADERS += bio/bio_local.h
344 361
345# bn 362# bn
346libcrypto_la_SOURCES += bn/bn_add.c 363libcrypto_la_SOURCES += bn/bn_add.c
364libcrypto_la_SOURCES += bn/bn_add_sub.c
347libcrypto_la_SOURCES += bn/bn_bpsw.c 365libcrypto_la_SOURCES += bn/bn_bpsw.c
348libcrypto_la_SOURCES += bn/bn_const.c 366libcrypto_la_SOURCES += bn/bn_const.c
349libcrypto_la_SOURCES += bn/bn_convert.c 367libcrypto_la_SOURCES += bn/bn_convert.c
@@ -357,6 +375,7 @@ libcrypto_la_SOURCES += bn/bn_kron.c
357libcrypto_la_SOURCES += bn/bn_lib.c 375libcrypto_la_SOURCES += bn/bn_lib.c
358libcrypto_la_SOURCES += bn/bn_mod.c 376libcrypto_la_SOURCES += bn/bn_mod.c
359libcrypto_la_SOURCES += bn/bn_mod_sqrt.c 377libcrypto_la_SOURCES += bn/bn_mod_sqrt.c
378libcrypto_la_SOURCES += bn/bn_mod_words.c
360libcrypto_la_SOURCES += bn/bn_mont.c 379libcrypto_la_SOURCES += bn/bn_mont.c
361libcrypto_la_SOURCES += bn/bn_mul.c 380libcrypto_la_SOURCES += bn/bn_mul.c
362libcrypto_la_SOURCES += bn/bn_prime.c 381libcrypto_la_SOURCES += bn/bn_prime.c
@@ -562,13 +581,16 @@ libcrypto_la_SOURCES += ec/ec_asn1.c
562libcrypto_la_SOURCES += ec/ec_convert.c 581libcrypto_la_SOURCES += ec/ec_convert.c
563libcrypto_la_SOURCES += ec/ec_curve.c 582libcrypto_la_SOURCES += ec/ec_curve.c
564libcrypto_la_SOURCES += ec/ec_err.c 583libcrypto_la_SOURCES += ec/ec_err.c
584libcrypto_la_SOURCES += ec/ec_field.c
565libcrypto_la_SOURCES += ec/ec_key.c 585libcrypto_la_SOURCES += ec/ec_key.c
566libcrypto_la_SOURCES += ec/ec_lib.c 586libcrypto_la_SOURCES += ec/ec_lib.c
567libcrypto_la_SOURCES += ec/ec_mult.c 587libcrypto_la_SOURCES += ec/ec_mult.c
568libcrypto_la_SOURCES += ec/ec_pmeth.c 588libcrypto_la_SOURCES += ec/ec_pmeth.c
569libcrypto_la_SOURCES += ec/eck_prn.c 589libcrypto_la_SOURCES += ec/eck_prn.c
590libcrypto_la_SOURCES += ec/ecp_hp_methods.c
570libcrypto_la_SOURCES += ec/ecp_methods.c 591libcrypto_la_SOURCES += ec/ecp_methods.c
571libcrypto_la_SOURCES += ec/ecx_methods.c 592libcrypto_la_SOURCES += ec/ecx_methods.c
593noinst_HEADERS += ec/ec_internal.h
572noinst_HEADERS += ec/ec_local.h 594noinst_HEADERS += ec/ec_local.h
573 595
574# ecdh 596# ecdh
@@ -800,11 +822,7 @@ libcrypto_la_SOURCES += rand/rand_lib.c
800libcrypto_la_SOURCES += rand/randfile.c 822libcrypto_la_SOURCES += rand/randfile.c
801 823
802# rc2 824# rc2
803libcrypto_la_SOURCES += rc2/rc2_cbc.c 825libcrypto_la_SOURCES += rc2/rc2.c
804libcrypto_la_SOURCES += rc2/rc2_ecb.c
805libcrypto_la_SOURCES += rc2/rc2_skey.c
806libcrypto_la_SOURCES += rc2/rc2cfb64.c
807libcrypto_la_SOURCES += rc2/rc2ofb64.c
808noinst_HEADERS += rc2/rc2_local.h 826noinst_HEADERS += rc2/rc2_local.h
809 827
810# rc4 828# rc4
diff --git a/crypto/Makefile.am.elf-arm b/crypto/Makefile.am.elf-arm
deleted file mode 100644
index 6a9fa50..0000000
--- a/crypto/Makefile.am.elf-arm
+++ /dev/null
@@ -1,18 +0,0 @@
1ASM_ARM_ELF = aes/aes-elf-armv4.S
2ASM_ARM_ELF += bn/mont-elf-armv4.S
3ASM_ARM_ELF += sha/sha1-elf-armv4.S
4ASM_ARM_ELF += sha/sha512-elf-armv4.S
5ASM_ARM_ELF += sha/sha256-elf-armv4.S
6ASM_ARM_ELF += modes/ghash-elf-armv4.S
7ASM_ARM_ELF += armv4cpuid.S
8ASM_ARM_ELF += armcap.c
9
10EXTRA_DIST += $(ASM_ARM_ELF)
11
12if HOST_ASM_ELF_ARM
13libcrypto_la_CPPFLAGS += -DAES_ASM
14libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT
15libcrypto_la_CPPFLAGS += -DGHASH_ASM
16libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ
17libcrypto_la_SOURCES += $(ASM_ARM_ELF)
18endif
diff --git a/crypto/Makefile.am.elf-x86_64 b/crypto/Makefile.am.elf-x86_64
index c62662c..ad49787 100644
--- a/crypto/Makefile.am.elf-x86_64
+++ b/crypto/Makefile.am.elf-x86_64
@@ -1,7 +1,5 @@
1 1
2ASM_X86_64_ELF = aes/aes-elf-x86_64.S 2ASM_X86_64_ELF = aes/aes-elf-x86_64.S
3ASM_X86_64_ELF += aes/bsaes-elf-x86_64.S
4ASM_X86_64_ELF += aes/vpaes-elf-x86_64.S
5ASM_X86_64_ELF += aes/aesni-elf-x86_64.S 3ASM_X86_64_ELF += aes/aesni-elf-x86_64.S
6ASM_X86_64_ELF += bn/modexp512-elf-x86_64.S 4ASM_X86_64_ELF += bn/modexp512-elf-x86_64.S
7ASM_X86_64_ELF += bn/mont-elf-x86_64.S 5ASM_X86_64_ELF += bn/mont-elf-x86_64.S
@@ -20,11 +18,14 @@ ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_4_8_alt.S
20ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_8_16_alt.S 18ASM_X86_64_ELF += bn/arch/amd64/bignum_sqr_8_16_alt.S
21ASM_X86_64_ELF += bn/arch/amd64/bignum_sub.S 19ASM_X86_64_ELF += bn/arch/amd64/bignum_sub.S
22ASM_X86_64_ELF += bn/arch/amd64/word_clz.S 20ASM_X86_64_ELF += bn/arch/amd64/word_clz.S
23ASM_X86_64_ELF += bn/arch/amd64/bn_arch.c
24 21
25EXTRA_DIST += $(ASM_X86_64_ELF) 22EXTRA_DIST += $(ASM_X86_64_ELF)
26 23
27if HOST_ASM_ELF_X86_64 24if HOST_ASM_ELF_X86_64
25libcrypto_la_SOURCES += aes/aes_amd64.c
26libcrypto_la_SOURCES += bn/arch/amd64/bn_arch.c
27libcrypto_la_SOURCES += modes/gcm128_amd64.c
28
28libcrypto_la_CPPFLAGS += -DAES_ASM 29libcrypto_la_CPPFLAGS += -DAES_ASM
29libcrypto_la_CPPFLAGS += -DBSAES_ASM 30libcrypto_la_CPPFLAGS += -DBSAES_ASM
30libcrypto_la_CPPFLAGS += -DVPAES_ASM 31libcrypto_la_CPPFLAGS += -DVPAES_ASM
diff --git a/crypto/Makefile.am.macosx-x86_64 b/crypto/Makefile.am.macosx-x86_64
index 010e3be..bbccfd6 100644
--- a/crypto/Makefile.am.macosx-x86_64
+++ b/crypto/Makefile.am.macosx-x86_64
@@ -1,7 +1,5 @@
1 1
2ASM_X86_64_MACOSX = aes/aes-macosx-x86_64.S 2ASM_X86_64_MACOSX = aes/aes-macosx-x86_64.S
3ASM_X86_64_MACOSX += aes/bsaes-macosx-x86_64.S
4ASM_X86_64_MACOSX += aes/vpaes-macosx-x86_64.S
5ASM_X86_64_MACOSX += aes/aesni-macosx-x86_64.S 3ASM_X86_64_MACOSX += aes/aesni-macosx-x86_64.S
6ASM_X86_64_MACOSX += bn/modexp512-macosx-x86_64.S 4ASM_X86_64_MACOSX += bn/modexp512-macosx-x86_64.S
7ASM_X86_64_MACOSX += bn/mont-macosx-x86_64.S 5ASM_X86_64_MACOSX += bn/mont-macosx-x86_64.S
@@ -20,11 +18,14 @@ ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_4_8_alt.S
20ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_8_16_alt.S 18ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sqr_8_16_alt.S
21ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sub.S 19ASM_X86_64_MACOSX += bn/arch/amd64/bignum_sub.S
22ASM_X86_64_MACOSX += bn/arch/amd64/word_clz.S 20ASM_X86_64_MACOSX += bn/arch/amd64/word_clz.S
23ASM_X86_64_MACOSX += bn/arch/amd64/bn_arch.c
24 21
25EXTRA_DIST += $(ASM_X86_64_MACOSX) 22EXTRA_DIST += $(ASM_X86_64_MACOSX)
26 23
27if HOST_ASM_MACOSX_X86_64 24if HOST_ASM_MACOSX_X86_64
25libcrypto_la_SOURCES += aes/aes_amd64.c
26libcrypto_la_SOURCES += bn/arch/amd64/bn_arch.c
27libcrypto_la_SOURCES += modes/gcm128_amd64.c
28
28libcrypto_la_CPPFLAGS += -DAES_ASM 29libcrypto_la_CPPFLAGS += -DAES_ASM
29libcrypto_la_CPPFLAGS += -DBSAES_ASM 30libcrypto_la_CPPFLAGS += -DBSAES_ASM
30libcrypto_la_CPPFLAGS += -DVPAES_ASM 31libcrypto_la_CPPFLAGS += -DVPAES_ASM
diff --git a/crypto/Makefile.am.masm-x86_64 b/crypto/Makefile.am.masm-x86_64
index 2ef7e1b..bb94e3a 100644
--- a/crypto/Makefile.am.masm-x86_64
+++ b/crypto/Makefile.am.masm-x86_64
@@ -1,7 +1,5 @@
1 1
2ASM_X86_64_MASM = aes/aes-masm-x86_64.S 2ASM_X86_64_MASM = aes/aes-masm-x86_64.S
3ASM_X86_64_MASM += aes/bsaes-masm-x86_64.S
4ASM_X86_64_MASM += aes/vpaes-masm-x86_64.S
5ASM_X86_64_MASM += aes/aesni-masm-x86_64.S 3ASM_X86_64_MASM += aes/aesni-masm-x86_64.S
6ASM_X86_64_MASM += bn/modexp512-masm-x86_64.S 4ASM_X86_64_MASM += bn/modexp512-masm-x86_64.S
7ASM_X86_64_MASM += bn/mont-masm-x86_64.S 5ASM_X86_64_MASM += bn/mont-masm-x86_64.S
@@ -12,6 +10,9 @@ ASM_X86_64_MASM += rc4/rc4-masm-x86_64.S
12EXTRA_DIST += $(ASM_X86_64_MASM) 10EXTRA_DIST += $(ASM_X86_64_MASM)
13 11
14if HOST_ASM_MASM_X86_64 12if HOST_ASM_MASM_X86_64
13libcrypto_la_SOURCES += aes/aes_amd64.c
14libcrypto_la_SOURCES += modes/gcm128_amd64.c
15
15libcrypto_la_CPPFLAGS += -DAES_ASM 16libcrypto_la_CPPFLAGS += -DAES_ASM
16libcrypto_la_CPPFLAGS += -DBSAES_ASM 17libcrypto_la_CPPFLAGS += -DBSAES_ASM
17libcrypto_la_CPPFLAGS += -DVPAES_ASM 18libcrypto_la_CPPFLAGS += -DVPAES_ASM
diff --git a/crypto/Makefile.am.mingw64-x86_64 b/crypto/Makefile.am.mingw64-x86_64
index 8e39e9f..efe2643 100644
--- a/crypto/Makefile.am.mingw64-x86_64
+++ b/crypto/Makefile.am.mingw64-x86_64
@@ -1,7 +1,5 @@
1 1
2ASM_X86_64_MINGW64 = aes/aes-mingw64-x86_64.S 2ASM_X86_64_MINGW64 = aes/aes-mingw64-x86_64.S
3ASM_X86_64_MINGW64 += aes/bsaes-mingw64-x86_64.S
4ASM_X86_64_MINGW64 += aes/vpaes-mingw64-x86_64.S
5ASM_X86_64_MINGW64 += aes/aesni-mingw64-x86_64.S 3ASM_X86_64_MINGW64 += aes/aesni-mingw64-x86_64.S
6#ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S 4#ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S
7#ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S 5#ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S
@@ -12,6 +10,9 @@ ASM_X86_64_MINGW64 += rc4/rc4-mingw64-x86_64.S
12EXTRA_DIST += $(ASM_X86_64_MINGW64) 10EXTRA_DIST += $(ASM_X86_64_MINGW64)
13 11
14if HOST_ASM_MINGW64_X86_64 12if HOST_ASM_MINGW64_X86_64
13libcrypto_la_SOURCES += aes/aes_amd64.c
14libcrypto_la_SOURCES += modes/gcm128_amd64.c
15
15libcrypto_la_CPPFLAGS += -Dendbr32=endbr64 16libcrypto_la_CPPFLAGS += -Dendbr32=endbr64
16libcrypto_la_CPPFLAGS += -DAES_ASM 17libcrypto_la_CPPFLAGS += -DAES_ASM
17libcrypto_la_CPPFLAGS += -DBSAES_ASM 18libcrypto_la_CPPFLAGS += -DBSAES_ASM
diff --git a/crypto/arch/aarch64/crypto_cpu_caps_darwin.c b/crypto/arch/aarch64/crypto_cpu_caps_darwin.c
new file mode 100644
index 0000000..1dd91b2
--- /dev/null
+++ b/crypto/arch/aarch64/crypto_cpu_caps_darwin.c
@@ -0,0 +1,60 @@
1/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
2/*
3 * Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#include <sys/sysctl.h>
19
20#include "crypto_arch.h"
21
22/* Machine dependent CPU capabilities. */
23uint64_t crypto_cpu_caps_aarch64;
24
25static uint64_t
26check_cpu_cap(const char *cap_name, uint64_t cap_flag)
27{
28 int has_cap = 0;
29 size_t len = sizeof(has_cap);
30
31 sysctlbyname(cap_name, &has_cap, &len, NULL, 0);
32
33 return has_cap ? cap_flag : 0;
34}
35
36void
37crypto_cpu_caps_init(void)
38{
39 crypto_cpu_caps_aarch64 = 0;
40
41 /* from https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3918855 */
42
43 crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_AES",
44 CRYPTO_CPU_CAPS_AARCH64_AES);
45
46 crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_PMULL",
47 CRYPTO_CPU_CAPS_AARCH64_PMULL);
48
49 crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA1",
50 CRYPTO_CPU_CAPS_AARCH64_SHA1);
51
52 crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA256",
53 CRYPTO_CPU_CAPS_AARCH64_SHA2);
54
55 crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA512",
56 CRYPTO_CPU_CAPS_AARCH64_SHA512);
57
58 crypto_cpu_caps_aarch64 |= check_cpu_cap("hw.optional.arm.FEAT_SHA3",
59 CRYPTO_CPU_CAPS_AARCH64_SHA3);
60}
diff --git a/crypto/arch/aarch64/crypto_cpu_caps_linux.c b/crypto/arch/aarch64/crypto_cpu_caps_linux.c
new file mode 100644
index 0000000..ae28120
--- /dev/null
+++ b/crypto/arch/aarch64/crypto_cpu_caps_linux.c
@@ -0,0 +1,62 @@
1/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
2/*
3 * Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#include <sys/auxv.h>
19
20/* from arch/arm64/include/uapi/asm/hwcap.h */
21#define HWCAP_AES (1 << 3)
22#define HWCAP_PMULL (1 << 4)
23#define HWCAP_SHA1 (1 << 5)
24#define HWCAP_SHA2 (1 << 6)
25#define HWCAP_CRC32 (1 << 7)
26#define HWCAP_SHA3 (1 << 17)
27#define HWCAP_SHA512 (1 << 21)
28
29#include "crypto_arch.h"
30
31/* Machine dependent CPU capabilities. */
32uint64_t crypto_cpu_caps_aarch64;
33
34static uint64_t
35check_cpu_cap(unsigned long hwcap, uint64_t cap_flag)
36{
37 return (getauxval(AT_HWCAP) & hwcap) ? cap_flag : 0;
38}
39
40void
41crypto_cpu_caps_init(void)
42{
43 crypto_cpu_caps_aarch64 = 0;
44
45 crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_AES,
46 CRYPTO_CPU_CAPS_AARCH64_AES);
47
48 crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_PMULL,
49 CRYPTO_CPU_CAPS_AARCH64_PMULL);
50
51 crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA1,
52 CRYPTO_CPU_CAPS_AARCH64_SHA1);
53
54 crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA2,
55 CRYPTO_CPU_CAPS_AARCH64_SHA2);
56
57 crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA512,
58 CRYPTO_CPU_CAPS_AARCH64_SHA512);
59
60 crypto_cpu_caps_aarch64 |= check_cpu_cap(HWCAP_SHA3,
61 CRYPTO_CPU_CAPS_AARCH64_SHA3);
62}
diff --git a/crypto/arch/aarch64/crypto_cpu_caps_none.c b/crypto/arch/aarch64/crypto_cpu_caps_none.c
new file mode 100644
index 0000000..dcd96b7
--- /dev/null
+++ b/crypto/arch/aarch64/crypto_cpu_caps_none.c
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17#include "crypto_arch.h"
18
19/* Machine dependent CPU capabilities. */
20uint64_t crypto_cpu_caps_aarch64;
21
22void
23crypto_cpu_caps_init(void)
24{
25 crypto_cpu_caps_aarch64 = 0;
26}
diff --git a/crypto/arch/aarch64/crypto_cpu_caps_windows.c b/crypto/arch/aarch64/crypto_cpu_caps_windows.c
new file mode 100644
index 0000000..e7cdded
--- /dev/null
+++ b/crypto/arch/aarch64/crypto_cpu_caps_windows.c
@@ -0,0 +1,36 @@
1/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
2/*
3 * Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#include <windows.h>
19
20#include "crypto_arch.h"
21
22/* Machine dependent CPU capabilities. */
23uint64_t crypto_cpu_caps_aarch64;
24
25void
26crypto_cpu_caps_init(void)
27{
28 crypto_cpu_caps_aarch64 = 0;
29
30 if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) {
31 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_AES;
32 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_PMULL;
33 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_SHA1;
34 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_SHA2;
35 }
36}
diff --git a/crypto/compat/.gitignore b/crypto/compat/.gitignore
new file mode 100644
index 0000000..7f05049
--- /dev/null
+++ b/crypto/compat/.gitignore
@@ -0,0 +1,31 @@
1arc4random.c
2arc4random_aix.h
3arc4random_freebsd.h
4arc4random_hpux.h
5arc4random_linux.h
6arc4random_netbsd.h
7arc4random_osx.h
8arc4random_solaris.h
9arc4random_uniform.c
10arc4random_win.h
11chacha_private.h
12explicit_bzero.c
13getentropy_aix.c
14getentropy_freebsd.c
15getentropy_hpux.c
16getentropy_linux.c
17getentropy_netbsd.c
18getentropy_osx.c
19getentropy_solaris.c
20getentropy_win.c
21reallocarray.c
22recallocarray.c
23strcasecmp.c
24strlcat.c
25strlcpy.c
26strndup.c
27strnlen.c
28strsep.c
29strtonum.c
30timingsafe_bcmp.c
31timingsafe_memcmp.c
diff --git a/crypto/compat/b_win.c b/crypto/compat/b_win.c
index e261cd2..45af839 100644
--- a/crypto/compat/b_win.c
+++ b/crypto/compat/b_win.c
@@ -8,7 +8,8 @@
8#include <ws2tcpip.h> 8#include <ws2tcpip.h>
9 9
10#include <openssl/bio.h> 10#include <openssl/bio.h>
11#include <openssl/err.h> 11
12#include "err_local.h"
12 13
13int 14int
14BIO_sock_init(void) 15BIO_sock_init(void)
@@ -29,7 +30,7 @@ BIO_sock_init(void)
29 } 30 }
30 wsa_init_done = 1; 31 wsa_init_done = 1;
31 } 32 }
32 return (1); 33 return (1);
33} 34}
34 35
35void 36void
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c
index 1fbfce1..572e527 100644
--- a/crypto/compat/posix_win.c
+++ b/crypto/compat/posix_win.c
@@ -22,6 +22,25 @@
22#include <string.h> 22#include <string.h>
23#include <unistd.h> 23#include <unistd.h>
24 24
25#include <sys/stat.h>
26
27static int
28is_socket(int fd)
29{
30 // Border case: Don't break std* file descriptors
31 if (fd < 3)
32 return 0;
33
34 // All locally-allocated file descriptors will have the high bit set
35 return (fd & 0x80000000) == 0;
36}
37
38static int
39get_real_fd(int fd)
40{
41 return (fd & 0x7fffffff);
42}
43
25void 44void
26posix_perror(const char *s) 45posix_perror(const char *s)
27{ 46{
@@ -44,6 +63,12 @@ posix_fopen(const char *path, const char *mode)
44} 63}
45 64
46int 65int
66libressl_fstat(int fd, struct stat *statbuf)
67{
68 return fstat(get_real_fd(fd), statbuf);
69}
70
71int
47posix_open(const char *path, ...) 72posix_open(const char *path, ...)
48{ 73{
49 va_list ap; 74 va_list ap;
@@ -62,7 +87,11 @@ posix_open(const char *path, ...)
62 flags |= O_NOINHERIT; 87 flags |= O_NOINHERIT;
63 } 88 }
64 flags &= ~O_NONBLOCK; 89 flags &= ~O_NONBLOCK;
65 return open(path, flags, mode); 90
91 const int fh = open(path, flags, mode);
92
93 // Set high bit to mark file descriptor as a file handle
94 return fh + 0x80000000;
66} 95}
67 96
68char * 97char *
@@ -150,52 +179,6 @@ wsa_errno(int err)
150 return -1; 179 return -1;
151} 180}
152 181
153/*
154 * Employ a similar trick to cpython (pycore_fileutils.h) where the CRT report
155 * handler is disabled while checking if a descriptor is a socket or a file
156 */
157#if defined _MSC_VER && _MSC_VER >= 1900
158
159#include <crtdbg.h>
160#include <stdlib.h>
161
162static void noop_handler(const wchar_t *expression, const wchar_t *function,
163 const wchar_t *file, unsigned int line, uintptr_t pReserved)
164{
165 return;
166}
167
168#define BEGIN_SUPPRESS_IPH \
169 const int old_report_mode = _CrtSetReportMode(_CRT_ASSERT, 0); \
170 const _invalid_parameter_handler old_handler = _set_thread_local_invalid_parameter_handler(noop_handler)
171#define END_SUPPRESS_IPH \
172 (void)old_report_mode; /* Silence warning in release mode when _CrtSetReportMode compiles to void. */ \
173 _CrtSetReportMode(_CRT_ASSERT, old_report_mode); \
174 _set_thread_local_invalid_parameter_handler(old_handler)
175
176#else
177
178#define BEGIN_SUPPRESS_IPH
179#define END_SUPPRESS_IPH
180
181#endif
182
183static int
184is_socket(int fd)
185{
186 intptr_t hd;
187
188 BEGIN_SUPPRESS_IPH;
189 hd = _get_osfhandle(fd);
190 END_SUPPRESS_IPH;
191
192 if (hd == (intptr_t)INVALID_HANDLE_VALUE) {
193 return 1; /* fd is not file descriptor */
194 }
195
196 return 0;
197}
198
199int 182int
200posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) 183posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
201{ 184{
@@ -209,14 +192,13 @@ int
209posix_close(int fd) 192posix_close(int fd)
210{ 193{
211 int rc; 194 int rc;
212
213 if (is_socket(fd)) { 195 if (is_socket(fd)) {
214 if ((rc = closesocket(fd)) == SOCKET_ERROR) { 196 if ((rc = closesocket(fd)) == SOCKET_ERROR) {
215 int err = WSAGetLastError(); 197 int err = WSAGetLastError();
216 rc = wsa_errno(err); 198 rc = wsa_errno(err);
217 } 199 }
218 } else { 200 } else {
219 rc = close(fd); 201 rc = close(get_real_fd(fd));
220 } 202 }
221 return rc; 203 return rc;
222} 204}
@@ -225,14 +207,13 @@ ssize_t
225posix_read(int fd, void *buf, size_t count) 207posix_read(int fd, void *buf, size_t count)
226{ 208{
227 ssize_t rc; 209 ssize_t rc;
228
229 if (is_socket(fd)) { 210 if (is_socket(fd)) {
230 if ((rc = recv(fd, buf, count, 0)) == SOCKET_ERROR) { 211 if ((rc = recv(fd, buf, count, 0)) == SOCKET_ERROR) {
231 int err = WSAGetLastError(); 212 int err = WSAGetLastError();
232 rc = wsa_errno(err); 213 rc = wsa_errno(err);
233 } 214 }
234 } else { 215 } else {
235 rc = read(fd, buf, count); 216 rc = read(get_real_fd(fd), buf, count);
236 } 217 }
237 return rc; 218 return rc;
238} 219}
@@ -246,7 +227,7 @@ posix_write(int fd, const void *buf, size_t count)
246 rc = wsa_errno(WSAGetLastError()); 227 rc = wsa_errno(WSAGetLastError());
247 } 228 }
248 } else { 229 } else {
249 rc = write(fd, buf, count); 230 rc = write(get_real_fd(fd), buf, count);
250 } 231 }
251 return rc; 232 return rc;
252} 233}
diff --git a/dist.sh b/dist.sh
index e367038..9c4d35d 100755
--- a/dist.sh
+++ b/dist.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16#
2set -e 17set -e
3 18
4rm -f man/*.[35] include/openssl/*.h 19rm -f man/*.[35] include/openssl/*.h
diff --git a/gen-coverage-report.sh b/gen-coverage-report.sh
index b11f3f9..6453ecb 100755
--- a/gen-coverage-report.sh
+++ b/gen-coverage-report.sh
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15#
1#!/bin/sh 16#!/bin/sh
2 17
3VERSION=$(cat VERSION) 18VERSION=$(cat VERSION)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 11ab7c2..04160af 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2016 Jeff Davey
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1if(ENABLE_LIBRESSL_INSTALL) 16if(ENABLE_LIBRESSL_INSTALL)
2 install(DIRECTORY . 17 install(DIRECTORY .
3 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 18 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
diff --git a/include/Makefile.am b/include/Makefile.am
index feaaa60..a3e1c19 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3EXTRA_DIST = CMakeLists.txt 18EXTRA_DIST = CMakeLists.txt
@@ -52,6 +67,7 @@ noinst_HEADERS += arch/amd64/opensslconf.h
52noinst_HEADERS += arch/arm/opensslconf.h 67noinst_HEADERS += arch/arm/opensslconf.h
53noinst_HEADERS += arch/hppa/opensslconf.h 68noinst_HEADERS += arch/hppa/opensslconf.h
54noinst_HEADERS += arch/i386/opensslconf.h 69noinst_HEADERS += arch/i386/opensslconf.h
70noinst_HEADERS += arch/loongarch64/opensslconf.h
55noinst_HEADERS += arch/m88k/opensslconf.h 71noinst_HEADERS += arch/m88k/opensslconf.h
56noinst_HEADERS += arch/mips/opensslconf.h 72noinst_HEADERS += arch/mips/opensslconf.h
57noinst_HEADERS += arch/mips64/opensslconf.h 73noinst_HEADERS += arch/mips64/opensslconf.h
diff --git a/include/arch/loongarch64/opensslconf.h b/include/arch/loongarch64/opensslconf.h
index 731b06a..868066c 100644
--- a/include/arch/loongarch64/opensslconf.h
+++ b/include/arch/loongarch64/opensslconf.h
@@ -1,9 +1,4 @@
1#include <openssl/opensslfeatures.h> 1#include <openssl/opensslfeatures.h>
2/* crypto/opensslconf.h.in */
3
4#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR)
5#define OPENSSLDIR "/etc/ssl"
6#endif
7 2
8#undef OPENSSL_EXPORT_VAR_AS_FUNCTION 3#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
9 4
@@ -17,30 +12,7 @@
17#endif 12#endif
18#endif 13#endif
19 14
20#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
21#define IDEA_INT unsigned int
22#endif
23
24#if defined(HEADER_MD2_H) && !defined(MD2_INT)
25#define MD2_INT unsigned int
26#endif
27
28#if defined(HEADER_RC2_H) && !defined(RC2_INT)
29/* I need to put in a mod for the alpha - eay */
30#define RC2_INT unsigned int
31#endif
32
33#if defined(HEADER_RC4_H) 15#if defined(HEADER_RC4_H)
34#if !defined(RC4_INT)
35/* using int types make the structure larger but make the code faster
36 * on most boxes I have tested - up to %20 faster. */
37/*
38 * I don't know what does "most" mean, but declaring "int" is a must on:
39 * - Intel P6 because partial register stalls are very expensive;
40 * - elder Alpha because it lacks byte load/store instructions;
41 */
42#define RC4_INT unsigned int
43#endif
44#if !defined(RC4_CHUNK) 16#if !defined(RC4_CHUNK)
45/* 17/*
46 * This enables code handling data aligned at natural CPU word 18 * This enables code handling data aligned at natural CPU word
@@ -49,106 +21,3 @@
49#define RC4_CHUNK unsigned long 21#define RC4_CHUNK unsigned long
50#endif 22#endif
51#endif 23#endif
52
53#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
54/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
55 * %20 speed up (longs are 8 bytes, int's are 4). */
56#ifndef DES_LONG
57#define DES_LONG unsigned int
58#endif
59#endif
60
61#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
62#define CONFIG_HEADER_BN_H
63#undef BN_LLONG
64
65/* Should we define BN_DIV2W here? */
66
67/* Only one for the following should be defined */
68/* The prime number generation stuff may not work when
69 * EIGHT_BIT but I don't care since I've only used this mode
70 * for debugging the bignum libraries */
71#define SIXTY_FOUR_BIT_LONG
72#undef SIXTY_FOUR_BIT
73#undef THIRTY_TWO_BIT
74#undef SIXTEEN_BIT
75#undef EIGHT_BIT
76#endif
77
78#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
79#define CONFIG_HEADER_BF_LOCL_H
80#undef BF_PTR
81#endif /* HEADER_BF_LOCL_H */
82
83#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
84#define CONFIG_HEADER_DES_LOCL_H
85#ifndef DES_DEFAULT_OPTIONS
86/* the following is tweaked from a config script, that is why it is a
87 * protected undef/define */
88#ifndef DES_PTR
89#undef DES_PTR
90#endif
91
92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */
95#ifndef DES_RISC1
96#undef DES_RISC1
97#endif
98
99#ifndef DES_RISC2
100#undef DES_RISC2
101#endif
102
103#if defined(DES_RISC1) && defined(DES_RISC2)
104YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif
106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very much CPU dependent */
109#ifndef DES_UNROLL
110#define DES_UNROLL
111#endif
112
113/* These default values were supplied by
114 * Peter Gutman <pgut001@cs.auckland.ac.nz>
115 * They are only used if nothing else has been defined */
116#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
117/* Special defines which change the way the code is built depending on the
118 CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
119 even newer MIPS CPU's, but at the moment one size fits all for
120 optimization options. Older Sparc's work better with only UNROLL, but
121 there's no way to tell at compile time what it is you're running on */
122
123#if defined( sun ) /* Newer Sparc's */
124# define DES_PTR
125# define DES_RISC1
126# define DES_UNROLL
127#elif defined( __ultrix ) /* Older MIPS */
128# define DES_PTR
129# define DES_RISC2
130# define DES_UNROLL
131#elif defined( __osf1__ ) /* Alpha */
132# define DES_PTR
133# define DES_RISC2
134#elif defined ( _AIX ) /* RS6000 */
135 /* Unknown */
136#elif defined( __hpux ) /* HP-PA */
137 /* Unknown */
138#elif defined( __aux ) /* 68K */
139 /* Unknown */
140#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
141# define DES_UNROLL
142#elif defined( __sgi ) /* Newer MIPS */
143# define DES_PTR
144# define DES_RISC2
145# define DES_UNROLL
146#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
147# define DES_PTR
148# define DES_RISC1
149# define DES_UNROLL
150#endif /* Systems-specific speed defines */
151#endif
152
153#endif /* DES_DEFAULT_OPTIONS */
154#endif /* HEADER_DES_LOCL_H */
diff --git a/include/arch/mips/opensslconf.h b/include/arch/mips/opensslconf.h
index a5d26b6..dcbe113 100644
--- a/include/arch/mips/opensslconf.h
+++ b/include/arch/mips/opensslconf.h
@@ -1,9 +1,4 @@
1#include <openssl/opensslfeatures.h> 1#include <openssl/opensslfeatures.h>
2/* crypto/opensslconf.h.in */
3
4#if defined(HEADER_CRYPTO_LOCAL_H) && !defined(OPENSSLDIR)
5#define OPENSSLDIR "/etc/ssl"
6#endif
7 2
8#undef OPENSSL_EXPORT_VAR_AS_FUNCTION 3#undef OPENSSL_EXPORT_VAR_AS_FUNCTION
9 4
@@ -17,30 +12,7 @@
17#endif 12#endif
18#endif 13#endif
19 14
20#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)
21#define IDEA_INT unsigned int
22#endif
23
24#if defined(HEADER_MD2_H) && !defined(MD2_INT)
25#define MD2_INT unsigned int
26#endif
27
28#if defined(HEADER_RC2_H) && !defined(RC2_INT)
29/* I need to put in a mod for the alpha - eay */
30#define RC2_INT unsigned int
31#endif
32
33#if defined(HEADER_RC4_H) 15#if defined(HEADER_RC4_H)
34#if !defined(RC4_INT)
35/* using int types make the structure larger but make the code faster
36 * on most boxes I have tested - up to %20 faster. */
37/*
38 * I don't know what does "most" mean, but declaring "int" is a must on:
39 * - Intel P6 because partial register stalls are very expensive;
40 * - elder Alpha because it lacks byte load/store instructions;
41 */
42#define RC4_INT unsigned int
43#endif
44#if !defined(RC4_CHUNK) 16#if !defined(RC4_CHUNK)
45/* 17/*
46 * This enables code handling data aligned at natural CPU word 18 * This enables code handling data aligned at natural CPU word
@@ -49,106 +21,3 @@
49#undef RC4_CHUNK 21#undef RC4_CHUNK
50#endif 22#endif
51#endif 23#endif
52
53#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)
54/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a
55 * %20 speed up (longs are 8 bytes, int's are 4). */
56#ifndef DES_LONG
57#define DES_LONG unsigned int
58#endif
59#endif
60
61#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)
62#define CONFIG_HEADER_BN_H
63#define BN_LLONG
64
65/* Should we define BN_DIV2W here? */
66
67/* Only one for the following should be defined */
68/* The prime number generation stuff may not work when
69 * EIGHT_BIT but I don't care since I've only used this mode
70 * for debugging the bignum libraries */
71#undef SIXTY_FOUR_BIT_LONG
72#undef SIXTY_FOUR_BIT
73#define THIRTY_TWO_BIT
74#undef SIXTEEN_BIT
75#undef EIGHT_BIT
76#endif
77
78#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
79#define CONFIG_HEADER_BF_LOCL_H
80#undef BF_PTR
81#endif /* HEADER_BF_LOCL_H */
82
83#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)
84#define CONFIG_HEADER_DES_LOCL_H
85#ifndef DES_DEFAULT_OPTIONS
86/* the following is tweaked from a config script, that is why it is a
87 * protected undef/define */
88#ifndef DES_PTR
89#undef DES_PTR
90#endif
91
92/* This helps C compiler generate the correct code for multiple functional
93 * units. It reduces register dependencies at the expense of 2 more
94 * registers */
95#ifndef DES_RISC1
96#undef DES_RISC1
97#endif
98
99#ifndef DES_RISC2
100#undef DES_RISC2
101#endif
102
103#if defined(DES_RISC1) && defined(DES_RISC2)
104YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
105#endif
106
107/* Unroll the inner loop, this sometimes helps, sometimes hinders.
108 * Very much CPU dependent */
109#ifndef DES_UNROLL
110#define DES_UNROLL
111#endif
112
113/* These default values were supplied by
114 * Peter Gutman <pgut001@cs.auckland.ac.nz>
115 * They are only used if nothing else has been defined */
116#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)
117/* Special defines which change the way the code is built depending on the
118 CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find
119 even newer MIPS CPU's, but at the moment one size fits all for
120 optimization options. Older Sparc's work better with only UNROLL, but
121 there's no way to tell at compile time what it is you're running on */
122
123#if defined( sun ) /* Newer Sparc's */
124# define DES_PTR
125# define DES_RISC1
126# define DES_UNROLL
127#elif defined( __ultrix ) /* Older MIPS */
128# define DES_PTR
129# define DES_RISC2
130# define DES_UNROLL
131#elif defined( __osf1__ ) /* Alpha */
132# define DES_PTR
133# define DES_RISC2
134#elif defined ( _AIX ) /* RS6000 */
135 /* Unknown */
136#elif defined( __hpux ) /* HP-PA */
137 /* Unknown */
138#elif defined( __aux ) /* 68K */
139 /* Unknown */
140#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */
141# define DES_UNROLL
142#elif defined( __sgi ) /* Newer MIPS */
143# define DES_PTR
144# define DES_RISC2
145# define DES_UNROLL
146#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */
147# define DES_PTR
148# define DES_RISC1
149# define DES_UNROLL
150#endif /* Systems-specific speed defines */
151#endif
152
153#endif /* DES_DEFAULT_OPTIONS */
154#endif /* HEADER_DES_LOCL_H */
diff --git a/include/compat/sys/stat.h b/include/compat/sys/stat.h
index b88da1d..57aa521 100644
--- a/include/compat/sys/stat.h
+++ b/include/compat/sys/stat.h
@@ -118,4 +118,12 @@
118 118
119#endif 119#endif
120 120
121#ifdef _WIN32
122int libressl_fstat(int fd, struct stat *statbuf);
123
124#ifndef NO_REDEF_POSIX_FUNCTIONS
125#define fstat(fd, statbuf) libressl_fstat(fd, statbuf)
126#endif
127#endif
128
121#endif 129#endif
diff --git a/libcrypto.pc.in b/libcrypto.pc.in
index 11d7ef0..c11fbd3 100644
--- a/libcrypto.pc.in
+++ b/libcrypto.pc.in
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15#
1#libcrypto pkg-config source file 16#libcrypto pkg-config source file
2 17
3prefix=@prefix@ 18prefix=@prefix@
diff --git a/libssl.pc.in b/libssl.pc.in
index 512ec1c..9d0d641 100644
--- a/libssl.pc.in
+++ b/libssl.pc.in
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15#
1#libssl pkg-config source file 16#libssl pkg-config source file
2 17
3prefix=@prefix@ 18prefix=@prefix@
diff --git a/libtls.pc.in b/libtls.pc.in
index 3c49391..19c8134 100644
--- a/libtls.pc.in
+++ b/libtls.pc.in
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15#
1#libtls pkg-config source file 16#libtls pkg-config source file
2 17
3prefix=@prefix@ 18prefix=@prefix@
diff --git a/m4/check-libc.m4 b/m4/check-libc.m4
index 8cb849b..dadf0da 100644
--- a/m4/check-libc.m4
+++ b/m4/check-libc.m4
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1AC_DEFUN([CHECK_LIBC_COMPAT], [ 16AC_DEFUN([CHECK_LIBC_COMPAT], [
2# Check for libc headers 17# Check for libc headers
3AC_CHECK_HEADERS([endian.h machine/endian.h err.h readpassphrase.h]) 18AC_CHECK_HEADERS([endian.h machine/endian.h err.h readpassphrase.h])
diff --git a/m4/check-os-options.m4 b/m4/check-os-options.m4
index 2ef4293..fd63d77 100644
--- a/m4/check-os-options.m4
+++ b/m4/check-os-options.m4
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1AC_DEFUN([CHECK_OS_OPTIONS], [ 16AC_DEFUN([CHECK_OS_OPTIONS], [
2 17
3CFLAGS="$CFLAGS -Wall -std=gnu99 -fno-strict-aliasing" 18CFLAGS="$CFLAGS -Wall -std=gnu99 -fno-strict-aliasing"
@@ -74,14 +89,14 @@ char buf[1]; getentropy(buf, 1);
74 ;; 89 ;;
75 *hpux*) 90 *hpux*)
76 HOST_OS=hpux; 91 HOST_OS=hpux;
77 if test "`echo $host_os | cut -c 1-4`" = "ia64" ; then 92 if test "echo $host_os | cut -c 1-4" = "ia64" ; then
78 if test "`echo $CC | cut -d ' ' -f 1`" = "gcc" ; then 93 if test "echo $CC | cut -d ' ' -f 1" = "gcc" ; then
79 CFLAGS="$CFLAGS -mlp64" 94 CFLAGS="$CFLAGS -mlp64"
80 else 95 else
81 CFLAGS="+DD64" 96 CFLAGS="+DD64"
82 fi 97 fi
83 fi 98 fi
84 if ! test "`echo $CC | cut -d ' ' -f 1`" = "gcc" ; then 99 if ! test "echo $CC | cut -d ' ' -f 1" = "gcc" ; then
85 CFLAGS="-g -O2 +Otype_safety=off $CFLAGS $USER_CFLAGS" 100 CFLAGS="-g -O2 +Otype_safety=off $CFLAGS $USER_CFLAGS"
86 fi 101 fi
87 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT" 102 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT"
diff --git a/m4/disable-compiler-warnings.m4 b/m4/disable-compiler-warnings.m4
index 2792722..052e8ab 100644
--- a/m4/disable-compiler-warnings.m4
+++ b/m4/disable-compiler-warnings.m4
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1AC_DEFUN([DISABLE_COMPILER_WARNINGS], [ 16AC_DEFUN([DISABLE_COMPILER_WARNINGS], [
2# Clang throws a lot of warnings when it does not understand a flag. Disable 17# Clang throws a lot of warnings when it does not understand a flag. Disable
3# this warning for now so other warnings are visible. 18# this warning for now so other warnings are visible.
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 462a831..8f1121e 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2015 Jeff Davey
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1if(ENABLE_LIBRESSL_INSTALL) 16if(ENABLE_LIBRESSL_INSTALL)
2 install(DIRECTORY . 17 install(DIRECTORY .
3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 18 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
diff --git a/man/links b/man/links
index b1dbf82..37c7b42 100644
--- a/man/links
+++ b/man/links
@@ -185,9 +185,7 @@ BIO_ctrl.3,BIO_set_info_callback.3
185BIO_ctrl.3,BIO_tell.3 185BIO_ctrl.3,BIO_tell.3
186BIO_ctrl.3,BIO_wpending.3 186BIO_ctrl.3,BIO_wpending.3
187BIO_ctrl.3,bio_info_cb.3 187BIO_ctrl.3,bio_info_cb.3
188BIO_dump.3,BIO_dump_fp.3
189BIO_dump.3,BIO_dump_indent.3 188BIO_dump.3,BIO_dump_indent.3
190BIO_dump.3,BIO_dump_indent_fp.3
191BIO_dup_chain.3,BIO_dup_state.3 189BIO_dup_chain.3,BIO_dup_state.3
192BIO_f_buffer.3,BIO_get_buffer_num_lines.3 190BIO_f_buffer.3,BIO_get_buffer_num_lines.3
193BIO_f_buffer.3,BIO_set_buffer_read_data.3 191BIO_f_buffer.3,BIO_set_buffer_read_data.3
@@ -644,37 +642,33 @@ ECDSA_SIG_new.3,ECDSA_size.3
644ECDSA_SIG_new.3,ECDSA_verify.3 642ECDSA_SIG_new.3,ECDSA_verify.3
645ECDSA_SIG_new.3,d2i_ECDSA_SIG.3 643ECDSA_SIG_new.3,d2i_ECDSA_SIG.3
646ECDSA_SIG_new.3,i2d_ECDSA_SIG.3 644ECDSA_SIG_new.3,i2d_ECDSA_SIG.3
647EC_GROUP_copy.3,EC_GROUP_check.3 645EC_GROUP_check.3,EC_GROUP_check_discriminant.3
648EC_GROUP_copy.3,EC_GROUP_check_discriminant.3 646EC_GROUP_get_curve_name.3,EC_GROUP_get0_seed.3
649EC_GROUP_copy.3,EC_GROUP_cmp.3 647EC_GROUP_get_curve_name.3,EC_GROUP_get_asn1_flag.3
650EC_GROUP_copy.3,EC_GROUP_dup.3 648EC_GROUP_get_curve_name.3,EC_GROUP_get_basis_type.3
651EC_GROUP_copy.3,EC_GROUP_get0_generator.3 649EC_GROUP_get_curve_name.3,EC_GROUP_get_point_conversion_form.3
652EC_GROUP_copy.3,EC_GROUP_get0_seed.3 650EC_GROUP_get_curve_name.3,EC_GROUP_get_seed_len.3
653EC_GROUP_copy.3,EC_GROUP_get_asn1_flag.3 651EC_GROUP_get_curve_name.3,EC_GROUP_set_asn1_flag.3
654EC_GROUP_copy.3,EC_GROUP_get_basis_type.3 652EC_GROUP_get_curve_name.3,EC_GROUP_set_curve_name.3
655EC_GROUP_copy.3,EC_GROUP_get_cofactor.3 653EC_GROUP_get_curve_name.3,EC_GROUP_set_point_conversion_form.3
656EC_GROUP_copy.3,EC_GROUP_get_curve_name.3 654EC_GROUP_get_curve_name.3,EC_GROUP_set_seed.3
657EC_GROUP_copy.3,EC_GROUP_get_degree.3 655EC_GROUP_new_by_curve_name.3,EC_GROUP_cmp.3
658EC_GROUP_copy.3,EC_GROUP_get_order.3 656EC_GROUP_new_by_curve_name.3,EC_GROUP_dup.3
659EC_GROUP_copy.3,EC_GROUP_get_point_conversion_form.3 657EC_GROUP_new_by_curve_name.3,EC_GROUP_free.3
660EC_GROUP_copy.3,EC_GROUP_get_seed_len.3 658EC_GROUP_new_by_curve_name.3,EC_curve_nid2nist.3
661EC_GROUP_copy.3,EC_GROUP_order_bits.3 659EC_GROUP_new_by_curve_name.3,EC_curve_nist2nid.3
662EC_GROUP_copy.3,EC_GROUP_set_asn1_flag.3 660EC_GROUP_new_by_curve_name.3,EC_get_builtin_curves.3
663EC_GROUP_copy.3,EC_GROUP_set_curve_name.3 661EC_GROUP_new_curve_GFp.3,EC_GROUP_clear_free.3
664EC_GROUP_copy.3,EC_GROUP_set_generator.3 662EC_GROUP_new_curve_GFp.3,EC_GROUP_get0_generator.3
665EC_GROUP_copy.3,EC_GROUP_set_point_conversion_form.3 663EC_GROUP_new_curve_GFp.3,EC_GROUP_get_cofactor.3
666EC_GROUP_copy.3,EC_GROUP_set_seed.3 664EC_GROUP_new_curve_GFp.3,EC_GROUP_get_curve.3
667EC_GROUP_new.3,EC_GROUP_clear_free.3 665EC_GROUP_new_curve_GFp.3,EC_GROUP_get_curve_GFp.3
668EC_GROUP_new.3,EC_GROUP_free.3 666EC_GROUP_new_curve_GFp.3,EC_GROUP_get_degree.3
669EC_GROUP_new.3,EC_GROUP_get_curve.3 667EC_GROUP_new_curve_GFp.3,EC_GROUP_get_order.3
670EC_GROUP_new.3,EC_GROUP_get_curve_GFp.3 668EC_GROUP_new_curve_GFp.3,EC_GROUP_order_bits.3
671EC_GROUP_new.3,EC_GROUP_new_by_curve_name.3 669EC_GROUP_new_curve_GFp.3,EC_GROUP_set_curve.3
672EC_GROUP_new.3,EC_GROUP_new_curve_GFp.3 670EC_GROUP_new_curve_GFp.3,EC_GROUP_set_curve_GFp.3
673EC_GROUP_new.3,EC_GROUP_set_curve.3 671EC_GROUP_new_curve_GFp.3,EC_GROUP_set_generator.3
674EC_GROUP_new.3,EC_GROUP_set_curve_GFp.3
675EC_GROUP_new.3,EC_curve_nid2nist.3
676EC_GROUP_new.3,EC_curve_nist2nid.3
677EC_GROUP_new.3,EC_get_builtin_curves.3
678EC_KEY_METHOD_new.3,EC_KEY_METHOD_free.3 672EC_KEY_METHOD_new.3,EC_KEY_METHOD_free.3
679EC_KEY_METHOD_new.3,EC_KEY_METHOD_get_compute_key.3 673EC_KEY_METHOD_new.3,EC_KEY_METHOD_get_compute_key.3
680EC_KEY_METHOD_new.3,EC_KEY_METHOD_get_init.3 674EC_KEY_METHOD_new.3,EC_KEY_METHOD_get_init.3
@@ -724,23 +718,21 @@ EC_POINT_add.3,EC_POINT_is_at_infinity.3
724EC_POINT_add.3,EC_POINT_is_on_curve.3 718EC_POINT_add.3,EC_POINT_is_on_curve.3
725EC_POINT_add.3,EC_POINT_make_affine.3 719EC_POINT_add.3,EC_POINT_make_affine.3
726EC_POINT_add.3,EC_POINT_mul.3 720EC_POINT_add.3,EC_POINT_mul.3
727EC_POINT_new.3,EC_POINT_bn2point.3 721EC_POINT_get_affine_coordinates.3,EC_POINT_get_affine_coordinates_GFp.3
722EC_POINT_get_affine_coordinates.3,EC_POINT_set_affine_coordinates.3
723EC_POINT_get_affine_coordinates.3,EC_POINT_set_affine_coordinates_GFp.3
724EC_POINT_get_affine_coordinates.3,EC_POINT_set_compressed_coordinates.3
725EC_POINT_get_affine_coordinates.3,EC_POINT_set_compressed_coordinates_GFp.3
726EC_POINT_get_affine_coordinates.3,EC_POINT_set_to_infinity.3
728EC_POINT_new.3,EC_POINT_clear_free.3 727EC_POINT_new.3,EC_POINT_clear_free.3
729EC_POINT_new.3,EC_POINT_copy.3 728EC_POINT_new.3,EC_POINT_copy.3
730EC_POINT_new.3,EC_POINT_dup.3 729EC_POINT_new.3,EC_POINT_dup.3
731EC_POINT_new.3,EC_POINT_free.3 730EC_POINT_new.3,EC_POINT_free.3
732EC_POINT_new.3,EC_POINT_get_affine_coordinates.3 731EC_POINT_point2oct.3,EC_POINT_bn2point.3
733EC_POINT_new.3,EC_POINT_get_affine_coordinates_GFp.3 732EC_POINT_point2oct.3,EC_POINT_hex2point.3
734EC_POINT_new.3,EC_POINT_hex2point.3 733EC_POINT_point2oct.3,EC_POINT_oct2point.3
735EC_POINT_new.3,EC_POINT_oct2point.3 734EC_POINT_point2oct.3,EC_POINT_point2bn.3
736EC_POINT_new.3,EC_POINT_point2bn.3 735EC_POINT_point2oct.3,EC_POINT_point2hex.3
737EC_POINT_new.3,EC_POINT_point2hex.3
738EC_POINT_new.3,EC_POINT_point2oct.3
739EC_POINT_new.3,EC_POINT_set_affine_coordinates.3
740EC_POINT_new.3,EC_POINT_set_affine_coordinates_GFp.3
741EC_POINT_new.3,EC_POINT_set_compressed_coordinates.3
742EC_POINT_new.3,EC_POINT_set_compressed_coordinates_GFp.3
743EC_POINT_new.3,EC_POINT_set_to_infinity.3
744ENGINE_new.3,ENGINE_by_id.3 736ENGINE_new.3,ENGINE_by_id.3
745ENGINE_new.3,ENGINE_cleanup.3 737ENGINE_new.3,ENGINE_cleanup.3
746ENGINE_new.3,ENGINE_ctrl_cmd.3 738ENGINE_new.3,ENGINE_ctrl_cmd.3
@@ -1182,11 +1174,6 @@ MD5.3,MD5_Update.3
1182NAME_CONSTRAINTS_new.3,GENERAL_SUBTREE_free.3 1174NAME_CONSTRAINTS_new.3,GENERAL_SUBTREE_free.3
1183NAME_CONSTRAINTS_new.3,GENERAL_SUBTREE_new.3 1175NAME_CONSTRAINTS_new.3,GENERAL_SUBTREE_new.3
1184NAME_CONSTRAINTS_new.3,NAME_CONSTRAINTS_free.3 1176NAME_CONSTRAINTS_new.3,NAME_CONSTRAINTS_free.3
1185OBJ_NAME_add.3,OBJ_NAME_cleanup.3
1186OBJ_NAME_add.3,OBJ_NAME_get.3
1187OBJ_NAME_add.3,OBJ_NAME_init.3
1188OBJ_NAME_add.3,OBJ_NAME_new_index.3
1189OBJ_NAME_add.3,OBJ_NAME_remove.3
1190OBJ_create.3,OBJ_add_object.3 1177OBJ_create.3,OBJ_add_object.3
1191OBJ_create.3,OBJ_cleanup.3 1178OBJ_create.3,OBJ_cleanup.3
1192OBJ_create.3,OBJ_create_objects.3 1179OBJ_create.3,OBJ_create_objects.3
@@ -1271,7 +1258,6 @@ OPENSSL_VERSION_NUMBER.3,SSLeay.3
1271OPENSSL_VERSION_NUMBER.3,SSLeay_version.3 1258OPENSSL_VERSION_NUMBER.3,SSLeay_version.3
1272OPENSSL_config.3,OPENSSL_no_config.3 1259OPENSSL_config.3,OPENSSL_no_config.3
1273OPENSSL_init_crypto.3,OPENSSL_init.3 1260OPENSSL_init_crypto.3,OPENSSL_init.3
1274OPENSSL_load_builtin_modules.3,ASN1_add_oid_module.3
1275OPENSSL_malloc.3,CRYPTO_free.3 1261OPENSSL_malloc.3,CRYPTO_free.3
1276OPENSSL_malloc.3,CRYPTO_malloc.3 1262OPENSSL_malloc.3,CRYPTO_malloc.3
1277OPENSSL_malloc.3,CRYPTO_strdup.3 1263OPENSSL_malloc.3,CRYPTO_strdup.3
@@ -1303,7 +1289,6 @@ OpenSSL_add_all_algorithms.3,OpenSSL_add_all_digests.3
1303OpenSSL_add_all_algorithms.3,SSLeay_add_all_algorithms.3 1289OpenSSL_add_all_algorithms.3,SSLeay_add_all_algorithms.3
1304PEM_ASN1_read.3,PEM_ASN1_read_bio.3 1290PEM_ASN1_read.3,PEM_ASN1_read_bio.3
1305PEM_ASN1_read.3,d2i_of_void.3 1291PEM_ASN1_read.3,d2i_of_void.3
1306PEM_X509_INFO_read.3,PEM_X509_INFO_read_bio.3
1307PEM_read.3,PEM_def_callback.3 1292PEM_read.3,PEM_def_callback.3
1308PEM_read.3,PEM_do_header.3 1293PEM_read.3,PEM_do_header.3
1309PEM_read.3,PEM_get_EVP_CIPHER_INFO.3 1294PEM_read.3,PEM_get_EVP_CIPHER_INFO.3
@@ -2048,7 +2033,6 @@ X509_OBJECT_get0_X509.3,X509_OBJECT_idx_by_subject.3
2048X509_OBJECT_get0_X509.3,X509_OBJECT_new.3 2033X509_OBJECT_get0_X509.3,X509_OBJECT_new.3
2049X509_OBJECT_get0_X509.3,X509_OBJECT_retrieve_by_subject.3 2034X509_OBJECT_get0_X509.3,X509_OBJECT_retrieve_by_subject.3
2050X509_OBJECT_get0_X509.3,X509_OBJECT_retrieve_match.3 2035X509_OBJECT_get0_X509.3,X509_OBJECT_retrieve_match.3
2051X509_PKEY_new.3,X509_PKEY_free.3
2052X509_PUBKEY_new.3,X509_PUBKEY_free.3 2036X509_PUBKEY_new.3,X509_PUBKEY_free.3
2053X509_PUBKEY_new.3,X509_PUBKEY_get.3 2037X509_PUBKEY_new.3,X509_PUBKEY_get.3
2054X509_PUBKEY_new.3,X509_PUBKEY_get0.3 2038X509_PUBKEY_new.3,X509_PUBKEY_get0.3
diff --git a/patches/aarch64_crypto_arch.h.patch b/patches/aarch64_crypto_arch.h.patch
new file mode 100644
index 0000000..e6a8cbf
--- /dev/null
+++ b/patches/aarch64_crypto_arch.h.patch
@@ -0,0 +1,16 @@
1--- crypto/arch/aarch64/crypto_arch.h.orig Sun Jun 29 03:49:56 2025
2+++ crypto/arch/aarch64/crypto_arch.h Sun Jun 29 04:00:13 2025
3@@ -34,11 +34,13 @@ extern uint64_t crypto_cpu_caps_aarch64;
4 #define CRYPTO_CPU_CAPS_AARCH64_SHA3 (1ULL << 5)
5
6 #ifndef OPENSSL_NO_ASM
7+#if 0
8
9 #define HAVE_SHA1_BLOCK_DATA_ORDER
10 #define HAVE_SHA256_BLOCK_DATA_ORDER
11 #define HAVE_SHA512_BLOCK_DATA_ORDER
12
13+#endif
14 #endif
15
16 #endif
diff --git a/patches/amd64_crypto_arch.h.patch b/patches/amd64_crypto_arch.h.patch
new file mode 100644
index 0000000..b094100
--- /dev/null
+++ b/patches/amd64_crypto_arch.h.patch
@@ -0,0 +1,18 @@
1--- crypto/arch/amd64/crypto_arch.h.orig Wed Jul 23 08:15:02 2025
2+++ crypto/arch/amd64/crypto_arch.h Wed Jul 23 08:15:20 2025
3@@ -47,6 +47,7 @@ extern uint64_t crypto_cpu_caps_amd64;
4 #define HAVE_RC4_INTERNAL
5 #define HAVE_RC4_SET_KEY_INTERNAL
6
7+#if 0
8 #define HAVE_SHA1_BLOCK_DATA_ORDER
9 #define HAVE_SHA1_BLOCK_GENERIC
10
11@@ -55,6 +56,7 @@ extern uint64_t crypto_cpu_caps_amd64;
12
13 #define HAVE_SHA512_BLOCK_DATA_ORDER
14 #define HAVE_SHA512_BLOCK_GENERIC
15+#endif
16
17 #endif
18
diff --git a/patches/crypto_arch.h.patch b/patches/crypto_arch.h.patch
deleted file mode 100644
index 6c889e5..0000000
--- a/patches/crypto_arch.h.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1--- crypto/arch/amd64/crypto_arch.h.orig Fri Feb 14 06:00:43 2025
2+++ crypto/arch/amd64/crypto_arch.h Fri Feb 14 06:01:13 2025
3@@ -40,6 +40,7 @@ extern uint64_t crypto_cpu_caps_amd64;
4 #define HAVE_RC4_INTERNAL
5 #define HAVE_RC4_SET_KEY_INTERNAL
6
7+#if 0
8 #define HAVE_SHA1_BLOCK_DATA_ORDER
9 #define HAVE_SHA1_BLOCK_GENERIC
10
11@@ -48,6 +49,7 @@ extern uint64_t crypto_cpu_caps_amd64;
12
13 #define HAVE_SHA512_BLOCK_DATA_ORDER
14 #define HAVE_SHA512_BLOCK_GENERIC
15+#endif
16
17 #endif
18
19--- crypto/arch/aarch64/crypto_arch.h.orig Thu Mar 13 05:42:37 2025
20+++ crypto/arch/aarch64/crypto_arch.h Thu Mar 13 05:47:39 2025
21@@ -33,11 +33,13 @@
22 #define CRYPTO_CPU_CAPS_AARCH64_SHA512 (1ULL << 4)
23 #define CRYPTO_CPU_CAPS_AARCH64_SHA3 (1ULL << 5)
24
25+#if 0
26 #ifndef OPENSSL_NO_ASM
27
28 #define HAVE_SHA256_BLOCK_DATA_ORDER
29 #define HAVE_SHA512_BLOCK_DATA_ORDER
30
31+#endif
32 #endif
33
34 #endif
diff --git a/patches/modes_local.h.patch b/patches/modes_local.h.patch
deleted file mode 100644
index 1ff799b..0000000
--- a/patches/modes_local.h.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1--- crypto/modes/modes_local.h.orig Sat Jul 8 14:03:53 2023
2+++ crypto/modes/modes_local.h Sat Jul 8 14:10:56 2023
3@@ -45,6 +45,7 @@
4 asm ("bswapl %0" \
5 : "+r"(ret)); ret; })
6 # elif (defined(__arm__) || defined(__arm)) && !defined(__STRICT_ALIGNMENT)
7+# if (__ARM_ARCH >= 6)
8 # define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x); \
9 asm ("rev %0,%0; rev %1,%1" \
10 : "+r"(hi),"+r"(lo)); \
11@@ -53,6 +54,7 @@
12 asm ("rev %0,%1" \
13 : "=r"(ret) : "r"((u32)(x))); \
14 ret; })
15+# endif
16 # endif
17 #endif
18 #endif
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch
index 319aca6..345a170 100644
--- a/patches/netcat.c.patch
+++ b/patches/netcat.c.patch
@@ -1,5 +1,5 @@
1--- apps/nc/netcat.c.orig Sat Aug 17 03:21:05 2024 1--- apps/nc/netcat.c.orig Fri Jun 27 12:39:21 2025
2+++ apps/nc/netcat.c Sat Aug 17 03:28:50 2024 2+++ apps/nc/netcat.c Fri Jun 27 12:39:29 2025
3@@ -93,9 +93,13 @@ int zflag; /* Port Scan Flag */ 3@@ -93,9 +93,13 @@ int zflag; /* Port Scan Flag */
4 int Dflag; /* sodebug */ 4 int Dflag; /* sodebug */
5 int Iflag; /* TCP receive buffer size */ 5 int Iflag; /* TCP receive buffer size */
@@ -14,7 +14,7 @@
14 14
15 int usetls; /* use TLS */ 15 int usetls; /* use TLS */
16 const char *Cflag; /* Public cert file */ 16 const char *Cflag; /* Public cert file */
17@@ -268,12 +272,14 @@ main(int argc, char *argv[]) 17@@ -271,12 +275,14 @@ main(int argc, char *argv[])
18 case 'u': 18 case 'u':
19 uflag = 1; 19 uflag = 1;
20 break; 20 break;
@@ -29,7 +29,7 @@
29 case 'v': 29 case 'v':
30 vflag = 1; 30 vflag = 1;
31 break; 31 break;
32@@ -320,9 +326,11 @@ main(int argc, char *argv[]) 32@@ -323,9 +329,11 @@ main(int argc, char *argv[])
33 case 'o': 33 case 'o':
34 oflag = optarg; 34 oflag = optarg;
35 break; 35 break;
@@ -41,7 +41,7 @@
41 case 'T': 41 case 'T':
42 errstr = NULL; 42 errstr = NULL;
43 errno = 0; 43 errno = 0;
44@@ -346,9 +354,11 @@ main(int argc, char *argv[]) 44@@ -349,9 +357,11 @@ main(int argc, char *argv[])
45 argc -= optind; 45 argc -= optind;
46 argv += optind; 46 argv += optind;
47 47
@@ -53,7 +53,7 @@
53 53
54 /* Cruft to make sure options are clean, and used properly. */ 54 /* Cruft to make sure options are clean, and used properly. */
55 if (argc == 1 && family == AF_UNIX) { 55 if (argc == 1 && family == AF_UNIX) {
56@@ -923,7 +933,10 @@ remote_connect(const char *host, const char *port, str 56@@ -928,7 +938,10 @@ remote_connect(const char *host, const char *port, str
57 char *ipaddr) 57 char *ipaddr)
58 { 58 {
59 struct addrinfo *res, *res0; 59 struct addrinfo *res, *res0;
@@ -65,7 +65,7 @@
65 65
66 if ((error = getaddrinfo(host, port, &hints, &res0))) 66 if ((error = getaddrinfo(host, port, &hints, &res0)))
67 errx(1, "getaddrinfo for host \"%s\" port %s: %s", host, 67 errx(1, "getaddrinfo for host \"%s\" port %s: %s", host,
68@@ -938,8 +951,10 @@ remote_connect(const char *host, const char *port, str 68@@ -943,8 +956,10 @@ remote_connect(const char *host, const char *port, str
69 if (sflag || pflag) { 69 if (sflag || pflag) {
70 struct addrinfo ahints, *ares; 70 struct addrinfo ahints, *ares;
71 71
@@ -76,7 +76,7 @@
76 memset(&ahints, 0, sizeof(struct addrinfo)); 76 memset(&ahints, 0, sizeof(struct addrinfo));
77 ahints.ai_family = res->ai_family; 77 ahints.ai_family = res->ai_family;
78 ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM; 78 ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
79@@ -1031,7 +1046,10 @@ int 79@@ -1036,7 +1051,10 @@ int
80 local_listen(const char *host, const char *port, struct addrinfo hints) 80 local_listen(const char *host, const char *port, struct addrinfo hints)
81 { 81 {
82 struct addrinfo *res, *res0; 82 struct addrinfo *res, *res0;
@@ -88,7 +88,7 @@
88 int error; 88 int error;
89 89
90 /* Allow nodename to be null. */ 90 /* Allow nodename to be null. */
91@@ -1052,9 +1070,11 @@ local_listen(const char *host, const char *port, struc 91@@ -1057,9 +1075,11 @@ local_listen(const char *host, const char *port, struc
92 res->ai_protocol)) == -1) 92 res->ai_protocol)) == -1)
93 continue; 93 continue;
94 94
@@ -100,7 +100,7 @@
100 100
101 set_common_sockopts(s, res->ai_family); 101 set_common_sockopts(s, res->ai_family);
102 102
103@@ -1559,11 +1579,13 @@ set_common_sockopts(int s, int af) 103@@ -1564,11 +1584,13 @@ set_common_sockopts(int s, int af)
104 { 104 {
105 int x = 1; 105 int x = 1;
106 106
@@ -114,7 +114,7 @@
114 if (Dflag) { 114 if (Dflag) {
115 if (setsockopt(s, SOL_SOCKET, SO_DEBUG, 115 if (setsockopt(s, SOL_SOCKET, SO_DEBUG,
116 &x, sizeof(x)) == -1) 116 &x, sizeof(x)) == -1)
117@@ -1574,9 +1596,16 @@ set_common_sockopts(int s, int af) 117@@ -1579,9 +1601,16 @@ set_common_sockopts(int s, int af)
118 IP_TOS, &Tflag, sizeof(Tflag)) == -1) 118 IP_TOS, &Tflag, sizeof(Tflag)) == -1)
119 err(1, "set IP ToS"); 119 err(1, "set IP ToS");
120 120
@@ -131,7 +131,7 @@
131 } 131 }
132 if (Iflag) { 132 if (Iflag) {
133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, 133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
134@@ -1600,13 +1629,17 @@ set_common_sockopts(int s, int af) 134@@ -1605,13 +1634,17 @@ set_common_sockopts(int s, int af)
135 } 135 }
136 136
137 if (minttl != -1) { 137 if (minttl != -1) {
@@ -150,7 +150,7 @@
150 } 150 }
151 } 151 }
152 152
153@@ -1831,15 +1864,19 @@ help(void) 153@@ -1841,15 +1874,19 @@ help(void)
154 \t-P proxyuser\tUsername for proxy authentication\n\ 154 \t-P proxyuser\tUsername for proxy authentication\n\
155 \t-p port\t Specify local port for remote connects\n\ 155 \t-p port\t Specify local port for remote connects\n\
156 \t-R CAfile CA bundle\n\ 156 \t-R CAfile CA bundle\n\
@@ -175,4 +175,4 @@
175+ "\t-v Verbose\n\ 175+ "\t-v Verbose\n\
176 \t-W recvlimit Terminate after receiving a number of packets\n\ 176 \t-W recvlimit Terminate after receiving a number of packets\n\
177 \t-w timeout Timeout for connects and final net reads\n\ 177 \t-w timeout Timeout for connects and final net reads\n\
178 \t-X proto Proxy protocol: \"4\", \"5\" (SOCKS) or \"connect\"\n\ 178 \t-X proto Proxy protocol: \"4\", \"4A\", \"5\" (SOCKS) or \"connect\"\n\
diff --git a/patches/openssl.c.patch b/patches/openssl.c.patch
index 5ba5ac6..60ea9a7 100644
--- a/patches/openssl.c.patch
+++ b/patches/openssl.c.patch
@@ -1,6 +1,6 @@
1--- apps/openssl/openssl.c.orig Thu Jan 2 08:27:54 2025 1--- apps/openssl/openssl.c.orig Sat May 31 03:18:05 2025
2+++ apps/openssl/openssl.c Thu Jan 2 08:28:04 2025 2+++ apps/openssl/openssl.c Sat May 31 03:18:17 2025
3@@ -344,7 +344,9 @@ BIO *bio_err = NULL; 3@@ -341,7 +341,9 @@ BIO *bio_err = NULL;
4 static void 4 static void
5 openssl_startup(void) 5 openssl_startup(void)
6 { 6 {
diff --git a/patches/opensslfeatures.h.patch b/patches/opensslfeatures.h.patch
index 77df5dc..d370b32 100644
--- a/patches/opensslfeatures.h.patch
+++ b/patches/opensslfeatures.h.patch
@@ -36,3 +36,14 @@
36 #include "bytestring.h" 36 #include "bytestring.h"
37 37
38 #if defined(__cplusplus) 38 #if defined(__cplusplus)
39--- tests/test.h.orig Sat May 31 04:48:09 2025
40+++ tests/test.h Sat May 31 04:48:31 2025
41@@ -18,6 +18,8 @@
42 #ifndef HEADER_TEST_H
43 #define HEADER_TEST_H
44
45+#include <openssl/opensslfeatures.h>
46+
47 #include <stddef.h>
48 #include <stdint.h>
49
diff --git a/patches/patch-aarch64-crypto-cpu-caps.c.patch b/patches/patch-aarch64-crypto-cpu-caps.c.patch
deleted file mode 100644
index dcfbdc0..0000000
--- a/patches/patch-aarch64-crypto-cpu-caps.c.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1Disable feature detection until we find a more portable way.
2
3--- crypto/arch/aarch64/crypto_cpu_caps.c.orig Sat Dec 14 13:45:16 2024
4+++ crypto/arch/aarch64/crypto_cpu_caps.c Sat Dec 14 13:54:06 2024
5@@ -16,9 +16,12 @@
6 */
7
8 #include <sys/types.h>
9+
10+#if defined(__OpenBSD__)
11 #include <sys/sysctl.h>
12
13 #include <machine/cpu.h>
14+#endif
15
16 #include <stddef.h>
17 #include <stdio.h>
18@@ -67,6 +70,7 @@ parse_isar0(uint64_t isar0)
19 return caps;
20 }
21
22+#if defined(__OpenBSD__)
23 static int
24 read_isar0(uint64_t *isar0)
25 {
26@@ -84,6 +88,13 @@ read_isar0(uint64_t *isar0)
27
28 return 1;
29 }
30+#else
31+static int
32+read_isar0(uint64_t *isar0)
33+{
34+ return 0;
35+}
36+#endif
37
38 void
39 crypto_cpu_caps_init(void)
diff --git a/patches/patch-i386-crypto-cpu-caps.c.patch b/patches/patch-i386-crypto-cpu-caps.c.patch
index c85e33c..0642582 100644
--- a/patches/patch-i386-crypto-cpu-caps.c.patch
+++ b/patches/patch-i386-crypto-cpu-caps.c.patch
@@ -1,6 +1,6 @@
1--- crypto/arch/i386/crypto_cpu_caps.c.orig Fri Oct 18 17:35:20 2024 1--- crypto/arch/i386/crypto_cpu_caps.c.orig Mon Jun 16 10:38:27 2025
2+++ crypto/arch/i386/crypto_cpu_caps.c Fri Oct 18 17:39:13 2024 2+++ crypto/arch/i386/crypto_cpu_caps.c Mon Jun 16 10:38:39 2025
3@@ -33,7 +33,7 @@ cpuid(uint32_t eax, uint32_t *out_eax, uint32_t *out_e 3@@ -37,7 +37,7 @@ cpuid(uint32_t eax, uint32_t *out_eax, uint32_t *out_e
4 { 4 {
5 uint32_t ebx = 0, ecx = 0, edx = 0; 5 uint32_t ebx = 0, ecx = 0, edx = 0;
6 6
@@ -9,7 +9,7 @@
9 __asm__ ("cpuid": "+a"(eax), "+b"(ebx), "+c"(ecx), "+d"(edx)); 9 __asm__ ("cpuid": "+a"(eax), "+b"(ebx), "+c"(ecx), "+d"(edx));
10 #else 10 #else
11 eax = 0; 11 eax = 0;
12@@ -54,7 +54,7 @@ xgetbv(uint32_t ecx, uint32_t *out_eax, uint32_t *out_ 12@@ -58,7 +58,7 @@ xgetbv(uint32_t ecx, uint32_t *out_eax, uint32_t *out_
13 { 13 {
14 uint32_t eax = 0, edx = 0; 14 uint32_t eax = 0, edx = 0;
15 15
diff --git a/patches/speed.c.patch b/patches/speed.c.patch
index e1f1698..32e42b4 100644
--- a/patches/speed.c.patch
+++ b/patches/speed.c.patch
@@ -1,6 +1,6 @@
1--- apps/openssl/speed.c.orig Thu Jan 2 08:04:28 2025 1--- apps/openssl/speed.c.orig Sat May 31 03:18:05 2025
2+++ apps/openssl/speed.c Thu Jan 2 08:04:38 2025 2+++ apps/openssl/speed.c Sat May 31 03:18:17 2025
3@@ -158,7 +158,16 @@ static void 3@@ -154,7 +154,16 @@ static void
4 pkey_print_message(const char *str, const char *str2, 4 pkey_print_message(const char *str, const char *str2,
5 long num, int bits, int sec); 5 long num, int bits, int sec);
6 static void print_result(int alg, int run_no, int count, double time_used); 6 static void print_result(int alg, int run_no, int count, double time_used);
@@ -15,9 +15,9 @@
15+#define alarm(seconds) speed_alarm((seconds)) 15+#define alarm(seconds) speed_alarm((seconds))
16+#endif 16+#endif
17 17
18 #define ALGOR_NUM 32 18 #define ALGOR_NUM 31
19 #define SIZE_NUM 5 19 #define SIZE_NUM 5
20@@ -1129,8 +1138,10 @@ speed_main(int argc, char **argv) 20@@ -1087,8 +1096,10 @@ speed_main(int argc, char **argv)
21 const EVP_CIPHER *evp_cipher = NULL; 21 const EVP_CIPHER *evp_cipher = NULL;
22 const EVP_MD *evp_md = NULL; 22 const EVP_MD *evp_md = NULL;
23 int decrypt = 0; 23 int decrypt = 0;
@@ -28,7 +28,7 @@
28 const char *errstr = NULL; 28 const char *errstr = NULL;
29 29
30 if (pledge("stdio proc", NULL) == -1) { 30 if (pledge("stdio proc", NULL) == -1) {
31@@ -1205,6 +1216,7 @@ speed_main(int argc, char **argv) 31@@ -1163,6 +1174,7 @@ speed_main(int argc, char **argv)
32 decrypt = 1; 32 decrypt = 1;
33 j--; /* Otherwise, -decrypt gets confused with an 33 j--; /* Otherwise, -decrypt gets confused with an
34 * algorithm. */ 34 * algorithm. */
@@ -36,7 +36,7 @@
36 } else if (argc > 0 && strcmp(*argv, "-multi") == 0) { 36 } else if (argc > 0 && strcmp(*argv, "-multi") == 0) {
37 argc--; 37 argc--;
38 argv++; 38 argv++;
39@@ -1219,6 +1231,7 @@ speed_main(int argc, char **argv) 39@@ -1177,6 +1189,7 @@ speed_main(int argc, char **argv)
40 } 40 }
41 j--; /* Otherwise, -multi gets confused with an 41 j--; /* Otherwise, -multi gets confused with an
42 * algorithm. */ 42 * algorithm. */
@@ -44,7 +44,7 @@
44 } else if (argc > 0 && strcmp(*argv, "-unaligned") == 0) { 44 } else if (argc > 0 && strcmp(*argv, "-unaligned") == 0) {
45 argc--; 45 argc--;
46 argv++; 46 argv++;
47@@ -1542,7 +1555,9 @@ speed_main(int argc, char **argv) 47@@ -1491,7 +1504,9 @@ speed_main(int argc, char **argv)
48 BIO_printf(bio_err, "-evp e use EVP e.\n"); 48 BIO_printf(bio_err, "-evp e use EVP e.\n");
49 BIO_printf(bio_err, "-decrypt time decryption instead of encryption (only EVP).\n"); 49 BIO_printf(bio_err, "-decrypt time decryption instead of encryption (only EVP).\n");
50 BIO_printf(bio_err, "-mr produce machine readable output.\n"); 50 BIO_printf(bio_err, "-mr produce machine readable output.\n");
@@ -54,7 +54,7 @@
54 BIO_printf(bio_err, "-unaligned n use buffers with offset n from proper alignment.\n"); 54 BIO_printf(bio_err, "-unaligned n use buffers with offset n from proper alignment.\n");
55 goto end; 55 goto end;
56 } 56 }
57@@ -1551,8 +1566,10 @@ speed_main(int argc, char **argv) 57@@ -1500,8 +1515,10 @@ speed_main(int argc, char **argv)
58 j++; 58 j++;
59 } 59 }
60 60
@@ -65,7 +65,7 @@
65 65
66 if (j == 0) { 66 if (j == 0) {
67 for (i = 0; i < ALGOR_NUM; i++) { 67 for (i = 0; i < ALGOR_NUM; i++) {
68@@ -1624,11 +1641,13 @@ speed_main(int argc, char **argv) 68@@ -1573,11 +1590,13 @@ speed_main(int argc, char **argv)
69 #define COND(c) (run && count<0x7fffffff) 69 #define COND(c) (run && count<0x7fffffff)
70 #define COUNT(d) (count) 70 #define COUNT(d) (count)
71 71
@@ -79,7 +79,7 @@
79 79
80 #ifndef OPENSSL_NO_MD4 80 #ifndef OPENSSL_NO_MD4
81 if (doit[D_MD4]) { 81 if (doit[D_MD4]) {
82@@ -2434,7 +2453,9 @@ speed_main(int argc, char **argv) 82@@ -2370,7 +2389,9 @@ speed_main(int argc, char **argv)
83 ecdh_doit[j] = 0; 83 ecdh_doit[j] = 0;
84 } 84 }
85 } 85 }
@@ -89,7 +89,7 @@
89 if (!mr) { 89 if (!mr) {
90 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION)); 90 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION));
91 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_BUILT_ON)); 91 fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_BUILT_ON));
92@@ -2590,11 +2611,15 @@ pkey_print_message(const char *str, const char *str2, 92@@ -2526,11 +2547,15 @@ pkey_print_message(const char *str, const char *str2,
93 static void 93 static void
94 print_result(int alg, int run_no, int count, double time_used) 94 print_result(int alg, int run_no, int count, double time_used)
95 { 95 {
@@ -105,7 +105,7 @@
105 static char * 105 static char *
106 sstrsep(char **string, const char *delim) 106 sstrsep(char **string, const char *delim)
107 { 107 {
108@@ -2795,5 +2820,6 @@ do_multi(int multi) 108@@ -2731,5 +2756,6 @@ do_multi(int multi)
109 free(fds); 109 free(fds);
110 return 1; 110 return 1;
111 } 111 }
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt
index cd7e335..637e0f0 100644
--- a/ssl/CMakeLists.txt
+++ b/ssl/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1set( 16set(
2 SSL_SRC 17 SSL_SRC
3 bio_ssl.c 18 bio_ssl.c
diff --git a/ssl/Makefile.am b/ssl/Makefile.am
index 2c84bff..3096749 100644
--- a/ssl/Makefile.am
+++ b/ssl/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk 18-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
@@ -26,7 +41,7 @@ EXTRA_libssl_la_DEPENDENCIES = libssl_la_objects.mk
26 41
27libssl_la_objects.mk: Makefile 42libssl_la_objects.mk: Makefile
28 @echo "libssl_la_objects= $(libssl_la_OBJECTS)" \ 43 @echo "libssl_la_objects= $(libssl_la_OBJECTS)" \
29 | sed 's/ */ $$\(abs_top_builddir\)\/ssl\//g' \ 44 | sed 's/ */ $$\(top_builddir\)\/ssl\//g' \
30 > libssl_la_objects.mk 45 > libssl_la_objects.mk
31 46
32.PHONY: remove_bs_objects 47.PHONY: remove_bs_objects
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d7cc499..c497b77 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2015 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1add_definitions(-DLIBRESSL_CRYPTO_INTERNAL) 16add_definitions(-DLIBRESSL_CRYPTO_INTERNAL)
2 17
3include_directories( 18include_directories(
@@ -65,6 +80,9 @@ function(add_platform_test TEST_NAME)
65 endif() 80 endif()
66endfunction() 81endfunction()
67 82
83# XXX - should probably be in their own static lib
84set(TEST_HELPER_SRC test.c test_util.c)
85
68# aeadtest 86# aeadtest
69add_executable(aeadtest aeadtest.c) 87add_executable(aeadtest aeadtest.c)
70target_link_libraries(aeadtest ${OPENSSL_TEST_LIBS}) 88target_link_libraries(aeadtest ${OPENSSL_TEST_LIBS})
@@ -449,6 +467,7 @@ add_platform_test(evptest evptest ${CMAKE_CURRENT_SOURCE_DIR}/evptests.txt)
449# evp_test 467# evp_test
450add_executable(evp_test evp_test.c) 468add_executable(evp_test evp_test.c)
451target_link_libraries(evp_test ${OPENSSL_TEST_LIBS}) 469target_link_libraries(evp_test ${OPENSSL_TEST_LIBS})
470prepare_emscripten_test_target(evp_test)
452add_platform_test(evp_test evp_test) 471add_platform_test(evp_test evp_test)
453 472
454# exdata_test 473# exdata_test
@@ -536,9 +555,12 @@ prepare_emscripten_test_target(lhash_test)
536add_platform_test(lhash_test lhash_test) 555add_platform_test(lhash_test lhash_test)
537 556
538# md_test 557# md_test
539add_executable(md_test md_test.c) 558# XXX - ftruncate and mkstemp missing from Windows
540target_link_libraries(md_test ${OPENSSL_TEST_LIBS}) 559if(NOT WIN32)
541add_platform_test(md_test md_test) 560 add_executable(md_test md_test.c ${TEST_HELPER_SRC})
561 target_link_libraries(md_test ${OPENSSL_TEST_LIBS})
562 add_platform_test(md_test md_test)
563endif()
542 564
543# mlkem_tests 565# mlkem_tests
544add_executable(mlkem_tests mlkem_tests.c mlkem_tests_util.c parse_test_file.c) 566add_executable(mlkem_tests mlkem_tests.c mlkem_tests_util.c parse_test_file.c)
@@ -620,13 +642,7 @@ add_platform_test(policy policy)
620# pq_test 642# pq_test
621add_executable(pq_test pq_test.c) 643add_executable(pq_test pq_test.c)
622target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) 644target_link_libraries(pq_test ${OPENSSL_TEST_LIBS})
623if(NOT WIN32) 645add_platform_test(pq_test pq_test)
624 add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh)
625else()
626 add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat
627 $<TARGET_FILE:pq_test>)
628endif()
629set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}")
630 646
631# quictest 647# quictest
632set(QUICTEST_SRC quictest.c) 648set(QUICTEST_SRC quictest.c)
@@ -724,9 +740,12 @@ endif()
724set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") 740set_tests_properties(servertest PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}")
725 741
726# sha_test 742# sha_test
727add_executable(sha_test sha_test.c) 743# XXX - ftruncate and mkstemp missing from Windows
728target_link_libraries(sha_test ${OPENSSL_TEST_LIBS}) 744if(NOT WIN32)
729add_platform_test(sha_test sha_test) 745 add_executable(sha_test sha_test.c ${TEST_HELPER_SRC})
746 target_link_libraries(sha_test ${OPENSSL_TEST_LIBS})
747 add_platform_test(sha_test sha_test)
748endif()
730 749
731# shutdowntest 750# shutdowntest
732set(SHUTDOWNTEST_SRC shutdowntest.c) 751set(SHUTDOWNTEST_SRC shutdowntest.c)
@@ -938,11 +957,6 @@ add_executable(x509_name_test x509_name_test.c)
938target_link_libraries(x509_name_test ${OPENSSL_TEST_LIBS}) 957target_link_libraries(x509_name_test ${OPENSSL_TEST_LIBS})
939add_platform_test(x509_name_test x509_name_test) 958add_platform_test(x509_name_test x509_name_test)
940 959
941# x509name
942add_executable(x509name x509name.c)
943target_link_libraries(x509name ${OPENSSL_TEST_LIBS})
944add_platform_test(x509name x509name)
945
946# x509req_ext 960# x509req_ext
947add_executable(x509req_ext x509req_ext.c) 961add_executable(x509req_ext x509req_ext.c)
948target_link_libraries(x509req_ext ${OPENSSL_TEST_LIBS}) 962target_link_libraries(x509req_ext ${OPENSSL_TEST_LIBS})
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b58de21..914b1e5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2015 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk 18-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
@@ -19,6 +34,7 @@ AM_CPPFLAGS += -I $(top_srcdir)/crypto/modes
19AM_CPPFLAGS += -I $(top_srcdir)/crypto/sha 34AM_CPPFLAGS += -I $(top_srcdir)/crypto/sha
20AM_CPPFLAGS += -I $(top_srcdir)/crypto/x509 35AM_CPPFLAGS += -I $(top_srcdir)/crypto/x509
21AM_CPPFLAGS += -I $(top_srcdir)/ssl 36AM_CPPFLAGS += -I $(top_srcdir)/ssl
37AM_CPPFLAGS += -I $(top_srcdir)/tests
22AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl 38AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl
23AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl/compat 39AM_CPPFLAGS += -I $(top_srcdir)/apps/openssl/compat
24AM_CPPFLAGS += -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/cert.pem\" 40AM_CPPFLAGS += -D_PATH_SSL_CA_FILE=\"$(top_srcdir)/cert.pem\"
@@ -86,6 +102,11 @@ check_PROGRAMS =
86EXTRA_DIST = CMakeLists.txt 102EXTRA_DIST = CMakeLists.txt
87DISTCLEANFILES = pidwraptest.txt 103DISTCLEANFILES = pidwraptest.txt
88 104
105# XXX - should probably be in their own static lib
106TEST_HELPER_SRC = test.c test_util.c
107noinst_HEADERS = test.h
108EXTRA_DIST += $(TEST_HELPER_SRC)
109
89# aeadtest 110# aeadtest
90TESTS += aeadtest.sh 111TESTS += aeadtest.sh
91check_PROGRAMS += aeadtest 112check_PROGRAMS += aeadtest
@@ -338,7 +359,7 @@ chachatest_SOURCES = chachatest.c
338TESTS += cipher_list 359TESTS += cipher_list
339check_PROGRAMS += cipher_list 360check_PROGRAMS += cipher_list
340cipher_list_SOURCES = cipher_list.c 361cipher_list_SOURCES = cipher_list.c
341noinst_HEADERS = tests.h 362noinst_HEADERS += tests.h
342 363
343# cipherstest 364# cipherstest
344TESTS += cipherstest 365TESTS += cipherstest
@@ -548,7 +569,7 @@ lhash_test_SOURCES = lhash_test.c
548# md_test 569# md_test
549TESTS += md_test 570TESTS += md_test
550check_PROGRAMS += md_test 571check_PROGRAMS += md_test
551md_test_SOURCES = md_test.c 572md_test_SOURCES = md_test.c $(TEST_HELPER_SRC)
552 573
553noinst_HEADERS += mlkem_tests_util.h 574noinst_HEADERS += mlkem_tests_util.h
554noinst_HEADERS += parse_test_file.h 575noinst_HEADERS += parse_test_file.h
@@ -656,11 +677,9 @@ EXTRA_DIST += policy_root2.pem
656EXTRA_DIST += policy_root_cross_inhibit_mapping.pem 677EXTRA_DIST += policy_root_cross_inhibit_mapping.pem
657 678
658# pq_test 679# pq_test
659TESTS += pq_test.sh 680TESTS += pq_test
660check_PROGRAMS += pq_test 681check_PROGRAMS += pq_test
661pq_test_SOURCES = pq_test.c 682pq_test_SOURCES = pq_test.c
662EXTRA_DIST += pq_test.sh pq_test.bat
663EXTRA_DIST += pq_expected.txt
664 683
665# quictest 684# quictest
666TESTS += quictest.sh 685TESTS += quictest.sh
@@ -747,7 +766,7 @@ EXTRA_DIST += servertest.sh servertest.bat
747# sha_test 766# sha_test
748TESTS += sha_test 767TESTS += sha_test
749check_PROGRAMS += sha_test 768check_PROGRAMS += sha_test
750sha_test_SOURCES = sha_test.c 769sha_test_SOURCES = sha_test.c $(TEST_HELPER_SRC)
751 770
752# shutdowntest 771# shutdowntest
753TESTS += shutdowntest.sh 772TESTS += shutdowntest.sh
@@ -919,11 +938,6 @@ TESTS += x509_name_test
919check_PROGRAMS += x509_name_test 938check_PROGRAMS += x509_name_test
920x509_name_test_SOURCES = x509_name_test.c 939x509_name_test_SOURCES = x509_name_test.c
921 940
922# x509name
923TESTS += x509name
924check_PROGRAMS += x509name
925x509name_SOURCES = x509name.c
926
927# x509req_ext 941# x509req_ext
928TESTS += x509req_ext 942TESTS += x509req_ext
929check_PROGRAMS += x509req_ext 943check_PROGRAMS += x509req_ext
diff --git a/tests/aeadtest.sh b/tests/aeadtest.sh
index 212e354..bb09df2 100755
--- a/tests/aeadtest.sh
+++ b/tests/aeadtest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3TEST=./aeadtest 18TEST=./aeadtest
4if [ -e ./aeadtest.exe ]; then 19if [ -e ./aeadtest.exe ]; then
diff --git a/tests/arc4randomforktest.sh b/tests/arc4randomforktest.sh
index fe03068..bbe7641 100755
--- a/tests/arc4randomforktest.sh
+++ b/tests/arc4randomforktest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3./arc4randomforktest 18./arc4randomforktest
4./arc4randomforktest -b 19./arc4randomforktest -b
diff --git a/tests/cmake/CMakeLists.txt b/tests/cmake/CMakeLists.txt
index 956fbfd..c3b7c4f 100644
--- a/tests/cmake/CMakeLists.txt
+++ b/tests/cmake/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2023 Pierre Wendling
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1cmake_minimum_required(VERSION 3.5) 16cmake_minimum_required(VERSION 3.5)
2 17
3project(LibreSSL_Consumer LANGUAGES C) 18project(LibreSSL_Consumer LANGUAGES C)
diff --git a/tests/compat/pipe2.c b/tests/compat/pipe2.c
index 7600783..c27a858 100644
--- a/tests/compat/pipe2.c
+++ b/tests/compat/pipe2.c
@@ -35,6 +35,22 @@ static int setfl(int fd, int flag)
35 return rc; 35 return rc;
36} 36}
37 37
38/*
39 * Have open() temporarily use up file descriptors until reaching beyond the
40 * allocated sockets, then leak the ones conflicting with any of the latter.
41 */
42static void create_issue_1069_sentinels(int socket_vector[2])
43{
44 int fd = open("CONIN$", O_RDONLY);
45 if (fd == -1 || fd > socket_vector[0] && fd > socket_vector[1]) {
46 return;
47 }
48 create_issue_1069_sentinels(socket_vector);
49 if (fd != socket_vector[0] && fd != socket_vector[1]) {
50 close(fd);
51 }
52}
53
38int socketpair(int domain, int type, int protocol, int socket_vector[2]) 54int socketpair(int domain, int type, int protocol, int socket_vector[2])
39{ 55{
40 if (domain != AF_UNIX || !(type & SOCK_STREAM) || protocol != PF_UNSPEC) 56 if (domain != AF_UNIX || !(type & SOCK_STREAM) || protocol != PF_UNSPEC)
@@ -85,6 +101,9 @@ int socketpair(int domain, int type, int protocol, int socket_vector[2])
85 goto err; 101 goto err;
86 102
87 closesocket(listener); 103 closesocket(listener);
104
105 create_issue_1069_sentinels(socket_vector);
106
88 return 0; 107 return 0;
89 108
90err: 109err:
diff --git a/tests/dtlstest.sh b/tests/dtlstest.sh
index 8f9b229..f0b7161 100755
--- a/tests/dtlstest.sh
+++ b/tests/dtlstest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2021 Kinichiro Inoguchi
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4dtlstest_bin=./dtlstest 19dtlstest_bin=./dtlstest
diff --git a/tests/evptest.sh b/tests/evptest.sh
index ba44d75..ddd7445 100755
--- a/tests/evptest.sh
+++ b/tests/evptest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3TEST=./evptest 18TEST=./evptest
4if [ -e ./evptest.exe ]; then 19if [ -e ./evptest.exe ]; then
diff --git a/tests/keypairtest.sh b/tests/keypairtest.sh
index 8bb7d9f..f2c20c4 100755
--- a/tests/keypairtest.sh
+++ b/tests/keypairtest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2018 Kinichiro Inoguchi
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3TEST=./keypairtest 18TEST=./keypairtest
4if [ -e ./keypairtest.exe ]; then 19if [ -e ./keypairtest.exe ]; then
diff --git a/tests/mlkem_tests.sh b/tests/mlkem_tests.sh
index 2a9856e..cbc0f0b 100755
--- a/tests/mlkem_tests.sh
+++ b/tests/mlkem_tests.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2024 Theo Buehler
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4TEST=./mlkem_tests 19TEST=./mlkem_tests
diff --git a/tests/ocsptest.bat b/tests/ocsptest.bat
index 2b6b66b..8d44ee0 100644
--- a/tests/ocsptest.bat
+++ b/tests/ocsptest.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM ocspocsp_test_bin.bat 3
4:: Copyright (c) 2016 Kinichiro Inoguchi
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set ocsp_test_bin=%1 18set ocsp_test_bin=%1
6set ocsp_test_bin=%ocsp_test_bin:/=\% 19set ocsp_test_bin=%ocsp_test_bin:/=\%
diff --git a/tests/ocsptest.sh b/tests/ocsptest.sh
index a1c266d..71c975e 100755
--- a/tests/ocsptest.sh
+++ b/tests/ocsptest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2016 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3TEST=./ocsp_test 18TEST=./ocsp_test
4if [ -e ./ocsp_test.exe ]; then 19if [ -e ./ocsp_test.exe ]; then
diff --git a/tests/pidwraptest.sh b/tests/pidwraptest.sh
index 04fb5c4..d5a2f71 100755
--- a/tests/pidwraptest.sh
+++ b/tests/pidwraptest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2./pidwraptest > pidwraptest.txt 17./pidwraptest > pidwraptest.txt
3while read a b; 18while read a b;
4do 19do
diff --git a/tests/pq_test.bat b/tests/pq_test.bat
deleted file mode 100644
index 084f06d..0000000
--- a/tests/pq_test.bat
+++ /dev/null
@@ -1,15 +0,0 @@
1@echo off
2setlocal enabledelayedexpansion
3REM pq_test.bat
4
5set pq_test_bin=%1
6set pq_test_bin=%pq_test_bin:/=\%
7if not exist %pq_test_bin% exit /b 1
8
9set pq_output=pq_output.txt
10if exist %pq_output% del %pq_output%
11
12%pq_test_bin% > %pq_output%
13fc /b %pq_output% %srcdir%\pq_expected.txt
14
15endlocal
diff --git a/tests/pq_test.sh b/tests/pq_test.sh
deleted file mode 100755
index eab6f3c..0000000
--- a/tests/pq_test.sh
+++ /dev/null
@@ -1,9 +0,0 @@
1#!/bin/sh
2set -e
3TEST=./pq_test
4if [ -e ./pq_test.exe ]; then
5 TEST=./pq_test.exe
6elif [ -e ./pq_test.js ]; then
7 TEST="node ./pq_test.js"
8fi
9$TEST | diff -b $srcdir/pq_expected.txt -
diff --git a/tests/quictest.bat b/tests/quictest.bat
index 645fc2f..be731c8 100644
--- a/tests/quictest.bat
+++ b/tests/quictest.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM quictest.bat 3
4:: Copyright (c) 2022 Brent Cook
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set quictest_bin=%1 18set quictest_bin=%1
6set quictest_bin=%quictest_bin:/=\% 19set quictest_bin=%quictest_bin:/=\%
diff --git a/tests/quictest.sh b/tests/quictest.sh
index 23561ad..407a66b 100755
--- a/tests/quictest.sh
+++ b/tests/quictest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2022 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4quictest_bin=./quictest 19quictest_bin=./quictest
diff --git a/tests/renegotiation_test.bat b/tests/renegotiation_test.bat
index 0086046..6691a39 100644
--- a/tests/renegotiation_test.bat
+++ b/tests/renegotiation_test.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM renegotiation_test.bat 3
4:: Copyright (c) 2025 Theo Beuhler
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set renegotiation_test_bin=%1 18set renegotiation_test_bin=%1
6set renegotiation_test_bin=%renegotiation_test_bin:/=\% 19set renegotiation_test_bin=%renegotiation_test_bin:/=\%
diff --git a/tests/renegotiation_test.sh b/tests/renegotiation_test.sh
index bbf27c8..8d963a2 100755
--- a/tests/renegotiation_test.sh
+++ b/tests/renegotiation_test.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2025 Theo Buehler
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4renegotiation_test_bin=./renegotiation_test 19renegotiation_test_bin=./renegotiation_test
diff --git a/tests/servertest.bat b/tests/servertest.bat
index c0bfaa4..d72d8de 100644
--- a/tests/servertest.bat
+++ b/tests/servertest.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM servertest.bat 3
4:: Copyright (c) 2017 Kinichiro Inoguchi
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set servertest_bin=%1 18set servertest_bin=%1
6set servertest_bin=%servertest_bin:/=\% 19set servertest_bin=%servertest_bin:/=\%
diff --git a/tests/servertest.sh b/tests/servertest.sh
index 1662332..4770e4b 100755
--- a/tests/servertest.sh
+++ b/tests/servertest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2017 Kinichiro Inoguchi
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4servertest_bin=./servertest 19servertest_bin=./servertest
diff --git a/tests/shutdowntest.bat b/tests/shutdowntest.bat
index f087dbb..d722fa0 100644
--- a/tests/shutdowntest.bat
+++ b/tests/shutdowntest.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM shutdowntest.bat 3
4:: Copyright (c) 2024 Theo Beuhler
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set shutdowntest_bin=%1 18set shutdowntest_bin=%1
6set shutdowntest_bin=%shutdowntest_bin:/=\% 19set shutdowntest_bin=%shutdowntest_bin:/=\%
diff --git a/tests/shutdowntest.sh b/tests/shutdowntest.sh
index d3ae472..b3c98da 100755
--- a/tests/shutdowntest.sh
+++ b/tests/shutdowntest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2024 Theo Buehler
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4shutdowntest_bin=./shutdowntest 19shutdowntest_bin=./shutdowntest
diff --git a/tests/ssltest.bat b/tests/ssltest.bat
index 5dda6bc..17f912f 100644
--- a/tests/ssltest.bat
+++ b/tests/ssltest.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM ssltest.bat 3
4:: Copyright (c) 2016 Kinichiro Inoguchi
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set ssltest_bin=%1 18set ssltest_bin=%1
6set ssltest_bin=%ssltest_bin:/=\% 19set ssltest_bin=%ssltest_bin:/=\%
diff --git a/tests/ssltest.sh b/tests/ssltest.sh
index 29ea0b0..4ec4884 100755
--- a/tests/ssltest.sh
+++ b/tests/ssltest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4ssltest_bin=./ssltest 19ssltest_bin=./ssltest
diff --git a/tests/testdsa.bat b/tests/testdsa.bat
index 898ded8..df53305 100644
--- a/tests/testdsa.bat
+++ b/tests/testdsa.bat
@@ -1,9 +1,21 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM testdsa.bat
4 3
5 4:: Copyright (c) 2016 Kinichiro Inoguchi
6REM # Test DSA certificate generation of openssl 5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18:: Test DSA certificate generation of openssl
7 19
8set openssl_bin=%1 20set openssl_bin=%1
9set openssl_bin=%openssl_bin:/=\% 21set openssl_bin=%openssl_bin:/=\%
diff --git a/tests/testdsa.sh b/tests/testdsa.sh
index 7ecb8ef..230a1f8 100755
--- a/tests/testdsa.sh
+++ b/tests/testdsa.sh
@@ -1,6 +1,18 @@
1#!/bin/sh 1#!/bin/sh
2# $OpenBSD: testdsa.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $ 2#
3 3# Copyright (c) 2015 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 16
5#Test DSA certificate generation of openssl 17#Test DSA certificate generation of openssl
6 18
diff --git a/tests/testenc.bat b/tests/testenc.bat
index 84f48f2..fa14620 100644
--- a/tests/testenc.bat
+++ b/tests/testenc.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM testenc.bat 3
4:: Copyright (c) 2016 Kinichiro Inoguchi
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set test=P 18set test=P
6 19
diff --git a/tests/testenc.sh b/tests/testenc.sh
index 63bce34..418e48d 100755
--- a/tests/testenc.sh
+++ b/tests/testenc.sh
@@ -1,5 +1,18 @@
1#!/bin/sh 1#!/bin/sh
2# $OpenBSD: testenc.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $ 2#
3# Copyright (c) 2015 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3 16
4test=p 17test=p
5if [ -d ../apps/openssl ]; then 18if [ -d ../apps/openssl ]; then
diff --git a/tests/testrsa.bat b/tests/testrsa.bat
index 59c3b5d..af59aad 100644
--- a/tests/testrsa.bat
+++ b/tests/testrsa.bat
@@ -1,9 +1,21 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM testrsa.bat
4 3
5 4:: Copyright (c) 2016 Kinichiro Inoguchi
6REM # Test RSA certificate generation of openssl 5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18:: Test RSA certificate generation of openssl
7 19
8set openssl_bin=%1 20set openssl_bin=%1
9set openssl_bin=%openssl_bin:/=\% 21set openssl_bin=%openssl_bin:/=\%
diff --git a/tests/testrsa.sh b/tests/testrsa.sh
index e644999..afbc610 100755
--- a/tests/testrsa.sh
+++ b/tests/testrsa.sh
@@ -1,6 +1,18 @@
1#!/bin/sh 1#!/bin/sh
2# $OpenBSD: testrsa.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $ 2#
3 3# Copyright (c) 2015 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 16
5#Test RSA certificate generation of openssl 17#Test RSA certificate generation of openssl
6 18
diff --git a/tests/testssl.bat b/tests/testssl.bat
index c4e6286..35a789a 100644
--- a/tests/testssl.bat
+++ b/tests/testssl.bat
@@ -1,6 +1,19 @@
1@echo on 1@echo on
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM testssl.bat 3
4:: Copyright (c) 2016 Kinichiro Inoguchi
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set key=%1 18set key=%1
6set cert=%2 19set cert=%2
diff --git a/tests/tlstest.bat b/tests/tlstest.bat
index 5f5f6a6..204201b 100644
--- a/tests/tlstest.bat
+++ b/tests/tlstest.bat
@@ -1,6 +1,19 @@
1@echo off 1@echo off
2setlocal enabledelayedexpansion 2setlocal enabledelayedexpansion
3REM tlstest.bat 3
4:: Copyright (c) 2017 Brent Cook
5::
6:: Permission to use, copy, modify, and distribute this software for any
7:: purpose with or without fee is hereby granted, provided that the above
8:: copyright notice and this permission notice appear in all copies.
9::
10:: THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11:: WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12:: MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13:: ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14:: WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15:: ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16:: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4 17
5set tlstest_bin=%1 18set tlstest_bin=%1
6set tlstest_bin=%tlstest_bin:/=\% 19set tlstest_bin=%tlstest_bin:/=\%
diff --git a/tests/tlstest.sh b/tests/tlstest.sh
index 4024007..4a5aff6 100755
--- a/tests/tlstest.sh
+++ b/tests/tlstest.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2015 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4tlstest_bin=./tlstest 19tlstest_bin=./tlstest
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index c81bbb0..6475245 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1set( 16set(
2 TLS_SRC 17 TLS_SRC
3 tls.c 18 tls.c
diff --git a/tls/Makefile.am b/tls/Makefile.am
index 22f3222..2a7b089 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -1,3 +1,18 @@
1#
2# Copyright (c) 2014 Brent Cook
3#
4# Permission to use, copy, modify, and distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
1include $(top_srcdir)/Makefile.am.common 16include $(top_srcdir)/Makefile.am.common
2 17
3-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk 18-include $(abs_top_builddir)/crypto/libcrypto_la_objects.mk
@@ -16,7 +31,7 @@ EXTRA_libtls_la_DEPENDENCIES = libtls_la_objects.mk
16 31
17libtls_la_objects.mk: Makefile 32libtls_la_objects.mk: Makefile
18 @echo "libtls_la_objects= $(libtls_la_OBJECTS)" \ 33 @echo "libtls_la_objects= $(libtls_la_OBJECTS)" \
19 | sed -e 's/ *$$//' -e 's/ */ $$\(abs_top_builddir\)\/tls\//g' \ 34 | sed -e 's/ *$$//' -e 's/ */ $$\(top_builddir\)\/tls\//g' \
20 > libtls_la_objects.mk 35 > libtls_la_objects.mk
21 36
22libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym 37libtls_la_LDFLAGS = -version-info @LIBTLS_VERSION@ -no-undefined -export-symbols $(top_srcdir)/tls/tls.sym
diff --git a/update.sh b/update.sh
index 9636ee7..e8b0566 100755
--- a/update.sh
+++ b/update.sh
@@ -1,4 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2#
3# Copyright (c) 2014 Brent Cook
4#
5# Permission to use, copy, modify, and distribute this software for any
6# purpose with or without fee is hereby granted, provided that the above
7# copyright notice and this permission notice appear in all copies.
8#
9# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
2set -e 17set -e
3 18
4openbsd_branch=`cat OPENBSD_BRANCH` 19openbsd_branch=`cat OPENBSD_BRANCH`
@@ -83,8 +98,6 @@ if [ -x /opt/csw/bin/ggrep ]; then
83 GREP='/opt/csw/bin/ggrep' 98 GREP='/opt/csw/bin/ggrep'
84fi 99fi
85 100
86$CP $libssl_src/LICENSE COPYING
87
88$CP $libcrypto_src/opensslfeatures.h include/openssl 101$CP $libcrypto_src/opensslfeatures.h include/openssl
89$CP $libssl_src/pqueue.h include 102$CP $libssl_src/pqueue.h include
90 103
@@ -166,6 +179,11 @@ for i in `awk '/SOURCES|HEADERS/ { print $3 }' crypto/Makefile.am` ; do
166 fi 179 fi
167done 180done
168 181
182for arch in amd64 i386; do
183 $CP $libcrypto_src/aes/aes_${arch}.c crypto/aes/
184 $CP $libcrypto_src/modes/gcm128_${arch}.c crypto/modes/
185done
186
169for i in $libcrypto_src/arch/*; do 187for i in $libcrypto_src/arch/*; do
170 arch=`basename $i` 188 arch=`basename $i`
171 mkdir -p include/arch/$arch 189 mkdir -p include/arch/$arch
@@ -210,6 +228,7 @@ gen_asm_stdout() {
210 EOF 228 EOF
211 if [ $1 = "masm" ]; then 229 if [ $1 = "masm" ]; then
212 fixup_masm crypto/$3.tmp crypto/$3 230 fixup_masm crypto/$3.tmp crypto/$3
231 rm crypto/$3.tmp
213 else 232 else
214 $MV crypto/$3.tmp crypto/$3 233 $MV crypto/$3.tmp crypto/$3
215 fi 234 fi
@@ -238,6 +257,7 @@ gen_asm() {
238 EOF 257 EOF
239 if [ $1 = "masm" ]; then 258 if [ $1 = "masm" ]; then
240 fixup_masm crypto/$3.tmp crypto/$3 259 fixup_masm crypto/$3.tmp crypto/$3
260 rm crypto/$3.tmp
241 else 261 else
242 $MV crypto/$3.tmp crypto/$3 262 $MV crypto/$3.tmp crypto/$3
243 fi 263 fi
@@ -259,23 +279,10 @@ gen_asm_mips 64 sha sha1-mips sha1-mips64
259gen_asm_mips 64 sha sha512-mips sha256-mips64 279gen_asm_mips 64 sha sha512-mips sha256-mips64
260gen_asm_mips 64 sha sha512-mips sha512-mips64 280gen_asm_mips 64 sha sha512-mips sha512-mips64
261 281
262echo generating arm ASM source for elf
263gen_asm_stdout elf aes/asm/aes-armv4.pl aes/aes-elf-armv4.S
264gen_asm_stdout elf bn/asm/armv4-mont.pl bn/mont-elf-armv4.S
265gen_asm_stdout elf sha/asm/sha1-armv4-large.pl sha/sha1-elf-armv4.S
266gen_asm_stdout elf sha/asm/sha256-armv4.pl sha/sha256-elf-armv4.S
267gen_asm_stdout elf sha/asm/sha512-armv4.pl sha/sha512-elf-armv4.S
268gen_asm_stdout elf modes/asm/ghash-armv4.pl modes/ghash-elf-armv4.S
269$CP $libcrypto_src/arch/arm/armv4cpuid.S crypto
270$CP $libcrypto_src/arch/arm/armcap.c crypto
271$CP $libcrypto_src/arch/arm/arm_arch.h crypto
272
273for abi in elf macosx masm mingw64; do 282for abi in elf macosx masm mingw64; do
274 echo generating x86_64 ASM source for $abi 283 echo generating x86_64 ASM source for $abi
275 284
276 gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S 285 gen_asm_stdout $abi aes/asm/aes-x86_64.pl aes/aes-$abi-x86_64.S
277 gen_asm_stdout $abi aes/asm/vpaes-x86_64.pl aes/vpaes-$abi-x86_64.S
278 gen_asm_stdout $abi aes/asm/bsaes-x86_64.pl aes/bsaes-$abi-x86_64.S
279 gen_asm_stdout $abi aes/asm/aesni-x86_64.pl aes/aesni-$abi-x86_64.S 286 gen_asm_stdout $abi aes/asm/aesni-x86_64.pl aes/aesni-$abi-x86_64.S
280 gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl bn/modexp512-$abi-x86_64.S 287 gen_asm_stdout $abi bn/asm/modexp512-x86_64.pl bn/modexp512-$abi-x86_64.S
281 gen_asm_stdout $abi bn/asm/x86_64-mont.pl bn/mont-$abi-x86_64.S 288 gen_asm_stdout $abi bn/asm/x86_64-mont.pl bn/mont-$abi-x86_64.S
@@ -376,7 +383,6 @@ done
376$CP $libssl_regress/unit/tests.h tests 383$CP $libssl_regress/unit/tests.h tests
377$CP $libssl_regress/certs/*.pem tests 384$CP $libssl_regress/certs/*.pem tests
378$CP $libssl_regress/certs/*.crl tests 385$CP $libssl_regress/certs/*.crl tests
379$CP $libssl_regress/pqueue/expected.txt tests/pq_expected.txt
380 386
381# copy libtls tests 387# copy libtls tests
382for i in `find $libtls_regress -name '*.c'`; do 388for i in `find $libtls_regress -name '*.c'`; do