Browse Source

Avoid confusion of the return value of aead_cipher_decrypt()

pull/2503/head
Max Lv 5 years ago
parent
commit
9109b63aaa
1 changed files with 6 additions and 0 deletions
  1. 6
      src/aead.c

6
src/aead.c

@ -245,6 +245,12 @@ aead_cipher_decrypt(cipher_ctx_t *cipher_ctx,
return CRYPTO_ERROR;
}
// The success return value ln libsodium and mbedTLS are both 0
if (err != 0)
// Although we never return any library specific value in the caller,
// here we still set the error code to CRYPTO_ERROR to avoid confusion.
err = CRYPTO_ERROR;
return err;
}

Loading…
Cancel
Save