Skip to content
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

Fix password generation for shares, improve generator #5717

Merged
merged 6 commits into from
Jul 20, 2023

Conversation

claucambra
Copy link
Collaborator

@claucambra claucambra commented May 20, 2023

This fixes issues where the user cannot create a password for a share as the default generated password we send to the server upon enabling passwords is too weak to be accepted

This uses a combination of OpenSSL's HASH_bytes function to generate a random password. There is also a post-generation check to ensure the password has all types of characters that are required, in the edge case where this is not the case

Screenshot 2023-05-20 at 23 29 12

Closes #5711

@claucambra claucambra self-assigned this May 20, 2023
@claucambra claucambra changed the title Have better password generation for shares Fix password generation for shares, improve generator May 20, 2023
@codecov
Copy link

codecov bot commented May 20, 2023

Codecov Report

Merging #5717 (1ca836e) into master (759c2a2) will increase coverage by 0.24%.
The diff coverage is n/a.

❗ Current head 1ca836e differs from pull request most recent head 9df47cf. Consider uploading reports for the commit 9df47cf to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5717      +/-   ##
==========================================
+ Coverage   60.08%   60.33%   +0.24%     
==========================================
  Files         145      143       -2     
  Lines       18756    18518     -238     
==========================================
- Hits        11270    11172      -98     
+ Misses       7486     7346     -140     

see 38 files with indirect coverage changes

@claucambra claucambra force-pushed the bugfix/better-password-gen branch from 1ca836e to ddd9290 Compare May 20, 2023 16:48
@claucambra
Copy link
Collaborator Author

/backport to stable-3.9

@sushifrick
Copy link

Tested against 25.0.6 and 26.0.2 and works fine!

Fixes #5555

src/gui/filedetails/sharemodel.cpp Outdated Show resolved Hide resolved
src/gui/filedetails/sharemodel.cpp Outdated Show resolved Hide resolved
@claucambra claucambra requested a review from mgallien June 8, 2023 09:24
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 8, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 3 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@claucambra claucambra force-pushed the bugfix/better-password-gen branch from 47485ca to 5ff50b0 Compare July 20, 2023 15:22
@claucambra claucambra force-pushed the bugfix/better-password-gen branch from 5ff50b0 to 9df47cf Compare July 20, 2023 15:32
@claucambra claucambra merged commit c42cb28 into master Jul 20, 2023
@claucambra claucambra deleted the bugfix/better-password-gen branch July 20, 2023 15:51
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 3 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5717-9df47cf1ccc1395dff389d3dad7c5612aec853aa-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@AndyXheli
Copy link

@claucambra I just tired it on Windows 11 NC 3.9.1 to send a share via email or share via link and the password did not generate automatically

@mgallien mgallien added this to the 3.10.0 milestone Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: macOS client - cannot create password when sharing
6 participants