New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add back support for Go 1.14 #51
Conversation
Adds simple reimplementation of fillBytesInt for go 1.14 support Fix golang-jwt#50 Signed-off-by: Andrew Thornton <art27@cantab.net>
Can you please add go1.14 to workflow? https://github.com/golang-jwt/jwt/blob/main/.github/workflows/build.yml#L16 |
Ah perfect, you added build tags |
ecdsa_go1.14.go
Outdated
if i >= 0 { | ||
buf[i] = byte(d) | ||
} else if byte(d) != 0 { | ||
panic("math/big: buffer too small to fit value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me this looks like a 1:1 copy out of the Go std lib, even including the particular error here and the comment above. Not quite sure, if this ok from a license point of view. Even though it is BSD, it still needs proper attribution and the LICENSE file/header and unless you are the original author of that line, this is very fishy in my opinion to just copy/paste that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the exact same thought (was just about to check if this was a copy/paste from the standard library).
I usually reference this ticket by Ian. golang/go#19893 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The panic has to be exactly the same otherwise it's not compatible.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Adds simple reimplementation of fillBytesInt for go 1.14 support
Fix #50
Signed-off-by: Andrew Thornton art27@cantab.net