fix compile errors with AuthenticatedEncryption as Poco::AutoPtr

This commit is contained in:
Dario 2020-06-24 14:15:48 +02:00
parent b8e93e8142
commit 39e85a959e
2 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,9 @@
#include "../SingletonManager/MemoryManager.h"
#include "../lib/AutoPtrContainer.h"
#include "Poco/AutoPtr.h"
#include <shared_mutex>
#include <vector>
@ -45,6 +48,9 @@ public:
inline KeyHashed getKeyHashed() const { std::shared_lock<std::shared_mutex> _lock(mWorkingMutex); return mEncryptionKeyHash; }
inline bool operator == (const Poco::AutoPtr<AuthenticatedEncryption>& b) const {
return isTheSame(b);
}
inline bool isTheSame(const Poco::AutoPtr<AuthenticatedEncryption>& b) const {
std::shared_lock<std::shared_mutex> _lock(mWorkingMutex);
if (b.isNull()) return false;
return mEncryptionKeyHash == b->getKeyHashed();

View File

@ -352,10 +352,9 @@ const Mnemonic* Passphrase::detectMnemonic(const std::string& passphrase, const
}
if (existAll) {
if (keyPair) {
auto test_passphrase = new Passphrase(passphrase, &m);
Poco::AutoPtr<Passphrase> test_passphrase = new Passphrase(passphrase, &m);
test_passphrase->createWordIndices();
auto key_pair = KeyPairEd25519::create(test_passphrase);
delete test_passphrase;
if (key_pair) {
if (*key_pair != *keyPair) {
delete key_pair;