Fixes to make inclusion of card raleted source files into 1.3 easier.

This commit is contained in:
Werner Koch 2003-10-02 10:27:34 +00:00
parent 59a61b3c93
commit f194ebc782
11 changed files with 95 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2003-10-01 Werner Koch <wk@gnupg.org>
* configure.ac (AH_BOTTOM): Define GNUPG_MAJOR_VERSION.
2003-09-23 Werner Koch <wk@gnupg.org>
Merged most of David Shaw's changes in 1.3 since 2003-06-03.

View File

@ -238,6 +238,11 @@ AH_BOTTOM([
/* Tell libgcrypt not to use its own libgpg-error implementation. */
#define USE_LIBGPG_ERROR 1
/* This is the major version number of GnuPG so that
source included files can test for this. Note, that\
we use 2 here even for GnuPG 1.9.x. */
#define GNUPG_MAJOR_VERSION 2
#include "g10defs.h"
])

View File

@ -1,3 +1,7 @@
2003-10-01 Werner Koch <wk@gnupg.org>
* card-util.c: Tweaked to use this source also under 1.3.
2003-09-30 Werner Koch <wk@gnupg.org>
* keylist.c (print_card_serialno): New.
@ -407,7 +411,7 @@
* card-util.c (card_status): New.
* call-agent.c (learn_status_cb): Parse more information.
* keylist.c (print_pubkey_info): Add FP arg for optinal printing
* keylist.c (print_pubkey_info): Add FP arg for optional printing
to a stream. Changed all callers.
2003-07-23 Werner Koch <wk@gnupg.org>

View File

@ -25,14 +25,20 @@
#include <errno.h>
#include <assert.h>
#if GNUPG_MAJOR_VERSION != 1
#include "gpg.h"
#endif
#include "util.h"
#include "i18n.h"
#include "ttyio.h"
#include "status.h"
#include "options.h"
#include "main.h"
#if GNUPG_MAJOR_VERSION == 1
#include "cardglue.h"
#else
#include "call-agent.h"
#endif
#define CONTROL_D ('D' - 'A' + 1)

View File

@ -1,3 +1,14 @@
2003-10-01 Werner Koch <wk@gnupg.org>
* 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 <wk@gnupg.org>
* command.c (cmd_getattr): New command GETATTR.

View File

@ -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"

View File

@ -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*/

View File

@ -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"

View File

@ -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)

View File

@ -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);
}

View File

@ -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,