Commit Graph

171 Commits

Author SHA1 Message Date
Niels De Graef
b19c309096 Add build support for Meson
To build with meson, use the following commands:

```
$ meson build
$ ninja -C build
 # in case you want to install
$ ninja -C build install
```
2019-01-19 21:03:56 +00:00
Niels De Graef
80afd20c19 Add support for g_autoptr() to our types
g_autoptr() is a macro that was defined in GLib 2.44 that allows for
basic auto-cleanup of variables. One way to add this kind of support
would be through the use of e.g. `G_DECLARE_DERIVABLE_TYPE()` for our
declarations, but this would consitute an ABI break (due to the
`...Private *` field in the public structs). Instead, we can use
`G_DEFINE_AUTOPTR_CLEANUP_FUNC` to manually declare this.

This commit also bumps the minimally required GLib version to 2.44
2019-01-19 12:42:33 +00:00
Niels De Graef
cbea4ce739 Remove useless macro to check GLib version
We already require GLib to have version 2.38 or higher in
`configure.ac`, so no need to check in our code whether we have a
version higher than 2.35
2019-01-19 12:12:32 +01:00
Daiki Ueno
9c3381b483 Revert "Merge branch 'wip/dueno/search' into 'master'"
This reverts merge request !7
2018-12-07 14:28:20 +00:00
Tomasz Miąsko
5a217c5cae Secret item schema name is optional
Initialize the schema_name so that NULL is returned when the schema name
is absent, instead of an uninitialized memory. Mark return value as
nullable to indicate this for introspection and documentation.
2018-10-19 13:10:15 +02:00
Daiki Ueno
7716449b1d password: Add secret_password_search* functions
Previously there were no functions in the simple API that return the
matched attributes other than the secret value, while there were needs
for augumenting user input with additional information (such as
completing web forms).

This adds a set of functions which wrap secret_service_search*.  Note
that the return value is a list of GHashTable not of SecretItem,
because SecretItem is a subclass of GDBusProxy, which we don't want to
expose from the simple API.

Fixes #16
2018-10-19 12:00:45 +02:00
Daiki Ueno
9ca8f323a9 secret-session: Avoid double-free in service_encode_plain_secret()
As g_variant_builder_add_value() takes ownership of a floating
GVariant, we don't need to unref it afterwards.
2018-07-20 11:01:08 +02:00
Daiki Ueno
a3753c1b2b build: Remove unused constants 2018-06-06 15:14:32 +02:00
Daiki Ueno
a7f2efc450 build: Make DBus code generation more portable
The $'...' quoting syntax is a Bash extension and might not be
available in other Bourne Shell compatible shells:
https://www.gnu.org/software/bash/manual/html_node/Major-Differences-From-The-Bourne-Shell.html#Major-Differences-From-The-Bourne-Shell

https://bugzilla.gnome.org/show_bug.cgi?id=734630
2018-03-31 09:27:23 +02:00
Philip Withnall
b738c9f787 lib/schemas: Add secret_get_schema() accessor for SECRET_SCHEMA_*s
The SECRET_SCHEMA_* extern structs are not introspectable; add a new
accessor function which takes an enum and returns a struct, which is
introspectable.

Mark the old extern structs as (skip), but don’t deprecate them because
they’re still useful from C (if unconventional).

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=697681
2018-03-22 17:46:22 +00:00
Dmitry Shachnev
d3ac1c1834 mock: Pad the common secret with zero bytes to make it exactly 128 bytes long
This is what the C code does, see egg/egg-dh.c:340.

https://bugzilla.gnome.org/show_bug.cgi?id=768112
2017-11-07 15:22:40 +01:00
Ville Skyttä
2624ed771b Spelling fixes 2017-10-15 00:28:01 +03:00
Michael Catanzaro
f76e333d09 secret-methods: Don't unref NULL when search fails
If the gnome-keyring D-Bus service is not responding, we wind up freeing
the SearchClosure in an error path without ever creating a SecretService
object. Guard against this.

https://bugzilla.gnome.org/show_bug.cgi?id=787391
2017-09-06 20:48:24 -05:00
Debarshi Ray
b9151faaf0 secret-value: Don't annotate secret_value_unref as (allow-none)
https://bugzilla.gnome.org/show_bug.cgi?id=785034
2017-07-17 19:41:33 +02:00
Philip Chimento
4d7b190b67 build: Use $-quoted string to escape newline
BSD sed doesn't like escaping a literal newline character with a
backslash. Instead, use a $-quoted string to escape the newline as \n.

https://bugzilla.gnome.org/show_bug.cgi?id=734630
2017-05-22 11:25:20 +02:00
David King
455b70968a Build Vala tests with -fPIC
Fixes a build failure in the tests in the Fedora package.

https://bugzilla.gnome.org/show_bug.cgi?id=777826
https://bugzilla.redhat.com/show_bug.cgi?id=1416818
2017-02-01 12:39:02 +01:00
Garima Gaur
b9fbfbdb00 Remove double check on collection_path in secret-collection.c
Signed-off-by: Stef Walter <stefw@redhat.com>
 * Most of the lines of change seem to be reindentation

https://bugzilla.gnome.org/show_bug.cgi?id=775747
2016-12-12 13:22:27 +01:00
Piotr Drąg
3c1faf4f99 Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772528
2016-10-18 11:31:57 +02:00
Robert Ancell
f59f2b6a82 Makefile.am: Compile vala unstable tests with SECRET_WITH_UNSTABLE=1.
Without this the generated C code compiles without the correct header (warnings
are disabled so this is not obvious). This was causing the test to crash on
Ubuntu (exact cause not diagnosed).

https://bugzilla.gnome.org/show_bug.cgi?id=767002
2016-05-30 09:41:20 +02:00
Dmitry Shachnev
ae5761cd65 libsecret: Get rid of PyGI warnings about unspecified versions
https://bugzilla.gnome.org/show_bug.cgi?id=687637
2016-04-07 10:08:54 +02:00
Antonio Murdaca
43cac02864 Fix typos
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Signed-off-by: Stef Walter <stefw@redhat.com>
 * Fix one spelling of 'succeeded'

https://bugzilla.gnome.org/show_bug.cgi?id=763143
2016-03-08 13:32:07 +01:00
Dmitry Shachnev
7da8c2b70e mock: Remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=761834
2016-02-14 17:55:09 +01:00
Dmitry Shachnev
847dd055e4 mock: Port to Python 3
https://bugzilla.gnome.org/show_bug.cgi?id=761834
2016-02-14 17:55:09 +01:00
Dmitry Shachnev
be5f98bbdb mock: Port to modern pygobject API
https://bugzilla.gnome.org/show_bug.cgi?id=761834
2016-02-14 17:55:08 +01:00
Michael Catanzaro
0660951db3 Fix typos 2015-11-13 14:35:52 -08:00
Christophe Fergeau
1b55291feb Fix secret_schema_unref detection of 0 refcount
g_atomic_int_add (&schema->refs, -1); will return the value of 'refs'
_before_ adding -1 to it, so checking this value for 0 to see if the
refcount dropped to 0 after adding -1 is not going to work and will
cause a leak.
Using g_atomic_int_dec_and_test() fixes this problem as this will return
TRUE when the value drops to 0 after being decremented.

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:11:19 +02:00
Christophe Fergeau
b8bd3d0de8 secret-sync: Fix SecretSync leak
The memory allocated for the SecretSync instance itself was not freed. This fixes:
==7106== 24 bytes in 1 blocks are definitely lost in loss record 855 of 1,629
==7106==    at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==7106==    by 0x600303F: g_malloc0 (gmem.c:124)
==7106==    by 0x6003322: g_malloc0_n (gmem.c:354)
==7106==    by 0x4E6979D: _secret_sync_new (secret-util.c:441)
==7106==    by 0x4E65D11: secret_service_read_alias_dbus_path_sync (secret-paths.c:2334)
==7106==    by 0x4E4E09E: secret_collection_for_alias_sync (secret-collection.c:2221)
==7106==    by 0x40270E: test_for_alias_sync (test-collection.c:187)
==7106==    by 0x60258FA: test_case_run (gtestutils.c:2158)
==7106==    by 0x6025CBB: g_test_run_suite_internal (gtestutils.c:2241)
==7106==    by 0x6025D64: g_test_run_suite_internal (gtestutils.c:2253)
==7106==    by 0x6025F7B: g_test_run_suite (gtestutils.c:2328)
==7106==    by 0x6024C1C: g_test_run (gtestutils.c:1596)
==7106==    by 0x4E7CA3B: egg_tests_run_with_loop (egg-testing.c:167)
==7106==    by 0x406948: main (test-collection.c:1033)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
ec33acd46e Free CollectionClosure::collection_path when it's freed
Similarly to what is done ItemClosure::collection_path, make sure that
CollectionClosure::collection_path is freed in
collection_closure_free().

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
396d192a1f Don't leak ItemClosure::collection_path
This fixes:
==17724== 48 bytes in 1 blocks are definitely lost in loss record 1,135 of 1,698
==17724==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17724==    by 0x6002FCC: g_malloc (gmem.c:94)
==17724==    by 0x60032AE: g_malloc_n (gmem.c:330)
==17724==    by 0x601DBF0: g_strdup (gstrfuncs.c:363)
==17724==    by 0x4E650B5: on_create_item_called (secret-paths.c:1990)
==17724==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==17724==    by 0x5A33575: g_task_return (gtask.c:1162)
==17724==    by 0x5A33E76: g_task_return_pointer (gtask.c:1537)
==17724==    by 0x5A9BB7D: g_dbus_connection_call_done (gdbusconnection.c:5704)
==17724==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==17724==    by 0x5A334B6: complete_in_idle_cb (gtask.c:1118)
==17724==    by 0x5FFD3D0: g_idle_dispatch (gmain.c:5441)
==17724==    by 0x5FFAA18: g_main_dispatch (gmain.c:3154)
==17724==    by 0x5FFB85C: g_main_context_dispatch (gmain.c:3769)
==17724==    by 0x5FFBA40: g_main_context_iterate (gmain.c:3840)
==17724==    by 0x5FFBE66: g_main_loop_run (gmain.c:4034)
==17724==    by 0x4E55FF7: secret_service_store_sync (secret-methods.c:1281)
==17724==    by 0x404AC8: test_store_sync (test-methods.c:736)
==17724==    by 0x60258FA: test_case_run (gtestutils.c:2158)
==17724==    by 0x6025CBB: g_test_run_suite_internal (gtestutils.c:2241)
==17724==    by 0x6025D64: g_test_run_suite_internal (gtestutils.c:2253)
==17724==    by 0x6025F7B: g_test_run_suite (gtestutils.c:2328)
==17724==    by 0x6024C1C: g_test_run (gtestutils.c:1596)
==17724==    by 0x4E7CA68: egg_tests_run_with_loop (egg-testing.c:167)
==17724==    by 0x406190: main (test-methods.c:998)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
d9f5479963 collection: Fix on_create_path() leak
This fixes:
==2111== 45 bytes in 1 blocks are definitely lost in loss record 1,180 of 1,795
==2111==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==2111==    by 0x6002FCC: g_malloc (gmem.c:94)
==2111==    by 0x60032AE: g_malloc_n (gmem.c:330)
==2111==    by 0x601DBF0: g_strdup (gstrfuncs.c:363)
==2111==    by 0x603C073: g_variant_dup_string (gvariant.c:1503)
==2111==    by 0x4E644D5: on_create_collection_prompt (secret-paths.c:1682)
==2111==    by 0x5A1CB66: g_simple_async_result_complete (gsimpleasyncresult.c:801)
==2111==    by 0x4E5C12F: on_real_prompt_completed (secret-service.c:322)
==2111==    by 0x5A1CB66: g_simple_async_result_complete (gsimpleasyncresult.c:801)
==2111==    by 0x4E5A6A1: perform_prompt_complete (secret-prompt.c:288)
==2111==    by 0x4E5A7B5: on_prompt_completed (secret-prompt.c:314)
==2111==    by 0x5A97B7B: emit_signal_instance_in_idle_cb (gdbusconnection.c:3701)
==2111==    by 0x5FFD3D0: g_idle_dispatch (gmain.c:5441)
==2111==    by 0x5FFAA18: g_main_dispatch (gmain.c:3154)
==2111==    by 0x5FFB85C: g_main_context_dispatch (gmain.c:3769)
==2111==    by 0x5FFBA40: g_main_context_iterate (gmain.c:3840)
==2111==    by 0x5FFBE66: g_main_loop_run (gmain.c:4034)
==2111==    by 0x4E7C9E1: loop_wait_until (egg-testing.c:151)
==2111==    by 0x4E7C859: egg_test_wait_until (egg-testing.c:105)
==2111==    by 0x4032ED: test_create_async (test-collection.c:328)
==2111==    by 0x60258FA: test_case_run (gtestutils.c:2158)
==2111==    by 0x6025CBB: g_test_run_suite_internal (gtestutils.c:2241)
==2111==    by 0x6025D64: g_test_run_suite_internal (gtestutils.c:2253)
==2111==    by 0x6025F7B: g_test_run_suite (gtestutils.c:2328)
==2111==    by 0x6024C1C: g_test_run (gtestutils.c:1596)
==2111==    by 0x4E7CA3B: egg_tests_run_with_loop (egg-testing.c:167)
==2111==    by 0x406948: main (test-collection.c:1033)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
91ee4c847d test-collection: Fix string leaks
This fixes:
==16832== 6 bytes in 1 blocks are definitely lost in loss record 8 of 1,184
==16832==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16832==    by 0x36E564F679: g_malloc (gmem.c:97)
==16832==    by 0x36E56688AE: g_strdup (gstrfuncs.c:356)
==16832==    by 0x4C2B242: secret_collection_get_label (secret-collection.c:1835)
==16832==    by 0x40313D: test_create_sync (test-collection.c:305)
==16832==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16832==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16832==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16832==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16832==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16832==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16832==    by 0x4068B0: main (test-collection.c:1028)
==16832==-
==16832== 6 bytes in 1 blocks are definitely lost in loss record 9 of 1,184
==16832==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16832==    by 0x36E564F679: g_malloc (gmem.c:97)
==16832==    by 0x36E56688AE: g_strdup (gstrfuncs.c:356)
==16832==    by 0x4C2B242: secret_collection_get_label (secret-collection.c:1835)
==16832==    by 0x40337C: test_create_async (test-collection.c:333)
==16832==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16832==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16832==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16832==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16832==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16832==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16832==    by 0x4068B0: main (test-collection.c:1028)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
d416da7705 test-collection: Fix GError leaks
This fixes (among others):
==16832== 95 (16 direct, 79 indirect) bytes in 1 blocks are definitely lost in loss record 927 of 1,184
==16832==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16832==    by 0x36E564F679: g_malloc (gmem.c:97)
==16832==    by 0x36E5666CD2: g_slice_alloc (gslice.c:1007)
==16832==    by 0x36E563522B: g_error_new_valist (gerror.c:386)
==16832==    by 0x36E563560A: g_set_error (gerror.c:560)
==16832==    by 0x4C27FB4: secret_collection_initable_init (secret-collection.c:543)
==16832==    by 0x36E6E5D83E: g_initable_new_valist (ginitable.c:228)
==16832==    by 0x36E6E5D8F5: g_initable_new (ginitable.c:146)
==16832==    by 0x4C3E1E3: secret_collection_new_for_dbus_path_sync (secret-paths.c:158)
==16832==    by 0x404733: test_delete_sync (test-collection.c:623)
==16832==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16832==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16832==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16832==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16832==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16832==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16832==    by 0x4068B0: main (test-collection.c:1028)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
b6189a95e9 prompt: Don't leak 'owner_name' in secret_prompt_perform()
This fixes:
==16832== 7 bytes in 1 blocks are definitely lost in loss record 10 of 1,184
==16832==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16832==    by 0x36E564F679: g_malloc (gmem.c:97)
==16832==    by 0x36E56688AE: g_strdup (gstrfuncs.c:356)
==16832==    by 0x36E6EDEB98: g_dbus_proxy_get_name_owner (gdbusproxy.c:2372)
==16832==    by 0x4C38B64: secret_prompt_perform (secret-prompt.c:468)
==16832==    by 0x4C39F4C: secret_service_real_prompt_async (secret-service.c:339)
==16832==    by 0x4C3D126: secret_service_prompt (secret-service.c:1711)
==16832==    by 0x4C42182: on_create_collection_called (secret-paths.c:1706)
==16832==    by 0x36E6E74BA6: g_simple_async_result_complete (gsimpleasyncresult.c:763)
==16832==    by 0x36E6ED1921: g_dbus_connection_call_done (gdbusconnection.c:5508)
==16832==    by 0x36E6E74BA6: g_simple_async_result_complete (gsimpleasyncresult.c:763)
==16832==    by 0x36E6E74C08: complete_in_idle_cb (gsimpleasyncresult.c:775)
==16832==    by 0x36E5649A89: g_main_dispatch (gmain.c:3122)
==16832==    by 0x36E5649A89: g_main_context_dispatch (gmain.c:3737)
==16832==    by 0x36E5649E1F: g_main_context_iterate.isra.29 (gmain.c:3808)
==16832==    by 0x36E564A141: g_main_loop_run (gmain.c:4002)
==16832==    by 0x4C427F1: secret_service_create_collection_dbus_path_sync (secret-paths.c:1908)
==16832==    by 0x4C299F9: secret_collection_create_sync (secret-collection.c:1211)
==16832==    by 0x403084: test_create_sync (test-collection.c:299)
==16832==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16832==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16832==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16832==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16832==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16832==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16832==    by 0x4068B0: main (test-collection.c:1028)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
c8931ab6fc test-prompt: Fix GError leak
https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
6fbfb64b17 item: Fix local variable leak in on_create_path()
This fixes:
==22678== 48 bytes in 1 blocks are definitely lost in loss record 1,045 of 1,560
==22678==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==22678==    by 0x6002FCC: g_malloc (gmem.c:94)
==22678==    by 0x60032AE: g_malloc_n (gmem.c:330)
==22678==    by 0x601DBF0: g_strdup (gstrfuncs.c:363)
==22678==    by 0x4E6508B: on_create_item_called (secret-paths.c:1991)
==22678==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==22678==    by 0x5A33575: g_task_return (gtask.c:1162)
==22678==    by 0x5A33E76: g_task_return_pointer (gtask.c:1537)
==22678==    by 0x5A9BB7D: g_dbus_connection_call_done (gdbusconnection.c:5704)
==22678==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==22678==    by 0x5A334B6: complete_in_idle_cb (gtask.c:1118)
==22678==    by 0x5FFD3D0: g_idle_dispatch (gmain.c:5441)
==22678==    by 0x5FFAA18: g_main_dispatch (gmain.c:3154)
==22678==    by 0x5FFB85C: g_main_context_dispatch (gmain.c:3769)
==22678==    by 0x5FFBA40: g_main_context_iterate (gmain.c:3840)
==22678==    by 0x5FFBE66: g_main_loop_run (gmain.c:4034)
==22678==    by 0x4E7C9E4: loop_wait_until (egg-testing.c:151)
==22678==    by 0x4E7C85C: egg_test_wait_until (egg-testing.c:105)
==22678==    by 0x402D22: test_create_async (test-item.c:245)
==22678==    by 0x60258FA: test_case_run (gtestutils.c:2158)
==22678==    by 0x6025CBB: g_test_run_suite_internal (gtestutils.c:2241)
==22678==    by 0x6025D64: g_test_run_suite_internal (gtestutils.c:2253)
==22678==    by 0x6025F7B: g_test_run_suite (gtestutils.c:2328)
==22678==    by 0x6024C1C: g_test_run (gtestutils.c:1596)
==22678==    by 0x4E7CA3E: egg_tests_run_with_loop (egg-testing.c:167)
==22678==    by 0x406B52: main (test-item.c:887)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
2c5567cd65 item: Free SecreItem::value in finalize()
This fixes:
==20768== 67 (40 direct, 27 indirect) bytes in 1 blocks are definitely lost in loss record 1,133 of 1,588
==20768==    at 0x4C28C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20768==    by 0x6002FCC: g_malloc (gmem.c:94)
==20768==    by 0x601B523: g_slice_alloc (gslice.c:1007)
==20768==    by 0x601B563: g_slice_alloc0 (gslice.c:1032)
==20768==    by 0x4E5FB64: secret_value_new_full (secret-value.c:140)
==20768==    by 0x4E67B63: service_decode_aes_secret (secret-session.c:457)
==20768==    by 0x4E67D6B: _secret_session_decode_secret (secret-session.c:513)
==20768==    by 0x4E50A61: on_item_load_secret (secret-item.c:1157)
==20768==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==20768==    by 0x5A33575: g_task_return (gtask.c:1162)
==20768==    by 0x5A33E76: g_task_return_pointer (gtask.c:1537)
==20768==    by 0x5AAC7E6: reply_cb (gdbusproxy.c:2579)
==20768==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==20768==    by 0x5A33575: g_task_return (gtask.c:1162)
==20768==    by 0x5A33E76: g_task_return_pointer (gtask.c:1537)
==20768==    by 0x5A9BB7D: g_dbus_connection_call_done (gdbusconnection.c:5704)
==20768==    by 0x5A3346D: g_task_return_now (gtask.c:1104)
==20768==    by 0x5A334B6: complete_in_idle_cb (gtask.c:1118)
==20768==    by 0x5FFD3D0: g_idle_dispatch (gmain.c:5441)
==20768==    by 0x5FFAA18: g_main_dispatch (gmain.c:3154)
==20768==    by 0x5FFB85C: g_main_context_dispatch (gmain.c:3769)
==20768==    by 0x5FFBA40: g_main_context_iterate (gmain.c:3840)
==20768==    by 0x5FFBE66: g_main_loop_run (gmain.c:4034)
==20768==    by 0x4E510DA: secret_item_load_secret_sync (secret-item.c:1311)
==20768==    by 0x405238: test_load_secret_sync (test-item.c:592)
==20768==    by 0x60258FA: test_case_run (gtestutils.c:2158)
==20768==    by 0x6025CBB: g_test_run_suite_internal (gtestutils.c:2241)
==20768==    by 0x6025D64: g_test_run_suite_internal (gtestutils.c:2253)
==20768==    by 0x6025F7B: g_test_run_suite (gtestutils.c:2328)
==20768==    by 0x6024C1C: g_test_run (gtestutils.c:1596)
==20768==    by 0x4E7CA25: egg_tests_run_with_loop (egg-testing.c:167)
==20768==    by 0x406B52: main (test-item.c:887)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
4a7de5a403 test-item: Fix string leaks
This fixes:

==16901== 7 bytes in 1 blocks are definitely lost in loss record 9 of 1,154
==16901==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16901==    by 0x36E564F679: g_malloc (gmem.c:97)
==16901==    by 0x36E56688AE: g_strdup (gstrfuncs.c:356)
==16901==    by 0x4C3098F: secret_item_get_label (secret-item.c:1922)
==16901==    by 0x402A65: test_create_sync (test-item.c:203)
==16901==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16901==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16901==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16901==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16901==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16901==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16901==    by 0x406AAE: main (test-item.c:880)
==16901==-
==16901== 7 bytes in 1 blocks are definitely lost in loss record 10 of 1,154
==16901==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16901==    by 0x36E564F679: g_malloc (gmem.c:97)
==16901==    by 0x36E56688AE: g_strdup (gstrfuncs.c:356)
==16901==    by 0x4C3098F: secret_item_get_label (secret-item.c:1922)
==16901==    by 0x402DB6: test_create_async (test-item.c:249)
==16901==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16901==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16901==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16901==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16901==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16901==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16901==    by 0x406AAE: main (test-item.c:880)
==16901==-

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
66888a1e6a test-item: Fix GHashTable leak
This fixes:
==16901== 248 (88 direct, 160 indirect) bytes in 1 blocks are definitely lost in loss record 1,108 of 1,154
==16901==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16901==    by 0x36E564F679: g_malloc (gmem.c:97)
==16901==    by 0x36E5666CD2: g_slice_alloc (gslice.c:1007)
==16901==    by 0x36E563860D: g_hash_table_new_full (ghash.c:711)
==16901==    by 0x4047B2: test_set_attributes_async (test-item.c:493)
==16901==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16901==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16901==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16901==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16901==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16901==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16901==    by 0x406AAE: main (test-item.c:880)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
cd96ccffcd test-item: Fix GError leak
This fixes:
==16901== 94 (16 direct, 78 indirect) bytes in 1 blocks are definitely lost in loss record 901 of 1,154
==16901==    at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==16901==    by 0x36E564F679: g_malloc (gmem.c:97)
==16901==    by 0x36E5666CD2: g_slice_alloc (gslice.c:1007)
==16901==    by 0x36E563522B: g_error_new_valist (gerror.c:386)
==16901==    by 0x36E563560A: g_set_error (gerror.c:560)
==16901==    by 0x4C2CFB2: secret_item_initable_init (secret-item.c:480)
==16901==    by 0x36E6E5D83E: g_initable_new_valist (ginitable.c:228)
==16901==    by 0x36E6E5D8F5: g_initable_new (ginitable.c:146)
==16901==    by 0x4C3E711: secret_item_new_for_dbus_path_sync (secret-paths.c:286)
==16901==    by 0x402506: test_new_sync_noexist (test-item.c:121)
==16901==    by 0x36E566FB92: test_case_run (gtestutils.c:2124)
==16901==    by 0x36E566FB92: g_test_run_suite_internal (gtestutils.c:2185)
==16901==    by 0x36E566FD5A: g_test_run_suite_internal (gtestutils.c:2196)
==16901==    by 0x36E56700DA: g_test_run_suite (gtestutils.c:2249)
==16901==    by 0x36E5670110: g_test_run (gtestutils.c:1553)
==16901==    by 0x4C5A0EA: egg_tests_run_with_loop (egg-testing.c:167)
==16901==    by 0x406AAE: main (test-item.c:880)

https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
a2e76aede7 Fix 'attributes' typo in API doc
https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Christophe Fergeau
1be4264b76 secret-item: Fix 'convenince' typo
https://bugzilla.gnome.org/show_bug.cgi?id=756766
2015-10-19 12:09:50 +02:00
Stef Walter
ad77f143e6 libsecret: Fix up the tests for recent regressions 2015-04-14 10:48:19 +02:00
Stef Walter
e8a2b3cd5a Add license headers to enum template files 2014-12-04 22:50:26 +01:00
Stef Walter
d205542ba3 Fix for GObject-Introspection annotation changes
The GTK-Doc form of annotations is deprecated.
2014-09-09 15:18:33 +02:00
Stef Walter
068e80451b Makefile.am: Fix make distcheck again 2014-03-05 12:59:48 +01:00
Stef Walter
0d116b7177 libsecret: Fix uninitialized access in _secret_attributes_validate() 2014-03-05 12:59:48 +01:00
Stef Walter
460d36e32c Makefile.am: Look in $builddir for headers when building vala tests 2014-03-04 23:42:42 +01:00
Stef Walter
7d58d2d2b0 Makefile.am: Fix typo in last commit 2014-03-04 22:22:10 +01:00
Stef Walter
f9a32fb043 Makefile.am: Add dependencies on vapis from vala tests 2014-03-04 21:55:07 +01:00
Stef Walter
b24d7d78f7 Makefile.am: Get the dependencies of libsecret-testable.so right 2014-03-04 21:23:58 +01:00
Stef Walter
5910155863 Makefile.am Fix build of vala tests
valac is very hard to make happy
2014-03-04 21:20:41 +01:00
Stef Walter
a1036d0053 Makefile.am: Quiet down one last rule 2014-03-04 21:20:25 +01:00
Stef Walter
59a8238971 libsecret: Fix documentation typos 2014-03-04 14:15:43 +01:00
Stef Walter
6b7d643929 libsecret: Add secret_service_encode_dbus_secret() and opposite
Add secret_service_encode_dbus_secret() and
secret_service_decode_dbus_secret() functions for encoding
and decoding the Secret Service API DBus structs that carry
secrets on the wire.

These are not added to the stable or scripting APIs.
2014-03-04 14:15:27 +01:00
Stef Walter
b72048c920 Makefile.am: Use a single Makefile.am and parallel tests
Allow parallel building and testing by using a single Makefile.am

Implement parallel testing using TAP, with various drivers and
compilers living in the build/ directory.

Fix all sorts of issues that this caused, including builddir != srcdir,
leaks in tests and so on.

It would have been nice to break out all the above into separate
commits ... blush.
2014-03-04 12:57:19 +01:00
Stef Walter
66e8949b7b Remove unstable vapi
Just use the main vapi, and expect people to define the relevant
SECRET_WITH_UNSTABLE preprocessor macro.

https://bugzilla.gnome.org/show_bug.cgi?id=721429
2014-01-04 11:17:18 +01:00
Ryan Lortie
0257a68106 libsecret: more sed portability changes
As per POSIX, a '\' and a newline is expected after the 'i' command.

https://bugzilla.gnome.org/show_bug.cgi?id=720087
2013-12-16 17:35:54 +01:00
Stef Walter
dd6fcf87bb Mark most of unstable API as stable
This is with the exception of the 'path' functions.
2013-12-11 10:57:22 +01:00
Stef Walter
71e2791ea3 secret-prompt: Use string window ids
This is more portable and exposes what's actually in the Secret
Service API. This change was made before going stable with the
prompting functions.
2013-12-11 10:57:22 +01:00
Stef Walter
d743d4dbcc tests: Fix up the javascript and python tests 2013-12-11 10:12:51 +01:00
Stef Walter
37d1b73c25 tests: Stop when either the javascript or python tests fail 2013-12-11 10:12:51 +01:00
Stef Walter
7b7e886288 test-attributes: Remove deprecated use of g_test_trap_fork() 2013-12-11 10:12:51 +01:00
Stef Walter
8d297361de libsecret: Don't use non-portable sed -i shell command
https://bugzilla.gnome.org/show_bug.cgi?id=720087
2013-12-11 10:12:50 +01:00
Stef Walter
482dc34d74 Fix documentation warnings 2013-12-11 08:26:58 +01:00
Stef Walter
9dc2f2c112 More reliable means of checking if object was finalized
Don't try to use G_IS_OBJECT() to see if an object was finalized
as this segfaults in corner cases, even with our crafty check
for a pointer within our memory space.

https://bugzilla.gnome.org/show_bug.cgi?id=705202
2013-08-15 10:04:30 +02:00
Stef Walter
5c9001ab6f Clarify documentation for secret_service_clear_xxx()
https://bugzilla.gnome.org/show_bug.cgi?id=705629
2013-08-07 21:08:26 +02:00
Stef Walter
46fa081063 Use AM_CPPFLAGS instead of INCLUDES
automake 1.13 deprecates the latter
2013-06-21 15:11:15 +02:00
Stef Walter
bdbdadf40c Pass return_type to prompt async begin functions, rather than finish
Much like g_dbus_connection_call() we now pass our return_type value
when starting the async operation. This unbreaks vala and various
other bindings that make assumptions about the form of xxx_finish()
async calls.

This is an API/API break, but its to the portion of the library
marked as unstable. Only used by seahorse (in jhbuild) and updated
usage there.
2013-06-21 15:11:14 +02:00
Stef Walter
d6367b1de0 Simpler way to use custom service/collection/item types
The previous way of setting collection_gtype and item_gtype
on SecretServiceClass was not very bindings friendly. Instead
allow per instance virtual functions to return the GTypes.
2013-06-21 15:11:14 +02:00
Stef Walter
143f00ceef collection: Have gobject-introspection and glib-mkenums recognize flags
Recognize flags correctly by putting << in their enum values. This
is pretty ugly and I wish there was an annotation.
2013-06-21 15:11:14 +02:00
Stef Walter
1758194f26 service: Rename secret_service_new() and friends to open()
The _new() suffix confuses vala and gobject introspection thinking
that it's a constructor, and there's no way to tell it otherwise. And
things really get messy because they're async functions.

So while we're still unstable, rename these functions to
secret_service_open() secret_service_open_sync() and
secret_service_open_finish().

This is an API/API break, but its to the portion of the library
marked as unstable. Only used by seahorse (in jhbuild) and updated
usage there.
2013-06-21 15:11:14 +02:00
Stef Walter
cec740fea9 Add secret_value_get_text() function to return NULL terminated secret 2013-06-21 15:11:14 +02:00
Jiří Klimeš
227a5b2904 Fix return types in secret_service_search_finish() on error paths
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=698040
2013-06-21 15:11:14 +02:00
Peter Bloomfield
3cb4f0e178 Do not quote NULL sentinel
https://bugzilla.gnome.org/show_bug.cgi?id=695791
2013-03-14 06:52:42 +01:00
Claudio Saavedra
ab239c7f6b secret-value: allow empty strings
Passwords and other secrets are allowed to be empty strings, therefore
the check for length != 0 is wrong.

Add tests for empty SecretValue contents.

https://bugzilla.gnome.org/show_bug.cgi?id=694787
2013-03-04 09:33:26 +02:00
Claudio Saavedra
261749ec77 secret-attributes: improve validation of attributes table
Attributes table that are built by the library itself contain
the xdg:schema meta-attribute. Additionally,
secrets with a SECRET_SCHEMA_COMPAT_NETWORK schema might also have
libgnomekeyring specific meta-attributes (prefixed 'gkr'). During
validation, ensure that the former is consistent with the name
of the schema and ignore the latter.

Add tests for these changes

https://bugzilla.gnome.org/show_bug.cgi?id=694107
2013-02-26 19:30:33 +01:00
Stef Walter
ddd9bdd2e9 Fix introspection for secret_value_get() to return a uint8
This works around a crash in pygobject.

https://bugzilla.gnome.org/show_bug.cgi?id=694448
2013-02-26 15:55:49 +01:00
Stef Walter
0e9870bd35 Try to unlock locked collection when storing an item
And add tests to verify this behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=693723
2013-02-19 07:08:57 +01:00
Stef Walter
c2d6affadd Use correct annotations for Gio.DBusProxy 2013-02-13 17:19:02 +01:00
Stef Walter
f4e4ed10da Release version 0.12 2012-11-21 17:54:08 +01:00
Stef Walter
fb5f66296f Don't print messages when creating default collection
* This is expected behavior, so don't complain.

https://bugzilla.gnome.org/show_bug.cgi?id=688165
2012-11-14 11:11:23 +01:00
Stef Walter
a23ee598c7 Rework how we strip remote DBus errors
* This is necessary because sometimes we don't want to complain,
   for expected errors, when running nested operations.
 * The fact that we have to do this is silly, and soon there
   will be a solution in glib itself.

https://bugzilla.gnome.org/show_bug.cgi?id=688165
2012-11-14 11:11:23 +01:00
Stef Walter
430b217e3e Translated label for automatically created default keyrings
https://bugzilla.gnome.org/show_bug.cgi?id=688165
2012-11-14 11:11:23 +01:00
Stef Walter
afc1d65679 When storing a secret, create default keyring if necessary
* If the default keyring does not exist when storing a secret
   try and create it.
 * We handle both secrets that correctly return NoSuchObject
   and ones that just return the silly DBus UnknownMethod error.

https://bugzilla.gnome.org/show_bug.cgi?id=688165
2012-11-14 11:11:23 +01:00
Stef Walter
4eb3c4577e Fix collection creation bugs in mock service
* Guarantee that collections have unique paths
 * Set the alias of new collections correctly

https://bugzilla.gnome.org/show_bug.cgi?id=688165
2012-11-14 11:11:23 +01:00
Stef Walter
21f2ccea31 Share the memory pool with the gcr or libgnome-keyring library. 2012-10-27 12:46:59 +02:00
Stef Walter
7cea18071b Bring over a new version of the secure memory code from gcr
* This allows libraries to share the pool if they have the same
   version of the secure memory code.
2012-10-27 12:23:39 +02:00
Stef Walter
24cc1e118f Fix for glib deprecations
* g_type_init() was deprecated in glib 2.35.0
2012-10-22 20:50:48 +02:00
Stef Walter
7e02a594a7 Better critical preconditions for invalid attributes
* When passing NULL for a string vararg attribute print
   a critical warning.
 * Make all attribute warnings critical
 * Add tests for the various critical warnings

https://bugzilla.gnome.org/show_bug.cgi?id=686015
2012-10-12 18:28:14 +02:00
Stef Walter
131f2b209d Fix gcc warning about uninitialized warning 2012-08-20 15:58:26 +02:00
Evan Nemerson
8f3387cacc vala: use nodist sources for vala test cases
https://bugzilla.gnome.org/show_bug.cgi?id=681330
2012-08-16 11:30:14 +02:00
Stef Walter
4001cdf871 Don't link to secure memory code twice
* This leads to problems with the tests not being able to free
   non-pageable memory returned from libsecret-testable.so
2012-08-06 16:08:13 +02:00
Stef Walter
18e125d462 More licensing tweaks
* Actually include in the tarball the other licenses for test code
 * Refer to COPYING.TESTS not COPYING.GPL

https://bugzilla.gnome.org/show_bug.cgi?id=681302
2012-08-06 16:08:13 +02:00
Matthias Clasen
9011932730 Actually export SECRET_SCHEMA_NOTE
The regex for exported symbols was keeping the predefined
schemas from being available to outside users of the library.
This was showing up as a link error for seahorse, which is
trying to use SECRET_SCHEMA_NOTE.

https://bugzilla.gnome.org/show_bug.cgi?id=681255
2012-08-06 08:31:14 -04:00
Stef Walter
e43cba8174 Fix up libsecret licensing
* License libsecret under LGPL2.1+. We can do this because the
   files that make up the library are either LGPL2.0+ or LGPL2.1+
 * Correctly include a file which contains the full texts of the
   various licenses used in the tests.
 * Include license headers in some files that contained no license
   headers.

https://bugzilla.gnome.org/show_bug.cgi?id=680781
2012-08-06 11:25:08 +02:00
Stef Walter
66a7a81216 Fix introspection tests
* Regressed due to hiding of internal symbols in libsecret.so and
   creation of a separate libsecret-testable.so library
2012-07-31 14:56:52 +02:00
Stef Walter
e34381276e Set correct module flags on libsecret
* Pointed out by Robert Ancell

https://bugzilla.gnome.org/show_bug.cgi?id=680207
2012-07-24 06:24:05 +02:00
Stef Walter
45e01e6600 Match schema names for notes and network passwords
* These are old item types from libgnome-keyring, and
   gnome-keyring-daemon has special code to generate the
   schema for these types of items.
2012-07-14 13:25:39 +02:00
Stef Walter
ebc65dba98 Remove multiple definitions of SecretCollection
https://bugzilla.gnome.org/show_bug.cgi?id=679913
2012-07-14 13:23:16 +02:00
Stef Walter
ce03e082a2 Remove empty secret-unstable.h file 2012-07-14 12:11:02 +02:00