Fix fallback otk support

This commit is contained in:
Valere 2021-11-10 16:55:34 +01:00
parent 474e2aadbe
commit 5b76d4b682
2 changed files with 10 additions and 3 deletions

1
changelog.d/4446.bugfix Normal file
View File

@ -0,0 +1 @@
Unable to establish Olm outbound session from fallback key

View File

@ -38,14 +38,18 @@ data class MXKey(
/**
* signature user Id to [deviceid][signature]
*/
private val signatures: Map<String, Map<String, String>>
private val signatures: Map<String, Map<String, String>>,
private val rawMap: JsonDict
) {
/**
* @return the signed data map
*/
fun signalableJSONDictionary(): Map<String, Any> {
return mapOf("key" to value)
return rawMap.filter {
it.key != "signatures" && it.key != "unsigned"
}
}
/**
@ -82,6 +86,7 @@ data class MXKey(
* <pre>
* "signed_curve25519:AAAAFw": {
* "key": "IjwIcskng7YjYcn0tS8TUOT2OHHtBSfMpcfIczCgXj4",
* "fallback" : true|false
* "signatures": {
* "@userId:matrix.org": {
* "ed25519:GMJRREOASV": "EUjp6pXzK9u3SDFR\/qLbzpOi3bEREeI6qMnKzXu992HsfuDDZftfJfiUXv9b\/Hqq1og4qM\/vCQJGTHAWMmgkCg"
@ -107,7 +112,8 @@ data class MXKey(
type = components[0],
keyId = components[1],
value = params["key"] as String,
signatures = params["signatures"] as Map<String, Map<String, String>>
signatures = params["signatures"] as Map<String, Map<String, String>>,
rawMap = params
)
}
}