mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-04 20:47:36 +03:00
fix: preshared key fingerprinter test
updated fingerprinter test to test with PreSharedKey extension
This commit is contained in:
parent
a72e17e699
commit
36c4f244a9
2 changed files with 4 additions and 5 deletions
|
@ -200,7 +200,8 @@ func (chs *ClientHelloSpec) ReadTLSExtensions(b []byte, keepPSK, allowBluntMimic
|
||||||
}
|
}
|
||||||
|
|
||||||
if extension == extensionPreSharedKey && !keepPSK {
|
if extension == extensionPreSharedKey && !keepPSK {
|
||||||
continue // skip PSK, this will result in fingerprint change!!!!
|
return fmt.Errorf("PSK extension is not allowed unless keepPSK is set")
|
||||||
|
// continue // skip PSK, this will result in fingerprint change!!!!
|
||||||
}
|
}
|
||||||
|
|
||||||
extWriter := ExtensionIDToExtension(extension)
|
extWriter := ExtensionIDToExtension(extension)
|
||||||
|
|
|
@ -514,10 +514,8 @@ func TestUTLSFingerprintClientHelloKeepPSK(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, ext := range generatedSpec.Extensions {
|
for _, ext := range generatedSpec.Extensions {
|
||||||
if genericExtension, ok := (ext).(*GenericExtension); ok {
|
if _, ok := (ext).(*PreSharedKeyExtension); ok {
|
||||||
if genericExtension.Id == extensionPreSharedKey {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
t.Errorf("generated ClientHelloSpec with KeepPSK does not include preshared key extension")
|
t.Errorf("generated ClientHelloSpec with KeepPSK does not include preshared key extension")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue