-
Notifications
You must be signed in to change notification settings - Fork 7.3k
PKCS7_sign() method doesn't work in addon modules linking to openssl. #8026
Comments
Sorry, the link seems to be broken? May be you could try storing your files as a gist? |
Sorry, I just checked it in here: https://github.com/Neilpang/nodejstest thanks. |
Whoa, so the answer is simple :) Remove |
Nop. I don't think openssl lib is statically linked in to Nodejs. If I remove -lssl and -lcrypto from binding.gyp, there will be another runtime error: " undefined symbol: PKCS7_sign" |
Could you please try the sample code ? |
I just tried it and it works fine for me, I suppose you are building the module with |
You may also consider adding this to your binding.gyp:
|
Yes, I removed -lssl and -lcrypto. but I just get this error when I run sign.js:
|
I removed all the "build" folder and built the module with:
|
Could you please run it with: |
Yes,
|
Oh, looks like the symbol slips away after linking openssl with node... I'll figure it out |
Anyway, it appears to me to be a problem only on a OSX, can you confirm this? |
Please tell me your OS version , Nodejs version and Openssl version. So that I can setup a VM here. |
? |
For me, this issue Only happens on Linux( my ubuntu 14.04), My Mac works well. |
You said: "I just tried it and it works fine for me, I suppose you are building the module with node-gyp configure && node-gyp rebuild?" Can you tell me your OS versions? So that I can set up VM here to repro. |
I am able to reproduce it, see #8026 (comment) |
So, this is a fix for OSX: #8029 |
Force pushed #8029 to include fix for linux too. Could you please give it a try? You'll need to:
|
thanks, I'll check it later. |
gyp: do not remove unused openssl syms
Hi, Another question, when I build my sample project, I got '"node_shared_openssl": "true",' this line in the "build/config.gypi" file. This is the full content of the "build/config.gypi"
|
What does
say? |
fix #8026 Reviewed-By: Fedor Indutny <[email protected]>
I'm using Ubuntu now. It seems that otool is not there. |
Oh, right:
|
|
Ok, I don't see |
Anyways, Thanks. |
@indutny It's the nodejs package installed via |
Oh, shit! |
fix nodejs#8026 Reviewed-By: Fedor Indutny <[email protected]>
Ubuntu 14.04.
Using the latest Nodejs 0.10.29 compiled from source code, and the latest OpenSSL lib 1.0.1g
For short, the openssl demo code "smsign.c" doesn't work if compiled as an addon module.
The demo code smsign.c is here: https://github.com/joyent/node/blob/5fcd6e40385f45bc9091689337a7ab531861ba19/deps/openssl/openssl/demos/smime/smsign.c
The core error is "PKCS7_sign()" method failed without any error code or error message.
I just wrote a sample project, please clone it here: https://github.com/Neilpang/nodejstest
In the project, the "makefile" compiles the demo code as an executable, and it works successfully.
However, using the "bindings.gyp" it compiles the demo code as a nodejs addon, run the "sign.js" script, it shows the error.
Update, this issue doesn't happen on Mac, only in Ubuntu.
Windows has not been tested yet.
The text was updated successfully, but these errors were encountered: