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

libp11 fails with public key absent #312

Closed
dwmw2 opened this issue Oct 7, 2019 · 2 comments
Closed

libp11 fails with public key absent #312

dwmw2 opened this issue Oct 7, 2019 · 2 comments

Comments

@dwmw2
Copy link
Contributor

dwmw2 commented Oct 7, 2019

Once upon a time, the self tests in http:https://git.infradead.org/users/dwmw2/openconnect.git/blob/HEAD:/tests/Makefile.am#l193 used to work when built with OpenSSL + libp11.

Now they fail on the token where only private keys were imported without corresponding public keys.

Connecting to obtain cookie (token openconnect-test1 key object=RSA)... SSL connection failure
139951977556608:error:8107A005:PKCS#11 module:pkcs11_private_encrypt:General Error:p11_rsa.c:116:

To reproduce, build openconnect with libp11. Run 'make check'

gnutlsmirror pushed a commit to openconnect/openconnect that referenced this issue Oct 7, 2019
It's broken: OpenSC/libp11#312

Signed-off-by: David Woodhouse <[email protected]>
@dwmw2
Copy link
Contributor Author

dwmw2 commented Oct 7, 2019

Seen with 0.4.10 on Fedora 30: https://gitlab.com/openconnect/openconnect/-/jobs/314002609

@ansasaki
Copy link
Contributor

ansasaki commented Nov 6, 2019

Is the test trying to negotiate TLS 1.3?
I'm asking because this might be related with OpenSSL's difficulty to generate RSA-PSS signatures using the engine. This problem is caused by the fact that PKCS#11 does not differentiate RSA-PSS keys from RSA keys, but OpenSSL does. If X509_check_private_key() is called, then the matching of the key from the device and the public key from the certificate will fail.

@mtrojnar mtrojnar closed this as completed Aug 9, 2022
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

No branches or pull requests

3 participants