help-gnutls
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Smartcard + pkcs11 = segmentation fault...


From: Sven Geggus
Subject: Re: Smartcard + pkcs11 = segmentation fault...
Date: Thu, 1 Mar 2012 11:14:18 +0000 (UTC)
User-agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (Linux/2.6.27.52-ztdummy (x86_64))

Nikos Mavrogiannopoulos <address@hidden> 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 address@hidden, http://sven.gegg.us/ on the Web



reply via email to

[Prev in Thread] Current Thread [Next in Thread]