[pkg-opensc-commit] [pkcs11-helper] 196/253: Do not retry if CKR_BUFFER_TOO_SMALL and none NULL target.

Eric Dorland eric at moszumanska.debian.org
Fri Jan 6 23:39:19 UTC 2017


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository pkcs11-helper.

commit f8360b712af6cb34fe6a8ae8badd2d3cebbe850d
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date:   Fri Aug 12 19:49:56 2011 +0000

    Do not retry if CKR_BUFFER_TOO_SMALL and none NULL target.
---
 ChangeLog                 |  4 ++++
 lib/pkcs11h-certificate.c | 13 +++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 03aa6e0..3b8eeee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@ Copyright (c) 2005-2011 Alon Bar-Lev <alon.barlev at gmail.com>
 
 $Id$
 
+????-??-?? - Version 1.09
+
+ * Do not retry if CKR_BUFFER_TOO_SMALL and none NULL target.
+
 2011-02-23 - Version 1.08
 
  * Do not attempt to logout if uninitialized, thanks to Jan Just Keijser.
diff --git a/lib/pkcs11h-certificate.c b/lib/pkcs11h-certificate.c
index b8995c6..c3efeb7 100644
--- a/lib/pkcs11h-certificate.c
+++ b/lib/pkcs11h-certificate.c
@@ -961,16 +961,17 @@ __pkcs11h_certificate_doPrivateOperation (
 			rv
 		);
 
+		if (rv == CKR_BUFFER_TOO_SMALL && op != __pkcs11h_private_op_unwrap) {
+			certificate->operation_active = TRUE;
+		}
+
 		if (target != NULL) {
 			if (rv != CKR_OK) {
 				goto retry;
 			}
 		}
 		else {
-			if (
-				rv == CKR_OK ||
-				rv == CKR_BUFFER_TOO_SMALL
-			) {
+			if (rv == CKR_OK) {
 				if (op != __pkcs11h_private_op_unwrap) {
 					certificate->operation_active = TRUE;
 				}
@@ -994,6 +995,10 @@ __pkcs11h_certificate_doPrivateOperation (
 		}
 
 		if (!op_succeed) {
+			if (rv == CKR_BUFFER_TOO_SMALL) {
+				goto cleanup;
+			}
+
 			/*
 			 * OpenSC workaround
 			 * It still allows C_FindObjectsInit when

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/pkcs11-helper.git



More information about the pkg-opensc-commit mailing list