Subject: re: lib/30414
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Tyler Retzlaff <rtr@omicron-persei-8.net>
List: netbsd-bugs
Date: 06/05/2005 02:33:01
The following reply was made to PR lib/30414; it has been noted by GNATS.
From: Tyler Retzlaff <rtr@omicron-persei-8.net>
To: gnats-bugs@netbsd.org
Cc:
Subject: re: lib/30414
Date: Sun, 5 Jun 2005 12:31:58 +1000
Okay, I upgraded to a userland and kernel built from sources as of
2005/06/04. I can no longer get the failure from named I can still
get it from other sources. The next most reliable way is to run the
following code which requires pkgsrc security/gpgme to link. Of
course you'll also need to replace the key fingerprint with something
suitable on the test machine.
#include <gpgme.h>
#include <locale.h>
#include <err.h>
int
main(int argc, char **argv)
{
char text[] = "test plain text\n";
gpgme_data_t plain, cipher;
gpgme_ctx_t context;
gpgme_key_t keys[2];
gpgme_error_t e;
gpgme_protocol_t p = GPGME_PROTOCOL_OpenPGP;
setlocale(LC_ALL, "");
gpgme_check_version(NULL);
gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL));
gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES,
NULL));
if (GPG_ERR_NO_ERROR != (e = gpgme_engine_check_version(p)))
errx(-1, "%s", gpgme_strerror(e));
if (GPG_ERR_NO_ERROR != (e = gpgme_new(&context)))
errx(-1, "%s", gpgme_strerror(e));
if (GPG_ERR_NO_ERROR != (e = gpgme_set_protocol(context, p)))
errx(-1, "%s", gpgme_strerror(e));
gpgme_set_armor(context, 1);
if (GPG_ERR_NO_ERROR !=
(e = gpgme_data_new_from_mem(&plain, text, strlen(text),
0)))
errx(-1, "%s", gpgme_strerror(e));
if (GPG_ERR_NO_ERROR !=
(e = gpgme_data_new(&cipher)))
errx(-1, "%s", gpgme_strerror(e));
if (GPG_ERR_NO_ERROR != (e = gpgme_get_key(context,
"41DAEBB743C4B111F13F67EB3B4836DB285695D2", &keys[0], 0)))
errx(-1, "%s", gpgme_strerror(e));
keys[1] = NULL;
if (GPG_ERR_NO_ERROR != (e = gpgme_op_encrypt_start(context,
keys,
GPGME_ENCRYPT_ALWAYS_TRUST, plain, cipher)))
errx(-1, "%s", gpgme_strerror(e));
gpgme_wait(context, &e, 1);
if (GPG_ERR_NO_ERROR != e)
errx(-1, "%s", gpgme_strerror(e));
}