File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 5
5
// This file provides native crypto hooks for OpenSSL 3 (the default since Node.js 18),
6
6
// allowing us to skip expensive round-trips between JS and C++.
7
7
8
+ #include " mongocrypt.h"
9
+
10
+ // Electron does not expose OpenSSL, so we cannot use OpenSSL
11
+ // functions directly if we're building against Electron:
12
+ // https://github.com/electron/electron/issues/13176
13
+ #ifndef MONGOCRYPT_AVOID_OPENSSL_CRYPTO
8
14
#include < openssl/crypto.h>
9
15
#include < openssl/err.h>
10
16
#include < openssl/evp.h>
13
19
14
20
#include < stdexcept>
15
21
16
- #include " mongocrypt.h"
17
-
18
22
#ifdef _WIN32
19
23
#include < windows.h>
20
24
#else
@@ -441,3 +445,13 @@ std::unique_ptr<CryptoHooks> createOpenSSLCryptoHooks() {
441
445
442
446
} // namespace opensslcrypto
443
447
} // namespace node_mongocrypt
448
+
449
+ #else // MONGOCRYPT_AVOID_OPENSSL_CRYPTO
450
+ namespace node_mongocrypt {
451
+ namespace opensslcrypto {
452
+ std::unique_ptr<CryptoHooks> createOpenSSLCryptoHooks () {
453
+ return {};
454
+ }
455
+ }
456
+ }
457
+ #endif // MONGOCRYPT_AVOID_OPENSSL_CRYPTO
Original file line number Diff line number Diff line change 8
8
'variables' : {
9
9
'ARCH' : '<(host_arch)' ,
10
10
'libmongocrypt_link_type%' : 'static' ,
11
+ 'mongocrypt_avoid_openssl_crypto%' : 'false' ,
12
+ 'built_with_electron%' : 0
11
13
},
12
14
'sources' : [
13
15
'addon/mongocrypt.cc' ,
25
27
'VCCLCompilerTool' : { 'ExceptionHandling' : 1 },
26
28
},
27
29
'conditions' : [
30
+ ['mongocrypt_avoid_openssl_crypto=="true" or built_with_electron==1' , { 'defines' : ['MONGOCRYPT_AVOID_OPENSSL_CRYPTO' ] }],
28
31
['OS=="mac"' , { 'cflags+' : ['-fvisibility=hidden' ] }],
29
32
['_type!="static_library" and ARCH=="arm64"' , {
30
33
'xcode_settings' : {
You can’t perform that action at this time.
0 commit comments