ima-evm-utils: link to libcrypto instead of OpenSSL
PATCH 1/4 ima-evm-utils: link to libcrypto instead of OpenSSL
There is no need to link to full libssl. evmctl uses functions from libcrypto, so let's link only against that library.
--- configure.ac | 4 +--- src/Makefile.am | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-)
configure.ac +1 -3
@@ -24,9 +24,7 @@ LT_INIT # Checks for header files. AC_HEADER_STDC -PKG_CHECK_MODULES(OPENSSL, [ openssl >= 0.9.8 ]) -AC_SUBST(OPENSSL_CFLAGS) -AC_SUBST(OPENSSL_LIBS) +PKG_CHECK_MODULES(LIBCRYPTO, [libcrypto >= 0.9.8 ]) AC_SUBST(KERNEL_HEADERS) AC_CHECK_HEADER(unistd.h) AC_CHECK_HEADERS(openssl/conf.h)
src/Makefile.am +4 -5
@@ -1,11 +1,11 @@ lib_LTLIBRARIES = libimaevm.la libimaevm_la_SOURCES = libimaevm.c -libimaevm_la_CPPFLAGS = $(OPENSSL_CFLAGS) +libimaevm_la_CPPFLAGS = $(LIBCRYPTO_CFLAGS) # current[:revision[:age]] # result: [current-age].age.revision libimaevm_la_LDFLAGS = -version-info 0:0:0 -libimaevm_la_LIBADD = $(OPENSSL_LIBS) +libimaevm_la_LIBADD = $(LIBCRYPTO_LIBS) include_HEADERS = imaevm.h
@@ -17,12 +17,11 @@ hash_info.h: Makefile bin_PROGRAMS = evmctl evmctl_SOURCES = evmctl.c -evmctl_CPPFLAGS = $(OPENSSL_CFLAGS) +evmctl_CPPFLAGS = $(LIBCRYPTO_CFLAGS) evmctl_LDFLAGS = $(LDFLAGS_READLINE) -evmctl_LDADD = $(OPENSSL_LIBS) -lkeyutils libimaevm.la +evmctl_LDADD = $(LIBCRYPTO_LIBS) -lkeyutils libimaevm.la INCLUDES = -I$(top_srcdir) -include config.h CLEANFILES = hash_info.h DISTCLEANFILES = @DISTCLEANFILES@ -
Signature · 1 line
2.20.1
PATCH 2/4 ima-evm-utils: replace INCLUDES with AM_CPPFLAGS
Replace INCLUDES variable with AM_CPPFLAGS to stop Automake from warning about deprecated variable usage.
--- src/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
src/Makefile.am +3 -3
@@ -1,7 +1,7 @@ lib_LTLIBRARIES = libimaevm.la libimaevm_la_SOURCES = libimaevm.c -libimaevm_la_CPPFLAGS = $(LIBCRYPTO_CFLAGS) +libimaevm_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBCRYPTO_CFLAGS) # current[:revision[:age]] # result: [current-age].age.revision libimaevm_la_LDFLAGS = -version-info 0:0:0
@@ -17,11 +17,11 @@ hash_info.h: Makefile bin_PROGRAMS = evmctl evmctl_SOURCES = evmctl.c -evmctl_CPPFLAGS = $(LIBCRYPTO_CFLAGS) +evmctl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBCRYPTO_CFLAGS) evmctl_LDFLAGS = $(LDFLAGS_READLINE) evmctl_LDADD = $(LIBCRYPTO_LIBS) -lkeyutils libimaevm.la -INCLUDES = -I$(top_srcdir) -include config.h +AM_CPPFLAGS = -I$(top_srcdir) -include config.h CLEANFILES = hash_info.h DISTCLEANFILES = @DISTCLEANFILES@
Signature · 1 line
2.20.1
PATCH 3/4 ima-evm-utils: include hash-info.gen into distribution
In reply to Dmitry Eremin-SolenikovInclude hash-info.gen into tarball and call it from the sourcedir to fix out-of-tree build (and thus 'make distcheck').
--- src/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/Makefile.am +2 -1
@@ -11,8 +11,9 @@ include_HEADERS = imaevm.h nodist_libimaevm_la_SOURCES = hash_info.h BUILT_SOURCES = hash_info.h +EXTRA_DIST = hash_info.gen hash_info.h: Makefile - ./hash_info.gen $(KERNEL_HEADERS) >$@ + $(srcdir)/hash_info.gen $(KERNEL_HEADERS) >$@ bin_PROGRAMS = evmctl
Signature · 1 line
2.20.1
PATCH 4/4 ima-evm-utils: update .gitignore files
In reply to Dmitry Eremin-Solenikov--- .gitignore | 1 + src/.gitignore | 1 + 2 files changed, 2 insertions(+) create mode 100644 src/.gitignore
.gitignore +1 -0
@@ -45,6 +45,7 @@ cscope.* ncscope.* # Generated documentation +*.1 *.8 *.5 manpage.links
src/.gitignore new file +1 -0
@@ -0,0 +1 @@ +hash_info.h
Signature · 1 line
2.20.1
Mimi Zohar
maintainerQuoted 4 lines · Dmitry Eremin-Solenikov
There is no need to link to full libssl. evmctl uses functions from libcrypto, so let's link only against that library.
Signed-off-by Dmitry Eremin-Solenikov <[email protected]>
Thank you for this patch and the other three. They're all now in the next branch.
Mimi
чт, 23 мая 2019 г. в 18:13, Mimi Zohar <[email protected]>:
Quoted 9 lines · Dmitry Eremin-Solenikov
Quoted 4 lines
There is no need to link to full libssl. evmctl uses functions from libcrypto, so let's link only against that library.
Signed-off-by Dmitry Eremin-Solenikov <[email protected]>Thank you for this patch and the other three. They're all now in the next branch.
Thank you!
Signature · 2 lines
With best wishes Dmitry
Dmitry,
Quoted 2 lines · Dmitry Eremin-Solenikov
There is no need to link to full libssl. evmctl uses functions from libcrypto, so let's link only against that library.
Btw, this breaks my tests in my set up with gost-engine, making evmctl crash on OPENSSL_init_crypto (in bind_gost). Did not investigate real cause yet. I test with latest version of gost-engine (e372739) and openssl 0fc4d00a00.
Quoted 57 lines
Signed-off-by Dmitry Eremin-Solenikov <[email protected]>--- configure.ac | 4 +--- src/Makefile.am | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-)configure.ac +1
-3@@ -24,9 +24,7 @@ LT_INIT # Checks for header files. AC_HEADER_STDC -PKG_CHECK_MODULES(OPENSSL, [ openssl >= 0.9.8 ]) -AC_SUBST(OPENSSL_CFLAGS) -AC_SUBST(OPENSSL_LIBS) +PKG_CHECK_MODULES(LIBCRYPTO, [libcrypto >= 0.9.8 ]) AC_SUBST(KERNEL_HEADERS) AC_CHECK_HEADER(unistd.h) AC_CHECK_HEADERS(openssl/conf.h)src/Makefile.am +4
-5@@ -1,11 +1,11 @@ lib_LTLIBRARIES = libimaevm.la libimaevm_la_SOURCES = libimaevm.c -libimaevm_la_CPPFLAGS = $(OPENSSL_CFLAGS) +libimaevm_la_CPPFLAGS = $(LIBCRYPTO_CFLAGS) # current[:revision[:age]] # result: [current-age].age.revision libimaevm_la_LDFLAGS = -version-info 0:0:0 -libimaevm_la_LIBADD = $(OPENSSL_LIBS) +libimaevm_la_LIBADD = $(LIBCRYPTO_LIBS) include_HEADERS = imaevm.h@@ -17,12 +17,11 @@ hash_info.h: Makefile bin_PROGRAMS = evmctl evmctl_SOURCES = evmctl.c -evmctl_CPPFLAGS = $(OPENSSL_CFLAGS) +evmctl_CPPFLAGS = $(LIBCRYPTO_CFLAGS) evmctl_LDFLAGS = $(LDFLAGS_READLINE) -evmctl_LDADD = $(OPENSSL_LIBS) -lkeyutils libimaevm.la +evmctl_LDADD = $(LIBCRYPTO_LIBS) -lkeyutils libimaevm.la INCLUDES = -I$(top_srcdir) -include config.h CLEANFILES = hash_info.h DISTCLEANFILES = @DISTCLEANFILES@ -Signature · 1 line
2.20.1
Dmitry,
Quoted 8 lines · Vitaly Chikunov
Quoted 2 lines · Dmitry Eremin-Solenikov
There is no need to link to full libssl. evmctl uses functions from libcrypto, so let's link only against that library.
Btw, this breaks my tests in my set up with gost-engine, making evmctl crash on
OPENSSL_init_crypto(inbind_gost). Did not investigate real cause yet. I test with latest version of gost-engine (e372739) and openssl0fc4d00a00.
Sorry, this was my set up failure. Previously I was defining OPENSSL_LIBS="-L$HOME/src/openssl -lssl -lcrypto" to link with custom OpenSSL build. Now I should just define LIBCRYPTO_LIBS="-L$HOME/src/openssl -lcrypto" instead.
So there is no error in these commits.
Thanks,