Skip to content

Commit

Permalink
Minor fix/enhance of a few comments
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Koskie <[email protected]>
  • Loading branch information
vkkoskie authored and ionut-arm committed Jan 27, 2022
1 parent ed4aecf commit e9aa3bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cryptoki/src/slot/slot_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 8 additions & 4 deletions cryptoki/src/slot/token_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u64>,
Expand Down

0 comments on commit e9aa3bd

Please sign in to comment.