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
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:
@@ -22,6 +22,7 @@
|
||||
#include "config/files.h"
|
||||
#include "otr/otr.h"
|
||||
#include "otr/otrlib.h"
|
||||
#include "event/client_events.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/window_list.h"
|
||||
#include "xmpp/chat_session.h"
|
||||
@@ -331,6 +332,10 @@ otr_on_message_send(ProfChatWin* chatwin, const char* const message, gboolean re
|
||||
|
||||
// tag and send for policy opportunistic
|
||||
if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
|
||||
// the tagged first message is still plaintext on the wire
|
||||
if (!allow_unencrypted_message(chatwin, message)) {
|
||||
return TRUE;
|
||||
}
|
||||
auto_char char* otr_tagged_msg = otr_tag_message(message);
|
||||
id = message_send_chat_otr(chatwin->barejid, otr_tagged_msg, request_receipt, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, message, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
|
||||
Reference in New Issue
Block a user