-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
/
Copy pathcrypto_common.h
48 lines (33 loc) · 1.61 KB
/
crypto_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef SRC_CRYPTO_CRYPTO_COMMON_H_
#define SRC_CRYPTO_CRYPTO_COMMON_H_
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
#include "ncrypto.h"
#include "node_crypto.h"
#include "v8.h"
#include <string>
namespace node {
namespace crypto {
ncrypto::SSLSessionPointer GetTLSSession(const unsigned char* buf,
size_t length);
v8::MaybeLocal<v8::Value> GetValidationErrorReason(Environment* env, int err);
v8::MaybeLocal<v8::Value> GetValidationErrorCode(Environment* env, int err);
v8::MaybeLocal<v8::Value> GetCert(Environment* env,
const ncrypto::SSLPointer& ssl);
v8::MaybeLocal<v8::Object> GetCipherInfo(Environment* env,
const ncrypto::SSLPointer& ssl);
v8::MaybeLocal<v8::Object> GetEphemeralKey(Environment* env,
const ncrypto::SSLPointer& ssl);
v8::MaybeLocal<v8::Value> GetPeerCert(Environment* env,
const ncrypto::SSLPointer& ssl,
bool abbreviated = false,
bool is_server = false);
v8::MaybeLocal<v8::Object> ECPointToBuffer(Environment* env,
const EC_GROUP* group,
const EC_POINT* point,
point_conversion_form_t form);
} // namespace crypto
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#endif // SRC_CRYPTO_CRYPTO_COMMON_H_