diff options
author | NIIBE Yutaka <[email protected]> | 2023-09-26 04:34:50 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2023-09-26 04:34:50 +0000 |
commit | 26939ea2227b8c05b5721cc4b1ad88117e62d468 (patch) | |
tree | d482514d0f8e25ac50c79a235044cd1fc5a095aa /tools/gpg-card.c | |
parent | gpg: Fix last commit. (diff) | |
download | gnupg-26939ea2227b8c05b5721cc4b1ad88117e62d468.tar.gz gnupg-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 <[email protected]>
Diffstat (limited to 'tools/gpg-card.c')
-rw-r--r-- | tools/gpg-card.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/gpg-card.c b/tools/gpg-card.c index 4002cc185..12b4be25f 100644 --- a/tools/gpg-card.c +++ b/tools/gpg-card.c @@ -2080,13 +2080,15 @@ cmd_writecert (card_info_t info, char *argstr) && ascii_memistr (data, datalen, "-----END CERTIFICATE-----") && !memchr (data, 0, datalen) && !memchr (data, 1, datalen)) { - struct b64state b64; + gpgrt_b64state_t b64; - err = b64dec_start (&b64, ""); - if (!err) - err = b64dec_proc (&b64, data, datalen, &datalen); + b64 = gpgrt_b64dec_start (""); + if (!b64) + err = gpg_error_from_syserror (); + else + err = gpgrt_b64dec_proc (b64, data, datalen, &datalen); if (!err) - err = b64dec_finish (&b64); + err = gpgrt_b64dec_finish (b64); if (err) goto leave; } |