RE: applying AES-GCM to secure shell: proposed "tweak"

"Igoe, Kevin M." <kmigoe@nsa.gov> Thu, 09 April 2009 23:25 UTC

Return-Path: <bounces-ietf-ssh-owner-secsh-tyoxbijeg7-archive=lists.ietf.org@NetBSD.org>
X-Original-To: ietfarch-secsh-tyoxbijeg7-archive@core3.amsl.com
Delivered-To: ietfarch-secsh-tyoxbijeg7-archive@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id C871D3A6D0E for <ietfarch-secsh-tyoxbijeg7-archive@core3.amsl.com>; Thu, 9 Apr 2009 16:25:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dt4v9rnmTzQL for <ietfarch-secsh-tyoxbijeg7-archive@core3.amsl.com>; Thu, 9 Apr 2009 16:25:19 -0700 (PDT)
Received: from mail.netbsd.org (mail.NetBSD.org [IPv6:2001:4f8:4:7:2e0:81ff:fe52:9ab6]) by core3.amsl.com (Postfix) with ESMTP id 9A8CA3A6A2F for <secsh-tyoxbijeg7-archive@lists.ietf.org>; Thu, 9 Apr 2009 16:25:14 -0700 (PDT)
Received: by mail.netbsd.org (Postfix, from userid 0) id 0B3E063B1AB; Thu, 9 Apr 2009 23:26:18 +0000 (UTC)
Delivered-To: ietf-ssh@netbsd.org
Received: from msux-gh1-uea02.nsa.gov (msux-gh1-uea02.nsa.gov [63.239.67.2]) by mail.netbsd.org (Postfix) with ESMTP id 4355063B244 for <ietf-ssh@netbsd.org>; Thu, 9 Apr 2009 23:25:59 +0000 (UTC)
Received: from MSCS-GH1-UEA02.corp.nsa.gov (localhost [127.0.0.1]) by msux-gh1-uea02.nsa.gov (8.12.10/8.12.10) with ESMTP id n39CdkhX012738; Thu, 9 Apr 2009 12:39:46 GMT
Received: from MSIS-GH1-UEA06.corp.nsa.gov ([10.215.228.137]) by MSCS-GH1-UEA02.corp.nsa.gov with Microsoft SMTPSVC(6.0.3790.1830); Thu, 9 Apr 2009 08:36:25 -0400
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-MimeOLE: Produced By Microsoft Exchange V6.5
Subject: RE: applying AES-GCM to secure shell: proposed "tweak"
Date: Thu, 09 Apr 2009 08:36:24 -0400
Message-ID: <80F9AC969A517A4DA0DE3E7CF74CC1BB034935@MSIS-GH1-UEA06.corp.nsa.gov>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: applying AES-GCM to secure shell: proposed "tweak"
Thread-Index: Acm4wu+MorpFDEztSjGbh7pQO+vuJgAS5mIwAAAbUIA=
From: "Igoe, Kevin M." <kmigoe@nsa.gov>
To: Damien Miller <djm@mindrot.org>, Tim Polk <tim.polk@nist.gov>
Cc: ietf-ssh@netbsd.org, Tero Kivinen <kivinen@iki.fi>, Bill Sommerfeld <sommerfeld@sun.com>, Chris Lonvick <clonvick@cisco.com>, ylo@ssh.com, "Jerome A. Solinas" <jasolin@orion.ncsc.mil>, Pasi.Eronen@nokia.com
X-OriginalArrivalTime: 09 Apr 2009 12:36:25.0411 (UTC) FILETIME=[CBF2E130:01C9B90F]
Sender: ietf-ssh-owner@NetBSD.org
List-Id: ietf-ssh
Precedence: list

Damien Miller writes:

> 5.1/5.2 - The suggested algorithm names are structurally different to
> the other algorithm identifiers used in SSH. In particular, I don't see
> any need for the "-ssh" to appear in the algorithm name as the cipher
> has not been modified in any substantial way. Why not just "aes128-gcm"
> or "aes128-gcm-aead" if you wanted to be particularly verbose?

AEAD has its own convention for naming algorithms.  The names selected
are more in keeping with the AEAD conventions.  I'm not terribly fond of
theses names and would be willing to modify them as needed, but I'd like
to keep an "ssh" tag in the name so that when one looks at the namespace 
of all AEAD algorithms, it is clear that these algorithms are intended
for use in secsh.

> First, why GCM? Some rationale would be nice.

Adding a justification is easily done, its much the same as it is in
other protocols (e.g. see draft-mcgrew-srtp-aes-gcm-01).

-----Original Message-----
From: Damien Miller [mailto:djm@mindrot.org]
Sent: Wednesday, April 08, 2009 11:26 PM
To: Tim Polk
Cc: ietf-ssh@netbsd.org; Tero Kivinen; Bill Sommerfeld; Chris Lonvick;
ylo@ssh.com; Igoe, Kevin M.; Jerome A. Solinas; <Pasi.Eronen@nokia.com>
Eronen
Subject: Re: applying AES-GCM to secure shell: proposed "tweak"


On Wed, 8 Apr 2009, Tim Polk wrote:

> Folks,
> 
> The IESG is currently considering publication of draft-igoe-secsh-aes-
> gcm-01, "AES Galois Counter Mode for the Secure Shell Transport Layer
> Protocol", as an Informational RFC.  The draft specifies the
> application of the Authenticated Encryption with Associated Data
> (AEAD) block cipher mode AES Galois/Counter Mode to provide both
> confidentiality and data integrity for SSH.  (See RFC 5116, "An
> Interface and Algorithms for Authenticated Encryption", for a general
> look at AEAD algorithms and NIST Special Publication 800-38D for the
> specification of the GCM mode; see URLs below.)
> 
> The draft was designed to minimize the changes to RFC 4253 (the SSH
> Transport Layer Protocol), so it encrypts the whole SSH binary packet,
> including the packet_length field.
> 
> However, AEAD decryption as defined in both RFC 5116 and SP 800-38D
> takes the ciphertext as input, and returns either (1) the plaintext if
> the authentication succeeds or (2) failure. The ciphertext here is an
> octet string of known length, not an ubounded stream.
> 
> Since the packet_length field is also encrypted, SSH cannot determine
> the ciphertext boundary before passing the data to AEAD decryption.
> (This differs from current SSH encryption modes where the data is
> first decrypted, then the packet length field is parsed, and finally
> the MAC is verified.)
> 
> Two solutions have been proposed: (1) explicitly allowing "partial
> decryption" so that an implementation can recover the packet_length
> without authenticating the data; or (2) sending the packet_length
> unencrypted so that it is always available.

another option, would be encrypting the length field with an
independently-keyed cipher, but I doubt that it is worth it.

I'd agree that simply leaving the length fields unencrypted would
be best, but the security considerations should mention the need to
use padding to avoid revealing secrets, especially for password
userauth.

Some general comments on the draft:

First, why GCM? Some rationale would be nice.

4.1 Key exchange implies modification to the matching rules, but doesn't
IMO sufficiently spell out exactly how matching should occur when the
GCM method appears in various positions of the client and server's lists.

5.1/5.2 - The suggested algorithm names are structurally different to
the other algorithm identifiers used in SSH. In particular, I don't see
any need for the "-ssh" to appear in the algorithm name as the cipher
has not been modified in any substantial way. Why not just "aes128-gcm"
or "aes128-gcm-aead" if you wanted to be particularly verbose?

-d