some details: user opensc-pkcs11.so by default; catch all exceptions on load

master
Marc Wäckerlin 15 years ago
parent f2b8078cb1
commit 234bb55b7b
  1. 2
      install-64-and-32-bit-linux.sh
  2. 4
      src/cryptoki.cxx
  3. 4
      src/cryptoki.hxx

@ -12,7 +12,7 @@ make clean && \
LDFLAGS="-L/opt/local/i586-mingw32msvc/lib" \ LDFLAGS="-L/opt/local/i586-mingw32msvc/lib" \
CPPFLAGS="-I/opt/local/i586-mingw32msvc/include" \ CPPFLAGS="-I/opt/local/i586-mingw32msvc/include" \
./configure \ ./configure \
--prefix=/opt/local/ig586-mingw32msvc \ --prefix=/opt/local/i586-mingw32msvc \
--build=x86_64 \ --build=x86_64 \
--host=i586-mingw32msvc && \ --host=i586-mingw32msvc && \
make && \ 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) { _exc(exc), _res(CKR_OK), _fn(0) {
CRYPTOKI_LOG("library: "<<library); CRYPTOKI_LOG("library: "<<library);
//! calls @c functionList //! calls @c functionList
@ -176,6 +176,8 @@ namespace cryptoki {
//! calls @c C_Initialize //! calls @c C_Initialize
check(_fn->C_Initialize(0), //! @todo add optional argument check(_fn->C_Initialize(0), //! @todo add optional argument
CRYPTOKI_FN_LOG("C_Initialize")); CRYPTOKI_FN_LOG("C_Initialize"));
} catch (...) {
throw access_error(CRYPTOKI_FN_LOG("C_Initialize")+": Error in library");
} }
Init::operator bool() { Init::operator bool() {

@ -764,7 +764,7 @@ namespace cryptoki {
@param library name of the shared library that supports pkcs#11 @param library name of the shared library that supports pkcs#11
@param exc wether exceptions should be thrown */ @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() { ~Init() {
CRYPTOKI_LOG("log"); CRYPTOKI_LOG("log");
@ -1940,7 +1940,7 @@ namespace cryptoki {
else else
free(attr.pValue); free(attr.pValue);
} else if (*it==CKA_MODULUS && attr.ulValueLen==0) { } 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 @c CKA_MODULUS has a size of 0 bytes, the
following query to @c CKA_MODULUS_BITS ends following query to @c CKA_MODULUS_BITS ends
in a segmentation fault. in a segmentation fault.

Loading…
Cancel
Save