From b5036fbe14ee8e6a1e98f34e4bf0bf499e19d406 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 9 Dec 2008 21:57:09 +0000 Subject: Fix problem with objects being shared among slots. --- module/p11-capi-token.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/p11-capi-token.c b/module/p11-capi-token.c index f6ef2ca..c76d6ce 100644 --- a/module/p11-capi-token.c +++ b/module/p11-capi-token.c @@ -177,6 +177,7 @@ object_hash_func(const void* a) { P11cObject* obj = (P11cObject*)a; unsigned int hash = p11c_hash_pointer(obj->obj_funcs); + hash ^= p11c_hash_integer((int)obj->slot); hash ^= (obj->obj_funcs->hash_object)(obj); return hash; } @@ -188,6 +189,8 @@ object_equal_func(const void* a, const void* b) P11cObject* cb = (P11cObject*)b; if(ca == cb) return 1; + if(ca->slot != cb->slot) + return 0; if(ca->obj_funcs != cb->obj_funcs) return 0; return (ca->obj_funcs->equal_object)(ca, cb); -- cgit v1.2.3