Commit Graph

93 Commits

Author SHA1 Message Date
Christian Hohnstaedt
7c2a805ede Fix login via PinPad on e.g ReinerSCT
Setting in opensc.conf:
  reader_driver pcsc {
    enable_pinpad = true;
  }

Only call login once and return an empty pin
instead of a NULL pin, which indicated a failure
while an empty (non-NULL) return-value
indicates success.
2024-04-22 19:13:02 +02:00
Christian Hohnstaedt
4b37902052 Yubikey select one of the special IDs
Yubikey defines and enforces 4 (NEO) or 24 (YubiKey YK4, YubiKey YK5)
slots with special, fixed names.

Add a dropdown box if "fixed_ids" are present and let the user select
the slot during key generation.
2024-02-29 17:57:46 +01:00
Christian Hohnstaedt
844e74632b Yubikey: add p11.tokenLoginForModification()
to encapsulate the most used configuration and
add the need_SO_for_object_mod() function
to establish a SO-login on yubikeys when modifying items..
2024-02-29 17:57:46 +01:00
Christian Hohnstaedt
d52708e5b4 Consolidate Workarounds for special tokens
to document their use ...
2024-02-29 17:57:46 +01:00
Christian Hohnstaedt
7e3b0e12fd Add pkcs11::closeSession() to fix token management
The Yubikey does not like an open read-only session
while changing items with a write-session
2024-02-29 17:57:46 +01:00
Christian Hohnstaedt
46e82e254e Constify tokenInfo() and findUniqueID()
No functional change
2024-02-29 17:57:46 +01:00
Christian Hohnstaedt
143d059ded Take care of OpenSSL and LibreSSL compatibility
OpenSSL 1.1.1 - 3.1.x are supported as well as
LibreSSL 3.6.x
2023-11-02 21:08:44 +01:00
Christian Hohnstaedt
42b76418fb Enable Warnings and fix them 2023-09-30 11:24:18 +02:00
Yaroslav Isakov
46c0f7ed25 Fix OpenSSL 3.0 engine asking two times for sign
In commit 9767a3dca7
OpenSSL changed sign behavior, that now it calls sign mechanism two
times - first with NULL output buffer, to get size of it, for next call.
This causes two sign operations in token for ED25519, so, let's detect
NULL buffer and return size of signature.

I haven't tested other type of keys - it's possible that they have
the same issue.
2023-05-16 09:49:46 +02:00
Christian Hohnstaedt
ee842feb5e Improve windows compatibility 2022-08-31 00:01:06 +02:00
Yaroslav Isakov
31e6fdd3ef Fix OpenSSL 3 compatibility in ED25519 smartcard code
Also, use proper defines instead of EC one
2022-08-06 22:36:33 +02:00
Yaroslav Isakov
6d098460d6 Support importing ED25519 keys and signing with them, using PKCS#11 tokens
What works:
- Importing ED25519 Signature key from Yubikey token (OpenSC with openpgp driver, key generated via gpg)
- Creating self-signed certificate for CA, for Signature key from card
- Signing Certificates using new CA

I haven't tested other features, e.g. storing new certificate on card, so, they're probably broken
2022-07-28 22:54:32 +02:00
Christian Hohnstaedt
0e5af2e452 Replace check_oom() by Q_CHECK_PTR()
Qt offers the functionality. No need to invent it ourselves.
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
00926e3efd Get rid of libltdl. QLibrary provides the same functionality 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
f8915fbc98 PwDialog: Split into cmdline-core and GUI
Another step to split core and GUI components
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
0c5603ec20 XcaWarning: Split into Core and GUI element
one more step to split core and GUI components
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
802a8787cf Adaptions to stay OpenSSL 3.0 alpha16 compatible 2021-05-12 08:49:28 +02:00
Christian Hohnstädt
1500e636c8 Drop OpenSSL backward compatibility hacks < 1.1.0
OpenSSL < 1.1.1 is out of support anyway
2021-05-09 12:25:32 +02:00
Christian Hohnstaedt
c528c37986 Merge branch 'master' into develop 2020-04-05 10:58:47 +02:00
Christian Hohnstaedt
4314b0ead9 constify slotid 2020-04-05 09:16:12 +02:00
Christian Hohnstaedt
2d0980d4f6 Use pkcs11_lib_list as model for Options:pkcs11list
Change pkcs11List from QListWidget to QListView
The pkcs11_lib_list holds the data of the loaded libraries.
For the model a QList "model_data" is used to
hold indexes into QList dirs to allow duplicates,
moves and removes.

On windows it now displays the paths with \ separators.
2020-04-05 09:16:12 +02:00
Christian Hohnstaedt
928ff6458c Improve and fix qDeleteAll()
qDeleteAll() does not clear the QList.
Add it, if necessary.

Use dynamic_cast where appropriate
2020-03-20 16:29:42 +01:00
Christian Hohnstaedt
aacd9ee5f6 Make XcaProgress and WAITCURSOR cmdline compatible 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
19eafe1739 Improve and fix qDeleteAll()
qDeleteAll() does not clear the QList.
Add it, if necessary.

Use dynamic_cast where appropriate
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
e4d0ab8f8e Refactor Image and icon ressources 2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
a90d7b5b0d Improve password input handling
Unify password results
Retry on password verification error
Honor the users wish to exit
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
113a201d39 Separate database from Mainwin for better cmdline support
New classes:
 - database_model: Manage the database tables (keys, req, cert, crl, templ)
   extracted from widgets/MW_database.cpp
 - arguments: parse commandline, dynamically create help text
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
ced0995862 Close #91: Change order of "PKCS#11 provider"
With this commit PKCS#11 libraries may be reordered
and enabled or disabled.

The slot selection dialog iterates over all enabled and successfully
loaded libraries in the configured order and collects the slots
of each of them.

In the options dialog the library info is shown in the tool-tip
2019-03-21 06:12:51 +01:00
Christian Hohnstaedt
bfe6fbbc43 Close #24: Add LibreSSL support. Tested with LibreSSL 2.7.2 2018-04-22 16:12:04 +02:00
Christian Hohnstaedt
3eef4bd12b Fix translation artefacts.
No need to translate "X Certificate and Key management",
"Form", "Dialog" or "TimeInput"

"Select Token" and "New Key" window titles were never shown.
Remove them.
2018-03-28 08:13:22 +02:00
Christian Hohnstaedt
e1b982a346 Replace printf by qDebug 2018-03-05 07:46:10 +01:00
Dancho Penev
b0d131e79a SF bug #124 Wrong assumptions about slots returned by PKCS11 library
When using PKCS11 library to manage smart cards the code assumes
that all slots returned by the library call are not empty.
In some cases Gemalto's library returns list of slots in which the
first one is empty and the second one is occupied by the smart card,
this causes xca to report an error and isn't able to use the smart card.
2018-02-07 11:10:04 +01:00
Christian Hohnstaedt
3f20bce3f9 OSSL 1.1 vs. 1.0: Drop some #ifdef from the pkcs11 2017-06-19 08:33:29 +02:00
Christian Hohnstaedt
077c061d0e OSSL 1.1 vs. 1.0: Add openssl_compat.h centralizing the #ifdef Hell 2017-06-19 08:33:29 +02:00
Patrick Monnerat
ad6c2baae5 Add support for OpenSSL 1.1.0
The API changed heavily. New functions arrived, old functions
disappeared and many structures became opaque.

This version of the patch implements pkcs11 signing as follows:
- openssl < 1.0.0: rsa & dsa without engine
- openssl 1.0.x: rsa, dsa & ec with engine
- openssl >= 1.1.0: rsa, dsa & ec without engine

In the operation, we therefore also gain implementation of dsa signing for openssl < 1.0.0 (ec disabled because EC_KEY_METHOD was not yet invented!).

I've given up trying to use a PKEY_ENGINE with openssl 1.1: seems not possible anymore.

I've succeeded compiling the patched xca with openssl 0.9.8n, 1.0.2j and 1.1.0e.
I've successfully tested pkcs11 signing using softhsm with openssl 1.0.2j and 1.1.0e.

The patch also removes gcc7 new warnings.
2017-06-19 08:32:39 +02:00
Christian Hohnstaedt
806312800d Thales nCipher key generation changes for EC and DSA keys
Developed and tested by
 Mak, Mcken <Mcken.Mak@thalesesec.com>

Thanks!
2016-01-16 07:54:54 +01:00
Christian Hohnstaedt
e5541c6d67 SF. Bug. #81 Make xca qt5 compatible
Extend XCA to also compile against Qt5
Remove directory from Qt includes
2015-09-17 18:42:42 +02:00
Christian Hohnstaedt
d55eb917e2 Silence compiler warnings about unused parameters 2015-08-11 07:17:56 +02:00
Christian Hohnstaedt
854d0dbde5 Minor fixes, remove debugging output 2015-05-18 17:51:20 +02:00
Christian Hohnstaedt
2909e79317 Move entropy functions into new class
Read and write .rnd file during start and exit
2015-04-08 06:54:55 +02:00
Christian Hohnstaedt
1138dad902 SF Bug #102 Weak entropy source used for key generation
On startup use "/dev/random" and "/dev/hwrng"
as additional entropy for the OpenSSL random pool.

Collect mouse position and key press time entropy
for seeding the openssl random pool before generating keys.

When using Smartcards, use the Smartcard RNG
as additional entropy source.
2015-04-06 14:19:10 +02:00
Christian Hohnstaedt
277b25af62 Check for crashes in PKCS#11 library and inform the user 2015-02-22 17:00:06 +01:00
Christian Hohnstaedt
c8e517912a Refine PKCS#11 ECC named curve workaround for www.CardContact.de 2014-11-22 11:50:37 +01:00
Christian Hohnstaedt
7b4ea0c130 Fix DSA token signing 2014-11-13 20:10:18 +01:00
Christian Hohnstaedt
b9dd27a915 Fix EC token key generation 2014-11-13 20:10:18 +01:00
Christian Hohnstaedt
9321c92f3e DSA add Token keygen for DSA and start DSA token signing 2014-11-12 22:19:43 +01:00
Christian Hohnstaedt
2512a22aa7 Load and store DSA keys on a token 2014-11-12 22:19:43 +01:00
Christian Hohnstaedt
6927dc1b0c Fix signed/unsigned warning 2014-11-05 06:57:46 +01:00
Christian Hohnstaedt
65debf1e60 Fix my ENGINEs memory and reference handling
and remove some unused things
2014-11-01 10:02:57 +01:00
Christian Hohnstaedt
fed1a9584a Remove debugging code 2014-10-31 07:21:11 +01:00