This interface provides a separation between the
frontend (secret_password*) and the backend (SecretService). That
makes it easier to replace SecretService with a custom backend
implementation.
Given these functions take a hash table built from valid attributes,
there is no need to re-validate. This is also consistent with the
secret_service API.
This adds the secret_value_unref_to_password function that
unreferences and returns the stored secret in non-pageable memory.
This is supposed to be used with secret_password_lookup_binary*
functions.
This adds a set of functions that takes a SecretValue instead of a
text password when storing a secret. This is useful if the stored
password is not null-terminated.
This adds a set of functions that return a SecretValue instead of a
text password when looking up a secret. This is useful if the stored
password is not null-terminated.
This is a ground work for adding a local storage backend. As
SecretItem is derived from GDBusProxy, it cannot be simply exposed to
the application through the secret_password_search() if the item is
not backed by the DBus API. This adds an abstract interface
representing a read-only view of a secret item for that purpose.
In file included from /usr/include/libsecret-1/libsecret/secret.h:33,
from ../lib/sync/../ephy-sync-utils.h:24,
from ../lib/sync/ephy-history-manager.c:25:
/usr/include/libsecret-1/libsecret/secret-version.h:19: error: ignoring #pragma __once__ [-Werror=unknown-pragmas]
#pragma __once__
It should be #pragma once, not #pragma __once__.
But let's follow the other public headers here instead.
Added macros:
* SECRET_VERSION_MAJOR
* SECRET_VERSION_MINOR
* SECRET_VERSION_MICRO
* SECRET_CHECK_VERSION
These macros are widely defined in GLib based library. For example,
GLib, GTK, poppler GLib and so on define them.
These macros are useful to detect libsecret version on build type and
from GObject Introspection based bindings.
Linux 3.4 added support for the MADV_DONTDUMP option to madvise(), which
requests that the covered memory not be included in coredumps. It makes
sense to use this to prevent cases where application crashes could
result in secrets being persisted to disk or included in dumps that are
uploaded to remote servers for analysis. I've avoided making this fatal
since there's a chance this code could be built on systems that have
MADV_DONTDUMP but run on systems that don't.
GSimpleAsyncResult is deprecated in favor of the simpler GTask, so use
that instead. This cuts down on the deprecation warnings.
I wanted to do both separately, but porting one without the other led to
some faulty casts from GSimpleAsyncResult to GTask (and vice versa).
Apart from having more developer-friendly messages if the assertions go
wrong, it also prevents the assertions not being run if
`G_DISABLE_ASSERT` is defined (e.g. for performance reasons).
Some distributions patch libgcrypt to provide a pkg-config file, and
disable libgcrypt-config. One of these distributions is Yocto, which we
use as the basis for the GNOME Continuous build environment.
We should check if there's a pkg-config file available for gcrypt, and
use it, falling back to libgcrypt-config if the pkg-config file is not
found.
Commit f36379af33 added the enumeration
GType for SecretCollectionFlags and SecretCollectionCreateFlags in the
introspection data, but by doing so it broke existing users of the
introspected API.
Additionally, the enumeration nicknames—which are used to generate the
enumeration value from the type name and the namespace—were wrong
before, and are wrong now. The idiomatic way to name enumeration members
is to use the uppercase, snake case version of the type name, and append
the value at the end:
SecretCollectionFlags → SECRET_COLLECTION_FLAGS_NONE
SecretCollectionCreateFlags → SECRET_COLLECTION_CREATE_FLAGS_NONE
If this practice is not followed, enumerations should use the
glib-mkenums trigraph and the `prefix` option; this tells glib-mkenums,
and the introspection parser after that, where to cut off the prefix and
which part of the enumeration value should be considered the nickname.
Thus, with `prefix=SECRET_COLLECTION` we can turn:
SECRET_COLLECTION_NONE
into:
Secret.CollectionFlags.NONE
which is the idiomatic form of an enumeration value.