Skip to content

Undefined framing for cipher upgrade #60

@jakubtrnka

Description

@jakubtrnka

Stratum uses Noise NX handshake to establish encrypted session between client and server.

after an initial roundtrip

-> e
<- e, ee, s, es, <certificate>

specification suggests to negotiate a different symmetric cipher.

Idea is that client suggests a list of alternatives ciphers, and server chooses one of them.

But since this is not a stratum-message, doesn't have a stratum header, it is impossible for the server to know how many bytes it should read and decrypt on the connection.
the only content according to the spec is ciphertext of SEQ0_32[u32].

There are two options:

  1. we define a frame for this message
  2. we remove this step entirely

Some ideas for a frame:
a. Use encrypted array length as a header: 1 + 16 B = 17 B, followed by an encrypted tuple of N u32 numbers (N x 4 B + 16)
b. Define a stratum message with a full sv2-header (extenstion type, message type, payload length...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions