Commit Graph

135 Commits

Author SHA1 Message Date
Christian Hohnstaedt
580a2fae2b Close #93 Default output folder / Improve Portable App usability
- allow setting a database as default
- Strip xca-app-folder from database and export filenames.
  This allows renaming/moving the portable app and open the default DB
  and use the working directory inside the folder
- Remember database history and configured language
2020-01-13 07:26:46 +01:00
Christian Hohnstaedt
2fbadfc9f0 Update Copyright Years to 2020 2020-01-13 07:26:46 +01:00
Christian Hohnstaedt
953d26c419 Close #21 Support for ODBC (MSSQL)
Add ODBC QSQL Database driver

Column "public" in public_keys table is a keyword in
MSSQL. Double quote it.
Double quotes are invalid on MySQL in non-ANSI mode.
Force ANSI mode for MySQL/MariaDB databases.

MSSQL also has a maximum VARCHAR of 8000

Schema updates are not performed for each new database.
New databases are immediately created conforming to schema:7
Schema 5 and 6 get updated to 7.
Schemas < 5 never have been released officially. (pre 2.0.0)

Switch "Database name" label to "DSN" for ODBC databases.
2020-01-13 07:24:08 +01:00
Christian Hohnstaedt
7f833a591f Close #144: Database export has issues with wildcards in internal names
Escape more characters when using internal name
as file name according to:
https://docs.microsoft.com/de-de/windows/win32/fileio/naming-a-file

Append a "_" after "CON, PRN, AUX, NUL, COM1-9, LPT1-9" as filename.
2019-12-05 14:56:39 +01:00
Christian Hohnstaedt
5e3d5e0edc Cancel creating a new database if database-password dialog is cancelled.
Clicking cancel in the password dialog during database creation
does not trigger an assertion during key generation/import
anymore.
2019-03-27 05:58:15 +01:00
Christian Hohnstaedt
f43e7520db Support concurrent database access.
If a database is modified by another instance of XCA the passive
instance reloads and displays the changed parts.
2019-03-25 06:47:25 +01:00
Christian Hohnstaedt
73452bfa17 Close #37: XCA 2: EVP_DecryptFinal_ex:bad decrypt
This error occures when updating a legacy database not
protected by a password (empty password) and setting
a new password during update process.

When importing an old database with an empty password,
don't ask for a new one for the new database.
2018-10-29 22:24:22 +01:00
Christian Hohnstaedt
00bd36f19b Support for XCA as portable App
On Windows XCA goes in portable mode if no XCA registry entry is found.
On Mac and Unix it checks the XCA_PORTABLE environment to be non-empty.
In portable mode:
 - The current working directory is not written to the database
 - The configured language and history of opened databases is
   forgotten after a restart of XCA
 - No registry entry is required nor written.
 - No unexpected files are written to disk, except exported items.
 - Portable mode is displayed in the "About" dialog

If setup.exe or "make install" are not used,
 - XCA is not assigned as app for any file types
2018-10-25 16:43:19 +02:00
Christian Hohnstaedt
1953f7f1b0 Improve defaultdb / defaultlang handling. No functional change 2018-10-25 16:43:19 +02:00
Christian Hohnstaedt
0ccd5594ea Use QFile for "dbhistory" and "defaultdb" 2018-09-13 17:51:52 +02:00
Christian Hohnstaedt
c9cdb5d61c Close #55: Calculate "CSR signed" information from legacy database
XCA-2.x stores the "request signed" information permanently
in the database.
XCA-1.x dynamically calculated this information by looking
for certificates with the same public key.

When converting an XCA-1.x database, requests with a matching cert
are marked signed in the XCA-2.x database.
2018-08-17 06:03:52 +02:00
Christian Hohnstaedt
f4646a65b1 Close #50: Hang while importing 1.4.1 database into 2.1.0
Import the legacy database _before_ showing the content.
2018-08-01 18:06:12 +02:00
Christian Hohnstaedt
4ca33d6bcf Extend maximum width of settings(value) to 10000
The column configuration (table-header) may become pretty huge.
2018-07-24 15:38:48 +02:00
Christian Hohnstaedt
c67a0471ce Usability: Preset remote database input values with previous ones 2018-03-23 06:00:45 +01:00
Christian Hohnstaedt
64c9c5ccab Add table prefix to be prepended to each table
This allows multiple independent xca databases in one database
2018-03-19 06:14:06 +01:00
Christian Hohnstaedt
ac02da8631 Fix opening, importing and dropping databases 2018-03-15 21:48:53 +01:00
Christian Hohnstaedt
6e432238e7 Generalize, simplify and unify settings management
Add settings class to access the settings table in the database
Cache values and improve database writes.
Options dialog simplified
Replace getSetting / storeSetting
Unpack option flags to rows in the settings
2018-03-10 09:04:54 +01:00
Christian Hohnstaedt
f1cf3aeab1 Improve database opening 2018-03-06 11:51:26 +01:00
Christian Hohnstaedt
c2007a13ee Minor fixes: Store token in DB, Load settings, 2018-03-06 09:02:06 +01:00
Christian Hohnstaedt
8aedb35716 Improve database update message 2018-03-05 07:46:11 +01:00
Christian Hohnstaedt
03124f6f70 Put the database schema into a different file for documentation 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
add9f50e29 Undelete not working 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
af0e0a75b9 Drop dnPolicy for now 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
7a553da38a Transaction around Settings update 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
d079dbde09 Collect affected items 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
0f582044e2 More transaction 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
0b82028644 Add "Legacy Database" as additional source 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
d36e6eb0cb Implement nested transactions.
The DbTransaction class automatically rolls back when the scope
is left (destructor) and no commit happenned.

Every transaction begin will increment the counter,
each commit/rollback will decrement it. Only if all transactions
finished with a commit, a final database commit will be performed.
2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
3f016c62e7 Fix minor problems during db open and key import 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
07594d1edd Rebase on master 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
fed2dd711a Minor fixes 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
e1b982a346 Replace printf by qDebug 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
431076c90e Change private key encryption in the database to PKCS#8 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
d50dbbd726 Create indexes 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
fbde63e98d Add Views and a concept of schema updates 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
fc7fc357ac Support opening remote databases MySQL and PostgreSQL 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
2a0a4630ae Extend authority table and fix CaProperties 2018-03-05 07:46:09 +01:00
Christian Hohnstaedt
fe6062f16e No more increasing serials. Only random serials. 2018-03-05 07:46:09 +01:00
Christian Hohnstaedt
4598ddb4de Convert QByteArray.base64() to QString before writing it to the DB 2018-03-05 07:46:09 +01:00
Christian Hohnstaedt
a75eb6ebd8 Avoid LastInsertID 2018-03-05 07:46:09 +01:00
Christian Hohnstaedt
4b3ee2c705 Switch database format to SQL(ite)
This is a large squash of many small commits.

Allow porting data from the legacy format to SQL.
Store Binaries base64 encoded and use db->transaction
Update password hash to be 8000 x SHA512 with 8 byte Salt
Add revocations table and fixup CRL generation
Add comment and insertion date columns

Fix column saving, remove trust, add XcaDialog
Allow changing the internal name and comment in Cert/Req details view
Extend Comment functionality, Replace About.ui by XcaDialog.ui
2018-03-05 07:42:36 +01:00
Christian Hohnstaedt
9e4340ff83 Open options dialog if weak hash is configured 2017-11-13 18:05:05 +01:00
Christian Hohnstaedt
cfc65af48a Add warning if the default hash algorithm is SHA1 or less 2017-11-13 17:40:15 +01:00
Patrick Monnerat
ad6c2baae5 Add support for OpenSSL 1.1.0
The API changed heavily. New functions arrived, old functions
disappeared and many structures became opaque.

This version of the patch implements pkcs11 signing as follows:
- openssl < 1.0.0: rsa & dsa without engine
- openssl 1.0.x: rsa, dsa & ec with engine
- openssl >= 1.1.0: rsa, dsa & ec without engine

In the operation, we therefore also gain implementation of dsa signing for openssl < 1.0.0 (ec disabled because EC_KEY_METHOD was not yet invented!).

I've given up trying to use a PKEY_ENGINE with openssl 1.1: seems not possible anymore.

I've succeeded compiling the patched xca with openssl 0.9.8n, 1.0.2j and 1.1.0e.
I've successfully tested pkcs11 signing using softhsm with openssl 1.0.2j and 1.1.0e.

The patch also removes gcc7 new warnings.
2017-06-19 08:32:39 +02:00
Christian Hohnstaedt
e5541c6d67 SF. Bug. #81 Make xca qt5 compatible
Extend XCA to also compile against Qt5
Remove directory from Qt includes
2015-09-17 18:42:42 +02:00
Christian Hohnstaedt
85d2a26aa9 Fix all fopen() calls to always use "wb" or "rb"
fix PKI item autodetection
Fix compiler warning because of a changed OpenSSL 0.9.8/1.0.1
  "PEM_load_bio()" API change
2015-05-20 13:14:21 +02:00
Christian Hohnstaedt
75a6d117f3 Refactor context menu
Better support multiple selections
 - Export all selected items into one PEM file
 - Batch Revoke/unrevoke/renew of many selected certificates
   of the same issuer
 - allow exporting templates as PEM

Add Feat. Reg. #83 Option to revoke old certificate when renewing

Always put all signed certificate to the newest CA.
If a CA certificate is renewed, all certificates issued by
the old CA are now shown as signed by the new one.
2015-05-17 09:17:04 +02:00
Christian Hohnstaedt
90f351b2cb Refactor CRL handling 2015-04-20 18:25:59 +02:00
Christian Hohnstaedt
58142b487c Fix syntax errors in documentation and english phrases
Thx Patrick Monnerat <Patrick.Monnerat@datasphere.ch>
2015-04-10 19:27:05 +02:00
Christian Hohnstaedt
2909e79317 Move entropy functions into new class
Read and write .rnd file during start and exit
2015-04-08 06:54:55 +02:00