File ocki-3.2_02_ep11-token-incorrectly-copied-the-public-key-object-.patch of Package openCryptoki.2906

From 5c1afc61d616bae28ae513aa71131e9524170369 Mon Sep 17 00:00:00 2001
From: Vineetha Pai <vpishar@us.ibm.com>
Date: Thu, 10 Sep 2015 23:57:37 -0500
Subject: [PATCH] ep11 token incorrectly copied the public key object class to
 the private key, thus both public and private keys were CKO_PUBLIC_KEY.
 Remove this code. The default attribute functions will ensure that private
 key has correct info.

Signed-off-by: Vineetha Pai <vpishar@us.ibm.com>
---
 usr/lib/pkcs11/ep11_stdll/ep11_specific.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

--- opencryptoki.orig/usr/lib/pkcs11/ep11_stdll/ep11_specific.c	2015-10-01 15:03:03.531303000 -0600
+++ opencryptoki/usr/lib/pkcs11/ep11_stdll/ep11_specific.c	2015-10-01 15:09:01.104094000 -0600
@@ -2765,37 +2765,6 @@ CK_RV token_specific_generate_key_pair(S
 			private_key_obj->name, public_key_obj, private_key_obj);
 	}
 
-	/* copy CKA_CLASS, CKA_KEY_TYPE to private template */
-	if (template_attribute_find(public_key_obj->template, CKA_CLASS, &attr)) {
-		rc = build_attribute(attr->type, attr->pValue,
-					attr->ulValueLen, &n_attr);
-		if (rc != CKR_OK) {
-			EP11TOK_ELOG(1,"build_attribute failed with rc=0x%lx",rc);
-			goto error;
-		}
-
-		rc = template_update_attribute(private_key_obj->template, n_attr);
-		if (rc != CKR_OK) {
-			EP11TOK_ELOG(1,"template_update_attribute failed with rc=0x%lx",rc);
-			goto error;
-		}
-	}
-
-	if (template_attribute_find(public_key_obj->template, CKA_KEY_TYPE, &attr)) {
-		rc = build_attribute(attr->type, attr->pValue,
-					attr->ulValueLen, &n_attr);
-		if (rc != CKR_OK) {
-			EP11TOK_ELOG(1,"build_attribute failed with rc=0x%lx",rc);
-			goto error;
-		}
-
-		rc = template_update_attribute(private_key_obj->template, n_attr);
-		if (rc != CKR_OK) {
-			EP11TOK_ELOG(1,"template_update_attribute failed with rc=0x%lx",rc);
-			goto error;
-		}
-	}
-
 	/* Keys should be fully constructed,
 	 * assign object handles and store keys.
 	 */
openSUSE Build Service is sponsored by