GCC Code Coverage Report
Directory: ../ Exec Total Coverage
File: /home/iojs/build/workspace/node-test-commit-linux-coverage-daily/nodes/benchmark/out/../src/node_crypto.cc Lines: 27 27 100.0 %
Date: 2021-01-16 04:10:54 Branches: 2 4 50.0 %

Line Branch Exec Source
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
663
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
663
  uv_once(&init_once, InitCryptoOnce);
44
45
663
  Environment* env = Environment::GetCurrent(context);
46
47
663
  AES::Initialize(env, target);
48
663
  CipherBase::Initialize(env, target);
49
663
  DiffieHellman::Initialize(env, target);
50
663
  DSAAlg::Initialize(env, target);
51
663
  ECDH::Initialize(env, target);
52
663
  Hash::Initialize(env, target);
53
663
  HKDFJob::Initialize(env, target);
54
663
  Hmac::Initialize(env, target);
55
663
  Keygen::Initialize(env, target);
56
663
  Keys::Initialize(env, target);
57
663
  NativeKeyObject::Initialize(env, target);
58
663
  PBKDF2Job::Initialize(env, target);
59
663
  Random::Initialize(env, target);
60
663
  RSAAlg::Initialize(env, target);
61
663
  SecureContext::Initialize(env, target);
62
663
  Sign::Initialize(env, target);
63
663
  SPKAC::Initialize(env, target);
64
663
  Timing::Initialize(env, target);
65
663
  Util::Initialize(env, target);
66
663
  Verify::Initialize(env, target);
67
663
  X509Certificate::Initialize(env, target);
68
69
#ifndef OPENSSL_NO_SCRYPT
70
663
  ScryptJob::Initialize(env, target);
71
#endif
72
663
}
73
74
}  // namespace crypto
75
}  // namespace node
76
77

18652
NODE_MODULE_CONTEXT_AWARE_INTERNAL(crypto, node::crypto::Initialize)