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

build: fix compiling against openssl with no-psk #36881

Closed
wants to merge 1 commit into from

Conversation

everett1992
Copy link
Contributor

fixes #36464

Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef

int SSLWrap<Base>::SetCACerts(SecureContext* sc) {

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jan 11, 2021
@everett1992
Copy link
Contributor Author

afaict node doesn't have integration testing for different openssl configurations. I've tested this change using the script from #36464, it compiles and all except two psk tests pass.

Path: parallel/test-tls-psk-circuit
Path: parallel/test-tls-psk-errors

[02:42|% 100|+ 3280|-   2]: Done

in both tests the error is no cipher match which is expected

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 11, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 11, 2021
@nodejs-github-bot
Copy link
Collaborator

@everett1992
Copy link
Contributor Author

I don't understand how this change would introduce a memory leak. is test-asan flaky?

@richardlau
Copy link
Member

I don't understand how this change would introduce a memory leak. is test-asan flaky?

It's not flaky, it was broken by #36779.

@jasnell
Copy link
Member

jasnell commented Jan 12, 2021

It's not flaky, it was broken by #36779.

Hmm... I missed that entirely. I'll take a look

aduh95 pushed a commit to jasnell/node that referenced this pull request Jan 12, 2021
The asan checks don't play well currently with persistent secure
heap allocations.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: nodejs#36900
Refs: nodejs#36881
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
@everett1992
Copy link
Contributor Author

if asan is already broken are there any blockers of this PR?

danielleadams pushed a commit that referenced this pull request Jan 13, 2021
The asan checks don't play well currently with persistent secure
heap allocations.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #36900
Refs: #36881
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
fixes nodejs#36464

Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to `node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef

https://github.com/nodejs/node/blob/6751b6dc3da102f259b74b7453032edadc7a37ca/src/crypto/crypto_ssl.cc#L839
@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 18, 2021
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Jan 18, 2021

@everett1992 GitHub cannot link the commit to your GitHub account. You may want to take a look at https://github.com/nodejs/node/blob/99b1ada/doc/guides/contributing/pull-requests.md#step-1-fork to set this up – so you'll get a Contributor badge next to your name and your contribution is registered to your GitHub profile. If that was done on purpose, no issue of course, we can land your commit as is; I wanted to let you know and give you the opportunity to fix that if you wanted to.

@everett1992
Copy link
Contributor Author

@aduh95 thanks for letting me know, I'm okay not being marked as a contributor

aduh95 pushed a commit that referenced this pull request Jan 19, 2021
Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to
`node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef.

PR-URL: #36881
Fixes: #36464
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
@aduh95
Copy link
Contributor

aduh95 commented Jan 19, 2021

Landed in fef2128

@aduh95 aduh95 closed this Jan 19, 2021
ruyadorno pushed a commit that referenced this pull request Jan 22, 2021
Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to
`node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef.

PR-URL: #36881
Fixes: #36464
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
@ruyadorno ruyadorno mentioned this pull request Jan 22, 2021
ruyadorno pushed a commit that referenced this pull request Jan 25, 2021
Node 15 prior to this commit will not compile if openssl is built with
no-psk. Compiling emits an error like this:

```
crypto_tls.cc:(.text+0x4c27): undefined reference to
`node::crypto::TLSWrap::SetCACerts(node::crypto::SecureContext*)'
```

Blame on crypto_tls.cc shows the file was created in a refactor. Before
that refactor SetCACerts was defined outside OPENSSL_NO_PSK ifndef.

PR-URL: #36881
Fixes: #36464
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node 15.3.0 fails to build with shared-openssl with no-psk
6 participants