summaryrefslogtreecommitdiff
path: root/gck/gck-enumerator.c
Commit message (Collapse)AuthorAgeFilesLines
* Stop using GSliceNiels De Graef2023-01-161-2/+2
| | | | | | | | | | | | GLib is discussing deprecating/removing it upstream [1] since it has only limited uses. Next to that, it seems to bork stack traces here when using ASAN (for which you also have to specify `G_SLICE=always-malloc` too). In other words, let's just get rid of using `GSLice` and call the allocation APIs directly. [1]: https://gitlab.gnome.org/GNOME/glib/-/issues/1079
* Drop Gck list APINiels De Graef2022-07-171-12/+6
| | | | | | | | | | gck provided some APIs that made working with lists of `GObject`s easier. GLib has for a long time added API that works well enough for the same use case, like `g_list_copy_deep()`, `g_list_free_full()` and more recently also `g_clear_list()`, so use those instead. This commit also bumps the required GLib version to a more modern 2.64 (which is needed for the `g_clear_list()` API).
* Replace g_memdup with g_memdup2Niels De Graef2022-06-131-1/+1
|
* gck-enumerator: Use G_DECLARE_FINAL_TYPE to declare the typeCorentin Noël2022-04-091-68/+67
| | | | Set the GMutex directly in the structure.
* gck: Remove floating capabilities to GckAttributesCorentin Noël2022-04-091-1/+1
| | | | | | | It is not necessary and makes it difficult to interact with GObject introspected languages. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
* gck: use the right namespace for GckUriData methodsCorentin Noël2022-04-091-1/+1
|
* gck: Remove authenticate_slot/object from GckModuleCorentin Noël2022-04-091-12/+2
| | | | Also remove the compatibility test and objects.
* gck-object-cache: Use G_DECLARE_INTERFACE to define the interfaceCorentin Noël2022-04-091-1/+1
| | | | | | | This means that GckObjectCacheIface becomes GckObjectCacheInterface and GCK_OBJECT_CACHE_GET_INTERFACE becomes GCK_OBJECT_CACHE_GET_IFACE. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
* docs: Port from gtk-doc to gi-docgenNiels De Graef2021-11-101-14/+6
| | | | | | | | | | | | | | gtk-doc has been slowly dying for the past few years. With gi-docgen we have a clear successor in sight to replace the voodoo magic one needs to get the whole documentation setup. See the [gi-docgen tutorial] for more info on how the system works. Since we're now only the C compiler (and GIR) parse the C code, that means we can also get rid of all the special escapes for the # character in PKCS#11. [gi-docgen tutorial]: https://gnome.pages.gitlab.gnome.org/gi-docgen/tutorial.html
* gck-call: Make the API more consistent, making it always handle GckCall pointersMarco Trevisan (Treviño)2021-01-191-3/+5
| | | | | Never return or expect arguments as paramter for gck_call_* functions, instead use gck_call_get_arguments to interact with them when needed
* gck-call: Move cb_object parameter to the async_ready functionsMarco Trevisan (Treviño)2021-01-191-2/+2
| | | | | This is to mimic GTask more and so we can avoid using a temporary task only for temporary storing an object pointer.
* gck-call: Simplify the code by using GTask based implementationMarco Trevisan (Treviño)2021-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | GckCall uses its own implementation of threads pool to handle the async calls, now that we've GTask this code can be simplified by reusing GLib code. I didn't want to change the API in this commit, even if private not to mix changes together, so the functions still are used as they used to be The main difference is that the async_pre and async_ready prepare a GTask instance, while the async_go starts a thread using the gtask function. Callback functions needed to be adapted to the new GAsyncResult type. Tests needed also some tuning as the underneath task holding a reference to the source object might be finalized at later stage, when the thread-related data is removed, as per this we may wait a bit to check whether a source object gets finalized, this is due to GNOME/GLib#1346.
* gck: Use G_PARAM_STATIC_STRINGSNiels De Graef2020-01-041-4/+7
| | | | | | This prevents some unnecessary string copies, resulting in less memory used and some unnecessary performance overhead being removed. Well, a little bit at least.
* Don't use deprecated (allow-none) GIR annotationNiels De Graef2020-01-031-5/+5
| | | | | It should be replaced with either `(optional)`, `(nullable)`, or in some cases both.
* gck: g_type_class_add_private() is deprecatedNiels De Graef2019-05-241-4/+2
| | | | | Use `G_ADD_PRIVATE()` (or the convenience macro `G_DEFINE_TYPE_WITH_PRIVATE()`) instead.
* gck: Remove an unnecessary (transfer) annotationPhilip Withnall2017-01-121-1/+1
| | | | | | | GTypes cannot be owned or unowned, so a (transfer) annotation makes no sense. g-ir-scanner was warning about it. https://bugzilla.gnome.org/show_bug.cgi?id=775685
* Fix gck_enumerator_next_async annotationDaiki Ueno2016-03-081-1/+1
| | | | | | The return value should be a list of GckObject, rather than GckModule. https://bugzilla.gnome.org/show_bug.cgi?id=763301
* Use the g_debug() mechanism from GLib directlyStef Walter2014-09-031-41/+31
| | | | | Rather than using our own _gck_debug() and _gcr_debug() wrappers.
* Release version 3.11.913.11.91Stef Walter2014-03-061-1/+1
|
* gck: Add gck_enumerator_set_object_type_full() functionStef Walter2014-03-031-9/+56
| | | | | | | | This is more bindable than setting fields in the GckObjectCacheIface struct directly. Hide the old gck_enumerator_set_object_type() for scripting and introspection using languages.
* Updated FSF's addressDaniel Mustieles2014-01-311-2/+1
|
* gck: Keep enumerating if getting info about one slot fails.Stef Walter2012-09-251-2/+4
| | | | | | * This is happening with the opensc PKCS#11 driver. https://bugzilla.gnome.org/show_bug.cgi?id=684359
* Remove support code for old glib versionsStef Walter2012-06-261-8/+0
| | | | | | * Remove a bunch of #ifdefs for old glib versions prior to 2.32.0. * Already bumped glib dependency in a recent commit.
* Documentation fixesStef Walter2012-06-261-1/+1
| | | | | * Clean up documentation and introspection warnings * Separate GcrImportInteraction docs into own page
* gck: Add documentation for newly functionsStef Walter2011-12-081-1/+1
|
* gck: Rename GckObjectAttributes to GckObjectCacheStef Walter2011-12-081-5/+5
| | | | | | | * And allow updating of the attributes, in particula adding attributes that are discovered. * Add a gck_object_cache_lookup() methods which load attributes and then updates the cache if the object has a cache.
* gck: Add floating references to GckAttributesStef Walter2011-12-081-1/+1
| | | | | | * Allows us more flexibility in our API in the future * Simplifies the common case of generating a set of attributes and directly passing it to a gck function
* gck: Add GckBuilder as a mutable attribute setStef Walter2011-12-081-17/+7
| | | | | | | | * Use GckBuilder to build a set of attributes, and then GckAttributes is a immutable set of attributes. * We reference count the memory used in attributes, so as we copy and transfer the attributes without duplicating values unnecessarily
* Fix build for glib 2.31 deprecationsStef Walter2011-12-061-0/+10
| | | | | | * Mainly g_mutex_new/g_mutex_free g_cond_new/g_cond_free * Since we like to build with the last stable version of glib, using #ifdef until these glib changes make it into a stable release.
* gck: Make the gck_attributes_to_string() function publicStef Walter2011-11-301-3/+3
| | | | * Used for debugging and logging
* gck: Retrieve attributes in GckEnumerator properlyStef Walter2011-11-291-48/+42
| | | | | | | * Previously retrieved attributes only for first enumerator iteration. * Properly retrieve attributes for objects found, but not yet attributes retrieved.
* Fix bugs and unused code highlighted by the clang static analyzerStef Walter2011-11-211-1/+0
|
* gck: Chaining of enumeratorsStef Walter2011-11-021-37/+161
| | | | | | | * Add functions gck_enumerator_get_chained() and gck_enumerator_set_chained() * Chaining enumerator returns results from the chained enumerator after all results have been retrieved from the former.
* gck: Allow enumerating objects on a sessionStef Walter2011-11-021-24/+76
| | | | | | * Add gck_session_enumerate_objects() * This has several advantages such as retrieving attributes during the enumeration, etc.
* gck: Documentation fix upStef Walter2011-10-121-4/+3
|
* gck: Enumerator can now retrieve object attributesStef Walter2011-10-121-86/+327
| | | | | | | | | | * New interface called GckObjectAttributes. Callers derive from GckObject, implement GckObjectAttributes and set fields in the iface to denote which attributes are interested in. * Caller passes type of derived object to gck_enumerator_set_object_type() and then enumerator will retrieve attributes set in iface, and return objects of that type * GckObjectAttributes has attributes property.
* gck: Integrate GTlsInteraction into libgckStef Walter2011-10-031-117/+194
| | | | | | * Deprecate the GckModule signals which were used for password auth * Fire deprecated GckModule signals from a compat GTlsInteraction * Add some tests for this integration
* gck: Fix introspection warnings and complete introspection annotationsStef Walter2011-09-281-4/+6
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=655651
* gck: Add debug output to GckEnumerator and bits of GckSessionStef Walter2011-08-311-10/+60
| | | | | * Also fix up Gcr debugging * And add debugging to trust stuff.
* gck: Use p11-kit for module loading, messages, and uri parsing.Stef Walter2011-07-061-6/+6
|
* gck: Cleanup the documentationStef Walter2011-04-051-3/+65
|
* [gck] Update PKCS#11 URI to add library support.Stef Walter2011-01-191-22/+27
| | | | | Add library-description and library-description and library-manufacturer parts. And refactor to support parsing in different contexts better.
* [gck] Allow enumeration over slots as well as modules.Stef Walter2010-12-181-64/+52
| | | | | Can now enumerate object over a list of slots, as well as a list of modules.
* [gck] Fix crash in enumerator when C_FindObjects fails.Stef Walter2010-11-291-3/+2
| | | | | If C_FindObjects failed when used in a gck_enumerate_xxx() and friends, then we would crash.
* [gck] Add session options, remove module options.Stef Walter2010-09-271-7/+18
| | | | | | Add concept of session options, which are different (but sometimes related to) session PKCS#11 flags. The session options take the place of module options, which were much harder to use appropriately.
* Port gnome-keyring to new gck library.Stef Walter2010-08-251-13/+47
|
* [gck] Implement PkCS#11 URI's and enumerationStef Walter2010-08-091-0/+689
* PKCS#11 URI spec is not completely finalized yet. * Removed old callback style enumeration and replaced with gio style.