#include <lib-lib/mem.h>
#include <lib-lib/str.h>
#include <lib-lib/date.h>
-#include <lib-lib/debug.h>
#include <lib-mime/mime.h>
if (!*buf)
return NULL;
- debug_print (2, ("buf = `%s'\n", buf));
-
for (p = buf; p; p = pend) {
if ((pend = strchr (p, ':')))
*pend++ = 0;
switch (field) {
case 1: /* record type */
{
- debug_print (2, ("record type: %s\n", p));
-
if (!m_strcmp(p, "pub"));
else if (!m_strcmp(p, "sub"))
*is_subkey = 1;
}
case 2: /* trust info */
{
- debug_print (2, ("trust info: %s\n", p));
-
switch (*p) { /* look only at the first letter */
case 'e':
flags |= KEYFLAG_EXPIRED;
}
case 3: /* key length */
{
-
- debug_print (2, ("key len: %s\n", p));
-
if (!(*is_subkey && option (OPTPGPIGNORESUB)))
k->keylen = atoi (p); /* fixme: add validation checks */
break;
}
case 4: /* pubkey algo */
{
-
- debug_print (2, ("pubkey algorithm: %s\n", p));
-
if (!(*is_subkey && option (OPTPGPIGNORESUB))) {
k->numalg = atoi (p);
k->algorithm = pgp_pkalgbytype (atoi (p));
}
case 5: /* 16 hex digits with the long keyid. */
{
- debug_print (2, ("key id: %s\n", p));
-
if (!(*is_subkey && option (OPTPGPIGNORESUB)))
m_strreplace(&k->keyid, p);
break;
char tstr[11];
struct tm st_time;
- debug_print (2, ("time stamp: %s\n", p));
-
if (!p)
break;
st_time.tm_sec = 0;
if (!is_uid && (*is_subkey && option (OPTPGPIGNORESUB)))
break;
- debug_print (2, ("user ID: %s\n", p));
-
uid = p_new(pgp_uid_t, 1);
fix_uid (p);
uid->addr = m_strdup(p);
case 11: /* signature class */
break;
case 12: /* key capabilities */
- debug_print (2, ("capabilities info: %s\n", p));
-
while (*p) {
switch (*p++) {
case 'D':
return k;
}
-pgp_key_t pgp_get_candidates (pgp_ring_t keyring, LIST * hints)
+pgp_key_t pgp_get_candidates (pgp_ring_t keyring, string_list_t * hints)
{
FILE *fp;
pid_t thepid;