Lazarus

Programming => Networking and Web Programming => Topic started by: trev on August 15, 2020, 08:09:45 am

Title: OpenSSL/LibreSSL version deprecation and function names
Post by: trev on August 15, 2020, 08:09:45 am
When using
Code: Pascal  [Select][+][-]
  1. SSLeayversion(0);
there is a deprecation warning:

Quote
unit1.pas(59,15) Warning: Symbol "SSLeayversion" is deprecated: "For 1.1+ use OpenSSL_version"

When using
Code: Pascal  [Select][+][-]
  1. SSLeay_version(0);
there is no deprecation warning.

The deprecation warning for the first variant suggests using OpenSSL_version, but there is no OpenSSL_version() function. There is, however, an OpenSSLGetVersion function.

It would appear to me that:
1) The second SSLeay variant needs a deprecation warning; and
2) The deprecation warning in both instances should suggest OpenSSLGetVersion.

Am I confused? ;)
Title: Re: OpenSSL/LibreSSL version deprecation and function names
Post by: Bi0T1N on August 15, 2020, 11:08:38 am
I've already provided a patch (https://bugs.freepascal.org/view.php?id=37555) to fix the deprecation warning and also the loading of the OpenSSL_version.

However, the function function SSLeay_version(t: cint): PChar; has the same name than the  SSLeay_version (https://www.openssl.org/docs/man1.0.2/man3/SSLeay_version.html) function from OpenSSL method prior 1.1.x so maybe it was just added for convenience without seeing that _SSLeayversion already exists (or the way around)?
I think it should be deprecated as well (better for backward compatibility than removing it) and changed to use _SSLeayversion as it automatically links to OpenSSL_version if SSLeay_version (https://www.openssl.org/docs/man1.0.2/man3/SSLeay_version.html) isn't available anymore.
TinyPortal © 2005-2018