Commit e0292d52 authored by Niels Möller's avatar Niels Möller
Browse files

(sexp_transport_iterator_first): Updated to new

conventions for base64_decode_update and base64_decode_final.

Rev: src/nettle/sexp-transport.c:1.2
parent aa4c823b
...@@ -60,6 +60,7 @@ sexp_transport_iterator_first(struct sexp_iterator *iterator, ...@@ -60,6 +60,7 @@ sexp_transport_iterator_first(struct sexp_iterator *iterator,
{ {
/* Found transport encoding */ /* Found transport encoding */
struct base64_decode_ctx ctx; struct base64_decode_ctx ctx;
unsigned length;
unsigned end; unsigned end;
for (end = ++in; end < length && input[end] != '}'; end++) for (end = ++in; end < length && input[end] != '}'; end++)
...@@ -69,13 +70,18 @@ sexp_transport_iterator_first(struct sexp_iterator *iterator, ...@@ -69,13 +70,18 @@ sexp_transport_iterator_first(struct sexp_iterator *iterator,
return 0; return 0;
base64_decode_init(&ctx); base64_decode_init(&ctx);
length = end - in;
out += base64_decode_update(&ctx, input + out,
end - in, input + in); if (base64_decode_update(&ctx, &length, input + out,
if (!base64_decode_status(&ctx)) length, input + in)
&& base64_decode_final(&ctx))
{
out += length;
in = end + 1;
}
else
return 0; return 0;
in = end + 1;
break; break;
} }
default: default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment