Smartcard + pkcs11 = segmentation fault...
Sven Geggus
lists at fuchsschwanzdomain.de
Thu Mar 1 12:14:18 CET 2012
Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote:
> To my understanding the token contains an object without an ID.
> Could you add below this code (after else if (version != NULL))
> http://git.savannah.gnu.org/gitweb/?p=gnutls.git;a=blob;f=lib/pkcs11.c;h=83fad64b893c0e79d26428a539a6f2ab3db13f02;hb=gnutls_2_12_x#l398
> the following:
> else
> {
> *output_size = 0;
> if (output) output[0] = 0;
> return 0;
> }
>
> This would allow printing that object without crashing.
This gives a compiler error, but this slightly different Version does
compile and makes "p11tool --login --list-all" work!
gnutls-3.0.14/ > diff -u ./lib/pkcs11.c.orig ./lib/pkcs11.c
--- ./lib/pkcs11.c.orig 2012-02-23 08:43:11.000000000 +0100
+++ ./lib/pkcs11.c 2012-03-01 12:07:14.864362795 +0100
@@ -400,7 +400,14 @@
(int)version->minor);
terminate = 1;
}
-
+ else
+ {
+ *output_size = 0;
+ // if (output) output[0] = 0;
+ if (output) output = NULL;
+ return 0;
+ }
+
if (hexify)
{
/* terminate is assumed with hexify */
Thanks
Sven
--
"Das Einzige wovor wir Angst haben müssen ist die Angst selbst"
(Franklin D. Roosevelt)
/me is giggls at ircnet, http://sven.gegg.us/ on the Web
More information about the Gnutls-help
mailing list