-
-
Notifications
You must be signed in to change notification settings - Fork 934
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 support for AEAD AES 128/256 GCM Ciphers (.NET 6.0 onward only) #1369
Conversation
… SymmetricCipher to BlockCipher
…just like other ciphers
…d tag field in offset and length when call AesGcm's `Decrypt(...)` method. Do not determine HMAC if cipher is AesGcm during kex.
Generally it looks good to me but I'll take a closer look soon. One thing is that (side note: if you don't want to close #1356, replace "fix" with a non-keyword e.g. "contributes to") |
Guard AES-GCM with `NET6_0_OR_GREATER`. Insert AES-GCM ciphers right after AES-CTR ciphers but before AES-CBC ciphers, which is similar with OpenSSH: ``` debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com ``` Although Dictionary's order is not defined, from observation, it is in the same order with add. Anyway that would be another topic.
…mance" for `ConnectionInfo.Encryptions`. Test `Aes128Gcm` and `Aes256Gcm` only when `NET6_0_OR_GREATER`
… the packet length and the size it 4.
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Assert offset when decrypt.
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.
Thank you
Thanks |
1 similar comment
Thanks |
This PR adds support for aes128-gcm@openssh.com and aes256-gcm@openssh.com described in https://datatracker.ietf.org/doc/html/rfc5647
Resolves #792
Contributes to #1356
Resolves #774
Resolves #773
Resolves #555
Resolves #477
Resolves #994
Closes #877
Notes:
ChaCha20
to encrypt/decrypt the packet length field.The BCL adds support for ChaCha20Ploy1305 since .NET 6.0, but no standalone
ChaCha20
till now (2024-04-04).At the beginning, I created a branch named as "aes-gcm-and-chacha20-poly1305" in my fork and created a PR Support AesGcm cipher #1364. Then when I realize there's no direct way to implement chacha20-poly1305@openssh.com, I renamed the branch to aesgcm. The original PR is closed automatically after renaming. I have to create this new PR. Please refer the previous PR for review comment history. Thank @zybexXL @Rob-Hague for reviewing.
Dictionary
's order is not defined, from observation, it is in the same order with add. Anyway that would be another topic, see Dictionary enumeration order is relied upon in ConnectionInfo despite being undefined behaviour #719