randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.6k stars 570 forks source link

Hard-coded usage of the system RNG in ffi_pk_op #4340

Open ghost opened 2 months ago

ghost commented 2 months ago

There are functions in ffi_pk_op.cpp that directly use Botan::system_rng() without giving the caller the option to override that, e.g. here:

https://github.com/randombit/botan/blob/3.5.0/src/lib/ffi/ffi_pk_op.cpp#L40

Should the RNG not be a parameter?

randombit commented 2 months ago

It should have been a paramater. I don’t recall anymore why this ended up hard coded in this way. We cannot change the current implementations, since many existing users depend on the current ABI, but we could certainly add new functions which allow specifying an RNG to use.

dirkz commented 1 month ago

Implementation happening here: https://github.com/randombit/botan/pull/4411