Adjusted for changes --fixed-list-mode in 1.0.4h

This commit is contained in:
Werner Koch 2001-04-19 12:18:40 +00:00
parent ba1a1ec381
commit 1a3db20121
9 changed files with 68 additions and 39 deletions

View File

@ -1,3 +1,7 @@
2001-04-05 Werner Koch <wk@gnupg.org>
* configure.in (NEED_GPG_VERSION): Set to 1.0.4g
2001-04-02 Werner Koch <wk@gnupg.org>
Released 0.2.1.

View File

@ -31,11 +31,11 @@ AM_MAINTAINER_MODE
# AGE, set REVISION to 0.
# 3. Interfaces removed (BAD, breaks upward compatibility): Increment
# CURRENT, set AGE and REVISION to 0.
AM_INIT_AUTOMAKE(gpgme,0.2.1)
AM_INIT_AUTOMAKE(gpgme,0.2.1a)
LIBGPGME_LT_CURRENT=3
LIBGPGME_LT_AGE=3
LIBGPGME_LT_REVISION=0
NEED_GPG_VERSION=1.0.4f
NEED_GPG_VERSION=1.0.4h
##############################################
AC_SUBST(LIBGPGME_LT_CURRENT)

View File

@ -1,3 +1,29 @@
2001-04-19 Werner Koch <wk@gnupg.org>
* keylist.c (parse_timestamp): Adjusted for the changed
--fixed-list-mode of gpg 1.0.4h.
2001-04-05 Werner Koch <wk@gnupg.org>
* verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
2001-04-04 Werner Koch <wk@gnupg.org>
* w32-io.c (_gpgme_io_select): Don't select on the writer if there
are still bytes pending. Timo found this not easy to track down
race condition.
2001-04-02 Werner Koch <wk@gnupg.org>
* gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
* key.c (gpgme_key_get_ulong_attr): And return those attribs.
* verify.c (gpgme_get_sig_key): Set keyliosting mode depending on
the mode set in the current context. Suggested by Timo.
* key.c (gpgme_key_get_ulong_attr): Return can_certify and not
can_encrypt. By Timo.
2001-03-30 Werner Koch <wk@gnupg.org>
* debug.c (debug_init): Allow to specify a debug file.

View File

@ -44,7 +44,7 @@ extern "C" {
* let autoconf (using the AM_PATH_GPGME macro) check that this
* header matches the installed library.
* Warning: Do not edit the next line. configure will do that for you! */
#define GPGME_VERSION "0.2.1"
#define GPGME_VERSION "0.2.1a"
@ -138,7 +138,9 @@ typedef enum {
GPGME_ATTR_KEY_CAPS = 20,
GPGME_ATTR_CAN_ENCRYPT = 21,
GPGME_ATTR_CAN_SIGN = 22,
GPGME_ATTR_CAN_CERTIFY = 23
GPGME_ATTR_CAN_CERTIFY = 23,
GPGME_ATTR_KEY_EXPIRED = 24,
GPGME_ATTR_KEY_DISABLED= 25
} GpgmeAttr;
typedef enum {

View File

@ -553,6 +553,8 @@ gpgme_key_get_string_attr ( GpgmeKey key, GpgmeAttr what,
case GPGME_ATTR_TYPE:
case GPGME_ATTR_KEY_REVOKED:
case GPGME_ATTR_KEY_INVALID:
case GPGME_ATTR_KEY_EXPIRED:
case GPGME_ATTR_KEY_DISABLED:
case GPGME_ATTR_UID_REVOKED:
case GPGME_ATTR_UID_INVALID:
case GPGME_ATTR_CAN_ENCRYPT:
@ -629,6 +631,18 @@ gpgme_key_get_ulong_attr ( GpgmeKey key, GpgmeAttr what,
if (k)
val = k->flags.invalid;
break;
case GPGME_ATTR_KEY_EXPIRED:
for (k=&key->keys; k && idx; k=k->next, idx-- )
;
if (k)
val = k->flags.expired;
break;
case GPGME_ATTR_KEY_DISABLED:
for (k=&key->keys; k && idx; k=k->next, idx-- )
;
if (k)
val = k->flags.disabled;
break;
case GPGME_ATTR_UID_REVOKED:
for (u=key->uids; u && idx; u=u->next, idx-- )
;
@ -642,7 +656,7 @@ gpgme_key_get_ulong_attr ( GpgmeKey key, GpgmeAttr what,
val = u->invalid;
break;
case GPGME_ATTR_CAN_ENCRYPT:
val = key->gloflags.can_encrypt;
val = key->gloflags.can_certify;
break;
case GPGME_ATTR_CAN_SIGN:
val = key->gloflags.can_sign;

View File

@ -58,35 +58,10 @@ keylist_status_handler ( GpgmeCtx ctx, GpgStatusCode code, char *args )
static time_t
parse_timestamp ( char *p )
{
struct tm tm;
int i;
if (!*p )
return 0;
if (strlen(p) < 10 || p[4] != '-' || p[7] != '-' )
return (time_t)-1;
p[4] = 0;
p[7] = 0;
p[10] = 0; /* just in case the time part follows */
memset (&tm, 0, sizeof tm);
i = atoi (p);
if ( i < 1900 )
return (time_t)-1;
tm.tm_year = i - 1900;
i = atoi (p+5);
if ( i < 1 || i > 12 )
return (time_t)-1;
tm.tm_mon = i-1;
i = atoi (p+8);
if ( i < 1 || i > 31 )
return (time_t)-1;
tm.tm_mday = i;
return mktime (&tm);
return (time_t)strtoul (p, NULL, 10);
}
@ -263,7 +238,7 @@ keylist_colon_handler ( GpgmeCtx ctx, char *line )
if ( strlen (p) == DIM(key->keys.keyid)-1 )
strcpy (key->keys.keyid, p);
break;
case 6: /* timestamp (1998-02-28) */
case 6: /* timestamp (seconds) */
key->keys.timestamp = parse_timestamp (p);
break;
case 7: /* valid for n days */
@ -303,7 +278,7 @@ keylist_colon_handler ( GpgmeCtx ctx, char *line )
if ( strlen (p) == DIM(sk->keyid)-1 )
strcpy (sk->keyid, p);
break;
case 6: /* timestamp (1998-02-28) */
case 6: /* timestamp (seconds) */
sk->timestamp = parse_timestamp (p);
break;
case 7: /* valid for n days */

View File

@ -1094,7 +1094,7 @@ read_status ( GpgObject gpg )
if ( *p == '\n' ) {
/* (we require that the last line is terminated by a LF) */
*p = 0;
/* fprintf (stderr, "read_status: `%s'\n", buffer); */
fflush (stdout); fprintf (stderr, "read_status: `%s'\n", buffer);
if (!strncmp (buffer, "[GNUPG:] ", 9 )
&& buffer[9] >= 'A' && buffer[9] <= 'Z' ) {
struct status_table_s t, *r;

View File

@ -219,7 +219,7 @@ gpgme_op_verify_start ( GpgmeCtx c, GpgmeData sig, GpgmeData text )
{
int rc = 0;
int i;
int pipemode = 0 /*!!text*/; /* use pipemode for detached sigs */
int pipemode = !!text; /* use pipemode for detached sigs */
fail_on_pending_request( c );
c->pending = 1;
@ -434,6 +434,7 @@ gpgme_get_sig_key (GpgmeCtx c, int idx, GpgmeKey *r_key)
* an internal context used for such key listings */
if ( (err=gpgme_new (&listctx)) )
return err;
gpgme_set_keylist_mode( listctx, c->keylist_mode );
if ( !(err=gpgme_op_keylist_start (listctx, res->fpr, 0 )) )
err=gpgme_op_keylist_next ( listctx, r_key );
gpgme_release (listctx);

View File

@ -1033,11 +1033,18 @@ _gpgme_io_select ( struct io_select_fd_s *fds, size_t nfds )
DEBUG0 ("Too many objects for WFMO!" );
return -1;
}
waitidx[nwait] = i;
waitbuf[nwait++] = c->is_empty;
LOCK (c->mutex);
if ( !c->nbytes ) {
waitidx[nwait] = i;
waitbuf[nwait++] = c->is_empty;
DEBUG_ADD1 (dbg_help, "w%d ", fds[i].fd );
any = 1;
}
else {
DEBUG_ADD1 (dbg_help, "w%d(ignored) ", fds[i].fd );
}
UNLOCK (c->mutex);
}
DEBUG_ADD1 (dbg_help, "w%d ", fds[i].fd );
any = 1;
}
}
}