Mercurial > libervia-backend
comparison sat/plugins/plugin_sec_otr.py @ 3231:e756e0eb1be4
core (memory/encryption): automatic start encryption if peer send encrypted message:
If peer sends encrypted message and we have no encryption activated, we automatically
start encryption to avoid sending plain text message when answering.
markAsEncrypted now needs the encryption algorithm namespace as mandatory argument.
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 23 Mar 2020 17:52:18 +0100 |
parents | 2f406b762788 |
children | be6d91572633 |
comparison
equal
deleted
inserted
replaced
3230:109d94c62b95 | 3231:e756e0eb1be4 |
---|---|
696 else: | 696 else: |
697 raise failure.Failure( | 697 raise failure.Failure( |
698 exceptions.CancelError("Cancelled by OTR") | 698 exceptions.CancelError("Cancelled by OTR") |
699 ) # no message at all (no history, no signal) | 699 ) # no message at all (no history, no signal) |
700 | 700 |
701 client.encryption.markAsEncrypted(data) | 701 client.encryption.markAsEncrypted(data, namespace=NS_OTR) |
702 trusted = otrctx.isTrusted() | 702 trusted = otrctx.isTrusted() |
703 | 703 |
704 if trusted: | 704 if trusted: |
705 client.encryption.markAsTrusted(data) | 705 client.encryption.markAsTrusted(data) |
706 else: | 706 else: |