Skip to content

Commit

Permalink
fix: enlarge buffer for storing session
Browse files Browse the repository at this point in the history
  • Loading branch information
szysas committed Jun 28, 2022
1 parent c385a67 commit 048d8e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class SslSession internal constructor(
}

fun saveAndClose(): ByteArray {
val buffer = Memory(512)
val buffer = Memory(1280)
val outputLen = Memory(8)
mbedtls_ssl_context_save(sslContext, buffer, buffer.size().toInt(), outputLen).verify()
close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ class DtlsTransmitterCertTest {
serverConf = SslConfig.server(Certs.serverLongChain, Certs.server2.privateKey, reqAuthentication = false, cidSupplier = randomCid, mtu = 1024)
val server = newServerDtlsTransmitter(7004)

val clientConf = SslConfig.client(trustedCerts = listOf(Certs.rootRsa.asX509()), cipherSuites = listOf("TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384", "TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256"))
val clientConf = SslConfig.client(trustedCerts = listOf(Certs.rootRsa.asX509()))
val client = DtlsTransmitter.connect(srvTrans, clientConf, 7004).await()

client.send("dupa")
assertEquals("dupa", server.await().receiveString())

client.saveSession()
}

@Test
Expand Down

0 comments on commit 048d8e2

Please sign in to comment.