From 853d500199eadc04801616915632860c9eb10663 Mon Sep 17 00:00:00 2001 From: Daniel Wyatt Date: Mon, 27 May 2019 19:55:27 -0400 Subject: Fix PKCS#11 C_Sign output size. --- src/lib/prov/pkcs11/p11.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/prov/pkcs11/p11.h b/src/lib/prov/pkcs11/p11.h index 4cf1f0071..d941cd939 100644 --- a/src/lib/prov/pkcs11/p11.h +++ b/src/lib/prov/pkcs11/p11.h @@ -2199,12 +2199,17 @@ class BOTAN_PUBLIC_API(2,0) LowLevel } signature.resize(signature_size); - return C_Sign(session, + if (!C_Sign(session, const_cast(data.data()), static_cast(data.size()), signature.data(), &signature_size, - return_value); + return_value)) + { + return false; + } + signature.resize(signature_size); + return true; } /** -- cgit v1.2.3