Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646378 - dev-libs/pkcs11-helper: build failure with >=dev-libs/openssl-1.1.0
Summary: dev-libs/pkcs11-helper: build failure with >=dev-libs/openssl-1.1.0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Crypto team [DISABLED]
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-02-02 05:00 UTC by Quentin Minster
Modified: 2018-06-15 06:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,41.66 KB, text/x-log)
2018-02-02 05:00 UTC, Quentin Minster
Details
pkcs11-helper-1.21-openssl-1.1.0-compatibility.patch (pkcs11-helper-1.21-openssl-1.1.0-compatibility.patch,1.94 KB, patch)
2018-02-02 05:01 UTC, Quentin Minster
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Quentin Minster 2018-02-02 05:00:07 UTC
Created attachment 517524 [details]
build.log

On my system with dev-libs/openssl-1.1.0g-r2, dev-libs/pkcs11-helper-1.21 fails to build with theses kinds of warnings and errors (incomplete, see attached build.log for full log):

  _pkcs11h-crypto-openssl.c: In function ‘__pkcs11h_crypto_openssl_initialize’:
  _pkcs11h-crypto-openssl.c:89:2: warning: implicit declaration of function ‘OpenSSL_add_all_digests’ [-Wimplicit-function-declaration]
    OpenSSL_add_all_digests ();
    ^~~~~~~~~~~~~~~~~~~~~~~
  _pkcs11h-crypto-openssl.c: In function ‘__pkcs11h_crypto_openssl_certificate_get_expiration’:
  _pkcs11h-crypto-openssl.c:135:14: warning: implicit declaration of function ‘X509_get_notBefore’; did you mean ‘X509_getm_notBefore’? [-Wimplicit-function-declaration]
    notBefore = X509_get_notBefore (x509);
                ^~~~~~~~~~~~~~~~~~
                X509_getm_notBefore

  pkcs11h-openssl.c: In function ‘__pkcs11h_openssl_rsa_dec’:
  pkcs11h-openssl.c:382:8: error: ‘RSA_PKCS1_PADDING’ undeclared (first use in this function)
     case RSA_PKCS1_PADDING:
          ^~~~~~~~~~~~~~~~~

This is due to changes in OpenSSL 1.1.0.
A few of these were header changes which were spotted by Alon Bar-Lev, and a PR is available upstream: https://github.com/OpenSC/pkcs11-helper/pull/14

However the undefined functions either did not generate warnings or were not fixed, so I'm attaching a patch which fixes those.
Note that the patch includes 2 snippets from Alon's PR, to fix the include errors, but not the full PR (as it seems Gentoo doesn't offer the option to build OpenSSL without RSA or DSA).
Comment 1 Quentin Minster 2018-02-02 05:01:02 UTC
Created attachment 517526 [details, diff]
pkcs11-helper-1.21-openssl-1.1.0-compatibility.patch
Comment 2 Alon Bar-Lev (RETIRED) gentoo-dev 2018-02-10 23:34:03 UTC
Hi,
It required much more work, the openssl-1.1 was contribution that I merged without properly testing.
Can you please check master if there are more issues?
Please also try to interact with upstream directly for upstream issues, gentoo will inherit any fix.
Thanks!
Comment 3 Alon Bar-Lev (RETIRED) gentoo-dev 2018-06-02 19:15:34 UTC
Should work with pkcs11-helper-1.23
Comment 4 Alon Bar-Lev (RETIRED) gentoo-dev 2018-06-15 06:10:53 UTC
Please reopen if does not work