From 0ee8d028527683970fad133d3a4365edbc2baa54 Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Wed, 31 Dec 2014 23:42:02 -0800 Subject: [PATCH] Use servername instead of UUID for credential store. Unfortunately, the UUID is used in such a way that makes it unlikely to be unique. The server name is the current best option. --- .../FeatureLib/pfPasswordStore/pfPasswordStore_Mac.cpp | 6 +++--- .../FeatureLib/pfPasswordStore/pfPasswordStore_Win.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Mac.cpp b/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Mac.cpp index 78b728b7..e31d6575 100644 --- a/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Mac.cpp +++ b/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Mac.cpp @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfPasswordStore.h" #include "pfPasswordStore_impl.h" -#include "plProduct.h" +#include "pnNetBase/pnNbSrvs.h" #include @@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *****************************************************************************/ const plString pfMacPasswordStore::GetPassword(const plString& username) { - plString service = plProduct::UUID(); + plString service = GetServerDisplayName(); void* passwd = nullptr; uint32_t passwd_len = 0; @@ -78,7 +78,7 @@ const plString pfMacPasswordStore::GetPassword(const plString& username) bool pfMacPasswordStore::SetPassword(const plString& username, const plString& password) { - plString service = plProduct::UUID(); + plString service = GetServerDisplayName(); return SecKeychainAddGenericPassword(nullptr, service.GetSize(), diff --git a/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Win.cpp b/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Win.cpp index ca0ecd6b..78da4413 100644 --- a/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Win.cpp +++ b/Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore_Win.cpp @@ -43,8 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfPasswordStore.h" #include "pfPasswordStore_impl.h" -#include "plProduct.h" #include "plFormat.h" +#include "pnNetBase/pnNbSrvs.h" #include "hsWindows.h" #include @@ -55,7 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com const plString pfWin32PasswordStore::GetPassword(const plString& username) { PCREDENTIALW credential; - plString target = plFormat("%s__%s", plProduct::UUID(), username); + plString target = plFormat("{}__{}", GetServerDisplayName(), username); plString password = plString::Null; if (!CredReadW(target.ToWchar().GetData(), CRED_TYPE_GENERIC, 0, &credential)) { @@ -74,7 +74,7 @@ const plString pfWin32PasswordStore::GetPassword(const plString& username) bool pfWin32PasswordStore::SetPassword(const plString& username, const plString& password) { CREDENTIALW credential; - plString target = plFormat("%s__%s", plProduct::UUID(), username); + plString target = plFormat("{}__{}", GetServerDisplayName(), username); if (password.IsNull()) { if (CredDeleteW(target.ToWchar().GetData(), CRED_TYPE_GENERIC, 0)) {