feat(protocol): negotiate display and native input
Verify Protocol / module (push) Successful in 1m17s
Verify Protocol / verify (push) Successful in 55s

This commit is contained in:
sechmachine
2026-08-10 23:07:04 +07:00
parent 346bf5fe4d
commit 408d4f9cc3
24 changed files with 707 additions and 60 deletions
+17 -2
View File
@@ -125,10 +125,12 @@ func evaluate(kind, input string) string {
}
return "valid"
case "tunnel":
if (parts["offered"] == "1" || parts["offered"] == "0" || parts["offered"] == "-1") && parts["feature"] == "control.v1" {
feature := parts["feature"]
registered := feature == "control.v1" || feature == "display.request.v1" || feature == "input.absolute.v1" || feature == "input.scroll.v1"
if (parts["offered"] == "1" || parts["offered"] == "0" || parts["offered"] == "-1") && registered {
return "valid"
}
if parts["feature"] != "control.v1" {
if !registered {
return "invalid:unsupported_feature"
}
return "invalid:unsupported_version"
@@ -226,6 +228,19 @@ func classifyGatewayInput(encoded string) string {
}
}
}
case 6:
if len(body) != 8 {
return "invalid:length"
}
x, y := uint16(body[0])<<8|uint16(body[1]), uint16(body[2])<<8|uint16(body[3])
width, height := uint16(body[4])<<8|uint16(body[5]), uint16(body[6])<<8|uint16(body[7])
if width == 0 || height == 0 || x >= width || y >= height {
return "invalid:field"
}
case 7:
if len(body) != 4 {
return "invalid:length"
}
default:
return "invalid:kind"
}