Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issues with dynamic loading OpenSSL. Fixes #13903. #13919

Merged
merged 1 commit into from
Apr 8, 2020

Conversation

dom96
Copy link
Contributor

@dom96 dom96 commented Apr 7, 2020

This fixes at least a couple of issues:

I also added a new define (-d:noOpenSSLHacks) to force the use of Nim's dynlib mechanism (and not the rather hacky dynamic approach taken by default).

Also it's important to keep in mind that I tested this with 1.0.6 and then forward ported my patch, here is my openssl.nim on 1.0.6 to ease backporting: https://gist.github.com/dom96/bb6a76e0738f18f35a95ba8d6a4ec86b

As a side note, I wanted to add some unit tests for this but apparently wrapper module files are not tested in CI :(

@dom96 dom96 force-pushed the fixes-openssl-android branch 2 times, most recently from 1dd31de to 498ebdd Compare April 7, 2020 21:54
This fixes at least a couple of issues:

* Procs loaded from the DLL being used even when the pointer is nil.
* The actual issue (#13903) which appeared to cause stack corruption on
  Android 7.1.1 with OpenSSL 1.1.1f. The change that fixed this was the
  move to loading the procs in `sslSym`.
@Araq Araq merged commit 350ee03 into devel Apr 8, 2020
@Araq Araq deleted the fixes-openssl-android branch April 8, 2020 12:37
@timotheecour
Copy link
Member

I also added a new define (-d:noOpenSSLHacks)

should be -d:nimNoOpenSSLHacks to avoid name clashes

@timotheecour timotheecour mentioned this pull request Apr 10, 2020
1 task
@dom96
Copy link
Contributor Author

dom96 commented Apr 13, 2020

likelihood of clashes is really small.

narimiran pushed a commit that referenced this pull request Apr 14, 2020
…ckport]

This fixes at least a couple of issues:

* Procs loaded from the DLL being used even when the pointer is nil.
* The actual issue (#13903) which appeared to cause stack corruption on
  Android 7.1.1 with OpenSSL 1.1.1f. The change that fixed this was the
  move to loading the procs in `sslSym`.

(cherry picked from commit 350ee03)
narimiran pushed a commit that referenced this pull request Apr 14, 2020
…ckport]

This fixes at least a couple of issues:

* Procs loaded from the DLL being used even when the pointer is nil.
* The actual issue (#13903) which appeared to cause stack corruption on
  Android 7.1.1 with OpenSSL 1.1.1f. The change that fixed this was the
  move to loading the procs in `sslSym`.

(cherry picked from commit 350ee03)
@timotheecour
Copy link
Member

it's not just about clashes, it's also about namespacing. So that you can tell from a symbol which pkg it comes from (nim vs other nimble package)

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.

3 participants