/[winpt]/trunk/MyGPGME/verify.c
ViewVC logotype

Diff of /trunk/MyGPGME/verify.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by twoaday, Mon Jan 31 11:02:21 2005 UTC revision 17 by twoaday, Fri May 20 08:38:32 2005 UTC
# Line 1  Line 1 
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   *   *
# Line 155  verify_status_handler( gpgme_ctx_t ctx, Line 155  verify_status_handler( gpgme_ctx_t ctx,
155              return;              return;
156      }      }
157    
158      _gpgme_sigtrust_status_handler (code, args, &ctx->result.verify->trust);      if (code >= STATUS_TRUST_UNDEFINED && code <= STATUS_TRUST_ULTIMATE)
159            _gpgme_sigtrust_status_handler (code, args, &ctx->result.verify->trust);
160    
161      switch( code ) {      switch( code ) {
162      case STATUS_FILE_START:      case STATUS_FILE_START:
# Line 713  gpgme_get_sig_ctx (gpgme_ctx_t ctx, int Line 714  gpgme_get_sig_ctx (gpgme_ctx_t ctx, int
714      sig->trust = res->trust;      sig->trust = res->trust;
715      sig->key_algo = res->key_algo;      sig->key_algo = res->key_algo;
716      sig->md_algo = res->md_algo;      sig->md_algo = res->md_algo;
717      sig->class = res->sig_class;      sig->sigclass = res->sig_class;
718      sig->user_id = get_sig_userid( ctx, idx_old );      sig->user_id = get_sig_userid( ctx, idx_old );
719      sig->policy_url = res->policy_url? strdup (res->policy_url) : NULL;      sig->policy_url = res->policy_url? strdup (res->policy_url) : NULL;
720      sig->file_name = res->file_name? strdup (res->file_name) : NULL;      sig->file_name = res->file_name? strdup (res->file_name) : NULL;
# Line 735  gpgme_get_sig_ctx (gpgme_ctx_t ctx, int Line 736  gpgme_get_sig_ctx (gpgme_ctx_t ctx, int
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 )
# Line 754  gpgme_get_sig_key( gpgme_ctx_t ctx, int Line 754  gpgme_get_sig_key( gpgme_ctx_t ctx, int
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 */

Legend:
Removed from v.2  
changed lines
  Added in v.17

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26