I’m making a core password manager/vault library, and I’m wondering whether I should zero the memory or the user should do this.
One way they could do this is through a ZeroingAllocator, which std.crypto.secureZero’s all memory that is freed. This also makes it easier for me because I have a StringHashMap where the keys need to be freed, and the allocators already @constCast.
Two problems with this:
- User doesn’t know about having to do this.
- User would prefer not to worry about it and have the library do it for them.
I could maybe provide a ZeroingAllocator with the library in the second problem, but I would like to know what other people think!