[crypto] ssh: relax RSA signature check in SSH_MSG_USERAUTH_REQUEST

82 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Jun 16, 2022, 1:15:13 PM6/16/22
to goph...@pubsubhelper.golang.org, Stan Hu, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

ssh: relax RSA signature check in SSH_MSG_USERAUTH_REQUEST

Buggy SSH clients, such as gpg-agent v2.2.4 and OpenSSH v7.6 shipped
in Ubuntu 18.04, may send `ssh-rsa-512` as the public key algorithm
but actually include an `rsa-sha` signature.

If RFC 3808 (extension negotiation) is implemented, these clients will
fail to authenticate with the error:

```
ssh: signature "ssh-rsa" came in for selected algorithm "rsa-sha2-512", public key is type ssh-rsa
```

According to RFC 8332 section 3.2:

If the client includes the signature field, the client MUST encode the
same algorithm name in the signature as in SSH_MSG_USERAUTH_REQUEST --
either "rsa-sha2-256" or "rsa-sha2-512". If a server receives a
mismatching request, it MAY apply arbitrary authentication penalties,
including but not limited to authentication failure or disconnect.

...A server MAY, but is not required to, accept this variant or another
variant that corresponds to a good-faith implementation and is
considered safe to accept.

While the client is expected to do the right thing, in practice older
clients may not fully support `ssh-rsa-256` and `ssh-rsa-512`. For
example, gpg-agent v2.2.6 added support for these newer signature
types.

To accomodate these clients, relax the matching constraint: if the
`SSH_MSG_USERAUTH_REQUEST` message specifies an RSA public key
algorithm and includes an RSA public key, then allow any of the
following signature types:

- `rsa-sha-512`
- `rsa-sha-256`
- `rsa-sha`

This emulates what OpenSSH does. OpenSSH only considers that the RSA
family is specified and then verifies if the signature and public key
match.

Closes https://github.com/golang/go/issues/53391

Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
GitHub-Last-Rev: 443b8cb475cc16514b864a61d02fef52fbb2ae2d
GitHub-Pull-Request: golang/crypto#221
---
M ssh/server.go
1 file changed, 77 insertions(+), 1 deletion(-)

diff --git a/ssh/server.go b/ssh/server.go
index 70045bd..8a3f14e 100644
--- a/ssh/server.go
+++ b/ssh/server.go
@@ -396,6 +396,28 @@
// It is returned in ServerAuthError.Errors from NewServerConn.
var ErrNoAuth = errors.New("ssh: no auth passed yet")

+func isRSAType(algo string) bool {
+ return algo == KeyAlgoRSASHA512 || algo == KeyAlgoRSASHA256 || algo == KeyAlgoRSA
+}
+
+func algoCompatible(algo string, publicKey PublicKey, sig *Signature) bool {
+ if underlyingAlgo(algo) == sig.Format {
+ return true
+ }
+
+ // Buggy SSH clients may send ssh-rsa2-512 as the public key algorithm but
+ // actually include a rsa-sha signature.
+ // According to RFC 8832 Section 3.2:
+ // A server MAY, but is not required to, accept this variant or another variant that
+ // corresponds to a good-faith implementation and is considered safe to
+ // accept.
+ if publicKey.Type() == KeyAlgoRSA && isRSAType(algo) && isRSAType(sig.Format) {
+ return true
+ }
+
+ return false
+}
+
func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) {
sessionID := s.transport.getSessionID()
var cache pubKeyCache
@@ -564,7 +586,7 @@
authErr = fmt.Errorf("ssh: algorithm %q not accepted", sig.Format)
break
}
- if underlyingAlgo(algo) != sig.Format {
+ if !algoCompatible(algo, pubKey, sig) {
authErr = fmt.Errorf("ssh: signature %q not compatible with selected algorithm %q", sig.Format, algo)
break
}

To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: crypto
Gerrit-Branch: master
Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
Gerrit-Change-Number: 412854
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Stan Hu <sta...@gmail.com>
Gerrit-MessageType: newchange

Maxime Tremblay (Gerrit)

unread,
Jun 18, 2022, 2:47:02 AM6/18/22
to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Filippo Valsorda.

Patch set 1:Code-Review +1

View Change

    To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: crypto
    Gerrit-Branch: master
    Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
    Gerrit-Change-Number: 412854
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Stan Hu <sta...@gmail.com>
    Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
    Gerrit-Comment-Date: Sat, 18 Jun 2022 06:46:58 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Gerrit Bot (Gerrit)

    unread,
    Feb 15, 2023, 2:29:16 PM2/15/23
    to Stan Hu, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Filippo Valsorda, Maxime Tremblay.

    Gerrit Bot uploaded patch set #2 to this change.

    View Change

    GitHub-Last-Rev: 08edff8304716fba1b6a681d937d2ef5f51283c3

    GitHub-Pull-Request: golang/crypto#221
    ---
    M ssh/server.go
    1 file changed, 79 insertions(+), 1 deletion(-)

    To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: crypto
    Gerrit-Branch: master
    Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
    Gerrit-Change-Number: 412854
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Stan Hu <sta...@gmail.com>
    Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
    Gerrit-MessageType: newpatchset

    Gerrit Bot (Gerrit)

    unread,
    Feb 15, 2023, 2:55:11 PM2/15/23
    to Stan Hu, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Filippo Valsorda, Maxime Tremblay.

    Gerrit Bot uploaded patch set #3 to this change.

    View Change

    GitHub-Last-Rev: 630f71961527acf21f42f6ef29ae4a2444d605c2
    GitHub-Pull-Request: golang/crypto#221
    ---
    M ssh/client_auth_test.go
    M ssh/server.go
    2 files changed, 159 insertions(+), 1 deletion(-)

    To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: crypto
    Gerrit-Branch: master
    Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
    Gerrit-Change-Number: 412854
    Gerrit-PatchSet: 3
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>

    Maxime Tremblay (Gerrit)

    unread,
    Feb 16, 2023, 9:31:50 AM2/16/23
    to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Jakub Nyckowski, Filippo Valsorda, Adam Langley, Gopher Robot, golang-co...@googlegroups.com

    Attention is currently required from: Filippo Valsorda.

    Patch set 3:Code-Review +1

    View Change

    1 comment:

      • ssh: signature "ssh-rsa" came in for selected algorithm "rsa-sha2-512", public key is type ssh-rsa

    To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: crypto
    Gerrit-Branch: master
    Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
    Gerrit-Change-Number: 412854
    Gerrit-PatchSet: 3
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
    Gerrit-CC: Stan Hu <sta...@gmail.com>
    Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
    Gerrit-Comment-Date: Thu, 16 Feb 2023 14:31:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Jakub Nyckowski (Gerrit)

    unread,
    Feb 16, 2023, 11:51:10 AM2/16/23
    to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Maxime Tremblay, Filippo Valsorda, Adam Langley, Gopher Robot, golang-co...@googlegroups.com

    Attention is currently required from: Filippo Valsorda, Maxime Tremblay.

    View Change

    1 comment:

    • File ssh/server.go:

      • Patch Set #2, Line 408: return algo == KeyAlgoRSASHA512 || algo == KeyAlgoRSASHA256 || algo == KeyAlgoRSA

        This only covers public key authentication, but it doesn't solve the same issue when using an ssh certificate. Could we "extend" that check to also include ssh certificates?

    To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: crypto
    Gerrit-Branch: master
    Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
    Gerrit-Change-Number: 412854
    Gerrit-PatchSet: 2
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
    Gerrit-CC: Stan Hu <sta...@gmail.com>
    Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
    Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
    Gerrit-Comment-Date: Wed, 15 Feb 2023 19:43:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Roland Shoemaker (Gerrit)

    unread,
    Jun 5, 2023, 4:16:11 PM6/5/23
    to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, Gopher Robot, golang-co...@googlegroups.com

    Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski.

    Patch set 3:Run-TryBot +1

    View Change

      To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: crypto
      Gerrit-Branch: master
      Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
      Gerrit-Change-Number: 412854
      Gerrit-PatchSet: 3
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: David Chase <drc...@google.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
      Gerrit-CC: Adam Langley <a...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
      Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
      Gerrit-Attention: David Chase <drc...@google.com>
      Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
      Gerrit-Comment-Date: Mon, 05 Jun 2023 20:16:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Roland Shoemaker (Gerrit)

      unread,
      Jun 5, 2023, 4:18:06 PM6/5/23
      to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski.

      Patch set 4:Run-TryBot +1

      View Change

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Mon, 05 Jun 2023 20:18:02 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes

        Jakub Nyckowski (Gerrit)

        unread,
        Jun 5, 2023, 4:44:49 PM6/5/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Gopher Robot, Roland Shoemaker, David Chase, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Stan Hu.

        View Change

        1 comment:

        • File ssh/server.go:

          • I think this should be resolved with the latest changes in https://github. […]

            I tested the latest changes, and I'm still getting an error when trying to connect to OpenSSH 7.4:

            ssh: signature "rsa-sha2-512" not compatible with selected algorithm "ssh-rsa-...@openssh.com", unsupported key type:

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Mon, 05 Jun 2023 20:44:45 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Jakub Nyckowski <jakub.n...@goteleport.com>
        Comment-In-Reply-To: Stan Hu <sta...@gmail.com>

        Jakub Nyckowski (Gerrit)

        unread,
        Jun 6, 2023, 6:26:01 PM6/6/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Gopher Robot, Roland Shoemaker, David Chase, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Stan Hu.

        View Change

        1 comment:

        • File ssh/server.go:

          • To be clear, this is with SSH certificates? Perhaps this should be a separate change. […]

            I created a repository with a reproduction https://github.com/jakule/go-crypto-ssh-repro. I used two clients, OpenSSH 8.9 and 7.4. The older OpenSSH fails with the error posted above. I understand this could be a separate charge, but merging anything upstream takes years, and we're also running a fork of go/crypto because of this.
            Let me know if you have more questions.

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Tue, 06 Jun 2023 22:25:58 +0000

        Jakub Nyckowski (Gerrit)

        unread,
        Jun 6, 2023, 10:41:13 PM6/6/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Gopher Robot, Roland Shoemaker, David Chase, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Stan Hu.

        View Change

        1 comment:

        • File ssh/server.go:

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Wed, 07 Jun 2023 02:41:10 +0000

        Nicola Murino (Gerrit)

        unread,
        Jun 7, 2023, 5:48:31 AM6/7/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Gopher Robot, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski.

        View Change

        1 comment:

        • File ssh/server.go:

          • Patch Set #4, Line 410: compatibleAlgos := algorithmsForKeyFormat(pubKeyFormat)

            ```suggestion
            compatibleAlgos := algorithmsForKeyFormat(underlyingAlgo(pubKeyFormat))
            ```

            this change should fix the reported issue with certificates.

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Wed, 07 Jun 2023 09:48:26 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No

        Jakub Nyckowski (Gerrit)

        unread,
        Jun 7, 2023, 11:53:23 AM6/7/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Nicola Murino, Gopher Robot, Roland Shoemaker, David Chase, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Nicola Murino, Stan Hu.

        View Change

        2 comments:

        • File ssh/server.go:

          • ```suggestion […]

            I confirm, this patch solves the cert issue.

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Stan Hu <sta...@gmail.com>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Nicola Murino <nicola...@gmail.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Wed, 07 Jun 2023 15:53:19 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Jakub Nyckowski <jakub.n...@goteleport.com>
        Comment-In-Reply-To: Stan Hu <sta...@gmail.com>
        Comment-In-Reply-To: Nicola Murino <nicola...@gmail.com>

        Gerrit Bot (Gerrit)

        unread,
        Jun 7, 2023, 12:22:40 PM6/7/23
        to Stan Hu, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski, Maxime Tremblay, Nicola Murino, Roland Shoemaker, Stan Hu.

        Gerrit Bot uploaded patch set #5 to this change.

        View Change

        The following approvals got outdated and were removed: Run-TryBot+1 by Roland Shoemaker, TryBot-Result+1 by Gopher Robot

        ssh: relax RSA signature check in SSH_MSG_USERAUTH_REQUEST

        Buggy SSH clients, such as gpg-agent v2.2.4 and OpenSSH v7.6 shipped
        in Ubuntu 18.04, may send `ssh-rsa-512` as the public key algorithm
        but actually include an `rsa-sha` signature.

        If RFC 3808 (extension negotiation) is implemented, these clients will
        fail to authenticate with the error:

        ```
        ssh: signature "ssh-rsa" came in for selected algorithm "rsa-sha2-512", public key is type ssh-rsa
        GitHub-Last-Rev: 9c9ba6a5d725b5247ce43e5c1eafac8a10136195

        GitHub-Pull-Request: golang/crypto#221
        ---
        M ssh/client_auth_test.go
        M ssh/server.go
        2 files changed, 111 insertions(+), 1 deletion(-)

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: newpatchset
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>

        Nicola Murino (Gerrit)

        unread,
        Jun 7, 2023, 3:08:21 PM6/7/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Gopher Robot, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski, Maxime Tremblay, Roland Shoemaker, Stan Hu.

        View Change

        1 comment:

        • File ssh/server.go:

          • Done

            Thank you Stan Hu. The compatibility with old clients should be now fixed for both keys and certificates.
            I wonder if a more stringent validity check should be added. We can accept the "ssh-rsa" algorithm with the public key format "ssh-rsa-...@openssh.com" or viceversa. I think this worked even before this change. OpenSSH seems to have a stricter validation. I have errors like this "error: userauth_pubkey: type mismatch for decoded key (received 0, expected 4) [preauth]"

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Wed, 07 Jun 2023 19:08:17 +0000

        Nicola Murino (Gerrit)

        unread,
        Jun 8, 2023, 12:44:46 AM6/8/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Gopher Robot, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski, Maxime Tremblay, Roland Shoemaker, Stan Hu.

        View Change

        1 comment:

        • File ssh/server.go:

          • Patch Set #5, Line 589: }

            ```suggestion
            }
            // Ensure the declared public key algo is compatible
            // with the decoded one
            if !contains(algorithmsForKeyFormat(pubKey.Type()), algo) {
            authErr = fmt.Errorf("ssh: type mismatch for decoded key, received %q, expected %q", pubKey.Type(), algo)
            break
            }
            ```

            this way we don't accept incompatible algo. For example algo ssh-rsa-...@openssh.com with public key type ssh-rsa will be rejected.
            Not sure if this change should be included here or discussed in a separate patch

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Thu, 08 Jun 2023 04:44:40 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No

        David Chase (Gerrit)

        unread,
        Jun 22, 2023, 3:54:14 PM6/22/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Ash McKenzie, Nicola Murino, Gopher Robot, Roland Shoemaker, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: Ash McKenzie, Filippo Valsorda, Jakub Nyckowski, Maxime Tremblay, Nicola Murino, Roland Shoemaker.

        View Change

        1 comment:

        • Patchset:

          • Patch Set #5:

            👋 Is there anything I can do to help move this change along? I'm happy to test?

            I think it needs at least on "trusted" security-oriented person to eyeball it and +2 it. I put "trusted" in square quotes because that ultimately depends on someone else's judgement (not mine, I know who's on the Go security team and a subset of who they trust).

            Also for actually submitting, all the comments have to be marked "resolved" (as I will this one).

            Re testing, maybe? Confirming that it works in an end-to-end test is not bad, but if that's a lot of work for you, probably not necessary either. I get the impression this CL is well-tested in the fork.

            I don't know if this will make it into 1.21, but if it is approved, we should at least do it early in 1.22 so that we're done with it.

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Ash McKenzie <a...@ashmckenzie.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: Ash McKenzie <a...@ashmckenzie.org>
        Gerrit-Attention: Nicola Murino <nicola...@gmail.com>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Thu, 22 Jun 2023 19:54:10 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Ash McKenzie <a...@ashmckenzie.org>

        Nicola Murino (Gerrit)

        unread,
        Jun 22, 2023, 4:04:26 PM6/22/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, triciu...@appspot.gserviceaccount.com, Ash McKenzie, Gopher Robot, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: Ash McKenzie, David Chase, Filippo Valsorda, Jakub Nyckowski, Maxime Tremblay, Roland Shoemaker.

        View Change

        1 comment:

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Ash McKenzie <a...@ashmckenzie.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Ash McKenzie <a...@ashmckenzie.org>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Thu, 22 Jun 2023 20:04:18 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: David Chase <drc...@google.com>
        Comment-In-Reply-To: Ash McKenzie <a...@ashmckenzie.org>

        Gopher Robot (Gerrit)

        unread,
        Jun 22, 2023, 4:15:56 PM6/22/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, triciu...@appspot.gserviceaccount.com, Ash McKenzie, Nicola Murino, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Gopher Robot abandoned this change.

        View Change

        Abandoned GitHub PR golang/crypto#221 has been closed.

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: abandon

        Nicola Murino (Gerrit)

        unread,
        Jun 22, 2023, 4:24:07 PM6/22/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, triciu...@appspot.gserviceaccount.com, Ash McKenzie, Gopher Robot, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        View Change

        1 comment:

        • Patchset:

          • Patch Set #5:

            Ok, I'll close this out in favor of that.

            That's just an alternative approach to fix the same issue. It depends on what the maintainers prefer. I think also this CL should be considered for a better evaluation

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Ash McKenzie <a...@ashmckenzie.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Comment-Date: Thu, 22 Jun 2023 20:24:01 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Stan Hu <sta...@gmail.com>
        Comment-In-Reply-To: David Chase <drc...@google.com>
        Comment-In-Reply-To: Ash McKenzie <a...@ashmckenzie.org>
        Comment-In-Reply-To: Nicola Murino <nicola...@gmail.com>

        Ash McKenzie (Gerrit)

        unread,
        Jun 22, 2023, 6:58:35 PM6/22/23
        to Gerrit Bot, Stan Hu, goph...@pubsubhelper.golang.org, Nicola Murino, Gopher Robot, Roland Shoemaker, David Chase, Jakub Nyckowski, Maxime Tremblay, Filippo Valsorda, Adam Langley, golang-co...@googlegroups.com

        Attention is currently required from: David Chase, Filippo Valsorda, Jakub Nyckowski, Maxime Tremblay, Nicola Murino, Roland Shoemaker.

        View Change

        1 comment:

        • Patchset:

          • Patch Set #5:

            👋 Is there anything I can do to help move this change along? I'm happy to test?

        To view, visit change 412854. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: crypto
        Gerrit-Branch: master
        Gerrit-Change-Id: I9208fba08ab792c973cc6f744a9b68a812a583e0
        Gerrit-Change-Number: 412854
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: David Chase <drc...@google.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Adam Langley <a...@golang.org>
        Gerrit-CC: Ash McKenzie <a...@ashmckenzie.org>
        Gerrit-CC: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-CC: Nicola Murino <nicola...@gmail.com>
        Gerrit-CC: Stan Hu <sta...@gmail.com>
        Gerrit-Attention: Maxime Tremblay <maxtre...@gmail.com>
        Gerrit-Attention: Jakub Nyckowski <jakub.n...@goteleport.com>
        Gerrit-Attention: David Chase <drc...@google.com>
        Gerrit-Attention: Nicola Murino <nicola...@gmail.com>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Thu, 22 Jun 2023 06:00:58 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Reply all
        Reply to author
        Forward
        0 new messages