mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
debug for new encryption
This commit is contained in:
parent
a81c17057f
commit
4f7d26d86e
@ -223,14 +223,12 @@ object SnodeAPI {
|
|||||||
deferred.reject(Error.HashingFailed)
|
deferred.reject(Error.HashingFailed)
|
||||||
return@success
|
return@success
|
||||||
}
|
}
|
||||||
val sessionID: String
|
val sessionIDAsData = ByteArray(sessionIDByteCount)
|
||||||
try {
|
if (!sodium.cryptoAeadXChaCha20Poly1305IetfDecrypt(sessionIDAsData, null, null, ciphertext, ciphertext.size.toLong(), null, 0, nonce, key)) {
|
||||||
sessionID = sodium.decrypt(hexEncodedCiphertext, null, nonce, Key.fromBytes(key), AEAD.Method.CHACHA20_POLY1305_IETF)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
deferred.reject(Error.DecryptionFailed)
|
deferred.reject(Error.DecryptionFailed)
|
||||||
return@success
|
return@success
|
||||||
}
|
}
|
||||||
sessionIDs.add(sessionID)
|
sessionIDs.add(Hex.toStringCondensed(sessionIDAsData))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
deferred.reject(Error.Generic)
|
deferred.reject(Error.Generic)
|
||||||
|
Loading…
Reference in New Issue
Block a user