Compare commits

..
85 Commits
Author SHA1 Message Date
Gopher Robot 5307a0ce6d go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I75e16a930bfe42cc082df82ab67802c42ad56a97
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/701303
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
2025-09-08 08:14:28 -07:00
Daniel McCarney 9d779377cf acme: include order problem in OrderError
If client.WaitOrder or client.CreateOrderCert return an acme.OrderError
it's helpful to include the order's problem field (if available). This
will often have detailed information about why a particular order
became invalid that's invaluable for debugging (e.g. a challenge
response was incorrect, a name couldn't be resolved, etc).

While it's possible for a consumer to poll the order themselves as part
of handling the order to extract a fresh Order.Error field value, it
would take an extra round-trip network request. Since we have the
underlying error in-hand when we produce the OrderError we might as well
include it directly.

Since this field is a structured object with a number of sub-fields the
OrderError.Error() function isn't updated to include the order problem
error in the String description. Interested callers should instead use
errors.Is to extract the problem information directly.

Resolves golang/go#74430

Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-linux-amd64-longtest
Change-Id: I3158f064793bbfdc292dd6b5e1a6bfd7729bd980
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/681037
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-09-04 07:39:59 -07:00
Nicola Murino 8f580defa0 ssh: remove Go 1.24 build tag for ML-KEM kex
Change-Id: Ia77ad1b6fef9919ab100fb10c42231725eb81c12
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/698775
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2025-08-26 00:42:33 -07:00
Nicola Murino a4d1237429 ssh/knownhosts: improve IPv6 support in Normalize
Correctly converts bracketed IPv6:

- [abcd::abcd:abcd:abcd] => abcd::abcd:abcd:abcd
- [abcd::abcd:abcd:abcd]:22 => abcd::abcd:abcd:abcd
- [abcd::abcd:abcd:abcd]:23 => [abcd::abcd:abcd:abcd]:23

Fixes golang/go#53463

Change-Id: Id0a7460d8448a72e2a8c6d46137245bead9ecf9f
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/694575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-08-19 13:12:03 -07:00
Filippo Valsorda b8d8dae13d curve25519: include potential fips140=only error in panic message
Updates golang/go#75061

Change-Id: I6a6a696474122a12c12696d8a2efec902572327d
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/696996
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-08-19 10:40:36 -07:00
Filippo Valsorda f5a2eabcab ssh: use curve25519.X25519 instead of curve25519.ScalarMult
This lets us surface an error message instead of panicking if running
in fips140=only mode, where ECDH on X25519 returns an error.

Updates golang/go#75061

Change-Id: I6a6a6964c0591f3dca2dc946c99d44364314a3ab
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/696995
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
2025-08-19 10:38:43 -07:00
Gopher Robot 44ecf3af99 all: upgrade go directive to at least 1.24.0 [generated]
By now Go 1.25.0 has been released, and Go 1.23 is no longer supported
per the Go Release Policy (see https://go.dev/doc/devel/release#policy).

For golang/go#69095.

[git-generate]
(cd . && go get go@1.24.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none)
(cd x509roots/fallback && go get go@1.24.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none)

Change-Id: Ia4c201e9611a2c13489e16d4ae81d7e3e32bf455
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/695715
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-13 08:00:22 -07:00
Gopher Robot ef5341b706 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I93de641462a54b0ae565bb60e2a0e6e7c2c3b883
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/693999
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2025-08-07 10:21:04 -07:00
Daniel McCarney b999374650 acme: fix pebble subprocess output data race
Wait for process completion before reading stdout/stderr buffers
to eliminate race between I/O Go routines and test cleanup.

Updates golang/go#74437

Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-linux-amd64-longtest-race
Change-Id: I2e650c04db5be0d7a1e858ce40e25f13ad12223c
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/693596
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-06 13:33:03 -07:00
Mateusz Poliwczak c247dead11 x509roots/fallback: store bundle certs directly in DER
goos: linux
goarch: amd64
pkg: golang.org/x/crypto/x509roots/fallback
cpu: AMD Ryzen 5 4600G with Radeon Graphics
            │ /tmp/before │             /tmp/after              │
            │   sec/op    │   sec/op     vs base                │
InitTime-12   1.726m ± 0%   1.101m ± 1%  -36.20% (p=0.000 n=30)

            │  /tmp/before  │              /tmp/after              │
            │     B/op      │     B/op      vs base                │
InitTime-12   1178.2Ki ± 0%   779.8Ki ± 0%  -33.81% (p=0.000 n=30)

            │ /tmp/before │             /tmp/after             │
            │  allocs/op  │  allocs/op   vs base               │
InitTime-12   11.35k ± 0%   10.64k ± 0%  -6.32% (p=0.000 n=30)

Updates golang/go#73691

Change-Id: Ic33f2fdfc65001c41afeb3b6af8a383288d10de6
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676217
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <mark@golang.org>
2025-08-03 12:47:17 -07:00
Daniel McCarney 1fda73153f acme: increase pebble test waitForServer attempts
In CI it seems that occasionally we can't connect to the test servers
within 10 tries, and the test flakes. Let's give the process more
attempts.

Updates golang/go#74437

Change-Id: I74d6cea83468a3a572ec4b52ff7314c778c664cf
Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/692075
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Mark Freeman <mark@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-08-01 08:44:22 -07:00
Gopher Robot 1b4c3d2e8c x509roots/fallback: update bundle
This is an automated CL which updates the NSS root bundle.

[git-generate]
go generate ./x509roots

Change-Id: Ib30b702d41dedacce835628a9dab456098be0703
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/687895
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
2025-07-30 16:29:44 -07:00
Daniel McCarney b903b535d3 acme: capture pebble test subprocess stdout/stderr
When spawning the pebble and pebble-challtestserv processes redirect
stdout/stderr to bytes.Buffer instances and print their content at test
end as appropriate.

The stdout/stderr content for each process is printed if the test
failed, or if testing is being done in verbose mode. Otherwise the
output is swallowed.

This makes debugging test failures much easier as output from the
subprocesses from independent tests isn't intermingled.

Updates golang/go#74437

Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-linux-amd64-longtest
Change-Id: Ia79a3609ce3522ef6248442de247554c39367162
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/686935
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-07-11 12:27:10 -07:00
Gopher Robot 459a9db11b go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I3a89b1890ad2f7d2b2c23e1efce60c19e43dd381
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/687017
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2025-07-10 10:21:43 -07:00
Nicola Murino 74e709ad8a ssh: add AlgorithmNegotiationError
Fixes golang/go#61536

Change-Id: Id38cc6d46879dbe2bdea04dec061596387ec6cfe
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/559056
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-07-09 08:43:26 -07:00
Daniel McCarney b3790b8d91 acme: fix TLSALPN01ChallengeCert for IP address identifiers
When creating a TLS-ALPN-01 challenge response certificate for an IP
address identifier we need to configure the template IPAddresses field,
not the DNSNames/Subject.CommonName.

Along the way we can do some small tidying:
* Updating the draft TLS-ALPN-01 reference to the finalized RFC
* Adding a reference to the IP address identifier ACME RFC
* Adding a mention of the form the challenge validation request's SNI
  will take when verifying an IP address identifier
* Tidying the private tlsChallengeCert() function to take a single
  identifier as arg since the only call-sites provide singular values
  since the removal of the TLS-SNI-[01|02] challenge helpers.

This allows enabling an IP address identifier in the Pebble integration
tests that otherwise caused a validation failure for TLS-ALPN-01
challenge types because the IP address was used as a DNS SAN.

Updates golang/go#73914

Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-linux-amd64-longtest
Change-Id: Ic671e41b585f424f821db65206c7ffcc6dd386a0
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/677576
Reviewed-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-06-30 12:50:50 -07:00
Daniel McCarney 1dc4269656 acme: add Pebble integration testing
This commit adds integration test coverage for a complete TLS-ALPN-01
and HTTP-01 based issuance flow.

For each tested challenge type we:

* Spin up a pebble/pebble-challtestsrv environment
* Spin up a small challenge response server
* Create an ACME account
* Create an order for multiple DNS type identifiers
* Provision challenge responses based on the challenge type under test
* Wait for the order to become ready for issuance
* Finalize the order, issuing a certificate
* Check the newly issued certificate chain validates with the Pebble
  trust anchor, and that the certificate is valid for each of the names
  from our initial order

These tests are skipped in short mode (Pebble has variable delays for
validation requests).

The Pebble source is fetched through the Go module proxy (unless
a local directory is specified to aid development), similar to how the
stdlib crypto packages fetch BoGo tooling.

More test coverage for various other parts of the protocol (key
rollover, account/authz deactivation, revocation, etc) can be added as
follow-up work now that the groundwork for integration testing is laid.

Fixes golang/go#73914

Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-linux-amd64-longtest
Change-Id: I4e79f4858f31ef290a0c91d345e15fbdc510e9ab
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/677575
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-30 09:51:57 -07:00
qiulaidongfeng 97bf787255 blake2b: implement hash.XOF
Fixes golang/go#69518

Change-Id: Id9989ac9b28262df77017e97f985f67c1571c3ce
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/644255
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-30 09:39:26 -07:00
Gopher Robot 952517d181 x509roots/fallback: update bundle
This is an automated CL which updates the NSS root bundle.

[git-generate]
go generate ./x509roots

Change-Id: Icb71f9f7c509dc6f49ad4385aa287bd6a8966523
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/681915
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2025-06-30 09:08:05 -07:00
Nicola Murino c6fce02826 ssh: refuse to parse certificates that use a certificate as signing key
According to draft-miller-ssh-cert-01, Section 2.1.1, certificates with
certificate keys as signature keys are invalid

Change-Id: I474524ea444deb78f2fa7c2682e47c0fd057f0b8
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/678716
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2025-06-30 09:02:50 -07:00
Nicola Murino 0ae49b8145 ssh: reject certificate keys used as signature keys for SSH certs
As specified in draft-miller-ssh-cert-01, Section 2.1.1:
Implementations MUST NOT accept certificate keys as CA keys.

Change-Id: I2e559a8a58b7bceccd0d8c6b80803abdbe281067
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/678715
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2025-06-30 09:02:45 -07:00
Nicola Murino 3bf9d2afd4 ssh/test: skip KEX test if unsupported by system SSH client
Skip the key exchange test when using the system's ssh CLI if the
required KEX algorithm (e.g., mlkem768x25519-sha256) is not supported.
This is determined by running ssh -Q kex and checking for the presence
of the target algorithm.
Prevents false test failures in CI environments with older or limited
SSH implementations.

Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-darwin-amd64-longtest,x_crypto-gotip-linux-amd64-longtest,x_crypto-gotip-windows-amd64-longtest
Change-Id: I3fac703ec70559e18b30d5fff88274335a7c3952
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/679195
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-06-05 10:42:09 -07:00
Gopher Robot 9bab96736c go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: Icbe0bf922207aefa5ee047a35dfb71843ec75306
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/679135
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
2025-06-05 08:51:54 -07:00
Mateusz Poliwczak 4f9f0ca9fc x509roots/fallback: add init time benchmark
goos: linux
goarch: amd64
pkg: golang.org/x/crypto/x509roots/fallback
cpu: AMD Ryzen 5 4600G with Radeon Graphics
            │ /tmp/before │
            │   sec/op    │
InitTime-12   1.726m ± 0%

            │ /tmp/before  │
            │     B/op     │
InitTime-12   1.151Mi ± 0%

            │ /tmp/before │
            │  allocs/op  │
InitTime-12   11.35k ± 0%

For golang/go#73691

Change-Id: Ic932bd7835e50dd5c6adbdf684644afa49bddebc
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676216
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-05-31 02:59:11 -07:00
Mateusz Poliwczak eac7cf0d78 x509roots/fallback: move parsing code to a non-generated file
For golang/go#73691

Change-Id: I3e2b09055c39286d863fe70ca3bd72a839e25d0a
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676215
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-31 02:59:06 -07:00
Daniel McCarney 18228cd6f1 acme: return err from deprecated TLS-SNI-[01|02] functions
The TLSSNI01ChallengeCert and TLSSNI02ChallengeCert functions have been
marked deprecated since 2022. The package documentation indicates
pre-RFC 8555 functionality is retained for compilation success, but will
return errors. This commit makes these two deprecated functions match
that description.

No meaningful support for these draft standard challenge types exists
in the ACME ecosystem, and they are insecure for use in shared hosting
environments.

Change-Id: I1c17980a0630092c70eb971b3453a0f115834be0
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676835
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-05-29 10:16:04 -07:00
Daniel McCarney 73f6362471 acme: remove dead code
The private encodePem() and unique() functions under the acme package
had no call-sites and so can be removed.

Change-Id: Ic617392e7cc9b9e795456626a623ba02df108694
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676875
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-05-28 10:23:52 -07:00
Nicola Murino ebc8e46315 ssh: add server side support for Diffie Hellman Group Exchange
We add this support for the following reasons:

- We are planning to expose recommended (secure) vs. supported (works,
  not necessarily recommended) algorithms. The DHGEX kex is currently
  only exposed as a client-side kex. To simplify the calling convention
  for this follow-on, we expose the server side too.
- Some clients are quite inflexible with reference to kex algorithms
  choice, for example they offer:

  diffie-hellman-group-exchange-sha256, diffie-hellman-group-exchange-sha1,
  diffie-hellman-group14-sha1, diffie-hellman-group1-sha1

  therefore DHGEX helps interoperability.

We do not recommend the DHGEX kex as a whole:

- the negotiation requires an extra round trip
- the server must generate parameters (slow) or hardcode them, which
  defeats the security benefit over traditional DH.

In this implementation we hardcode sending Oakley Group 14, Oakley
Group 15 or Oakley Group 16 based on the requested max size.

Users that are concerned with security of classical DH kex should
migrate to kex based on EC or Ed25519.

Fixes golang/go#54743

Change-Id: I127822e90efc36821af4aca679931f40a2023021
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/532415
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-15 10:47:05 -07:00
Nicola Murino e944286e33 ssh: expose negotiated algorithms
Fixes golang/go#58523
Fixes golang/go#46638

Change-Id: Ic64bd2fdd6e9ec96acac3ed4be842e2fbb15231d
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/538235
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-15 10:44:04 -07:00
Nicola Murino 78a1fd7893 ssh: automatically add curve25519-sha256@libssh.org KEX alias
If the key exchange method curve25519-sha256 is configured, automatically
add the curve25519-sha256@libssh.org alias to ensure compatibility with
OpenSSH versions up to 7.2, which recognize only the older vendor-specific
name.

Change-Id: If50ab2c49179db949ba1b986f7bb0e153cc7f897
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/669716
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-15 10:43:39 -07:00
Nicola Murino ac58737d25 ssh: export supported algorithms
Fixes golang/go#61537

Change-Id: If3478121e3ae445391e3faeceeb889d75e9e3214
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/531935
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2025-05-15 10:43:30 -07:00
redwrasse 9dbbcf002b bcrypt: update InvalidCostError message to describe cost range inclusive
Change InvalidCostError string to explicitly state cost bounds
range as inclusive, rather than using parentheses that might
imply an exclusive range.

Change-Id: Ie5e7d53ef4217c8560e6a7fe23e3d65ecc24a2a3
GitHub-Last-Rev: b49002b6b2cff0939858553a28e3f255bde397b6
GitHub-Pull-Request: golang/crypto#300
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/609455
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-05-12 11:46:18 -07:00
Gopher Robot 9f6bf8449a x509roots/fallback: update bundle
This is an automated CL which updates the NSS root bundle.

[git-generate]
go generate ./x509roots

Change-Id: If1970af8da68ead595dc3fa7dd79a8555a5f09c5
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/668576
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
2025-05-12 08:41:11 -07:00
Gopher Robot aae6e61070 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I06b2bb01f1557af02a8bf172ee85973695506906
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/670095
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: David Chase <drchase@google.com>
2025-05-05 11:47:08 -07:00
Nicola Murino 9c1aa6af88 ssh/test: reset the random source before capturing a recording
If a recording file exists but is invalid for any reason, the random
source may have already been used, resulting in a recording that
cannot be replayed.

Change-Id: Ib81aaf163f5783fede2c14a0ac10a8d2af6019c6
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/664917
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
2025-04-18 04:19:36 -07:00
Nicola Murino 88199028d7 ssh/test: enable Diffie-Hellman key exchange algorithms
starting with OpenSSH 10, all Diffie-Hellman key exchange algorithms
are disabled by default. To generate recordings, we must explicitly
enable them.

Change-Id: Icfbf46b30478f36d7040991e0f6324b9b4766aaf
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665115
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2025-04-18 04:18:34 -07:00
Ian Stapleton Cordasco 3f311e442e acme: return error from pre-authorization when unsupported
Check the directory's AuthzURL to see if the server supports
pre-authorization. If it's empty, then the server is not advertising
support and we can encounter other bugs. Better to return early and give
a clear error to the caller.

From https://www.rfc-editor.org/rfc/rfc8555#section-7.4.1

    If a CA wishes to allow pre-authorization within ACME, it can offer a
    "new authorization" resource in its directory by adding the field
    "newAuthz" with a URL for the newAuthz resource.

Fixes golang/go#40839

Change-Id: Id3e92e8e2ae3c57285183d37544dd59b4988b3be
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/661675
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2025-04-17 11:16:57 -07:00
Nicola Murino 1f7c62cd66 ssh/test: skip unsupported tests on js/wasm
This fixes the build on the js/wasm builder.

Change-Id: Icd891cd38b9da07279b9afaa168f7c64c81e13fe
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665095
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2025-04-16 08:28:17 -07:00
Alberto Bertogli a5f804889e acme/autocert: use standard functions to pick the cache directory
acme/autocert currently has ad-hoc logic to find a reasonable default
for a cache directory.

Since that logic was written (in 2017), new functions were added to the
os package to provide that functionality (in Go 1.13, 2019-09):
`os.UserCacheDir` and `os.UserHomeDir`.

This patch replaces the ad-hoc logic with a call to `os.UserCacheDir`.

The fallback to `/` is kept, since it may be relied upon in some
environments.

Change-Id: I3bf692ca670b87bf3d329e5d3684eee15ed374aa
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/440195
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
2025-04-16 08:16:13 -07:00
Michael Pratt 958cde86ef Revert "chacha20: add loong64 SIMD implementation"
This reverts CL 636257.

Reason for revert: Does not build on 1.23 or 1.24

For golang/go#73354.

Change-Id: Ie28d5c45930a8eacd5cabed64390ef674b3fb446
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665536
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-16 06:50:31 -07:00
Michael Pratt 51f005cfd4 Revert "salsa20: add loong64 SIMD implementation"
This reverts CL 663375.

Reason for revert: Does not build on 1.23 or 1.24

For golang/go#73354.

Change-Id: I251d598423b83c01cc2e04ddf6f49ae14095fa7c
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665535
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-16 06:50:29 -07:00
Michael Pratt 7c358664da Revert "argon2: add loong64 SIMD implementation"
This reverts CL 657795.

Reason for revert: Does not build on 1.23 or 1.24

For golang/go#73354.

Change-Id: I69498f24b57bd6650c9d1f4c755922cfaaba4a84
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665555
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-04-16 06:49:50 -07:00
Michael Pratt 0091fc8e7c Revert "blake2s: add loong64 SIMD implementation"
This reverts CL 661215.

Reason for revert: Does not build on 1.23 or 1.24

Fixes #73354.

Change-Id: I90abd8a3dabf5c0d9fd1062de3ba3e78ecb2f2e8
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/664796
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-14 04:06:44 -07:00
Xiaolin Zhao 388684e50b argon2: add loong64 SIMD implementation
The performance gains on Loongson 3A6000 and 3A5000 are as follows:

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/argon2
cpu: Loongson-3A6000-HV @ 2500.00MHz
                                             |  bench.old   |              bench.new              |
                                             |    sec/op    |   sec/op     vs base                |
Argon2i/_Time:_3_Memory:_32_MB,_Threads:_1     131.23m ± 0%   67.56m ± 1%  -48.52% (p=0.000 n=10)
Argon2i/_Time:_4_Memory:_32_MB,_Threads:_1     171.28m ± 2%   90.20m ± 0%  -47.34% (p=0.000 n=10)
Argon2i/_Time:_5_Memory:_32_MB,_Threads:_1      213.3m ± 0%   112.6m ± 0%  -47.21% (p=0.000 n=10)
Argon2i/_Time:_3_Memory:_64_MB,_Threads:_4      269.5m ± 0%   147.2m ± 0%  -45.37% (p=0.000 n=10)
Argon2i/_Time:_4_Memory:_64_MB,_Threads:_4      357.7m ± 0%   195.4m ± 0%  -45.36% (p=0.000 n=10)
Argon2i/_Time:_5_Memory:_64_MB,_Threads:_4      449.8m ± 0%   243.8m ± 0%  -45.79% (p=0.000 n=10)
Argon2d/_Time:_3,_Memory:_32_MB,_Threads:_1    126.56m ± 0%   67.43m ± 0%  -46.72% (p=0.000 n=10)
Argon2d/_Time:_4,_Memory:_32_MB,_Threads:_1    168.57m ± 0%   90.04m ± 0%  -46.58% (p=0.000 n=10)
Argon2d/_Time:_5,_Memory:_32_MB,_Threads:_1     210.5m ± 0%   112.7m ± 0%  -46.45% (p=0.000 n=10)
Argon2d/_Time:_3,_Memory:_64_MB,_Threads:_4     264.8m ± 0%   145.0m ± 1%  -45.23% (p=0.000 n=10)
Argon2d/_Time:_4,_Memory:_64_MB,_Threads:_4     353.8m ± 0%   193.7m ± 0%  -45.26% (p=0.000 n=10)
Argon2d/_Time:_5,_Memory:_64_MB,_Threads:_4     444.4m ± 0%   242.3m ± 0%  -45.49% (p=0.000 n=10)
Argon2id/_Time:_3,_Memory:_32_MB,_Threads:_1   126.89m ± 0%   66.62m ± 0%  -47.50% (p=0.000 n=10)
Argon2id/_Time:_4,_Memory:_32_MB,_Threads:_1   169.02m ± 0%   89.07m ± 0%  -47.30% (p=0.000 n=10)
Argon2id/_Time:_5,_Memory:_32_MB,_Threads:_1    210.7m ± 0%   111.0m ± 0%  -47.34% (p=0.000 n=10)
Argon2id/_Time:_3,_Memory:_64_MB,_Threads:_4    267.6m ± 1%   145.8m ± 0%  -45.51% (p=0.000 n=10)
Argon2id/_Time:_4,_Memory:_64_MB,_Threads:_4    355.1m ± 0%   194.1m ± 0%  -45.34% (p=0.000 n=10)
Argon2id/_Time:_5,_Memory:_64_MB,_Threads:_4    443.6m ± 0%   242.5m ± 0%  -45.33% (p=0.000 n=10)
geomean                                         240.8m        129.3m       -46.32%

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/argon2
cpu: Loongson-3A5000 @ 2500.00MHz
                                             |  bench.old  |              bench.new              |
                                             |   sec/op    |   sec/op     vs base                |
Argon2i/_Time:_3_Memory:_32_MB,_Threads:_1     209.9m ± 1%   109.7m ± 2%  -47.75% (p=0.000 n=10)
Argon2i/_Time:_4_Memory:_32_MB,_Threads:_1     278.1m ± 0%   143.7m ± 0%  -48.34% (p=0.000 n=10)
Argon2i/_Time:_5_Memory:_32_MB,_Threads:_1     346.7m ± 0%   178.1m ± 0%  -48.63% (p=0.000 n=10)
Argon2i/_Time:_3_Memory:_64_MB,_Threads:_4     455.3m ± 0%   240.8m ± 0%  -47.12% (p=0.000 n=10)
Argon2i/_Time:_4_Memory:_64_MB,_Threads:_4     604.6m ± 0%   317.7m ± 0%  -47.45% (p=0.000 n=10)
Argon2i/_Time:_5_Memory:_64_MB,_Threads:_4     754.8m ± 0%   395.4m ± 0%  -47.61% (p=0.000 n=10)
Argon2d/_Time:_3,_Memory:_32_MB,_Threads:_1    206.9m ± 1%   107.6m ± 0%  -48.00% (p=0.000 n=10)
Argon2d/_Time:_4,_Memory:_32_MB,_Threads:_1    274.3m ± 0%   141.8m ± 1%  -48.32% (p=0.000 n=10)
Argon2d/_Time:_5,_Memory:_32_MB,_Threads:_1    342.4m ± 0%   175.6m ± 0%  -48.71% (p=0.000 n=10)
Argon2d/_Time:_3,_Memory:_64_MB,_Threads:_4    450.2m ± 0%   237.9m ± 0%  -47.15% (p=0.000 n=10)
Argon2d/_Time:_4,_Memory:_64_MB,_Threads:_4    597.7m ± 0%   314.0m ± 0%  -47.46% (p=0.000 n=10)
Argon2d/_Time:_5,_Memory:_64_MB,_Threads:_4    745.8m ± 0%   390.7m ± 1%  -47.61% (p=0.000 n=10)
Argon2id/_Time:_3,_Memory:_32_MB,_Threads:_1   207.6m ± 0%   107.9m ± 0%  -48.05% (p=0.000 n=10)
Argon2id/_Time:_4,_Memory:_32_MB,_Threads:_1   275.0m ± 0%   142.0m ± 0%  -48.34% (p=0.000 n=10)
Argon2id/_Time:_5,_Memory:_32_MB,_Threads:_1   342.9m ± 1%   176.0m ± 0%  -48.66% (p=0.000 n=10)
Argon2id/_Time:_3,_Memory:_64_MB,_Threads:_4   450.6m ± 1%   238.5m ± 0%  -47.07% (p=0.000 n=10)
Argon2id/_Time:_4,_Memory:_64_MB,_Threads:_4   598.5m ± 1%   314.6m ± 0%  -47.44% (p=0.000 n=10)
Argon2id/_Time:_5,_Memory:_64_MB,_Threads:_4   746.4m ± 0%   391.0m ± 0%  -47.61% (p=0.000 n=10)
geomean                                        398.6m        207.9m       -47.86%

Change-Id: Iaa9d134d68dd2f0972fc5768d7e66f7b1ff0ebd3
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/657795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-04-13 20:23:35 -07:00
Xiaolin Zhao 953e809589 chacha20: add loong64 SIMD implementation
The performance of chacha20 has been greatly improved on 3A6000 and 3A5000.

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/chacha20
cpu: Loongson-3A6000 @ 2500.00MHz
                 |  bench.old   |              bench.new              |
                 |    sec/op    |   sec/op     vs base                |
ChaCha20/64         171.9n ± 0%   159.3n ± 0%   -7.33% (p=0.000 n=20)
ChaCha20/256        592.2n ± 0%   142.8n ± 0%  -75.89% (p=0.000 n=20)
ChaCha20/10x25      981.5n ± 0%   518.8n ± 0%  -47.14% (p=0.000 n=20)
ChaCha20/4096       8.991µ ± 0%   1.732µ ± 0%  -80.74% (p=0.000 n=20)
ChaCha20/100x40    10.651µ ± 0%   5.135µ ± 0%  -51.79% (p=0.000 n=20)
ChaCha20/65536     143.43µ ± 0%   28.76µ ± 0%  -79.95% (p=0.000 n=20)
ChaCha20/1000x65   146.17µ ± 0%   37.13µ ± 0%  -74.60% (p=0.000 n=20)
geomean             5.721µ        1.962µ       -65.70%

                 |  bench.old   |               bench.new                |
                 |     B/s      |      B/s       vs base                 |
ChaCha20/64        355.1Mi ± 0%    383.1Mi ± 0%    +7.89% (p=0.000 n=20)
ChaCha20/256       412.2Mi ± 0%   1710.2Mi ± 0%  +314.86% (p=0.000 n=20)
ChaCha20/10x25     242.9Mi ± 0%    459.6Mi ± 0%   +89.19% (p=0.000 n=20)
ChaCha20/4096      434.5Mi ± 0%   2255.8Mi ± 0%  +419.22% (p=0.000 n=20)
ChaCha20/100x40    358.1Mi ± 0%    742.9Mi ± 0%  +107.44% (p=0.000 n=20)
ChaCha20/65536     435.8Mi ± 0%   2173.2Mi ± 0%  +398.72% (p=0.000 n=20)
ChaCha20/1000x65   424.1Mi ± 0%   1669.4Mi ± 0%  +293.64% (p=0.000 n=20)
geomean            373.9Mi         1.065Gi       +191.55%

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/chacha20
cpu: Loongson-3A5000 @ 2500.00MHz
                 |  bench.old   |              bench.new              |
                 |    sec/op    |   sec/op     vs base                |
ChaCha20/64         234.5n ± 0%   295.8n ± 0%  +26.14% (p=0.000 n=20)
ChaCha20/256        782.0n ± 0%   274.6n ± 0%  -64.88% (p=0.000 n=20)
ChaCha20/10x25     1340.0n ± 0%   752.7n ± 0%  -43.83% (p=0.000 n=20)
ChaCha20/4096      11.744µ ± 0%   3.455µ ± 0%  -70.58% (p=0.000 n=20)
ChaCha20/100x40    14.151µ ± 0%   7.435µ ± 0%  -47.46% (p=0.000 n=20)
ChaCha20/65536     188.05µ ± 0%   54.33µ ± 0%  -71.11% (p=0.000 n=20)
ChaCha20/1000x65   191.44µ ± 0%   66.29µ ± 0%  -65.37% (p=0.000 n=20)
geomean             7.604µ        3.436µ       -54.81%

                 |  bench.old   |               bench.new                |
                 |     B/s      |      B/s       vs base                 |
ChaCha20/64        260.3Mi ± 0%    206.3Mi ± 0%   -20.73% (p=0.000 n=20)
ChaCha20/256       312.2Mi ± 0%    888.9Mi ± 0%  +184.75% (p=0.000 n=20)
ChaCha20/10x25     177.9Mi ± 0%    316.8Mi ± 0%   +78.08% (p=0.000 n=20)
ChaCha20/4096      332.6Mi ± 0%   1130.8Mi ± 0%  +239.95% (p=0.000 n=20)
ChaCha20/100x40    269.6Mi ± 0%    513.1Mi ± 0%   +90.34% (p=0.000 n=20)
ChaCha20/65536     332.4Mi ± 0%   1150.5Mi ± 0%  +246.16% (p=0.000 n=20)
ChaCha20/1000x65   323.8Mi ± 0%    935.2Mi ± 0%  +188.81% (p=0.000 n=20)
geomean            281.3Mi         622.6Mi       +121.31%

Change-Id: I5386f2029122076c1d22a04610567e3df23877cd
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/636257
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-04-13 20:23:16 -07:00
Xiaolin Zhao 18f770732f salsa20: add loong64 SIMD implementation
The performance gains on Loongson 3A6000 and 3A5000 are as follows:

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/salsa20
cpu: Loongson-3A6000-HV @ 2500.00MHz
      |  bench.old   |              bench.new              |
      |    sec/op    |   sec/op     vs base                |
XOR1K   3175.0n ± 0%   435.4n ± 0%  -86.29% (p=0.000 n=20)

      |  bench.old   |               bench.new                |
      |     B/s      |      B/s       vs base                 |
XOR1K   307.6Mi ± 0%   2242.7Mi ± 0%  +629.13% (p=0.000 n=20)

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/salsa20
cpu: Loongson-3A5000 @ 2500.00MHz
      |  bench.old   |              bench.new              |
      |    sec/op    |   sec/op     vs base                |
XOR1K   4125.0n ± 0%   864.0n ± 0%  -79.05% (p=0.000 n=20)

      |  bench.old   |               bench.new                |
      |     B/s      |      B/s       vs base                 |
XOR1K   236.7Mi ± 0%   1130.3Mi ± 0%  +377.41% (p=0.000 n=20)

Change-Id: Ib37f603e6654f1e3837985fad4b6dee10b5af993
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/663375
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
2025-04-11 13:55:20 -07:00
Xiaolin Zhao 2ebaafcdf5 blake2s: add loong64 SIMD implementation
The performance gains on Loongson 3A6000 and 3A5000 are as follows:

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/blake2s
cpu: Loongson-3A6000-HV @ 2500.00MHz
        |  bench.old  |              bench.new              |
        |   sec/op    |   sec/op     vs base                |
Write64   277.8n ± 0%   113.5n ± 0%  -59.14% (p=0.000 n=10)
Write1K   4.246µ ± 0%   1.736µ ± 0%  -59.11% (p=0.000 n=10)
Sum64     289.9n ± 0%   137.7n ± 0%  -52.51% (p=0.000 n=10)
Sum1K     4.265µ ± 0%   1.758µ ± 0%  -58.78% (p=0.000 n=10)
geomean   1.099µ        467.3n       -57.48%

        |  bench.old   |               bench.new               |
        |     B/s      |     B/s       vs base                 |
Write64   219.7Mi ± 0%   537.9Mi ± 0%  +144.86% (p=0.000 n=10)
Write1K   230.0Mi ± 0%   562.6Mi ± 0%  +144.62% (p=0.000 n=10)
Sum64     210.5Mi ± 0%   443.3Mi ± 0%  +110.59% (p=0.000 n=10)
Sum1K     229.0Mi ± 0%   555.5Mi ± 0%  +142.64% (p=0.000 n=10)
geomean   222.1Mi        522.5Mi       +135.21%

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/blake2s
cpu: Loongson-3A5000 @ 2500.00MHz
        |  bench.old  |              bench.new              |
        |   sec/op    |   sec/op     vs base                |
Write64   373.8n ± 0%   175.0n ± 0%  -53.18% (p=0.000 n=10)
Write1K   5.763µ ± 0%   2.595µ ± 0%  -54.97% (p=0.000 n=10)
Sum64     397.8n ± 0%   205.7n ± 0%  -48.29% (p=0.000 n=10)
Sum1K     5.787µ ± 0%   2.627µ ± 0%  -54.61% (p=0.000 n=10)
geomean   1.492µ        703.8n       -52.83%

        |  bench.old   |               bench.new               |
        |     B/s      |     B/s       vs base                 |
Write64   163.3Mi ± 0%   348.9Mi ± 0%  +113.62% (p=0.000 n=10)
Write1K   169.5Mi ± 0%   376.3Mi ± 0%  +122.09% (p=0.000 n=10)
Sum64     153.4Mi ± 0%   296.7Mi ± 0%   +93.37% (p=0.000 n=10)
Sum1K     168.7Mi ± 0%   371.8Mi ± 0%  +120.33% (p=0.000 n=10)
geomean   163.6Mi        346.9Mi       +112.03%

Change-Id: Id91ffbefc538bce294875d72e6cde72fea43afbf
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/661215
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-11 13:55:16 -07:00
cuishuang 4bc0711281 acme: use built-in max/min to simplify the code
Change-Id: I6ba8d07b9e53b01f25f4c1c8eac629aaa47de3a1
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/664836
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-04-11 09:06:14 -07:00
Nicola MurinoandDamien Miller c96bba2ced ssh: add mlkem768x25519-sha256 Key Exchange algorithm
mlkem768x25519-sha256 requires the crypto/mlkem package introduced in
Go 1.24.

Thanks to Damien Miller for posting an early version to the OpenSSH
mailing list.

Co-authored-by: Damien Miller <djm@mindrot.org>
Change-Id: I4235cf906903524a9a97283834cc8f43b5f76f91
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/646075
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-11 07:39:49 -07:00
Nicola Murino 6b13eef40b ssh: add integration tests against a reference implementation
As in crypto/tls, we record the connection against a reference
implementation, OpenSSH in our case, and run part of our integration
tests by replaying these recorded SSH connections.

Change-Id: If042b5f650b267bd3ede34a05ec3a6fa6d1a86b3
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/644436
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
2025-04-11 07:29:06 -07:00
Gopher Robot 959f8f3db0 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I1e9480e5897a08cac746309acdc8bbdf0bce8060
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/663256
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-06 09:04:20 -07:00
Nicola Murino 769bcd6997 ssh: use the configured rand in kex init
Change-Id: I4f89c395886b9dd07b584d1fcf1a0f2df215b91b
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/644435
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
2025-04-03 13:05:29 -07:00
Simon Josefsson d0a798f774 cryptobyte: fix typo 'octects' into 'octets' for asn1.go
This typo ends up into lots of executables that trigger 'codespell'-style linter checks.

Change-Id: I2a7e3a6597272ca7c97ebddc54c5eef4cb5cab88
GitHub-Last-Rev: e42f734f00aa575030b72dd1e328d2acefb02625
GitHub-Pull-Request: golang/crypto#310
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/646375
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2025-03-17 08:22:34 -07:00
Mateusz Poliwczak acbcbef23f acme: remove unnecessary []byte conversion
Change-Id: Iddbe6bcb7a5487678c48df65903571b4625fc9f9
GitHub-Last-Rev: 2552a8d99c7472f029d7da270fa814398793b564
GitHub-Pull-Request: golang/crypto#243
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/456438
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
2025-03-17 08:22:03 -07:00
Roland Shoemaker 376eb14006 x509roots: support constrained roots
Adds support for roots with the distrust-after bit set. The constraint
function construction is a little funky, but I couldn't think of an
obvious better way to do it.

Fixes golang/go#70777
Fixes golang/go#70623

Change-Id: I780f866416b626360eaee9368185768da7bc75ef
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/652996
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-03-13 16:44:06 -07:00
Xiaolin Zhao b369b723c8 crypto/internal/poly1305: implement function update in assembly on loong64
The performance improvements on Loongson-3A5000 and Loongson-3A6000 are as follows:

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/internal/poly1305
cpu: Loongson-3A5000 @ 2500.00MHz
                 |  bench.old   |              bench.new              |
                 |    sec/op    |   sec/op     vs base                |
64                  122.8n ± 0%   100.0n ± 0%  -18.57% (p=0.000 n=10)
1K                 1152.0n ± 0%   732.2n ± 0%  -36.44% (p=0.000 n=10)
2M                  2.356m ± 0%   1.443m ± 0%  -38.74% (p=0.000 n=10)
64Unaligned         122.7n ± 0%   101.5n ± 0%  -17.24% (p=0.000 n=10)
1KUnaligned        1152.0n ± 0%   745.4n ± 0%  -35.30% (p=0.000 n=10)
2MUnaligned         2.336m ± 0%   1.473m ± 0%  -36.94% (p=0.000 n=10)
Write64             77.92n ± 0%   54.88n ± 0%  -29.57% (p=0.000 n=10)
Write1K            1106.0n ± 0%   683.3n ± 0%  -38.22% (p=0.000 n=10)
Write2M             2.356m ± 0%   1.444m ± 0%  -38.72% (p=0.000 n=10)
Write64Unaligned    77.87n ± 0%   55.69n ± 0%  -28.49% (p=0.000 n=10)
Write1KUnaligned   1106.0n ± 0%   708.1n ± 0%  -35.97% (p=0.000 n=10)
Write2MUnaligned    2.335m ± 0%   1.471m ± 0%  -37.01% (p=0.000 n=10)
geomean             6.373µ        4.272µ       -32.96%

                 |  bench.old   |               bench.new               |
                 |     B/s      |      B/s       vs base                |
64                 497.1Mi ± 0%    610.3Mi ± 0%  +22.78% (p=0.000 n=10)
1K                 847.6Mi ± 0%   1333.7Mi ± 0%  +57.35% (p=0.000 n=10)
2M                 849.0Mi ± 0%   1385.9Mi ± 0%  +63.24% (p=0.000 n=10)
64Unaligned        497.4Mi ± 0%    600.9Mi ± 0%  +20.81% (p=0.000 n=10)
1KUnaligned        847.6Mi ± 0%   1310.1Mi ± 0%  +54.57% (p=0.000 n=10)
2MUnaligned        856.3Mi ± 0%   1357.9Mi ± 0%  +58.58% (p=0.000 n=10)
Write64            783.3Mi ± 0%   1112.2Mi ± 0%  +41.99% (p=0.000 n=10)
Write1K            882.8Mi ± 0%   1429.1Mi ± 0%  +61.88% (p=0.000 n=10)
Write2M            849.0Mi ± 0%   1385.4Mi ± 0%  +63.18% (p=0.000 n=10)
Write64Unaligned   783.8Mi ± 0%   1096.1Mi ± 0%  +39.85% (p=0.000 n=10)
Write1KUnaligned   882.8Mi ± 0%   1379.0Mi ± 0%  +56.20% (p=0.000 n=10)
Write2MUnaligned   856.5Mi ± 0%   1359.9Mi ± 0%  +58.76% (p=0.000 n=10)
geomean            772.2Mi         1.125Gi       +49.18%

goos: linux
goarch: loong64
pkg: golang.org/x/crypto/internal/poly1305
cpu: Loongson-3A6000-HV @ 2500.00MHz
                 |  bench.old  |              bench.new              |
                 |   sec/op    |   sec/op     vs base                |
64                 92.06n ± 0%   71.55n ± 0%  -22.28% (p=0.000 n=10)
1K                 998.4n ± 0%   607.7n ± 0%  -39.13% (p=0.000 n=10)
2M                 1.976m ± 0%   1.165m ± 0%  -41.07% (p=0.000 n=10)
64Unaligned        92.05n ± 0%   71.55n ± 0%  -22.27% (p=0.000 n=10)
1KUnaligned        998.3n ± 0%   607.6n ± 0%  -39.13% (p=0.000 n=10)
2MUnaligned        1.975m ± 0%   1.222m ± 0%  -38.11% (p=0.000 n=10)
Write64            65.24n ± 0%   45.23n ± 0%  -30.67% (p=0.000 n=10)
Write1K            970.8n ± 0%   577.6n ± 0%  -40.51% (p=0.000 n=10)
Write2M            1.965m ± 0%   1.163m ± 0%  -40.81% (p=0.000 n=10)
Write64Unaligned   65.24n ± 0%   45.24n ± 0%  -30.66% (p=0.000 n=10)
Write1KUnaligned   970.8n ± 0%   577.6n ± 0%  -40.50% (p=0.000 n=10)
Write2MUnaligned   1.965m ± 0%   1.222m ± 0%  -37.81% (p=0.000 n=10)
geomean            5.317µ        3.426µ       -35.58%

                 |   bench.old   |               bench.new               |
                 |      B/s      |      B/s       vs base                |
64                  663.0Mi ± 0%    853.1Mi ± 0%  +28.67% (p=0.000 n=10)
1K                  978.1Mi ± 0%   1606.9Mi ± 0%  +64.28% (p=0.000 n=10)
2M                 1012.0Mi ± 0%   1717.4Mi ± 0%  +69.70% (p=0.000 n=10)
64Unaligned         663.1Mi ± 0%    853.1Mi ± 0%  +28.65% (p=0.000 n=10)
1KUnaligned         978.2Mi ± 0%   1607.1Mi ± 0%  +64.29% (p=0.000 n=10)
2MUnaligned        1012.6Mi ± 0%   1636.2Mi ± 0%  +61.58% (p=0.000 n=10)
Write64             935.5Mi ± 0%   1349.3Mi ± 0%  +44.23% (p=0.000 n=10)
Write1K            1005.9Mi ± 0%   1690.9Mi ± 0%  +68.09% (p=0.000 n=10)
Write2M            1017.7Mi ± 0%   1719.5Mi ± 0%  +68.95% (p=0.000 n=10)
Write64Unaligned    935.6Mi ± 0%   1349.3Mi ± 0%  +44.22% (p=0.000 n=10)
Write1KUnaligned   1006.0Mi ± 0%   1690.9Mi ± 0%  +68.08% (p=0.000 n=10)
Write2MUnaligned   1017.7Mi ± 0%   1636.4Mi ± 0%  +60.80% (p=0.000 n=10)
geomean             925.6Mi         1.403Gi       +55.22%

Change-Id: If05a8bfc868b3e6f903ff169eed7a894af741f9b
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/638455
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
2025-03-11 17:59:26 -07:00
Carlos A Becker 6b853fbea3 ssh/knownhosts: check more than one key
I believe this fixes https://github.com/golang/go/issues/36126 .

The problem was that it was keeping only the first known key of each
type found.
If you have a server advertising multiple keys of the same type,
you might get a missmatch key error.

Per sshd(8) man page, it should allow reapeatable hosts with
different host keys, although it don't specify anything about
hosts being from different types:

"It is permissible (but not recommended) to have several lines or
different host keys for the same names.  This will inevitably happen when
short forms of host names from different domains are put in the file.  It
is possible that the files contain conflicting information;
authentication is accepted if valid information can be found from either
file."

So, this changes knownhosts behavior to accept any of the keys for a
given host, regardless of type.

Fixes #36126

Change-Id: I3450ff954259a403f2471082d013a5f79def0e16
GitHub-Last-Rev: 361bd2bcd20348956aaf114ef159a5350397eaf4
GitHub-Pull-Request: golang/crypto#254
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/478535
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
2025-03-06 10:51:46 -08:00
Gopher Robot 49bf5b80c8 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: Ieae7a2d210a65d5cd2cb7e2670d283176922c767
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/655018
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-03-05 09:04:21 -08:00
Ilia Mirkin 24852b6b3f ssh: add decode support for banners
These banners can be printed when enabling debugHandshake, add decode
support so that they're not printed as unknown messages.

Change-Id: Ic8d56079d8225c35aac843accdbc80a642dd6249
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/650635
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-03-03 11:16:37 -08:00
cuishuang bbc689cf5c ssh: use a more straightforward return value
Change-Id: Ie5ee95efe4924f75719087c6fe8d4867607934bf
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/653198
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2025-02-28 12:03:19 -08:00
Nicola Murino 7292932d45 ssh: limit the size of the internal packet queue while waiting for KEX
In the SSH protocol, clients and servers execute the key exchange to
generate one-time session keys used for encryption and authentication.
The key exchange is performed initially after the connection is
established and then periodically after a configurable amount of data.
While a key exchange is in progress, we add the received packets to an
internal queue until we receive SSH_MSG_KEXINIT from the other side.
This can result in high memory usage if the other party is slow to
respond to the SSH_MSG_KEXINIT packet, or memory exhaustion if a
malicious client never responds to an SSH_MSG_KEXINIT packet during a
large file transfer.
We now limit the internal queue to 64 packets: this means 2MB with the
typical 32KB packet size.
When the internal queue is full we block further writes until the
pending key exchange is completed or there is a read or write error.

Thanks to Yuichi Watanabe for reporting this issue.

Change-Id: I1ce2214cc16e08b838d4bc346c74c72addafaeec
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/652135
Reviewed-by: Neal Patel <nealpatel@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-02-24 09:39:25 -08:00
Roland Shoemaker f66f74b0a4 acme/autocert: check host policy before probing the cache
Avoid unnessecary cache probes for names that don't match the host
policy.

Fixes golang/go#71199

Change-Id: I11e8465b0416e960a549b0c0d74a622026c39931
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/651296
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2025-02-21 16:31:38 -08:00
Dmitri Shuralyov b0784b7bfb x509roots/fallback: drop obsolete build constraint
Back when Go 1.20 and 1.19 were supported, the go1.20 build constraint
was there to establish 1.20 as the minimum for the package, because it
requires an API that was added only in Go 1.20 and there was no way to
make it work with 1.19's APIs.

By now only Go 1.24 and 1.23 are supported, and the minimum is set via
the go directive in go.mod.

For golang/go#57792.

Change-Id: Ie4d37d34993374cdd380667930ee667af97eeccb
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/649716
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-02-21 09:26:01 -08:00
Roland Shoemaker 911360c8a4 all: bump golang.org/x/crypto dependencies of asm generators
Change-Id: Ieb2f0d45f82647978f0bd1eb47bb347f0bfb7d13
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/649499
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-02-14 15:32:41 -08:00
Gopher Robot 89ff08d67c all: upgrade go directive to at least 1.23.0 [generated]
By now Go 1.24.0 has been released, and Go 1.22 is no longer supported
per the Go Release Policy (https://go.dev/doc/devel/release#policy).

For golang/go#69095.

[git-generate]
(cd . && go get go@1.23.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none)
(cd x509roots/fallback && go get go@1.23.0 && go mod tidy && go fix ./... && go mod edit -toolchain=none)

Change-Id: I879bced994b310927c41f820ec272a518aa0c8a5
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/649715
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-02-14 12:15:19 -08:00
Sean Liao e47973b1c1 all: update certs for go1.24
Fixes golang/go#71612

Change-Id: I5cb0596b33cb18016eb1883d1518319588ae1454
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/647975
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
2025-02-10 08:33:42 -08:00
Gopher Robot 9290511cd2 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: Ib9440df43bc2fde0268cbe327c1df839e793f675
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/646220
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-02-04 11:03:03 -08:00
Gopher Robot fa5273e461 x509roots/fallback: update bundle
This is an automated CL which updates the NSS root bundle.

Change-Id: I3a4388574221a77486b184e73f4b776ff0afc09f
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/646215
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2025-02-03 08:51:27 -08:00
Brad Fitzpatrick a8ea4be81f ssh: add ServerConfig.PreAuthConnCallback, ServerPreAuthConn (banner) interface
Fixes golang/go#68688

Change-Id: Id5f72b32c61c9383a26ec182339486a432c7cdf5
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/613856
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2025-01-18 11:27:23 -08:00
Evgeny Shatokhin 71d3a4cfdb acme: support challenges that require the ACME client to send a non-empty JSON body in a response to the challenge.
A new extension to the ACME protocol is proposed to support device attestation: https://datatracker.ietf.org/doc/draft-acme-device-attest/
Based on the recent IETF meetings, the proposal is likely to be accepted.
To support the new extension, the ACME client will need to send a non-empty JSON body in the response to a "device-attest-01" challenge.
Fixes golang/go#68674

Change-Id: I29b420ec837f682e3d59071a4a82af56dc319134
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/608975
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
2025-01-16 08:17:40 -08:00
Gopher Robot 8929309228 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I86bc4657bf10e469231536cff39cbdb86c1135c7
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/640455
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2025-01-06 06:44:30 -08:00
cuishuang 4a75ba54c2 all: make function and struct comments match the names
Change-Id: Iba9c1fc2895adca0d3455f8068b040d0ca006408
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/639575
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
2025-01-02 08:15:46 -08:00
Roland Shoemaker b4f1988a35 ssh: make the public key cache a 1-entry FIFO cache
Users of the the ssh package seem to extremely commonly misuse the
PublicKeyCallback API, assuming that the key passed in the last call
before a connection is established is the key used for authentication.
Some users then make authorization decisions based on this key. This
property is not documented, and may not be correct, due to the caching
behavior of the package, resulting in users making incorrect
authorization decisions about the connection.

This change makes the cache a one entry FIFO cache, making the assumed
property, that the last call to PublicKeyCallback represents the key
actually used for authentication, actually hold.

Thanks to Damien Tournoud, Patrick Dawkins, Vince Parker, and
Jules Duvivier from the Platform.sh / Upsun engineering team
for reporting this issue.

Fixes golang/go#70779
Fixes CVE-2024-45337

Change-Id: Ife7c7b4045d8b6bcd7e3a417bdfae370c709797f
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/635315
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-12-11 09:50:49 -08:00
Roland Shoemaker 7042ebcbe0 openpgp/clearsign: just use rand.Reader in tests
Instead of a convoluted fake rand, it is _basically_ just as fast, and
fixes errors that pop up due to bad entropy.

Fixes golang/go#70682

Change-Id: Ib0f605398d1092b516b03135f602c644be2a060f
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/633655
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2024-12-04 19:36:17 +00:00
Gopher Robot 3e90321ac7 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: I580d412fc4a135696d4054f8007593cfa4f64224
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/633480
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
2024-12-04 16:35:48 +00:00
Gopher Robot 8c4e668694 x509roots/fallback: update bundle
This is an automated CL which updates the NSS root bundle.

Change-Id: Ic5267bf9d66b676e1cfc5fc2ae153afb8f33b29c
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/631635
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-27 18:44:53 +00:00
Gopher Robot 6018723c74 go.mod: update golang.org/x dependencies
Update golang.org/x dependencies to their latest tagged versions.

Change-Id: Ib4976eb0b062bcd71c208afc9ff53e8c3068fbf9
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/626377
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-11-07 22:54:53 +00:00
Ian Lance Taylor 71ed71b4fa README: don't recommend go get
These days people will just import the packages and the go tool will
do the right thing. We don't need to explain it.

Add a pointer to the git repo, though.

For golang/go#62645

Change-Id: I8b1e4a877bd83fe6891688a44d27a6c7902c8979
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/624155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2024-11-04 00:10:25 +00:00
Filippo Valsorda 750a45fe5e sha3: add MarshalBinary, AppendBinary, and UnmarshalBinary
Fixes golang/go#24617

Change-Id: I1d9d529950aa8a5953435e8d3412cda44b075d55
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/616635
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
2024-10-22 19:51:02 +00:00
Filippo Valsorda 36b172546b sha3: avoid trailing permutation
If you read a multiple of the rate, and then stop, there is no point in
running the final permutation.

Change-Id: Ic95e70f78b6e139aca1d3e3c11e09d2bbcf54f6c
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/620555
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
2024-10-22 19:50:23 +00:00
Filippo Valsorda 80ea76eb17 sha3: fix padding for long cSHAKE parameters
We used to compute the incorrect value if len(initBlock) % rate == 0.

Also, add a test vector for golang/go#66232, confirmed to fail on
GOARCH=386 without CL 570876.

Fixes golang/go#69169

Change-Id: I3f2400926fca111dd0ca1327d6b5975e51b28f96
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/616576
Reviewed-by: Andrew Ekstedt <andrew.ekstedt@gmail.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2024-10-22 19:50:19 +00:00
Filippo Valsorda c17aa50fbd sha3: avoid buffer copy
Previously, the package worked by copying the input (or the output) into
a buffer, and then XOR'ing (or copying) it into (or out of) the state.
(Except for an input fast path.) There's no need for that! We can XOR
straight into the state, and copy straight out of it, at least on little
endian machines. This is a bit faster, almost halves the state size, and
will make it easier to implement marshaling, but most importantly look
at how much simpler it makes the code!

go: go1.23.0
goos: linux
goarch: amd64
pkg: golang.org/x/crypto/sha3
cpu: AMD Ryzen 7 PRO 8700GE w/ Radeon 780M Graphics
                      │ v0.27.0-2-g42ee18b9637 │    v0.27.0-2-g42ee18b9637-dirty    │
                      │         sec/op         │   sec/op     vs base               │
PermutationFunction-8              270.8n ± 0%   270.4n ± 0%       ~ (p=0.099 n=10)
Sha3_512_MTU-8                     5.762µ ± 0%   5.658µ ± 0%  -1.80% (p=0.000 n=10)
Sha3_384_MTU-8                     4.179µ ± 0%   4.070µ ± 0%  -2.60% (p=0.000 n=10)
Sha3_256_MTU-8                     3.316µ ± 0%   3.214µ ± 0%  -3.08% (p=0.000 n=10)
Sha3_224_MTU-8                     3.175µ ± 0%   3.061µ ± 0%  -3.61% (p=0.000 n=10)
Shake128_MTU-8                     2.779µ ± 0%   2.681µ ± 0%  -3.51% (p=0.000 n=10)
Shake256_MTU-8                     2.947µ ± 0%   2.957µ ± 0%  +0.32% (p=0.000 n=10)
Shake256_16x-8                     44.15µ ± 0%   44.45µ ± 0%  +0.67% (p=0.000 n=10)
Shake256_1MiB-8                    2.319m ± 0%   2.274m ± 0%  -1.93% (p=0.000 n=10)
Sha3_512_1MiB-8                    4.204m ± 0%   4.219m ± 0%  +0.34% (p=0.000 n=10)
geomean                            13.75µ        13.54µ       -1.55%

                      │ v0.27.0-2-g42ee18b9637 │    v0.27.0-2-g42ee18b9637-dirty     │
                      │          B/s           │     B/s       vs base               │
PermutationFunction-8             704.3Mi ± 0%   705.4Mi ± 0%       ~ (p=0.105 n=10)
Sha3_512_MTU-8                    223.5Mi ± 0%   227.6Mi ± 0%  +1.83% (p=0.000 n=10)
Sha3_384_MTU-8                    308.1Mi ± 0%   316.4Mi ± 0%  +2.67% (p=0.000 n=10)
Sha3_256_MTU-8                    388.2Mi ± 0%   400.5Mi ± 0%  +3.17% (p=0.000 n=10)
Sha3_224_MTU-8                    405.5Mi ± 0%   420.7Mi ± 0%  +3.73% (p=0.000 n=10)
Shake128_MTU-8                    463.4Mi ± 0%   480.2Mi ± 0%  +3.64% (p=0.000 n=10)
Shake256_MTU-8                    436.9Mi ± 0%   435.5Mi ± 0%  -0.32% (p=0.000 n=10)
Shake256_16x-8                    353.9Mi ± 0%   351.5Mi ± 0%  -0.66% (p=0.000 n=10)
Shake256_1MiB-8                   431.2Mi ± 0%   439.7Mi ± 0%  +1.97% (p=0.000 n=10)
Sha3_512_1MiB-8                   237.8Mi ± 0%   237.1Mi ± 0%  -0.33% (p=0.000 n=10)
geomean                           375.7Mi        381.6Mi       +1.57%

Even stronger effect when patched on top of CL 616555 (forced on).

go: go1.23.0
goos: darwin
goarch: arm64
pkg: golang.org/x/crypto/sha3
cpu: Apple M2
                      │    old    │               new                   │
                      │   sec/op  │     sec/op     vs base              │
PermutationFunction-8   154.7n ± 2%   153.8n ± 1%        ~ (p=0.469 n=10)
Sha3_512_MTU-8          3.260µ ± 2%   3.143µ ± 2%   -3.60% (p=0.000 n=10)
Sha3_384_MTU-8          2.389µ ± 2%   2.244µ ± 2%   -6.07% (p=0.000 n=10)
Sha3_256_MTU-8          1.950µ ± 2%   1.758µ ± 1%   -9.87% (p=0.000 n=10)
Sha3_224_MTU-8          1.874µ ± 2%   1.686µ ± 1%  -10.06% (p=0.000 n=10)
Shake128_MTU-8          1.827µ ± 3%   1.447µ ± 1%  -20.80% (p=0.000 n=10)
Shake256_MTU-8          1.665µ ± 3%   1.604µ ± 3%   -3.63% (p=0.003 n=10)
Shake256_16x-8          25.14µ ± 1%   25.23µ ± 2%        ~ (p=0.912 n=10)
Shake256_1MiB-8         1.236m ± 2%   1.243m ± 2%        ~ (p=0.631 n=10)
Sha3_512_1MiB-8         2.296m ± 2%   2.305m ± 1%        ~ (p=0.315 n=10)
geomean                 7.906µ        7.467µ        -5.56%

                      │    old    │               new                   │
                      │    B/op   │      B/op      vs base              │
PermutationFunction-8   1.204Gi ± 2%   1.212Gi ± 1%        ~ (p=0.529 n=10)
Sha3_512_MTU-8          394.9Mi ± 2%   409.7Mi ± 2%   +3.73% (p=0.000 n=10)
Sha3_384_MTU-8          539.0Mi ± 2%   573.8Mi ± 2%   +6.45% (p=0.000 n=10)
Sha3_256_MTU-8          660.3Mi ± 2%   732.6Mi ± 1%  +10.95% (p=0.000 n=10)
Sha3_224_MTU-8          687.1Mi ± 2%   763.9Mi ± 1%  +11.17% (p=0.000 n=10)
Shake128_MTU-8          704.7Mi ± 2%   889.6Mi ± 2%  +26.24% (p=0.000 n=10)
Shake256_MTU-8          773.4Mi ± 3%   802.5Mi ± 3%   +3.76% (p=0.004 n=10)
Shake256_16x-8          621.6Mi ± 1%   619.3Mi ± 2%        ~ (p=0.912 n=10)
Shake256_1MiB-8         809.1Mi ± 2%   804.7Mi ± 2%        ~ (p=0.631 n=10)
Sha3_512_1MiB-8         435.6Mi ± 2%   433.9Mi ± 1%        ~ (p=0.315 n=10)
geomean                 653.6Mi        692.0Mi        +5.88%

Change-Id: I33a0a1ddf305c395f99bf17f81473e2f42c5ce42
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/616575
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Andrew Ekstedt <andrew.ekstedt@gmail.com>
2024-10-21 19:02:20 +00:00
samiponkanen 7cfb9161e8 ssh: return unexpected msg error when server fails keyboard-interactive auth early
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&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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Nicola Murino <nicola.murino@gmail.com>
Reviewed-by: Nicola Murino <nicola.murino@gmail.com>
2024-10-16 07:16:19 +00:00
Paul E. Murphy b61b08db44 chacha20: extend ppc64le support to ppc64
This requires fixing an incorrect save of the counter. It is a word
value. It happens to work on LE because length is limited to u32.

Refactor the constant table to load correctly independent of byte
ordering.

Add byte order swapping where output needs converted to LE
ordering for storage.

Change-Id: Ic7e09bd1c769bb77dd6e817f5a8639ba765f4c0f
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/614297
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Archana Ravindar <aravinda@redhat.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-10-11 17:09:09 +00:00
Paul E. Murphy 6c21748958 internal/poly1305: extend ppc64le support to ppc64
The cipher needs to load the stream in LE order. Use the byte
reversing loads on BE.

Also, remove the unused variable poly1305Mask in the PPC64
asm file too.

Change-Id: Ie90fe7bb0ea7a3bcb76583e0cf9c1e4133499541
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/614298
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Archana Ravindar <aravinda@redhat.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2024-10-04 20:59:56 +00:00
141 changed files with 20036 additions and 5426 deletions
+5 -8
View File
@@ -2,20 +2,17 @@
[![Go Reference](https://pkg.go.dev/badge/golang.org/x/crypto.svg)](https://pkg.go.dev/golang.org/x/crypto)
This repository holds supplementary Go cryptography libraries.
## Download/Install
The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You
can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`.
This repository holds supplementary Go cryptography packages.
## Report Issues / Send Patches
This repository uses Gerrit for code changes. To learn how to submit changes to
this repository, see https://golang.org/doc/contribute.html.
this repository, see https://go.dev/doc/contribute.
The git repository is https://go.googlesource.com/crypto.
The main issue tracker for the crypto repository is located at
https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the
https://go.dev/issues. Prefix your issue with "x/crypto:" in the
subject line, so it is easy to find.
Note that contributions to the cryptography package receive additional scrutiny
+45 -55
View File
@@ -31,12 +31,11 @@ import (
"crypto/x509/pkix"
"encoding/asn1"
"encoding/base64"
"encoding/hex"
"encoding/json"
"encoding/pem"
"errors"
"fmt"
"math/big"
"net"
"net/http"
"strings"
"sync"
@@ -353,6 +352,10 @@ func (c *Client) authorize(ctx context.Context, typ, val string) (*Authorization
if _, err := c.Discover(ctx); err != nil {
return nil, err
}
if c.dir.AuthzURL == "" {
// Pre-Authorization is unsupported
return nil, errPreAuthorizationNotSupported
}
type authzID struct {
Type string `json:"type"`
@@ -467,7 +470,7 @@ func (c *Client) WaitAuthorization(ctx context.Context, url string) (*Authorizat
// while waiting for a final authorization status.
d := retryAfter(res.Header.Get("Retry-After"))
if d == 0 {
// Given that the fastest challenges TLS-SNI and HTTP-01
// Given that the fastest challenges TLS-ALPN and HTTP-01
// require a CA to make at least 1 network round trip
// and most likely persist a challenge state,
// this default delay seems reasonable.
@@ -514,7 +517,11 @@ func (c *Client) Accept(ctx context.Context, chal *Challenge) (*Challenge, error
return nil, err
}
res, err := c.post(ctx, nil, chal.URI, json.RawMessage("{}"), wantStatus(
payload := json.RawMessage("{}")
if len(chal.Payload) != 0 {
payload = chal.Payload
}
res, err := c.post(ctx, nil, chal.URI, payload, wantStatus(
http.StatusOK, // according to the spec
http.StatusAccepted, // Let's Encrypt: see https://goo.gl/WsJ7VT (acme-divergences.md)
))
@@ -564,50 +571,28 @@ func (c *Client) HTTP01ChallengePath(token string) string {
}
// TLSSNI01ChallengeCert creates a certificate for TLS-SNI-01 challenge response.
// Always returns an error.
//
// Deprecated: This challenge type is unused in both draft-02 and RFC versions of the ACME spec.
func (c *Client) TLSSNI01ChallengeCert(token string, opt ...CertOption) (cert tls.Certificate, name string, err error) {
ka, err := keyAuth(c.Key.Public(), token)
if err != nil {
return tls.Certificate{}, "", err
}
b := sha256.Sum256([]byte(ka))
h := hex.EncodeToString(b[:])
name = fmt.Sprintf("%s.%s.acme.invalid", h[:32], h[32:])
cert, err = tlsChallengeCert([]string{name}, opt)
if err != nil {
return tls.Certificate{}, "", err
}
return cert, name, nil
// Deprecated: This challenge type was only present in pre-standardized ACME
// protocol drafts and is insecure for use in shared hosting environments.
func (c *Client) TLSSNI01ChallengeCert(token string, opt ...CertOption) (tls.Certificate, string, error) {
return tls.Certificate{}, "", errPreRFC
}
// TLSSNI02ChallengeCert creates a certificate for TLS-SNI-02 challenge response.
// Always returns an error.
//
// Deprecated: This challenge type is unused in both draft-02 and RFC versions of the ACME spec.
func (c *Client) TLSSNI02ChallengeCert(token string, opt ...CertOption) (cert tls.Certificate, name string, err error) {
b := sha256.Sum256([]byte(token))
h := hex.EncodeToString(b[:])
sanA := fmt.Sprintf("%s.%s.token.acme.invalid", h[:32], h[32:])
ka, err := keyAuth(c.Key.Public(), token)
if err != nil {
return tls.Certificate{}, "", err
}
b = sha256.Sum256([]byte(ka))
h = hex.EncodeToString(b[:])
sanB := fmt.Sprintf("%s.%s.ka.acme.invalid", h[:32], h[32:])
cert, err = tlsChallengeCert([]string{sanA, sanB}, opt)
if err != nil {
return tls.Certificate{}, "", err
}
return cert, sanA, nil
// Deprecated: This challenge type was only present in pre-standardized ACME
// protocol drafts and is insecure for use in shared hosting environments.
func (c *Client) TLSSNI02ChallengeCert(token string, opt ...CertOption) (tls.Certificate, string, error) {
return tls.Certificate{}, "", errPreRFC
}
// TLSALPN01ChallengeCert creates a certificate for TLS-ALPN-01 challenge response.
// Servers can present the certificate to validate the challenge and prove control
// over a domain name. For more details on TLS-ALPN-01 see
// https://tools.ietf.org/html/draft-shoemaker-acme-tls-alpn-00#section-3
// over an identifier (either a DNS name or the textual form of an IPv4 or IPv6
// address). For more details on TLS-ALPN-01 see
// https://www.rfc-editor.org/rfc/rfc8737 and https://www.rfc-editor.org/rfc/rfc8738
//
// The token argument is a Challenge.Token value.
// If a WithKey option is provided, its private part signs the returned cert,
@@ -615,9 +600,13 @@ func (c *Client) TLSSNI02ChallengeCert(token string, opt ...CertOption) (cert tl
// If no WithKey option is provided, a new ECDSA key is generated using P-256 curve.
//
// The returned certificate is valid for the next 24 hours and must be presented only when
// the server name in the TLS ClientHello matches the domain, and the special acme-tls/1 ALPN protocol
// the server name in the TLS ClientHello matches the identifier, and the special acme-tls/1 ALPN protocol
// has been specified.
func (c *Client) TLSALPN01ChallengeCert(token, domain string, opt ...CertOption) (cert tls.Certificate, err error) {
//
// Validation requests for IP address identifiers will use the reverse DNS form in the server name
// in the TLS ClientHello since the SNI extension is not supported for IP addresses.
// See RFC 8738 Section 6 for more information.
func (c *Client) TLSALPN01ChallengeCert(token, identifier string, opt ...CertOption) (cert tls.Certificate, err error) {
ka, err := keyAuth(c.Key.Public(), token)
if err != nil {
return tls.Certificate{}, err
@@ -647,7 +636,7 @@ func (c *Client) TLSALPN01ChallengeCert(token, domain string, opt ...CertOption)
}
tmpl.ExtraExtensions = append(tmpl.ExtraExtensions, acmeExtension)
newOpt = append(newOpt, WithTemplate(tmpl))
return tlsChallengeCert([]string{domain}, newOpt)
return tlsChallengeCert(identifier, newOpt)
}
// popNonce returns a nonce value previously stored with c.addNonce
@@ -765,11 +754,15 @@ func defaultTLSChallengeCertTemplate() *x509.Certificate {
}
}
// tlsChallengeCert creates a temporary certificate for TLS-SNI challenges
// with the given SANs and auto-generated public/private key pair.
// The Subject Common Name is set to the first SAN to aid debugging.
// tlsChallengeCert creates a temporary certificate for TLS-ALPN challenges
// for the given identifier, using an auto-generated public/private key pair.
//
// If the provided identifier is a domain name, it will be used as a DNS type SAN and for the
// subject common name. If the provided identifier is an IP address it will be used as an IP type
// SAN.
//
// To create a cert with a custom key pair, specify WithKey option.
func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) {
func tlsChallengeCert(identifier string, opt []CertOption) (tls.Certificate, error) {
var key crypto.Signer
tmpl := defaultTLSChallengeCertTemplate()
for _, o := range opt {
@@ -793,9 +786,12 @@ func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) {
return tls.Certificate{}, err
}
}
tmpl.DNSNames = san
if len(san) > 0 {
tmpl.Subject.CommonName = san[0]
if ip := net.ParseIP(identifier); ip != nil {
tmpl.IPAddresses = []net.IP{ip}
} else {
tmpl.DNSNames = []string{identifier}
tmpl.Subject.CommonName = identifier
}
der, err := x509.CreateCertificate(rand.Reader, tmpl, tmpl, key.Public(), key)
@@ -808,11 +804,5 @@ func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) {
}, nil
}
// encodePEM returns b encoded as PEM with block of type typ.
func encodePEM(typ string, b []byte) []byte {
pb := &pem.Block{Type: typ, Bytes: b}
return pem.EncodeToMemory(pb)
}
// timeNow is time.Now, except in tests which can mess with it.
var timeNow = time.Now
+87 -111
View File
@@ -9,20 +9,18 @@ import (
"context"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/base64"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"math/big"
"net/http"
"net/http/httptest"
"reflect"
"sort"
"strings"
"testing"
"time"
)
@@ -254,6 +252,57 @@ func TestAuthorizeValid(t *testing.T) {
}
}
func TestAuthorizeUnsupported(t *testing.T) {
const (
nonce = "https://example.com/acme/new-nonce"
reg = "https://example.com/acme/new-acct"
order = "https://example.com/acme/new-order"
revoke = "https://example.com/acme/revoke-cert"
keychange = "https://example.com/acme/key-change"
metaTerms = "https://example.com/acme/terms/2017-5-30"
metaWebsite = "https://www.example.com/"
metaCAA = "example.com"
)
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Replay-Nonce", "nonce")
if r.Method == http.MethodHead {
return
}
switch r.URL.Path {
case "/": // Directory
w.Header().Set("Content-Type", "application/json")
fmt.Fprintf(w, `{
"newNonce": %q,
"newAccount": %q,
"newOrder": %q,
"revokeCert": %q,
"keyChange": %q,
"meta": {
"termsOfService": %q,
"website": %q,
"caaIdentities": [%q],
"externalAccountRequired": true
}
}`, nonce, reg, order, revoke, keychange, metaTerms, metaWebsite, metaCAA)
w.WriteHeader(http.StatusOK)
case "/acme/new-authz":
w.WriteHeader(http.StatusBadRequest)
}
}))
defer ts.Close()
client := &Client{Key: testKey, DirectoryURL: ts.URL}
dir, err := client.Discover(context.Background())
if err != nil {
t.Fatal(err)
}
if dir.AuthzURL != "" {
t.Fatalf("expected AuthzURL to be empty, got %q", dir.AuthzURL)
}
if _, err := client.Authorize(context.Background(), "example.com"); !errors.Is(err, errPreAuthorizationNotSupported) {
t.Errorf("expected err to indicate pre-authorization is unsupported, got %+v", err)
}
}
func TestWaitAuthorization(t *testing.T) {
t.Run("wait loop", func(t *testing.T) {
var count int
@@ -640,71 +689,6 @@ func TestLinkHeader(t *testing.T) {
}
}
func TestTLSSNI01ChallengeCert(t *testing.T) {
const (
token = "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA"
// echo -n <token.testKeyECThumbprint> | shasum -a 256
san = "dbbd5eefe7b4d06eb9d1d9f5acb4c7cd.a27d320e4b30332f0b6cb441734ad7b0.acme.invalid"
)
tlscert, name, err := newTestClient().TLSSNI01ChallengeCert(token)
if err != nil {
t.Fatal(err)
}
if n := len(tlscert.Certificate); n != 1 {
t.Fatalf("len(tlscert.Certificate) = %d; want 1", n)
}
cert, err := x509.ParseCertificate(tlscert.Certificate[0])
if err != nil {
t.Fatal(err)
}
if len(cert.DNSNames) != 1 || cert.DNSNames[0] != san {
t.Fatalf("cert.DNSNames = %v; want %q", cert.DNSNames, san)
}
if cert.DNSNames[0] != name {
t.Errorf("cert.DNSNames[0] != name: %q vs %q", cert.DNSNames[0], name)
}
if cn := cert.Subject.CommonName; cn != san {
t.Errorf("cert.Subject.CommonName = %q; want %q", cn, san)
}
}
func TestTLSSNI02ChallengeCert(t *testing.T) {
const (
token = "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA"
// echo -n evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA | shasum -a 256
sanA = "7ea0aaa69214e71e02cebb18bb867736.09b730209baabf60e43d4999979ff139.token.acme.invalid"
// echo -n <token.testKeyECThumbprint> | shasum -a 256
sanB = "dbbd5eefe7b4d06eb9d1d9f5acb4c7cd.a27d320e4b30332f0b6cb441734ad7b0.ka.acme.invalid"
)
tlscert, name, err := newTestClient().TLSSNI02ChallengeCert(token)
if err != nil {
t.Fatal(err)
}
if n := len(tlscert.Certificate); n != 1 {
t.Fatalf("len(tlscert.Certificate) = %d; want 1", n)
}
cert, err := x509.ParseCertificate(tlscert.Certificate[0])
if err != nil {
t.Fatal(err)
}
names := []string{sanA, sanB}
if !reflect.DeepEqual(cert.DNSNames, names) {
t.Fatalf("cert.DNSNames = %v;\nwant %v", cert.DNSNames, names)
}
sort.Strings(cert.DNSNames)
i := sort.SearchStrings(cert.DNSNames, name)
if i >= len(cert.DNSNames) || cert.DNSNames[i] != name {
t.Errorf("%v doesn't have %q", cert.DNSNames, name)
}
if cn := cert.Subject.CommonName; cn != sanA {
t.Errorf("CommonName = %q; want %q", cn, sanA)
}
}
func TestTLSALPN01ChallengeCert(t *testing.T) {
const (
token = "evaGxfADs6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA"
@@ -757,10 +741,11 @@ func TestTLSALPN01ChallengeCert(t *testing.T) {
}
func TestTLSChallengeCertOpt(t *testing.T) {
key, err := rsa.GenerateKey(rand.Reader, 512)
key, err := rsa.GenerateKey(rand.Reader, 1024)
if err != nil {
t.Fatal(err)
}
domain := "example.com"
tmpl := &x509.Certificate{
SerialNumber: big.NewInt(2),
Subject: pkix.Name{Organization: []string{"Test"}},
@@ -769,52 +754,43 @@ func TestTLSChallengeCertOpt(t *testing.T) {
opts := []CertOption{WithKey(key), WithTemplate(tmpl)}
client := newTestClient()
cert1, _, err := client.TLSSNI01ChallengeCert("token", opts...)
if err != nil {
t.Fatal(err)
}
cert2, _, err := client.TLSSNI02ChallengeCert("token", opts...)
cert, err := client.TLSALPN01ChallengeCert("token", domain, opts...)
if err != nil {
t.Fatal(err)
}
for i, tlscert := range []tls.Certificate{cert1, cert2} {
// verify generated cert private key
tlskey, ok := tlscert.PrivateKey.(*rsa.PrivateKey)
if !ok {
t.Errorf("%d: tlscert.PrivateKey is %T; want *rsa.PrivateKey", i, tlscert.PrivateKey)
continue
}
if tlskey.D.Cmp(key.D) != 0 {
t.Errorf("%d: tlskey.D = %v; want %v", i, tlskey.D, key.D)
}
// verify generated cert public key
x509Cert, err := x509.ParseCertificate(tlscert.Certificate[0])
if err != nil {
t.Errorf("%d: %v", i, err)
continue
}
tlspub, ok := x509Cert.PublicKey.(*rsa.PublicKey)
if !ok {
t.Errorf("%d: x509Cert.PublicKey is %T; want *rsa.PublicKey", i, x509Cert.PublicKey)
continue
}
if tlspub.N.Cmp(key.N) != 0 {
t.Errorf("%d: tlspub.N = %v; want %v", i, tlspub.N, key.N)
}
// verify template option
sn := big.NewInt(2)
if x509Cert.SerialNumber.Cmp(sn) != 0 {
t.Errorf("%d: SerialNumber = %v; want %v", i, x509Cert.SerialNumber, sn)
}
org := []string{"Test"}
if !reflect.DeepEqual(x509Cert.Subject.Organization, org) {
t.Errorf("%d: Subject.Organization = %+v; want %+v", i, x509Cert.Subject.Organization, org)
}
for _, v := range x509Cert.DNSNames {
if !strings.HasSuffix(v, ".acme.invalid") {
t.Errorf("%d: invalid DNSNames element: %q", i, v)
}
// verify generated cert private key
tlskey, ok := cert.PrivateKey.(*rsa.PrivateKey)
if !ok {
t.Fatalf("tlscert.PrivateKey is %T; want *rsa.PrivateKey", cert.PrivateKey)
}
if tlskey.D.Cmp(key.D) != 0 {
t.Errorf("tlskey.D = %v; want %v", tlskey.D, key.D)
}
// verify generated cert public key
x509Cert, err := x509.ParseCertificate(cert.Certificate[0])
if err != nil {
t.Fatal(err)
}
tlspub, ok := x509Cert.PublicKey.(*rsa.PublicKey)
if !ok {
t.Fatalf("x509Cert.PublicKey is %T; want *rsa.PublicKey", x509Cert.PublicKey)
}
if tlspub.N.Cmp(key.N) != 0 {
t.Errorf("tlspub.N = %v; want %v", tlspub.N, key.N)
}
// verify template option
sn := big.NewInt(2)
if x509Cert.SerialNumber.Cmp(sn) != 0 {
t.Errorf("SerialNumber = %v; want %v", x509Cert.SerialNumber, sn)
}
org := []string{"Test"}
if !reflect.DeepEqual(x509Cert.Subject.Organization, org) {
t.Errorf("Subject.Organization = %+v; want %+v", x509Cert.Subject.Organization, org)
}
for _, v := range x509Cert.DNSNames {
if v != domain {
t.Errorf("invalid DNSNames element: %q", v)
}
}
}
+4 -3
View File
@@ -292,6 +292,10 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
}
// regular domain
if err := m.hostPolicy()(ctx, name); err != nil {
return nil, err
}
ck := certKey{
domain: strings.TrimSuffix(name, "."), // golang.org/issue/18114
isRSA: !supportsECDSA(hello),
@@ -305,9 +309,6 @@ func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate,
}
// first-time
if err := m.hostPolicy()(ctx, name); err != nil {
return nil, err
}
cert, err = m.createCert(ctx, ck)
if err != nil {
return nil, err
+2 -2
View File
@@ -619,7 +619,7 @@ func TestCache(t *testing.T) {
PrivateKey: ecdsaKey,
}
rsaKey, err := rsa.GenerateKey(rand.Reader, 512)
rsaKey, err := rsa.GenerateKey(rand.Reader, 1024)
if err != nil {
t.Fatal(err)
}
@@ -694,7 +694,7 @@ func TestValidCert(t *testing.T) {
if err != nil {
t.Fatal(err)
}
key3, err := rsa.GenerateKey(rand.Reader, 512)
key3, err := rsa.GenerateKey(rand.Reader, 1024)
if err != nil {
t.Fatal(err)
}
-12
View File
@@ -782,15 +782,3 @@ func decodePayload(v interface{}, r io.Reader) error {
func challengeToken(domain, challType string, authzID int) string {
return fmt.Sprintf("token-%s-%s-%d", domain, challType, authzID)
}
func unique(a []string) []string {
seen := make(map[string]bool)
var res []string
for _, s := range a {
if s != "" && !seen[s] {
seen[s] = true
res = append(res, s)
}
}
return res
}
+6 -26
View File
@@ -10,7 +10,6 @@ import (
"net"
"os"
"path/filepath"
"runtime"
"time"
)
@@ -124,32 +123,13 @@ func (ln *listener) Close() error {
return ln.tcpListener.Close()
}
func homeDir() string {
if runtime.GOOS == "windows" {
return os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
}
if h := os.Getenv("HOME"); h != "" {
return h
}
return "/"
}
func cacheDir() string {
const base = "golang-autocert"
switch runtime.GOOS {
case "darwin":
return filepath.Join(homeDir(), "Library", "Caches", base)
case "windows":
for _, ev := range []string{"APPDATA", "CSIDL_APPDATA", "TEMP", "TMP"} {
if v := os.Getenv(ev); v != "" {
return filepath.Join(v, base)
}
}
// Worst case:
return filepath.Join(homeDir(), base)
cache, err := os.UserCacheDir()
if err != nil {
// Fall back to the root directory.
cache = "/.cache"
}
if xdg := os.Getenv("XDG_CACHE_HOME"); xdg != "" {
return filepath.Join(xdg, base)
}
return filepath.Join(homeDir(), ".cache", base)
return filepath.Join(cache, base)
}
+2 -5
View File
@@ -66,7 +66,7 @@ func (c *Client) retryTimer() *retryTimer {
// The n argument is always bounded between 1 and 30.
// The returned value is always greater than 0.
func defaultBackoff(n int, r *http.Request, res *http.Response) time.Duration {
const max = 10 * time.Second
const maxVal = 10 * time.Second
var jitter time.Duration
if x, err := rand.Int(rand.Reader, big.NewInt(1000)); err == nil {
// Set the minimum to 1ms to avoid a case where
@@ -86,10 +86,7 @@ func defaultBackoff(n int, r *http.Request, res *http.Response) time.Duration {
n = 30
}
d := time.Duration(1<<uint(n-1))*time.Second + jitter
if d > max {
return max
}
return d
return min(d, maxVal)
}
// retryAfter parses a Retry-After HTTP header value,
+1 -1
View File
@@ -92,7 +92,7 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid KeyID, nonce, ur
if err != nil {
return nil, err
}
phead := base64.RawURLEncoding.EncodeToString([]byte(phJSON))
phead := base64.RawURLEncoding.EncodeToString(phJSON)
var payload string
if val, ok := claimset.(string); ok {
payload = val
+809
View File
@@ -0,0 +1,809 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package acme_test
import (
"bytes"
"context"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"crypto/x509"
"encoding/json"
"encoding/pem"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
"net/http"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
"golang.org/x/crypto/acme"
)
const (
// pebbleModVersion is the module version used for Pebble and Pebble's
// challenge test server. It is ignored if `-pebble-local-dir` is provided.
pebbleModVersion = "v2.7.0"
// startingPort is the first port number used for binding interface
// addresses. Each call to takeNextPort() will increment a port number
// starting at this value.
startingPort = 5555
)
var (
pebbleLocalDir = flag.String(
"pebble-local-dir",
"",
"Local Pebble to use, instead of fetching from source",
)
nextPort atomic.Uint32
)
func init() {
nextPort.Store(startingPort)
}
func TestWithPebble(t *testing.T) {
// We want to use process groups w/ syscall.Kill, and the acme package
// is very platform-agnostic, so skip on non-Linux.
if runtime.GOOS != "linux" {
t.Skip("skipping pebble tests on non-linux OS")
}
if testing.Short() {
t.Skip("skipping pebble tests in short mode")
}
tests := []struct {
name string
challSrv func(*environment) (challengeServer, string)
}{
{
name: "TLSALPN01-Issuance",
challSrv: func(env *environment) (challengeServer, string) {
bindAddr := fmt.Sprintf(":%d", env.config.TLSPort)
return newChallTLSServer(bindAddr), bindAddr
},
},
{
name: "HTTP01-Issuance",
challSrv: func(env *environment) (challengeServer, string) {
bindAddr := fmt.Sprintf(":%d", env.config.HTTPPort)
return newChallHTTPServer(bindAddr), bindAddr
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
env := startPebbleEnvironment(t, nil)
challSrv, challSrvAddr := tt.challSrv(&env)
challSrv.Run()
t.Cleanup(func() {
challSrv.Shutdown()
})
waitForServer(t, challSrvAddr)
testIssuance(t, &env, challSrv)
})
}
}
// challengeServer abstracts over the details of running a challenge response
// server for some supported acme.Challenge type. Responses are provisioned
// during the test issuance process to be presented to the ACME server's
// validation authority.
type challengeServer interface {
Run()
Shutdown() error
Supported(chal *acme.Challenge) bool
Provision(client *acme.Client, ident acme.AuthzID, chal *acme.Challenge) error
}
// challTLSServer is a simple challenge response server that listens for TLS
// connections on a specific port and if they are TLS-ALPN-01 challenge
// requests, completes the handshake using the configured challenge response
// certificate for the SNI value provided.
type challTLSServer struct {
*http.Server
// mu protects challCerts.
mu sync.RWMutex
// challCerts is a map from SNI domain name to challenge response certificate.
challCerts map[string]*tls.Certificate
}
// https://datatracker.ietf.org/doc/html/rfc8737#section-4
const acmeTLSAlpnProtocol = "acme-tls/1"
func newChallTLSServer(address string) *challTLSServer {
challServer := &challTLSServer{Server: &http.Server{
Addr: address,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
}, challCerts: make(map[string]*tls.Certificate)}
// Configure the server to support the TLS-ALPN-01 challenge protocol
// and to use a callback for selecting the handshake certificate.
challServer.Server.TLSConfig = &tls.Config{
NextProtos: []string{acmeTLSAlpnProtocol},
GetCertificate: challServer.getCertificate,
}
return challServer
}
func (c *challTLSServer) Shutdown() error {
log.Printf("challTLSServer: shutting down")
ctx, cancel := context.WithTimeout(context.Background(), 10)
defer cancel()
return c.Server.Shutdown(ctx)
}
func (c *challTLSServer) Run() {
go func() {
// Note: certFile and keyFile are empty because our config uses a
// GetCertificate callback.
if err := c.Server.ListenAndServeTLS("", ""); err != nil {
if !errors.Is(err, http.ErrServerClosed) {
log.Printf("challTLSServer error: %v", err)
}
}
}()
}
func (c *challTLSServer) Supported(chal *acme.Challenge) bool {
return chal.Type == "tls-alpn-01"
}
func (c *challTLSServer) Provision(client *acme.Client, ident acme.AuthzID, chal *acme.Challenge) error {
respCert, err := client.TLSALPN01ChallengeCert(chal.Token, ident.Value)
if err != nil {
return fmt.Errorf("challTLSServer: failed to generate challlenge response cert for %s: %w",
ident.Value, err)
}
log.Printf("challTLSServer: setting challenge response certificate for %s", ident.Value)
c.mu.Lock()
defer c.mu.Unlock()
c.challCerts[ident.Value] = &respCert
return nil
}
func (c *challTLSServer) getCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) {
// Verify the request looks like a TLS-ALPN-01 challenge request.
if len(clientHello.SupportedProtos) != 1 || clientHello.SupportedProtos[0] != acmeTLSAlpnProtocol {
return nil, fmt.Errorf(
"challTLSServer: non-TLS-ALPN-01 challenge request received with SupportedProtos: %s",
clientHello.SupportedProtos)
}
serverName := clientHello.ServerName
// TLS-ALPN-01 challenge requests for IP addresses are encoded in the SNI
// using the reverse-DNS notation. See RFC 8738 Section 6:
// https://www.rfc-editor.org/rfc/rfc8738.html#section-6
if strings.HasSuffix(serverName, ".in-addr.arpa") {
serverName = strings.TrimSuffix(serverName, ".in-addr.arpa")
parts := strings.Split(serverName, ".")
for i, j := 0, len(parts)-1; i < j; i, j = i+1, j-1 {
parts[i], parts[j] = parts[j], parts[i]
}
serverName = strings.Join(parts, ".")
}
log.Printf("challTLSServer: selecting certificate for request from %s for %s",
clientHello.Conn.RemoteAddr(), serverName)
c.mu.RLock()
defer c.mu.RUnlock()
cert := c.challCerts[serverName]
if cert == nil {
return nil, fmt.Errorf("challTLSServer: no challenge response certificate configured for %s", serverName)
}
return cert, nil
}
// challHTTPServer is a simple challenge response server that listens for HTTP
// connections on a specific port and if they are HTTP-01 challenge requests,
// serves the challenge response key authorization.
type challHTTPServer struct {
*http.Server
// mu protects challMap
mu sync.RWMutex
// challMap is a mapping from request path to response body.
challMap map[string]string
}
func newChallHTTPServer(address string) *challHTTPServer {
challServer := &challHTTPServer{
Server: &http.Server{
Addr: address,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
},
challMap: make(map[string]string),
}
challServer.Server.Handler = challServer
return challServer
}
func (c *challHTTPServer) Supported(chal *acme.Challenge) bool {
return chal.Type == "http-01"
}
func (c *challHTTPServer) Provision(client *acme.Client, ident acme.AuthzID, chall *acme.Challenge) error {
path := client.HTTP01ChallengePath(chall.Token)
body, err := client.HTTP01ChallengeResponse(chall.Token)
if err != nil {
return fmt.Errorf("failed to generate HTTP-01 challenge response for %v challenge %s token %s: %w",
ident, chall.URI, chall.Token, err)
}
c.mu.Lock()
defer c.mu.Unlock()
log.Printf("challHTTPServer: setting challenge response for %s", path)
c.challMap[path] = body
return nil
}
func (c *challHTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
log.Printf("challHTTPServer: handling %s to %s from %s", r.Method, r.URL.Path, r.RemoteAddr)
if r.Method != http.MethodGet {
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
return
}
c.mu.RLock()
defer c.mu.RUnlock()
response, exists := c.challMap[r.URL.Path]
if !exists {
http.NotFound(w, r)
return
}
w.Header().Set("Content-Type", "text/plain")
w.Write([]byte(response))
}
func (c *challHTTPServer) Shutdown() error {
log.Printf("challHTTPServer: shutting down")
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
return c.Server.Shutdown(ctx)
}
func (c *challHTTPServer) Run() {
go func() {
if err := c.Server.ListenAndServe(); err != nil {
if !errors.Is(err, http.ErrServerClosed) {
log.Printf("challHTTPServer error: %v", err)
}
}
}()
}
func testIssuance(t *testing.T, env *environment, challSrv challengeServer) {
t.Helper()
// Bound the total issuance process by a timeout of 60 seconds.
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
// Create a new ACME account.
client := env.client
acct, err := client.Register(ctx, &acme.Account{}, acme.AcceptTOS)
if err != nil {
t.Fatalf("failed to register account: %v", err)
}
if acct.Status != acme.StatusValid {
t.Fatalf("expected new account status to be valid, got %v", acct.Status)
}
log.Printf("registered account: %s", acct.URI)
// Create a new order for some example identifiers
identifiers := []acme.AuthzID{
{
Type: "dns",
Value: "example.com",
},
{
Type: "dns",
Value: "www.example.com",
},
{
Type: "ip",
Value: "127.0.0.1",
},
}
order, err := client.AuthorizeOrder(ctx, identifiers)
if err != nil {
t.Fatalf("failed to create order for %v: %v", identifiers, err)
}
if order.Status != acme.StatusPending {
t.Fatalf("expected new order status to be pending, got %v", order.Status)
}
orderURL := order.URI
log.Printf("created order: %v", orderURL)
// For each pending authz provision a supported challenge type's response
// with the test challenge server, and tell the ACME server to verify it.
for _, authzURL := range order.AuthzURLs {
authz, err := client.GetAuthorization(ctx, authzURL)
if err != nil {
t.Fatalf("failed to get order %s authorization %s: %v",
orderURL, authzURL, err)
}
if authz.Status != acme.StatusPending {
continue
}
for _, challenge := range authz.Challenges {
if challenge.Status != acme.StatusPending || !challSrv.Supported(challenge) {
continue
}
if err := challSrv.Provision(client, authz.Identifier, challenge); err != nil {
t.Fatalf("failed to provision challenge %s: %v", challenge.URI, err)
}
_, err = client.Accept(ctx, challenge)
if err != nil {
t.Fatalf("failed to accept order %s challenge %s: %v",
orderURL, challenge.URI, err)
}
}
}
// Wait for the order to become ready for finalization.
order, err = client.WaitOrder(ctx, order.URI)
if err != nil {
var orderErr *acme.OrderError
if errors.Is(err, orderErr) {
t.Fatalf("failed to wait for order %s: %s: %s", orderURL, err, orderErr.Problem)
} else {
t.Fatalf("failed to wait for order %s: %s", orderURL, err)
}
}
if order.Status != acme.StatusReady {
t.Fatalf("expected order %s status to be ready, got %v",
orderURL, order.Status)
}
// Generate a certificate keypair and a CSR for the order identifiers.
certKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
t.Fatalf("failed to generate certificate key: %v", err)
}
var dnsNames []string
var ipAddresses []net.IP
for _, ident := range identifiers {
switch ident.Type {
case "dns":
dnsNames = append(dnsNames, ident.Value)
case "ip":
ipAddresses = append(ipAddresses, net.ParseIP(ident.Value))
default:
t.Fatalf("unsupported identifier type: %s", ident.Type)
}
}
csrDer, err := x509.CreateCertificateRequest(rand.Reader, &x509.CertificateRequest{
DNSNames: dnsNames,
IPAddresses: ipAddresses,
}, certKey)
if err != nil {
t.Fatalf("failed to create CSR: %v", err)
}
// Finalize the order by creating a certificate with our CSR.
chain, _, err := client.CreateOrderCert(ctx, order.FinalizeURL, csrDer, true)
if err != nil {
t.Fatalf("failed to finalize order %s with finalize URL %s: %v",
orderURL, order.FinalizeURL, err)
}
// Split the chain into the leaf and any intermediates.
leaf := chain[0]
intermediatesDER := chain[1:]
leafCert, err := x509.ParseCertificate(leaf)
if err != nil {
t.Fatalf("failed to parse order %s leaf certificate: %v", orderURL, err)
}
intermediates := x509.NewCertPool()
for i, intermediateDER := range intermediatesDER {
intermediate, err := x509.ParseCertificate(intermediateDER)
if err != nil {
t.Fatalf("failed to parse intermediate %d: %v", i, err)
}
intermediates.AddCert(intermediate)
}
// Verify there is a valid path from the leaf certificate to Pebble's
// issuing root using the provided intermediate certificates.
roots, err := env.RootCert()
if err != nil {
t.Fatalf("failed to get Pebble issuer root certs: %v", err)
}
paths, err := leafCert.Verify(x509.VerifyOptions{
Intermediates: intermediates,
Roots: roots,
})
if err != nil {
t.Fatalf("failed to verify order %s leaf certificate: %v", orderURL, err)
}
log.Printf("verified %d path(s) from issued leaf certificate to Pebble root CA", len(paths))
// Also verify that the leaf cert is valid for each of the DNS names
// and IP addresses from our order's identifiers.
for _, name := range dnsNames {
if err := leafCert.VerifyHostname(name); err != nil {
t.Fatalf("failed to verify order %s leaf certificate for order DNS name %s: %v",
orderURL, name, err)
}
}
for _, ip := range ipAddresses {
if err := leafCert.VerifyHostname(ip.String()); err != nil {
t.Fatalf("failed to verify order %s leaf certificate for order IP address %s: %v",
orderURL, ip, err)
}
}
}
type environment struct {
config *environmentConfig
client *acme.Client
}
// RootCert returns the Pebble CA's primary issuing hierarchy root certificate.
// This is generated randomly at each startup and can be used to verify
// certificate chains issued by Pebble's ACME interface. Note that this
// is separate from the static root certificate used by the Pebble ACME
// HTTPS interface.
func (e *environment) RootCert() (*x509.CertPool, error) {
// NOTE: in the future we may want to consider the alternative chains
// returned as Link alternative headers.
rootURL := fmt.Sprintf("https://%s/roots/0", e.config.pebbleConfig.ManagementListenAddress)
resp, err := e.client.HTTPClient.Get(rootURL)
if err != nil || resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to GET Pebble root CA from %s: %v", rootURL, err)
}
roots := x509.NewCertPool()
rootPEM, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to parse Pebble root CA PEM: %v", err)
}
rootDERBlock, _ := pem.Decode(rootPEM)
rootCA, err := x509.ParseCertificate(rootDERBlock.Bytes)
if err != nil {
return nil, fmt.Errorf("failed to parse Pebble root CA DER: %v", err)
}
roots.AddCert(rootCA)
return roots, nil
}
// environmentConfig describes the Pebble configuration, and configuration
// shared between pebble and pebble-challtestsrv.
type environmentConfig struct {
pebbleConfig
dnsPort uint32
}
// defaultConfig returns an environmentConfig populated with default values.
// The provided pebbleDir is used to specify certificate/private key paths
// for the HTTPS ACME interface.
func defaultConfig(pebbleDir string) environmentConfig {
return environmentConfig{
pebbleConfig: pebbleConfig{
ListenAddress: fmt.Sprintf("127.0.0.1:%d", takeNextPort()),
ManagementListenAddress: fmt.Sprintf("127.0.0.1:%d", takeNextPort()),
HTTPPort: takeNextPort(),
TLSPort: takeNextPort(),
Certificate: fmt.Sprintf("%s/test/certs/localhost/cert.pem", pebbleDir),
PrivateKey: fmt.Sprintf("%s/test/certs/localhost/key.pem", pebbleDir),
OCSPResponderURL: "",
ExternalAccountBindingRequired: false,
ExternalAccountMACKeys: make(map[string]string),
DomainBlocklist: []string{"blocked-domain.example"},
Profiles: map[string]struct {
Description string
ValidityPeriod uint64
}{
"default": {
Description: "default profile",
ValidityPeriod: 3600,
},
},
RetryAfter: struct {
Authz int
Order int
}{
3,
5,
},
},
dnsPort: takeNextPort(),
}
}
// pebbleConfig matches the JSON structure of the Pebble configuration file.
type pebbleConfig struct {
ListenAddress string
ManagementListenAddress string
HTTPPort uint32
TLSPort uint32
Certificate string
PrivateKey string
OCSPResponderURL string
ExternalAccountBindingRequired bool
ExternalAccountMACKeys map[string]string
DomainBlocklist []string
Profiles map[string]struct {
Description string
ValidityPeriod uint64
}
RetryAfter struct {
Authz int
Order int
}
}
func takeNextPort() uint32 {
return nextPort.Add(1) - 1
}
// startPebbleEnvironment is a test helper that spawns Pebble and Pebble
// challenge test server processes based on the provided environmentConfig. The
// processes will be torn down when the test ends.
func startPebbleEnvironment(t *testing.T, config *environmentConfig) environment {
t.Helper()
var pebbleDir string
if *pebbleLocalDir != "" {
pebbleDir = *pebbleLocalDir
} else {
pebbleDir = fetchModule(t, "github.com/letsencrypt/pebble/v2", pebbleModVersion)
}
binDir := prepareBinaries(t, pebbleDir)
if config == nil {
cfg := defaultConfig(pebbleDir)
config = &cfg
}
marshalConfig := struct {
Pebble pebbleConfig
}{
Pebble: config.pebbleConfig,
}
configData, err := json.Marshal(marshalConfig)
if err != nil {
t.Fatalf("failed to marshal config: %v", err)
}
configFile, err := os.CreateTemp("", "pebble-config-*.json")
if err != nil {
t.Fatalf("failed to create temp config file: %v", err)
}
t.Cleanup(func() { os.Remove(configFile.Name()) })
if _, err := configFile.Write(configData); err != nil {
t.Fatalf("failed to write config file: %v", err)
}
configFile.Close()
log.Printf("pebble dir: %s", pebbleDir)
log.Printf("config file: %s", configFile.Name())
// Spawn the Pebble CA server. It answers ACME requests and performs
// outbound validations. We configure it to use a mock DNS server that
// always answers 127.0.0.1 for all A queries so that validation
// requests for any domain name will resolve to our local challenge
// server instances.
spawnServerProcess(t, binDir, "pebble", "-config", configFile.Name(),
"-dnsserver", fmt.Sprintf("127.0.0.1:%d", config.dnsPort),
"-strict")
// Spawn the Pebble challenge test server. We'll use it to mock DNS
// responses but disable all the other interfaces. We want to stand
// up our own challenge response servers for TLS-ALPN-01,
// etc.
// Note: we specify -defaultIPv6 "" so that no AAAA records are served.
// The LUCI CI runners have issues with IPv6 connectivity on localhost.
spawnServerProcess(t, binDir, "pebble-challtestsrv",
"-dns01", fmt.Sprintf(":%d", config.dnsPort),
"-defaultIPv6", "",
"-management", fmt.Sprintf(":%d", takeNextPort()),
"-doh", "",
"-http01", "",
"-tlsalpn01", "",
"-https01", "")
waitForServer(t, config.pebbleConfig.ListenAddress)
waitForServer(t, fmt.Sprintf("127.0.0.1:%d", config.dnsPort))
log.Printf("pebble environment ready")
// Construct a cert pool that contains the CA certificate used by the ACME
// interface's certificate chain. This is separate from the issuing
// hierarchy and is used for the ACME client to interact with the ACME
// interface without cert verification error.
caCertPath := filepath.Join(pebbleDir, "test/certs/pebble.minica.pem")
caCert, err := os.ReadFile(caCertPath)
if err != nil {
t.Fatalf("failed to read CA certificate %s: %v", caCertPath, err)
}
caCertPool := x509.NewCertPool()
if !caCertPool.AppendCertsFromPEM(caCert) {
t.Fatalf("failed to parse CA certificate %s", caCertPath)
}
httpClient := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: caCertPool,
},
},
}
// Create an ACME account keypair/client and verify it can discover
// the Pebble server's ACME directory without error.
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
if err != nil {
t.Fatalf("failed to generate account key: %v", err)
}
client := &acme.Client{
Key: key,
HTTPClient: httpClient,
DirectoryURL: fmt.Sprintf("https://%s/dir", config.ListenAddress),
}
_, err = client.Discover(context.TODO())
if err != nil {
t.Fatalf("failed to discover ACME directory: %v", err)
}
return environment{
config: config,
client: client,
}
}
func waitForServer(t *testing.T, addr string) {
t.Helper()
for i := 0; i < 20; i++ {
if conn, err := net.Dial("tcp", addr); err == nil {
conn.Close()
return
}
time.Sleep(time.Duration(i*100) * time.Millisecond)
}
t.Fatalf("failed to connect to %q after 20 tries", addr)
}
// fetchModule fetches the module at the given version and returns the directory
// containing its source tree. It skips the test if fetching modules is not
// possible in this environment.
//
// Copied from the stdlib cryptotest.FetchModule and adapted to not rely on the
// stdlib internal testenv package.
func fetchModule(t *testing.T, module, version string) string {
// If the default GOMODCACHE doesn't exist, use a temporary directory
// instead. (For example, run.bash sets GOPATH=/nonexist-gopath.)
out, err := exec.Command("go", "env", "GOMODCACHE").Output()
if err != nil {
t.Errorf("go env GOMODCACHE: %v\n%s", err, out)
if ee, ok := err.(*exec.ExitError); ok {
t.Logf("%s", ee.Stderr)
}
t.FailNow()
}
modcacheOk := false
if gomodcache := string(bytes.TrimSpace(out)); gomodcache != "" {
if _, err := os.Stat(gomodcache); err == nil {
modcacheOk = true
}
}
if !modcacheOk {
t.Setenv("GOMODCACHE", t.TempDir())
// Allow t.TempDir() to clean up subdirectories.
t.Setenv("GOFLAGS", os.Getenv("GOFLAGS")+" -modcacherw")
}
t.Logf("fetching %s@%s\n", module, version)
output, err := exec.Command("go", "mod", "download", "-json", module+"@"+version).CombinedOutput()
if err != nil {
t.Fatalf("failed to download %s@%s: %s\n%s\n", module, version, err, output)
}
var j struct {
Dir string
}
if err := json.Unmarshal(output, &j); err != nil {
t.Fatalf("failed to parse 'go mod download': %s\n%s\n", err, output)
}
return j.Dir
}
func prepareBinaries(t *testing.T, pebbleDir string) string {
t.Helper()
// We don't want to build in the module cache dir, which might not be
// writable or to pollute the user's clone with binaries if pebbleLocalDir
//is used.
binDir := t.TempDir()
build := func(cmd string) {
log.Printf("building %s", cmd)
buildCmd := exec.Command(
"go",
"build", "-o", filepath.Join(binDir, cmd), "-mod", "mod", "./cmd/"+cmd)
buildCmd.Dir = pebbleDir
output, err := buildCmd.CombinedOutput()
if err != nil {
t.Fatalf("failed to build %s: %s\n%s\n", cmd, err, output)
}
}
build("pebble")
build("pebble-challtestsrv")
return binDir
}
func spawnServerProcess(t *testing.T, dir string, cmd string, args ...string) {
t.Helper()
var stdout, stderr bytes.Buffer
cmdInstance := exec.Command("./"+cmd, args...)
cmdInstance.Dir = dir
cmdInstance.Stdout = &stdout
cmdInstance.Stderr = &stderr
if err := cmdInstance.Start(); err != nil {
t.Fatalf("failed to start %s: %v", cmd, err)
}
t.Cleanup(func() {
cmdInstance.Process.Kill()
cmdInstance.Wait()
if t.Failed() || testing.Verbose() {
t.Logf("=== %s output ===", cmd)
if stdout.Len() > 0 {
t.Logf("stdout:\n%s", strings.TrimSpace(stdout.String()))
}
if stderr.Len() > 0 {
t.Logf("stderr:\n%s", strings.TrimSpace(stderr.String()))
}
}
})
}
+2 -2
View File
@@ -272,7 +272,7 @@ func (c *Client) WaitOrder(ctx context.Context, url string) (*Order, error) {
case err != nil:
// Skip and retry.
case o.Status == StatusInvalid:
return nil, &OrderError{OrderURL: o.URI, Status: o.Status}
return nil, &OrderError{OrderURL: o.URI, Status: o.Status, Problem: o.Error}
case o.Status == StatusReady || o.Status == StatusValid:
return o, nil
}
@@ -369,7 +369,7 @@ func (c *Client) CreateOrderCert(ctx context.Context, url string, csr []byte, bu
}
// The only acceptable status post finalize and WaitOrder is "valid".
if o.Status != StatusValid {
return nil, "", &OrderError{OrderURL: o.URI, Status: o.Status}
return nil, "", &OrderError{OrderURL: o.URI, Status: o.Status, Problem: o.Error}
}
crt, err := c.fetchCertRFC(ctx, o.CertURL, bundle)
return crt, o.CertURL, err
+16 -3
View File
@@ -885,11 +885,17 @@ func TestRFC_WaitOrderError(t *testing.T) {
s.handle("/orders/1", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Location", s.url("/orders/1"))
w.WriteHeader(http.StatusOK)
s := StatusPending
if count > 0 {
s = StatusInvalid
// https://www.rfc-editor.org/rfc/rfc8555#section-7.3.3
errorData := `{
"type": "urn:ietf:params:acme:error:userActionRequired",
"detail": "Terms of service have changed",
"instance": "https://example.com/acme/agreement/?token=W8Ih3PswD-8"
}`
fmt.Fprintf(w, `{"status": %q, "error": %s}`, StatusInvalid, errorData)
} else {
fmt.Fprintf(w, `{"status": %q}`, StatusPending)
}
fmt.Fprintf(w, `{"status": %q}`, s)
count++
})
s.start()
@@ -910,6 +916,13 @@ func TestRFC_WaitOrderError(t *testing.T) {
if e.Status != StatusInvalid {
t.Errorf("e.Status = %q; want %q", e.Status, StatusInvalid)
}
if e.Problem == nil {
t.Errorf("e.Problem = nil")
}
expectedProbType := "urn:ietf:params:acme:error:userActionRequired"
if e.Problem.ProblemType != expectedProbType {
t.Errorf("e.Problem.ProblemType = %q; want %q", e.Problem.ProblemType, expectedProbType)
}
}
func TestRFC_CreateOrderCert(t *testing.T) {
+21 -3
View File
@@ -7,6 +7,7 @@ package acme
import (
"crypto"
"crypto/x509"
"encoding/json"
"errors"
"fmt"
"net/http"
@@ -55,6 +56,10 @@ var (
// ErrNoAccount indicates that the Client's key has not been registered with the CA.
ErrNoAccount = errors.New("acme: account does not exist")
// errPreAuthorizationNotSupported indicates that the server does not
// support pre-authorization of identifiers.
errPreAuthorizationNotSupported = errors.New("acme: pre-authorization is not supported")
)
// A Subproblem describes an ACME subproblem as reported in an Error.
@@ -149,13 +154,16 @@ func (a *AuthorizationError) Error() string {
// OrderError is returned from Client's order related methods.
// It indicates the order is unusable and the clients should start over with
// AuthorizeOrder.
// AuthorizeOrder. A Problem description may be provided with details on
// what caused the order to become unusable.
//
// The clients can still fetch the order object from CA using GetOrder
// to inspect its state.
type OrderError struct {
OrderURL string
Status string
// Problem is the error that occurred while processing the order.
Problem *Error
}
func (oe *OrderError) Error() string {
@@ -288,7 +296,7 @@ type Directory struct {
// KeyChangeURL allows to perform account key rollover flow.
KeyChangeURL string
// Term is a URI identifying the current terms of service.
// Terms is a URI identifying the current terms of service.
Terms string
// Website is an HTTP or HTTPS URL locating a website
@@ -527,6 +535,16 @@ type Challenge struct {
// when this challenge was used.
// The type of a non-nil value is *Error.
Error error
// Payload is the JSON-formatted payload that the client sends
// to the server to indicate it is ready to respond to the challenge.
// When unset, it defaults to an empty JSON object: {}.
// For most challenges, the client must not set Payload,
// see https://tools.ietf.org/html/rfc8555#section-7.5.1.
// Payload is used only for newer challenges (such as "device-attest-01")
// where the client must send additional data for the server to validate
// the challenge.
Payload json.RawMessage
}
// wireChallenge is ACME JSON challenge representation.
@@ -604,7 +622,7 @@ func (*certOptKey) privateCertOpt() {}
//
// In TLS ChallengeCert methods, the template is also used as parent,
// resulting in a self-signed certificate.
// The DNSNames field of t is always overwritten for tls-sni challenge certs.
// The DNSNames or IPAddresses fields of t are always overwritten for tls-alpn challenge certs.
func WithTemplate(t *x509.Certificate) CertOption {
return (*certOptTemplate)(t)
}
+2 -2
View File
@@ -4,12 +4,12 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.24.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+1 -1
View File
@@ -50,7 +50,7 @@ func (ih InvalidHashPrefixError) Error() string {
type InvalidCostError int
func (ic InvalidCostError) Error() string {
return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), MinCost, MaxCost)
return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed inclusive range %d..%d", int(ic), MinCost, MaxCost)
}
const (
+2 -2
View File
@@ -4,13 +4,13 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.24.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+2 -2
View File
@@ -4,12 +4,12 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.24.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+8
View File
@@ -12,6 +12,8 @@ import (
// XOF defines the interface to hash functions that
// support arbitrary-length output.
//
// New callers should prefer the standard library [hash.XOF].
type XOF interface {
// Write absorbs more data into the hash's state. It panics if called
// after Read.
@@ -47,6 +49,8 @@ const maxOutputLength = (1 << 32) * 64
//
// A non-nil key turns the hash into a MAC. The key must between
// zero and 32 bytes long.
//
// The result can be safely interface-upgraded to [hash.XOF].
func NewXOF(size uint32, key []byte) (XOF, error) {
if len(key) > Size {
return nil, errKeySize
@@ -93,6 +97,10 @@ func (x *xof) Clone() XOF {
return &clone
}
func (x *xof) BlockSize() int {
return x.d.BlockSize()
}
func (x *xof) Reset() {
x.cfg[0] = byte(Size)
binary.LittleEndian.PutUint32(x.cfg[4:], uint32(Size)) // leaf length
+11
View File
@@ -0,0 +1,11 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.25
package blake2b
import "hash"
var _ hash.XOF = (*xof)(nil)
+2 -2
View File
@@ -4,12 +4,12 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.24.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+1 -1
View File
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (!arm64 && !s390x && !ppc64le) || !gc || purego
//go:build (!arm64 && !s390x && !ppc64 && !ppc64le) || !gc || purego
package chacha20
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc && !purego
//go:build gc && !purego && (ppc64 || ppc64le)
package chacha20
@@ -19,7 +19,7 @@
// The differences in this and the original implementation are
// due to the calling conventions and initialization of constants.
//go:build gc && !purego
//go:build gc && !purego && (ppc64 || ppc64le)
#include "textflag.h"
@@ -36,32 +36,68 @@
// for VPERMXOR
#define MASK R18
DATA consts<>+0x00(SB)/8, $0x3320646e61707865
DATA consts<>+0x08(SB)/8, $0x6b20657479622d32
DATA consts<>+0x10(SB)/8, $0x0000000000000001
DATA consts<>+0x18(SB)/8, $0x0000000000000000
DATA consts<>+0x20(SB)/8, $0x0000000000000004
DATA consts<>+0x28(SB)/8, $0x0000000000000000
DATA consts<>+0x30(SB)/8, $0x0a0b08090e0f0c0d
DATA consts<>+0x38(SB)/8, $0x0203000106070405
DATA consts<>+0x40(SB)/8, $0x090a0b080d0e0f0c
DATA consts<>+0x48(SB)/8, $0x0102030005060704
DATA consts<>+0x50(SB)/8, $0x6170786561707865
DATA consts<>+0x58(SB)/8, $0x6170786561707865
DATA consts<>+0x60(SB)/8, $0x3320646e3320646e
DATA consts<>+0x68(SB)/8, $0x3320646e3320646e
DATA consts<>+0x70(SB)/8, $0x79622d3279622d32
DATA consts<>+0x78(SB)/8, $0x79622d3279622d32
DATA consts<>+0x80(SB)/8, $0x6b2065746b206574
DATA consts<>+0x88(SB)/8, $0x6b2065746b206574
DATA consts<>+0x90(SB)/8, $0x0000000100000000
DATA consts<>+0x98(SB)/8, $0x0000000300000002
DATA consts<>+0xa0(SB)/8, $0x5566774411223300
DATA consts<>+0xa8(SB)/8, $0xddeeffcc99aabb88
DATA consts<>+0xb0(SB)/8, $0x6677445522330011
DATA consts<>+0xb8(SB)/8, $0xeeffccddaabb8899
DATA consts<>+0x00(SB)/4, $0x61707865
DATA consts<>+0x04(SB)/4, $0x3320646e
DATA consts<>+0x08(SB)/4, $0x79622d32
DATA consts<>+0x0c(SB)/4, $0x6b206574
DATA consts<>+0x10(SB)/4, $0x00000001
DATA consts<>+0x14(SB)/4, $0x00000000
DATA consts<>+0x18(SB)/4, $0x00000000
DATA consts<>+0x1c(SB)/4, $0x00000000
DATA consts<>+0x20(SB)/4, $0x00000004
DATA consts<>+0x24(SB)/4, $0x00000000
DATA consts<>+0x28(SB)/4, $0x00000000
DATA consts<>+0x2c(SB)/4, $0x00000000
DATA consts<>+0x30(SB)/4, $0x0e0f0c0d
DATA consts<>+0x34(SB)/4, $0x0a0b0809
DATA consts<>+0x38(SB)/4, $0x06070405
DATA consts<>+0x3c(SB)/4, $0x02030001
DATA consts<>+0x40(SB)/4, $0x0d0e0f0c
DATA consts<>+0x44(SB)/4, $0x090a0b08
DATA consts<>+0x48(SB)/4, $0x05060704
DATA consts<>+0x4c(SB)/4, $0x01020300
DATA consts<>+0x50(SB)/4, $0x61707865
DATA consts<>+0x54(SB)/4, $0x61707865
DATA consts<>+0x58(SB)/4, $0x61707865
DATA consts<>+0x5c(SB)/4, $0x61707865
DATA consts<>+0x60(SB)/4, $0x3320646e
DATA consts<>+0x64(SB)/4, $0x3320646e
DATA consts<>+0x68(SB)/4, $0x3320646e
DATA consts<>+0x6c(SB)/4, $0x3320646e
DATA consts<>+0x70(SB)/4, $0x79622d32
DATA consts<>+0x74(SB)/4, $0x79622d32
DATA consts<>+0x78(SB)/4, $0x79622d32
DATA consts<>+0x7c(SB)/4, $0x79622d32
DATA consts<>+0x80(SB)/4, $0x6b206574
DATA consts<>+0x84(SB)/4, $0x6b206574
DATA consts<>+0x88(SB)/4, $0x6b206574
DATA consts<>+0x8c(SB)/4, $0x6b206574
DATA consts<>+0x90(SB)/4, $0x00000000
DATA consts<>+0x94(SB)/4, $0x00000001
DATA consts<>+0x98(SB)/4, $0x00000002
DATA consts<>+0x9c(SB)/4, $0x00000003
DATA consts<>+0xa0(SB)/4, $0x11223300
DATA consts<>+0xa4(SB)/4, $0x55667744
DATA consts<>+0xa8(SB)/4, $0x99aabb88
DATA consts<>+0xac(SB)/4, $0xddeeffcc
DATA consts<>+0xb0(SB)/4, $0x22330011
DATA consts<>+0xb4(SB)/4, $0x66774455
DATA consts<>+0xb8(SB)/4, $0xaabb8899
DATA consts<>+0xbc(SB)/4, $0xeeffccdd
GLOBL consts<>(SB), RODATA, $0xc0
#ifdef GOARCH_ppc64
#define BE_XXBRW_INIT() \
LVSL (R0)(R0), V24 \
VSPLTISB $3, V25 \
VXOR V24, V25, V24 \
#define BE_XXBRW(vr) VPERM vr, vr, V24, vr
#else
#define BE_XXBRW_INIT()
#define BE_XXBRW(vr)
#endif
//func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32)
TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40
MOVD out+0(FP), OUT
@@ -94,6 +130,8 @@ TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40
// Clear V27
VXOR V27, V27, V27
BE_XXBRW_INIT()
// V28
LXVW4X (CONSTBASE)(R11), VS60
@@ -299,6 +337,11 @@ loop_vsx:
VADDUWM V8, V18, V8
VADDUWM V12, V19, V12
BE_XXBRW(V0)
BE_XXBRW(V4)
BE_XXBRW(V8)
BE_XXBRW(V12)
CMPU LEN, $64
BLT tail_vsx
@@ -327,6 +370,11 @@ loop_vsx:
VADDUWM V9, V18, V8
VADDUWM V13, V19, V12
BE_XXBRW(V0)
BE_XXBRW(V4)
BE_XXBRW(V8)
BE_XXBRW(V12)
CMPU LEN, $64
BLT tail_vsx
@@ -334,8 +382,8 @@ loop_vsx:
LXVW4X (INP)(R8), VS60
LXVW4X (INP)(R9), VS61
LXVW4X (INP)(R10), VS62
VXOR V27, V0, V27
VXOR V27, V0, V27
VXOR V28, V4, V28
VXOR V29, V8, V29
VXOR V30, V12, V30
@@ -354,6 +402,11 @@ loop_vsx:
VADDUWM V10, V18, V8
VADDUWM V14, V19, V12
BE_XXBRW(V0)
BE_XXBRW(V4)
BE_XXBRW(V8)
BE_XXBRW(V12)
CMPU LEN, $64
BLT tail_vsx
@@ -381,6 +434,11 @@ loop_vsx:
VADDUWM V11, V18, V8
VADDUWM V15, V19, V12
BE_XXBRW(V0)
BE_XXBRW(V4)
BE_XXBRW(V8)
BE_XXBRW(V12)
CMPU LEN, $64
BLT tail_vsx
@@ -408,9 +466,9 @@ loop_vsx:
done_vsx:
// Increment counter by number of 64 byte blocks
MOVD (CNT), R14
MOVWZ (CNT), R14
ADD BLOCKS, R14
MOVD R14, (CNT)
MOVWZ R14, (CNT)
RET
tail_vsx:
+2 -2
View File
@@ -4,12 +4,12 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.24.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+1 -1
View File
@@ -234,7 +234,7 @@ func (b *Builder) AddASN1(tag asn1.Tag, f BuilderContinuation) {
// Identifiers with the low five bits set indicate high-tag-number format
// (two or more octets), which we don't support.
if tag&0x1f == 0x1f {
b.err = fmt.Errorf("cryptobyte: high-tag number identifier octects not supported: 0x%x", tag)
b.err = fmt.Errorf("cryptobyte: high-tag number identifier octets not supported: 0x%x", tag)
return
}
b.AddUint8(uint8(tag))
+1 -1
View File
@@ -36,7 +36,7 @@ func ScalarBaseMult(dst, scalar *[32]byte) {
curve := ecdh.X25519()
priv, err := curve.NewPrivateKey(scalar[:])
if err != nil {
panic("curve25519: internal error: scalarBaseMult was not 32 bytes")
panic("curve25519: " + err.Error())
}
copy(dst[:], priv.PublicKey().Bytes())
}
+5 -5
View File
@@ -1,11 +1,11 @@
module golang.org/x/crypto
go 1.20
go 1.24.0
require (
golang.org/x/net v0.21.0 // tagx:ignore
golang.org/x/sys v0.26.0
golang.org/x/term v0.25.0
golang.org/x/net v0.43.0 // tagx:ignore
golang.org/x/sys v0.36.0
golang.org/x/term v0.35.0
)
require golang.org/x/text v0.19.0 // indirect
require golang.org/x/text v0.29.0 // indirect
+8 -8
View File
@@ -1,8 +1,8 @@
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
+2 -2
View File
@@ -4,12 +4,12 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.24.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
+1 -1
View File
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego
//go:build (!amd64 && !loong64 && !ppc64le && !ppc64 && !s390x) || !gc || purego
package poly1305
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc && !purego
//go:build gc && !purego && (amd64 || loong64 || ppc64 || ppc64le)
package poly1305
+123
View File
@@ -0,0 +1,123 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc && !purego
// func update(state *macState, msg []byte)
TEXT ·update(SB), $0-32
MOVV state+0(FP), R4
MOVV msg_base+8(FP), R5
MOVV msg_len+16(FP), R6
MOVV $0x10, R7
MOVV (R4), R8 // h0
MOVV 8(R4), R9 // h1
MOVV 16(R4), R10 // h2
MOVV 24(R4), R11 // r0
MOVV 32(R4), R12 // r1
BLT R6, R7, bytes_between_0_and_15
loop:
MOVV (R5), R14 // msg[0:8]
MOVV 8(R5), R16 // msg[8:16]
ADDV R14, R8, R8 // h0 (x1 + y1 = z1', if z1' < x1 then z1' overflow)
ADDV R16, R9, R27
SGTU R14, R8, R24 // h0.carry
SGTU R9, R27, R28
ADDV R27, R24, R9 // h1
SGTU R27, R9, R24
OR R24, R28, R24 // h1.carry
ADDV $0x01, R24, R24
ADDV R10, R24, R10 // h2
ADDV $16, R5, R5 // msg = msg[16:]
multiply:
MULV R8, R11, R14 // h0r0.lo
MULHVU R8, R11, R15 // h0r0.hi
MULV R9, R11, R13 // h1r0.lo
MULHVU R9, R11, R16 // h1r0.hi
ADDV R13, R15, R15
SGTU R13, R15, R24
ADDV R24, R16, R16
MULV R10, R11, R25
ADDV R16, R25, R25
MULV R8, R12, R13 // h0r1.lo
MULHVU R8, R12, R16 // h0r1.hi
ADDV R13, R15, R15
SGTU R13, R15, R24
ADDV R24, R16, R16
MOVV R16, R8
MULV R10, R12, R26 // h2r1
MULV R9, R12, R13 // h1r1.lo
MULHVU R9, R12, R16 // h1r1.hi
ADDV R13, R25, R25
ADDV R16, R26, R27
SGTU R13, R25, R24
ADDV R27, R24, R26
ADDV R8, R25, R25
SGTU R8, R25, R24
ADDV R24, R26, R26
AND $3, R25, R10
AND $-4, R25, R17
ADDV R17, R14, R8
ADDV R26, R15, R27
SGTU R17, R8, R24
SGTU R26, R27, R28
ADDV R27, R24, R9
SGTU R27, R9, R24
OR R24, R28, R24
ADDV R24, R10, R10
SLLV $62, R26, R27
SRLV $2, R25, R28
SRLV $2, R26, R26
OR R27, R28, R25
ADDV R25, R8, R8
ADDV R26, R9, R27
SGTU R25, R8, R24
SGTU R26, R27, R28
ADDV R27, R24, R9
SGTU R27, R9, R24
OR R24, R28, R24
ADDV R24, R10, R10
SUBV $16, R6, R6
BGE R6, R7, loop
bytes_between_0_and_15:
BEQ R6, R0, done
MOVV $1, R14
XOR R15, R15
ADDV R6, R5, R5
flush_buffer:
MOVBU -1(R5), R25
SRLV $56, R14, R24
SLLV $8, R15, R28
SLLV $8, R14, R14
OR R24, R28, R15
XOR R25, R14, R14
SUBV $1, R6, R6
SUBV $1, R5, R5
BNE R6, R0, flush_buffer
ADDV R14, R8, R8
SGTU R14, R8, R24
ADDV R15, R9, R27
SGTU R15, R27, R28
ADDV R27, R24, R9
SGTU R27, R9, R24
OR R24, R28, R24
ADDV R10, R24, R10
MOVV $16, R6
JMP multiply
done:
MOVV R8, (R4)
MOVV R9, 8(R4)
MOVV R10, 16(R4)
RET
-47
View File
@@ -1,47 +0,0 @@
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc && !purego
package poly1305
//go:noescape
func update(state *macState, msg []byte)
// mac is a wrapper for macGeneric that redirects calls that would have gone to
// updateGeneric to update.
//
// Its Write and Sum methods are otherwise identical to the macGeneric ones, but
// using function pointers would carry a major performance cost.
type mac struct{ macGeneric }
func (h *mac) Write(p []byte) (int, error) {
nn := len(p)
if h.offset > 0 {
n := copy(h.buffer[h.offset:], p)
if h.offset+n < TagSize {
h.offset += n
return nn, nil
}
p = p[n:]
h.offset = 0
update(&h.macState, h.buffer[:])
}
if n := len(p) - (len(p) % TagSize); n > 0 {
update(&h.macState, p[:n])
p = p[n:]
}
if len(p) > 0 {
h.offset += copy(h.buffer[h.offset:], p)
}
return nn, nil
}
func (h *mac) Sum(out *[16]byte) {
state := h.macState
if h.offset > 0 {
update(&state, h.buffer[:h.offset])
}
finalize(out, &state.h, &state.s)
}
@@ -2,15 +2,25 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build gc && !purego
//go:build gc && !purego && (ppc64 || ppc64le)
#include "textflag.h"
// This was ported from the amd64 implementation.
#ifdef GOARCH_ppc64le
#define LE_MOVD MOVD
#define LE_MOVWZ MOVWZ
#define LE_MOVHZ MOVHZ
#else
#define LE_MOVD MOVDBR
#define LE_MOVWZ MOVWBR
#define LE_MOVHZ MOVHBR
#endif
#define POLY1305_ADD(msg, h0, h1, h2, t0, t1, t2) \
MOVD (msg), t0; \
MOVD 8(msg), t1; \
LE_MOVD (msg)( R0), t0; \
LE_MOVD (msg)(R24), t1; \
MOVD $1, t2; \
ADDC t0, h0, h0; \
ADDE t1, h1, h1; \
@@ -50,10 +60,6 @@
ADDE t3, h1, h1; \
ADDZE h2
DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF
DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC
GLOBL ·poly1305Mask<>(SB), RODATA, $16
// func update(state *[7]uint64, msg []byte)
TEXT ·update(SB), $0-32
MOVD state+0(FP), R3
@@ -66,6 +72,8 @@ TEXT ·update(SB), $0-32
MOVD 24(R3), R11 // r0
MOVD 32(R3), R12 // r1
MOVD $8, R24
CMP R5, $16
BLT bytes_between_0_and_15
@@ -94,7 +102,7 @@ flush_buffer:
// Greater than 8 -- load the rightmost remaining bytes in msg
// and put into R17 (h1)
MOVD (R4)(R21), R17
LE_MOVD (R4)(R21), R17
MOVD $16, R22
// Find the offset to those bytes
@@ -118,7 +126,7 @@ just1:
BLT less8
// Exactly 8
MOVD (R4), R16
LE_MOVD (R4), R16
CMP R17, $0
@@ -133,7 +141,7 @@ less8:
MOVD $0, R22 // shift count
CMP R5, $4
BLT less4
MOVWZ (R4), R16
LE_MOVWZ (R4), R16
ADD $4, R4
ADD $-4, R5
MOVD $32, R22
@@ -141,7 +149,7 @@ less8:
less4:
CMP R5, $2
BLT less2
MOVHZ (R4), R21
LE_MOVHZ (R4), R21
SLD R22, R21, R21
OR R16, R21, R16
ADD $16, R22
+1 -13
View File
@@ -123,24 +123,12 @@ func TestSigning(t *testing.T) {
}
}
// We use this to make test keys, so that they aren't all the same.
type quickRand byte
func (qr *quickRand) Read(p []byte) (int, error) {
for i := range p {
p[i] = byte(*qr)
}
*qr++
return len(p), nil
}
func TestMultiSign(t *testing.T) {
if testing.Short() {
t.Skip("skipping long test in -short mode")
}
zero := quickRand(0)
config := packet.Config{Rand: &zero}
var config packet.Config
for nKeys := 0; nKeys < 4; nKeys++ {
nextTest:
+1 -1
View File
@@ -26,7 +26,7 @@ type pbeCipher interface {
create(key []byte) (cipher.Block, error)
// deriveKey returns a key derived from the given password and salt.
deriveKey(salt, password []byte, iterations int) []byte
// deriveKey returns an IV derived from the given password and salt.
// deriveIV returns an IV derived from the given password and salt.
deriveIV(salt, password []byte, iterations int) []byte
}
+1 -1
View File
@@ -4,7 +4,7 @@ go 1.23
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.26.0
golang.org/x/crypto v0.33.0
)
require (
+2 -2
View File
@@ -1,7 +1,7 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
+2 -2
View File
@@ -4,12 +4,12 @@ go 1.22
require (
github.com/mmcloughlin/avo v0.6.0
golang.org/x/crypto v0.25.0
golang.org/x/crypto v0.33.0
)
require (
golang.org/x/mod v0.19.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.23.0 // indirect
)
+4 -4
View File
@@ -1,12 +1,12 @@
github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
+4
View File
@@ -5,6 +5,10 @@
// Package sha3 implements the SHA-3 fixed-output-length hash functions and
// the SHAKE variable-output-length hash functions defined by FIPS-202.
//
// All types in this package also implement [encoding.BinaryMarshaler],
// [encoding.BinaryAppender] and [encoding.BinaryUnmarshaler] to marshal and
// unmarshal the internal state of the hash.
//
// Both types of hash function use the "sponge" construction and the Keccak
// permutation. For a detailed specification see http://keccak.noekeon.org/
//
+25 -6
View File
@@ -48,33 +48,52 @@ func init() {
crypto.RegisterHash(crypto.SHA3_512, New512)
}
const (
dsbyteSHA3 = 0b00000110
dsbyteKeccak = 0b00000001
dsbyteShake = 0b00011111
dsbyteCShake = 0b00000100
// rateK[c] is the rate in bytes for Keccak[c] where c is the capacity in
// bits. Given the sponge size is 1600 bits, the rate is 1600 - c bits.
rateK256 = (1600 - 256) / 8
rateK448 = (1600 - 448) / 8
rateK512 = (1600 - 512) / 8
rateK768 = (1600 - 768) / 8
rateK1024 = (1600 - 1024) / 8
)
func new224Generic() *state {
return &state{rate: 144, outputLen: 28, dsbyte: 0x06}
return &state{rate: rateK448, outputLen: 28, dsbyte: dsbyteSHA3}
}
func new256Generic() *state {
return &state{rate: 136, outputLen: 32, dsbyte: 0x06}
return &state{rate: rateK512, outputLen: 32, dsbyte: dsbyteSHA3}
}
func new384Generic() *state {
return &state{rate: 104, outputLen: 48, dsbyte: 0x06}
return &state{rate: rateK768, outputLen: 48, dsbyte: dsbyteSHA3}
}
func new512Generic() *state {
return &state{rate: 72, outputLen: 64, dsbyte: 0x06}
return &state{rate: rateK1024, outputLen: 64, dsbyte: dsbyteSHA3}
}
// NewLegacyKeccak256 creates a new Keccak-256 hash.
//
// Only use this function if you require compatibility with an existing cryptosystem
// that uses non-standard padding. All other users should use New256 instead.
func NewLegacyKeccak256() hash.Hash { return &state{rate: 136, outputLen: 32, dsbyte: 0x01} }
func NewLegacyKeccak256() hash.Hash {
return &state{rate: rateK512, outputLen: 32, dsbyte: dsbyteKeccak}
}
// NewLegacyKeccak512 creates a new Keccak-512 hash.
//
// Only use this function if you require compatibility with an existing cryptosystem
// that uses non-standard padding. All other users should use New512 instead.
func NewLegacyKeccak512() hash.Hash { return &state{rate: 72, outputLen: 64, dsbyte: 0x01} }
func NewLegacyKeccak512() hash.Hash {
return &state{rate: rateK1024, outputLen: 64, dsbyte: dsbyteKeccak}
}
// Sum224 returns the SHA3-224 digest of the data.
func Sum224(data []byte) (digest [28]byte) {
+122 -63
View File
@@ -4,6 +4,15 @@
package sha3
import (
"crypto/subtle"
"encoding/binary"
"errors"
"unsafe"
"golang.org/x/sys/cpu"
)
// spongeDirection indicates the direction bytes are flowing through the sponge.
type spongeDirection int
@@ -14,16 +23,13 @@ const (
spongeSqueezing
)
const (
// maxRate is the maximum size of the internal buffer. SHAKE-256
// currently needs the largest buffer.
maxRate = 168
)
type state struct {
// Generic sponge components.
a [25]uint64 // main state of the hash
rate int // the number of bytes of state to use
a [1600 / 8]byte // main state of the hash
// a[n:rate] is the buffer. If absorbing, it's the remaining space to XOR
// into before running the permutation. If squeezing, it's the remaining
// output to produce before running the permutation.
n, rate int
// dsbyte contains the "domain separation" bits and the first bit of
// the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the
@@ -39,10 +45,6 @@ type state struct {
// Extendable-Output Functions (May 2014)"
dsbyte byte
i, n int // storage[i:n] is the buffer, i is only used while squeezing
storage [maxRate]byte
// Specific to SHA-3 and SHAKE.
outputLen int // the default output size in bytes
state spongeDirection // whether the sponge is absorbing or squeezing
}
@@ -61,7 +63,7 @@ func (d *state) Reset() {
d.a[i] = 0
}
d.state = spongeAbsorbing
d.i, d.n = 0, 0
d.n = 0
}
func (d *state) clone() *state {
@@ -69,22 +71,25 @@ func (d *state) clone() *state {
return &ret
}
// permute applies the KeccakF-1600 permutation. It handles
// any input-output buffering.
// permute applies the KeccakF-1600 permutation.
func (d *state) permute() {
switch d.state {
case spongeAbsorbing:
// If we're absorbing, we need to xor the input into the state
// before applying the permutation.
xorIn(d, d.storage[:d.rate])
d.n = 0
keccakF1600(&d.a)
case spongeSqueezing:
// If we're squeezing, we need to apply the permutation before
// copying more output.
keccakF1600(&d.a)
d.i = 0
copyOut(d, d.storage[:d.rate])
var a *[25]uint64
if cpu.IsBigEndian {
a = new([25]uint64)
for i := range a {
a[i] = binary.LittleEndian.Uint64(d.a[i*8:])
}
} else {
a = (*[25]uint64)(unsafe.Pointer(&d.a))
}
keccakF1600(a)
d.n = 0
if cpu.IsBigEndian {
for i := range a {
binary.LittleEndian.PutUint64(d.a[i*8:], a[i])
}
}
}
@@ -92,53 +97,36 @@ func (d *state) permute() {
// the multi-bitrate 10..1 padding rule, and permutes the state.
func (d *state) padAndPermute() {
// Pad with this instance's domain-separator bits. We know that there's
// at least one byte of space in d.buf because, if it were full,
// at least one byte of space in the sponge because, if it were full,
// permute would have been called to empty it. dsbyte also contains the
// first one bit for the padding. See the comment in the state struct.
d.storage[d.n] = d.dsbyte
d.n++
for d.n < d.rate {
d.storage[d.n] = 0
d.n++
}
d.a[d.n] ^= d.dsbyte
// This adds the final one bit for the padding. Because of the way that
// bits are numbered from the LSB upwards, the final bit is the MSB of
// the last byte.
d.storage[d.rate-1] ^= 0x80
d.a[d.rate-1] ^= 0x80
// Apply the permutation
d.permute()
d.state = spongeSqueezing
d.n = d.rate
copyOut(d, d.storage[:d.rate])
}
// Write absorbs more data into the hash's state. It panics if any
// output has already been read.
func (d *state) Write(p []byte) (written int, err error) {
func (d *state) Write(p []byte) (n int, err error) {
if d.state != spongeAbsorbing {
panic("sha3: Write after Read")
}
written = len(p)
n = len(p)
for len(p) > 0 {
if d.n == 0 && len(p) >= d.rate {
// The fast path; absorb a full "rate" bytes of input and apply the permutation.
xorIn(d, p[:d.rate])
p = p[d.rate:]
keccakF1600(&d.a)
} else {
// The slow path; buffer the input until we can fill the sponge, and then xor it in.
todo := d.rate - d.n
if todo > len(p) {
todo = len(p)
}
d.n += copy(d.storage[d.n:], p[:todo])
p = p[todo:]
x := subtle.XORBytes(d.a[d.n:d.rate], d.a[d.n:d.rate], p)
d.n += x
p = p[x:]
// If the sponge is full, apply the permutation.
if d.n == d.rate {
d.permute()
}
// If the sponge is full, apply the permutation.
if d.n == d.rate {
d.permute()
}
}
@@ -156,14 +144,14 @@ func (d *state) Read(out []byte) (n int, err error) {
// Now, do the squeezing.
for len(out) > 0 {
n := copy(out, d.storage[d.i:d.n])
d.i += n
out = out[n:]
// Apply the permutation if we've squeezed the sponge dry.
if d.i == d.rate {
if d.n == d.rate {
d.permute()
}
x := copy(out, d.a[d.n:d.rate])
d.n += x
out = out[x:]
}
return
@@ -183,3 +171,74 @@ func (d *state) Sum(in []byte) []byte {
dup.Read(hash)
return append(in, hash...)
}
const (
magicSHA3 = "sha\x08"
magicShake = "sha\x09"
magicCShake = "sha\x0a"
magicKeccak = "sha\x0b"
// magic || rate || main state || n || sponge direction
marshaledSize = len(magicSHA3) + 1 + 200 + 1 + 1
)
func (d *state) MarshalBinary() ([]byte, error) {
return d.AppendBinary(make([]byte, 0, marshaledSize))
}
func (d *state) AppendBinary(b []byte) ([]byte, error) {
switch d.dsbyte {
case dsbyteSHA3:
b = append(b, magicSHA3...)
case dsbyteShake:
b = append(b, magicShake...)
case dsbyteCShake:
b = append(b, magicCShake...)
case dsbyteKeccak:
b = append(b, magicKeccak...)
default:
panic("unknown dsbyte")
}
// rate is at most 168, and n is at most rate.
b = append(b, byte(d.rate))
b = append(b, d.a[:]...)
b = append(b, byte(d.n), byte(d.state))
return b, nil
}
func (d *state) UnmarshalBinary(b []byte) error {
if len(b) != marshaledSize {
return errors.New("sha3: invalid hash state")
}
magic := string(b[:len(magicSHA3)])
b = b[len(magicSHA3):]
switch {
case magic == magicSHA3 && d.dsbyte == dsbyteSHA3:
case magic == magicShake && d.dsbyte == dsbyteShake:
case magic == magicCShake && d.dsbyte == dsbyteCShake:
case magic == magicKeccak && d.dsbyte == dsbyteKeccak:
default:
return errors.New("sha3: invalid hash state identifier")
}
rate := int(b[0])
b = b[1:]
if rate != d.rate {
return errors.New("sha3: invalid hash state function")
}
copy(d.a[:], b)
b = b[len(d.a):]
n, state := int(b[0]), spongeDirection(b[1])
if n > d.rate {
return errors.New("sha3: invalid hash state")
}
d.n = n
if state != spongeAbsorbing && state != spongeSqueezing {
return errors.New("sha3: invalid hash state")
}
d.state = state
return nil
}
+149
View File
@@ -13,10 +13,12 @@ package sha3
import (
"bytes"
"compress/flate"
"encoding"
"encoding/hex"
"encoding/json"
"fmt"
"hash"
"io"
"math/rand"
"os"
"strings"
@@ -375,6 +377,153 @@ func TestClone(t *testing.T) {
}
}
func TestCSHAKEAccumulated(t *testing.T) {
// Generated with pycryptodome@3.20.0
//
// from Crypto.Hash import cSHAKE128
// rng = cSHAKE128.new()
// acc = cSHAKE128.new()
// for n in range(200):
// N = rng.read(n)
// for s in range(200):
// S = rng.read(s)
// c = cSHAKE128.cSHAKE_XOF(data=None, custom=S, capacity=256, function=N)
// c.update(rng.read(100))
// acc.update(c.read(200))
// c = cSHAKE128.cSHAKE_XOF(data=None, custom=S, capacity=256, function=N)
// c.update(rng.read(168))
// acc.update(c.read(200))
// c = cSHAKE128.cSHAKE_XOF(data=None, custom=S, capacity=256, function=N)
// c.update(rng.read(200))
// acc.update(c.read(200))
// print(acc.read(32).hex())
//
// and with @noble/hashes@v1.5.0
//
// import { bytesToHex } from "@noble/hashes/utils";
// import { cshake128 } from "@noble/hashes/sha3-addons";
// const rng = cshake128.create();
// const acc = cshake128.create();
// for (let n = 0; n < 200; n++) {
// const N = rng.xof(n);
// for (let s = 0; s < 200; s++) {
// const S = rng.xof(s);
// let c = cshake128.create({ NISTfn: N, personalization: S });
// c.update(rng.xof(100));
// acc.update(c.xof(200));
// c = cshake128.create({ NISTfn: N, personalization: S });
// c.update(rng.xof(168));
// acc.update(c.xof(200));
// c = cshake128.create({ NISTfn: N, personalization: S });
// c.update(rng.xof(200));
// acc.update(c.xof(200));
// }
// }
// console.log(bytesToHex(acc.xof(32)));
//
t.Run("cSHAKE128", func(t *testing.T) {
testCSHAKEAccumulated(t, NewCShake128, rateK256,
"bb14f8657c6ec5403d0b0e2ef3d3393497e9d3b1a9a9e8e6c81dbaa5fd809252")
})
t.Run("cSHAKE256", func(t *testing.T) {
testCSHAKEAccumulated(t, NewCShake256, rateK512,
"0baaf9250c6e25f0c14ea5c7f9bfde54c8a922c8276437db28f3895bdf6eeeef")
})
}
func testCSHAKEAccumulated(t *testing.T, newCShake func(N, S []byte) ShakeHash, rate int64, exp string) {
rnd := newCShake(nil, nil)
acc := newCShake(nil, nil)
for n := 0; n < 200; n++ {
N := make([]byte, n)
rnd.Read(N)
for s := 0; s < 200; s++ {
S := make([]byte, s)
rnd.Read(S)
c := newCShake(N, S)
io.CopyN(c, rnd, 100 /* < rate */)
io.CopyN(acc, c, 200)
c.Reset()
io.CopyN(c, rnd, rate)
io.CopyN(acc, c, 200)
c.Reset()
io.CopyN(c, rnd, 200 /* > rate */)
io.CopyN(acc, c, 200)
}
}
if got := hex.EncodeToString(acc.Sum(nil)[:32]); got != exp {
t.Errorf("got %s, want %s", got, exp)
}
}
func TestCSHAKELargeS(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
// See https://go.dev/issue/66232.
const s = (1<<32)/8 + 1000 // s * 8 > 2^32
S := make([]byte, s)
rnd := NewShake128()
rnd.Read(S)
c := NewCShake128(nil, S)
io.CopyN(c, rnd, 1000)
// Generated with pycryptodome@3.20.0
//
// from Crypto.Hash import cSHAKE128
// rng = cSHAKE128.new()
// S = rng.read(536871912)
// c = cSHAKE128.new(custom=S)
// c.update(rng.read(1000))
// print(c.read(32).hex())
//
exp := "2cb9f237767e98f2614b8779cf096a52da9b3a849280bbddec820771ae529cf0"
if got := hex.EncodeToString(c.Sum(nil)); got != exp {
t.Errorf("got %s, want %s", got, exp)
}
}
func TestMarshalUnmarshal(t *testing.T) {
t.Run("SHA3-224", func(t *testing.T) { testMarshalUnmarshal(t, New224()) })
t.Run("SHA3-256", func(t *testing.T) { testMarshalUnmarshal(t, New256()) })
t.Run("SHA3-384", func(t *testing.T) { testMarshalUnmarshal(t, New384()) })
t.Run("SHA3-512", func(t *testing.T) { testMarshalUnmarshal(t, New512()) })
t.Run("SHAKE128", func(t *testing.T) { testMarshalUnmarshal(t, NewShake128()) })
t.Run("SHAKE256", func(t *testing.T) { testMarshalUnmarshal(t, NewShake256()) })
t.Run("cSHAKE128", func(t *testing.T) { testMarshalUnmarshal(t, NewCShake128([]byte("N"), []byte("S"))) })
t.Run("cSHAKE256", func(t *testing.T) { testMarshalUnmarshal(t, NewCShake256([]byte("N"), []byte("S"))) })
t.Run("Keccak-256", func(t *testing.T) { testMarshalUnmarshal(t, NewLegacyKeccak256()) })
t.Run("Keccak-512", func(t *testing.T) { testMarshalUnmarshal(t, NewLegacyKeccak512()) })
}
// TODO(filippo): move this to crypto/internal/cryptotest.
func testMarshalUnmarshal(t *testing.T, h hash.Hash) {
buf := make([]byte, 200)
rand.Read(buf)
n := rand.Intn(200)
h.Write(buf)
want := h.Sum(nil)
h.Reset()
h.Write(buf[:n])
b, err := h.(encoding.BinaryMarshaler).MarshalBinary()
if err != nil {
t.Errorf("MarshalBinary: %v", err)
}
h.Write(bytes.Repeat([]byte{0}, 200))
if err := h.(encoding.BinaryUnmarshaler).UnmarshalBinary(b); err != nil {
t.Errorf("UnmarshalBinary: %v", err)
}
h.Write(buf[n:])
got := h.Sum(nil)
if !bytes.Equal(got, want) {
t.Errorf("got %x, want %x", got, want)
}
}
// BenchmarkPermutationFunction measures the speed of the permutation function
// with no input data.
func BenchmarkPermutationFunction(b *testing.B) {
+51 -32
View File
@@ -16,9 +16,12 @@ package sha3
// [2] https://doi.org/10.6028/NIST.SP.800-185
import (
"bytes"
"encoding/binary"
"errors"
"hash"
"io"
"math/bits"
)
// ShakeHash defines the interface to hash functions that support
@@ -50,41 +53,33 @@ type cshakeState struct {
initBlock []byte
}
// Consts for configuring initial SHA-3 state
const (
dsbyteShake = 0x1f
dsbyteCShake = 0x04
rate128 = 168
rate256 = 136
)
func bytepad(input []byte, w int) []byte {
// leftEncode always returns max 9 bytes
buf := make([]byte, 0, 9+len(input)+w)
buf = append(buf, leftEncode(uint64(w))...)
buf = append(buf, input...)
padlen := w - (len(buf) % w)
return append(buf, make([]byte, padlen)...)
func bytepad(data []byte, rate int) []byte {
out := make([]byte, 0, 9+len(data)+rate-1)
out = append(out, leftEncode(uint64(rate))...)
out = append(out, data...)
if padlen := rate - len(out)%rate; padlen < rate {
out = append(out, make([]byte, padlen)...)
}
return out
}
func leftEncode(value uint64) []byte {
var b [9]byte
binary.BigEndian.PutUint64(b[1:], value)
// Trim all but last leading zero bytes
i := byte(1)
for i < 8 && b[i] == 0 {
i++
func leftEncode(x uint64) []byte {
// Let n be the smallest positive integer for which 2^(8n) > x.
n := (bits.Len64(x) + 7) / 8
if n == 0 {
n = 1
}
// Prepend number of encoded bytes
b[i-1] = 9 - i
return b[i-1:]
// Return n || x with n as a byte and x an n bytes in big-endian order.
b := make([]byte, 9)
binary.BigEndian.PutUint64(b[1:], x)
b = b[9-n-1:]
b[0] = byte(n)
return b
}
func newCShake(N, S []byte, rate, outputLen int, dsbyte byte) ShakeHash {
c := cshakeState{state: &state{rate: rate, outputLen: outputLen, dsbyte: dsbyte}}
// leftEncode returns max 9 bytes
c.initBlock = make([]byte, 0, 9*2+len(N)+len(S))
c.initBlock = make([]byte, 0, 9+len(N)+9+len(S)) // leftEncode returns max 9 bytes
c.initBlock = append(c.initBlock, leftEncode(uint64(len(N))*8)...)
c.initBlock = append(c.initBlock, N...)
c.initBlock = append(c.initBlock, leftEncode(uint64(len(S))*8)...)
@@ -111,6 +106,30 @@ func (c *state) Clone() ShakeHash {
return c.clone()
}
func (c *cshakeState) MarshalBinary() ([]byte, error) {
return c.AppendBinary(make([]byte, 0, marshaledSize+len(c.initBlock)))
}
func (c *cshakeState) AppendBinary(b []byte) ([]byte, error) {
b, err := c.state.AppendBinary(b)
if err != nil {
return nil, err
}
b = append(b, c.initBlock...)
return b, nil
}
func (c *cshakeState) UnmarshalBinary(b []byte) error {
if len(b) <= marshaledSize {
return errors.New("sha3: invalid hash state")
}
if err := c.state.UnmarshalBinary(b[:marshaledSize]); err != nil {
return err
}
c.initBlock = bytes.Clone(b[marshaledSize:])
return nil
}
// NewShake128 creates a new SHAKE128 variable-output-length ShakeHash.
// Its generic security strength is 128 bits against all attacks if at
// least 32 bytes of its output are used.
@@ -126,11 +145,11 @@ func NewShake256() ShakeHash {
}
func newShake128Generic() *state {
return &state{rate: rate128, outputLen: 32, dsbyte: dsbyteShake}
return &state{rate: rateK256, outputLen: 32, dsbyte: dsbyteShake}
}
func newShake256Generic() *state {
return &state{rate: rate256, outputLen: 64, dsbyte: dsbyteShake}
return &state{rate: rateK512, outputLen: 64, dsbyte: dsbyteShake}
}
// NewCShake128 creates a new instance of cSHAKE128 variable-output-length ShakeHash,
@@ -143,7 +162,7 @@ func NewCShake128(N, S []byte) ShakeHash {
if len(N) == 0 && len(S) == 0 {
return NewShake128()
}
return newCShake(N, S, rate128, 32, dsbyteCShake)
return newCShake(N, S, rateK256, 32, dsbyteCShake)
}
// NewCShake256 creates a new instance of cSHAKE256 variable-output-length ShakeHash,
@@ -156,7 +175,7 @@ func NewCShake256(N, S []byte) ShakeHash {
if len(N) == 0 && len(S) == 0 {
return NewShake256()
}
return newCShake(N, S, rate256, 64, dsbyteCShake)
return newCShake(N, S, rateK512, 64, dsbyteCShake)
}
// ShakeSum128 writes an arbitrary-length digest of data into hash.
-40
View File
@@ -1,40 +0,0 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package sha3
import (
"crypto/subtle"
"encoding/binary"
"unsafe"
"golang.org/x/sys/cpu"
)
// xorIn xors the bytes in buf into the state.
func xorIn(d *state, buf []byte) {
if cpu.IsBigEndian {
for i := 0; len(buf) >= 8; i++ {
a := binary.LittleEndian.Uint64(buf)
d.a[i] ^= a
buf = buf[8:]
}
} else {
ab := (*[25 * 64 / 8]byte)(unsafe.Pointer(&d.a))
subtle.XORBytes(ab[:], ab[:], buf)
}
}
// copyOut copies uint64s to a byte buffer.
func copyOut(d *state, b []byte) {
if cpu.IsBigEndian {
for i := 0; len(b) >= 8; i++ {
binary.LittleEndian.PutUint64(b, d.a[i])
b = b[8:]
}
} else {
ab := (*[25 * 64 / 8]byte)(unsafe.Pointer(&d.a))
copy(b, ab[:])
}
}
+11 -11
View File
@@ -555,7 +555,7 @@ func (c *client) insertKey(s interface{}, comment string, constraints []byte) er
})
case *dsa.PrivateKey:
req = ssh.Marshal(dsaKeyMsg{
Type: ssh.KeyAlgoDSA,
Type: ssh.InsecureKeyAlgoDSA,
P: k.P,
Q: k.Q,
G: k.G,
@@ -803,16 +803,16 @@ var _ ssh.AlgorithmSigner = &agentKeyringSigner{}
//
// This map must be kept in sync with the one in certs.go.
var certKeyAlgoNames = map[string]string{
ssh.CertAlgoRSAv01: ssh.KeyAlgoRSA,
ssh.CertAlgoRSASHA256v01: ssh.KeyAlgoRSASHA256,
ssh.CertAlgoRSASHA512v01: ssh.KeyAlgoRSASHA512,
ssh.CertAlgoDSAv01: ssh.KeyAlgoDSA,
ssh.CertAlgoECDSA256v01: ssh.KeyAlgoECDSA256,
ssh.CertAlgoECDSA384v01: ssh.KeyAlgoECDSA384,
ssh.CertAlgoECDSA521v01: ssh.KeyAlgoECDSA521,
ssh.CertAlgoSKECDSA256v01: ssh.KeyAlgoSKECDSA256,
ssh.CertAlgoED25519v01: ssh.KeyAlgoED25519,
ssh.CertAlgoSKED25519v01: ssh.KeyAlgoSKED25519,
ssh.CertAlgoRSAv01: ssh.KeyAlgoRSA,
ssh.CertAlgoRSASHA256v01: ssh.KeyAlgoRSASHA256,
ssh.CertAlgoRSASHA512v01: ssh.KeyAlgoRSASHA512,
ssh.InsecureCertAlgoDSAv01: ssh.InsecureKeyAlgoDSA,
ssh.CertAlgoECDSA256v01: ssh.KeyAlgoECDSA256,
ssh.CertAlgoECDSA384v01: ssh.KeyAlgoECDSA384,
ssh.CertAlgoECDSA521v01: ssh.KeyAlgoECDSA521,
ssh.CertAlgoSKECDSA256v01: ssh.KeyAlgoSKECDSA256,
ssh.CertAlgoED25519v01: ssh.KeyAlgoED25519,
ssh.CertAlgoSKED25519v01: ssh.KeyAlgoSKED25519,
}
// underlyingAlgo returns the signature algorithm associated with algo (which is
+2 -2
View File
@@ -506,7 +506,7 @@ func (s *server) insertIdentity(req []byte) error {
switch record.Type {
case ssh.KeyAlgoRSA:
addedKey, err = parseRSAKey(req)
case ssh.KeyAlgoDSA:
case ssh.InsecureKeyAlgoDSA:
addedKey, err = parseDSAKey(req)
case ssh.KeyAlgoECDSA256, ssh.KeyAlgoECDSA384, ssh.KeyAlgoECDSA521:
addedKey, err = parseECDSAKey(req)
@@ -514,7 +514,7 @@ func (s *server) insertIdentity(req []byte) error {
addedKey, err = parseEd25519Key(req)
case ssh.CertAlgoRSAv01:
addedKey, err = parseRSACert(req)
case ssh.CertAlgoDSAv01:
case ssh.InsecureCertAlgoDSAv01:
addedKey, err = parseDSACert(req)
case ssh.CertAlgoECDSA256v01, ssh.CertAlgoECDSA384v01, ssh.CertAlgoECDSA521v01:
addedKey, err = parseECDSACert(req)
+40 -27
View File
@@ -20,14 +20,19 @@ import (
// returned by MultiAlgorithmSigner and don't appear in the Signature.Format
// field.
const (
CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com"
CertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com"
CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com"
CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com"
CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com"
CertAlgoSKECDSA256v01 = "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com"
CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com"
CertAlgoSKED25519v01 = "sk-ssh-ed25519-cert-v01@openssh.com"
CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com"
// Deprecated: DSA is only supported at insecure key sizes, and was removed
// from major implementations.
CertAlgoDSAv01 = InsecureCertAlgoDSAv01
// Deprecated: DSA is only supported at insecure key sizes, and was removed
// from major implementations.
InsecureCertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com"
CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com"
CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com"
CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com"
CertAlgoSKECDSA256v01 = "sk-ecdsa-sha2-nistp256-cert-v01@openssh.com"
CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com"
CertAlgoSKED25519v01 = "sk-ssh-ed25519-cert-v01@openssh.com"
// CertAlgoRSASHA256v01 and CertAlgoRSASHA512v01 can't appear as a
// Certificate.Type (or PublicKey.Type), but only in
@@ -228,7 +233,11 @@ func parseCert(in []byte, privAlgo string) (*Certificate, error) {
if err != nil {
return nil, err
}
// The Type() function is intended to return only certificate key types, but
// we use certKeyAlgoNames anyway for safety, to match [Certificate.Type].
if _, ok := certKeyAlgoNames[k.Type()]; ok {
return nil, fmt.Errorf("ssh: the signature key type %q is invalid for certificates", k.Type())
}
c.SignatureKey = k
c.Signature, rest, ok = parseSignatureBody(g.Signature)
if !ok || len(rest) > 0 {
@@ -296,16 +305,13 @@ type CertChecker struct {
SupportedCriticalOptions []string
// IsUserAuthority should return true if the key is recognized as an
// authority for the given user certificate. This allows for
// certificates to be signed by other certificates. This must be set
// if this CertChecker will be checking user certificates.
// authority for user certificate. This must be set if this CertChecker
// will be checking user certificates.
IsUserAuthority func(auth PublicKey) bool
// IsHostAuthority should report whether the key is recognized as
// an authority for this host. This allows for certificates to be
// signed by other keys, and for those other keys to only be valid
// signers for particular hostnames. This must be set if this
// CertChecker will be checking host certificates.
// an authority for this host. This must be set if this CertChecker
// will be checking host certificates.
IsHostAuthority func(auth PublicKey, address string) bool
// Clock is used for verifying time stamps. If nil, time.Now
@@ -442,12 +448,19 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error {
// SignCert signs the certificate with an authority, setting the Nonce,
// SignatureKey, and Signature fields. If the authority implements the
// MultiAlgorithmSigner interface the first algorithm in the list is used. This
// is useful if you want to sign with a specific algorithm.
// is useful if you want to sign with a specific algorithm. As specified in
// [SSH-CERTS], Section 2.1.1, authority can't be a [Certificate].
func (c *Certificate) SignCert(rand io.Reader, authority Signer) error {
c.Nonce = make([]byte, 32)
if _, err := io.ReadFull(rand, c.Nonce); err != nil {
return err
}
// The Type() function is intended to return only certificate key types, but
// we use certKeyAlgoNames anyway for safety, to match [Certificate.Type].
if _, ok := certKeyAlgoNames[authority.PublicKey().Type()]; ok {
return fmt.Errorf("ssh: certificates cannot be used as authority (public key type %q)",
authority.PublicKey().Type())
}
c.SignatureKey = authority.PublicKey()
if v, ok := authority.(MultiAlgorithmSigner); ok {
@@ -485,16 +498,16 @@ func (c *Certificate) SignCert(rand io.Reader, authority Signer) error {
//
// This map must be kept in sync with the one in agent/client.go.
var certKeyAlgoNames = map[string]string{
CertAlgoRSAv01: KeyAlgoRSA,
CertAlgoRSASHA256v01: KeyAlgoRSASHA256,
CertAlgoRSASHA512v01: KeyAlgoRSASHA512,
CertAlgoDSAv01: KeyAlgoDSA,
CertAlgoECDSA256v01: KeyAlgoECDSA256,
CertAlgoECDSA384v01: KeyAlgoECDSA384,
CertAlgoECDSA521v01: KeyAlgoECDSA521,
CertAlgoSKECDSA256v01: KeyAlgoSKECDSA256,
CertAlgoED25519v01: KeyAlgoED25519,
CertAlgoSKED25519v01: KeyAlgoSKED25519,
CertAlgoRSAv01: KeyAlgoRSA,
CertAlgoRSASHA256v01: KeyAlgoRSASHA256,
CertAlgoRSASHA512v01: KeyAlgoRSASHA512,
InsecureCertAlgoDSAv01: InsecureKeyAlgoDSA,
CertAlgoECDSA256v01: KeyAlgoECDSA256,
CertAlgoECDSA384v01: KeyAlgoECDSA384,
CertAlgoECDSA521v01: KeyAlgoECDSA521,
CertAlgoSKECDSA256v01: KeyAlgoSKECDSA256,
CertAlgoED25519v01: KeyAlgoED25519,
CertAlgoSKED25519v01: KeyAlgoSKED25519,
}
// underlyingAlgo returns the signature algorithm associated with algo (which is
+36 -9
View File
@@ -15,14 +15,12 @@ import (
"reflect"
"testing"
"time"
"golang.org/x/crypto/ssh/testdata"
)
// Cert generated by ssh-keygen 6.0p1 Debian-4.
// % ssh-keygen -s ca-key -I test user-key
const exampleSSHCert = `ssh-rsa-cert-v01@openssh.com AAAAHHNzaC1yc2EtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgb1srW/W3ZDjYAO45xLYAwzHBDLsJ4Ux6ICFIkTjb1LEAAAADAQABAAAAYQCkoR51poH0wE8w72cqSB8Sszx+vAhzcMdCO0wqHTj7UNENHWEXGrU0E0UQekD7U+yhkhtoyjbPOVIP7hNa6aRk/ezdh/iUnCIt4Jt1v3Z1h1P+hA4QuYFMHNB+rmjPwAcAAAAAAAAAAAAAAAEAAAAEdGVzdAAAAAAAAAAAAAAAAP//////////AAAAAAAAAIIAAAAVcGVybWl0LVgxMS1mb3J3YXJkaW5nAAAAAAAAABdwZXJtaXQtYWdlbnQtZm9yd2FyZGluZwAAAAAAAAAWcGVybWl0LXBvcnQtZm9yd2FyZGluZwAAAAAAAAAKcGVybWl0LXB0eQAAAAAAAAAOcGVybWl0LXVzZXItcmMAAAAAAAAAAAAAAHcAAAAHc3NoLXJzYQAAAAMBAAEAAABhANFS2kaktpSGc+CcmEKPyw9mJC4nZKxHKTgLVZeaGbFZOvJTNzBspQHdy7Q1uKSfktxpgjZnksiu/tFF9ngyY2KFoc+U88ya95IZUycBGCUbBQ8+bhDtw/icdDGQD5WnUwAAAG8AAAAHc3NoLXJzYQAAAGC8Y9Z2LQKhIhxf52773XaWrXdxP0t3GBVo4A10vUWiYoAGepr6rQIoGGXFxT4B9Gp+nEBJjOwKDXPrAevow0T9ca8gZN+0ykbhSrXLE5Ao48rqr3zP4O1/9P7e6gp0gw8=`
func TestParseCert(t *testing.T) {
authKeyBytes := []byte(exampleSSHCert)
authKeyBytes := bytes.TrimSuffix(testdata.SSHCertificates["rsa"], []byte(" host.example.com\n"))
key, _, _, rest, err := ParseAuthorizedKey(authKeyBytes)
if err != nil {
@@ -103,7 +101,7 @@ func TestParseCertWithOptions(t *testing.T) {
}
func TestValidateCert(t *testing.T) {
key, _, _, _, err := ParseAuthorizedKey([]byte(exampleSSHCert))
key, _, _, _, err := ParseAuthorizedKey(testdata.SSHCertificates["rsa-user-testcertificate"])
if err != nil {
t.Fatalf("ParseAuthorizedKey: %v", err)
}
@@ -116,7 +114,7 @@ func TestValidateCert(t *testing.T) {
return bytes.Equal(k.Marshal(), validCert.SignatureKey.Marshal())
}
if err := checker.CheckCert("user", validCert); err != nil {
if err := checker.CheckCert("testcertificate", validCert); err != nil {
t.Errorf("Unable to validate certificate: %v", err)
}
invalidCert := &Certificate{
@@ -125,7 +123,7 @@ func TestValidateCert(t *testing.T) {
ValidBefore: CertTimeInfinity,
Signature: &Signature{},
}
if err := checker.CheckCert("user", invalidCert); err == nil {
if err := checker.CheckCert("testcertificate", invalidCert); err == nil {
t.Error("Invalid cert signature passed validation")
}
}
@@ -299,7 +297,7 @@ func TestCertTypes(t *testing.T) {
{"legacyRSASigner", &legacyRSASigner{testSigners["rsa"]}, KeyAlgoRSA},
{"multiAlgoRSASignerSHA256", multiAlgoSignerSHA256, KeyAlgoRSASHA256},
{"multiAlgoRSASignerSHA512", multiAlgoSignerSHA512, KeyAlgoRSASHA512},
{CertAlgoDSAv01, testSigners["dsa"], ""},
{InsecureCertAlgoDSAv01, testSigners["dsa"], ""},
}
k, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
@@ -406,3 +404,32 @@ func TestCertSignWithMultiAlgorithmSigner(t *testing.T) {
})
}
}
func TestCertSignWithCertificate(t *testing.T) {
cert := &Certificate{
Key: testPublicKeys["rsa"],
ValidBefore: CertTimeInfinity,
CertType: UserCert,
}
if err := cert.SignCert(rand.Reader, testSigners["ecdsa"]); err != nil {
t.Fatalf("SignCert: %v", err)
}
signer, err := NewSignerWithAlgorithms(testSigners["rsa"].(AlgorithmSigner), []string{KeyAlgoRSASHA256})
if err != nil {
t.Fatal(err)
}
certSigner, err := NewCertSigner(cert, signer)
if err != nil {
t.Fatalf("NewCertSigner: %v", err)
}
cert1 := &Certificate{
Key: testPublicKeys["ecdsa"],
ValidBefore: CertTimeInfinity,
CertType: UserCert,
}
if err := cert1.SignCert(rand.Reader, certSigner); err == nil {
t.Fatal("successfully signed a certificate using another certificate, it is expected to fail")
}
}
+19 -21
View File
@@ -58,11 +58,11 @@ func newRC4(key, iv []byte) (cipher.Stream, error) {
type cipherMode struct {
keySize int
ivSize int
create func(key, iv []byte, macKey []byte, algs directionAlgorithms) (packetCipher, error)
create func(key, iv []byte, macKey []byte, algs DirectionAlgorithms) (packetCipher, error)
}
func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream, error)) func(key, iv []byte, macKey []byte, algs directionAlgorithms) (packetCipher, error) {
return func(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) {
func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream, error)) func(key, iv []byte, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) {
return func(key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) {
stream, err := createFunc(key, iv)
if err != nil {
return nil, err
@@ -98,36 +98,36 @@ func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream,
var cipherModes = map[string]*cipherMode{
// Ciphers from RFC 4344, which introduced many CTR-based ciphers. Algorithms
// are defined in the order specified in the RFC.
"aes128-ctr": {16, aes.BlockSize, streamCipherMode(0, newAESCTR)},
"aes192-ctr": {24, aes.BlockSize, streamCipherMode(0, newAESCTR)},
"aes256-ctr": {32, aes.BlockSize, streamCipherMode(0, newAESCTR)},
CipherAES128CTR: {16, aes.BlockSize, streamCipherMode(0, newAESCTR)},
CipherAES192CTR: {24, aes.BlockSize, streamCipherMode(0, newAESCTR)},
CipherAES256CTR: {32, aes.BlockSize, streamCipherMode(0, newAESCTR)},
// Ciphers from RFC 4345, which introduces security-improved arcfour ciphers.
// They are defined in the order specified in the RFC.
"arcfour128": {16, 0, streamCipherMode(1536, newRC4)},
"arcfour256": {32, 0, streamCipherMode(1536, newRC4)},
InsecureCipherRC4128: {16, 0, streamCipherMode(1536, newRC4)},
InsecureCipherRC4256: {32, 0, streamCipherMode(1536, newRC4)},
// Cipher defined in RFC 4253, which describes SSH Transport Layer Protocol.
// Note that this cipher is not safe, as stated in RFC 4253: "Arcfour (and
// RC4) has problems with weak keys, and should be used with caution."
// RFC 4345 introduces improved versions of Arcfour.
"arcfour": {16, 0, streamCipherMode(0, newRC4)},
InsecureCipherRC4: {16, 0, streamCipherMode(0, newRC4)},
// AEAD ciphers
gcm128CipherID: {16, 12, newGCMCipher},
gcm256CipherID: {32, 12, newGCMCipher},
chacha20Poly1305ID: {64, 0, newChaCha20Cipher},
CipherAES128GCM: {16, 12, newGCMCipher},
CipherAES256GCM: {32, 12, newGCMCipher},
CipherChaCha20Poly1305: {64, 0, newChaCha20Cipher},
// CBC mode is insecure and so is not included in the default config.
// (See https://www.ieee-security.org/TC/SP2013/papers/4977a526.pdf). If absolutely
// needed, it's possible to specify a custom Config to enable it.
// You should expect that an active attacker can recover plaintext if
// you do.
aes128cbcID: {16, aes.BlockSize, newAESCBCCipher},
InsecureCipherAES128CBC: {16, aes.BlockSize, newAESCBCCipher},
// 3des-cbc is insecure and is not included in the default
// config.
tripledescbcID: {24, des.BlockSize, newTripleDESCBCCipher},
InsecureCipherTripleDESCBC: {24, des.BlockSize, newTripleDESCBCCipher},
}
// prefixLen is the length of the packet prefix that contains the packet length
@@ -307,7 +307,7 @@ type gcmCipher struct {
buf []byte
}
func newGCMCipher(key, iv, unusedMacKey []byte, unusedAlgs directionAlgorithms) (packetCipher, error) {
func newGCMCipher(key, iv, unusedMacKey []byte, unusedAlgs DirectionAlgorithms) (packetCipher, error) {
c, err := aes.NewCipher(key)
if err != nil {
return nil, err
@@ -429,7 +429,7 @@ type cbcCipher struct {
oracleCamouflage uint32
}
func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) {
func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) {
cbc := &cbcCipher{
mac: macModes[algs.MAC].new(macKey),
decrypter: cipher.NewCBCDecrypter(c, iv),
@@ -443,7 +443,7 @@ func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs directionAlgorith
return cbc, nil
}
func newAESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) {
func newAESCBCCipher(key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) {
c, err := aes.NewCipher(key)
if err != nil {
return nil, err
@@ -457,7 +457,7 @@ func newAESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCi
return cbc, nil
}
func newTripleDESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) {
func newTripleDESCBCCipher(key, iv, macKey []byte, algs DirectionAlgorithms) (packetCipher, error) {
c, err := des.NewTripleDESCipher(key)
if err != nil {
return nil, err
@@ -635,8 +635,6 @@ func (c *cbcCipher) writeCipherPacket(seqNum uint32, w io.Writer, rand io.Reader
return nil
}
const chacha20Poly1305ID = "chacha20-poly1305@openssh.com"
// chacha20Poly1305Cipher implements the chacha20-poly1305@openssh.com
// AEAD, which is described here:
//
@@ -650,7 +648,7 @@ type chacha20Poly1305Cipher struct {
buf []byte
}
func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs directionAlgorithms) (packetCipher, error) {
func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs DirectionAlgorithms) (packetCipher, error) {
if len(key) != 64 {
panic(len(key))
}
+14 -14
View File
@@ -22,7 +22,7 @@ func TestDefaultCiphersExist(t *testing.T) {
t.Errorf("supported cipher %q is unknown", cipherAlgo)
}
}
for _, cipherAlgo := range preferredCiphers {
for _, cipherAlgo := range defaultCiphers {
if _, ok := cipherModes[cipherAlgo]; !ok {
t.Errorf("preferred cipher %q is unknown", cipherAlgo)
}
@@ -30,8 +30,8 @@ func TestDefaultCiphersExist(t *testing.T) {
}
func TestPacketCiphers(t *testing.T) {
defaultMac := "hmac-sha2-256"
defaultCipher := "aes128-ctr"
defaultMac := HMACSHA256
defaultCipher := CipherAES128CTR
for cipher := range cipherModes {
t.Run("cipher="+cipher,
func(t *testing.T) { testPacketCipher(t, cipher, defaultMac) })
@@ -44,10 +44,10 @@ func TestPacketCiphers(t *testing.T) {
func testPacketCipher(t *testing.T, cipher, mac string) {
kr := &kexResult{Hash: crypto.SHA1}
algs := directionAlgorithms{
algs := DirectionAlgorithms{
Cipher: cipher,
MAC: mac,
Compression: "none",
compression: compressionNone,
}
client, err := newPacketCipher(clientKeys, algs, kr)
if err != nil {
@@ -77,10 +77,10 @@ func testPacketCipher(t *testing.T, cipher, mac string) {
func TestCBCOracleCounterMeasure(t *testing.T) {
kr := &kexResult{Hash: crypto.SHA1}
algs := directionAlgorithms{
Cipher: aes128cbcID,
MAC: "hmac-sha1",
Compression: "none",
algs := DirectionAlgorithms{
Cipher: InsecureCipherAES128CBC,
MAC: HMACSHA1,
compression: compressionNone,
}
client, err := newPacketCipher(clientKeys, algs, kr)
if err != nil {
@@ -141,7 +141,7 @@ func TestCVE202143565(t *testing.T) {
constructPacket func(packetCipher) io.Reader
}{
{
cipher: gcm128CipherID,
cipher: CipherAES128GCM,
constructPacket: func(client packetCipher) io.Reader {
internalCipher := client.(*gcmCipher)
b := &bytes.Buffer{}
@@ -159,7 +159,7 @@ func TestCVE202143565(t *testing.T) {
},
},
{
cipher: chacha20Poly1305ID,
cipher: CipherChaCha20Poly1305,
constructPacket: func(client packetCipher) io.Reader {
internalCipher := client.(*chacha20Poly1305Cipher)
b := &bytes.Buffer{}
@@ -201,13 +201,13 @@ func TestCVE202143565(t *testing.T) {
}
for _, tc := range tests {
mac := "hmac-sha2-256"
mac := HMACSHA256
kr := &kexResult{Hash: crypto.SHA1}
algs := directionAlgorithms{
algs := DirectionAlgorithms{
Cipher: tc.cipher,
MAC: mac,
Compression: "none",
compression: compressionNone,
}
client, err := newPacketCipher(clientKeys, algs, kr)
if err != nil {
+1
View File
@@ -110,6 +110,7 @@ func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) e
}
c.sessionID = c.transport.getSessionID()
c.algorithms = c.transport.getAlgorithms()
return c.clientAuthenticate(config)
}
+6 -1
View File
@@ -289,7 +289,7 @@ func pickSignatureAlgorithm(signer Signer, extensions map[string][]byte) (MultiA
}
}
algo, err := findCommon("public key signature algorithm", keyAlgos, serverAlgos)
algo, err := findCommon("public key signature algorithm", keyAlgos, serverAlgos, true)
if err != nil {
// If there is no overlap, return the fallback algorithm to support
// servers that fail to list all supported algorithms.
@@ -555,6 +555,7 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe
}
gotMsgExtInfo := false
gotUserAuthInfoRequest := false
for {
packet, err := c.readPacket()
if err != nil {
@@ -585,6 +586,9 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe
if msg.PartialSuccess {
return authPartialSuccess, msg.Methods, nil
}
if !gotUserAuthInfoRequest {
return authFailure, msg.Methods, unexpectedMessageError(msgUserAuthInfoRequest, packet[0])
}
return authFailure, msg.Methods, nil
case msgUserAuthSuccess:
return authSuccess, nil, nil
@@ -596,6 +600,7 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe
if err := Unmarshal(packet, &msg); err != nil {
return authFailure, nil, err
}
gotUserAuthInfoRequest = true
// Manually unpack the prompt/echo pairs.
rest := msg.Prompts
+94 -2
View File
@@ -38,7 +38,7 @@ func tryAuth(t *testing.T, config *ClientConfig) error {
return err
}
// tryAuth runs a handshake with a given config against an SSH server
// tryAuthWithGSSAPIWithMICConfig runs a handshake with a given config against an SSH server
// with a given GSSAPIWithMICConfig and config serverConfig. Returns both client and server side errors.
func tryAuthWithGSSAPIWithMICConfig(t *testing.T, clientConfig *ClientConfig, gssAPIWithMICConfig *GSSAPIWithMICConfig) error {
err, _ := tryAuthBothSides(t, clientConfig, gssAPIWithMICConfig)
@@ -324,6 +324,9 @@ func TestMethodInvalidAlgorithm(t *testing.T) {
}
func TestClientHMAC(t *testing.T) {
supportedAlgos := SupportedAlgorithms()
insecureAlgos := InsecureAlgorithms()
supportedMACs := append(supportedAlgos.MACs, insecureAlgos.MACs...)
for _, mac := range supportedMACs {
config := &ClientConfig{
User: "testuser",
@@ -349,7 +352,7 @@ func TestClientUnsupportedCipher(t *testing.T) {
PublicKeys(),
},
Config: Config{
Ciphers: []string{"aes128-cbc"}, // not currently supported
Ciphers: []string{"unsupported-cipher"}, // not currently supported
},
}
if err := tryAuth(t, config); err == nil {
@@ -1293,3 +1296,92 @@ func TestCertAuthOpenSSHCompat(t *testing.T) {
t.Fatalf("unable to dial remote side: %s", err)
}
}
func TestKeyboardInteractiveAuthEarlyFail(t *testing.T) {
const maxAuthTries = 2
c1, c2, err := netPipe()
if err != nil {
t.Fatalf("netPipe: %v", err)
}
defer c1.Close()
defer c2.Close()
// Start testserver
serverConfig := &ServerConfig{
MaxAuthTries: maxAuthTries,
KeyboardInteractiveCallback: func(c ConnMetadata,
client KeyboardInteractiveChallenge) (*Permissions, error) {
// Fail keyboard-interactive authentication early before
// any prompt is sent to client.
return nil, errors.New("keyboard-interactive auth failed")
},
PasswordCallback: func(c ConnMetadata,
pass []byte) (*Permissions, error) {
if string(pass) == clientPassword {
return nil, nil
}
return nil, errors.New("password auth failed")
},
}
serverConfig.AddHostKey(testSigners["rsa"])
serverDone := make(chan struct{})
go func() {
defer func() { serverDone <- struct{}{} }()
conn, chans, reqs, err := NewServerConn(c2, serverConfig)
if err != nil {
return
}
_ = conn.Close()
discarderDone := make(chan struct{})
go func() {
defer func() { discarderDone <- struct{}{} }()
DiscardRequests(reqs)
}()
for newChannel := range chans {
newChannel.Reject(Prohibited,
"testserver not accepting requests")
}
<-discarderDone
}()
// Connect to testserver, expect KeyboardInteractive() to be not called,
// PasswordCallback() to be called and connection to succeed.
passwordCallbackCalled := false
clientConfig := &ClientConfig{
User: "testuser",
Auth: []AuthMethod{
RetryableAuthMethod(KeyboardInteractive(func(name,
instruction string, questions []string,
echos []bool) ([]string, error) {
t.Errorf("unexpected call to KeyboardInteractive()")
return []string{clientPassword}, nil
}), maxAuthTries),
RetryableAuthMethod(PasswordCallback(func() (secret string,
err error) {
t.Logf("PasswordCallback()")
passwordCallbackCalled = true
return clientPassword, nil
}), maxAuthTries),
},
HostKeyCallback: InsecureIgnoreHostKey(),
}
conn, _, _, err := NewClientConn(c1, "", clientConfig)
if err != nil {
t.Errorf("unexpected NewClientConn() error: %v", err)
}
if conn != nil {
conn.Close()
}
// Wait for server to finish.
<-serverDone
if !passwordCallbackCalled {
t.Errorf("expected PasswordCallback() to be called")
}
}
+5 -5
View File
@@ -292,7 +292,7 @@ func TestUnsupportedAlgorithm(t *testing.T) {
{
"unsupported and supported KEXs",
Config{
KeyExchanges: []string{"unsupported", kexAlgoCurve25519SHA256},
KeyExchanges: []string{"unsupported", KeyExchangeCurve25519},
},
"",
},
@@ -306,7 +306,7 @@ func TestUnsupportedAlgorithm(t *testing.T) {
{
"unsupported and supported ciphers",
Config{
Ciphers: []string{"unsupported", chacha20Poly1305ID},
Ciphers: []string{"unsupported", CipherChaCha20Poly1305},
},
"",
},
@@ -315,16 +315,16 @@ func TestUnsupportedAlgorithm(t *testing.T) {
Config{
MACs: []string{"unsupported"},
// MAC is used for non AAED ciphers.
Ciphers: []string{"aes256-ctr"},
Ciphers: []string{CipherAES256CTR},
},
"no common algorithm",
},
{
"unsupported and supported MACs",
Config{
MACs: []string{"unsupported", "hmac-sha2-256-etm@openssh.com"},
MACs: []string{"unsupported", HMACSHA256ETM},
// MAC is used for non AAED ciphers.
Ciphers: []string{"aes256-ctr"},
Ciphers: []string{CipherAES256CTR},
},
"",
},
+309 -107
View File
@@ -10,6 +10,7 @@ import (
"fmt"
"io"
"math"
"slices"
"sync"
_ "crypto/sha1"
@@ -24,69 +25,260 @@ const (
serviceSSH = "ssh-connection"
)
// supportedCiphers lists ciphers we support but might not recommend.
var supportedCiphers = []string{
"aes128-ctr", "aes192-ctr", "aes256-ctr",
"aes128-gcm@openssh.com", gcm256CipherID,
chacha20Poly1305ID,
"arcfour256", "arcfour128", "arcfour",
aes128cbcID,
tripledescbcID,
// The ciphers currently or previously implemented by this library, to use in
// [Config.Ciphers]. For a list, see the [Algorithms.Ciphers] returned by
// [SupportedAlgorithms] or [InsecureAlgorithms].
const (
CipherAES128GCM = "aes128-gcm@openssh.com"
CipherAES256GCM = "aes256-gcm@openssh.com"
CipherChaCha20Poly1305 = "chacha20-poly1305@openssh.com"
CipherAES128CTR = "aes128-ctr"
CipherAES192CTR = "aes192-ctr"
CipherAES256CTR = "aes256-ctr"
InsecureCipherAES128CBC = "aes128-cbc"
InsecureCipherTripleDESCBC = "3des-cbc"
InsecureCipherRC4 = "arcfour"
InsecureCipherRC4128 = "arcfour128"
InsecureCipherRC4256 = "arcfour256"
)
// The key exchanges currently or previously implemented by this library, to use
// in [Config.KeyExchanges]. For a list, see the
// [Algorithms.KeyExchanges] returned by [SupportedAlgorithms] or
// [InsecureAlgorithms].
const (
InsecureKeyExchangeDH1SHA1 = "diffie-hellman-group1-sha1"
InsecureKeyExchangeDH14SHA1 = "diffie-hellman-group14-sha1"
KeyExchangeDH14SHA256 = "diffie-hellman-group14-sha256"
KeyExchangeDH16SHA512 = "diffie-hellman-group16-sha512"
KeyExchangeECDHP256 = "ecdh-sha2-nistp256"
KeyExchangeECDHP384 = "ecdh-sha2-nistp384"
KeyExchangeECDHP521 = "ecdh-sha2-nistp521"
KeyExchangeCurve25519 = "curve25519-sha256"
InsecureKeyExchangeDHGEXSHA1 = "diffie-hellman-group-exchange-sha1"
KeyExchangeDHGEXSHA256 = "diffie-hellman-group-exchange-sha256"
// KeyExchangeMLKEM768X25519 is supported from Go 1.24.
KeyExchangeMLKEM768X25519 = "mlkem768x25519-sha256"
// An alias for KeyExchangeCurve25519SHA256. This kex ID will be added if
// KeyExchangeCurve25519SHA256 is requested for backward compatibility with
// OpenSSH versions up to 7.2.
keyExchangeCurve25519LibSSH = "curve25519-sha256@libssh.org"
)
// The message authentication code (MAC) currently or previously implemented by
// this library, to use in [Config.MACs]. For a list, see the
// [Algorithms.MACs] returned by [SupportedAlgorithms] or
// [InsecureAlgorithms].
const (
HMACSHA256ETM = "hmac-sha2-256-etm@openssh.com"
HMACSHA512ETM = "hmac-sha2-512-etm@openssh.com"
HMACSHA256 = "hmac-sha2-256"
HMACSHA512 = "hmac-sha2-512"
HMACSHA1 = "hmac-sha1"
InsecureHMACSHA196 = "hmac-sha1-96"
)
var (
// supportedKexAlgos specifies key-exchange algorithms implemented by this
// package in preference order, excluding those with security issues.
supportedKexAlgos = []string{
KeyExchangeMLKEM768X25519,
KeyExchangeCurve25519,
KeyExchangeECDHP256,
KeyExchangeECDHP384,
KeyExchangeECDHP521,
KeyExchangeDH14SHA256,
KeyExchangeDH16SHA512,
KeyExchangeDHGEXSHA256,
}
// defaultKexAlgos specifies the default preference for key-exchange
// algorithms in preference order.
defaultKexAlgos = []string{
KeyExchangeMLKEM768X25519,
KeyExchangeCurve25519,
KeyExchangeECDHP256,
KeyExchangeECDHP384,
KeyExchangeECDHP521,
KeyExchangeDH14SHA256,
InsecureKeyExchangeDH14SHA1,
}
// insecureKexAlgos specifies key-exchange algorithms implemented by this
// package and which have security issues.
insecureKexAlgos = []string{
InsecureKeyExchangeDH14SHA1,
InsecureKeyExchangeDH1SHA1,
InsecureKeyExchangeDHGEXSHA1,
}
// supportedCiphers specifies cipher algorithms implemented by this package
// in preference order, excluding those with security issues.
supportedCiphers = []string{
CipherAES128GCM,
CipherAES256GCM,
CipherChaCha20Poly1305,
CipherAES128CTR,
CipherAES192CTR,
CipherAES256CTR,
}
// defaultCiphers specifies the default preference for ciphers algorithms
// in preference order.
defaultCiphers = supportedCiphers
// insecureCiphers specifies cipher algorithms implemented by this
// package and which have security issues.
insecureCiphers = []string{
InsecureCipherAES128CBC,
InsecureCipherTripleDESCBC,
InsecureCipherRC4256,
InsecureCipherRC4128,
InsecureCipherRC4,
}
// supportedMACs specifies MAC algorithms implemented by this package in
// preference order, excluding those with security issues.
supportedMACs = []string{
HMACSHA256ETM,
HMACSHA512ETM,
HMACSHA256,
HMACSHA512,
HMACSHA1,
}
// defaultMACs specifies the default preference for MAC algorithms in
// preference order.
defaultMACs = []string{
HMACSHA256ETM,
HMACSHA512ETM,
HMACSHA256,
HMACSHA512,
HMACSHA1,
InsecureHMACSHA196,
}
// insecureMACs specifies MAC algorithms implemented by this
// package and which have security issues.
insecureMACs = []string{
InsecureHMACSHA196,
}
// supportedHostKeyAlgos specifies the supported host-key algorithms (i.e.
// methods of authenticating servers) implemented by this package in
// preference order, excluding those with security issues.
supportedHostKeyAlgos = []string{
CertAlgoRSASHA256v01,
CertAlgoRSASHA512v01,
CertAlgoECDSA256v01,
CertAlgoECDSA384v01,
CertAlgoECDSA521v01,
CertAlgoED25519v01,
KeyAlgoRSASHA256,
KeyAlgoRSASHA512,
KeyAlgoECDSA256,
KeyAlgoECDSA384,
KeyAlgoECDSA521,
KeyAlgoED25519,
}
// defaultHostKeyAlgos specifies the default preference for host-key
// algorithms in preference order.
defaultHostKeyAlgos = []string{
CertAlgoRSASHA256v01,
CertAlgoRSASHA512v01,
CertAlgoRSAv01,
InsecureCertAlgoDSAv01,
CertAlgoECDSA256v01,
CertAlgoECDSA384v01,
CertAlgoECDSA521v01,
CertAlgoED25519v01,
KeyAlgoECDSA256,
KeyAlgoECDSA384,
KeyAlgoECDSA521,
KeyAlgoRSASHA256,
KeyAlgoRSASHA512,
KeyAlgoRSA,
InsecureKeyAlgoDSA,
KeyAlgoED25519,
}
// insecureHostKeyAlgos specifies host-key algorithms implemented by this
// package and which have security issues.
insecureHostKeyAlgos = []string{
KeyAlgoRSA,
InsecureKeyAlgoDSA,
CertAlgoRSAv01,
InsecureCertAlgoDSAv01,
}
// supportedPubKeyAuthAlgos specifies the supported client public key
// authentication algorithms. Note that this doesn't include certificate
// types since those use the underlying algorithm. Order is irrelevant.
supportedPubKeyAuthAlgos = []string{
KeyAlgoED25519,
KeyAlgoSKED25519,
KeyAlgoSKECDSA256,
KeyAlgoECDSA256,
KeyAlgoECDSA384,
KeyAlgoECDSA521,
KeyAlgoRSASHA256,
KeyAlgoRSASHA512,
}
// defaultPubKeyAuthAlgos specifies the preferred client public key
// authentication algorithms. This list is sent to the client if it supports
// the server-sig-algs extension. Order is irrelevant.
defaultPubKeyAuthAlgos = []string{
KeyAlgoED25519,
KeyAlgoSKED25519,
KeyAlgoSKECDSA256,
KeyAlgoECDSA256,
KeyAlgoECDSA384,
KeyAlgoECDSA521,
KeyAlgoRSASHA256,
KeyAlgoRSASHA512,
KeyAlgoRSA,
InsecureKeyAlgoDSA,
}
// insecurePubKeyAuthAlgos specifies client public key authentication
// algorithms implemented by this package and which have security issues.
insecurePubKeyAuthAlgos = []string{
KeyAlgoRSA,
InsecureKeyAlgoDSA,
}
)
// NegotiatedAlgorithms defines algorithms negotiated between client and server.
type NegotiatedAlgorithms struct {
KeyExchange string
HostKey string
Read DirectionAlgorithms
Write DirectionAlgorithms
}
// preferredCiphers specifies the default preference for ciphers.
var preferredCiphers = []string{
"aes128-gcm@openssh.com", gcm256CipherID,
chacha20Poly1305ID,
"aes128-ctr", "aes192-ctr", "aes256-ctr",
// Algorithms defines a set of algorithms that can be configured in the client
// or server config for negotiation during a handshake.
type Algorithms struct {
KeyExchanges []string
Ciphers []string
MACs []string
HostKeys []string
PublicKeyAuths []string
}
// supportedKexAlgos specifies the supported key-exchange algorithms in
// preference order.
var supportedKexAlgos = []string{
kexAlgoCurve25519SHA256, kexAlgoCurve25519SHA256LibSSH,
// P384 and P521 are not constant-time yet, but since we don't
// reuse ephemeral keys, using them for ECDH should be OK.
kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521,
kexAlgoDH14SHA256, kexAlgoDH16SHA512, kexAlgoDH14SHA1,
kexAlgoDH1SHA1,
// SupportedAlgorithms returns algorithms currently implemented by this package,
// excluding those with security issues, which are returned by
// InsecureAlgorithms. The algorithms listed here are in preference order.
func SupportedAlgorithms() Algorithms {
return Algorithms{
Ciphers: slices.Clone(supportedCiphers),
MACs: slices.Clone(supportedMACs),
KeyExchanges: slices.Clone(supportedKexAlgos),
HostKeys: slices.Clone(supportedHostKeyAlgos),
PublicKeyAuths: slices.Clone(supportedPubKeyAuthAlgos),
}
}
// serverForbiddenKexAlgos contains key exchange algorithms, that are forbidden
// for the server half.
var serverForbiddenKexAlgos = map[string]struct{}{
kexAlgoDHGEXSHA1: {}, // server half implementation is only minimal to satisfy the automated tests
kexAlgoDHGEXSHA256: {}, // server half implementation is only minimal to satisfy the automated tests
}
// preferredKexAlgos specifies the default preference for key-exchange
// algorithms in preference order. The diffie-hellman-group16-sha512 algorithm
// is disabled by default because it is a bit slower than the others.
var preferredKexAlgos = []string{
kexAlgoCurve25519SHA256, kexAlgoCurve25519SHA256LibSSH,
kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521,
kexAlgoDH14SHA256, kexAlgoDH14SHA1,
}
// supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. methods
// of authenticating servers) in preference order.
var supportedHostKeyAlgos = []string{
CertAlgoRSASHA256v01, CertAlgoRSASHA512v01,
CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01,
CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01,
KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521,
KeyAlgoRSASHA256, KeyAlgoRSASHA512,
KeyAlgoRSA, KeyAlgoDSA,
KeyAlgoED25519,
}
// supportedMACs specifies a default set of MAC algorithms in preference order.
// This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed
// because they have reached the end of their useful life.
var supportedMACs = []string{
"hmac-sha2-256-etm@openssh.com", "hmac-sha2-512-etm@openssh.com", "hmac-sha2-256", "hmac-sha2-512", "hmac-sha1", "hmac-sha1-96",
// InsecureAlgorithms returns algorithms currently implemented by this package
// and which have security issues.
func InsecureAlgorithms() Algorithms {
return Algorithms{
KeyExchanges: slices.Clone(insecureKexAlgos),
Ciphers: slices.Clone(insecureCiphers),
MACs: slices.Clone(insecureMACs),
HostKeys: slices.Clone(insecureHostKeyAlgos),
PublicKeyAuths: slices.Clone(insecurePubKeyAuthAlgos),
}
}
var supportedCompressions = []string{compressionNone}
@@ -94,13 +286,13 @@ var supportedCompressions = []string{compressionNone}
// hashFuncs keeps the mapping of supported signature algorithms to their
// respective hashes needed for signing and verification.
var hashFuncs = map[string]crypto.Hash{
KeyAlgoRSA: crypto.SHA1,
KeyAlgoRSASHA256: crypto.SHA256,
KeyAlgoRSASHA512: crypto.SHA512,
KeyAlgoDSA: crypto.SHA1,
KeyAlgoECDSA256: crypto.SHA256,
KeyAlgoECDSA384: crypto.SHA384,
KeyAlgoECDSA521: crypto.SHA512,
KeyAlgoRSA: crypto.SHA1,
KeyAlgoRSASHA256: crypto.SHA256,
KeyAlgoRSASHA512: crypto.SHA512,
InsecureKeyAlgoDSA: crypto.SHA1,
KeyAlgoECDSA256: crypto.SHA256,
KeyAlgoECDSA384: crypto.SHA384,
KeyAlgoECDSA521: crypto.SHA512,
// KeyAlgoED25519 doesn't pre-hash.
KeyAlgoSKECDSA256: crypto.SHA256,
KeyAlgoSKED25519: crypto.SHA256,
@@ -135,18 +327,6 @@ func isRSACert(algo string) bool {
return isRSA(algo)
}
// supportedPubKeyAuthAlgos specifies the supported client public key
// authentication algorithms. Note that this doesn't include certificate types
// since those use the underlying algorithm. This list is sent to the client if
// it supports the server-sig-algs extension. Order is irrelevant.
var supportedPubKeyAuthAlgos = []string{
KeyAlgoED25519,
KeyAlgoSKED25519, KeyAlgoSKECDSA256,
KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521,
KeyAlgoRSASHA256, KeyAlgoRSASHA512, KeyAlgoRSA,
KeyAlgoDSA,
}
// unexpectedMessageError results when the SSH message that we received didn't
// match what we wanted.
func unexpectedMessageError(expected, got uint8) error {
@@ -158,7 +338,7 @@ func parseError(tag uint8) error {
return fmt.Errorf("ssh: parse error in message type %d", tag)
}
func findCommon(what string, client []string, server []string) (common string, err error) {
func findCommon(what string, client []string, server []string, isClient bool) (string, error) {
for _, c := range client {
for _, s := range server {
if c == s {
@@ -166,23 +346,49 @@ func findCommon(what string, client []string, server []string) (common string, e
}
}
}
return "", fmt.Errorf("ssh: no common algorithm for %s; client offered: %v, server offered: %v", what, client, server)
err := &AlgorithmNegotiationError{
What: what,
}
if isClient {
err.SupportedAlgorithms = client
err.RequestedAlgorithms = server
} else {
err.SupportedAlgorithms = server
err.RequestedAlgorithms = client
}
return "", err
}
// directionAlgorithms records algorithm choices in one direction (either read or write)
type directionAlgorithms struct {
// AlgorithmNegotiationError defines the error returned if the client and the
// server cannot agree on an algorithm for key exchange, host key, cipher, MAC.
type AlgorithmNegotiationError struct {
What string
// RequestedAlgorithms lists the algorithms supported by the peer.
RequestedAlgorithms []string
// SupportedAlgorithms lists the algorithms supported on our side.
SupportedAlgorithms []string
}
func (a *AlgorithmNegotiationError) Error() string {
return fmt.Sprintf("ssh: no common algorithm for %s; we offered: %v, peer offered: %v",
a.What, a.SupportedAlgorithms, a.RequestedAlgorithms)
}
// DirectionAlgorithms defines the algorithms negotiated in one direction
// (either read or write).
type DirectionAlgorithms struct {
Cipher string
MAC string
Compression string
compression string
}
// rekeyBytes returns a rekeying intervals in bytes.
func (a *directionAlgorithms) rekeyBytes() int64 {
func (a *DirectionAlgorithms) rekeyBytes() int64 {
// According to RFC 4344 block ciphers should rekey after
// 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is
// 128.
switch a.Cipher {
case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcm128CipherID, gcm256CipherID, aes128cbcID:
case CipherAES128CTR, CipherAES192CTR, CipherAES256CTR, CipherAES128GCM, CipherAES256GCM, InsecureCipherAES128CBC:
return 16 * (1 << 32)
}
@@ -192,66 +398,59 @@ func (a *directionAlgorithms) rekeyBytes() int64 {
}
var aeadCiphers = map[string]bool{
gcm128CipherID: true,
gcm256CipherID: true,
chacha20Poly1305ID: true,
CipherAES128GCM: true,
CipherAES256GCM: true,
CipherChaCha20Poly1305: true,
}
type algorithms struct {
kex string
hostKey string
w directionAlgorithms
r directionAlgorithms
}
func findAgreedAlgorithms(isClient bool, clientKexInit, serverKexInit *kexInitMsg) (algs *NegotiatedAlgorithms, err error) {
result := &NegotiatedAlgorithms{}
func findAgreedAlgorithms(isClient bool, clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms, err error) {
result := &algorithms{}
result.kex, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos)
result.KeyExchange, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos, isClient)
if err != nil {
return
}
result.hostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos)
result.HostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos, isClient)
if err != nil {
return
}
stoc, ctos := &result.w, &result.r
stoc, ctos := &result.Write, &result.Read
if isClient {
ctos, stoc = stoc, ctos
}
ctos.Cipher, err = findCommon("client to server cipher", clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer)
ctos.Cipher, err = findCommon("client to server cipher", clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer, isClient)
if err != nil {
return
}
stoc.Cipher, err = findCommon("server to client cipher", clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient)
stoc.Cipher, err = findCommon("server to client cipher", clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient, isClient)
if err != nil {
return
}
if !aeadCiphers[ctos.Cipher] {
ctos.MAC, err = findCommon("client to server MAC", clientKexInit.MACsClientServer, serverKexInit.MACsClientServer)
ctos.MAC, err = findCommon("client to server MAC", clientKexInit.MACsClientServer, serverKexInit.MACsClientServer, isClient)
if err != nil {
return
}
}
if !aeadCiphers[stoc.Cipher] {
stoc.MAC, err = findCommon("server to client MAC", clientKexInit.MACsServerClient, serverKexInit.MACsServerClient)
stoc.MAC, err = findCommon("server to client MAC", clientKexInit.MACsServerClient, serverKexInit.MACsServerClient, isClient)
if err != nil {
return
}
}
ctos.Compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer)
ctos.compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer, isClient)
if err != nil {
return
}
stoc.Compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient)
stoc.compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient, isClient)
if err != nil {
return
}
@@ -297,7 +496,7 @@ func (c *Config) SetDefaults() {
c.Rand = rand.Reader
}
if c.Ciphers == nil {
c.Ciphers = preferredCiphers
c.Ciphers = defaultCiphers
}
var ciphers []string
for _, c := range c.Ciphers {
@@ -309,19 +508,22 @@ func (c *Config) SetDefaults() {
c.Ciphers = ciphers
if c.KeyExchanges == nil {
c.KeyExchanges = preferredKexAlgos
c.KeyExchanges = defaultKexAlgos
}
var kexs []string
for _, k := range c.KeyExchanges {
if kexAlgoMap[k] != nil {
// Ignore the KEX if we have no kexAlgoMap definition.
kexs = append(kexs, k)
if k == KeyExchangeCurve25519 && !contains(c.KeyExchanges, keyExchangeCurve25519LibSSH) {
kexs = append(kexs, keyExchangeCurve25519LibSSH)
}
}
}
c.KeyExchanges = kexs
if c.MACs == nil {
c.MACs = supportedMACs
c.MACs = defaultMACs
}
var macs []string
for _, m := range c.MACs {
+17 -17
View File
@@ -51,33 +51,33 @@ func TestFindAgreedAlgorithms(t *testing.T) {
}
}
initDirAlgs := func(a *directionAlgorithms) {
initDirAlgs := func(a *DirectionAlgorithms) {
if a.Cipher == "" {
a.Cipher = "cipher1"
}
if a.MAC == "" {
a.MAC = "mac1"
}
if a.Compression == "" {
a.Compression = "compression1"
if a.compression == "" {
a.compression = "compression1"
}
}
initAlgs := func(a *algorithms) {
if a.kex == "" {
a.kex = "kex1"
initAlgs := func(a *NegotiatedAlgorithms) {
if a.KeyExchange == "" {
a.KeyExchange = "kex1"
}
if a.hostKey == "" {
a.hostKey = "hostkey1"
if a.HostKey == "" {
a.HostKey = "hostkey1"
}
initDirAlgs(&a.r)
initDirAlgs(&a.w)
initDirAlgs(&a.Read)
initDirAlgs(&a.Write)
}
type testcase struct {
name string
clientIn, serverIn kexInitMsg
wantClient, wantServer algorithms
wantClient, wantServer NegotiatedAlgorithms
wantErr bool
}
@@ -120,19 +120,19 @@ func TestFindAgreedAlgorithms(t *testing.T) {
CiphersClientServer: []string{"cipher2", "cipher1"},
CiphersServerClient: []string{"cipher3", "cipher2"},
},
wantClient: algorithms{
r: directionAlgorithms{
wantClient: NegotiatedAlgorithms{
Read: DirectionAlgorithms{
Cipher: "cipher3",
},
w: directionAlgorithms{
Write: DirectionAlgorithms{
Cipher: "cipher2",
},
},
wantServer: algorithms{
w: directionAlgorithms{
wantServer: NegotiatedAlgorithms{
Write: DirectionAlgorithms{
Cipher: "cipher3",
},
r: directionAlgorithms{
Read: DirectionAlgorithms{
Cipher: "cipher2",
},
},
+12
View File
@@ -74,6 +74,13 @@ type Conn interface {
// Disconnect
}
// AlgorithmsConnMetadata is a ConnMetadata that can return the algorithms
// negotiated between client and server.
type AlgorithmsConnMetadata interface {
ConnMetadata
Algorithms() NegotiatedAlgorithms
}
// DiscardRequests consumes and rejects all requests from the
// passed-in channel.
func DiscardRequests(in <-chan *Request) {
@@ -106,6 +113,7 @@ type sshConn struct {
sessionID []byte
clientVersion []byte
serverVersion []byte
algorithms NegotiatedAlgorithms
}
func dup(src []byte) []byte {
@@ -141,3 +149,7 @@ func (c *sshConn) ClientVersion() []byte {
func (c *sshConn) ServerVersion() []byte {
return dup(c.serverVersion)
}
func (c *sshConn) Algorithms() NegotiatedAlgorithms {
return c.algorithms
}
+1
View File
@@ -16,6 +16,7 @@ References:
[PROTOCOL]: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=HEAD
[PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD
[SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1
[SSH-CERTS]: https://datatracker.ietf.org/doc/html/draft-miller-ssh-cert-01
This package does not fall under the stability promise of the Go language itself,
so its API may be changed when pressing needs arise.
+110
View File
@@ -154,6 +154,75 @@ func ExampleNewServerConn() {
}
}
func ExampleServerConfig() {
// Minimal ServerConfig with SHA-1 algoritms disabled and supporting only
// public key authentication.
// The algorithms returned by ssh.SupportedAlgorithms() are different from
// the default ones and do not include algorithms that are considered
// insecure, such as those using SHA-1, returned by
// ssh.InsecureAlgorithms().
algorithms := ssh.SupportedAlgorithms()
// Public key authentication is done by comparing
// the public key of a received connection
// with the entries in the authorized_keys file.
authorizedKeysBytes, err := os.ReadFile("authorized_keys")
if err != nil {
log.Fatalf("Failed to load authorized_keys, err: %v", err)
}
authorizedKeysMap := map[string]bool{}
for len(authorizedKeysBytes) > 0 {
pubKey, _, _, rest, err := ssh.ParseAuthorizedKey(authorizedKeysBytes)
if err != nil {
log.Fatal(err)
}
authorizedKeysMap[string(pubKey.Marshal())] = true
authorizedKeysBytes = rest
}
config := &ssh.ServerConfig{
Config: ssh.Config{
KeyExchanges: algorithms.KeyExchanges,
Ciphers: algorithms.Ciphers,
MACs: algorithms.MACs,
},
// The configured PublicKeyAuthAlgorithms do not contain SHA-1 based
// signature formats, so if the client attempts to use them the
// authentication will fail before calling the defined callback.
PublicKeyAuthAlgorithms: algorithms.PublicKeyAuths,
PublicKeyCallback: func(c ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) {
if authorizedKeysMap[string(pubKey.Marshal())] {
return &ssh.Permissions{
// Record the public key used for authentication.
Extensions: map[string]string{
"pubkey-fp": ssh.FingerprintSHA256(pubKey),
},
}, nil
}
return nil, fmt.Errorf("unknown public key for %q", c.User())
},
}
privateBytes, err := os.ReadFile("id_rsa")
if err != nil {
log.Fatal("Failed to load private key: ", err)
}
private, err := ssh.ParsePrivateKey(privateBytes)
if err != nil {
log.Fatal("Failed to parse private key: ", err)
}
// Restrict host key algorithms to disable ssh-rsa.
signer, err := ssh.NewSignerWithAlgorithms(private.(ssh.AlgorithmSigner), []string{ssh.KeyAlgoRSASHA256, ssh.KeyAlgoRSASHA512})
if err != nil {
log.Fatal("Failed to create private key with restricted algorithms: ", err)
}
config.AddHostKey(signer)
}
func ExampleServerConfig_AddHostKey() {
// Minimal ServerConfig supporting only password authentication.
config := &ssh.ServerConfig{
@@ -262,6 +331,47 @@ func ExampleDial() {
fmt.Println(b.String())
}
func ExampleClientConfig() {
var hostKey ssh.PublicKey
key, err := os.ReadFile("/home/user/.ssh/id_rsa")
if err != nil {
log.Fatalf("unable to read private key: %v", err)
}
// Create the Signer for this private key.
signer, err := ssh.ParsePrivateKey(key)
if err != nil {
log.Fatalf("unable to parse private key: %v", err)
}
// Minimal ClientConfig with SHA-1 algoritms disabled.
// The algorithms returned by ssh.SupportedAlgorithms() are different from
// the default ones and do not include algorithms that are considered
// insecure, such as those using SHA-1, returned by
// ssh.InsecureAlgorithms().
algorithms := ssh.SupportedAlgorithms()
config := &ssh.ClientConfig{
Config: ssh.Config{
KeyExchanges: algorithms.KeyExchanges,
Ciphers: algorithms.Ciphers,
MACs: algorithms.MACs,
},
User: "username",
Auth: []ssh.AuthMethod{
ssh.PublicKeys(signer),
},
HostKeyCallback: ssh.FixedHostKey(hostKey),
// We should check that hostKey algorithm is inlcuded in
// algorithms.HostKeys.
HostKeyAlgorithms: algorithms.HostKeys,
}
client, err := ssh.Dial("tcp", "yourserver.com:22", config)
if err != nil {
log.Fatal("Failed to dial: ", err)
}
defer client.Close()
}
func ExamplePublicKeys() {
var hostKey ssh.PublicKey
// A public key may be used to authenticate against the remote
+64 -24
View File
@@ -5,7 +5,6 @@
package ssh
import (
"crypto/rand"
"errors"
"fmt"
"io"
@@ -25,6 +24,11 @@ const debugHandshake = false
// quickly.
const chanSize = 16
// maxPendingPackets sets the maximum number of packets to queue while waiting
// for KEX to complete. This limits the total pending data to maxPendingPackets
// * maxPacket bytes, which is ~16.8MB.
const maxPendingPackets = 64
// keyingTransport is a packet based transport that supports key
// changes. It need not be thread-safe. It should pass through
// msgNewKeys in both directions.
@@ -34,7 +38,7 @@ type keyingTransport interface {
// prepareKeyChange sets up a key change. The key change for a
// direction will be effected if a msgNewKeys message is sent
// or received.
prepareKeyChange(*algorithms, *kexResult) error
prepareKeyChange(*NegotiatedAlgorithms, *kexResult) error
// setStrictMode sets the strict KEX mode, notably triggering
// sequence number resets on sending or receiving msgNewKeys.
@@ -73,13 +77,22 @@ type handshakeTransport struct {
incoming chan []byte
readError error
mu sync.Mutex
writeError error
sentInitPacket []byte
sentInitMsg *kexInitMsg
pendingPackets [][]byte // Used when a key exchange is in progress.
mu sync.Mutex
// Condition for the above mutex. It is used to notify a completed key
// exchange or a write failure. Writes can wait for this condition while a
// key exchange is in progress.
writeCond *sync.Cond
writeError error
sentInitPacket []byte
sentInitMsg *kexInitMsg
// Used to queue writes when a key exchange is in progress. The length is
// limited by pendingPacketsSize. Once full, writes will block until the key
// exchange is completed or an error occurs. If not empty, it is emptied
// all at once when the key exchange is completed in kexLoop.
pendingPackets [][]byte
writePacketsLeft uint32
writeBytesLeft int64
userAuthComplete bool // whether the user authentication phase is complete
// If the read loop wants to schedule a kex, it pings this
// channel, and the write loop will send out a kex
@@ -102,7 +115,7 @@ type handshakeTransport struct {
bannerCallback BannerCallback
// Algorithms agreed in the last key exchange.
algorithms *algorithms
algorithms *NegotiatedAlgorithms
// Counters exclusively owned by readLoop.
readPacketsLeft uint32
@@ -133,6 +146,7 @@ func newHandshakeTransport(conn keyingTransport, config *Config, clientVersion,
config: config,
}
t.writeCond = sync.NewCond(&t.mu)
t.resetReadThresholds()
t.resetWriteThresholds()
@@ -150,7 +164,7 @@ func newClientTransport(conn keyingTransport, clientVersion, serverVersion []byt
if config.HostKeyAlgorithms != nil {
t.hostKeyAlgorithms = config.HostKeyAlgorithms
} else {
t.hostKeyAlgorithms = supportedHostKeyAlgos
t.hostKeyAlgorithms = defaultHostKeyAlgos
}
go t.readLoop()
go t.kexLoop()
@@ -170,6 +184,10 @@ func (t *handshakeTransport) getSessionID() []byte {
return t.sessionID
}
func (t *handshakeTransport) getAlgorithms() NegotiatedAlgorithms {
return *t.algorithms
}
// waitSession waits for the session to be established. This should be
// the first thing to call after instantiating handshakeTransport.
func (t *handshakeTransport) waitSession() error {
@@ -259,6 +277,7 @@ func (t *handshakeTransport) recordWriteError(err error) {
defer t.mu.Unlock()
if t.writeError == nil && err != nil {
t.writeError = err
t.writeCond.Broadcast()
}
}
@@ -275,7 +294,7 @@ func (t *handshakeTransport) resetWriteThresholds() {
if t.config.RekeyThreshold > 0 {
t.writeBytesLeft = int64(t.config.RekeyThreshold)
} else if t.algorithms != nil {
t.writeBytesLeft = t.algorithms.w.rekeyBytes()
t.writeBytesLeft = t.algorithms.Write.rekeyBytes()
} else {
t.writeBytesLeft = 1 << 30
}
@@ -362,6 +381,8 @@ write:
}
}
t.pendingPackets = t.pendingPackets[:0]
// Unblock writePacket if waiting for KEX.
t.writeCond.Broadcast()
t.mu.Unlock()
}
@@ -390,7 +411,7 @@ func (t *handshakeTransport) resetReadThresholds() {
if t.config.RekeyThreshold > 0 {
t.readBytesLeft = int64(t.config.RekeyThreshold)
} else if t.algorithms != nil {
t.readBytesLeft = t.algorithms.r.rekeyBytes()
t.readBytesLeft = t.algorithms.Read.rekeyBytes()
} else {
t.readBytesLeft = 1 << 30
}
@@ -483,7 +504,7 @@ func (t *handshakeTransport) sendKexInit() error {
CompressionClientServer: supportedCompressions,
CompressionServerClient: supportedCompressions,
}
io.ReadFull(rand.Reader, msg.Cookie[:])
io.ReadFull(t.config.Rand, msg.Cookie[:])
// We mutate the KexAlgos slice, in order to add the kex-strict extension algorithm,
// and possibly to add the ext-info extension algorithm. Since the slice may be the
@@ -552,26 +573,44 @@ func (t *handshakeTransport) sendKexInit() error {
return nil
}
var errSendBannerPhase = errors.New("ssh: SendAuthBanner outside of authentication phase")
func (t *handshakeTransport) writePacket(p []byte) error {
t.mu.Lock()
defer t.mu.Unlock()
switch p[0] {
case msgKexInit:
return errors.New("ssh: only handshakeTransport can send kexInit")
case msgNewKeys:
return errors.New("ssh: only handshakeTransport can send newKeys")
case msgUserAuthBanner:
if t.userAuthComplete {
return errSendBannerPhase
}
case msgUserAuthSuccess:
t.userAuthComplete = true
}
t.mu.Lock()
defer t.mu.Unlock()
if t.writeError != nil {
return t.writeError
}
if t.sentInitMsg != nil {
// Copy the packet so the writer can reuse the buffer.
cp := make([]byte, len(p))
copy(cp, p)
t.pendingPackets = append(t.pendingPackets, cp)
return nil
if len(t.pendingPackets) < maxPendingPackets {
// Copy the packet so the writer can reuse the buffer.
cp := make([]byte, len(p))
copy(cp, p)
t.pendingPackets = append(t.pendingPackets, cp)
return nil
}
for t.sentInitMsg != nil {
// Block and wait for KEX to complete or an error.
t.writeCond.Wait()
if t.writeError != nil {
return t.writeError
}
}
}
if t.writeBytesLeft > 0 {
@@ -588,6 +627,7 @@ func (t *handshakeTransport) writePacket(p []byte) error {
if err := t.pushPacket(p); err != nil {
t.writeError = err
t.writeCond.Broadcast()
}
return nil
@@ -664,9 +704,9 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error {
}
}
kex, ok := kexAlgoMap[t.algorithms.kex]
kex, ok := kexAlgoMap[t.algorithms.KeyExchange]
if !ok {
return fmt.Errorf("ssh: unexpected key exchange algorithm %v", t.algorithms.kex)
return fmt.Errorf("ssh: unexpected key exchange algorithm %v", t.algorithms.KeyExchange)
}
var result *kexResult
@@ -773,12 +813,12 @@ func pickHostKey(hostKeys []Signer, algo string) AlgorithmSigner {
}
func (t *handshakeTransport) server(kex kexAlgorithm, magics *handshakeMagics) (*kexResult, error) {
hostKey := pickHostKey(t.hostKeys, t.algorithms.hostKey)
hostKey := pickHostKey(t.hostKeys, t.algorithms.HostKey)
if hostKey == nil {
return nil, errors.New("ssh: internal error: negotiated unsupported signature type")
}
r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey, t.algorithms.hostKey)
r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey, t.algorithms.HostKey)
return r, err
}
@@ -793,7 +833,7 @@ func (t *handshakeTransport) client(kex kexAlgorithm, magics *handshakeMagics) (
return nil, err
}
if err := verifyHostKeySignature(hostKey, t.algorithms.hostKey, result); err != nil {
if err := verifyHostKeySignature(hostKey, t.algorithms.HostKey, result); err != nil {
return nil, err
}
+348 -3
View File
@@ -367,7 +367,7 @@ type errorKeyingTransport struct {
readLeft, writeLeft int
}
func (n *errorKeyingTransport) prepareKeyChange(*algorithms, *kexResult) error {
func (n *errorKeyingTransport) prepareKeyChange(*NegotiatedAlgorithms, *kexResult) error {
return nil
}
@@ -539,10 +539,230 @@ func TestDisconnect(t *testing.T) {
}
}
type mockKeyingTransport struct {
packetConn
kexInitAllowed chan struct{}
kexInitSent chan struct{}
}
func (n *mockKeyingTransport) prepareKeyChange(*NegotiatedAlgorithms, *kexResult) error {
return nil
}
func (n *mockKeyingTransport) writePacket(packet []byte) error {
if packet[0] == msgKexInit {
<-n.kexInitAllowed
n.kexInitSent <- struct{}{}
}
return n.packetConn.writePacket(packet)
}
func (n *mockKeyingTransport) readPacket() ([]byte, error) {
return n.packetConn.readPacket()
}
func (n *mockKeyingTransport) setStrictMode() error { return nil }
func (n *mockKeyingTransport) setInitialKEXDone() {}
func TestHandshakePendingPacketsWait(t *testing.T) {
a, b := memPipe()
trS := &mockKeyingTransport{
packetConn: a,
kexInitAllowed: make(chan struct{}, 2),
kexInitSent: make(chan struct{}, 2),
}
// Allow the first KEX.
trS.kexInitAllowed <- struct{}{}
trC := &mockKeyingTransport{
packetConn: b,
kexInitAllowed: make(chan struct{}, 2),
kexInitSent: make(chan struct{}, 2),
}
// Allow the first KEX.
trC.kexInitAllowed <- struct{}{}
clientConf := &ClientConfig{
HostKeyCallback: InsecureIgnoreHostKey(),
}
clientConf.SetDefaults()
v := []byte("version")
client := newClientTransport(trC, v, v, clientConf, "addr", nil)
serverConf := &ServerConfig{}
serverConf.AddHostKey(testSigners["ecdsa"])
serverConf.AddHostKey(testSigners["rsa"])
serverConf.SetDefaults()
server := newServerTransport(trS, v, v, serverConf)
if err := server.waitSession(); err != nil {
t.Fatalf("server.waitSession: %v", err)
}
if err := client.waitSession(); err != nil {
t.Fatalf("client.waitSession: %v", err)
}
<-trC.kexInitSent
<-trS.kexInitSent
// Allow and request new KEX server side.
trS.kexInitAllowed <- struct{}{}
server.requestKeyExchange()
// Wait until the KEX init is sent.
<-trS.kexInitSent
// The client is not allowed to respond to the KEX, so writes will be
// blocked on the server side once the packets queue is full.
for i := 0; i < maxPendingPackets; i++ {
p := []byte{msgRequestSuccess, byte(i)}
if err := server.writePacket(p); err != nil {
t.Errorf("unexpected write error: %v", err)
}
}
// The packets queue is now full, the next write will block.
server.mu.Lock()
if len(server.pendingPackets) != maxPendingPackets {
t.Errorf("unexpected pending packets size; got: %d, want: %d", len(server.pendingPackets), maxPendingPackets)
}
server.mu.Unlock()
writeDone := make(chan struct{})
go func() {
defer close(writeDone)
p := []byte{msgRequestSuccess, byte(65)}
// This write will block until KEX completes.
err := server.writePacket(p)
if err != nil {
t.Errorf("unexpected write error: %v", err)
}
}()
// Consume packets on the client side
readDone := make(chan bool)
go func() {
defer close(readDone)
for {
if _, err := client.readPacket(); err != nil {
if err != io.EOF {
t.Errorf("unexpected read error: %v", err)
}
break
}
}
}()
// Allow the client to reply to the KEX and so unblock the write goroutine.
trC.kexInitAllowed <- struct{}{}
<-trC.kexInitSent
<-writeDone
// Close the client to unblock the read goroutine.
client.Close()
<-readDone
server.Close()
}
func TestHandshakePendingPacketsError(t *testing.T) {
a, b := memPipe()
trS := &mockKeyingTransport{
packetConn: a,
kexInitAllowed: make(chan struct{}, 2),
kexInitSent: make(chan struct{}, 2),
}
// Allow the first KEX.
trS.kexInitAllowed <- struct{}{}
trC := &mockKeyingTransport{
packetConn: b,
kexInitAllowed: make(chan struct{}, 2),
kexInitSent: make(chan struct{}, 2),
}
// Allow the first KEX.
trC.kexInitAllowed <- struct{}{}
clientConf := &ClientConfig{
HostKeyCallback: InsecureIgnoreHostKey(),
}
clientConf.SetDefaults()
v := []byte("version")
client := newClientTransport(trC, v, v, clientConf, "addr", nil)
serverConf := &ServerConfig{}
serverConf.AddHostKey(testSigners["ecdsa"])
serverConf.AddHostKey(testSigners["rsa"])
serverConf.SetDefaults()
server := newServerTransport(trS, v, v, serverConf)
if err := server.waitSession(); err != nil {
t.Fatalf("server.waitSession: %v", err)
}
if err := client.waitSession(); err != nil {
t.Fatalf("client.waitSession: %v", err)
}
<-trC.kexInitSent
<-trS.kexInitSent
// Allow and request new KEX server side.
trS.kexInitAllowed <- struct{}{}
server.requestKeyExchange()
// Wait until the KEX init is sent.
<-trS.kexInitSent
// The client is not allowed to respond to the KEX, so writes will be
// blocked on the server side once the packets queue is full.
for i := 0; i < maxPendingPackets; i++ {
p := []byte{msgRequestSuccess, byte(i)}
if err := server.writePacket(p); err != nil {
t.Errorf("unexpected write error: %v", err)
}
}
// The packets queue is now full, the next write will block.
writeDone := make(chan struct{})
go func() {
defer close(writeDone)
p := []byte{msgRequestSuccess, byte(65)}
// This write will block until KEX completes.
err := server.writePacket(p)
if err != io.EOF {
t.Errorf("unexpected write error: %v", err)
}
}()
// Consume packets on the client side
readDone := make(chan bool)
go func() {
defer close(readDone)
for {
if _, err := client.readPacket(); err != nil {
if err != io.EOF {
t.Errorf("unexpected read error: %v", err)
}
break
}
}
}()
// Close the server to unblock the write after an error
server.Close()
<-writeDone
// Unblock the pending write and close the client to unblock the read
// goroutine.
trC.kexInitAllowed <- struct{}{}
client.Close()
<-readDone
}
func TestHandshakeRekeyDefault(t *testing.T) {
clientConf := &ClientConfig{
Config: Config{
Ciphers: []string{"aes128-ctr"},
Ciphers: []string{CipherAES128CTR},
},
HostKeyCallback: InsecureIgnoreHostKey(),
}
@@ -568,7 +788,7 @@ func TestHandshakeRekeyDefault(t *testing.T) {
}
func TestHandshakeAEADCipherNoMAC(t *testing.T) {
for _, cipher := range []string{chacha20Poly1305ID, gcm128CipherID} {
for _, cipher := range []string{CipherChaCha20Poly1305, CipherAES128GCM} {
checker := &syncChecker{
called: make(chan int, 1),
}
@@ -1019,3 +1239,128 @@ func TestStrictKEXMixed(t *testing.T) {
t.Fatalf("client.waitSession: %v", err)
}
}
func TestNegotiatedAlgorithms(t *testing.T) {
c1, c2, err := netPipe()
if err != nil {
t.Fatalf("netPipe: %v", err)
}
defer c1.Close()
defer c2.Close()
var serverAlgorithms NegotiatedAlgorithms
serverConf := &ServerConfig{
PasswordCallback: func(conn ConnMetadata, password []byte) (*Permissions, error) {
if algorithmConn, ok := conn.(AlgorithmsConnMetadata); ok {
serverAlgorithms = algorithmConn.Algorithms()
return &Permissions{}, nil
}
return nil, errors.New("server conn does not implement AlgorithmsConnMetadata")
},
}
serverConf.AddHostKey(testSigners["rsa"])
go NewServerConn(c1, serverConf)
clientConf := &ClientConfig{
User: "test",
Auth: []AuthMethod{Password("testpw")},
HostKeyCallback: FixedHostKey(testSigners["rsa"].PublicKey()),
}
if conn, _, _, err := NewClientConn(c2, "", clientConf); err != nil {
t.Fatal(err)
} else {
if algorithmConn, ok := conn.(AlgorithmsConnMetadata); ok {
clientAlgorithms := algorithmConn.Algorithms()
if clientAlgorithms.HostKey == "" {
t.Fatal("negotiated client host key is empty")
}
if clientAlgorithms.KeyExchange == "" {
t.Fatal("negotiated client KEX is empty")
}
if clientAlgorithms.Read.Cipher == "" {
t.Fatal("negotiated client read cipher is empty")
}
if clientAlgorithms.Write.Cipher == "" {
t.Fatal("negotiated client write cipher is empty")
}
if !reflect.DeepEqual(clientAlgorithms, serverAlgorithms) {
t.Fatalf("negotiated client algorithms: %+v differs from negotiated server algorithms: %+v",
clientAlgorithms, serverAlgorithms)
}
} else {
t.Fatal("client conn does not implement AlgorithmsConnMetadata")
}
}
}
func TestAlgorithmNegotiationError(t *testing.T) {
c1, c2, err := netPipe()
if err != nil {
t.Fatalf("netPipe: %v", err)
}
defer c1.Close()
defer c2.Close()
serverConf := &ServerConfig{
Config: Config{
Ciphers: []string{CipherAES128CTR, CipherAES256CTR},
},
PasswordCallback: func(conn ConnMetadata, password []byte) (*Permissions, error) {
return &Permissions{}, nil
},
}
serverConf.AddHostKey(testSigners["rsa"])
srvErrCh := make(chan error, 1)
go func() {
_, _, _, err := NewServerConn(c1, serverConf)
srvErrCh <- err
}()
clientConf := &ClientConfig{
Config: Config{
Ciphers: []string{CipherAES128GCM, CipherAES256GCM},
},
User: "test",
Auth: []AuthMethod{Password("testpw")},
HostKeyCallback: FixedHostKey(testSigners["rsa"].PublicKey()),
}
_, _, _, err = NewClientConn(c2, "", clientConf)
if err == nil {
t.Fatal("client connection succeded expected algorithm negotiation error")
}
var negotiationError *AlgorithmNegotiationError
if !errors.As(err, &negotiationError) {
t.Fatalf("expected algorithm negotiation error, got %v", err)
}
expectedErrorString := fmt.Sprintf("ssh: handshake failed: ssh: no common algorithm for client to server cipher; we offered: %v, peer offered: %v",
clientConf.Ciphers, serverConf.Ciphers)
if err.Error() != expectedErrorString {
t.Fatalf("expected error string %q, got %q", expectedErrorString, err.Error())
}
if !reflect.DeepEqual(negotiationError.RequestedAlgorithms, serverConf.Ciphers) {
t.Fatalf("expected requested algorithms %v, got %v", serverConf.Ciphers, negotiationError.RequestedAlgorithms)
}
if !reflect.DeepEqual(negotiationError.SupportedAlgorithms, clientConf.Ciphers) {
t.Fatalf("expected supported algorithms %v, got %v", clientConf.Ciphers, negotiationError.SupportedAlgorithms)
}
err = <-srvErrCh
negotiationError = nil
if !errors.As(err, &negotiationError) {
t.Fatalf("expected algorithm negotiation error, got %v", err)
}
expectedErrorString = fmt.Sprintf("ssh: no common algorithm for client to server cipher; we offered: %v, peer offered: %v",
serverConf.Ciphers, clientConf.Ciphers)
if err.Error() != expectedErrorString {
t.Fatalf("expected error string %q, got %q", expectedErrorString, err.Error())
}
if !reflect.DeepEqual(negotiationError.RequestedAlgorithms, clientConf.Ciphers) {
t.Fatalf("expected requested algorithms %v, got %v", clientConf.Ciphers, negotiationError.RequestedAlgorithms)
}
if !reflect.DeepEqual(negotiationError.SupportedAlgorithms, serverConf.Ciphers) {
t.Fatalf("expected supported algorithms %v, got %v", serverConf.Ciphers, negotiationError.SupportedAlgorithms)
}
}
+72 -67
View File
@@ -9,7 +9,6 @@ import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/subtle"
"encoding/binary"
"errors"
"fmt"
@@ -20,21 +19,18 @@ import (
)
const (
kexAlgoDH1SHA1 = "diffie-hellman-group1-sha1"
kexAlgoDH14SHA1 = "diffie-hellman-group14-sha1"
kexAlgoDH14SHA256 = "diffie-hellman-group14-sha256"
kexAlgoDH16SHA512 = "diffie-hellman-group16-sha512"
kexAlgoECDH256 = "ecdh-sha2-nistp256"
kexAlgoECDH384 = "ecdh-sha2-nistp384"
kexAlgoECDH521 = "ecdh-sha2-nistp521"
kexAlgoCurve25519SHA256LibSSH = "curve25519-sha256@libssh.org"
kexAlgoCurve25519SHA256 = "curve25519-sha256"
// For the following kex only the client half contains a production
// ready implementation. The server half only consists of a minimal
// implementation to satisfy the automated tests.
kexAlgoDHGEXSHA1 = "diffie-hellman-group-exchange-sha1"
kexAlgoDHGEXSHA256 = "diffie-hellman-group-exchange-sha256"
// This is the group called diffie-hellman-group1-sha1 in RFC 4253 and
// Oakley Group 2 in RFC 2409.
oakleyGroup2 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF"
// This is the group called diffie-hellman-group14-sha1 in RFC 4253 and
// Oakley Group 14 in RFC 3526.
oakleyGroup14 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF"
// This is the group called diffie-hellman-group15-sha512 in RFC 8268 and
// Oakley Group 15 in RFC 3526.
oakleyGroup15 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF"
// This is the group called diffie-hellman-group16-sha512 in RFC 8268 and
// Oakley Group 16 in RFC 3526.
oakleyGroup16 = "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199FFFFFFFFFFFFFFFF"
)
// kexResult captures the outcome of a key exchange.
@@ -402,53 +398,47 @@ func ecHash(curve elliptic.Curve) crypto.Hash {
var kexAlgoMap = map[string]kexAlgorithm{}
func init() {
// This is the group called diffie-hellman-group1-sha1 in
// RFC 4253 and Oakley Group 2 in RFC 2409.
p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF", 16)
kexAlgoMap[kexAlgoDH1SHA1] = &dhGroup{
p, _ := new(big.Int).SetString(oakleyGroup2, 16)
kexAlgoMap[InsecureKeyExchangeDH1SHA1] = &dhGroup{
g: new(big.Int).SetInt64(2),
p: p,
pMinus1: new(big.Int).Sub(p, bigOne),
hashFunc: crypto.SHA1,
}
// This are the groups called diffie-hellman-group14-sha1 and
// diffie-hellman-group14-sha256 in RFC 4253 and RFC 8268,
// and Oakley Group 14 in RFC 3526.
p, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16)
p, _ = new(big.Int).SetString(oakleyGroup14, 16)
group14 := &dhGroup{
g: new(big.Int).SetInt64(2),
p: p,
pMinus1: new(big.Int).Sub(p, bigOne),
}
kexAlgoMap[kexAlgoDH14SHA1] = &dhGroup{
kexAlgoMap[InsecureKeyExchangeDH14SHA1] = &dhGroup{
g: group14.g, p: group14.p, pMinus1: group14.pMinus1,
hashFunc: crypto.SHA1,
}
kexAlgoMap[kexAlgoDH14SHA256] = &dhGroup{
kexAlgoMap[KeyExchangeDH14SHA256] = &dhGroup{
g: group14.g, p: group14.p, pMinus1: group14.pMinus1,
hashFunc: crypto.SHA256,
}
// This is the group called diffie-hellman-group16-sha512 in RFC
// 8268 and Oakley Group 16 in RFC 3526.
p, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D788719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA993B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199FFFFFFFFFFFFFFFF", 16)
p, _ = new(big.Int).SetString(oakleyGroup16, 16)
kexAlgoMap[kexAlgoDH16SHA512] = &dhGroup{
kexAlgoMap[KeyExchangeDH16SHA512] = &dhGroup{
g: new(big.Int).SetInt64(2),
p: p,
pMinus1: new(big.Int).Sub(p, bigOne),
hashFunc: crypto.SHA512,
}
kexAlgoMap[kexAlgoECDH521] = &ecdh{elliptic.P521()}
kexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()}
kexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()}
kexAlgoMap[kexAlgoCurve25519SHA256] = &curve25519sha256{}
kexAlgoMap[kexAlgoCurve25519SHA256LibSSH] = &curve25519sha256{}
kexAlgoMap[kexAlgoDHGEXSHA1] = &dhGEXSHA{hashFunc: crypto.SHA1}
kexAlgoMap[kexAlgoDHGEXSHA256] = &dhGEXSHA{hashFunc: crypto.SHA256}
kexAlgoMap[KeyExchangeECDHP521] = &ecdh{elliptic.P521()}
kexAlgoMap[KeyExchangeECDHP384] = &ecdh{elliptic.P384()}
kexAlgoMap[KeyExchangeECDHP256] = &ecdh{elliptic.P256()}
kexAlgoMap[KeyExchangeCurve25519] = &curve25519sha256{}
kexAlgoMap[keyExchangeCurve25519LibSSH] = &curve25519sha256{}
kexAlgoMap[InsecureKeyExchangeDHGEXSHA1] = &dhGEXSHA{hashFunc: crypto.SHA1}
kexAlgoMap[KeyExchangeDHGEXSHA256] = &dhGEXSHA{hashFunc: crypto.SHA256}
kexAlgoMap[KeyExchangeMLKEM768X25519] = &mlkem768WithCurve25519sha256{}
}
// curve25519sha256 implements the curve25519-sha256 (formerly known as
@@ -464,15 +454,17 @@ func (kp *curve25519KeyPair) generate(rand io.Reader) error {
if _, err := io.ReadFull(rand, kp.priv[:]); err != nil {
return err
}
curve25519.ScalarBaseMult(&kp.pub, &kp.priv)
p, err := curve25519.X25519(kp.priv[:], curve25519.Basepoint)
if err != nil {
return fmt.Errorf("curve25519: %w", err)
}
if len(p) != 32 {
return fmt.Errorf("curve25519: internal error: X25519 returned %d bytes, expected 32", len(p))
}
copy(kp.pub[:], p)
return nil
}
// curve25519Zeros is just an array of 32 zero bytes so that we have something
// convenient to compare against in order to reject curve25519 points with the
// wrong order.
var curve25519Zeros [32]byte
func (kex *curve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) {
var kp curve25519KeyPair
if err := kp.generate(rand); err != nil {
@@ -495,11 +487,9 @@ func (kex *curve25519sha256) Client(c packetConn, rand io.Reader, magics *handsh
return nil, errors.New("ssh: peer's curve25519 public value has wrong length")
}
var servPub, secret [32]byte
copy(servPub[:], reply.EphemeralPubKey)
curve25519.ScalarMult(&secret, &kp.priv, &servPub)
if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 {
return nil, errors.New("ssh: peer's curve25519 public value has wrong order")
secret, err := curve25519.X25519(kp.priv[:], reply.EphemeralPubKey)
if err != nil {
return nil, fmt.Errorf("ssh: peer's curve25519 public value is not valid: %w", err)
}
h := crypto.SHA256.New()
@@ -541,11 +531,9 @@ func (kex *curve25519sha256) Server(c packetConn, rand io.Reader, magics *handsh
return nil, err
}
var clientPub, secret [32]byte
copy(clientPub[:], kexInit.ClientPubKey)
curve25519.ScalarMult(&secret, &kp.priv, &clientPub)
if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 {
return nil, errors.New("ssh: peer's curve25519 public value has wrong order")
secret, err := curve25519.X25519(kp.priv[:], kexInit.ClientPubKey)
if err != nil {
return nil, fmt.Errorf("ssh: peer's curve25519 public value is not valid: %w", err)
}
hostKeyBytes := priv.PublicKey().Marshal()
@@ -601,9 +589,9 @@ const (
func (gex *dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshakeMagics) (*kexResult, error) {
// Send GexRequest
kexDHGexRequest := kexDHGexRequestMsg{
MinBits: dhGroupExchangeMinimumBits,
PreferedBits: dhGroupExchangePreferredBits,
MaxBits: dhGroupExchangeMaximumBits,
MinBits: dhGroupExchangeMinimumBits,
PreferredBits: dhGroupExchangePreferredBits,
MaxBits: dhGroupExchangeMaximumBits,
}
if err := c.writePacket(Marshal(&kexDHGexRequest)); err != nil {
return nil, err
@@ -690,9 +678,7 @@ func (gex *dhGEXSHA) Client(c packetConn, randSource io.Reader, magics *handshak
}
// Server half implementation of the Diffie Hellman Key Exchange with SHA1 and SHA256.
//
// This is a minimal implementation to satisfy the automated tests.
func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (result *kexResult, err error) {
func (gex *dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (result *kexResult, err error) {
// Receive GexRequest
packet, err := c.readPacket()
if err != nil {
@@ -702,13 +688,32 @@ func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshake
if err = Unmarshal(packet, &kexDHGexRequest); err != nil {
return
}
// We check that the request received is valid and that the MaxBits
// requested are at least equal to our supported minimum. This is the same
// check done in OpenSSH:
// https://github.com/openssh/openssh-portable/blob/80a2f64b/kexgexs.c#L94
//
// Furthermore, we also check that the required MinBits are less than or
// equal to 4096 because we can use up to Oakley Group 16.
if kexDHGexRequest.MaxBits < kexDHGexRequest.MinBits || kexDHGexRequest.PreferredBits < kexDHGexRequest.MinBits ||
kexDHGexRequest.MaxBits < kexDHGexRequest.PreferredBits || kexDHGexRequest.MaxBits < dhGroupExchangeMinimumBits ||
kexDHGexRequest.MinBits > 4096 {
return nil, fmt.Errorf("ssh: DH GEX request out of range, min: %d, max: %d, preferred: %d", kexDHGexRequest.MinBits,
kexDHGexRequest.MaxBits, kexDHGexRequest.PreferredBits)
}
var p *big.Int
// We hardcode sending Oakley Group 14 (2048 bits), Oakley Group 15 (3072
// bits) or Oakley Group 16 (4096 bits), based on the requested max size.
if kexDHGexRequest.MaxBits < 3072 {
p, _ = new(big.Int).SetString(oakleyGroup14, 16)
} else if kexDHGexRequest.MaxBits < 4096 {
p, _ = new(big.Int).SetString(oakleyGroup15, 16)
} else {
p, _ = new(big.Int).SetString(oakleyGroup16, 16)
}
// Send GexGroup
// This is the group called diffie-hellman-group14-sha1 in RFC
// 4253 and Oakley Group 14 in RFC 3526.
p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16)
g := big.NewInt(2)
msg := &kexDHGexGroupMsg{
P: p,
G: g,
@@ -746,9 +751,9 @@ func (gex dhGEXSHA) Server(c packetConn, randSource io.Reader, magics *handshake
h := gex.hashFunc.New()
magics.write(h)
writeString(h, hostKeyBytes)
binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMinimumBits))
binary.Write(h, binary.BigEndian, uint32(dhGroupExchangePreferredBits))
binary.Write(h, binary.BigEndian, uint32(dhGroupExchangeMaximumBits))
binary.Write(h, binary.BigEndian, kexDHGexRequest.MinBits)
binary.Write(h, binary.BigEndian, kexDHGexRequest.PreferredBits)
binary.Write(h, binary.BigEndian, kexDHGexRequest.MaxBits)
writeInt(h, p)
writeInt(h, g)
writeInt(h, kexDHGexInit.X)
+16 -11
View File
@@ -36,14 +36,19 @@ import (
// ClientConfig.HostKeyAlgorithms, Signature.Format, or as AlgorithmSigner
// arguments.
const (
KeyAlgoRSA = "ssh-rsa"
KeyAlgoDSA = "ssh-dss"
KeyAlgoECDSA256 = "ecdsa-sha2-nistp256"
KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com"
KeyAlgoECDSA384 = "ecdsa-sha2-nistp384"
KeyAlgoECDSA521 = "ecdsa-sha2-nistp521"
KeyAlgoED25519 = "ssh-ed25519"
KeyAlgoSKED25519 = "sk-ssh-ed25519@openssh.com"
KeyAlgoRSA = "ssh-rsa"
// Deprecated: DSA is only supported at insecure key sizes, and was removed
// from major implementations.
KeyAlgoDSA = InsecureKeyAlgoDSA
// Deprecated: DSA is only supported at insecure key sizes, and was removed
// from major implementations.
InsecureKeyAlgoDSA = "ssh-dss"
KeyAlgoECDSA256 = "ecdsa-sha2-nistp256"
KeyAlgoSKECDSA256 = "sk-ecdsa-sha2-nistp256@openssh.com"
KeyAlgoECDSA384 = "ecdsa-sha2-nistp384"
KeyAlgoECDSA521 = "ecdsa-sha2-nistp521"
KeyAlgoED25519 = "ssh-ed25519"
KeyAlgoSKED25519 = "sk-ssh-ed25519@openssh.com"
// KeyAlgoRSASHA256 and KeyAlgoRSASHA512 are only public key algorithms, not
// public key formats, so they can't appear as a PublicKey.Type. The
@@ -67,7 +72,7 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err
switch algo {
case KeyAlgoRSA:
return parseRSA(in)
case KeyAlgoDSA:
case InsecureKeyAlgoDSA:
return parseDSA(in)
case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521:
return parseECDSA(in)
@@ -77,7 +82,7 @@ func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err err
return parseED25519(in)
case KeyAlgoSKED25519:
return parseSKEd25519(in)
case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01:
case CertAlgoRSAv01, InsecureCertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoSKECDSA256v01, CertAlgoED25519v01, CertAlgoSKED25519v01:
cert, err := parseCert(in, certKeyAlgoNames[algo])
if err != nil {
return nil, nil, err
@@ -268,7 +273,7 @@ func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []str
return nil, "", nil, nil, errors.New("ssh: no key found")
}
// ParsePublicKey parses an SSH public key formatted for use in
// ParsePublicKey parses an SSH public key or certificate formatted for use in
// the SSH wire protocol according to RFC 4253, section 6.6.
func ParsePublicKey(in []byte) (out PublicKey, err error) {
algo, in, ok := parseString(in)
+27
View File
@@ -810,3 +810,30 @@ func TestCryptoPublicKey(t *testing.T) {
}
}
}
func TestParseCertWithCertSignatureKey(t *testing.T) {
certBytes := []byte(`-----BEGIN SSH CERTIFICATE-----
AAAAIHNzaC1lZDI1NTE5LWNlcnQtdjAxQG9wZW5zc2guY29tAAAAIPSp27hvNSB0
IotJnVhjC4zxNgNS8BHlUCxD0VJi4D/eAAAAIIJMi1e5qfx+IFuKD/p/Ssqcb3os
CpOw/4wBs1pQ53zwAAAAAAAAAAEAAAACAAAAAAAAABMAAAAPZm9vLmV4YW1wbGUu
Y29tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT0AAAAgc3NoLWVkMjU1
MTktY2VydC12MDFAb3BlbnNzaC5jb20AAAAg+sNYhCO35mQT1UBMpmMk8ey+culd
IU8vBlPEl4B07swAAAAggiv+RLnboS4znGCVl/n1jDg2uD0h15tW4s/04eS2mLQA
AAAAAAAAAQAAAAIAAAAAAAAAEwAAAA9mb28uZXhhbXBsZS5jb20AAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAAAtzc2gtZWQyNTUxOQAAACCV2wETgLKL
Kt0bRl3YUnd/ZYSlq0xJMbn4Jj3cdPWykQAAAFMAAAALc3NoLWVkMjU1MTkAAABA
WOdbRGEzyRAhiIK227CLUQD5caXYMV8FvSIB7toEE2M/8HnWdG9H3Rsg/v3unruQ
JrQldnuPJNe7KOP2+zvUDgAAAFMAAAALc3NoLWVkMjU1MTkAAABAm3bIPp85ZpIe
D+izJcUqlcAOri7HO8bULFNHT6LVegvB06xQ5TLwMlrxWUF4cafl1tSe8JQck4a6
cLYUOHfQDw==
-----END SSH CERTIFICATE-----
`)
block, _ := pem.Decode(certBytes)
if block == nil {
t.Fatal("invalid test certificate")
}
if _, err := ParsePublicKey(block.Bytes); err == nil {
t.Fatal("parsing an SSH certificate using another certificate as signature key succeeded; expected failure")
}
}
+26 -34
View File
@@ -302,8 +302,8 @@ func (k *KnownKey) String() string {
// applications can offer an interactive prompt to the user.
type KeyError struct {
// Want holds the accepted host keys. For each key algorithm,
// there can be one hostkey. If Want is empty, the host is
// unknown. If Want is non-empty, there was a mismatch, which
// there can be multiple hostkeys. If Want is empty, the host
// is unknown. If Want is non-empty, there was a mismatch, which
// can signify a MITM attack.
Want []KnownKey
}
@@ -358,34 +358,20 @@ func (db *hostKeyDB) checkAddr(a addr, remoteKey ssh.PublicKey) error {
// is just a key for the IP address, but not for the
// hostname?
// Algorithm => key.
knownKeys := map[string]KnownKey{}
keyErr := &KeyError{}
for _, l := range db.lines {
if l.match(a) {
typ := l.knownKey.Key.Type()
if _, ok := knownKeys[typ]; !ok {
knownKeys[typ] = l.knownKey
}
if !l.match(a) {
continue
}
keyErr.Want = append(keyErr.Want, l.knownKey)
if keyEq(l.knownKey.Key, remoteKey) {
return nil
}
}
keyErr := &KeyError{}
for _, v := range knownKeys {
keyErr.Want = append(keyErr.Want, v)
}
// Unknown remote host.
if len(knownKeys) == 0 {
return keyErr
}
// If the remote host starts using a different, unknown key type, we
// also interpret that as a mismatch.
if known, ok := knownKeys[remoteKey.Type()]; !ok || !keyEq(known.Key, remoteKey) {
return keyErr
}
return nil
return keyErr
}
// The Read function parses file contents.
@@ -435,20 +421,26 @@ func New(files ...string) (ssh.HostKeyCallback, error) {
return certChecker.CheckHostKey, nil
}
// Normalize normalizes an address into the form used in known_hosts
// Normalize normalizes an address into the form used in known_hosts. Supports
// IPv4, hostnames, bracketed IPv6. Any other non-standard formats are returned
// with minimal transformation.
func Normalize(address string) string {
const defaultSSHPort = "22"
host, port, err := net.SplitHostPort(address)
if err != nil {
host = address
port = "22"
port = defaultSSHPort
}
entry := host
if port != "22" {
entry = "[" + entry + "]:" + port
} else if strings.Contains(host, ":") && !strings.HasPrefix(host, "[") {
entry = "[" + entry + "]"
if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") {
host = host[1 : len(host)-1]
}
return entry
if port == defaultSSHPort {
return host
}
return "[" + host + "]:" + port
}
// Line returns a line to add append to the known_hosts files.
+33 -20
View File
@@ -201,17 +201,6 @@ func TestHostNamePrecedence(t *testing.T) {
}
}
func TestDBOrderingPrecedenceKeyType(t *testing.T) {
str := fmt.Sprintf("server.org,%s %s\nserver.org,%s %s", testAddr, edKeyStr, testAddr, alternateEdKeyStr)
db := testDB(t, str)
if err := db.check("server.org:22", testAddr, alternateEdKey); err == nil {
t.Errorf("check succeeded")
} else if _, ok := err.(*KeyError); !ok {
t.Errorf("got %T, want *KeyError", err)
}
}
func TestNegate(t *testing.T) {
str := fmt.Sprintf("%s,!server.org %s", testAddr, edKeyStr)
db := testDB(t, str)
@@ -247,7 +236,7 @@ func TestLine(t *testing.T) {
"server.org": "server.org " + edKeyStr,
"server.org:22": "server.org " + edKeyStr,
"server.org:23": "[server.org]:23 " + edKeyStr,
"[c629:1ec4:102:304:102:304:102:304]:22": "[c629:1ec4:102:304:102:304:102:304] " + edKeyStr,
"[c629:1ec4:102:304:102:304:102:304]:22": "c629:1ec4:102:304:102:304:102:304 " + edKeyStr,
"[c629:1ec4:102:304:102:304:102:304]:23": "[c629:1ec4:102:304:102:304:102:304]:23 " + edKeyStr,
} {
if got := Line([]string{in}, edKey); got != want {
@@ -321,14 +310,25 @@ func testHostHash(t *testing.T, hostname, encoded string) {
func TestNormalize(t *testing.T) {
for in, want := range map[string]string{
"127.0.0.1:22": "127.0.0.1",
"[127.0.0.1]:22": "127.0.0.1",
"[127.0.0.1]:23": "[127.0.0.1]:23",
"127.0.0.1:23": "[127.0.0.1]:23",
"[a.b.c]:22": "a.b.c",
"[abcd:abcd:abcd:abcd]": "[abcd:abcd:abcd:abcd]",
"[abcd:abcd:abcd:abcd]:22": "[abcd:abcd:abcd:abcd]",
"[abcd:abcd:abcd:abcd]:23": "[abcd:abcd:abcd:abcd]:23",
"127.0.0.1": "127.0.0.1",
"127.0.0.1:22": "127.0.0.1",
"[127.0.0.1]:22": "127.0.0.1",
"[127.0.0.1]:23": "[127.0.0.1]:23",
"127.0.0.1:23": "[127.0.0.1]:23",
"[a.b.c]:22": "a.b.c",
"[a.b.c]:23": "[a.b.c]:23",
"abcd::abcd:abcd:abcd": "abcd::abcd:abcd:abcd",
"[abcd::abcd:abcd:abcd]": "abcd::abcd:abcd:abcd",
"[abcd::abcd:abcd:abcd]:22": "abcd::abcd:abcd:abcd",
"[abcd::abcd:abcd:abcd]:23": "[abcd::abcd:abcd:abcd]:23",
"2001:db8::1": "2001:db8::1",
"2001:db8::1:22": "2001:db8::1:22",
"[2001:db8::1]:22": "2001:db8::1",
"2001:db8::1:2200": "2001:db8::1:2200",
"a.b.c.d.com:2200": "[a.b.c.d.com]:2200",
"2001::db8:1": "2001::db8:1",
"2001::db8:1:22": "2001::db8:1:22",
"2001::db8:1:2200": "2001::db8:1:2200",
} {
got := Normalize(in)
if got != want {
@@ -354,3 +354,16 @@ func TestHashedHostkeyCheck(t *testing.T) {
t.Errorf("got error %v, want %v", got, want)
}
}
func TestIssue36126(t *testing.T) {
str := fmt.Sprintf("server.org,%s %s\nserver.org,%s %s", testAddr, edKeyStr, testAddr, alternateEdKeyStr)
db := testDB(t, str)
if err := db.check("server.org:22", testAddr, edKey); err != nil {
t.Errorf("should have passed the check, got %v", err)
}
if err := db.check("server.org:22", testAddr, alternateEdKey); err != nil {
t.Errorf("should have passed the check, got %v", err)
}
}
+6 -6
View File
@@ -47,22 +47,22 @@ func (t truncatingMAC) Size() int {
func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() }
var macModes = map[string]*macMode{
"hmac-sha2-512-etm@openssh.com": {64, true, func(key []byte) hash.Hash {
HMACSHA512ETM: {64, true, func(key []byte) hash.Hash {
return hmac.New(sha512.New, key)
}},
"hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash {
HMACSHA256ETM: {32, true, func(key []byte) hash.Hash {
return hmac.New(sha256.New, key)
}},
"hmac-sha2-512": {64, false, func(key []byte) hash.Hash {
HMACSHA512: {64, false, func(key []byte) hash.Hash {
return hmac.New(sha512.New, key)
}},
"hmac-sha2-256": {32, false, func(key []byte) hash.Hash {
HMACSHA256: {32, false, func(key []byte) hash.Hash {
return hmac.New(sha256.New, key)
}},
"hmac-sha1": {20, false, func(key []byte) hash.Hash {
HMACSHA1: {20, false, func(key []byte) hash.Hash {
return hmac.New(sha1.New, key)
}},
"hmac-sha1-96": {20, false, func(key []byte) hash.Hash {
InsecureHMACSHA196: {20, false, func(key []byte) hash.Hash {
return truncatingMAC{12, hmac.New(sha1.New, key)}
}},
}
+5 -3
View File
@@ -122,9 +122,9 @@ type kexDHGexReplyMsg struct {
const msgKexDHGexRequest = 34
type kexDHGexRequestMsg struct {
MinBits uint32 `sshtype:"34"`
PreferedBits uint32
MaxBits uint32
MinBits uint32 `sshtype:"34"`
PreferredBits uint32
MaxBits uint32
}
// See RFC 4253, section 10.
@@ -818,6 +818,8 @@ func decode(packet []byte) (interface{}, error) {
return new(userAuthSuccessMsg), nil
case msgUserAuthFailure:
msg = new(userAuthFailureMsg)
case msgUserAuthBanner:
msg = new(userAuthBannerMsg)
case msgUserAuthPubKeyOk:
msg = new(userAuthPubKeyOkMsg)
case msgGlobalRequest:
+56
View File
@@ -206,6 +206,62 @@ func TestMarshalMultiTag(t *testing.T) {
}
}
func TestDecode(t *testing.T) {
rnd := rand.New(rand.NewSource(0))
kexInit := new(kexInitMsg).Generate(rnd, 10).Interface()
kexDHInit := new(kexDHInitMsg).Generate(rnd, 10).Interface()
kexDHReply := new(kexDHReplyMsg)
kexDHReply.Y = randomInt(rnd)
// Note: userAuthSuccessMsg can't be tested directly since it
// doesn't have a field for sshtype. So it's tested separately
// at the end.
decodeMessageTypes := []interface{}{
new(disconnectMsg),
new(serviceRequestMsg),
new(serviceAcceptMsg),
new(extInfoMsg),
kexInit,
kexDHInit,
kexDHReply,
new(userAuthRequestMsg),
new(userAuthFailureMsg),
new(userAuthBannerMsg),
new(userAuthPubKeyOkMsg),
new(globalRequestMsg),
new(globalRequestSuccessMsg),
new(globalRequestFailureMsg),
new(channelOpenMsg),
new(channelDataMsg),
new(channelOpenConfirmMsg),
new(channelOpenFailureMsg),
new(windowAdjustMsg),
new(channelEOFMsg),
new(channelCloseMsg),
new(channelRequestMsg),
new(channelRequestSuccessMsg),
new(channelRequestFailureMsg),
new(userAuthGSSAPIToken),
new(userAuthGSSAPIMIC),
new(userAuthGSSAPIErrTok),
new(userAuthGSSAPIError),
}
for _, msg := range decodeMessageTypes {
decoded, err := decode(Marshal(msg))
if err != nil {
t.Errorf("error decoding %T", msg)
} else if reflect.TypeOf(msg) != reflect.TypeOf(decoded) {
t.Errorf("error decoding %T, unexpected %T", msg, decoded)
}
}
userAuthSuccess, err := decode([]byte{msgUserAuthSuccess})
if err != nil {
t.Errorf("error decoding userAuthSuccessMsg")
} else if reflect.TypeOf(userAuthSuccess) != reflect.TypeOf((*userAuthSuccessMsg)(nil)) {
t.Errorf("error decoding userAuthSuccessMsg, unexpected %T", userAuthSuccess)
}
}
func randomBytes(out []byte, rand *rand.Rand) {
for i := 0; i < len(out); i++ {
out[i] = byte(rand.Int31())
+168
View File
@@ -0,0 +1,168 @@
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ssh
import (
"crypto"
"crypto/mlkem"
"crypto/sha256"
"errors"
"fmt"
"io"
"golang.org/x/crypto/curve25519"
)
// mlkem768WithCurve25519sha256 implements the hybrid ML-KEM768 with
// curve25519-sha256 key exchange method, as described by
// draft-kampanakis-curdle-ssh-pq-ke-05 section 2.3.3.
type mlkem768WithCurve25519sha256 struct{}
func (kex *mlkem768WithCurve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) {
var c25519kp curve25519KeyPair
if err := c25519kp.generate(rand); err != nil {
return nil, err
}
seed := make([]byte, mlkem.SeedSize)
if _, err := io.ReadFull(rand, seed); err != nil {
return nil, err
}
mlkemDk, err := mlkem.NewDecapsulationKey768(seed)
if err != nil {
return nil, err
}
hybridKey := append(mlkemDk.EncapsulationKey().Bytes(), c25519kp.pub[:]...)
if err := c.writePacket(Marshal(&kexECDHInitMsg{hybridKey})); err != nil {
return nil, err
}
packet, err := c.readPacket()
if err != nil {
return nil, err
}
var reply kexECDHReplyMsg
if err = Unmarshal(packet, &reply); err != nil {
return nil, err
}
if len(reply.EphemeralPubKey) != mlkem.CiphertextSize768+32 {
return nil, errors.New("ssh: peer's mlkem768x25519 public value has wrong length")
}
// Perform KEM decapsulate operation to obtain shared key from ML-KEM.
mlkem768Secret, err := mlkemDk.Decapsulate(reply.EphemeralPubKey[:mlkem.CiphertextSize768])
if err != nil {
return nil, err
}
// Complete Curve25519 ECDH to obtain its shared key.
c25519Secret, err := curve25519.X25519(c25519kp.priv[:], reply.EphemeralPubKey[mlkem.CiphertextSize768:])
if err != nil {
return nil, fmt.Errorf("ssh: peer's mlkem768x25519 public value is not valid: %w", err)
}
// Compute actual shared key.
h := sha256.New()
h.Write(mlkem768Secret)
h.Write(c25519Secret)
secret := h.Sum(nil)
h.Reset()
magics.write(h)
writeString(h, reply.HostKey)
writeString(h, hybridKey)
writeString(h, reply.EphemeralPubKey)
K := make([]byte, stringLength(len(secret)))
marshalString(K, secret)
h.Write(K)
return &kexResult{
H: h.Sum(nil),
K: K,
HostKey: reply.HostKey,
Signature: reply.Signature,
Hash: crypto.SHA256,
}, nil
}
func (kex *mlkem768WithCurve25519sha256) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv AlgorithmSigner, algo string) (*kexResult, error) {
packet, err := c.readPacket()
if err != nil {
return nil, err
}
var kexInit kexECDHInitMsg
if err = Unmarshal(packet, &kexInit); err != nil {
return nil, err
}
if len(kexInit.ClientPubKey) != mlkem.EncapsulationKeySize768+32 {
return nil, errors.New("ssh: peer's ML-KEM768/curve25519 public value has wrong length")
}
encapsulationKey, err := mlkem.NewEncapsulationKey768(kexInit.ClientPubKey[:mlkem.EncapsulationKeySize768])
if err != nil {
return nil, fmt.Errorf("ssh: peer's ML-KEM768 encapsulation key is not valid: %w", err)
}
// Perform KEM encapsulate operation to obtain ciphertext and shared key.
mlkem768Secret, mlkem768Ciphertext := encapsulationKey.Encapsulate()
// Perform server side of Curve25519 ECDH to obtain server public value and
// shared key.
var c25519kp curve25519KeyPair
if err := c25519kp.generate(rand); err != nil {
return nil, err
}
c25519Secret, err := curve25519.X25519(c25519kp.priv[:], kexInit.ClientPubKey[mlkem.EncapsulationKeySize768:])
if err != nil {
return nil, fmt.Errorf("ssh: peer's ML-KEM768/curve25519 public value is not valid: %w", err)
}
hybridKey := append(mlkem768Ciphertext, c25519kp.pub[:]...)
// Compute actual shared key.
h := sha256.New()
h.Write(mlkem768Secret)
h.Write(c25519Secret)
secret := h.Sum(nil)
hostKeyBytes := priv.PublicKey().Marshal()
h.Reset()
magics.write(h)
writeString(h, hostKeyBytes)
writeString(h, kexInit.ClientPubKey)
writeString(h, hybridKey)
K := make([]byte, stringLength(len(secret)))
marshalString(K, secret)
h.Write(K)
H := h.Sum(nil)
sig, err := signAndMarshal(priv, rand, H, algo)
if err != nil {
return nil, err
}
reply := kexECDHReplyMsg{
EphemeralPubKey: hybridKey,
HostKey: hostKeyBytes,
Signature: sig,
}
if err := c.writePacket(Marshal(&reply)); err != nil {
return nil, err
}
return &kexResult{
H: H,
K: K,
HostKey: hostKeyBytes,
Signature: sig,
Hash: crypto.SHA256,
}, nil
}
+51 -26
View File
@@ -59,6 +59,27 @@ type GSSAPIWithMICConfig struct {
Server GSSAPIServer
}
// SendAuthBanner implements [ServerPreAuthConn].
func (s *connection) SendAuthBanner(msg string) error {
return s.transport.writePacket(Marshal(&userAuthBannerMsg{
Message: msg,
}))
}
func (*connection) unexportedMethodForFutureProofing() {}
// ServerPreAuthConn is the interface available on an incoming server
// connection before authentication has completed.
type ServerPreAuthConn interface {
unexportedMethodForFutureProofing() // permits growing ServerPreAuthConn safely later, ala testing.TB
ConnMetadata
// SendAuthBanner sends a banner message to the client.
// It returns an error once the authentication phase has ended.
SendAuthBanner(string) error
}
// ServerConfig holds server specific configuration data.
type ServerConfig struct {
// Config contains configuration shared between client and server.
@@ -118,6 +139,12 @@ type ServerConfig struct {
// attempts.
AuthLogCallback func(conn ConnMetadata, method string, err error)
// PreAuthConnCallback, if non-nil, is called upon receiving a new connection
// before any authentication has started. The provided ServerPreAuthConn
// can be used at any time before authentication is complete, including
// after this callback has returned.
PreAuthConnCallback func(ServerPreAuthConn)
// ServerVersion is the version identification string to announce in
// the public handshake.
// If empty, a reasonable default is used.
@@ -149,7 +176,7 @@ func (s *ServerConfig) AddHostKey(key Signer) {
}
// cachedPubKey contains the results of querying whether a public key is
// acceptable for a user.
// acceptable for a user. This is a FIFO cache.
type cachedPubKey struct {
user string
pubKeyData []byte
@@ -157,7 +184,13 @@ type cachedPubKey struct {
perms *Permissions
}
const maxCachedPubKeys = 16
// maxCachedPubKeys is the number of cache entries we store.
//
// Due to consistent misuse of the PublicKeyCallback API, we have reduced this
// to 1, such that the only key in the cache is the most recently seen one. This
// forces the behavior that the last call to PublicKeyCallback will always be
// with the key that is used for authentication.
const maxCachedPubKeys = 1
// pubKeyCache caches tests for public keys. Since SSH clients
// will query whether a public key is acceptable before attempting to
@@ -179,9 +212,10 @@ func (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) {
// add adds the given tuple to the cache.
func (c *pubKeyCache) add(candidate cachedPubKey) {
if len(c.keys) < maxCachedPubKeys {
c.keys = append(c.keys, candidate)
if len(c.keys) >= maxCachedPubKeys {
c.keys = c.keys[1:]
}
c.keys = append(c.keys, candidate)
}
// ServerConn is an authenticated SSH connection, as seen from the
@@ -209,22 +243,15 @@ func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewCha
fullConf.MaxAuthTries = 6
}
if len(fullConf.PublicKeyAuthAlgorithms) == 0 {
fullConf.PublicKeyAuthAlgorithms = supportedPubKeyAuthAlgos
fullConf.PublicKeyAuthAlgorithms = defaultPubKeyAuthAlgos
} else {
for _, algo := range fullConf.PublicKeyAuthAlgorithms {
if !contains(supportedPubKeyAuthAlgos, algo) {
if !contains(SupportedAlgorithms().PublicKeyAuths, algo) && !contains(InsecureAlgorithms().PublicKeyAuths, algo) {
c.Close()
return nil, nil, nil, fmt.Errorf("ssh: unsupported public key authentication algorithm %s", algo)
}
}
}
// Check if the config contains any unsupported key exchanges
for _, kex := range fullConf.KeyExchanges {
if _, ok := serverForbiddenKexAlgos[kex]; ok {
c.Close()
return nil, nil, nil, fmt.Errorf("ssh: unsupported key exchange %s for server", kex)
}
}
s := &connection{
sshConn: sshConn{conn: c},
@@ -281,6 +308,7 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error)
// We just did the key change, so the session ID is established.
s.sessionID = s.transport.getSessionID()
s.algorithms = s.transport.getAlgorithms()
var packet []byte
if packet, err = s.transport.readPacket(); err != nil {
@@ -481,6 +509,10 @@ func (b *BannerError) Error() string {
}
func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) {
if config.PreAuthConnCallback != nil {
config.PreAuthConnCallback(s)
}
sessionID := s.transport.getSessionID()
var cache pubKeyCache
var perms *Permissions
@@ -488,7 +520,7 @@ func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, err
authFailures := 0
noneAuthCount := 0
var authErrs []error
var displayedBanner bool
var calledBannerCallback bool
partialSuccessReturned := false
// Set the initial authentication callbacks from the config. They can be
// changed if a PartialSuccessError is returned.
@@ -535,14 +567,10 @@ userAuthLoop:
s.user = userAuthReq.User
if !displayedBanner && config.BannerCallback != nil {
displayedBanner = true
msg := config.BannerCallback(s)
if msg != "" {
bannerMsg := &userAuthBannerMsg{
Message: msg,
}
if err := s.transport.writePacket(Marshal(bannerMsg)); err != nil {
if !calledBannerCallback && config.BannerCallback != nil {
calledBannerCallback = true
if msg := config.BannerCallback(s); msg != "" {
if err := s.SendAuthBanner(msg); err != nil {
return nil, err
}
}
@@ -755,10 +783,7 @@ userAuthLoop:
var bannerErr *BannerError
if errors.As(authErr, &bannerErr) {
if bannerErr.Message != "" {
bannerMsg := &userAuthBannerMsg{
Message: bannerErr.Message,
}
if err := s.transport.writePacket(Marshal(bannerMsg)); err != nil {
if err := s.SendAuthBanner(bannerErr.Message); err != nil {
return nil, err
}
}
+136 -1
View File
@@ -5,6 +5,7 @@
package ssh
import (
"bytes"
"errors"
"fmt"
"io"
@@ -211,7 +212,7 @@ func TestNewServerConnValidationErrors(t *testing.T) {
serverConf = &ServerConfig{
Config: Config{
KeyExchanges: []string{kexAlgoDHGEXSHA256},
KeyExchanges: []string{KeyExchangeDHGEXSHA256},
},
}
c = &markerConn{}
@@ -299,6 +300,140 @@ func TestBannerError(t *testing.T) {
}
}
func TestPublicKeyCallbackLastSeen(t *testing.T) {
var lastSeenKey PublicKey
c1, c2, err := netPipe()
if err != nil {
t.Fatalf("netPipe: %v", err)
}
defer c1.Close()
defer c2.Close()
serverConf := &ServerConfig{
PublicKeyCallback: func(conn ConnMetadata, key PublicKey) (*Permissions, error) {
lastSeenKey = key
fmt.Printf("seen %#v\n", key)
if _, ok := key.(*dsaPublicKey); !ok {
return nil, errors.New("nope")
}
return nil, nil
},
}
serverConf.AddHostKey(testSigners["ecdsap256"])
done := make(chan struct{})
go func() {
defer close(done)
NewServerConn(c1, serverConf)
}()
clientConf := ClientConfig{
User: "user",
Auth: []AuthMethod{
PublicKeys(testSigners["rsa"], testSigners["dsa"], testSigners["ed25519"]),
},
HostKeyCallback: InsecureIgnoreHostKey(),
}
_, _, _, err = NewClientConn(c2, "", &clientConf)
if err != nil {
t.Fatal(err)
}
<-done
expectedPublicKey := testSigners["dsa"].PublicKey().Marshal()
lastSeenMarshalled := lastSeenKey.Marshal()
if !bytes.Equal(lastSeenMarshalled, expectedPublicKey) {
t.Errorf("unexpected key: got %#v, want %#v", lastSeenKey, testSigners["dsa"].PublicKey())
}
}
func TestPreAuthConnAndBanners(t *testing.T) {
testDone := make(chan struct{})
defer close(testDone)
authConnc := make(chan ServerPreAuthConn, 1)
serverConfig := &ServerConfig{
PreAuthConnCallback: func(c ServerPreAuthConn) {
t.Logf("got ServerPreAuthConn: %v", c)
authConnc <- c // for use later in the test
for _, s := range []string{"hello1", "hello2"} {
if err := c.SendAuthBanner(s); err != nil {
t.Errorf("failed to send banner %q: %v", s, err)
}
}
// Now start a goroutine to spam SendAuthBanner in hopes
// of hitting a race.
go func() {
for {
select {
case <-testDone:
return
default:
if err := c.SendAuthBanner("attempted-race"); err != nil && err != errSendBannerPhase {
t.Errorf("unexpected error from SendAuthBanner: %v", err)
}
time.Sleep(5 * time.Millisecond)
}
}
}()
},
NoClientAuth: true,
NoClientAuthCallback: func(ConnMetadata) (*Permissions, error) {
t.Logf("got NoClientAuthCallback")
return &Permissions{}, nil
},
}
serverConfig.AddHostKey(testSigners["rsa"])
var banners []string
clientConfig := &ClientConfig{
User: "test",
HostKeyCallback: InsecureIgnoreHostKey(),
BannerCallback: func(msg string) error {
if msg != "attempted-race" {
banners = append(banners, msg)
}
return nil
},
}
c1, c2, err := netPipe()
if err != nil {
t.Fatalf("netPipe: %v", err)
}
defer c1.Close()
defer c2.Close()
go newServer(c1, serverConfig)
c, _, _, err := NewClientConn(c2, "", clientConfig)
if err != nil {
t.Fatalf("client connection failed: %v", err)
}
defer c.Close()
wantBanners := []string{
"hello1",
"hello2",
}
if !reflect.DeepEqual(banners, wantBanners) {
t.Errorf("got banners:\n%q\nwant banners:\n%q", banners, wantBanners)
}
// Now that we're authenticated, verify that use of SendBanner
// is an error.
var bc ServerPreAuthConn
select {
case bc = <-authConnc:
default:
t.Fatal("expected ServerPreAuthConn")
}
if err := bc.SendAuthBanner("wrong-phase"); err == nil {
t.Error("unexpected success of SendAuthBanner after authentication")
} else if err != errSendBannerPhase {
t.Errorf("unexpected error: %v; want %v", err, errSendBannerPhase)
}
}
type markerConn struct {
closed uint32
used uint32
+1 -1
View File
@@ -459,7 +459,7 @@ func (c *Client) dial(laddr string, lport int, raddr string, rport int) (Channel
return nil, err
}
go DiscardRequests(in)
return ch, err
return ch, nil
}
type tcpChan struct {
-31
View File
@@ -1,31 +0,0 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
package test
import (
"testing"
)
func TestBannerCallbackAgainstOpenSSH(t *testing.T) {
server := newServer(t)
clientConf := clientConfig()
var receivedBanner string
clientConf.BannerCallback = func(message string) error {
receivedBanner = message
return nil
}
conn := server.Dial(clientConf)
defer conn.Close()
expected := "Server Banner"
if receivedBanner != expected {
t.Fatalf("got %v; want %v", receivedBanner, expected)
}
}
+1 -1
View File
@@ -94,7 +94,7 @@ func testPortForward(t *testing.T, n, listenAddr string) {
if len(sent) != len(read) {
t.Fatalf("got %d bytes, want %d", len(read), len(sent))
}
if bytes.Compare(sent, read) != 0 {
if !bytes.Equal(sent, read) {
t.Fatalf("read back data does not match")
}
+504
View File
@@ -0,0 +1,504 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package test
import (
"bytes"
"errors"
"fmt"
"io"
"net"
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"testing"
"time"
"golang.org/x/crypto/internal/testenv"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/testdata"
)
// serverPort contains the port that OpenSSH will listen on. OpenSSH can't take
// "0" as an argument here so we have to pick a number and hope that it's not in
// use on the machine. Since this only occurs when -update is given and thus
// when there's a human watching the test, this isn't too bad.
const serverPort = 24222
var (
storeUsernameOnce sync.Once
)
type clientTest struct {
// name is a freeform string identifying the test and the file in which
// the expected results will be stored.
name string
// config contains the client configuration to use for this test.
config *ssh.ClientConfig
// expectError defines the error string to check if the connection is
// expected to fail.
expectError string
// successCallback defines a callback to execute after the client connection
// is established.
successCallback func(t *testing.T, client *ssh.Client)
}
// connFromCommand starts the reference server process, connects to it and
// returns a recordingConn for the connection. It must be closed before Waiting
// for child.
func (test *clientTest) connFromCommand(t *testing.T, config string) *recordingConn {
sshd, err := exec.LookPath("sshd")
if err != nil {
t.Skipf("sshd not found, skipping test: %v", err)
}
dir, err := os.MkdirTemp("", "sshtest")
if err != nil {
t.Fatal(err)
}
f, err := os.Create(filepath.Join(dir, "sshd_config"))
if err != nil {
t.Fatal(err)
}
if _, ok := configTmpl[config]; ok == false {
t.Fatal(fmt.Errorf("Invalid server config '%s'", config))
}
configVars := map[string]string{
"Dir": dir,
}
err = configTmpl[config].Execute(f, configVars)
if err != nil {
t.Fatal(err)
}
f.Close()
writeFile(filepath.Join(dir, "banner"), []byte("Server Banner"))
for k, v := range testdata.PEMBytes {
filename := "id_" + k
writeFile(filepath.Join(dir, filename), v)
writeFile(filepath.Join(dir, filename+".pub"), ssh.MarshalAuthorizedKey(testPublicKeys[k]))
}
var authkeys bytes.Buffer
for k := range testdata.PEMBytes {
authkeys.Write(ssh.MarshalAuthorizedKey(testPublicKeys[k]))
}
writeFile(filepath.Join(dir, "authorized_keys"), authkeys.Bytes())
cmd := testenv.Command(t, sshd, "-D", "-e", "-f", f.Name(), "-p", strconv.Itoa(serverPort))
cmd.Stdin = nil
var output bytes.Buffer
cmd.Stdout = &output
cmd.Stderr = &output
if err := cmd.Start(); err != nil {
t.Fatal(err)
}
t.Cleanup(func() {
if err := os.RemoveAll(dir); err != nil {
t.Error(err)
}
// Don't check for errors; if it fails it's most
// likely "os: process already finished", and we don't
// care about that. Use os.Interrupt, so child
// processes are killed too.
cmd.Process.Signal(os.Interrupt)
cmd.Wait()
if t.Failed() {
t.Logf("OpenSSH output:\n\n%s", cmd.Stdout)
}
})
var tcpConn net.Conn
for i := uint(0); i < 5; i++ {
tcpConn, err = net.DialTCP("tcp", nil, &net.TCPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: serverPort,
})
if err == nil {
break
}
time.Sleep((1 << i) * 5 * time.Millisecond)
}
if err != nil {
t.Fatalf("error connecting to the OpenSSH server: %v (%v)\n\n%s", err, cmd.Wait(), output.Bytes())
}
record := &recordingConn{
Conn: tcpConn,
clientToServer: true,
}
return record
}
func (test *clientTest) dataPath() string {
return filepath.Join("..", "testdata", "Client-"+test.name)
}
func (test *clientTest) usernameDataPath() string {
return filepath.Join("..", "testdata", "Client-username")
}
func (test *clientTest) loadData() (flows [][]byte, err error) {
in, err := os.Open(test.dataPath())
if err != nil {
return nil, err
}
defer in.Close()
return parseTestData(in)
}
func (test *clientTest) storeUsername() (err error) {
storeUsernameOnce.Do(func() {
err = os.WriteFile(test.usernameDataPath(), []byte(username()), 0666)
})
return err
}
func (test *clientTest) loadUsername() (string, error) {
data, err := os.ReadFile(test.usernameDataPath())
return string(data), err
}
func (test *clientTest) run(t *testing.T, write bool) {
var clientConn net.Conn
var recordingConn *recordingConn
setDeterministicRandomSource(&test.config.Config)
if write {
// We store the username used when we record the connection so we can
// reuse the same username when running tests.
if err := test.storeUsername(); err != nil {
t.Fatalf("failed to store username to %q: %v", test.usernameDataPath(), err)
}
recordingConn = test.connFromCommand(t, "default")
clientConn = recordingConn
} else {
username, err := test.loadUsername()
if err != nil {
t.Fatalf("failed to load username from %q: %v", test.usernameDataPath(), err)
}
test.config.User = username
timer := time.AfterFunc(10*time.Second, func() {
fmt.Println("This test may be stuck, try running using -timeout 10s")
})
t.Cleanup(func() {
timer.Stop()
})
flows, err := test.loadData()
if err != nil {
t.Fatalf("failed to load data from %s: %v", test.dataPath(), err)
}
clientConn = newReplayingConn(t, flows)
}
c, chans, reqs, err := ssh.NewClientConn(clientConn, "", test.config)
if err != nil {
if test.expectError == "" {
t.Fatal(err)
} else {
if !strings.Contains(err.Error(), test.expectError) {
t.Fatalf("%q not found in %v", test.expectError, err)
}
}
} else {
if test.expectError != "" {
t.Error("dial should have failed.")
}
client := ssh.NewClient(c, chans, reqs)
if test.successCallback != nil {
test.successCallback(t, client)
}
if err := client.Close(); err != nil {
t.Fatal(err)
}
}
if write {
path := test.dataPath()
out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
t.Fatalf("Failed to create output file: %v", err)
}
defer out.Close()
recordingConn.Close()
recordingConn.WriteTo(out)
t.Logf("Wrote %s\n", path)
}
}
func recordingsClientConfig() *ssh.ClientConfig {
config := clientConfig()
config.SetDefaults()
// Remove ML-KEM since it only works with Go 1.24.
if config.KeyExchanges[0] == ssh.KeyExchangeMLKEM768X25519 {
config.KeyExchanges = config.KeyExchanges[1:]
}
config.Auth = []ssh.AuthMethod{
ssh.PublicKeys(testSigners["rsa"]),
}
return config
}
func TestClientKeyExchanges(t *testing.T) {
config := ssh.ClientConfig{}
config.SetDefaults()
var keyExchanges []string
for _, kex := range config.KeyExchanges {
// Exclude ecdh for now, to make them determistic we should use see a
// stream of fixed bytes as the random source.
if !strings.HasPrefix(kex, "ecdh-") {
keyExchanges = append(keyExchanges, kex)
}
}
// Add diffie-hellman-group-exchange-sha256 and
// diffie-hellman-group16-sha512 as they are not enabled by default.
keyExchanges = append(keyExchanges, "diffie-hellman-group-exchange-sha256", "diffie-hellman-group16-sha512")
for _, kex := range keyExchanges {
c := recordingsClientConfig()
c.KeyExchanges = []string{kex}
test := clientTest{
name: "KEX-" + kex,
config: c,
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
}
func TestClientCiphers(t *testing.T) {
config := ssh.ClientConfig{}
config.SetDefaults()
for _, ciph := range config.Ciphers {
c := recordingsClientConfig()
c.Ciphers = []string{ciph}
test := clientTest{
name: "Cipher-" + ciph,
config: c,
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
}
func TestClientMACs(t *testing.T) {
config := ssh.ClientConfig{}
config.SetDefaults()
for _, mac := range config.MACs {
c := recordingsClientConfig()
c.MACs = []string{mac}
test := clientTest{
name: "MAC-" + mac,
config: c,
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
}
func TestBannerCallback(t *testing.T) {
var receivedBanner string
config := recordingsClientConfig()
config.BannerCallback = func(message string) error {
receivedBanner = message
return nil
}
test := clientTest{
name: "BannerCallback",
config: config,
successCallback: func(t *testing.T, client *ssh.Client) {
expected := "Server Banner"
if receivedBanner != expected {
t.Fatalf("got %v; want %v", receivedBanner, expected)
}
},
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
func TestRunCommandSuccess(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm")
}
test := clientTest{
name: "RunCommandSuccess",
config: recordingsClientConfig(),
successCallback: func(t *testing.T, client *ssh.Client) {
session, err := client.NewSession()
if err != nil {
t.Fatalf("session failed: %v", err)
}
defer session.Close()
err = session.Run("true")
if err != nil {
t.Fatalf("session failed: %v", err)
}
},
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
func TestHostKeyCheck(t *testing.T) {
config := recordingsClientConfig()
hostDB := hostKeyDB()
config.HostKeyCallback = hostDB.Check
// change the keys.
hostDB.keys[ssh.KeyAlgoRSA][25]++
hostDB.keys[ssh.InsecureKeyAlgoDSA][25]++
hostDB.keys[ssh.KeyAlgoECDSA256][25]++
test := clientTest{
name: "HostKeyCheck",
config: config,
expectError: "host key mismatch",
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
func TestRunCommandStdin(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm")
}
test := clientTest{
name: "RunCommandStdin",
config: recordingsClientConfig(),
successCallback: func(t *testing.T, client *ssh.Client) {
session, err := client.NewSession()
if err != nil {
t.Fatalf("session failed: %v", err)
}
defer session.Close()
r, w := io.Pipe()
defer r.Close()
defer w.Close()
session.Stdin = r
err = session.Run("true")
if err != nil {
t.Fatalf("session failed: %v", err)
}
},
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
func TestRunCommandStdinError(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm")
}
test := clientTest{
name: "RunCommandStdinError",
config: recordingsClientConfig(),
successCallback: func(t *testing.T, client *ssh.Client) {
session, err := client.NewSession()
if err != nil {
t.Fatalf("session failed: %v", err)
}
defer session.Close()
r, w := io.Pipe()
defer r.Close()
session.Stdin = r
pipeErr := errors.New("closing write end of pipe")
w.CloseWithError(pipeErr)
err = session.Run("true")
if err != pipeErr {
t.Fatalf("expected %v, found %v", pipeErr, err)
}
},
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
func TestRunCommandFailed(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm")
}
test := clientTest{
name: "RunCommandFailed",
config: recordingsClientConfig(),
successCallback: func(t *testing.T, client *ssh.Client) {
session, err := client.NewSession()
if err != nil {
t.Fatalf("session failed: %v", err)
}
defer session.Close()
// Trigger a failure by attempting to execute a non-existent
// command.
err = session.Run(`non-existent command`)
if err == nil {
t.Fatalf("session succeeded: %v", err)
}
},
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
func TestWindowChange(t *testing.T) {
if runtime.GOARCH == "wasm" {
t.Skip("skipping test, stdin/out are not supported on wasm")
}
test := clientTest{
name: "WindowChange",
config: recordingsClientConfig(),
successCallback: func(t *testing.T, client *ssh.Client) {
session, err := client.NewSession()
if err != nil {
t.Fatalf("session failed: %v", err)
}
defer session.Close()
stdout, err := session.StdoutPipe()
if err != nil {
t.Fatalf("unable to acquire stdout pipe: %s", err)
}
stdin, err := session.StdinPipe()
if err != nil {
t.Fatalf("unable to acquire stdin pipe: %s", err)
}
tm := ssh.TerminalModes{ssh.ECHO: 0}
if err = session.RequestPty("xterm", 80, 40, tm); err != nil {
t.Fatalf("req-pty failed: %s", err)
}
if err := session.WindowChange(100, 100); err != nil {
t.Fatalf("window-change failed: %s", err)
}
err = session.Shell()
if err != nil {
t.Fatalf("session failed: %s", err)
}
stdin.Write([]byte("stty size && exit\n"))
var buf bytes.Buffer
if _, err := io.Copy(&buf, stdout); err != nil {
t.Fatalf("reading failed: %s", err)
}
if sttyOutput := buf.String(); !strings.Contains(sttyOutput, "100 100") {
t.Fatalf("terminal WindowChange failure: expected \"100 100\" stty output, got %s", sttyOutput)
}
},
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
+284
View File
@@ -0,0 +1,284 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package test
import (
"bytes"
"errors"
"fmt"
"net"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
"golang.org/x/crypto/internal/testenv"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/testdata"
)
type serverTest struct {
// name is a freeform string identifying the test and the file in which
// the expected results will be stored.
name string
// config contains the server configuration to use for this test.
config *ssh.ServerConfig
}
// connFromCommand starts opens a listening socket and starts the reference
// client to connect to it. It returns a recordingConn that wraps the resulting
// connection.
func (test *serverTest) connFromCommand(t *testing.T) (conn *recordingConn, err error) {
sshCLI, err := exec.LookPath("ssh")
if err != nil {
t.Skipf("skipping test: %v", err)
}
l, err := net.ListenTCP("tcp", &net.TCPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: 0,
})
if err != nil {
return nil, err
}
defer l.Close()
port := l.Addr().(*net.TCPAddr).Port
dir, err := os.MkdirTemp("", "sshtest")
if err != nil {
t.Fatal(err)
}
filename := "id_ed25519"
writeFile(filepath.Join(dir, filename), testdata.PEMBytes["ed25519"])
writeFile(filepath.Join(dir, filename+".pub"), ssh.MarshalAuthorizedKey(testPublicKeys["ed25519"]))
var args []string
args = append(args, "-v", "-i", filepath.Join(dir, filename), "-o", "StrictHostKeyChecking=no")
args = append(args, "-oKexAlgorithms=+diffie-hellman-group14-sha1")
args = append(args, "-p", strconv.Itoa(port))
args = append(args, "testuser@127.0.0.1")
args = append(args, "true")
cmd := testenv.Command(t, sshCLI, args...)
cmd.Stdin = nil
var output bytes.Buffer
cmd.Stdout = &output
cmd.Stderr = &output
if err := cmd.Start(); err != nil {
return nil, err
}
t.Cleanup(func() {
if err := os.RemoveAll(dir); err != nil {
t.Error(err)
}
// Don't check for errors; if it fails it's most
// likely "os: process already finished", and we don't
// care about that.
cmd.Process.Kill()
cmd.Wait()
if t.Failed() {
t.Logf("OpenSSH output:\n\n%s", cmd.Stdout)
}
})
connChan := make(chan any, 1)
go func() {
tcpConn, err := l.Accept()
if err != nil {
connChan <- err
return
}
connChan <- tcpConn
}()
var tcpConn net.Conn
select {
case connOrError := <-connChan:
if err, ok := connOrError.(error); ok {
return nil, err
}
tcpConn = connOrError.(net.Conn)
case <-time.After(2 * time.Second):
return nil, errors.New("timed out waiting for connection from child process")
}
record := &recordingConn{
Conn: tcpConn,
clientToServer: false,
}
return record, nil
}
func (test *serverTest) dataPath() string {
return filepath.Join("..", "testdata", "Server-"+test.name)
}
func (test *serverTest) loadData() (flows [][]byte, err error) {
in, err := os.Open(test.dataPath())
if err != nil {
return nil, err
}
defer in.Close()
return parseTestData(in)
}
func (test *serverTest) run(t *testing.T, write bool) {
var serverConn net.Conn
var recordingConn *recordingConn
setDeterministicRandomSource(&test.config.Config)
if write {
var err error
recordingConn, err = test.connFromCommand(t)
if err != nil {
t.Fatalf("Failed to start subcommand: %v", err)
}
serverConn = recordingConn
} else {
timer := time.AfterFunc(10*time.Second, func() {
fmt.Println("This test may be stuck, try running using -timeout 10s")
})
t.Cleanup(func() {
timer.Stop()
})
flows, err := test.loadData()
if err != nil {
t.Fatalf("Failed to load data from %s", test.dataPath())
}
serverConn = newReplayingConn(t, flows)
}
server, chans, reqs, err := ssh.NewServerConn(serverConn, test.config)
if err != nil {
t.Fatalf("Failed to create server conn: %v", err)
}
defer server.Close()
go ssh.DiscardRequests(reqs)
done := make(chan bool)
for newChannel := range chans {
if newChannel.ChannelType() != "session" {
newChannel.Reject(ssh.UnknownChannelType, "unknown channel type")
continue
}
channel, requests, err := newChannel.Accept()
if err != nil {
continue
}
go func(in <-chan *ssh.Request) {
for req := range in {
switch req.Type {
case "exec":
if req.WantReply {
req.Reply(true, nil)
}
channel.SendRequest("exit-status", false, ssh.Marshal(&exitStatusMsg{Status: 0}))
channel.Close()
done <- true
default:
if req.WantReply {
req.Reply(false, nil)
}
}
}
}(requests)
}
<-done
if write {
path := test.dataPath()
out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
t.Fatalf("Failed to create output file: %v", err)
}
defer out.Close()
recordingConn.Close()
recordingConn.WriteTo(out)
t.Logf("Wrote %s\n", path)
}
}
func recordingsServerConfig() *ssh.ServerConfig {
config := &ssh.ServerConfig{
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
return nil, nil
},
}
config.SetDefaults()
// Remove ML-KEM since it only works with Go 1.24.
config.SetDefaults()
if config.KeyExchanges[0] == ssh.KeyExchangeMLKEM768X25519 {
config.KeyExchanges = config.KeyExchanges[1:]
}
config.AddHostKey(testSigners["rsa"])
return config
}
func TestServerKeyExchanges(t *testing.T) {
config := ssh.ClientConfig{}
config.SetDefaults()
var keyExchanges []string
for _, kex := range config.KeyExchanges {
// Exclude ecdh for now, to make them determistic we should use see a
// stream of fixed bytes as the random source.
// Exclude ML-KEM because server side is not deterministic.
if !strings.HasPrefix(kex, "ecdh-") && !strings.HasPrefix(kex, "mlkem") {
keyExchanges = append(keyExchanges, kex)
}
}
// Add diffie-hellman-group16-sha512 as it is not enabled by default.
keyExchanges = append(keyExchanges, "diffie-hellman-group16-sha512")
for _, kex := range keyExchanges {
c := recordingsServerConfig()
c.KeyExchanges = []string{kex}
test := serverTest{
name: "KEX-" + kex,
config: c,
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
}
func TestServerCiphers(t *testing.T) {
config := ssh.ClientConfig{}
config.SetDefaults()
for _, ciph := range config.Ciphers {
c := recordingsServerConfig()
c.Ciphers = []string{ciph}
test := serverTest{
name: "Cipher-" + ciph,
config: c,
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
}
func TestServerMACs(t *testing.T) {
config := ssh.ClientConfig{}
config.SetDefaults()
for _, mac := range config.MACs {
c := recordingsServerConfig()
c.MACs = []string{mac}
test := serverTest{
name: "MAC-" + mac,
config: c,
}
runTestAndUpdateIfNeeded(t, test.name, test.run)
}
}
+433
View File
@@ -0,0 +1,433 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package test
import (
"bufio"
"bytes"
"encoding/hex"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
"os"
"os/user"
"strconv"
"strings"
"sync"
"testing"
"text/template"
"time"
"golang.org/x/crypto/sha3"
"golang.org/x/crypto/ssh"
)
const (
defaultSSHDConfig = `
Protocol 2
Banner {{.Dir}}/banner
HostKey {{.Dir}}/id_rsa
HostKey {{.Dir}}/id_dsa
HostKey {{.Dir}}/id_ecdsa
HostCertificate {{.Dir}}/id_rsa-sha2-512-cert.pub
Pidfile {{.Dir}}/sshd.pid
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel DEBUG2
LoginGraceTime 120
PermitRootLogin no
StrictModes no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile {{.Dir}}/authorized_keys
TrustedUserCAKeys {{.Dir}}/id_ecdsa.pub
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PubkeyAcceptedKeyTypes=*
# In recent versions of OpenSSH, Diffie-Hellman key exchange algorithms
# are disabled by default. However, they are still included in our default
# Key Exchange (KEX) configuration. We explicitly enable them here to
# maintain compatibility for our test cases.
KexAlgorithms +diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group-exchange-sha256
`
multiAuthSshdConfigTail = `
UsePAM yes
PasswordAuthentication yes
ChallengeResponseAuthentication yes
AuthenticationMethods {{.AuthMethods}}
`
maxAuthTriesSshdConfigTail = `
PasswordAuthentication yes
MaxAuthTries 1
`
)
var configTmpl = map[string]*template.Template{
"default": template.Must(template.New("").Parse(defaultSSHDConfig)),
"MultiAuth": template.Must(template.New("").Parse(defaultSSHDConfig + multiAuthSshdConfigTail)),
"MaxAuthTries": template.Must(template.New("").Parse(defaultSSHDConfig + maxAuthTriesSshdConfigTail))}
type server struct {
t *testing.T
configfile string
testUser string // test username for sshd
testPasswd string // test password for sshd
sshdTestPwSo string // dynamic library to inject a custom password into sshd
lastDialConn net.Conn
}
type storedHostKey struct {
// keys map from an algorithm string to binary key data.
keys map[string][]byte
// checkCount counts the Check calls. Used for testing
// rekeying.
checkCount int
}
func (k *storedHostKey) Add(key ssh.PublicKey) {
if k.keys == nil {
k.keys = map[string][]byte{}
}
k.keys[key.Type()] = key.Marshal()
}
func (k *storedHostKey) Check(addr string, remote net.Addr, key ssh.PublicKey) error {
k.checkCount++
algo := key.Type()
if k.keys == nil || !bytes.Equal(key.Marshal(), k.keys[algo]) {
return fmt.Errorf("host key mismatch. Got %q, want %q", key, k.keys[algo])
}
return nil
}
func hostKeyDB() *storedHostKey {
keyChecker := &storedHostKey{}
keyChecker.Add(testPublicKeys["ecdsa"])
keyChecker.Add(testPublicKeys["rsa"])
keyChecker.Add(testPublicKeys["dsa"])
return keyChecker
}
func clientConfig() *ssh.ClientConfig {
config := &ssh.ClientConfig{
User: username(),
Auth: []ssh.AuthMethod{
ssh.PublicKeys(testSigners["user"]),
},
HostKeyCallback: hostKeyDB().Check,
HostKeyAlgorithms: []string{ // by default, don't allow certs as this affects the hostKeyDB checker
ssh.KeyAlgoECDSA256, ssh.KeyAlgoECDSA384, ssh.KeyAlgoECDSA521,
ssh.KeyAlgoRSA, ssh.InsecureKeyAlgoDSA,
ssh.KeyAlgoED25519,
},
}
return config
}
// SSH reference tests run a connection against a reference implementation
// (OpenSSH) of SSH and record the bytes of the resulting connection. The Go
// code, during a test, is configured with deterministic randomness and so the
// reference test can be reproduced exactly in the future.
//
// In order to save everyone who wishes to run the tests from needing the
// reference implementation installed, the reference connections are saved in
// files in the testdata directory. Thus running the tests involves nothing
// external, but creating and updating them requires the reference
// implementation.
//
// Tests can be updated by running them with the -update flag. This will cause
// the test files for failing tests to be regenerated. Since the reference
// implementation will always generate fresh random numbers, large parts of the
// reference connection will always change.
var (
update = flag.Bool("update", false, "update golden files on failure")
)
func runTestAndUpdateIfNeeded(t *testing.T, name string, run func(t *testing.T, update bool)) {
success := t.Run(name, func(t *testing.T) {
if !*update {
t.Parallel()
}
run(t, false)
})
if !success && *update {
t.Run(name+"#update", func(t *testing.T) {
run(t, true)
})
}
}
// recordingConn is a net.Conn that records the traffic that passes through it.
// WriteTo can be used to produce output that can be later be loaded with
// ParseTestData.
type recordingConn struct {
net.Conn
clientToServer bool
sync.Mutex
flows [][]byte
reading bool
}
func (r *recordingConn) Read(b []byte) (n int, err error) {
if n, err = r.Conn.Read(b); n == 0 {
return
}
b = b[:n]
r.Lock()
defer r.Unlock()
if l := len(r.flows); l == 0 || !r.reading {
buf := make([]byte, len(b))
copy(buf, b)
r.flows = append(r.flows, buf)
} else {
r.flows[l-1] = append(r.flows[l-1], b[:n]...)
}
r.reading = true
return
}
func (r *recordingConn) Write(b []byte) (n int, err error) {
if n, err = r.Conn.Write(b); n == 0 {
return
}
b = b[:n]
r.Lock()
defer r.Unlock()
if l := len(r.flows); l == 0 || r.reading {
buf := make([]byte, len(b))
copy(buf, b)
r.flows = append(r.flows, buf)
} else {
r.flows[l-1] = append(r.flows[l-1], b[:n]...)
}
r.reading = false
return
}
// WriteTo writes Go source code to w that contains the recorded traffic.
func (r *recordingConn) WriteTo(w io.Writer) (int64, error) {
var written int64
for i, flow := range r.flows {
source, dest := "client", "server"
if !r.clientToServer {
source, dest = dest, source
}
n, err := fmt.Fprintf(w, ">>> Flow %d (%s to %s)\n", i+1, source, dest)
written += int64(n)
if err != nil {
return written, err
}
dumper := hex.Dumper(w)
n, err = dumper.Write(flow)
written += int64(n)
if err != nil {
return written, err
}
err = dumper.Close()
if err != nil {
return written, err
}
r.clientToServer = !r.clientToServer
}
return written, nil
}
func parseTestData(r io.Reader) (flows [][]byte, err error) {
var currentFlow []byte
scanner := bufio.NewScanner(r)
for scanner.Scan() {
line := scanner.Text()
// If the line starts with ">>> " then it marks the beginning
// of a new flow.
if strings.HasPrefix(line, ">>> ") {
if len(currentFlow) > 0 || len(flows) > 0 {
flows = append(flows, currentFlow)
currentFlow = nil
}
continue
}
// Otherwise the line is a line of hex dump that looks like:
// 00000170 fc f5 06 bf (...) |.....X{&?......!|
// (Some bytes have been omitted from the middle section.)
_, after, ok := strings.Cut(line, " ")
if !ok {
return nil, errors.New("invalid test data")
}
line = after
before, _, ok := strings.Cut(line, "|")
if !ok {
return nil, errors.New("invalid test data")
}
line = before
hexBytes := strings.Fields(line)
for _, hexByte := range hexBytes {
val, err := strconv.ParseUint(hexByte, 16, 8)
if err != nil {
return nil, errors.New("invalid hex byte in test data: " + err.Error())
}
currentFlow = append(currentFlow, byte(val))
}
}
if len(currentFlow) > 0 {
flows = append(flows, currentFlow)
}
return flows, nil
}
func newReplayingConn(t testing.TB, flows [][]byte) net.Conn {
r := &replayingConn{
t: t,
flows: flows,
reading: false,
}
r.readCond = sync.NewCond(&r.Mutex)
return r
}
// replayingConn is a net.Conn that replays flows recorded by recordingConn.
type replayingConn struct {
t testing.TB
sync.Mutex
flows [][]byte
reading bool
// SSH channels use a read loop goroutine, we use this condition to wait
// until we are ready to read/write.
readCond *sync.Cond
}
var _ net.Conn = (*replayingConn)(nil)
func (r *replayingConn) Read(b []byte) (n int, err error) {
r.Lock()
defer r.Unlock()
for !r.reading {
r.readCond.Wait()
}
// Some tests run commands that return no output.
if len(r.flows) == 0 {
return 0, nil
}
n = copy(b, r.flows[0])
r.flows[0] = r.flows[0][n:]
if len(r.flows[0]) == 0 {
r.flows = r.flows[1:]
r.reading = false
r.readCond.Broadcast()
if len(r.flows) == 0 {
return n, io.EOF
}
}
return n, nil
}
func (r *replayingConn) Write(b []byte) (n int, err error) {
r.Lock()
defer r.Unlock()
for r.reading {
r.readCond.Wait()
}
if !bytes.HasPrefix(r.flows[0], b) {
r.t.Errorf("write mismatch: expected %x, got %x", r.flows[0], b)
r.reading = true
r.readCond.Broadcast()
return 0, fmt.Errorf("write mismatch")
}
r.flows[0] = r.flows[0][len(b):]
if len(r.flows[0]) == 0 {
r.flows = r.flows[1:]
r.reading = true
r.readCond.Broadcast()
}
return len(b), nil
}
func (r *replayingConn) Close() error {
r.Lock()
defer r.Unlock()
if len(r.flows) > 0 {
r.t.Errorf("closed with unfinished flows: %d", len(r.flows))
return fmt.Errorf("unexpected close")
}
return nil
}
func (r *replayingConn) LocalAddr() net.Addr { return nil }
func (r *replayingConn) RemoteAddr() net.Addr { return nil }
func (r *replayingConn) SetDeadline(_ time.Time) error { return nil }
func (r *replayingConn) SetReadDeadline(_ time.Time) error { return nil }
func (r *replayingConn) SetWriteDeadline(_ time.Time) error { return nil }
func username() string {
var username string
if user, err := user.Current(); err == nil {
username = user.Username
} else {
// user.Current() currently requires cgo. If an error is
// returned attempt to get the username from the environment.
log.Printf("user.Current: %v; falling back on $USER", err)
username = os.Getenv("USER")
}
if username == "" {
panic("Unable to get username")
}
return username
}
func writeFile(path string, contents []byte) {
f, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0600)
if err != nil {
panic(err)
}
defer f.Close()
if _, err := f.Write(contents); err != nil {
panic(err)
}
}
// setDeterministicRandomSource sets a deterministic random source for the
// provided ssh.Config. It is intended solely for use in test cases, as
// deterministic randomness is insecure and should never be used in production
// environments. A deterministic random source is required to enable consistent
// testing against recorded session files.
func setDeterministicRandomSource(config *ssh.Config) {
config.Rand = sha3.NewShake128()
}
func TestMain(m *testing.M) {
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", os.Args)
flag.PrintDefaults()
}
flag.Parse()
os.Exit(m.Run())
}
+2 -207
View File
@@ -10,7 +10,6 @@ package test
import (
"bytes"
"errors"
"fmt"
"io"
"path/filepath"
@@ -29,108 +28,6 @@ func skipIfIssue64959(t *testing.T, err error) {
}
}
func TestRunCommandSuccess(t *testing.T) {
server := newServer(t)
conn := server.Dial(clientConfig())
defer conn.Close()
session, err := conn.NewSession()
if err != nil {
skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
err = session.Run("true")
if err != nil {
t.Fatalf("session failed: %v", err)
}
}
func TestHostKeyCheck(t *testing.T) {
server := newServer(t)
conf := clientConfig()
hostDB := hostKeyDB()
conf.HostKeyCallback = hostDB.Check
// change the keys.
hostDB.keys[ssh.KeyAlgoRSA][25]++
hostDB.keys[ssh.KeyAlgoDSA][25]++
hostDB.keys[ssh.KeyAlgoECDSA256][25]++
conn, err := server.TryDial(conf)
if err == nil {
conn.Close()
t.Fatalf("dial should have failed.")
} else if !strings.Contains(err.Error(), "host key mismatch") {
t.Fatalf("'host key mismatch' not found in %v", err)
}
}
func TestRunCommandStdin(t *testing.T) {
server := newServer(t)
conn := server.Dial(clientConfig())
defer conn.Close()
session, err := conn.NewSession()
if err != nil {
skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
r, w := io.Pipe()
defer r.Close()
defer w.Close()
session.Stdin = r
err = session.Run("true")
if err != nil {
t.Fatalf("session failed: %v", err)
}
}
func TestRunCommandStdinError(t *testing.T) {
server := newServer(t)
conn := server.Dial(clientConfig())
defer conn.Close()
session, err := conn.NewSession()
if err != nil {
skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
r, w := io.Pipe()
defer r.Close()
session.Stdin = r
pipeErr := errors.New("closing write end of pipe")
w.CloseWithError(pipeErr)
err = session.Run("true")
if err != pipeErr {
t.Fatalf("expected %v, found %v", pipeErr, err)
}
}
func TestRunCommandFailed(t *testing.T) {
server := newServer(t)
conn := server.Dial(clientConfig())
defer conn.Close()
session, err := conn.NewSession()
if err != nil {
skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
err = session.Run(`bash -c "kill -9 $$"`)
if err == nil {
t.Fatalf("session succeeded: %v", err)
}
}
func TestRunCommandWeClosed(t *testing.T) {
server := newServer(t)
conn := server.Dial(clientConfig())
@@ -290,59 +187,6 @@ func TestValidTerminalMode(t *testing.T) {
}
}
func TestWindowChange(t *testing.T) {
if runtime.GOOS == "aix" {
// On AIX, sshd cannot acquire /dev/pts/* if launched as
// a non-root user.
t.Skipf("skipping on %s", runtime.GOOS)
}
server := newServer(t)
conn := server.Dial(clientConfig())
defer conn.Close()
session, err := conn.NewSession()
if err != nil {
skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
stdout, err := session.StdoutPipe()
if err != nil {
t.Fatalf("unable to acquire stdout pipe: %s", err)
}
stdin, err := session.StdinPipe()
if err != nil {
t.Fatalf("unable to acquire stdin pipe: %s", err)
}
tm := ssh.TerminalModes{ssh.ECHO: 0}
if err = session.RequestPty("xterm", 80, 40, tm); err != nil {
t.Fatalf("req-pty failed: %s", err)
}
if err := session.WindowChange(100, 100); err != nil {
t.Fatalf("window-change failed: %s", err)
}
err = session.Shell()
if err != nil {
t.Fatalf("session failed: %s", err)
}
stdin.Write([]byte("stty size && exit\n"))
var buf bytes.Buffer
if _, err := io.Copy(&buf, stdout); err != nil {
t.Fatalf("reading failed: %s", err)
}
if sttyOutput := buf.String(); !strings.Contains(sttyOutput, "100 100") {
t.Fatalf("terminal WindowChange failure: expected \"100 100\" stty output, got %s", sttyOutput)
}
}
func testOneCipher(t *testing.T, cipher string, cipherOrder []string) {
server := newServer(t)
conf := clientConfig()
@@ -380,8 +224,8 @@ func testOneCipher(t *testing.T, cipher string, cipherOrder []string) {
}
var deprecatedCiphers = []string{
"aes128-cbc", "3des-cbc",
"arcfour128", "arcfour256",
ssh.InsecureCipherAES128CBC, ssh.InsecureCipherTripleDESCBC,
ssh.InsecureCipherRC4128, ssh.InsecureCipherRC4256,
}
func TestCiphers(t *testing.T) {
@@ -396,55 +240,6 @@ func TestCiphers(t *testing.T) {
}
}
func TestMACs(t *testing.T) {
var config ssh.Config
config.SetDefaults()
macOrder := config.MACs
for _, mac := range macOrder {
t.Run(mac, func(t *testing.T) {
server := newServer(t)
conf := clientConfig()
conf.MACs = []string{mac}
// Don't fail if sshd doesn't have the MAC.
conf.MACs = append(conf.MACs, macOrder...)
if conn, err := server.TryDial(conf); err == nil {
conn.Close()
} else {
t.Fatalf("failed for MAC %q", mac)
}
})
}
}
func TestKeyExchanges(t *testing.T) {
var config ssh.Config
config.SetDefaults()
kexOrder := config.KeyExchanges
// Based on the discussion in #17230, the key exchange algorithms
// diffie-hellman-group-exchange-sha1 and diffie-hellman-group-exchange-sha256
// are not included in the default list of supported kex so we have to add them
// here manually.
kexOrder = append(kexOrder, "diffie-hellman-group-exchange-sha1", "diffie-hellman-group-exchange-sha256")
// The key exchange algorithms diffie-hellman-group16-sha512 is disabled by
// default so we add it here manually.
kexOrder = append(kexOrder, "diffie-hellman-group16-sha512")
for _, kex := range kexOrder {
t.Run(kex, func(t *testing.T) {
server := newServer(t)
conf := clientConfig()
// Don't fail if sshd doesn't have the kex.
conf.KeyExchanges = append([]string{kex}, kexOrder...)
conn, err := server.TryDial(conf)
if err == nil {
conn.Close()
} else {
t.Errorf("failed for kex %q", kex)
}
})
}
}
func TestClientAuthAlgorithms(t *testing.T) {
for _, key := range []string{
"rsa",
+74 -11
View File
@@ -34,23 +34,29 @@ func sshClient(t *testing.T) string {
return sshCLI
}
// setupSSHCLIKeys writes the provided key files to a temporary directory and
// returns the path to the private key.
func setupSSHCLIKeys(t *testing.T, keyFiles map[string][]byte, privKeyName string) string {
tmpDir := t.TempDir()
for fn, content := range keyFiles {
if err := os.WriteFile(filepath.Join(tmpDir, fn), content, 0600); err != nil {
t.Fatalf("WriteFile(%q): %v", fn, err)
}
}
return filepath.Join(tmpDir, privKeyName)
}
func TestSSHCLIAuth(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skipf("always fails on Windows, see #64403")
}
sshCLI := sshClient(t)
dir := t.TempDir()
keyPrivPath := filepath.Join(dir, "rsa")
for fn, content := range map[string][]byte{
keyPrivPath: testdata.PEMBytes["rsa"],
keyPrivPath + ".pub": ssh.MarshalAuthorizedKey(testPublicKeys["rsa"]),
filepath.Join(dir, "rsa-cert.pub"): testdata.SSHCertificates["rsa-user-testcertificate"],
} {
if err := os.WriteFile(fn, content, 0600); err != nil {
t.Fatalf("WriteFile(%q): %v", fn, err)
}
keyFiles := map[string][]byte{
"rsa": testdata.PEMBytes["rsa"],
"rsa.pub": ssh.MarshalAuthorizedKey(testPublicKeys["rsa"]),
"rsa-cert.pub": testdata.SSHCertificates["rsa-user-testcertificate"],
}
keyPrivPath := setupSSHCLIKeys(t, keyFiles, "rsa")
certChecker := ssh.CertChecker{
IsUserAuthority: func(k ssh.PublicKey) bool {
@@ -98,3 +104,60 @@ func TestSSHCLIAuth(t *testing.T) {
t.Fatalf("user certificate authentication failed, error: %v, command output %q", err, string(out))
}
}
func TestSSHCLIKeyExchanges(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skipf("always fails on Windows, see #64403")
}
sshCLI := sshClient(t)
keyFiles := map[string][]byte{
"rsa": testdata.PEMBytes["rsa"],
"rsa.pub": ssh.MarshalAuthorizedKey(testPublicKeys["rsa"]),
}
keyPrivPath := setupSSHCLIKeys(t, keyFiles, "rsa")
keyExchanges := append(ssh.SupportedAlgorithms().KeyExchanges, ssh.InsecureAlgorithms().KeyExchanges...)
for _, kex := range keyExchanges {
t.Run(kex, func(t *testing.T) {
cmd := testenv.Command(t, sshCLI, "-Q", "kex")
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("%s failed to check if the KEX is supported, error: %v, command output %q", kex, err, string(out))
}
if !bytes.Contains(out, []byte(kex)) {
t.Skipf("KEX %q is not supported in the installed ssh CLI", kex)
}
config := &ssh.ServerConfig{
Config: ssh.Config{
KeyExchanges: []string{kex},
},
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
if conn.User() == "testpubkey" && bytes.Equal(key.Marshal(), testPublicKeys["rsa"].Marshal()) {
return nil, nil
}
return nil, fmt.Errorf("pubkey for %q not acceptable", conn.User())
},
}
config.AddHostKey(testSigners["rsa"])
server, err := newTestServer(config)
if err != nil {
t.Fatalf("unable to start test server: %v", err)
}
defer server.Close()
port, err := server.port()
if err != nil {
t.Fatalf("unable to get server port: %v", err)
}
cmd = testenv.Command(t, sshCLI, "-vvv", "-i", keyPrivPath, "-o", "StrictHostKeyChecking=no",
"-o", fmt.Sprintf("KexAlgorithms=%s", kex), "-p", port, "testpubkey@127.0.0.1", "true")
out, err = cmd.CombinedOutput()
if err != nil {
t.Fatalf("%s failed, error: %v, command output %q", kex, err, string(out))
}
})
}
}
-133
View File
@@ -13,140 +13,18 @@ import (
"crypto/rand"
"encoding/base64"
"fmt"
"log"
"net"
"os"
"os/exec"
"os/user"
"path/filepath"
"testing"
"text/template"
"golang.org/x/crypto/internal/testenv"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/testdata"
)
const (
defaultSshdConfig = `
Protocol 2
Banner {{.Dir}}/banner
HostKey {{.Dir}}/id_rsa
HostKey {{.Dir}}/id_dsa
HostKey {{.Dir}}/id_ecdsa
HostCertificate {{.Dir}}/id_rsa-sha2-512-cert.pub
Pidfile {{.Dir}}/sshd.pid
#UsePrivilegeSeparation no
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel DEBUG2
LoginGraceTime 120
PermitRootLogin no
StrictModes no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile {{.Dir}}/authorized_keys
TrustedUserCAKeys {{.Dir}}/id_ecdsa.pub
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PubkeyAcceptedKeyTypes=*
`
multiAuthSshdConfigTail = `
UsePAM yes
PasswordAuthentication yes
ChallengeResponseAuthentication yes
AuthenticationMethods {{.AuthMethods}}
`
maxAuthTriesSshdConfigTail = `
PasswordAuthentication yes
MaxAuthTries 1
`
)
var configTmpl = map[string]*template.Template{
"default": template.Must(template.New("").Parse(defaultSshdConfig)),
"MultiAuth": template.Must(template.New("").Parse(defaultSshdConfig + multiAuthSshdConfigTail)),
"MaxAuthTries": template.Must(template.New("").Parse(defaultSshdConfig + maxAuthTriesSshdConfigTail))}
type server struct {
t *testing.T
configfile string
testUser string // test username for sshd
testPasswd string // test password for sshd
sshdTestPwSo string // dynamic library to inject a custom password into sshd
lastDialConn net.Conn
}
func username() string {
var username string
if user, err := user.Current(); err == nil {
username = user.Username
} else {
// user.Current() currently requires cgo. If an error is
// returned attempt to get the username from the environment.
log.Printf("user.Current: %v; falling back on $USER", err)
username = os.Getenv("USER")
}
if username == "" {
panic("Unable to get username")
}
return username
}
type storedHostKey struct {
// keys map from an algorithm string to binary key data.
keys map[string][]byte
// checkCount counts the Check calls. Used for testing
// rekeying.
checkCount int
}
func (k *storedHostKey) Add(key ssh.PublicKey) {
if k.keys == nil {
k.keys = map[string][]byte{}
}
k.keys[key.Type()] = key.Marshal()
}
func (k *storedHostKey) Check(addr string, remote net.Addr, key ssh.PublicKey) error {
k.checkCount++
algo := key.Type()
if k.keys == nil || bytes.Compare(key.Marshal(), k.keys[algo]) != 0 {
return fmt.Errorf("host key mismatch. Got %q, want %q", key, k.keys[algo])
}
return nil
}
func hostKeyDB() *storedHostKey {
keyChecker := &storedHostKey{}
keyChecker.Add(testPublicKeys["ecdsa"])
keyChecker.Add(testPublicKeys["rsa"])
keyChecker.Add(testPublicKeys["dsa"])
return keyChecker
}
func clientConfig() *ssh.ClientConfig {
config := &ssh.ClientConfig{
User: username(),
Auth: []ssh.AuthMethod{
ssh.PublicKeys(testSigners["user"]),
},
HostKeyCallback: hostKeyDB().Check,
HostKeyAlgorithms: []string{ // by default, don't allow certs as this affects the hostKeyDB checker
ssh.KeyAlgoECDSA256, ssh.KeyAlgoECDSA384, ssh.KeyAlgoECDSA521,
ssh.KeyAlgoRSA, ssh.KeyAlgoDSA,
ssh.KeyAlgoED25519,
},
}
return config
}
// unixConnection creates two halves of a connected net.UnixConn. It
// is used for connecting the Go SSH client with sshd without opening
// ports.
@@ -262,17 +140,6 @@ func (s *server) Dial(config *ssh.ClientConfig) *ssh.Client {
return conn
}
func writeFile(path string, contents []byte) {
f, err := os.OpenFile(path, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0600)
if err != nil {
panic(err)
}
defer f.Close()
if _, err := f.Write(contents); err != nil {
panic(err)
}
}
// generate random password
func randomPassword() (string, error) {
b := make([]byte, 12)
+298
View File
@@ -0,0 +1,298 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 03 2c 11 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...,....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 6c 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 |.laes128-gcm@ope|
00000150 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d |nssh.com,aes256-|
00000160 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |gcm@openssh.com,|
00000170 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 31 33 30 |chacha20-poly130|
00000180 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 |5@openssh.com,ae|
00000190 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d |s128-ctr,aes192-|
000001a0 63 74 72 2c 61 65 73 32 35 36 2d 63 74 72 00 00 |ctr,aes256-ctr..|
000001b0 00 6c 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 |.laes128-gcm@ope|
000001c0 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d |nssh.com,aes256-|
000001d0 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |gcm@openssh.com,|
000001e0 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 31 33 30 |chacha20-poly130|
000001f0 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 |5@openssh.com,ae|
00000200 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d |s128-ctr,aes192-|
00000210 63 74 72 2c 61 65 73 32 35 36 2d 63 74 72 00 00 |ctr,aes256-ctr..|
00000220 00 6e 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d |.nhmac-sha2-256-|
00000230 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000240 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 |hmac-sha2-512-et|
00000250 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d |m@openssh.com,hm|
00000260 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 |ac-sha2-256,hmac|
00000270 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 |-sha2-512,hmac-s|
00000280 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 |ha1,hmac-sha1-96|
00000290 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d 32 35 |...nhmac-sha2-25|
000002a0 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |6-etm@openssh.co|
000002b0 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d |m,hmac-sha2-512-|
000002c0 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
000002d0 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d |hmac-sha2-256,hm|
000002e0 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 |ac-sha2-512,hmac|
000002f0 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d |-sha1,hmac-sha1-|
00000300 39 36 00 00 00 04 6e 6f 6e 65 00 00 00 04 6e 6f |96....none....no|
00000310 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 00 d7 |ne..............|
00000320 3b 80 93 f6 ef bc 88 eb 1a 6e ac fa 66 ef 26 3c |;........n..f.&<|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 c8 9f 47 8f 1d b3 6c e4 86 d8 |........G...l...|
00000010 29 d2 db 83 c7 ee 00 00 01 7a 73 6e 74 72 75 70 |)........zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 aa 80 4b 53 a8 4b |...,..... ..KS.K|
00000010 4c 0f fa ac a3 b8 5f 64 7d 36 42 e7 1d 56 45 7e |L....._d}6B..VE~|
00000020 2b ac e0 f9 e7 60 f5 d7 55 37 b8 cc 87 3c 23 dc |+....`..U7...<#.|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 37 00 93 5e 60 8c 9f e2 e0 4b |..... 7..^`....K|
00000080 59 97 5c 6f d4 5a 3e 25 f8 fb 08 72 92 05 4d 6c |Y.\o.Z>%...r..Ml|
00000090 80 c4 27 0e ec 26 00 00 00 64 00 00 00 13 65 63 |..'..&...d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 21 00 ec c1 21 3e be 3c |6...I...!...!>.<|
000000c0 7a 50 7b 47 eb c2 92 bf 0b 93 cf 59 b5 84 2c f5 |zP{G.......Y..,.|
000000d0 bf 9b 2d 01 cc 2e 42 15 b0 04 00 00 00 20 61 99 |..-...B...... a.|
000000e0 9e 54 45 c1 54 a4 da d6 0b 3a d1 09 24 0f a0 b1 |.TE.T....:..$...|
000000f0 66 b9 6f 06 a4 f4 09 7e 51 3f 5a e2 98 6c 00 00 |f.o....~Q?Z..l..|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 57 9a 3e 61 |...........@W.>a|
00000120 04 0a 62 05 83 8d 82 84 8a e6 91 0b 2c 28 d5 ce |..b.........,(..|
00000130 b8 06 56 59 54 af 80 60 6c 9b 8c a5 1c 8a 5a 30 |..VYT..`l.....Z0|
00000140 e3 70 23 61 86 ed a3 6a b6 fc 8d b8 d0 c3 72 25 |.p#a...j......r%|
00000150 1c 4c 5c 84 a5 77 59 83 31 52 1b f4 09 8c 9f a7 |.L\..wY.1R......|
00000160 b5 b2 ca f2 2c 8d ca 8f 2f 49 b9 83 65 af 97 5d |....,.../I..e..]|
00000170 a3 a9 02 97 8f ee 42 30 9a 6c 8a 38 2c 23 33 1b |......B0.l.8,#3.|
00000180 16 08 cd 7e 5e 2a 9b b4 34 26 9e 3b cb ec 37 0b |...~^*..4&.;..7.|
00000190 39 8e 39 62 80 57 a2 95 d7 0d b6 ce 02 d8 66 b0 |9.9b.W........f.|
000001a0 15 c4 cf 77 01 80 7b 42 41 96 4d 92 d6 5d b3 03 |...w..{BA.M..]..|
000001b0 f3 83 22 c8 fe a7 7a c3 a4 aa 6a 75 23 de 4a 30 |.."...z...ju#.J0|
000001c0 76 e6 8d 2a c7 3a c8 1a 60 f3 db ce 8a 53 44 2f |v..*.:..`....SD/|
000001d0 ff 02 38 3e 23 28 cf 45 08 ae b8 a8 24 db 6f 1e |..8>#(.E....$.o.|
000001e0 77 7a 33 19 e8 d0 13 11 63 19 b6 71 8b 19 3b 5b |wz3.....c..q..;[|
000001f0 ad b5 3d cc 08 6f bd 89 cb fa c9 d7 e6 af e0 82 |..=..o..........|
00000200 25 8b 60 bb 08 64 d3 71 d0 71 05 f1 94 1e 9b 7b |%.`..d.q.q.....{|
00000210 07 35 64 fa 05 c3 23 4d 95 d0 4d 49 7d 93 61 72 |.5d...#M..MI}.ar|
00000220 11 14 07 94 fb 3e a4 0f 7c ce 24 e3 a5 24 3e ae |.....>..|.$..$>.|
00000230 e5 11 f5 29 f1 aa 2d 6c a8 8d 47 fb cb 0c 62 e2 |...)..-l..G...b.|
00000240 cc 80 89 bc a6 76 e6 60 5c bf 86 78 58 ea e3 b2 |.....v.`\..xX...|
00000250 b3 61 35 c4 80 23 f5 c6 ac 45 fd 5f 5b 41 8d 59 |.a5..#...E._[A.Y|
00000260 eb 4c b2 3c fa df 0a 78 c4 af 59 42 |.L.<...x..YB|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 62 b8 d2 60 16 9a fa 2f 75 ab |......b..`.../u.|
00000010 00 00 00 20 ad 6d e9 f4 a6 ee b0 dc 51 d0 16 a8 |... .m......Q...|
00000020 48 f5 0b cf 15 42 51 3a 8a 0a 3d 4b cd 20 82 ce |H....BQ:..=K. ..|
00000030 3f ac d4 33 0d ff 29 ea f8 28 2c dc e2 c4 bc 46 |?..3..)..(,....F|
00000040 c2 5e 8a ce |.^..|
>>> Flow 8 (server to client)
00000000 00 00 00 20 25 d5 f5 9e c7 e4 76 15 a5 03 f4 30 |... %.....v....0|
00000010 02 2e 64 e7 b7 a8 33 12 d1 d1 e0 62 3d b5 23 12 |..d...3....b=.#.|
00000020 eb 61 31 21 5c 07 bb 54 bc 4f 29 5d 80 1e 7c 88 |.a1!\..T.O)]..|.|
00000030 b9 46 b0 56 |.F.V|
>>> Flow 9 (client to server)
00000000 00 00 00 30 dc 6c b3 a7 e2 60 9c a8 41 3c 12 4b |...0.l...`..A<.K|
00000010 f0 90 69 20 65 08 60 50 b0 52 22 ed 50 cf 5f 5c |..i e.`P.R".P._\|
00000020 d3 ed 35 13 88 32 2c 7c d5 5b 6c f3 09 1b 50 0e |..5..2,|.[l...P.|
00000030 9b bb ac 21 73 94 51 93 73 de 71 6c 0a fd 11 a4 |...!s.Q.s.ql....|
00000040 77 70 55 ef |wpU.|
>>> Flow 10 (server to client)
00000000 00 00 00 20 32 b6 e9 e4 79 15 00 f8 5a 72 08 38 |... 2...y...Zr.8|
00000010 55 af 59 21 6e 7f f4 6f f2 0e e8 d8 a5 61 bb a4 |U.Y!n..o.....a..|
00000020 ce 26 3b 94 a8 e7 d9 5d 69 d7 6d d7 70 5f b8 a9 |.&;....]i.m.p_..|
00000030 e9 ee 02 e8 00 00 00 40 21 fe 1d 4e 06 ce c3 51 |.......@!..N...Q|
00000040 34 9d ad 04 60 1b 5e b7 89 c9 8d f5 24 d7 ff 69 |4...`.^.....$..i|
00000050 a0 89 fe 95 58 66 7f af 63 1b b2 f5 b0 ad 26 b8 |....Xf..c.....&.|
00000060 b4 25 33 9d 47 02 69 98 a1 a2 5c 30 5b 1c da 9d |.%3.G.i...\0[...|
00000070 7d 75 8c f3 be 05 dd b2 0f 65 5c 1e 17 08 d7 00 |}u.......e\.....|
00000080 03 97 99 ca a4 ca a3 c2 |........|
>>> Flow 11 (client to server)
00000000 00 00 01 60 4d a5 d0 b6 1a b3 dc c9 f2 da 8e 8a |...`M...........|
00000010 03 a4 d3 61 0b 95 e5 7e db cc 31 49 21 c7 fa 95 |...a...~..1I!...|
00000020 43 d0 ee 93 d6 45 29 85 3c 9a 82 e4 6b 65 5d 7c |C....E).<...ke]||
00000030 cc 52 e8 83 b2 5a 65 ad 2f 83 1f b0 e7 a4 aa c7 |.R...Ze./.......|
00000040 49 40 98 10 d8 af c2 c0 0f a2 54 d0 30 37 13 06 |I@........T.07..|
00000050 12 63 a6 3b 73 30 74 d3 47 56 51 ba 23 32 c8 6f |.c.;s0t.GVQ.#2.o|
00000060 e7 8a b1 27 fa f6 21 6c 26 2a f7 00 cb 14 d6 9a |...'..!l&*......|
00000070 c2 f7 45 51 c8 20 6c 96 24 b2 64 57 06 23 31 ed |..EQ. l.$.dW.#1.|
00000080 3a b2 10 7f 1d 8e 48 25 db 95 6c 0e 30 90 aa 69 |:.....H%..l.0..i|
00000090 92 ae a5 1b 36 40 43 62 95 b0 d8 f6 bf 5c c1 8e |....6@Cb.....\..|
000000a0 48 ab 38 f9 75 52 e1 8e b2 4b 75 6e f4 ac 03 24 |H.8.uR...Kun...$|
000000b0 73 f4 01 51 98 0c 6f ed 4f 19 29 88 d7 08 13 d2 |s..Q..o.O.).....|
000000c0 84 d9 54 63 b3 e3 8a 0d 42 6c f0 67 ac dc 4b 93 |..Tc....Bl.g..K.|
000000d0 79 f2 70 ff 53 1f 27 f3 70 7c bf 75 33 79 64 3c |y.p.S.'.p|.u3yd<|
000000e0 eb 30 1b dc c4 ff 11 f9 6f 74 f3 d1 1a c0 6b 4e |.0......ot....kN|
000000f0 f2 56 32 5f 0d 82 eb 49 10 a1 0a df 47 af 18 c6 |.V2_...I....G...|
00000100 21 c3 77 b4 39 7a 62 c3 aa f4 fb 19 95 bc 2d d2 |!.w.9zb.......-.|
00000110 36 ca 6b d6 bf 91 00 3d 73 e8 41 65 60 44 89 48 |6.k....=s.Ae`D.H|
00000120 57 89 9b 69 a4 c8 5e c2 df b8 bb e8 da e4 09 f9 |W..i..^.........|
00000130 29 17 39 c6 35 88 7f 26 9b c8 94 02 03 c4 03 e8 |).9.5..&........|
00000140 f6 df 68 52 e2 6e 84 91 10 7b 06 23 b0 4b f5 75 |..hR.n...{.#.K.u|
00000150 4f b6 b8 b4 f2 b3 72 8a bf 91 92 1f 73 0a de e4 |O.....r.....s...|
00000160 20 62 3d 30 50 c3 b9 7b cd 59 d1 83 fd e7 f0 cd | b=0P..{.Y......|
00000170 c6 a0 11 12 |....|
>>> Flow 12 (server to client)
00000000 00 00 01 40 57 32 56 54 ba 8e a5 73 bc 12 1e 11 |...@W2VT...s....|
00000010 02 03 72 e9 23 4f b2 70 a5 23 ea de f6 1e 25 e3 |..r.#O.p.#....%.|
00000020 6c d0 8d c5 db da 81 e5 04 71 7e 9b 75 99 1b 70 |l........q~.u..p|
00000030 ef 04 fc 64 ef 83 2b a9 4b 87 32 ed 28 98 17 ec |...d..+.K.2.(...|
00000040 c6 e9 bf 8f 85 8e 93 ac 91 a2 fe a0 78 bc e3 88 |............x...|
00000050 97 a4 3a 2e 3e 11 f5 04 0e 6f 38 6d 33 7f b7 10 |..:.>....o8m3...|
00000060 9f 1d 84 45 02 11 da 63 37 f7 86 c7 1b b3 36 ec |...E...c7.....6.|
00000070 ea b7 1a 2d 38 39 0a a1 0d 44 84 6b ad d7 22 28 |...-89...D.k.."(|
00000080 27 ab 24 b5 c3 85 77 31 b3 97 0c 12 35 7f 3e c7 |'.$...w1....5.>.|
00000090 d4 0e 3f 16 07 70 e8 fc b1 f7 29 94 28 2c ae 1b |..?..p....).(,..|
000000a0 b3 1a 25 8a 2e e7 5f 52 5b 17 dd e5 ec e9 db 93 |..%..._R[.......|
000000b0 12 29 3d ba bf ac 90 d4 37 42 36 53 ae 3e 8c db |.)=.....7B6S.>..|
000000c0 d7 7c 48 c5 43 a1 ee d3 b6 74 ac 01 27 c9 06 0c |.|H.C....t..'...|
000000d0 ae 31 68 a7 a9 ff 40 9e d1 f3 c9 ee ca 3b 98 13 |.1h...@......;..|
000000e0 aa 5d 00 67 a0 fb 68 32 64 07 ff 4c f3 e1 4c be |.].g..h2d..L..L.|
000000f0 38 3e 26 10 5c 9d 4b fc 7f 3f 22 0f ee 12 af f9 |8>&.\.K..?".....|
00000100 3d 51 83 b1 5c 65 63 f1 fa 92 0e 1d 76 b9 27 a4 |=Q..\ec.....v.'.|
00000110 a4 a3 ec ba e9 43 b1 77 e1 c7 db 9e 25 bc 93 4d |.....C.w....%..M|
00000120 0c 9c bd 64 a0 db f4 a1 2b 9a 24 99 a9 0d be 17 |...d....+.$.....|
00000130 cd 99 31 da 3f 83 66 c0 4e 6f a5 1a 1e ec 4d 07 |..1.?.f.No....M.|
00000140 a4 04 d7 23 03 f7 ec 2c 8a 12 96 85 c1 d0 cb 59 |...#...,.......Y|
00000150 e8 6b 4a 6d |.kJm|
>>> Flow 13 (client to server)
00000000 00 00 02 80 5e 7e 95 09 c2 ec 6e cd 14 10 2c 4f |....^~....n...,O|
00000010 d3 f5 0a 89 6c 4a 3a b0 26 e4 c4 bc 51 26 ec a2 |....lJ:.&...Q&..|
00000020 1a c9 35 8e b6 7a a7 88 1d fe 04 04 73 f1 e7 e1 |..5..z......s...|
00000030 86 4c 3d 85 61 02 cc 5d 24 bb 87 a2 3e b2 5d bd |.L=.a..]$...>.].|
00000040 19 5f ce 47 5a 6c 6c ab 45 84 2d 3e 51 82 90 e7 |._.GZll.E.->Q...|
00000050 76 41 b7 37 0a b8 57 d9 3c 43 3e 3b 3d ba 39 41 |vA.7..W.<C>;=.9A|
00000060 01 84 1b 3f 80 e0 f4 9b 32 32 12 02 c5 f5 23 4e |...?....22....#N|
00000070 36 75 37 2b ce 24 5e f7 9b 5b 3c 6e f8 2c aa d5 |6u7+.$^..[<n.,..|
00000080 77 03 b0 ff fe ad 75 2f 73 b5 94 0b aa f4 08 31 |w.....u/s......1|
00000090 46 a3 f3 f6 7e 1e bf eb fe c3 2c 20 e7 c5 02 41 |F...~....., ...A|
000000a0 2b 91 dd eb 8d f4 ec a9 61 0c b8 c3 67 12 0d 1f |+.......a...g...|
000000b0 4f a8 40 b0 64 68 f0 90 65 d8 06 f6 b0 7d 9f 5c |O.@.dh..e....}.\|
000000c0 2c 54 5e c4 db bc 44 b2 8a 65 9b 70 e4 5f dd 73 |,T^...D..e.p._.s|
000000d0 1b 4e 91 9a 3a 87 ba da 1e d9 0e 7c 68 b3 b1 c3 |.N..:......|h...|
000000e0 8e ce 32 a5 0d 09 22 8d 62 79 80 75 54 59 1f f8 |..2...".by.uTY..|
000000f0 9c 80 4a 4a 17 a6 1d 74 1f bd b8 76 32 24 d7 4c |..JJ...t...v2$.L|
00000100 64 0d 58 a4 f1 2e 4b 7a 82 31 33 8b 53 b2 e0 84 |d.X...Kz.13.S...|
00000110 72 88 2d 97 2b e8 27 77 4f ed 0c ad 04 5a 7a 7d |r.-.+.'wO....Zz}|
00000120 f2 10 7c db 08 b6 cd 00 22 32 19 21 4c c3 c0 71 |..|....."2.!L..q|
00000130 1a 95 4c 97 74 54 9d 2d 81 73 47 45 9b bb 72 16 |..L.tT.-.sGE..r.|
00000140 b5 10 d0 11 6a 2d 90 fa 5b 17 27 62 75 a9 40 91 |....j-..[.'bu.@.|
00000150 f6 a4 0b 3a 36 27 2c 48 e3 74 07 7d a9 35 58 7b |...:6',H.t.}.5X{|
00000160 b8 0e 05 48 6c 30 96 dc d0 b0 e2 a4 9b 82 71 04 |...Hl0........q.|
00000170 bd cd 66 54 ee 8c 1e 82 cd 5e 08 67 d3 92 d3 ad |..fT.....^.g....|
00000180 6f 68 20 ac 2e 07 16 39 6c 05 3f 1f 72 89 0b 5d |oh ....9l.?.r..]|
00000190 00 d1 a8 ce f7 93 7c b0 fe d5 01 8a dc be 1f 2b |......|........+|
000001a0 cf 94 9b 2e bc 2d c5 cc 9f 1a 88 44 73 f2 82 20 |.....-.....Ds.. |
000001b0 30 ba 04 da 91 46 22 30 1a a5 bf ee 73 80 69 9d |0....F"0....s.i.|
000001c0 66 0d 61 02 b2 9a ff 39 87 35 89 3e 53 f8 1a d2 |f.a....9.5.>S...|
000001d0 c0 31 f3 d0 19 4d 51 a5 05 da 8d d3 9b a7 58 29 |.1...MQ.......X)|
000001e0 1e 25 c1 2e f8 27 ad 05 3f 11 b6 1f 9c 6d a5 d0 |.%...'..?....m..|
000001f0 28 db ba 57 8a 12 9f c5 f3 73 93 48 05 ba d2 0a |(..W.....s.H....|
00000200 a8 6d a4 a8 96 02 de a8 77 fd 01 e4 fe 14 87 46 |.m......w......F|
00000210 d4 df f4 fc a7 e7 40 c2 3a 64 52 98 b8 5e 0f 00 |......@.:dR..^..|
00000220 06 bf 70 d9 5b 2d 14 22 3e 6a a8 e2 c5 9b 91 76 |..p.[-.">j.....v|
00000230 50 c9 92 b5 c0 31 32 a8 77 c9 be 02 00 68 08 c4 |P....12.w....h..|
00000240 1e 08 d1 fa d8 e8 32 97 5a 0a 56 a8 9b 78 94 20 |......2.Z.V..x. |
00000250 84 dd 56 18 2e eb 5d d2 e3 fd 28 05 b7 15 32 87 |..V...]...(...2.|
00000260 c4 78 71 f6 11 41 22 da 3b b5 4c 60 71 df 6c eb |.xq..A".;.L`q.l.|
00000270 c3 7c 4a 9c b3 e3 c9 12 2b a3 79 c9 e2 99 2a 4d |.|J.....+.y...*M|
00000280 6b 88 2b 42 48 79 c7 52 33 f5 09 2e 60 1f 96 b1 |k.+BHy.R3...`...|
00000290 b5 35 94 5a |.5.Z|
>>> Flow 14 (server to client)
00000000 00 00 00 10 60 4c c8 0d e2 72 d3 60 e0 94 a4 06 |....`L...r.`....|
00000010 79 85 52 74 0f 2d 35 96 99 61 f6 8d d4 01 6e e3 |y.Rt.-5..a....n.|
00000020 b2 54 8a 0f |.T..|
+295
View File
@@ -0,0 +1,295 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 5c 05 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...\....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 0a 61 65 73 31 32 38 2d 63 74 72 00 00 00 0a |..aes128-ctr....|
00000150 61 65 73 31 32 38 2d 63 74 72 00 00 00 6e 68 6d |aes128-ctr...nhm|
00000160 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 |ac-sha2-256-etm@|
00000170 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
00000180 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 |-sha2-512-etm@op|
00000190 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000001a0 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 |ha2-256,hmac-sha|
000001b0 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 2c |2-512,hmac-sha1,|
000001c0 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 00 6e |hmac-sha1-96...n|
000001d0 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 |hmac-sha2-256-et|
000001e0 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d |m@openssh.com,hm|
000001f0 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 |ac-sha2-512-etm@|
00000200 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
00000210 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 |-sha2-256,hmac-s|
00000220 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 |ha2-512,hmac-sha|
00000230 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 |1,hmac-sha1-96..|
00000240 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 |..none....none..|
00000250 00 00 00 00 00 00 00 00 00 00 00 d7 3b 80 93 f6 |............;...|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 3c 7e 44 d5 52 42 76 d2 6a fa |......<~D.RBv.j.|
00000010 8b b0 ea cc ef 95 00 00 01 7a 73 6e 74 72 75 70 |.........zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 13 cf b6 0f c2 c9 |...,..... ......|
00000010 08 d9 7b f6 60 d4 53 7f 4b b1 29 37 59 98 3c dd |..{.`.S.K.)7Y.<.|
00000020 ab b1 51 12 94 92 eb 56 4c 6f e8 a3 63 9c a8 a1 |..Q....VLo..c...|
>>> Flow 6 (server to client)
00000000 00 00 01 04 09 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 e9 56 86 74 34 11 d7 d3 48 a0 |..... .V.t4...H.|
00000080 a8 6d bd 3f 00 ae da 7d 63 fb 6f b2 2d 90 c8 53 |.m.?...}c.o.-..S|
00000090 3f 14 42 43 88 12 00 00 00 65 00 00 00 13 65 63 |?.BC.....e....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 4a 00 00 00 21 00 ed ac 80 ff 90 17 |6...J...!.......|
000000c0 05 2b 9b 55 14 f1 04 45 f5 8e 59 7b 0f a9 69 51 |.+.U...E..Y{..iQ|
000000d0 39 04 ef ab 75 03 27 8d b2 a6 00 00 00 21 00 fb |9...u.'......!..|
000000e0 5c 9b 84 8f 26 00 81 c4 7a 58 c8 c1 e7 3c 15 b7 |\...&...zX...<..|
000000f0 a3 06 27 f8 e2 a1 b5 02 5d 7f 73 29 8a e5 98 00 |..'.....].s)....|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 fc d3 1f 73 |...........@...s|
00000120 95 a6 4b 07 99 e0 76 21 16 09 1e 47 bb 69 67 42 |..K...v!...G.igB|
00000130 5c f2 e4 d2 24 8c a4 92 56 65 11 8a 8e 58 64 fd |\...$...Ve...Xd.|
00000140 20 69 4d fd a3 61 44 1d d6 b8 40 3e 9a 07 05 d5 | iM..aD...@>....|
00000150 be 5d 02 bf a0 6e 9c 1b 5d 3f b1 10 21 88 6b 78 |.]...n..]?..!.kx|
00000160 5b 36 a4 ba 01 a4 62 50 e7 e2 d1 d2 7a 47 a3 fc |[6....bP....zG..|
00000170 27 38 15 89 10 13 ee d4 bc 72 d2 16 95 d5 3a 52 |'8.......r....:R|
00000180 df 54 1e 9c 6e dd 01 2a 30 3e 5c 0a 5e 08 19 ef |.T..n..*0>\.^...|
00000190 d4 60 a6 f0 85 34 da 53 f6 c0 51 8b 5a 6b 3e 28 |.`...4.S..Q.Zk>(|
000001a0 4a 7b 41 72 89 73 c3 16 1e d4 62 fe 21 3a 0f 74 |J{Ar.s....b.!:.t|
000001b0 45 6d 61 01 3c b1 95 a0 37 6e b5 5d 38 a8 54 be |Ema.<...7n.]8.T.|
000001c0 f2 67 0d 99 cc 61 4d 11 4a 64 93 93 05 47 0f 08 |.g...aM.Jd...G..|
000001d0 75 fc 41 25 24 ce a6 b4 e7 71 c8 f4 eb 77 00 82 |u.A%$....q...w..|
000001e0 a9 8d 5d 7a f5 b9 d1 01 cb 3f d1 30 41 c4 35 56 |..]z.....?.0A.5V|
000001f0 d6 7c 13 e5 1a d2 ae 59 3a a1 35 bc 0f ca 67 73 |.|.....Y:.5...gs|
00000200 39 da 3f 33 d0 d4 ad 16 37 0d 23 52 45 c5 48 a1 |9.?3....7.#RE.H.|
00000210 0a 07 44 34 f2 a4 f1 59 91 2f ec 46 2b 47 fd 7a |..D4...Y./.F+G.z|
00000220 80 82 60 7b 22 e0 aa e2 be 9f ca 5f d0 da 58 23 |..`{"......_..X#|
00000230 b3 f9 30 e0 f6 48 a6 97 99 55 76 79 fd cc c3 fd |..0..H...Uvy....|
00000240 1b c3 91 51 f3 a2 17 c4 50 ad 34 c9 66 47 5d f2 |...Q....P.4.fG].|
00000250 0a 77 81 a2 74 35 3e e0 e1 ce 7b 10 22 9c 4a 10 |.w..t5>...{.".J.|
00000260 6b b8 5e 21 49 dc cb 02 85 7a 96 4f d6 39 b5 e5 |k.^!I....z.O.9..|
00000270 a1 40 7a 1d d6 b3 c5 3e 08 65 31 ad |.@z....>.e1.|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 e3 f9 ae 57 e2 35 b8 cc 87 3c |.........W.5...<|
00000010 00 00 00 20 33 e5 12 ab 62 1c 2c 69 88 93 54 76 |... 3...b.,i..Tv|
00000020 f7 f8 fd dc 60 17 93 77 87 cd 82 b1 07 a3 b1 ab |....`..w........|
00000030 3c 1a 85 46 bb 6d 43 54 d5 63 49 d9 1d 51 55 89 |<..F.mCT.cI..QU.|
00000040 e9 5c 5f 7c 62 b8 76 b4 0b c6 c4 e9 be d2 b2 9b |.\_|b.v.........|
00000050 d3 dc 15 b8 |....|
>>> Flow 8 (server to client)
00000000 00 00 00 20 93 ba c4 77 30 8a 7f d5 56 ed 0b b8 |... ...w0...V...|
00000010 85 c8 49 71 3a a1 8b 8b 94 d4 b1 e2 2b 0f 54 12 |..Iq:.......+.T.|
00000020 74 89 06 dc a5 92 37 aa 5e 3a 24 4d 82 df a6 40 |t.....7.^:$M...@|
00000030 74 48 79 db 42 bf 49 49 67 61 a3 e5 96 c2 f8 11 |tHy.B.IIga......|
00000040 a6 74 2c 1b |.t,.|
>>> Flow 9 (client to server)
00000000 00 00 00 30 78 7e e0 d6 9f ee 3f ac 47 ee a1 ab |...0x~....?.G...|
00000010 1f 7a d5 00 e0 b8 0a 00 69 61 db 12 f2 d4 b2 c5 |.z......ia......|
00000020 a0 09 12 08 c2 fa c1 2a 3b 21 18 03 4f be 96 0a |.......*;!..O...|
00000030 fc b4 36 8f c6 4d 8d 13 c7 ca 48 80 65 db 25 da |..6..M....H.e.%.|
00000040 4e 36 29 44 fb 19 b4 96 53 b9 2f 74 56 c9 8c 66 |N6)D....S./tV..f|
00000050 85 03 eb 98 |....|
>>> Flow 10 (server to client)
00000000 00 00 00 20 36 ba 73 95 01 22 06 8d e9 7c c1 41 |... 6.s.."...|.A|
00000010 92 85 b9 b8 f4 37 52 b0 b4 99 8f 47 f7 ef 38 10 |.....7R....G..8.|
00000020 a6 b0 35 c4 44 f1 72 89 0a 67 75 09 de 70 68 d5 |..5.D.r..gu..ph.|
00000030 4e 81 af 5b e4 5b 61 02 aa ed bb 31 fe 70 59 f5 |N..[.[a....1.pY.|
00000040 fc bf 7a 44 00 00 00 40 e3 5b ae 48 03 59 c7 d0 |..zD...@.[.H.Y..|
00000050 22 f6 34 db c7 f4 2a 09 7e 0d ad c0 e4 b6 52 c2 |".4...*.~.....R.|
00000060 7d de 8e 63 04 a0 06 d6 74 76 51 57 a6 16 7b 39 |}..c....tvQW..{9|
00000070 90 8c af 32 c3 c1 84 3f 65 39 15 d7 0e 8e b9 8e |...2...?e9......|
00000080 8f 13 97 9a ff f8 9b aa 5f 09 11 4c 46 e4 3d f6 |........_..LF.=.|
00000090 d1 e3 ac b7 d5 3e ae 68 6e ca 52 c6 f9 78 c4 ba |.....>.hn.R..x..|
000000a0 f7 37 0c 28 a5 7e 2d 45 |.7.(.~-E|
>>> Flow 11 (client to server)
00000000 00 00 01 60 90 e3 71 e0 56 c9 9e 55 b4 59 3c 28 |...`..q.V..U.Y<(|
00000010 9e 51 1c 69 16 61 e8 39 fd 0c 67 80 eb f4 c7 70 |.Q.i.a.9..g....p|
00000020 1a f9 6a b4 f3 b7 65 25 28 f5 a5 1a 56 b7 3c dc |..j...e%(...V.<.|
00000030 5b 6c 77 df 08 a2 31 e1 7f 77 17 24 fd 5a a3 e6 |[lw...1..w.$.Z..|
00000040 42 cf 4b da 75 e0 8b bf f3 e5 59 cb 11 95 d7 87 |B.K.u.....Y.....|
00000050 21 69 64 91 91 dc d8 b3 11 48 df 36 72 b1 05 43 |!id......H.6r..C|
00000060 d5 09 95 92 90 b9 d8 e4 0f 84 dd 3b c7 55 3b 93 |...........;.U;.|
00000070 d6 d0 3c 08 04 84 5a 25 55 76 ad 70 da 4d 17 6c |..<...Z%Uv.p.M.l|
00000080 5b 5e 56 0f 96 3b 4a 89 0f 23 7a a5 69 e3 b1 61 |[^V..;J..#z.i..a|
00000090 0d 19 a9 88 e9 79 bc 70 43 15 48 5e 7e 7f 76 75 |.....y.pC.H^~.vu|
000000a0 5f 8f d4 dc f7 90 af 67 e0 0a 62 56 0c 46 69 5c |_......g..bV.Fi\|
000000b0 92 bd 1d 3e bb 96 9e e9 a5 77 8a a4 70 ab df 5e |...>.....w..p..^|
000000c0 cb 09 7c 84 43 c4 d1 0e 86 0f ad e2 b7 fe d1 24 |..|.C..........$|
000000d0 e3 59 5c 22 00 07 77 a6 05 d0 53 90 47 ae c7 72 |.Y\"..w...S.G..r|
000000e0 f2 6a 56 98 f9 1e 6e 4c b1 a6 b8 3f 9f 04 c0 60 |.jV...nL...?...`|
000000f0 9a 79 14 75 4d 5f e4 c4 70 da f9 3e 88 71 94 04 |.y.uM_..p..>.q..|
00000100 5e 07 67 a9 d8 4c 4d e2 af 51 13 d1 e5 65 15 fe |^.g..LM..Q...e..|
00000110 b7 cd 7d 79 3c ba 3f 99 f3 4a 1f 2b f5 7f ff d6 |..}y<.?..J.+....|
00000120 77 48 34 96 33 1d 87 c6 41 f8 cf f8 b5 94 e8 47 |wH4.3...A......G|
00000130 d2 12 4d 21 9c 4a d8 ea 02 27 d5 dd 69 87 9a c6 |..M!.J...'..i...|
00000140 86 71 9f 97 14 d1 a3 03 35 d3 02 ed dd 5d 51 5d |.q......5....]Q]|
00000150 f5 12 47 b9 c5 39 eb fb 2d dc 56 99 da 6e e9 0a |..G..9..-.V..n..|
00000160 e6 50 94 7d f3 2e c0 64 e8 32 89 dc 43 3f ed f2 |.P.}...d.2..C?..|
00000170 99 21 c6 81 6b a6 05 90 9d 88 1e 28 d7 15 8e b8 |.!..k......(....|
00000180 6e e1 4a de |n.J.|
>>> Flow 12 (server to client)
00000000 00 00 01 40 c2 47 39 65 3f a2 7e 94 17 b3 10 86 |...@.G9e?.~.....|
00000010 f9 73 32 6e f3 ec ab e3 ac d0 8a fb 82 d3 b1 e5 |.s2n............|
00000020 45 f9 cb 72 41 f8 23 ad f8 ce b6 7d 94 f6 2b 56 |E..rA.#....}..+V|
00000030 4e 99 b0 0d d5 11 2f 55 c3 67 44 bf 0f 72 5c 5a |N...../U.gD..r\Z|
00000040 6f 41 16 b2 46 f2 f5 1d fe d7 3b cc 47 3f d7 97 |oA..F.....;.G?..|
00000050 4e 9b 2c 84 de 31 10 2a 98 91 5e 55 15 fb df 61 |N.,..1.*..^U...a|
00000060 6d 6d 0e 59 dd 9c f4 f3 bf bc 8a 6b 37 ce 78 c6 |mm.Y.......k7.x.|
00000070 cc 21 c9 56 42 11 04 65 01 6c 94 29 e3 0c 12 31 |.!.VB..e.l.)...1|
00000080 7e cc f7 3c e3 9d 74 d4 2a 5a 35 ba 85 33 86 e1 |~..<..t.*Z5..3..|
00000090 99 2f 79 1e 7e 42 ca c4 b4 fa e7 60 2f f4 6f 80 |./y.~B.....`/.o.|
000000a0 28 f1 9c f8 94 89 90 7f ad ce fd d4 be cd af 66 |(..............f|
000000b0 93 4e 53 29 2c 15 4d 5d d4 36 73 97 0e 9c 53 95 |.NS),.M].6s...S.|
000000c0 42 69 1a 80 34 ab 46 2b 97 7f 42 ca d9 33 94 e2 |Bi..4.F+..B..3..|
000000d0 35 b9 c8 ec 98 34 87 4f fe 14 ce cd 47 c4 77 22 |5....4.O....G.w"|
000000e0 74 8b f6 c6 4a dd 95 b2 57 b1 ba cd 3e bd a2 cb |t...J...W...>...|
000000f0 c7 0f e2 75 24 48 a8 75 83 35 45 8f 11 16 a8 6c |...u$H.u.5E....l|
00000100 05 3d d3 bb 2c 81 4c 67 ae 33 32 ae 28 d9 dd dd |.=..,.Lg.32.(...|
00000110 ea 73 b7 7c 88 7e ac 72 fa b9 e4 ed 37 2e 0c 0a |.s.|.~.r....7...|
00000120 8f 24 f7 80 15 af b3 61 4b 1e 83 73 34 7f bd d7 |.$.....aK..s4...|
00000130 8f 24 25 93 43 75 3c a7 e1 dc ff e1 f7 e7 9a b5 |.$%.Cu<.........|
00000140 18 1c bd 8d 81 12 a3 1a 16 1d fa e5 72 9c c7 9d |............r...|
00000150 f3 d2 1b 76 ca a6 76 50 c5 83 56 1b 20 e5 c9 99 |...v..vP..V. ...|
00000160 c0 68 fb 99 |.h..|
>>> Flow 13 (client to server)
00000000 00 00 02 80 93 38 6e 30 08 53 2e 06 7f 0b 15 9f |.....8n0.S......|
00000010 f0 12 11 34 be b5 e6 77 ef 32 d1 e5 ab b7 25 5a |...4...w.2....%Z|
00000020 2a 97 6b 83 f2 08 35 d0 ae 3b 45 ec 47 72 60 b0 |*.k...5..;E.Gr`.|
00000030 2c c1 2c 5e 66 23 a0 b0 b5 c4 77 04 97 fc 89 14 |,.,^f#....w.....|
00000040 e6 d2 60 a6 40 d0 78 22 da c9 6a a4 72 8b 63 ad |..`.@.x"..j.r.c.|
00000050 60 57 b4 27 15 8f 66 0b a0 0c c2 c0 31 a2 74 4b |`W.'..f.....1.tK|
00000060 89 4c 8f d1 cd 45 a2 3d bf f9 8d 72 95 4f fa c8 |.L...E.=...r.O..|
00000070 46 09 ec 4c cc b0 7b 69 dd 20 3e e7 b0 ac 2d a4 |F..L..{i. >...-.|
00000080 f0 34 88 02 24 e1 5b 53 c7 aa 06 96 fe 35 ab d0 |.4..$.[S.....5..|
00000090 47 95 be 42 2f 75 22 d4 14 1f c4 cb 40 89 6f a0 |G..B/u".....@.o.|
000000a0 ff 73 01 dc 40 9d c7 3d 8b 96 f1 f9 89 f6 b1 fe |.s..@..=........|
000000b0 00 35 53 9c f7 09 25 a6 90 90 bb c8 a7 a2 88 e0 |.5S...%.........|
000000c0 ee 78 97 a8 d2 26 b7 b4 8c c6 3d 10 16 29 4b 6c |.x...&....=..)Kl|
000000d0 ee 30 90 73 09 57 f2 e1 c3 90 5f bc a2 48 aa 7b |.0.s.W...._..H.{|
000000e0 34 a3 95 1c 33 29 04 e4 97 f9 5f 62 5b 70 a0 c7 |4...3)...._b[p..|
000000f0 35 0f 28 ea 66 f8 42 61 a5 09 c3 c3 f1 81 26 66 |5.(.f.Ba......&f|
00000100 c3 c7 b9 b8 8e eb fa 22 30 a7 61 39 35 04 ba dc |......."0.a95...|
00000110 ff ab 5c 4e f6 0a 1d dc da 1d 37 88 fb 13 83 9b |..\N......7.....|
00000120 64 7c 5a 80 dc 05 df 3c 5a 36 16 67 6f 3f eb d1 |d|Z....<Z6.go?..|
00000130 f9 b8 4c 43 c3 39 97 e8 d9 2a e6 2b df 61 45 b1 |..LC.9...*.+.aE.|
00000140 9b d6 42 c0 d0 04 e9 d4 8b d5 fc db bc 09 ab 6d |..B............m|
00000150 fe e1 8c a9 95 29 d0 f6 e8 d0 f7 f5 f2 b8 39 f1 |.....)........9.|
00000160 2b 72 a7 ec 65 e9 7a 95 18 c2 2c 02 57 fa f8 b6 |+r..e.z...,.W...|
00000170 81 a8 10 99 cb ea a6 df d8 fe fd bf 20 32 82 97 |............ 2..|
00000180 78 31 a4 17 96 0c 50 05 bc c9 51 51 a9 fe da 2f |x1....P...QQ.../|
00000190 f1 bf df 91 1a 68 76 0f bc d9 22 9e bc 5e 65 64 |.....hv..."..^ed|
000001a0 7d 9f 19 c9 b6 09 77 0d 8d 7b cc 95 b5 70 cb c4 |}.....w..{...p..|
000001b0 d8 b6 85 4d f9 df 90 ce 91 2b 65 90 0d 2f f2 0a |...M.....+e../..|
000001c0 87 3e af c5 55 bd 37 05 4a 5d a6 ae d7 ce ec 65 |.>..U.7.J].....e|
000001d0 94 66 7e 4e e2 94 b4 f0 5a 83 08 f6 e1 ce 62 e5 |.f~N....Z.....b.|
000001e0 24 d6 98 6e a7 10 23 03 57 e8 03 b1 b0 84 53 0b |$..n..#.W.....S.|
000001f0 74 85 df fd b2 e1 0d 52 af 51 e3 64 5b 9d ed 42 |t......R.Q.d[..B|
00000200 88 a6 bd f1 e5 61 05 a7 40 f6 0b c2 97 26 ad 3c |.....a..@....&.<|
00000210 60 4f 75 d9 fb 20 b1 4d 96 a0 e8 80 c1 fe 1c 2c |`Ou.. .M.......,|
00000220 d5 b2 17 d5 8a 63 50 16 ae 67 3c dc 56 28 68 6d |.....cP..g<.V(hm|
00000230 3d ec ca 11 58 f4 98 30 dc 92 f4 38 6b 7c ff 4d |=...X..0...8k|.M|
00000240 e4 f0 63 66 b4 e6 20 56 3a d0 b7 e8 10 d0 13 44 |..cf.. V:......D|
00000250 a7 ac 20 2a ca 8c 4f 73 12 36 8d 29 66 92 0c 5a |.. *..Os.6.)f..Z|
00000260 db 11 49 8b c2 2a e4 7c 2d 4c 26 5c d7 a5 37 2f |..I..*.|-L&\..7/|
00000270 4b 4e 95 90 1b de 4c 7d 78 6a 62 ac b0 a0 e8 93 |KN....L}xjb.....|
00000280 46 65 ce c9 39 19 36 14 d4 22 28 75 23 3b 33 97 |Fe..9.6.."(u#;3.|
00000290 95 46 f1 7a 87 ae d4 4b dd 2d 3b 7e 5b 3a e1 d2 |.F.z...K.-;~[:..|
000002a0 17 85 9c 7e |...~|
>>> Flow 14 (server to client)
00000000 00 00 00 10 f5 bc 41 31 d1 0d d3 47 ed 2b 87 a0 |......A1...G.+..|
00000010 53 67 74 1d 19 c6 af f6 59 6a 8c d2 0d 29 0a 63 |Sgt.....Yj...).c|
00000020 b1 0d cc db d3 b4 d3 1b d3 d0 73 a6 f8 ec 16 06 |..........s.....|
00000030 de e2 0e b8 |....|
+287
View File
@@ -0,0 +1,287 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 7c 0d 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...|....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 16 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 |..aes128-gcm@ope|
00000150 6e 73 73 68 2e 63 6f 6d 00 00 00 16 61 65 73 31 |nssh.com....aes1|
00000160 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-gcm@openssh.c|
00000170 6f 6d 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d |om...nhmac-sha2-|
00000180 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e |256-etm@openssh.|
00000190 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 |com,hmac-sha2-51|
000001a0 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |2-etm@openssh.co|
000001b0 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
000001c0 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
000001d0 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 |ac-sha1,hmac-sha|
000001e0 31 2d 39 36 00 00 00 6e 68 6d 61 63 2d 73 68 61 |1-96...nhmac-sha|
000001f0 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-256-etm@openss|
00000200 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d |h.com,hmac-sha2-|
00000210 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e |512-etm@openssh.|
00000220 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 |com,hmac-sha2-25|
00000230 36 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c |6,hmac-sha2-512,|
00000240 68 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 |hmac-sha1,hmac-s|
00000250 68 61 31 2d 39 36 00 00 00 04 6e 6f 6e 65 00 00 |ha1-96....none..|
00000260 00 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 |..none..........|
00000270 00 00 00 d7 3b 80 93 f6 ef bc 88 eb 1a 6e ac fa |....;........n..|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 5b f0 eb 4c e5 38 1d df 00 dc |......[..L.8....|
00000010 d7 5e f9 2f 04 3b 00 00 01 7a 73 6e 74 72 75 70 |.^./.;...zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 7e 4a 3b cc bf 9a |...,..... ~J;...|
00000010 2e 84 5f cb bb 32 fa b6 67 2f 28 60 b3 d3 48 e8 |.._..2..g/(`..H.|
00000020 f9 c9 38 6f ae b4 a3 c4 5b 73 ae 57 e2 35 b8 cc |..8o....[s.W.5..|
>>> Flow 6 (server to client)
00000000 00 00 01 04 09 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 24 91 84 75 c5 47 0e f0 65 f7 |..... $..u.G..e.|
00000080 b4 24 f9 69 a6 ba b0 3c fa c7 6b 47 67 93 ed 68 |.$.i...<..kGg..h|
00000090 c7 24 9f 85 d1 20 00 00 00 65 00 00 00 13 65 63 |.$... ...e....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 4a 00 00 00 21 00 be d5 c3 20 93 2a |6...J...!.... .*|
000000c0 6f 26 6e ff 6e 3b fc 85 55 ff 33 8a a9 ce 0a 46 |o&n.n;..U.3....F|
000000d0 33 6f b8 b6 8c ee 3d dd 0c 81 00 00 00 21 00 c7 |3o....=......!..|
000000e0 f1 e0 5b 89 be 5f c2 55 77 8a 0b 08 e8 d0 f3 e6 |..[.._.Uw.......|
000000f0 ce d0 fe 20 4e 64 8e 8e 76 1d 2c 86 06 48 0a 00 |... Nd..v.,..H..|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 7a e3 f5 9b |...........@z...|
00000120 b1 a1 ce 3c 76 3c 19 bd fd 43 ae a0 cd 49 a6 2e |...<v<...C...I..|
00000130 b9 3b f6 25 4d 9d 0e 20 e3 29 30 f6 d5 ce 22 c8 |.;.%M.. .)0...".|
00000140 29 f3 10 f2 99 99 e7 5b 7c eb a8 4b 5c 6e 35 57 |)......[|..K\n5W|
00000150 30 9e 6d 9d 41 fe be a2 cf 55 7a 8a 45 08 95 5e |0.m.A....Uz.E..^|
00000160 58 89 c6 24 27 ea 14 a1 a5 d9 9b 06 80 40 94 84 |X..$'........@..|
00000170 10 14 88 71 71 06 a0 b6 53 d1 4b 07 77 e4 12 6e |...qq...S.K.w..n|
00000180 cc 4a 0a 89 87 3c d2 f3 2e 70 02 71 f3 3c 96 fb |.J...<...p.q.<..|
00000190 29 7d b6 85 93 7e 73 e0 83 d7 5f 9e 36 67 7f 82 |)}...~s..._.6g..|
000001a0 b3 d5 cb bb 93 fd d8 fd 29 9a 9a 55 07 b1 8a 05 |........)..U....|
000001b0 92 cc 40 eb 2e f1 cc fe 82 13 58 8b e5 6e f2 8a |..@.......X..n..|
000001c0 b9 ae 3a e1 07 29 ed f7 5a 52 57 c6 58 92 fa f3 |..:..)..ZRW.X...|
000001d0 43 dd 4a fc 7c 67 54 55 eb fc dd 5b 86 26 2f 6e |C.J.|gTU...[.&/n|
000001e0 78 d5 2a 48 7f f6 2f 44 89 35 a7 71 8d 41 fe dd |x.*H../D.5.q.A..|
000001f0 6b 59 45 08 99 e8 02 f9 27 80 a2 0a 1a 4e 51 e1 |kYE.....'....NQ.|
00000200 c7 db 0d 45 54 9e 6e 61 7f 01 a4 1d 4a 43 98 05 |...ET.na....JC..|
00000210 15 b4 4a 29 73 56 6f ad 3d c7 ac d1 d3 6e ca 65 |..J)sVo.=....n.e|
00000220 36 31 d3 82 a6 67 4c b2 dd e8 24 9f 39 33 4d 0e |61...gL...$.93M.|
00000230 81 ef 20 b6 a0 ca 5a 06 b1 75 4b 4d 0d 5f 3e 8f |.. ...Z..uKM._>.|
00000240 bb 65 12 af 72 f7 3d 26 cd 29 7e 12 ee 90 e4 f8 |.e..r.=&.)~.....|
00000250 f9 b5 93 11 1f 96 a9 82 5f d0 c3 d3 8a 5c ba cc |........_....\..|
00000260 6b 6f ae 87 92 4e ba 86 a8 dc 68 6f |ko...N....ho|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 87 3c 23 dc 62 b8 d2 60 16 9a |.......<#.b..`..|
00000010 00 00 00 20 79 7f 77 85 3c a1 cd 5b 68 fb 0d 92 |... y.w.<..[h...|
00000020 3c d9 58 4c a3 88 ff 1c 94 e5 50 cb 1d ab 83 ab |<.XL......P.....|
00000030 7e b2 ff 51 e4 3a d2 c6 65 c8 42 f5 de 8c 90 71 |~..Q.:..e.B....q|
00000040 1c 99 e1 09 |....|
>>> Flow 8 (server to client)
00000000 00 00 00 20 9e 31 c9 bd a5 a4 95 f8 67 2b 5e 5a |... .1......g+^Z|
00000010 63 53 db 9d a9 ae ef 08 43 f9 2b 0a 15 b7 38 71 |cS......C.+...8q|
00000020 7e d0 68 16 d6 03 c4 0c 66 b9 e8 0e 4b 0f e8 53 |~.h.....f...K..S|
00000030 e4 bc c2 60 |...`|
>>> Flow 9 (client to server)
00000000 00 00 00 30 9f 76 ec e4 9c a3 55 3e 8a 83 03 54 |...0.v....U>...T|
00000010 c9 d1 e4 20 91 6b d9 2c 28 28 a5 7f 82 92 3a 89 |... .k.,((....:.|
00000020 d0 cd 98 e7 a4 85 d7 31 a8 3e be a3 b3 c0 65 65 |.......1.>....ee|
00000030 e6 6c 74 e5 38 13 42 51 12 e2 d0 1b 53 39 f6 b3 |.lt.8.BQ....S9..|
00000040 e8 b2 73 3f |..s?|
>>> Flow 10 (server to client)
00000000 00 00 00 20 e4 45 97 15 a1 64 3b ff 65 37 c4 2e |... .E...d;.e7..|
00000010 03 d6 8e e7 91 ca 58 65 55 f5 b9 fa ef 3b 7d cc |......XeU....;}.|
00000020 ad 11 3b 54 c8 e3 2c f8 de 42 55 b2 97 b4 a7 ec |..;T..,..BU.....|
00000030 d8 a0 90 98 00 00 00 40 5c bc 96 d5 fe 09 4a e9 |.......@\.....J.|
00000040 d1 a5 f9 2e 9f 4c 0f 28 0c 66 79 aa 53 bb 78 d5 |.....L.(.fy.S.x.|
00000050 41 a5 8f 7d 53 09 98 fb be 3d 26 35 f3 8a 76 88 |A..}S....=&5..v.|
00000060 3f e1 66 b3 93 9e c9 00 b6 33 0e 12 ac 37 50 8f |?.f......3...7P.|
00000070 f7 b3 25 51 71 9f f7 e1 f9 b3 7b c8 4d 0f ca 92 |..%Qq.....{.M...|
00000080 21 32 5c f4 22 c1 63 90 |!2\.".c.|
>>> Flow 11 (client to server)
00000000 00 00 01 60 98 3f bc 85 ef 21 41 c0 61 b1 ad d1 |...`.?...!A.a...|
00000010 d9 73 3d 13 54 fe d7 c1 d3 d8 65 02 e4 3f 32 eb |.s=.T.....e..?2.|
00000020 78 2f fc fe 5f fc 48 ea 7f d9 53 51 59 a8 ad c0 |x/.._.H...SQY...|
00000030 a4 65 c8 e6 6b 11 44 e7 ab 9a 1a 84 4e 83 1c a9 |.e..k.D.....N...|
00000040 48 95 0a d1 f2 4c 64 c8 43 c4 0c 15 5b 5b af e0 |H....Ld.C...[[..|
00000050 3c 21 0d ff f2 a8 7c 91 a1 d9 cc 7a f1 ff 53 56 |<!....|....z..SV|
00000060 b2 09 f1 8b bb bf 42 5e c0 1d 03 6b ba 15 6f 68 |......B^...k..oh|
00000070 5a 69 5c d5 33 11 c6 52 d2 12 23 dc 57 f8 06 7a |Zi\.3..R..#.W..z|
00000080 55 d9 ee 8e cb 5f 49 32 c1 6a 84 57 73 b1 c5 70 |U...._I2.j.Ws..p|
00000090 78 83 bc 4a 45 72 ec 07 0a 5a cb 5d c2 06 d2 d7 |x..JEr...Z.]....|
000000a0 fd 0a 4c 0f 8a 47 e0 58 7e ec f8 35 ba 9a 4c 0e |..L..G.X~..5..L.|
000000b0 3f 0b 21 b2 b8 17 a0 c8 a1 c6 98 38 9c 7b 15 d0 |?.!........8.{..|
000000c0 8e 12 49 5a d9 5e ae ce 64 7d be 67 22 48 53 c7 |..IZ.^..d}.g"HS.|
000000d0 2a 19 37 8e 4e c8 2b 12 33 70 68 8a 18 8e 2b 5c |*.7.N.+.3ph...+\|
000000e0 1d 8a d2 b3 3b 0e 8b 55 58 12 2d 9c 67 5e bd 77 |....;..UX.-.g^.w|
000000f0 48 85 c3 88 59 4c c6 6f 64 3b 0c 24 96 81 d2 e1 |H...YL.od;.$....|
00000100 39 24 0e 9d 72 7a 0b 29 66 cc 7e fe 6d 88 1f d0 |9$..rz.)f.~.m...|
00000110 1b ac 9d 00 8d 21 98 58 36 c0 64 e7 83 f8 77 87 |.....!.X6.d...w.|
00000120 d7 8e 06 a9 57 b3 01 2b 61 4f 7d 31 d4 6c 5d 78 |....W..+aO}1.l]x|
00000130 ee c7 06 f8 92 92 36 d3 6e 98 8f 0d 5b 68 1a 1d |......6.n...[h..|
00000140 fb d8 90 a0 3c db c1 40 4a bc 18 6a b7 f6 45 d0 |....<..@J..j..E.|
00000150 42 49 7e 8f b8 4f 27 93 8c d7 3b 57 46 79 a7 20 |BI~..O'...;WFy. |
00000160 25 57 0f ca a8 70 83 3a 21 5f 63 b5 fa d8 9d 4b |%W...p.:!_c....K|
00000170 f0 8a 88 b7 |....|
>>> Flow 12 (server to client)
00000000 00 00 01 40 ef 68 cf f5 46 8a f8 c9 2f 84 67 34 |...@.h..F.../.g4|
00000010 bf 28 5f 6c b4 f5 87 1c 93 4a 87 30 5c cf 3c f1 |.(_l.....J.0\.<.|
00000020 2b 86 d7 28 26 00 ae e5 8b 68 e7 66 ed 14 e7 95 |+..(&....h.f....|
00000030 c1 33 d1 34 e0 d2 d8 f7 eb 7d 94 0c e4 22 c9 69 |.3.4.....}...".i|
00000040 c8 68 b6 e3 01 fc f0 32 a8 2f 82 56 2d 04 fd 55 |.h.....2./.V-..U|
00000050 fd 7a 89 d9 b6 19 e0 32 34 27 82 c5 61 ff 20 95 |.z.....24'..a. .|
00000060 44 c6 fd fd 8c 62 3c 39 16 9e 62 6d 5d 30 3c b4 |D....b<9..bm]0<.|
00000070 43 47 72 6e b7 2a 61 5f 95 9b 4f 9b b3 0b 76 e3 |CGrn.*a_..O...v.|
00000080 c3 5f d0 61 8d a1 7d c7 6d 5b f3 54 57 8a 43 aa |._.a..}.m[.TW.C.|
00000090 03 19 06 06 1e cd d9 b1 52 1d 59 c8 38 60 da 12 |........R.Y.8`..|
000000a0 52 35 52 41 b0 45 73 b3 c3 f2 d8 e8 cc a5 c4 84 |R5RA.Es.........|
000000b0 88 cd 78 4b 92 ec 02 02 25 fd e9 ea 2f 1d 62 ec |..xK....%.../.b.|
000000c0 17 af 3e 2e bd d2 d5 d5 94 f8 30 ad 75 9d 36 31 |..>.......0.u.61|
000000d0 51 37 e7 d7 1d 06 fe 4b 06 f6 6a 90 0e 53 0b 2e |Q7.....K..j..S..|
000000e0 5b d2 7d d3 b3 28 f7 22 31 29 47 b3 f5 8a 40 d4 |[.}..(."1)G...@.|
000000f0 bd 90 fa cc 0e 43 66 fb 3b cb 12 9a e6 4c 84 84 |.....Cf.;....L..|
00000100 55 0d 84 cc 71 10 55 79 a4 51 1a b5 f4 61 d0 bf |U...q.Uy.Q...a..|
00000110 07 34 b0 a1 d8 96 81 fe 51 b1 63 fa a5 90 82 87 |.4......Q.c.....|
00000120 0d bc 15 63 d8 7f 8e 5f 4d c3 be 7d 54 36 3c f4 |...c..._M..}T6<.|
00000130 4c 88 5e 8d 41 6f f3 74 25 b3 3b f1 3d 4d 8c 14 |L.^.Ao.t%.;.=M..|
00000140 83 5e 5e b7 78 e5 8a 8f 73 28 30 7d 64 0f 5c bd |.^^.x...s(0}d.\.|
00000150 31 e4 9a c4 |1...|
>>> Flow 13 (client to server)
00000000 00 00 02 80 00 cb 00 7f f2 7f 90 a4 6b 52 c0 6c |............kR.l|
00000010 7b 1b 0a a0 0e 61 e9 93 be a0 96 da 8b 25 10 2d |{....a.......%.-|
00000020 1f 12 3b 87 cf 98 45 5c 59 91 c0 5c 37 a5 0c 5b |..;...E\Y..\7..[|
00000030 df 23 6b b6 b4 8a c4 f0 c7 b5 28 2f e3 21 b7 10 |.#k.......(/.!..|
00000040 fc 8d 32 04 1d e9 11 7d 68 1c 68 eb 8c a3 38 45 |..2....}h.h...8E|
00000050 a7 a2 01 37 97 ac b2 fd 90 29 15 0e c6 13 ce 66 |...7.....).....f|
00000060 85 ff a7 4e 48 4c ba d9 fc 15 ec e3 64 98 36 9d |...NHL......d.6.|
00000070 0b dd fe 21 8b 1f ba 81 39 ac 79 f0 b9 01 aa 09 |...!....9.y.....|
00000080 64 a0 8e da 7b d4 e1 13 28 57 fe 1c 05 ec ad ed |d...{...(W......|
00000090 38 de 3e 79 a0 74 d5 01 4e fe 4b e6 e8 53 d3 d6 |8.>y.t..N.K..S..|
000000a0 03 a6 79 46 77 c1 5f ee a7 c3 c5 9e 97 f6 57 1d |..yFw._.......W.|
000000b0 5e 35 3e 8a a7 fc 91 f3 f1 91 dd 6c ea ae d8 04 |^5>........l....|
000000c0 5a 03 69 b4 1e fb 40 be b9 39 56 08 7c 32 ca a2 |Z.i...@..9V.|2..|
000000d0 c5 e0 ec 0a 66 61 25 49 5c 78 ce 08 8c b6 39 3a |....fa%I\x....9:|
000000e0 5e 29 da f3 a1 9b 0b 0b 70 8f 54 fd 1e c7 36 26 |^)......p.T...6&|
000000f0 9d ae 82 79 0e fb 18 27 ce 45 6d 04 ce 0e a7 c2 |...y...'.Em.....|
00000100 81 27 e8 53 8e 03 a7 55 c4 ca c4 48 26 c5 8d 2b |.'.S...U...H&..+|
00000110 3b dc 66 ca 98 35 bb b7 ab 22 e3 93 64 6d e7 10 |;.f..5..."..dm..|
00000120 8a 9b fb e7 af 24 b1 ff 58 e4 01 90 18 d6 2c 38 |.....$..X.....,8|
00000130 4c aa b1 44 15 cd 9d 76 9f 8f a4 1d 11 36 96 41 |L..D...v.....6.A|
00000140 1b 33 a3 ee 1f 4a e5 23 8c bc 82 a5 10 6a 3c 27 |.3...J.#.....j<'|
00000150 68 7f 8f 8a b8 cc 22 1b 0f 1c b5 ea 51 05 5c 43 |h.....".....Q.\C|
00000160 2d 85 c3 4e 2d d9 6c b3 4c 2c 5d 45 c0 77 85 20 |-..N-.l.L,]E.w. |
00000170 df 40 38 0a e7 ab 33 f0 60 66 fa 2a 94 46 3b 73 |.@8...3.`f.*.F;s|
00000180 9a 80 2b 5a 8b ec eb 0a c6 93 e0 85 e2 78 99 9e |..+Z.........x..|
00000190 5d 03 3a ea 9c 43 e4 a2 05 5f 6d 3b bb e2 8a 70 |].:..C..._m;...p|
000001a0 f8 ce bc 36 f2 9f 58 b6 42 30 83 2c 45 3e 5b 6d |...6..X.B0.,E>[m|
000001b0 23 f1 8c 86 4a 42 cf c9 50 88 9c 4c 28 18 64 4b |#...JB..P..L(.dK|
000001c0 14 48 82 b3 35 42 82 c7 3b 4a bf cb 7e c1 4a e2 |.H..5B..;J..~.J.|
000001d0 e8 de a3 55 19 94 3e 38 80 2d a9 60 16 73 7e 85 |...U..>8.-.`.s~.|
000001e0 50 47 4f 0a 26 d8 e9 b8 14 ab 1a 8f 67 9a a1 a5 |PGO.&.......g...|
000001f0 0e fe 67 59 4f f6 2c 57 01 98 c5 65 b3 7c f0 57 |..gYO.,W...e.|.W|
00000200 42 c4 30 41 8b cc f0 c7 05 32 a3 e0 ef 97 bf 23 |B.0A.....2.....#|
00000210 f0 d8 fc 87 fc 13 9f 3d 33 6d 80 a2 e1 75 df 93 |.......=3m...u..|
00000220 34 1b 9a 7f 36 c6 80 f5 75 c5 4c 0b 43 75 5a 97 |4...6...u.L.CuZ.|
00000230 f6 c0 bf 67 86 8e 2e 8a 15 ef 30 cc a8 d6 43 3f |...g......0...C?|
00000240 aa 1a 7a 39 bf 9d 45 8d 60 97 02 2d 7d 2b c3 b7 |..z9..E.`..-}+..|
00000250 fb ea d0 9e 99 69 26 05 f7 bb 79 5d 9a fa 86 fb |.....i&...y]....|
00000260 96 fe 42 58 32 7a 7c d1 05 0b 1b 7a 12 35 ea be |..BX2z|....z.5..|
00000270 dc 56 19 8f 32 4c 92 17 53 d9 33 00 04 e8 6f ba |.V..2L..S.3...o.|
00000280 4f bb 52 83 ff ba e6 f9 87 3c aa 6f c1 58 93 23 |O.R......<.o.X.#|
00000290 b0 5e 26 42 |.^&B|
>>> Flow 14 (server to client)
00000000 00 00 00 10 79 b4 da e8 8c a4 14 53 a6 e7 37 65 |....y......S..7e|
00000010 37 76 0e 7d ef a8 d9 91 1d 99 2a 57 95 fc 2a 97 |7v.}......*W..*.|
00000020 37 12 13 73 |7..s|
+295
View File
@@ -0,0 +1,295 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 5c 05 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...\....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 0a 61 65 73 31 39 32 2d 63 74 72 00 00 00 0a |..aes192-ctr....|
00000150 61 65 73 31 39 32 2d 63 74 72 00 00 00 6e 68 6d |aes192-ctr...nhm|
00000160 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 |ac-sha2-256-etm@|
00000170 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
00000180 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 |-sha2-512-etm@op|
00000190 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000001a0 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 |ha2-256,hmac-sha|
000001b0 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 2c |2-512,hmac-sha1,|
000001c0 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 00 6e |hmac-sha1-96...n|
000001d0 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 |hmac-sha2-256-et|
000001e0 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d |m@openssh.com,hm|
000001f0 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 |ac-sha2-512-etm@|
00000200 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
00000210 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 |-sha2-256,hmac-s|
00000220 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 |ha2-512,hmac-sha|
00000230 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 |1,hmac-sha1-96..|
00000240 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 |..none....none..|
00000250 00 00 00 00 00 00 00 00 00 00 00 d7 3b 80 93 f6 |............;...|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 e1 22 f6 a4 d0 5d ab 07 1b 53 |......."...]...S|
00000010 71 9b 45 3a a8 4e 00 00 01 7a 73 6e 74 72 75 70 |q.E:.N...zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 13 cf b6 0f c2 c9 |...,..... ......|
00000010 08 d9 7b f6 60 d4 53 7f 4b b1 29 37 59 98 3c dd |..{.`.S.K.)7Y.<.|
00000020 ab b1 51 12 94 92 eb 56 4c 6f e8 a3 63 9c a8 a1 |..Q....VLo..c...|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 81 ce f7 63 d7 91 ec be e9 c0 |..... ...c......|
00000080 0d 73 92 94 15 ef e2 e9 6d 47 38 ea 62 67 78 12 |.s......mG8.bgx.|
00000090 07 2b 79 f3 27 77 00 00 00 64 00 00 00 13 65 63 |.+y.'w...d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 21 00 9e c5 62 22 31 5f |6...I...!...b"1_|
000000c0 fd 0f bc 20 d6 20 0c 3f f3 68 26 38 6b 97 09 c2 |... . .?.h&8k...|
000000d0 07 4f 1b 4f 7f 3c 56 cf 79 4b 00 00 00 20 22 b5 |.O.O.<V.yK... ".|
000000e0 5c 49 2d a3 f2 7e 49 83 54 2a f5 83 84 e4 48 06 |\I-..~I.T*....H.|
000000f0 83 f9 00 46 cf 2a 9b 25 e0 55 2a 76 0c ed 00 00 |...F.*.%.U*v....|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 97 32 fc d4 |...........@.2..|
00000120 fb 2d 65 17 78 14 c9 7a ee 20 4e 99 9a f5 91 d5 |.-e.x..z. N.....|
00000130 a0 58 01 80 8e 09 d5 41 91 d8 41 67 71 19 c1 ca |.X.....A..Agq...|
00000140 06 74 10 79 17 cd 3a 1d db 31 c4 73 81 61 29 ee |.t.y..:..1.s.a).|
00000150 50 ed 97 cd a9 c0 ae fd d0 aa 5e 5d 32 df b1 36 |P.........^]2..6|
00000160 43 7c 01 4d b6 e5 2e 3f 21 91 81 58 61 74 cb 6a |C|.M...?!..Xat.j|
00000170 b2 43 6d 46 f9 49 41 ca 22 4d 3b 5f 07 52 06 6e |.CmF.IA."M;_.R.n|
00000180 d4 8f 74 ee 4f 44 65 da 6d db 45 de 30 3e 9b fe |..t.ODe.m.E.0>..|
00000190 23 05 c2 95 55 d3 57 12 7f 0e c4 a1 5a 75 46 9a |#...U.W.....ZuF.|
000001a0 7a ba a1 ea 81 f4 e9 68 0c 4e a2 63 bf 67 01 97 |z......h.N.c.g..|
000001b0 4d 95 98 64 4e ba 8a fd e0 c4 79 d7 9f 36 93 a8 |M..dN.....y..6..|
000001c0 55 47 71 96 2b 7e a1 ae 6f 09 b2 d0 39 bd bd 23 |UGq.+~..o...9..#|
000001d0 76 19 6f d9 40 6c 3d dd 1c 6e 12 5b a1 68 50 60 |v.o.@l=..n.[.hP`|
000001e0 8d bb 28 2b bd 6b 06 8d 95 98 3d 6c 4a 4a 87 e2 |..(+.k....=lJJ..|
000001f0 99 47 b4 1d 71 5e 4d 8b 99 f3 95 d9 21 e9 50 6a |.G..q^M.....!.Pj|
00000200 c5 46 09 2d 42 47 9f a4 5a fb 23 12 09 f4 87 95 |.F.-BG..Z.#.....|
00000210 1e 27 4d c6 9e 99 d8 69 3a e9 3c 70 47 f4 70 f2 |.'M....i:.<pG.p.|
00000220 ef 3c a4 8f d3 67 71 49 b5 f1 e8 d2 46 7d 5f 89 |.<...gqI....F}_.|
00000230 18 d8 5d 91 3e 19 7a 17 3a d0 8b 5d d6 03 21 80 |..].>.z.:..]..!.|
00000240 b5 99 7d 96 aa 23 01 18 1e ee 55 89 7e 98 2b a4 |..}..#....U.~.+.|
00000250 06 08 9d 47 cf 7a f9 b4 2a f8 34 43 bf 8c 11 f6 |...G.z..*.4C....|
00000260 10 b7 c5 cc e8 a0 46 d0 d8 ec 9f ff 0b 14 79 a4 |......F.......y.|
00000270 fb cf 27 7d b8 0d 44 9d 52 ed 60 44 |..'}..D.R.`D|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 e3 f9 ae 57 e2 35 b8 cc 87 3c |.........W.5...<|
00000010 00 00 00 20 f4 13 e8 fa 65 88 0b 90 e2 19 fc 17 |... ....e.......|
00000020 98 47 93 de 21 47 e1 74 8c b8 81 6f 70 cf 17 07 |.G..!G.t...op...|
00000030 ab a5 08 eb 35 04 48 0b c8 ae 85 62 76 1e 24 7f |....5.H....bv.$.|
00000040 2a 9c ec 6a 19 af 9c d6 8f b0 a8 51 97 c6 69 bb |*..j.......Q..i.|
00000050 67 c3 4a c2 |g.J.|
>>> Flow 8 (server to client)
00000000 00 00 00 20 da 65 ba 85 a0 a2 83 b6 ac ec bc cb |... .e..........|
00000010 5b c7 e2 57 e7 b3 ff 29 a8 13 71 52 4b c8 52 dd |[..W...)..qRK.R.|
00000020 fb 5c b1 c9 bd ff 16 05 ea d3 b5 0e 4d 29 a6 0d |.\..........M)..|
00000030 12 f7 5d 5c 75 ca 2a 2a 35 ca 19 3d 51 98 6b 02 |..]\u.**5..=Q.k.|
00000040 4d 49 8c 55 |MI.U|
>>> Flow 9 (client to server)
00000000 00 00 00 30 9b 75 2d cc 5b a2 24 12 e8 b6 54 a5 |...0.u-.[.$...T.|
00000010 f2 32 2d e6 27 b9 97 5c eb 6d bc 05 4d 92 4d 04 |.2-.'..\.m..M.M.|
00000020 ef e9 cf 8e a7 7f c0 d8 46 43 0e 5c 72 c0 07 af |........FC.\r...|
00000030 e7 00 52 d4 6d 2a 32 14 95 9e 00 36 8e 51 60 12 |..R.m*2....6.Q`.|
00000040 7e 42 66 d6 72 55 08 b3 10 4e ee cb 91 3d 3d 9a |~Bf.rU...N...==.|
00000050 7b a4 03 9f |{...|
>>> Flow 10 (server to client)
00000000 00 00 00 20 ea eb e4 be 7a 89 14 50 31 3b 2d c3 |... ....z..P1;-.|
00000010 07 33 c0 dd 20 bd 0b 29 f3 31 a3 c0 8c 0b a6 fe |.3.. ..).1......|
00000020 19 55 ff 30 63 18 a0 88 98 b6 ec 1f 8e 17 f1 3e |.U.0c..........>|
00000030 b7 e9 db 17 c3 d3 c2 65 5d 8c b1 6b 46 a3 5c cc |.......e]..kF.\.|
00000040 ed e2 76 52 00 00 00 40 84 e9 87 0e b9 7a 45 1c |..vR...@.....zE.|
00000050 6e 0a 5e 34 d8 43 11 50 84 fc e8 8a eb a9 11 4f |n.^4.C.P.......O|
00000060 3a 38 e1 e1 8c 46 32 1b 2e d2 02 5c 41 f5 48 f5 |:8...F2....\A.H.|
00000070 28 cd 8e 09 55 4d 6a 75 62 15 39 48 df fb c1 58 |(...UMjub.9H...X|
00000080 07 57 7b 11 f4 71 76 bd 5f bf 3a 2d f0 7b bf a0 |.W{..qv._.:-.{..|
00000090 cd 2c e0 3f 6e 53 66 aa 4b 2a a5 63 e7 bb 86 37 |.,.?nSf.K*.c...7|
000000a0 56 dd 80 66 58 70 e6 cd |V..fXp..|
>>> Flow 11 (client to server)
00000000 00 00 01 60 fa a3 83 90 6b bc 23 18 34 ed 38 05 |...`....k.#.4.8.|
00000010 93 78 66 20 8b f1 36 92 cb c5 b2 1b 1a d6 d1 57 |.xf ..6........W|
00000020 1f 62 a9 58 5d 30 26 16 09 65 f7 f5 9d da 81 90 |.b.X]0&..e......|
00000030 b0 40 68 0c 30 11 9a 7c ae 41 67 9e 93 3d 53 c4 |.@h.0..|.Ag..=S.|
00000040 3d fc e8 c7 a2 e2 b5 69 b0 41 65 51 71 f8 d6 e9 |=......i.AeQq...|
00000050 cf c8 6f 61 1e 2c 51 d3 3b 52 ff 6f cc 6e 7c 6e |..oa.,Q.;R.o.n|n|
00000060 e8 0d 16 b2 c8 d3 d8 23 0f 75 fb 04 ce 4e 74 f2 |.......#.u...Nt.|
00000070 ea 9d 08 75 6f 73 e0 26 9a f2 88 67 a6 57 5c 6c |...uos.&...g.W\l|
00000080 33 10 f3 43 b0 a0 c3 89 48 6f cf ff db 2a 66 30 |3..C....Ho...*f0|
00000090 92 14 26 8c 60 7e f5 df 40 21 28 56 6c 57 be 57 |..&.`~..@!(VlW.W|
000000a0 a2 bf 0c 35 c4 0d 5f 8c 79 a6 9a ea 10 65 57 2f |...5.._.y....eW/|
000000b0 b1 f8 09 e9 63 a3 11 7d 04 f2 99 4b 8e 09 1c b5 |....c..}...K....|
000000c0 bb ff ee 80 8a 18 77 73 f7 4b 4c 03 8e 1c 67 45 |......ws.KL...gE|
000000d0 98 42 1b e6 a4 11 ef 65 df 91 8d eb 87 7c aa 96 |.B.....e.....|..|
000000e0 42 06 a0 e2 6c b9 81 68 84 5f 6b 7a 6f 54 50 1d |B...l..h._kzoTP.|
000000f0 a3 f7 8f c1 21 c9 8f 0d 9b a4 bd e7 b7 76 45 7f |....!........vE.|
00000100 60 bf 88 f4 24 ad a2 2b 85 bf 3b 6d 4e 72 b4 4e |`...$..+..;mNr.N|
00000110 f4 03 2c 6d 81 4a 78 43 f2 f2 09 78 10 0b 48 8d |..,m.JxC...x..H.|
00000120 1a 63 16 dc fd e9 cb c7 ce 40 f2 fd 27 cd 5a 59 |.c.......@..'.ZY|
00000130 9e 7f e1 b7 3a d5 a9 2a 7e 89 1c 4b 3f 9f f3 93 |....:..*~..K?...|
00000140 49 13 3f ce 87 1d 40 70 69 65 2a 1f 12 13 87 2b |I.?...@pie*....+|
00000150 dc 02 99 19 7a 2f 17 5e 6f 02 94 18 de 14 1d 7e |....z/.^o......~|
00000160 50 33 d4 38 d5 92 9d 08 62 3b 1e fd b8 cb 5a c6 |P3.8....b;....Z.|
00000170 bd 35 d4 de f4 6b dc ca e4 eb 0d a2 50 04 f4 02 |.5...k......P...|
00000180 c1 5e 42 97 |.^B.|
>>> Flow 12 (server to client)
00000000 00 00 01 40 66 c2 3c 75 cc 6e c1 dc 86 d8 36 bf |...@f.<u.n....6.|
00000010 98 4d 48 17 d2 ae ce de 51 62 66 1e 18 9a d0 83 |.MH.....Qbf.....|
00000020 32 29 a6 c4 37 d9 7b 8a 60 89 33 e1 51 0a 02 90 |2)..7.{.`.3.Q...|
00000030 73 ca 7c 5f 7b 22 a7 cb ad b8 9f 7f f5 fe 28 95 |s.|_{"........(.|
00000040 42 53 78 fa 3b 58 96 b9 22 2b 7f 92 fb b3 27 1f |BSx.;X.."+....'.|
00000050 c0 9e ca a3 b5 0e ba 3b 9a 98 28 db 80 6f 65 51 |.......;..(..oeQ|
00000060 b0 e0 f0 f7 58 d8 c7 ae 03 35 3e 27 c3 fd 29 c6 |....X....5>'..).|
00000070 e5 88 e1 64 0b c8 6e e0 3b 89 7f b0 e1 22 97 7c |...d..n.;....".||
00000080 5a 08 fc 67 83 a7 4a 4e fa 6b a2 43 68 1d 16 82 |Z..g..JN.k.Ch...|
00000090 07 24 48 ca b0 fa 44 0c 3d 81 1b ea 63 3a a2 40 |.$H...D.=...c:.@|
000000a0 36 a3 36 a2 ef a4 b8 0e 0a 97 35 0b 43 9e 5e c5 |6.6.......5.C.^.|
000000b0 b5 52 17 d1 0e 63 84 90 e3 82 a9 1d 29 67 91 2c |.R...c......)g.,|
000000c0 23 75 13 a4 7a bb f4 02 18 ac 63 02 f4 ec c3 53 |#u..z.....c....S|
000000d0 a9 52 bd bc 8d a5 cf 69 4b c5 36 9e 02 f8 47 29 |.R.....iK.6...G)|
000000e0 ad be bd 06 41 c7 bd b9 e5 a0 8f 82 ee 57 06 4d |....A........W.M|
000000f0 86 1d 3b ea 63 13 f2 e4 65 8d 50 10 1c 4b f0 0a |..;.c...e.P..K..|
00000100 22 04 3d 45 c5 d9 7d 96 47 00 bb dd ef dd cb f6 |".=E..}.G.......|
00000110 cb 50 83 f6 ef 43 9a ec 52 15 24 05 1e f9 45 fb |.P...C..R.$...E.|
00000120 77 c2 4d 9d 63 88 7b 79 5d 4b 26 83 ac 0a 3b 1e |w.M.c.{y]K&...;.|
00000130 68 96 d4 c8 3e 05 c5 f6 1c 2a 7a 55 cd 2c 57 00 |h...>....*zU.,W.|
00000140 2f e6 ed 38 e2 e2 3f 04 26 f1 88 f5 ba a7 4d 55 |/..8..?.&.....MU|
00000150 66 b8 fe 14 38 e8 9d fa 61 cb 20 91 40 71 1d 32 |f...8...a. .@q.2|
00000160 5e ec 27 1b |^.'.|
>>> Flow 13 (client to server)
00000000 00 00 02 80 9e c7 90 7d 44 f4 3c 3f 6f 44 dc 81 |.......}D.<?oD..|
00000010 06 f0 ff 14 b2 76 e6 f2 69 1f c8 e6 7c 8c 0a 8d |.....v..i...|...|
00000020 8d 3b c4 28 47 09 14 1f dd 5a 1c ce a7 19 8d 63 |.;.(G....Z.....c|
00000030 27 fb 97 ba 14 53 ad 41 0d 2c 42 6b 8a e9 29 8f |'....S.A.,Bk..).|
00000040 82 15 19 a1 70 80 b4 18 20 c8 2c aa c7 24 2b dd |....p... .,..$+.|
00000050 c3 c9 4e 0c 38 89 49 14 ac 63 bf b9 2a 1a ca 36 |..N.8.I..c..*..6|
00000060 fd f8 5d 53 b2 6b 9e 96 43 17 e8 1e 9a e4 cb dd |..]S.k..C.......|
00000070 f7 95 4b a5 c1 6a c5 6f 2e 75 ff f3 56 17 af 7a |..K..j.o.u..V..z|
00000080 77 88 98 34 c2 a3 07 51 91 61 16 90 85 5a d7 f2 |w..4...Q.a...Z..|
00000090 f7 a0 68 21 43 10 1b b0 50 51 cf c6 06 ec 1d d0 |..h!C...PQ......|
000000a0 2f f3 a4 7b e5 15 66 81 66 04 ce c0 00 68 ef 39 |/..{..f.f....h.9|
000000b0 d6 72 26 bc 13 8d 58 d6 ed 46 22 e3 34 52 66 f9 |.r&...X..F".4Rf.|
000000c0 ea 28 54 15 21 84 83 48 ed 51 8d d4 57 56 2a 10 |.(T.!..H.Q..WV*.|
000000d0 71 6c 7f d2 76 72 6b 26 72 91 fc 2a e5 ff 0b 6c |ql..vrk&r..*...l|
000000e0 1d f3 1d 82 ac 45 97 ac 28 6e 67 f6 df bc 5b 16 |.....E..(ng...[.|
000000f0 35 2f aa 41 88 47 9d 30 52 ca 6e a9 bf 9f db a8 |5/.A.G.0R.n.....|
00000100 0c 42 cb f1 b2 29 99 44 e7 54 3e 09 da 4e a5 37 |.B...).D.T>..N.7|
00000110 70 e2 07 7f 5c 31 71 22 3d d4 76 72 28 c1 20 f4 |p...\1q"=.vr(. .|
00000120 21 bc 34 ca 25 9d b5 95 9e 96 15 65 b3 23 91 2a |!.4.%......e.#.*|
00000130 ed a9 95 dd df 5d ae 16 e9 9a 35 ec a8 9f ec 46 |.....]....5....F|
00000140 cf 81 5f 6b 22 f7 43 d2 e1 29 7e 10 75 9e cb 19 |.._k".C..)~.u...|
00000150 3e 3a 17 28 7f 50 8d 2a 96 c4 ef 98 ab f8 57 a7 |>:.(.P.*......W.|
00000160 1e 9d 6a 22 19 0b c5 a3 d2 de 16 82 2c c4 11 de |..j"........,...|
00000170 16 e4 89 fc 63 3d af 52 d7 d4 24 67 f2 a7 12 4d |....c=.R..$g...M|
00000180 bb 97 55 dd 6c 10 dc f0 72 ee 7a 5d dd 81 06 62 |..U.l...r.z]...b|
00000190 de 5a c4 f2 c5 28 e7 c4 fb 9e 35 59 c0 5b 2c b3 |.Z...(....5Y.[,.|
000001a0 66 ec 11 df 1e ff 6a bf a8 82 41 2c f6 6d 98 cc |f.....j...A,.m..|
000001b0 d4 30 38 93 15 86 05 4e 93 32 aa fa ec 28 d2 0b |.08....N.2...(..|
000001c0 6b df 90 2b 97 56 60 0d 14 c0 d7 ec bf be 6d fb |k..+.V`.......m.|
000001d0 e9 18 62 27 a9 c4 e2 ff 98 87 d6 67 0a cc ae f1 |..b'.......g....|
000001e0 53 5e 51 df e3 49 f7 0c b9 b7 c8 d3 e2 77 11 15 |S^Q..I.......w..|
000001f0 84 4f 33 5a 7d 7c 8c ff f3 f4 56 ef 79 2d 46 c7 |.O3Z}|....V.y-F.|
00000200 7f 16 0e 88 57 8d 8a 0c a4 92 21 f8 d6 76 a7 9b |....W.....!..v..|
00000210 af bf 55 11 7f f4 ff 55 0e 2a 03 5c 99 01 55 da |..U....U.*.\..U.|
00000220 c6 8d 39 17 57 58 c0 c8 c7 8c 81 e6 ca a7 70 fe |..9.WX........p.|
00000230 57 ea c2 8a dc e7 fa a2 ee 7c 5c 07 53 df fb 99 |W........|\.S...|
00000240 aa 67 34 5f 6d 38 82 45 9d c8 ab c9 17 f2 80 70 |.g4_m8.E.......p|
00000250 41 cd bb 7f f0 ff 20 8b aa ac ba 1b 8c f4 90 b3 |A..... .........|
00000260 e4 98 7c 2a eb a2 16 16 c2 27 c1 54 9f 80 c2 c8 |..|*.....'.T....|
00000270 d0 91 e3 89 e6 90 8d a0 40 c9 5f eb a5 a5 89 b4 |........@._.....|
00000280 d9 c8 2e 5e 40 ab 35 a8 3f 3a bc bc af aa ba e6 |...^@.5.?:......|
00000290 94 97 2e 83 6e 1a b0 e0 b7 d4 3c 6c c4 3a bf ae |....n.....<l.:..|
000002a0 00 62 f1 25 |.b.%|
>>> Flow 14 (server to client)
00000000 00 00 00 10 9a cb e8 50 5a fa b7 db f6 2a 92 99 |.......PZ....*..|
00000010 3e c5 a8 26 39 35 50 b0 4c b6 f1 75 7c ce d4 90 |>..&95P.L..u|...|
00000020 0c 9a 84 73 e3 be ac c2 79 7d ed 65 bd 31 f8 0a |...s....y}.e.1..|
00000030 25 d1 03 7e |%..~|
+295
View File
@@ -0,0 +1,295 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 5c 05 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...\....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 0a 61 65 73 32 35 36 2d 63 74 72 00 00 00 0a |..aes256-ctr....|
00000150 61 65 73 32 35 36 2d 63 74 72 00 00 00 6e 68 6d |aes256-ctr...nhm|
00000160 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 |ac-sha2-256-etm@|
00000170 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
00000180 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 |-sha2-512-etm@op|
00000190 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000001a0 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 |ha2-256,hmac-sha|
000001b0 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 2c |2-512,hmac-sha1,|
000001c0 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 00 6e |hmac-sha1-96...n|
000001d0 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 |hmac-sha2-256-et|
000001e0 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d |m@openssh.com,hm|
000001f0 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 |ac-sha2-512-etm@|
00000200 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
00000210 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 |-sha2-256,hmac-s|
00000220 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 |ha2-512,hmac-sha|
00000230 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 |1,hmac-sha1-96..|
00000240 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 |..none....none..|
00000250 00 00 00 00 00 00 00 00 00 00 00 d7 3b 80 93 f6 |............;...|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 b9 f9 b6 c4 ed 7e 18 3f 94 37 |...........~.?.7|
00000010 5b 4a d6 e0 42 bc 00 00 01 7a 73 6e 74 72 75 70 |[J..B....zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 13 cf b6 0f c2 c9 |...,..... ......|
00000010 08 d9 7b f6 60 d4 53 7f 4b b1 29 37 59 98 3c dd |..{.`.S.K.)7Y.<.|
00000020 ab b1 51 12 94 92 eb 56 4c 6f e8 a3 63 9c a8 a1 |..Q....VLo..c...|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 dc b4 2e a2 97 2c 11 80 39 31 |..... .....,..91|
00000080 ff f8 28 cb 42 d6 59 49 6b 25 4c ff a8 b2 88 3f |..(.B.YIk%L....?|
00000090 59 5c 08 1d 50 5f 00 00 00 64 00 00 00 13 65 63 |Y\..P_...d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 21 00 fd 1e a5 2f 00 a1 |6...I...!..../..|
000000c0 3a da d5 57 e0 57 81 e4 72 06 53 63 20 41 e8 51 |:..W.W..r.Sc A.Q|
000000d0 b1 f8 70 0a c7 dd 45 c9 53 d1 00 00 00 20 2f 0e |..p...E.S.... /.|
000000e0 42 dd ff 31 fd 52 a0 5e d5 fd f1 3f 02 a6 9d 4b |B..1.R.^...?...K|
000000f0 72 60 05 64 a8 c9 5d dc 38 03 2b 45 11 ec 00 00 |r`.d..].8.+E....|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 29 e3 86 8d |...........@)...|
00000120 8a 4f dc fc 5e d4 a5 fd 8f 31 49 e5 fb e5 94 a3 |.O..^....1I.....|
00000130 3e 01 06 15 a7 61 49 1a ff b4 7d 3e ef c6 ef cc |>....aI...}>....|
00000140 a4 9d 2d e8 79 1f cd c5 61 b3 8c df 52 00 94 ba |..-.y...a...R...|
00000150 90 91 38 65 5e 4e fb f3 6c cb dc ca be 2a ad 68 |..8e^N..l....*.h|
00000160 3d 23 06 8a 7f c4 71 b8 55 6c af 83 57 91 40 fd |=#....q.Ul..W.@.|
00000170 bd e6 4e e3 fd 48 0d 11 50 b2 91 b9 ac 7d 39 7f |..N..H..P....}9.|
00000180 96 fe 88 c3 e8 e3 49 76 df 8e 33 13 63 84 35 75 |......Iv..3.c.5u|
00000190 13 5a ea 45 0f e0 28 82 c5 01 73 78 31 7b de 08 |.Z.E..(...sx1{..|
000001a0 b2 c9 e4 ab f9 40 df 8a 04 a5 58 b9 cb b6 5c 12 |.....@....X...\.|
000001b0 53 07 e3 53 83 24 43 76 5b 66 e1 fe b9 df 48 f0 |S..S.$Cv[f....H.|
000001c0 36 82 95 d7 21 5b 07 84 d5 f6 06 f6 19 79 a8 9d |6...![.......y..|
000001d0 3d d7 6c 06 6e 0b c8 05 aa 50 43 7b 97 ae 78 c8 |=.l.n....PC{..x.|
000001e0 24 d5 af 7f 6f 6b 75 9f 9b e3 b2 00 74 b3 28 8f |$...oku.....t.(.|
000001f0 3d 0e e3 27 c6 34 8d 06 1f 5d d7 9e 7f 72 ec 84 |=..'.4...]...r..|
00000200 f9 bb 1f 7e a7 84 be 9d 47 a8 26 39 1b df be bb |...~....G.&9....|
00000210 66 5e 93 88 81 97 aa dc 4c 25 18 0f 84 e7 e2 c2 |f^......L%......|
00000220 96 c4 55 1b 76 75 84 b2 06 9c 00 4f 11 2b 91 d0 |..U.vu.....O.+..|
00000230 cb 05 ba f5 9d d9 42 cd bc 83 e7 dc e1 2a be 90 |......B......*..|
00000240 9a 68 b1 45 e4 e2 ac 7e 1e 5a de 1a 90 38 ea c1 |.h.E...~.Z...8..|
00000250 f2 2a ff 52 d6 13 06 f9 58 9e d6 14 49 9b 11 b5 |.*.R....X...I...|
00000260 8a 39 a3 d9 2e e4 3d 31 d4 29 53 50 cd 91 19 db |.9....=1.)SP....|
00000270 b8 fd 5a 75 c7 55 11 72 0e c7 22 13 |..Zu.U.r..".|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 e3 f9 ae 57 e2 35 b8 cc 87 3c |.........W.5...<|
00000010 00 00 00 20 b7 cd e5 1e 32 4c af 0d 14 b0 15 9c |... ....2L......|
00000020 28 f1 f9 23 ab 40 ef 2a 61 e3 b5 14 e8 28 ff bf |(..#.@.*a....(..|
00000030 94 a0 19 88 b8 4b a1 e4 bf de f1 bf e8 45 99 18 |.....K.......E..|
00000040 ab 42 06 0f 9a 8e 49 9e e0 92 a5 89 b8 fa 0c c5 |.B....I.........|
00000050 b4 6a 5e 44 |.j^D|
>>> Flow 8 (server to client)
00000000 00 00 00 20 a7 59 4a e8 1f ed d6 91 0c fd 51 fe |... .YJ.......Q.|
00000010 f8 b1 81 7c 21 fe de 37 0d 29 6c c4 06 4c d5 48 |...|!..7.)l..L.H|
00000020 59 50 54 35 aa 62 1f 45 1c ba 71 37 24 d4 4c 09 |YPT5.b.E..q7$.L.|
00000030 15 14 35 6e 93 99 6c f7 2b 7b 0e 60 1c 3e 9d 46 |..5n..l.+{.`.>.F|
00000040 98 b6 bd b5 |....|
>>> Flow 9 (client to server)
00000000 00 00 00 30 db 4f da 1a 98 a1 d5 a0 35 44 5f ca |...0.O......5D_.|
00000010 61 62 cc b5 6b 67 d5 ac 57 67 10 1c 11 b9 8d 46 |ab..kg..Wg.....F|
00000020 1c ff 4c 9c 76 cd 32 93 46 47 bd 6c 50 b3 16 b8 |..L.v.2.FG.lP...|
00000030 91 82 0c e6 d0 a9 07 0a b3 a2 56 87 be 97 10 3c |..........V....<|
00000040 04 99 37 e4 a2 af 47 f0 21 a3 54 fb 0a 50 f8 3b |..7...G.!.T..P.;|
00000050 70 13 c4 79 |p..y|
>>> Flow 10 (server to client)
00000000 00 00 00 20 ef a1 05 ef bf d2 8b bc 40 f3 71 ca |... ........@.q.|
00000010 64 f7 bb 7b 49 56 e8 9e 4f d6 7f 25 4e 81 c3 b0 |d..{IV..O..%N...|
00000020 f9 af 58 40 5e 7e 77 d4 05 c7 c5 9f bd d5 18 fb |..X@^~w.........|
00000030 2c 29 c5 0d 9f 94 21 7c 9c f3 2a 3a 09 31 ad ac |,)....!|..*:.1..|
00000040 08 40 75 d9 00 00 00 40 0c bc d9 17 fc 1b a9 28 |.@u....@.......(|
00000050 1e 5b 51 30 f1 4c 33 31 74 93 21 21 3a b1 3a f8 |.[Q0.L31t.!!:.:.|
00000060 75 41 8d c4 4d 06 96 85 5c 73 d4 b0 26 0b e4 37 |uA..M...\s..&..7|
00000070 80 26 8f 7c 1a 59 61 bd 99 04 0d a9 5e e5 50 fc |.&.|.Ya.....^.P.|
00000080 bc f7 fd 8d 1e 69 9a 83 e8 62 bb 23 bf 1a 40 d2 |.....i...b.#..@.|
00000090 d5 e7 ed e1 c3 da 97 a3 69 ff de 3f 89 d4 a6 8b |........i..?....|
000000a0 63 09 2c 7c 7c ea bc 34 |c.,||..4|
>>> Flow 11 (client to server)
00000000 00 00 01 60 9a dc 8b 51 bb ac d1 45 74 61 ed 7a |...`...Q...Eta.z|
00000010 f2 cb 8a 43 39 a0 c1 74 93 3b d5 69 06 8e b7 ee |...C9..t.;.i....|
00000020 d2 0f 44 a5 b2 66 5d 1d 9e b3 37 9c d3 fc 55 61 |..D..f]...7...Ua|
00000030 1a 04 00 d3 37 e0 c1 cc 53 c4 eb 22 12 4c 02 f7 |....7...S..".L..|
00000040 98 d0 16 c0 3e af bb d9 2d ec 97 e0 39 d6 6b a5 |....>...-...9.k.|
00000050 9f af f9 20 97 01 30 af d5 cd 58 71 36 81 24 6a |... ..0...Xq6.$j|
00000060 24 95 88 20 fb dc 62 97 82 97 e1 a4 09 f6 8b 1b |$.. ..b.........|
00000070 b5 ab 28 b4 6f d1 0b 67 40 76 cc 07 44 98 d9 d5 |..(.o..g@v..D...|
00000080 ca d0 ef bf 8d 5f 47 27 3d 68 63 f1 05 12 da 04 |....._G'=hc.....|
00000090 66 9d 53 57 09 b0 6a 92 3c 0a bd da 2e 85 96 50 |f.SW..j.<......P|
000000a0 13 43 19 c3 8e fc 33 44 3b b4 6a dd 2e 9c f5 fb |.C....3D;.j.....|
000000b0 35 ac a1 96 85 81 bc 65 59 7b e0 8d 2a c5 bf 40 |5......eY{..*..@|
000000c0 0b c9 59 62 35 e9 0d bc 41 86 9e 5e ab 28 45 42 |..Yb5...A..^.(EB|
000000d0 7c c6 9f 40 0a 6c 30 06 f7 9c f3 2c 64 86 be cc ||..@.l0....,d...|
000000e0 7f 51 04 e9 f2 86 7d 4b 1b e8 b9 10 ad 7c e3 35 |.Q....}K.....|.5|
000000f0 34 a4 9c 80 fe a9 03 ce 85 de 6e 67 f3 9f ad 8a |4.........ng....|
00000100 d0 3b 61 db 6c 96 af 22 cb b2 e5 20 9a 8e 58 d8 |.;a.l.."... ..X.|
00000110 15 5d 11 47 20 f1 8c 7a d2 0f b0 be d9 14 49 89 |.].G ..z......I.|
00000120 8a 37 c4 12 ff 6f 92 78 01 ff 59 dc 50 a1 8c 10 |.7...o.x..Y.P...|
00000130 c7 f6 91 da 5e 0b dd b7 18 93 9f fe 0d 07 af ec |....^...........|
00000140 79 a1 2a 03 03 a8 e4 83 60 44 e5 21 d4 24 54 8f |y.*.....`D.!.$T.|
00000150 4f 18 71 68 9d 53 ad bc 72 18 82 bf 6c 8b ca d9 |O.qh.S..r...l...|
00000160 f2 3a b7 bd 3c 0d 46 0b bb 6a 38 83 ee fa 19 62 |.:..<.F..j8....b|
00000170 07 bf 09 38 fa d5 94 06 0f 8e 93 fa 82 c3 fc 6e |...8...........n|
00000180 39 aa df e4 |9...|
>>> Flow 12 (server to client)
00000000 00 00 01 40 be 1d 0f a6 fb 0e ab e1 7e e6 60 1d |...@........~.`.|
00000010 ab ed 8f dd f6 36 f3 d9 28 01 8d 51 5a 2d bd 30 |.....6..(..QZ-.0|
00000020 94 8b c3 8b d7 d0 8d 6c 85 6a 26 7f 1f 3e 44 48 |.......l.j&..>DH|
00000030 f8 8b d2 47 da 8d 18 26 3a 2f 7c 4f 2f 49 34 89 |...G...&:/|O/I4.|
00000040 c9 ec 9b 72 1c 3d 22 c1 b5 0f 7c 6a 1e e7 f1 a6 |...r.="...|j....|
00000050 59 9f aa af 06 1d 54 51 55 4f ab a3 a9 98 f0 e1 |Y.....TQUO......|
00000060 0a 72 fe 06 71 e6 b5 ce 81 71 5c d9 32 00 0e dc |.r..q....q\.2...|
00000070 a4 a8 e8 94 6e de 3f 7d 01 81 59 d3 31 92 e1 a0 |....n.?}..Y.1...|
00000080 a8 e2 43 24 cb a9 50 b7 19 ee 88 eb 1a b6 c5 68 |..C$..P........h|
00000090 38 b3 58 6f 5b fb 1b 94 8d 53 8d 03 8b 0c 6d 6f |8.Xo[....S....mo|
000000a0 7d 22 44 e5 ed ec 5a d4 b9 f5 b6 71 7f e6 69 4f |}"D...Z....q..iO|
000000b0 1a 5d 41 07 e0 68 d4 39 4a 71 1d 45 23 42 6b 9d |.]A..h.9Jq.E#Bk.|
000000c0 51 37 4c 08 cd 07 6e 6a 7f fc af 54 57 cc f9 f9 |Q7L...nj...TW...|
000000d0 a1 f8 b9 43 fe ef 10 7e 08 2a 84 a7 cc c6 fa 10 |...C...~.*......|
000000e0 36 4a 3c cf 5c 88 42 0b 9f c5 99 18 0f 4f 7f 4b |6J<.\.B......O.K|
000000f0 4b cf dc d7 45 6b f2 73 20 20 7a 05 4a 2e 91 9a |K...Ek.s z.J...|
00000100 9d 9b 11 b9 d1 8b 42 e8 b4 5e 37 47 af 6a bf d7 |......B..^7G.j..|
00000110 c0 fc b1 0b 9f bb 37 e1 dc bc 87 61 0b d4 a4 ff |......7....a....|
00000120 60 09 0c ed 58 de f3 d6 75 e5 50 37 cc ce da fc |`...X...u.P7....|
00000130 db d5 c3 fe 10 6b 82 f2 20 60 1e 2c a1 85 cb df |.....k.. `.,....|
00000140 13 5b b3 34 ae 0c 6c 47 63 d1 a5 4a f0 a4 6d cd |.[.4..lGc..J..m.|
00000150 27 49 b3 f4 64 d8 ad f1 d5 98 b5 ad eb be 00 1f |'I..d...........|
00000160 87 f4 db aa |....|
>>> Flow 13 (client to server)
00000000 00 00 02 80 a3 75 dd 61 db 5d ec c8 01 75 ed 65 |.....u.a.]...u.e|
00000010 40 8e d8 3b 85 28 d5 8e 14 c3 dc 3f e6 f5 78 35 |@..;.(.....?..x5|
00000020 50 41 cf 9d 0e d4 e2 de bf d5 31 12 3f ea da d6 |PA........1.?...|
00000030 bf 7d 0e 77 80 eb 0f 8c 6e 93 61 20 4b be 31 0b |.}.w....n.a K.1.|
00000040 45 83 08 93 cd c1 da 70 b5 6c f0 9a 34 f7 a4 86 |E......p.l..4...|
00000050 19 63 a8 39 82 9b 58 a8 15 88 6e 6d 11 0d e1 f9 |.c.9..X...nm....|
00000060 34 41 39 26 3c 1a d6 9c 94 fe 40 55 44 7d b7 87 |4A9&<.....@UD}..|
00000070 0c 72 5c 1e e5 fb 5c f5 9a f7 c7 fa 64 47 79 8e |.r\...\.....dGy.|
00000080 e2 b3 9c 67 19 27 85 c5 2c 1b 65 47 32 20 e8 14 |...g.'..,.eG2 ..|
00000090 82 d4 f4 3d bc 3c 12 f1 6c 96 05 80 53 d0 9f 77 |...=.<..l...S..w|
000000a0 a6 58 8e 01 a3 dc 65 4b 11 ff 1c 21 66 98 c4 9a |.X....eK...!f...|
000000b0 c3 44 d5 fe 5d bd fd 77 ad ab a0 96 73 81 87 34 |.D..]..w....s..4|
000000c0 47 6d 98 2f 3f 8d 10 ea d3 9f 25 62 b4 e7 7b e6 |Gm./?.....%b..{.|
000000d0 b9 1c 0d 3b 32 d5 85 a0 40 5f c7 c1 92 f9 9a 7f |...;2...@_......|
000000e0 11 93 f7 9e d8 60 5e 93 17 d8 07 aa 3c eb fa d3 |.....`^.....<...|
000000f0 85 8f e5 34 8b a1 23 3b 03 b4 8d 2d 71 1d 20 6d |...4..#;...-q. m|
00000100 d1 04 13 fb 9c dd 0d b5 4b 8c 85 47 55 5f 72 c7 |........K..GU_r.|
00000110 66 43 35 5a b5 d8 26 94 fa 83 0d 45 47 a3 47 9b |fC5Z..&....EG.G.|
00000120 72 5c 96 78 94 37 49 2a ca e7 59 9f 34 aa 2d df |r\.x.7I*..Y.4.-.|
00000130 f7 95 82 b7 b9 52 dc ea a4 72 a4 60 23 ab 4a 3a |.....R...r.`#.J:|
00000140 1a fc 56 ae e4 39 6e da f3 00 f6 18 7a 45 48 46 |..V..9n.....zEHF|
00000150 a2 ad 06 86 6b d2 e1 02 4c f8 e0 84 cc 09 07 cd |....k...L.......|
00000160 b5 6c 12 58 14 7b a1 b6 a1 72 eb 89 75 22 3f 2d |.l.X.{...r..u"?-|
00000170 11 a4 61 4b cb c0 2f 4a 67 52 f5 3a 58 5b 34 63 |..aK../JgR.:X[4c|
00000180 5d d0 01 d1 af 8d d3 26 2c 97 41 81 ee 22 5b 5a |]......&,.A.."[Z|
00000190 3e e0 f2 08 64 52 4d b7 4a cf 49 69 ac 1d 6c 55 |>...dRM.J.Ii..lU|
000001a0 2f 58 c3 e6 7c 72 91 80 94 51 83 40 56 ab cc 70 |/X..|r...Q.@V..p|
000001b0 bd 48 1c e2 1d ef 4f 00 b9 bd ce e4 f0 be 17 9e |.H....O.........|
000001c0 3f e0 ae 36 f4 f5 2a 59 5f e6 62 77 e3 3e 59 2c |?..6..*Y_.bw.>Y,|
000001d0 5a 8d b1 22 7d 37 ef a3 ae 9c 7a a4 ab 90 e9 81 |Z.."}7....z.....|
000001e0 2e 3f 29 2b 67 d6 7b 36 1c 12 62 16 03 62 3d 51 |.?)+g.{6..b..b=Q|
000001f0 bc 0a 71 25 d9 0a 98 51 4c a0 53 aa cf 61 20 56 |..q%...QL.S..a V|
00000200 a0 03 5a 70 cd 2b 2a 74 90 16 bb de 54 c0 5f 82 |..Zp.+*t....T._.|
00000210 f4 43 e7 d1 69 b9 69 a4 a8 14 92 6a 97 3b bf e5 |.C..i.i....j.;..|
00000220 5a f6 45 d2 2e cc 6e b2 a9 68 d5 7f 86 0d d8 e9 |Z.E...n..h......|
00000230 9d e3 bd 22 1a 5e cd 1a fd 64 b1 61 9a fe 41 16 |...".^...d.a..A.|
00000240 e0 7a 6b 30 a0 35 99 9d 1e 77 e0 03 44 f7 b3 6c |.zk0.5...w..D..l|
00000250 ee 22 a7 b8 4c 2c 26 4c 30 c7 a0 38 66 66 45 0d |."..L,&L0..8ffE.|
00000260 7f 63 aa 36 e5 07 96 0c 16 14 fb 95 62 f9 41 a7 |.c.6........b.A.|
00000270 aa 2b 6c 19 7d f6 da f2 21 e8 62 a1 cb ce f6 8c |.+l.}...!.b.....|
00000280 d6 75 43 c9 ea f8 7b 7b ed 37 10 b4 4b 3a b9 81 |.uC...{{.7..K:..|
00000290 0f 67 ba 13 e9 d5 7a 41 f4 f8 98 0b ea f6 6b 20 |.g....zA......k |
000002a0 2f f0 a1 0d |/...|
>>> Flow 14 (server to client)
00000000 00 00 00 10 3f 5d 35 f7 01 4c 70 e9 30 90 09 84 |....?]5..Lp.0...|
00000010 b0 ec 12 34 93 9d 81 4d f4 34 83 37 62 ef 31 a5 |...4...M.4.7b.1.|
00000020 d3 03 ce 5d dd 58 1d 5d 0f a5 7c 65 db c9 c2 24 |...].X.]..|e...$|
00000030 c8 35 8e 77 |.5.w|
+287
View File
@@ -0,0 +1,287 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 7c 0d 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...|....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 16 61 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 |..aes256-gcm@ope|
00000150 6e 73 73 68 2e 63 6f 6d 00 00 00 16 61 65 73 32 |nssh.com....aes2|
00000160 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 |56-gcm@openssh.c|
00000170 6f 6d 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d |om...nhmac-sha2-|
00000180 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e |256-etm@openssh.|
00000190 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 |com,hmac-sha2-51|
000001a0 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |2-etm@openssh.co|
000001b0 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
000001c0 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
000001d0 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 |ac-sha1,hmac-sha|
000001e0 31 2d 39 36 00 00 00 6e 68 6d 61 63 2d 73 68 61 |1-96...nhmac-sha|
000001f0 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-256-etm@openss|
00000200 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d |h.com,hmac-sha2-|
00000210 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e |512-etm@openssh.|
00000220 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 |com,hmac-sha2-25|
00000230 36 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c |6,hmac-sha2-512,|
00000240 68 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 |hmac-sha1,hmac-s|
00000250 68 61 31 2d 39 36 00 00 00 04 6e 6f 6e 65 00 00 |ha1-96....none..|
00000260 00 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 |..none..........|
00000270 00 00 00 d7 3b 80 93 f6 ef bc 88 eb 1a 6e ac fa |....;........n..|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 03 91 97 87 a7 dc fc 58 9c f9 |.............X..|
00000010 12 c3 72 62 44 c3 00 00 01 7a 73 6e 74 72 75 70 |..rbD....zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 7e 4a 3b cc bf 9a |...,..... ~J;...|
00000010 2e 84 5f cb bb 32 fa b6 67 2f 28 60 b3 d3 48 e8 |.._..2..g/(`..H.|
00000020 f9 c9 38 6f ae b4 a3 c4 5b 73 ae 57 e2 35 b8 cc |..8o....[s.W.5..|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 6f 1c 0a 10 b7 60 53 0b e1 9e |..... o....`S...|
00000080 ef 53 02 0f 90 c5 91 92 17 e2 5f be 6a 69 7b f3 |.S........_.ji{.|
00000090 b9 d0 fa 44 a4 0f 00 00 00 64 00 00 00 13 65 63 |...D.....d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 20 2d 84 a6 de 6c 7f 15 |6...I... -...l..|
000000c0 62 4e 01 3f b2 e3 d5 d0 49 6c d4 49 ba 88 91 50 |bN.?....Il.I...P|
000000d0 65 12 77 52 fd 05 06 5a e4 00 00 00 21 00 f5 50 |e.wR...Z....!..P|
000000e0 28 ab 99 21 48 6a a1 dc 58 1e b4 d4 3c 3c c2 1a |(..!Hj..X...<<..|
000000f0 55 41 da 44 38 57 05 ce eb 03 1a 5b 6d 3b 00 00 |UA.D8W.....[m;..|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 b6 4c c2 9f |...........@.L..|
00000120 41 92 5c 10 ee c9 55 48 4a f5 42 da ff 2b c6 34 |A.\...UHJ.B..+.4|
00000130 b7 8d 3f 48 a3 f1 61 57 dc 5b f9 f2 3a bc 19 14 |..?H..aW.[..:...|
00000140 31 72 fc 1e fb 12 c6 1f cf c6 ee 5c 3b b4 e8 d0 |1r.........\;...|
00000150 b5 1a f4 ef 1f a8 40 68 2d 99 10 17 97 83 b7 35 |......@h-......5|
00000160 6e e9 81 0e 54 ad d2 05 2a 50 c1 36 0c b9 af c9 |n...T...*P.6....|
00000170 cc 27 30 ac ea 70 65 7a e8 2b 0d 82 9a 60 b2 09 |.'0..pez.+...`..|
00000180 3b fb 55 8b e3 2a c3 27 bb ba d0 40 5b d3 4b 94 |;.U..*.'...@[.K.|
00000190 59 59 0b 23 ec 55 cd fb 70 9a eb f1 54 cb 83 8f |YY.#.U..p...T...|
000001a0 d0 52 fb 3c 59 0e 49 7e 8b 5d 9a 1a f9 0b 85 2a |.R.<Y.I~.].....*|
000001b0 e5 2e 0a 45 62 9a 6b a1 d1 b0 c9 75 d0 5e bd 7d |...Eb.k....u.^.}|
000001c0 16 94 af 23 f1 76 8b 1c 12 68 7b d6 f7 b1 fa 01 |...#.v...h{.....|
000001d0 29 37 0a f5 01 5b 9c 90 70 8b 7c 83 8f 07 0e 00 |)7...[..p.|.....|
000001e0 7e d4 29 54 ab 84 a9 11 60 88 0f 0d 00 6b c8 44 |~.)T....`....k.D|
000001f0 1d 31 e0 8f 1e 14 19 ee 08 6b 9d 7f 95 49 2b e7 |.1.......k...I+.|
00000200 a3 d2 0a 2b 1f 78 8f 2d 49 1f a8 b1 af ba a4 fd |...+.x.-I.......|
00000210 63 bc 4c 74 ab 34 28 de f7 ec 3c fb 33 94 a7 a1 |c.Lt.4(...<.3...|
00000220 12 26 aa e7 fe 08 b1 d6 74 34 d8 3b ee 39 32 c0 |.&......t4.;.92.|
00000230 eb c8 89 56 cc aa 15 79 8c 48 f7 14 da 4f b4 f7 |...V...y.H...O..|
00000240 0b 87 18 95 92 58 63 eb 6d 07 00 9f 35 16 b8 a5 |.....Xc.m...5...|
00000250 88 99 d6 da ba d2 e6 44 f2 b7 4d b5 4c 6d 94 ce |.......D..M.Lm..|
00000260 f8 93 c1 41 bc cc 43 70 79 08 cf 9f |...A..Cpy...|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 87 3c 23 dc 62 b8 d2 60 16 9a |.......<#.b..`..|
00000010 00 00 00 20 7c 71 d9 dc 5d cc a9 fd ae 24 a4 97 |... |q..]....$..|
00000020 41 b8 a5 d4 9a 32 d5 b7 f9 b7 e3 a1 38 2d 68 0d |A....2......8-h.|
00000030 bf 8a 17 14 6e 0d d7 d8 9a 4e 46 06 ca a5 b9 8e |....n....NF.....|
00000040 33 3d 14 3f |3=.?|
>>> Flow 8 (server to client)
00000000 00 00 00 20 d5 70 c2 d4 80 cb d1 bb e2 1d ff 1d |... .p..........|
00000010 db b1 8a a0 71 4d 9c a2 63 b9 56 0e 77 27 f5 58 |....qM..c.V.w'.X|
00000020 2a bd 6d 3d b3 4c 03 61 9f 4f b5 4d 00 40 83 58 |*.m=.L.a.O.M.@.X|
00000030 5c bb 23 03 |\.#.|
>>> Flow 9 (client to server)
00000000 00 00 00 30 37 f6 af dc 45 36 44 d6 4d ac 66 4c |...07...E6D.M.fL|
00000010 75 05 bb 94 58 cf 92 a1 a6 65 ae 74 f2 cd 57 fc |u...X....e.t..W.|
00000020 89 e0 6d 5a 1d 9f 0b 6c 91 af 66 0b dc f8 ff b6 |..mZ...l..f.....|
00000030 af 02 ff 3e ed 57 ec d4 59 00 76 42 d0 59 a3 c5 |...>.W..Y.vB.Y..|
00000040 52 b1 2b 16 |R.+.|
>>> Flow 10 (server to client)
00000000 00 00 00 20 79 bc 0a 5d f3 59 0d d6 11 6e c4 8c |... y..].Y...n..|
00000010 f1 ca 15 d2 fc 1f da 1b 63 5b b6 b5 ce 29 14 e6 |........c[...)..|
00000020 e4 98 cb b1 7f 47 4e c3 21 65 19 ea de 65 1f 53 |.....GN.!e...e.S|
00000030 98 9a 5e 7f 00 00 00 40 ae 3d 2e cc 14 74 18 4c |..^....@.=...t.L|
00000040 9b 82 c3 af 1c 24 75 89 1f 8f a4 db dd 41 2e 16 |.....$u......A..|
00000050 b8 56 b7 1e 3c 62 3b 48 96 97 6c f3 51 36 4a ec |.V..<b;H..l.Q6J.|
00000060 bb 82 95 e9 9e c3 5a ae ad 0c 40 a7 65 11 00 10 |......Z...@.e...|
00000070 eb 0a b3 db b3 53 57 8a 57 7b 38 b2 4e 32 72 10 |.....SW.W{8.N2r.|
00000080 d5 ae 40 99 15 98 f7 6c |..@....l|
>>> Flow 11 (client to server)
00000000 00 00 01 60 87 65 80 4e 94 61 76 b8 1d 06 ff 7c |...`.e.N.av....||
00000010 f2 89 9c ee 77 6a 38 f6 aa 17 d4 33 25 81 c2 91 |....wj8....3%...|
00000020 75 5b ae b8 15 c6 28 bc 98 9e 70 91 68 68 08 ae |u[....(...p.hh..|
00000030 6b 36 ea da 18 60 91 45 85 62 bf f6 23 a1 f0 4b |k6...`.E.b..#..K|
00000040 0b d2 02 e6 57 d1 5e 79 ef 6f 6a 72 b5 04 5b f5 |....W.^y.ojr..[.|
00000050 e1 d7 73 b2 f9 d9 21 65 fc 69 2d 02 1f c5 4c 78 |..s...!e.i-...Lx|
00000060 92 7b b6 da ff 88 19 f2 48 57 3e e5 e7 6b 79 74 |.{......HW>..kyt|
00000070 67 8d 65 f7 09 63 6f 04 0a e1 5e a1 c9 a0 83 2a |g.e..co...^....*|
00000080 69 fb 41 12 48 82 e9 71 5e 05 b2 23 44 87 c1 dc |i.A.H..q^..#D...|
00000090 7a d0 37 a6 bc 8d 45 39 37 c7 bf 91 14 8e e3 9b |z.7...E97.......|
000000a0 9c 47 4e e6 75 71 67 d9 cd 13 54 ca 08 5d 0f b6 |.GN.uqg...T..]..|
000000b0 79 2e fa 6f 13 a9 e5 d0 2e f7 05 a6 34 91 94 23 |y..o........4..#|
000000c0 fe b4 90 44 9b cf 53 ed b0 21 b5 5d c6 51 3a 93 |...D..S..!.].Q:.|
000000d0 9d 26 a5 47 f2 6c 01 98 c1 9b 15 ff cd 5a 7a a9 |.&.G.l.......Zz.|
000000e0 88 7c 32 3c e0 36 61 91 08 1e f3 d2 ca 8d d7 9d |.|2<.6a.........|
000000f0 28 9f bc c5 71 e0 ee 69 11 9d b9 a0 9b a4 e6 cc |(...q..i........|
00000100 57 29 48 ff bf ae 00 cc ef 25 bc 87 d4 d1 ec a8 |W)H......%......|
00000110 6e e4 5e 1b 4f a6 71 da 5f 0e b8 57 a5 72 bf 30 |n.^.O.q._..W.r.0|
00000120 0f 62 e2 da 76 01 92 67 a5 c5 5d d5 ec c3 e7 8f |.b..v..g..].....|
00000130 04 33 51 17 e3 46 4c 86 1c 03 26 0d e2 25 9b 80 |.3Q..FL...&..%..|
00000140 fe 99 63 a1 57 26 20 ed 20 0c 38 3a 3a e3 65 3a |..c.W& . .8::.e:|
00000150 98 e4 1b 76 05 f8 22 2e 8d f2 6e ec b3 ac ed 86 |...v.."...n.....|
00000160 b7 ab f9 b8 d5 5e c6 a5 08 fa 5e 14 48 24 02 52 |.....^....^.H$.R|
00000170 ca ab d6 9f |....|
>>> Flow 12 (server to client)
00000000 00 00 01 40 ab 28 ac fe d0 b6 a5 bb 27 a8 07 87 |...@.(......'...|
00000010 10 3f 81 13 69 32 61 02 d7 3a 1c d2 87 96 5c 84 |.?..i2a..:....\.|
00000020 87 5a b9 aa f4 f5 53 97 64 de 31 37 6f 96 ab 41 |.Z....S.d.17o..A|
00000030 71 f4 13 0c 2a 0c 97 c4 33 52 3c 45 84 de b2 d8 |q...*...3R<E....|
00000040 8c 45 91 00 ea a5 d6 61 e3 a1 55 de 9b 9f 0f 96 |.E.....a..U.....|
00000050 2f 1e 62 99 15 44 81 f7 4f aa 72 37 cf 1f 17 6e |/.b..D..O.r7...n|
00000060 38 40 5c 8f 2d b7 bc 5d de c0 2b f3 20 b0 e7 04 |8@\.-..]..+. ...|
00000070 64 54 f0 46 8d 97 22 47 26 be cd 9a 15 ed f3 66 |dT.F.."G&......f|
00000080 74 ff b1 6f 03 4d 0c 1a d3 d5 20 8e fc f5 ae 92 |t..o.M.... .....|
00000090 78 8c 76 74 cd 7c ad 2b e1 18 49 d3 80 af 26 e3 |x.vt.|.+..I...&.|
000000a0 78 1e 9c e2 1c 6b 32 a2 79 2e 8d 02 77 9e f7 05 |x....k2.y...w...|
000000b0 e8 97 52 c7 e9 0e a7 59 d9 8e 17 2d fc 42 3d 17 |..R....Y...-.B=.|
000000c0 0b 3a 73 e5 53 ca 52 70 df 77 24 55 3a c6 25 79 |.:s.S.Rp.w$U:.%y|
000000d0 ee 81 c8 bf 26 74 0b 2c 5f d6 10 16 fd f7 0d 63 |....&t.,_......c|
000000e0 89 0b 38 05 35 05 ed f6 66 75 17 38 0b 46 cd 10 |..8.5...fu.8.F..|
000000f0 63 0d 1e ba b9 d5 06 1a 77 20 1f 00 8d da f4 03 |c.......w ......|
00000100 3d 45 5f 0e 52 cc fb 98 ff b6 9b 6e c1 b6 0b 08 |=E_.R......n....|
00000110 61 c4 ba 99 e3 17 4b a2 fe f1 ae de 89 6c 0e a7 |a.....K......l..|
00000120 ed 58 a3 ff 74 eb 05 56 5d 3a a0 00 14 a5 f4 45 |.X..t..V]:.....E|
00000130 50 ec 4f de 9c 8f 97 97 09 39 47 1b 90 e3 d2 c9 |P.O......9G.....|
00000140 b8 00 aa 37 24 94 24 ae c1 18 cb 9d 43 c4 20 2d |...7$.$.....C. -|
00000150 34 8b 33 94 |4.3.|
>>> Flow 13 (client to server)
00000000 00 00 02 80 8b 2f be b2 46 70 97 b1 d1 3c 8b de |...../..Fp...<..|
00000010 53 82 86 33 ed 61 0d 2f bf 22 cd 98 93 2f 68 94 |S..3.a./.".../h.|
00000020 ed c0 3c 25 fc 82 fb 33 fa 03 16 5d 32 1a 87 4d |..<%...3...]2..M|
00000030 52 d5 c0 7f 1d 0d 3d 88 29 32 54 8a 31 b5 a7 18 |R.....=.)2T.1...|
00000040 17 0a 47 a2 98 70 c3 43 bb f8 31 1e 0d 19 c2 f0 |..G..p.C..1.....|
00000050 d5 f9 ff 70 5d d8 db cf 63 1f 49 fb d6 fe 0a 41 |...p]...c.I....A|
00000060 fc 86 f6 e9 18 11 04 21 db 11 82 1c 0e 23 90 11 |.......!.....#..|
00000070 b3 f5 90 64 f2 65 f6 35 ac a5 e3 99 ee 12 1d a2 |...d.e.5........|
00000080 9a db a7 1b e8 99 65 eb 92 a0 3d e5 bd da 5e 56 |......e...=...^V|
00000090 97 29 5c bb 7f 22 1e 0c 96 9c cc 1f 0f 07 f8 18 |.)\.."..........|
000000a0 f0 db 47 a4 6c 85 c5 3c ab df 84 4e 04 06 24 1c |..G.l..<...N..$.|
000000b0 84 cf 7c 13 90 81 9b 7e c9 56 43 66 ff 63 05 33 |..|....~.VCf.c.3|
000000c0 5c 70 2e 74 9a 8e ba 43 e2 61 65 67 2e e3 8b d2 |\p.t...C.aeg....|
000000d0 e0 47 80 61 66 ff 33 87 7e 97 b3 e9 1e 8d 9a 96 |.G.af.3.~.......|
000000e0 c9 ca e2 61 3e 28 ec 1d d5 18 72 65 57 44 fb 17 |...a>(....reWD..|
000000f0 ca 70 d6 26 87 d4 a0 42 2e 3f f7 a2 3e 93 08 1d |.p.&...B.?..>...|
00000100 ad b4 3f 7f 93 08 d0 6d 76 0b 2b 8b 2d ae 09 04 |..?....mv.+.-...|
00000110 f7 4d 02 0d ad 66 44 08 91 16 70 b1 98 b9 5a 86 |.M...fD...p...Z.|
00000120 5e 69 7d f3 0d 3d 9a 0c 08 f6 7d 66 87 ea 9a 0b |^i}..=....}f....|
00000130 60 43 f6 67 07 1c 37 41 54 65 c0 06 c1 b5 91 0c |`C.g..7ATe......|
00000140 83 49 ba 53 2f 87 bb 83 27 29 c8 7f 27 09 ba f2 |.I.S/...')..'...|
00000150 ac 77 e3 a5 71 b8 13 73 74 90 63 a7 89 ec e2 b6 |.w..q..st.c.....|
00000160 2c bf 3e ac 78 45 ec 48 3a 97 2a 63 74 35 04 55 |,.>.xE.H:.*ct5.U|
00000170 a7 16 c1 dd 1a 1b 9c ea f7 18 73 5d 8e 94 7e c1 |..........s]..~.|
00000180 15 49 5c fd 2f 0e b0 40 e4 22 e1 38 0d c0 3d ee |.I\./..@.".8..=.|
00000190 c9 9d 74 34 a0 a0 f9 cf fd 94 ff 0f db c2 4c f1 |..t4..........L.|
000001a0 ea 2e c0 ce fb f8 b4 af 8b 8d 2f 9c 61 21 b7 8f |........../.a!..|
000001b0 fb 95 3e ac e8 81 a3 66 a7 83 8c 7c 0e 63 d7 fb |..>....f...|.c..|
000001c0 e5 49 af 6c 6d 23 51 26 d3 ac c8 55 12 f7 42 44 |.I.lm#Q&...U..BD|
000001d0 61 6a 1b 0c f7 9c 85 9b 87 66 f6 0e b6 2e 41 f2 |aj.......f....A.|
000001e0 c4 9c 98 35 8e 27 84 8b 48 44 19 8d bf 0f e2 0d |...5.'..HD......|
000001f0 93 f9 c8 34 8d 7f f5 54 28 d2 02 7d 00 02 c4 a2 |...4...T(..}....|
00000200 34 96 40 3d ab be 35 9e b9 be ad 83 8b 34 19 5f |4.@=..5......4._|
00000210 12 93 22 f2 c5 2b ec 2f e5 db bb 37 05 6c 7e cc |.."..+./...7.l~.|
00000220 d9 0b 1f 46 70 b6 cb 41 8a 79 19 0d eb fe 4d 53 |...Fp..A.y....MS|
00000230 7c 24 f4 9a d3 43 8f 3a 0c 31 8c 30 7d 4b 5a 8f ||$...C.:.1.0}KZ.|
00000240 81 33 18 65 fe 04 8b a6 67 85 ef c9 34 43 8a 78 |.3.e....g...4C.x|
00000250 0d 85 47 5d 17 72 6d d7 29 e6 14 cb f7 6e ee cf |..G].rm.)....n..|
00000260 4f 22 84 ed b7 40 1f 24 ce 11 17 0d bb bb ea fd |O"...@.$........|
00000270 26 68 7e 73 04 d6 41 c0 fe f0 66 b8 03 12 52 46 |&h~s..A...f...RF|
00000280 7b 1d e5 49 93 80 ec 32 6f 41 81 46 a4 e3 02 23 |{..I...2oA.F...#|
00000290 f8 35 25 2f |.5%/|
>>> Flow 14 (server to client)
00000000 00 00 00 10 8b 43 54 b5 76 8b ee 65 e2 20 47 aa |.....CT.v..e. G.|
00000010 9b 27 eb 3c a6 cb dc ca d0 f9 a2 ee d9 33 60 1e |.'.<.........3`.|
00000020 2d 77 5a 63 |-wZc|
+282
View File
@@ -0,0 +1,282 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 8c 0f 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |........+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 1d 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 31 |..chacha20-poly1|
00000150 33 30 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 00 |305@openssh.com.|
00000160 00 00 1d 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 |...chacha20-poly|
00000170 31 33 30 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |1305@openssh.com|
00000180 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d 32 35 |...nhmac-sha2-25|
00000190 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |6-etm@openssh.co|
000001a0 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d |m,hmac-sha2-512-|
000001b0 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
000001c0 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d |hmac-sha2-256,hm|
000001d0 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 |ac-sha2-512,hmac|
000001e0 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d |-sha1,hmac-sha1-|
000001f0 39 36 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d |96...nhmac-sha2-|
00000200 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e |256-etm@openssh.|
00000210 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 |com,hmac-sha2-51|
00000220 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |2-etm@openssh.co|
00000230 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000240 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000250 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 |ac-sha1,hmac-sha|
00000260 31 2d 39 36 00 00 00 04 6e 6f 6e 65 00 00 00 04 |1-96....none....|
00000270 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 |none............|
00000280 00 d7 3b 80 93 f6 ef bc 88 eb 1a 6e ac fa 66 ef |..;........n..f.|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 2f eb 28 ce 9c 5d d8 9e bb 3c |....../.(..]...<|
00000010 8b 7a f7 f2 71 bc 00 00 01 7a 73 6e 74 72 75 70 |.z..q....zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 b4 a9 7d fd 9e 94 |...,..... ..}...|
00000010 7e 5f be f6 5c 5f 3f ca 56 d5 49 14 88 a0 84 49 |~_..\_?.V.I....I|
00000020 79 61 2d 25 d7 0b 0f d8 b9 53 e2 35 b8 cc 87 3c |ya-%.....S.5...<|
>>> Flow 6 (server to client)
00000000 00 00 01 04 09 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 c7 36 22 b7 17 99 92 92 37 dd |..... .6".....7.|
00000080 14 42 9c 37 a4 54 99 71 c7 ee 4f 3c 6a 13 8a 61 |.B.7.T.q..O<j..a|
00000090 77 f4 42 46 4a 2e 00 00 00 65 00 00 00 13 65 63 |w.BFJ....e....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 4a 00 00 00 21 00 f4 10 20 b7 44 ef |6...J...!... .D.|
000000c0 34 ca a0 97 9f fb 8e c0 62 94 9b 96 69 e0 4a 48 |4.......b...i.JH|
000000d0 51 6b e1 b1 d8 78 ac c5 43 17 00 00 00 21 00 9f |Qk...x..C....!..|
000000e0 9e 4b 2d 48 81 bc 08 a0 92 0e 85 58 c3 f5 9c 2b |.K-H.......X...+|
000000f0 a0 18 88 db c9 20 45 1d be 18 9b d7 f1 fe cc 00 |..... E.........|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 93 d6 5e ab 31 d6 bf 57 |..........^.1..W|
00000120 f4 30 59 03 99 cd f1 06 6d 38 7a 76 20 59 10 1a |.0Y.....m8zv Y..|
00000130 2d 0a ba 5e 30 1e 55 9e f9 9b 5e 9c b0 88 e1 de |-..^0.U...^.....|
00000140 44 82 49 23 ad 02 7d 59 10 be 78 24 1f 57 28 26 |D.I#..}Y..x$.W(&|
00000150 05 47 bd 82 71 4e 9a c9 49 36 cc dd c3 53 6d 25 |.G..qN..I6...Sm%|
00000160 3e c7 75 f7 61 5a 3b b0 7c 1d e6 0f c7 9d 10 05 |>.u.aZ;.|.......|
00000170 59 4f d1 52 e9 58 c2 db 7f 66 27 ef 1e 2d cb 11 |YO.R.X...f'..-..|
00000180 f0 37 28 2a 23 97 20 14 8a 1d 0a de 05 04 ec 63 |.7(*#. ........c|
00000190 7d f5 af 6c 42 96 9e 31 ad ca c4 38 ba db f0 a5 |}..lB..1...8....|
000001a0 9b 4a 31 ff e2 0d 5f eb f2 bd 17 9e ba 57 1c 24 |.J1..._......W.$|
000001b0 bc 76 f7 5a f1 1c 71 bf f4 56 08 25 0f 76 4c 7a |.v.Z..q..V.%.vLz|
000001c0 40 dc 82 88 2c 97 f0 45 99 72 52 49 35 8c 04 ff |@...,..E.rRI5...|
000001d0 9c f4 6b 06 7e af ce 51 68 1a 64 58 47 02 a3 8b |..k.~..Qh.dXG...|
000001e0 6a c4 51 5d 86 05 86 7b db f4 81 e4 40 63 06 c4 |j.Q]...{....@c..|
000001f0 fd ae 4c f4 8d 98 49 2f f8 86 59 d4 3a 5b 02 88 |..L...I/..Y.:[..|
00000200 73 19 76 bb 0f 5d 8a f0 ce f1 d3 d0 ef 20 0b 1b |s.v..]....... ..|
00000210 48 e1 d0 9f 4f 76 57 9b 24 b4 2c 02 07 b4 eb a9 |H...OvW.$.,.....|
00000220 06 93 ae c1 61 9b a1 28 e3 20 68 49 8d 58 7b 35 |....a..(. hI.X{5|
00000230 7e 16 5c ad 6d f0 2e 43 44 58 90 3f 9f e6 19 5f |~.\.m..CDX.?..._|
00000240 dc 89 9e 6e e9 ce cc 6c d6 c0 a0 b3 f8 93 1d 2a |...n...l.......*|
00000250 2f be a5 be bc e3 64 79 a6 85 9e 17 47 1c 04 39 |/.....dy....G..9|
00000260 20 33 c8 ba | 3..|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 23 dc 62 b8 d2 60 16 9a fa 2f |......#.b..`.../|
00000010 3a 3a 49 cd 8e 18 51 64 5f ad ec fd 18 0d 67 93 |::I...Qd_.....g.|
00000020 dc 69 96 a5 3a 55 3b 23 a6 90 c1 da ff ba 80 e5 |.i..:U;#........|
00000030 21 a1 87 7e c8 d1 6d e9 bd 1e 59 08 |!..~..m...Y.|
>>> Flow 8 (server to client)
00000000 f5 90 9d 63 c4 ef 0d f2 b8 74 64 a4 c4 e7 4a f3 |...c.....td...J.|
00000010 18 40 b7 65 ae f5 8e 1f 8d ef 69 01 c7 74 f7 b6 |.@.e......i..t..|
00000020 9a 38 cd 3c 0a ff 7f b6 b6 fd 25 b1 |.8.<......%.|
>>> Flow 9 (client to server)
00000000 a0 93 a8 e3 ec 1e 7a a9 73 9a b1 17 61 5d 64 dd |......z.s...a]d.|
00000010 59 8e 40 25 06 16 99 21 d2 86 7e aa c9 c7 9a df |Y.@%...!..~.....|
00000020 45 8b b2 95 58 b1 9f f2 04 c1 24 44 3b f4 e8 05 |E...X.....$D;...|
00000030 70 29 74 8a d1 f8 be 75 59 1e a3 30 1d 6b 6e 25 |p)t....uY..0.kn%|
00000040 93 d8 1b e8 |....|
>>> Flow 10 (server to client)
00000000 91 31 b3 9f 83 fd d6 0d 5a 4f 1e c4 ba 7f ea 5e |.1......ZO.....^|
00000010 58 cd a5 0a 32 18 7a f6 e2 dd 41 70 7c 03 a8 cb |X...2.z...Ap|...|
00000020 24 da 46 d8 ee bc ba 0c 15 b0 2e 67 82 b2 81 b4 |$.F........g....|
00000030 d2 a6 eb e2 ae 80 80 11 fd 23 9e e8 52 82 8c d3 |.........#..R...|
00000040 15 9c 00 64 3a 2b 20 fe 79 18 63 35 b5 01 a3 18 |...d:+ .y.c5....|
00000050 ad 90 fb 88 9a ef f5 fc 7c 5c b8 f4 88 1f 4f 7e |........|\....O~|
00000060 a1 9e 60 1f ab 40 f9 3b 7d 7d 31 7f c4 6f 8e e6 |..`..@.;}}1..o..|
00000070 a1 2e 66 6f a1 e7 45 86 82 de 78 87 09 e4 94 bf |..fo..E...x.....|
>>> Flow 11 (client to server)
00000000 c4 02 e3 fc 38 5e ea 90 76 a4 8f 6c c2 17 e1 57 |....8^..v..l...W|
00000010 ea d0 6d a9 78 b4 01 65 9d 45 4e 5c cf 52 51 e4 |..m.x..e.EN\.RQ.|
00000020 df 29 ff 66 bd 07 d8 7f cc 6a 88 02 22 92 94 68 |.).f.....j.."..h|
00000030 7d 54 45 36 bc b8 41 17 83 10 28 af 38 19 a6 d4 |}TE6..A...(.8...|
00000040 19 01 dc 8c 0a 01 c3 87 41 a3 61 dd 96 2b bc 40 |........A.a..+.@|
00000050 65 32 59 22 9b 98 fe cb 96 71 f2 a1 c3 f1 d5 e2 |e2Y".....q......|
00000060 d5 b7 92 3e 5c 1c 9c 6a 25 05 d6 d3 0d f2 29 db |...>\..j%.....).|
00000070 4c 36 ea 22 bc 21 13 4e b4 e5 90 e6 be 24 c0 d3 |L6.".!.N.....$..|
00000080 93 d8 1a b8 d4 bc 51 a7 79 b7 ba b5 e4 01 6b aa |......Q.y.....k.|
00000090 3e 42 70 c0 10 24 c4 77 ad 11 db 50 d8 a8 0b 53 |>Bp..$.w...P...S|
000000a0 ab ef a6 e4 9b 81 86 f3 75 fd 00 b5 65 ad d6 1d |........u...e...|
000000b0 08 a1 d1 fc 7b 50 61 0e 56 51 d2 58 13 4e c2 1e |....{Pa.VQ.X.N..|
000000c0 7b c0 1e c6 61 c7 36 ad 00 71 fb cc 9e 89 80 df |{...a.6..q......|
000000d0 83 69 22 99 cd f0 ce 6c d4 e9 d8 4d 23 f8 c6 3f |.i"....l...M#..?|
000000e0 42 1a 4f b1 00 ea cb b7 4d 41 d5 b5 ec f8 11 80 |B.O.....MA......|
000000f0 a6 c5 e0 07 bc b5 b8 8d 8e 67 45 ef 6b 67 4f 37 |.........gE.kgO7|
00000100 d5 56 b5 5c 13 84 91 31 83 73 37 4e 04 f0 50 84 |.V.\...1.s7N..P.|
00000110 3c 42 a8 e6 30 05 10 11 7c f4 3d db 3c 50 59 09 |<B..0...|.=.<PY.|
00000120 7d c3 1f 73 cd 8e c2 05 6b c6 df 8f 0a 4a b7 3c |}..s....k....J.<|
00000130 54 75 47 9d 87 4d 55 c2 85 60 b1 ae b5 db c9 49 |TuG..MU..`.....I|
00000140 2e ed a4 9d 18 41 9c 3e db 52 52 f5 23 a6 18 0c |.....A.>.RR.#...|
00000150 d2 e4 61 c1 12 fa 8a 6e 01 c9 4d a4 66 20 ba da |..a....n..M.f ..|
00000160 36 20 4a 35 56 91 28 42 33 33 b5 71 f2 ef 8c 63 |6 J5V.(B33.q...c|
00000170 24 c9 74 c2 |$.t.|
>>> Flow 12 (server to client)
00000000 96 bc 95 18 58 09 46 79 9d 57 59 05 e2 72 e0 de |....X.Fy.WY..r..|
00000010 f6 38 4c 44 09 55 ba ff 0d d1 2c 8a 96 47 b6 df |.8LD.U....,..G..|
00000020 13 25 b4 85 89 cb 18 df ac b9 6c 5c 5c 43 77 a2 |.%........l\\Cw.|
00000030 1b f5 74 6e 5a 2f 72 77 67 03 43 b4 e1 0e 5e 46 |..tnZ/rwg.C...^F|
00000040 94 05 6a 74 04 62 b1 0f c7 76 99 be 13 8b 3f 23 |..jt.b...v....?#|
00000050 38 12 b4 e2 6d 27 6f c3 e5 12 87 8d 6a 54 50 00 |8...m'o.....jTP.|
00000060 7e 31 12 b4 97 8c 30 10 33 15 21 73 51 1d 7c cb |~1....0.3.!sQ.|.|
00000070 57 1f 17 a9 86 5b 70 3d 30 e1 a1 55 10 3a 0c 37 |W....[p=0..U.:.7|
00000080 7f 61 ab ff 2a ec e8 44 1e 02 be e9 c4 73 b2 61 |.a..*..D.....s.a|
00000090 8c f0 87 c1 bf 35 8f 2b 51 60 04 07 07 28 d6 60 |.....5.+Q`...(.`|
000000a0 7f 89 15 62 cf 2b aa 98 89 d9 3e 2b 05 db 4f b3 |...b.+....>+..O.|
000000b0 24 b0 95 15 97 8d 4d c0 ba ab a9 24 d8 ee 7a 3a |$.....M....$..z:|
000000c0 bd e8 c2 d7 9e 61 97 b3 68 87 fa e5 d3 1e 23 a2 |.....a..h.....#.|
000000d0 e2 5c 65 71 56 d5 10 1d 79 a1 ab 96 61 2e 78 90 |.\eqV...y...a.x.|
000000e0 2e b2 96 de 5e b1 f2 ba 1e 1f b6 f3 77 9e 4c 3b |....^.......w.L;|
000000f0 9e 85 b0 b2 2a 99 cf da 4c c9 46 1b 0f 5e a8 28 |....*...L.F..^.(|
00000100 d8 3a c4 19 a6 ff 3c 0b 88 6f 30 cd 8d 21 c8 34 |.:....<..o0..!.4|
00000110 35 95 67 a9 b3 02 f9 17 2c c2 ed 4b c4 97 08 47 |5.g.....,..K...G|
00000120 c0 9d 1a ff 17 1c c0 61 82 b2 f0 82 34 51 58 1a |.......a....4QX.|
00000130 7c a9 9d 51 04 0f d3 4d 89 b3 a1 0e 96 78 07 39 ||..Q...M.....x.9|
00000140 c7 12 9d 8d 8a 0b 1d b7 e3 f8 a9 4b |...........K|
>>> Flow 13 (client to server)
00000000 1e 8d 8b 82 d0 80 8d ec 30 b3 03 e9 57 2c 3c e3 |........0...W,<.|
00000010 d1 22 02 9b 49 71 bc 2c db da fa a3 72 72 84 f0 |."..Iq.,....rr..|
00000020 01 ba 67 ef b1 5e b2 c1 59 84 9f ba 24 06 3b d9 |..g..^..Y...$.;.|
00000030 bb 11 47 5e 90 1f 92 b1 d9 26 5a 07 6d d7 94 40 |..G^.....&Z.m..@|
00000040 d3 3b 51 36 54 9a 57 af 84 7a 40 82 2e e4 95 80 |.;Q6T.W..z@.....|
00000050 0b 5f 16 92 3c d7 c9 77 94 1f 82 43 f0 2f 0c ed |._..<..w...C./..|
00000060 08 43 b7 1b 61 dc b1 d5 50 04 a6 fa ae 7c 58 9b |.C..a...P....|X.|
00000070 9f fa 00 97 0d 1d 4e 4a 85 9c f5 32 ab b9 af d2 |......NJ...2....|
00000080 f1 1c dd 9e b1 4d 51 31 46 25 90 05 5f 8b b4 22 |.....MQ1F%.._.."|
00000090 45 9d 87 af c6 a9 ab 25 26 b5 b3 26 99 97 cd 10 |E......%&..&....|
000000a0 06 ee 07 dc 51 0d c2 46 54 2c 20 95 43 d8 01 f3 |....Q..FT, .C...|
000000b0 55 2e 7a 79 21 44 0e b8 d1 5a 09 7c fb 1d d6 39 |U.zy!D...Z.|...9|
000000c0 09 90 03 6d 2d ce a5 5f f0 eb 46 79 40 e5 7f ca |...m-.._..Fy@...|
000000d0 f9 de cf 88 c4 64 8a c6 f7 24 96 87 f2 ae e1 17 |.....d...$......|
000000e0 ef 1b b4 4b 99 46 d9 da e8 f9 c0 c3 c6 4e e9 09 |...K.F.......N..|
000000f0 c2 c3 49 22 45 82 42 ed 63 5e 09 c6 d6 a8 c3 fd |..I"E.B.c^......|
00000100 c8 ac 06 37 99 9b fe d3 a1 2d f9 14 7d 2a c0 f3 |...7.....-..}*..|
00000110 da e1 5c 64 61 bd 0b 72 27 b2 3b a4 da d1 9f 1b |..\da..r'.;.....|
00000120 86 e6 9e 50 d3 39 76 fc 06 54 d4 6c 7c 17 30 cc |...P.9v..T.l|.0.|
00000130 0b ac bc 75 83 07 b6 2f 40 6e 55 6a 6a 0d a0 79 |...u.../@nUjj..y|
00000140 6b 27 6b bb 34 66 7b 4d 26 18 50 96 0e d4 8c ca |k'k.4f{M&.P.....|
00000150 a5 53 68 68 9e 73 ae 5d 93 70 ed c3 94 6e 61 11 |.Shh.s.].p...na.|
00000160 ea d3 6e 73 8c 06 d9 09 7c 08 a9 a0 05 52 98 ab |..ns....|....R..|
00000170 09 70 4e 72 f8 29 90 c8 77 83 9f dd 4e 22 98 f0 |.pNr.)..w...N"..|
00000180 c8 22 60 80 50 86 13 7e 93 0b 06 53 75 af 9d 75 |."`.P..~...Su..u|
00000190 27 e6 7f a0 7f 66 3a fd 33 b3 45 2e cc e9 b5 22 |'....f:.3.E...."|
000001a0 76 c4 e6 24 3f e1 db 53 b9 f1 69 20 76 40 f0 bf |v..$?..S..i v@..|
000001b0 b9 5e 1a 8e 1b 44 43 4b 44 2c ac 02 f4 f5 5f 8b |.^...DCKD,...._.|
000001c0 da 0f b6 2d de 09 75 7a 79 3a 4a 5a d7 9a 95 2c |...-..uzy:JZ...,|
000001d0 b3 f8 d9 8c 45 74 fb a0 a8 d6 2b 1f b2 35 bf dc |....Et....+..5..|
000001e0 5d 9d c2 e8 30 5b 8b 96 8f 2c 07 be 78 3c b6 9f |]...0[...,..x<..|
000001f0 be 07 4c 7e 50 c8 41 cc df 75 04 f3 29 be 38 ec |..L~P.A..u..).8.|
00000200 2a 99 df 2a 6b 21 a7 e5 88 70 ed 7d 2c 25 a1 28 |*..*k!...p.},%.(|
00000210 82 79 f4 01 09 78 60 fa 57 77 e8 7c 91 a5 32 cc |.y...x`.Ww.|..2.|
00000220 22 b2 25 5f f0 cf f6 84 c3 49 72 56 91 e5 9d 08 |".%_.....IrV....|
00000230 2f 3e 7d 8c ce f6 7a 3b 31 33 4f ce 06 57 a0 2d |/>}...z;13O..W.-|
00000240 cb c8 6e 3a 96 df f0 20 99 c9 77 39 82 7d 47 ca |..n:... ..w9.}G.|
00000250 d9 05 5c af 61 53 71 ea e2 6f 4b 31 b2 0f 6a e3 |..\.aSq..oK1..j.|
00000260 75 0b 44 30 c9 32 9e 30 20 c1 13 49 fe dc fd 63 |u.D0.2.0 ..I...c|
00000270 cb 03 48 6f aa cd 61 b2 e5 b8 1e c2 df 56 bf b0 |..Ho..a......V..|
00000280 c8 eb 46 33 54 8e 06 7e fd d1 2a 42 |..F3T..~..*B|
>>> Flow 14 (server to client)
00000000 1a a1 84 7d 94 88 a6 79 88 4f 79 2a 60 72 b4 2b |...}...y.Oy*`r.+|
00000010 20 b1 1e 55 6a 1f 1c a2 ba 49 8b 9e | ..Uj....I..|
+176
View File
@@ -0,0 +1,176 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 03 2c 11 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |...,....+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 c9 63 75 72 76 65 32 |EPv..>....curve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
00000050 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
00000060 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000070 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
00000080 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
00000090 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 2c |-group14-sha256,|
000000a0 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 |diffie-hellman-g|
000000b0 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 2d |roup14-sha1,ext-|
000000c0 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 |info-c,kex-stric|
000000d0 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e |t-c-v00@openssh.|
000000e0 63 6f 6d 00 00 00 57 65 63 64 73 61 2d 73 68 61 |com...Wecdsa-sha|
000000f0 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 73 61 |2-nistp256,ecdsa|
00000100 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
00000110 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 |cdsa-sha2-nistp5|
00000120 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 |21,ssh-rsa,ssh-d|
00000130 73 73 2c 73 73 68 2d 65 64 32 35 35 31 39 00 00 |ss,ssh-ed25519..|
00000140 00 6c 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 |.laes128-gcm@ope|
00000150 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d |nssh.com,aes256-|
00000160 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |gcm@openssh.com,|
00000170 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 31 33 30 |chacha20-poly130|
00000180 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 |5@openssh.com,ae|
00000190 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d |s128-ctr,aes192-|
000001a0 63 74 72 2c 61 65 73 32 35 36 2d 63 74 72 00 00 |ctr,aes256-ctr..|
000001b0 00 6c 61 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 |.laes128-gcm@ope|
000001c0 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d |nssh.com,aes256-|
000001d0 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |gcm@openssh.com,|
000001e0 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 31 33 30 |chacha20-poly130|
000001f0 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 |5@openssh.com,ae|
00000200 73 31 32 38 2d 63 74 72 2c 61 65 73 31 39 32 2d |s128-ctr,aes192-|
00000210 63 74 72 2c 61 65 73 32 35 36 2d 63 74 72 00 00 |ctr,aes256-ctr..|
00000220 00 6e 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d |.nhmac-sha2-256-|
00000230 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000240 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 |hmac-sha2-512-et|
00000250 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d |m@openssh.com,hm|
00000260 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 |ac-sha2-256,hmac|
00000270 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 |-sha2-512,hmac-s|
00000280 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 |ha1,hmac-sha1-96|
00000290 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d 32 35 |...nhmac-sha2-25|
000002a0 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |6-etm@openssh.co|
000002b0 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d |m,hmac-sha2-512-|
000002c0 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
000002d0 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d |hmac-sha2-256,hm|
000002e0 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 |ac-sha2-512,hmac|
000002f0 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d |-sha1,hmac-sha1-|
00000300 39 36 00 00 00 04 6e 6f 6e 65 00 00 00 04 6e 6f |96....none....no|
00000310 6e 65 00 00 00 00 00 00 00 00 00 00 00 00 00 d7 |ne..............|
00000320 3b 80 93 f6 ef bc 88 eb 1a 6e ac fa 66 ef 26 3c |;........n..f.&<|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 f3 f0 95 b8 f3 48 8a d7 53 02 |...........H..S.|
00000010 0f 06 e2 fa ec 09 00 00 01 7a 73 6e 74 72 75 70 |.........zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 aa 80 4b 53 a8 4b |...,..... ..KS.K|
00000010 4c 0f fa ac a3 b8 5f 64 7d 36 42 e7 1d 56 45 7e |L....._d}6B..VE~|
00000020 2b ac e0 f9 e7 60 f5 d7 55 37 b8 cc 87 3c 23 dc |+....`..U7...<#.|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 5c ba 6d 1c b4 b7 84 24 3b 46 |..... \.m....$;F|
00000080 0c 91 27 c1 65 2e b0 59 06 8e 7f bb d0 f6 16 66 |..'.e..Y.......f|
00000090 29 e8 5f 52 cb 42 00 00 00 64 00 00 00 13 65 63 |)._R.B...d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 21 00 c3 27 7c 33 6a d5 |6...I...!..'|3j.|
000000c0 c4 a3 ee b8 4a 13 27 24 11 69 64 ce 2d 0c 1a 79 |....J.'$.id.-..y|
000000d0 8d 34 23 4e 96 79 7b 14 5f 8c 00 00 00 20 49 2b |.4#N.y{._.... I+|
000000e0 48 81 ee 1a c2 8b 85 42 95 7b be 27 b2 96 d5 3e |H......B.{.'...>|
000000f0 ca e9 16 47 eb 66 4e 2b 88 37 42 61 c0 76 00 00 |...G.fN+.7Ba.v..|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 8a 7d de de |...........@.}..|
00000120 4a 81 5e 93 af c1 ae 6a 42 49 ae dd 1a 89 d5 2e |J.^....jBI......|
00000130 e3 84 6a 60 cf 52 51 61 24 f6 1d 5a 2e 03 f4 4b |..j`.RQa$..Z...K|
00000140 9e 98 83 49 34 ff e6 5b 01 ea 58 a6 af b5 f6 64 |...I4..[..X....d|
00000150 ab 29 c4 51 e2 32 1f f9 c4 78 d7 b4 5e 06 c6 45 |.).Q.2...x..^..E|
00000160 59 3e 31 7b d7 30 fa dc 40 43 26 2b 24 c6 7b 31 |Y>1{.0..@C&+$.{1|
00000170 4b a7 ee a9 cd d1 61 29 8c 87 d6 81 28 70 27 7e |K.....a)....(p'~|
00000180 5c 07 a1 28 e3 06 9b f9 1a e7 01 07 23 0f 6d 3e |\..(........#.m>|
00000190 22 e8 c4 9d 96 f7 7c 84 4b 13 13 d2 e0 22 1d c0 |".....|.K...."..|
000001a0 60 7d 3e 17 28 c3 60 83 db 19 8b 80 a8 5f 2b ed |`}>.(.`......_+.|
000001b0 72 3d c2 0d d9 e9 6b 20 88 9c 27 e1 dc b7 bd af |r=....k ..'.....|
000001c0 fa 44 6c ef 2d c5 72 ed d8 9c 68 c8 be 1a 75 81 |.Dl.-.r...h...u.|
000001d0 be 81 a4 27 f5 cc c5 0b c8 4a 91 17 9d fa 58 c0 |...'.....J....X.|
000001e0 7a 7f fc 4a 72 d6 1a 9d 89 8a 2e 1a ca dc a3 9d |z..Jr...........|
000001f0 10 bb ad c6 eb fc 73 03 6f e8 0a cd b0 75 6e dc |......s.o....un.|
00000200 0c 5a c9 f5 7a d8 dd 40 94 9f b5 09 17 ad 4b f2 |.Z..z..@......K.|
00000210 3f 49 37 bb d1 6a fd 6a 1a eb fd ff f0 ad 1f 6c |?I7..j.j.......l|
00000220 ea d8 b8 86 4b 86 74 e2 e1 9c 8a 5c ed 54 bf d8 |....K.t....\.T..|
00000230 70 16 df 35 be 41 6d 39 da 2c c0 a6 fd 47 4a 4b |p..5.Am9.,...GJK|
00000240 37 87 b7 7f ed 83 af 76 39 e3 71 67 aa 41 e6 83 |7......v9.qg.A..|
00000250 fa b1 c1 ba 0f f9 8c 3e 2c 65 25 c5 c7 1f 9e f7 |.......>,e%.....|
00000260 b3 61 4f 86 6c c4 7a 30 f2 ea cc b1 |.aO.l.z0....|
+288
View File
@@ -0,0 +1,288 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 31 30 2e 30 0d 0a |10.0..|
>>> Flow 3 (client to server)
00000000 00 00 02 ac 04 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |........+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 56 63 75 72 76 65 32 |EPv..>...Vcurve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000030 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000040 62 73 73 68 2e 6f 72 67 2c 65 78 74 2d 69 6e 66 |bssh.org,ext-inf|
00000050 6f 2d 63 2c 6b 65 78 2d 73 74 72 69 63 74 2d 63 |o-c,kex-strict-c|
00000060 2d 76 30 30 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-v00@openssh.com|
00000070 00 00 00 57 65 63 64 73 61 2d 73 68 61 32 2d 6e |...Wecdsa-sha2-n|
00000080 69 73 74 70 32 35 36 2c 65 63 64 73 61 2d 73 68 |istp256,ecdsa-sh|
00000090 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 63 64 73 |a2-nistp384,ecds|
000000a0 61 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 31 2c |a-sha2-nistp521,|
000000b0 73 73 68 2d 72 73 61 2c 73 73 68 2d 64 73 73 2c |ssh-rsa,ssh-dss,|
000000c0 73 73 68 2d 65 64 32 35 35 31 39 00 00 00 6c 61 |ssh-ed25519...la|
000000d0 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73 |es128-gcm@openss|
000000e0 68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d 67 63 6d |h.com,aes256-gcm|
000000f0 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 63 68 61 |@openssh.com,cha|
00000100 63 68 61 32 30 2d 70 6f 6c 79 31 33 30 35 40 6f |cha20-poly1305@o|
00000110 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 31 32 |penssh.com,aes12|
00000120 38 2d 63 74 72 2c 61 65 73 31 39 32 2d 63 74 72 |8-ctr,aes192-ctr|
00000130 2c 61 65 73 32 35 36 2d 63 74 72 00 00 00 6c 61 |,aes256-ctr...la|
00000140 65 73 31 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73 |es128-gcm@openss|
00000150 68 2e 63 6f 6d 2c 61 65 73 32 35 36 2d 67 63 6d |h.com,aes256-gcm|
00000160 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 63 68 61 |@openssh.com,cha|
00000170 63 68 61 32 30 2d 70 6f 6c 79 31 33 30 35 40 6f |cha20-poly1305@o|
00000180 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 31 32 |penssh.com,aes12|
00000190 38 2d 63 74 72 2c 61 65 73 31 39 32 2d 63 74 72 |8-ctr,aes192-ctr|
000001a0 2c 61 65 73 32 35 36 2d 63 74 72 00 00 00 6e 68 |,aes256-ctr...nh|
000001b0 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d |mac-sha2-256-etm|
000001c0 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 |@openssh.com,hma|
000001d0 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f |c-sha2-512-etm@o|
000001e0 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d |penssh.com,hmac-|
000001f0 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 |sha2-256,hmac-sh|
00000200 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 |a2-512,hmac-sha1|
00000210 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 00 |,hmac-sha1-96...|
00000220 6e 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 |nhmac-sha2-256-e|
00000230 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
00000240 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d |mac-sha2-512-etm|
00000250 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 |@openssh.com,hma|
00000260 63 2d 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d |c-sha2-256,hmac-|
00000270 73 68 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 |sha2-512,hmac-sh|
00000280 61 31 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 |a1,hmac-sha1-96.|
00000290 00 00 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 |...none....none.|
000002a0 00 00 00 00 00 00 00 00 00 00 00 00 d7 3b 80 93 |.............;..|
>>> Flow 4 (server to client)
00000000 00 00 04 7c 08 14 d7 da a8 cd 40 76 e6 8a 12 b5 |...|......@v....|
00000010 5f ff a4 a5 57 4b 00 00 01 5c 6d 6c 6b 65 6d 37 |_...WK...\mlkem7|
00000020 36 38 78 32 35 35 31 39 2d 73 68 61 32 35 36 2c |68x25519-sha256,|
00000030 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 2d |sntrup761x25519-|
00000040 73 68 61 35 31 32 2c 73 6e 74 72 75 70 37 36 31 |sha512,sntrup761|
00000050 78 32 35 35 31 39 2d 73 68 61 35 31 32 40 6f 70 |x25519-sha512@op|
00000060 65 6e 73 73 68 2e 63 6f 6d 2c 63 75 72 76 65 32 |enssh.com,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 64 69 |-group14-sha1,di|
000000f0 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f |ffie-hellman-gro|
00000100 75 70 31 34 2d 73 68 61 32 35 36 2c 64 69 66 66 |up14-sha256,diff|
00000110 69 65 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 |ie-hellman-group|
00000120 31 36 2d 73 68 61 35 31 32 2c 64 69 66 66 69 65 |16-sha512,diffie|
00000130 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 2d 65 |-hellman-group-e|
00000140 78 63 68 61 6e 67 65 2d 73 68 61 32 35 36 2c 65 |xchange-sha256,e|
00000150 78 74 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 |xt-info-s,kex-st|
00000160 72 69 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 |rict-s-v00@opens|
00000170 73 68 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 |sh.com...-rsa-sh|
00000180 61 32 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d |a2-512,rsa-sha2-|
00000190 32 35 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e |256,ecdsa-sha2-n|
000001a0 69 73 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 |istp256...lchach|
000001b0 61 32 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 |a20-poly1305@ope|
000001c0 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d |nssh.com,aes128-|
000001d0 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |gcm@openssh.com,|
000001e0 61 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 |aes256-gcm@opens|
000001f0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000200 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000210 32 35 36 2d 63 74 72 00 00 00 6c 63 68 61 63 68 |256-ctr...lchach|
00000220 61 32 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 |a20-poly1305@ope|
00000230 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d |nssh.com,aes128-|
00000240 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |gcm@openssh.com,|
00000250 61 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 |aes256-gcm@opens|
00000260 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000270 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000280 32 35 36 2d 63 74 72 00 00 00 d5 75 6d 61 63 2d |256-ctr....umac-|
00000290 36 34 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |64-etm@openssh.c|
000002a0 6f 6d 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 |om,umac-128-etm@|
000002b0 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 |openssh.com,hmac|
000002c0 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 |-sha2-256-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e |ha2-512-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 31 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f |1-etm@openssh.co|
00000310 6d 2c 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 |m,umac-64@openss|
00000320 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f |h.com,umac-128@o|
00000330 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d |penssh.com,hmac-|
00000340 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 |sha2-256,hmac-sh|
00000350 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 |a2-512,hmac-sha1|
00000360 00 00 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 |....umac-64-etm@|
00000370 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 |openssh.com,umac|
00000380 2d 31 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 |-128-etm@openssh|
00000390 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 |.com,hmac-sha2-2|
000003a0 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |56-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 |om,hmac-sha2-512|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f |,hmac-sha1-etm@o|
000003e0 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d |penssh.com,umac-|
000003f0 36 34 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 |64@openssh.com,u|
00000400 6d 61 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e |mac-128@openssh.|
00000410 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 |com,hmac-sha2-25|
00000420 36 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c |6,hmac-sha2-512,|
00000430 68 6d 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e |hmac-sha1....non|
00000440 65 2c 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 |e,zlib@openssh.c|
00000450 6f 6d 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 |om....none,zlib@|
00000460 6f 70 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 |openssh.com.....|
00000470 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 13 87 32 34 3e 68 |...,..... ..24>h|
00000010 e6 9b 9a cb 23 22 06 11 e8 24 71 e5 d7 96 79 83 |....#"...$q...y.|
00000020 48 59 1a 95 f2 b0 86 1c 76 54 58 e8 a3 63 9c a8 |HY......vTX..c..|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 85 12 a8 ca dd 22 7d 74 89 87 |..... ....."}t..|
00000080 df 36 23 6e fb 59 c0 75 4b 38 1e 49 d6 fa 5e 8c |.6#n.Y.uK8.I..^.|
00000090 cd 6c eb fd 26 34 00 00 00 64 00 00 00 13 65 63 |.l..&4...d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 21 00 f4 8e 10 b5 77 04 |6...I...!.....w.|
000000c0 3e 1b 59 06 4f ef 48 08 2b 15 07 4a 69 0f 30 a2 |>.Y.O.H.+..Ji.0.|
000000d0 a4 37 7b 5e f9 de 15 0a ca 1a 00 00 00 20 6a 97 |.7{^......... j.|
000000e0 a3 23 e3 7c 92 67 28 0d 02 9e 36 e0 ae b1 f3 37 |.#.|.g(...6....7|
000000f0 19 34 12 cd bf db 84 31 8e 97 72 a5 e1 3f 00 00 |.4.....1..r..?..|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 03 fb e9 4c |...........@...L|
00000120 15 76 5c bf 4b d7 6a 8b 2a 83 6f df bd 5e f6 45 |.v\.K.j.*.o..^.E|
00000130 b2 2b bc bf 38 9f f0 30 13 e1 03 67 d3 4f e6 6f |.+..8..0...g.O.o|
00000140 88 97 39 8e a6 2d df 6f a7 d2 90 df c2 9a 87 93 |..9..-.o........|
00000150 ad 91 12 2e 92 c1 c4 bb 93 b7 7d 6e fd 7c c2 10 |..........}n.|..|
00000160 fe fa b6 22 7e a5 a7 64 c4 25 ce cc bb 5d a5 f0 |..."~..d.%...]..|
00000170 ad 41 c7 8c a1 59 c3 a9 23 f0 69 38 4a 64 2a a1 |.A...Y..#.i8Jd*.|
00000180 62 8d bc 69 1c c1 01 ce ac a9 30 58 a1 d0 68 92 |b..i......0X..h.|
00000190 35 e8 7b 3a bf 1b 68 82 f6 90 8e dd 01 e6 92 4b |5.{:..h........K|
000001a0 bc ce 50 a8 96 2a 7d a5 4d 61 13 98 67 83 11 70 |..P..*}.Ma..g..p|
000001b0 ef f2 af 94 a6 0c 34 78 05 a8 39 d3 44 f6 c4 13 |......4x..9.D...|
000001c0 76 59 77 38 72 83 c4 92 a7 4c 7f 5e 25 08 9b a0 |vYw8r....L.^%...|
000001d0 6f eb 02 4d 4d c6 0a 07 09 2d c6 80 d3 05 8b c2 |o..MM....-......|
000001e0 e7 de 37 16 5a db 1c 02 2e 35 fb 3a 93 ce 79 4e |..7.Z....5.:..yN|
000001f0 0c 25 05 c9 b7 be b7 47 31 8c 18 d8 37 ba 66 34 |.%.....G1...7.f4|
00000200 bb 03 15 0d 0d cc da ad 2d 2c 36 0f 88 3f 5a 70 |........-,6..?Zp|
00000210 21 5f f1 cc 8a 21 e7 5a af c7 7c a0 e3 51 04 4a |!_...!.Z..|..Q.J|
00000220 d3 cb bb a4 60 2f d1 28 7b 6f 52 10 e8 76 fa c2 |....`/.({oR..v..|
00000230 86 9b 08 3f b2 72 e5 f0 0a 7c e0 19 ce 6f d2 74 |...?.r...|...o.t|
00000240 3e 12 8f 7d 1e 21 73 25 57 b8 c9 96 ad 35 f3 b6 |>..}.!s%W....5..|
00000250 5f b0 ae 82 90 4b 05 10 de 11 46 ea ad d7 3b 08 |_....K....F...;.|
00000260 a6 0d b5 24 f6 e3 ae 3b 67 3c a0 44 |...$...;g<.D|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 a1 e3 f9 ae 57 e2 35 b8 cc 87 |..........W.5...|
00000010 00 00 00 20 ba d9 4a 00 05 48 df ec d8 c5 bf f8 |... ..J..H......|
00000020 7d ed c8 ac a8 5f 1c 46 a0 21 c3 26 7e c6 51 2d |}...._.F.!.&~.Q-|
00000030 b8 e8 12 50 38 3a 08 8c a8 0e 98 e7 8c 27 4f 4d |...P8:.......'OM|
00000040 76 42 94 1f |vB..|
>>> Flow 8 (server to client)
00000000 00 00 00 20 53 c2 11 dc 60 cb f1 e0 55 eb f8 50 |... S...`...U..P|
00000010 38 11 aa 98 fc 4c 2a d1 36 0f 57 c2 c9 55 cb 04 |8....L*.6.W..U..|
00000020 dc 2f 79 36 28 5d fa 67 08 01 0a 1b fc a5 57 cd |./y6(].g......W.|
00000030 7f 67 ea 81 |.g..|
>>> Flow 9 (client to server)
00000000 00 00 00 30 c5 dd dd 05 d4 df 9e 48 d6 58 76 a1 |...0.......H.Xv.|
00000010 8a 7e 04 c6 51 26 44 1a cb 85 8b 9a 51 44 bd 57 |.~..Q&D.....QD.W|
00000020 bc 4f 2e a0 0a b9 e0 ee 00 b6 57 d3 2f 52 71 8e |.O........W./Rq.|
00000030 b6 4e f6 f7 34 7c 9f fe c7 c7 ec ca 08 6f d9 b0 |.N..4|.......o..|
00000040 e3 85 81 49 |...I|
>>> Flow 10 (server to client)
00000000 00 00 00 20 4e d8 10 08 39 ab 47 f6 49 42 4e bd |... N...9.G.IBN.|
00000010 2f 69 f7 bc 48 26 1b 5f ee ee 08 25 2e b8 8d 1f |/i..H&._...%....|
00000020 a0 e0 fa 11 28 26 9c af f0 6b 7e e0 f0 00 8f 92 |....(&...k~.....|
00000030 08 96 73 64 00 00 00 40 60 bb 40 d2 c4 8f 5e 09 |..sd...@`.@...^.|
00000040 e6 d9 13 04 fc 4e 21 81 51 dc ad 06 48 51 fc 35 |.....N!.Q...HQ.5|
00000050 b2 cd bb ba df 66 c4 20 b1 c0 b0 7e 7b c0 a7 41 |.....f. ...~{..A|
00000060 6f 16 7a fe 01 fe 3a be 45 4a b9 94 d1 46 a1 82 |o.z...:.EJ...F..|
00000070 09 24 97 57 17 83 9e e6 1b 4e 04 83 a0 73 55 08 |.$.W.....N...sU.|
00000080 2f e6 de 6b 43 77 84 31 |/..kCw.1|
>>> Flow 11 (client to server)
00000000 00 00 01 60 f2 7d b2 4f d9 db ec 78 6b a2 c2 77 |...`.}.O...xk..w|
00000010 6a a1 f8 d0 3c 5c e0 3b d3 99 33 ac 54 4b f7 e2 |j...<\.;..3.TK..|
00000020 3d 1f 6e 51 6f 4c c2 7e d5 3a 79 1e 9f 51 70 75 |=.nQoL.~.:y..Qpu|
00000030 67 35 8c f8 5d 62 35 9a ff fe b2 46 6f 72 47 0b |g5..]b5....ForG.|
00000040 5b 78 30 5b ce 54 5c ab 46 a4 a5 12 8b ef 32 2e |[x0[.T\.F.....2.|
00000050 1e a9 4a 25 07 9e a3 87 42 f9 69 ae c6 9d 83 68 |..J%....B.i....h|
00000060 e8 dd 19 a3 ef 4e 97 c9 ef 19 be a7 08 77 28 7d |.....N.......w(}|
00000070 ee aa b4 a4 3a e5 c1 4e 78 ee b2 b7 50 6d f2 eb |....:..Nx...Pm..|
00000080 2b df 38 22 a3 c9 be f7 ea 36 2f 7d f7 25 fd f4 |+.8".....6/}.%..|
00000090 9f 54 ec cf d5 82 5c 4b e5 e0 3f 74 da 9d d0 32 |.T....\K..?t...2|
000000a0 06 f6 a1 13 15 f4 11 24 e9 74 4c 9b 5e e2 c8 5b |.......$.tL.^..[|
000000b0 32 6b 89 87 d4 d4 ee e3 0c 81 16 d4 54 b7 97 ef |2k..........T...|
000000c0 c6 a4 d7 16 2d 87 be 2c 19 b8 48 9d d6 82 3c 82 |....-..,..H...<.|
000000d0 88 de bc 18 5b 64 ab aa d7 ac 8b 64 6a ad a8 4d |....[d.....dj..M|
000000e0 5a 20 a3 6e ee 7b 7f bf dc 6d 69 6a b0 8b ee 26 |Z .n.{...mij...&|
000000f0 0b 34 f0 22 a6 81 0f d3 b5 15 e8 86 1b 71 1a 60 |.4.".........q.`|
00000100 16 dc 2f 6b ca 63 6c 52 b3 33 42 46 c0 ea 63 50 |../k.clR.3BF..cP|
00000110 bb 23 29 69 79 0c 23 3f fb da 29 dd 94 44 f1 7e |.#)iy.#?..)..D.~|
00000120 58 1c 12 0f df a7 80 3c 69 8a 44 f7 4d 2e 7b db |X......<i.D.M.{.|
00000130 c2 5a 01 c0 0c 57 8e ff 4f 98 74 71 c3 3b 61 fc |.Z...W..O.tq.;a.|
00000140 1b e6 fb 4c 75 33 ff 6b 0e 83 52 40 4a 7f 35 2f |...Lu3.k..R@J.5/|
00000150 82 38 40 22 22 bc 51 6e 21 ce f9 bb 02 bf 26 a5 |.8@"".Qn!.....&.|
00000160 63 9b 91 c3 37 46 6d f6 fe 19 27 5f 91 68 a7 29 |c...7Fm...'_.h.)|
00000170 b7 00 27 37 |..'7|
>>> Flow 12 (server to client)
00000000 00 00 01 40 ed 8c ad 60 63 f2 de d8 77 4e ea e5 |...@...`c...wN..|
00000010 7f 0e e7 65 d5 07 51 66 b5 f6 60 1f ba f0 00 59 |...e..Qf..`....Y|
00000020 ed b3 87 97 9f 52 71 a1 60 9b 3b ef 16 5c 69 2b |.....Rq.`.;..\i+|
00000030 73 1b 35 01 61 52 d6 36 50 5b 61 04 da e3 eb 2f |s.5.aR.6P[a..../|
00000040 b1 5f e4 b2 20 fa f9 52 76 ff 90 66 fe 69 98 26 |._.. ..Rv..f.i.&|
00000050 c2 72 9f 93 aa e3 bb 9a b4 28 62 e3 ea 7f 94 c6 |.r.......(b.....|
00000060 92 e3 2a 81 99 6c 08 f1 df 99 dc d1 a0 cd d0 e6 |..*..l..........|
00000070 31 21 7b d4 c0 e7 85 66 2c 3f 0e 9e 8f 8b 49 11 |1!{....f,?....I.|
00000080 64 6b 61 c4 39 15 d2 c0 83 76 f5 cf f5 5d 0c dc |dka.9....v...]..|
00000090 03 37 22 a7 fa f5 3c 8b b2 a4 2f 1b c3 57 7f 9a |.7"...<.../..W..|
000000a0 4b eb 80 dc e2 17 fd 8f 55 90 b9 03 2d 7f 1e e8 |K.......U...-...|
000000b0 5a 2b 08 57 76 a1 c7 7b 46 97 68 6e af b4 42 8a |Z+.Wv..{F.hn..B.|
000000c0 ea 13 b1 d7 7a 88 c1 f1 9d 45 ec 41 aa ed ef a0 |....z....E.A....|
000000d0 40 3b b8 74 e4 80 88 a9 6a bf d4 a8 9c 27 3d 21 |@;.t....j....'=!|
000000e0 65 8f 28 8a e5 4e 33 a7 fd 9b 78 08 07 ee d0 cf |e.(..N3...x.....|
000000f0 51 f9 b7 5c e3 6c cb 07 5a 74 55 f6 0f ef 42 2b |Q..\.l..ZtU...B+|
00000100 da 28 ac 34 e7 70 64 9b 4d 35 dd a0 d6 94 4f 48 |.(.4.pd.M5....OH|
00000110 d0 91 d5 6b 36 64 9e ce 88 c7 07 9b b7 c4 2e e3 |...k6d..........|
00000120 3b a9 0e 2e b2 63 f6 f6 0c 38 48 71 a0 a4 de 1b |;....c...8Hq....|
00000130 42 61 82 1e d8 1f d0 6b 83 71 ff e8 d5 c6 bc 7b |Ba.....k.q.....{|
00000140 ee 53 5b 87 b5 38 cf 07 5d 73 6e 59 cb d5 d7 d6 |.S[..8..]snY....|
00000150 bc 76 4e e8 |.vN.|
>>> Flow 13 (client to server)
00000000 00 00 02 80 62 66 4c ce e6 ed b9 56 ed 11 4a 46 |....bfL....V..JF|
00000010 93 45 c7 16 71 c0 e2 c4 fc bf 06 58 fb 20 3d ca |.E..q......X. =.|
00000020 2f 85 8f 6f da 51 9a 0d 90 3e 0b e0 af d5 00 5d |/..o.Q...>.....]|
00000030 f2 17 db fb 3c e9 4a 93 df a7 f2 a9 e1 d0 65 33 |....<.J.......e3|
00000040 18 f2 45 09 28 4e eb d2 58 22 b7 9e a9 df b4 48 |..E.(N..X".....H|
00000050 8e 60 e0 b3 b6 78 e9 e5 1c 37 26 1a a1 82 4b e8 |.`...x...7&...K.|
00000060 c3 9d 06 69 f5 13 59 18 2a 78 f6 2c 36 f0 96 0a |...i..Y.*x.,6...|
00000070 99 c5 f0 90 de 38 c4 58 b7 0d 42 0f e1 5d 11 2f |.....8.X..B..]./|
00000080 1f 56 da d6 d9 94 86 68 df bb 4b df ce ea 31 86 |.V.....h..K...1.|
00000090 32 cc 7f 50 75 ac 03 f3 48 c1 7b 58 7f db f8 3b |2..Pu...H.{X...;|
000000a0 5e 02 79 9d 59 38 9d 7f 7c ee 24 8b a1 22 92 a0 |^.y.Y8..|.$.."..|
000000b0 a1 52 2a 09 3a a1 b8 fb 3e be 40 63 7d af cf 21 |.R*.:...>.@c}..!|
000000c0 c8 a0 b6 86 94 af d8 bc 21 3b 83 77 55 c4 0a d0 |........!;.wU...|
000000d0 8e ea 4b 19 04 e7 88 2d 6f ff 9f 79 32 8a 7a 7d |..K....-o..y2.z}|
000000e0 20 09 9b 52 05 d7 a2 95 53 0d 7b 57 b0 92 be 0e | ..R....S.{W....|
000000f0 52 c2 0e c2 71 a4 d2 67 f5 80 e9 89 7b 6c d1 ea |R...q..g....{l..|
00000100 7c 83 f1 af 13 3e b6 69 62 e7 10 ed 75 c8 f8 cf ||....>.ib...u...|
00000110 60 07 d8 9a 46 e6 4f b4 22 f2 f7 ca ba ed 36 f9 |`...F.O.".....6.|
00000120 f3 ac a9 e0 f3 e5 37 b0 b0 7d 23 ed b9 7f 1f b3 |......7..}#.....|
00000130 57 38 7c c3 34 b0 78 a5 e8 29 a9 cb 35 17 68 4d |W8|.4.x..)..5.hM|
00000140 dd 8f 35 9c f1 b5 e6 e6 29 00 3b 1c ac 5d d0 cd |..5.....).;..]..|
00000150 1f a0 a8 a1 25 b0 97 53 ed 9a 72 a8 f0 61 0b 66 |....%..S..r..a.f|
00000160 2c 67 c9 e1 dd 86 6a 14 54 00 7b 90 7e 3c d2 5c |,g....j.T.{.~<.\|
00000170 d8 d3 a2 a0 cd c9 b2 82 8f 48 a0 22 49 63 54 6d |.........H."IcTm|
00000180 9f 04 f9 47 27 db 4f 3d 41 82 4a 1a be 4a b7 2f |...G'.O=A.J..J./|
00000190 81 c5 ad 12 cc 1e 45 f8 bb 42 93 ea 4b 24 97 44 |......E..B..K$.D|
000001a0 6b c4 4c 4d f4 61 08 0c a3 37 20 48 d3 be 47 71 |k.LM.a...7 H..Gq|
000001b0 1b b2 8a a1 eb 9f b9 17 61 07 64 15 29 6e fc 93 |........a.d.)n..|
000001c0 7d 21 fd 7d f2 09 6b 9c 5f 05 79 2b dc e0 c6 d4 |}!.}..k._.y+....|
000001d0 03 d4 9e 23 f2 3e 4b 23 11 5e 58 ec a8 5e 96 63 |...#.>K#.^X..^.c|
000001e0 6d 51 22 d5 3e e3 de ee 1a c5 d5 85 c3 c5 c4 05 |mQ".>...........|
000001f0 38 4c bd 54 b4 1e 6a 64 5a 9a 3e 48 82 ec e7 fe |8L.T..jdZ.>H....|
00000200 6a 67 a5 30 c0 fc fd c6 7e d4 d0 68 a7 30 40 e0 |jg.0....~..h.0@.|
00000210 87 c1 5d 75 0b a0 4f 90 f7 46 51 18 8b 02 36 c5 |..]u..O..FQ...6.|
00000220 fb b5 54 bd 32 75 dc 63 84 6f 61 a5 36 fe a6 23 |..T.2u.c.oa.6..#|
00000230 f8 a5 b9 cc af 00 e4 83 c0 11 50 ad 81 2b e2 bd |..........P..+..|
00000240 20 08 85 11 40 5e 66 25 d8 ac 06 a3 a2 10 dc 52 | ...@^f%.......R|
00000250 7a d5 13 61 82 b5 48 83 02 32 7b 20 96 78 40 14 |z..a..H..2{ .x@.|
00000260 38 10 9f 88 25 d3 60 3c 7e e4 11 da a9 6e 1e 58 |8...%.`<~....n.X|
00000270 13 de d8 d4 74 78 b2 5f 8c ce 9c ce 33 5c 1a 6e |....tx._....3\.n|
00000280 76 56 49 a4 54 0c ab 20 b9 c6 20 d4 fa b8 6f 41 |vVI.T.. .. ...oA|
00000290 81 1a 7e f4 |..~.|
>>> Flow 14 (server to client)
00000000 00 00 00 10 6e 70 e8 37 1b 64 e5 98 df 83 52 b2 |....np.7.d....R.|
00000010 40 ca 82 24 96 8c 21 c4 df d2 ec a8 d8 c7 b1 48 |@..$..!........H|
00000020 c2 48 90 90 |.H..|
+289
View File
@@ -0,0 +1,289 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 9c 06 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |........+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 44 63 75 72 76 65 32 |EPv..>...Dcurve2|
00000020 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 62 73 |5519-sha256@libs|
00000030 73 68 2e 6f 72 67 2c 65 78 74 2d 69 6e 66 6f 2d |sh.org,ext-info-|
00000040 63 2c 6b 65 78 2d 73 74 72 69 63 74 2d 63 2d 76 |c,kex-strict-c-v|
00000050 30 30 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 00 00 |00@openssh.com..|
00000060 00 57 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |.Wecdsa-sha2-nis|
00000070 74 70 32 35 36 2c 65 63 64 73 61 2d 73 68 61 32 |tp256,ecdsa-sha2|
00000080 2d 6e 69 73 74 70 33 38 34 2c 65 63 64 73 61 2d |-nistp384,ecdsa-|
00000090 73 68 61 32 2d 6e 69 73 74 70 35 32 31 2c 73 73 |sha2-nistp521,ss|
000000a0 68 2d 72 73 61 2c 73 73 68 2d 64 73 73 2c 73 73 |h-rsa,ssh-dss,ss|
000000b0 68 2d 65 64 32 35 35 31 39 00 00 00 6c 61 65 73 |h-ed25519...laes|
000000c0 31 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e |128-gcm@openssh.|
000000d0 63 6f 6d 2c 61 65 73 32 35 36 2d 67 63 6d 40 6f |com,aes256-gcm@o|
000000e0 70 65 6e 73 73 68 2e 63 6f 6d 2c 63 68 61 63 68 |penssh.com,chach|
000000f0 61 32 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 |a20-poly1305@ope|
00000100 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d |nssh.com,aes128-|
00000110 63 74 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 |ctr,aes192-ctr,a|
00000120 65 73 32 35 36 2d 63 74 72 00 00 00 6c 61 65 73 |es256-ctr...laes|
00000130 31 32 38 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e |128-gcm@openssh.|
00000140 63 6f 6d 2c 61 65 73 32 35 36 2d 67 63 6d 40 6f |com,aes256-gcm@o|
00000150 70 65 6e 73 73 68 2e 63 6f 6d 2c 63 68 61 63 68 |penssh.com,chach|
00000160 61 32 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 |a20-poly1305@ope|
00000170 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d |nssh.com,aes128-|
00000180 63 74 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 |ctr,aes192-ctr,a|
00000190 65 73 32 35 36 2d 63 74 72 00 00 00 6e 68 6d 61 |es256-ctr...nhma|
000001a0 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f |c-sha2-256-etm@o|
000001b0 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d |penssh.com,hmac-|
000001c0 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 |sha2-512-etm@ope|
000001d0 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
000001e0 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
000001f0 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 2c 68 |-512,hmac-sha1,h|
00000200 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 00 6e 68 |mac-sha1-96...nh|
00000210 6d 61 63 2d 73 68 61 32 2d 32 35 36 2d 65 74 6d |mac-sha2-256-etm|
00000220 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 |@openssh.com,hma|
00000230 63 2d 73 68 61 32 2d 35 31 32 2d 65 74 6d 40 6f |c-sha2-512-etm@o|
00000240 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d |penssh.com,hmac-|
00000250 73 68 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 |sha2-256,hmac-sh|
00000260 61 32 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 |a2-512,hmac-sha1|
00000270 2c 68 6d 61 63 2d 73 68 61 31 2d 39 36 00 00 00 |,hmac-sha1-96...|
00000280 04 6e 6f 6e 65 00 00 00 04 6e 6f 6e 65 00 00 00 |.none....none...|
00000290 00 00 00 00 00 00 00 00 00 00 d7 3b 80 93 f6 ef |...........;....|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 b0 cd 36 b8 9a 47 6c e0 8f a2 |........6..Gl...|
00000010 06 ec 96 16 17 7c 00 00 01 7a 73 6e 74 72 75 70 |.....|...zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 2c 06 1e 00 00 00 20 ee a0 9c c6 be 90 |...,..... ......|
00000010 37 5d 28 ba ea a8 41 a5 72 c8 5e 4d 2d 23 c4 f9 |7](...A.r.^M-#..|
00000020 26 88 44 60 fc 30 d9 da 91 6a a3 63 9c a8 a1 e3 |&.D`.0...j.c....|
>>> Flow 6 (server to client)
00000000 00 00 01 04 0a 1f 00 00 00 68 00 00 00 13 65 63 |.........h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 00 20 18 93 88 e4 65 66 c6 6a 6e 8e |..... ....ef.jn.|
00000080 26 98 82 64 63 d0 3f 29 9a 7c 42 ca 2d f3 16 24 |&..dc.?).|B.-..$|
00000090 1c 7f 22 9d 9c 6f 00 00 00 64 00 00 00 13 65 63 |.."..o...d....ec|
000000a0 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
000000b0 36 00 00 00 49 00 00 00 20 46 20 40 87 9c 83 06 |6...I... F @....|
000000c0 c7 08 5e 36 4d f7 b4 2a 48 7e 01 8e af 7c 90 41 |..^6M..*H~...|.A|
000000d0 ed 43 26 fb 56 3e 47 67 ad 00 00 00 21 00 bf a9 |.C&.V>Gg....!...|
000000e0 45 23 c7 27 0b 7a df 14 a0 15 af 82 e5 43 09 5a |E#.'.z.......C.Z|
000000f0 2a 23 30 c3 d7 66 36 d8 cd 83 d7 e6 15 4f 00 00 |*#0..f6......O..|
00000100 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
00000110 00 00 00 00 00 00 00 00 00 00 01 40 e8 49 e6 95 |...........@.I..|
00000120 02 27 90 c3 8d 11 8f f4 3b 85 09 dc 8e 93 f6 5e |.'......;......^|
00000130 3d 03 64 18 71 86 40 0d fb ef 22 a8 36 01 8a 07 |=.d.q.@...".6...|
00000140 96 1a 13 e1 66 70 aa e3 22 62 de c4 61 bf 64 4e |....fp.."b..a.dN|
00000150 33 24 6c e5 c4 f0 b2 20 21 31 20 3b 3d 54 0f bc |3$l.... !1 ;=T..|
00000160 4c 24 27 c7 83 94 b1 f7 89 0c ea fb 8e a8 e7 6e |L$'............n|
00000170 84 d2 da c5 77 f0 d4 64 c2 09 d5 20 1c f6 94 46 |....w..d... ...F|
00000180 85 20 79 35 e3 3e 2a 3d 86 d3 8a 99 a2 95 dc ca |. y5.>*=........|
00000190 ef e0 53 06 de e8 4a 36 3b 41 a4 21 49 5f 50 e9 |..S...J6;A.!I_P.|
000001a0 84 9d 0b a6 92 80 0a 9a 89 d9 db f8 24 a6 5f 2d |............$._-|
000001b0 e1 7b f5 31 a4 c9 a7 7f 07 f0 60 68 09 25 5b 97 |.{.1......`h.%[.|
000001c0 fe b0 ce d2 74 fb e3 92 27 a8 4f 8a ff cc a4 cc |....t...'.O.....|
000001d0 78 85 52 44 a2 46 f2 36 cb 13 6b 1b 8a 77 c0 7c |x.RD.F.6..k..w.||
000001e0 16 6e 0f 33 d9 d0 aa 9d 25 b1 5f ba 7b 8d da bd |.n.3....%._.{...|
000001f0 fe 0f 4f f6 20 e7 1d bc 7f 19 b6 bc 7f d0 ae f3 |..O. ...........|
00000200 70 da 69 fa e2 9e 15 9e c2 e6 23 0f c2 1a 30 9a |p.i.......#...0.|
00000210 00 64 d3 ba 91 c5 ec 43 dc a1 82 87 5d 63 67 6c |.d.....C....]cgl|
00000220 02 99 04 ca cd a8 ef 35 61 54 60 59 92 4c 85 7e |.......5aT`Y.L.~|
00000230 3a a7 2c c0 25 e2 a4 a4 f5 cf 96 5f 04 2a c1 ad |:.,.%......_.*..|
00000240 1d 3e d8 0c 50 f6 1b e7 0b b1 e2 4c b6 cf 1f f0 |.>..P......L....|
00000250 fa e5 4b 42 b9 e6 44 35 f2 be bc 2a b9 62 a8 43 |..KB..D5...*.b.C|
00000260 1c 09 68 c3 85 48 b3 9a b7 75 95 79 |..h..H...u.y|
>>> Flow 7 (client to server)
00000000 00 00 00 0c 0a 15 f9 ae 57 e2 35 b8 cc 87 3c 23 |........W.5...<#|
00000010 00 00 00 20 1c 89 71 b1 5d 73 b7 6f d6 14 e8 79 |... ..q.]s.o...y|
00000020 50 e9 90 fa 11 7b a6 25 a1 95 84 ff c8 44 1c b1 |P....{.%.....D..|
00000030 43 88 2d c5 0c 40 61 5a a9 28 4c c9 77 00 82 87 |C.-..@aZ.(L.w...|
00000040 4e 86 bd 67 |N..g|
>>> Flow 8 (server to client)
00000000 00 00 00 20 b2 8d 5d a8 d5 32 77 c5 a4 6a 51 0f |... ..]..2w..jQ.|
00000010 42 55 ec b4 16 5a 94 ad bd 2a dd 01 c3 37 58 0d |BU...Z...*...7X.|
00000020 f0 0e 3d 28 8b f6 2f 3a 64 4c 5d bc 84 5d bc 7f |..=(../:dL]..]..|
00000030 59 24 98 0f |Y$..|
>>> Flow 9 (client to server)
00000000 00 00 00 30 9b ac 39 ff 48 bf fe d0 dd 87 5f 14 |...0..9.H....._.|
00000010 08 03 9b 20 89 fa 84 fb dd 4a 35 b2 74 2b 99 a9 |... .....J5.t+..|
00000020 aa a9 ea 89 91 09 93 fe f0 15 71 55 2e 37 b6 29 |..........qU.7.)|
00000030 68 0f 0f 67 59 1b 3e dd 69 d3 d3 52 c6 78 1e f0 |h..gY.>.i..R.x..|
00000040 3e b2 bc cc |>...|
>>> Flow 10 (server to client)
00000000 00 00 00 20 68 e7 bd c2 ed f5 29 52 3d a4 1b 2b |... h.....)R=..+|
00000010 f0 aa 11 47 7a 0b 39 77 2c aa 7a d4 28 15 60 85 |...Gz.9w,.z.(.`.|
00000020 c6 15 d3 9c 30 d3 36 e6 0b b1 d3 10 c1 66 e6 dc |....0.6......f..|
00000030 eb 75 91 6b 00 00 00 40 78 c3 94 19 9f 78 9c dd |.u.k...@x....x..|
00000040 dd 7d a5 ec 56 dd de 7a e4 ac 78 47 d3 10 b6 d9 |.}..V..z..xG....|
00000050 7f 5c 8d 32 16 32 d0 63 06 e4 8a 64 8a 82 0e 02 |.\.2.2.c...d....|
00000060 71 7e 01 2f 90 29 89 cb e9 6b 2e 8d 92 0d 60 89 |q~./.)...k....`.|
00000070 5a 45 04 45 c1 d4 04 50 8b 99 44 2c 02 de a5 7b |ZE.E...P..D,...{|
00000080 31 0c dd 93 0d 58 1d 6e |1....X.n|
>>> Flow 11 (client to server)
00000000 00 00 01 60 05 5a 2a 52 6e 58 06 70 de 77 4a 66 |...`.Z*RnX.p.wJf|
00000010 6a 2f 3e 38 4b 7c 86 00 b1 0a 29 04 5c 0b 33 7e |j/>8K|....).\.3~|
00000020 fb 6e 20 8c b3 e0 5e d7 83 53 4c 46 c5 66 11 31 |.n ...^..SLF.f.1|
00000030 bb 79 ee c4 69 9c 5e 8e c2 95 29 2b 71 ce e5 92 |.y..i.^...)+q...|
00000040 b6 a7 de 9f 4d 1b 7c ee e0 70 41 cc c9 b5 09 ac |....M.|..pA.....|
00000050 93 59 eb d6 f4 5d 36 77 06 18 6c 48 70 1f 66 1d |.Y...]6w..lHp.f.|
00000060 0f 5d cc ac 05 ae cc 4f 20 0c 69 38 b5 84 21 48 |.].....O .i8..!H|
00000070 91 4c f3 cf ee a3 d7 8d 9f f0 04 e8 e3 d2 dc 5d |.L.............]|
00000080 4f 19 7d 8e 6c 41 68 ea 48 45 82 29 8d 7d 07 47 |O.}.lAh.HE.).}.G|
00000090 31 7c b2 4f ea c5 25 2a f4 69 7a ce b0 72 56 8c |1|.O..%*.iz..rV.|
000000a0 43 78 7d ca 2c 68 b1 8a 40 17 44 9b c9 d6 9d 36 |Cx}.,h..@.D....6|
000000b0 28 1a 3f b8 88 4b 1e 9d 45 bf 20 52 d3 0a 42 93 |(.?..K..E. R..B.|
000000c0 1c 46 52 ed 5c df 99 90 45 ed ab 7e 6d e1 4b 7c |.FR.\...E..~m.K||
000000d0 2a 79 c5 32 f6 72 86 38 7f f5 ae 6c 8b 87 ca de |*y.2.r.8...l....|
000000e0 57 90 82 e7 a6 0e 31 36 b3 60 03 61 df 53 36 6e |W.....16.`.a.S6n|
000000f0 31 16 2f 77 7c 44 d2 87 24 3e 3f d4 81 fd d5 88 |1./w|D..$>?.....|
00000100 a2 e2 fe 8f 8b 4b e8 24 56 2d 8d 50 fc d9 7c 39 |.....K.$V-.P..|9|
00000110 5e 99 a7 6d df 3e 3d 9e 32 01 63 37 f3 64 f7 64 |^..m.>=.2.c7.d.d|
00000120 a0 c7 66 8f 7a 50 da c3 5f 19 07 14 09 e2 0a 10 |..f.zP.._.......|
00000130 f9 83 7e 6e 60 b4 50 3d c4 34 5e 37 e3 b5 be f5 |..~n`.P=.4^7....|
00000140 13 c1 54 5d 66 47 9b 77 35 18 6f 9d c4 97 82 f5 |..T]fG.w5.o.....|
00000150 c6 b0 32 28 76 89 43 d1 4e 2d 14 ac 75 d9 41 51 |..2(v.C.N-..u.AQ|
00000160 19 7a b2 18 fb f0 d7 3b 9e f0 c0 80 c6 20 b8 cf |.z.....;..... ..|
00000170 30 16 3f d9 |0.?.|
>>> Flow 12 (server to client)
00000000 00 00 01 40 82 4b b0 d9 9c 0a 97 38 ff 35 cb 0c |...@.K.....8.5..|
00000010 1b c5 a9 d9 63 1c a5 12 3a 22 8f 93 c2 e3 30 f7 |....c...:"....0.|
00000020 d0 dd b5 89 3d 2d f4 d6 b3 d6 ee 65 24 2d 19 ea |....=-.....e$-..|
00000030 04 0d 31 ff a4 d0 7c d3 09 5f 0b 36 c0 26 5f 56 |..1...|.._.6.&_V|
00000040 0f 0d af 9a 00 1a d9 8a e7 b8 fc d1 0f 0f 99 2d |...............-|
00000050 ee 1e a5 52 8e dc 21 80 a0 29 e2 98 99 3d df b5 |...R..!..)...=..|
00000060 f9 4a f7 9f 07 4a 6f 06 ce 70 77 e2 f5 7d 53 52 |.J...Jo..pw..}SR|
00000070 9a 15 82 81 5f 9a dc 69 ca c8 84 91 52 9d 7d f6 |...._..i....R.}.|
00000080 1a 4b be 90 d7 60 f9 f9 b6 6c 8a 16 96 c3 8c f9 |.K...`...l......|
00000090 3e bb 2c 3d f9 aa 40 bd a6 a8 f0 47 0a 15 e5 bd |>.,=..@....G....|
000000a0 7a 42 01 b5 28 d2 46 7b 39 83 b9 49 2c ce ea 00 |zB..(.F{9..I,...|
000000b0 50 a1 0a 1c 92 1c 9b a5 58 c6 0f 7e 5e 4b af 88 |P.......X..~^K..|
000000c0 c5 06 f9 f8 5d a5 99 a3 a4 92 74 84 c9 ca 34 cd |....].....t...4.|
000000d0 86 20 32 e0 dd 2a 69 f7 eb 71 37 3f b2 63 7d 9f |. 2..*i..q7?.c}.|
000000e0 6b 7d c7 4a fd 57 67 a1 a0 22 f6 a3 cf 46 c7 ed |k}.J.Wg.."...F..|
000000f0 38 cf 41 d3 f1 f0 8b 9f dd 6a 73 f3 0a e8 e5 f2 |8.A......js.....|
00000100 84 f0 d6 b5 d2 ba 3e af 11 db d8 df ba aa 85 e6 |......>.........|
00000110 44 86 1c 85 9e 6b 57 d7 6c 80 4c ef 44 fb f1 14 |D....kW.l.L.D...|
00000120 8b 99 4a 61 8a 37 8d 5b 54 53 6a cd 5c 6f 9f 0c |..Ja.7.[TSj.\o..|
00000130 86 dc db 97 e4 2c ff 64 cf f8 69 9e 82 0d 28 3e |.....,.d..i...(>|
00000140 a9 91 e4 39 68 9d 4a 76 cf 99 7c ac 40 90 a6 0d |...9h.Jv..|.@...|
00000150 8e e0 62 05 |..b.|
>>> Flow 13 (client to server)
00000000 00 00 02 80 87 c1 35 bf fa 7e d1 55 cd 2e e9 80 |......5..~.U....|
00000010 ee a5 09 06 87 ea e0 49 a4 c3 be 1d fb a4 ef 74 |.......I.......t|
00000020 35 1f 18 7b 46 fc 07 82 50 89 b6 63 67 6a c8 72 |5..{F...P..cgj.r|
00000030 1c 86 32 33 8b 94 72 ce 41 15 82 02 f2 31 5e 03 |..23..r.A....1^.|
00000040 72 28 77 e4 5d 55 df 53 c5 07 d0 62 db 3b 70 f4 |r(w.]U.S...b.;p.|
00000050 10 76 36 4f ea 0c 6f eb 63 c5 d8 7f ce e9 34 d2 |.v6O..o.c.....4.|
00000060 a1 b1 ee 97 bd d6 d2 2f 35 a8 35 86 2e 7f a4 0c |......./5.5.....|
00000070 da 32 59 8f c1 69 b2 f2 9d b7 50 8f 91 4d 0f d8 |.2Y..i....P..M..|
00000080 90 19 6d 63 72 bd 8b 26 08 65 66 64 d3 85 60 fc |..mcr..&.efd..`.|
00000090 d8 df 74 44 e9 6f b7 63 84 d3 34 21 58 22 ff 36 |..tD.o.c..4!X".6|
000000a0 f5 f9 2b db 4f b6 13 2c 02 b5 52 5b be 20 db 1e |..+.O..,..R[. ..|
000000b0 6d 3c 00 cb 85 f0 88 32 98 e5 4d f6 e4 8d a5 5b |m<.....2..M....[|
000000c0 93 ea 44 3e 53 87 0d 68 f8 b5 7e e2 7f 66 f5 4b |..D>S..h..~..f.K|
000000d0 72 17 fd 3d 7b c9 1d 4a ef 57 1e 98 2a 70 b9 60 |r..={..J.W..*p.`|
000000e0 ef 13 ea 39 c4 50 96 5f c6 b4 2c 3e bc 8e df e2 |...9.P._..,>....|
000000f0 7d 90 79 ab c8 98 b8 30 e0 c7 46 31 20 a4 f5 b3 |}.y....0..F1 ...|
00000100 07 bc 6f d4 58 5b 4f 89 df fe 2b d8 d2 6b b8 2e |..o.X[O...+..k..|
00000110 48 8e aa 0e f1 34 5e 5f fb e3 28 10 a6 d9 63 c9 |H....4^_..(...c.|
00000120 79 9c 67 d8 e7 3b 2b 1d 66 d1 84 28 46 a2 84 9f |y.g..;+.f..(F...|
00000130 ed 94 4d 15 5d 26 ec 61 0c cb 5f d9 26 4c df 9d |..M.]&.a.._.&L..|
00000140 cc 18 80 de 2e 4b 33 76 35 87 c6 c3 8f 98 1c 0b |.....K3v5.......|
00000150 77 55 79 7a fa 70 44 09 bb 62 11 51 64 62 69 d1 |wUyz.pD..b.Qdbi.|
00000160 06 a4 c6 54 d4 7c bb 1f 1a b3 4e 42 2c 2e d8 29 |...T.|....NB,..)|
00000170 dd ff 50 1c ec 30 f9 b2 bc da 0d 93 37 87 c5 9f |..P..0......7...|
00000180 4b 3a d0 8d 12 77 09 1d 29 b3 34 8f cc ce 43 f6 |K:...w..).4...C.|
00000190 1f 0f e4 cc 54 60 25 aa ca c7 99 60 00 93 72 46 |....T`%....`..rF|
000001a0 21 9c 68 a1 eb ff cb 44 7a b7 57 b3 9b 9c 14 a8 |!.h....Dz.W.....|
000001b0 a4 19 13 99 58 cf 18 49 64 95 03 eb 1a dc d6 32 |....X..Id......2|
000001c0 f7 d9 23 fe 08 d6 0b da ec d7 06 54 13 78 e3 c3 |..#........T.x..|
000001d0 4e f4 d5 ff 9a 84 c9 62 ba 40 eb 10 0f 41 f9 0e |N......b.@...A..|
000001e0 4f d9 15 ad fe f4 09 f0 ee c7 b6 39 5a ef d0 24 |O..........9Z..$|
000001f0 16 d3 95 39 cb 2f 50 30 8c b9 c1 d9 95 98 1f 74 |...9./P0.......t|
00000200 a1 db 6d 2d fc 33 61 c2 d9 d1 91 41 f3 ae 69 1b |..m-.3a....A..i.|
00000210 e3 e6 9f 90 84 04 d0 1e 0c a0 7c 94 78 f0 69 5f |..........|.x.i_|
00000220 43 a4 66 3d 1c 5e a6 eb c6 a5 3b 0e 61 82 65 66 |C.f=.^....;.a.ef|
00000230 26 fa 90 43 3b 0f 11 07 ab b1 3c cc 9a 40 80 79 |&..C;.....<..@.y|
00000240 c4 d1 da 40 71 70 11 d1 93 31 4a 44 91 f0 39 87 |...@qp...1JD..9.|
00000250 0a ed 53 e0 e4 00 9e 93 6d e7 a8 14 f1 69 84 49 |..S.....m....i.I|
00000260 d8 97 6c f0 db ab a0 13 1a e8 9b bf 43 a2 3e 84 |..l.........C.>.|
00000270 d2 45 16 d6 8d c9 85 f5 39 05 4b 3f db f3 87 47 |.E......9.K?...G|
00000280 56 36 fe 46 7b 36 4f 38 be 3a 13 bb 82 5f 59 5d |V6.F{6O8.:..._Y]|
00000290 a9 ec b3 02 |....|
>>> Flow 14 (server to client)
00000000 00 00 00 10 4a 36 13 a2 c0 c1 a9 77 7c dc 8e 24 |....J6.....w|..$|
00000010 4c 39 78 70 1c a1 07 99 21 50 ee 27 b9 7e 41 e0 |L9xp....!P.'.~A.|
00000020 99 80 7d 96 |..}.|
@@ -0,0 +1,340 @@
>>> Flow 1 (client to server)
00000000 53 53 48 2d 32 2e 30 2d 47 6f 0d 0a |SSH-2.0-Go..|
>>> Flow 2 (server to client)
00000000 53 53 48 2d 32 2e 30 2d 4f 70 65 6e 53 53 48 5f |SSH-2.0-OpenSSH_|
00000010 39 2e 39 0d 0a |9.9..|
>>> Flow 3 (client to server)
00000000 00 00 02 ac 0e 14 7f 9c 2b a4 e8 8f 82 7d 61 60 |........+....}a`|
00000010 45 50 76 05 85 3e 00 00 00 4c 64 69 66 66 69 65 |EPv..>...Ldiffie|
00000020 2d 68 65 6c 6c 6d 61 6e 2d 67 72 6f 75 70 2d 65 |-hellman-group-e|
00000030 78 63 68 61 6e 67 65 2d 73 68 61 32 35 36 2c 65 |xchange-sha256,e|
00000040 78 74 2d 69 6e 66 6f 2d 63 2c 6b 65 78 2d 73 74 |xt-info-c,kex-st|
00000050 72 69 63 74 2d 63 2d 76 30 30 40 6f 70 65 6e 73 |rict-c-v00@opens|
00000060 73 68 2e 63 6f 6d 00 00 00 57 65 63 64 73 61 2d |sh.com...Wecdsa-|
00000070 73 68 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 |sha2-nistp256,ec|
00000080 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 |dsa-sha2-nistp38|
00000090 34 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |4,ecdsa-sha2-nis|
000000a0 74 70 35 32 31 2c 73 73 68 2d 72 73 61 2c 73 73 |tp521,ssh-rsa,ss|
000000b0 68 2d 64 73 73 2c 73 73 68 2d 65 64 32 35 35 31 |h-dss,ssh-ed2551|
000000c0 39 00 00 00 6c 61 65 73 31 32 38 2d 67 63 6d 40 |9...laes128-gcm@|
000000d0 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 32 |openssh.com,aes2|
000000e0 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 |56-gcm@openssh.c|
000000f0 6f 6d 2c 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 |om,chacha20-poly|
00000100 31 33 30 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |1305@openssh.com|
00000110 2c 61 65 73 31 32 38 2d 63 74 72 2c 61 65 73 31 |,aes128-ctr,aes1|
00000120 39 32 2d 63 74 72 2c 61 65 73 32 35 36 2d 63 74 |92-ctr,aes256-ct|
00000130 72 00 00 00 6c 61 65 73 31 32 38 2d 67 63 6d 40 |r...laes128-gcm@|
00000140 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 65 73 32 |openssh.com,aes2|
00000150 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 68 2e 63 |56-gcm@openssh.c|
00000160 6f 6d 2c 63 68 61 63 68 61 32 30 2d 70 6f 6c 79 |om,chacha20-poly|
00000170 31 33 30 35 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |1305@openssh.com|
00000180 2c 61 65 73 31 32 38 2d 63 74 72 2c 61 65 73 31 |,aes128-ctr,aes1|
00000190 39 32 2d 63 74 72 2c 61 65 73 32 35 36 2d 63 74 |92-ctr,aes256-ct|
000001a0 72 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 2d 32 |r...nhmac-sha2-2|
000001b0 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |56-etm@openssh.c|
000001c0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 |om,hmac-sha2-512|
000001d0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000001e0 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c 68 |,hmac-sha2-256,h|
000001f0 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d 61 |mac-sha2-512,hma|
00000200 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 61 31 |c-sha1,hmac-sha1|
00000210 2d 39 36 00 00 00 6e 68 6d 61 63 2d 73 68 61 32 |-96...nhmac-sha2|
00000220 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e 73 73 68 |-256-etm@openssh|
00000230 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 35 |.com,hmac-sha2-5|
00000240 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |12-etm@openssh.c|
00000250 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
00000260 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 |,hmac-sha2-512,h|
00000270 6d 61 63 2d 73 68 61 31 2c 68 6d 61 63 2d 73 68 |mac-sha1,hmac-sh|
00000280 61 31 2d 39 36 00 00 00 04 6e 6f 6e 65 00 00 00 |a1-96....none...|
00000290 04 6e 6f 6e 65 00 00 00 00 00 00 00 00 00 00 00 |.none...........|
000002a0 00 00 d7 3b 80 93 f6 ef bc 88 eb 1a 6e ac fa 66 |...;........n..f|
>>> Flow 4 (server to client)
00000000 00 00 04 9c 0a 14 ce fa 42 f0 01 84 db 18 f9 c1 |........B.......|
00000010 aa 81 b5 e1 09 eb 00 00 01 7a 73 6e 74 72 75 70 |.........zsntrup|
00000020 37 36 31 78 32 35 35 31 39 2d 73 68 61 35 31 32 |761x25519-sha512|
00000030 2c 73 6e 74 72 75 70 37 36 31 78 32 35 35 31 39 |,sntrup761x25519|
00000040 2d 73 68 61 35 31 32 40 6f 70 65 6e 73 73 68 2e |-sha512@openssh.|
00000050 63 6f 6d 2c 6d 6c 6b 65 6d 37 36 38 78 32 35 35 |com,mlkem768x255|
00000060 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 65 32 |19-sha256,curve2|
00000070 35 35 31 39 2d 73 68 61 32 35 36 2c 63 75 72 76 |5519-sha256,curv|
00000080 65 32 35 35 31 39 2d 73 68 61 32 35 36 40 6c 69 |e25519-sha256@li|
00000090 62 73 73 68 2e 6f 72 67 2c 65 63 64 68 2d 73 68 |bssh.org,ecdh-sh|
000000a0 61 32 2d 6e 69 73 74 70 32 35 36 2c 65 63 64 68 |a2-nistp256,ecdh|
000000b0 2d 73 68 61 32 2d 6e 69 73 74 70 33 38 34 2c 65 |-sha2-nistp384,e|
000000c0 63 64 68 2d 73 68 61 32 2d 6e 69 73 74 70 35 32 |cdh-sha2-nistp52|
000000d0 31 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e |1,diffie-hellman|
000000e0 2d 67 72 6f 75 70 2d 65 78 63 68 61 6e 67 65 2d |-group-exchange-|
000000f0 73 68 61 32 35 36 2c 64 69 66 66 69 65 2d 68 65 |sha256,diffie-he|
00000100 6c 6c 6d 61 6e 2d 67 72 6f 75 70 31 36 2d 73 68 |llman-group16-sh|
00000110 61 35 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c |a512,diffie-hell|
00000120 6d 61 6e 2d 67 72 6f 75 70 31 38 2d 73 68 61 35 |man-group18-sha5|
00000130 31 32 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 |12,diffie-hellma|
00000140 6e 2d 67 72 6f 75 70 31 34 2d 73 68 61 32 35 36 |n-group14-sha256|
00000150 2c 64 69 66 66 69 65 2d 68 65 6c 6c 6d 61 6e 2d |,diffie-hellman-|
00000160 67 72 6f 75 70 31 34 2d 73 68 61 31 2c 65 78 74 |group14-sha1,ext|
00000170 2d 69 6e 66 6f 2d 73 2c 6b 65 78 2d 73 74 72 69 |-info-s,kex-stri|
00000180 63 74 2d 73 2d 76 30 30 40 6f 70 65 6e 73 73 68 |ct-s-v00@openssh|
00000190 2e 63 6f 6d 00 00 00 2d 72 73 61 2d 73 68 61 32 |.com...-rsa-sha2|
000001a0 2d 35 31 32 2c 72 73 61 2d 73 68 61 32 2d 32 35 |-512,rsa-sha2-25|
000001b0 36 2c 65 63 64 73 61 2d 73 68 61 32 2d 6e 69 73 |6,ecdsa-sha2-nis|
000001c0 74 70 32 35 36 00 00 00 6c 63 68 61 63 68 61 32 |tp256...lchacha2|
000001d0 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
000001e0 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
000001f0 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000200 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000210 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000220 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
00000230 68 2e 63 6f 6d 00 00 00 6c 63 68 61 63 68 61 32 |h.com...lchacha2|
00000240 30 2d 70 6f 6c 79 31 33 30 35 40 6f 70 65 6e 73 |0-poly1305@opens|
00000250 73 68 2e 63 6f 6d 2c 61 65 73 31 32 38 2d 63 74 |sh.com,aes128-ct|
00000260 72 2c 61 65 73 31 39 32 2d 63 74 72 2c 61 65 73 |r,aes192-ctr,aes|
00000270 32 35 36 2d 63 74 72 2c 61 65 73 31 32 38 2d 67 |256-ctr,aes128-g|
00000280 63 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 61 |cm@openssh.com,a|
00000290 65 73 32 35 36 2d 67 63 6d 40 6f 70 65 6e 73 73 |es256-gcm@openss|
000002a0 68 2e 63 6f 6d 00 00 00 d5 75 6d 61 63 2d 36 34 |h.com....umac-64|
000002b0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000002c0 2c 75 6d 61 63 2d 31 32 38 2d 65 74 6d 40 6f 70 |,umac-128-etm@op|
000002d0 65 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 |enssh.com,hmac-s|
000002e0 68 61 32 2d 32 35 36 2d 65 74 6d 40 6f 70 65 6e |ha2-256-etm@open|
000002f0 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 |ssh.com,hmac-sha|
00000300 32 2d 35 31 32 2d 65 74 6d 40 6f 70 65 6e 73 73 |2-512-etm@openss|
00000310 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 61 31 2d |h.com,hmac-sha1-|
00000320 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c |etm@openssh.com,|
00000330 75 6d 61 63 2d 36 34 40 6f 70 65 6e 73 73 68 2e |umac-64@openssh.|
00000340 63 6f 6d 2c 75 6d 61 63 2d 31 32 38 40 6f 70 65 |com,umac-128@ope|
00000350 6e 73 73 68 2e 63 6f 6d 2c 68 6d 61 63 2d 73 68 |nssh.com,hmac-sh|
00000360 61 32 2d 32 35 36 2c 68 6d 61 63 2d 73 68 61 32 |a2-256,hmac-sha2|
00000370 2d 35 31 32 2c 68 6d 61 63 2d 73 68 61 31 00 00 |-512,hmac-sha1..|
00000380 00 d5 75 6d 61 63 2d 36 34 2d 65 74 6d 40 6f 70 |..umac-64-etm@op|
00000390 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 31 |enssh.com,umac-1|
000003a0 32 38 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 |28-etm@openssh.c|
000003b0 6f 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 |om,hmac-sha2-256|
000003c0 2d 65 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |-etm@openssh.com|
000003d0 2c 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2d 65 |,hmac-sha2-512-e|
000003e0 74 6d 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 68 |tm@openssh.com,h|
000003f0 6d 61 63 2d 73 68 61 31 2d 65 74 6d 40 6f 70 65 |mac-sha1-etm@ope|
00000400 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 63 2d 36 34 |nssh.com,umac-64|
00000410 40 6f 70 65 6e 73 73 68 2e 63 6f 6d 2c 75 6d 61 |@openssh.com,uma|
00000420 63 2d 31 32 38 40 6f 70 65 6e 73 73 68 2e 63 6f |c-128@openssh.co|
00000430 6d 2c 68 6d 61 63 2d 73 68 61 32 2d 32 35 36 2c |m,hmac-sha2-256,|
00000440 68 6d 61 63 2d 73 68 61 32 2d 35 31 32 2c 68 6d |hmac-sha2-512,hm|
00000450 61 63 2d 73 68 61 31 00 00 00 15 6e 6f 6e 65 2c |ac-sha1....none,|
00000460 7a 6c 69 62 40 6f 70 65 6e 73 73 68 2e 63 6f 6d |zlib@openssh.com|
00000470 00 00 00 15 6e 6f 6e 65 2c 7a 6c 69 62 40 6f 70 |....none,zlib@op|
00000480 65 6e 73 73 68 2e 63 6f 6d 00 00 00 00 00 00 00 |enssh.com.......|
00000490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
>>> Flow 5 (client to server)
00000000 00 00 00 1c 0e 22 00 00 08 00 00 00 08 00 00 00 |....."..........|
00000010 20 00 ef 26 3c b1 ee a9 88 00 4b 93 10 3c fb 0a | ..&<.....K..<..|
>>> Flow 6 (server to client)
00000000 00 00 01 14 08 1f 00 00 01 01 00 f7 b6 db 13 59 |...............Y|
00000010 f9 0c 03 25 32 08 9b f3 ba e4 a2 ed 12 09 ee 18 |...%2...........|
00000020 1e 51 7d 24 23 8a 7e df 32 48 9c 1e 6f 3d ba 19 |.Q}$#.~.2H..o=..|
00000030 c0 14 89 ff 3b 6a 27 64 e9 32 b1 08 21 84 62 11 |....;j'd.2..!.b.|
00000040 1d 8c 83 4e b6 42 72 6f 08 fd be eb c0 8d c2 5a |...N.Bro.......Z|
00000050 2a bd 10 d7 2d e4 05 3e f4 b4 8a d3 85 a0 eb 97 |*...-..>........|
00000060 f1 ef 96 f0 1b aa 45 aa 91 4b ad 80 96 b9 79 19 |......E..K....y.|
00000070 f7 24 c1 07 5f cf ba 43 11 90 06 c6 1a 5f 4e 99 |.$.._..C....._N.|
00000080 1b 79 1e 10 56 73 0c f1 9e 92 15 b4 82 f6 04 71 |.y..Vs.........q|
00000090 04 26 9c 11 22 aa 14 a7 6b 55 37 62 1c 0a 62 0c |.&.."...kU7b..b.|
000000a0 e4 bd 63 a7 0b 89 8e 00 2d 19 bd 28 97 a1 d0 36 |..c.....-..(...6|
000000b0 b6 28 3e f9 cb 8a df 92 80 6c ae a8 ae fc de 63 |.(>......l.....c|
000000c0 f9 45 c5 f0 98 e1 18 24 be 34 93 22 5f 98 48 e0 |.E.....$.4."_.H.|
000000d0 8f 4a ab 4e 4c 36 21 d8 af 20 9c 02 05 86 83 33 |.J.NL6!.. .....3|
000000e0 2c e1 16 3d 15 8c 48 4e cf 99 09 5c 88 9b 90 01 |,..=..HN...\....|
000000f0 27 de 43 67 d2 a8 43 3e 5d 23 da b5 f5 ae bd a9 |'.Cg..C>]#......|
00000100 7c 42 5f 8b 16 97 59 f2 66 cc cb 00 00 00 01 02 ||B_...Y.f.......|
00000110 00 00 00 00 00 00 00 00 |........|
>>> Flow 7 (client to server)
00000000 00 00 01 0c 06 20 00 00 01 00 3d 5f 1a c6 e8 7d |..... ....=_...}|
00000010 30 eb 84 57 b6 e4 82 2e 1c 5d 84 fe 30 aa 8a 8d |0..W.....]..0...|
00000020 74 ff 44 9a 08 fb 46 6d a4 69 32 ad cc 61 d2 95 |t.D...Fm.i2..a..|
00000030 fd 16 ba f7 a0 ff d8 e0 57 81 e5 a7 e3 36 4b 0f |........W....6K.|
00000040 f5 17 05 19 38 7e 08 de e0 2c 1d 03 11 7c 94 49 |....8~...,...|.I|
00000050 ea a8 d0 fa 52 7e bc ac c5 88 08 53 2a 4a 31 e8 |....R~.....S*J1.|
00000060 d9 ce 61 d6 3b 82 fd 28 40 73 7c 7a 1b c6 7d 31 |..a.;..(@s|z..}1|
00000070 8b 9c ba 15 9d fb a1 67 12 8b 51 df 00 69 df b6 |.......g..Q..i..|
00000080 a7 d6 bd c8 0b a6 7e d2 87 c6 ae a4 ff 63 20 be |......~......c .|
00000090 34 ca 0b 09 35 46 d3 14 25 23 ac 4a cd d2 7a 10 |4...5F..%#.J..z.|
000000a0 79 b5 d3 8a 11 9f 66 bd 54 2b 00 5e d5 06 ee dd |y.....f.T+.^....|
000000b0 fb 85 36 36 78 95 f1 aa 05 cb 28 3e f2 7f 62 f6 |..66x.....(>..b.|
000000c0 8b aa af c6 13 c7 28 c3 3f e2 2d 33 6f ff 51 6d |......(.?.-3o.Qm|
000000d0 ef e3 d9 e3 42 97 f3 68 7e 4e da fc 93 ec c4 0c |....B..h~N......|
000000e0 9c 0a 8d 41 3c d9 3c 0d 1f 6b 0f e5 75 4d 9c 1b |...A<.<..k..uM..|
000000f0 1d 4f 2b b3 cf a5 9b af d6 e0 2e 2d 05 93 9a 44 |.O+........-...D|
00000100 38 28 7c 08 27 30 b7 68 92 4d 26 ed c0 96 31 b1 |8(|.'0.h.M&...1.|
>>> Flow 8 (server to client)
00000000 00 00 01 e4 09 21 00 00 00 68 00 00 00 13 65 63 |.....!...h....ec|
00000010 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000020 36 00 00 00 08 6e 69 73 74 70 32 35 36 00 00 00 |6....nistp256...|
00000030 41 04 8b d1 dd c3 a2 af 65 c5 b1 7e 0d 88 0e 10 |A.......e..~....|
00000040 3b 52 4a 43 b7 3c ed e9 9a 89 5d 2b 05 74 b7 7e |;RJC.<....]+.t.~|
00000050 2b 1e 12 dd 2c 78 71 53 be eb f6 4e 5d 19 cf 98 |+...,xqS...N]...|
00000060 d0 25 2d 4a a3 4a 15 2c 50 10 67 80 6d 2e d9 fa |.%-J.J.,P.g.m...|
00000070 84 a8 00 00 01 00 22 9c d1 15 5b 09 0e 26 5e 9e |......"...[..&^.|
00000080 07 7f c4 0f 06 80 aa 69 3f ad 26 1a e4 23 15 5e |.......i?.&..#.^|
00000090 0f f7 f3 25 dd 90 9e ee c8 ef dd bf 40 a6 f2 36 |...%........@..6|
000000a0 aa 5d 11 e0 79 8d 56 76 2e 38 26 f2 48 02 6f 67 |.]..y.Vv.8&.H.og|
000000b0 03 9e c5 e1 a2 00 40 28 92 74 9f f4 15 0b a7 eb |......@(.t......|
000000c0 bd 5b 61 8d f5 99 04 e3 bc 61 88 aa ff 32 cd b8 |.[a......a...2..|
000000d0 4c 47 62 7f 9f f4 d0 5b f2 cc 1b 2a b8 59 b4 bf |LGb....[...*.Y..|
000000e0 20 85 31 be 8c ec 9f b7 1b 7d a0 db 54 2a 6e 28 | .1......}..T*n(|
000000f0 46 bd 8a 8b d0 ab 7c a5 75 57 d9 c8 82 7e 3a 5b |F.....|.uW...~:[|
00000100 f2 37 bb 31 3e 31 7c 76 be 35 36 da a8 27 e0 8c |.7.1>1|v.56..'..|
00000110 f5 6f f3 59 7f 03 d0 43 cc 6a f9 35 cb 94 48 87 |.o.Y...C.j.5..H.|
00000120 bf 13 6b 55 76 cd 25 05 3a 6e 24 83 0a fb 8b 84 |..kUv.%.:n$.....|
00000130 a2 9f 11 4f 47 19 47 ce 8e 50 ed 0a 58 90 a8 4a |...OG.G..P..X..J|
00000140 a4 60 13 0c b5 08 ab cb c3 37 c4 dc ff e3 fa cb |.`.......7......|
00000150 58 ad ab 12 3e 78 63 e4 fc ba 87 9a 5c a7 9d 1d |X...>xc.....\...|
00000160 ba 55 31 6c be 30 cc e5 d1 78 dc 68 68 0b 06 3a |.U1l.0...x.hh..:|
00000170 6b d2 6f 00 89 7a 00 00 00 65 00 00 00 13 65 63 |k.o..z...e....ec|
00000180 64 73 61 2d 73 68 61 32 2d 6e 69 73 74 70 32 35 |dsa-sha2-nistp25|
00000190 36 00 00 00 4a 00 00 00 21 00 fa 2f 87 96 42 8a |6...J...!../..B.|
000001a0 6b ad 4f 7f 6a 18 23 7c 29 38 09 95 51 10 80 ad |k.O.j.#|)8..Q...|
000001b0 64 82 73 dc 51 c0 60 f8 72 95 00 00 00 21 00 a1 |d.s.Q.`.r....!..|
000001c0 88 1f 71 aa e2 1f 97 c5 ce 9a 5a 1c 09 3c 87 bc |..q.......Z..<..|
000001d0 e7 53 69 85 ed b6 59 f7 18 4c 76 02 75 1f 74 00 |.Si...Y..Lv.u.t.|
000001e0 00 00 00 00 00 00 00 00 00 00 00 0c 0a 15 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 01 40 69 ce 95 02 |...........@i...|
00000200 42 fd f6 5a 31 a7 d8 0d cf d7 37 c2 be 4c ce 2a |B..Z1.....7..L.*|
00000210 87 4f 17 54 53 9e 51 c7 10 36 ed e7 c7 1f ea c9 |.O.TS.Q..6......|
00000220 13 5d 40 6e 97 cc 94 6b 5c 1c 47 8a 50 ed 11 1e |.]@n...k\.G.P...|
00000230 c8 08 7b a9 59 0e 8a 9d f3 1b 9b fb 55 42 f2 3f |..{.Y.......UB.?|
00000240 ba a9 60 7d 4f f4 d9 3e 31 2c 4f 00 6d 08 b5 b5 |..`}O..>1,O.m...|
00000250 26 7a 77 e6 b8 be a7 c2 a1 4a 03 e8 d5 f8 3e e6 |&zw......J....>.|
00000260 bc 35 8b cc de 91 6c 4b 04 13 56 d3 21 86 15 be |.5....lK..V.!...|
00000270 35 9e 3d 75 0b fb a2 60 55 0e fe 2a 97 59 08 ba |5.=u...`U..*.Y..|
00000280 d1 eb 1a 28 5b e8 c4 ab 57 6c 98 a0 07 44 12 da |...([...Wl...D..|
00000290 1c b5 a5 ff ff 40 fb 65 6f c1 36 39 9c fe 85 53 |.....@.eo.69...S|
000002a0 1d 0d cf e9 71 c3 54 a6 22 f9 4b b5 2d d0 16 05 |....q.T.".K.-...|
000002b0 01 bb e7 76 e6 37 27 53 12 9d 81 03 d5 51 68 5a |...v.7'S.....QhZ|
000002c0 1a 74 d2 86 9e a8 07 33 36 85 b0 83 fc 29 ec 55 |.t.....36....).U|
000002d0 9f 5a f3 65 dd 20 9e 78 16 77 47 1a 5f 91 dc 70 |.Z.e. .x.wG._..p|
000002e0 b5 5d cc 9f 39 29 e0 2a dd 11 8c 18 50 ba 4c 16 |.]..9).*....P.L.|
000002f0 cc 30 01 c4 3e 9c ff 04 53 51 26 e4 ca 00 2c 4d |.0..>...SQ&...,M|
00000300 9a d9 b2 28 38 c4 3f 23 cf 36 f2 cd cf 64 44 85 |...(8.?#.6...dD.|
00000310 12 1a 83 c5 fe e4 7c df e3 25 25 c0 72 35 1e e3 |......|..%%.r5..|
00000320 2b cc 4c 92 3f 72 50 cd d1 71 2b 25 66 7a 99 f3 |+.L.?rP..q+%fz..|
00000330 6f 89 40 14 fb de 87 46 98 a0 30 5e 1b 9b b7 07 |o.@....F..0^....|
00000340 d2 92 8b 85 71 e6 eb c3 59 4d 5a 31 |....q...YMZ1|
>>> Flow 9 (client to server)
00000000 00 00 00 0c 0a 15 09 58 f4 64 d8 89 f3 1b a0 10 |.......X.d......|
00000010 00 00 00 20 ec 44 9d 56 6e c0 a0 79 03 70 c7 71 |... .D.Vn..y.p.q|
00000020 19 8e 28 6e 94 8d c6 7c 91 8a 7b d3 32 b7 4c ca |..(n...|..{.2.L.|
00000030 01 a9 e8 69 be f2 bf 23 38 d1 8e 86 69 44 0c dd |...i...#8...iD..|
00000040 2a 29 b4 7c |*).||
>>> Flow 10 (server to client)
00000000 00 00 00 20 27 f3 90 62 3a f5 4e fe cd 68 f5 8d |... '..b:.N..h..|
00000010 a1 b4 81 cd c7 38 12 c3 d9 62 39 d5 c8 25 c1 ec |.....8...b9..%..|
00000020 43 af cc 06 73 bb 11 c2 64 b1 ff 3f e9 2b b0 f8 |C...s...d..?.+..|
00000030 13 98 5c 6c |..\l|
>>> Flow 11 (client to server)
00000000 00 00 00 30 e2 28 97 cb ad 4d 45 8d 34 e7 cc f3 |...0.(...ME.4...|
00000010 bd 2c 74 ff ca 83 c4 f8 0a 72 1b 70 d1 a8 3c 13 |.,t......r.p..<.|
00000020 c7 43 41 ea 60 1e a4 3b 3e 95 91 38 c9 42 e0 1e |.CA.`..;>..8.B..|
00000030 ac 9b 8b 32 9e cd b6 e1 bc 94 76 88 2a b5 ba 15 |...2......v.*...|
00000040 b5 42 4e b7 |.BN.|
>>> Flow 12 (server to client)
00000000 00 00 00 20 14 d4 d1 f3 e6 23 83 6b 2f f6 4e 6e |... .....#.k/.Nn|
00000010 c3 b0 e0 bb 58 6d 45 f7 6d 4f 00 af d4 c2 48 87 |....XmE.mO....H.|
00000020 15 6b 5c 80 5e 98 88 13 32 8c 72 e1 70 8d 1b 15 |.k\.^...2.r.p...|
00000030 a7 5f 65 b8 00 00 00 40 77 9e 84 59 54 09 0a 5d |._e....@w..YT..]|
00000040 a2 be 9b cd 04 f4 76 2f b0 89 e2 93 0f 65 da 6f |......v/.....e.o|
00000050 3d c9 4a 52 e5 f4 7f 65 2e 7f 06 92 f9 ed ea 56 |=.JR...e.......V|
00000060 46 1e 06 80 a6 ef a0 ff 8a b1 ae 67 69 bd f2 a0 |F..........gi...|
00000070 34 b1 28 7e 69 46 17 3e d4 4a d5 87 67 fd 52 42 |4.(~iF.>.J..g.RB|
00000080 f6 1c f0 cd 58 1e 1f d8 |....X...|
>>> Flow 13 (client to server)
00000000 00 00 01 60 35 c8 4f 9e ab 8a 8a fb 0c c3 1a 28 |...`5.O........(|
00000010 64 a7 7c b3 d0 31 be e2 1a fd 0d 87 66 67 00 39 |d.|..1......fg.9|
00000020 24 89 c2 3d b6 ca d8 3e 8d bf e4 7d 60 c2 99 19 |$..=...>...}`...|
00000030 a0 2a d5 bd 17 6e e9 12 98 c3 a0 16 93 a2 de 1e |.*...n..........|
00000040 ad 81 76 24 15 b8 67 89 61 d9 79 df d1 32 1a 14 |..v$..g.a.y..2..|
00000050 9d 63 9b dc d3 e6 f8 60 46 41 bf 22 25 2b 21 6e |.c.....`FA."%+!n|
00000060 8f a1 9e 10 14 66 de c6 ab 21 0f 52 0a 12 87 ff |.....f...!.R....|
00000070 34 9d 37 96 44 e7 2d 86 3d 6b c3 db 98 01 da 06 |4.7.D.-.=k......|
00000080 8b 22 33 09 db bf 38 ad bf 8a 26 34 a1 0d cf ef |."3...8...&4....|
00000090 e6 1e 30 ba 0a f2 d5 de a0 52 7c e9 53 11 c6 ee |..0......R|.S...|
000000a0 21 24 ae 2d 10 9f 43 ac f1 75 04 1d 5d 56 22 6b |!$.-..C..u..]V"k|
000000b0 89 af bb 73 26 9d cb ef 8e 2f 38 f3 f5 63 71 c5 |...s&..../8..cq.|
000000c0 f7 68 7b 9c b8 fc af e5 c9 80 22 50 16 dd 81 88 |.h{......."P....|
000000d0 b7 1a 83 fc 67 67 f0 27 5e c4 f5 5b 82 fa f0 74 |....gg.'^..[...t|
000000e0 ab 92 3a fb 9b 8f ac 11 e6 77 e5 f8 2c 9f 52 2b |..:......w..,.R+|
000000f0 7e 52 09 96 2f b3 c9 09 4e 44 6b b5 8d 4e 4f 82 |~R../...NDk..NO.|
00000100 ac 5e d1 0d 45 79 90 e4 79 cc bd 8b 9a 0d ba ec |.^..Ey..y.......|
00000110 c3 1b 07 ba 64 80 6c 16 41 84 ee 64 0e 54 13 b9 |....d.l.A..d.T..|
00000120 b3 f5 20 7f f3 f3 ad de 8d 07 9c e0 f1 d5 a5 62 |.. ............b|
00000130 02 ca 24 61 7a 28 1b b7 d0 b8 8f 78 3f f3 cd d0 |..$az(.....x?...|
00000140 a1 c5 7b 9d 84 7c b2 29 99 07 b3 00 0b 74 d5 28 |..{..|.).....t.(|
00000150 8c 80 2d 4c f2 b1 51 bf d9 32 9d f4 bd 63 f5 85 |..-L..Q..2...c..|
00000160 68 17 a1 df b1 99 8d f4 04 ed 47 fb e9 f7 4c a0 |h.........G...L.|
00000170 05 ff 02 08 |....|
>>> Flow 14 (server to client)
00000000 00 00 01 40 e5 e3 bc 08 24 8c 7a d6 bc 39 3b e5 |...@....$.z..9;.|
00000010 4c 55 a0 c2 2a b1 c9 47 9e fe ae 7d 6e 17 51 18 |LU..*..G...}n.Q.|
00000020 eb d6 dc bb 83 e2 3b a8 2e 00 27 de 45 65 33 0f |......;...'.Ee3.|
00000030 6a 0c 6e 7b 47 6d 29 eb db d6 db f6 2a 40 9f 0a |j.n{Gm).....*@..|
00000040 1c ad ed e2 81 1f 4c 10 f2 e2 04 0f 20 78 56 37 |......L..... xV7|
00000050 b0 e9 f9 86 96 24 43 82 7f 3b 59 d4 bc e3 0e 27 |.....$C..;Y....'|
00000060 55 34 b8 b7 13 79 d3 1e 68 8a 8e 1a 8a 63 52 d7 |U4...y..h....cR.|
00000070 f3 22 63 f6 c6 d3 44 57 4e 95 d2 67 96 e7 19 9c |."c...DWN..g....|
00000080 62 23 58 37 72 38 e0 c3 6e 64 aa 84 ff 01 ec 9c |b#X7r8..nd......|
00000090 f6 94 43 e2 25 9c 4f ee 1d be fb 5c fb f2 bd c4 |..C.%.O....\....|
000000a0 ec 40 8f d2 91 b8 43 43 6d 49 d5 6d da 5e 09 63 |.@....CCmI.m.^.c|
000000b0 81 4e ef 0d 2b 9b 22 7f 55 e2 c0 17 cd 33 a1 17 |.N..+.".U....3..|
000000c0 f8 dc c1 6f dd c0 7c b5 2e 2b 1d d8 d7 8c e9 9d |...o..|..+......|
000000d0 ae 43 95 4f 28 c4 a4 45 af a2 5d e5 17 da eb 0e |.C.O(..E..].....|
000000e0 6e 73 75 5b 88 ec 52 dd 81 45 c6 4c 04 dc e1 6d |nsu[..R..E.L...m|
000000f0 45 bb de b9 41 c7 98 f8 20 4a 4e 93 08 9d b5 7e |E...A... JN....~|
00000100 66 e0 19 4e b2 94 aa 52 b9 a7 e3 c4 97 54 81 a4 |f..N...R.....T..|
00000110 ca 34 5d a3 ce 8b 96 ea 18 44 d8 b5 b8 2d e9 c0 |.4]......D...-..|
00000120 1a f6 82 fe 04 29 af 8b eb ff 89 cb 01 b0 0c 0c |.....)..........|
00000130 ae 07 62 fc 3e 9a 21 fa d5 59 6d 20 9f 37 28 b1 |..b.>.!..Ym .7(.|
00000140 55 e8 ab 6c d8 25 9b 88 4f 52 51 55 0e 69 72 4d |U..l.%..ORQU.irM|
00000150 9d d6 f8 ed |....|
>>> Flow 15 (client to server)
00000000 00 00 02 80 9d 12 cb 6f c8 d4 5a 31 87 f9 be b5 |.......o..Z1....|
00000010 a3 7b 3c 32 36 a8 5f b3 fa 7a 2c 03 dc 56 e5 52 |.{<26._..z,..V.R|
00000020 c4 dc 9c bd 5b 7a 81 ba bd 5a 98 32 72 a2 0e 5a |....[z...Z.2r..Z|
00000030 28 4e 40 28 ce e5 51 d5 06 2c 6e 39 43 cf 64 17 |(N@(..Q..,n9C.d.|
00000040 25 3f d0 99 d6 96 84 ac b1 c6 c7 06 2f e9 5a 95 |%?........../.Z.|
00000050 79 f4 07 b9 ba 20 a6 c2 77 87 5d 94 06 26 9c 1e |y.... ..w.]..&..|
00000060 eb 01 4e 3a 6a 44 0e 22 b1 c9 7a 8a a9 65 b1 28 |..N:jD."..z..e.(|
00000070 03 6f 16 78 15 48 23 b4 bd 9f 7e 13 76 40 99 26 |.o.x.H#...~.v@.&|
00000080 32 fc 04 40 4f 7c c9 88 d0 5d 53 ca 5b 51 b9 55 |2..@O|...]S.[Q.U|
00000090 3f 5f 3a dc fc d4 ca 67 67 39 b9 85 c0 52 7a 1b |?_:....gg9...Rz.|
000000a0 16 19 17 8d e5 e2 41 f4 8f 2c a7 1a a0 f3 b1 bc |......A..,......|
000000b0 40 78 ce 60 a2 7c 71 64 9b 3d 02 f1 5d 10 73 2a |@x.`.|qd.=..].s*|
000000c0 2f 89 7f 92 b1 f9 43 c6 b1 61 8a 0d c6 3b e7 e5 |/.....C..a...;..|
000000d0 63 ba a0 c6 1f 1d ac a1 bd ec 24 b2 d9 23 92 46 |c.........$..#.F|
000000e0 91 d9 97 cf 50 00 57 99 46 41 a7 92 a5 5c 42 ab |....P.W.FA...\B.|
000000f0 73 87 c5 50 1a aa 71 3c 37 88 09 c3 bd 05 bf 2b |s..P..q<7......+|
00000100 d2 36 81 64 2d 8f 19 f7 e2 0b 1f 09 de 05 a9 4e |.6.d-..........N|
00000110 f6 e8 85 11 e7 9f ff 83 5d d7 8f 16 cc ff a5 03 |........].......|
00000120 59 d7 f2 3a 01 05 4d 02 e8 6d d3 db a4 37 27 e2 |Y..:..M..m...7'.|
00000130 f6 ac c6 fa 61 99 5c e9 7e 3b e0 8f 60 a9 ee f7 |....a.\.~;..`...|
00000140 a9 dd 91 f3 83 21 04 9e 17 37 e2 25 87 0e 65 14 |.....!...7.%..e.|
00000150 29 c1 e2 f4 68 42 98 b6 b9 d0 99 a2 19 09 0d 83 |)...hB..........|
00000160 6b 5e b6 94 08 be a1 55 e5 c9 60 3b 9c 96 49 86 |k^.....U..`;..I.|
00000170 df f3 87 e1 34 33 3a 28 48 39 5b 3b e8 95 29 96 |....43:(H9[;..).|
00000180 fe 1b 0d 67 ff ca 94 4e c3 e3 87 23 85 ff aa ff |...g...N...#....|
00000190 24 39 3d 3a 32 4a 0d 91 f7 96 f9 f2 5b 36 9c a9 |$9=:2J......[6..|
000001a0 6d 15 3e cb 79 84 a9 c8 ac e6 cf a6 ac d3 24 14 |m.>.y.........$.|
000001b0 e2 7a 00 38 13 c7 c4 62 2e 69 c6 45 d2 1f 8c bf |.z.8...b.i.E....|
000001c0 f9 64 6d f8 ca 71 e3 2d 59 23 ec 8e c9 56 cd c5 |.dm..q.-Y#...V..|
000001d0 b6 9c e0 fa 58 61 5d bc 11 15 8b 3a e6 bc 3a 7b |....Xa]....:..:{|
000001e0 be 8e ae e5 a6 dc 6a f7 2b 1c 37 2e 75 6b 77 5b |......j.+.7.ukw[|
000001f0 45 d4 94 e2 67 d6 63 b1 d3 b8 d2 f9 d4 cf 87 5a |E...g.c........Z|
00000200 3b 2b b7 7c b7 c7 58 86 ed de 00 91 39 88 92 ca |;+.|..X.....9...|
00000210 84 03 0c 40 72 18 86 b7 48 77 2f 36 24 be b4 e7 |...@r...Hw/6$...|
00000220 ba c3 94 bb 95 af f5 b2 0c ce 12 d2 21 16 87 fa |............!...|
00000230 d7 e1 81 d1 85 6f a2 e6 06 46 86 1a bb c0 74 c4 |.....o...F....t.|
00000240 f9 0a 98 6c 5f c4 25 5c a8 f8 44 50 36 9e 3b 87 |...l_.%\..DP6.;.|
00000250 82 a4 ff d1 6b fa 95 e8 37 2f ce 52 5b a6 6c a7 |....k...7/.R[.l.|
00000260 b1 7a 74 1e 4a 3f 77 b2 1c 4c 99 0f 7f 90 55 cf |.zt.J?w..L....U.|
00000270 9c de 62 b4 31 47 3b 31 9a 17 12 6f 16 61 10 72 |..b.1G;1...o.a.r|
00000280 0b 17 b0 3d 76 87 46 b3 1f b0 6d 2f 2c 3b 1f 49 |...=v.F...m/,;.I|
00000290 ff 7c a8 3b |.|.;|
>>> Flow 16 (server to client)
00000000 00 00 00 10 80 00 79 db a8 ad 00 6f ae 0c 3f 21 |......y....o..?!|
00000010 55 c3 33 5b 0f 09 8a 8e 7f 90 49 69 df 9e 03 44 |U.3[......Ii...D|
00000020 a3 b9 41 49 |..AI|

Some files were not shown because too many files have changed in this diff Show More