[Opendnssec-user] proper C_FindObjectsInit

Jack Craig jack.craig.aptos at gmail.com
Mon Jan 20 21:15:19 UTC 2014


The spectre of hindsight revelation is blinding!  Thank you So much!

It makes perfect sense now, ...


On Mon, Jan 20, 2014 at 2:12 AM, Rickard Bellgrim <rickard at opendnssec.org>wrote:

>
>         {CKA_LABEL, (void *)"card_data", sizeof("card_data" -1) },
>>
>
> Maybe just a typo in the email, but the -1 should be outside the
> parentheses.
>
>
>> i compute 6 elements total, But then in the C_FindObjectsInit, i pass
>> ulCount - 1
>> and i get no matches.
>>
>> should i be doing
>>
>> *  rv = C_FindObjectsInit( g_session, Template, ulCount );*
>>
>> am i doing this wrong?  Tia, jackc
>>
>
> The indexing of the array goes from 0 to 5. But when you count the content
> of the array then it goes from 1 to 6. So ulCount should be equal to 6.
>
> However, you should get a match with just 5 attributes. The extra
> attribute will just narrow the search. Is the object a private object? Then
> you also need to C_Login() on your session before searching.
>
> When searching for objects you usually just search using the CKA_CLASS and
> CKA_ID. E.g. a private key with ID 1234.
>
> This is the code that OpenDNSSEC uses when searching for objects.
>
> http://fisheye.opendnssec.org/browse/~br=trunk/opendnssec/trunk/OpenDNSSEC/libhsm/src/lib/libhsm.c?hb=true#to1132
>
> // Rickard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendnssec.org/pipermail/opendnssec-user/attachments/20140120/bfe56fa3/attachment.htm>


More information about the Opendnssec-user mailing list