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

[PM-13420] Support case-insensitive TOTP generation #1144

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

dani-garcia
Copy link
Member

@dani-garcia dani-garcia commented Oct 17, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-13420

📔 Objective

Update TOTP parsing to be case insensitive by lowercasing the input initially. decode_b32 is already converting the input to uppercase so secret decoding will still work the same.

I've also removed the to_uppercase from algorithm now that we know the string is lowercase.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link
Contributor

github-actions bot commented Oct 17, 2024

Logo
Checkmarx One – Scan Summary & Details20f30931-6fb1-4f59-ae1c-0d599a3595ec

Fixed Issues

Severity Issue Source File / Package
MEDIUM Missing_HSTS_Header /languages/php/example.php: 3
MEDIUM Parameter_Tampering /languages/kotlin/app/src/main/java/com/bitwarden/myapplication/MainActivity.kt: 384
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java: 43
MEDIUM Privacy_Violation /languages/java/example/Example.java: 46
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java: 43
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java: 43
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java: 43
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/BitwardenClient.java: 43
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java: 41
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java: 41
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java: 138
MEDIUM Privacy_Violation /languages/java/example/Example.java: 43
MEDIUM Privacy_Violation /languages/java/src/main/java/com/bitwarden/sdk/SecretsClient.java: 20
MEDIUM Privacy_Violation /languages/java/example/Example.java: 53
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 159
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 129
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 115
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 159
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 115
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 151
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 129
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 159
LOW Privacy_Violation /languages/cpp/src/Secrets.cpp: 56
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 151
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 129
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 159
LOW Privacy_Violation /languages/cpp/src/Secrets.cpp: 139
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 122
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 115
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 151
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 129
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 159
LOW Privacy_Violation /languages/cpp/src/Secrets.cpp: 107
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 159
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 136
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 122
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 151
LOW Privacy_Violation /languages/cpp/src/BitwardenClient.cpp: 129

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 96.96970% with 1 line in your changes missing coverage. Please review.

Project coverage is 58.30%. Comparing base (8aea2e9) to head (0ddf765).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-vault/src/totp.rs 96.96% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1144      +/-   ##
==========================================
+ Coverage   58.17%   58.30%   +0.12%     
==========================================
  Files         197      197              
  Lines       13587    13614      +27     
==========================================
+ Hits         7904     7937      +33     
+ Misses       5683     5677       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hinton Hinton changed the title Support case-insensitive TOTP generation [PM-13420] Support case-insensitive TOTP generation Oct 17, 2024
@dani-garcia dani-garcia merged commit be75311 into main Oct 21, 2024
100 of 101 checks passed
@dani-garcia dani-garcia deleted the pm/totp-ignore-case branch October 21, 2024 15:37
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.

2 participants