1 |
/* verify.c - signature verification |
/* verify.c - signature verification |
2 |
* Copyright (C) 2000 Werner Koch (dd9jn) |
* Copyright (C) 2000 Werner Koch (dd9jn) |
3 |
* Copyright (C) 2001-2004 Timo Schulz |
* Copyright (C) 2001-2005 Timo Schulz |
4 |
* |
* |
5 |
* This file is part of MyGPGME. |
* This file is part of MyGPGME. |
6 |
* |
* |
52 |
|
|
53 |
|
|
54 |
void |
void |
55 |
_gpgme_release_verify_result(_verify_result_t res) |
_gpgme_release_verify_result (_verify_result_t res) |
56 |
{ |
{ |
57 |
while (res) { |
while (res) { |
58 |
_verify_result_t r2 = res->next; |
_verify_result_t r2 = res->next; |
736 |
* indicate that there are no more signatures. |
* indicate that there are no more signatures. |
737 |
**/ |
**/ |
738 |
gpgme_error_t |
gpgme_error_t |
739 |
gpgme_get_sig_key( gpgme_ctx_t ctx, int idx, gpgme_key_t * r_key ) |
gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t * r_key) |
740 |
{ |
{ |
741 |
_verify_result_t res; |
_verify_result_t res; |
|
gpgme_ctx_t listctx = NULL; |
|
742 |
gpgme_error_t err; |
gpgme_error_t err; |
743 |
|
|
744 |
if( !ctx || !r_key ) |
if( !ctx || !r_key ) |
754 |
if( strlen( res->fpr ) < 16 ) /* we have at least an key ID */ |
if( strlen( res->fpr ) < 16 ) /* we have at least an key ID */ |
755 |
return mk_error( Invalid_Key ); |
return mk_error( Invalid_Key ); |
756 |
|
|
757 |
if( ctx->key_lookup ) |
if (ctx->key_lookup) |
758 |
err = gpgme_keycache_find_key( ctx->key_lookup, res->fpr, 0, r_key ); |
err = gpgme_keycache_find_key (ctx->key_lookup, res->fpr, 0, r_key); |
759 |
else { |
else |
760 |
err = gpgme_new( &listctx ); |
err = gpgme_op_keylist_getkey (0, res->fpr, r_key); |
|
if( !err ) { |
|
|
gpgme_control( listctx, GPGME_CTRL_LISTMODE, listctx->keylist_mode ); |
|
|
err = gpgme_op_keylist_start( listctx, res->fpr, 0 ); |
|
|
} |
|
|
if( !err ) |
|
|
err = gpgme_op_keylist_next( listctx, r_key ); |
|
|
gpgme_release( listctx ); |
|
|
} |
|
761 |
|
|
762 |
return err; |
return err; |
763 |
} /* gpgme_get_sig_key */ |
} /* gpgme_get_sig_key */ |