1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

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>
This commit is contained in:
NIIBE Yutaka 2023-09-26 13:34:50 +09:00
parent 34f812475e
commit 26939ea222
No known key found for this signature in database
GPG key ID: 640114AF89DE6054
10 changed files with 75 additions and 99 deletions

View file

@ -2706,18 +2706,18 @@ export_one_ssh_key (estream_t fp, PKT_public_key *pk)
blob = get_membuf (&mb, &bloblen);
if (blob)
{
struct b64state b64_state;
gpgrt_b64state_t b64_state;
es_fprintf (fp, "%s ", identifier);
err = b64enc_start_es (&b64_state, fp, "");
if (err)
b64_state = gpgrt_b64enc_start (fp, "");
if (!b64_state)
{
xfree (blob);
goto leave;
}
err = b64enc_write (&b64_state, blob, bloblen);
b64enc_finish (&b64_state);
err = gpgrt_b64enc_write (b64_state, blob, bloblen);
gpgrt_b64enc_finish (b64_state);
es_fprintf (fp, " openpgp:0x%08lX\n", (ulong)keyid_from_pk (pk, NULL));
xfree (blob);
@ -2961,7 +2961,7 @@ export_secret_ssh_key (ctrl_t ctrl, const char *userid)
int pkalgo;
int i;
gcry_mpi_t keyparam[10] = { NULL };
struct b64state b64_state;
gpgrt_b64state_t b64_state;
init_membuf_secure (&mb, 1024);
init_membuf_secure (&mb2, 1024);
@ -3139,11 +3139,11 @@ export_secret_ssh_key (ctrl_t ctrl, const char *userid)
goto leave;
}
err = b64enc_start_es (&b64_state, fp, "OPENSSH PRIVATE_KEY");
if (err)
b64_state = gpgrt_b64enc_start (fp, "OPENSSH PRIVATE_KEY");
if (!b64_state)
goto leave;
err = b64enc_write (&b64_state, blob, bloblen);
b64enc_finish (&b64_state);
err = gpgrt_b64enc_write (b64_state, blob, bloblen);
gpgrt_b64enc_finish (b64_state);
if (err)
goto leave;