diff --git a/cryptoki/src/slot/slot_info.rs b/cryptoki/src/slot/slot_info.rs index d0cfa90b..2dff9d01 100644 --- a/cryptoki/src/slot/slot_info.rs +++ b/cryptoki/src/slot/slot_info.rs @@ -47,7 +47,7 @@ impl SlotInfo { /// /// **[Conformance](crate#conformance-notes):** /// If this slot does not represent a removable device, a token is *always* - /// considered to be present. That is, `slot.removable device() == false` + /// considered to be present. That is, `slot.removable_device() == false` /// implies `slot.token_present() == true`. pub fn token_present(&self) -> bool { self.flags.contains(SlotInfoFlags::TOKEN_PRESENT) diff --git a/cryptoki/src/slot/token_info.rs b/cryptoki/src/slot/token_info.rs index bb7e4d4b..ebb91a04 100644 --- a/cryptoki/src/slot/token_info.rs +++ b/cryptoki/src/slot/token_info.rs @@ -50,10 +50,14 @@ pub enum Limit { /// Information about a token #[derive(Debug, Clone)] pub struct TokenInfo { - label: String, // 32 - manufacturer_id: String, // 32 - model: String, // 16 - serial_number: String, // 16 + // The following four strings are limited in size based on + // the orignating struct definition. Sizes are in *bytes* + // but UTF-8 data may represent fewer characters. + // Original buffers were space (0x20) padded. + label: String, // len <= 32 bytes + manufacturer_id: String, // len <= 32 bytes + model: String, // len <= 16 bytes + serial_number: String, // len <= 16 bytes flags: TokenInfoFlags, max_session_count: Limit, session_count: Option,