Old OpenSSL Compatibility (x: Old OpenSSL Cpmpaitibility)

Fred Wright fw at fwright.net
Sun Dec 22 23:59:53 UTC 2024


On Fri, 20 Dec 2024, Hal Murray wrote:

> Pleae try again.
>
> Looks like I had the #define backwards.
>
> I copied that code from new defs which was trying to adapt to old code.
> We want old defs to reverse adapt to new code.

I should have noticed that, but I was in the middle of doing three things 
at once.

The updated version fixed the build problems, but there were some test 
failures.  The relevant old OpenSSL cases were 1.0.x, so I had to restore 
some initialization stuff needed for that.  I'm not sure why pymodule-mac 
has its own initialization rather than using ssl_init() from ssl_init.c, 
but I left that alone.

The macro to map EVP_MD_CTX_reset to EVP_MD_CTX_init wouldn't have worked, 
but it didn't matter since that function isn't actually used.  I didn't 
think it was a good idea to leave a time bomb for some possible future 
use, so I fixed it.

The problem is that the return type changed, and the only way to handle 
that in a macro is to rely on a block expression, which is a gnu 
extension.  But it's straightforward to do it in a function instead, and 
since inline functions are more robust in general that macros, I changed 
all three of them.

Some compilers may complain about unused inlines.  I included the usual 
void casts to avoid "unused function" warnings, but some compilers may 
then issue an "unemitted inline" warning.  This doesn't seem to happen in 
the cases I tested, though, and of course the whole thing is only present 
for old OpenSSL versions.

I also added the new include to the two affected attic programs.

I'll submit an MR once I've tested it more thoroughly.

Fred Wright


More information about the devel mailing list