Hi Laurence, On Thu, Oct 13, 2011 at 11:24:25PM +0100, Laurence Rowe wrote: > On 13 October 2011 18:45, Laurence Rowe <[email protected]> wrote: > > How do you handle null bytes in the strings returned by digest.hash* / > > digest.hmac* / digest.base64*decode ? I was under the impression > > varnish used null terminated strings internally. > > From reading the source I see that the hash and hmac functions return > hexdigests. Presumably it's assumed any base64 data you would be > interested in reading in Varnish would not contain null characters.
A valid point... I could provide base64 functions that accept a length-argument too. However, since there is no simple way to deal with NULL in VCL itself, I'm curious if you have a use case for it? The only real use case I see is if you combine it with other vmods. I can actually see that happening with the nulldata vmod, now that I think about it. It's not entirely unreasonable to have a base64-encoded constant in your VCL, use the digest-vmod to decode it before the nulldata-vmod sticks it in synthetic. Then the problem becomes that you have to inform the caller of the length. That shouldn't be a big deal either, but not quite as elegant as I'd prefer. Hmm.... - Kristian
signature.asc
Description: Digital signature
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
