assaabloy-ppi / salt-channel

The specification and the reference implementation of Salt Channel - a simple, light-weight secure channel protocol based on TweetNaCl by Bernstein.
MIT License
14 stars 11 forks source link

Add way to detect A1A2 session in SaltServerSession #11

Closed franslundberg closed 6 years ago

franslundberg commented 6 years ago

We need way to determine if A1A2 occured after handshake() called. Ref: TcpServer.java in other project.

    SaltServerSession serverSession = new SaltServerSession(host.getSigKeyPair(), clearChannel);
    serverSession.setEncKeyPair(host.getCryptoLib().getRand());
    serverSession.setA2(A2Factory.createForPoTv1());
    serverSession.handshake();

    // TODO B. we need to know here if A1A2 was used, then session is over
    // and we should return
franslundberg commented 6 years ago

Fixed. Added serverSession.isDone() method.