mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
dirmngr: Correct indentation.
-- Signed-off-by: Neal H. Walfield <neal@g10code.com>
This commit is contained in:
parent
7f6d7948c1
commit
6d5aee23c3
@ -1123,118 +1123,117 @@ ks_ldap_search (ctrl_t ctrl, parsed_uri_t uri, const char *pattern,
|
|||||||
|
|
||||||
es_fprintf (fp, "pub:%s:",certid[0]);
|
es_fprintf (fp, "pub:%s:",certid[0]);
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "pgpkeytype");
|
vals = ldap_get_values (ldap_conn, each, "pgpkeytype");
|
||||||
if (vals)
|
if (vals)
|
||||||
{
|
{
|
||||||
/* The LDAP server doesn't exactly handle this
|
/* The LDAP server doesn't exactly handle this
|
||||||
well. */
|
well. */
|
||||||
if (strcasecmp (vals[0], "RSA") == 0)
|
if (strcasecmp (vals[0], "RSA") == 0)
|
||||||
es_fputs ("1", fp);
|
es_fputs ("1", fp);
|
||||||
else if (strcasecmp (vals[0], "DSS/DH") == 0)
|
else if (strcasecmp (vals[0], "DSS/DH") == 0)
|
||||||
es_fputs ("17", fp);
|
es_fputs ("17", fp);
|
||||||
ldap_value_free (vals);
|
ldap_value_free (vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
es_fputc (':', fp);
|
es_fputc (':', fp);
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "pgpkeysize");
|
vals = ldap_get_values (ldap_conn, each, "pgpkeysize");
|
||||||
if (vals)
|
if (vals)
|
||||||
{
|
{
|
||||||
/* Not sure why, but some keys are listed with a
|
/* Not sure why, but some keys are listed with a
|
||||||
key size of 0. Treat that like an
|
key size of 0. Treat that like an unknown. */
|
||||||
unknown. */
|
if (atoi (vals[0]) > 0)
|
||||||
if (atoi (vals[0]) > 0)
|
es_fprintf (fp, "%d", atoi (vals[0]));
|
||||||
es_fprintf (fp, "%d", atoi (vals[0]));
|
ldap_value_free (vals);
|
||||||
ldap_value_free (vals);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
es_fputc (':', fp);
|
es_fputc (':', fp);
|
||||||
|
|
||||||
/* YYYYMMDDHHmmssZ */
|
/* YYYYMMDDHHmmssZ */
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "pgpkeycreatetime");
|
vals = ldap_get_values (ldap_conn, each, "pgpkeycreatetime");
|
||||||
if(vals && strlen (vals[0]) == 15)
|
if(vals && strlen (vals[0]) == 15)
|
||||||
{
|
{
|
||||||
es_fprintf (fp, "%u",
|
es_fprintf (fp, "%u",
|
||||||
(unsigned int) ldap2epochtime(vals[0]));
|
(unsigned int) ldap2epochtime(vals[0]));
|
||||||
ldap_value_free (vals);
|
ldap_value_free (vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
es_fputc (':', fp);
|
es_fputc (':', fp);
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "pgpkeyexpiretime");
|
vals = ldap_get_values (ldap_conn, each, "pgpkeyexpiretime");
|
||||||
if (vals && strlen (vals[0]) == 15)
|
if (vals && strlen (vals[0]) == 15)
|
||||||
{
|
{
|
||||||
es_fprintf (fp, "%u",
|
es_fprintf (fp, "%u",
|
||||||
(unsigned int) ldap2epochtime (vals[0]));
|
(unsigned int) ldap2epochtime (vals[0]));
|
||||||
ldap_value_free (vals);
|
ldap_value_free (vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
es_fputc (':', fp);
|
es_fputc (':', fp);
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "pgprevoked");
|
vals = ldap_get_values (ldap_conn, each, "pgprevoked");
|
||||||
if (vals)
|
if (vals)
|
||||||
{
|
{
|
||||||
if (atoi (vals[0]) == 1)
|
if (atoi (vals[0]) == 1)
|
||||||
es_fprintf (fp, "r");
|
es_fprintf (fp, "r");
|
||||||
ldap_value_free (vals);
|
ldap_value_free (vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "pgpdisabled");
|
vals = ldap_get_values (ldap_conn, each, "pgpdisabled");
|
||||||
if (vals)
|
if (vals)
|
||||||
{
|
{
|
||||||
if (atoi (vals[0]) ==1)
|
if (atoi (vals[0]) ==1)
|
||||||
es_fprintf (fp, "d");
|
es_fprintf (fp, "d");
|
||||||
ldap_value_free (vals);
|
ldap_value_free (vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* This is not yet specified in the keyserver
|
/* This is not yet specified in the keyserver
|
||||||
protocol, but may be someday. */
|
protocol, but may be someday. */
|
||||||
es_fputc (':', fp);
|
es_fputc (':', fp);
|
||||||
|
|
||||||
vals = ldap_get_values (ldap_conn, each, "modifytimestamp");
|
vals = ldap_get_values (ldap_conn, each, "modifytimestamp");
|
||||||
if(vals && strlen (vals[0]) == 15)
|
if(vals && strlen (vals[0]) == 15)
|
||||||
{
|
{
|
||||||
es_fprintf (fp, "%u",
|
es_fprintf (fp, "%u",
|
||||||
(unsigned int) ldap2epochtime (vals[0]));
|
(unsigned int) ldap2epochtime (vals[0]));
|
||||||
ldap_value_free (vals);
|
ldap_value_free (vals);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
es_fprintf (fp, "\n");
|
es_fprintf (fp, "\n");
|
||||||
|
|
||||||
/* Now print all the uids that have this certid */
|
/* Now print all the uids that have this certid */
|
||||||
for (uids = ldap_first_entry (ldap_conn, res);
|
for (uids = ldap_first_entry (ldap_conn, res);
|
||||||
uids;
|
uids;
|
||||||
uids = ldap_next_entry (ldap_conn, uids))
|
uids = ldap_next_entry (ldap_conn, uids))
|
||||||
{
|
{
|
||||||
vals = ldap_get_values (ldap_conn, uids, "pgpcertid");
|
vals = ldap_get_values (ldap_conn, uids, "pgpcertid");
|
||||||
if (! vals)
|
if (! vals)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (strcasecmp (certid[0], vals[0]) == 0)
|
if (strcasecmp (certid[0], vals[0]) == 0)
|
||||||
{
|
{
|
||||||
char **uidvals;
|
char **uidvals;
|
||||||
|
|
||||||
es_fprintf (fp, "uid:");
|
es_fprintf (fp, "uid:");
|
||||||
|
|
||||||
uidvals = ldap_get_values (ldap_conn,
|
uidvals = ldap_get_values (ldap_conn,
|
||||||
uids, "pgpuserid");
|
uids, "pgpuserid");
|
||||||
if (uidvals)
|
if (uidvals)
|
||||||
{
|
{
|
||||||
/* Need to escape any colons */
|
/* Need to escape any colons */
|
||||||
char *quoted = percent_escape (uidvals[0], NULL);
|
char *quoted = percent_escape (uidvals[0], NULL);
|
||||||
es_fputs (quoted, fp);
|
es_fputs (quoted, fp);
|
||||||
xfree (quoted);
|
xfree (quoted);
|
||||||
ldap_value_free (uidvals);
|
ldap_value_free (uidvals);
|
||||||
}
|
}
|
||||||
|
|
||||||
es_fprintf (fp, "\n");
|
es_fprintf (fp, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
ldap_value_free(vals);
|
ldap_value_free(vals);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ldap_value_free (certid);
|
ldap_value_free (certid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user