Skip to content

Commit 52daf5f

Browse files
authored
Merge pull request #287 from ptdecker/ptdecker/secrecy-upgrade
Bumped secrecy crate from 0.8.0 to 0.10.3
2 parents 68813c6 + e783630 commit 52daf5f

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
*DS_Store
55
*.patch
66
*NVChip
7+
8+
#IDEs
79
.vscode
10+
.idea
11+
12+
#build artifacts
13+
cryptoki-sys/pkcs11-precompile.h

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cryptoki/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ libloading = "0.8.6"
1818
log = "0.4.14"
1919
cryptoki-sys = { path = "../cryptoki-sys", version = "0.4.0" }
2020
paste = "1.0.6"
21-
secrecy = "0.8.0"
21+
secrecy = "0.10.3"
2222

2323
[dev-dependencies]
2424
num-traits = "0.2.14"

cryptoki/src/session/session_management.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ impl Session {
6262
}
6363

6464
/// Logs a session in using a slice of raw bytes as a PIN. Some dongle drivers allow
65-
/// non UTF-8 characters in the PIN and as a result, we aren't guaranteed that we can
66-
/// pass in a UTF-8 string to login. Therefore, it's useful to be able to pass in raw bytes
65+
/// non UTF-8 characters in the PIN and, as a result, we aren't guaranteed that we can
66+
/// pass in a UTF-8 string to `login`. Therefore, it's useful to be able to pass in raw bytes
6767
/// rather than convert a UTF-8 string to bytes.
6868
///
6969
/// # Arguments

cryptoki/src/types.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
55
use crate::error::{Error, Result};
66
use cryptoki_sys::*;
7-
use secrecy::SecretString;
8-
use secrecy::SecretVec;
7+
use secrecy::{SecretBox, SecretString};
98
use std::convert::TryFrom;
109
use std::convert::TryInto;
1110
use std::fmt::Formatter;
@@ -29,7 +28,7 @@ impl Date {
2928
///
3029
/// # Errors
3130
///
32-
/// If the lengths are invalid a `Error::InvalidValue` will be returned
31+
/// If the lengths are invalid, an `Error::InvalidValue` will be returned
3332
pub fn new_from_str_slice(year: &str, month: &str, day: &str) -> Result<Self> {
3433
if year.len() != 4 || month.len() != 2 || day.len() != 2 {
3534
Err(Error::InvalidValue)
@@ -222,22 +221,22 @@ impl From<CK_VERSION> for Version {
222221
/// A UTC datetime returned by a token's clock if present.
223222
#[derive(Copy, Clone, Debug)]
224223
pub struct UtcTime {
225-
/// **[Conformance](crate#conformance-notes):**
224+
/// **[Conformance](crate#conformance-notes): **
226225
/// Guaranteed to be in range 0..=9999
227226
pub year: u16,
228-
/// **[Conformance](crate#conformance-notes):**
227+
/// **[Conformance](crate#conformance-notes): **
229228
/// Guaranteed to be in range 0..=99
230229
pub month: u8,
231-
/// **[Conformance](crate#conformance-notes):**
230+
/// **[Conformance](crate#conformance-notes): **
232231
/// Guaranteed to be in range 0..=99
233232
pub day: u8,
234-
/// **[Conformance](crate#conformance-notes):**
233+
/// **[Conformance](crate#conformance-notes): **
235234
/// Guaranteed to be in range 0..=99
236235
pub hour: u8,
237-
/// **[Conformance](crate#conformance-notes):**
236+
/// **[Conformance](crate#conformance-notes): **
238237
/// Guaranteed to be in range 0..=99
239238
pub minute: u8,
240-
/// **[Conformance](crate#conformance-notes):**
239+
/// **[Conformance](crate#conformance-notes): **
241240
/// Guaranteed to be in range 0..=99
242241
pub second: u8,
243242
}
@@ -248,7 +247,7 @@ impl UtcTime {
248247
/// PKCS#11 and ISO are unrelated standards, and this function is provided
249248
/// only for convenience. ISO format is more widely recognized and parsable
250249
/// by various date/time utilities, while PKCS#11's internal representation
251-
/// of this type is is not used elsewhere.
250+
/// of this type is not used elsewhere.
252251
/// Other than formatting, this crate does not guarantee or enforce any part
253252
/// of the ISO standard.
254253
pub fn as_iso8601_string(&self) -> String {
@@ -281,7 +280,7 @@ pub type AuthPin = SecretString;
281280
/// Secret wrapper for a raw non UTF-8 Pin
282281
///
283282
/// Enable the `serde` feature to add support for Deserialize
284-
pub type RawAuthPin = SecretVec<u8>;
283+
pub type RawAuthPin = SecretBox<Vec<u8>>;
285284

286285
#[cfg(test)]
287286
mod test {

0 commit comments

Comments
 (0)