- Timestamp:
- Sep 16, 2018 6:35:40 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/ssl-openssl.cpp
r74296 r74299 29 29 * Header Files * 30 30 *********************************************************************************************************************************/ 31 #include "internal/iprt.h" 32 #include <iprt/crypto/ssl.h> 33 34 #include <iprt/asm.h> 35 #include <iprt/assert.h> 36 #include <iprt/file.h> 37 #include <iprt/mem.h> 38 #include <iprt/string.h> 39 40 #include "internal/magics.h" 41 42 #include "internal/iprt-openssl.h" 43 #include <openssl/ssl.h> 31 # include "internal/iprt.h" 32 # include <iprt/crypto/ssl.h> 33 34 # include <iprt/asm.h> 35 # include <iprt/assert.h> 36 # include <iprt/file.h> 37 # include <iprt/mem.h> 38 # include <iprt/string.h> 39 40 # include "internal/magics.h" 41 42 # include "internal/iprt-openssl.h" 43 # include <openssl/ssl.h> 44 # include <openssl/tls1.h> 44 45 45 46 … … 86 87 AssertReturn(!fFlags, VERR_INVALID_FLAGS); 87 88 88 const SSL_METHOD *pSslMethod = TLS_server_method(); 89 /* 90 * We aim at TLSv1 or higher here by default. 91 */ 92 # if OPENSSL_VERSION_NUMBER >= 0x10100000 93 const SSL_METHOD *pSslMethod = TLS_method(); 94 # elif OPENSSL_VERSION_NUMBER >= 0x10002000 95 const SSL_METHOD *pSslMethod = SSLv23_method(); 96 # else 97 SSL_METHOD *pSslMethod = TLSv1_method(); 98 # endif 89 99 if (pSslMethod) 90 100 { … … 95 105 if (pThis->pCtx) 96 106 { 107 /* Help with above aim. */ 108 # if OPENSSL_VERSION_NUMBER >= 0x10100000 109 if (SSL_CTX_get_min_proto_version(pThis->pCtx) < TLS1_VERSION) 110 SSL_CTX_set_min_proto_version(pThis->pCtx, TLS1_VERSION); 111 # elif OPENSSL_VERSION_NUMBER >= 0x10002000 112 SSL_CTX_set_options(pThis->pCtx, SSL_OP_NO_SSLv2); 113 SSL_CTX_set_options(pThis->pCtx, SSL_OP_NO_SSLv3); 114 # endif 115 116 /* 117 * Complete the instance and return it. 118 */ 97 119 pThis->u32Magic = RTCRSSLINT_MAGIC; 98 120 pThis->cRefs = 1; … … 241 263 if (pSession->pBio) 242 264 { 265 # if OPENSSL_VERSION_NUMBER >= 0x10100000 243 266 BIO_up_ref(pSession->pBio); /* our reference. */ 267 # endif 244 268 SSL_set_bio(pSession->pSsl, pSession->pBio, pSession->pBio); 245 269 … … 287 311 SSL_free(pThis->pSsl); 288 312 pThis->pSsl = NULL; 313 # if OPENSSL_VERSION_NUMBER >= 0x10100000 289 314 BIO_free(pThis->pBio); 315 # endif 290 316 pThis->pBio = NULL; 291 317 RTMemFree(pThis);
Note:
See TracChangeset
for help on using the changeset viewer.