summaryrefslogtreecommitdiffstats
path: root/tools/wks-util.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2023-09-26 06:34:50 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2023-09-26 06:34:50 +0200
commit26939ea2227b8c05b5721cc4b1ad88117e62d468 (patch)
treed482514d0f8e25ac50c79a235044cd1fc5a095aa /tools/wks-util.c
parentgpg: Fix last commit. (diff)
downloadgnupg2-26939ea2227b8c05b5721cc4b1ad88117e62d468.tar.xz
gnupg2-26939ea2227b8c05b5721cc4b1ad88117e62d468.zip
Use gpgrt_b64* API of libgpg-error.
* common/Makefile.am (common_sources): Remove b64enc.c and b64dec.c. (module_maint_tests): Remove t-b64. (t_b64_LDADD): Remove. * common/util.h: Remove the internal API. * common/ssh-utils.c (get_fingerprint): Use the gpgrt_b64 API. (ssh_public_key_in_base64): Likewise. * dirmngr/crlfetch.c (my_es_read, crl_close_reader): Likewise. * dirmngr/dirmngr-client.c (data_cb, do_lookup): Likewise. * dirmngr/misc.c (armor_data): Likewise. * g10/export.c (export_one_ssh_key, export_secret_ssh_key): Likewise. * tools/gpg-card.c (cmd_writecert): Likewise. * tools/mime-parser.c (parse_message_cb, mime_parser_release) (process_part_data): Likewise. * tools/wks-util.c (wks_armor_key): Likewise. -- GnuPG-bug-id: 6734 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to '')
-rw-r--r--tools/wks-util.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/wks-util.c b/tools/wks-util.c
index ee1305b00..49dbb6f8a 100644
--- a/tools/wks-util.c
+++ b/tools/wks-util.c
@@ -598,7 +598,7 @@ wks_armor_key (estream_t *r_newkey, estream_t key, const char *prefix)
{
gpg_error_t err;
estream_t newkey;
- struct b64state b64state;
+ gpgrt_b64state_t b64state;
char buffer[4096];
size_t nread;
@@ -614,16 +614,19 @@ wks_armor_key (estream_t *r_newkey, estream_t key, const char *prefix)
if (prefix)
es_fputs (prefix, newkey);
- err = b64enc_start_es (&b64state, newkey, "PGP PUBLIC KEY BLOCK");
- if (err)
- goto leave;
+ b64state = gpgrt_b64enc_start (newkey, "PGP PUBLIC KEY BLOCK");
+ if (!b64state)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
do
{
nread = es_fread (buffer, 1, sizeof buffer, key);
if (!nread)
break;
- err = b64enc_write (&b64state, buffer, nread);
+ err = gpgrt_b64enc_write (b64state, buffer, nread);
if (err)
goto leave;
}
@@ -634,7 +637,7 @@ wks_armor_key (estream_t *r_newkey, estream_t key, const char *prefix)
goto leave;
}
- err = b64enc_finish (&b64state);
+ err = gpgrt_b64enc_finish (b64state);
if (err)
goto leave;