Skip to content

Commit

Permalink
use SecretString
Browse files Browse the repository at this point in the history
  • Loading branch information
radumarias committed Dec 11, 2024
1 parent c0a9d92 commit 92c67b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/encryptedfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl From<TimesFileAttr> for SetFileAttr {
#[derive(Debug, Clone)]
pub struct DirectoryEntry {
pub ino: u64,
pub name: SecretBox<String>,
pub name: SecretString,
pub kind: FileType,
}

Expand All @@ -423,7 +423,7 @@ impl PartialEq for DirectoryEntry {
#[derive(Debug)]
pub struct DirectoryEntryPlus {
pub ino: u64,
pub name: SecretBox<String>,
pub name: SecretString,
pub kind: FileType,
pub attr: FileAttr,
}
Expand Down Expand Up @@ -567,7 +567,7 @@ pub struct EncryptedFs {
self_weak: std::sync::Mutex<Option<Weak<Self>>>,
attr_cache: ExpireValue<RwLock<LruCache<u64, FileAttr>>, FsError, AttrCacheProvider>,
dir_entries_name_cache:
ExpireValue<Mutex<LruCache<String, SecretBox<String>>>, FsError, DirEntryNameCacheProvider>,
ExpireValue<Mutex<LruCache<String, SecretString>>, FsError, DirEntryNameCacheProvider>,
dir_entries_meta_cache:
ExpireValue<Mutex<DirEntryMetaCache>, FsError, DirEntryMetaCacheProvider>,
sizes_write: Mutex<HashMap<u64, AtomicU64>>,
Expand Down Expand Up @@ -1976,9 +1976,9 @@ impl EncryptedFs {
pub async fn rename(
&self,
parent: u64,
name: &SecretBox<String>,
name: &SecretString,
new_parent: u64,
new_name: &SecretBox<String>,
new_name: &SecretString,
) -> FsResult<()> {
if self.read_only {
return Err(FsError::ReadOnly);
Expand Down Expand Up @@ -2115,8 +2115,8 @@ impl EncryptedFs {
/// Change the password of the filesystem used to access the encryption key.
pub async fn passwd(
data_dir: &Path,
old_password: SecretBox<String>,
new_password: SecretBox<String>,
old_password: SecretString,
new_password: SecretString,
cipher: Cipher,
) -> FsResult<()> {
check_structure(data_dir, false).await?;
Expand Down

0 comments on commit 92c67b2

Please sign in to comment.