Comments (2)
I confirm!
This is true for the decryption of some AEAD modes. On the C++ level, some report a minimum_final_size()
(of the tag length) and an update granularity of 1; notably ChaChaPoly, EAX, SIV and CCM. As a result, ffi_choose_update_size()
produces 17.
Also surprising: for GCM it reports 32 (due to both update granularity and minimum final size reporting 16 and ffi_choose_update_size()
rounding up "17" to the next multiple of "update granularity").
Note that botan_cipher_get_ideal_update_granularity()
(introduced in Botan 3.0) always reports reasonable values. However, documentation claims that "ideal granularity" is always a multiple of "update granularity", which obviously isn't the case for the configurations affected by this issue.
We should have caught that in #3951 already, but the tests that sanity-check the granularities aren't up to the job. Thanks a lot for scrutinizing this even before it gets released!
from botan.
@randombit I feel the safest fix for this is to let botan_cipher_get_update_granularity()
pass-through whatever is returned by Cipher_Mode::update_granularity()
(see #4094). This would remove the bug-prone logic in ffi_choose_update_size()
. Functionally, it should be just fine after the changes in #3951 -- most notably the BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE
handling added there.
Nevertheless, one could make a case about semver: Users that rely on the old behavior with the sufficiently sized update granularity, might trip over this. When updating to 3.5.0, they would either need to switch to botan_cipher_get_IDEAL_update_granularity()
or handle BOTAN_FFI_ERROR_INSUFFICIENT_BUFFER_SPACE
properly.
As an alternative to #4094, we could extend the logic in ffi_choose_update_size()
to scale the minimal update granularity to ensure ideal granularity is a multiple of it. My gut tells me, that this will just make it more error-prone, though: e.g. when Cipher_Mode
's update granularity is equal to its ideal granularity.
from botan.
Related Issues (20)
- [botan2] Intermittent assertions in `dh_invalid` test case on ppc64le HOT 6
- Using `find_package(botan)` with botan 3.4.0 installed from conan HOT 4
- Namespace Botan has no member HOT 3
- Fails to build as shared library on osx (via vcpkg) HOT 11
- GCC 14: warning: ‘operator delete’ called on pointer ‘_74’ with nonzero offset HOT 2
- The `--build-targets=` option doesn't
- Add CT::Option
- FrodoKEM-AES terribly slow without AESNI
- Re-evaluate Certificate_Extension::validate
- current master fails to build docs HOT 3
- Replace TPM support with alternative library HOT 3
- Possibility to use a custom thread pool HOT 4
- Botan Thread == 1 handling and Emscripten side effects HOT 8
- Some build flags are not passed to link-time optimizer when building with `-flto=auto` HOT 6
- ECDSA public key recovery: Internal error: False assertion m_point is not null in EC_AffinePoint HOT 6
- ECDSA producing unverifiable or incorrect signatures for secp128r2 HOT 3
- Create ECDH_PrivateKey from raw bits HOT 5
- Ninja install places .cmake files in the wrong folder. HOT 2
- configure.py drops build.ninja in the repository root HOT 3
- Significant slowdown of S2K key derivation/SHA1 hashing HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from botan.