/[winpt]/trunk/Src/wptKeyCache.cpp
ViewVC logotype

Diff of /trunk/Src/wptKeyCache.cpp

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

revision 259 by twoaday, Sat Aug 5 10:31:06 2006 UTC revision 260 by twoaday, Wed Aug 16 10:01:30 2006 UTC
# Line 835  static int Line 835  static int
835  key_divert_to_card (gpgme_key_t key)  key_divert_to_card (gpgme_key_t key)
836  {  {
837      gpgme_subkey_t k;      gpgme_subkey_t k;
838      int n=0, n_alg=0;      int n=0;
839      int can_auth = 0, can_encr = 0;      int can_auth = 0, can_encr = 0;
840    
841      for (k = key->subkeys; k; k = k->next) {      for (k = key->subkeys; k; k = k->next) {
842          n++;          n++;
843          if (k->pubkey_algo == GPGME_PK_RSA && k->length == 1024)          if (k->pubkey_algo != GPGME_PK_RSA || k->length != 1024) {
844              n_alg++;              return 0;
845                break;
846            }
847          if (k->can_authenticate)          if (k->can_authenticate)
848              can_auth++;              can_auth++;
849          if (k->can_encrypt)          if (k->can_encrypt)
850              can_encr++;              can_encr++;
851      }      }
852      if (n == 3 && n_alg == 3 && can_auth == 1 && can_encr == 1)      if (n >= 3 && can_auth >= 1 && can_encr >= 1)
853          return 1;          return 1;
854      return 0;      return 0;
855  }  }

Legend:
Removed from v.259  
changed lines
  Added in v.260

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26