From f9fe024435557b2e23208d44b51fec16b85e4f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 7 Aug 2024 09:57:44 +0200 Subject: [PATCH 1/3] Fix libssl bindings for LibreSSL 3.5 --- src/openssl/lib_crypto.cr | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openssl/lib_crypto.cr b/src/openssl/lib_crypto.cr index aef6a238f663..8d450b28ff17 100644 --- a/src/openssl/lib_crypto.cr +++ b/src/openssl/lib_crypto.cr @@ -57,7 +57,10 @@ lib LibCrypto struct Bio method : Void* - callback : (Void*, Int, Char*, Int, Long, Long) -> Long + callback : BIO_callback_fn + {% if compare_versions(LIBRESSL_VERSION, "3.5.0") >= 0 %} + callback_ex : BIO_callback_fn_ex + {% end %} cb_arg : Char* init : Int shutdown : Int @@ -72,6 +75,9 @@ lib LibCrypto num_write : ULong end + alias BIO_callback_fn = (Bio*, Int, Char*, Int, Long, Long) -> Long + alias BIO_callback_fn_ex = (Bio*, Int, Char, SizeT, Int, Long, Int, SizeT*) -> Long + PKCS5_SALT_LEN = 8 EVP_MAX_KEY_LENGTH = 32 EVP_MAX_IV_LENGTH = 16 From 2715c4444261f5d6a1b0334ef1aae8050db42916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Fri, 21 Oct 2022 23:07:06 +0200 Subject: [PATCH 2/3] [CI] Add test for libreSSL 3.5 --- .github/workflows/openssl.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/openssl.yml b/.github/workflows/openssl.yml index 46d440d1f6e7..e2842cce4b86 100644 --- a/.github/workflows/openssl.yml +++ b/.github/workflows/openssl.yml @@ -56,3 +56,18 @@ jobs: run: bin/crystal eval 'require "openssl"; p! LibSSL::OPENSSL_VERSION, LibSSL::LIBRESSL_VERSION' - name: Run OpenSSL specs run: bin/crystal spec --order=random spec/std/openssl/ + libressl35: + runs-on: ubuntu-latest + name: "LibreSSL 3.5" + container: crystallang/crystal:1.13.1-alpine + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Uninstall openssl + run: apk del openssl-dev openssl-libs-static + - name: Install libressl 3.5 + run: apk add "libressl-dev=~3.5" --repository=http://dl-cdn.alpinelinux.org/alpine/v3.16/community + - name: Check LibSSL version + run: bin/crystal eval 'require "openssl"; p! LibSSL::OPENSSL_VERSION, LibSSL::LIBRESSL_VERSION' + - name: Run OpenSSL specs + run: bin/crystal spec --order=random spec/std/openssl/ From e8106b9de9c3d70633e34d7b0acb98d9a258b17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Wed, 7 Aug 2024 10:03:38 +0200 Subject: [PATCH 3/3] [CI] Add test for libreSSL 3.8 --- .github/workflows/openssl.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/openssl.yml b/.github/workflows/openssl.yml index e2842cce4b86..b932ce542e45 100644 --- a/.github/workflows/openssl.yml +++ b/.github/workflows/openssl.yml @@ -71,3 +71,18 @@ jobs: run: bin/crystal eval 'require "openssl"; p! LibSSL::OPENSSL_VERSION, LibSSL::LIBRESSL_VERSION' - name: Run OpenSSL specs run: bin/crystal spec --order=random spec/std/openssl/ + libressl38: + runs-on: ubuntu-latest + name: "LibreSSL 3.5" + container: crystallang/crystal:1.13.1-alpine + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Uninstall openssl + run: apk del openssl-dev openssl-libs-static + - name: Install libressl 3.8 + run: apk add "libressl-dev=~3.8" --repository=http://dl-cdn.alpinelinux.org/alpine/v3.20/community + - name: Check LibSSL version + run: bin/crystal eval 'require "openssl"; p! LibSSL::OPENSSL_VERSION, LibSSL::LIBRESSL_VERSION' + - name: Run OpenSSL specs + run: bin/crystal spec --order=random spec/std/openssl/