Skip to content

Commit

Permalink
improvement: cleanup (#253)
Browse files Browse the repository at this point in the history
u_common.go:
* Move if statement into existing switch case
* Remove comment about keepPSK

u_fingerprinter.go:
* Remove comment about KeepPSK
  • Loading branch information
VeNoMouS committed Oct 10, 2023
1 parent e89d82c commit 3546fd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 2 additions & 5 deletions u_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ func (chs *ClientHelloSpec) ReadCompressionMethods(compressionMethods []byte) er

// ReadTLSExtensions is a helper function to construct a list of TLS extensions from
// 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 {
extensions := cryptobyte.String(b)
for !extensions.Empty() {
Expand All @@ -233,12 +231,11 @@ func (chs *ClientHelloSpec) ReadTLSExtensions(b []byte, allowBluntMimicry bool,
} else {
extWriter = &FakePreSharedKeyExtension{}
}
}

if extension == extensionSupportedVersions {
case extensionSupportedVersions:
chs.TLSVersMin = 0
chs.TLSVersMax = 0
}

if _, err := extWriter.Write(extData); err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion u_fingerprinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package tls
type Fingerprinter struct {
// AllowBluntMimicry will ensure that unknown extensions are
// 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
// that are generated with this flag which could compromise security and/or mimicry
AllowBluntMimicry bool
Expand Down

0 comments on commit 3546fd9

Please sign in to comment.