[pkg-opensc-commit] [engine-pkcs11] 39/152: properly clean pin storage. full size as it might be not null-terminated.

Eric Dorland eric at moszumanska.debian.org
Mon Oct 19 03:11:12 UTC 2015


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

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

commit 5b2711ac39b8d585c51b1395d4bc76b31d1bfb25
Author: Andreas Jellinghaus <andreas at ionisiert.de>
Date:   Fri Jun 29 13:47:03 2007 +0000

    properly clean pin storage. full size as it might be not null-terminated.
---
 src/engine_pkcs11.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/engine_pkcs11.c b/src/engine_pkcs11.c
index fc21c26..bdf8093 100644
--- a/src/engine_pkcs11.c
+++ b/src/engine_pkcs11.c
@@ -130,7 +130,7 @@ int pkcs11_finish(ENGINE * engine)
 		ctx = NULL;
 	}
 	if (pin != NULL) {
-		OPENSSL_cleanse(pin, strlen(pin));
+		OPENSSL_cleanse(pin, sizeof(pin));
 		free(pin);
 		pin = NULL;
 	}
@@ -616,7 +616,7 @@ EVP_PKEY *pkcs11_load_key(ENGINE * e, const char *s_slot_key_id,
                 if (PKCS11_login(slot, 0, pin)) {
                         /* Login failed, so free the PIN if present */
                         if(pin != NULL) {
-				OPENSSL_cleanse(pin, strlen(pin));
+				OPENSSL_cleanse(pin, sizeof(pin));
                                 free(pin);
                                 pin = NULL;
                         }

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



More information about the pkg-opensc-commit mailing list