diff --git a/passphrase_cache.cc b/passphrase_cache.cc index 05771d4..9f6d37f 100644 --- a/passphrase_cache.cc +++ b/passphrase_cache.cc @@ -4,8 +4,13 @@ namespace pEp { void PassphraseCache::add(std::string passphrase) { std::lock_guard lock(_mtx); + + if (passphrase == "") + return; + while (_cache.size() >= _max_size) _cache.pop_front(); + _cache.emplace_back(cache_entry(passphrase, clock::now())); }