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

New Groups support #42

Merged
merged 55 commits into from
Sep 6, 2023
Merged

New Groups support #42

merged 55 commits into from
Sep 6, 2023

Commits on Aug 22, 2023

  1. Group metadata; signed & read-only configs support

    Adds a group info config type, which tracks distributed info for v2
    groups.
    
    This requires introducing/using a few new concepts not currently used
    for user config messages:
    
    - Multiple decryption keys.  User config doesn't do this at all (rather
      it generates a single decryption key from the private key for each
      namespace).
    
    This doesn't yet add support for sharing and distributing those keys,
    just for having being able to load a config with a list of multiple
    possible keys.
    
    - Config signing and verification.  For user configs this isn't
      done, since only the owner can actually encrypt/decrypt a config
      message, just being able to decrypt it is authentication enough.
    
    This required various modifications to make the config library properly
    prevent modifications when we can't modify, and to properly follow
    that through in terms of merging, updates, etc.
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    5d10667 View commit details
    Browse the repository at this point in the history
  2. Add multi-key encryption tests

    Fixes a bug where construction-provided keys were loaded in reversed
    priority.
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    80f4d14 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    83c9dec View commit details
    Browse the repository at this point in the history
  4. Add group info fields test

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    12d601b View commit details
    Browse the repository at this point in the history
  5. Add group members config

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    6f19646 View commit details
    Browse the repository at this point in the history
  6. Fix bad doc name

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    8f142c0 View commit details
    Browse the repository at this point in the history
  7. More API doc fixes

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    bf3df15 View commit details
    Browse the repository at this point in the history
  8. Group encryption keys

    Tests to follow.
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    7e3001d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fdc664e View commit details
    Browse the repository at this point in the history
  10. Fix broken assert

    The first part of this assert shouldn't fail if we are starting from a
    fresh, blank config (in which case we don't actually serialize our own
    message anymore).
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    6e3cbf8 View commit details
    Browse the repository at this point in the history
  11. Remove signature_optional parameter

    It doesn't really make sense to have this as we either want signatures
    (for shared messages) or don't (for personally encrypted messages).  The
    only place we were passing it as `true` was in a place that also didn't
    pass a verifier or signer (during dumping), and so already wasn't
    adding/checking signatures.
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    0fcc07c View commit details
    Browse the repository at this point in the history
  12. Move all key management into Keys; make Keys dumpable

    This makes Keys construction, loading, and rekeying take the Info and
    Members object to update their keys, thus removing the requirement for
    application code to worry about key management at all (they just feed
    the keys in, and they propagate to info/members).
    
    Also adds a state dump (similar to base config `dump()`) to Keys.
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    c6fd471 View commit details
    Browse the repository at this point in the history
  13. Doc CI fix

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    dddc5b3 View commit details
    Browse the repository at this point in the history
  14. Doc fixes

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    f929e79 View commit details
    Browse the repository at this point in the history
  15. Add dedicated namespace for messages; rearrange config namespace values

    Messages to a new group can't go into 0 (since that is publicly
    depositable), so reserve a namespace (11) for messages.
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    cb40a14 View commit details
    Browse the repository at this point in the history
  16. Add group message encryption + compression

    Adds method for encrypting/decrypting a message.
    
    This supports both compressed+encrypted and just plain encrypted.
    
    Abstracts the zstd compression implementation from base.cpp into
    internal.cpp, and uses it inside the new group message encryption
    
    Compression is only used if beneficial (that is, only if compression
    actually reduces the message size).
    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    60cbeca View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    286243c View commit details
    Browse the repository at this point in the history
  18. groups::Info C API

    jagerman committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    95aeea6 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2023

  1. Add Group Members C wrappers

    jagerman committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    a2dc2e9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c454e35 View commit details
    Browse the repository at this point in the history
  3. C wrapper API for group keys

    jagerman committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    ae2f1ba View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2023

  1. Configuration menu
    Copy the full SHA
    a44567e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9953645 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3b902f View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2023

  1. Fix broken x25519 extraction

    jagerman committed Aug 25, 2023
    Configuration menu
    Copy the full SHA
    4551257 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8d9ce6e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    744b25e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3c5f74b View commit details
    Browse the repository at this point in the history
  5. fix admin key loading

    jagerman committed Aug 25, 2023
    Configuration menu
    Copy the full SHA
    e83f479 View commit details
    Browse the repository at this point in the history
  6. off by 2 error (Jason)

    dr7ana authored and jagerman committed Aug 25, 2023
    Configuration menu
    Copy the full SHA
    cb89c0f View commit details
    Browse the repository at this point in the history
  7. Config keys unit tests

    - new group keys unit tests runs through relevant functionalities
    - add/remove users, change group info, add admin, verify encryption compression
    dr7ana authored and jagerman committed Aug 25, 2023
    Configuration menu
    Copy the full SHA
    b4cf7e2 View commit details
    Browse the repository at this point in the history
  8. review

    dr7ana authored and jagerman committed Aug 25, 2023
    Configuration menu
    Copy the full SHA
    9f447b6 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    d121864 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c431f12 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2023

  1. Configuration menu
    Copy the full SHA
    8837103 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. Updates for user groups -> groups

    - add test
    - add missing `erase_group` to erase by id
    - fix bug where `K` wasn't set for non-admins (it should be set but
      empty in such a case so that we always have a key).
    - make `check_session_id` take a string view prefix instead of a char to
      make it a little easier, and to include it in the error message.
    jagerman committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    517a61a View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2023

  1. Remove temporary testKeys binary

    It was temporary for simpler keys testing.
    jagerman committed Aug 29, 2023
    Configuration menu
    Copy the full SHA
    390faa8 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. Swarm subaccount authentication

    This adds methods to `Keys` that generates subaccount tokens and
    signatures as needed to do storage server subaccount authentication
    (which currently requires testnet as the subaccount code is not yet
    active on mainnet), along with test code to test it.
    
    Also adds a tests/swarm-auth-test binary that spits out storage requests
    for store/retrieve testing.
    jagerman committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    8cb26be View commit details
    Browse the repository at this point in the history
  2. Don't build swarm-auth-test by default

    It adds a nlohmann::json dependency, and isn't really part of the normal
    test suite.
    jagerman committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    18d3df2 View commit details
    Browse the repository at this point in the history
  3. Format fix

    jagerman committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    224dda9 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. C API updates, and related tweaks

    - Adds C wrappers for all the swarm authentication methods
    - Adds C wrapper for querying if the keys object has admin permission
    - Adds C wrapper for key_supplement to generate supplemental key messages
    
    - Changes the swarm `subaccount` value to be base64 instead of hex
      (since it isn't really a pubkey)
    - Makes the vector passed into key_supplement const&
    jagerman committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    9b0cdcd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e30122b View commit details
    Browse the repository at this point in the history
  3. Keys.size(); updates to Keys C API

    - Add keys.size() return the number of keys in the object.
    - Add C API for retrieving keys & key size
    - Fix copy-and-paste error in groups_members_size C API name
    jagerman committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    2ad96d5 View commit details
    Browse the repository at this point in the history
  4. Fix doc typos/mistakes

    jagerman committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    8a9d8ac View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    24ed158 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4d0c6e4 View commit details
    Browse the repository at this point in the history
  7. Fix propagation of secret key values

    Also adds tests to verify that auth_data and secretkey data propagate as
    expected.
    
    Many thanks to Harris for identifying and tracking this down.
    jagerman committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    3ed91d5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5854c4f View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2023

  1. Configuration menu
    Copy the full SHA
    194f972 View commit details
    Browse the repository at this point in the history
  2. formatter

    dr7ana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    364f8d3 View commit details
    Browse the repository at this point in the history
  3. C method to return groups keys

    - Added config_groups_keys to config/base.h
    - Looped in test call into config user groups C api unit test
    dr7ana committed Sep 1, 2023
    Configuration menu
    Copy the full SHA
    8ed090e View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2023

  1. Add current hash tracking

    Adds current hash tracking to groups::Keys; this adds a `current_hashes`
    method to group::Keys that works similarly to the base config
    current_hashes (though returns a set instead of vector).
    
    (The C version is `groups_keys_current_hashes`)
    
    Testing this also triggered a bug in that we weren't probably re-loading
    the verified-signature state on a dump->load cycle, which caused an
    assertion failure on merge (because the current state couldn't be
    successfully serialized-then-deserialized), also fixed here.
    
    Also renames the recently added C config_group_keys to config_get_keys
    to better reflect its purpose.
    jagerman committed Sep 2, 2023
    Configuration menu
    Copy the full SHA
    bb7a2cf View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2023

  1. Configuration menu
    Copy the full SHA
    c272e06 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2023

  1. Add invited and name to groups; add kicked methods

    This adds an `.invited` flag for all group types (legacy, new, and
    communities) that can be used to track a invited-but-not-yet-joined room
    by session clients.
    
    Also adds `.name` to new groups data so that the name from an invitation
    can be stored before accepting (after accepting the name will come from
    the shared group config message).
    
    Add `setKicked()` and `kicked()` methods which clear both auth_data and
    secretkey and report whether both are empty, respectively.  (For the C
    API these are `ugroups_group_set_kicked` and `ugroups_group_is_kicked`
    and take a pointer to the `ugroups_group_info`).
    jagerman committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    2adb20c View commit details
    Browse the repository at this point in the history
  2. Fix info/members key lists when loading from dump

    The key lists weren't being set properly when loading a Keys object from
    a dump; these sets the key lists properly.
    jagerman committed Sep 6, 2023
    Configuration menu
    Copy the full SHA
    f61bc4a View commit details
    Browse the repository at this point in the history