Commit Graph

1304 Commits

Author SHA1 Message Date
Christian Hohnstaedt
2b3f4dd039 Combine #90 and #315 and support UPN in name constraints 2024-09-15 09:25:44 +02:00
Christian Hohnstaedt
cb1f02502d Close #90, #361: Name Constraints (RFC5280 section 4.2.1.10)
Some checks failed
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Has been cancelled
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Has been cancelled
Conversion of name constraints from certificate to Template
(Advanced Tab) and using them from there was working since long.

Now there is an additional input line, like (and next to)
SubjectAlternativeName with live validation and edit button
with guided input.

The conversion from cert to template now puts the extension
into the correct LineEdit and not on the Advanced Tab anymore.

However, XCA does NOT follow the constraints, yet.
It is still possible to issue certificates with arbitrary
names, independent of any "Name Constraints" in the CA.

This is what issue #239 asks for.
2024-09-14 23:53:59 +02:00
Christian Hohnstaedt
c6304a073d Close #296: Proper plurals
Some checks are pending
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Waiting to run
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Waiting to run
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Waiting to run
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Waiting to run
Use the provided plural mechanisms of QT.
The "PO" translation also works smoothly and
the translation mechanisms between .po <-> .qt
was tested successfully.

The new english translation file translates
the single phrase:
 "Delete the %n revocation list(s): '%1'?"
into
 "Delete the revocation list: '%1'?" for one item
and
 "Delete the %n revocation lists: '%1'?" otherwise
2024-09-14 10:22:45 +02:00
Christian Hohnstaedt
09a2924912 OpenVPN is not PEM 2024-09-14 01:13:18 +02:00
Christian Hohnstaedt
1ac1dc0a71 Extend password write dialogs by the file name
Now the Password dialog for exported items
also shows the file name of the current export
and not only the internal name of the item.
2024-09-14 01:13:18 +02:00
Christian Hohnstaedt
c806631906 Drop the Password input message for PVK files
Encrypted PVK files are not supported anymore since
39da47c217
So the password dialog messages are also supervlous.
2024-09-14 01:13:18 +02:00
Christian Hohnstaedt
46c1b78577 Close #88: Export to multiple files
Extend the ExportFile dialog by a checkbox to
switch between "all-in-one-file" or every item in a separate
file. It is only visible if more than one file is selected.
Activating the checkbox will:
 - Change the file-input into a directory-input and cut off the
   file name
 - Disabling all formats that are intended for multiple items.
De-activating the checkbox will:
 - Change the directory-input back into a file-input
   and append the previously erased file name again.
 - Disabling all export-formats that are only useful for single items.
2024-09-14 01:13:18 +02:00
Christian Hohnstaedt
28425b6ec4 BioByteArray: add tests for new methods 2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
60aefeac53 Close #313: Support JWK export format of certificates
The "x5t" and "x5t#256" properties are always present.
The "x5c" Certificate chain can be optionally selected.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
2e70aa6329 Feature #313: Support JWK sets
When multiple keys are selected, put them all into
one file as a JWK set, which is "keys" array of JWK objects.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
778e5c2e3a Feature #313: Add JWK export
Export private and public keys as JWK.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
7078853573 Consolidate Bignum2ByteArray conversion implementations
Unify the different implementations of Bignum-to-QByteArray
implementations by our BioByteArray class.

Also support alignment to a minimal bitsize.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
a3dd931fb3 Drop unneeded function BNoneLine() 2024-09-10 23:51:47 +02:00
Christian Hohnstaedt
418b78ce52 Fixup for #548: fix detection of portable app
Some checks failed
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Has been cancelled
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Has been cancelled
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Has been cancelled
Don't call getHomeDir() in global constructor before main()
2024-09-08 12:17:39 +02:00
Christian Hohnstaedt
d256da3858 Fix debugging-info on Windows
The file separator bite again
2024-09-08 11:42:57 +02:00
Christian Hohnstaedt
775939b3ae Close #552: issues with icons in gnome dock
coreApp->setOrganizationDomain() expects the domain
in DNS order (hohnstaedt.de) and not reversed.

Change the WM_CLASS property to "de.hohnstaedt.xca"
via setApplicationName().
While Qt6 prepends the reversed "OrganizationDomain",
Qt5 does not and setting the complete name with
domain-prefix works for both.

Also adopt the ".desktop" file name to follow the application-name
and fix issues found by "desktop-file-validate"
2024-09-07 21:52:29 +02:00
Christian Hohnstaedt
60ca584266 Close #315 Support UPN type for EAP/802.1X certificates
Replace "UPN:" by "otherName:msUPN;UTF8:" when generating
the extension from the Subject- and IssuerAlternativeName.

Extend the Edit dialog of the SAN and IAN by the "UPN" prefix.

Replace "otherName:msUPN;UTF8:" by "UPN:" when creating a template
from an existing certificate or request.

The OpenSSL config file export, the configuration display
and edit on the "Advanced Tab" are not afffected, since
this is an XCA syntax sugar, not supported by OpenSSL.

Update documentation
2024-09-06 10:07:51 +02:00
Christian Hohnstaedt
73f1029f52 Constify extList 2024-09-06 09:24:59 +02:00
Christian Hohnstaedt
7f5bdb7dec Close #287: template don't save/restore correctly
Use the probably modified internal name of the template
in the template-details dialog before import.

Therefore the name of the qlineedit of the internal name of
all other details dialogs changed from "descr" to "description"
to match the name in the NewX509 dialog and to be found
by the "XcaDetails" class.

When exporting the template data, add the internal name and the comment
to the exported data.
The XCA template data is defined by us and can be modified.
This change is backwards and upwards compatible:
  New versions of XCA can read an old Template export and vice-versa.
2024-08-31 14:48:43 +02:00
Christian Hohnstaedt
a2ea166cac Close #351: a1int::getLong() doesn't handle all error cases
Check for LONG_MAX and LONG_MIN and throw an error if the returned value
is too big.
2024-08-31 14:48:43 +02:00
Christian Hohnstaedt
6777f7c853 Close #401: Write PEM data to a file especially for crlgen
The new option --pem-file=<filename> behaves like --pem, just that it
writes the PEM data (and nothing else) to the given file name
2024-08-30 22:17:58 +02:00
Christian Hohnstaedt
e1fbba9eaa Close #548: export certificate: error using child folder
Always initialize the working directory.
2024-08-30 22:17:58 +02:00
Christian Hohnstaedt
6bf6f4384b Automatically generate documentation of export formats
The pki_export class has all information to generate the documentation
2024-08-30 09:30:42 +02:00
Christian Hohnstaedt
9a0454b7c5 Relates #391: export expired and revoked certificates 2024-08-29 09:20:44 +02:00
Christian Hohnstaedt
b03076c474 Close #391: hide expired and revoked certificates 2024-08-29 09:10:58 +02:00
Christian Hohnstaedt
0212113424 Close #304 oids.txt not found etc if prefix non-standard
Add INSTALL_PREFIX to the header and add it to the search path
for OIDs, translations and documentation.
2024-08-25 00:47:49 +02:00
Christian Hohnstaedt
63b54f938c Add cmdline option to disable native dialogs
--no-native-dialogs disables QTs feature to display
OS specific dialogs for message-boxes and file-open dialogs.

This is currently necessary for flatpak, but may be helpful in other
occasions, too.
2024-08-24 15:09:00 +02:00
Christian Hohnstaedt
a4fc9aa110 Close #364 Export ED25519 private key with password
Allow exporting encrypted ED25519 keys.
The crypt flag was disallowed to support SSH2 export.
But since the SSH2 key is written unencrypted,
this restriction makes no sense anymore.
2024-08-24 15:09:00 +02:00
Christian Hohnstaedt
4b6965d784 Related to #364 fix writeSSH2private() function
Move writeSSH2private() and write_SSH2_ed25519_private()
from pki_key.cpp (base class for public keys)
to pki_evp.cpp (derived class for private keys)

Extend the function to write RSA/DSA/EC in traditional
format.
Remove the PEM flag from the export format to not be catched
by (PEM | PRIVATE) selector in db_key::exportItem().
2024-08-24 15:09:00 +02:00
Christian Hohnstaedt
c730a886c8 Fix #364, comment#3: Remove ED25519 from PEM line
Actually, ED25519 has no "traditional" format.
While at it, replace the switch statement by
the simpler PEM_write_bio_PrivateKey_traditional()
2024-08-24 15:09:00 +02:00
Christian Hohnstaedt
db55a09a59 Abandon 3DES triggered by #218 Encryption for exported keys
Switch Key export in "Cert+PKCS#8" and "Database dump"
mode from DES3-EDE to AES-256
2024-08-21 10:20:41 +02:00
Christian Hohnstaedt
39da47c217 Drop support of encrypted PVK files.
The RC4 "encryption" is insecure.

The unencrypted PVK key is also insecure, but it does
not give users a false sense of security.
2024-08-20 11:03:27 +02:00
Christian Hohnstaedt
ee48266625 Update OpenSSL versions
Stay with QT 6.6.3 on Windows, because windeployqt
does not deploy the gcc libs with QT 6.7.2
Stay with QT 6.6.3 on MacOS, because the info/warning
message does not show an icon
2024-08-20 11:00:21 +02:00
Christian Hohnstaedt
2060d75f51 Close #395: Flexible Clipboard Export
Generalize the Clipboard format selection
and extend it to certificates.

Certificates may now be exported as chain
or together with private key.

The clipboard format selection also
affects the Drag&Drop content.

The Export->Clipboard men now also shows the
currently selected format export.
2024-04-23 22:01:38 +02:00
Christian Hohnstaedt
e1914d3fd3 Improve translation file lookup on linux
Also look in the directory of the application
if no other translation was found.
Add search path for qt5 or qt6 library translations
depending on the compiletime library version

Use static initializers while at it.
2024-04-23 21:49:39 +02:00
Christian Hohnstaedt
c7565cf0f1 Fix calendar export for CAs
The export checked the F_CHAIN flag, but the export item
used the F_CA flag to indicate CA calendar exports.
2024-04-22 19:13:24 +02:00
Christian Hohnstaedt
e3c2c40f1e Support importing existing OpenVPN TLS Auth keys
The TA-Key is the property of a CA.
2024-04-22 19:13:02 +02:00
Christian Hohnstaedt
f3ed7ef09e Fix missing takeys table in new databases
The "takeys" table was only created for existing databases.

New databases were immediately marked as version "8" databases
and the tykeys table creation was skipped.
2024-04-22 19:13:02 +02:00
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
e72ffb1445 Extend #383: tag insecure PFX/PKCS#12 algorithms
Show the insecure algorithms with the postfix (insecure)
in the dropdown menu.

Since the "insecure" is translateable, put the algorithm NID
into the data field of the combo-box entry to
reliably find the correct entry by NID instead of text.
2024-03-10 18:53:52 +01:00
Christian Hohnstaedt
10e8385c69 Extend #383: support PKCS#12 export format: pbeWithSHA1And40BitRC2-CBC
This ancient, insecure algorithm is apparently
still required by some systems.
2024-03-10 18:53:52 +01:00
Christian Hohnstaedt
b395eaa5cc Close #536: macos include OpenSSL legacy provider
Put it into the "PlugIns" directory and load it from there.
Show whether the legacy-provider was loaded in the About-Dialog.

CmakeLists.txt: Improve OpenSSL Major version detection
and replace the foreach() loop in misc/CMakeLists.txt
by the simpler list(TRANSFORM ...)
2024-03-10 18:53:52 +01:00
Christian Hohnstaedt
1199d776d2 Close #89: ta.key for OpenVPN tls-auth
The ta-key will be generated on-demand and assigned to the
issuing CA. All issued certificates of this CA will use the
same ta-key.

It can be exported as single file and will also be part of the
exported openvpn configuration file.

Extend export tests to validate the output of ta-keys
and adapt the OpenVPN conf file export test to also check the ta-key.
2024-03-04 12:21:00 +01:00
Christian Hohnstaedt
0dd587a3f2 Move OpenSSL configuration file generation
Instead of being a special context menu entry,
make it an option in the export dialog.
2024-03-04 12:21:00 +01:00
Christian Hohnstaedt
06009705bb Close #496: PKCS11 access to AWS CloudHSM failed
It results in CKR_SLOT_ID_INVALID error.

Use CK_SLOT_ID definition (unsigned long)
consistently. It is 64 bit on Linux.

Especially don't mangle it through an 'int'
in line 226 of lib/pkcs11_lib.cpp
2024-02-29 17:57:46 +01: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