security: E2EE and transport correctness (issue #147)
Some checks failed
CI Code / Check spelling (pull_request) Successful in 14s
CI Code / Check coding style (pull_request) Successful in 24s
CI Code / Linux (debian) (pull_request) Failing after 45s
CI Code / Linux (arch) (pull_request) Failing after 51s
CI Code / Linux (ubuntu) (pull_request) Failing after 3m57s
CI Code / Code Coverage (pull_request) Failing after 6m19s

T04: promote security events to warnings — SASL auth failure, TLS
handshake failure, cert-failure details, see-other-host redirect;
DISABLE_TLS, TRUST_TLS and LEGACY_AUTH get a log warning plus a
console notice (REQ-LOG-01, REQ-LOG-02, REQ-AUTH-03)

T05: warn when a session ends up unencrypted without the user having
asked for it; refuse in-band registration on an unencrypted stream;
warn on each HTTP transfer with certificate verification disabled
(REQ-CRY-03, REQ-CFG-01)

T06: pin the update check to https with peer/host verification and no
redirects; strict N.N.N parser for the fetched version, which is
untrusted network input (REQ-VUL-02)

T09: no plaintext logging on failed MUC OMEMO sends; OTR opportunistic
first message passes allow_unencrypted_message(); get_random_string()
draws from a CSPRNG without modulo bias; guard the identity-key length
decrement against unsigned underflow (REQ-CRY-01, REQ-CRY-02,
REQ-CRY-07, REQ-MEM-05)

REQ-VUL-03 and REQ-CRY-09 are already satisfied on master and are
left unchanged.

The console warnings use cons_show_warning() from #87, so this needs
that change in master first.
This commit is contained in:
2026-07-25 15:43:59 +03:00
parent 2be16df905
commit e05e0d58b3
19 changed files with 262 additions and 23 deletions

View File

@@ -342,6 +342,12 @@ AS_IF([test "x$enable_gdk_pixbuf" != xno],
[AC_MSG_ERROR([gdk-pixbuf-2.0 >= 2.4 is required to scale avatars before uploading])],
[AC_MSG_NOTICE([gdk-pixbuf-2.0 >= 2.4 not found, GDK Pixbuf support not enabled])])])])
dnl libgcrypt: CSPRNG for stanza ids and instance identifiers (also pulled in by OMEMO/OTR)
AC_CHECK_LIB([gcrypt], [gcry_create_nonce],
[AC_DEFINE([HAVE_LIBGCRYPT], [1], [Have libgcrypt])
LIBS="-lgcrypt $LIBS"],
[AC_MSG_NOTICE([libgcrypt not found, identifiers will use the OS random device])])
dnl feature: omemo
AM_CONDITIONAL([BUILD_OMEMO], [false])
if test "x$enable_omemo" != xno; then