some details: user opensc-pkcs11.so by default; catch all exceptions on load
This commit is contained in:
@@ -12,7 +12,7 @@ make clean && \
|
||||
LDFLAGS="-L/opt/local/i586-mingw32msvc/lib" \
|
||||
CPPFLAGS="-I/opt/local/i586-mingw32msvc/include" \
|
||||
./configure \
|
||||
--prefix=/opt/local/ig586-mingw32msvc \
|
||||
--prefix=/opt/local/i586-mingw32msvc \
|
||||
--build=x86_64 \
|
||||
--host=i586-mingw32msvc && \
|
||||
make && \
|
||||
|
@@ -166,7 +166,7 @@ namespace cryptoki {
|
||||
}
|
||||
}
|
||||
|
||||
Init::Init(const std::string& library, bool exc):
|
||||
Init::Init(const std::string& library, bool exc) try:
|
||||
_exc(exc), _res(CKR_OK), _fn(0) {
|
||||
CRYPTOKI_LOG("library: "<<library);
|
||||
//! calls @c functionList
|
||||
@@ -176,6 +176,8 @@ namespace cryptoki {
|
||||
//! calls @c C_Initialize
|
||||
check(_fn->C_Initialize(0), //! @todo add optional argument
|
||||
CRYPTOKI_FN_LOG("C_Initialize"));
|
||||
} catch (...) {
|
||||
throw access_error(CRYPTOKI_FN_LOG("C_Initialize")+": Error in library");
|
||||
}
|
||||
|
||||
Init::operator bool() {
|
||||
|
@@ -764,7 +764,7 @@ namespace cryptoki {
|
||||
|
||||
@param library name of the shared library that supports pkcs#11
|
||||
@param exc wether exceptions should be thrown */
|
||||
Init(const std::string& library="onepin-opensc-pkcs11.so", bool exc=true);
|
||||
Init(const std::string& library="opensc-pkcs11.so", bool exc=true);
|
||||
|
||||
~Init() {
|
||||
CRYPTOKI_LOG("log");
|
||||
@@ -1940,7 +1940,7 @@ namespace cryptoki {
|
||||
else
|
||||
free(attr.pValue);
|
||||
} else if (*it==CKA_MODULUS && attr.ulValueLen==0) {
|
||||
/*! @bug This is a bug in onepin-opensc-pkcs11.so: If
|
||||
/*! @bug This is a bug in opensc-pkcs11.so: If
|
||||
@c CKA_MODULUS has a size of 0 bytes, the
|
||||
following query to @c CKA_MODULUS_BITS ends
|
||||
in a segmentation fault.
|
||||
|
Reference in New Issue
Block a user