Commit Graph

127 Commits

Author SHA1 Message Date
Christian Hohnstaedt
c6304a073d Close #296: Proper plurals
Some checks are pending
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 5.15.2, ubuntu-latest) (push) Waiting to run
CMake / build (build/xca-*-Linux.tar.gz, Unix Makefiles, linux, /usr, ubuntu, 6.6.2, ubuntu-latest) (push) Waiting to run
CMake / build (build/xca-*.dmg, Unix Makefiles, mac, /opt/homebrew/opt/openssl, macos, 6.6.2, macos-latest) (push) Waiting to run
CMake / build (build/xca-*.msi build/xca-portable-*.zip , MinGW Makefiles, windows, D:\msys2\msys64\mingw64, windows, 5.15.2, windows-2019, win64_mingw81) (push) Waiting to run
Use the provided plural mechanisms of QT.
The "PO" translation also works smoothly and
the translation mechanisms between .po <-> .qt
was tested successfully.

The new english translation file translates
the single phrase:
 "Delete the %n revocation list(s): '%1'?"
into
 "Delete the revocation list: '%1'?" for one item
and
 "Delete the %n revocation lists: '%1'?" otherwise
2024-09-14 10:22:45 +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
52f1cf3388 Catch PEM_read_bio_* read errors
If the base64 decoding fails these function return a null pointer
without setting an openssl error.

Additionally throw an error if the PEM_read_bio functions return NULL.
2023-09-20 15:24:28 +02:00
Christian Hohnstaedt
ee842feb5e Improve windows compatibility 2022-08-31 00:01:06 +02:00
Christian Hohnstaedt
4d401792a9 OpenSSL: Avoid all FILE pointer operations, use QFile
For interoprability reason.
To enforce it, set "#define OPENSSL_NO_STDIO 1"
All file access is done by reading/writing from/to BioByteArray()
which is filled by QFile:readAll()

Drop CRYPTO_malloc_debug / CRYPTO_mem_leaks
which is unused and disabled since many years.
2021-11-13 23:53:11 +01:00
Christian Hohnstädt
435602d524 Convert to native separators in calendar items 2021-11-13 14:49:02 +01: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
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
57802580c8 Drop backward-compatibility for old(<2.0.0) XCA databases 2021-05-10 20:41:12 +02:00
Christian Hohnstädt
1500e636c8 Drop OpenSSL backward compatibility hacks < 1.1.0
OpenSSL < 1.1.1 is out of support anyway
2021-05-09 12:25:32 +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
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
096e57ec8c Close #70: cant open ics file in ical on macos mojave
Fixed syntax errors in the ICS file.
Verified by http://ical-validator.herokuapp.com/validate/
Thanks for the service.
2020-04-01 12:29:55 +02:00
Christian Hohnstaedt
55d1693015 Improve printing of cmdline items
Unify --print by collecting all properties
Add --pem to print the item in PEM format
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
1544065133 Extend --print and --text functionality 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
e4d0ab8f8e Refactor Image and icon ressources 2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
2fbadfc9f0 Update Copyright Years to 2020 2020-01-13 07:26:46 +01:00
Christian Hohnstaedt
1ea45c8da4 Constify fload() fromPEM_BIO() fromPEMbyteArray()
Use "BIO_from_QByteArray()" instead of "BIO_new_mem_buf()"

Replace qSort() by std::sort()
Replace QString::null by QString()
2020-01-06 21:30:29 +01:00
Christian Hohnstaedt
8726c8b96d Improve item loading. Inspired by #153
If Loading the item results in an openssl error,
even if the item is not empty, discard it.
Otherwise loading it from the database later on will fail.

Improve "autoIntName()"
2020-01-06 19:35:11 +01:00
Christian Hohnstaedt
68ffb63db6 Use the SQL primary key to reference the CRL issuer
... and avoid the pointer
2019-03-25 07:23:53 +01:00
Christian Hohnstaedt
fa704001ca Also change File loading from FILE* to QFile 2019-03-18 06:25:20 +01:00
Christian Hohnstaedt
026d8f8e6d Extend PEM files by human readable information about the item
This can be enabled or disabled during export.
Move from FILE* to QFile
2019-03-18 06:25:20 +01:00
Christian Hohnstaedt
bdfa10d4d5 Close #45: Unable to view Public Key
Allow displaying the public key of a certificate
or request without importing it.

When importing certificates or CRLs,
display the issuer if it exists in the database.
2018-07-01 14:58:23 +02:00
Christian Hohnstaedt
96d8c5cf37 Generalize handling of DateTime columns 2018-06-26 23:32:40 +02:00
Christian Hohnstaedt
b10b4f7a53 Inspired by #42: display insertion date relative
Easy to find the most recent entry, because it says
"3 seconds ago"
2018-06-25 21:20:25 +02:00
Christian Hohnstaedt
dc36728df8 Generate calender (.ics) files for certificate and CRL expiries
Also support consolidated calendar entries for a CA,
containing the CA, all issued certificates and the CRL expiry dates.
2018-05-10 12:49:59 +02:00
Christian Hohnstaedt
b362ae3593 Const-ify dbheader in column_data() and getIcon() 2018-04-25 09:34:45 +02:00
Christian Hohnstaedt
b74642fa09 Const-ify QSqlRecord of restoreSql() 2018-04-24 09:34:34 +02:00
Christian Hohnstaedt
6f85548c07 Drop getClassName() 2018-03-30 14:38:09 +02:00
Christian Hohnstaedt
2c20bd109a Constify and Pure-Virtual pki_base and derived classes 2018-03-30 14:38:09 +02:00
Christian Hohnstaedt
24d1f85a26 Make use of C++ templates for more type-safety 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
dc75fa0171 Add token as item source, minor fixes
Use dynamic cast for sqlSELECTpki()
Fix Double-click links in cert details
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
2a0a4630ae Extend authority table and fix CaProperties 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
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
4b9b8e9973 Add more openssl error checks during database load to tackle Bug #122 2018-02-13 11:47:22 +01:00
Christian Hohnstaedt
704d98b071 Remove duplicate X509_CRL_set_issuer_name()
Found by "Patrick Monnerat <patrick@monnerat.net>"
Thank you
2017-11-29 08:01:19 +01:00
Christian Hohnstaedt
a279a8e43e OSSL 1.1 vs. 1.0: Cleanup CRL 2017-06-19 08:33:29 +02:00
Christian Hohnstaedt
413ba8bff3 OSSL 1.1 vs. 1.0: Cleanup CRL extensions 2017-06-19 08:33:29 +02: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
d55eb917e2 Silence compiler warnings about unused parameters 2015-08-11 07:17:56 +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
f8f730d41a Support exporting SSH2 public key to the clipboard 2015-04-07 20:22:24 +02:00