validateNegotiation method

  1. @override
bool validateNegotiation(
  1. NegotiationResult negotiation
)
override

Validates that the negotiated algorithms are supported and secure.

Implementation

@override
bool validateNegotiation(NegotiationResult negotiation) {
  // Basic validation
  if (negotiation.localPeerId.isEmpty || negotiation.remotePeerId.isEmpty) {
    return false;
  }

  // Ensure algorithms are supported
  final supportedKeyExchange = _keyExchangePriority;
  final supportedAsymmetric = _asymmetricPriority;
  final supportedSymmetric = _symmetricPriority;

  return supportedKeyExchange.contains(negotiation.keyExchange) &&
      supportedAsymmetric.contains(negotiation.asymmetric) &&
      supportedSymmetric.contains(negotiation.symmetric);
}