From 2608f90fa1db419a346837fa4f044986233e91c9 Mon Sep 17 00:00:00 2001 From: Yosuke Shimizu Date: Fri, 17 Apr 2026 17:37:18 +0900 Subject: [PATCH] Fix FingerprintKey --- apps/wolfssh/common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/wolfssh/common.c b/apps/wolfssh/common.c index a4e0b1974..c93a5aa8c 100644 --- a/apps/wolfssh/common.c +++ b/apps/wolfssh/common.c @@ -214,10 +214,12 @@ static int FingerprintKey(const byte* pubKey, word32 pubKeySz, char* out) int ret; ret = wc_InitSha256(&sha); - if (ret == 0) + if (ret == 0) { ret = wc_Sha256Update(&sha, pubKey, pubKeySz); - if (ret == 0) - ret = wc_Sha256Final(&sha, digest); + if (ret == 0) + ret = wc_Sha256Final(&sha, digest); + wc_Sha256Free(&sha); + } if (ret == 0) ret = Base64_Encode_NoNl(digest, sizeof(digest), (byte*)fp, &fpSz);