Repository navigation
64bits keyspace - #17
Conversation
| } else if (m_data_size_type == data_size_range) { | ||
| if (m_data_size_pattern && *m_data_size_pattern=='S') { | ||
| float a = (m_key_index-m_key_min)/(float)(m_key_max-m_key_min); | ||
| float a = (m_key_index-m_key_min)/(m_key_max-m_key_min); |
There was a problem hiding this comment.
Why remove the cast? the new_size calc won't be correct....
|
@swilly22 - Note your git config sets 'root' as the author.... |
| llrn = llrn << 32; // move to upper 32bits | ||
|
|
||
| rn = nrand48(m_data_blob); // max is 1<<31 | ||
| llrn |= rn; // max is 1<<31 |
| #ifdef HAVE_RANDOM_R | ||
| return RAND_MAX; | ||
| unsigned long long rand_max = RAND_MAX; | ||
| return (rand_max << 32) | RAND_MAX; |
There was a problem hiding this comment.
Not really important, but you can do ((uint64_t)RAND_MAX << 32) | RAND_MAX; instead.
| if (m_data_size_pattern && *m_data_size_pattern=='S') { | ||
| float a = (m_key_index-m_key_min)/(m_key_max-m_key_min); | ||
| float a = (m_key_index-m_key_min)/(float)(m_key_max-m_key_min); | ||
| new_size = (m_data_size.size_range.size_max-m_data_size.size_range.size_min)*a + m_data_size.size_range.size_min; |
There was a problem hiding this comment.
This now triggers a compilation warnings on size mismatch - need to add some casts (both here and in random_range two lines below) - and let's use static_cast<> instead of C style...
There was a problem hiding this comment.
(static cast to double -- not to float)
|
@swilly22 - Note comment - after you fix please squash and repush, then I'll merge. |
2beaab2 to
5e616f1
Compare
…nSSL 4.0 compat) (#432) * fix(tls): replace SSL_OP_NO_TLSv1/1_1 with set_min_proto_version (OpenSSL 4.0 compat) SSL_OP_NO_TLSv1 and SSL_OP_NO_TLSv1_1 are absent from the OpenSSL 4.0 public API. PR #388 covered the threading/init deprecations but missed these two flags, so master would fail to build against OpenSSL 4.0. SSL_CTX_set_min_proto_version / SSL_CTX_set_max_proto_version are semantically equivalent (enforcing the user-requested protocol range) and are available since OpenSSL 1.1.0. SSL_OP_NO_TLSv1_2 (also removed in 4.0) is covered by the same guard. Falls back to SSL_OP_NO_TLSv* on pre-1.1.0 toolchains. Refs: 2.4 review finding #17 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * fix(tls): mask protocol gaps inside min/max range under OpenSSL >= 1.1.0 Bugbot flagged that the min/max approach allowed intermediate protocols the user explicitly omitted (e.g. --tls-protocols "tlsv1,tlsv1.2" enabled tlsv1.1). Combines envelope clamp (set_min/max_proto_version) with per-gap SSL_OP_NO_TLSv1_x masks, guarded by #ifdef so OpenSSL 4.0 (which may remove the symbols entirely) still builds. For 4.0 the gap-mask is silently skipped: removing those symbols means the runtime can't individually disable them anyway, which matches OpenSSL's intended deprecation policy. Refs: bugbot MED review on PR #432 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
No description provided.