Merge tag 'v1.5.1' into sc

Note: we already had picked the internal v1.5.1 patch for the security
release, but we still do this merge to make git merge happy again for
future merges, and also clean up a little bit of UI things that I did
for that patch but abandonned later.

Change-Id: I51b674093e6f32e19fc9556109fb0d231d8f8f3e
This commit is contained in:
SpiritCroc 2022-10-07 19:32:26 +02:00
commit c634bb74e5
6 changed files with 37 additions and 38 deletions

View File

@ -1,11 +1,11 @@
Changes in Element v1.5.1 (2022-09-23) Changes in Element v1.5.1 (2022-09-28)
====================================== ======================================
Security ⚠️ Security ⚠️
---------- ----------
This update provides important security fixes, update now. This update provides important security fixes, update now.
Ref: CVE-2022-39246 CVE-2022-39248
Changes in Element v1.5.0 (2022-09-23) Changes in Element v1.5.0 (2022-09-23)
====================================== ======================================

View File

@ -2615,6 +2615,7 @@
<string name="unencrypted">Unencrypted</string> <string name="unencrypted">Unencrypted</string>
<string name="encrypted_unverified">Encrypted by an unverified device</string> <string name="encrypted_unverified">Encrypted by an unverified device</string>
<string name="key_authenticity_not_guaranteed">The authenticity of this encrypted message can\'t be guaranteed on this device.</string>
<string name="review_logins">Review where youre logged in</string> <string name="review_logins">Review where youre logged in</string>
<string name="verify_other_sessions">Verify all your sessions to ensure your account &amp; messages are safe</string> <string name="verify_other_sessions">Verify all your sessions to ensure your account &amp; messages are safe</string>
<!-- Argument will be replaced by the other session name (e.g, Desktop, mobile) --> <!-- Argument will be replaced by the other session name (e.g, Desktop, mobile) -->

View File

@ -656,7 +656,7 @@ internal class MXOlmDevice @Inject constructor(
} }
// else if the new one is safe and does not connect with existing, import the new one // else if the new one is safe and does not connect with existing, import the new one
} else { } else {
// If our existing session is better we keep it // If our existing session is better we keep it
if (existingFirstKnown <= newKnownFirstIndex) { if (existingFirstKnown <= newKnownFirstIndex) {
val shouldUpdateTrust = trusted && (existingSession.sessionData.trusted != true) val shouldUpdateTrust = trusted && (existingSession.sessionData.trusted != true)
Timber.tag(loggerTag.value).d("## addInboundGroupSession() : updateTrust for $sessionId") Timber.tag(loggerTag.value).d("## addInboundGroupSession() : updateTrust for $sessionId")
@ -664,10 +664,10 @@ internal class MXOlmDevice @Inject constructor(
// the existing as a better index but the new one is trusted so update trust // the existing as a better index but the new one is trusted so update trust
inboundGroupSessionStore.updateToSafe(existingSessionHolder, sessionId, senderKey) inboundGroupSessionStore.updateToSafe(existingSessionHolder, sessionId, senderKey)
} }
Timber.tag(loggerTag.value).d("## addInboundGroupSession() : ignore session our is better $senderKey/$sessionId") Timber.tag(loggerTag.value).d("## addInboundGroupSession() : ignore session our is better $senderKey/$sessionId")
candidateSession.releaseSession() candidateSession.releaseSession()
return AddSessionResult.NotImportedHigherIndex(newKnownFirstIndex.toInt()) return AddSessionResult.NotImportedHigherIndex(newKnownFirstIndex.toInt())
} }
} }
} catch (failure: Throwable) { } catch (failure: Throwable) {
Timber.tag(loggerTag.value).e("## addInboundGroupSession() Failed to add inbound: ${failure.localizedMessage}") Timber.tag(loggerTag.value).e("## addInboundGroupSession() Failed to add inbound: ${failure.localizedMessage}")

View File

@ -46,18 +46,18 @@ internal class CryptoSyncHandler @Inject constructor(
toDevice.events toDevice.events
?.filter { isSupportedToDevice(it) } ?.filter { isSupportedToDevice(it) }
?.forEachIndexed { index, event -> ?.forEachIndexed { index, event ->
progressReporter?.reportProgress(index * 100F / total) progressReporter?.reportProgress(index * 100F / total)
// Decrypt event if necessary // Decrypt event if necessary
Timber.tag(loggerTag.value).i("To device event from ${event.senderId} of type:${event.type}") Timber.tag(loggerTag.value).i("To device event from ${event.senderId} of type:${event.type}")
decryptToDeviceEvent(event, null) decryptToDeviceEvent(event, null)
if (event.getClearType() == EventType.MESSAGE && if (event.getClearType() == EventType.MESSAGE &&
event.getClearContent()?.toModel<MessageContent>()?.msgType == "m.bad.encrypted") { event.getClearContent()?.toModel<MessageContent>()?.msgType == "m.bad.encrypted") {
Timber.tag(loggerTag.value).e("handleToDeviceEvent() : Warning: Unable to decrypt to-device event : ${event.content}") Timber.tag(loggerTag.value).e("handleToDeviceEvent() : Warning: Unable to decrypt to-device event : ${event.content}")
} else { } else {
verificationService.onToDeviceEvent(event) verificationService.onToDeviceEvent(event)
cryptoService.onToDeviceEvent(event) cryptoService.onToDeviceEvent(event)
} }
} }
} }
private val unsupportedPlainToDeviceEventTypes = listOf( private val unsupportedPlainToDeviceEventTypes = listOf(

View File

@ -225,24 +225,24 @@ class MessageInformationDataFactory @Inject constructor(
if (event.root.mxDecryptionResult?.isSafe == false) { if (event.root.mxDecryptionResult?.isSafe == false) {
E2EDecoration.WARN_UNSAFE_KEY E2EDecoration.WARN_UNSAFE_KEY
} else { } else {
when { when {
sendingDevice == null -> { sendingDevice == null -> {
// For now do not decorate this with warning // For now do not decorate this with warning
// maybe it's a deleted session // maybe it's a deleted session
E2EDecoration.WARN_SENT_BY_DELETED_SESSION E2EDecoration.WARN_SENT_BY_DELETED_SESSION
} }
sendingDevice.trustLevel == null -> { sendingDevice.trustLevel == null -> {
E2EDecoration.WARN_SENT_BY_UNKNOWN E2EDecoration.WARN_SENT_BY_UNKNOWN
} }
sendingDevice.trustLevel?.isVerified().orFalse() -> { sendingDevice.trustLevel?.isVerified().orFalse() -> {
E2EDecoration.NONE E2EDecoration.NONE
} }
else -> { else -> {
E2EDecoration.WARN_SENT_BY_UNVERIFIED E2EDecoration.WARN_SENT_BY_UNVERIFIED
}
} }
} }
} }
}
} else { } else {
e2EDecorationForClearEventInE2ERoom(event, roomSummary) e2EDecorationForClearEventInE2ERoom(event, roomSummary)
} }
@ -254,12 +254,12 @@ class MessageInformationDataFactory @Inject constructor(
E2EDecoration.NONE E2EDecoration.NONE
} else { } else {
E2EDecoration.WARN_UNSAFE_KEY E2EDecoration.WARN_UNSAFE_KEY
}
} else {
E2EDecoration.NONE
} }
} else {
E2EDecoration.NONE
} }
} }
}
private fun e2EDecorationForClearEventInE2ERoom(event: TimelineEvent, roomSummary: RoomSummary) = private fun e2EDecorationForClearEventInE2ERoom(event: TimelineEvent, roomSummary: RoomSummary) =
if (event.root.isStateEvent()) { if (event.root.isStateEvent()) {

View File

@ -86,7 +86,7 @@ abstract class AbsBaseMessageItem<H : AbsBaseMessageItem.Holder>(@LayoutRes layo
super.bind(holder) super.bind(holder)
renderReactions(holder, baseAttributes.informationData.reactionsSummary) renderReactions(holder, baseAttributes.informationData.reactionsSummary)
if (!baseAttributes.informationData.messageLayout.showsE2eDecorationInFooter()) { if (!baseAttributes.informationData.messageLayout.showsE2eDecorationInFooter()) {
holder.getEffectiveE2eDecorationView().renderE2EDecoration(baseAttributes.informationData.e2eDecoration) holder.e2EDecorationView.renderE2EDecoration(baseAttributes.informationData.e2eDecoration)
} }
holder.view.onClick(baseAttributes.itemClickListener) holder.view.onClick(baseAttributes.itemClickListener)
holder.view.setOnLongClickListener(baseAttributes.itemLongClickListener) holder.view.setOnLongClickListener(baseAttributes.itemLongClickListener)
@ -190,8 +190,6 @@ abstract class AbsBaseMessageItem<H : AbsBaseMessageItem.Holder>(@LayoutRes layo
val reactionsContainer by bind<ViewGroup>(R.id.reactionsContainer) val reactionsContainer by bind<ViewGroup>(R.id.reactionsContainer)
val informationBottom by bind<ViewGroup>(R.id.informationBottom) val informationBottom by bind<ViewGroup>(R.id.informationBottom)
val e2EDecorationView by bind<ShieldImageView>(R.id.messageE2EDecoration) val e2EDecorationView by bind<ShieldImageView>(R.id.messageE2EDecoration)
open fun getEffectiveE2eDecorationView() = e2EDecorationView
} }
/** /**