Skip to content

Conversation

@xoloki
Copy link
Contributor

@xoloki xoloki commented Dec 21, 2015

This PR removes all of the dangerous Windows entropy gathering routines in favor of standard CryptGenRandom calls, as was discussed in the "Improving OpenSSL default RNG" thread on openssl-dev. This fixes common, repeatable crashes that happen when running openssl under the VS debugger.

We will likely lose support for some ancient versions of WINCE with this change, so it should only go in master for now. I would strongly argue in favor of putting this in 1.1.0, but it should probably not go into 1.0.2 (as much as I'd like to see it there).

@vszakats
Copy link
Contributor

Suggesting CRYPT_VERIFYCONTEXT | CRYPT_SILENT in place of CRYPT_VERIFYCONTEXT for each occurrence — to make sure no UI is popping up here.

Ref.: https://msdn.microsoft.com/en-us/library/windows/desktop/aa379886.aspx

@xoloki
Copy link
Contributor Author

xoloki commented Dec 23, 2015

Seems like a good idea @vszakats, PR updated.

@vszakats
Copy link
Contributor

Thank you @xoloki!

@ghedo
Copy link
Contributor

ghedo commented Jan 12, 2016

RAND_screen() should go too IMO.

@richsalz
Copy link
Contributor

@xoloki
Copy link
Contributor Author

xoloki commented Jan 12, 2016

Done @ghedo. I wasn't sure what to do with libeay.num, so I marked RAND_screen as NOEXIST. Hopefully I don't need to renumerate the entire file.

@xoloki
Copy link
Contributor Author

xoloki commented Jan 12, 2016

I don't have rt access @richsalz, how do I get it?

@richsalz
Copy link
Contributor

User guest password guest

@xoloki
Copy link
Contributor Author

xoloki commented Jan 12, 2016

Thanks @richsalz. That RT is exactly what I saw, though in my case it had the decency to crash and not deadlock. The crash appeared frequently (~66% of the time) when running my application under the VS debugger.

@ghedo
Copy link
Contributor

ghedo commented Jan 12, 2016

@xoloki RAND_event() too probably. Also, MAXDELAY and the code inside the CURSOR_SHOWING ifndef (including the comment above it) can be removed too since they seem unused. Might want to check if we actually need all the #includes as well.

@OscarLinden
Copy link

Done @ghedo. I built on windows and verified that we could get rid of one #include.

The VC-WIN64A build seems a little broken in general, but I was able to build libeay32.lib so rand_win seems good.

@ghedo
Copy link
Contributor

ghedo commented Jan 13, 2016

Oh, wow, I didn't know we had a winrand app. It was added almost 16 years ago, and since then it received 4 commits in total (all of them being general code improvements, not specific to that file). Should be safe to drop as well IMO.

@OscarLinden
Copy link

Done @ghedo. Nothing was even referencing winrand.c.

@OscarLinden
Copy link

Also, I noticed that the debug-VC configure targets are missing in master. How do I do a debug windows build now @ghedo?

@levitte
Copy link
Member

levitte commented Jan 13, 2016

@OscarLinden, thanks for noticing. You need the following patch (to be committed soon):

diff --git a/util/mk1mf.pl b/util/mk1mf.pl
index bac5a6f..64ad29a 100755
--- a/util/mk1mf.pl
+++ b/util/mk1mf.pl
@@ -83,8 +83,6 @@ while(<IN>) {
 }
 close(IN);

-$debug = 1 if $mf_platform =~ /^debug-/;
-
 if ($mf_fipscanisterinternal eq "y") {
        $fips = 1;
        $fipscanisterbuild = 1;
@@ -1401,6 +1399,7 @@ sub read_options
                "rsaref" => 0,
                "gcc" => \$gcc,
                "debug" => \$debug,
+               "--debug" => \$debug,
                "profile" => \$profile,
                "shlib" => \$shlib,
                "dll" => \$shlib,

@xoloki
Copy link
Contributor Author

xoloki commented Jan 13, 2016

Thanks @levitte! I don't have a pressing need to build debug now, so I'll wait for that change to hit master.

FdaSilvaYY and others added 6 commits May 14, 2016 08:04
Reviewed-by: Kurt Roeckx <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from openssl#1042)
- "/Ox /O2 /Ob2" get's reduced to "/O2", the reason being:

    /Ox = /Ob2 /Og /Oi /Ot /Oy /Gs
    /O2 = /Ob2 /Og /Oi /Ot /Oy /Gs /GF /Gy

- apps/openssl.cnf gets installed.

- always delete files quietly, as they might not be there.

Reviewed-by: Matt Caswell <[email protected]>
(Merged from openssl#1075)
Add a status return value instead of void.
Add some sanity checks on reference counter value.
Update the docs.

Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
Since 50932c4 "PACKETise ServerHello processing",
ssl_next_proto_validate() incorrectly allows empty protocol name.
draft-agl-tls-nextprotoneg-04[1] says "Implementations MUST ensure that
the empty string is not included and that no byte strings are
truncated."
This patch restores the old correct behavior.

[1] https://tools.ietf.org/html/draft-agl-tls-nextprotoneg-04

Reviewed-by: Emilia Käsper <[email protected]>
Reviewed-by: Matt Caswell <[email protected]>
@mattcaswell
Copy link
Member

This looks genarlly ok to me, but I'd feel happier if someone with more Windows knowledge than me took a look.
There are a number of merge commits in this PR which aren't allowed, so they need to be removed, and this PR rebased instead. Also "make update" probably needs to be run.

@xoloki
Copy link
Contributor Author

xoloki commented May 16, 2016

I did the rebase, but I couldn't push to my fork without a single merge at the end. Is this okay?

@mattcaswell
Copy link
Member

No - there can't be any merge commits. Also looks like you messed up somehow. This PR is now showing a whole load of changes which aren't yours.

@xoloki
Copy link
Contributor Author

xoloki commented May 16, 2016

I'll make a new branch and cherry pick all my actual commits.

The commits from other people showed up days ago, no idea how that happened...

@mattcaswell mattcaswell added this to the 1.1.0 milestone May 16, 2016
@ghedo
Copy link
Contributor

ghedo commented May 16, 2016

@xoloki why not just do "git rebase master" from inside your branch? You might want to squash into a single commit as well.

@xoloki
Copy link
Contributor Author

xoloki commented May 16, 2016

I'm on a fork, so I did

git rebase upstream/master

From my fork's master branch.

But then I couldn't push back to my fork without an extra

git pull

Which added another merge.

Will

git rebase master

On my fork's master actually work?

@OscarLinden
Copy link

Ok, new PR-1079:

#1079

On 5/16/2016 6:10 AM, mattcaswell wrote:

No - there can't be any merge commits. Also looks like you messed up
somehow. This PR is now showing a whole load of changes which aren't yours.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#512 (comment)

@mattcaswell
Copy link
Member

Replaced by #1079

@ghedo
Copy link
Contributor

ghedo commented May 16, 2016

@xoloki then I think you needed to just do git push --force.

@kroeckx kroeckx mentioned this pull request Apr 1, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.