/[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 122 by twoaday, Mon Dec 12 11:19:56 2005 UTC revision 123 by twoaday, Wed Dec 14 09:01:45 2005 UTC
# Line 120  keycache_prepare2 (gpg_keycache_t ctx, c Line 120  keycache_prepare2 (gpg_keycache_t ctx, c
120      if (secring) {      if (secring) {
121          parse_secring (ctx, kid, secring);          parse_secring (ctx, kid, secring);
122          if (!pubring) {          if (!pubring) {
123              safe_free(pkt);              safe_free (pkt);
124              return 0;              return 0;
125          }          }
126      }      }
127      inp = gpg_iobuf_open (pubring);      inp = gpg_iobuf_open (pubring);
128      if (!inp) {      if (!inp) {
129          safe_free( pkt );          safe_free (pkt);
130          return gpg_error (GPG_ERR_KEYRING_OPEN);          return gpg_error (GPG_ERR_KEYRING_OPEN);
131      }      }
132      gpg_iobuf_ioctl( inp, 3, 1, NULL ); /* disable cache */      gpg_iobuf_ioctl (inp, 3, 1, NULL); /* disable cache */
133    
134      gpg_init_packet( pkt );      gpg_init_packet (pkt);
135      while (gpg_parse_packet (inp, pkt) != -1) {      while (gpg_parse_packet (inp, pkt) != -1) {
136          if (pkt->pkttype == PKT_PUBLIC_KEY) {          if (pkt->pkttype == PKT_PUBLIC_KEY) {
137              strcpy (keyid, "");              strcpy (keyid, "");
# Line 517  key_divert_to_card (gpgme_key_t key) Line 517  key_divert_to_card (gpgme_key_t key)
517  }  }
518    
519    
520    static unsigned char*
521    copy_uid_prefs (const unsigned char *prefs)
522    {
523        unsigned char *p;
524        size_t pos=0;
525    
526        while (prefs[pos] != 0)
527            pos++;
528        p = (unsigned char*)calloc (1, pos+1);
529        if (!p)
530            abort ();
531        memcpy (p, prefs, pos);
532        return p;
533    }
534    
535    
536  gpgme_error_t  gpgme_error_t
537  gpg_keycache_sync (gpg_keycache_t pub, gpg_keycache_t sec)  gpg_keycache_sync (gpg_keycache_t pub, gpg_keycache_t sec)
538  {  {
# Line 532  gpg_keycache_sync (gpg_keycache_t pub, g Line 548  gpg_keycache_sync (gpg_keycache_t pub, g
548              c_sec->gloflags.divert_to_card = c->gloflags.divert_to_card;              c_sec->gloflags.divert_to_card = c->gloflags.divert_to_card;
549              if (!c->gloflags.divert_to_card)              if (!c->gloflags.divert_to_card)
550                  c->gloflags.divert_to_card = key_divert_to_card (key);                  c->gloflags.divert_to_card = key_divert_to_card (key);
551                c->sym_prefs = copy_uid_prefs (c_sec->sym_prefs);
552              c->pubpart = c_sec;              c->pubpart = c_sec;
553              c->pubpart->key = key;              c->pubpart->key = key;
554          }          }

Legend:
Removed from v.122  
changed lines
  Added in v.123

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26