<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go-x-crypto/ssh/client_auth.go, branch main</title>
<subtitle>Fork of golang.org/x/crypto with my patches.</subtitle>
<id>http://git.kilabit.info/go-x-crypto/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/go-x-crypto/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/'/>
<updated>2026-03-23T15:34:51Z</updated>
<entry>
<title>ssh: respect signer's algorithm preference in pickSignatureAlgorithm</title>
<updated>2026-03-23T15:34:51Z</updated>
<author>
<name>Nicola Murino</name>
<email>nicola.murino@gmail.com</email>
</author>
<published>2026-02-16T09:38:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=8400f4a938077a7a7817ab7d163d148e371b320b'/>
<id>urn:sha1:8400f4a938077a7a7817ab7d163d148e371b320b</id>
<content type='text'>
Previously, pickSignatureAlgorithm constructed the list of candidate
algorithms by iterating over the static list returned by
algorithmsForKeyFormat. This caused the Signer's preference order
to be ignored in favor of the library's default internal order.

This change inverts the filtering logic to iterate over the signer's
supported algorithms first. This ensures that if a MultiAlgorithmSigner
explicitly prefers a specific algorithm (e.g., rsa-sha2-512 over
rsa-sha2-256), that preference is preserved and respected during the
handshake negotiation.

Fixes golang/go#78248

Change-Id: I48a0aac720be7f973963342b82047ce32fc96699
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/746020
Reviewed-by: Lonny Wong &lt;lonnywang.cn@gmail.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Auto-Submit: Nicola Murino &lt;nicola.murino@gmail.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
Reviewed-by: Carlos Amedee &lt;carlos@golang.org&gt;
</content>
</entry>
<entry>
<title>ssh: remove custom contains, use slices.Contains</title>
<updated>2025-09-16T06:33:16Z</updated>
<author>
<name>Nicola Murino</name>
<email>nicola.murino@gmail.com</email>
</author>
<published>2025-09-14T13:28:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=ddb4e80c6ad38c8a94001924a6ff8424f5cae369'/>
<id>urn:sha1:ddb4e80c6ad38c8a94001924a6ff8424f5cae369</id>
<content type='text'>
Change-Id: If4784469e7285675bdd51399a76bdc16f0036a2e
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/703635
Reviewed-by: Mark Freeman &lt;markfreeman@google.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>ssh: add AlgorithmNegotiationError</title>
<updated>2025-07-09T15:43:26Z</updated>
<author>
<name>Nicola Murino</name>
<email>nicola.murino@gmail.com</email>
</author>
<published>2024-01-27T18:29:59Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=74e709ad8a8068445173aa5f3e8d7c89caf510c3'/>
<id>urn:sha1:74e709ad8a8068445173aa5f3e8d7c89caf510c3</id>
<content type='text'>
Fixes golang/go#61536

Change-Id: Id38cc6d46879dbe2bdea04dec061596387ec6cfe
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/559056
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
Auto-Submit: Nicola Murino &lt;nicola.murino@gmail.com&gt;
Reviewed-by: Carlos Amedee &lt;carlos@golang.org&gt;
</content>
</entry>
<entry>
<title>ssh: return unexpected msg error when server fails keyboard-interactive auth early</title>
<updated>2024-10-16T07:16:19Z</updated>
<author>
<name>samiponkanen</name>
<email>sami.ponkanen@gmail.com</email>
</author>
<published>2024-10-16T01:53:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=7cfb9161e8d828fd6d9f34560e78460435b63503'/>
<id>urn:sha1:7cfb9161e8d828fd6d9f34560e78460435b63503</id>
<content type='text'>
Seems the OpenSSH server running on windows fails keyboard-interactive
auth this way without sending any prompt to client. In such case the
golang ssh client should not retry keyboard-interactive auth when the
auth method is wrapped in a RetryableAuthMethod(). Rather the auth
method should be immediately marked as tried&amp;failed and the client auth
process should move on to next available and acceptable auth method.

Fixes golang/go#67855

Change-Id: I6c64ae58ff8325774e37af716601b112f8833d8f
GitHub-Last-Rev: 7fafc4d1c81284b31000d7d6ccadd934dda26d24
GitHub-Pull-Request: golang/crypto#297
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/590956
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Nicola Murino &lt;nicola.murino@gmail.com&gt;
Reviewed-by: Nicola Murino &lt;nicola.murino@gmail.com&gt;
</content>
</entry>
<entry>
<title>ssh: fail client auth immediately on receiving disconnect message</title>
<updated>2024-06-04T17:03:48Z</updated>
<author>
<name>samiponkanen</name>
<email>sami.ponkanen@gmail.com</email>
</author>
<published>2024-05-17T12:09:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=d4e7c9cb6cb8bb64ad4a1988cd26328ef6cb9023'/>
<id>urn:sha1:d4e7c9cb6cb8bb64ad4a1988cd26328ef6cb9023</id>
<content type='text'>
Fixes golang/go#66991

Change-Id: I60dd8a807578f162fda0e49bcd6fbf289d444396
GitHub-Last-Rev: f88329d35712873d0d7e3b39b9b11e7bfbc28e71
GitHub-Pull-Request: golang/crypto#293
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/581075
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
Auto-Submit: Nicola Murino &lt;nicola.murino@gmail.com&gt;
Reviewed-by: Nicola Murino &lt;nicola.murino@gmail.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>ssh: validate key type in SSH_MSG_USERAUTH_PK_OK response</title>
<updated>2024-05-03T13:40:56Z</updated>
<author>
<name>Nicola Murino</name>
<email>nicola.murino@gmail.com</email>
</author>
<published>2024-03-23T11:10:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=ebb717d630028d3e29c90c55d73cb6de90d53c3e'/>
<id>urn:sha1:ebb717d630028d3e29c90c55d73cb6de90d53c3e</id>
<content type='text'>
According to RFC 4252 Section 7 the algorithm in SSH_MSG_USERAUTH_PK_OK
should match that of the request but some servers send the key type instead.
OpenSSH checks for the key type, so we do the same.

Fixes golang/go#66438
Fixes golang/go#64785
Fixes golang/go#56342
Fixes golang/go#54027

Change-Id: I2f733f0faece097e44ba7a97c868d30a53e21d79
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/573360
Auto-Submit: Nicola Murino &lt;nicola.murino@gmail.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Run-TryBot: Nicola Murino &lt;nicola.murino@gmail.com&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Joedian Reid &lt;joedian@google.com&gt;
</content>
</entry>
<entry>
<title>ssh: fix certificate authentication with OpenSSH 7.2-7.7</title>
<updated>2023-11-23T17:23:14Z</updated>
<author>
<name>Nicola Murino</name>
<email>nicola.murino@gmail.com</email>
</author>
<published>2023-07-16T12:25:08Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=1c17e20020f974158d1b45be166660c999d6269b'/>
<id>urn:sha1:1c17e20020f974158d1b45be166660c999d6269b</id>
<content type='text'>
OpenSSH 7.2-7.7 advertises support for rsa-sha2-256 and rsa-sha2-512
in the "server-sig-algs" extension but doesn't support these
algorithms for certificate authentication, so if the server rejects
the key try to use the obtained algorithm as if "server-sig-algs" had
not been implemented.

Fixes golang/go#58371

Change-Id: Id49960d3dedd32a21e2c6c2689b1696e05398286
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/510155
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
Run-TryBot: Nicola Murino &lt;nicola.murino@gmail.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Nicola Murino &lt;nicola.murino@gmail.com&gt;
</content>
</entry>
<entry>
<title>ssh: add MultiAlgorithmSigner</title>
<updated>2023-09-20T18:10:30Z</updated>
<author>
<name>Nicola Murino</name>
<email>nicola.murino@gmail.com</email>
</author>
<published>2023-07-08T13:39:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=28c53ff63c09fc7df7793600caa30989bc69e194'/>
<id>urn:sha1:28c53ff63c09fc7df7793600caa30989bc69e194</id>
<content type='text'>
MultiAlgorithmSigner allows to restrict client-side, server-side and
certificate signing algorithms.

Fixes golang/go#52132
Fixes golang/go#36261

Change-Id: I295092f1bba647327aaaf294f110e9157d294159
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/508398
Reviewed-by: Filippo Valsorda &lt;filippo@golang.org&gt;
Run-TryBot: Filippo Valsorda &lt;filippo@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Filippo Valsorda &lt;filippo@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
</content>
</entry>
<entry>
<title>ssh: support rsa-sha2-256/512 for client certificates</title>
<updated>2022-03-15T16:07:06Z</updated>
<author>
<name>Filippo Valsorda</name>
<email>filippo@golang.org</email>
</author>
<published>2022-03-15T15:56:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=3147a52a75dda54ac3a611ef8978640d85188a2a'/>
<id>urn:sha1:3147a52a75dda54ac3a611ef8978640d85188a2a</id>
<content type='text'>
The server-sig-algs logic was not working for certificate algorithms.
Follow-up on CL 392394.

Tested with OpenSSH 8.8 configured with

    PubkeyAcceptedKeyTypes -ssh-rsa-cert-v01@openssh.com

Updates golang/go#39885
For golang/go#49952

Change-Id: Ic230dd6f98e96b7938acbd0128ab37d33b70abe5
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/392974
Trust: Filippo Valsorda &lt;filippo@golang.org&gt;
Run-TryBot: Filippo Valsorda &lt;filippo@golang.org&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>ssh: support rsa-sha2-256/512 for client authentication</title>
<updated>2022-03-14T23:47:24Z</updated>
<author>
<name>Filippo Valsorda</name>
<email>filippo@golang.org</email>
</author>
<published>2022-03-14T14:48:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go-x-crypto/commit/?id=5d542ad81a58c89581d596f49d0ba5d435481bcf'/>
<id>urn:sha1:5d542ad81a58c89581d596f49d0ba5d435481bcf</id>
<content type='text'>
CL 220037 had implemented support for host authentication using
rsa-sha2-256/512, but not client public key authentication. OpenSSH
disabled the SHA-1 based ssh-rsa by default in version 8.8 (after
pre-announcing it in versions 8.2, 8.3, 8.4, 8.5, 8.6, and 8.7) although
some distributions re-enable it. GitHub will start rejecting ssh-rsa for
keys uploaded before November 2, 2021 on March 15, 2022.

https://github.blog/2021-09-01-improving-git-protocol-security-github/

The server side already worked, as long as the client selected one of
the SHA-2 algorithms, because the signature flowed freely to Verify.
There was however nothing verifying that the signature algorithm matched
the advertised one. The comment suggested the check was being performed,
but it got lost back in CL 86190043. Not a security issue because the
signature had to pass the callback's Verify method regardless, and both
values were checked to be acceptable.

Tested with OpenSSH 8.8 configured with "PubkeyAcceptedKeyTypes -ssh-rsa"
and no application-side changes.

The Signers returned by ssh/agent (when backed by an agent client)
didn't actually implement AlgorithmSigner but ParameterizedSigner, an
interface defined in an earlier version of CL 123955.

Updates golang/go#49269
Fixes golang/go#39885
For golang/go#49952

Change-Id: I13b41db8041f1112a70f106c55f077b904b12cb8
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/392394
Trust: Filippo Valsorda &lt;filippo@golang.org&gt;
Run-TryBot: Filippo Valsorda &lt;filippo@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
</content>
</entry>
</feed>
