wsd/ProofKey.cpp | 3 ++- wsd/ProofKey.hpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)
New commits: commit cd98388653d9038e8918f1a1431a4c836b1adcb9 Author: Michael Meeks <michael.me...@collabora.com> AuthorDate: Thu Aug 20 16:46:05 2020 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Thu Aug 20 18:11:12 2020 +0200 Avoid contention on RSA Digest engine. Change-Id: If9068371c7ab18083d432f8bc582d85c2f85e80e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101081 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/wsd/ProofKey.cpp b/wsd/ProofKey.cpp index c7df1afe1..1fdfc5eca 100644 --- a/wsd/ProofKey.cpp +++ b/wsd/ProofKey.cpp @@ -252,7 +252,8 @@ std::vector<unsigned char> Proof::GetProof(const std::string& access_token, cons std::string Proof::SignProof(const std::vector<unsigned char>& proof) const { assert(m_pKey); - static Poco::Crypto::RSADigestEngine digestEngine(*m_pKey, "SHA256"); + // One per DocumentBroker that uses this via WopiStorage + static thread_local Poco::Crypto::RSADigestEngine digestEngine(*m_pKey, "SHA256"); digestEngine.reset(); digestEngine.update(proof.data(), proof.size()); return BytesToBase64(digestEngine.signature()); diff --git a/wsd/ProofKey.hpp b/wsd/ProofKey.hpp index 34dd98e12..5efc79aeb 100644 --- a/wsd/ProofKey.hpp +++ b/wsd/ProofKey.hpp @@ -27,6 +27,11 @@ namespace Poco { class WopiProofTests; +/** + * Global singleton - with one-time loaded key data + * loaded at startup, and then un-modified & shared + * across threads. + */ class Proof { friend class WopiProofTests; void initialize(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits