From 6d59ace988fdc1bb9f52ab70e21af0d40380c3f3 Mon Sep 17 00:00:00 2001
From: "Chan, Donald" <hoiho@lab126.com>
Date: Mon, 19 Jul 2021 09:18:54 -0700
Subject: [PATCH] lib: rsa: rsa-sign: Minor bug in debug message

*sig_size isn't set until later so use the correct variables.

Signed-off-by: Donald Chan <hoiho@lab126.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 lib/rsa/rsa-sign.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/rsa/rsa-sign.c b/lib/rsa/rsa-sign.c
index f4ed11e74a..c64deac31f 100644
--- a/lib/rsa/rsa-sign.c
+++ b/lib/rsa/rsa-sign.c
@@ -473,7 +473,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;
 	*sig_size = size;
 
-- 
2.39.5