-
Notifications
You must be signed in to change notification settings - Fork 364
jets: remove +de:sivc punt logging #5826
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
Conversation
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 approve. This logging annoys more than informs.
If the encryption libraries don't report whether their error was deterministic, then the only guaranteed-correct way to handle that is for Nock to treat any error as nondeteterministic. Otherwise we could mistakenly think encryption failed deterministically, which would violate Nock.
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 approve. This logging annoys more than informs.
If the encryption libraries don't report whether their error was deterministic, then the only guaranteed-correct way to handle that is for Nock to treat any error as nondeteterministic. Otherwise we could mistakenly think encryption failed deterministically, which would violate Nock.
|
@belisarius222 I've gone ahead and replaced the "punt" on decryption failure with |
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
|
@belisarius222 sorry for dripping these changes out. I realized that we never need stack traces for PTOML (one more) |
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.
looks good again
The "punt" logging pattern in the crypto jets was intended to surface unusual error conditions. But urcrypt and libaes-siv don't clearly distinguish between deterministic decryption failure and other errors (invalid calls, allocation failures, &c). to ensure determinism, so the relevant jets "punt" all errors back to the nock interpreter. And
+de:sivcis used by ames, which means that receiving any invalid ciphertext or stale keys produces noisy, useless output: two lines ofsivc-de-puntper packet.The PR just removes the logging, but there are two non-trivial next steps which should be done:
Accomplishing this will require review of libaes-siv and the openssl functions it depends on, and may require patches to distinguish error conditions. This is important for many reasons, not the least of which is that punting is expensive (and therefore a DOS vector).
Other than the (accidentally) frequent "punt" logging, the ames driver keeps a counter of failed packets and prints every 1K (or every time with
-v). But if we're receiving lots of invalid packets with a valid ames header, there's a good chance that we or our peer is behind on PKI state. (And if packets from a particular ip:port are consistently invalid, we probably want to stop try to process them for a while.)