Subject: Re: [Curdle] WG status and extension negotiation

From: Румен Петров <[email-masked]>
Date: Tue, 02 May 2017 21:07:00 +0300

Hi,

I would like to split my comments in two parts.
First part is about extension negotiation 
(draft-ietf-curdle-ssh-ext-info-nn.txt) and subject of this email.

I'm author of PKIX-SSH secure shell implementation that support X.509 
certificate based publickey and hostbased algorithms.

Goal is to find way transparently to users to switch from legacy 
algorithms to rfc6187 one.
Legacy algorithms as defined  in draft-ietf-secsh-transport-12.txt (31 
Jan. 2002) are
- x509v3-sign-rsa and
- x509v3-sign-dss .
Algorithms that correspond to same key type defined in rfc6187 are
- x509v3-ssh-rsa and
- x509v3-ssh-dss .
Currently x509v3-rsa2048-sha256 ( rfc6187) is out of my scope.

Daniel Migault wrote:
> Hi,
>
> So far we have not received many inputs and I would like to make sure we
> understand Romen's concern. My understanding of the concerned raised by
> Romen is that specifying signature algorithms may complexity the ways
> Public Key Algorithm registries are designated.  However it looks to me one
> reason is that we are moving from implicit signature scheme to explicit
> ones.
>
> Romen please re-state your issues with the draft, clearly expose the issues
> as well as the alternate you would fine acceptable.

Let review be example following case - secure token (smart-card), RSA 
key and associated X.509 certificate.

Which publickey algorithm to in public key authentication without to 
probe all listed below?
- (1) x509v3-sign-rsa  (legacy)
- (2) x509v3-ssh-rsa  (rfc6187)
- (3) x509v3-rsa2048-sha256 (rfc6187 if applicable, perhaps will be 
implemented in PKIX-SSH)
- (4) ssh-rsa (rfc4253)
- (5) rsa-sha2-256 (upcoming)
- (6) rsa-sha2-512 (upcoming)

To find suitable algorithm we could use "software version" field (see 
rfc4253 4.2.  Protocol Version Exchange). This solution is possible but 
requires up-to date database with information for vendor, version and 
supported ssh features. For such solution maintenance cost is too high.

Another solution id peers to inform each other for supported 
functionality. So "extension negotiation mechanism"fail into this category.

Denis,  author of extension negotiation propose "server-sig-algs".

Until now ssh related documents define publickey algorithm - see 
rfc4252, chapter  7. Public Key Authentication Method: "publickey") and 
hostbased (same rfc) and format of key and signature in
with triplet :
(I) public key algorithm name in USERAUTH_REQUEST message (rfc4252)
(II) certificate or public key format identifier (rfc4253)
(III) signature format identifier (as specified by the public 
key/certificate format) (rfc4253)

For algorithms (1), (2) and (4) the triplet is :
(1) x509v3-sign-rsa  / --- (!?!) / x509v3-sign-rsa
(2) x509v3-ssh-rsa / x509v3-ssh-rsa / ssh-rsa
(4) ssh-rsa / ssh-rsa / ssh-rsa

As is visible identifier of signature algorithm overlap two publickey 
algorithm.

To avoid ambiguities in PKIX-SSH 10.1 I implement new extension (a) 
/"[email-masked]"/ . Thus PKIX-SSH could list 
all algorithms from above (3* if implemented) as "public key algorithm 
name" in unique.
As of today client will chose algorithm (1) but in the near future 
(perhaps next version)  rfc6187 algorithm(2) will be preferred chose.

Extension (b) "server-sig-algs" is also announced by PKIX-SSH but with 
restriction - list only algorithms whose name match identifier of 
signature. This exclude automatically rfc6187 but could be used for 
compatibility with implementation like Bitvise and OpenSSH as they 
supports "algorithms whose name match identifier of signature".
In connection to those servers PKIX-SSH will chose algorithm (5).

In connection to server without extensions - client will try (1) and if 
not accepted (4).

Above is part of PKIX-SSH feature called "/adaptive public key algorithm 
selection"/ - an automatic process.

Manual configurations that impact /public key algorithm selection is out 
of scope to this mail ./

In conclusion : extension negotiation mechanism is valuable solution to 
resolve case above if propose an extension that allows in unique way to 
chose triplet for USERAUTH_REQUEST message.

> Yours,
> Daniel
[SNIP]

Regards,
Roumen Petrov

---

From: Румен Петров <[email-masked]>
Date: Wed, 03 May 2017 22:29:36 +0300

Hi
Daniel Migault wrote:
> [snip]

I would like to propose an redaction over draft-ietf-curdle-rsa-sha2-03 
(see attached file draft-ietf-curdle-rsa-sha2-03+rpetrov.txt).
Attached file" draft-ietf-curdle-rsa-sha2-03+rpetrov.wdiff.html" shows 
modifications as word-diff in html format :
- removed: red font, strikeout
- added : green font

I chose version 3 as this version is mostly fine with me except few 
substitutions(rewording)  to follow style of previous SSH related 
documents - [RFC4253], [RFC5656] and [RFC6187] (see modifications in 
chapter 2 Public Key Algorithms).
No modification in structure of messages, formats and etc.

Using mostly word "Public Key Algorithm" will allow section(chapter) "4. 
IANA Considerations" to be written in very simple manner.
The totally rewritten chapter adds references to [RFC4250]  and [RFC4251] .

Section "3.  Discovery of signature algorithms supported by servers" in 
not updated yet (depends from another discussion).

Regards,
Roumen Petrov

---

From: Daniel Migault <[email-masked]>
Date: Wed, 3 May 2017 16:19:06 -0400

Thanks for the file. Somehow I could not open the file. I am attaching the
diff here.  Please comment on the proposed changes.
Yours,
Daniel

On Wed, May 3, 2017 at 3:29 PM, Румен Петров <[email-masked]>
wrote:

> substitutions(rewording)  to follow style of previous SSH related documents
> - [RFC4253], [RFC5656] and [RFC6187] (see modifications in chapter 2 Public
> Key Algorithms).
> _______________________________________________
> Curdle mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/curdle
>
>

---

From: Румен Петров <[email-masked]>
Date: Thu, 04 May 2017 08:35:41 +0300

Daniel Migault wrote:
> Thanks for the file.
I'm sorry as somehow is attached copy of another diff, non-related to topic.
> Somehow I could not open the file. I am attaching the
> diff here.
Thanks Daniel. You page to page diff is better then my.
>   Please comment on the proposed changes.
> Yours,
> Daniel
>
[snip]
Roumen

---

From: denis bider <[email-masked]>
Date: Thu, 4 May 2017 00:37:31 -0600

Hello everyone,

in the interest of consensus, I have adopted the requested terminology
changes in the two drafts. What was previously "signature algorithm" is now
"public key algorithm", and what was previously "public key algorithm" is
now "public key format".

Please review and let me know.

denis

---

From: Daniel Migault <[email-masked]>
Date: Thu, 4 May 2017 13:41:20 +0000

Thanks Denis for meeting the consensus. As the changes are minor, if you have any opinion please raise it by the end of the week. The drafts will be sent to the IESG next week.
Yours,
Daniel

From: Curdle [mailto:[email-masked]] On Behalf Of denis bider
Sent: Thursday, May 04, 2017 2:38 AM
To: Румен Петров <[email-masked]>
Cc: curdle <[email-masked]>
Subject: Re: [Curdle] WG status and rsa-sha2 as public key algorithm

Hello everyone,

in the interest of consensus, I have adopted the requested terminology changes in the two drafts. What was previously "signature algorithm" is now "public key algorithm", and what was previously "public key algorithm" is now "public key format".

denis

On Wed, May 3, 2017 at 11:35 PM, Румен Петров <[email-masked]<mailto:[email-masked]>> wrote:

Daniel Migault wrote:
Thanks for the file.

_______________________________________________
Curdle mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/curdle

---

From: "Mark D. Baushke" <[email-masked]>
Date: Thu, 4 May 2017 08:07:46 -0700

Hi denis,

draft-ietf-curdle-rsa-sha2-07 looks good to me.

	-- Mark

---

From: Румен Петров <[email-masked]>
Date: Thu, 04 May 2017 22:17:52 +0300

Hi denis,

> Please review and let me know.
10x for new versions.

Main context of *draft-ietf-curdle-rsa-sha2-07.txt* is fine with me.
I still think that chapter 4 IANA Considerations could be simplified to 
list only public key algorithm but this is not so important.
The chapter refer to RFC4250 but section 7.1 Normative References lack 
reference to it. May be is good to list RFC4250 as well.
No other remarks.

About draft-ietf-curdle-ssh-ext-info-06.txt:
The name of extension "server-sig-algs" must be changed as well.
First because extension contain  abbreviation of signature in name 
(description is fine),
second because existing implementation does not follow rules from 
RFC4250, section 4.6.1. "Conventions for Names" and
third(!) due to broken OpenSSH implementation: " ...where SHA2 RSA 
signature methods were not being correctly advertised..." fixed in 7.5.

[SNIP]

Regards,
Roumen Petrov

---

From: denis bider <[email-masked]>
Date: Thu, 4 May 2017 23:12:52 -0600

> 10x for new versions.

You don't even have the decency to spell that.

> The name of extension "server-sig-algs" must be changed as well.

No fucking way. Fuck off.

On Thu, May 4, 2017 at 1:17 PM, Румен Петров <[email-masked]>
wrote:

> second because existing implementation does not follow rules from RFC4250,
> section 4.6.1. "Conventions for Names" and

---

From: denis bider <[email-masked]>
Date: Fri, 5 May 2017 00:18:16 -0600

Although my below response was self-explanatory, it is not sufficient. It
requires elaboration:

- The extension being specified is already deployed in a variety of
implementations, not only OpenSSH. (See [1] at bottom)

- Since the draft thus far remains compatible with existing
implementations, changing the name of the extension would break
compatibility.

- Breaking compatibility with existing implementations requires a
substantive reason. I am currently not aware of a substantive reason to do
this.

- A problem in particular versions of a particular implementation is not a
substantive reason. Idiosyncrasies of specific implementations are handled
by others recognizing the SSH version string, not diverging the protocol.

- It is not clear to me that the problem you reference in OpenSSH versions
prior to 7.5 is a problem that needs to be addressed at this level.

- In a previous message, Damien Miller, who is representative of OpenSSH in
this forum, has expressed a preference to keep the same extension name.

To be clear, the extension name is not one I'm overly happy with. In fact,
I had changed the name of the extension from "server-sig-algs" to something
more appropriate in an early version of the draft. However, by that time,
another implementation already picked up "server-sig-algs".

For this reason, I changed the spec back to "server-sig-algs". Although the
name is not ideal, it is now in use; and the name being ideal is strictly
less important than there being one identifier; and one identifier only;
for the same concept, if reasonably possible.

I stand by this decision, and think it's incorrect to modify the name at
this time, unless the mechanics of the extension are changed in some way
that's fundamental.

[1] According to this excellent, but at this time slightly outdated
comparison:

http://ssh-comparison.quendi.de/comparison/hostkey.html

... implementations of rsa-sha2-*** public key algorithms include AsyncSSH,
SmartFTP, and OpenSSH. Bitvise SSH Server and Client also support them, but
this is not listed in the chart. This leads me to believe there may be
other implementations also. I know that at least three of these
implementations also implement the "server-sig-algs" extension under its
current name.

---

From: denis bider <[email-masked]>
Date: Fri, 5 May 2017 04:15:35 -0600

Talking to Roumen off-list to gain a better understanding of his
implementation, and why it has trouble dealing with "server-sig-algs" sent
by OpenSSH versions before 7.5. Our implementation does not have trouble.
His implementation might though, perhaps due to different combinations of
supported algorithms, and/or a different design approach. Trying to
understand this better. Will post when I do.

On Fri, May 5, 2017 at 12:18 AM, denis bider <[email-masked]>
wrote:

> - In a previous message, Damien Miller, who is representative of OpenSSH
> in this forum, has expressed a preference to keep the same extension name.
>
> For this reason, I changed the spec back to "server-sig-algs". Although
> the name is not ideal, it is now in use; and the name being ideal is
> strictly less important than there being one identifier; and one identifier
> only; for the same concept, if reasonably possible.
>
> ... implementations of rsa-sha2-*** public key algorithms include
> AsyncSSH, SmartFTP, and OpenSSH. Bitvise SSH Server and Client also support
> them, but this is not listed in the chart. This leads me to believe there
> may be other implementations also. I know that at least three of these

---

From: denis bider <[email-masked]>
Date: Sun, 7 May 2017 19:01:26 -0600

Roumen and I have exchanged details over the weekend. My understanding now
is as follows.

*Server-side situation:*

OpenSSH versions before 7.5 (such as 7.3) send the "server-sig-algs"
extension, but they only use it to indicate support for "rsa-sha2-512" and
"rsa-sha2-256". They do not include other public key algorithms that the
server supports, even though the server will accept those algorithms if
they are attempted.

It is intended that the server should send a complete set of accepted
public key algorithms. My understanding is that OpenSSH versions 7.5 and
later do this. Bitvise SSH Server has always sent a complete list.

*Client-side situation:*

There exist clients which have problems with OpenSSH 7.3 behavior, and
clients that don't.

*Clients with explicit public key configuration.* Bitvise SSH Client does
not have a problem with this behavior, because it does not use public keys
opportunistically. Our SSH Client will use a public key to authenticate
only if the key is explicitly configured by the user. It will use only the
requested key, and not other keys that it may find in various places of
storage.

As a result, our SSH Client has no use for a hint from the server about
which key types are OK to use. It already knows the key it's going to use.
The question is what signature algorithm (now renamed "public key
algorithm") to use with that key. For this purpose, the information sent by
OpenSSH is sufficient, regardless of version. For RSA keys, the
"server-sig-algs" extension provides the info. For non-RSA keys, there's
only one algorithm possible anyway, so we use it.

*Clients with opportunistic key search.* Other SSH clients, including
OpenSSH and PKIXSSH (Roumen's work) do not require a public key to be
explicitly configured in order to be used. Such clients perform an
opportunistic search, and try to use any and all keys that might work that
can be found in various places of storage. This includes the user's .ssh
directory, keys available via the SSH agent protocol, and keys specified on
the command line.

These types of clients have a problem, because:

- In OpenSSH versions 7.5 and higher, the client can use the list of
algorithms sent in the server's "server-sig-algs" extension to narrow down
the public keys it's going to try. If the server doesn't list ECDSA or DSA,
for example, the client can take that as authoritative, and can exclude
those keys from authentication. This is nice because it may involve trying
fewer keys.

- In OpenSSH version 7.3, the server will only send "rsa-sha2-256" and
"rsa-sha2-512", even if the server also accepts ECDSA and other algorithms.
This means the client needs to have explicit treatment to detect the
OpenSSH protocol version. If the OpenSSH version is older than 7.5,
"server-sig-algs" can still be used to enable the use of "rsa-sha2-XXXX"
instead of "ssh-rsa", but it cannot be used to exclude non-RSA keys in
authentication.

*Options:*

*(A) Rename extension.* Roumen has requested that we rename the
"server-sig-algs" extension and make it clear that the server must send all
algorithms it will accept.

I think this is not the best thing to do for the following reasons:

- There are multiple implementations of this extension which are not
impacted by the OpenSSH 7.3 issue. These implementations would suffer from
the rename.

- Implementations that are impacted by the OpenSSH 7.3 issue may still have
a requirement to interoperate with OpenSSH 7.5, as well as other servers
that currently send "server-sig-algs" with a complete list of algorithms.
For such implementations, renaming the extension is again not a fix, but a
further complication.

*(B) Workaround by clients that need it.* My suggestion is that clients
that use opportunistic key search, and wish to interoperate with OpenSSH
7.3, should implement a compatibility workaround for the way
"server-sig-algs" is sent by that version.

I think this is the better solution for the following reasons:

- There are multiple implementations which are already not affected by the
issue, whether communicating with OpenSSH or between themselves. In this
case, those implementations do not need to change anything.

- The work required for clients with opportunistic key search is similar to
the work required in above option A), *assuming *those clients want to
interoperate with OpenSSH 7.5+ and other existing servers that send
"server-sig-algs" with a complete list of algorithms.

In addition, it appears the draft needs to be clarified to state:

- The server SHOULD send a complete list of public key algorithms it will
accept for user authentication.

- The client MAY authenticate with a public key algorithm not included in
the server's list.

At this time, I will make this update to the draft.

denis

On Fri, May 5, 2017 at 4:15 AM, denis bider <[email-masked]>
wrote:

>> - A problem in particular versions of a particular implementation is not
>> a substantive reason. Idiosyncrasies of specific implementations are
>> handled by others recognizing the SSH version string, not diverging the
>> protocol.
>>
>> - It is not clear to me that the problem you reference in OpenSSH
>> versions prior to 7.5 is a problem that needs to be addressed at this level.
>>
>> To be clear, the extension name is not one I'm overly happy with. In
>> fact, I had changed the name of the extension from "server-sig-algs" to
>> something more appropriate in an early version of the draft. However, by
>> that time, another implementation already picked up "server-sig-algs".
>>

---

From: Daniel Migault <[email-masked]>
Date: Fri, 19 May 2017 21:50:36 -0400

Thanks Denis for the clarification on the mailing list. It seems the
proposed version reached consensus as none opposed for the last 12 days. If
you think otherwise, please mention it as soon as possible. I am planning
to move the draft forward next week for AD review..

Yours,
Daniel

On Sun, May 7, 2017 at 9:01 PM, denis bider <[email-masked]>
wrote:

> - Implementations that are impacted by the OpenSSH 7.3 issue may still
> have a requirement to interoperate with OpenSSH 7.5, as well as other
> servers that currently send "server-sig-algs" with a complete list of
> algorithms. For such implementations, renaming the extension is again not a
> fix, but a further complication.
>
> - The work required for clients with opportunistic key search is similar
> to the work required in above option A), *assuming *those clients want to
>>> Although my below response was self-explanatory, it is not sufficient.
>>> It requires elaboration:
>>>
>>>> On Thu, May 4, 2017 at 1:17 PM, Румен Петров <[email-masked]
>>>> > wrote:
>>>>
>>>>> Hi denis,
>>>>>
>>>>> denis bider wrote:
>>>>>
>>>>>> Hello everyone,
>>>>>>
>>>>> I still think that chapter 4 IANA Considerations could be simplified
>>>>> to list only public key algorithm but this is not so important.