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

RawBearer API #4395

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

RawBearer API #4395

wants to merge 19 commits into from

Conversation

tdammers
Copy link

Description

This provides a socket-like API for Snockets (backed by sockets / named pipes, or simulated in IOSim), reading/writing directly to/from raw memory buffers.

This will be needed to securely send KES keys over a network connection or local pipe, because we need to ensure that key data is never stored on disk, nor on the GHC heap, from where it might be swapped to disk.

For context, see also:

Checklist

  • Branch
    • Commit sequence broadly makes sense
    • Commits have useful messages
    • The documentation has been properly updated
    • New tests are added if needed and existing tests are updated
    • Any changes affecting Consensus packages must have an entry in the appropriate changelog.d directory created using scriv. If in doubt, see the Consensus release process.
    • (n/a) If this branch changes Network and has any consequences for downstream repositories or end users, said changes must be documented in interface-CHANGELOG.md
    • If serialization changes, user-facing consequences (e.g. replay from genesis) are confirmed to be intentional.
  • Pull Request
    • Self-reviewed the diff
    • Useful pull request description at least containing the following information:
      • What does this PR change?
      • Why these changes were needed?
      • How does this affect downstream repositories and/or end-users?
      • Which ticket does this PR close (if any)? If it does, is it linked?
    • Reviewer requested

@tdammers tdammers requested a review from coot May 17, 2023 08:49
Copy link
Contributor

@coot coot left a comment

Choose a reason for hiding this comment

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

LGTM.

@coot
Copy link
Contributor

coot commented May 26, 2023

It can be merged once CI passes, we should merge it after #4571.

@bolt12 bolt12 mentioned this pull request May 26, 2023
9 tasks
@coot
Copy link
Contributor

coot commented Jun 23, 2023

There's a conflict in CHANGELOG.md; Could you squash / clean the branch a bit before merging?

Just clientAddr -> do
say $ "sender: binding to " ++ show clientAddr
bind snocket s clientAddr
say $ "sender: connecting to " ++ show serverAddr
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you provide a tracer instead of using say or Debug.Trace.traceM. By default the test should use nullTracer. This will make it clean when the test passes and easy to get debug information once it fails.

@coot
Copy link
Contributor

coot commented Oct 27, 2023

@tdammers do we still need this PR?

Lower-level send/receive API for Snockets, bypassing the normal Mux
protocol. We need this for KES secure forgetting, as we cannot store
secrets in intermediate data structures for serialization purposes; we
must copy data directly between secure memory and file descriptors.
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