]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
Add version check for OpenSSL(1.1.0) required
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Mon, 22 Nov 2021 10:27:08 +0000 (19:27 +0900)
committerDaniel Wagner <dwagner@suse.de>
Fri, 10 Dec 2021 13:55:59 +0000 (14:55 +0100)
HMAC_CTX_new(), HMAC_CTX_free() are new in OpenSSL 1.1.0.

nvme.c: In function ‘gen_dhchap_key’:
nvme.c:6792:24: error: implicit declaration of function ‘HMAC_CTX_new’; did you mean ‘HMAC_CTX_init’? [-Werror=implicit-function-declaration]
 6792 |   HMAC_CTX *hmac_ctx = HMAC_CTX_new();
      |                        ^~~~~~~~~~~~
      |                        HMAC_CTX_init
nvme.c:6792:24: error: initialization of ‘HMAC_CTX *’ {aka ‘struct hmac_ctx_st *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion]
nvme.c:6805:3: error: implicit declaration of function ‘HMAC_CTX_free’; did you mean ‘HMAC_CTX_copy’? [-Werror=implicit-function-declaration]
 6805 |   HMAC_CTX_free(hmac_ctx);
      |   ^~~~~~~~~~~~~
      |   HMAC_CTX_copy
cc1: all warnings being treated as errors
make: *** [Makefile:155: nvme.o] Error 1

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Makefile
meson.build

index 44b2eeadfc6750177affbd8dcec2ce4159e033fc..8feac778aa17dbc77eb848e9563fb25d994acbd1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ HAVE_SYSTEMD = $(shell pkg-config --exists libsystemd  --atleast-version=242; ec
 LIBJSONC_14 = $(shell pkg-config --atleast-version=0.14 json-c; echo $$?)
 LIBJSONC = $(shell pkg-config json-c; echo $$?)
 LIBZ = $(shell $(LD) -o /dev/null -lz >/dev/null 2>&1; echo $$?)
-LIBOPENSSL = $(shell $(LD) -o /dev/null -lssl >/dev/null 2>&1; echo $$?)
+LIBOPENSSL = $(shell pkg-config --atleast-version=1.1.0 openssl; echo $$?)
 NVME = nvme
 INSTALL ?= install
 DESTDIR =
index c81efe017f0ac51fe0246245b053f3a265932a7a..7907206515986d4b3a74ca33ea21a3ca703a602d 100644 (file)
@@ -50,7 +50,7 @@ conf.set('LIBHUGETLBFS', libhugetlbfs.found(), description: 'Is libhugetlbfs req
 libz_dep = dependency('zlib', required: true)
 
 # Check for open-ssl availability
-libopenssl = dependency('openssl', required: false)
+libopenssl = dependency('openssl', version: '>=1.1.0', required: false)
 conf.set('OPENSSL', libopenssl.found(), description: 'Is open-ssl required?')
 
 # Set the nvme-cli version