Commit Graph

109 Commits

Author SHA1 Message Date
Christian Hohnstaedt
802a8787cf Adaptions to stay OpenSSL 3.0 alpha16 compatible 2021-05-12 08:49:28 +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
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
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 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
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
d54aa116db Avoid unused variable warning for OpenSSL 0.9.8 2020-03-29 22:33:57 +02:00
Christian Hohnstaedt
9c55caf82f Merge branch 'master' into develop 2020-03-23 06:53:06 +01:00
Christian Hohnstaedt
92846d6b38 Close #174: Microsoft's PVK RSA private key format
Support Import and export private and public PVK keys.
2020-03-22 08:12:38 +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
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
a48ea10e3d Split key generation and data-collection-UI
Use the key job to transfer the information
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
77519936e0 Invent keytype class for mapping type mechanism and name 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
c5208f1cd7 Consolidate headers, unguard delete operator 2020-03-11 07:19:56 +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
a90d7b5b0d Improve password input handling
Unify password results
Retry on password verification error
Honor the users wish to exit
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
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
212b385022 Fix Typo 2019-12-14 13:24:15 +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
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
742e1536d7 Fix Private key verification 2019-03-14 06:35:25 +01:00
Christian Hohnstaedt
1bc340a0ef Close #104: Also show sha256 digests of public keys
Print digest of public keys in the key details in different formats:

Print SHA256 SSH digest as used to by SSH users:
	ssh-keygen -l -f ~/.ssh/id_rsa.pub

Print SHA1 X509 key digest as shown in the
	Subject key identifier of a certificate

Print SHA256 digest as in:
	openssl pkey -pubout -outform DER < key.pem | sha256sum
as requested by this issue.

Refactored digesting functionality by a generic Digest()
function working with QByteArrays.
The function formatHash() now also expects a QByteArray input.
2019-03-14 06:35:24 +01:00
Christian Hohnstaedt
56687bfc83 Verify imported keys thoroughly
When importing keys, a verification by signing and verifying
some random data is performed now.
2018-12-06 05:50:09 +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
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
bfe6fbbc43 Close #24: Add LibreSSL support. Tested with LibreSSL 2.7.2 2018-04-22 16:12:04 +02:00
Christian Hohnstaedt
cd118e4e72 Fixup for "Assure traditional file format if PKCS#8 NOT selected"
Also RSA and DSA keys were marked as EC PRIVATE KEY.
Add break to the switch statement
2018-04-09 05:18:19 +02:00
Christian Hohnstaedt
ec5507412e Fix private key import of PKCS12 and PEM keys 2018-04-06 06:01:05 +02:00
Christian Hohnstaedt
3073bcd105 Fixup previous commit to build on Qt4 2018-04-04 22:39:50 +02:00
Christian Hohnstaedt
4c75d43b87 Assure traditional file format if PKCS#8 NOT selected 2018-04-04 19:24:16 +02:00
Christian Hohnstaedt
5fdd84c82c Fix Importing PKCS#12 and PKCS#7 files 2018-03-30 21:34:00 +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
6cf72a38e0 Remove superflous function and mark decryptKey as pure virtual 2018-03-30 14:38:09 +02:00
Christian Hohnstaedt
0776ead694 Acceppt empty password for private key decryption
d2i_PKCS8PrivateKey_bio does not accept
passwords with 0 length for whatever reason.
2018-03-12 16:15:30 +01:00
Christian Hohnstaedt
0ed9f6926c GitHub Bug #5: Exporting a private key results in too-permissive permissions
Add umask(077) for key export
2018-03-10 14:43:36 +01:00
Christian Hohnstaedt
4867cfb8ab Improve "Dump database" filename 2018-03-07 05:49:46 +01:00
Christian Hohnstaedt
80471cd3f3 Small fixes: MySQL does not like "DEFAULT (0)" 2018-03-06 16:45:42 +01:00
Christian Hohnstaedt
d079dbde09 Collect affected items 2018-03-05 07:46:10 +01:00