1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* keydb.h [!ENABLE_AGENT_SUPPORT]: Define dummy types.

* cardglue.c (assuan_strerror, assuan_transact): Dummy functions
        if not build with agent support.

	* zh_TW.po, zh_CN.po, es.po, ro.po: Updated.

        * tr.po: Updated from TP.  Note: this is an exception in general
        translations from the Robot are not anymore accepted.

        * regcomp.c (MB_CUR_MAX) [_WIN32]: Define it only if not defined.
This commit is contained in:
Werner Koch 2005-05-31 10:11:01 +00:00
parent 7d4043ca57
commit a6a93ac540
34 changed files with 6933 additions and 7065 deletions

View file

@ -1,5 +1,10 @@
2005-05-31 Werner Koch <wk@g10code.com>
* keydb.h [!ENABLE_AGENT_SUPPORT]: Define dummy types.
* cardglue.c (assuan_strerror, assuan_transact): Dummy functions
if not build with agent support.
* armor.c (check_input): Don't bail out on invalid header lines
unless in struict rfc2440 mode. Suggested by Richard Patterson.

View file

@ -46,7 +46,7 @@ struct app_ctx_s {
in case we need to divert the operation to an already running
agent. This if ASSUAN_CTX is not NULL we take this as indication
that all operations are diverted to gpg-agent. */
#if GNUPG_MAJOR_VERSION == 1 && defined(ENABLE_AGENT_SUPPORT)
#if GNUPG_MAJOR_VERSION == 1
assuan_context_t assuan_ctx;
#endif /*GNUPG_MAJOR_VERSION == 1*/

View file

@ -44,11 +44,6 @@
#include "apdu.h"
#include "app-common.h"
/* If we build w/o agent support, assuan.h won't be included and thus
we need to define a repalcement for the assuan error type. */
#ifndef ENABLE_AGENT_SUPPORT
typedef int assuan_error_t;
#endif
struct ctrl_ctx_s
@ -81,6 +76,48 @@ static app_t current_app;
static assuan_error_t learn_status_cb (void *opaque, const char *line);
/* To avoid cluttering the code with bunches of ifdefs we use a few
dummy functions instead and defines. */
#ifndef ENABLE_AGENT_SUPPORT
#define ASSUAN_LINELENGTH 100
static assuan_context_t
agent_open (int try)
{
return NULL;
}
void
agent_close (assuan_context_t ctx)
{
}
const char *
assuan_strerror (assuan_error_t err)
{
return "no Assuan support";
}
assuan_error_t
assuan_transact (assuan_context_t ctx,
const char *command,
assuan_error_t (*data_cb)(void *, const void *, size_t),
void *data_cb_arg,
assuan_error_t (*inquire_cb)(void*, const char *),
void *inquire_cb_arg,
assuan_error_t (*status_cb)(void*, const char *),
void *status_cb_arg)
{
return 100; /* ASSUAN_NOT_IMPLEMENTED */
}
assuan_error_t
assuan_send_data (assuan_context_t ctx, const void *buffer, size_t length)
{
return 100; /* ASSUAN_NOT_IMPLEMENTED */
}
#endif /*!ENABLE_AGENT_SUPPORT*/
/* Create a serialno/fpr string from the serial number and the secret
key. caller must free the returned string. There is no error
@ -253,9 +290,6 @@ app_get_serial_and_stamp (app_t app, char **serial, time_t *stamp)
/* Release the card info structure. */
void
agent_release_card_info (struct agent_card_info_s *info)
@ -280,7 +314,7 @@ agent_release_card_info (struct agent_card_info_s *info)
}
/* Print an error message for a failed assuan-Transact and return a
/* Print an error message for a failed assuan_transact and return a
gpg error code. No error is printed if RC is 0. */
static gpg_error_t
test_transact (int rc, const char *command)

View file

@ -92,6 +92,7 @@ typedef struct ctrl_ctx_s *ctrl_t;
#define GPG_ERR_INV_ID G10ERR_GENERAL
#define GPG_ERR_INV_NAME G10ERR_GENERAL
#define GPG_ERR_INV_VALUE G10ERR_INV_ARG
#define GPG_ERR_INV_SEXP G10ERR_INV_ARG
#define GPG_ERR_NOT_SUPPORTED G10ERR_UNSUPPORTED
#define GPG_ERR_NO_OBJ G10ERR_GENERAL
#define GPG_ERR_PIN_BLOCKED G10ERR_PASSPHRASE

View file

@ -191,6 +191,11 @@ int build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list,
#ifdef ENABLE_AGENT_SUPPORT
assuan_context_t agent_open (int try);
void agent_close (assuan_context_t ctx);
#else
/* If we build w/o agent support, assuan.h won't get included and thus
we need to define a replacement for some Assuan types. */
typedef int assuan_error_t;
typedef void *assuan_context_t;
#endif
int have_static_passphrase(void);
void read_passphrase_from_fd( int fd );

View file

@ -27,7 +27,11 @@
#include <assert.h>
#if GNUPG_MAJOR_VERSION == 1
#include "cardglue.h"
#define GPG_ERR_EOF (-1)
#define GPG_ERR_BAD_BER (1) /*G10ERR_GENERAL*/
#define GPG_ERR_INV_SEXP (45) /*G10ERR_INV_ARG*/
typedef int gpg_error_t;
#define gpg_error(n) (n)
#else
#include <gpg-error.h>
#endif