Uh oh!
There was an error while loading. Please reload this page.
Open a BCrypt algorithm handle - #101476
Conversation
rustbot
commented
Sep 6, 2022
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
65b32b1 to
b2e4f9dComparethomcc
commented
Sep 7, 2022
Thanks, looks great! @bors r+ |
bors
commented
Sep 7, 2022
ChrisDenton
commented
Sep 7, 2022
@bors p=1 so the fix is sure to be in the next nightly |
…omcc Open a BCrypt algorithm handle Fixesrust-lang#101474, supplants rust-lang#101456. Replaces use of a pseduo handle with manually opening a algorithm handle. Most interesting thing here is the atomics. r? `@thomcc`
ChrisDenton
commented
Sep 7, 2022
bors
commented
Sep 7, 2022
📌 Commit a68ba39e7733dbb427708ef164164c2c55705a3c has been approved by It is now in the queue for this repository. |
ChrisDenton
commented
Sep 7, 2022
@thomcc I pushed small commit so that miri won't be broken by this. The weirdness is a little hack to avoid having to use a bunch of |
bors
commented
Sep 7, 2022
⌛ Testing commit a68ba39e7733dbb427708ef164164c2c55705a3c with merge d27cb8dad98c06b510106bd299076341741ca0e1... |
bors
commented
Sep 7, 2022
💔 Test failed - checks-actions |
a68ba39 to
832c7afCompareChrisDenton
commented
Sep 7, 2022
fixed formatting @bors r=thomcc |
bors
commented
Sep 7, 2022
bors
commented
Sep 7, 2022
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
This comment has been minimized.
This comment has been minimized.
bors
commented
Sep 7, 2022
bors
commented
Sep 7, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Sep 7, 2022
Finished benchmarking commit (9682b5d): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
| #[cfg(miri)] | ||
| fn open() -> Result<Self, c::NTSTATUS> { | ||
| const BCRYPT_RNG_ALG_HANDLE: c::BCRYPT_ALG_HANDLE = ptr::invalid_mut(0x81); | ||
| let _ = ( | ||
| c::BCryptOpenAlgorithmProvider, | ||
| c::BCryptCloseAlgorithmProvider, | ||
| c::BCRYPT_RNG_ALGORITHM, | ||
| c::STATUS_NOT_SUPPORTED, | ||
| ); | ||
| Ok(Self(BCRYPT_RNG_ALG_HANDLE)) | ||
| } |
There was a problem hiding this comment.
I am surprised to see a Miri special path here; usually we try to execute the real thing where feasible (and BCryptOpenAlgorithmProvider looks easy enough to fake). Also please Cc @rust-lang/miri when adding such a codepath, and always add a comment explaining why Miri uses a different codepath.
There was a problem hiding this comment.
Yeah, for this I'd say it's better to just add the shims to miri.
There was a problem hiding this comment.
Sorry! My intent was for this to be temporary until I was confident that the crash issue was addressed. Then we can go back to using BCRYPT_USE_SYSTEM_PREFERRED_RNG as the default and BCryptOpenAlgorithmProvider would be the fallback. I can submit a PR to undo tho.
There was a problem hiding this comment.
Ah, if this is just temporary then implementing the shims in Miri would indeed not be worth it.
Fixes#101474, supplants #101456.
Replaces use of a pseduo handle with manually opening a algorithm handle.
Most interesting thing here is the atomics.
r? @thomcc