mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 18:05:59 +03:00
Merge pull request #4447 from vector-im/feature/bca/fix_fallback_key_support
Fix fallback otk support
This commit is contained in:
commit
c8577eb951
2 changed files with 14 additions and 3 deletions
1
changelog.d/4446.bugfix
Normal file
1
changelog.d/4446.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Unable to establish Olm outbound session from fallback key
|
|
@ -38,14 +38,22 @@ 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>>,
|
||||
|
||||
/**
|
||||
* We have to store the original json because it can contain other fields
|
||||
* that we don't support yet but they would be needed to check signatures
|
||||
*/
|
||||
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 +90,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 +116,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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue