From 7ae7b018ccf7760013f368fcb83aad9ecd8982a8 Mon Sep 17 00:00:00 2001 From: Mathieu Arnold Date: Mon, 20 Jun 2016 16:23:28 +0000 Subject: With the power of USES=dos2unix, get rid of most patches and files with CRLF. While there, run make makepatch, rename patches to use the new scheme, and various fixes. With hat: portmgr Sponsored by: Absolight --- .../files/patch-native_src_pkcs11wrapper.c | 88 +++++++++++----------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c') diff --git a/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c b/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c index bbf6cb1dc775..ae78b05f0565 100644 --- a/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c +++ b/security/iaikpkcs11wrapper/files/patch-native_src_pkcs11wrapper.c @@ -1,44 +1,44 @@ ---- ../../common/pkcs11wrapper.c.orig 2011-11-03 12:15:18.000000000 +0100 -+++ ../../common/pkcs11wrapper.c 2011-11-13 21:55:57.000000000 +0100 -@@ -1258,6 +1258,7 @@ - jobject jAttribute; - CK_RV rv; - CK_ULONG error = 0; -+ CK_BBOOL array = FALSE; - ModuleData *moduleData; - CK_FUNCTION_LIST_PTR ckpFunctions; - -@@ -1328,9 +1329,11 @@ - for (j=0; jC_GetAttributeValue)(ckSessionHandle, ckObjectHandle, ckpAttributes, ckAttributesLength); - if(ckAssertReturnValueOK(env, rv, __FUNCTION__) != CK_ASSERT_OK) { -@@ -1343,6 +1346,7 @@ - TRACE0(tag_call, __FUNCTION__, "exiting "); - return ; - } -+ } - - /* now, the ulValueLength field of each attribute should hold the exact buffer length needed - * to allocate the needed buffers accordingly -@@ -4474,11 +4478,12 @@ - jpTemp = (jchar*) malloc((*ckpLength) * sizeof(jchar)); - if (jpTemp == NULL && (*ckpLength)!=0) { *ckpArray = NULL_PTR; throwOutOfMemoryError(env); return 1; } - (*env)->GetCharArrayRegion(env, jArray, 0, *ckpLength, jpTemp); -- *ckpArray = (CK_UTF8CHAR_PTR) malloc (*ckpLength * sizeof(CK_UTF8CHAR)); -+ *ckpArray = (CK_UTF8CHAR_PTR) malloc ((*ckpLength + 1) * sizeof(CK_UTF8CHAR)); - if (*ckpArray == NULL && (*ckpLength)!=0) { free(jpTemp); throwOutOfMemoryError(env); return 2; } - for (i=0; i<(*ckpLength); i++) { - (*ckpArray)[i] = jCharToCKUTF8Char(jpTemp[i]); - } -+ (*ckpArray)[*ckpLength] = NULL_PTR; - free(jpTemp); - return 0; - } +--- ../../common/pkcs11wrapper.c.orig 2016-06-20 15:16:34 UTC ++++ ../../common/pkcs11wrapper.c +@@ -1258,6 +1258,7 @@ JNIEXPORT void JNICALL Java_iaik_pkcs_pk + jobject jAttribute; + CK_RV rv; + CK_ULONG error = 0; ++ CK_BBOOL array = FALSE; + ModuleData *moduleData; + CK_FUNCTION_LIST_PTR ckpFunctions; + +@@ -1328,9 +1329,11 @@ JNIEXPORT void JNICALL Java_iaik_pkcs_pk + for (j=0; jC_GetAttributeValue)(ckSessionHandle, ckObjectHandle, ckpAttributes, ckAttributesLength); + if(ckAssertReturnValueOK(env, rv, __FUNCTION__) != CK_ASSERT_OK) { +@@ -1343,6 +1346,7 @@ JNIEXPORT void JNICALL Java_iaik_pkcs_pk + TRACE0(tag_call, __FUNCTION__, "exiting "); + return ; + } ++ } + + /* now, the ulValueLength field of each attribute should hold the exact buffer length needed + * to allocate the needed buffers accordingly +@@ -4474,11 +4478,12 @@ int jCharArrayToCKUTF8CharArray(JNIEnv * + jpTemp = (jchar*) malloc((*ckpLength) * sizeof(jchar)); + if (jpTemp == NULL && (*ckpLength)!=0) { *ckpArray = NULL_PTR; throwOutOfMemoryError(env); return 1; } + (*env)->GetCharArrayRegion(env, jArray, 0, *ckpLength, jpTemp); +- *ckpArray = (CK_UTF8CHAR_PTR) malloc (*ckpLength * sizeof(CK_UTF8CHAR)); ++ *ckpArray = (CK_UTF8CHAR_PTR) malloc ((*ckpLength + 1) * sizeof(CK_UTF8CHAR)); + if (*ckpArray == NULL && (*ckpLength)!=0) { free(jpTemp); throwOutOfMemoryError(env); return 2; } + for (i=0; i<(*ckpLength); i++) { + (*ckpArray)[i] = jCharToCKUTF8Char(jpTemp[i]); + } ++ (*ckpArray)[*ckpLength] = NULL_PTR; + free(jpTemp); + return 0; + } -- cgit v1.2.3