* gpg/Makefile (TESTS_ENVIRONMENT): Set GPG_AGENT_INFO empty.
* gpg/t-signers.c, gpg/t-sign.c, gpg/t-encrypt-sym.c
* gpg/t-encrypt-sign.c, gpg/t-decrypt.c
* gpg/t-decrypt-verify.c (main): Changed the GPG_AGENT_INFO check to
match the one in ../../gpgme/rungpg.c.
+2002-06-20 Werner Koch <wk@gnupg.org>
+
+ * gpgsm/t-sign.c (main): Also test a normal signature.
+
+ * gpg/Makefile (TESTS_ENVIRONMENT): Set GPG_AGENT_INFO empty.
+ * gpg/t-signers.c, gpg/t-sign.c, gpg/t-encrypt-sym.c
+ * gpg/t-encrypt-sign.c, gpg/t-decrypt.c
+ * gpg/t-decrypt-verify.c (main): Changed the GPG_AGENT_INFO check to
+ match the one in ../../gpgme/rungpg.c.
+
2002-06-12 Werner Koch <wk@gnupg.org>
* gpgsm/t-keylist.c (doit): Print operation info if available.
GPG = @GPG@
-TESTS_ENVIRONMENT = GNUPGHOME=.
+TESTS_ENVIRONMENT = GNUPGHOME=. GPG_AGENT_INFO=
TESTS = t-encrypt t-encrypt-sym t-encrypt-sign t-sign t-signers \
t-decrypt t-verify t-decrypt-verify t-keylist t-export \
struct passphrase_cb_info_s info;
const char *cipher_2_asc = mk_fname ("cipher-2.asc");
GpgmeSigStat stat;
+ char *p;
do
{
err = gpgme_new (&ctx);
fail_if_err (err);
- if (!getenv("GPG_AGENT_INFO"))
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
{
memset (&info, 0, sizeof info);
info.c = ctx;
GpgmeData in, out, pwdata = NULL;
struct passphrase_cb_info_s info;
const char *cipher_1_asc = mk_fname ("cipher-1.asc");
+ char *p;
do {
err = gpgme_new (&ctx);
fail_if_err (err);
- if ( !getenv("GPG_AGENT_INFO") ) {
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
+ {
memset ( &info, 0, sizeof info );
info.c = ctx;
gpgme_set_passphrase_cb ( ctx, passphrase_cb, &info );
- }
+ }
err = gpgme_data_new_from_file ( &in, cipher_1_asc, 1 );
fail_if_err (err);
GpgmeError err;
GpgmeData in, out;
GpgmeRecipients rset;
+ char *p;
err = gpgme_check_engine ();
fail_if_err (err);
err = gpgme_new (&ctx);
fail_if_err (err);
gpgme_set_armor (ctx, 1);
- if (!getenv("GPG_AGENT_INFO"))
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
gpgme_set_passphrase_cb (ctx, passphrase_cb, NULL);
err = gpgme_data_new_from_mem ( &in, "Hallo Leute\n", 12, 0 );
GpgmeData plain, cipher;
const char *text = "Hallo Leute\n";
char *text2;
+ char *p;
int i;
err = gpgme_check_engine ();
err = gpgme_new (&ctx);
fail_if_err (err);
gpgme_set_armor (ctx, 1);
- if (!getenv("GPG_AGENT_INFO"))
- gpgme_set_passphrase_cb (ctx, passphrase_cb, NULL);
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
+ gpgme_set_passphrase_cb (ctx, passphrase_cb, NULL);
err = gpgme_data_new_from_mem (&plain, text, strlen (text), 0);
fail_if_err (err);
GpgmeCtx ctx;
GpgmeError err;
GpgmeData in, out;
+ char *p;
do {
err = gpgme_new (&ctx);
fail_if_err (err);
- if ( !getenv("GPG_AGENT_INFO") ) {
- gpgme_set_passphrase_cb ( ctx, passphrase_cb, NULL );
- }
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
+ gpgme_set_passphrase_cb ( ctx, passphrase_cb, NULL );
gpgme_set_textmode (ctx, 1);
gpgme_set_armor (ctx, 1);
GpgmeError err;
GpgmeData in, out;
GpgmeKey key[2]; /* There are two secret keys in the test area. */
+ char *p;
err = gpgme_new (&ctx);
fail_if_err (err);
{
err = gpgme_new (&ctx);
fail_if_err (err);
- if (!getenv ("GPG_AGENT_INFO"))
+
+ p = getenv("GPG_AGENT_INFO");
+ if (!(p && strchr (p, ':')))
gpgme_set_passphrase_cb (ctx, passphrase_cb, NULL);
err = gpgme_signers_add (ctx, key[0]);
fail_if_err (err);
err = gpgme_data_new_from_mem ( &in, "Hallo Leute!\n", 13, 0 );
fail_if_err (err);
-#if 0
/* first a normal signature */
err = gpgme_data_new ( &out );
fail_if_err (err);
fputs ("End Result.\n", stdout );
gpgme_data_release (out);
gpgme_data_rewind (in);
-#endif
/* now a detached signature */
err = gpgme_data_new ( &out );
gpgme_data_release (out);
gpgme_data_rewind (in);
-
-#if 0
- /* And finally a cleartext signature */
- err = gpgme_data_new ( &out );
- fail_if_err (err);
- err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR );
- fail_if_err (err);
- fflush (NULL);
- print_op_info (ctx);
- fputs ("Begin Result:\n", stdout );
- print_data (out);
- fputs ("End Result.\n", stdout );
- gpgme_data_release (out);
- gpgme_data_rewind (in);
-#endif
/* ready */
gpgme_data_release (in);