Conversation
|
Thanks for the PR! I'm not sure what would be the right way to do this. Zeroization of a
I'm sure there is already some established preferred ways to do this that I'm not familiar with. What do you think? |
|
Hi! You're right, thank you. It seems like I'll fix the PR ASAP with this factors in mind. |
# Conflicts: # iban_validate/README.md # iban_validate/src/base_iban.rs
BazeIbanZeroizeOnDrop for BazeIban
|
I updated the PR to only support the Some helper functions were fixed to ensure strings allocated inside them are wrapped to the The consequence of this change is that |
Hi! Here I added the feature-protected support for the
BaseIbanzeroization via the well-known crate zeroize. This would help using the type as a part of secure structures supporting the zeroization (to comply with PCI DSS and other security standards).Under the hood it just relies on the
ArrayString's implementation ofZeroize.In addition (see the second commit) I provided zeroization of the temporary objects created during the validation to prevent any partial leaks of invalid IBAN-s
I added zeroization to the
BaseIbanonly (not to theIban) because the later is expected to be checked, but its zeroization would break any invariants. If theIbanwere not copied, it would be worth it to implementZeroizeOnDrop, but for sturcts on a stack (which is necessary for#[no_std]), theCopyis definitely more important.See the test example for the usage.