comparison Core/Pkcs11.cpp @ 2145:39f4207727db

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Nov 2016 17:09:29 +0100
parents dd609a99d39a
children a3a65de1840f
comparison
equal deleted inserted replaced
2144:a979ded1dbb1 2145:39f4207727db
31 31
32 32
33 #include "PrecompiledHeaders.h" 33 #include "PrecompiledHeaders.h"
34 #include "Pkcs11.h" 34 #include "Pkcs11.h"
35 35
36 #if ORTHANC_ENABLE_PKCS11 != 1 || ORTHANC_ENABLE_SSL != 1
37 # error This file cannot be used if OpenSSL or PKCS#11 support is disabled
38 #endif
39
40 36
41 #if defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_EC) || defined(OPENSSL_NO_ECDSA) || defined(OPENSSL_NO_ECDH) 37 #if defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_EC) || defined(OPENSSL_NO_ECDSA) || defined(OPENSSL_NO_ECDH)
42 # error OpenSSL was compiled without support for RSA, EC, ECDSA or ECDH 38 # error OpenSSL was compiled without support for RSA, EC, ECDSA or ECDH
43 #endif 39 #endif
44 40
45 41
46 #include "Logging.h" 42 #include "Logging.h"
47 #include "OrthancException.h" 43 #include "OrthancException.h"
48 #include "Toolbox.h" 44 #include "SystemToolbox.h"
49 45
50 extern "C" 46 extern "C"
51 { 47 {
52 #include <libp11/engine.h> // This is P11's "engine.h" 48 # include <libp11/engine.h> // This is P11's "engine.h"
53 #include <libp11/libp11.h> 49 # include <libp11/libp11.h>
54 } 50 }
55 51
56 #include <openssl/engine.h> 52 #include <openssl/engine.h>
57 53
58 54
259 LOG(ERROR) << "The PKCS#11 engine has already been initialized"; 255 LOG(ERROR) << "The PKCS#11 engine has already been initialized";
260 throw OrthancException(ErrorCode_BadSequenceOfCalls); 256 throw OrthancException(ErrorCode_BadSequenceOfCalls);
261 } 257 }
262 258
263 if (module.empty() || 259 if (module.empty() ||
264 !Toolbox::IsRegularFile(module)) 260 !SystemToolbox::IsRegularFile(module))
265 { 261 {
266 LOG(ERROR) << "The PKCS#11 module must be a path to one shared library (DLL or .so)"; 262 LOG(ERROR) << "The PKCS#11 module must be a path to one shared library (DLL or .so)";
267 throw OrthancException(ErrorCode_InexistentFile); 263 throw OrthancException(ErrorCode_InexistentFile);
268 } 264 }
269 265