aboutsummaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
Diffstat (limited to 'scd')
-rw-r--r--scd/ChangeLog11
-rw-r--r--scd/apdu.c13
-rw-r--r--scd/app-common.h6
-rw-r--r--scd/app-openpgp.c18
-rw-r--r--scd/ccid-driver.c13
-rw-r--r--scd/iso7816.c20
-rw-r--r--scd/iso7816.h4
7 files changed, 76 insertions, 9 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index 4363888c6..f090e34c0 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,14 @@
+2003-10-01 Werner Koch <[email protected]>
+
+ * ccid-driver.c: Detect GnuPG 1.3 and include appropriate files.
+ * apdu.c: Ditto.
+ * app-openpgp.c: Ditto.
+ * iso7816.c: Ditto.
+ (generate_keypair): Renamed to ..
+ (do_generate_keypair): .. this.
+ * app-common.h [GNUPG_MAJOR_VERSION]: New.
+ * iso7816.h [GNUPG_MAJOR_VERSION]: Include cardglue.h
+
2003-09-30 Werner Koch <[email protected]>
* command.c (cmd_getattr): New command GETATTR.
diff --git a/scd/apdu.c b/scd/apdu.c
index d5f64c6d8..d5b93de6e 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -28,7 +28,20 @@
# include <opensc/opensc.h>
#endif
+#if GNUPG_MAJOR_VERSION == 1
+/* This is used with GnuPG version < 1.9. The code has been source
+ copied from the current GnuPG >= 1.9 and is maintained over
+ there. */
+#include "options.h"
+#include "errors.h"
+#include "memory.h"
+#include "util.h"
+#include "i18n.h"
+#include "cardglue.h"
+#else /* GNUPG_MAJOR_VERSION != 1 */
#include "scdaemon.h"
+#endif /* GNUPG_MAJOR_VERSION != 1 */
+
#include "apdu.h"
#include "dynload.h"
#include "ccid-driver.h"
diff --git a/scd/app-common.h b/scd/app-common.h
index e4b9d2f6c..33f23127b 100644
--- a/scd/app-common.h
+++ b/scd/app-common.h
@@ -70,6 +70,10 @@ struct app_ctx_s {
};
+#if GNUPG_MAJOR_VERSION == 1
+int app_select_openpgp (APP app, unsigned char **sn, size_t *snlen);
+int app_get_serial_and_stamp (APP app, char **serial, time_t *stamp);
+#else
/*-- app.c --*/
void app_set_default_reader_port (const char *portstr);
APP select_application (void);
@@ -124,6 +128,8 @@ int app_openpgp_storekey (APP app, int keyno,
int app_openpgp_readkey (APP app, int keyno,
unsigned char **m, size_t *mlen,
unsigned char **e, size_t *elen);
+#endif
+
#endif /*GNUPG_SCD_APP_COMMON_H*/
diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 3a312696b..e8fe19ea1 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -24,10 +24,24 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
-
+#include <time.h>
+
+#if GNUPG_MAJOR_VERSION == 1
+/* This is used with GnuPG version < 1.9. The code has been source
+ copied from the current GnuPG >= 1.9 and is maintained over
+ there. */
+#include "options.h"
+#include "errors.h"
+#include "memory.h"
+#include "util.h"
+#include "i18n.h"
+#include "cardglue.h"
+#else /* GNUPG_MAJOR_VERSION != 1 */
#include "scdaemon.h"
-#include "app-common.h"
+#endif /* GNUPG_MAJOR_VERSION != 1 */
+
#include "iso7816.h"
+#include "app-common.h"
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index e0b48f880..b4fbc0b21 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -87,9 +87,16 @@
#define DRVNAME "ccid-driver: "
-#ifdef GNUPG_DEFAULT_SCDAEMON /* This source is used within the
- gnupg>=1.9 source tree. */
-# include "scdaemon.h"
+#ifdef GNUPG_MAJOR_VERSION /* This source is used within GnuPG. */
+
+# if GNUPG_MAJOR_VERSION == 1 /* GnuPG Version is < 1.9. */
+# include "options.h"
+# include "util.h"
+# include "memory.h"
+# include "cardglue.h"
+# else /* This is the modularized GnuPG 1.9 or later. */
+# include "scdaemon.h"
+# endif
# define DEBUGOUT(t) do { if (DBG_CARD_IO) \
log_debug (DRVNAME t); } while (0)
diff --git a/scd/iso7816.c b/scd/iso7816.c
index 2b06103ef..f4aa18c6f 100644
--- a/scd/iso7816.c
+++ b/scd/iso7816.c
@@ -24,10 +24,22 @@
#include <stdlib.h>
#include <string.h>
+#if GNUPG_MAJOR_VERSION == 1
+/* This is used with GnuPG version < 1.9. The code has been source
+ copied from the current GnuPG >= 1.9 and is maintained over
+ there. */
+#include "options.h"
+#include "errors.h"
+#include "memory.h"
+#include "util.h"
+#include "i18n.h"
+#else /* GNUPG_MAJOR_VERSION != 1 */
#include "scdaemon.h"
+#endif /* GNUPG_MAJOR_VERSION != 1 */
+
#include "iso7816.h"
#include "apdu.h"
-#include "dynload.h"
+
#define CMD_SELECT_FILE 0xA4
#define CMD_VERIFY 0x20
@@ -290,7 +302,7 @@ iso7816_internal_authenticate (int slot,
static gpg_error_t
-generate_keypair (int slot, int readonly,
+do_generate_keypair (int slot, int readonly,
const unsigned char *data, size_t datalen,
unsigned char **result, size_t *resultlen)
{
@@ -321,7 +333,7 @@ iso7816_generate_keypair (int slot,
const unsigned char *data, size_t datalen,
unsigned char **result, size_t *resultlen)
{
- return generate_keypair (slot, 0, data, datalen, result, resultlen);
+ return do_generate_keypair (slot, 0, data, datalen, result, resultlen);
}
@@ -330,7 +342,7 @@ iso7816_read_public_key (int slot,
const unsigned char *data, size_t datalen,
unsigned char **result, size_t *resultlen)
{
- return generate_keypair (slot, 1, data, datalen, result, resultlen);
+ return do_generate_keypair (slot, 1, data, datalen, result, resultlen);
}
diff --git a/scd/iso7816.h b/scd/iso7816.h
index d7e77a101..26b8d6aba 100644
--- a/scd/iso7816.h
+++ b/scd/iso7816.h
@@ -21,6 +21,10 @@
#ifndef ISO7816_H
#define ISO7816_H
+#if GNUPG_MAJOR_VERSION == 1
+#include "cardglue.h"
+#endif
+
gpg_error_t iso7816_select_application (int slot,
const char *aid, size_t aidlen);
gpg_error_t iso7816_verify (int slot,