From patchwork Mon Jul 19 16:18:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Chan X-Patchwork-Id: 1507124 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GT6VV10Npz9s5R for ; Tue, 20 Jul 2021 02:19:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA0E7829F9; Mon, 19 Jul 2021 18:19:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=lab126.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id BEF3682BB2; Mon, 19 Jul 2021 18:19:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 93E80829E7 for ; Mon, 19 Jul 2021 18:18:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=lab126.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=8278c2da9=hoiho@lab126.com X-IronPort-AV: E=Sophos;i="5.84,252,1620691200"; d="scan'208";a="126373629" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP; 19 Jul 2021 16:18:56 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2b-4ff6265a.us-west-2.amazon.com (Postfix) with ESMTPS id 13FB7A18C2; Mon, 19 Jul 2021 16:18:56 +0000 (UTC) Received: from EX13D12UWA001.ant.amazon.com (10.43.160.163) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 19 Jul 2021 16:18:55 +0000 Received: from [192.168.5.231] (10.43.161.199) by EX13D12UWA001.ant.amazon.com (10.43.160.163) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 19 Jul 2021 16:18:55 +0000 From: "Chan, Donald" To: CC: Alexandru Gagniuc , Simon Glass Subject: [PATCH] lib: rsa: rsa-sign: Minor bug in debug message Date: Mon, 19 Jul 2021 09:18:54 -0700 X-Mailer: MailMate Trial (1.13.2r5673) Message-ID: <38BA5B1F-8D89-4490-91BC-97F6D269872F@lab126.com> MIME-Version: 1.0 X-Originating-IP: [10.43.161.199] X-ClientProxiedBy: EX13D05UWB001.ant.amazon.com (10.43.161.181) To EX13D12UWA001.ant.amazon.com (10.43.160.163) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean *sig_size isn't set until later so use the correct variables. Signed-off-by: Donald Chan Reviewed-by: Simon Glass --- lib/rsa/rsa-sign.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) *sig_size = size; diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c index f70f352311..5b85d61a13 100644 --- a/lib/rsa/rsa-sign.c +++ b/lib/rsa/rsa-sign.c @@ -482,7 +482,7 @@ static int rsa_sign_with_key(EVP_PKEY *pkey, struct padding_algo *padding_algo, #endif EVP_MD_CTX_destroy(context); - debug("Got signature: %d bytes, expected %zu\n", *sig_size, size); + debug("Got signature: %zu bytes, expected %d\n", size, EVP_PKEY_size(pkey)); *sigp = sig;