mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 11:05:25 +00:00
fix: add optional namespace in signature and params
This commit is contained in:
parent
39bd0bba22
commit
edb5ff09e9
@ -373,7 +373,8 @@ object SnodeAPI {
|
||||
val ed25519PublicKey = userEd25519KeyPair.publicKey.asHexString
|
||||
val timestamp = System.currentTimeMillis() + clockOffset
|
||||
val signature = ByteArray(Sign.BYTES)
|
||||
val verificationData = "retrieve$namespace$timestamp".toByteArray()
|
||||
val verificationData = if (namespace == 0) "retrieve$timestamp".toByteArray()
|
||||
else "retrieve$namespace$timestamp".toByteArray()
|
||||
try {
|
||||
sodium.cryptoSignDetached(
|
||||
signature,
|
||||
@ -385,8 +386,11 @@ object SnodeAPI {
|
||||
return null
|
||||
}
|
||||
params["timestamp"] = timestamp
|
||||
// params["pubkey_ed25519"] = ed25519PublicKey
|
||||
params["pubkey_ed25519"] = ed25519PublicKey
|
||||
params["signature"] = Base64.encodeBytes(signature)
|
||||
if (namespace != 0) {
|
||||
params["namespace"] = namespace
|
||||
}
|
||||
return SnodeBatchRequestInfo(
|
||||
Snode.Method.Retrieve.rawValue,
|
||||
params
|
||||
|
Loading…
Reference in New Issue
Block a user