Welcome to basically how every distributed TRANSACTION PROTOCOL works, even things like PAXOS and RAFT and MULTI-PHASE COMMIT use waiting and polling sometimes. What they don't assume is that ... AT ANY MOMENT A MISCREANT ON THE NETWORK MIGHT JUST RESEND THE ORIGINAL MESSAGE.
-
Show this thread
-
That would be CRAZY, because they USE TLS, and the S in TLS stands for "SECURITY" and that includes things like "THOU SHALT NOT MAKE MESSAGES REPLAYABLE".
1 reply 2 retweets 22 likesShow this thread -
Now the TLS1.3 people are still like BUT WE WANT SPEED, SO JUST DEAL WITH IT. And the distributed systems people are like IDEMPOTENCY IS REALLY HARD, WE MEAN IT. But wait, it turns out that we can actually get anti-replay and forward secrecy back, and keep 0-RTT, how ....
1 reply 0 retweets 27 likesShow this thread -
The answer is for the server not to use key-in-a-key BS. Instead if the server just remembers the key, let's a client use it ONCE, and deletes it when it's done ... we get FORWARD SECRECY and ANTI-REPLAY. REJOICE!!!
2 replies 0 retweets 27 likesShow this thread -
Replying to @colmmacc
Can you expand on this point? Which key is only used once, and how do you get 0rtt on future requests if the key is deleted? Got a good article that dives into this?
1 reply 0 retweets 1 like -
Replying to @jboeshart
Sure thing. So every TLS connection also mints a nice shiny resumption key, and there's an early data key. These can be used by the client to resume new connections, and encrypt 0-RTT data, respectively. Cont ...
1 reply 0 retweets 1 like -
Replying to @colmmacc @jboeshart
Rather than remembering these keys, it's common for TLS servers to envelope encrypt these keys with a Session Ticket Encryption Key (STEK) and then give it all to the client as an encrypted ticket. The client does most of the remembering, the server only remembers the STEK.
1 reply 0 retweets 1 like -
Replying to @colmmacc @jboeshart
This works, but isn't forward secret, anyone with the STEK can resume a session or decrypt or forge early data. We can fix this in TLS1.3 by having the server store the resumption and early data keys, and delete them as they are used. Also gives anti-replay.
1 reply 0 retweets 1 like -
Replying to @colmmacc @jboeshart
The cost is that the server has to spend the memory to store and retrieve the keys. But it's the only way we've found to do anti-replay and forward secrecy.
1 reply 0 retweets 1 like -
Replying to @colmmacc
Thanks, is there an expiry for resumption keys that aren’t used? Like, after 1 hr you have to fully reestablish a session. Also, once a resumption key is used, is a new one generated and sent to client for next use?
1 reply 0 retweets 0 likes
Yep, it has a TTL, but it's more like a week than an hour. And yep, when you use an RPSK, you get a new one you can re-use. Actually you can even get more than one, and keep a stash, and they are each distinct.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Replying to @colmmacc @jboeshart
This provides the snapshot of what we can expect in the rfc. Thanks a lot for your effort.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.