debug: Add debug output for ChaCha20-Poly1305
Found: TAG mismatch between encrypt and decrypt - Encrypt produces: b3a7f2c8... - Decrypt expects: f6e6610c... Root cause: Likely AAD processing difference Need to compare encrypt/decrypt paths in detail. WireGuard tests: 28 passed, 4 failed
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* =========================================================================
|
||||
* WireGuard Protocol Constants
|
||||
@@ -322,6 +323,8 @@ int se050_wireguard_decrypt_packet(se050_wireguard_session_t *session,
|
||||
memzero_explicit(tag, 16);
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "DEBUG: decrypt failed, ciphertext_len=%zu, packet_len=%zu, aad_len=16\n",
|
||||
ciphertext_len, packet_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user