Commit Graph

1089 Commits

Author SHA1 Message Date
Christian Hohnstädt
8c0a5adc3a
Merge pull request #288 from PF4Public/pf/replace
Replace certificate while renewing
2021-06-04 08:50:58 +02:00
pf
8af3cabfa8 Replace certificate while renewing it
This commit also changes the default state of
the "Revoke old certificate" checkbox to unchecked.
The reasoning for this is that by renewing a certificate
its lifetime and subsequently validity are prolonged,
which therefore implies equal trustworthiness
for both new and old certificates, which does not intend
the revocation of the latter.
2021-06-01 20:25:13 +03: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 Hohnstaedt
802a8787cf Adaptions to stay OpenSSL 3.0 alpha16 compatible 2021-05-12 08:49:28 +02:00
Christian Hohnstädt
3bce3ae1d6 Fix travis build
Add qttools5-dev-tools qttools5-dev
Fix warnings found by travis
2021-05-12 00:03:52 +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 Hohnstaedt
7d564132ba Move ca-properties dialog to the certificate view
Reduce UI from QDialog to QWidget and display it in the XcaDialog frame.
Also move user interface specific code from the db_x509 class
into the CertTreeView class
2021-05-10 20:41:12 +02:00
Christian Hohnstaedt
523fa64486 asn1ToQString: use OpenSSL's ASN1_STRING_to_UTF8()
instead of my own implementation.

Please don't ask why I didn't look for such a function
before. I don't know.
2021-05-10 20:41:12 +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 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
2c38ddbd8d Set default key size to 2048 instead of 0
when changing the key type from EC/ED25519 to RSA/DSA
2021-05-07 22:30:51 +02:00
Christian Hohnstaedt
dea42e8d1f Minor documentation update 2021-05-07 22:08:34 +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
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
b907103975 Update documentation 2021-04-28 22:27:04 +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 Hohnstädt
8c04bc2b27 Rename PACKAGE_VERSION to XCA_VERSION
For an official release XCA_VERSION == PACKAGE_VERSION.
For any additional commit, XCA_VERSION's path-level is increased.

PACKAGE_VERSION cannot be modified after initially set.
Change any occurance of PACKAGE_VERSION by XCA_VERSION
2021-04-26 10:10:23 +02:00
Christian Hohnstädt
48e211b892 Improve error message during commandline import
If the file es not accessible, XCA now reports:
  Error opening file: 'file.pem': No such file or directory
Instead of:
  Failed to import from '../I'
2021-04-25 15:41:02 +02:00
Christian Hohnstädt
7a05d5623d Change versioning schema: drop iteration counter
The patchlevel will be increased by the iteration counter,
which is the number of commits since the most recent annotated tag.

Tagged version 1.2.3 in VERSION will be called "1.2.3"
3 commits later it will be 1.2.6
2021-04-24 23:16:36 +02:00
Christian Hohnstaedt
a81ee33652 pki_key.cpp: The key-type string in the database is only 4 bytes
... but "ED25519" is consists of more than 4 characters.
2021-04-23 15:57:32 +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 Hohnstaedt
87c4729d75 func.h: The mainwin is global
Like the application, the main window is a single instance
which is globally available for simplicity.
in case of non-gui mode, mainwin is NULL.
2021-04-23 15:57:32 +02:00
Christian Hohnstaedt
51f3418c68 db_base.cpp: Improve loading database content
If tan item has unsupported content like key type or algorithm,
it will be skipped with a warning now, but the database loads.
2021-04-23 15:57:32 +02:00
Christian Hohnstädt
ca0fdcd5c9 Bash completion 2021-04-23 15:57:32 +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
7ace0db0d5 Add ED25519 support for commandline key generation
Enable the key-job class to parse ED25519 key description
without size and EC-Group correctly.
Don't check the size parameter of ED25519 keys.
2021-04-09 17:36:03 +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
c05b58c6e6 Fix for building against libreoffice 2021-04-01 20:27:11 +02:00
Christian Hohnstaedt
0bdd964443 Use .priv as SSH private key extension 2021-04-01 17:25:27 +02:00
Christian Hohnstädt
45de747461 Add support for SSH2 ED25519 private key export
Encrypting the SSH2 private keys is not supported, yet.
2021-04-01 12:24:01 +02:00
Christian Hohnstädt
241abffaad Close #258: xca aborts on exit and on access to own templates
Double check the values used to call beginRemove/InsertRows()
2021-04-01 11:02:22 +02:00
Christian Hohnstädt
6d76fe1206 Close #142: Support Ed25519 Export private SSH2 key
Currently "PEM private" will export the key in SSH2
for PEM export into the clipboard
2021-04-01 11:02:22 +02:00
Christian Hohnstaedt
fdb2894e80 Close #142: Support Ed25519 Import private SSH2 key
Support loading OpenSSH ED25519 private key

Improve private key verification in general.
ED25519 does not support EVP_PKEY_sign(), so use
EVP_DigestSign(), which in turn only works since OpenSSL 1.1.1
resulting in a backward compatibility quirk in openssl_compat.
2021-04-01 11:02:22 +02:00
Christian Hohnstaedt
9cd58ff262 Close #142: Support Ed25519 Import public key
Import ED25519 key from SSH2 public key format
2021-04-01 11:02:22 +02:00
Christian Hohnstaedt
86cfff35d0 Close #142: Support Ed25519 Public export an Details
- Export SSH2 Public key
- Detect whether ED25519 key is private key
- Support ED25519 in the KeyDetails dialog
   o Display public key
   o Curve name
   o Fingerprints
   o Availability of private key
2021-04-01 11:02:22 +02:00
Christian Hohnstaedt
dbb3c48ef3 Close #142: Support Ed25519 Keygen
Support generating ED25519 keys
2021-04-01 11:02:22 +02:00
Christian Hohnstädt
1a0ef9c9ee Extend OpenSSL 1.0.2 compatibility layer
Add EVP_MD_CTX_new/free() and EVP_CIPHER_CTX_new/free()
as backward compatibility layer
2021-04-01 11:02:22 +02:00
Christian Hohnstaedt
46cbba45a3 pki_evp: Fix indentation 2021-04-01 11:02:22 +02:00
Christian Hohnstädt
496fb5e0bc Close #251: AuthorityKeyIdentifier: use issuer:always
When analysing and translating the AuthorityKeyIdentifier
extension to OpenSSL syntax, take an existing DirName
as "issuer:always", because openssle otherwise ignores it,
when the keyid succeeds.
2021-02-08 17:07:06 +01:00
Christian Hohnstädt
c90302ddd8 Close #230: Change PKCS12 export extension from .p12 to .pfx
[Change Request] Consider changing PKCS12 export
extension from .p12 to .pfx by default,
as p12 is a legacy Netscape holdover,
and PFX is the 'standard' per RFC now.
2021-02-06 22:52:54 +01:00
Christian Hohnstaedt
66cff37ad9 Close #208: XCA hung when importing EC keys. For example prime256v1
Fix Null-Pointer exception, which is strange, because:
 - it only happens on windows
 - the key still works fine
2021-02-06 22:52:54 +01:00
Christian Hohnstaedt
e9edb75442 ImportMulti: Update pointer management to always free all items 2020-10-16 00:37:12 +02:00