summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-10-06 10:54:11 +0200
committerJan Holesovsky <kendy@collabora.com>2017-10-06 11:39:29 +0200
commit92aca7f2dd35249ff1f82bf4947932582e88b534 (patch)
tree5c8549060ff7e8cd7c1651505aeed1fa4aa576f8 /common
parentMore information about the support key state. (diff)
downloadonline-92aca7f2dd35249ff1f82bf4947932582e88b534.tar.gz
online-92aca7f2dd35249ff1f82bf4947932582e88b534.zip
Compile the support key in (when configured to use one).
Change-Id: Iffff0b95b245b91d9732a774a6026a3cec2b2222 Reviewed-on: https://gerrit.libreoffice.org/43185 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'common')
-rw-r--r--common/Crypto.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/common/Crypto.cpp b/common/Crypto.cpp
index a8e84c2d6b..2c125a2f01 100644
--- a/common/Crypto.cpp
+++ b/common/Crypto.cpp
@@ -22,6 +22,7 @@
#include "Log.hpp"
#include "Crypto.hpp"
+#include "support-public-key.hpp"
using namespace Poco;
using namespace Poco::Crypto;
@@ -82,27 +83,9 @@ bool SupportKey::verify()
return false;
}
- std::ifstream pubStream;
- std::string supportKeyFilename =
-#if ENABLE_DEBUG
- SUPPORT_KEY_FILE
-#else
- LOOLWSD_CONFIGDIR "/" SUPPORT_KEY_FILE
-#endif
- ;
+ std::istringstream pubStream(SUPPORT_PUBLIC_KEY);
try {
- pubStream.open(supportKeyFilename, std::ifstream::in);
- if (pubStream.fail())
- {
- LOG_ERR("Failed to open support public key '" << supportKeyFilename << "'.");
- return false;
- }
- } catch (...) {
- LOG_ERR("Exception opening public key '" << supportKeyFilename << "'.");
- return false;
- }
- try {
RSAKey keyPub(&pubStream);
RSADigestEngine rsaEngine(keyPub, RSADigestEngine::DigestType::DIGEST_SHA1);
rsaEngine.update(_impl->_data);