Skip to content

Bumped secrecy crate from 0.8.0 to 0.10.3 #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
*DS_Store
*.patch
*NVChip

#IDEs
.vscode
.idea

#build artifacts
cryptoki-sys/pkcs11-precompile.h
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cryptoki/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ libloading = "0.8.6"
log = "0.4.14"
cryptoki-sys = { path = "../cryptoki-sys", version = "0.4.0" }
paste = "1.0.6"
secrecy = "0.8.0"
secrecy = "0.10.3"

[dev-dependencies]
num-traits = "0.2.14"
Expand Down
4 changes: 2 additions & 2 deletions cryptoki/src/session/session_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ impl Session {
}

/// Logs a session in using a slice of raw bytes as a PIN. Some dongle drivers allow
/// non UTF-8 characters in the PIN and as a result, we aren't guaranteed that we can
/// pass in a UTF-8 string to login. Therefore, it's useful to be able to pass in raw bytes
/// non UTF-8 characters in the PIN and, as a result, we aren't guaranteed that we can
/// pass in a UTF-8 string to `login`. Therefore, it's useful to be able to pass in raw bytes
/// rather than convert a UTF-8 string to bytes.
///
/// # Arguments
Expand Down
21 changes: 10 additions & 11 deletions cryptoki/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

use crate::error::{Error, Result};
use cryptoki_sys::*;
use secrecy::SecretString;
use secrecy::SecretVec;
use secrecy::{SecretBox, SecretString};
use std::convert::TryFrom;
use std::convert::TryInto;
use std::fmt::Formatter;
Expand All @@ -29,7 +28,7 @@ impl Date {
///
/// # Errors
///
/// If the lengths are invalid a `Error::InvalidValue` will be returned
/// If the lengths are invalid, an `Error::InvalidValue` will be returned
pub fn new_from_str_slice(year: &str, month: &str, day: &str) -> Result<Self> {
if year.len() != 4 || month.len() != 2 || day.len() != 2 {
Err(Error::InvalidValue)
Expand Down Expand Up @@ -222,22 +221,22 @@ impl From<CK_VERSION> for Version {
/// A UTC datetime returned by a token's clock if present.
#[derive(Copy, Clone, Debug)]
pub struct UtcTime {
/// **[Conformance](crate#conformance-notes):**
/// **[Conformance](crate#conformance-notes): **
/// Guaranteed to be in range 0..=9999
pub year: u16,
/// **[Conformance](crate#conformance-notes):**
/// **[Conformance](crate#conformance-notes): **
/// Guaranteed to be in range 0..=99
pub month: u8,
/// **[Conformance](crate#conformance-notes):**
/// **[Conformance](crate#conformance-notes): **
/// Guaranteed to be in range 0..=99
pub day: u8,
/// **[Conformance](crate#conformance-notes):**
/// **[Conformance](crate#conformance-notes): **
/// Guaranteed to be in range 0..=99
pub hour: u8,
/// **[Conformance](crate#conformance-notes):**
/// **[Conformance](crate#conformance-notes): **
/// Guaranteed to be in range 0..=99
pub minute: u8,
/// **[Conformance](crate#conformance-notes):**
/// **[Conformance](crate#conformance-notes): **
/// Guaranteed to be in range 0..=99
pub second: u8,
}
Expand All @@ -248,7 +247,7 @@ impl UtcTime {
/// PKCS#11 and ISO are unrelated standards, and this function is provided
/// only for convenience. ISO format is more widely recognized and parsable
/// by various date/time utilities, while PKCS#11's internal representation
/// of this type is is not used elsewhere.
/// of this type is not used elsewhere.
/// Other than formatting, this crate does not guarantee or enforce any part
/// of the ISO standard.
pub fn as_iso8601_string(&self) -> String {
Expand Down Expand Up @@ -281,7 +280,7 @@ pub type AuthPin = SecretString;
/// Secret wrapper for a raw non UTF-8 Pin
///
/// Enable the `serde` feature to add support for Deserialize
pub type RawAuthPin = SecretVec<u8>;
pub type RawAuthPin = SecretBox<Vec<u8>>;

#[cfg(test)]
mod test {
Expand Down
Loading