Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 673988 | Differences between
and this patch

Collapse All | Expand All

(-)a/ChangeLog.md (+2 lines)
Lines 52-57 a subsequent segfault when VTK tried to call `glBlendFuncSeparate()`. Link Here
52
VirtualGL's implementation of `glXGetVisualFromFBConfig()` now returns NULL
52
VirtualGL's implementation of `glXGetVisualFromFBConfig()` now returns NULL
53
unless the FB config has a corresponding visual on the 3D X server.
53
unless the FB config has a corresponding visual on the 3D X server.
54
54
55
6. VirtualGL can now be built and run with OpenSSL 1.1.
56
55
57
56
2.5.2
58
2.5.2
57
=====
59
=====
(-)a/include/Socket.h (-2 / +6 lines)
Lines 1-6 Link Here
1
/* Copyright (C)2004 Landmark Graphics Corporation
1
/* Copyright (C)2004 Landmark Graphics Corporation
2
 * Copyright (C)2005 Sun Microsystems, Inc.
2
 * Copyright (C)2005 Sun Microsystems, Inc.
3
 * Copyright (C)2014, 2016 D. R. Commander
3
 * Copyright (C)2014, 2016, 2018 D. R. Commander
4
 *
4
 *
5
 * This library is free software and may be redistributed and/or modified under
5
 * This library is free software and may be redistributed and/or modified under
6
 * the terms of the wxWindows Library License, Version 3.1 or (at your option)
6
 * the terms of the wxWindows Library License, Version 3.1 or (at your option)
Lines 23-29 Link Here
23
#endif
23
#endif
24
#include <openssl/ssl.h>
24
#include <openssl/ssl.h>
25
#include <openssl/err.h>
25
#include <openssl/err.h>
26
#if defined(sun) || defined(sgi)
26
#if !defined(HAVE_DEVURANDOM) && !defined(_WIN32)
27
#include <openssl/rand.h>
27
#include <openssl/rand.h>
28
#endif
28
#endif
29
#endif
29
#endif
Lines 161-175 namespace vglutil Link Here
161
161
162
			#ifdef USESSL
162
			#ifdef USESSL
163
163
164
			#if OPENSSL_VERSION_NUMBER < 0x10100000L
164
			static void lockingCallback(int mode, int type, const char *file,
165
			static void lockingCallback(int mode, int type, const char *file,
165
				int line)
166
				int line)
166
			{
167
			{
167
				if(mode&CRYPTO_LOCK) cryptoLock[type].lock();
168
				if(mode&CRYPTO_LOCK) cryptoLock[type].lock();
168
				else cryptoLock[type].unlock();
169
				else cryptoLock[type].unlock();
169
			}
170
			}
171
			#endif
170
172
171
			static bool sslInit;
173
			static bool sslInit;
174
			#if OPENSSL_VERSION_NUMBER < 0x10100000L
172
			static CriticalSection cryptoLock[CRYPTO_NUM_LOCKS];
175
			static CriticalSection cryptoLock[CRYPTO_NUM_LOCKS];
176
			#endif
173
			bool doSSL;  SSL_CTX *sslctx;  SSL *ssl;
177
			bool doSSL;  SSL_CTX *sslctx;  SSL *ssl;
174
178
175
			#endif
179
			#endif
(-)a/util/CMakeLists.txt (+5 lines)
Lines 13-18 target_link_libraries(bmptest vglutil) Link Here
13
add_executable(pftest pftest.c)
13
add_executable(pftest pftest.c)
14
target_link_libraries(pftest vglutil)
14
target_link_libraries(pftest vglutil)
15
15
16
if(EXISTS /dev/urandom)
17
	message(STATUS "Using /dev/urandom for random number generation")
18
	add_definitions(-DHAVE_DEVURANDOM)
19
endif()
20
16
add_library(vglsocket STATIC Socket.cpp)
21
add_library(vglsocket STATIC Socket.cpp)
17
target_link_libraries(vglsocket vglutil)
22
target_link_libraries(vglsocket vglutil)
18
if(WIN32)
23
if(WIN32)
(-)a/util/Socket.cpp (-9 / +16 lines)
Lines 1-6 Link Here
1
/* Copyright (C)2004 Landmark Graphics Corporation
1
/* Copyright (C)2004 Landmark Graphics Corporation
2
 * Copyright (C)2005 Sun Microsystems, Inc.
2
 * Copyright (C)2005 Sun Microsystems, Inc.
3
 * Copyright (C)2014, 2016 D. R. Commander
3
 * Copyright (C)2014, 2016, 2018 D. R. Commander
4
 *
4
 *
5
 * This library is free software and may be redistributed and/or modified under
5
 * This library is free software and may be redistributed and/or modified under
6
 * the terms of the wxWindows Library License, Version 3.1 or (at your option)
6
 * the terms of the wxWindows Library License, Version 3.1 or (at your option)
Lines 43-74 typedef socklen_t SOCKLEN_T; Link Here
43
43
44
#ifdef USESSL
44
#ifdef USESSL
45
bool Socket::sslInit=false;
45
bool Socket::sslInit=false;
46
#if OPENSSL_VERSION_NUMBER < 0x10100000L
46
CriticalSection Socket::cryptoLock[CRYPTO_NUM_LOCKS];
47
CriticalSection Socket::cryptoLock[CRYPTO_NUM_LOCKS];
47
#endif
48
#endif
49
#endif
48
CriticalSection Socket::mutex;
50
CriticalSection Socket::mutex;
49
int Socket::instanceCount=0;
51
int Socket::instanceCount=0;
50
52
51
53
52
#ifdef USESSL
54
#ifdef USESSL
53
55
54
static void progressCallback(int p, int n, void *arg)
55
{
56
}
57
58
59
static EVP_PKEY *newPrivateKey(int bits)
56
static EVP_PKEY *newPrivateKey(int bits)
60
{
57
{
58
	BIGNUM *bn = NULL;
59
	RSA *rsa = NULL;
61
	EVP_PKEY *pk=NULL;
60
	EVP_PKEY *pk=NULL;
62
61
63
	try
62
	try
64
	{
63
	{
64
		if(!(bn = BN_new())) _throwssl();
65
		if(!BN_set_word(bn, RSA_F4)) _throwssl();
66
		if(!(rsa = RSA_new())) _throwssl();
67
		if(!RSA_generate_key_ex(rsa, bits, bn, NULL)) _throwssl();
65
		if(!(pk=EVP_PKEY_new())) _throwssl();
68
		if(!(pk=EVP_PKEY_new())) _throwssl();
66
		if(!EVP_PKEY_assign_RSA(pk, RSA_generate_key(bits, 0x10001,
69
		if(!EVP_PKEY_assign_RSA(pk, rsa)) _throwssl();
67
			progressCallback, NULL))) _throwssl();
70
		BN_free(bn);
68
		return pk;
71
		return pk;
69
	}
72
	}
70
	catch (...)
73
	catch (...)
71
	{
74
	{
75
		if(bn) BN_free(bn);
76
		if(rsa) RSA_free(rsa);
72
		if(pk) EVP_PKEY_free(pk);
77
		if(pk) EVP_PKEY_free(pk);
73
		throw;
78
		throw;
74
	}
79
	}
Lines 147-153 Socket::Socket(bool doSSL_) Link Here
147
	#ifdef USESSL
152
	#ifdef USESSL
148
	if(!sslInit && doSSL)
153
	if(!sslInit && doSSL)
149
	{
154
	{
150
		#if defined(sun) || defined(sgi)
155
		#if !defined(HAVE_DEVURANDOM) && !defined(_WIN32)
151
		char buf[128];  int i;
156
		char buf[128];  int i;
152
		srandom(getpid());
157
		srandom(getpid());
153
		for(i = 0; i < 128; i++)
158
		for(i = 0; i < 128; i++)
Lines 158-164 Socket::Socket(bool doSSL_) Link Here
158
		SSL_load_error_strings();
163
		SSL_load_error_strings();
159
		ERR_load_crypto_strings();
164
		ERR_load_crypto_strings();
160
		CRYPTO_set_id_callback(Thread::threadID);
165
		CRYPTO_set_id_callback(Thread::threadID);
166
		#if OPENSSL_VERSION_NUMBER < 0x10100000L
161
		CRYPTO_set_locking_callback(lockingCallback);
167
		CRYPTO_set_locking_callback(lockingCallback);
168
		#endif
162
		SSL_library_init();
169
		SSL_library_init();
163
		sslInit = true;
170
		sslInit = true;
164
		char *env = NULL;
171
		char *env = NULL;

Return to bug 673988