Open 0blu opened 5 days ago
Hello!
Thanks for letting us know about this problem, and for the reference to how Rust solved it.
I was trying to reproduce this with aws-lc-rs, but I'm having trouble with the build. I suspect my issue relates to not having the toolchain setup. (Since this is a tier 3 platform, are there any pre-built toolchains available?)
Here's what I tried (on a Windows host using the bash shell provided by Git), and the resulting error:
> rustup +nightly component add rust-src
...
> cargo +nightly build -Z build-std --target x86_64-win7-windows-msvc
...
...
= note: LINK : fatal error LNK1181: cannot open input file 'windows.0.52.0.lib'␍
error: could not compile `aws-lc-rs` (example "digest") due to 1 previous error
If you can provide some guidance on how to setup a development environment for this, it would be appreciated. Thanks!
Hey, I appreciate you being open to supporting a legacy system like Windows 7. I am using a Windows 11 / Linux host for developing and a Windows 7 VM to test compatibility.
For my initial test project (shown above) I also used cargo +nightly build --release --target x86_64-win7-windows-msvc -Zbuild-std
just like you, but with
[dependencies]
aws-lc-rs = { version = "1.11.0", default-features = false, features = ["aws-lc-sys", "prebuilt-nasm"] }
If I reference aws-lc-rs
directly I cant even get the project to build, even if I target x86_64-pc-windows-msvc
.
My Cargo.toml
looks like this in this case:
[dependencies]
aws-lc-rs = { path = "../aws-lc-rs/aws-lc-rs", default-features = false, features = ["aws-lc-sys", "prebuilt-nasm"] }
Do you have an idea what might cause this error?
aws-lc-rs
referenceI somehow even get an error when trying to compile Test rustls
or rusttls-cli-bench
directly (git at v1.11.0)
(bogo
and ech-client
compiled successfully though):
Test rustls
...
The source directory
D:/Programming/RustroverProjects/aws-lc-rs/aws-lc-sys/aws-lc
does not contain a CMakeLists.txt file.
...
This looks like the error I get when I forget to initialize the git submodules. (The Makefile in our project has some convenient targets for doing this.)
Thanks for the response. I'll take a closer look at this tomorrow.
Compiling rustls-ci-bench v0.0.1 (D:\Programming\RustroverProjects\rustls\ci-bench)
This is part of rustls's performance CI infrastructure, and is not intended to be portable to platforms other than linux.
initialize the git submodules
Thanks, I somehow missed that. I ran a quick sanity check and it seems to work
Using my test project with aws-lc-rs
as a folder reference (like above), I was able to successfully run it under Windows 7.
The previous code in this repo used RtlGenRandom
aka advapi32!SystemFunction036
, which according to Microsoft should never be used.
So I hacked an proof of concept with bcrypt!BCryptGenRandom
together.
Maybe it's possible to clean this up a bit and put it behind a conditional #if
directive (when targeting older windows).
Thanks for the patch!
Since this involves very security sensitive logic (i.e., entropy/randomness), it will take some time for us to consider it. As you indicated, in the end this change will likely be guarded by an #if
directive as to only impact older Windows versions. I'll see if we can get this change through. We'll update you here when progress is made.
Problem:
I actually came here from aws-lc-rust. I tried to use the following minimal example with
x86_64-win7-windows-msvc
but as soon as the library tries to accessProcessPrng
the program aborts.Erroneous line: https://github.com/aws/aws-lc/blob/745359e8569fdafa8897ac2fffdfd0fdcf620563/crypto/rand_extra/windows.c#L68
Solution:
Rust recently switched from
BCryptGenRandom
toProcessPrng
but allowed a path for Windows 7. https://github.com/rust-lang/rust/pull/121337Is a similar solution also possible in this project?