Le Thursday 23 September 2004 � 21:18:26, John McBride a �crit:
> This was emailed to me, not sure if anyone here is aware of it. Concerns
> the file :
>
> muscleframework-1.1.5/libmusclepkcs11/src/p11x_object.c
>
> http://www.opendarwin.org/bugzilla/show_bug.cgi?id=1749
The patch says:
in PKCS11/p11x_object.c line 252.. it says
key_obj_id[1] = pKeyInfo->keyNum > 9 ? 55 + pKeyInfo->keyNum : 48 +
pKeyInfo->keyNum;
did you mean
key_obj_id[1] = pKeyInfo->keyNum > 9 ? 65 + pKeyInfo->keyNum : 48 +
pKeyInfo->keyNum;
this would give you objects 'k0' -'k9' -> 'kA' - 'KF'
The patch is wrong.
If pKeyInfo->keyNum == 10 we must use 'A'. ASCII code of 'A' is 65 so
the formula is:
pKeyInfo->keyNum -10 + 'A'
which is "simplified" in
pKeyInfo->keyNum +55
I agree the code could be better with something like:
sprintf(key_obj_id, "k%X", pKeyInfo->keyNum);
Bye,
--
Dr. Ludovic Rousseau [EMAIL PROTECTED]
-- Normaliser Unix c'est comme pasteuriser le camembert, L.R. --
_______________________________________________
Muscle mailing list
[EMAIL PROTECTED]
http://lists.drizzle.com/mailman/listinfo/muscle