Skip to content

Commit c59e79d

Browse files
committed
git: Always use OpenSSL on win32
By default, libssh2 uses Windows Cryptography Next Generation when targeting win32. The wincng backend does not support ED25519, which is a widely-used algorithm among git hosting services, and in some cases may be the only option on remotes in certain configurations. This change adds the feature `openssl-on-win32`, enabling the same one in `libssh2-sys`, and enables it in the CI release flow, ensuring that release builds are able to communicate with hosts using ED25519. Fixes #3322
1 parent 47c010f commit c59e79d

File tree

6 files changed

+14
-2
lines changed

6 files changed

+14
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
toolchain: stable
4747
target: ${{ matrix.target }}
4848
- name: Build release binary
49-
run: cargo build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
49+
run: cargo build --target ${{ matrix.target }} --verbose --release --features packaging,openssl-on-win32,vendored-openssl
5050
- name: Build archive
5151
shell: bash
5252
run: |

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323

2424
### Fixed bugs
2525

26+
* When built with the `openssl-on-win32` feature, ED25519 host keys are supported
27+
when connecting to Git+SSH remotes on Windows.
28+
2629
## [0.17.1] - 2024-05-07
2730

2831
### Fixed bugs

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ indoc = "2.0.4"
6060
insta = { version = "1.38.0", features = ["filters"] }
6161
itertools = "0.12.1"
6262
libc = { version = "0.2.154" }
63+
libssh2-sys = { version = "0.3.0" }
6364
maplit = "1.0.2"
6465
minus = { version = "5.6.1", features = ["dynamic_output", "search"] }
6566
num_cpus = "1.16.0"

cli/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ unicode-width = { workspace = true }
8989
[target.'cfg(unix)'.dependencies]
9090
libc = { workspace = true }
9191

92+
[target.'cfg(windows)'.dependencies]
93+
libssh2-sys = { workspace = true }
94+
9295
[dev-dependencies]
9396
anyhow = { workspace = true }
9497
assert_cmd = { workspace = true }
@@ -104,6 +107,7 @@ jj-cli = { path = ".", features = ["test-fakes"], default-features = false }
104107
[features]
105108
default = ["watchman"]
106109
bench = ["dep:criterion"]
110+
openssl-on-win32 = ["libssh2-sys/openssl-on-win32", "jj-lib/openssl-on-win32"]
107111
packaging = []
108112
test-fakes = ["jj-lib/testing"]
109113
vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"]

lib/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ hex = { workspace = true }
4949
ignore = { workspace = true }
5050
itertools = { workspace = true }
5151
jj-lib-proc-macros = { workspace = true }
52+
libssh2-sys = { workspace = true }
5253
maplit = { workspace = true }
5354
once_cell = { workspace = true }
5455
pest = { workspace = true }
@@ -92,6 +93,7 @@ tokio = { workspace = true, features = ["full"] }
9293

9394
[features]
9495
default = []
95-
vendored-openssl = ["git2/vendored-openssl"]
96+
openssl-on-win32 = ["libssh2-sys/openssl-on-win32"]
97+
vendored-openssl = ["git2/vendored-openssl", "libssh2-sys/openssl-on-win32"]
9698
watchman = ["dep:tokio", "dep:watchman_client"]
9799
testing = []

0 commit comments

Comments
 (0)