Skip to content

Commit

Permalink
Update systemcredentials.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Dec 1, 2023
1 parent f94de8d commit 7f5f5f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/keyring/systemcredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace Nickvision::Aura::Keyring
{
#ifndef _WIN32
static const SecretSchema KEYRING_SCHEMA = { "org.nickvision.aura.keyring", SECRET_SCHEMA_NONE, { { "application", SECRET_SCHEMA_ATTRIBUTE_STRING }, { NULL, 0 } } };
static const SecretSchema KEYRING_SCHEMA = { "org.nickvision.aura.keyring", SECRET_SCHEMA_NONE, { { "application", SECRET_SCHEMA_ATTRIBUTE_STRING }, { "NULL", SECRET_SCHEMA_ATTRIBUTE_STRING } } };
#endif

std::optional<Credential> SystemCredentials::getCredential(const std::string& name)
Expand All @@ -29,7 +29,7 @@ namespace Nickvision::Aura::Keyring
}
#else
GError* error{ nullptr };
char* password = secret_password_lookup_sync(&KEYRING_SCHEMA, nullptr, &error, "application", name.c_str(), nullptr);
char* password = secret_password_lookup_sync(&KEYRING_SCHEMA, nullptr, &error, "application", name.c_str(), NULL);
if (!error && password)
{
Credential c{ name, "", "default", password };
Expand Down Expand Up @@ -65,7 +65,7 @@ namespace Nickvision::Aura::Keyring
return c;
#else
GError* error{ nullptr };
secret_password_store_sync(&KEYRING_SCHEMA, SECRET_COLLECTION_DEFAULT, c.getName().c_str(), c.getPassword().c_str(), nullptr, &error, "application", c.getName().c_str(), nullptr);
secret_password_store_sync(&KEYRING_SCHEMA, SECRET_COLLECTION_DEFAULT, c.getName().c_str(), c.getPassword().c_str(), nullptr, &error, "application", c.getName().c_str(), NULL);
if (error)
{
g_error_free(error);
Expand All @@ -81,7 +81,7 @@ namespace Nickvision::Aura::Keyring
return CredDeleteA(credential.getName().c_str(), CRED_TYPE_GENERIC, 0);
#else
GError* error{ nullptr };
bool res = secret_password_clear_sync(&KEYRING_SCHEMA, nullptr, &error, "application", credential.getName().c_str(), nullptr);
bool res = secret_password_clear_sync(&KEYRING_SCHEMA, nullptr, &error, "application", credential.getName().c_str(), NULL);
if (!error)
{
return res;
Expand Down

0 comments on commit 7f5f5f2

Please sign in to comment.