summaryrefslogtreecommitdiffstats
path: root/usr.bin/dig/lib/isc/base32.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/dig/lib/isc/base32.c')
-rw-r--r--usr.bin/dig/lib/isc/base32.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/dig/lib/isc/base32.c b/usr.bin/dig/lib/isc/base32.c
index becc95c42cb..817ea392703 100644
--- a/usr.bin/dig/lib/isc/base32.c
+++ b/usr.bin/dig/lib/isc/base32.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: base32.c,v 1.7 2020/02/26 18:47:59 florian Exp $ */
+/* $Id: base32.c,v 1.8 2020/09/14 08:40:44 florian Exp $ */
/*! \file */
@@ -115,19 +115,19 @@ typedef struct {
int length; /*%< Desired length of binary data or -1 */
isc_buffer_t *target; /*%< Buffer for resulting binary data */
int digits; /*%< Number of buffered base32 digits */
- isc_boolean_t seen_end; /*%< True if "=" end marker seen */
+ int seen_end; /*%< True if "=" end marker seen */
int val[8];
const char *base; /*%< Which encoding we are using */
int seen_32; /*%< Number of significant bytes if non zero */
- isc_boolean_t pad; /*%< Expect padding */
+ int pad; /*%< Expect padding */
} base32_decode_ctx_t;
static inline void
base32_decode_init(base32_decode_ctx_t *ctx, int length, const char base[],
- isc_boolean_t pad, isc_buffer_t *target)
+ int pad, isc_buffer_t *target)
{
ctx->digits = 0;
- ctx->seen_end = ISC_FALSE;
+ ctx->seen_end = 0;
ctx->seen_32 = 0;
ctx->length = length;
ctx->target = target;
@@ -210,7 +210,7 @@ base32_decode_char(base32_decode_ctx_t *ctx, int c) {
unsigned char buf[5];
if (ctx->seen_32 != 0) {
- ctx->seen_end = ISC_TRUE;
+ ctx->seen_end = 1;
n = ctx->seen_32;
}
buf[0] = (ctx->val[0]<<3)|(ctx->val[1]>>2);
@@ -239,7 +239,7 @@ base32_decode_finish(base32_decode_ctx_t *ctx) {
* Add missing padding if required.
*/
if (!ctx->pad && ctx->digits != 0) {
- ctx->pad = ISC_TRUE;
+ ctx->pad = 1;
do {
RETERR(base32_decode_char(ctx, '='));
} while (ctx->digits != 0);
@@ -251,7 +251,7 @@ base32_decode_finish(base32_decode_ctx_t *ctx) {
static isc_result_t
base32_decoderegion(isc_region_t *source, const char base[],
- isc_boolean_t pad, isc_buffer_t *target)
+ int pad, isc_buffer_t *target)
{
base32_decode_ctx_t ctx;
@@ -267,5 +267,5 @@ base32_decoderegion(isc_region_t *source, const char base[],
isc_result_t
isc_base32hexnp_decoderegion(isc_region_t *source, isc_buffer_t *target) {
- return (base32_decoderegion(source, base32hex, ISC_FALSE, target));
+ return (base32_decoderegion(source, base32hex, 0, target));
}