aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/crlfetch.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 /dirmngr/crlfetch.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 'dirmngr/crlfetch.c')
-rw-r--r--dirmngr/crlfetch.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/dirmngr/crlfetch.c b/dirmngr/crlfetch.c
index 5b6b648e2..620edf788 100644
--- a/dirmngr/crlfetch.c
+++ b/dirmngr/crlfetch.c
@@ -39,10 +39,10 @@
2008) we need a context in the reader callback. */
struct reader_cb_context_s
{
- estream_t fp; /* The stream used with the ksba reader. */
- int checked:1; /* PEM/binary detection ahs been done. */
- int is_pem:1; /* The file stream is PEM encoded. */
- struct b64state b64state; /* The state used for Base64 decoding. */
+ estream_t fp; /* The stream used with the ksba reader. */
+ unsigned int checked:1; /* PEM/binary detection ahs been done. */
+ unsigned int is_pem:1; /* The file stream is PEM encoded. */
+ gpgrt_b64state_t b64state; /* The state used for Base64 decoding. */
};
@@ -126,14 +126,16 @@ my_es_read (void *opaque, char *buffer, size_t nbytes, size_t *nread)
else
{
cb_ctx->is_pem = 1;
- b64dec_start (&cb_ctx->b64state, "");
+ cb_ctx->b64state = gpgrt_b64dec_start ("");
+ if (!cb_ctx->b64state)
+ return gpg_error_from_syserror ();
}
}
if (cb_ctx->is_pem && *nread)
{
size_t nread2;
- if (b64dec_proc (&cb_ctx->b64state, buffer, *nread, &nread2))
+ if (gpgrt_b64dec_proc (cb_ctx->b64state, buffer, *nread, &nread2))
{
/* EOF from decoder. */
*nread = 0;
@@ -581,7 +583,7 @@ crl_close_reader (ksba_reader_t reader)
es_fclose (cb_ctx->fp);
/* Release the base64 decoder state. */
if (cb_ctx->is_pem)
- b64dec_finish (&cb_ctx->b64state);
+ gpgrt_b64dec_finish (cb_ctx->b64state);
/* Release the callback context. */
xfree (cb_ctx);
}