Commit Graph

250 Commits

Author SHA1 Message Date
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
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
b03076c474 Close #391: hide expired and revoked certificates 2024-08-29 09:10:58 +02:00
Christian Hohnstaedt
a25b6c7402 Close #520: permanent processor load
Improve the timer interval maintenance process:
 - Do not fire every second,
   but at most 1 second after the last run
 - Reduce the fired events.
 - Every container now only evaluates its own elements
   (keys, certs,etc.) instead of each container evaluating all
   items and duplicating work

Disable sorting and resizing in the view during initialization,
to speed up opening the database
2024-02-23 12:24:31 +01:00
Christian Hohnstaedt
43e1b336d2 Fix crash when deleting CA certificates
If a CA certificate is deleted, all issued certificates must be moved to
an other issuer or the top-level list.

The CA cert will be taken from the model together with the issued certs
first. Then the issued certs are re-inserted.
To make this work correctly, the issuer must be erased from the issued certs
to be interpreted as insertion and not as move.
2023-10-30 01:17:50 +01: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
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
65b10c33ce Close #444 cannot update template internal name
Update internal name, even if they seem unchanged
if the force option is set.
2023-09-21 20:58:14 +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
99a7768fd9 Improve/Fix database loading
Do not interact with the GUI when loading datbase items (beginInsertRows,
beginMoveRows, beginRemoveRows, etc.) by not using
insertChild() / remFromCont() anymore.

Fill and organize the root- tree- and sub-items and call
columnsContentChanged() once when done.

Automatically set "parent" of a pki-item when inserting or removing
as child items.
2023-09-19 16:43:24 +02:00
Christian Hohnstaedt
441bc8630d Really erase element after deleting 2023-09-19 16:42:25 +02:00
Christian Hohnstaedt
11a88781f9 Merge branch 'vertical-align-fix' of github.com:gentoo90/xca 2023-05-30 18:39:35 +02:00
gentoo90
1e06d60f8e Fix vertical text alignment in the tree views 2023-05-30 18:41:11 +03: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
02fc95c70b Reset parent pointer when removing child from container
and use the issuer as parent when inserting it to
put it under the correct issuer
2023-05-16 09:49:46 +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
186657fbce Close: #366 Not Responding after upgrade
cache the results of visibility check as long as the search text remains.
This function is called many times when displaying the data,
even if the search string does not change.
2022-08-03 07:36:33 +02:00
Christian Hohnstaedt
ed475c8d9f Close #327: "Dump database" dumps everything to everywhere
Select the items to be dumped to the currently selected
directory.
2022-07-31 13:02:29 +02: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
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
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
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
9180a3ea31 Move font information from db_base to TreeView 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 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
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
Christian Hohnstädt
8c04bc2b27 Rename PACKAGE_VERSION to XCA_VERSION
For an official release XCA_VERSION == PACKAGE_VERSION.
For any additional commit, XCA_VERSION's path-level is increased.

PACKAGE_VERSION cannot be modified after initially set.
Change any occurance of PACKAGE_VERSION by XCA_VERSION
2021-04-26 10:10:23 +02:00
Christian Hohnstaedt
51f3418c68 db_base.cpp: Improve loading database content
If tan item has unsupported content like key type or algorithm,
it will be skipped with a warning now, but the database loads.
2021-04-23 15:57:32 +02:00
Christian Hohnstaedt
ff7704ff0b Add context sensitive documentation
All dialogs get the "Qt::WindowModal" modality to
operate the Help window in parallel
while also blocking the dialog parent windows.

The manageRevocations() moved from model to view

The Details dialogs become more self-sufficient.
There is a statc start method that shows the dialog and
updates name and comment after accept().
This allows recursive starts of certificate details and
independence of mainwin.
It is necessary to set the current toplevel widget as parent
for the next dialog to not block the application.
2021-04-23 15:50:13 +02:00
Christian Hohnstaedt
cbe7709b20 Close #224: Store original path/filename on import 2020-10-16 00:37:12 +02:00
Christian Hohnstaedt
ef24c00c22 Minor fixes 2020-06-26 14:21:32 +02:00
Christian Hohnstaedt
45f834a6e4 Move tree-handling from db_x509 class to the base class
This is a preparation for possibly inserting
structuring folder elements later.
2020-05-08 17:37:40 +02:00
Christian Hohnstaedt
1e544161f6 Eliminate the use of "mainwin" in lib/db_* 2020-05-08 11:59:09 +02:00
Christian Hohnstaedt
7c65a786ea Revamp database management
The global variable "Database" of class xca_db
can be used by any other class to access. No need
to provide it.

The "xca_db" class managed the "database_model" pointer.
Accessing the name of the current database has been unified.
2020-05-08 07:47:15 +02:00
Christian Hohnstaedt
b2ab7570b8 Minor fixxes and constifies 2020-04-30 18:47:28 +02:00
Christian Hohnstaedt
0f7465dcc5 Add convenience function to convert QModelIndex to pki_base * 2020-04-30 18:46:08 +02:00
Christian Hohnstaedt
03633d7a8a Provide db class name through constructor 2020-04-30 18:44:36 +02:00
Christian Hohnstaedt
a3344100e3 Drop FOR_ALL_pki() makro and use a foreach() loop
The foreach loop iterates over all items of a type.
The iterate method is now superflous
2020-04-30 18:40:49 +02:00
Christian Hohnstaedt
5a64725556 Move item store from db_base into separate class "pki_lookup"
Since also pki_base and other classes need to access them.
2020-04-30 18:37:25 +02:00
Christian Hohnstaedt
ea453d4336 Encapsulate all BIOs in the BioByteArray class
If we have a QByteArray (ba) and must provide it to
a BIO* expecting OpenSSL function, the following
construct provides it: BioByteArray(ba).ro()
directly providing the QByteArray buffer as BIO

It also supports mixed writes:
  BIO_write(bba, buf, size)
  bba += QByteArray
2020-04-06 22:07:57 +02:00
Christian Hohnstaedt
5543ec2fb8 Merge branch 'master' into develop 2020-04-02 07:35:18 +02:00
Christian Hohnstaedt
b41d322069 Refactor native separators / and \ on windows.
Always only use forward slash /
Drop all "QDir::separator()" and "nativeSeparator()"
functions. Only use it where filenames are displayed for the user.
2020-04-02 06:12:47 +02:00
Christian Hohnstaedt
7babd609be Drop unneeded pki_base::insert()
Insert / append does not matter,
because the rows are sorted by columns anyway.
2020-03-17 05:13:35 +01:00
Christian Hohnstaedt
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
3dd34a61bc Move "showPki()" from the model class to the view
The displaying function requires UI.
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
d0d387b03e Directly display the error instead of signaling others
The XCA_ERROR() is console-compatible and can be used
without GUI
2020-03-13 12:13:27 +01:00