erlang: update to 26.2.1

- Update to Erlang/OTP 26.2.1
- Remove obsolete configure options
- Remove obsolete patches, add new one
- Add missing no_dot_erlang.boot file (fixes #20587)
- Change package URL to https

Signed-off-by: krant <aleksey.vasilenko@gmail.com>
This commit is contained in:
krant 2024-01-10 15:27:01 +02:00 committed by Rosen Penev
parent 4bdc29ece4
commit e8673e9e85
8 changed files with 478 additions and 413 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=erlang
PKG_VERSION:=24.2
PKG_RELEASE:=3
PKG_VERSION:=26.2.1
PKG_RELEASE:=1
PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= http://www.erlang.org/download/
PKG_HASH:=af0f1928dcd16cd5746feeca8325811865578bf1a110a443d353ea3e509e6d41
PKG_SOURCE_URL:= https://github.com/erlang/otp/releases/download/OTP-$(PKG_VERSION)/
PKG_HASH:=80d66bafbae409481a4e1badcb4a6275b07a8e9af82980c08d7a8add483232a9
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE.txt
@ -35,7 +35,7 @@ define Package/erlang/Default
SECTION:=lang
CATEGORY:=Languages
TITLE:=Erlang/OTP programming language
URL:=http://www.erlang.org/
URL:=https://www.erlang.org/
endef
define Package/erlang/Default/description
@ -47,7 +47,7 @@ endef
define Package/erlang
$(call Package/erlang/Default)
DEPENDS+= +libncurses +librt +zlib +libstdcpp
PROVIDES:= erlang-erts=12.2 erlang-kernel=8.2 erlang-sasl=4.1.1 erlang-stdlib=3.17
PROVIDES:= erlang-erts=14.2.1 erlang-kernel=9.2 erlang-sasl=4.2.1 erlang-stdlib=5.2
endef
define Package/erlang/description
@ -61,7 +61,7 @@ endef
define Package/erlang-asn1
$(call Package/erlang/Default)
TITLE:=Abstract Syntax Notation One (ASN.1) support
VERSION:=5.0.17
VERSION:=5.2.1
DEPENDS+= +erlang +erlang-syntax-tools
endef
@ -76,7 +76,7 @@ endef
define Package/erlang-compiler
$(call Package/erlang/Default)
TITLE:=Byte code compiler
VERSION:=8.0.4
VERSION:=8.4.1
DEPENDS+= +erlang
endef
@ -91,7 +91,7 @@ endef
define Package/erlang-crypto
$(call Package/erlang/Default)
TITLE:=Cryptography support
VERSION:=5.0.5
VERSION:=5.4
DEPENDS+= +erlang +libopenssl
endef
@ -106,7 +106,7 @@ endef
define Package/erlang-inets
$(call Package/erlang/Default)
TITLE:=Internet clients and servers
VERSION:=7.5
VERSION:=9.1
DEPENDS+= +erlang
endef
@ -122,7 +122,7 @@ endef
define Package/erlang-mnesia
$(call Package/erlang/Default)
TITLE:=Distributed database
VERSION:=4.20.1
VERSION:=4.23
DEPENDS+= +erlang
endef
@ -139,7 +139,7 @@ endef
define Package/erlang-runtime-tools
$(call Package/erlang/Default)
TITLE:=Low-profile debugging/tracing tools
VERSION:=1.17
VERSION:=2.0.1
DEPENDS+= +erlang
endef
@ -154,7 +154,7 @@ endef
define Package/erlang-snmp
$(call Package/erlang/Default)
TITLE:=Simple Network Management Protocol (SNMP) support
VERSION:=5.11
VERSION:=5.15
DEPENDS+= +erlang +erlang-asn1
endef
@ -170,7 +170,7 @@ endef
define Package/erlang-public-key
$(call Package/erlang/Default)
TITLE:=Public Key support
VERSION:=1.11.3
VERSION:=1.15
DEPENDS+= +erlang +erlang-crypto +erlang-asn1
endef
@ -184,7 +184,7 @@ endef
define Package/erlang-ssh
$(call Package/erlang/Default)
TITLE:=Secure Shell (SSH) support
VERSION:=4.13
VERSION:=5.1.1
DEPENDS+= +erlang +erlang-crypto
endef
@ -199,7 +199,7 @@ endef
define Package/erlang-ssl
$(call Package/erlang/Default)
TITLE:=Secure Sockets Layer (SSL) support
VERSION:=10.6
VERSION:=11.1
DEPENDS+= +erlang +erlang-crypto
endef
@ -214,7 +214,7 @@ endef
define Package/erlang-syntax-tools
$(call Package/erlang/Default)
TITLE:=Abstract Erlang syntax trees handling support
VERSION:=2.6
VERSION:=3.1
DEPENDS+= +erlang
endef
@ -229,7 +229,7 @@ endef
define Package/erlang-tools
$(call Package/erlang/Default)
TITLE:=Erlang tools support
VERSION:=3.5.2
VERSION:=3.6
DEPENDS+= +erlang
endef
@ -243,7 +243,7 @@ endef
define Package/erlang-reltool
$(call Package/erlang/Default)
TITLE:=Erlang reltool support
VERSION:=0.9
VERSION:=1.0
DEPENDS+= +erlang
endef
@ -257,7 +257,7 @@ endef
define Package/erlang-erl-interface
$(call Package/erlang/Default)
TITLE:=Erlang erl_interface support
VERSION:=5.1
VERSION:=5.5
DEPENDS+= +erlang
endef
@ -270,7 +270,7 @@ endef
define Package/erlang-os_mon
$(call Package/erlang/Default)
TITLE:=Erlang OS Monitoring Application
VERSION:=2.7.1
VERSION:=2.9.1
DEPENDS+= +erlang
endef
@ -286,7 +286,7 @@ endef
define Package/erlang-xmerl
$(call Package/erlang/Default)
TITLE:=Erlang XML export
VERSION:=1.3.28
VERSION:=1.3.34
DEPENDS+= +erlang
endef
@ -305,16 +305,11 @@ HOST_CFLAGS += \
HOST_CONFIGURE_ARGS += \
--with-ssl="$(STAGING_DIR_HOST)" \
--disable-hipe \
--disable-pgo \
--disable-smp-support \
--without-javac
# Target
CONFIGURE_ARGS += \
--disable-hipe \
--disable-smp-support \
--without-javac \
--enable-dynamic-ssl-lib
@ -343,7 +338,7 @@ define Package/erlang/install
$(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \
done
$(INSTALL_DIR) $(1)/usr/lib/erlang/bin
for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot to_erl; do \
for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot no_dot_erlang.boot to_erl; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \
done
$(INSTALL_DIR) $(1)/usr/lib/erlang/lib
@ -408,4 +403,3 @@ $(eval $(call BuildModule,reltool,reltool))
$(eval $(call BuildModule,erl-interface,erl_interface))
$(eval $(call BuildModule,os_mon,os_mon))
$(eval $(call BuildModule,xmerl,xmerl))

View File

@ -1,48 +0,0 @@
--- a/lib/crypto/c_src/engine.c
+++ b/lib/crypto/c_src/engine.c
@@ -239,7 +239,7 @@ ERL_NIF_TERM engine_load_dynamic_nif(Erl
#ifdef HAS_ENGINE_SUPPORT
ASSERT(argc == 0);
- ENGINE_load_dynamic();
+ ENGINE_load_builtin_engines();
return atom_ok;
#else
return atom_notsup;
--- a/lib/crypto/c_src/info.c
+++ b/lib/crypto/c_src/info.c
@@ -46,6 +46,11 @@
#endif
+#if OPENSSL_VERSION_NUMBER < PACKED_OPENSSL_VERSION_PLAIN(1,1,0)
+#define OPENSSL_VERSION SSLEAY_VERSION
+#define OpenSSL_version SSLeay_version
+#endif
+
#ifdef HAVE_DYNAMIC_CRYPTO_LIB
char *crypto_callback_name = CB_NAME;
@@ -132,7 +137,7 @@ ERL_NIF_TERM info_lib(ErlNifEnv *env, in
ASSERT(argc == 0);
name_sz = strlen(libname);
- ver = SSLeay_version(SSLEAY_VERSION);
+ ver = OpenSSL_version(OPENSSL_VERSION);
ver_sz = strlen(ver);
ver_num = OPENSSL_VERSION_NUMBER;
--- a/lib/crypto/c_src/otp_test_engine.c
+++ b/lib/crypto/c_src/otp_test_engine.c
@@ -101,9 +101,11 @@ static int test_init(ENGINE *e) {
goto err;
#endif /* if defined(FAKE_RSA_IMPL) */
+#if OPENSSL_VERSION_NUMBER < PACKED_OPENSSL_VERSION_PLAIN(1,1,0)
/* Load all digest and cipher algorithms. Needed for password protected private keys */
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
+#endif
return 111;

View File

@ -0,0 +1,455 @@
From eace72dfda7e6452dc82b884f0385a78a9d65d10 Mon Sep 17 00:00:00 2001
From: Paul Swartz <paul@paulswartz.net>
Date: Sun, 31 Dec 2023 13:12:02 -0500
Subject: [PATCH 1/3] fix: rename `openssl/md5.h` to avoid include conflicts
with OpenSSL
Ref: #7987
---
erts/emulator/openssl/README | 2 +-
erts/emulator/openssl/crypto/md5/md5_local.h | 2 +-
erts/emulator/openssl/include/erl_md5.h | 2 +-
.../emulator/openssl/include/{openssl => openssl_local}/md5.h | 0
erts/emulator/openssl/openssl.diff | 4 ++--
erts/emulator/openssl/openssl.mk | 2 +-
lib/erl_interface/src/openssl/README | 2 +-
lib/erl_interface/src/openssl/crypto/md5/md5_local.h | 2 +-
lib/erl_interface/src/openssl/include/erl_md5.h | 2 +-
.../src/openssl/include/{openssl => openssl_local}/md5.h | 0
lib/erl_interface/src/openssl/openssl.diff | 4 ++--
11 files changed, 11 insertions(+), 11 deletions(-)
rename erts/emulator/openssl/include/{openssl => openssl_local}/md5.h (100%)
rename lib/erl_interface/src/openssl/include/{openssl => openssl_local}/md5.h (100%)
--- a/erts/emulator/openssl/README
+++ b/erts/emulator/openssl/README
@@ -7,7 +7,7 @@ The files that has been taken from the 3
./crypto/md5/md5_local.h
./crypto/md5/md5_dgst.c
./include/crypto/md32_common.h
-./include/openssl/md5.h
+./include/openssl_local/md5.h (renamed from include/openssl/md5.h)
The openssl.diff file contains the diff between the original files and the ones
included in OTP.
--- a/erts/emulator/openssl/crypto/md5/md5_local.h
+++ b/erts/emulator/openssl/crypto/md5/md5_local.h
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>
#if defined(ERLANG_OPENSSL_INTEGRATION)
-#include "openssl/md5.h"
+#include "openssl_local/md5.h"
#define md5_block_data_order MD5_BLOCK_DATA_ORDER_FUNCTION_NAME
#undef MD5_ASM
#else
--- a/erts/emulator/openssl/include/erl_md5.h
+++ b/erts/emulator/openssl/include/erl_md5.h
@@ -30,6 +30,6 @@
#define MD5_TRANSFORM_FUNCTION_NAME MD5Transform
#define MD5_BLOCK_DATA_ORDER_FUNCTION_NAME MD5BlockDataOrder
-#include "openssl/md5.h"
+#include "openssl_local/md5.h"
#endif
--- a/erts/emulator/openssl/openssl.diff
+++ b/erts/emulator/openssl/openssl.diff
@@ -46,7 +46,7 @@ diff -u original/crypto/md5/md5_local.h
#include <stdlib.h>
#include <string.h>
+#if defined(ERLANG_OPENSSL_INTEGRATION)
-+#include "openssl/md5.h"
++#include "openssl_local/md5.h"
+#define md5_block_data_order MD5_BLOCK_DATA_ORDER_FUNCTION_NAME
+#undef MD5_ASM
+#else
@@ -116,7 +116,7 @@ diff -u original/include/crypto/md32_com
# error "HASH_MAKE_STRING must be defined!"
diff -u original/include/openssl/md5.h include/openssl/md5.h
--- original/include/openssl/md5.h 2023-11-24 15:58:28.610171865 +0100
-+++ include/openssl/md5.h 2023-11-24 23:10:52.570854593 +0100
++++ include/openssl_local/md5.h 2023-11-24 23:10:52.570854593 +0100
@@ -11,6 +11,15 @@
# define OPENSSL_MD5_H
# pragma once
--- a/erts/emulator/openssl/openssl.mk
+++ b/erts/emulator/openssl/openssl.mk
@@ -50,4 +50,4 @@ $(OPENSSL_OBJDIR)/%.o: $(OPENSSL_DIR)/cr
$(OPENSSL_OBJDIR)/md5_dgst.o: $(OPENSSL_DIR)/crypto/md5/md5_dgst.c \
$(OPENSSL_DIR)/crypto/md5/md5_local.h \
$(OPENSSL_DIR)/include/crypto/md32_common.h \
- $(OPENSSL_DIR)/include/openssl/md5.h
+ $(OPENSSL_DIR)/include/openssl_local/md5.h
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -42,7 +42,7 @@
# include <sys/select.h>
# endif
# include <time.h>
-# if HAVE_SYS_TIME_H
+# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# endif
# include <string.h>
--- a/lib/erl_interface/src/openssl/crypto/md5/md5_local.h
+++ b/lib/erl_interface/src/openssl/crypto/md5/md5_local.h
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>
#if defined(ERLANG_OPENSSL_INTEGRATION)
-#include "openssl/md5.h"
+#include "openssl_local/md5.h"
#define md5_block_data_order MD5_BLOCK_DATA_ORDER_FUNCTION_NAME
#undef MD5_ASM
#else
--- a/lib/erl_interface/src/openssl/include/erl_md5.h
+++ b/lib/erl_interface/src/openssl/include/erl_md5.h
@@ -30,6 +30,6 @@
#define MD5_TRANSFORM_FUNCTION_NAME ei_MD5Transform
#define MD5_BLOCK_DATA_ORDER_FUNCTION_NAME ei_MD5BlockDataOrder
-#include "openssl/md5.h"
+#include "openssl_local/md5.h"
#endif
--- a/erts/emulator/openssl/include/openssl/md5.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License"). You may not use
- * this file except in compliance with the License. You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_MD5_H
-# define OPENSSL_MD5_H
-# pragma once
-
-#if defined(ERLANG_OPENSSL_INTEGRATION)
-
-#include "erl_md5.h"
-
-#undef OPENSSL_NO_MD5
-#undef OPENSSL_NO_DEPRECATED_3_0
-
-#else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-
-# include <openssl/macros.h>
-# ifndef OPENSSL_NO_DEPRECATED_3_0
-# define HEADER_MD5_H
-# endif
-
-# include <openssl/opensslconf.h>
-
-#endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-
-# ifndef OPENSSL_NO_MD5
-#if !defined(ERLANG_OPENSSL_INTEGRATION)
-# include <openssl/e_os2.h>
-#endif
-# include <stddef.h>
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# define MD5_DIGEST_LENGTH 16
-
-# if !defined(OPENSSL_NO_DEPRECATED_3_0)
-/*
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- * ! MD5_LONG has to be at least 32 bits wide. !
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- */
-# define MD5_LONG unsigned int
-
-# define MD5_CBLOCK 64
-# define MD5_LBLOCK (MD5_CBLOCK/4)
-
-typedef struct MD5state_st {
- MD5_LONG A, B, C, D;
- MD5_LONG Nl, Nh;
- MD5_LONG data[MD5_LBLOCK];
- unsigned int num;
-} MD5_CTX;
-# endif
-# ifndef OPENSSL_NO_DEPRECATED_3_0
-# if defined(ERLANG_OPENSSL_INTEGRATION)
-int MD5_INIT_FUNCTION_NAME(MD5_CTX *c);
-int MD5_UPDATE_FUNCTION_NAME(MD5_CTX *c, const void *data, size_t len);
-int MD5_FINAL_FUNCTION_NAME(unsigned char *md, MD5_CTX *c);
-void MD5_TRANSFORM_FUNCTION_NAME(MD5_CTX *c, const unsigned char *b);
-# else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
-OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
-OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
-OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
- unsigned char *md);
-OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
-# endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-# endif
-
-# ifdef __cplusplus
-}
-# endif
-# endif
-
-#endif
--- /dev/null
+++ b/erts/emulator/openssl/include/openssl_local/md5.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OPENSSL_MD5_H
+# define OPENSSL_MD5_H
+# pragma once
+
+#if defined(ERLANG_OPENSSL_INTEGRATION)
+
+#include "erl_md5.h"
+
+#undef OPENSSL_NO_MD5
+#undef OPENSSL_NO_DEPRECATED_3_0
+
+#else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+
+# include <openssl/macros.h>
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# define HEADER_MD5_H
+# endif
+
+# include <openssl/opensslconf.h>
+
+#endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+
+# ifndef OPENSSL_NO_MD5
+#if !defined(ERLANG_OPENSSL_INTEGRATION)
+# include <openssl/e_os2.h>
+#endif
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define MD5_DIGEST_LENGTH 16
+
+# if !defined(OPENSSL_NO_DEPRECATED_3_0)
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD5_LONG has to be at least 32 bits wide. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+# define MD5_LONG unsigned int
+
+# define MD5_CBLOCK 64
+# define MD5_LBLOCK (MD5_CBLOCK/4)
+
+typedef struct MD5state_st {
+ MD5_LONG A, B, C, D;
+ MD5_LONG Nl, Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+} MD5_CTX;
+# endif
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# if defined(ERLANG_OPENSSL_INTEGRATION)
+int MD5_INIT_FUNCTION_NAME(MD5_CTX *c);
+int MD5_UPDATE_FUNCTION_NAME(MD5_CTX *c, const void *data, size_t len);
+int MD5_FINAL_FUNCTION_NAME(unsigned char *md, MD5_CTX *c);
+void MD5_TRANSFORM_FUNCTION_NAME(MD5_CTX *c, const unsigned char *b);
+# else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
+ unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+# endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+# endif
+
+#endif
--- a/lib/erl_interface/src/openssl/include/openssl/md5.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License"). You may not use
- * this file except in compliance with the License. You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#ifndef OPENSSL_MD5_H
-# define OPENSSL_MD5_H
-# pragma once
-
-#if defined(ERLANG_OPENSSL_INTEGRATION)
-
-#include "erl_md5.h"
-
-#undef OPENSSL_NO_MD5
-#undef OPENSSL_NO_DEPRECATED_3_0
-
-#else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-
-# include <openssl/macros.h>
-# ifndef OPENSSL_NO_DEPRECATED_3_0
-# define HEADER_MD5_H
-# endif
-
-# include <openssl/opensslconf.h>
-
-#endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-
-# ifndef OPENSSL_NO_MD5
-#if !defined(ERLANG_OPENSSL_INTEGRATION)
-# include <openssl/e_os2.h>
-#endif
-# include <stddef.h>
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# define MD5_DIGEST_LENGTH 16
-
-# if !defined(OPENSSL_NO_DEPRECATED_3_0)
-/*
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- * ! MD5_LONG has to be at least 32 bits wide. !
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- */
-# define MD5_LONG unsigned int
-
-# define MD5_CBLOCK 64
-# define MD5_LBLOCK (MD5_CBLOCK/4)
-
-typedef struct MD5state_st {
- MD5_LONG A, B, C, D;
- MD5_LONG Nl, Nh;
- MD5_LONG data[MD5_LBLOCK];
- unsigned int num;
-} MD5_CTX;
-# endif
-# ifndef OPENSSL_NO_DEPRECATED_3_0
-# if defined(ERLANG_OPENSSL_INTEGRATION)
-int MD5_INIT_FUNCTION_NAME(MD5_CTX *c);
-int MD5_UPDATE_FUNCTION_NAME(MD5_CTX *c, const void *data, size_t len);
-int MD5_FINAL_FUNCTION_NAME(unsigned char *md, MD5_CTX *c);
-void MD5_TRANSFORM_FUNCTION_NAME(MD5_CTX *c, const unsigned char *b);
-# else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
-OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
-OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
-OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
- unsigned char *md);
-OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
-# endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
-# endif
-
-# ifdef __cplusplus
-}
-# endif
-# endif
-
-#endif
--- /dev/null
+++ b/lib/erl_interface/src/openssl/include/openssl_local/md5.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OPENSSL_MD5_H
+# define OPENSSL_MD5_H
+# pragma once
+
+#if defined(ERLANG_OPENSSL_INTEGRATION)
+
+#include "erl_md5.h"
+
+#undef OPENSSL_NO_MD5
+#undef OPENSSL_NO_DEPRECATED_3_0
+
+#else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+
+# include <openssl/macros.h>
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# define HEADER_MD5_H
+# endif
+
+# include <openssl/opensslconf.h>
+
+#endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+
+# ifndef OPENSSL_NO_MD5
+#if !defined(ERLANG_OPENSSL_INTEGRATION)
+# include <openssl/e_os2.h>
+#endif
+# include <stddef.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define MD5_DIGEST_LENGTH 16
+
+# if !defined(OPENSSL_NO_DEPRECATED_3_0)
+/*
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * ! MD5_LONG has to be at least 32 bits wide. !
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ */
+# define MD5_LONG unsigned int
+
+# define MD5_CBLOCK 64
+# define MD5_LBLOCK (MD5_CBLOCK/4)
+
+typedef struct MD5state_st {
+ MD5_LONG A, B, C, D;
+ MD5_LONG Nl, Nh;
+ MD5_LONG data[MD5_LBLOCK];
+ unsigned int num;
+} MD5_CTX;
+# endif
+# ifndef OPENSSL_NO_DEPRECATED_3_0
+# if defined(ERLANG_OPENSSL_INTEGRATION)
+int MD5_INIT_FUNCTION_NAME(MD5_CTX *c);
+int MD5_UPDATE_FUNCTION_NAME(MD5_CTX *c, const void *data, size_t len);
+int MD5_FINAL_FUNCTION_NAME(unsigned char *md, MD5_CTX *c);
+void MD5_TRANSFORM_FUNCTION_NAME(MD5_CTX *c, const unsigned char *b);
+# else /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+OSSL_DEPRECATEDIN_3_0 int MD5_Init(MD5_CTX *c);
+OSSL_DEPRECATEDIN_3_0 int MD5_Update(MD5_CTX *c, const void *data, size_t len);
+OSSL_DEPRECATEDIN_3_0 int MD5_Final(unsigned char *md, MD5_CTX *c);
+OSSL_DEPRECATEDIN_3_0 unsigned char *MD5(const unsigned char *d, size_t n,
+ unsigned char *md);
+OSSL_DEPRECATEDIN_3_0 void MD5_Transform(MD5_CTX *c, const unsigned char *b);
+# endif /* !defined(ERLANG_OPENSSL_INTEGRATION) */
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+# endif
+
+#endif

View File

@ -1,53 +0,0 @@
From 85a3e5b4f65e5284e59dcdd90e92ea7d50ef6907 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@openwide.fr>
Date: Sun, 8 Feb 2015 17:23:13 +0100
Subject: [PATCH] erts/emulator: reorder inclued headers paths
If the Perl Compatible Regular Expressions is installed on the
host and the path to the headers is added to the CFLAGS, the
pcre.h from the host is used instead of the one provided by
erlang.
Erlang use an old version of this file which is incompatible
with the upstream one.
Move INCLUDES before CFLAGS to use pcre.h from erlang.
http://autobuild.buildroot.net/results/cbd/cbd8b54eef535f19d7d400fd269af1b3571d6143/build-end.log
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
[Bernd: rebased for erlang-21.0]
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[svlobanov: updated for erlang-24.2]
---
erts/emulator/Makefile.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/erts/emulator/Makefile.in
+++ b/erts/emulator/Makefile.in
@@ -800,7 +800,7 @@ endif
# Usually the same as the default rule, but certain platforms (e.g. win32) mix
# different compilers
$(OBJDIR)/beam_emu.o: beam/emu/beam_emu.c
- $(V_EMU_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
+ $(V_EMU_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
$(OBJDIR)/beam_emu.S: beam/emu/beam_emu.c
$(V_EMU_CC) -S -fverbose-asm $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
@@ -863,13 +863,13 @@ endif
# General targets
#
$(OBJDIR)/%.o: beam/%.c
- $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
+ $(V_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
$(OBJDIR)/%.o: beam/emu/%.c
- $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
+ $(V_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
$(OBJDIR)/%.o: beam/jit/%.c
- $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
+ $(V_CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
$(OBJDIR)/%.o: $(TARGET)/%.c
$(V_CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@

View File

@ -1,86 +0,0 @@
From ca2fed6c60039003f255ffe7a5d98744b8ebdedc Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Thu, 17 Feb 2022 12:22:06 +0100
Subject: [PATCH] crypto: Make configure flag --disable-otp-test-engine
---
lib/crypto/c_src/Makefile.in | 16 ++++++++++++++--
lib/crypto/configure.in | 10 ++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
--- a/lib/crypto/c_src/Makefile.in
+++ b/lib/crypto/c_src/Makefile.in
@@ -119,11 +119,17 @@ CRYPTO_STATIC_OBJS = $(patsubst $(OBJDIR
NIF_ARCHIVE = $(LIBDIR)/crypto$(TYPEMARKER).a
-TEST_ENGINE_OBJS = $(OBJDIR)/otp_test_engine$(TYPEMARKER).o
-
NIF_LIB = $(LIBDIR)/crypto$(TYPEMARKER).@DED_EXT@
CALLBACK_LIB = $(LIBDIR)/crypto_callback$(TYPEMARKER).@DED_EXT@
+
+DISABLE_OTP_TEST_ENGINE = @DISABLE_OTP_TEST_ENGINE@
+ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
+TEST_ENGINE_LIB =
+TEST_ENGINE_OBJS =
+else
TEST_ENGINE_LIB = $(LIBDIR)/otp_test_engine$(TYPEMARKER).@DED_EXT@
+TEST_ENGINE_OBJS = $(OBJDIR)/otp_test_engine$(TYPEMARKER).o
+endif
DYNAMIC_CRYPTO_LIB=@SSL_DYNAMIC_ONLY@
# Wierd that we compile as if dynamically linking when statically
@@ -182,6 +188,8 @@ debug opt valgrind asan: $(NIF_LIB) $(CA
static_lib: $(NIF_ARCHIVE)
+ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
+else
$(OBJDIR)/otp_test_engine$(TYPEMARKER).o: otp_test_engine.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
$(V_CC) -c -o $@ $(filter-out -Wmissing-prototypes,$(ALL_CFLAGS)) $<
@@ -193,6 +201,7 @@ $(LIBDIR)/otp_test_engine$(TYPEMARKER).s
$(LIBDIR)/otp_test_engine$(TYPEMARKER).dll: $(TEST_ENGINE_OBJS)
$(V_at)$(INSTALL_DIR) $(LIBDIR)
$(V_LD) $(LDFLAGS) -o $@ $(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) $(TEST_ENGINE_OBJS) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME) $(SSL_EXTRA_LIBS)
+endif
$(OBJDIR)/%$(TYPEMARKER).o: %.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
@@ -255,7 +264,10 @@ release_spec: opt
ifeq ($(DYNAMIC_OR_WIN_CRYPTO_LIB),yes)
$(INSTALL_PROGRAM) $(CALLBACK_LIB) "$(RELSYSDIR)/priv/lib"
endif
+ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
+else
$(INSTALL_PROGRAM) $(TEST_ENGINE_LIB) "$(RELSYSDIR)/priv/lib"
+endif
release_docs_spec:
--- a/lib/crypto/configure.in
+++ b/lib/crypto/configure.in
@@ -156,6 +156,15 @@ AS_HELP_STRING([--disable-evp-hmac],
*) DISABLE_EVP_HMAC=0;;
esac ], DISABLE_EVP_HMAC=0)
+
+AC_ARG_ENABLE(otp-test-engine,
+AS_HELP_STRING([--disable-otp-test-engine],
+ [intentionally undocumented workaround]),
+[ case "$enableval" in
+ no) DISABLE_OTP_TEST_ENGINE=yes;;
+ *) DISABLE_OTP_TEST_ENGINE=no;;
+ esac ], DISABLE_OTP_TEST_ENGINE=no)
+
AC_ARG_ENABLE(deprecated_warnings,
AS_HELP_STRING([--disable-deprecated-warnings],
[disable warnings for deprecated functions in cryptolib (default is to warn, except for OpenSSL 3.x where the default is not to warn)]),
@@ -826,6 +835,7 @@ AC_SUBST(SSL_DED_LD_RUNTIME_LIBRARY_PATH
AC_SUBST(SSL_DYNAMIC_ONLY)
AC_SUBST(DISABLE_EVP_DH)
AC_SUBST(DISABLE_EVP_HMAC)
+AC_SUBST(DISABLE_OTP_TEST_ENGINE)
AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in)

View File

@ -1,63 +0,0 @@
From 4d48c33d413957dc95fc8b921f9708eb0705c796 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Wed, 16 Feb 2022 09:28:38 +0100
Subject: [PATCH] Update configure scripts
---
lib/crypto/configure | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/lib/crypto/configure
+++ b/lib/crypto/configure
@@ -621,6 +621,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
+DISABLE_OTP_TEST_ENGINE
DISABLE_EVP_HMAC
DISABLE_EVP_DH
SSL_DYNAMIC_ONLY
@@ -747,6 +748,7 @@ with_ssl_rpath
enable_dynamic_ssl_lib
enable_evp_dh
enable_evp_hmac
+enable_otp_test_engine
enable_deprecated_warnings
enable_fips
'
@@ -1420,6 +1422,8 @@ Optional Features:
the crypto NIF
--disable-evp-dh intentionally undocumented workaround
--disable-evp-hmac intentionally undocumented workaround
+ --disable-otp-test-engine
+ intentionally undocumented workaround
--disable-deprecated-warnings
disable warnings for deprecated functions in
cryptolib (default is to warn, except for OpenSSL
@@ -5096,6 +5100,18 @@ else
fi
+
+# Check whether --enable-otp-test-engine was given.
+if test "${enable_otp_test_engine+set}" = set; then :
+ enableval=$enable_otp_test_engine; case "$enableval" in
+ no) DISABLE_OTP_TEST_ENGINE=yes;;
+ *) DISABLE_OTP_TEST_ENGINE=no;;
+ esac
+else
+ DISABLE_OTP_TEST_ENGINE=no
+fi
+
+
# Check whether --enable-deprecated_warnings was given.
if test "${enable_deprecated_warnings+set}" = set; then :
enableval=$enable_deprecated_warnings; case "$enableval" in
@@ -6319,6 +6335,7 @@ fi
+

View File

@ -1,45 +0,0 @@
From 4e3d154c0f1bd975016eaa2d842affd230b736cc Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Mon, 21 Feb 2022 14:58:08 +0100
Subject: [PATCH] crypto: do --disable-otp-test-engine for LibreSSL >= 3.5.0
---
lib/crypto/configure.in | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
--- a/lib/crypto/configure.in
+++ b/lib/crypto/configure.in
@@ -159,11 +159,11 @@ AS_HELP_STRING([--disable-evp-hmac],
AC_ARG_ENABLE(otp-test-engine,
AS_HELP_STRING([--disable-otp-test-engine],
- [intentionally undocumented workaround]),
+ [Disable build of the otp_test_engine. (default is --enable-otp-test-engine, unless for LibreSSL >= 3.5.0 where default is --disable-otp-test-engine)]),
[ case "$enableval" in
no) DISABLE_OTP_TEST_ENGINE=yes;;
*) DISABLE_OTP_TEST_ENGINE=no;;
- esac ], DISABLE_OTP_TEST_ENGINE=no)
+ esac ], DISABLE_OTP_TEST_ENGINE=default)
AC_ARG_ENABLE(deprecated_warnings,
AS_HELP_STRING([--disable-deprecated-warnings],
@@ -245,6 +245,19 @@ yes
],
[v3_include=yes],
[v3_include=no])
+
+if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
+# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
+ AC_EGREP_CPP(^yes.?$,[
+#include <openssl/opensslv.h>
+#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
+yes
+#endif
+ ],
+ [DISABLE_OTP_TEST_ENGINE=yes],
+ [DISABLE_OTP_TEST_ENGINE=no])
+ fi
+
CPPFLAGS="$save_CPPFLAGS"
if test $valid_include != yes; then

View File

@ -1,89 +0,0 @@
From 2f27f4bf85971dc8d8e0c2dcef133729835458c5 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Mon, 21 Feb 2022 14:58:35 +0100
Subject: [PATCH] Update configure scripts
---
lib/crypto/configure | 50 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 48 insertions(+), 2 deletions(-)
--- a/lib/crypto/configure
+++ b/lib/crypto/configure
@@ -1423,7 +1423,9 @@ Optional Features:
--disable-evp-dh intentionally undocumented workaround
--disable-evp-hmac intentionally undocumented workaround
--disable-otp-test-engine
- intentionally undocumented workaround
+ Disable build of the otp_test_engine. (default is
+ --enable-otp-test-engine, unless for LibreSSL >=
+ 3.5.0 where default is --disable-otp-test-engine)
--disable-deprecated-warnings
disable warnings for deprecated functions in
cryptolib (default is to warn, except for OpenSSL
@@ -5108,7 +5110,7 @@ if test "${enable_otp_test_engine+set}"
*) DISABLE_OTP_TEST_ENGINE=no;;
esac
else
- DISABLE_OTP_TEST_ENGINE=no
+ DISABLE_OTP_TEST_ENGINE=default
fi
@@ -5300,6 +5302,28 @@ else
fi
rm -f conftest*
+
+if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
+# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <openssl/opensslv.h>
+#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "^yes.?$" >/dev/null 2>&1; then :
+ DISABLE_OTP_TEST_ENGINE=yes
+else
+ DISABLE_OTP_TEST_ENGINE=no
+fi
+rm -f conftest*
+
+ fi
+
CPPFLAGS="$save_CPPFLAGS"
if test $valid_include != yes; then
@@ -5705,6 +5729,28 @@ else
fi
rm -f conftest*
+
+if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
+# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <openssl/opensslv.h>
+#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "^yes.?$" >/dev/null 2>&1; then :
+ DISABLE_OTP_TEST_ENGINE=yes
+else
+ DISABLE_OTP_TEST_ENGINE=no
+fi
+rm -f conftest*
+
+ fi
+
CPPFLAGS="$save_CPPFLAGS"
if test $valid_include != yes; then