[Cryptech-Commits] [sw/pkcs11] 06/07: Set return value properly in C_CreateObject().

git at cryptech.is git at cryptech.is
Mon Jun 13 19:48:01 UTC 2016


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

sra at hactrn.net pushed a commit to branch master
in repository sw/pkcs11.

commit a7fedbfe7c5fd8c408d400a73a844c081b0f1834
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Mon Jun 13 12:51:21 2016 -0400

    Set return value properly in C_CreateObject().
---
 pkcs11.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkcs11.c b/pkcs11.c
index 1ac9326..641c032 100644
--- a/pkcs11.c
+++ b/pkcs11.c
@@ -3366,19 +3366,19 @@ CK_RV C_CreateObject(CK_SESSION_HANDLE hSession,
 
   if (*cka_class == CKO_PUBLIC_KEY && *cka_key_type == CKK_RSA &&
       !p11_object_create_rsa_public_key(session, handle, flags))
-    goto fail;
+    lose(CKR_FUNCTION_FAILED);
 
   if (*cka_class == CKO_PUBLIC_KEY && *cka_key_type == CKK_EC &&
       !p11_object_create_ec_public_key(session, handle, flags))
-    goto fail;
+    lose(CKR_FUNCTION_FAILED);
 
   if (*cka_class == CKO_PRIVATE_KEY && *cka_key_type == CKK_RSA &&
       !p11_object_create_rsa_private_key(session, handle, flags, pTemplate, ulCount))
-    goto fail;
+    lose(CKR_FUNCTION_FAILED);
 
   if (*cka_class == CKO_PRIVATE_KEY && *cka_key_type == CKK_EC &&
       !p11_object_create_ec_private_key(session, handle, flags, pTemplate, ulCount))
-    goto fail;
+    lose(CKR_FUNCTION_FAILED);
 
   if (!sql_exec("COMMIT"))
     lose(CKR_FUNCTION_FAILED);



More information about the Commits mailing list