Commit Graph

899 Commits

Author SHA1 Message Date
Christian Hohnstaedt
f07d25a076 Update copyright years 2024-02-14 22:33:18 +01:00
Christian Hohnstaedt
d17131d297 Warn in case of weak PFX algorithm configured 2024-02-09 22:21:58 +01:00
Christian Hohnstaedt
0c1c00962f Fix whitespace errors 2023-12-30 11:01:11 +01:00
Christian Hohnstaedt
dbe9eaa891 Extend GUI test by PEM import 2023-11-03 13:06:54 +01:00
Christian Hohnstaedt
41e46c1f51 ASAN: drop more ressources on exit 2023-10-30 20:01:31 +01:00
Christian Hohnstaedt
4fe06de78b Improve error handling in case of a wrong private password
instead of simply doing nothing.
2023-10-25 20:08:52 +02:00
Christian Hohnstaedt
e3791e2609 Add GUI test - testing the NewKey dialog 2023-10-24 17:03:09 +02:00
Christian Hohnstaedt
1599409b4f Remove duplicate Help-Button in CSR view
Fixup for 2333b02ddc
2023-10-19 19:02:26 +02:00
Christian Hohnstaedt
94a1eced62 Make XCA templates viewable for import
Until now XCA templates could not be viewed during import.
But this is necessary to skip the multi-import dialog.

The NewX509 dialog is used with almost everything disabled.
2023-10-08 22:19:18 +02:00
Christian Hohnstaedt
fc0191a512 Disable Public key import when displaying key of cert
Importing the displayed public key of a certificate during
certificate import resulted in a double free.

The "import" flag of the key-details can now forcefully
disable the import button.

Fixing it was way more complex than simply disabling it.

Also add sanity checks for pointers that are not our childs
when creating the QModelIndex
2023-10-08 22:19:18 +02:00
Christian Hohnstaedt
993da2d474 Use C++11 initializers for all non-static class members
When XCA started in 2002, there were no C++ initializers.
Drop explicit initializers from the constructors.

 - Fix indentations of section declarators.
 - Replace NULL by nullptr when feasible.
 - Sort private section: properties first, then methods.
2023-10-08 22:19:18 +02:00
Christian Hohnstaedt
7f4794ff4a Improve import: Finish multi import when empty
Also only register ImportMulti and Detail dialogs
as child of its parent, if the parent is visible.
2023-10-07 20:51:07 +02:00
Christian Hohnstaedt
07d813317e Avoid database access without open database
When displaying external items before import,
XCA tries to find their issuer and matching key in the database.

Now it only does it if the database is open.
2023-10-06 11:49:07 +02:00
Christian Hohnstaedt
2333b02ddc Close #384: Quick view of certificates without trying to open XCA
The ImportMulti dialog does not show up if there is only
one item to display, but the item is displayed directly.

The displayed items have a new "Import" button to import
directly from the viewed item.

If XCA is called with certs, crls, keys etc. from the commandline
XCA only displays and optionally imports the item if a default
database is given. Afterwards XCA exits.
2023-10-05 23:12:40 +02:00
Christian Hohnstaedt
3a73697406 Drop global pointer to mainwin by fixing its last user db_x509
Instead of querying the view about the selected item,
let the view store the current item in the model.
2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
42b76418fb Enable Warnings and fix them 2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
8f05c3eac9 Close #465 Export PEM + Key in one File
Fix logical error when exporting in PEM format.
The key export part was not reached...

The diff is much smaller when displayed with -b to skip
indentation-only changes....

Drop the unused "F_PLUSKEY" flag and fix the Template export
2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
be31b6e22e Make XCA AppStore compliant with -DAPPSTORE_COMPLIANT=ON
APPSTORE_COMPLIANT = ON:
 - Turns off the File menu and moves the language selector to
   the "Extra" Menu. "Options" and "Exit" are at the xca-macos
   special-menu anyway.
 - Switches the signing key from "Developer ID Application" to
   "3rd Party Mac Developer Application"
 - Sets the database name to "default.xdb"
 - Adds "-appstore-compliant" option to macdeployqt
 - Picks the "entitlement-appstore-compliant.plist"
 - Disables the "Token" menu and "PKCS#11 provider" tab
   in the option dialog
2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
856032b4a3 Silence warning message 2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
1159844cbe Show the real path of the running executable
in the About dialog
2023-09-30 11:24:18 +02:00
Christian Hohnstaedt
8aaffcde91 Alphabetically sort the languages 2023-09-30 11:24:17 +02:00
Christian Hohnstaedt
f457a991c6 Reduce debug code 2023-09-24 11:38:06 +02:00
Christian Hohnstaedt
cccc8ee1e3 Close #440: yellow background makes date text hard to read in dark themes
Adapt red and yellow background colors depending on the used theme,
detected by: "Text color lighter than Background color?"
2023-09-23 12:28:15 +02:00
Christian Hohnstaedt
c1bee8b38d Close #442: asan checks failed
Enable ASAN with -DADDRESS_SANITIZER=ON
Fix all findings inside XCA.
2023-09-20 21:08:44 +02:00
Christian Hohnstaedt
a324d1faeb Close #446: show more information in Recent Databases
Always print at most 30 characters of the database name.
Especially on macos the ToolTip Popup does not work.
2023-09-20 13:40:01 +02:00
Christian Hohnstaedt
2e36fd431a Macos: fix messagbox
Simple message boxes are still native messageboxes.
Complex message boxes have buttons with adapted texts.

Apparently the "Q_OBJECT" declaration in "xcaWarningBox"
made it. Don't know why.
2023-09-19 23:52:26 +02:00
Christian Hohnstaedt
65f2676939 Q_OS_MAC is deprecated 2023-09-19 23:39:03 +02:00
Christian Hohnstaedt
5cdd1e134c Improve database plugin detection
Drivers that fail with "Driver not loaded"
are skipped silently.
2023-09-15 21:45:08 +02:00
Christian Hohnstaedt
c34859797e Use existing font "Courier New" monospace font 2023-09-15 21:43:10 +02:00
Christian Hohnstaedt
5ed19e689e Optical improvement of main- and help-window 2023-09-15 09:38:29 +02:00
Christian Hohnstaedt
96ca26cc83 Integrate bulgarian translation
Thanks to Svetoslav Slavkov
2023-09-03 22:37:02 +02:00
Christian Hohnstaedt
061f676041 Improve/simplify item import
Unify import functions for some (on_butImport_clicked)
or all (on_butOk_clicked) items.
They both call "importIndexes(const QModelIndexList &indexes)"
containing some or all indexes to import.

db_x509.cpp: Only need to search the treeItem (containing all items
without issuer, not all in the rootItem (containing also certificates
with known issuer)

Re-use "remFromCont()" when stealing items from an other CA.
2023-05-30 14:38:55 +02:00
Christian Hohnstaedt
b126890bd7 Revert "Messagebox: Workaround for error not showing up"
This reverts commit eeedd6ec0e.
2023-05-25 23:23:15 +02:00
Christian Hohnstaedt
8662eff3ed Basic Constraints Pathlen: restrict input to postitive numbers 2023-05-25 22:19:14 +02:00
Christian Hohnstaedt
8f277ea781 x509v3_ext: Improve error-checking
Validate SAN, IAN, AIA, CRLDP during rollout.
Fix tab-switching when validating new certificate context.

Also work with X509_EXTENSION being nullptr
2023-05-25 22:18:48 +02:00
Christian Hohnstaedt
5f5ed2f22b Remote database names lost their numbers in recent Qt 2023-05-25 21:24:41 +02:00
Christian Hohnstaedt
780225198d macos CMake defaults for local arch, SDK and brew-Qt
The universal binary with older SDK and aqt-Qt will be
built by the release/build-mac.sh script
2023-05-25 21:23:48 +02:00
Christian Hohnstaedt
eeedd6ec0e Messagebox: Workaround for error not showing up
This was only observed on MacOS on M2 with QT 6.5.0.
Weird ..
2023-05-23 19:48:02 +02:00
Christian Hohnstaedt
d6d6d7d9d4 Update copyright years and adapt build scripts 2023-05-16 10:35:14 +02:00
Christian Hohnstaedt
fdf48c8b5b PR #425: Refresh supported hashes after key generation
There were 2 slots to trigger the switchHashAlgo()
whenever the selected key or request changes.

But their signature for automatic connect()ion was wrong.
After fixing the methods signature, they are connected
and get called whenever the keylist changes and especially,
when a new key is inserted.
2023-05-16 09:49:46 +02:00
Christian Hohnstaedt
7206024d6a Fix deprecation warnings
The proposed "addAction()" with the KeySequence as 2nd argument
is only available soince Qt6.3 and not compatible with QT5
Change the call in a compatible way and set the shortcut afterwards.
2023-05-14 21:49:13 +02:00
Christian Hohnstaedt
fa0d67b26c Adaptions for QT 6.5 and macos
- Create universal binaries
 - re-create menubar to avoid duplications during language change
 - Select MACOS SDK 11 when using  QT-6.5 requiring it.
2023-05-14 21:41:47 +02:00
Tobias Wich
097cbfb815 Add PKCS12 enc algo setting and use it when exporting PKCS12 2022-10-06 15:32:30 +02:00
Tobias Wich
d177f8cd08 Add PKCS12 encyrption algorithm combo box 2022-10-06 15:15:39 +02:00
Christian Hohnstaedt
dac8f97cc1 Fix images and icons on windows
xca.ico is only used as resource of the EXE file. To make
that work, the linker option -MD is necessary.

Use the 128x128 px PNG in favor to the 128x60 px PNG
as icon to avoid rescaling.
Don't use the xca.ico, which would require "imageformats/qico.dll"

This also reverts the rubbish commit 583b9f82b2.
2022-09-07 20:01:25 +02:00
Christian Hohnstaedt
bd61f44e02 Refactor source file inclusion
No libraries needed. Just put all files as source to xca
and those needed for xcadoc to the xcadoc target.
Github Action: create deployments for each matrix result
2022-09-07 20:01:25 +02:00
Christian Hohnstaedt
ced6dfc41a Add support for Qt6
XCA now supports both, Qt6 and Qt5 down to Qt-5.2

Use CMAKE_PREFIX_PATH to point to the QT dompiler directory like
$ cmake -B build -DCMAKE_PREFIX_PATH=$HOME/6.3.1/gcc_64
2022-08-31 00:09:37 +02:00
Christian Hohnstaedt
ded935b033 Prepare for Qt6: QRegExp -> QRegularExpression
QRegExp is deprecated and needs special library
in Qt6: core5compat

Replace by QRegularExpression which has been introduced by Qt5
2022-08-31 00:01:06 +02:00
Christian Hohnstaedt
ee842feb5e Improve windows compatibility 2022-08-31 00:01:06 +02:00
Christian Hohnstaedt
da00a50b30 Don't construct english sentences 2022-08-07 22:30:32 +02:00
Christian Hohnstaedt
4e194b0255 Integrate persian translation
Thanks to Erfan Esmayili Barzi
2022-08-03 10:15:23 +02:00
Melg Eight
2d8ebfe227
Enable usage of crlNumber from user
Signed-off-by: Melg Eight <public.melg8@gmail.com>
2022-02-16 10:01:27 +03:00
Melg Eight
3f6b0105a3
Enable usage of hashAlgo digest selected by user for CRL sign
Signed-off-by: Melg Eight <public.melg8@gmail.com>
2022-02-15 19:24:47 +03:00
Christian Hohnstädt
d4822cfaf7
Merge pull request #335 from melg8/fix_icons_names
Add missing comma between two image names
2022-02-11 22:05:32 +01:00
Christian Hohnstädt
a1134f532a
Merge pull request #333 from melg8/fix_memory_3
Fix wrong pointer type casting
2022-02-11 21:54:30 +01:00
Melg Eight
4063884740
Add missing comma between two image names
Before that "" was concatenated with second element so each
call by index to that array would be off by 1.

Signed-off-by: Melg Eight <public.melg8@gmail.com>
2022-02-10 15:06:37 +03:00
Melg Eight
4e1269974f
Fix wrong pointer type casting
Method event can get called with QChildEvent instead of
QHelpEvent.

Signed-off-by: Melg Eight <public.melg8@gmail.com>
2022-02-10 04:20:53 +03:00
Melg Eight
2288ac9e58
Fix possible null pointer dereference
Call to temps may return nullptr if dynamic_cast fail to
cast pointer to db_temp* type.

Signed-off-by: Melg Eight <public.melg8@gmail.com>
2022-02-10 04:13:01 +03:00
Christian Hohnstädt
06fbe10d24 cmake: fixup undefined variables
Remove unused variables, define variables for all platforms
and fix typo
2022-01-03 20:03:31 +01:00
Christian Hohnstädt
e92031cf0d Drop debugging output 2021-11-20 02:12:02 +01:00
Christian Hohnstaedt
4d401792a9 OpenSSL: Avoid all FILE pointer operations, use QFile
For interoprability reason.
To enforce it, set "#define OPENSSL_NO_STDIO 1"
All file access is done by reading/writing from/to BioByteArray()
which is filled by QFile:readAll()

Drop CRYPTO_malloc_debug / CRYPTO_mem_leaks
which is unused and disabled since many years.
2021-11-13 23:53:11 +01:00
Christian Hohnstaedt
25d2fdabb2 Fix and improve building help and documentation
- Always build html documentation if sphinx-build is available.
  to be installable during install
- Collect "${D}/qthelp/xca.qhc" "${D}/qthelp/xca.qch" in QTHELP_IDX
  and use this instead.
- On linux also install the qthelp in an html subdirectory like WIN32
- Don't instanciate QHelpEngine if no help available.
2021-11-13 14:49:02 +01:00
Christian Hohnstaedt
a70ffe4ff1 Move XcaDialog call from x509_super to XcaWarning 2021-11-13 14:49:02 +01:00
Christian Hohnstädt
6ea01e80f6 Refactor item export: separate GUI and database
Collect all export formats in pki_export.

Each export format has assigned acouple of flags, indicating,
whether they are text, concatenateable, encrypted, usable for
multiple selections or only for a single item.
2021-11-13 14:49:02 +01:00
Christian Hohnstaedt
48bed71f79 Enable-disable PEM comment checkbox 2021-11-13 13:38:51 +01:00
Christian Hohnstaedt
f2fe9be3f3 Move file loading GUI element out of non-gui container class (db_*)
into GUI View widgets/*TreeView.cpp
2021-10-30 11:51:35 +02:00
Christian Hohnstädt
be1a44d0a8 Consolidate export types and format in pki_export class
Move the descriptons from the ExportDialog into the
new pki_export class.

Also translate the exportType::etype to F_* flags
2021-10-30 11:51:35 +02:00
Christian Hohnstaedt
36e02374ff Put XcaWarningBox on the stack not on the heap 2021-10-24 20:32:12 +02:00
Christian Hohnstädt
b10c6c80ae Extend PR: #307: Enable indonesian language
Andika Triwidada as indonesian translator
2021-10-24 17:55:35 +02:00
Christian Hohnstädt
13b0992780 Set Key export format separately via context menu
The popping up query dialog during PEM export via Drag&Drop
and Ctrl-C during Key export was pretty annoying.
2021-10-24 14:41:25 +02:00
Christian Hohnstaedt
c752508979 Separate XCA Warning in Cmdline and GUI 2021-09-09 21:46:30 +02:00
Christian Hohnstaedt
e9f36fc72b Move storeItems() from db_base to XcaTeeView 2021-09-09 21:30:06 +02:00
Christian Hohnstädt
56c6df6c90 editComment: Move Gui elements to widgets/XcaTreeView
Another step to separate GUI from functionality
2021-06-19 13:18:48 +02:00
Christian Hohnstaedt
8cdc15aa39 Move database_schema.cpp from widgets to lib
there are no GUI elements in database_schema.cpp
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
a233ec89f9 QObject: Add Q_OBJECT macro where necessary 2021-06-01 17:48:37 +02:00
Christian Hohnstädt
52bf30e47b Visual Code adaptions 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
915a920de8 cmake: Split CMakeLists.txt into the different sub directories
mv cmake/sphinx-documentation.cmake -> doc/CMakeLists.txt
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
9180a3ea31 Move font information from db_base to TreeView 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
cfe788d362 Don't store the current locale ourselves. QLocale() does the job
This also seperates UI from the core.
After calling QLocale::setDefault(), the empty QLocale constructor
returns the current default locale.
This is now used instead of XcaApplication::language()
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
e066619a08 Close #283 Nitrokey HSM2 can't create EC keys on 2.4.0
Correctly create NewKey list items for smart-cards mechanisms.
use the PKCS#11 ID t.mech as parameter for CK_MECHANISM_TYPE
instead of t.type, which is an OpenSSL ID.
Both are numeric, so the compiler didnot complain.

For RSA it worked accidentally, because
type:EVP_PKEY_RSA == mech:CKM_RSA_PKCS_KEY_PAIR_GEN == 0

Bug introduced after 2.3.0 with
77519936e0

Set the mechanism of ED25519 to CKM_VENDOR_DEFINED, because ED25519
is not supported by PKCS#11 and 0 means CKM_RSA_PKCS_KEY_PAIR_GEN.
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
61fa66b129 Add digest class encapsulating EVP_MD
Enables the separation of the core classes from the hashbox widget
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
4e2a4b7d1a Move default keyjob from NewKey to the keyjob class
another step to separate widgets from the core
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
487f5e2046 Cleanup: Drop many superflous includes and unused loadImg() function 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 Hohnstädt
68273d0a30 Switch from autotools/qmake to cmake
Why?
 - QT will switch from qmake to cmake sooner or later.
 - autotools are good for unix-ish systems, cmake also for
   macOS and Xcode as well as Windows and VS-code
 - Cross compiling the windows-binaries on linux
   is not very helpful to attract windows-centric
   developers.

Also drop qmake's xca.pro
Generate man-page and sphinx sources of commandline arguments
during build by executing xca (xcadoc.cpp).
Generating Version-patchlevel and git hash is now also
OS independent.
2021-06-01 17:48:37 +02:00
Christian Hohnstädt
1adcceaa66 Drop OpenSSL backward comatibility for NID_tlsfeature
it was not defined for OpenSSL < 1.1.0
which is not supported anymore anyway.
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
b20ef7f32a Diffie-Hellmann: use XcaProgress dialog 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
82da759a4e XcaProgress: separate Cmdline progress from GUI progress
The generic XcaProgress object is used, which dynamically
creates a Cmdline progress object.
The Mainwindow replaces it by a GUI object, which integrates
into the status bar.
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
2621d20d22 make dbhistory independent of GUI widget OpenDb
the "lastRemote" database is not GUI specific and
has been moved from "OpenDb" to the non-gui class dbhistory,
which in turn becomes independent of OpenDb
2021-06-01 17:48:37 +02:00
Christian Hohnstädt
82936fa3bd No need to especially mention brainpool curves
They are part of OpenSSL 1.0.2, XCA now requires
at least OpenSSL 1.1.0
2021-05-11 12:07:40 +02:00
Christian Hohnstädt
8daf06dcac Close #259: Follow the XDG base directory specification
After dropping Qt4 support, the Qt5 QStandardPaths class
can be used to replace my implementation of directory discovery.

QStandardPaths follows the XDG specification.
2021-05-11 12:04:46 +02:00
Christian Hohnstaedt
7d564132ba Move ca-properties dialog to the certificate view
Reduce UI from QDialog to QWidget and display it in the XcaDialog frame.
Also move user interface specific code from the db_x509 class
into the CertTreeView class
2021-05-10 20:41:12 +02:00
Christian Hohnstaedt
57802580c8 Drop backward-compatibility for old(<2.0.0) XCA databases 2021-05-10 20:41:12 +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 Hohnstädt
d5fa97c3bb Drop support for Qt4
Version 2.4.0 was the last one with Qt4 support
2021-05-09 12:25:32 +02:00
Christian Hohnstaedt
2c38ddbd8d Set default key size to 2048 instead of 0
when changing the key type from EC/ED25519 to RSA/DSA
2021-05-07 22:30:51 +02:00
Christian Hohnstaedt
f24038bbdc Update changelog and copyright year 2021-05-07 21:58:09 +02:00
Christian Hohnstaedt
0f98d17f3a Close import-dialog when it is empty
either after deleting or importing the last item
2021-05-05 21:52:23 +02:00
Christian Hohnstädt
703d9c0ba7 sql: better handle SQL errors during insert
Don't pop-up a success message, but delete the item,
if an SQL error occures during insert.
2021-05-05 19:39:28 +02:00