Registry Mirror
Skip to content

Conversation

@ollie27

@ollie27 ollie27 commented Feb 25, 2016

Copy link
Copy Markdown
Contributor

CryptGenRandom takes a DWORD (u32) for the length so it only supports
writing u32::MAX bytes at a time.

Casting the length from a usize caused truncation meaning the whole
buffer was not always filled.

cc #31841

This is the same as rust-random/rand#99. I think it's a good idea to keep the implementations in sync.

r? @alexcrichton

…indows

CryptGenRandom takes a DWORD (u32) for the length so it only supports
writing u32::MAX bytes at a time.

Casting the length from a usize caused truncation meaning the whole
buffer was not always filled.
@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Feb 25, 2016
@brson

brson commented Feb 25, 2016

Copy link
Copy Markdown
Contributor

@bors r+

Look like a security bug cc @rust-lang/core

@bors

bors commented Feb 25, 2016

Copy link
Copy Markdown
Contributor

📌 Commit ac3cc33 has been approved by brson

@emberian

Copy link
Copy Markdown
Contributor

it is a security bug, but note that what really matters is the external crate, not this one. rust-random/rand#99

@bors

bors commented Feb 26, 2016

Copy link
Copy Markdown
Contributor

⌛ Testing commit ac3cc33 with merge 4236392...

@bors

bors commented Feb 26, 2016

Copy link
Copy Markdown
Contributor

💔 Test failed - auto-mac-32-opt

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

On Fri, Feb 26, 2016 at 11:22 AM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-32-opt
http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/8236

—
Reply to this email directly or view it on GitHub
#31876 (comment).

bors added a commit that referenced this pull request Feb 26, 2016
CryptGenRandom takes a DWORD (u32) for the length so it only supports
writing u32::MAX bytes at a time.

Casting the length from a usize caused truncation meaning the whole
buffer was not always filled.

cc #31841

This is the same as rust-random/rand#99. I think it's a good idea to keep the implementations in sync.

r? @alexcrichton
@bors

bors commented Feb 26, 2016

Copy link
Copy Markdown
Contributor

⌛ Testing commit ac3cc33 with merge 98a8a71...

@bors
bors merged commit ac3cc33 into rust-lang:master Feb 27, 2016
@ollie27
ollie27 deleted the win_fill_bytes branch May 2, 2016 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes Marks issues that should be documented in the release notes of the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants