mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-25 10:13:44 +00:00
Revert "ppbloom:remove unnecessay bloom_check"
ppbloom_add only checks current bloom filter not both PING PONG filters
This reverts commit 9ae59819be.
This commit is contained in:
+2
-1
@@ -695,10 +695,11 @@ aead_decrypt(buffer_t *ciphertext, cipher_ctx_t *cipher_ctx, size_t capacity)
|
||||
|
||||
// Add the salt to bloom filter
|
||||
if (cipher_ctx->init == 1) {
|
||||
if (ppbloom_add((void *)cipher_ctx->salt, salt_len) == 1) {
|
||||
if (ppbloom_check((void *)cipher_ctx->salt, salt_len) == 1) {
|
||||
LOGE("crypto: AEAD: repeat salt detected");
|
||||
return CRYPTO_ERROR;
|
||||
}
|
||||
ppbloom_add((void *)cipher_ctx->salt, salt_len);
|
||||
cipher_ctx->init = 2;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ ppbloom_add(const void *buffer, int len)
|
||||
{
|
||||
int err;
|
||||
err = bloom_add(ppbloom + current, buffer, len);
|
||||
if (err == -1 || err == 1)
|
||||
if (err == -1)
|
||||
return err;
|
||||
|
||||
bloom_count[current]++;
|
||||
|
||||
Reference in New Issue
Block a user