When we log debug and error information, we sometimes want to give context about types that contain secrets. However, we don't want to log the secrets themselves. Specifically, we want to avoid logging data that could be used to reconstruct key shares if it was collected after the fact.
It's okay to be a bit aggressive about identifying sensitive fields, we'd rather be too cautious.
[x] Identify all the types that contain potentially-sensitive fields
[x] Manually implement Debug on them with the secrets redacted
[x] Derive ZeroizeOnDrop on them, too
Tentative list of structs that need more careful debug. This includes types that don't derive debug right now, but I included them because it seems better to preemptively add a safer debug, than to leave open the possibility of deriving it insecurely later.
When we log debug and error information, we sometimes want to give context about types that contain secrets. However, we don't want to log the secrets themselves. Specifically, we want to avoid logging data that could be used to reconstruct key shares if it was collected after the fact.
It's okay to be a bit aggressive about identifying sensitive fields, we'd rather be too cautious.
Debug
on them with the secrets redactedZeroizeOnDrop
on them, tooTentative list of structs that need more careful debug. This includes types that don't derive debug right now, but I included them because it seems better to preemptively add a safer debug, than to leave open the possibility of deriving it insecurely later.