The on_portal_retrieve_secret() can connect a GCancellable, but it
doesn't disconnect from it (only when the cancellable is cancelled),
which means when the cancellable is cancelled later, when the GTask
is gone, the callback is called with already freed data.
As the GVariant serialization format does not record the original
endianness of integer values, we need to ensure that it doesn't change
between write and load.
As encrypt() is a standard POSIX function, its declaration had
conflict with our own. Let's be more verbose about naming of the
internal crypto functions.
Fixes#35.
When libgcrypt is available, libsecret links with it. When dynamic
linking is used, there is no problem: libsecret.so has a NEEDED
pointing to libgcrypt, so linking an application with -lsecret works
fine. However, when doing static linking, you must specify the entire
chain of libraries, otherwise you get unresolved symbols errors, such
as:
host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libsecret-1.a(libsecret_1_la-secret-session.o): In function `request_open_session_aes':
build/libsecret-0.18.3/libsecret/secret-session.c:99: undefined reference to `gcry_mpi_release'
build/libsecret-0.18.3/libsecret/secret-session.c:101: undefined reference to `gcry_mpi_aprint'
build/libsecret-0.18.3/libsecret/secret-session.c:107: undefined reference to `gcry_free'
In order to solve this, we simply need to indicate in the Libs.private
field of the .pc file that we depend on libgcrypt.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/libsecret/0001-libsecret.pc-add-Libs.private-field-for-libgcrypt.patch]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
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.
The condition checking g_task_is_valid was inverted, resulting in errors
being ignored.
Move the check to a g_return_val_if_fail to be in line with all other
uses of g_task_is_valid.
Fixes https://bugs.archlinux.org/task/63666
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.
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).
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.
Normally it shouldn't matter too much, but the GIR parser apparently
doesn't like it:
```
/home/niels/gnome/libsecret/libsecret/secret-schema.h:75: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-prompt.h:78: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-value.h:54: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-service.h:307: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-collection.h:176: syntax error, unexpected ';' in ';' at ';'
/home/niels/gnome/libsecret/libsecret/secret-item.h:194: syntax error, unexpected ';' in ';' at ';'
```