-
Notifications
You must be signed in to change notification settings - Fork 50
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
Possible code duplication #377
Comments
@lukehinds Did you mean to close this? Even if the code is valid for some reason it's a bit unintuitive so perhaps could use a comment. |
It looks like where slsa-verifier/verifiers/internal/gcb/provenance.go Lines 463 to 467 in 798db79
|
I'll reopen since this looks strange to me. /cc @laurentsimon since it looks like this was added in #251 |
I did, but perhaps it does merit some attention. My eyes did not make out URLEncoding and StdEncoding as different. |
Let me explain. We try both encoding because, when verifying GCB provenance, it sometimes failed due to an encoding issue. So I added this "redundant-looking" base64 decoding to avoid the problem. I agree it's worth adding a comment, which I should have done :/
and appended to a list of errors
If the loop (which iterates over all the signatures in the envelope) fails, we return all the errors we encountered
error
The
|
tbh, you're in good company. I didn't see that either... Yeah, probably a comment would have been good to make it clearer.
I think you want the error checking line to be if len(es) != 0 { perhaps? |
Was reading over the code and noticed the following:
slsa-verifier/verifiers/internal/gcb/provenance.go
Lines 413 to 430 in 798db79
There maybe some logic in the duplication, if so this is invalid, but I thought it worth raising in case it's a mistake and causes some edge case bug.
The text was updated successfully, but these errors were encountered: