2003-09-14 Marcus Brinkmann <marcus@g10code.de>
* gpg/t-import.c (main): Likewise. * gpg/t-keylist-sig.c (main): Likewise. * gpg/t-keylist.c (main): Likewise. * gpg/t-sign.c (main): Likewise. * gpg/t-signers.c (main): Likewise. * gpg/t-trustlist.c (main): Likewise. * gpgsm/t-support.h: Include <stdlib.h> and <locale.h>. (init_gpgme): New function. * gpg/t-support.h: Likewise. * gpgsm/t-verify.c (main): Call init_gpgme. * gpgsm/t-decrypt.c (main): Likewise. * gpgsm/t-encrypt.c (main): Likewise. * gpgsm/t-export.c (main): Likewise. * gpgsm/t-genkey.c (main): Likewise. * gpgsm/t-import.c (main): Likewise. * gpgsm/t-keylist.c (main): Likewise. * gpgsm/t-sign.c (main): Likewise. * gpg/t-verify.c (main): Call init_gpgme. * gpg/t-decrypt-verify.c (main): Likewise. * gpg/t-decrypt.c (main): Likewise. * gpg/t-edit.c (main): Likewise. * gpg/t-encrypt-sign.c (main): Likewise. * gpg/t-encrypt-sym.c (main): Likewise. * gpg/t-encrypt.c (main): Likewise. * gpg/t-eventloop.c (main): Likewise. * gpg/t-export.c (main): Likewise. * gpg/t-genkey.c (main): Likewise.
This commit is contained in:
parent
e4792cfb7d
commit
f8867f2707
@ -1,3 +1,33 @@
|
||||
2003-09-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpg/t-import.c (main): Likewise.
|
||||
* gpg/t-keylist-sig.c (main): Likewise.
|
||||
* gpg/t-keylist.c (main): Likewise.
|
||||
* gpg/t-sign.c (main): Likewise.
|
||||
* gpg/t-signers.c (main): Likewise.
|
||||
* gpg/t-trustlist.c (main): Likewise.
|
||||
* gpgsm/t-support.h: Include <stdlib.h> and <locale.h>.
|
||||
(init_gpgme): New function.
|
||||
* gpg/t-support.h: Likewise.
|
||||
* gpgsm/t-verify.c (main): Call init_gpgme.
|
||||
* gpgsm/t-decrypt.c (main): Likewise.
|
||||
* gpgsm/t-encrypt.c (main): Likewise.
|
||||
* gpgsm/t-export.c (main): Likewise.
|
||||
* gpgsm/t-genkey.c (main): Likewise.
|
||||
* gpgsm/t-import.c (main): Likewise.
|
||||
* gpgsm/t-keylist.c (main): Likewise.
|
||||
* gpgsm/t-sign.c (main): Likewise.
|
||||
* gpg/t-verify.c (main): Call init_gpgme.
|
||||
* gpg/t-decrypt-verify.c (main): Likewise.
|
||||
* gpg/t-decrypt.c (main): Likewise.
|
||||
* gpg/t-edit.c (main): Likewise.
|
||||
* gpg/t-encrypt-sign.c (main): Likewise.
|
||||
* gpg/t-encrypt-sym.c (main): Likewise.
|
||||
* gpg/t-encrypt.c (main): Likewise.
|
||||
* gpg/t-eventloop.c (main): Likewise.
|
||||
* gpg/t-export.c (main): Likewise.
|
||||
* gpg/t-genkey.c (main): Likewise.
|
||||
|
||||
2003-08-14 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* gpg/t-sign.c (check_result): Change output format for signature
|
||||
|
@ -98,6 +98,8 @@ main (int argc, char *argv[])
|
||||
const char *cipher_2_asc = make_filename ("cipher-2.asc");
|
||||
char *agent_info;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
@ -130,5 +132,3 @@ main (int argc, char *argv[])
|
||||
gpgme_release (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,6 +39,8 @@ main (int argc, char *argv[])
|
||||
const char *cipher_1_asc = make_filename ("cipher-1.asc");
|
||||
char *agent_info;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -113,6 +113,8 @@ main (int argc, char **argv)
|
||||
const char *pattern = "Alpha";
|
||||
char *agent_info;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
err = gpgme_data_new (&out);
|
||||
@ -141,5 +143,3 @@ main (int argc, char **argv)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,8 +86,7 @@ main (int argc, char **argv)
|
||||
gpgme_sign_result_t sign_result;
|
||||
char *agent_info;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -40,8 +40,7 @@ main (int argc, char *argv[])
|
||||
char *p;
|
||||
size_t len;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
@ -90,5 +89,3 @@ main (int argc, char *argv[])
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,10 +36,7 @@ main (int argc, char *argv[])
|
||||
gpgme_key_t key[3] = { NULL, NULL, NULL };
|
||||
gpgme_encrypt_result_t result;
|
||||
|
||||
gpgme_check_version (0);
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -168,6 +168,8 @@ main (int argc, char *argv[])
|
||||
gpgme_key_t key[3] = { NULL, NULL, NULL };
|
||||
int i;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
for (i = 0; i < FDLIST_MAX; i++)
|
||||
fdlist[i].fd = -1;
|
||||
|
||||
|
@ -36,6 +36,8 @@ main (int argc, char **argv)
|
||||
gpgme_data_t out;
|
||||
const char *pattern[] = { "Alpha", "Bob", NULL };
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -68,6 +68,8 @@ main (int argc, char **argv)
|
||||
"</GnupgKeyParms>\n";
|
||||
gpgme_genkey_result_t result;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -203,6 +203,8 @@ main (int argc, char *argv[])
|
||||
const char *pubkey_1_asc = make_filename ("pubkey-1.asc");
|
||||
const char *seckey_1_asc = make_filename ("seckey-1.asc");
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -74,8 +74,7 @@ main (int argc, char **argv)
|
||||
int mode;
|
||||
int i = 0;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -113,8 +113,7 @@ main (int argc, char **argv)
|
||||
gpgme_keylist_result_t result;
|
||||
int i = 0;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -84,6 +84,8 @@ main (int argc, char **argv)
|
||||
gpgme_sign_result_t result;
|
||||
char *agent_info;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
@ -133,7 +135,3 @@ main (int argc, char **argv)
|
||||
gpgme_release (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -96,6 +96,8 @@ main (int argc, char *argv[])
|
||||
gpgme_sign_result_t result;
|
||||
char *agent_info;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include <gpgme.h>
|
||||
|
||||
@ -79,3 +81,18 @@ make_filename (const char *fname)
|
||||
strcat (buf, fname);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
|
||||
|
||||
err = gpgme_engine_check_version (proto);
|
||||
fail_if_err (err);
|
||||
}
|
||||
|
@ -34,6 +34,8 @@ main (int argc, char *argv[])
|
||||
gpgme_error_t err;
|
||||
gpgme_trust_item_t item;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -151,6 +151,8 @@ main (int argc, char *argv[])
|
||||
gpgme_data_t sig, text;
|
||||
gpgme_verify_result_t result;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
||||
|
@ -49,6 +49,8 @@ main (int argc, char *argv[])
|
||||
gpgme_data_t in, out;
|
||||
gpgme_decrypt_result_t result;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS);
|
||||
@ -75,5 +77,3 @@ main (int argc, char *argv[])
|
||||
gpgme_release (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,8 +35,7 @@ main (int argc, char **argv)
|
||||
gpgme_key_t key[] = { NULL, NULL };
|
||||
gpgme_encrypt_result_t result;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -34,6 +34,9 @@ main (int argc, char *argv[])
|
||||
gpgme_error_t err;
|
||||
gpgme_data_t out;
|
||||
const char *pattern[] = { "DFN Top Level Certification Authority", NULL };
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS);
|
||||
|
@ -64,8 +64,7 @@ main (int argc, char *argv[])
|
||||
gpgme_genkey_result_t result;
|
||||
gpgme_data_t certreq;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_data_new (&certreq);
|
||||
fail_if_err (err);
|
||||
|
@ -161,8 +161,7 @@ main (int argc, char **argv)
|
||||
const char *cert_1 = make_filename ("cert_dfn_pca01.der");
|
||||
const char *cert_2 = make_filename ("cert_dfn_pca15.der");
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -82,8 +82,7 @@ main (int argc, char **argv)
|
||||
gpgme_keylist_result_t result;
|
||||
int i = 0;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
|
@ -81,8 +81,7 @@ main (int argc, char *argv[])
|
||||
gpgme_data_t in, out;
|
||||
gpgme_sign_result_t result;
|
||||
|
||||
err = gpgme_engine_check_version (GPGME_PROTOCOL_CMS);
|
||||
fail_if_err (err);
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
@ -119,7 +118,3 @@ main (int argc, char *argv[])
|
||||
gpgme_release (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
|
||||
#include <gpgme.h>
|
||||
|
||||
@ -79,3 +81,18 @@ make_filename (const char *fname)
|
||||
strcat (buf, fname);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
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));
|
||||
gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
|
||||
|
||||
err = gpgme_engine_check_version (proto);
|
||||
fail_if_err (err);
|
||||
}
|
||||
|
@ -119,6 +119,8 @@ main (int argc, char **argv)
|
||||
gpgme_data_t sig, text;
|
||||
gpgme_verify_result_t result;
|
||||
|
||||
init_gpgme (GPGME_PROTOCOL_CMS);
|
||||
|
||||
err = gpgme_new (&ctx);
|
||||
fail_if_err (err);
|
||||
gpgme_set_protocol (ctx, GPGME_PROTOCOL_CMS);
|
||||
@ -150,6 +152,3 @@ main (int argc, char **argv)
|
||||
gpgme_release (ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user