From 0ba6e74bec99c67c358f9fdb461c37c368479e06 Mon Sep 17 00:00:00 2001 From: Will Cosgrove Date: Wed, 26 Oct 2022 16:48:52 -0700 Subject: [PATCH] Fix regression with rsa_sha2_verify #758 (#763) Fixes comparison with the result value coming from `mbedtls_rsa_pkcs1_verify`. Success is 0, not 1. --- src/mbedtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mbedtls.c b/src/mbedtls.c index aba2d512..6326981d 100644 --- a/src/mbedtls.c +++ b/src/mbedtls.c @@ -541,7 +541,7 @@ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx, #endif free(hash); - return (ret == 1) ? 0 : -1; + return (ret == 0) ? 0 : -1; } int