diff options
author | Werner Koch <[email protected]> | 2008-06-09 14:49:28 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2008-06-09 14:49:28 +0000 |
commit | 5a788b9e00ea70595f3c50b66023531f25dbb5b9 (patch) | |
tree | d396bed5ebe536e9f7b1e27cec2c325623a38512 /common/util.h | |
parent | As a failsafe measure use memcpy instead of strcpy in gnupg_copy_time. (diff) | |
download | gnupg-5a788b9e00ea70595f3c50b66023531f25dbb5b9.tar.gz gnupg-5a788b9e00ea70595f3c50b66023531f25dbb5b9.zip |
Add Base64 decoder. Not yet used but complements out encoder.
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/common/util.h b/common/util.h index 7703be2b6..5b564a2c6 100644 --- a/common/util.h +++ b/common/util.h @@ -149,7 +149,7 @@ ssize_t read_line (FILE *fp, size_t *max_length); -/*-- b64enc.c --*/ +/*-- b64enc.c and b64dec.c --*/ struct b64state { unsigned int flags; @@ -159,12 +159,23 @@ struct b64state char *title; unsigned char radbuf[4]; u32 crc; + int stop_seen:1; + int invalid_encoding:1; }; + gpg_error_t b64enc_start (struct b64state *state, FILE *fp, const char *title); gpg_error_t b64enc_write (struct b64state *state, const void *buffer, size_t nbytes); gpg_error_t b64enc_finish (struct b64state *state); +gpg_error_t b64dec_start (struct b64state *state, const char *title); +gpg_error_t b64dec_proc (struct b64state *state, void *buffer, size_t length, + size_t *r_nbytes); +gpg_error_t b64dec_finish (struct b64state *state); + + + + /*-- sexputil.c */ gpg_error_t keygrip_from_canon_sexp (const unsigned char *key, size_t keylen, unsigned char *grip); |