sergot / openssl

OpenSSL bindings for Perl 6
MIT License
14 stars 31 forks source link

OpenSSL 1.1 renamed sk_num to OpenSSL_sk_num #62

Closed voegelas closed 6 years ago

voegelas commented 6 years ago

OpenSSL 1.1 renamed the functions sk_num, sk_value and sk_free to OPENSSL_sk_num etc. I've added is_symbol to the definitions in lib/OpenSSL/Stack.pm6. But I don't know how to define the functions dynamically depending on the available OpenSSL version.

our sub sk_num(OpenSSL::Stack) returns int32 is native(&gen-lib) is symbol("OPENSSL_sk_num") { ... }
our sub sk_value(OpenSSL::Stack, int32) returns Pointer is native(&gen-lib) is symbol("OPENSSL_sk_value") { ... }
our sub sk_free(OpenSSL::Stack) is native(&gen-lib) is symbol("OPENSSL_sk_free") { ... }

sk_num can be tested by replacing ok .num in t/10-client-ca-file.t with ok OpenSSL::Stack::sk_num($_).

This bug has also been reported at https://github.com/jnthn/p6-io-socket-async-ssl/issues/34.

donpdonp commented 6 years ago

for those with systems on openssl 1.1 (such as Ubuntu 18.04) wanting to force a temporary solution, it worked for me to make the above changes in-place in Stack.pm6

$ zef look OpenSSL
$ vi lib/OpenSSL/Stack.pm6
(replace the last 3 lines with the lines in voegelas's comment)
$ zef install . --force