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) |
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. */ |
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); |
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 |
} |
} |