Skip to content

Commit

Permalink
opusfile: Add cert store patch
Browse files Browse the repository at this point in the history
From one of lazka's comment

xiph/opusfile#13 (comment)
  • Loading branch information
1480c1 committed Jul 19, 2020
1 parent e1e9542 commit de66bd2
Showing 1 changed file with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From 29b6437d9b2675edc77df94baa9004442e22f469 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <[email protected]>
Date: Fri, 28 Sep 2018 00:00:00 +0000
Subject: [PATCH 1/2] Disable cert store integration if OPENSSL_VERSION_NUMBER
< 0x10100000L

---
src/http.c | 2 ++
src/wincerts.c | 3 +++
2 files changed, 5 insertions(+)

diff --git a/src/http.c b/src/http.c
index 19ae4b1..45329e4 100644
--- a/src/http.c
+++ b/src/http.c
@@ -327,10 +327,12 @@ static int op_poll_win32(struct pollfd *_fds,nfds_t _nfds,int _timeout){
typedef ptrdiff_t ssize_t;
# endif

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
/*Load certificates from the built-in certificate store.*/
int SSL_CTX_set_default_verify_paths_win32(SSL_CTX *_ssl_ctx);
# define SSL_CTX_set_default_verify_paths \
SSL_CTX_set_default_verify_paths_win32
+#endif

# else
/*Normal Berkeley sockets.*/
diff --git a/src/wincerts.c b/src/wincerts.c
index 7f915bd..78b9cc8 100644
--- a/src/wincerts.c
+++ b/src/wincerts.c
@@ -33,6 +33,8 @@
# include <openssl/err.h>
# include <openssl/x509.h>

+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+
static int op_capi_new(X509_LOOKUP *_lu){
HCERTSTORE h_store;
h_store=CertOpenStore(CERT_STORE_PROV_SYSTEM_A,0,0,
@@ -171,3 +173,4 @@ int SSL_CTX_set_default_verify_paths_win32(SSL_CTX *_ssl_ctx){
}

#endif
+#endif
--
2.20.1

0 comments on commit de66bd2

Please sign in to comment.