gpgsm: Fix storing of the serial number
authorWerner Koch <wk@gnupg.org>
Tue, 6 Dec 2011 15:45:46 +0000 (16:45 +0100)
committerWerner Koch <wk@gnupg.org>
Tue, 6 Dec 2011 15:45:46 +0000 (16:45 +0100)
* sm/certreqgen.c (create_request): Fix hex-bin conversion.

sm/certreqgen.c

index 41a6d7f..b4857b3 100644 (file)
@@ -889,7 +889,7 @@ create_request (ctrl_t ctrl,
           *p++ = '0';
           strcpy (p, string);
           for (p=hexbuf, len=0; p[0] && p[1]; p += 2)
-            ((unsigned char*)hexbuf)[len++] = xtoi_2 (s);
+            ((unsigned char*)hexbuf)[len++] = xtoi_2 (p);
           /* Now build the S-expression.  */
           snprintf (numbuf, DIM(numbuf), "%u:", (unsigned int)len);
           buf = p = xtrymalloc (1 + strlen (numbuf) + len + 1 + 1);