~chiefnoah/inbox

1

Patch for pybare

Shift Less
Details
Message ID
<CA+iPVFO+FfODC09=UzTMogGQsSKLBtNv+MSF9QmPjS8CQSzpEQ@mail.gmail.com>
DKIM signature
pass
Download raw message
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
Shift Less
Details
Message ID
<CA+iPVFOzbZ3g=cU3BVxVeX+MYFUKF+B2tLUULrGT7yucJHPF6A@mail.gmail.com>
In-Reply-To
<CA+iPVFO+FfODC09=UzTMogGQsSKLBtNv+MSF9QmPjS8CQSzpEQ@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
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
Export thread (mbox)