From patchwork Wed Mar 18 21:31:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mikhail Novosyolov X-Patchwork-Id: 11446123 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1059A913 for ; Wed, 18 Mar 2020 21:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C82F20714 for ; Wed, 18 Mar 2020 21:41:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=rosalinux.ru header.i=@rosalinux.ru header.b="EFozWfUN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727190AbgCRVlv (ORCPT ); Wed, 18 Mar 2020 17:41:51 -0400 Received: from mail.rosalinux.ru ([195.19.76.54]:34312 "EHLO mail.rosalinux.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726777AbgCRVlu (ORCPT ); Wed, 18 Mar 2020 17:41:50 -0400 X-Greylist: delayed 588 seconds by postgrey-1.27 at vger.kernel.org; Wed, 18 Mar 2020 17:41:50 EDT Received: from localhost (localhost [127.0.0.1]) by mail.rosalinux.ru (Postfix) with ESMTP id 59136D6F76F95; Thu, 19 Mar 2020 00:32:01 +0300 (MSK) Received: from mail.rosalinux.ru ([127.0.0.1]) by localhost (mail.rosalinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vEBJrQ_agJiR; Thu, 19 Mar 2020 00:31:46 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.rosalinux.ru (Postfix) with ESMTP id ED54BD68A0074; Thu, 19 Mar 2020 00:31:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rosalinux.ru ED54BD68A0074 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rosalinux.ru; s=A1AAD92A-9767-11E6-A27F-AC75C9F78EF4; t=1584567106; bh=OLZmYDkiQvs3u1GvR5c0MQQi01rmIE2Bh3XgwpIg5yA=; h=To:From:Message-ID:Date:MIME-Version; b=EFozWfUN30D/226h7IZAyPnKysjfb5/TW6iRx1ekEq1nmPTVDV7/ZMt40AFGgNSVr q1BSkzqnB2coScnRPnWDajGI3Bu+YLKHuAg0EBFQ40SZV7bWXmCuzAEbXMYfH9yrmM BPHCmhi+EqX6Ibk6cQtABx4Wr2vorrtAppFyItvaK939ogUJjXg5ZB4QwWGldAcvdH 1MLUV54Y9AhWlgA0xYPJtJvRU9wLdEJsEe0BDF8+mLUMFNcxqKIve8iumQF7cP5wyg iU1ZmmTfd6sQ8H8juqOM/C3tIDjEaycAejTL5PP1f+gh6iUBzhEoUS9EClEe80B3C3 5rJnFV+k2MCtA== X-Virus-Scanned: amavisd-new at rosalinux.ru Received: from mail.rosalinux.ru ([127.0.0.1]) by localhost (mail.rosalinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Um9Klry3hGBe; Thu, 19 Mar 2020 00:31:45 +0300 (MSK) Received: from [192.168.1.173] (broadband-90-154-70-24.ip.moscow.rt.ru [90.154.70.24]) by mail.rosalinux.ru (Postfix) with ESMTPSA id BC344D688A072; Thu, 19 Mar 2020 00:31:45 +0300 (MSK) To: keyrings@vger.kernel.org, linux-kernel@vger.kernel.org, Mikhail Novosyolov From: Mikhail Novosyolov Subject: sign-file: full functionality with modern LibreSSL Message-ID: Date: Thu, 19 Mar 2020 00:31:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Language: ru-RU Sender: keyrings-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: keyrings@vger.kernel.org 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 ---  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