aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-04-05 11:53:55 +0000
committerWerner Koch <[email protected]>2004-04-05 11:53:55 +0000
commit92dff6e4f17567cbe64fc4779deb9d2c51716ab0 (patch)
treeb9ef192235d16f8d30a2691899cc70e573e8951c
parent2004-03-29 Moritz Schulte <[email protected]> (diff)
downloadgpgme-92dff6e4f17567cbe64fc4779deb9d2c51716ab0.tar.gz
gpgme-92dff6e4f17567cbe64fc4779deb9d2c51716ab0.zip
(gpgsm_keylist_ext): Send with-validation
option. Fixed pattern construction.
-rw-r--r--gpgme/ChangeLog5
-rw-r--r--gpgme/ath-compat.c2
-rw-r--r--gpgme/engine-gpgsm.c15
-rw-r--r--gpgme/gpgme.h5
4 files changed, 25 insertions, 2 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog
index 9e52ee8b..16b2d87a 100644
--- a/gpgme/ChangeLog
+++ b/gpgme/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-05 Werner Koch <[email protected]>
+
+ * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
+ option. Fixed pattern construction.
+
2004-03-23 Marcus Brinkmann <[email protected]>
* engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
diff --git a/gpgme/ath-compat.c b/gpgme/ath-compat.c
index 02ccc58a..a4bd3f16 100644
--- a/gpgme/ath-compat.c
+++ b/gpgme/ath-compat.c
@@ -29,7 +29,9 @@
# include <sys/time.h>
#endif
#include <sys/types.h>
+#ifndef _WIN32
#include <sys/wait.h>
+#endif
#include "ath.h"
diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c
index 929b98c6..79eb2101 100644
--- a/gpgme/engine-gpgsm.c
+++ b/gpgme/engine-gpgsm.c
@@ -1293,6 +1293,7 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
/* Length is "LISTSECRETKEYS " + p + '\0'. */
int length = 15 + 1;
char *linep;
+ int any_pattern = 0;
int list_mode = 0;
if (reserved)
@@ -1310,6 +1311,15 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
if (err)
return err;
+ /* Use the validation mode if required. We don't check for an error
+ yet because this is a pretty fresh gpgsm features. */
+ gpgsm_assuan_simple_command (gpgsm->assuan_ctx,
+ (mode & GPGME_KEYLIST_MODE_VALIDATE)?
+ "OPTION with-validation=1":
+ "OPTION with-validation=0" ,
+ NULL, NULL);
+
+
if (pattern && *pattern)
{
const char **pat = pattern;
@@ -1326,7 +1336,6 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
patlet++;
}
pat++;
- /* This will allocate one byte more than necessary. */
length++;
}
}
@@ -1375,9 +1384,13 @@ gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only,
}
patlet++;
}
+ any_pattern = 1;
+ *linep++ = ' ';
pattern++;
}
}
+ if (any_pattern)
+ linep--;
*linep = '\0';
_gpgme_io_close (gpgsm->input_cb.fd);
diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h
index 04615e63..adc769f3 100644
--- a/gpgme/gpgme.h
+++ b/gpgme/gpgme.h
@@ -37,6 +37,9 @@
typedef long ssize_t;
#else
# include <sys/types.h>
+#ifdef _WIN32
+typedef long ssize_t;
+#endif
#endif
#ifdef __cplusplus
@@ -71,7 +74,7 @@ extern "C" {
AM_PATH_GPGME macro) check that this header matches the installed
library. Warning: Do not edit the next line. configure will do
that for you! */
-#define GPGME_VERSION "0.4.5-cvs"
+#define GPGME_VERSION "0.4.6-cvs"
/* Some opaque data types used by GPGME. */