Commit Graph

287 Commits

Author SHA1 Message Date
Christian Hohnstaedt
89b7c6beea codespell: Fix spelling issues, no functional changes 2025-03-28 18:11:18 +01:00
Christian Hohnstaedt
09a2924912 OpenVPN is not PEM 2024-09-14 01:13:18 +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
9a0454b7c5 Relates #391: export expired and revoked certificates 2024-08-29 09:20:44 +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
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
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
2785376689 Fix deletion of dialog pointers
Don't shadow the CertExtend dlg variable to be freed properly
at the end of the function.
Delete revoke dialog after use.
2024-02-23 15:35:22 +01:00
Christian Hohnstaedt
0a1a21608d Close #518: Export certificates for ovpn file
Create ovpn file with "ca", "cert" and "key"
Additionally put all intermediate CAs (if any)
tagged as "extra-certs".

"tls-auth" "OpenVPN Static key V1" not supported (yet)

Extend export-test by OpenVPN test case
2024-02-11 00:29:01 +01:00
Christian Hohnstaedt
286ae96764 Fixup warning introduced with 5dc8e7fd
Fix error: lib/db_x509.cpp:774:4: warning:
           add explicit braces to avoid dangling else [-Wdangling-else]
2024-02-08 17:06:59 +01:00
Patrick Monnerat
5dc8e7fd34 Fix a use-after-free crash
When requesting revocation AND deletion of certificates while renewing
them, revocation occurs after deletion, causing a use-after-free
error/crash.

This commit delays the certificates deletion after they have been
revoked.
2024-01-22 08:55:17 +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
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
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
270152e708 Add db transaction around the removal of a CA certificate
.. to avoid an error message, enforcing each database write access
into a transaction
2023-09-30 11:24:18 +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
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
Tobias Wich
097cbfb815 Add PKCS12 enc algo setting and use it when exporting PKCS12 2022-10-06 15:32:30 +02:00
Christian Hohnstaedt
ee842feb5e Improve windows compatibility 2022-08-31 00:01:06 +02:00
Christian Hohnstädt
435602d524 Convert to native separators in calendar items 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
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 Hohnstädt
3e858c877f Merge remote-tracking branch 'github/master' into main 2021-10-24 14:56:38 +02:00
Christian Hohnstaedt
c752508979 Separate XCA Warning in Cmdline and GUI 2021-09-09 21:46:30 +02:00
pf
8af3cabfa8 Replace certificate while renewing it
This commit also changes the default state of
the "Revoke old certificate" checkbox to unchecked.
The reasoning for this is that by renewing a certificate
its lifetime and subsequently validity are prolonged,
which therefore implies equal trustworthiness
for both new and old certificates, which does not intend
the revocation of the latter.
2021-06-01 20:25:13 +03: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
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
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
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
3bce3ae1d6 Fix travis build
Add qttools5-dev-tools qttools5-dev
Fix warnings found by travis
2021-05-12 00:03:52 +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 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 Hohnstaedt
b907103975 Update documentation 2021-04-28 22:27:04 +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 Hohnstädt
c90302ddd8 Close #230: Change PKCS12 export extension from .p12 to .pfx
[Change Request] Consider changing PKCS12 export
extension from .p12 to .pfx by default,
as p12 is a legacy Netscape holdover,
and PFX is the 'standard' per RFC now.
2021-02-06 22:52:54 +01:00
Christian Hohnstädt
0745af1d63 Fix editing revocation entries and generate CRL from that dialog 2020-10-14 19:48:18 +02:00
Christian Hohnstädt
ed29b5f3a5 Fix typo to start CRL Management 2020-10-14 19:48:18 +02:00
Christian Hohnstaedt
17b621ccef Encapsulate all index.internalPointer() in fromIndex(index) 2020-05-10 09:09:31 +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
af79214121 Use fromIndex(index) convenience function
for certificates create a function returning
a dynamically casted pki_x509 pointer

Add NULL check of dynamically casted pointer,
because it could be a folder...
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
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