-
-
Notifications
You must be signed in to change notification settings - Fork 761
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
Version 0.10.31 and newer requires deprecated unavailable function DH_generate_parameters() #1428
Comments
It looks like the |
Not having actually looked at the source code in question, I didn't know if this was a case of willingly exposing the deprecated functions through the Rust API or a bug. Now assuming we can conclude that it is a bug. It seems @wiomoc introduced Dh::generate_params as recent as at the end of last year, with PR-1353, and might perhaps have it still fresh in mind? Without fully understanding neither the C or Rust API:s, I presume the preferance is to keep the signature of Dh::generate_params unchanged as is and update openssl-sys to simply export interface the contemporary C api? Apart from my lack of proper knowledge, I have some practical troubles working on this. Because building rust-openssl freshly cloned fails due to ctest not supporting illumos. The following diff seems to at least compile under Linux. I have not made any further attempts at determining whether it is correct or not (and thus am a bit reluctant suggest it as a pull request):
Does this at all look like what is needed? |
We can't remove DH_generate_parameters from openssl-sys, but you can add the _ex version next to it and use that instead. |
Pull request 1431 created. I've managed to successfully compile on both Linux and illumos with it, but not done any further attempts to verify anything. Was about to ask about whether there were any test suites which we expected to be run, but got the notification that there are before doing so. |
Branch updated with whitespace damage fixed and all tests passed successfully. Please let me know where we go from here. |
I can see that PR-#1431 was merged. That's great @sfackler, thank you! One thing which worries me, just slightly, is that unintended usage of deprecated API:s might accidentally happen again. If not in this crate, possibly for other consumers of openssl-sys. Maybe this is a negligible risk, but it might be worth mentioning prior to closing the ticket. Not until after suggesting to use features for API versioning, I noticed that there used to be something like that. Which was removed after discussion in issue #852. Given that at least one bug related to API versioning has been seen now, maybe it's time to revisit the idea? We know that obsoleted functionality started to become harder to use as recently as in 1.1.0, thus not making it unreasonable to think that tracking deprecation might become more important in 3.0.0 and beyond. The way I understand the functionality addressed by issue #852, it seems to have been a user accessible way to opt-in to newer functionality (which I believe was later conceptually replaced by build time, automatically determined, osslαβγ features). How about reusing a rethought design and requiring the use of vαβγ features on openssl-sys to enable deprecated functionality? (Leaving all other existing features as is, of course). Maybe even naming these features apiαβγ to avoid name clash confusion. A very far from complete patch, but hopefully enough to illustrate my thinking, could start as:
Needless to say, I do not believe myself having thought about this a lot. So the perspective of greater insights would be welcome. |
There are a multitude of flags in OpenSSL to turn off various bits of the APIs, and it is unfortunately not feasible to test against every one of them. However, breakage tends to be pretty rare so the status quo of fixing things as they come up is probably the way to go. There are very few direct consumers of the bindings in openssl-sys outside of the openssl crate. I don't think anyone will be calling DH_generate_consumers. |
First, some essentials about my system:
Please consider the following minimal program:
When compiled using the following Cargo.toml:
It builds without any problems:
Yet, if attempting to use a newer crate version. Such as:
Attempts to build fail:
Attempting to build against 0.10.32 fails equally bad. The commit tagged openssl-sys-v0.9.59 (2020DEC09) mentions the addition of DH_generate_parameters, which we can see is the symbol missing in the compilation error above.
Looking at include/openssl/dh.h we learn that this function is conditionally compiled behind a deprecation guard, as this function was deprecated (2002DEC08) in OpenSSL 0.9.8. A version which was initially released more than a decade and a half ago (2005OCT10).
Quoting Configure on the use of its api option:
I believe that OmniOS has had OpenSSL built with --api=1.0.0 since 2017AUG23. Between OmniOS r151026 and OmniOS r151036 that should add up to six stable releases, from which we might assume being enough time to prove shipping systems with such a library configuration seems to be reasonably valid.
Lacking a deeper understanding here, I wonder if anyone might have an idea on what might be the right way to solve this? Could putting access to deprecated stuff behind a feature be the way to go?
The text was updated successfully, but these errors were encountered: