Commit Graph

158 Commits

Author SHA1 Message Date
Christian Hohnstaedt
5f4308245c Close #239: Check existing Name Constraints
This check is performed before the certificate is
issued and signed. Like all the other checks
regarding validity, extensions and other things.

Issuing certificates that violate the Name Constraints
of any CA in the chain is still be possible.

But there will be a warning now with the name of the affected
CA-Certificate and the violated constraint.

The Issuer can then decide whether to issue the
certificate or not.
2024-09-29 18:39:00 +02:00
Christian Hohnstaedt
7d3ff4f0f9 Add OpenSSL PURPOSE and validation results
A new tab on the certificate details dialog
shows the result of the OpenSSL validation process
and the calculated OpenSSL Purpose.

The translation of the OpenSSL X509_V_ERR.... messsages
back to strings is done by grepping them from "openssl/x509_vfy.h"
and wrapping them into a macro-call.
Additionally guard them by an #ifdef (Zombieland rule #2: Double-Tap)
This way:
 - I don't need to test and check in which versions of OpenSSL
   which errors are available or not
 - New errors will be picked up automatically, as long as they
   match the "X509_V_ERR_" pattern
2024-09-29 14:12:17 +02:00
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
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
b03076c474 Close #391: hide expired and revoked certificates 2024-08-29 09:10:58 +02:00
Christian Hohnstaedt
e3c2c40f1e Support importing existing OpenVPN TLS Auth keys
The TA-Key is the property of a CA.
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
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 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 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
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
c528c37986 Merge branch 'master' into develop 2020-04-05 10:58:47 +02:00
Christian Hohnstaedt
4314b0ead9 constify slotid 2020-04-05 09:16:12 +02:00
Christian Hohnstaedt
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01: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
7d0ab9d787 Add pki_XXX(const pki_XXX*) constructor
pki_XXX(const QString) -> (const QString &)
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
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
e9df5b7cda Use the SQL primary key to reference the certificate issuer
... and avoid the pointer
2019-03-25 07:22:35 +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
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
84fcc9610e Close #25: Certificates are no longer coloured
Fix function signature of "bg_color" to really overwrite
virtual pki_base::bg_color
2018-04-25 08:59:25 +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
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
c62339e1ce Adapt Certificate Index creation to the new database capabilities 2018-03-07 23:00:58 +01:00
Christian Hohnstaedt
af0e0a75b9 Drop dnPolicy for now 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
24d1f85a26 Make use of C++ templates for more type-safety 2018-03-05 07:46:10 +01:00
Christian Hohnstaedt
a545659e1a Add Source column, fix Revocation management 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
fe6062f16e No more increasing serials. Only random serials. 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
0ba41583fb SF Bug #109 Revoked.png isn't a valid image
It was unused and did not harm. No functional/optical impact.

Delete image and all ist references
2018-01-06 21:17:15 +01:00
Christian Hohnstaedt
f0c7badf0b OSSL 1.1 vs. 1.0: Store sigAlg as NID instead of Object 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
Adam Dawidowski
e94e9133b1 Support generating an OpenSSL "index.txt"
XCA currently lacks support for generating an index.txt.
Such a file gets created and maintained when using CA
features in openssl. As mentioned here:
https://sourceforge.net/p/xca/discussion/209946/thread/6cbc727c/#2310
such a file can be used by Openssl's built-in OCSP responder.
Additionally, it can be used for configuring a cron job for
reminding of certificate expiration.

Certificate index export is added in 3 places:
 - command line (-i index.txt),
 - the Extras menu (Extra->Export Certificate Index) and
 - the selected file(s) export option in the context menu
   on the Certificates tab (Export->File, Export Format:
    Certificate Index file).

Please note that SubjectDN generated by this feature has
different formatting than the one generated by openssl.
2016-04-09 06:40:39 +02:00
Christian Hohnstaedt
c00db626c5 Support editing the CRL number when generating CRLs 2015-05-17 13:22:47 +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
698c10216f Add option for disabling the very very legacy Netscape extensions
Maybe this setting will become the default in future releases....
2015-04-09 18:49:03 +02:00