diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/legalhold/LegalHoldRequestHandler.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/legalhold/LegalHoldRequestHandler.kt index dc8620a7e73..0c2f5a6fbd7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/legalhold/LegalHoldRequestHandler.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/handler/legalhold/LegalHoldRequestHandler.kt @@ -34,7 +34,10 @@ internal class LegalHoldRequestHandlerImpl internal constructor( ) : LegalHoldRequestHandler { override suspend fun handle(legalHoldRequest: Event.User.LegalHoldRequest): Either { if (selfUserId == legalHoldRequest.userId) { - kaliumLogger.i("Legal hold request received, storing it locally..") + kaliumLogger.i( + "Legal hold request received for user ${legalHoldRequest.userId.toLogString()}," + + " storing it locally.." + ) userConfigRepository.setLegalHoldRequest( legalHoldRequest.clientId.value, legalHoldRequest.lastPreKey.id, diff --git a/network/src/jvmTest/kotlin/com/wire/kalium/HttpClientConnectionSpecsTest.kt b/network/src/jvmTest/kotlin/com/wire/kalium/HttpClientConnectionSpecsTest.kt index 8a88f6a2aca..277bfc22b7d 100644 --- a/network/src/jvmTest/kotlin/com/wire/kalium/HttpClientConnectionSpecsTest.kt +++ b/network/src/jvmTest/kotlin/com/wire/kalium/HttpClientConnectionSpecsTest.kt @@ -32,29 +32,39 @@ class HttpClientConnectionSpecsTest { // This test conforms to the following testing standards: // @SF.Channel @TSFI.RESTfulAPI @S0.2 @S0.3 @S3 fun givenTheHttpClientIsCreated_ThenEnsureOnlySupportedSpecsArePresent() { + // given + val validTlsVersions = listOf(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2) + val notValidTlsVersions = listOf(TlsVersion.TLS_1_1, TlsVersion.TLS_1_0, TlsVersion.SSL_3_0) + val validCipherSuites = listOf( + CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + CipherSuite.TLS_AES_128_GCM_SHA256, + CipherSuite.TLS_AES_256_GCM_SHA384 + ) + val notValidCipherSuites = listOf( + CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_RSA_WITH_AES_128_GCM_SHA256, + CipherSuite.TLS_RSA_WITH_AES_256_GCM_SHA384, + CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA, + CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA, + CipherSuite.TLS_RSA_WITH_3DES_EDE_CBC_SHA + ) + + // when val connectionSpecs = OkHttpSingleton.createNew {}.connectionSpecs + + // then with(connectionSpecs[0]) { tlsVersions?.let { - assertTrue { validTlsVersions.containsAll(it) } - assertFalse { notValidTlsVersions.containsAll(it) } + assertTrue { it.containsAll(validTlsVersions) } + assertFalse { it.containsAll(notValidTlsVersions) } } cipherSuites?.let { assertTrue { it.containsAll(validCipherSuites) } + assertFalse { it.containsAll(notValidCipherSuites) } } } - assertEquals(connectionSpecs[1], ConnectionSpec.CLEARTEXT) } - - private companion object { - val validTlsVersions = listOf(TlsVersion.TLS_1_3, TlsVersion.TLS_1_2) - val notValidTlsVersions = listOf(TlsVersion.TLS_1_1, TlsVersion.TLS_1_0, TlsVersion.SSL_3_0) - - val validCipherSuites = listOf( - CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - CipherSuite.TLS_AES_128_GCM_SHA256, - CipherSuite.TLS_AES_256_GCM_SHA384 - ) - } } diff --git a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt index 38444610eb6..34af338ad1e 100644 --- a/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt +++ b/persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt @@ -93,7 +93,7 @@ internal class UserConfigDAOImpl internal constructor( metadataDAO.putSerializable( LEGAL_HOLD_REQUEST, LegalHoldRequestEntity(clientId, LastPreKey(lastPreKeyId, lastPreKey)), - LegalHoldRequestEntity.serializer(), + LegalHoldRequestEntity.serializer() ) }