Browse Source

Merge pull request #2608 from babarosaM33/master

Revert "ppbloom:remove unnecessay bloom_check"
pull/2611/head
Max Lv 4 years ago
committed by GitHub
parent
commit
5cd80951a3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions
  1. 3
      src/aead.c
  2. 2
      src/ppbloom.c

3
src/aead.c

@ -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;
}

2
src/ppbloom.c

@ -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]++;

Loading…
Cancel
Save