1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-20 10:39:19 +01:00

fix compilation warnings

This commit is contained in:
sstone 2017-01-18 18:42:38 +01:00
parent 692e47f3ea
commit b333de0d03
3 changed files with 8 additions and 2 deletions

View File

@ -424,10 +424,12 @@ object Noise {
val symmetricState1 = (handshakePattern.initiatorPreMessages).foldLeft(symmetricState) {
case (state, E) => state.mixHash(e.pub)
case (state, S) => state.mixHash(s.pub)
case _ => throw new RuntimeException("invalid pre-message")
}
val symmetricState2 = (handshakePattern.responderPreMessages).foldLeft(symmetricState1) {
case (state, E) => state.mixHash(re)
case (state, S) => state.mixHash(rs)
case _ => throw new RuntimeException("invalid pre-message")
}
HandshakeStateWriter(handshakePattern.messages, symmetricState2, s, e, rs, re, dh, byteStream)
}
@ -437,10 +439,12 @@ object Noise {
val symmetricState1 = handshakePattern.initiatorPreMessages.foldLeft(symmetricState) {
case (state, E) => state.mixHash(re)
case (state, S) => state.mixHash(rs)
case _ => throw new RuntimeException("invalid pre-message")
}
val symmetricState2 = handshakePattern.responderPreMessages.foldLeft(symmetricState1) {
case (state, E) => state.mixHash(e.pub)
case (state, S) => state.mixHash(s.pub)
case _ => throw new RuntimeException("invalid pre-message")
}
HandshakeStateReader(handshakePattern.messages, symmetricState2, s, e, rs, re, dh, byteStream)
}

View File

@ -7,6 +7,8 @@ import fr.acinq.bitcoin.{BinaryData, Protocol}
import fr.acinq.eclair.channel.{CMD_CLOSE, Command}
import fr.acinq.eclair.crypto.Noise._
import scala.reflect.ClassTag
/**
* see BOLT #8
* This class handles the transport layer:
@ -23,7 +25,7 @@ import fr.acinq.eclair.crypto.Noise._
* @param listenerFactory factory that will be used to create the listener that will receive decrypted messages once the
* handshake phase as been completed. Its parameters are a tuple (transport handler, remote public key)
*/
class TransportHandler[T](keyPair: KeyPair, rs: Option[BinaryData], them: ActorRef, isWriter: Boolean, listenerFactory: (ActorRef, BinaryData) => ActorRef, serializer: TransportHandler.Serializer[T]) extends Actor with LoggingFSM[TransportHandler.State, TransportHandler.Data] {
class TransportHandler[T: ClassTag](keyPair: KeyPair, rs: Option[BinaryData], them: ActorRef, isWriter: Boolean, listenerFactory: (ActorRef, BinaryData) => ActorRef, serializer: TransportHandler.Serializer[T]) extends Actor with LoggingFSM[TransportHandler.State, TransportHandler.Data] {
import TransportHandler._

View File

@ -304,7 +304,7 @@ object NoiseSpec {
def handshake(init: HandshakeStateWriter, resp: HandshakeStateReader, inputs: List[BinaryData], outputs: List[BinaryData] = Nil): (List[BinaryData], (CipherState, CipherState)) = {
assert(init.messages == resp.messages)
assert(init.messages.length == inputs.length)
inputs match {
(inputs: @unchecked) match {
case last :: Nil =>
val (_, message, Some((ics0, ics1, _))) = init.write(last)
val (_, _, Some((rcs0, rcs1, _))) = resp.read(message)