mirror of
https://github.com/XTLS/REALITY.git
synced 2025-08-24 23:48:36 +00:00
crypto/internal/hpke: rename Receipient to Recipient
receipient -> recipient Change-Id: I9ed5937acf0f3808283e35221f8b4f41408eee7c GitHub-Last-Rev: 0ed5ff7 GitHub-Pull-Request: #73131 Reviewed-on: https://go-review.googlesource.com/c/go/+/662175 Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Jorropo <jorropo.pgm@gmail.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Jorropo <jorropo.pgm@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
This commit is contained in:
parent
cfe61417e9
commit
c3f6b7dc5f
4
ech.go
4
ech.go
@ -389,7 +389,7 @@ func decodeInnerClientHello(outer *clientHelloMsg, encoded []byte) (*clientHello
|
|||||||
return inner, nil
|
return inner, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func decryptECHPayload(context *hpke.Receipient, hello, payload []byte) ([]byte, error) {
|
func decryptECHPayload(context *hpke.Recipient, hello, payload []byte) ([]byte, error) {
|
||||||
outerAAD := bytes.Replace(hello[4:], payload, make([]byte, len(payload)), 1)
|
outerAAD := bytes.Replace(hello[4:], payload, make([]byte, len(payload)), 1)
|
||||||
return context.Open(outerAAD, payload)
|
return context.Open(outerAAD, payload)
|
||||||
}
|
}
|
||||||
@ -577,7 +577,7 @@ func (c *Conn) processECHClientHello(outer *clientHelloMsg) (*clientHelloMsg, *e
|
|||||||
return nil, nil, fmt.Errorf("tls: invalid EncryptedClientHelloKeys PrivateKey: %s", err)
|
return nil, nil, fmt.Errorf("tls: invalid EncryptedClientHelloKeys PrivateKey: %s", err)
|
||||||
}
|
}
|
||||||
info := append([]byte("tls ech\x00"), echKey.Config...)
|
info := append([]byte("tls ech\x00"), echKey.Config...)
|
||||||
hpkeContext, err := hpke.SetupReceipient(hpke.DHKEM_X25519_HKDF_SHA256, echCiphersuite.KDFID, echCiphersuite.AEADID, echPriv, info, encap)
|
hpkeContext, err := hpke.SetupRecipient(hpke.DHKEM_X25519_HKDF_SHA256, echCiphersuite.KDFID, echCiphersuite.AEADID, echPriv, info, encap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// attempt next trial decryption
|
// attempt next trial decryption
|
||||||
continue
|
continue
|
||||||
|
@ -35,7 +35,7 @@ import (
|
|||||||
const maxClientPSKIdentities = 5
|
const maxClientPSKIdentities = 5
|
||||||
|
|
||||||
type echServerContext struct {
|
type echServerContext struct {
|
||||||
hpkeContext *hpke.Receipient
|
hpkeContext *hpke.Recipient
|
||||||
configID uint8
|
configID uint8
|
||||||
ciphersuite echCipher
|
ciphersuite echCipher
|
||||||
transcript hash.Hash
|
transcript hash.Hash
|
||||||
|
Loading…
Reference in New Issue
Block a user