mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-03 16:45:53 +00:00
Output error log when repeat IV/salt detected
This is useful when checking connection issues, and can be used to check broken random number generator and replay attacks. Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
@@ -635,6 +635,7 @@ aead_decrypt(buffer_t *ciphertext, cipher_ctx_t *cipher_ctx, size_t capacity)
|
||||
aead_cipher_ctx_set_key(cipher_ctx, 0);
|
||||
|
||||
if (cache_key_exist(nonce_cache, (char *)cipher_ctx->salt, salt_len)) {
|
||||
LOGE("crypto: AEAD: repeat salt detected");
|
||||
bfree(ciphertext);
|
||||
return CRYPTO_ERROR;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user