aboutsummaryrefslogtreecommitdiffstats
path: root/g10/export.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-09-26 04:34:50 +0000
committerNIIBE Yutaka <[email protected]>2023-09-26 04:34:50 +0000
commit26939ea2227b8c05b5721cc4b1ad88117e62d468 (patch)
treed482514d0f8e25ac50c79a235044cd1fc5a095aa /g10/export.c
parentgpg: Fix last commit. (diff)
downloadgnupg-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 'g10/export.c')
-rw-r--r--g10/export.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/g10/export.c b/g10/export.c
index b05492b32..2c6eb7bff 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -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;