Howdy,
I was playing around with pybare and found that the validators for
`bare.types.Data` and `bare.type.DataFixed` were not correct. One had
an actual error, and both made the assumption that the binary data
would be valid unicode. That is not correct according to the BARE
spec, which says that the binary data is arbitrary, and need not be a
unicode string, as your implementation required. I have altered the
validators to simply allow bytes objects (as one would intuit based on
the spec). Hope this patch is useful to you.
Thanks,
SL
Hello,
Upon fixing those validators yesterday I found that unpacking failed
as well for those two data types. The fix is also minimal, here are
the two patch files, for clarity, that solve this issue.
On Tue, Sep 22, 2020 at 2:09 PM Shift Less <shiftlesscode@gmail.com> wrote:
>
> Howdy,
>
> I was playing around with pybare and found that the validators for
> `bare.types.Data` and `bare.type.DataFixed` were not correct. One had
> an actual error, and both made the assumption that the binary data
> would be valid unicode. That is not correct according to the BARE
> spec, which says that the binary data is arbitrary, and need not be a
> unicode string, as your implementation required. I have altered the
> validators to simply allow bytes objects (as one would intuit based on
> the spec). Hope this patch is useful to you.
>
> Thanks,
>
> SL