summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-04-06 15:21:58 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-04-06 15:21:59 -0700
commit95acb13a550cbc07a5ef38ffceb5678fac61acff (patch)
treebc1f9fe126f2430b2f6b5374bda606db64e9553c
parentMerge branch 'ns/core-fsyncmethod' (diff)
parentgit-compat-util: really support openssl as a source of entropy (diff)
downloadtgif-95acb13a550cbc07a5ef38ffceb5678fac61acff.tar.xz
Merge branch 'bc/csprng-mktemps'
Build fix. * bc/csprng-mktemps: git-compat-util: really support openssl as a source of entropy
-rw-r--r--Makefile1
-rw-r--r--git-compat-util.h4
-rw-r--r--imap-send.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9173848562..f8bccfab5e 100644
--- a/Makefile
+++ b/Makefile
@@ -1972,6 +1972,7 @@ endif
ifneq ($(findstring openssl,$(CSPRNG_METHOD)),)
BASIC_CFLAGS += -DHAVE_OPENSSL_CSPRNG
+ EXTLIBS += -lcrypto -lssl
endif
ifneq ($(PROCFS_EXECUTABLE_PATH),)
diff --git a/git-compat-util.h b/git-compat-util.h
index 4d444dca27..68a9b9cd97 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -525,6 +525,10 @@ void warning_errno(const char *err, ...) __attribute__((format (printf, 1, 2)));
#include <openssl/x509v3.h>
#endif /* NO_OPENSSL */
+#ifdef HAVE_OPENSSL_CSPRNG
+#include <openssl/rand.h>
+#endif
+
/*
* Let callers be aware of the constant return value; this can help
* gcc with -Wuninitialized analysis. We restrict this trick to gcc, though,
diff --git a/imap-send.c b/imap-send.c
index 5ac6fa9c66..a50af56b82 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -27,7 +27,7 @@
#include "exec-cmd.h"
#include "run-command.h"
#include "parse-options.h"
-#ifdef NO_OPENSSL
+#if defined(NO_OPENSSL) && !defined(HAVE_OPENSSL_CSPRNG)
typedef void *SSL;
#endif
#ifdef USE_CURL_FOR_IMAP_SEND