[ 
https://issues.apache.org/jira/browse/SSHD-506?focusedWorklogId=434495&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-434495
 ]

ASF GitHub Bot logged work on SSHD-506:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/May/20 16:55
            Start Date: 18/May/20 16:55
    Worklog Time Spent: 10m 
      Work Description: lgoldstein commented on a change in pull request #132:
URL: https://github.com/apache/mina-sshd/pull/132#discussion_r426765217



##########
File path: 
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
##########
@@ -1249,6 +1260,20 @@ protected Buffer encode(Buffer buffer) throws 
IOException {
         }
     }
 
+    protected void aeadOutgoingBuffer(Buffer buf, int offset, int len) throws 
Exception {
+        if (outCipher instanceof BaseGCMCipher) {

Review comment:
       I would throw an exception here if this is not a `BaseGCMCipher` since 
only such ciphers are expected to reach this code

##########
File path: 
sshd-core/src/main/java/org/apache/sshd/common/session/helpers/AbstractSession.java
##########
@@ -1334,9 +1362,19 @@ protected void decode() throws Exception {
                 assert decoderBuffer.rpos() == Integer.BYTES;
                 int macSize = (inMac != null) ? inMacSize : 0;
                 // Check if the packet has been fully received
-                if (decoderBuffer.available() >= (decoderLength + macSize)) {
+                if (decoderBuffer.available() >= (decoderLength + macSize + 
authLen)) {
                     byte[] data = decoderBuffer.array();
-                    if (etmMode) {
+                    if (authMode) {
+                        final BaseGCMCipher cipher = (BaseGCMCipher) inCipher;

Review comment:
       No need for `final` - we don't use it in these cases




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 434495)
    Time Spent: 20m  (was: 10m)

> Add support for aes128/256-gcm ciphers
> --------------------------------------
>
>                 Key: SSHD-506
>                 URL: https://issues.apache.org/jira/browse/SSHD-506
>             Project: MINA SSHD
>          Issue Type: Improvement
>            Reporter: Lyor Goldstein
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> See:
> * [rfc5647|https://tools.ietf.org/html/rfc5647]
> * 
> [draft-igoe-secsh-aes-gcm-01|https://tools.ietf.org/html/draft-igoe-secsh-aes-gcm-01]
> * [OpenSSH v6.2|http://www.openssh.com/txt/release-6.2]
> * [JAVA AES 256 GCM encrypt/decrypt 
> example|https://javainterviewpoint.com/java-aes-256-gcm-encryption-and-decryption/]
>  - especially the usage of {{GCMParameterSpec}} to initialize the cipher
> * [OpenJDK 8 AESCipher.java source 
> code|https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/com/sun/crypto/provider/AESCipher.java]
> ** See also 
> [CipherCore.java|https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/com/sun/crypto/provider/CipherCore.java],
>  
> [FeedbackCipher.java|https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java],
>  
> [GaloisCounterMode.java|https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to