| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 30da2b4 commit 7039916
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,16 +71,19 @@ void LogSecret( | |||
| 71 | 71 | const unsigned char* secret, | |
| 72 | 72 | size_t secretlen) { | |
| 73 | 73 | auto keylog_cb = SSL_CTX_get_keylog_callback(SSL_get_SSL_CTX(ssl.get())); | |
| 74 | - unsigned char crandom[32]; | ||
| 74 | + // All supported versions of TLS/SSL fix the client random to the same size. | ||
| 75 | + constexpr size_t kTlsClientRandomSize = SSL3_RANDOM_SIZE; | ||
| 76 | + unsigned char crandom[kTlsClientRandomSize]; | ||
| 75 | 77 | ||
| 76 | 78 | if (keylog_cb == nullptr || | |
| 77 | - SSL_get_client_random(ssl.get(), crandom, 32) != 32) { | ||
| 79 | + SSL_get_client_random(ssl.get(), crandom, kTlsClientRandomSize) != | ||
| 80 | + kTlsClientRandomSize) { | ||
| 78 | 81 | return; | |
| 79 | 82 | } | |
| 80 | 83 | ||
| 81 | 84 | std::string line = name; | |
| 82 | - line += " " + StringBytes::hex_encode( | ||
| 83 | - reinterpret_cast<const char*>(crandom), 32); | ||
| 85 | + line += " " + StringBytes::hex_encode(reinterpret_cast<const char*>(crandom), | ||
| 86 | + kTlsClientRandomSize); | ||
| 84 | 87 | line += " " + StringBytes::hex_encode( | |
| 85 | 88 | reinterpret_cast<const char*>(secret), secretlen); | |
| 86 | 89 | keylog_cb(ssl.get(), line.c_str()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments