Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4741058pxb; Tue, 5 Oct 2021 09:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvW+w7xEx4eWXi2YpCr7dRwN1oQciq7pKSB/PlDzLURgPfwgEj1dMbtniDzCpBlRMrxEqX X-Received: by 2002:a17:902:be0f:b0:13a:19b6:6870 with SMTP id r15-20020a170902be0f00b0013a19b66870mr6221968pls.64.1633450869670; Tue, 05 Oct 2021 09:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633450869; cv=none; d=google.com; s=arc-20160816; b=YC1JkBsXexjyM9JGh4PKL/5djJs+r0xXorxOe6KHUjdk3rNN0Pda2c34+ZLhJfsRVe rgcMhKLpHPiUuKL575ua5FahH6Y03SmYTL3dd+PQB5omE22BHj/nBdJqQFPy0z8ikoB1 EIHvIQgXg3iJi9NkBTZoGlLrDZqRNtw3e1GRDR0ZlysVr8Oei4xQHZO37fzKU8agtHGT 6uBFj3RcWVDtZWPniz5JxzHR+9QUWu33E8kGn0LkEPHvPmhsSzRIx392JjMf5IhcE5io uymJdrxazVF8CycJircENL953fMr+ZgfNJq01DZIl5DKDz9M/16IUtf6iz3E3HPt4wjp 3/zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OrrCwF+kFDwdSmZPhicXDostoj2EDmJYm/81LXTAGoo=; b=eWkyz3iwmqbr3wayIPb5RQQs7tx/T+HXYsXT8Wq/qBhTIkAlR42byRPAlOLH1It6op JbaNUpP9H0RxznWdw5/DnowwTofN/vndiVe3d7xhAOVY8fvU3nQOy3VGylKDVhgFHwOI EA3SSwm3JfGc1hyV7Ht/c+0aRWlq3wfTosRLn0Rcw5OXL/DddpiS2mYfsHgb//ztBVKI VchwJqUnwqQkwuwQ0JwqYYRkiiwvHuop9uzfDTGpnj2MKyg/5zKmyruT1rsz4qjZq2+Y 8JmU+3AYxwb6Rj8XmsGcpIs41Yes9DuT4RUEYVMyUvQ3BShTXOe0qo/vdqDzxKnj/1s8 5cZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YftOWF02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s36si23740016pgl.300.2021.10.05.09.20.56; Tue, 05 Oct 2021 09:21:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YftOWF02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236440AbhJEQUb (ORCPT + 99 others); Tue, 5 Oct 2021 12:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235876AbhJEQUb (ORCPT ); Tue, 5 Oct 2021 12:20:31 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 231A0C061749 for ; Tue, 5 Oct 2021 09:18:40 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id m22so32914733wrb.0 for ; Tue, 05 Oct 2021 09:18:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OrrCwF+kFDwdSmZPhicXDostoj2EDmJYm/81LXTAGoo=; b=YftOWF02yixWsn3Yl1W6mpcPerRe4dd8jeS9FCkxUkNWPrbhB/euRl6FScWNY/dGev o1JJ719GC73YAY0DqKgriMkB7oCVW04HMvef2cw3s+ypCFusqgY7AWtb+vfLdoZBXxqK qep+P/7D8LbXifiLFatuclXXsj0GDtk/Qa4f7imwP+sHDHhsNiw83v/enwZiWskToBgQ tbNxfkpILuapgxwU50MiqwddyJBjfdvY577c6oMmKtdEl6Dr3Vh1lQMqwdm5AOJmDlh7 NPZLIQTYs+VdcEjUAENpR++AfgCGl5wL5TNIUlIBCH94TtQJAYV+G3FfuL7KTdCziWkG Pr0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OrrCwF+kFDwdSmZPhicXDostoj2EDmJYm/81LXTAGoo=; b=p09Ss3FMHn58frRhkTwEG43Qv9TiQ95GPIfSLIB9M8tvDQ6OE6lg9+3+67Rv6chVuC GQ8QMZv4o4OAu8dI6J+y1bZeiH7sYNBlatQlDBSt242/emXr7qrFvSEVT5tMr7mG+ZRp aM1Sq910TEuqPX4fQddlNwLtgcUcjsbdTrw1/YhcKfuD/ZR7Yj7zwNu/lAGvYZUrQEP4 S8/xOnXmlYFdtOaSDqhyNrRTUSHbYGauaa+86KbdaSgjJ14WTJa64QA6voadK6gXsc0A RVZCUA6zE5JagqapjYSIscs5kJPNx6jb3aiHIPojB8/RYoWY7m9Y9eXtTCDSW5dRl4la s9iA== X-Gm-Message-State: AOAM5321YV2eS5AQ12sUaXfWm1gdQITs+spEFGpbDohh4BAPomQzRv9t S9+vLXQ5wsuGuZgVArPiiayGKQ== X-Received: by 2002:adf:f789:: with SMTP id q9mr22714087wrp.367.1633450718739; Tue, 05 Oct 2021 09:18:38 -0700 (PDT) Received: from localhost.localdomain ([95.148.6.175]) by smtp.gmail.com with ESMTPSA id x17sm18188856wrc.51.2021.10.05.09.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 09:18:38 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, David Howells , David Woodhouse , keyrings@vger.kernel.org, Adam Langley Subject: [PATCH 1/1] sign-file: Use OpenSSL provided define to compile out deprecated APIs Date: Tue, 5 Oct 2021 17:18:33 +0100 Message-Id: <20211005161833.1522737-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OpenSSL's ENGINE API is deprecated in OpenSSL v3.0. Use OPENSSL_NO_ENGINE to disallow its use and fall back on the BIO API. Cc: David Howells Cc: David Woodhouse Cc: keyrings@vger.kernel.org Co-developed-by: Adam Langley Signed-off-by: Lee Jones --- scripts/sign-file.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/sign-file.c b/scripts/sign-file.c index fbd34b8e8f578..fa3fa59db6669 100644 --- a/scripts/sign-file.c +++ b/scripts/sign-file.c @@ -135,7 +135,9 @@ static int pem_pw_cb(char *buf, int len, int w, void *v) static EVP_PKEY *read_private_key(const char *private_key_name) { EVP_PKEY *private_key; + BIO *b; +#ifndef OPENSSL_NO_ENGINE if (!strncmp(private_key_name, "pkcs11:", 7)) { ENGINE *e; @@ -153,17 +155,16 @@ static EVP_PKEY *read_private_key(const char *private_key_name) private_key = ENGINE_load_private_key(e, private_key_name, NULL, NULL); ERR(!private_key, "%s", private_key_name); - } else { - BIO *b; - - b = BIO_new_file(private_key_name, "rb"); - ERR(!b, "%s", private_key_name); - private_key = PEM_read_bio_PrivateKey(b, NULL, pem_pw_cb, - NULL); - ERR(!private_key, "%s", private_key_name); - BIO_free(b); + return private_key; } +#endif + b = BIO_new_file(private_key_name, "rb"); + ERR(!b, "%s", private_key_name); + private_key = PEM_read_bio_PrivateKey(b, NULL, pem_pw_cb, + NULL); + ERR(!private_key, "%s", private_key_name); + BIO_free(b); return private_key; } -- 2.33.0.800.g4c38ced690-goog