summaryrefslogtreecommitdiff
path: root/src/node_crypto_clienthello.h
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2014-04-14 21:15:57 +0400
committerFedor Indutny <fedor@indutny.com>2014-04-18 02:21:16 +0400
commitb3ef289ffb7db476d284866658213f04415ea92d (patch)
treeece3f973d16849e46ea7736880055482df0616e7 /src/node_crypto_clienthello.h
parent77d1f4a91f2885fd3f39298754ae5b7ee75ad3d1 (diff)
downloadnode-new-b3ef289ffb7db476d284866658213f04415ea92d.tar.gz
tls: support OCSP on client and server
Diffstat (limited to 'src/node_crypto_clienthello.h')
-rw-r--r--src/node_crypto_clienthello.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h
index 4301d9bb1c..3ebcead0c3 100644
--- a/src/node_crypto_clienthello.h
+++ b/src/node_crypto_clienthello.h
@@ -34,7 +34,14 @@ class ClientHelloParser {
ClientHelloParser() : state_(kEnded),
onhello_cb_(NULL),
onend_cb_(NULL),
- cb_arg_(NULL) {
+ cb_arg_(NULL),
+ session_size_(0),
+ session_id_(NULL),
+ servername_size_(0),
+ servername_(NULL),
+ ocsp_request_(0),
+ tls_ticket_size_(0),
+ tls_ticket_(NULL) {
Reset();
}
@@ -48,6 +55,7 @@ class ClientHelloParser {
inline bool has_ticket() const { return has_ticket_; }
inline uint8_t servername_size() const { return servername_size_; }
inline const uint8_t* servername() const { return servername_; }
+ inline int ocsp_request() const { return ocsp_request_; }
private:
uint8_t session_size_;
@@ -55,6 +63,7 @@ class ClientHelloParser {
bool has_ticket_;
uint8_t servername_size_;
const uint8_t* servername_;
+ int ocsp_request_;
friend class ClientHelloParser;
};
@@ -76,6 +85,8 @@ class ClientHelloParser {
static const size_t kMaxTLSFrameLen = 16 * 1024 + 5;
static const size_t kMaxSSLExFrameLen = 32 * 1024;
static const uint8_t kServernameHostname = 0;
+ static const uint8_t kStatusRequestOCSP = 1;
+ static const size_t kMinStatusRequestSize = 5;
enum ParseState {
kWaiting,
@@ -99,6 +110,7 @@ class ClientHelloParser {
enum ExtensionType {
kServerName = 0,
+ kStatusRequest = 5,
kTLSSessionTicket = 35
};
@@ -123,6 +135,7 @@ class ClientHelloParser {
const uint8_t* session_id_;
uint16_t servername_size_;
const uint8_t* servername_;
+ uint8_t ocsp_request_;
uint16_t tls_ticket_size_;
const uint8_t* tls_ticket_;
};