-
Notifications
You must be signed in to change notification settings - Fork 144
Prevent loading engine twice #425
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
Prevent loading engine twice #425
Conversation
08fc251 to
2b7d088
Compare
|
@max619 Is there a specific reason you're loading the engine twice? Please include the exact command you're executing, along with its full output and any errors, in your PR description. Avoid making us reverse-engineer the symptoms based on your attempted fix. Kindly consider reading How to Report Bugs Effectively. |
|
Ok, I'm running the command: The issues is that certificate passed in The first time call succeeds here and "loads" key and cert from smart card: - } else if (options->p11engine && !engine_load(options)) {Then second call happens here: + /* try to find and load libp11 'pkcs11' or 'dynamic' engine */
if (!engine_load(options)) {
goto out;Which fails, and then /* Load additional (cross) certificates ('-ac' option) */
load_objects_from_store(options->xcertfile, options->pass, NULL, options->xcerts, NULL);
/* Load the certificate chain ('-certs' option) */
load_objects_from_store(options->certfile, options->pass, NULL, options->certs, NULL);
...
out:
return (options->pkey && sk_X509_num(options->certs) > 0) ? 1 : 0;However, as far as |
|
Thanks for the report. The code path:
will only be entered if the
you're not using the Could you please check your openssl.cnf for an implicit engine load? Specifically, look for something like this: If such a section is present, OpenSSL will load and initialize the engine automatically at startup with the In that case, signing the file will fail with the following error: This happens because the engine is already initialized externally, and osslsigncode tries to initialize it again internally, leading to a conflict. If signing completes successfully, it means the additional (cross) certificates specified using Let us know what you find. |
|
@olszomal That's actually my bad, i was using the That was the command: And that's the output: openssl.conf file is default one. There is no pkcs11 or engine related entries. |
olszomal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if my changes are sufficient. It would be great if you could also test how it works with the master branch of libp11.
2b7d088 to
17e7008
Compare
|
Changes are sufficient, thx. Tested with libp11 at master branch - works fine. |
Currently second call to
engine_loadfails which leads toxcertsnot being filled.Faced that during debugging of #419.