2003-06-05 23:20:29 +00:00
|
|
|
/* t-support.h - Helper routines for regression tests.
|
|
|
|
Copyright (C) 2000 Werner Koch (dd9jn)
|
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
COPYING.
* COPYING.LESSER: New file.
* gpgme.spec.in (%doc): Add COPYING.LESSER.
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
2.1 or later.
* TODO: Add copyright notice.
* README.CVS: Likewise.
assuan/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README.1st: Add copyright notice.
doc/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am: Change license to LGPL.
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
* gpgme.texi: Change license to LGPL (also for documentation of
GPGME's license).
* lesser.texi: New file.
* gpl.texi: File removed.
gpgme/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* putc_unlocked.c, funopen.c: I just claim copyright on these
files and change their license to LGPL, because they are totally
trivial wrapper functions.
* isascii.c: Change copyright notice to the one from ctype/ctype.h
in the GNU C Library (CVS Head 2004-10-10), where isascii is
defined as a macro doing exactly the same as the function in this
file.
* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
license to LGPL.
tests/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/mkdemodirs: Add copyright notice.
* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
|
|
|
Copyright (C) 2001, 2002, 2003, 2004 g10 Code GmbH
|
2003-06-05 23:20:29 +00:00
|
|
|
|
|
|
|
This file is part of GPGME.
|
2016-09-13 18:48:06 +00:00
|
|
|
|
2003-06-05 23:20:29 +00:00
|
|
|
GPGME is free software; you can redistribute it and/or modify it
|
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
COPYING.
* COPYING.LESSER: New file.
* gpgme.spec.in (%doc): Add COPYING.LESSER.
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
2.1 or later.
* TODO: Add copyright notice.
* README.CVS: Likewise.
assuan/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README.1st: Add copyright notice.
doc/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am: Change license to LGPL.
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
* gpgme.texi: Change license to LGPL (also for documentation of
GPGME's license).
* lesser.texi: New file.
* gpl.texi: File removed.
gpgme/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* putc_unlocked.c, funopen.c: I just claim copyright on these
files and change their license to LGPL, because they are totally
trivial wrapper functions.
* isascii.c: Change copyright notice to the one from ctype/ctype.h
in the GNU C Library (CVS Head 2004-10-10), where isascii is
defined as a macro doing exactly the same as the function in this
file.
* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
license to LGPL.
tests/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/mkdemodirs: Add copyright notice.
* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
|
|
|
under the terms of the GNU Lesser General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2.1 of
|
|
|
|
the License, or (at your option) any later version.
|
2016-09-13 18:48:06 +00:00
|
|
|
|
2003-06-05 23:20:29 +00:00
|
|
|
GPGME is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
COPYING.
* COPYING.LESSER: New file.
* gpgme.spec.in (%doc): Add COPYING.LESSER.
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
2.1 or later.
* TODO: Add copyright notice.
* README.CVS: Likewise.
assuan/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README.1st: Add copyright notice.
doc/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am: Change license to LGPL.
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
* gpgme.texi: Change license to LGPL (also for documentation of
GPGME's license).
* lesser.texi: New file.
* gpl.texi: File removed.
gpgme/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* putc_unlocked.c, funopen.c: I just claim copyright on these
files and change their license to LGPL, because they are totally
trivial wrapper functions.
* isascii.c: Change copyright notice to the one from ctype/ctype.h
in the GNU C Library (CVS Head 2004-10-10), where isascii is
defined as a macro doing exactly the same as the function in this
file.
* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
license to LGPL.
tests/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/mkdemodirs: Add copyright notice.
* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
|
|
|
Lesser General Public License for more details.
|
2016-09-13 18:48:06 +00:00
|
|
|
|
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README: Refer to COPYING.LESSER and "each file" instead of
COPYING.
* COPYING.LESSER: New file.
* gpgme.spec.in (%doc): Add COPYING.LESSER.
* acinclude.m4, configure.ac, Makefile.am: Change license to LGPL
2.1 or later.
* TODO: Add copyright notice.
* README.CVS: Likewise.
assuan/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* README.1st: Add copyright notice.
doc/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* Makefile.am: Change license to LGPL.
(gpgme_TEXINFOS): Replace gpl.texi with lesser.texi.
* gpgme.texi: Change license to LGPL (also for documentation of
GPGME's license).
* lesser.texi: New file.
* gpl.texi: File removed.
gpgme/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* putc_unlocked.c, funopen.c: I just claim copyright on these
files and change their license to LGPL, because they are totally
trivial wrapper functions.
* isascii.c: Change copyright notice to the one from ctype/ctype.h
in the GNU C Library (CVS Head 2004-10-10), where isascii is
defined as a macro doing exactly the same as the function in this
file.
* memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
* stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
* ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
license to LGPL.
tests/
2004-12-07 Marcus Brinkmann <marcus@g10code.de>
* gpg/mkdemodirs: Add copyright notice.
* gpgsm/Makefile.am, gpgsm/t-support.h, gpgsm/t-decrypt.c,
gpgsm/t-encrypt.c, gpgsm/t-export.c, gpgsm/t-genkey.c,
gpgsm/t-import.c, gpgsm/t-keylist.c, gpgsm/t-sign.c,
gpgsm/t-verify.c, gpg/Makefile.am, gpg/t-decrypt.c,
gpg/t-decrypt-verify.c, gpg/t-edit.c, gpg/t-encrypt.c,
gpg/t-encrypt-sign.c, gpg/t-encrypt-sym.c, gpg/t-eventloop.c,
gpg/t-export.c, gpg/t-genkey.c, gpg/t-import.c, gpg/t-keylist.c,
gpg/t-keylist-sig.c, gpg/t-sign.c, gpg/t-signers.c,
gpg/t-support.h, gpg/t-thread1.c, gpg/t-trustlist.c,
gpg/t-verify.c, Makefile.am, t-data.c, t-engine-info.c,
t-version.c: Change license to LGPL.
2004-12-07 21:13:39 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA. */
|
2003-06-05 23:20:29 +00:00
|
|
|
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
2003-09-14 00:30:53 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <locale.h>
|
2018-11-14 13:50:57 +00:00
|
|
|
#include <limits.h>
|
|
|
|
#include <ctype.h>
|
2003-06-05 23:20:29 +00:00
|
|
|
|
2007-09-27 13:01:54 +00:00
|
|
|
#ifdef HAVE_W32_SYSTEM
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2003-06-05 23:20:29 +00:00
|
|
|
#include <gpgme.h>
|
|
|
|
|
2003-11-19 15:15:33 +00:00
|
|
|
#ifndef DIM
|
|
|
|
#define DIM(v) (sizeof(v)/sizeof((v)[0]))
|
|
|
|
#endif
|
|
|
|
|
2003-06-05 23:20:29 +00:00
|
|
|
#define fail_if_err(err) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
if (err) \
|
|
|
|
{ \
|
|
|
|
fprintf (stderr, "%s:%d: %s: %s\n", \
|
|
|
|
__FILE__, __LINE__, gpgme_strsource (err), \
|
|
|
|
gpgme_strerror (err)); \
|
|
|
|
exit (1); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
while (0)
|
|
|
|
|
|
|
|
|
2017-01-12 13:01:00 +00:00
|
|
|
#ifdef GPGRT_HAVE_MACRO_FUNCTION
|
|
|
|
void GPGRT_ATTR_NORETURN
|
|
|
|
_test (const char *expr, const char *file, int line,
|
|
|
|
const char *func)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "Test \"%s\" in %s failed (%s:%d)\n",
|
|
|
|
expr, func, file, line);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
# define test(expr) \
|
|
|
|
((expr) \
|
|
|
|
? (void) 0 \
|
|
|
|
: _test (#expr, __FILE__, __LINE__, __FUNCTION__))
|
|
|
|
#else /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
|
|
|
void
|
|
|
|
_test (const char *expr, const char *file, int line)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "Test \"%s\" failed (%s:%d)\n",
|
|
|
|
expr, file, line);
|
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
# define test(expr) \
|
|
|
|
((expr) \
|
|
|
|
? (void) 0 \
|
|
|
|
: _test (#expr, __FILE__, __LINE__))
|
|
|
|
#endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
|
|
|
|
|
|
|
|
2009-06-16 15:42:37 +00:00
|
|
|
static const char *
|
|
|
|
nonnull (const char *s)
|
|
|
|
{
|
|
|
|
return s? s :"[none]";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-05 23:20:29 +00:00
|
|
|
void
|
|
|
|
print_data (gpgme_data_t dh)
|
|
|
|
{
|
|
|
|
#define BUF_SIZE 512
|
|
|
|
char buf[BUF_SIZE + 1];
|
|
|
|
int ret;
|
2016-09-13 18:48:06 +00:00
|
|
|
|
2003-06-05 23:20:29 +00:00
|
|
|
ret = gpgme_data_seek (dh, 0, SEEK_SET);
|
|
|
|
if (ret)
|
2003-06-06 00:56:03 +00:00
|
|
|
fail_if_err (gpgme_err_code_from_errno (errno));
|
2003-06-05 23:20:29 +00:00
|
|
|
while ((ret = gpgme_data_read (dh, buf, BUF_SIZE)) > 0)
|
|
|
|
fwrite (buf, ret, 1, stdout);
|
|
|
|
if (ret < 0)
|
2003-06-06 00:56:03 +00:00
|
|
|
fail_if_err (gpgme_err_code_from_errno (errno));
|
2003-06-05 23:20:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gpgme_error_t
|
|
|
|
passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info,
|
|
|
|
int last_was_bad, int fd)
|
|
|
|
{
|
2009-06-22 14:50:17 +00:00
|
|
|
int res;
|
2016-09-13 18:46:41 +00:00
|
|
|
char pass[] = "abc\n";
|
2009-06-22 14:50:17 +00:00
|
|
|
int passlen = strlen (pass);
|
|
|
|
int off = 0;
|
|
|
|
|
2016-09-13 18:46:41 +00:00
|
|
|
(void)opaque;
|
|
|
|
(void)uid_hint;
|
|
|
|
(void)passphrase_info;
|
|
|
|
(void)last_was_bad;
|
|
|
|
|
2009-06-22 14:50:17 +00:00
|
|
|
do
|
|
|
|
{
|
2016-09-13 18:46:41 +00:00
|
|
|
res = gpgme_io_write (fd, &pass[off], passlen - off);
|
2009-06-22 14:50:17 +00:00
|
|
|
if (res > 0)
|
|
|
|
off += res;
|
|
|
|
}
|
|
|
|
while (res > 0 && off != passlen);
|
|
|
|
|
|
|
|
return off == passlen ? 0 : gpgme_error_from_errno (errno);
|
2003-06-05 23:20:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *
|
|
|
|
make_filename (const char *fname)
|
|
|
|
{
|
|
|
|
const char *srcdir = getenv ("srcdir");
|
|
|
|
char *buf;
|
|
|
|
|
|
|
|
if (!srcdir)
|
|
|
|
srcdir = ".";
|
|
|
|
buf = malloc (strlen(srcdir) + strlen(fname) + 2);
|
2016-09-13 18:48:06 +00:00
|
|
|
if (!buf)
|
2003-06-05 23:20:29 +00:00
|
|
|
exit (8);
|
|
|
|
strcpy (buf, srcdir);
|
|
|
|
strcat (buf, "/");
|
|
|
|
strcat (buf, fname);
|
|
|
|
return buf;
|
|
|
|
}
|
2003-09-14 00:30:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
init_gpgme (gpgme_protocol_t proto)
|
|
|
|
{
|
|
|
|
gpgme_error_t err;
|
|
|
|
|
|
|
|
gpgme_check_version (NULL);
|
|
|
|
setlocale (LC_ALL, "");
|
|
|
|
gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
|
2005-09-23 13:29:04 +00:00
|
|
|
#ifndef HAVE_W32_SYSTEM
|
2003-09-14 00:30:53 +00:00
|
|
|
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
|
2005-09-23 13:29:04 +00:00
|
|
|
#endif
|
2003-09-14 00:30:53 +00:00
|
|
|
|
|
|
|
err = gpgme_engine_check_version (proto);
|
|
|
|
fail_if_err (err);
|
|
|
|
}
|
2009-06-16 15:42:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
print_import_result (gpgme_import_result_t r)
|
|
|
|
{
|
|
|
|
gpgme_import_status_t st;
|
|
|
|
|
|
|
|
for (st=r->imports; st; st = st->next)
|
|
|
|
{
|
|
|
|
printf (" fpr: %s err: %d (%s) status:", nonnull (st->fpr),
|
Use gpgme interface for error handling to avoid linking with gpg-error.
* tests/t-data.c, tests/run-export.c, tests/run-keylist.c,
tests/run-support.h, tests/run-verify.c, tests/gpg/t-decrypt-verify.c,
tests/gpg/t-edit.c, tests/gpg/t-eventloop.c, tests/gpg/t-keylist-sig.c,
tests/gpg/t-keylist.c, tests/gpg/t-support.h, tests/gpg/t-trustlist.c,
tests/gpg/t-verify.c, tests/gpg/t-wait.c, tests/gpgsm/cms-decrypt.c,
tests/gpgsm/cms-keylist.c, tests/gpgsm/t-keylist.c,
tests/gpgsm/t-support.h, tests/gpgsm/t-verify.c,
tests/opassuan/t-command.c: Use gpgme interface for gpg-error functions.
2012-02-08 14:26:17 +00:00
|
|
|
st->result, gpgme_strerror (st->result));
|
2009-06-16 15:42:37 +00:00
|
|
|
if (st->status & GPGME_IMPORT_NEW)
|
|
|
|
fputs (" new", stdout);
|
|
|
|
if (st->status & GPGME_IMPORT_UID)
|
|
|
|
fputs (" uid", stdout);
|
|
|
|
if (st->status & GPGME_IMPORT_SIG)
|
|
|
|
fputs (" sig", stdout);
|
|
|
|
if (st->status & GPGME_IMPORT_SUBKEY)
|
|
|
|
fputs (" subkey", stdout);
|
|
|
|
if (st->status & GPGME_IMPORT_SECRET)
|
|
|
|
fputs (" secret", stdout);
|
|
|
|
putchar ('\n');
|
|
|
|
}
|
|
|
|
printf ("key import summary:\n"
|
|
|
|
" considered: %d\n"
|
|
|
|
" no user id: %d\n"
|
|
|
|
" imported: %d\n"
|
|
|
|
" imported_rsa: %d\n"
|
|
|
|
" unchanged: %d\n"
|
|
|
|
" new user ids: %d\n"
|
|
|
|
" new subkeys: %d\n"
|
|
|
|
" new signatures: %d\n"
|
|
|
|
" new revocations: %d\n"
|
|
|
|
" secret read: %d\n"
|
|
|
|
" secret imported: %d\n"
|
|
|
|
" secret unchanged: %d\n"
|
|
|
|
" skipped new keys: %d\n"
|
2018-03-15 14:58:32 +00:00
|
|
|
" not imported: %d\n"
|
|
|
|
" skipped v3 keys: %d\n",
|
2009-06-16 15:42:37 +00:00
|
|
|
r->considered,
|
|
|
|
r->no_user_id,
|
|
|
|
r->imported,
|
|
|
|
r->imported_rsa,
|
|
|
|
r->unchanged,
|
|
|
|
r->new_user_ids,
|
|
|
|
r->new_sub_keys,
|
|
|
|
r->new_signatures,
|
|
|
|
r->new_revocations,
|
|
|
|
r->secret_read,
|
|
|
|
r->secret_imported,
|
|
|
|
r->secret_unchanged,
|
|
|
|
r->skipped_new_keys,
|
2018-03-15 14:58:32 +00:00
|
|
|
r->not_imported,
|
|
|
|
r->skipped_v3_keys);
|
2009-06-16 15:42:37 +00:00
|
|
|
}
|