Commit Graph

119 Commits

Author SHA1 Message Date
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 Hohnstaedt
c752508979 Separate XCA Warning in Cmdline and GUI 2021-09-09 21:46:30 +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
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
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
d8283d8ab5 Read oids: Avoid out of range access when reading OIDs
..and catch openssl_error()s when reading the OIDs
2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
7f431ccbd6 Fix typo introduced with 5f1d3945 to query the database password
Opening a database now again asks for the password
2021-06-01 17:29:30 +02:00
Christian Hohnstaedt
2635b91033 WIP 2021-05-25 21:10:54 +02:00
Christian Hohnstaedt
03769bef56 Add commandline option "select" to 'print', 'pem' or 'text'
can be used to export or display items.
2021-05-24 22:22:51 +02:00
Christian Hohnstädt
00e592d8f3 Sort output of "--issuers" and "--list-items" by primary key
This is also somehow a sort by inserting date.
For more detailled displays a sqlite browser should be used.
2021-05-11 12:07:40 +02:00
Christian Hohnstaedt
ccfad6a1c3 Replace qWarning()s by qDebug() 2021-05-11 12:07:40 +02:00
Christian Hohnstaedt
7e72d8c02c Commandline: Add "--list-items" to print a list of database items 2021-05-11 12:07:40 +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 Hohnstädt
8daf06dcac Close #259: Follow the XDG base directory specification
After dropping Qt4 support, the Qt5 QStandardPaths class
can be used to replace my implementation of directory discovery.

QStandardPaths follows the XDG specification.
2021-05-11 12:04:46 +02:00
Christian Hohnstädt
d5fa97c3bb Drop support for Qt4
Version 2.4.0 was the last one with Qt4 support
2021-05-09 12:25:32 +02:00
Christian Hohnstaedt
c2d88bf460 Database.close() is idempotent. Call it at the end unconditionally 2021-05-07 13:04:32 +02:00
Christian Hohnstaedt
5d4b52ac87 Fix opening a database on startup.
Commit e32fce8581
(main.cpp: mainwin must exist for read_cmdline() in GUI mode)
created the Mainwindow before parsing the commandline,
but the MainWindow constructor opened a default database if set.

With this change, the MinWindow constructor does not open a default
database. Now the default database is explicitly opened after parsing
the command line, if no other database is already open.

Rename init_database() to setup_open_database()
It is re-entrant.
2021-04-28 22:26:40 +02:00
Christian Hohnstaedt
e32fce8581 main.cpp: mainwin must exist for read_cmdline() in GUI mode
If XCA runs in GUI-mode, the mainwin must be accessible.
2021-04-23 15:57:32 +02:00
Christian Hohnstädt
ca0fdcd5c9 Bash completion 2021-04-23 15:57:32 +02:00
Christian Hohnstaedt
d53d64d23d Transform XCA documentation from SGML to sphinx
linuxdoc is pretty outdated, while sphinx is really cool:

 - Sphinx is modern with a broad user base
 - The generated documentation is themeable
 - The sphinx-source is much more readable than the
   SGML-tag scattered linuxdoc.
 - The different topics can be splitted into different files
 - It can be converted to qt-context sensitive help
 - It supports syntax highlighting for the SQL database documentation
 - It is supported on MacOSX,because it is python-based.

Drop code2html perl-script, which was used to colorize the SQL schema.
Generate "doc/arguments.rst" with XCA_MAN="rst" ./xca
2021-04-09 17:36:03 +02:00
Christian Hohnstaedt
e9edb75442 ImportMulti: Update pointer management to always free all items 2020-10-16 00:37:12 +02:00
Christian Hohnstädt
497e4a6120 Extend Password input by filedescriptor number and automatic man page
Also extend the documentation about the password.
Automatically generate the man page from the options.

Call xca as "XCA_MAN=1 ./xca" to print the current man-page options
2020-10-14 19:48:18 +02:00
Christian Hohnstädt
8963590053 Create user-settings directory after creating QApplication
At least on OSX this is required to have
QCoreApplication::applicationName() return "xca"
2020-10-14 19:48:18 +02:00
Christian Hohnstädt
78d6b5e67c Check XCA_ABORT_ON_WARNING envvar to abort() on any warning or worse
This allows easy debugging of warnings and errors
2020-10-14 19:48:17 +02:00
Christian Hohnstädt
24009b13c7 Fix warnings 2020-10-14 19:48:17 +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
93a7c6a9a3 Implement option --list-curves and display EC curves 2020-05-06 18:32:37 +02:00
Christian Hohnstaedt
9b201566e2 Improve on cmdline, console, unicode and windows CMD
Improve Windows registry functions

Use *A postfix function explicit becaus e we don't expect
unicode characters.
Also simplify "console_write()"
2020-05-06 18:32:27 +02:00
Christian Hohnstaedt
d1c0970ea1 BioByteArray: Add size() method 2020-05-06 18:08:36 +02:00
Christian Hohnstaedt
b5c9d645e3 More native separators when displaying file names 2020-05-06 17:57:09 +02:00
Christian Hohnstaedt
f889efc4cb Merge branch 'master' into develop 2020-04-30 18:34:16 +02:00
Christian Hohnstaedt
76e3f86783 Close #191: OID LN differs warning popups at startup
OpenSSL fixed the 2 LN with commit:
  648b53b88e

in OpenSSL 1.1.1e.

Follow my own advice and delete them from the oids.txt
together with all other OIDs present in OpenSSL
since at least version 0.9.8

Also do the initOIDs after creating the QApplication to
avoid qAbort() when creating the warning (introduced after 2.2.1)
2020-04-27 15:03:36 +02:00
Christian Hohnstaedt
7d5bb9ca4f Fix newline handling 2020-04-07 15:54:16 +02:00
Christian Hohnstaedt
5cb1b45d81 console_write: takes a QByteArray instead of printf()
Good Windows Unicode font:
https://math.berkeley.edu/~serganov/ilyaz.org/software/fonts/
2020-04-06 22:08:04 +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
4d95912d51 Add console_write() to print also on CMD 2020-04-05 22:45:11 +02:00
Christian Hohnstaedt
5543ec2fb8 Merge branch 'master' into develop 2020-04-02 07:35:18 +02:00
Christian Hohnstaedt
b41d322069 Refactor native separators / and \ on windows.
Always only use forward slash /
Drop all "QDir::separator()" and "nativeSeparator()"
functions. Only use it where filenames are displayed for the user.
2020-04-02 06:12:47 +02:00
Christian Hohnstaedt
524aff97b8 Load OID lists. Fixup for c89b6aff 2020-03-29 22:33:57 +02:00
Christian Hohnstaedt
149ecda63c Fix index-hierarchy functionality
create target directory and name feature "hierarchy"
2020-03-23 06:39:30 +01:00
Christian Hohnstaedt
9183f300c8 Add support for validating a keyjob
In case of an invalid keyjob bail out.
2020-03-18 05:26:16 +01:00
Christian Hohnstaedt
dcd2e1a223 Replace typeid by dynamic_cast where appropriate 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
2f917237bc Close #157 Generate and export CRLs from commandline
Enable key generation and CRL generation on the commandline
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
c098b235ce Minor fix. No Message when exiting 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
aa55a68782 Let pki_pkcs12 and pki_pkcs7 inherit from pki_multi
And ImportMulti handles pki_multi sufficiently
and does not need to know about pkcs12 or pkcs7

pkcs12 and pkcs7 don't need: print() getCa() addCaCert() numCa()
it is handled by pki_multi()

Take advantage of the power of dynamic_cast<>() instead of using
typeid()
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
1278ef9379 Add self-accounting of items for debugging 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
98593e7462 Compatibility fixes for QT4 and OpenSSL 0.9.8
Need to drop support for those ancient libs.
Not, yet.
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