Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libressl: update to 4.0.0 #23280

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,107 changes: 0 additions & 2,107 deletions mingw-w64-libressl/0001-libressl_relocation-msys.patch

This file was deleted.

178 changes: 178 additions & 0 deletions mingw-w64-libressl/0001-relocation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9c3d0d4..e0537a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,6 +123,7 @@ add_definitions(-DLIBRESSL_INTERNAL)
add_definitions(-DOPENSSL_NO_HW_PADLOCK)
add_definitions(-D__BEGIN_HIDDEN_DECLS=)
add_definitions(-D__END_HIDDEN_DECLS=)
+add_definitions(-DOPENSSLBIN=\"${CMAKE_INSTALL_FULL_BINDIR}\")

set(CMAKE_POSITION_INDEPENDENT_CODE true)

diff --git a/Makefile.am.common b/Makefile.am.common
index 5405704..a166c15 100644
--- a/Makefile.am.common
+++ b/Makefile.am.common
@@ -3,3 +3,4 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(abs_top_builddir)/include
AM_CPPFLAGS += -I$(top_srcdir)/include/compat -DLIBRESSL_INTERNAL
AM_CPPFLAGS += -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS=
+AM_CPPFLAGS += -DOPENSSLBIN=\"$(bindir)\"
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index 5140a7a..d5c216d 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -204,6 +204,7 @@ set(
mem_clr.c
mem_dbg.c
o_fips.c
+ pathtools.c
aes/aes.c
aes/aes_core.c
aes/aes_ige.c
diff --git a/crypto/Makefile.am b/crypto/Makefile.am
index cd6fe29..8e20b62 100644
--- a/crypto/Makefile.am
+++ b/crypto/Makefile.am
@@ -223,6 +223,10 @@ noinst_HEADERS += crypto_internal.h
noinst_HEADERS += crypto_local.h
noinst_HEADERS += x86_arch.h

+# pathtools
+libcrypto_la_SOURCES += pathtools.c
+noinst_HEADERS += pathtools.h
+
# aes
libcrypto_la_SOURCES += aes/aes.c
libcrypto_la_SOURCES += aes/aes_core.c
diff --git a/crypto/ct/ct_log.c b/crypto/ct/ct_log.c
index 514246f..63e0b0a 100644
--- a/crypto/ct/ct_log.c
+++ b/crypto/ct/ct_log.c
@@ -70,6 +70,7 @@
#include "conf_local.h"

#include "cryptlib.h"
+#include "pathtools.h"


/*
@@ -200,7 +201,11 @@ ctlog_new_from_conf(CTLOG **ct_log, const CONF *conf, const char *section)
int
CTLOG_STORE_load_default_file(CTLOG_STORE *store)
{
- return CTLOG_STORE_load_file(store, CTLOG_FILE);
+ static char *reloc = NULL;
+ if (reloc == NULL) {
+ reloc = single_path_relocation_lib(OPENSSLBIN, CTLOG_FILE);
+ }
+ return CTLOG_STORE_load_file(store, reloc);
}
LCRYPTO_ALIAS(CTLOG_STORE_load_default_file);

diff --git a/crypto/x509/x509_def.c b/crypto/x509/x509_def.c
index f85781a..1f708a3 100644
--- a/crypto/x509/x509_def.c
+++ b/crypto/x509/x509_def.c
@@ -60,32 +60,49 @@
#include "cryptlib.h"
#include <openssl/crypto.h>
#include <openssl/x509.h>
+#include "pathtools.h"

const char *
X509_get_default_private_dir(void)
{
- return (X509_PRIVATE_DIR);
+ static char *reloc = NULL;
+ if (reloc == NULL) {
+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_PRIVATE_DIR);
+ }
+ return reloc;
}
LCRYPTO_ALIAS(X509_get_default_private_dir);

const char *
X509_get_default_cert_area(void)
{
- return (X509_CERT_AREA);
+ static char *reloc = NULL;
+ if (reloc == NULL) {
+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_CERT_AREA);
+ }
+ return reloc;
}
LCRYPTO_ALIAS(X509_get_default_cert_area);

const char *
X509_get_default_cert_dir(void)
{
- return (X509_CERT_DIR);
+ static char *reloc = NULL;
+ if (reloc == NULL) {
+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_CERT_DIR);
+ }
+ return reloc;
}
LCRYPTO_ALIAS(X509_get_default_cert_dir);

const char *
X509_get_default_cert_file(void)
{
- return (X509_CERT_FILE);
+ static char *reloc = NULL;
+ if (reloc == NULL) {
+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_CERT_FILE);
+ }
+ return reloc;
}
LCRYPTO_ALIAS(X509_get_default_cert_file);

diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index c81bbb0..36218bc 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -1,5 +1,6 @@
set(
TLS_SRC
+ pathtools.c
tls.c
tls_bio_cb.c
tls_client.c
diff --git a/tls/Makefile.am b/tls/Makefile.am
index 22f3222..a00b1fe 100644
--- a/tls/Makefile.am
+++ b/tls/Makefile.am
@@ -59,3 +59,7 @@ libtls_la_SOURCES += compat/ftruncate.c
libtls_la_SOURCES += compat/pread.c
libtls_la_SOURCES += compat/pwrite.c
endif
+
+# pathtools
+libtls_la_SOURCES += pathtools.c
+noinst_HEADERS += pathtools.h
diff --git a/tls/tls_config.c b/tls/tls_config.c
index 22fa845..90697c0 100644
--- a/tls/tls_config.c
+++ b/tls/tls_config.c
@@ -28,13 +28,18 @@
#include <tls.h>

#include "tls_internal.h"
+#include "pathtools.h"

static const char default_ca_file[] = TLS_DEFAULT_CA_FILE;

const char *
tls_default_ca_cert_file(void)
{
- return default_ca_file;
+ static char *reloc = NULL;
+ if (reloc == NULL) {
+ reloc = single_path_relocation_lib(OPENSSLBIN, default_ca_file);
+ }
+ return reloc;
}

int
75 changes: 75 additions & 0 deletions mingw-w64-libressl/0002-add-prefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
diff --git a/apps/nc/CMakeLists.txt b/apps/nc/CMakeLists.txt
index d5f7813..43c6c71 100644
--- a/apps/nc/CMakeLists.txt
+++ b/apps/nc/CMakeLists.txt
@@ -42,6 +42,8 @@ target_include_directories(nc
${CMAKE_BINARY_DIR}/include)
target_link_libraries(nc ${LIBTLS_LIBS} compat_obj)

+set_target_properties(nc PROPERTIES PREFIX libressl-)
+
if(ENABLE_NC)
if(ENABLE_LIBRESSL_INSTALL)
install(TARGETS nc DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/apps/ocspcheck/CMakeLists.txt b/apps/ocspcheck/CMakeLists.txt
index 778e837..db22078 100644
--- a/apps/ocspcheck/CMakeLists.txt
+++ b/apps/ocspcheck/CMakeLists.txt
@@ -22,6 +22,8 @@ target_include_directories(ocspcheck
${CMAKE_BINARY_DIR}/include)
target_link_libraries(ocspcheck tls ${OPENSSL_LIBS} compat_obj tls_compat_obj)

+set_target_properties(ocspcheck PROPERTIES PREFIX libressl-)
+
if(ENABLE_LIBRESSL_INSTALL)
install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt
index bca60e1..d71aa24 100644
--- a/apps/openssl/CMakeLists.txt
+++ b/apps/openssl/CMakeLists.txt
@@ -76,6 +76,8 @@ target_include_directories(openssl
${CMAKE_BINARY_DIR}/include)
target_link_libraries(openssl ${OPENSSL_LIBS} compat_obj)

+set_target_properties(openssl PROPERTIES PREFIX libressl-)
+
if(ENABLE_LIBRESSL_INSTALL)
install(TARGETS openssl DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES openssl.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt
index d5c216d..eb4ae5d 100644
--- a/crypto/CMakeLists.txt
+++ b/crypto/CMakeLists.txt
@@ -845,6 +845,7 @@ set_target_properties(crypto PROPERTIES
OUTPUT_NAME crypto
ARCHIVE_OUTPUT_NAME crypto
EXPORT_NAME Crypto
+ PREFIX libre
VERSION ${CRYPTO_VERSION}
SOVERSION ${CRYPTO_MAJOR_VERSION}
)
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt
index cf62ff4..a6d5f6b 100644
--- a/ssl/CMakeLists.txt
+++ b/ssl/CMakeLists.txt
@@ -90,6 +90,7 @@ set_target_properties(ssl PROPERTIES
OUTPUT_NAME ssl
ARCHIVE_OUTPUT_NAME ssl
EXPORT_NAME SSL
+ PREFIX libre
VERSION ${SSL_VERSION}
SOVERSION ${SSL_MAJOR_VERSION}
)
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt
index 36218bc..8d4ca65 100644
--- a/tls/CMakeLists.txt
+++ b/tls/CMakeLists.txt
@@ -63,6 +63,7 @@ set_target_properties(tls PROPERTIES
OUTPUT_NAME tls
ARCHIVE_OUTPUT_NAME tls
EXPORT_NAME TLS
+ PREFIX libre
VERSION ${TLS_VERSION}
SOVERSION ${TLS_MAJOR_VERSION}
)
101 changes: 0 additions & 101 deletions mingw-w64-libressl/0002-libressl_relocation-tests.patch

This file was deleted.

Loading