Skip to content

[PM-23022] Re-sort bitwarden-crypto crate #344

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Jul 4, 2025

🎟️ Tracking

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

📔 Objective

Moves public-key (asymmetric) encryption, and symmetric encryption into dedicated folders. Low-level implementations are moved to "hazmat" sub-folders that are only available from super. Asymmetric encryption is split into a public key and private key file, similar to signingkey / verifying key in signing. The cose symmetric encryption logic is split out into a separate symmetric-encryption specific cose file.

Otherwise, this PR does not intend to rename or change implementations. A small change to key-wrap was necessary, so that the hazmat module does not need to be pub(crate).

Notably rsa is only partially moved and requires more refactors to be fully moved. This was used outside of the crate, and the necessary re-factors are out-of scope here.

⏰ 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 Jul 4, 2025

Logo
Checkmarx One – Scan Summary & Details23c34ea7-eb22-4f69-acdf-ce9243652036

Great job, no security vulnerabilities found in this Pull Request

@quexten quexten changed the title Re-sort bitwarden-crypto crate [PM-23022] Re-sort bitwarden-crypto crate Jul 4, 2025
Copy link

sonarqubecloud bot commented Jul 4, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 95.25140% with 17 lines in your changes missing coverage. Please review.

Project coverage is 72.12%. Comparing base (f2bc708) to head (e8f222a).

Files with missing lines Patch % Lines
.../bitwarden-crypto/src/symmetric_encryption/cose.rs 94.44% 10 Missing ⚠️
...warden-crypto/src/symmetric_encryption/key_wrap.rs 76.66% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #344      +/-   ##
==========================================
+ Coverage   71.89%   72.12%   +0.22%     
==========================================
  Files         240      244       +4     
  Lines       19622    19731     +109     
==========================================
+ Hits        14108    14230     +122     
+ Misses       5514     5501      -13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant