28 Commits

Author SHA1 Message Date
alakatos
e6fbc692aa Refactor the rscryutil tool
new crypto provider: lmcry_ossl
The new ossl crypto provider encapsulates the ability to use log
encryption in the omfile module. It provides the same functionality
as gcry, additionaly:
 * Algorithm are not hardcoded. We simply provide everything what
   can be fetched via the EVP_CIPHER_fetch() call. The same applies
   to the mode parameter.
 * It does not add extra dependency to a new package. Distro
   maintainers who are already using openssl do not need add
   anything in particular. By default, if rsyslog is compiled
   with --enable-openssl, the ossl crypto provider will also be
   included in both omfile and also rscryutil.
 * Side-channel vulnerability in libgcrypt - the Marvin Attack
https://lists.gnupg.org/pipermail/gcrypt-devel/2024-March/005607.html
   Some might be worried about other side-channel vulnerabilities
   against it, like the Minerva Attack[1], and the Raccoon Attack[2],
   given the way they handled one of the oldest, well known, and
   most straightforward side-channel attacks. They did downgrade
   their threat model as a result of Marvin too:
   https://gnupg.org/documentation/security.html.
2024-07-29 10:29:03 +02:00
Rainer Gerhards
deb98fecc1
bugfixes: small issues detected by clang static analyzer 10 2019-12-18 11:37:00 +01:00
PascalWithopf
c83e3ed216 correct codestyle in rsyslog part 2 2018-08-01 16:11:33 +02:00
PascalWithopf
19133327cc correct codestyle in rsyslog 2018-07-31 09:44:27 +02:00
Rainer Gerhards
7361603175 refactor core to unify random number generation
this is a step forward, but not everything yet done. Nevertheless
useful in itself.
2017-12-06 13:58:58 +01:00
Rainer Gerhards
56014d3fe4 "fix" Coverity scan false positives 2017-11-30 08:19:14 +01:00
Rainer Gerhards
af7b02b350 rscryutil bugfix: decryption error potentially undetected
Detectec by Coverity scan, CID 185340
2017-11-13 18:51:15 +01:00
Rainer Gerhards
744ae3c14c rscryutil: fix theoretical file handle leak
could only happen if file handle 0 was returned, what actuallyy
could not happen, as stdin is kept open by this command line tool.
Still fixing it to get rid of Coverity scan diagnostic.

Detected by Coverity scan, CID 185323
2017-10-30 14:31:48 +01:00
Rainer Gerhards
db3a1a904a rscryutil bugfix: do not leak file pointer if encinfo filetype is incorrect
Detected by Coverty scan, CID 185380
2017-10-28 11:25:08 +02:00
Rainer Gerhards
cbdc147394 file crypto provider: refactor interface
This permits an atomic check for error conditions and helps avoid
inconsistency between check and use of file name, which can also
pose security issues (not in the previous code, as the check was only
used for error-reporting).

Detected by Coverty scan, CID 185400
2017-10-28 11:25:08 +02:00
mrworkman
bb60c206f0 Fix broken 'debugless' build. 2017-09-12 08:01:39 -04:00
Jan Gerhards
edfc4396a3 core: add parameters debug.file and debug.whitelist
allows to generate debug log output only of specific files
2017-08-08 12:12:39 +02:00
Pascal Withopf
b63a6b9010 codestyle: line length adjusted 2017-01-17 08:54:37 +01:00
Rainer Gerhards
448f16495c remove "inline" attribute from excessivly long functions 2016-10-26 11:50:15 +02:00
Rainer Gerhards
51c03c66e0 make inline functions C99-compliant
As it seems, different C compilers have different rules/interpretations
on inline functions. The current code base did not properly obey all C99
rules. We fix this by converting some functions to macros and others to
include the necessary C99 plumbing. We also remove some inline attributes
for functions where this seems to be to agressive (aka "function to big").

This fixes build problems in some environments and is a general code
cleanup measure.
2016-09-05 16:47:14 +02:00
Rainer Gerhards
a2d20c07af fix compiler warnings 2016-06-03 14:03:32 +02:00
Rainer Gerhards
042d11b69a fix a false positive in clang static analyzer
we actually handle the impossible case, as it does not have any
bad side-effects (like performance requirements or so...)
2016-03-23 18:10:35 +01:00
Rainer Gerhards
1b7b8f4fbf rscryutil: fix clang static analyzer warning 2016-03-10 18:10:16 +01:00
Rainer Gerhards
f8b466623c fix some unitialized variable warnings
these were cosmetical and had no real effect
2016-01-29 18:54:11 +01:00
wizard1024
e3721df86b Update rscryutil.c
Change to right goto label due comment
2015-08-17 17:06:29 +03:00
wizard1024
995f35803d Update rscryutil.c
Added opportunity to decrypt not closed log file (without appropriate record END: xxx at <name>.encinfo file)
2015-08-17 10:33:29 +03:00
Rainer Gerhards
51f5693b50 fix compiler warnings on some platforms 2014-07-15 12:35:57 +02:00
Rainer Gerhards
64102e8cc3 logenc: add capability to use key generation program to rscryutil 2013-04-12 17:50:08 +02:00
Rainer Gerhards
97cbbdac13 logenc: full support for keyfiles
including their generation via rscrytool
2013-04-12 15:24:51 +02:00
Rainer Gerhards
7a62ef673f logenc: support keyfiles in rscryutil 2013-04-12 12:52:59 +02:00
Rainer Gerhards
815bae1f35 logenc: add parameters to select cipher algo and mode 2013-04-12 11:22:04 +02:00
Rainer Gerhards
2679dd4af1 logenc: rscryutil can now decrypt multi-block logfiles 2013-04-12 08:49:04 +02:00
Rainer Gerhards
5242a0b4a3 log encryption: add rscrytool to decrypt log files
also add test parameter to be able to set key
2013-04-05 18:52:52 +02:00