From 82b7dc1d294c43f50515fac448aa44dcf716baf2 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sat, 9 Feb 2002 00:06:32 +0000 Subject: [PATCH] 2002-02-09 Marcus Brinkmann * genkey.c (gpgme_op_genkey_start): Fix logic in validity check. (gpgme_op_genkey_start): Skip newlines after opening tag. * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft. --- gpgme/ChangeLog | 7 +++++++ gpgme/engine-gpgsm.c | 2 +- gpgme/genkey.c | 9 ++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 9912cb4..13cd50f 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,10 @@ +2002-02-09 Marcus Brinkmann + + * genkey.c (gpgme_op_genkey_start): Fix logic in validity check. + (gpgme_op_genkey_start): Skip newlines after opening tag. + + * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft. + 2002-02-08 Marcus Brinkmann * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index 0be5215..7852a1a 100644 --- a/gpgme/engine-gpgsm.c +++ b/gpgme/engine-gpgsm.c @@ -1006,7 +1006,7 @@ _gpgme_gpgsm_set_colon_line_handler (GpgsmObject gpgsm, GpgmeError -_gpgme_gpgsm_start (GpgsmObject gpgsm, void *opaque, GpgmeError *errorp) +_gpgme_gpgsm_start (GpgsmObject gpgsm, void *opaque) { return mk_error (Invalid_Engine); } diff --git a/gpgme/genkey.c b/gpgme/genkey.c index 9c65400..e8017f2 100644 --- a/gpgme/genkey.c +++ b/gpgme/genkey.c @@ -140,12 +140,12 @@ gpgme_op_genkey_start (GpgmeCtx ctx, const char *parms, if (!pubkey && !seckey) ; /* okay: Add key to the keyrings */ - else if (!pubkey || gpgme_data_get_type (pubkey) != GPGME_DATA_TYPE_NONE) + else if (pubkey && gpgme_data_get_type (pubkey) != GPGME_DATA_TYPE_NONE) { err = mk_error (Invalid_Value); goto leave; } - else if (!seckey || gpgme_data_get_type (seckey) != GPGME_DATA_TYPE_NONE) + else if (seckey && gpgme_data_get_type (seckey) != GPGME_DATA_TYPE_NONE) { err = mk_error (Invalid_Value); goto leave; @@ -166,7 +166,10 @@ gpgme_op_genkey_start (GpgmeCtx ctx, const char *parms, && (s2 = strstr (s+1, ""))) { /* FIXME: Check that there are no control statements inside. */ - err = gpgme_data_new_from_mem (&ctx->help_data_1, s+1, s2-s-1, 1); + s++; /* Skip '>'. */ + while (*s == '\n') + s++; + err = gpgme_data_new_from_mem (&ctx->help_data_1, s, s2-s, 1); } else err = mk_error (Invalid_Value); -- 2.26.2