botan icon indicating copy to clipboard operation
botan copied to clipboard

Hard-coded usage of the system RNG in ffi_pk_op

Open ghost opened this issue 1 year ago • 2 comments

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?

ghost avatar Sep 07 '24 10:09 ghost

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.

randombit avatar Sep 07 '24 14:09 randombit

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

dirkz avatar Oct 27 '24 11:10 dirkz