Commit Graph

841 Commits

Author SHA1 Message Date
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