* 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-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
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);
gpgme_release (ctx);
return 0;
}
-
-
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);
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);
return 0;
}
-
-
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);
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);
return 0;
}
-
-
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);
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;
gpgme_data_t out;
const char *pattern[] = { "Alpha", "Bob", NULL };
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
err = gpgme_new (&ctx);
fail_if_err (err);
"</GnupgKeyParms>\n";
gpgme_genkey_result_t result;
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
err = gpgme_new (&ctx);
fail_if_err (err);
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);
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);
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);
gpgme_sign_result_t result;
char *agent_info;
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
err = gpgme_new (&ctx);
fail_if_err (err);
gpgme_release (ctx);
return 0;
}
-
-
-
-
gpgme_sign_result_t result;
char *agent_info;
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
err = gpgme_new (&ctx);
fail_if_err (err);
#include <unistd.h>
#include <errno.h>
+#include <stdlib.h>
+#include <locale.h>
#include <gpgme.h>
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);
+}
gpgme_error_t err;
gpgme_trust_item_t item;
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
err = gpgme_new (&ctx);
fail_if_err (err);
gpgme_data_t sig, text;
gpgme_verify_result_t result;
+ init_gpgme (GPGME_PROTOCOL_OpenPGP);
+
err = gpgme_new (&ctx);
fail_if_err (err);
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);
gpgme_release (ctx);
return 0;
}
-
-
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);
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);
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);
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);
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);
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);
gpgme_release (ctx);
return 0;
}
-
-
-
-
#include <unistd.h>
#include <errno.h>
+#include <stdlib.h>
+#include <locale.h>
#include <gpgme.h>
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);
+}
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);
gpgme_release (ctx);
return 0;
}
-
-
-