-
-
Notifications
You must be signed in to change notification settings - Fork 932
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
Support ETM (Encrypt-then-MAC) variants for HMAC #1316
Conversation
Would you mind giving a try for this PR? |
Nice. Testing should be straightforward: diff --git a/test/Renci.SshNet.IntegrationTests/HmacTests.cs b/test/Renci.SshNet.IntegrationTests/HmacTests.cs
index 993e5ec98..e5057248c 100644
--- a/test/Renci.SshNet.IntegrationTests/HmacTests.cs
+++ b/test/Renci.SshNet.IntegrationTests/HmacTests.cs
@@ -58,6 +58,24 @@ public void HmacSha2_512()
DoTest(MessageAuthenticationCodeAlgorithm.HmacSha2_512);
}
+ [TestMethod]
+ public void HmacSha1Etm()
+ {
+ DoTest(MessageAuthenticationCodeAlgorithm.HmacSha1Etm);
+ }
+
+ [TestMethod]
+ public void HmacSha2_256_Etm()
+ {
+ DoTest(MessageAuthenticationCodeAlgorithm.HmacSha2_256_Etm);
+ }
+
+ [TestMethod]
+ public void HmacSha2_512_Etm()
+ {
+ DoTest(MessageAuthenticationCodeAlgorithm.HmacSha2_512_Etm);
+ }
+
private void DoTest(MessageAuthenticationCodeAlgorithm macAlgorithm)
{
_remoteSshdConfig.ClearMessageAuthenticationCodeAlgorithms() |
Do we want to support |
I think we might as well, while we still have |
Looks good to me otherwise |
…96_Etm Explicitly specify etm even if false
If it weren't a breaking change, I would approve it. I need some time to think it over and check it out. @Rob-Hague any idea? |
Yes I think we should go with the bool property on HashInfo and change |
Sorry I don't understand why you against The Shouldn't we focus on the implementation details of ETM? That's the main purpose of this PR. |
-- @zybexXL |
I think we've made it pretty clear that it's an unnecessary breaking change
Breaking HashInfo does not need to happen. It is much closer to the common API that people use. You said you had already gone in this direction in an earlier iteration. I've not seen any reason to stray from that.
I've checked the details. They look good. |
I've already explained why I abandoned the first iteration. I don't think |
To get the ball roll, someone has to compromise. Let me update the PR. |
Change `HMAC Create[...]Hash()` to `HashAlgorithm Create[...]Hash(out bool isEncryptThenMAC)`
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.
Thanks for making the change. It looks great to me. Another big pain point of the library bites the dust 🙂
Perhaps you could update the description to close a bunch of issues
The description has had the format to close the 2 related issues. Are there more? |
Only one more as it turned out, I thought there were a lot more. I've updated the description |
@scott-xu thanks! |
Cheers! |
Should fix #875 and fix #1050 and fix #837 and fix #1092
References:
Written by hand without testing by now.