[PR #2893] [PM-4739] Implement checksum uri validation #3869

Closed
opened 2025-11-26 23:38:04 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2893

State: closed
Merged: Yes


Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

This change ensures that the encrypted string is the same as what was originally saved with the server through the use of a checksum.

Code changes

Related to:
https://github.com/bitwarden/clients/pull/6485
https://github.com/bitwarden/server/pull/3318

  • LoginUriApi.cs/LoginUriData.cs: Adds checksum to loginUri models for the api.
  • Cipher.cs: Bypass validation if Cipher doesn't have a key
  • Login.cs: Changed logic to only add valid uris
  • LoginUri.cs: Add a method to validate the uri
  • CipherService.cs: Add a checksum to domain LoginUri that will be used later for validation
  • CryptoService.cs: Add a method that returns a base64 hash.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/2893 **State:** closed **Merged:** Yes --- ## Type of change - [X] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> This change ensures that the encrypted string is the same as what was originally saved with the server through the use of a checksum. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> Related to: https://github.com/bitwarden/clients/pull/6485 https://github.com/bitwarden/server/pull/3318 * **LoginUriApi.cs/LoginUriData.cs:** Adds checksum to loginUri models for the api. * **Cipher.cs:** Bypass validation if Cipher doesn't have a key * **Login.cs:** Changed logic to only add valid uris * **LoginUri.cs:** Add a method to validate the uri * **CipherService.cs:** Add a checksum to domain LoginUri that will be used later for validation * **CryptoService.cs:** Add a method that returns a base64 hash. ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:38:04 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3869