mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-22 04:17:44 +00:00
Optimize C_GetAttributeValues: remove not needed call.
This commit is contained in:
parent
73e7ea8b6d
commit
6b9c47112b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=272609
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= iaikPkcs11Wrapper
|
||||
PORTVERSION= 1.2.17
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= security java devel
|
||||
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
||||
MASTER_SITE_SUBDIR= ale
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user