Re: sign-file: full functionality with modern LibreSSL
From: Mikhail Novosyolov
Date: Sun May 10 2020 - 11:57:22 EST
19.03.2020 00:31, Mikhail Novosyolov ÐÐÑÐÑ:
> Current pre-release version of LibreSSL has enabled CMS support,
> and now sign-file is fully functional with it.
>
> See https://github.com/libressl-portable/openbsd/commits/master
>
> To test buildability with current LibreSSL:
> ~$ git clone https://github.com/libressl-portable/portable.git
> ~$ cd portable && ./autogen.sh
> ~$ ./configure --prefix=/opt/libressl
> ~$ make
> ~# make install
> Go to the kernel source tree and:
> ~$ gcc -I/opt/libressl/include -L /opt/libressl/lib -lcrypto -Wl,-rpath,/opt/libressl/lib scripts/sign-file.c -o scripts/sign-file
>
> Fixes: f8688017 ("sign-file: fix build error in sign-file.c with libressl")
>
> Signed-off-by: Mikhail Novosyolov <m.novosyolov@xxxxxxxxxxxx>
I would like to remember about this.
LibreSSL 3.1.1 has been released, and this patch (https://patchwork.kernel.org/patch/11446123/) is required to sign kernel modules using libressl.
Libressl 3.1.1 can sign them with functional parity with OpenSSL.
> ---
> Âscripts/sign-file.c | 7 ++++---
> Â1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/sign-file.c b/scripts/sign-file.c
> index fbd34b8e8f57..fd4d7c31d1bf 100644
> --- a/scripts/sign-file.c
> +++ b/scripts/sign-file.c
> @@ -41,9 +41,10 @@
> Â * signing with anything other than SHA1 - so we're stuck with that if such is
> Â * the case.
> Â */
> -#if defined(LIBRESSL_VERSION_NUMBER) || \
> -ÂÂÂ OPENSSL_VERSION_NUMBER < 0x10000000L || \
> -ÂÂÂ defined(OPENSSL_NO_CMS)
> +#if defined(OPENSSL_NO_CMS) || \
> +ÂÂÂ ( defined(LIBRESSL_VERSION_NUMBER) \
> +ÂÂÂ && (LIBRESSL_VERSION_NUMBER < 0x3010000fL) ) || \
> +ÂÂÂ OPENSSL_VERSION_NUMBER < 0x10000000L
> Â#define USE_PKCS7
> Â#endif
> Â#ifndef USE_PKCS7