__FILE__, __LINE__, sig->fpr);
exit (1);
}
- if (gpg_err_code (sig->status) != status)
+ if (gpgme_err_code (sig->status) != status)
{
fprintf (stderr, "%s:%i: Unexpected signature status: %s\n",
__FILE__, __LINE__, gpgme_strerror (sig->status));
__FILE__, __LINE__, sig->validity);
exit (1);
}
- if (gpg_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR)
+ if (gpgme_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR)
{
fprintf (stderr, "%s:%i: Unexpected validity reason: %s\n",
__FILE__, __LINE__, gpgme_strerror (sig->validity_reason));
ret = gpgme_data_seek (dh, 0, SEEK_SET);
if (ret)
- fail_if_err (gpg_error_from_errno (errno));
+ fail_if_err (gpgme_error_from_errno (errno));
while ((ret = gpgme_data_read (dh, buf, 100)) > 0)
fwrite (buf, ret, 1, stdout);
if (ret < 0)
- fail_if_err (gpg_error_from_errno (errno));
+ fail_if_err (gpgme_error_from_errno (errno));
}
}
}
if (i == FDLIST_MAX)
- return gpg_err_make (GPG_ERR_SOURCE_USER_1, GPG_ERR_GENERAL);
+ return gpgme_err_make (GPG_ERR_SOURCE_USER_1, GPG_ERR_GENERAL);
*r_tag = &fds[i];
return 0;
}
exit (1);
}
-
-
-
-
gpgme_key_unref (key);
i++;
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
err = gpgme_op_keylist_end (ctx);
fail_if_err (err);
gpgme_key_unref (key);
i++;
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
err = gpgme_op_keylist_end (ctx);
fail_if_err (err);
for (st=r->imports; st; st = st->next)
{
printf (" fpr: %s err: %d (%s) status:", nonnull (st->fpr),
- st->result, gpg_strerror (st->result));
+ st->result, gpgme_strerror (st->result));
if (st->status & GPGME_IMPORT_NEW)
fputs (" new", stdout);
if (st->status & GPGME_IMPORT_UID)
item->validity, item->name);
gpgme_trust_item_unref (item);
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
gpgme_release (ctx);
__FILE__, __LINE__, sig->fpr);
exit (1);
}
- if (gpg_err_code (sig->status) != status)
+ if (gpgme_err_code (sig->status) != status)
{
fprintf (stderr, "%s:%i: Unexpected signature status: %s\n",
- __FILE__, __LINE__, gpg_strerror (sig->status));
+ __FILE__, __LINE__, gpgme_strerror (sig->status));
exit (1);
}
if (notation)
__FILE__, __LINE__, sig->validity);
exit (1);
}
- if (gpg_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR)
+ if (gpgme_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR)
{
fprintf (stderr, "%s:%i: Unexpected validity reason: %s\n",
__FILE__, __LINE__, gpgme_strerror (sig->validity_reason));
err = gpgme_data_new (&text);
fail_if_err (err);
err = gpgme_op_verify (ctx, sig, NULL, text);
- if (gpg_err_code (err) != GPG_ERR_BAD_DATA)
+ if (gpgme_err_code (err) != GPG_ERR_BAD_DATA)
{
fprintf (stderr, "%s:%i: Double plaintext message not detected\n",
__FILE__, __LINE__);
while (gpgme_wait (ctx, &err, 0) == NULL && err == 0)
sleep(1);
- if (gpg_err_code (err) != GPG_ERR_NO_DATA)
+ if (gpgme_err_code (err) != GPG_ERR_NO_DATA)
{
fprintf (stderr, "%s:%d: %s: %s\n",
__FILE__, __LINE__, gpgme_strsource (err),
err = gpgme_op_decrypt (ctx, in, out);
printf ("gpgme_op_decrypt: %s <%s> (%u)\n",
- gpg_strerror (err), gpg_strsource (err), err);
+ gpgme_strerror (err), gpgme_strsource (err), err);
result = gpgme_op_decrypt_result (ctx);
if (!result)
{
for (recp = result->recipients; recp; recp = recp->next)
{
printf ("recipient.status: %s <%s> (%u)\n",
- gpg_strerror (recp->status), gpg_strsource (recp->status),
+ gpgme_strerror (recp->status), gpgme_strsource (recp->status),
recp->status);
printf ("recipient.pkalgo: %d\n", recp->pubkey_algo);
printf ("recipient.keyid : %s\n", nonnull (recp->keyid));
gpgme_key_unref (key);
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
err = gpgme_op_keylist_end (ctx);
fail_if_err (err);
gpgme_key_unref (key);
i++;
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
err = gpgme_op_keylist_end (ctx);
fail_if_err (err);
if (err) \
{ \
fprintf (stderr, "%s:%d: %s: %s (%d.%d)\n", \
- __FILE__, __LINE__, gpg_strsource (err), \
- gpg_strerror (err), \
- gpg_err_source (err), gpg_err_code (err)); \
+ __FILE__, __LINE__, gpgme_strsource (err), \
+ gpgme_strerror (err), \
+ gpgme_err_source (err), gpgme_err_code (err)); \
exit (1); \
} \
} \
ret = gpgme_data_seek (dh, 0, SEEK_SET);
if (ret)
- fail_if_err (gpg_error_from_errno (errno));
+ fail_if_err (gpgme_error_from_errno (errno));
while ((ret = gpgme_data_read (dh, buf, BUF_SIZE)) > 0)
fwrite (buf, ret, 1, stdout);
if (ret < 0)
- fail_if_err (gpg_error_from_errno (errno));
+ fail_if_err (gpgme_error_from_errno (errno));
}
__FILE__, __LINE__, sig->fpr);
got_errors = 1;
}
- if (gpg_err_code (sig->status) != status)
+ if (gpgme_err_code (sig->status) != status)
{
fprintf (stderr, "%s:%i: Unexpected signature status: %s\n",
__FILE__, __LINE__, gpgme_strerror (sig->status));
__FILE__, __LINE__, sig->validity);
got_errors = 1;
}
- if (gpg_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR)
+ if (gpgme_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR)
{
fprintf (stderr, "%s:%i: Unexpected validity reason: %s\n",
__FILE__, __LINE__, gpgme_strerror (sig->validity_reason));
{
fprintf (stderr, "%s:%i: Can't get audit log: %s\n",
__FILE__, __LINE__, gpgme_strerror (err));
- if (gpg_err_code (err) != GPG_ERR_ASS_UNKNOWN_CMD)
+ if (gpgme_err_code (err) != GPG_ERR_ASS_UNKNOWN_CMD)
got_errors = 1;
}
print_data (data);
if (err) \
{ \
fprintf (stderr, "%s:%d: %s: %s (%d.%d)\n", \
- __FILE__, __LINE__, gpg_strsource (err), \
- gpg_strerror (err), \
- gpg_err_source (err), gpg_err_code (err)); \
+ __FILE__, __LINE__, gpgme_strsource (err), \
+ gpgme_strerror (err), \
+ gpgme_err_source (err), gpgme_err_code (err)); \
exit (1); \
} \
} \
while (0)
-static gpg_error_t
+static gpgme_error_t
data_cb (void *opaque, const void *data, size_t datalen)
{
printf ("DATA_CB: datalen=%d\n", (int)datalen);
}
-static gpg_error_t
+static gpgme_error_t
inq_cb (void *opaque, const char *name, const char *args,
gpgme_data_t *r_data)
{
gpgme_data_t data;
- gpg_error_t err;
+ gpgme_error_t err;
if (name)
{
/* Uncomment the next lines and send a "SCD LEARN" to test sending
cancel from in inquiry. */
/* if (name && !strcmp (name, "KNOWNCARDP")) */
- /* return gpg_error (GPG_ERR_ASS_CANCELED); */
+ /* return gpgme_error (GPG_ERR_ASS_CANCELED); */
return 0;
}
-static gpg_error_t
+static gpgme_error_t
status_cb (void *opaque, const char *status, const char *args)
{
printf ("STATUS_CB: status=`%s' args=`%s'\n", status, args);
gpgme_key_unref (key);
}
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
err = gpgme_op_keylist_end (ctx);
fail_if_err (err);
else
gpgme_key_unref (key);
}
- if (gpg_err_code (err) != GPG_ERR_EOF)
+ if (gpgme_err_code (err) != GPG_ERR_EOF)
fail_if_err (err);
err = gpgme_op_keylist_end (ctx);
fail_if_err (err);
for (st=r->imports; st; st = st->next)
{
printf (" fpr: %s err: %d (%s) status:", nonnull (st->fpr),
- st->result, gpg_strerror (st->result));
+ st->result, gpgme_strerror (st->result));
if (st->status & GPGME_IMPORT_NEW)
fputs (" new", stdout);
if (st->status & GPGME_IMPORT_UID)
for (sig = result->signatures; sig; sig = sig->next)
{
printf ("Signature %d\n", count++);
- printf (" status ....: %s\n", gpg_strerror (sig->status));
+ printf (" status ....: %s\n", gpgme_strerror (sig->status));
printf (" summary ...:"); print_summary (sig->summary); putchar ('\n');
printf (" fingerprint: %s\n", nonnull (sig->fpr));
printf (" created ...: %lu\n", sig->timestamp);
printf (" expires ...: %lu\n", sig->exp_timestamp);
printf (" validity ..: ");
print_validity (sig->validity); putchar ('\n');
- printf (" val.reason : %s\n", gpg_strerror (sig->status));
+ printf (" val.reason : %s\n", gpgme_strerror (sig->status));
printf (" pubkey algo: %d\n", sig->pubkey_algo);
printf (" digest algo: %d\n", sig->hash_algo);
printf (" pka address: %s\n", nonnull (sig->pka_address));
fp_sig = fopen (argv[0], "rb");
if (!fp_sig)
{
- err = gpg_error_from_syserror ();
+ err = gpgme_error_from_syserror ();
fprintf (stderr, PGM ": can't open `%s': %s\n",
- argv[0], gpg_strerror (err));
+ argv[0], gpgme_strerror (err));
exit (1);
}
if (argc > 1)
fp_msg = fopen (argv[1], "rb");
if (!fp_msg)
{
- err = gpg_error_from_syserror ();
+ err = gpgme_error_from_syserror ();
fprintf (stderr, PGM ": can't open `%s': %s\n",
- argv[1], gpg_strerror (err));
+ argv[1], gpgme_strerror (err));
exit (1);
}
}
if (err)
{
fprintf (stderr, PGM ": error allocating data object: %s\n",
- gpg_strerror (err));
+ gpgme_strerror (err));
exit (1);
}
if (fp_msg)
if (err)
{
fprintf (stderr, PGM ": error allocating data object: %s\n",
- gpg_strerror (err));
+ gpgme_strerror (err));
exit (1);
}
}
print_result (result);
if (err)
{
- fprintf (stderr, PGM ": signing failed: %s\n", gpg_strerror (err));
+ fprintf (stderr, PGM ": signing failed: %s\n", gpgme_strerror (err));
exit (1);
}
amt = gpgme_data_write (data, text, strlen (text));
if (amt != strlen (text))
- fail_if_err (gpg_error_from_errno (errno));
+ fail_if_err (gpgme_error_from_errno (errno));
gpgme_data_seek (data, 0, SEEK_SET);
case TEST_INOUT_MEM_FROM_FILE_NO_COPY:
err = gpgme_data_new_from_file (&data, text_filename, 0);
/* This is not implemented yet. */
- if (gpg_err_code (err) == GPG_ERR_NOT_IMPLEMENTED
- || gpg_err_code (err) == GPG_ERR_INV_VALUE)
+ if (gpgme_err_code (err) == GPG_ERR_NOT_IMPLEMENTED
+ || gpgme_err_code (err) == GPG_ERR_INV_VALUE)
continue;
break;
case TEST_INOUT_MEM_FROM_FILE_PART_BY_NAME: