fix: NEWKEYS 后重置序列号为 0(加密上下文切换)

This commit is contained in:
IT committed 2026-06-12 19:01:43 +08:00
1 parent 8c5f0fa6ed
commit d355e2c10c
2 files changed
+6

No files matched your search

+4
View File
@@ -79,6 +79,10 @@ export class SSHPacketParser {
return this.seqNum;
}
resetSeqNum(): void {
this.seqNum = 0;
}
getBufferLength(): number {
return this.buffer.length;
}
+2
View File
@@ -220,6 +220,8 @@ export class SSHSession {
await this.writeSocket(packet);
console.log('[KEX] NEWKEYS sent');
this.seqNumSend = 0;
this.packetParser.resetSeqNum();
await this.enableEncryption();
console.log('[KEX] Encryption enabled');