/[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 68 by twoaday, Thu Nov 3 16:55:25 2005 UTC revision 69 by twoaday, Sat Nov 5 12:28:12 2005 UTC
# Line 36  Line 36 
36  #include "wptW32API.h"  #include "wptW32API.h"
37    
38    
39    #if 0
40  /* convert a binary buffer into its hex representation. */  /* convert a binary buffer into its hex representation. */
41  static void  static void
42  buffer_to_string (char *dst, size_t dlen, const byte *buf, size_t nbytes)  buffer_to_string (char *dst, size_t dlen, const byte *buf, size_t nbytes)
# Line 50  buffer_to_string (char *dst, size_t dlen Line 51  buffer_to_string (char *dst, size_t dlen
51          dlen -= 2;          dlen -= 2;
52      }      }
53  }  }
54    #endif
55    
56  /* Parse the secret keyring and retrieve some additional information  /* Parse the secret keyring and retrieve some additional information
57     for each key which was found. */     for each key which was found. */
# Line 104  gpgme_error_t Line 105  gpgme_error_t
105  keycache_prepare2 (gpg_keycache_t ctx, const char *kid,  keycache_prepare2 (gpg_keycache_t ctx, const char *kid,
106                     const char *pubring, const char *secring)                     const char *pubring, const char *secring)
107  {  {
108      gpgme_error_t err;      gpgme_error_t err = gpg_error (GPG_ERR_NO_ERROR);
109      gpgme_key_t key = NULL;      gpgme_key_t key = NULL;
110      gpg_iobuf_t inp;      gpg_iobuf_t inp;
111      PACKET *pkt = (PACKET*)calloc (1, sizeof * pkt);      PACKET *pkt = (PACKET*)calloc (1, sizeof * pkt);
# Line 175  keycache_prepare2 (gpg_keycache_t ctx, c Line 176  keycache_prepare2 (gpg_keycache_t ctx, c
176          }          }
177          if ((pkt->pkttype == PKT_USER_ID || pkt->pkttype == PKT_ATTRIBUTE)          if ((pkt->pkttype == PKT_USER_ID || pkt->pkttype == PKT_ATTRIBUTE)
178              && pkt->pkt.user_id->attrib_data && key) {              && pkt->pkt.user_id->attrib_data && key) {
179              PKT_user_id *id = pkt->pkt.user_id;              PKT_user_id *uid = pkt->pkt.user_id;
180              c->attrib.used = 1;              c->attrib.used = 1;
181              c->attrib.len = id->attrib_len;              c->attrib.len = uid->attrib_len;
182              c->attrib.d = (unsigned char*)calloc (1, id->attrib_len + 1);              c->attrib.d = (unsigned char*)calloc (1, uid->attrib_len + 1);
183              if (!c->attrib.d) {              if (!c->attrib.d) {
184                  err = gpg_error (GPG_ERR_ENOMEM);                  err = gpg_error (GPG_ERR_ENOMEM);
185                  goto fail;                  goto fail;
186              }              }
187              memcpy (c->attrib.d, id->attrib_data, id->attrib_len);              memcpy (c->attrib.d, uid->attrib_data, uid->attrib_len);
188              key = NULL;              key = NULL;
189              c = NULL;              c = NULL;
190          }          }

Legend:
Removed from v.68  
changed lines
  Added in v.69

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26