501 |
} |
} |
502 |
|
|
503 |
|
|
504 |
|
/* Return the next key which was updated. Before it is |
505 |
|
returned the update flag is cleared. |
506 |
|
Return value: 0 on success. */ |
507 |
|
gpgme_error_t |
508 |
|
gpg_keycache_next_updated_key (gpg_keycache_t ctx, |
509 |
|
struct keycache_s **r_obj) |
510 |
|
{ |
511 |
|
struct keycache_s *c; |
512 |
|
|
513 |
|
for (c = ctx->item; c; c = c->next) { |
514 |
|
if (c->flags == 1) { |
515 |
|
c->flags = 0; |
516 |
|
*r_obj = c; |
517 |
|
return 0; |
518 |
|
} |
519 |
|
} |
520 |
|
return gpg_error (GPG_ERR_NOT_FOUND); |
521 |
|
} |
522 |
|
|
523 |
|
|
524 |
|
|
525 |
gpgme_error_t |
gpgme_error_t |
526 |
gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec, |
gpg_keycache_update_key (gpg_keycache_t ctx, int is_sec, |
527 |
void *opaque, const char *keyid) |
void *opaque, const char *keyid) |
544 |
log_debug ("keycache update: keyid=%s %p\r\n", keyid, pub); |
log_debug ("keycache update: keyid=%s %p\r\n", keyid, pub); |
545 |
gpgme_key_release (fndkey); |
gpgme_key_release (fndkey); |
546 |
c->key = key; |
c->key = key; |
547 |
c->flags = 0; |
c->flags = 1; |
548 |
if (is_sec && pub != NULL && |
if (is_sec && pub != NULL && |
549 |
!gpg_keycache_find_key (pub, keyid, 0, &fndkey)) { |
!gpg_keycache_find_key (pub, keyid, 0, &fndkey)) { |
550 |
log_debug ("keycache update: set public part %p\r\n", fndkey); |
log_debug ("keycache update: set public part %p\r\n", fndkey); |
567 |
c->gloflags.divert_to_card = c_new->gloflags.divert_to_card; |
c->gloflags.divert_to_card = c_new->gloflags.divert_to_card; |
568 |
} |
} |
569 |
} |
} |
570 |
|
if (c) |
571 |
|
c->flags = 1; |
572 |
} |
} |
573 |
return 0; |
return 0; |
574 |
} |
} |