1 |
|
|
// Copyright Joyent, Inc. and other Node contributors. |
2 |
|
|
// |
3 |
|
|
// Permission is hereby granted, free of charge, to any person obtaining a |
4 |
|
|
// copy of this software and associated documentation files (the |
5 |
|
|
// "Software"), to deal in the Software without restriction, including |
6 |
|
|
// without limitation the rights to use, copy, modify, merge, publish, |
7 |
|
|
// distribute, sublicense, and/or sell copies of the Software, and to permit |
8 |
|
|
// persons to whom the Software is furnished to do so, subject to the |
9 |
|
|
// following conditions: |
10 |
|
|
// |
11 |
|
|
// The above copyright notice and this permission notice shall be included |
12 |
|
|
// in all copies or substantial portions of the Software. |
13 |
|
|
// |
14 |
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
15 |
|
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
16 |
|
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN |
17 |
|
|
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
18 |
|
|
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
19 |
|
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE |
20 |
|
|
// USE OR OTHER DEALINGS IN THE SOFTWARE. |
21 |
|
|
|
22 |
|
|
#include "node_crypto.h" |
23 |
|
|
#include "async_wrap-inl.h" |
24 |
|
|
#include "debug_utils-inl.h" |
25 |
|
|
#include "threadpoolwork-inl.h" |
26 |
|
|
#include "memory_tracker-inl.h" |
27 |
|
|
#include "v8.h" |
28 |
|
|
|
29 |
|
|
namespace node { |
30 |
|
|
|
31 |
|
|
using v8::Context; |
32 |
|
|
using v8::Local; |
33 |
|
|
using v8::Object; |
34 |
|
|
using v8::Value; |
35 |
|
|
|
36 |
|
|
namespace crypto { |
37 |
|
|
|
38 |
|
654 |
void Initialize(Local<Object> target, |
39 |
|
|
Local<Value> unused, |
40 |
|
|
Local<Context> context, |
41 |
|
|
void* priv) { |
42 |
|
|
static uv_once_t init_once = UV_ONCE_INIT; |
43 |
|
654 |
uv_once(&init_once, InitCryptoOnce); |
44 |
|
|
|
45 |
|
654 |
Environment* env = Environment::GetCurrent(context); |
46 |
|
|
|
47 |
|
654 |
AES::Initialize(env, target); |
48 |
|
654 |
CipherBase::Initialize(env, target); |
49 |
|
654 |
DiffieHellman::Initialize(env, target); |
50 |
|
654 |
DSAAlg::Initialize(env, target); |
51 |
|
654 |
ECDH::Initialize(env, target); |
52 |
|
654 |
Hash::Initialize(env, target); |
53 |
|
654 |
HKDFJob::Initialize(env, target); |
54 |
|
654 |
Hmac::Initialize(env, target); |
55 |
|
654 |
Keygen::Initialize(env, target); |
56 |
|
654 |
Keys::Initialize(env, target); |
57 |
|
654 |
NativeKeyObject::Initialize(env, target); |
58 |
|
654 |
PBKDF2Job::Initialize(env, target); |
59 |
|
654 |
Random::Initialize(env, target); |
60 |
|
654 |
RSAAlg::Initialize(env, target); |
61 |
|
654 |
SecureContext::Initialize(env, target); |
62 |
|
654 |
Sign::Initialize(env, target); |
63 |
|
654 |
SPKAC::Initialize(env, target); |
64 |
|
654 |
Timing::Initialize(env, target); |
65 |
|
654 |
Util::Initialize(env, target); |
66 |
|
654 |
Verify::Initialize(env, target); |
67 |
|
|
|
68 |
|
|
#ifndef OPENSSL_NO_SCRYPT |
69 |
|
654 |
ScryptJob::Initialize(env, target); |
70 |
|
|
#endif |
71 |
|
654 |
} |
72 |
|
|
|
73 |
|
|
} // namespace crypto |
74 |
|
|
} // namespace node |
75 |
|
|
|
76 |
✓✗✓✗
|
18704 |
NODE_MODULE_CONTEXT_AWARE_INTERNAL(crypto, node::crypto::Initialize) |