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

Diff of /trunk/MyGPGME/key.c

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

revision 21 by twoaday, Wed Jul 27 11:17:44 2005 UTC revision 22 by twoaday, Wed Aug 10 11:33:35 2005 UTC
# Line 38  pkalgo_to_string (int algo) Line 38  pkalgo_to_string (int algo)
38      case 1:      case 1:
39      case 2:      case 2:
40      case 3:  return "RSA";      case 3:  return "RSA";
     case 16:  
41      case 17: return "DSA";      case 17: return "DSA";
42        case 16:    
43      case 20: return "ELG";          case 20: return "ELG";    
44      default: return "???";      default: return "???";
45      }      }
# Line 512  gpgme_key_get_string_attr (gpgme_key_t k Line 512  gpgme_key_get_string_attr (gpgme_key_t k
512    
513  unsigned long  unsigned long
514  gpgme_key_get_ulong_attr (gpgme_key_t key, gpgme_attr_t what,  gpgme_key_get_ulong_attr (gpgme_key_t key, gpgme_attr_t what,
515                            void ** reserved, int idx)                            void **reserved, int idx)
516  {  {
517      unsigned long val = 0;      unsigned long val = 0;
518      struct subkey_s * k;      struct subkey_s * k;
# Line 522  gpgme_key_get_ulong_attr (gpgme_key_t ke Line 522  gpgme_key_get_ulong_attr (gpgme_key_t ke
522      struct mpi_s * m;      struct mpi_s * m;
523      int n=0;      int n=0;
524            
525      if( !key )      if (!key || idx < 0)
         return 0;      
     if( idx < 0 )  
526          return 0;          return 0;
527            
528      switch( what ) {      switch( what ) {
529      case GPGME_ATTR_ALGO:      case GPGME_ATTR_ALGO:
530          for (k=&key->keys; k && idx; k=k->next, idx-- )          for (k=&key->keys; k && idx; k=k->next, idx--)
531              ;              ;
532          if (k)          if (k)
533              val = (unsigned long)k->key_algo;              val = (unsigned long)k->key_algo;
534          break;          break;
535    
536      case GPGME_ATTR_LEN:          case GPGME_ATTR_LEN:    
537          for (k=&key->keys; k && idx; k=k->next, idx-- )          for (k=&key->keys; k && idx; k=k->next, idx--)
538              ;              ;
539          if (k)          if (k)
540              val = (unsigned long)k->key_len;              val = (unsigned long)k->key_len;

Legend:
Removed from v.21  
changed lines
  Added in v.22

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26