-
Notifications
You must be signed in to change notification settings - Fork 256
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
feature: extensionPreSharedKey support #107
Comments
Seemingly our upstream Since all changes up to Go 1.21.0 has been integrated into uTLS, it should be possible to implement support for |
We would welcome report for any use-cases for how to (programmatically) use a Currently, we still don't fully understand how |
|
So yesterday I spent some time on |
#231 adds support for PSK. |
Hi @gaukas,
Why doesn't it set the internal states? Is this a non-goal or just not being a high priority? |
If real PSK is needed, for now the only way to support it is via And For a
Of course! Any PR addressing bugs and pending features are greatly appreciated. Btw while you are here, @3andne, you know more about TLS than I do so I'd rather just confirm this with you: Is the current |
If
Then we would consider removing the current |
I might add some details tomorrow, but in short:
Exactly. Real PSK based session resumption requires the access to Lines 415 to 437 in 8199306
I see. The naming doesn't really matter. It's possible to have a real PSK extension.
I'd say a censor is not likely to distinguish between real or fake PSK exts. There are 3 elements in the PSK extension: labels (tickets), obfsAge and binders. Binders are generated by session secret and hash function. If you don't have the secret they are just random bytes. obfsAge is age + salt, and the salt is sent from the server in encrypted records. Tickets are sent from the server in encrypted records as well. Theoretically no one will know the plain text and therefore they should be unpredictable. |
Right. In the PR I mentioned above we are already providing
Okay, that makes sense. I may push another commit to my PR tomorrow at some point to replace the type FakePreSharedKeyExtension struct {
CipherSuite uint16 `json:"cipher_suite"` // this is used to compute the binder
SessionSecret []byte `json:"session_secret"` // this is used to compute the binder
Identities []PskIdentity `json:"identities"`
} With type HardcodedPreSharedKeyExtension struct {
Identities []PskIdentity `json:"identities"`
Binders [][]byte `json:"binders"`
} to further reduce the ambiguity. Thanks for confirming @3andne! See u_pre_shared_key.go for the implementations of all 3 (will be 2 after I push the change) implementations of our new |
The |
Btw can you share you plan for the next steps? I may start working on a PR later today based off your implementation of |
Interesting observation. Will a censor be able to know which cipher suite does a PSK Identity associate with? If not possibly we could just check for "any valid length of binder".
I can't think of any major updates in addition to the pending ones (kyberX and PSK). So once these two PRs merge, I will be less proactive in adding features to uTLS for a while. With that said my focus in the near future will be on fixing bugs. |
I will tag a new version once the discussed changes are implemented later today. Then it should be safe to base any PRs off it. |
New version tagged as v1.5.0-beta.3. It is safe to base any of your changes on this tag: we will rebase & merge the pull request #231. We had a bug regarding Bug will be discussed here: #233 (comment) |
Quote from rfc8446
Technically, yes. A censor has that ability if they capture all previous server hello records. But they probably aren't able to tell from a single client hello, if we use the 256-bit safe bet. |
Then we do not need to worry too much about it! Plus there are also external PSK available. For now let's just check if the binder is set to a valid length: Lines 302 to 312 in 3d7eea3
|
Fixed the bug in the latest commit (v1.5.0-beta.4). Finally eliminating the existence of |
Hey,
is there a way in Utls to add PSK/pre_shared_key/extensionPreSharedKey,
all i can find in utls is that somewhere you guys say: TODO: wait for someone who cares about PSK to implement
Thanks.
The text was updated successfully, but these errors were encountered: