Merge pull request #4447 from vector-im/feature/bca/fix_fallback_key_support
Fix fallback otk support
This commit is contained in:
commit
c8577eb951
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]
|
* 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
|
* @return the signed data map
|
||||||
*/
|
*/
|
||||||
fun signalableJSONDictionary(): Map<String, Any> {
|
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>
|
* <pre>
|
||||||
* "signed_curve25519:AAAAFw": {
|
* "signed_curve25519:AAAAFw": {
|
||||||
* "key": "IjwIcskng7YjYcn0tS8TUOT2OHHtBSfMpcfIczCgXj4",
|
* "key": "IjwIcskng7YjYcn0tS8TUOT2OHHtBSfMpcfIczCgXj4",
|
||||||
|
* "fallback" : true|false
|
||||||
* "signatures": {
|
* "signatures": {
|
||||||
* "@userId:matrix.org": {
|
* "@userId:matrix.org": {
|
||||||
* "ed25519:GMJRREOASV": "EUjp6pXzK9u3SDFR\/qLbzpOi3bEREeI6qMnKzXu992HsfuDDZftfJfiUXv9b\/Hqq1og4qM\/vCQJGTHAWMmgkCg"
|
* "ed25519:GMJRREOASV": "EUjp6pXzK9u3SDFR\/qLbzpOi3bEREeI6qMnKzXu992HsfuDDZftfJfiUXv9b\/Hqq1og4qM\/vCQJGTHAWMmgkCg"
|
||||||
@ -107,7 +116,8 @@ data class MXKey(
|
|||||||
type = components[0],
|
type = components[0],
|
||||||
keyId = components[1],
|
keyId = components[1],
|
||||||
value = params["key"] as String,
|
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 New Issue
Block a user