Commit Graph

45 Commits

Author SHA1 Message Date
Christian Hohnstaedt
db55a09a59 Abandon 3DES triggered by #218 Encryption for exported keys
Switch Key export in "Cert+PKCS#8" and "Database dump"
mode from DES3-EDE to AES-256
2024-08-21 10:20:41 +02:00
Christian Hohnstaedt
0c1c00962f Fix whitespace errors 2023-12-30 11:01:11 +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 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 Hohnstaedt
6efba2bb3e pkcs7: Fix endless loop when loading PKCS#7 via PEM import 2021-10-30 11:51:35 +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
500f11c9b3 Get rid of filename2bytearray and QString2filename
We now use QFile or its derivate XFile, who smoothly
handle unicode filenames also on windows.

The lt_dlopen() only handles "char *" not wchar_t.
Try to convert the filename with all known codecs
until we can open it.

filename2QString() remains to differently encode
filenames provided on the commandline on Windows.
2020-04-05 09:16:12 +02: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
1544065133 Extend --print and --text functionality 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
b2a69f3586 Several fixes of previous commit
Passwd::cleanse() also resets the password size
db_base::flushLookup() now deletes all items
and pki_base does not anymore.

Drop TRACE
Colorize pki_base::print()

Set and inherit filename of loaded items
Add print() method to pki_pkcs12
and constify its methods
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
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
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
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
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
f1c528fcc9 update copyright information 2010-03-11 07:13:48 +01:00
Christian Hohnstaedt
4b2f6726cc improve error-messages during file load.
- while at it, revamp SPKAC loading
2010-01-28 07:30:52 +01:00
Christian Hohnstaedt
fe8c2c2660 improve filename handling for databases
- allow "umlauts" and other non ASCII char in database filenames
   using the OS dependent handling QString2filename, using
   8Bit codepage encoding on Windows and UTF8 on linux and OS X
2009-11-25 09:06:22 +01:00
Christian Hohnstaedt
bd90901c10 change filename handling to support UTF8 names 2009-11-24 19:16:25 +01:00
Christian Hohnstaedt
9f900ae6f7 update copyright date to 2009 where appropriate 2009-11-24 17:54:21 +01:00
Christian
66876dd880 more PEM import 2007-08-23 20:31:46 +00:00
Christian
8283d8e7b9 replace copyright notice in source files
(copyright and licence itself remain unchanged)
fix configure to set Qt include dir
code justifying
2007-04-12 12:25:28 +02:00
Christian
a4b531af8c PKCS#12 export fixed 2006-06-11 23:03:10 +02:00
Christian
813e115b8e Spaces deleted 2006-05-21 10:08:39 +02:00
chris2511
a291aca857 more for QT4 2006-03-20 22:16:08 +00:00
chris2511
0091853a73 changes in building,
DSA keys
key format in database changed to contain the public key and
the private one in encrypted form.
2005-02-07 21:56:21 +00:00
chris2511
6cf2d0320e loading from file moved from constructor to
method fload()
2003-12-09 17:25:22 +00:00
chris2511
44c1a811f9 more PKCS#7 2003-12-04 22:28:40 +00:00
chris2511
1d1f4065ea New configure added, Makefile.in's purged and one configuration:
Local.mak for flags and compilers.
2003-10-13 09:01:21 +00:00
chris2511
592ae276a4 critical flag in key usage and extended key usage works now
Import of Multiple items is done and works
2003-07-30 14:55:29 +00:00
chris2511
fe46ff670f all strings replaced by QString 2003-06-18 16:04:26 +00:00
chris2511
a9b84c77d0 *** empty log message *** 2003-06-16 20:26:07 +00:00
chris2511
81d9b962a4 grosse Baustelle 2003-06-12 20:23:45 +00:00
chris2511
f9c648540f debian changelog updated 2003-02-07 15:57:29 +00:00
chris
9f650fff0c bugs removed 2003-01-06 19:35:46 +00:00
chris
c58c851b79 import certs from PKCS7, changes to compile against OpenSSL 0.9.7 2002-12-17 19:56:07 +00:00
chris
8ee7853932 certstack became class var 2002-12-16 23:00:05 +00:00
chris
cafc1cbec3 std:: added 2002-12-16 21:32:16 +00:00
chris
e2ece96256 PKCS7 signing works
sed s/string/std::string/g
2002-12-16 20:28:17 +00:00
chris
61bd85d12d pkcs7 class 2002-12-15 21:13:30 +00:00