Commit Graph

38 Commits

Author SHA1 Message Date
Christian Hohnstaedt
fee6235724 Close #306 #537 Allow Database-driver options in config file
XCA tries to read Database-driver specific options from
configurartion files in the getUserSettingsDir()
named after the driver and the host.
2024-10-03 10:44:54 +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
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
f9fddc3108 Database schema update: accept newer versions
This actually needs a more sophisticated solution with
schema major.minor version, incrementing the major version
for breaking changes, where old releases should not open newer
databases.

In the past, schema changes were always backward compatible,
i.e. older releases could open newer databases without breaking them.
2024-02-21 23:15:21 +01:00
Christian Hohnstaedt
44be50a42f Change B64_BLOB pattern to make th file parseable again
Otherwise sphinx-build spitts the warning:
  Parsing as "sql" resulted in an error at token: '{'.
  Retrying in relaxed mode.
2024-02-12 21:53:18 +01:00
Christian Hohnstaedt
6d01928d5d Automatically transform the key encryption scheme
When opening the database Find legacy encrypted keys and:
 - update them automatically when encrypted with the
   database password or
 - inform the user about a required action when encrypted with an
   individual passphrase

Related issues #458 #511 #503 #500 #494 #484 #482 #475

Remember a complete transformation of all keys
in the Settings["legacy-keys-updated"]
to avoid analyzing all keys each tim a database is opened.
2024-02-10 11:39:43 +01:00
Christian Hohnstaedt
b6ce91b81c Database schema: use string.replace for TEXT/LONGTEXT
Because generally using QString.arg() results in an error for
strings without %1
Also use the static database() function instead of creating
a temporary instance during close.
2024-01-20 08:54:11 +01: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
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
c3f58d402f Close #437: loading CRL at startup generates an error
Extend B64_BLOB from "VARCHAR(8000)" which was a good
common value - until I realized that CRL may become pretty large.

Use "TEXT" for all databases but MariaDB, where LONGTEXT is used.

Add database type check via SQL query to detect the
correct database even behind an ODBC Driver.
2023-09-21 21:42:54 +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
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 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
9c49c9949f Consolidate and document used environment variables
Rename XCA_SPECIAL to XCA_ARGUMENTS, which is less generic.

and change %1_OPTIONS to XCA_%1_OPTIONS to prefix all
XCA related environment variables with "XCA_".
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
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
5f1d394530 Close #67: possibility to ignore password prompt from CLI
XCA automatically checks whether the current arguments need
a password
2021-05-11 12:07:40 +02:00
Christian Hohnstaedt
57802580c8 Drop backward-compatibility for old(<2.0.0) XCA databases 2021-05-10 20:41:12 +02:00
Christian Hohnstaedt
d54819e15b database_model: better handle uncreateable databases
Current implementation did not check whether a non-existing
database-file could be created.

Throw an error message if the database file cannot be created.
Simply by using XFile instead of QFile.
2021-05-07 13:04:22 +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
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
e9edb75442 ImportMulti: Update pointer management to always free all items 2020-10-16 00:37:12 +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
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
f889efc4cb Merge branch 'master' into develop 2020-04-30 18:34:16 +02:00
Christian Hohnstaedt
a9a4c2b2d6 remote database: Dont show error if the password was empty
Otherwise, first an error message is shown and then
a password is asked.
2020-04-05 13:08:47 +02:00
Christian Hohnstaedt
c528c37986 Merge branch 'master' into develop 2020-04-05 10:58:47 +02:00
Christian Hohnstaedt
5543ec2fb8 Merge branch 'master' into develop 2020-04-02 07:35:18 +02:00
Christian Hohnstaedt
9845a00ca3 Store default database and recently opened file as UTF8 2020-03-17 05:07:46 +01:00
Christian Hohnstaedt
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
10857e3e0c Support item import from the commandline 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
19eafe1739 Improve and fix qDeleteAll()
qDeleteAll() does not clear the QList.
Add it, if necessary.

Use dynamic_cast where appropriate
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
b2a69f3586 Several fixes of previous commit
Passwd::cleanse() also resets the password size
db_base::flushLookup() now deletes all items
and pki_base does not anymore.

Drop TRACE
Colorize pki_base::print()

Set and inherit filename of loaded items
Add print() method to pki_pkcs12
and constify its methods
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
a90d7b5b0d Improve password input handling
Unify password results
Retry on password verification error
Honor the users wish to exit
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
176c2f8169 Improve password input and handling
Use the Passwd class instead of QString

Move password input into the database model
to be available for commandline use.

Repeat in case of wrong password
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
113a201d39 Separate database from Mainwin for better cmdline support
New classes:
 - database_model: Manage the database tables (keys, req, cert, crl, templ)
   extracted from widgets/MW_database.cpp
 - arguments: parse commandline, dynamically create help text
2020-03-11 07:19:56 +01:00