-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto: build warning fixes #10142
crypto: build warning fixes #10142
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @indutny Is there a reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's how much bits it occupies in binary representation. I don't have any strong feelings about making it wider, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is what I gather from a quick grep: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
tls_ticket_ = data + len; | ||
break; | ||
default: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct per se on 32 bits architectures where
long
is 32 bits and BN_ULONG is a 64 bitsunsigned long long
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix this tomorrow.