OpenVPN connection fails with smartcard provided private key; please update pkcs11-helper

Bug #1970943 reported by Lorenz Schwittmann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pkcs11-helper (Ubuntu)
Fix Released
High
Unassigned
Jammy
Fix Released
Undecided
Unassigned

Bug Description

* Impact

When using an openvpn configuration which uses a smartcard based authentication via "pkcs11-id" and "pkcs11-providers" the connection fails

* Test case

Try to connect to a server using OpenVPN with smartcard authentification

* Regression potential

libpkcs11-helper1 is only used by openvpn in the archive so focus the testing on openvpn + smartcards setups

-----------------------------------

Ubuntu 22.04 LTS

2022-04-29 14:07:18 OpenVPN 2.5.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Mar 22 2022
2022-04-29 14:07:18 library versions: OpenSSL 3.0.2 15 Mar 2022, LZO 2.10
2022-04-29 14:07:18 PKCS#11: Adding PKCS#11 provider '/usr/lib/x86_64-linux-gnu/opensc-pkcs11.so'
2022-04-29 14:07:19 TCP/UDP: Preserving recently used remote address: [AF_INET6]XXXXXXXXXXXXX:1194
2022-04-29 14:07:19 Socket Buffers: R=[212992->212992] S=[212992->212992]
2022-04-29 14:07:19 UDP link local: (not bound)
2022-04-29 14:07:19 UDP link remote: [AF_INET6]XXXXXXXXXXXXX:1194
2022-04-29 14:07:19 TLS: Initial packet from [AF_INET6]XXXXXXXXXXXXX:1194, sid=xxxxx xxxx
2022-04-29 14:07:19 VERIFY OK: depth=1, CN=xxxxxxxxxxxx
2022-04-29 14:07:19 VERIFY KU OK
2022-04-29 14:07:19 Validating certificate extended key usage
2022-04-29 14:07:19 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
2022-04-29 14:07:19 VERIFY EKU OK
2022-04-29 14:07:19 VERIFY OK: depth=0, CN=xxxxxxxxxxxxx
2022-04-29 14:07:19 OpenSSL: error:020000B3:rsa routines::missing private key
2022-04-29 14:07:19 OpenSSL: error:1C880004:Provider routines::RSA lib
2022-04-29 14:07:19 OpenSSL: error:0A080006:SSL routines::EVP lib
2022-04-29 14:07:19 TLS_ERROR: BIO read tls_read_plaintext error
2022-04-29 14:07:19 TLS Error: TLS object -> incoming plaintext read error
2022-04-29 14:07:19 TLS Error: TLS handshake failed
2022-04-29 14:07:19 SIGUSR1[soft,tls-error] received, process restarting
2022-04-29 14:07:19 Restart pause, 5 second(s)

The same problem has been reported upstream at https://github.com/OpenSC/pkcs11-helper/issues/52 which resulted in a fix.

I've downloaded and built pkcs11-helper version 1.29.0 and it fixed the problem indeed.

TLDR: please update pkcs11-helper

affects: file (Ubuntu) → pkcs11-helper (Ubuntu)
Revision history for this message
Eric Blevins (eblevins) wrote :

Suffering from the same problem in 22.04

After applying just this change to the Ubuntu source openvpn works as expected:
https://github.com/OpenSC/pkcs11-helper/commit/fba328fd7519833966712589be8fff419219277a

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pkcs11-helper (Ubuntu):
status: New → Confirmed
tags: added: rls-jj-incoming
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report

Changed in pkcs11-helper (Ubuntu):
importance: Undecided → High
status: Confirmed → Fix Committed
Revision history for this message
Sebastien Bacher (seb128) wrote :

I've uploaded to the current Ubuntu serie and a SRU to the LTS

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pkcs11-helper - 1.28-1ubuntu1

---------------
pkcs11-helper (1.28-1ubuntu1) kinetic; urgency=medium

  * debian/patches/git-openvpn-smartcard.patch:
    - openssl: set back key into EVP for openssl-3 to work, fix openvpn
      authentification using smartcards (lp: #1970943)

 -- Sebastien Bacher <email address hidden> Wed, 18 May 2022 15:29:01 +0200

Changed in pkcs11-helper (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Lorenz, or anyone else affected,

Accepted pkcs11-helper into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/pkcs11-helper/1.28-1ubuntu0.22.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in pkcs11-helper (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Lorenz Schwittmann (lorenz-schwittmann) wrote :

Hey there,

I have performed the following steps to test the proposed fix:

1) removed self-compiled pkcs11-helper version 1.29.0 from my system (hotfix)
2) tried to connect to an OpenVPN with smartcard authentification => failed as expected
3) enabled jammy-proposed
4) installed libpkcs11-helper1 1.28-1ubuntu0.22.04.1
5) tried to connect to an OpenVPN with smartcard authentification => connection succeeded

I therefore conclude that this update fixes the issue; thanks!

tags: added: verification-done-jammy
removed: verification-needed-jammy
tags: added: verification-done
removed: rls-jj-incoming verification-needed
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for pkcs11-helper has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pkcs11-helper - 1.28-1ubuntu0.22.04.1

---------------
pkcs11-helper (1.28-1ubuntu0.22.04.1) jammy; urgency=medium

  * debian/patches/git-openvpn-smartcard.patch:
    - openssl: set back key into EVP for openssl-3 to work, fix openvpn
      authentification using smartcards (lp: #1970943)

 -- Sebastien Bacher <email address hidden> Wed, 18 May 2022 15:29:01 +0200

Changed in pkcs11-helper (Ubuntu Jammy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.