# HG changeset patch # User Sebastien Jodogne # Date 1478707769 -3600 # Node ID 39f4207727db0093381cf33ea80a7b0feba0d98b # Parent a979ded1dbb169f4b1c2d2c881ed64fbd699d84e fix diff -r a979ded1dbb1 -r 39f4207727db Core/Pkcs11.cpp --- a/Core/Pkcs11.cpp Wed Nov 09 16:57:19 2016 +0100 +++ b/Core/Pkcs11.cpp Wed Nov 09 17:09:29 2016 +0100 @@ -33,10 +33,6 @@ #include "PrecompiledHeaders.h" #include "Pkcs11.h" -#if ORTHANC_ENABLE_PKCS11 != 1 || ORTHANC_ENABLE_SSL != 1 -# error This file cannot be used if OpenSSL or PKCS#11 support is disabled -#endif - #if defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_EC) || defined(OPENSSL_NO_ECDSA) || defined(OPENSSL_NO_ECDH) # error OpenSSL was compiled without support for RSA, EC, ECDSA or ECDH @@ -45,12 +41,12 @@ #include "Logging.h" #include "OrthancException.h" -#include "Toolbox.h" +#include "SystemToolbox.h" extern "C" { -#include // This is P11's "engine.h" -#include +# include // This is P11's "engine.h" +# include } #include @@ -261,7 +257,7 @@ } if (module.empty() || - !Toolbox::IsRegularFile(module)) + !SystemToolbox::IsRegularFile(module)) { LOG(ERROR) << "The PKCS#11 module must be a path to one shared library (DLL or .so)"; throw OrthancException(ErrorCode_InexistentFile); diff -r a979ded1dbb1 -r 39f4207727db Core/Pkcs11.h --- a/Core/Pkcs11.h Wed Nov 09 16:57:19 2016 +0100 +++ b/Core/Pkcs11.h Wed Nov 09 17:09:29 2016 +0100 @@ -32,6 +32,10 @@ #pragma once +#if !defined(ORTHANC_SANDBOXED) +# error The macro ORTHANC_SANDBOXED must be defined +#endif + #if !defined(ORTHANC_ENABLE_PKCS11) # error The macro ORTHANC_ENABLE_PKCS11 must be defined #endif @@ -40,6 +44,10 @@ # error The macro ORTHANC_ENABLE_SSL must be defined #endif +#if ORTHANC_SANDBOXED == 1 +# error This file cannot be used in sandboxed environments +#endif + #if ORTHANC_ENABLE_PKCS11 != 1 || ORTHANC_ENABLE_SSL != 1 # error This file cannot be used if OpenSSL or PKCS#11 support is disabled #endif diff -r a979ded1dbb1 -r 39f4207727db Core/WebServiceParameters.cpp --- a/Core/WebServiceParameters.cpp Wed Nov 09 16:57:19 2016 +0100 +++ b/Core/WebServiceParameters.cpp Wed Nov 09 17:09:29 2016 +0100 @@ -34,10 +34,13 @@ #include "WebServiceParameters.h" #include "../Core/Logging.h" -#include "../Core/SystemToolbox.h" #include "../Core/Toolbox.h" #include "../Core/OrthancException.h" +#if ORTHANC_SANDBOXED == 0 +# include "../Core/SystemToolbox.h" +#endif + #include namespace Orthanc @@ -58,6 +61,7 @@ } +#if ORTHANC_SANDBOXED == 0 void WebServiceParameters::SetClientCertificate(const std::string& certificateFile, const std::string& certificateKeyFile, const std::string& certificateKeyPassword) @@ -85,6 +89,7 @@ certificateKeyFile_ = certificateKeyFile; certificateKeyPassword_ = certificateKeyPassword; } +#endif static void AddTrailingSlash(std::string& url) diff -r a979ded1dbb1 -r 39f4207727db Core/WebServiceParameters.h --- a/Core/WebServiceParameters.h Wed Nov 09 16:57:19 2016 +0100 +++ b/Core/WebServiceParameters.h Wed Nov 09 17:09:29 2016 +0100 @@ -32,6 +32,10 @@ #pragma once +#if !defined(ORTHANC_SANDBOXED) +# error The macro ORTHANC_SANDBOXED must be defined +#endif + #include #include @@ -88,9 +92,11 @@ void ClearClientCertificate(); +#if ORTHANC_SANDBOXED == 0 void SetClientCertificate(const std::string& certificateFile, const std::string& certificateKeyFile, const std::string& certificateKeyPassword); +#endif const std::string& GetCertificateFile() const {