summaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2004-03-16 19:59:09 +0100
committerWerner Koch <wk@gnupg.org>2004-03-16 19:59:09 +0100
commit050b96f79077b1514829f49a89ce2a1acda0a483 (patch)
tree171bf4fd38e4039ffa4ce52379cd40315083a127 /sm
parent*** empty log message *** (diff)
downloadgnupg2-050b96f79077b1514829f49a89ce2a1acda0a483.tar.xz
gnupg2-050b96f79077b1514829f49a89ce2a1acda0a483.zip
(main): Implemented --gpgconf-list.
Diffstat (limited to 'sm')
-rw-r--r--sm/ChangeLog4
-rw-r--r--sm/certlist.c1
-rw-r--r--sm/gpgsm.c60
3 files changed, 49 insertions, 16 deletions
diff --git a/sm/ChangeLog b/sm/ChangeLog
index 18431c11c..210448643 100644
--- a/sm/ChangeLog
+++ b/sm/ChangeLog
@@ -1,3 +1,7 @@
+2004-03-16 Werner Koch <wk@gnupg.org>
+
+ * gpgsm.c (main): Implemented --gpgconf-list.
+
2004-03-15 Werner Koch <wk@gnupg.org>
* keylist.c (list_cert_colon): Hack to set the expired flag.
diff --git a/sm/certlist.c b/sm/certlist.c
index 8ee3c2caf..6e694b781 100644
--- a/sm/certlist.c
+++ b/sm/certlist.c
@@ -40,6 +40,7 @@ static const char oid_kp_clientAuth[] = "1.3.6.1.5.5.7.3.2";
static const char oid_kp_codeSigning[] = "1.3.6.1.5.5.7.3.3";
static const char oid_kp_emailProtection[]= "1.3.6.1.5.5.7.3.4";
static const char oid_kp_timeStamping[] = "1.3.6.1.5.5.7.3.8";
+static const char oid_kp_ocspSigning[] = "1.3.6.1.5.6.7.3.9";
/* Return 0 if the cert is usable for encryption. A MODE of 0 checks
for signing a MODE of 1 checks for encryption, a MODE of 2 checks
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index ca7fbfcca..6b8a2ea49 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -690,6 +690,7 @@ main ( int argc, char **argv)
CERTLIST recplist = NULL;
CERTLIST signerlist = NULL;
int do_not_setup_keys = 0;
+ char *config_filename = NULL;
/* trap_unaligned ();*/
set_strusage (my_strusage);
@@ -1116,7 +1117,8 @@ main ( int argc, char **argv)
{
fclose (configfp);
configfp = NULL;
- xfree (configname);
+ /* Keep a copy of the config filename. */
+ config_filename = configname;
configname = NULL;
goto next_pass;
}
@@ -1259,21 +1261,47 @@ main ( int argc, char **argv)
{
case aGPGConfList:
{ /* List options and default values in the GPG Conf format. */
- char *filename;
-
- /* First the default configuration file. This is not an
- option, but it is vital information for GPG Conf. */
- filename = make_filename (opt.homedir, "gpgsm.conf", NULL);
- printf ("gpgconf-gpgsm.conf:\"%s\n", filename);
- xfree (filename);
-
- printf ("verbose:\n"
- "quiet:\n"
- "debug-level:none\n"
- "log-file:\n"
- "force:\n"
- "faked-system-time:\n"
- "no-greeting:\n");
+
+ /* The following list is taken from gnupg/tools/gpgconf-comp.c. */
+ /* Option flags. YOU MUST NOT CHANGE THE NUMBERS OF THE EXISTING
+ FLAGS, AS THEY ARE PART OF THE EXTERNAL INTERFACE. */
+#define GC_OPT_FLAG_NONE 0UL
+ /* The RUNTIME flag for an option indicates that the option can be
+ changed at runtime. */
+#define GC_OPT_FLAG_RUNTIME (1UL << 3)
+ /* The DEFAULT flag for an option indicates that the option has a
+ default value. */
+#define GC_OPT_FLAG_DEFAULT (1UL << 4)
+ /* The DEF_DESC flag for an option indicates that the option has a
+ default, which is described by the value of the default field. */
+#define GC_OPT_FLAG_DEF_DESC (1UL << 5)
+ /* The NO_ARG_DESC flag for an option indicates that the argument has
+ a default, which is described by the value of the ARGDEF field. */
+#define GC_OPT_FLAG_NO_ARG_DESC (1UL << 6)
+
+ printf ("gpgconf-gpgsm.conf:%lu:\"%s\"\n",
+ GC_OPT_FLAG_DEFAULT,
+ config_filename?config_filename:"/dev/null");
+
+ printf ("verbose:%lu:\n"
+ "quiet:%lu:\n"
+ "debug-level:%lu:\"none\":\n"
+ "log-file:%lu:\n",
+ GC_OPT_FLAG_NONE,
+ GC_OPT_FLAG_NONE,
+ GC_OPT_FLAG_DEFAULT,
+ GC_OPT_FLAG_NONE );
+ printf ("disable-crl-checks:%lu:\n",
+ GC_OPT_FLAG_NONE );
+ printf ("enable-ocsp:%lu:\n",
+ GC_OPT_FLAG_NONE );
+ printf ("include-certs:%lu:1:\n",
+ GC_OPT_FLAG_DEFAULT );
+ printf ("disable-policy-checks:%lu:\n",
+ GC_OPT_FLAG_NONE );
+ printf ("auto-issuer-key-retrieve:%lu:\n",
+ GC_OPT_FLAG_NONE );
+
}
break;