rlittlefield / pypaseto

PASETO for Python
Other
96 stars 11 forks source link

Crash when footer is not set #1

Closed Ducatel closed 6 years ago

Ducatel commented 6 years ago

Hi,

When you don't set the footer value in encrypt method call, a TypeError: can't concat str to bytes is throw.

Reproduce it with

from paseto import PasetoV2
import secrets

PasetoV2.encrypt(
        plaintext=b'mytext',
        key=secrets.token_bytes(32),
    )
rlittlefield commented 6 years ago

Good catch!

I'm trying to use a DCO for this. I know the change is small, but would you be willing to amend your commit (or squash) and add a Signed-off-by: line to the commit message? I'm trying to make sure the provenance of all the commits is handled up front, and the DCO is handy for tracking these changes. Thanks! 😄

https://github.com/rlittlefield/pypaseto/blob/master/CONTRIBUTING

rlittlefield commented 6 years ago

All tests are passing. Thanks for the contribution! 🎉

Please let me know if you have any questions or concerns about the signed-off-by DCO stuff. 😄

Ducatel commented 6 years ago

Damn, I did theses quick commit directly on github and ... I didn't check the contributing guide, sorry my bad :bowtie:

For the DCO stuff, my commit is sign by PGP, it's enough ? If not I will made the amend tomorrow :wink:

rlittlefield commented 6 years ago

The DCO requires the "Signed-off-by" as a way to acknowledge that your contribution is intentional and that you are allowed to do it, so the GPG signature is not enough. You can add the signed-off-by with git commit --amend --signoff if that is easier than typing it.

Ducatel commented 6 years ago

For me signature is the best way to certify which my contribution is intentional. I hope, I will never see my PGP signature on something I didn't do intentional :stuck_out_tongue_closed_eyes:

I did the squash and the Signed-off-by ;)

I will add unit test for that fix