mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
commit
ed6d28bd3b
@ -142,12 +142,11 @@ private fun deriveKey(password: String,
|
||||
* Generate a 32 chars salt
|
||||
*/
|
||||
private fun generateSalt(): String {
|
||||
var salt = ""
|
||||
|
||||
val salt = buildString {
|
||||
do {
|
||||
salt += UUID.randomUUID().toString()
|
||||
} while (salt.length < SALT_LENGTH)
|
||||
|
||||
append(UUID.randomUUID().toString())
|
||||
} while (length < SALT_LENGTH)
|
||||
}
|
||||
|
||||
return salt.substring(0, SALT_LENGTH)
|
||||
}
|
@ -63,10 +63,8 @@ data class MXKey(
|
||||
fun signatureForUserId(userId: String, signkey: String): String? {
|
||||
// sanity checks
|
||||
if (userId.isNotBlank() && signkey.isNotBlank()) {
|
||||
if (signatures.containsKey(userId)) {
|
||||
return signatures[userId]?.get(signkey)
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user