summaryrefslogtreecommitdiff
path: root/gck/gck-mock.c
Commit message (Collapse)AuthorAgeFilesLines
* gck: Remove floating capabilities to GckAttributesCorentin Noël2022-04-091-19/+19
| | | | | | | 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-mock: Also store objects in the order they are takenIain Lane2019-02-061-14/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With GLib 2.59, gnome-keyring's `test-login-auto` test fails: Gcr-CRITICAL **: 14:34:24.126: expected prompt property 'choice-label' to be "Automatically unlock this keyring whenever I\342\200\231m logged in", but it is instead "" This is because, in `mock_secret_C_Initialize()` we assign two sets of fields to the mock module, one with `CKA_G_LOGIN_COLLECTION` → `CK_TRUE` and one with it pointing to `CK_FALSE`. This variable is used to decide, via `is_login_keyring()`, whether to call `setup_unlock_keyring_login()` or `setup_unlock_keyring_other()`. The first one sets `choice-label` to the empty string. The second one is what we want, and upgrading GLib made it flip. The reason is the same as the previous fix: the mock-secret-store expects to be able to insert items into a hash table and then iterate it and get them out in the same order. That was never guaranteed, and now doesn't happen. Let's keep a parallel list which keeps track of the order things were added. And then instead of iterating the hash table, we iterate this list. This is a backport of 7aba0e6aadd75fc688bf7f086a620e4dc41da6d0 from gnome-keyring.
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* gck: Fix warnings printed by p11-kit during testsStef Walter2012-09-251-1/+1
| | | | | | | * Don't pass invalid data to the mutex functions in an effort to test them, while running other tests. https://bugzilla.gnome.org/show_bug.cgi?id=684476
* Use p11-kit/pkcs11.h instead of shipping a copy with gck.Evan Nemerson2012-08-041-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=680271
* Fix copyright headers.Jordi Mallach2012-03-161-3/+3
| | | | | | | | Many files were missing “Public” in “GNU Lesser General Public License”, probably due to a mass replace that went a bit too far. Restore the correct wording in all affected places. https://bugzilla.gnome.org/show_bug.cgi?id=672187
* gck: Add floating references to GckAttributesStef Walter2011-12-081-13/+20
| | | | | | * 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-109/+142
| | | | | | | | * 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
* gcr: Implement functions for loading and using SubjectPublicKeyInfoStef Walter2011-11-231-4/+3
| | | | | | | | | | | * Move key calculation routines into gcr-subject-public-key.c * Move creation of SPK from gcr-fingerprint.c into here * Implement loading of SPK from PKCS#11 certificates, public keys, private keys * Add support for parsing SubjectPublicKeyInfo to parser. Generates attributes for a CKO_PUBLIC_KEY * Fix bugs in DER encoding related to this. * More tweaks on testing infrastructure
* Add valgrind memory checking and fix up errorsStef Walter2011-11-211-1/+5
| | | | | | | | | * This is especially necessary after migrating to EggBytes since it's reference counted and an easy sourc of memory leaks * Remove threading from testing framework, as gcr isn't threadsafe in all parts. * Fix bugs discovered in memory checking. * Fix up some of the testing stuff.
* gck: Fix problem where gck_slot_open_session_async() leaked objectsStef Walter2011-11-151-0/+1
| | | | * Held a reference to the session and result, which kept the module
* Split the GCR and GCK libraries out of gnome-keyringsplitStef Walter2011-10-061-2/+2
| | | | | | | | | | | Commits prior to this commit will not build. To build old releases of Gcr or Gck you should use the gnome-keyring git module. This module currently depends on: gtk+ >= 3.0, glib >= 2.28.0, p11-kit >= 0.6, libgcrypt >= 1.2.2 Additionally it requires asn1Parser for building.
* gck: More introspection and documentation cleanupStef Walter2011-09-291-4/+4
| | | | * In particular, use guchar * for arrays of bytes.
* [gcr] Implement GcrPkcs11Certificate which loads certs from PKCS#11Stef Walter2010-12-061-0/+7
| | | | In particular we can lookup certs by issuer from the PKCS#11 store.
* [gcr] Complete tests of gcr_trust_xxx functionality.Stef Walter2010-11-291-0/+16
|
* [gck] Add session options, remove module options.Stef Walter2010-09-271-3/+1
| | | | | | 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.
* [gck] Rework testing and make mock module.Stef Walter2010-09-181-0/+1787
Make mock Pkcs#11 module better modularized, and available to other tests of other modules. Add more test helpers.