fix(ssh): Add detailed MAC calculation logging for debugging
This commit is contained in:
@@ -513,9 +513,13 @@ impl EncryptedPacket {
|
||||
info!(" sequence_number: {}", sequence_number);
|
||||
info!(" mac_key length: {}", mac_key.len());
|
||||
info!(" plaintext_packet length: {}", plaintext_packet.len());
|
||||
info!(" plaintext_packet first 8 bytes: {:?}", &plaintext_packet.ptr()[..std::cmp::min(8, plaintext_packet.len())]);
|
||||
info!(" mac_key first 8 bytes: {:?}", &mac_key[..std::cmp::min(8, mac_key.len())]);
|
||||
|
||||
// MAC計算:HMAC(sequence_number || plaintext_packet)
|
||||
let mac = encryption_ctx.compute_mac(sequence_number, plaintext_packet.ptr(), mac_key)?;
|
||||
|
||||
info!(" Calculated MAC first 8 bytes: {:?}", &mac[..std::cmp::min(8, mac.len())]);
|
||||
|
||||
// 然後加密plaintext packet(AES-CTR加密整個packet)
|
||||
let cipher = if is_server_to_client {
|
||||
|
||||
Reference in New Issue
Block a user