[pkg-opensc-commit] [opensc] 254/295: gids-tool loops when using OpenSSL-1.1

Eric Dorland eric at moszumanska.debian.org
Sat Jun 24 21:11:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository opensc.

commit 0ec89941b293327a5cf5a9617b45bbf9da5d3fc5
Author: Doug Engert <deengert at gmail.com>
Date:   Tue May 9 09:45:27 2017 -0500

    gids-tool loops when using OpenSSL-1.1
    
    Add code to support OpenSSL initialization as needed for OpenSSL-1.1
---
 src/tools/gids-tool.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/tools/gids-tool.c b/src/tools/gids-tool.c
index 7dbbdfd..48084d8 100644
--- a/src/tools/gids-tool.c
+++ b/src/tools/gids-tool.c
@@ -33,10 +33,19 @@
 #include <ctype.h>
 #include <sys/stat.h>
 
+#include <openssl/opensslv.h>
+#include "libopensc/sc-ossl-compat.h"
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+#include <openssl/opensslconf.h>
+#include <openssl/crypto.h>
+#endif
+#if OPENSSL_VERSION_NUMBER >= 0x00907000L
+#include <openssl/conf.h>
+#endif
+
 #include <openssl/evp.h>
 #include <openssl/err.h>
 
-#include "libopensc/sc-ossl-compat.h"
 #include "libopensc/opensc.h"
 #include "libopensc/cardctl.h"
 #include "libopensc/card-gids.h"
@@ -517,11 +526,23 @@ int main(int argc, char * const argv[])
 		}
 	}
 
+
+	/* OpenSSL magic */
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L && OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
+	OPENSSL_config(NULL);
+#endif
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
+	OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS
+		| OPENSSL_INIT_ADD_ALL_CIPHERS
+		| OPENSSL_INIT_ADD_ALL_DIGESTS,
+               NULL);
+#else
 	/* OpenSSL magic */
 	OPENSSL_malloc_init();
 
 	ERR_load_crypto_strings();
 	OpenSSL_add_all_algorithms();
+#endif
 
 	memset(&ctx_param, 0, sizeof(sc_context_param_t));
 	ctx_param.app_name = app_name;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/opensc.git



More information about the pkg-opensc-commit mailing list