Reduce logging
This commit is contained in:
parent
1ed082d3cb
commit
560fda51d1
@ -94,7 +94,7 @@ class ECDHRendezvousChannel(override var transport: RendezvousTransport, theirPu
|
|||||||
val isInitiator = theirPublicKey == null
|
val isInitiator = theirPublicKey == null
|
||||||
|
|
||||||
if (isInitiator) {
|
if (isInitiator) {
|
||||||
Timber.tag(TAG).i("Waiting for other device to send their public key")
|
// Timber.tag(TAG).i("Waiting for other device to send their public key")
|
||||||
val res = this.receiveAsPayload() ?: throw RuntimeException("No reply from other device")
|
val res = this.receiveAsPayload() ?: throw RuntimeException("No reply from other device")
|
||||||
|
|
||||||
if (res.key == null) {
|
if (res.key == null) {
|
||||||
@ -106,7 +106,7 @@ class ECDHRendezvousChannel(override var transport: RendezvousTransport, theirPu
|
|||||||
theirPublicKey = Base64.decode(res.key, Base64.NO_WRAP)
|
theirPublicKey = Base64.decode(res.key, Base64.NO_WRAP)
|
||||||
} else {
|
} else {
|
||||||
// send our public key unencrypted
|
// send our public key unencrypted
|
||||||
Timber.tag(TAG).i("Sending public key")
|
// Timber.tag(TAG).i("Sending public key")
|
||||||
send(ECDHPayload(
|
send(ECDHPayload(
|
||||||
algorithm = SecureRendezvousChannelAlgorithm.ECDH_V1,
|
algorithm = SecureRendezvousChannelAlgorithm.ECDH_V1,
|
||||||
key = Base64.encodeToString(ourPublicKey, Base64.NO_WRAP)
|
key = Base64.encodeToString(ourPublicKey, Base64.NO_WRAP)
|
||||||
@ -121,10 +121,10 @@ class ECDHRendezvousChannel(override var transport: RendezvousTransport, theirPu
|
|||||||
|
|
||||||
aesKey = olmSAS!!.generateShortCode(aesInfo, 32)
|
aesKey = olmSAS!!.generateShortCode(aesInfo, 32)
|
||||||
|
|
||||||
Timber.tag(TAG).i("Our public key: ${Base64.encodeToString(ourPublicKey, Base64.NO_WRAP)}")
|
// Timber.tag(TAG).i("Our public key: ${Base64.encodeToString(ourPublicKey, Base64.NO_WRAP)}")
|
||||||
Timber.tag(TAG).i("Their public key: ${Base64.encodeToString(theirPublicKey, Base64.NO_WRAP)}")
|
// Timber.tag(TAG).i("Their public key: ${Base64.encodeToString(theirPublicKey, Base64.NO_WRAP)}")
|
||||||
Timber.tag(TAG).i("AES info: $aesInfo")
|
// Timber.tag(TAG).i("AES info: $aesInfo")
|
||||||
Timber.tag(TAG).i("AES key: ${Base64.encodeToString(aesKey, Base64.NO_WRAP)}")
|
// Timber.tag(TAG).i("AES key: ${Base64.encodeToString(aesKey, Base64.NO_WRAP)}")
|
||||||
|
|
||||||
val rawChecksum = olmSAS!!.generateShortCode(aesInfo, 5)
|
val rawChecksum = olmSAS!!.generateShortCode(aesInfo, 5)
|
||||||
return getDecimalCodeRepresentation(rawChecksum)
|
return getDecimalCodeRepresentation(rawChecksum)
|
||||||
@ -180,7 +180,7 @@ class ECDHRendezvousChannel(override var transport: RendezvousTransport, theirPu
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun encrypt(plainText: ByteArray): ECDHPayload {
|
private fun encrypt(plainText: ByteArray): ECDHPayload {
|
||||||
Timber.tag(TAG).i("Encrypting: ${plainText.toString(Charsets.UTF_8)}")
|
// Timber.tag(TAG).d("Encrypting: ${plainText.toString(Charsets.UTF_8)}")
|
||||||
val iv = ByteArray(16)
|
val iv = ByteArray(16)
|
||||||
SecureRandom().nextBytes(iv)
|
SecureRandom().nextBytes(iv)
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ class ECDHRendezvousChannel(override var transport: RendezvousTransport, theirPu
|
|||||||
|
|
||||||
val plainTextBytes = plainText.toByteArray()
|
val plainTextBytes = plainText.toByteArray()
|
||||||
|
|
||||||
Timber.tag(TAG).i("Decrypted: ${plainTextBytes.toString(Charsets.UTF_8)}")
|
// Timber.tag(TAG).d("Decrypted: ${plainTextBytes.toString(Charsets.UTF_8)}")
|
||||||
return plainTextBytes
|
return plainTextBytes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ class SimpleHttpRendezvousTransport(override var onCancelled: ((reason: Rendezvo
|
|||||||
// TODO: properly determine endpoint
|
// TODO: properly determine endpoint
|
||||||
val uri = if (uri != null) uri!! else "https://rendezvous.lab.element.dev"
|
val uri = if (uri != null) uri!! else "https://rendezvous.lab.element.dev"
|
||||||
|
|
||||||
Timber.tag(TAG).i("Sending data: ${data.toString(Charsets.UTF_8)} to $uri")
|
// Timber.tag(TAG).i("Sending data: ${data.toString(Charsets.UTF_8)} to $uri")
|
||||||
|
|
||||||
val httpClient = okhttp3.OkHttpClient.Builder().build()
|
val httpClient = okhttp3.OkHttpClient.Builder().build()
|
||||||
|
|
||||||
@ -123,8 +123,7 @@ class SimpleHttpRendezvousTransport(override var onCancelled: ((reason: Rendezvo
|
|||||||
val response = httpClient.newCall(request.build()).execute()
|
val response = httpClient.newCall(request.build()).execute()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Timber.tag(TAG).d("Received polling response: ${response.code} from $uri")
|
||||||
Timber.tag(TAG).i("Received polling response: ${response.code} from $uri")
|
|
||||||
|
|
||||||
if (response.code == 404) {
|
if (response.code == 404) {
|
||||||
cancel(RendezvousFailureReason.Unknown)
|
cancel(RendezvousFailureReason.Unknown)
|
||||||
@ -142,7 +141,7 @@ class SimpleHttpRendezvousTransport(override var onCancelled: ((reason: Rendezvo
|
|||||||
etag = it
|
etag = it
|
||||||
}
|
}
|
||||||
val data = response.body?.bytes()
|
val data = response.body?.bytes()
|
||||||
Timber.tag(TAG).i("Received data: ${data?.toString(Charsets.UTF_8)} from $uri with etag $etag")
|
// Timber.tag(TAG).d("Received data: ${data?.toString(Charsets.UTF_8)} from $uri with etag $etag")
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,6 +157,7 @@ class SimpleHttpRendezvousTransport(override var onCancelled: ((reason: Rendezvo
|
|||||||
|
|
||||||
override suspend fun cancel(reason: RendezvousFailureReason) {
|
override suspend fun cancel(reason: RendezvousFailureReason) {
|
||||||
var mappedReason = reason
|
var mappedReason = reason
|
||||||
|
Timber.tag(TAG).i("$expiresAt")
|
||||||
if (mappedReason == RendezvousFailureReason.Unknown &&
|
if (mappedReason == RendezvousFailureReason.Unknown &&
|
||||||
expiresAt != null && Date() > expiresAt) {
|
expiresAt != null && Date() > expiresAt) {
|
||||||
mappedReason = RendezvousFailureReason.Expired
|
mappedReason = RendezvousFailureReason.Expired
|
||||||
|
Loading…
Reference in New Issue
Block a user