security: Create PIB implementation as shared_ptr

While existing code is valid, it caused strange crashes on Android/ARM
platform.

Change-Id: I29c4879c65b3c844abb2d75f267c44a0b959a6f7
This commit is contained in:
Alexander Afanasyev committed 2020-05-30 18:34:19 -04:00
1 parent 3de8aac22d
commit ab9d7ed25a
1 file changed
+2 -2
+2 -2
View File
@@ -367,7 +367,7 @@ public: // PIB & TPM backend registry
registerTpmBackend(const std::string& scheme);
private:
typedef std::map<std::string, function<unique_ptr<pib::PibImpl>(const std::string& location)>> PibFactories;
typedef std::map<std::string, function<std::shared_ptr<pib::PibImpl>(const std::string& location)>> PibFactories;
typedef std::map<std::string, function<unique_ptr<tpm::BackEnd>(const std::string& location)>> TpmFactories;
static PibFactories&
@@ -458,7 +458,7 @@ inline void
KeyChain::registerPibBackend(const std::string& scheme)
{
getPibFactories().emplace(scheme, [] (const std::string& locator) {
return unique_ptr<pib::PibImpl>(new PibType(locator));
return std::shared_ptr<pib::PibImpl>(new PibType(locator));
});
}