Skip to content

Conversation

@robertmercea
Copy link
Collaborator

@robertmercea robertmercea commented Feb 22, 2025

Description

Fixes #208

  • added 2 functions inside EncryptedFs::create:
    • get_random_number - generates a random number between from and to
    • get_random_secret_filename - generates a random-length random encrypted file name asynchronously
  • created fake folders (with fake files inside of them) and fake files, using the 2 functions mentioned above, in EncryptedFs::create
  • added EncryptedFs::is_real_file_name method which returns true if an encrypted file is real, false otherwise
    • works by decrypting the filename and checking if the first character is 0
  • filtered the iter object using the aforementioned function in EncryptedFs::read_dir and EncryptedFs::read_dir_plus
  • filter and map entries in EncryptedFs::create_directory_entry_plus_iterator and EncryptedFs::create_directory_entry_iterator, depending if they are real files or not
  • add flavor = "multi_thread" to tokio::test

Problems

  • errors E0728, E0308 and E0277 inside iter.filter (in both read_dir functions)
    • I cannot seem to call the async is_real_file_name function
    • I also cannot get the right type for the argument
  • on the line with the last File::create inside EncryptedFs::create I get a type unknown/type annotation needed error when calling it as File::create(contents_dir.join(fake_file_name.into()));. If I remove .into(), I get an error E0521 on the entire EncryptedFs::create function call. I do not know how to fix either of them

Todo:

  • Fix the above errors (assistance needed)
  • Remove accidental duplication of the line let iter = fs::read_dir(ls_dir)?; in EncryptedFs::read_dir

Signed-off-by: robertmercea <robertmercea@gmail.com>
@robertmercea robertmercea self-assigned this Feb 22, 2025
@robertmercea robertmercea added bug Something isn't working help wanted Extra attention is needed security rust Pull requests that update Rust code and removed bug Something isn't working labels Feb 22, 2025
@robertmercea robertmercea marked this pull request as ready for review March 1, 2025 17:24
@robertmercea robertmercea requested a review from radumarias as a code owner March 1, 2025 17:24
@robertmercea robertmercea removed the help wanted Extra attention is needed label Mar 10, 2025
@radumarias radumarias changed the base branch from main to cdl-spring-2025-2 May 16, 2025 16:33
@radumarias radumarias merged commit c769d4e into xoriors:cdl-spring-2025-2 May 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cdl] Hide folder structure

3 participants