aboutsummaryrefslogtreecommitdiff
path: root/security/iaikpkcs11wrapper/files
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2011-04-12 13:52:54 +0000
committerAlex Dupre <ale@FreeBSD.org>2011-04-12 13:52:54 +0000
commit6b9c47112bdbceebeafcdbbb6cfdb691683cf87f (patch)
treecbca5f691b4e46283e493443f628fc1289463277 /security/iaikpkcs11wrapper/files
parent73e7ea8b6d7f45c4beb6e039842f57ab74583674 (diff)
downloadports-6b9c47112bdbceebeafcdbbb6cfdb691683cf87f.tar.gz
ports-6b9c47112bdbceebeafcdbbb6cfdb691683cf87f.zip
Optimize C_GetAttributeValues: remove not needed call.
Notes
Notes: svn path=/head/; revision=272609
Diffstat (limited to 'security/iaikpkcs11wrapper/files')
-rw-r--r--security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c b/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c
index 7e7b88b06c77..df010e4cd5d1 100644
--- a/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c
+++ b/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c
@@ -1,6 +1,34 @@
---- ../../src/pkcs11wrapper.c.orig 2008-01-17 12:49:35.000000000 +0100
-+++ ../../src/pkcs11wrapper.c 2008-01-17 12:53:51.000000000 +0100
-@@ -3965,11 +3965,12 @@
+--- ../../src/pkcs11wrapper.c.orig 2008-07-24 12:20:36.000000000 +0200
++++ ../../src/pkcs11wrapper.c 2011-04-12 10:53:02.000000000 +0200
+@@ -1134,6 +1134,7 @@
+ jobject jAttribute;
+ CK_RV rv;
+ CK_ULONG error = 0;
++ CK_BBOOL array = FALSE;
+ ModuleData *moduleData;
+ CK_FUNCTION_LIST_PTR ckpFunctions;
+ moduleData = getModuleEntry(env, obj);
+@@ -1188,9 +1189,11 @@
+ for (j=0; j<length; j++){
+ ckAttributeArray[j].pValue = NULL_PTR;
+ }
++ array = TRUE;
+ }
+ }
+
++ if (array == TRUE) {
+ // get ulValueLen of the attributes of a CKF_ARRAY_ATTRIBUTE if present
+ rv = (*ckpFunctions->C_GetAttributeValue)(ckSessionHandle, ckObjectHandle, ckpAttributes, ckAttributesLength);
+ if(ckAssertReturnValueOK(env, rv) != CK_ASSERT_OK) {
+@@ -1202,6 +1205,7 @@
+ free(ckpAttributes);
+ return ;
+ }
++ }
+
+ /* now, the ulValueLength field of each attribute should hold the exact buffer length needed
+ * to allocate the needed buffers accordingly
+@@ -4111,11 +4115,12 @@
jpTemp = (jchar*) malloc((*ckpLength) * sizeof(jchar));
if (jpTemp == NULL) { *ckpArray = NULL_PTR; throwOutOfMemoryError(env); return 1; }
(*env)->GetCharArrayRegion(env, jArray, 0, *ckpLength, jpTemp);