mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
scd: Add some compatibility code for easier backporting.
* scd/app-common.h (APP_WRITEKEY_FLAG_FORCE): New. (APP_READKEY_FLAG_INFO): New. (APP_LEARN_FLAG_KEYPAIRINFO): New. (APP_LEARN_FLAG_MULTI): New. (struct app_ctx_s): New forward declaration. (struct app_ctx_s): Add members prep_reselect, reselect, and with_keygrip. (KEYGRIP_ACTION_SEND_DATA): New. (KEYGRIP_ACTION_WRITE_STATUS): New. (KEYGRIP_ACTION_LOOKUP): New. (APP_CARD): New macro. * scd/scdaemon.h: Include app-common.h and remove from all other files. (app_t): Move typedef to ... * scd/app-common.h: here. -- These changes will make it easier to backport changes from 2.3 to 2.2. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
55f46b33df
commit
6380126b31
@ -33,12 +33,26 @@
|
||||
/* Flags used with app_genkey. */
|
||||
#define APP_GENKEY_FLAG_FORCE 1 /* Force overwriting existing key. */
|
||||
|
||||
/* Flags used with app_writekey. */
|
||||
#define APP_WRITEKEY_FLAG_FORCE 1 /* Force overwriting existing key. */
|
||||
|
||||
/* Flags used with app_readkey. */
|
||||
#define APP_READKEY_FLAG_INFO 1 /* Send also a KEYPAIRINFO line. */
|
||||
|
||||
/* Bit flags set by the decipher function into R_INFO. */
|
||||
#define APP_DECIPHER_INFO_NOPAD 1 /* Padding has been removed. */
|
||||
|
||||
/* Flags used by the app_write_learn_status. */
|
||||
#define APP_LEARN_FLAG_KEYPAIRINFO 1 /* Return only keypair infos. */
|
||||
#define APP_LEARN_FLAG_MULTI 2 /* Return info for all apps. */
|
||||
|
||||
|
||||
/* Forward declarations. */
|
||||
struct app_ctx_s;
|
||||
struct app_local_s; /* Defined by all app-*.c. */
|
||||
|
||||
typedef struct app_ctx_s *app_t;
|
||||
|
||||
struct app_ctx_s {
|
||||
struct app_ctx_s *next;
|
||||
|
||||
@ -67,6 +81,11 @@ struct app_ctx_s {
|
||||
struct app_local_s *app_local; /* Local to the application. */
|
||||
struct {
|
||||
void (*deinit) (app_t app);
|
||||
|
||||
/* prep_reselect and reselect are not used in this version of scd. */
|
||||
gpg_error_t (*prep_reselect) (app_t app, ctrl_t ctrl);
|
||||
gpg_error_t (*reselect) (app_t app, ctrl_t ctrl);
|
||||
|
||||
gpg_error_t (*learn_status) (app_t app, ctrl_t ctrl, unsigned int flags);
|
||||
gpg_error_t (*readcert) (app_t app, const char *certid,
|
||||
unsigned char **cert, size_t *certlen);
|
||||
@ -116,10 +135,24 @@ struct app_ctx_s {
|
||||
gpg_error_t (*check_pin) (app_t app, const char *keyidstr,
|
||||
gpg_error_t (*pincb)(void*, const char *, char **),
|
||||
void *pincb_arg);
|
||||
|
||||
/* with_keygrip is not used in this version of scd but having it
|
||||
* makes back porting app-*.c from later versions easier. */
|
||||
gpg_error_t (*with_keygrip) (app_t app, ctrl_t ctrl, int action,
|
||||
const char *keygrip_str, int capability);
|
||||
} fnc;
|
||||
};
|
||||
|
||||
|
||||
/* Action values for app_do_with_keygrip. */
|
||||
enum
|
||||
{
|
||||
KEYGRIP_ACTION_SEND_DATA,
|
||||
KEYGRIP_ACTION_WRITE_STATUS,
|
||||
KEYGRIP_ACTION_LOOKUP
|
||||
};
|
||||
|
||||
|
||||
/* Helper to get the slot from an APP object. */
|
||||
static inline int
|
||||
app_get_slot (app_t app)
|
||||
@ -131,6 +164,10 @@ app_get_slot (app_t app)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Macro to access members in app_t which are found in 2.3 in a linked
|
||||
* card_t member. */
|
||||
#define APP_CARD(a) (a)
|
||||
|
||||
|
||||
/*-- app-help.c --*/
|
||||
unsigned int app_help_count_bits (const unsigned char *a, size_t len);
|
||||
|
@ -81,7 +81,6 @@
|
||||
|
||||
#include "../common/i18n.h"
|
||||
#include "iso7816.h"
|
||||
#include "app-common.h"
|
||||
#include "../common/tlv.h"
|
||||
|
||||
|
||||
|
@ -39,7 +39,6 @@
|
||||
|
||||
#include "../common/i18n.h"
|
||||
#include "iso7816.h"
|
||||
#include "app-common.h"
|
||||
#include "../common/tlv.h"
|
||||
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "scdaemon.h"
|
||||
#include "app-common.h"
|
||||
#include "iso7816.h"
|
||||
#include "../common/tlv.h"
|
||||
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "scdaemon.h"
|
||||
#include "../common/i18n.h"
|
||||
#include "iso7816.h"
|
||||
#include "app-common.h"
|
||||
#include "../common/tlv.h"
|
||||
#include "apdu.h"
|
||||
#include "../common/host2net.h"
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include "../common/util.h"
|
||||
#include "../common/i18n.h"
|
||||
#include "iso7816.h"
|
||||
#include "app-common.h"
|
||||
#include "../common/tlv.h"
|
||||
#include "../common/host2net.h"
|
||||
#include "../common/openpgpdefs.h"
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "scdaemon.h"
|
||||
|
||||
#include "iso7816.h"
|
||||
#include "app-common.h"
|
||||
#include "../common/i18n.h"
|
||||
#include "../common/tlv.h"
|
||||
#include "apdu.h" /* fixme: we should move the card detection to a
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "scdaemon.h"
|
||||
|
||||
#include "iso7816.h"
|
||||
#include "app-common.h"
|
||||
#include "../common/tlv.h"
|
||||
#include "apdu.h"
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "scdaemon.h"
|
||||
#include "../common/exechelp.h"
|
||||
#include "app-common.h"
|
||||
#include "iso7816.h"
|
||||
#include "apdu.h"
|
||||
#include "../common/tlv.h"
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "scdaemon.h"
|
||||
#include <assuan.h>
|
||||
#include <ksba.h>
|
||||
#include "app-common.h"
|
||||
#include "iso7816.h"
|
||||
#include "apdu.h" /* Required for apdu_*_reader (). */
|
||||
#include "atr.h"
|
||||
|
@ -48,7 +48,6 @@
|
||||
|
||||
#include "../common/i18n.h"
|
||||
#include "../common/sysutils.h"
|
||||
#include "app-common.h"
|
||||
#include "iso7816.h"
|
||||
#include "apdu.h"
|
||||
#include "ccid-driver.h"
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <gcrypt.h>
|
||||
#include "../common/util.h"
|
||||
#include "../common/sysutils.h"
|
||||
#include "app-common.h"
|
||||
|
||||
|
||||
/* To convey some special hash algorithms we use algorithm numbers
|
||||
reserved for application use. */
|
||||
@ -112,7 +114,6 @@ struct server_control_s
|
||||
} in_data;
|
||||
};
|
||||
|
||||
typedef struct app_ctx_s *app_t;
|
||||
|
||||
/*-- scdaemon.c --*/
|
||||
void scd_exit (int rc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user