Re: SSH key algorithm updates

Damien Miller <djm@mindrot.org> Tue, 03 November 2015 00:27 UTC

Return-Path: <bounces-ietf-ssh-owner-secsh-tyoxbijeg7-archive=lists.ietf.org@NetBSD.org>
X-Original-To: ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com
Delivered-To: ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B05C81A92FE for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Mon, 2 Nov 2015 16:27:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.31
X-Spam-Level:
X-Spam-Status: No, score=-1.31 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_34=0.6, T_RP_MATCHES_RCVD=-0.01] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zJkuigfiCpIs for <ietfarch-secsh-tyoxbijeg7-archive@ietfa.amsl.com>; Mon, 2 Nov 2015 16:27:36 -0800 (PST)
Received: from mail.netbsd.org (mail.NetBSD.org [IPv6:2001:4f8:3:7::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 57E651A92FC for <secsh-tyoxbijeg7-archive@lists.ietf.org>; Mon, 2 Nov 2015 16:27:36 -0800 (PST)
Received: by mail.netbsd.org (Postfix, from userid 605) id 3A97A14A2E4; Tue, 3 Nov 2015 00:27:35 +0000 (UTC)
Delivered-To: ietf-ssh@NetBSD.org
Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id E5D9114A2E2 for <ietf-ssh@NetBSD.org>; Tue, 3 Nov 2015 00:27:28 +0000 (UTC)
X-Virus-Scanned: amavisd-new at NetBSD.org
Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.NetBSD.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id FL1iQo66NfcW for <ietf-ssh@NetBSD.org>; Tue, 3 Nov 2015 00:27:28 +0000 (UTC)
Received: from newmailhub.uq.edu.au (mailhub2.soe.uq.edu.au [130.102.132.209]) by mail.netbsd.org (Postfix) with ESMTP id 7D14C14A2E0 for <ietf-ssh@NetBSD.org>; Tue, 3 Nov 2015 00:27:27 +0000 (UTC)
Received: from smtp1.soe.uq.edu.au (smtp1.soe.uq.edu.au [10.138.113.40]) by newmailhub.uq.edu.au (8.14.5/8.14.5) with ESMTP id tA2NLjO5033675; Tue, 3 Nov 2015 09:21:45 +1000
Received: from mailhub.eait.uq.edu.au (hazel.eait.uq.edu.au [130.102.60.17]) by smtp1.soe.uq.edu.au (8.14.5/8.14.5) with ESMTP id tA2NLjO5026329 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Nov 2015 09:21:45 +1000
Received: from natsu.mindrot.org (natsu.mindrot.org [130.102.96.2]) by mailhub.eait.uq.edu.au (8.15.1/8.15.1) with ESMTP id tA2NLfQ1017307; Tue, 3 Nov 2015 09:21:41 +1000 (AEST)
Received: by natsu.mindrot.org (Postfix, from userid 1000) id 1173AA4F36; Tue, 3 Nov 2015 10:21:41 +1100 (AEDT)
Received: from localhost (localhost [127.0.0.1]) by natsu.mindrot.org (Postfix) with ESMTP id 10AD6A4F35; Tue, 3 Nov 2015 10:21:41 +1100 (AEDT)
Date: Tue, 03 Nov 2015 10:21:41 +1100
From: Damien Miller <djm@mindrot.org>
To: "Mark D. Baushke" <mdb@juniper.net>
cc: Jeffrey Hutzelman <jhutz@cmu.edu>, denis bider <ietf-ssh3@denisbider.com>, ietf-ssh@NetBSD.org, nisse@lysator.liu.se, stephen.farrell@cs.tcd.ie, jon@siliconcircus.com
Subject: Re: SSH key algorithm updates
In-Reply-To: <26715.1446310356@eng-mail01.juniper.net>
Message-ID: <alpine.BSO.2.20.1511031006110.9984@natsu.mindrot.org>
References: <1297540000-2044@skroderider.denisbider.com> <51845.1446188002@eng-mail01.juniper.net> <1446228753.32676.1.camel@destiny.pc.cs.cmu.edu> <26715.1446310356@eng-mail01.juniper.net>
User-Agent: Alpine 2.20 (BSO 67 2015-01-07)
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
X-Scanned-By: MIMEDefang 2.73 on UQ Mailhub
X-Scanned-By: MIMEDefang 2.75 on 130.102.60.17
X-UQ-FilterTime: 1446506506
Sender: ietf-ssh-owner@NetBSD.org
List-Id: ietf-ssh.NetBSD.org
Precedence: list

On Sat, 31 Oct 2015, Mark D. Baushke wrote:

> > That's an unfinished, -00 version internet draft from CFRG.  It's
> > probably too soon to use it as the basis for an SSH public key algorithm
> > at all, let alone make such an algorithm mandatory to implement.  Once
> > the document is ready, we can start with OPTIONAL, and consider
> > upgrading when the algorithm has proven itself and is reasonably widely
> > implemented in SSH.
> 
> Hmmm.... OpenSSH has implemented an ssh-ed25519 and B. Harris has
> written:
> 
>   https://tools.ietf.org/html/draft-bjh21-ssh-ed25519-02
> 
> I am not sure how closely the IRTF Ed25519 an ssh-ed25519
> implementations match, but I suspect it may be relevant to discuss
> both drafts and the SSH protocol sooner rather than later.

AFAIK ssh-ed25519 is compatible with CFRG consensus on new
signature schemes, but it's not yet become an I-D.

> OpenSSH has implemented chacha20-poly1305@openssh.com

Since we did that there has been an RFC on using this combination
https://tools.ietf.org/html/rfc7539 which is incompatible with ours.

The OpenSSH one, among other less-notable differences, maintains a
second chacha20 instance to encrypt packet lengths.

AFAIK a couple of other implementation support the openssh version.

> The way that RFC5647 was written seems to not have been widely adopted
> although OpenSSH did implement aes128-gcm@openssh.com and
> aes256-gcm@openssh.com which are very similar. It might be nice to
> actually come up with a 'standards' track document dealing with AEAD
> ciphers and SSH and see if there is a better way to negotiate it within
> the existing framework of SSH's separation of MAC and Cipher. For
> example, maybe MAC=AEAD and Cipher=aes-gcm,chacha20-poly1305 would make
> more sense in the negotiation?

The situation wrt aes-gcm is frustrating. A draft was posted by a NSA
employee here a few years ago, and there was quite a bit of feedback
that the negotiation method that it proposed effectively broke
negotiation of non-AEAD ciphers. The NSA/IETF standardised it anyway.

The only difference between the NSA/IETF RFC and the openssh
implementation is that we fixed the negotiation in kex.

> It would be useful to see what other protocols various SSH implementers
> have been adding and see if there is a desire to move any of them into a
> recommended or optional standard.
> 
> There is also the possibility of a encrypt-then-mac kinds of MAC choices
> to try to avoid attacks against block ciphers which are either
> mac-then-encrypt or AEAD.

OpenSSH has had encrypt-then-MAC modes as the default for some time. 

One other thing worth mentioning is the curve25519-sha256@libssh.org
key exchange method. It's supported by a few implementations and is
AFAIK compatible with the CFRG curves draft.

We'll probably do curve448 KEX and public key schemes in the near future,
with the NSA's recent de-recommendation of 256 bit EC.

With regard to recommended options, my take is something like:

kex: curve25519-sha256, with ecdh-sha2-nistp* as a second choice
pubkey: ed25519, with ecdsa-sha2-nistp* as a second choice
cipher: chacha20-poly1305, with aes*-gcm@openssh.com as second choice

(second choices for people who suffer under the yoke of FIPS compliance)

-d