iniator works now

This commit is contained in:
callebtc
2025-07-20 21:19:41 +02:00
parent b275ad7308
commit 9ba7dc5181
2 changed files with 26 additions and 22 deletions
@@ -124,24 +124,16 @@ class SecurityManager(private val encryptionService: EncryptionService, private
if (response != null) {
Log.d(TAG, "Successfully processed Noise handshake step $step from $peerID, sending response")
// Send handshake response through delegate
delegate?.sendHandshakeResponse(peerID, response)
// Notify delegate of handshake completion
// delegate?.onKeyExchangeCompleted(peerID, packet.payload, routed.relayAddress)
return true
} else {
// Check if session is now established (handshake complete)
if (encryptionService.hasEstablishedSession(peerID)) {
Log.d(TAG, "✅ Noise handshake completed with $peerID")
delegate?.onKeyExchangeCompleted(peerID, packet.payload, routed.relayAddress)
return true
} else {
Log.w(TAG, "Failed to process Noise handshake from $peerID")
return false
}
}
// Check if session is now established (handshake complete)
if (encryptionService.hasEstablishedSession(peerID)) {
Log.d(TAG, "✅ Noise handshake completed with $peerID")
delegate?.onKeyExchangeCompleted(peerID, packet.payload, routed.relayAddress)
}
return true
} catch (e: Exception) {
Log.e(TAG, "Failed to process Noise handshake from $peerID: ${e.message}")