Skip to content

Commit d24d541

Browse files
committed
Add support for HFS handshakes
1 parent a5133e4 commit d24d541

File tree

6 files changed

+254
-44
lines changed

6 files changed

+254
-44
lines changed

src/main/java/com/eatthepath/noise/HandshakePattern.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,10 @@ boolean requiresRemoteStaticPublicKey(final NoiseHandshake.Role role) {
815815
.anyMatch(token -> token == Token.S);
816816
}
817817

818+
boolean requiresKeyEncapsulationMechanism() {
819+
return getModifiers(getName()).contains("hfs");
820+
}
821+
818822
@Override
819823
public String toString() {
820824
final StringBuilder stringBuilder = new StringBuilder(getName() + ":\n");

src/main/java/com/eatthepath/noise/NamedProtocolHandshakeBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,14 @@ public NoiseHandshake build() {
205205
keyAgreement,
206206
cipher,
207207
hash,
208+
null,
208209
prologue,
209210
localStaticKeyPair,
210211
localEphemeralKeyPair,
212+
null,
211213
remoteStaticPublicKey,
212214
null,
215+
null,
213216
preSharedKeys);
214217
}
215218
}

0 commit comments

Comments
 (0)