-
Notifications
You must be signed in to change notification settings - Fork 45
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
Net::SSLeay assumes all libssl/libcrypto constants are doubles #315
Comments
What if we start with a partial solution: switch to an unsigned 64bit integer with Perls that support 64bit integer? |
This is a partial solution to GH-315. 64 bit constants are used with OpenSSL 3.0.0 and later when perl supports 64 bit integers. Otherwise constants, SSL_CTX_get_options() and its related functions continue to use double as the flag type. OpenSSL 3.0.0-alpha17 switched from long to uint64_t with SSL_CTX_get_options() family of functions.
Pull request #344 implements the partial solution. However, https://metacpan.org/pod/Math::Int64#C-API looks like a better option. If we change to it, parts of the pull request can still be used. It would also be usable with API functions that use 64 bit integers. None are exposed yet, but when they are needed, we'd have the support correctly available. |
After a closer look at Math::Int64, it appears that use of it would create a dependency which would also affect 64bit integer Perl environments. I guess there's no possibility to have a dependency that would only apply with 32bit integer Perls. This optional dependency would also require a number of ifdefs in the code, possibly two typemap files and would otherwise be ugly. I would stay with pull request #344 for now to cover most of the target Perls. |
This is a partial solution to GH-315. 64 bit constants are used with OpenSSL 3.0.0 and later when perl supports 64 bit integers. Otherwise constants, SSL_CTX_get_options() and its related functions continue to use double as the flag type. OpenSSL 3.0.0-alpha17 switched from long to uint64_t with SSL_CTX_get_options() family of functions.
…software/p5-net-ssleay into GH-315-support-64bit-constants
* GH-315 Use 64 bit constants with OpenSSL 3.0.0 and later. This is a partial solution to GH-315. 64 bit constants are used with OpenSSL 3.0.0 and later when perl supports 64 bit integers. Otherwise constants continue to use double, and SSL_CTX_get_options() and its related functions continue to use long as the flag type. OpenSSL 3.0.0-alpha17 switched from long to uint64_t with SSL_CTX_get_options() family of functions.
Changes in pull request GH-344 fix this for Perls that use 64bit integers. Perls with 32bit integers continue to use |
Stable release 1.92 includes the changes described above. Constants use type |
Raised by @h-vn in a comment in #313, but it deserves its own issue.
helper_script/regen_openssl_constants.pl
(and, when #313 is merged,helper_script/update-exported-constants
) generates C code that returns the values of libssl and libcrypto constants asdouble
s:p5-net-ssleay/constants.c
Lines 3 to 4 in 4d9f7ea
This assumes that the values of constants will never be greater than 253. This appears to be the case for all constants we currently export for all versions of OpenSSL and LibreSSL we currently support, although this isn't guaranteed to be true in future.
The text was updated successfully, but these errors were encountered: