byte_array_ops/core/trust/insecure/display.rs
1//! Display and Debug implementations for ByteArray in insecure mode
2//!
3//! In insecure mode, full byte array data is exposed in formatting
4
5use crate::core::model::ByteArray;
6use core::fmt::{Debug, Display, Formatter};
7
8/// this is insecure as it might exposes internal byte array data for example in system logs and is
9/// thus only available in insecure modes. If the user wants to do it nonetheless he shall override
10/// the default display provider TODO
11impl Display for ByteArray {
12 fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
13 self.bytes.fmt(f)
14 }
15}
16
17/// this is the insecure version of debug impl that leaks byte array data
18impl Debug for ByteArray {
19 fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
20 <ByteArray as Display>::fmt(self, f)
21 }
22}