Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crypto: use static kTLSTicketSizeMask
Resolve conversion warning on Windows
  • Loading branch information
Christopher J. Brody committed Dec 6, 2016
commit c271e8dbb80153d527524b91ef2e3272b31099c2
6 changes: 5 additions & 1 deletion src/node_crypto_clienthello.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include "node_crypto_clienthello-inl.h"
#include "node_buffer.h" // Buffer

// FUTURE TODO export maximum TLS ticket size:
static const size_t kTLSTicketSizeMask = 0xFFFF;

namespace node {

void ClientHelloParser::Parse(const uint8_t* data, size_t avail) {
Expand Down Expand Up @@ -146,7 +149,8 @@ void ClientHelloParser::ParseExtension(const uint16_t type,
ocsp_request_ = 1;
break;
case kTLSSessionTicket:
tls_ticket_size_ = len;
// TBD POSSIBLE DATA LOSS:
tls_ticket_size_ = static_cast<uint16_t>(len & kTLSTicketSizeMask);
tls_ticket_ = data + len;
break;
default:
Expand Down