Skip to content

Commit

Permalink
Merge branch 'paulswartz/openssl-md5/erlangGH-7987/OTP-18931' into maint
Browse files Browse the repository at this point in the history
* paulswartz/openssl-md5/erlangGH-7987/OTP-18931:
  ci: don't use cache if an `.h` file is deleted
  fix: `ifdef` for preprocessor variables
  fix: rename `openssl/md5.h` to avoid include conflicts with OpenSSL
  • Loading branch information
garazdawi committed Jan 15, 2024
2 parents 9f3dfc5 + d27de65 commit a66154d
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
filters: |
no-cache:
- '.github/**'
- deleted: '**/*.h'
deleted:
- deleted: '**'
bootstrap:
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/openssl/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The files that has been taken from the 3.1.4 version of OpenSSL:
./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.
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/openssl/crypto/md5/md5_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/openssl/include/erl_md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
4 changes: 2 additions & 2 deletions erts/emulator/openssl/openssl.diff
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ diff -u original/crypto/md5/md5_local.h 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
Expand Down Expand Up @@ -116,7 +116,7 @@ diff -u original/include/crypto/md32_common.h include/crypto/md32_common.h
# 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
Expand Down
2 changes: 1 addition & 1 deletion erts/emulator/openssl/openssl.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ $(OPENSSL_OBJDIR)/%.o: $(OPENSSL_DIR)/crypto/md5/%.c
$(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
2 changes: 1 addition & 1 deletion erts/lib_src/common/erl_misc_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion lib/erl_interface/src/openssl/README
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The files that has been taken from the 3.1.4 version of OpenSSL:
./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.
Expand Down
2 changes: 1 addition & 1 deletion lib/erl_interface/src/openssl/crypto/md5/md5_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/erl_interface/src/openssl/include/erl_md5.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/erl_interface/src/openssl/openssl.diff
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ diff -u original/crypto/md5/md5_local.h 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
Expand Down Expand Up @@ -116,7 +116,7 @@ diff -u original/include/crypto/md32_common.h include/crypto/md32_common.h
# 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
Expand Down

0 comments on commit a66154d

Please sign in to comment.