summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipap11helper/library.c10
-rw-r--r--ipapython/ipap11helper/library.h2
-rw-r--r--ipapython/ipap11helper/p11helper.c3
-rw-r--r--ipapython/ipap11helper/setup.py1
4 files changed, 6 insertions, 10 deletions
diff --git a/ipapython/ipap11helper/library.c b/ipapython/ipap11helper/library.c
index 51e24ebc2..fc4c1e41c 100644
--- a/ipapython/ipap11helper/library.c
+++ b/ipapython/ipap11helper/library.c
@@ -44,7 +44,7 @@
#include <dlfcn.h>
// Load the PKCS#11 library
-CK_C_GetFunctionList loadLibrary(char* module, void** moduleHandle)
+CK_C_GetFunctionList loadLibrary(const char* module, void** moduleHandle)
{
CK_C_GetFunctionList pGetFunctionList = NULL;
@@ -54,13 +54,9 @@ CK_C_GetFunctionList loadLibrary(char* module, void** moduleHandle)
if (module)
{
pDynLib = dlopen(module, RTLD_NOW | RTLD_LOCAL);
+ } else {
+ return NULL;
}
- /*
- else
- {
- pDynLib = dlopen(DEFAULT_PKCS11_LIB, RTLD_NOW | RTLD_LOCAL);
- }
- */
if (pDynLib == NULL)
{
diff --git a/ipapython/ipap11helper/library.h b/ipapython/ipap11helper/library.h
index 2ceb9e375..afcbd9fd2 100644
--- a/ipapython/ipap11helper/library.h
+++ b/ipapython/ipap11helper/library.h
@@ -42,7 +42,7 @@
#include <p11-kit/pkcs11.h>
-CK_C_GetFunctionList loadLibrary(char* module, void** moduleHandle);
+CK_C_GetFunctionList loadLibrary(const char* module, void** moduleHandle);
void unloadLibrary(void* moduleHandle);
#endif // !_SOFTHSM_V2_BIN_LIBRARY_H
diff --git a/ipapython/ipap11helper/p11helper.c b/ipapython/ipap11helper/p11helper.c
index 038c26c45..c1d100772 100644
--- a/ipapython/ipap11helper/p11helper.c
+++ b/ipapython/ipap11helper/p11helper.c
@@ -1659,10 +1659,11 @@ P11_Helper_set_attribute(P11_Helper* self, PyObject *args, PyObject *kwds) {
goto final;
}
if (PyString_AsStringAndSize(value, (char **) &attribute.pValue,
- &attribute.ulValueLen) == -1) {
+ &len) == -1) {
ret = NULL;
goto final;
}
+ attribute.ulValueLen = len;
break;
case CKA_LABEL:
if (!PyUnicode_Check(value)) {
diff --git a/ipapython/ipap11helper/setup.py b/ipapython/ipap11helper/setup.py
index 338cdcb2e..e8e824a33 100644
--- a/ipapython/ipap11helper/setup.py
+++ b/ipapython/ipap11helper/setup.py
@@ -23,7 +23,6 @@ module = Extension('_ipap11helper',
'-ggdb3',
'-O2',
'-W',
- '-pedantic',
'-Wall',
'-Wno-unused-parameter',
'-Wbad-function-cast',