Skip to content

Commit

Permalink
Try to load library by explicitly stated (known to work) version first
Browse files Browse the repository at this point in the history
We know that we support OpenSSL 1.1 and 1.0, so rather than hoping that
/usr/lib64/libssl.so points to a supported version, we should try those
first and fall back to the symlink later. This matches the dependency
stated in META6.json more closely.

Fixes GH sergot#16 and sergot#54 and sergot#59
  • Loading branch information
niner committed Feb 3, 2020
1 parent 6baffdc commit 407ceac
Show file tree
Hide file tree
Showing 14 changed files with 142 additions and 102 deletions.
10 changes: 5 additions & 5 deletions lib/OpenSSL/Bio.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class BIO is repr('CStruct') {
has int32 $.dummy;
}

our sub BIO_new_bio_pair(CArray[OpaquePointer], long, CArray[OpaquePointer], long --> int32) is native(&gen-lib) { ... }
our sub BIO_free(OpaquePointer) is native(&gen-lib) { ... }
our sub BIO_read(OpaquePointer, Blob, long --> int32) is native(&gen-lib) { ... }
our sub BIO_write(OpaquePointer, Blob, long --> int32) is native(&gen-lib) { ... }
our sub BIO_new_mem_buf(Blob, long --> OpaquePointer) is native(&gen-lib) { ... }
our sub BIO_new_bio_pair(CArray[OpaquePointer], long, CArray[OpaquePointer], long --> int32) is native(gen-lib) { ... }
our sub BIO_free(OpaquePointer) is native(gen-lib) { ... }
our sub BIO_read(OpaquePointer, Blob, long --> int32) is native(gen-lib) { ... }
our sub BIO_write(OpaquePointer, Blob, long --> int32) is native(gen-lib) { ... }
our sub BIO_new_mem_buf(Blob, long --> OpaquePointer) is native(gen-lib) { ... }
18 changes: 9 additions & 9 deletions lib/OpenSSL/Ctx.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ class SSL_CTX is repr('CStruct') {
has OpenSSL::Method::SSL_METHOD $.method;
}

our sub SSL_CTX_new(OpenSSL::Method::SSL_METHOD) returns SSL_CTX is native(&ssl-lib) { ... }
our sub SSL_CTX_free(SSL_CTX) is native(&ssl-lib) { ... }
our sub SSL_CTX_ctrl(SSL_CTX, int32, long, Pointer) returns long is native(&ssl-lib) { ... }
our sub SSL_CTX_new(OpenSSL::Method::SSL_METHOD) returns SSL_CTX is native(ssl-lib) { ... }
our sub SSL_CTX_free(SSL_CTX) is native(ssl-lib) { ... }
our sub SSL_CTX_ctrl(SSL_CTX, int32, long, Pointer) returns long is native(ssl-lib) { ... }

our sub SSL_CTX_use_certificate(SSL_CTX, Pointer) returns int32 is native(&ssl-lib) { ... }
our sub SSL_CTX_use_certificate_file(SSL_CTX, Str, int32) returns int32 is native(&ssl-lib) { ... }
our sub SSL_CTX_use_certificate_chain_file(SSL_CTX, Str) returns int32 is native(&ssl-lib) { ... }
our sub SSL_CTX_use_PrivateKey(SSL_CTX, Pointer) returns int32 is native(&ssl-lib) { ... }
our sub SSL_CTX_use_PrivateKey_file(SSL_CTX, Str, int32) returns int32 is native(&ssl-lib) { ... }
our sub SSL_CTX_check_private_key(SSL_CTX) returns int32 is native(&ssl-lib) { ... }
our sub SSL_CTX_use_certificate(SSL_CTX, Pointer) returns int32 is native(ssl-lib) { ... }
our sub SSL_CTX_use_certificate_file(SSL_CTX, Str, int32) returns int32 is native(ssl-lib) { ... }
our sub SSL_CTX_use_certificate_chain_file(SSL_CTX, Str) returns int32 is native(ssl-lib) { ... }
our sub SSL_CTX_use_PrivateKey(SSL_CTX, Pointer) returns int32 is native(ssl-lib) { ... }
our sub SSL_CTX_use_PrivateKey_file(SSL_CTX, Str, int32) returns int32 is native(ssl-lib) { ... }
our sub SSL_CTX_check_private_key(SSL_CTX) returns int32 is native(ssl-lib) { ... }
10 changes: 5 additions & 5 deletions lib/OpenSSL/Digest.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ our constant SHA256_DIGEST_LENGTH = 32;
our constant SHA384_DIGEST_LENGTH = 48;
our constant SHA512_DIGEST_LENGTH = 64;

sub MD5( Blob, size_t, Blob ) is native(&gen-lib) { ... }
sub SHA1( Blob, size_t, Blob ) is native(&gen-lib) { ... }
sub SHA256( Blob, size_t, Blob ) is native(&gen-lib) { ... }
sub SHA384( Blob, size_t, Blob ) is native(&gen-lib) { ... }
sub SHA512( Blob, size_t, Blob ) is native(&gen-lib) { ... }
sub MD5( Blob, size_t, Blob ) is native(gen-lib) { ... }
sub SHA1( Blob, size_t, Blob ) is native(gen-lib) { ... }
sub SHA256( Blob, size_t, Blob ) is native(gen-lib) { ... }
sub SHA384( Blob, size_t, Blob ) is native(gen-lib) { ... }
sub SHA512( Blob, size_t, Blob ) is native(gen-lib) { ... }

sub md5(Blob $msg) is export {
my $digest = buf8.allocate(MD5_DIGEST_LENGTH);
Expand Down
6 changes: 3 additions & 3 deletions lib/OpenSSL/Digest/MD5.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class OpenSSL::Digest::MD5
{
has $!context;

sub MD5_Init(Blob) returns int32 is native(&gen-lib) { * }
sub MD5_Update(Blob, Blob, size_t) returns int32 is native(&gen-lib) { * }
sub MD5_Final(Blob, Blob) returns int32 is native(&gen-lib) { * }
sub MD5_Init(Blob) returns int32 is native(gen-lib) { * }
sub MD5_Update(Blob, Blob, size_t) returns int32 is native(gen-lib) { * }
sub MD5_Final(Blob, Blob) returns int32 is native(gen-lib) { * }

submethod BUILD() {
$!context = buf8.allocate(MD5-CTX-SIZE);
Expand Down
26 changes: 13 additions & 13 deletions lib/OpenSSL/EVP.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ unit module OpenSSL::EVP;
use OpenSSL::NativeLib;
use NativeCall;

our sub EVP_PKEY_get1_RSA(OpaquePointer --> OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_PKEY_free(OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_PKEY_get1_RSA(OpaquePointer --> OpaquePointer) is native(gen-lib) { ... }
our sub EVP_PKEY_free(OpaquePointer) is native(gen-lib) { ... }

our sub EVP_CIPHER_CTX_new(--> OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_CIPHER_CTX_free(OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_CIPHER_CTX_new(--> OpaquePointer) is native(gen-lib) { ... }
our sub EVP_CIPHER_CTX_free(OpaquePointer) is native(gen-lib) { ... }

our sub EVP_EncryptInit(OpaquePointer, OpaquePointer, Blob, Blob --> int32) is native(&gen-lib) { ... }
our sub EVP_EncryptUpdate(OpaquePointer, Blob, CArray[int32], Blob, int32 --> int32) is native(&gen-lib) { ... }
our sub EVP_EncryptFinal(OpaquePointer, Blob, CArray[int32] --> int32) is native(&gen-lib) { ... }
our sub EVP_EncryptInit(OpaquePointer, OpaquePointer, Blob, Blob --> int32) is native(gen-lib) { ... }
our sub EVP_EncryptUpdate(OpaquePointer, Blob, CArray[int32], Blob, int32 --> int32) is native(gen-lib) { ... }
our sub EVP_EncryptFinal(OpaquePointer, Blob, CArray[int32] --> int32) is native(gen-lib) { ... }

our sub EVP_DecryptInit(OpaquePointer, OpaquePointer, Blob, Blob --> int32) is native(&gen-lib) { ... }
our sub EVP_DecryptUpdate(OpaquePointer, Blob, CArray[int32], Blob, int32 --> int32) is native(&gen-lib) { ... }
our sub EVP_DecryptFinal(OpaquePointer, Blob, CArray[int32] --> int32) is native(&gen-lib) { ... }
our sub EVP_DecryptInit(OpaquePointer, OpaquePointer, Blob, Blob --> int32) is native(gen-lib) { ... }
our sub EVP_DecryptUpdate(OpaquePointer, Blob, CArray[int32], Blob, int32 --> int32) is native(gen-lib) { ... }
our sub EVP_DecryptFinal(OpaquePointer, Blob, CArray[int32] --> int32) is native(gen-lib) { ... }

class evp_cipher_st is repr('CStruct') {
has int32 $.nid;
Expand All @@ -34,6 +34,6 @@ class evp_cipher_st is repr('CStruct') {
}

# ciphers
our sub EVP_aes_128_cbc( --> OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_aes_192_cbc( --> OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_aes_256_cbc( --> OpaquePointer) is native(&gen-lib) { ... }
our sub EVP_aes_128_cbc( --> OpaquePointer) is native(gen-lib) { ... }
our sub EVP_aes_192_cbc( --> OpaquePointer) is native(gen-lib) { ... }
our sub EVP_aes_256_cbc( --> OpaquePointer) is native(gen-lib) { ... }
4 changes: 2 additions & 2 deletions lib/OpenSSL/Err.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ unit module OpenSSL::Err;
use OpenSSL::NativeLib;
use NativeCall;

our sub ERR_error_string(int32 $e, Str $ret) returns Str is native(&gen-lib) { ... };
our sub ERR_error_string(int32 $e, Str $ret) returns Str is native(gen-lib) { ... };

our sub ERR_get_error() returns ulonglong is native(&gen-lib) { ... };
our sub ERR_get_error() returns ulonglong is native(gen-lib) { ... };
42 changes: 21 additions & 21 deletions lib/OpenSSL/Method.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ class SSL_METHOD is repr('CStruct') {
has int32 $.version;
}

our sub SSLv2_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv2_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv2_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv3_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv3_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv3_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv23_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv23_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv23_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLS_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLS_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLS_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_1_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_1_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_1_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_2_client_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_2_server_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub TLSv1_2_method() returns SSL_METHOD is native(&ssl-lib) { ... }
our sub SSLv2_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv2_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv2_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv3_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv3_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv3_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv23_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv23_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub SSLv23_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLS_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLS_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLS_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_1_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_1_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_1_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_2_client_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_2_server_method() returns SSL_METHOD is native(ssl-lib) { ... }
our sub TLSv1_2_method() returns SSL_METHOD is native(ssl-lib) { ... }
54 changes: 47 additions & 7 deletions lib/OpenSSL/NativeLib.pm6
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
unit module OpenSSL::NativeLib;

use NativeCall;

my $version;

sub ssl-lib is export {
state $lib = $*DISTRO.is-win
state @lib = $*DISTRO.is-win
?? dll-resource('ssleay32.dll')
!! $*VM.platform-library-name('ssl'.IO).Str;
!! ('ssl', version)
}

sub gen-lib-unversioned() {
$*DISTRO.is-win
?? dll-resource('libeay32.dll')
!! 'ssl'
}

sub gen-lib-version($v) {
@ = $*DISTRO.is-win
?? dll-resource('libeay32.dll')
!! ('ssl', $v)
}

sub gen-lib is export {
state $lib = $*DISTRO.is-win
sub gen-lib() is export {
state @lib = $*DISTRO.is-win
?? dll-resource('libeay32.dll')
!! $*VM.platform-library-name('ssl'.IO).Str;
!! ('ssl', version)
}

sub crypto-lib is export {
state $lib = $*DISTRO.is-win
state @lib = $*DISTRO.is-win
?? dll-resource('libeay32.dll')
!! $*VM.platform-library-name('crypto'.IO).Str;
!! ('crypto', version)
}

sub version() {
unless defined $version {
for (v1.1, v1.0, v1.0.0) -> $v {
try {
my sub EVP_aes_128_cbc( --> Pointer) { };
trait_mod:<is>(&EVP_aes_128_cbc, :native(gen-lib-version($v)));
EVP_aes_128_cbc();
$version = $v;
}
last if $version;
}

try {
my sub EVP_aes_128_cbc( --> Pointer) { };
trait_mod:<is>(&EVP_aes_128_cbc, :native(gen-lib-unversioned()));
EVP_aes_128_cbc();
$version = '';
}

die "Did not find {$*VM.platform-library-name('ssl'.IO)}" unless defined $version;
}
$version
}

# Windows only
Expand Down
8 changes: 4 additions & 4 deletions lib/OpenSSL/PEM.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ unit module OpenSSL::PEM;
use OpenSSL::NativeLib;
use NativeCall;

our sub PEM_read_bio_RSAPrivateKey(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(&gen-lib) { ... }
our sub PEM_read_bio_RSAPublicKey(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(&gen-lib) { ... }
our sub PEM_read_bio_RSA_PUBKEY(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(&gen-lib) { ... }
our sub PEM_read_bio_X509(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(&gen-lib) { ... }
our sub PEM_read_bio_RSAPrivateKey(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(gen-lib) { ... }
our sub PEM_read_bio_RSAPublicKey(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(gen-lib) { ... }
our sub PEM_read_bio_RSA_PUBKEY(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(gen-lib) { ... }
our sub PEM_read_bio_X509(OpaquePointer, OpaquePointer, OpaquePointer, OpaquePointer --> OpaquePointer) is native(gen-lib) { ... }
8 changes: 4 additions & 4 deletions lib/OpenSSL/RSA.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ unit module OpenSSL::RSA;
use OpenSSL::NativeLib;
use NativeCall;

our sub RSA_sign(int32, Blob, int32, Blob, CArray, OpaquePointer --> int32) is native(&gen-lib) { ... }
our sub RSA_verify(int32, Blob, int32, Blob, int32, OpaquePointer --> int32) is native(&gen-lib) { ... }
our sub RSA_sign(int32, Blob, int32, Blob, CArray, OpaquePointer --> int32) is native(gen-lib) { ... }
our sub RSA_verify(int32, Blob, int32, Blob, int32, OpaquePointer --> int32) is native(gen-lib) { ... }

our sub RSA_size(OpaquePointer --> int32) is native(&gen-lib) { ... }
our sub RSA_free(OpaquePointer) is native(&gen-lib) { ... }
our sub RSA_size(OpaquePointer --> int32) is native(gen-lib) { ... }
our sub RSA_free(OpaquePointer) is native(gen-lib) { ... }
44 changes: 22 additions & 22 deletions lib/OpenSSL/SSL.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ class SSL is repr('CStruct') {
has int32 $.rstate;
}

our sub SSL_library_init() is native(&ssl-lib) { ... }
our sub OPENSSL_init_ssl(uint64, OpaquePointer) is native(&ssl-lib) { ... }
our sub SSL_load_error_strings() is native(&ssl-lib) { ... }

our sub SSL_new(OpenSSL::Ctx::SSL_CTX) returns SSL is native(&ssl-lib) { ... }
our sub SSL_set_fd(SSL, int32) returns int32 is native(&ssl-lib) { ... }
our sub SSL_shutdown(SSL) returns int32 is native(&ssl-lib) { ... }
our sub SSL_free(SSL) is native(&ssl-lib) { ... }
our sub SSL_get_error(SSL, int32) returns int32 is native(&ssl-lib) { ... }
our sub SSL_accept(SSL) returns int32 is native(&ssl-lib) { ... }
our sub SSL_connect(SSL) returns int32 is native(&ssl-lib) { ... }
our sub SSL_read(SSL, Blob, int32) returns int32 is native(&ssl-lib) { ... }
our sub SSL_write(SSL, Blob, int32) returns int32 is native(&ssl-lib) { ... }
our sub SSL_set_connect_state(SSL) is native(&ssl-lib) { ... }
our sub SSL_set_accept_state(SSL) is native(&ssl-lib) { ... }

our sub SSL_set_bio(SSL, OpaquePointer, OpaquePointer) returns int32 is native(&ssl-lib) { ... }

our sub SSL_load_client_CA_file(CArray[uint8]) returns OpenSSL::Stack is native(&ssl-lib) { ... };
our sub SSL_get_client_CA_list(SSL) returns OpenSSL::Stack is native(&ssl-lib) { ... };
our sub SSL_set_client_CA_list(SSL, OpenSSL::Stack) is native(&ssl-lib) { ... };
our sub SSL_library_init() is native(ssl-lib) { ... }
our sub OPENSSL_init_ssl(uint64, OpaquePointer) is native(ssl-lib) { ... }
our sub SSL_load_error_strings() is native(ssl-lib) { ... }

our sub SSL_new(OpenSSL::Ctx::SSL_CTX) returns SSL is native(ssl-lib) { ... }
our sub SSL_set_fd(SSL, int32) returns int32 is native(ssl-lib) { ... }
our sub SSL_shutdown(SSL) returns int32 is native(ssl-lib) { ... }
our sub SSL_free(SSL) is native(ssl-lib) { ... }
our sub SSL_get_error(SSL, int32) returns int32 is native(ssl-lib) { ... }
our sub SSL_accept(SSL) returns int32 is native(ssl-lib) { ... }
our sub SSL_connect(SSL) returns int32 is native(ssl-lib) { ... }
our sub SSL_read(SSL, Blob, int32) returns int32 is native(ssl-lib) { ... }
our sub SSL_write(SSL, Blob, int32) returns int32 is native(ssl-lib) { ... }
our sub SSL_set_connect_state(SSL) is native(ssl-lib) { ... }
our sub SSL_set_accept_state(SSL) is native(ssl-lib) { ... }

our sub SSL_set_bio(SSL, OpaquePointer, OpaquePointer) returns int32 is native(ssl-lib) { ... }

our sub SSL_load_client_CA_file(CArray[uint8]) returns OpenSSL::Stack is native(ssl-lib) { ... };
our sub SSL_get_client_CA_list(SSL) returns OpenSSL::Stack is native(ssl-lib) { ... };
our sub SSL_set_client_CA_list(SSL, OpenSSL::Stack) is native(ssl-lib) { ... };

# long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg)
our sub SSL_ctrl(SSL, int32, long, Str ) returns long is native(&ssl-lib) { ... }
our sub SSL_ctrl(SSL, int32, long, Str ) returns long is native(ssl-lib) { ... }
6 changes: 3 additions & 3 deletions lib/OpenSSL/Stack.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ my sub real_symbol(Str $sym) returns Str {
return $v >= 0x10100000 && !$is_libressl ?? "OPENSSL_$sym" !! $sym;
}

our sub sk_num(OpenSSL::Stack) returns int32 is native(&gen-lib) is symbol(real_symbol('sk_num')) { ... }
our sub sk_value(OpenSSL::Stack, int32) returns Pointer is native(&gen-lib) is symbol(real_symbol('sk_value')) { ... }
our sub sk_free(OpenSSL::Stack) is native(&gen-lib) is symbol(real_symbol('sk_free')) { ... }
our sub sk_num(OpenSSL::Stack) returns int32 is native(gen-lib) is symbol(real_symbol('sk_num')) { ... }
our sub sk_value(OpenSSL::Stack, int32) returns Pointer is native(gen-lib) is symbol(real_symbol('sk_value')) { ... }
our sub sk_free(OpenSSL::Stack) is native(gen-lib) is symbol(real_symbol('sk_free')) { ... }
4 changes: 2 additions & 2 deletions lib/OpenSSL/Version.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ our int32 constant DIR = 4;
our int32 constant ENGINES_DIR = 5;

our sub version_num returns Int {
my sub OpenSSL_version_num returns ulong is native(&gen-lib) { ... }
my sub OpenSSL_version_num returns ulong is native(gen-lib) { ... }
return try { OpenSSL_version_num() } // 0;
}

our sub version(int32 $type = VERSION) returns Str {
my sub OpenSSL_version(int32) returns Str is native(&gen-lib) { ... }
my sub OpenSSL_version(int32) returns Str is native(gen-lib) { ... }
return try { OpenSSL_version($type) } // '';
}
4 changes: 2 additions & 2 deletions lib/OpenSSL/X509.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ our sub dump_x509_stack(OpenSSL::Stack $stack, :$FH = $*ERR) {
}
}

our sub X509_get_pubkey(OpaquePointer --> OpaquePointer) is native(&crypto-lib) { ... }
our sub X509_free(OpaquePointer) is native(&crypto-lib) { ... }
our sub X509_get_pubkey(OpaquePointer --> OpaquePointer) is native(crypto-lib) { ... }
our sub X509_free(OpaquePointer) is native(crypto-lib) { ... }

0 comments on commit 407ceac

Please sign in to comment.