File tree 2 files changed +18
-2
lines changed
2 files changed +18
-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
+ #if !defined(ELECTRON_ENSURE_CONFIG_GYPI) && !defined(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 // ELECTRON_ENSURE_CONFIG_GYPI
450
+ namespace node_mongocrypt {
451
+ namespace opensslcrypto {
452
+ std::unique_ptr<CryptoHooks> createOpenSSLCryptoHooks () {
453
+ return {};
454
+ }
455
+ }
456
+ }
457
+ #endif // ELECTRON_ENSURE_CONFIG_GYPI
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'
11
12
},
12
13
'sources' : [
13
14
'addon/mongocrypt.cc' ,
25
26
'VCCLCompilerTool' : { 'ExceptionHandling' : 1 },
26
27
},
27
28
'conditions' : [
29
+ ['mongocrypt_avoid_openssl_crypto=="true"' , { 'defines' : ['MONGOCRYPT_AVOID_OPENSSL_CRYPTO' ] }],
28
30
['OS=="mac"' , { 'cflags+' : ['-fvisibility=hidden' ] }],
29
31
['_type!="static_library" and ARCH=="arm64"' , {
30
32
'xcode_settings' : {
You can’t perform that action at this time.
0 commit comments