-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
pgcryptocipherccl: convert invariant errors into assertions #110774
pgcryptocipherccl: convert invariant errors into assertions #110774
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
76c292c
to
a46ce56
Compare
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.
lgtm, but just one nit! just to check - none of these errors can occur from strange user input, right?
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.
just to check - none of these errors can occur from strange user input, right?
Yup! The assertions in cipher.go
should only be hit if we forgot a enum case in the switch statement and the assertion in pkcsPad
would only happen if we passed in an invalid block size (not directly configurable by user). Neither of these is currently happening.
This patch changes the checks for programmer error in the `pgcryptocipherccl` package to use `errors.AssertionFailedf` so that they are surfaced with greater visibility. Release note: None
Release note: None
a46ce56
to
0e38f38
Compare
tftr! bors r=rafiss |
Build succeeded: |
This patch changes the checks for programmer error in the
pgcryptocipherccl
package to useerrors.AssertionFailedf
so that they are surfaced with greater visibility.Epic: None
Release note: None