mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-01 19:17:36 +03:00
improvement: cleanup (#253)
u_common.go: * Move if statement into existing switch case * Remove comment about keepPSK u_fingerprinter.go: * Remove comment about KeepPSK
This commit is contained in:
parent
e89d82cd69
commit
3546fd9286
2 changed files with 2 additions and 6 deletions
|
@ -208,8 +208,6 @@ func (chs *ClientHelloSpec) ReadCompressionMethods(compressionMethods []byte) er
|
||||||
|
|
||||||
// ReadTLSExtensions is a helper function to construct a list of TLS extensions from
|
// ReadTLSExtensions is a helper function to construct a list of TLS extensions from
|
||||||
// a byte slice into []TLSExtension.
|
// a byte slice into []TLSExtension.
|
||||||
//
|
|
||||||
// If keepPSK is not set, the PSK extension will cause an error.
|
|
||||||
func (chs *ClientHelloSpec) ReadTLSExtensions(b []byte, allowBluntMimicry bool, realPSK bool) error {
|
func (chs *ClientHelloSpec) ReadTLSExtensions(b []byte, allowBluntMimicry bool, realPSK bool) error {
|
||||||
extensions := cryptobyte.String(b)
|
extensions := cryptobyte.String(b)
|
||||||
for !extensions.Empty() {
|
for !extensions.Empty() {
|
||||||
|
@ -233,12 +231,11 @@ func (chs *ClientHelloSpec) ReadTLSExtensions(b []byte, allowBluntMimicry bool,
|
||||||
} else {
|
} else {
|
||||||
extWriter = &FakePreSharedKeyExtension{}
|
extWriter = &FakePreSharedKeyExtension{}
|
||||||
}
|
}
|
||||||
}
|
case extensionSupportedVersions:
|
||||||
|
|
||||||
if extension == extensionSupportedVersions {
|
|
||||||
chs.TLSVersMin = 0
|
chs.TLSVersMin = 0
|
||||||
chs.TLSVersMax = 0
|
chs.TLSVersMax = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := extWriter.Write(extData); err != nil {
|
if _, err := extWriter.Write(extData); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ package tls
|
||||||
type Fingerprinter struct {
|
type Fingerprinter struct {
|
||||||
// AllowBluntMimicry will ensure that unknown extensions are
|
// AllowBluntMimicry will ensure that unknown extensions are
|
||||||
// passed along into the resulting ClientHelloSpec as-is
|
// passed along into the resulting ClientHelloSpec as-is
|
||||||
// It will not ensure that the PSK is passed along, if you require that, use KeepPSK
|
|
||||||
// WARNING: there could be numerous subtle issues with ClientHelloSpecs
|
// WARNING: there could be numerous subtle issues with ClientHelloSpecs
|
||||||
// that are generated with this flag which could compromise security and/or mimicry
|
// that are generated with this flag which could compromise security and/or mimicry
|
||||||
AllowBluntMimicry bool
|
AllowBluntMimicry bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue