summaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2003-11-12 16:17:44 +0100
committerWerner Koch <wk@gnupg.org>2003-11-12 16:17:44 +0100
commitdba40e5e45e80896dc8864c2ae97f026069e2906 (patch)
tree724a2e0f0f73ef66cf6284adb7e2463785874ffe /scd
parent2003-11-10 Moritz Schulte <mo@g10code.com> (diff)
downloadgnupg2-dba40e5e45e80896dc8864c2ae97f026069e2906.tar.xz
gnupg2-dba40e5e45e80896dc8864c2ae97f026069e2906.zip
Mainly changes to adjust for the changed KSBA API.
Diffstat (limited to 'scd')
-rw-r--r--scd/ChangeLog4
-rw-r--r--scd/card-dinsig.c13
-rw-r--r--scd/card-p15.c13
-rw-r--r--scd/card.c3
-rw-r--r--scd/command.c12
5 files changed, 23 insertions, 22 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index d3282b38a..cccd3b669 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,7 @@
+2003-11-12 Werner Koch <wk@gnupg.org>
+
+ Adjusted for API changes in Libksba.
+
2003-10-30 Werner Koch <wk@gnupg.org>
* apdu.c (close_ct_reader, close_pcsc_reader): Implemented.
diff --git a/scd/card-dinsig.c b/scd/card-dinsig.c
index 391a51da8..18a67abb6 100644
--- a/scd/card-dinsig.c
+++ b/scd/card-dinsig.c
@@ -79,9 +79,9 @@
#ifdef HAVE_OPENSC
#include <opensc/pkcs15.h>
+#include "scdaemon.h"
#include <ksba.h>
-#include "scdaemon.h"
#include "card-common.h"
static int dinsig_read_cert (CARD card, const char *certidstr,
@@ -113,12 +113,11 @@ dinsig_enum_keypairs (CARD card, int idx,
if (rc)
return rc;
- cert = ksba_cert_new ();
- if (!cert)
+ rc = ksba_cert_new (&cert);
+ if (rc)
{
- gpg_error_t tmperr = out_of_core ();
xfree (buf);
- return tmperr;
+ return rc;
}
krc = ksba_cert_init_from_mem (cert, buf, buflen);
@@ -126,9 +125,9 @@ dinsig_enum_keypairs (CARD card, int idx,
if (krc)
{
log_error ("failed to parse the certificate at idx %d: %s\n",
- idx, ksba_strerror (krc));
+ idx, gpg_strerror (krc));
ksba_cert_release (cert);
- return gpg_error (GPG_ERR_CARD);
+ return krc;
}
if (card_help_get_keygrip (cert, keygrip))
{
diff --git a/scd/card-p15.c b/scd/card-p15.c
index dfb05c03f..33c58e2c8 100644
--- a/scd/card-p15.c
+++ b/scd/card-p15.c
@@ -27,9 +27,9 @@
#ifdef HAVE_OPENSC
#include <opensc/pkcs15.h>
-#include <ksba.h>
#include "scdaemon.h"
+#include <ksba.h>
#include "card-common.h"
@@ -148,21 +148,20 @@ p15_enum_keypairs (CARD card, int idx,
return gpg_error (GPG_ERR_CARD);
}
- cert = ksba_cert_new ();
- if (!cert)
+ rc = ksba_cert_new (&cert);
+ if (rc)
{
- gpg_error_t tmperr = out_of_core ();
sc_pkcs15_free_certificate (certder);
- return tmperr;
+ return rc;
}
krc = ksba_cert_init_from_mem (cert, certder->data, certder->data_len);
sc_pkcs15_free_certificate (certder);
if (krc)
{
log_error ("failed to parse the certificate for private key %d: %s\n",
- idx, ksba_strerror (krc));
+ idx, gpg_strerror (krc));
ksba_cert_release (cert);
- return gpg_error (GPG_ERR_CARD);
+ return krc;
}
if (card_help_get_keygrip (cert, keygrip))
{
diff --git a/scd/card.c b/scd/card.c
index 0a71fb2df..042613294 100644
--- a/scd/card.c
+++ b/scd/card.c
@@ -28,9 +28,10 @@
#ifdef HAVE_OPENSC
#include <opensc/pkcs15.h>
#endif
-#include <ksba.h>
#include "scdaemon.h"
+#include <ksba.h>
+
#include "card-common.h"
/* Map the SC error codes to the GNUPG ones */
diff --git a/scd/command.c b/scd/command.c
index 363b46480..122a2f3c1 100644
--- a/scd/command.c
+++ b/scd/command.c
@@ -25,11 +25,11 @@
#include <string.h>
#include <ctype.h>
#include <unistd.h>
-#include <ksba.h>
#include <assuan.h>
#include "scdaemon.h"
+#include <ksba.h>
#include "app-common.h"
/* maximum length aloowed as a PIN; used for INQUIRE NEEDPIN */
@@ -453,18 +453,16 @@ cmd_readkey (ASSUAN_CONTEXT ctx, char *line)
goto leave;
}
- kc = ksba_cert_new ();
- if (!kc)
+ rc = ksba_cert_new (&kc);
+ if (rc)
{
- rc = out_of_core ();
xfree (cert);
goto leave;
}
rc = ksba_cert_init_from_mem (kc, cert, ncert);
if (rc)
{
- log_error ("failed to parse the certificate: %s\n", ksba_strerror (rc));
- rc = map_ksba_err (rc);
+ log_error ("failed to parse the certificate: %s\n", gpg_strerror (rc));
goto leave;
}
@@ -531,7 +529,7 @@ pin_cb (void *opaque, const char *info, char **retstr)
ASSUAN_CONTEXT ctx = opaque;
char *command;
int rc;
- char *value;
+ unsigned char *value;
size_t valuelen;
*retstr = NULL;