On Wed, 2022-03-16 at 22:24 -0300, Santino Mazza wrote:
This is needed because BCryptFinalizeKey doesn't change the pubkey_len member based on the keylen member. Also it doesn't reallocate the pubkey buffer. If we don't do this programs get an error when trying to generate a key by setting the length using BCryptSetProperty.
The deeper problem is that we're allocating the pubkey buffer too early. Avoiding that will take some restructuring. I'll take a look.