Decrease max message size to 16MB

This commit is contained in:
Matéo Duparc 2021-06-18 16:04:50 +02:00
parent 38b322ebc5
commit f7418cf9c2
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ object Constants {
const val port = 7530
const val mDNSServiceName = "AIRA Node"
const val mDNSServiceType = "_aira._tcp"
const val fileSizeLimit = 32760000
const val fileSizeLimit = 16380000
const val MSG_LOADING_COUNT = 20
const val FILE_CHUNK_SIZE = 1023996
const val MAX_AVATAR_SIZE = 10000000

View File

@ -38,8 +38,8 @@ class Session(private val socket: SocketChannel, val outgoing: Boolean): Selecta
private const val handshakeBufferLen = (2*(RANDOM_LEN+PUBLIC_KEY_LEN))+SIGNATURE_LEN+AES_TAG_LEN
private const val CIPHER_TYPE = "AES/GCM/NoPadding"
private const val MESSAGE_LEN_LEN = 4
private const val PADDED_MAX_SIZE = 32768000
private const val MAX_RECV_SIZE = MESSAGE_LEN_LEN + PADDED_MAX_SIZE + AES_TAG_LEN
private const val PADDED_MAX_SIZE = 16384000
private const val MAX_RECV_SIZE = PADDED_MAX_SIZE + AES_TAG_LEN
}
private val prng = SecureRandom()