diff --git a/app/src/main/java/com/bitchat/android/noise/NoiseSession.kt b/app/src/main/java/com/bitchat/android/noise/NoiseSession.kt index dc4a3d50..5fe1ab59 100644 --- a/app/src/main/java/com/bitchat/android/noise/NoiseSession.kt +++ b/app/src/main/java/com/bitchat/android/noise/NoiseSession.kt @@ -1,9 +1,8 @@ package com.bitchat.android.noise import android.util.Log -import com.bitchat.android.noise.southernstorm.protocol.* -import com.bitchat.android.util.toHexString -import java.security.SecureRandom +import com.bitchat.android.noise.southernstorm.protocol.CipherState +import com.bitchat.android.noise.southernstorm.protocol.HandshakeState /** @@ -251,7 +250,7 @@ class NoiseSession( if (handshakeState?.needsLocalKeyPair() == true) { Log.d(TAG, "Local static key pair is required for XX pattern") - val localKeyPair = handshakeState?.getLocalKeyPair() + val localKeyPair = handshakeState?.localKeyPair if (localKeyPair != null) { // FIXED: Use the provided persistent identity keys with our local fork // Our local fork properly supports setting pre-existing keys @@ -369,7 +368,7 @@ class NoiseSession( Log.d(TAG, "Read handshake message, payload length: $payloadLength currentPattern: $currentPattern") // Check what action the handshake state wants us to take next - val action = handshakeStateLocal.getAction() + val action = handshakeStateLocal.action Log.d(TAG, "Handshake action after processing message: $action") return when (action) { @@ -380,7 +379,7 @@ class NoiseSession( currentPattern++ val response = responseBuffer.copyOf(responseLength) - Log.d(TAG, "Generated handshake response: ${response.size} bytes, action still: ${handshakeStateLocal.getAction()} currentPattern: $currentPattern") + Log.d(TAG, "Generated handshake response: ${response.size} bytes, action still: ${handshakeStateLocal.action} currentPattern: $currentPattern") completeHandshake() response } @@ -430,12 +429,12 @@ class NoiseSession( // Split handshake state into transport ciphers val cipherPair = handshakeState?.split() - sendCipher = cipherPair?.getSender() - receiveCipher = cipherPair?.getReceiver() + sendCipher = cipherPair?.sender + receiveCipher = cipherPair?.receiver // Extract remote static key if available if (handshakeState?.hasRemotePublicKey() == true) { - val remoteDH = handshakeState?.getRemotePublicKey() + val remoteDH = handshakeState?.remotePublicKey if (remoteDH != null) { remoteStaticPublicKey = ByteArray(32) remoteDH.getPublicKey(remoteStaticPublicKey!!, 0) @@ -444,7 +443,7 @@ class NoiseSession( } // Extract handshake hash for channel binding - handshakeHash = handshakeState?.getHandshakeHash() + handshakeHash = handshakeState?.handshakeHash // Clean up handshake state handshakeState?.destroy()