Skip to content

WPB-19575: Drop Cryptobox#4719

Merged
blackheaven merged 11 commits intodevelopfrom
gdifolco/WPB-19575_drop-cryptobox
Jan 21, 2026
Merged

WPB-19575: Drop Cryptobox#4719
blackheaven merged 11 commits intodevelopfrom
gdifolco/WPB-19575_drop-cryptobox

Conversation

@blackheaven
Copy link
Contributor

https://wearezeta.atlassian.net/browse/WPB-19575

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 15, 2025
@blackheaven blackheaven self-assigned this Aug 18, 2025
@blackheaven blackheaven force-pushed the gdifolco/WPB-19575_drop-cryptobox branch 2 times, most recently from e102880 to ed52c10 Compare January 7, 2026 17:30
@blackheaven blackheaven marked this pull request as ready for review January 7, 2026 17:30
@blackheaven blackheaven requested review from a team as code owners January 7, 2026 17:30
@blackheaven blackheaven force-pushed the gdifolco/WPB-19575_drop-cryptobox branch from a427565 to b6a7e7e Compare January 8, 2026 09:14
Comment on lines 109 to 124
-- = Format Specification
--
-- The input is expected to be a serialized CBOR Map adhering to the rules defined in __RFC 8949__.
--
-- The structure of the map is expected to be as follows:
--
-- * **Root Object**: CBOR Map (Major Type 5).
-- * **Key 0** (@Unsigned Int@): Protocol Version or Algorithm Identifier.
-- * **Key 1** (@Unsigned Int@): **The Prekey ID** (Target of extraction).
-- * **Key 2** (@Map@): The raw Public Key material (often a nested COSE-like structure).
--
-- = References
--
-- * <https://www.rfc-editor.org/rfc/rfc8949.html RFC 8949>: Concise Binary Object Representation (CBOR)
-- * <https://www.rfc-editor.org/rfc/rfc9052.html RFC 9052>: CBOR Object Signing and Encryption (COSE) - /Contextual/
--
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this comment, can we please write a type and parse things into it? Then the comment could just be a link to the spec.

This would also make the code much simpler because we're now parsing into a generic CBOR term.

Comment on lines 125 to 133
-- == Errors
--
-- This function returns a 'Left String' in the following cases:
--
-- 1. The input is not valid base64 data.
-- 2. The input is not valid CBOR data.
-- 3. The root object is not a Map.
-- 4. The key @1@ is missing from the Map.
-- 5. The value associated with key @1@ is not an integer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna go stale as soon as someone touches it. If we really want this, we should create an error type. Otherwise, I'm also ok with just deleting this part.

@akshaymankar akshaymankar changed the title WPD-19575: Drop Cryptobox WPB-19575: Drop Cryptobox Jan 8, 2026
@blackheaven blackheaven force-pushed the gdifolco/WPB-19575_drop-cryptobox branch from b6a7e7e to f00fc9f Compare January 8, 2026 16:19
@blackheaven blackheaven force-pushed the gdifolco/WPB-19575_drop-cryptobox branch from f6fd80a to 38aabc0 Compare January 8, 2026 18:58
Comment on lines 110 to 130
-- | Represents the EDHOC Prekey Bundle payload.
--
-- Structure based on X3DH Key Agreement Protocol patterns:
--
-- * **Root Object**: CBOR Map (Major Type 5).
-- * **Key 0** (@Unsigned Int@): Protocol Version or Algorithm Identifier.
-- Indicates the version of the handshake or algorithm suite being used (e.g., Curve25519 + AES-GCM).
-- * **Key 1** (@Unsigned Int@): **The Prekey ID** (Target of extraction).
-- The specific ID of the key being retrieved.
-- * **Key 2** (@Map@): **Identity Public Key**.
-- The long-term X25519 public key of the recipient (e.g., Map {0: Bytes(32)}).
-- * **Key 3** (@Map@): **Signed Prekey Public Key**.
-- A medium-term key (e.g., Map {0: {0: Bytes(32)}}).
-- * **Key 4** (@Null@): **One-Time Prekey**.
-- This field is Null if the server is out of one-time keys for this user.
--
-- = References
--
-- * <https://www.rfc-editor.org/rfc/rfc8949.html RFC 8949>: Concise Binary Object Representation (CBOR)
-- * <https://www.rfc-editor.org/rfc/rfc7748.html RFC 7748>: Elliptic Curves for Security (X25519)
-- * <https://www.rfc-editor.org/rfc/rfc9052.html RFC 9052>: CBOR Object Signing and Encryption (COSE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we're using COSE here. The Prekey decoder in the rust proteus library only has 3 things: https://github.com/wireapp/proteus/blob/b92dbc2d0c77105cae3911a7388acba05450a06d/src/internal/keys.rs#L204-L222

@blackheaven blackheaven force-pushed the gdifolco/WPB-19575_drop-cryptobox branch from ebd49b0 to cfe7667 Compare January 19, 2026 15:50
@blackheaven blackheaven merged commit 184071f into develop Jan 21, 2026
11 checks passed
@blackheaven blackheaven deleted the gdifolco/WPB-19575_drop-cryptobox branch January 21, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants