133
edits
(→Control event processing: Update to TLS version, remove encryption) |
(→Authentication and Event Protocol: Update to TLS server protocol) |
||
| Line 87: | Line 87: | ||
# Data encryption/decryption is asynchronous but HTTP request need response immediately. For UUID and PIN code case, remote control uses a ticket number to get status after decryption. But for event, we reduce polling result but use latest event's result instead. | # Data encryption/decryption is asynchronous but HTTP request need response immediately. For UUID and PIN code case, remote control uses a ticket number to get status after decryption. But for event, we reduce polling result but use latest event's result instead. | ||
=== | === Authentication and Event Protocol === | ||
==== | ==== Request handshake ==== | ||
Request | Request | ||
{ | { | ||
action: ' | type: 'auth' | ||
action: 'request_handshake' | |||
id: <id assigned by server, optional> | |||
} | } | ||
Response | Response | ||
{ | { | ||
type: 'auth' | |||
action: 'response_handshake' | |||
detail: 1 or 2, 1 for 1st handshake, 2 for 2nd handshake | |||
} | } | ||
==== | ==== J-PAKE key exchange ==== | ||
Client send round 1 | |||
{ | { | ||
action: ' | type: 'auth' | ||
action: 'jpake_client_1', | |||
detail: { | |||
gx1: gx1.value, | |||
gx2: gx2.value, | |||
zpk_x1: { gr: gv1.value, b: r1.value, id: 'client' }, | |||
zpk_x2: { gr: gv2.value, b: r2.value, id: 'client' } | |||
} | |||
} | } | ||
Server reply round 1 | |||
{ | { | ||
type: 'auth' | |||
action: 'jpake_server_1', | |||
detail: { | |||
gx1: gx1.value, | |||
gx2: gx2.value, | |||
zpk_x1: { gr: gv1.value, b: r1.value, id: 'server' }, | |||
zpk_x2: { gr: gv2.value, b: r2.value, id: 'server' } | |||
} | |||
} | } | ||
Client send round 2 | |||
{ | { | ||
type: 'auth' | |||
action: 'jpake_client_2', | |||
detail: { | |||
A: A.value, | |||
zkp_A: { gr: gvA.value, b: rA.value, id: 'client' } | |||
} | |||
} | } | ||
Server reply round 2 | |||
{ | { | ||
action: ' | type: 'auth' | ||
action: 'jpake_server_2', | |||
detail: { | |||
A: A.value, | |||
zkp_A: { gr: gvA.value, b: rA.value, id: 'server' } | |||
} | |||
} | } | ||
==== | ==== Key confirmation ==== | ||
Server key confirmation | |||
{ | { | ||
action: ' | type: 'auth' | ||
action: 'server_key_confirm' | |||
detail: { | |||
signature: <double signature of AES key by HMAC key, in base64> | |||
} | |||
} | } | ||
Client key confirmation | |||
{ | { | ||
type: 'auth' | |||
action: 'client_key_confirmation' | |||
detail: { | |||
signature: <signature of AES key by HMAC key, in base64> | |||
} | |||
} | } | ||
Server finish handshake | |||
{ | { | ||
type: 'auth' | |||
action: 'finish_handshake' | |||
detail: { | |||
id: <id assigned by server, optional> | |||
} | |||
} | } | ||
==== Touch Events ==== | ==== Touch Events ==== | ||
{ | { | ||
type: 'touchstart', | type: 'command' | ||
action: 'touchstart', | |||
detail: { | detail: { | ||
width: <touch panel width, integer, in pixels>, | width: <touch panel width, integer, in pixels>, | ||
| Line 182: | Line 183: | ||
{ | { | ||
type: 'touchmove', | type: 'command' | ||
action: 'touchmove', | |||
detail: { | detail: { | ||
dx: <dx between current point and starting point, integer, in pixels>, | dx: <dx between current point and starting point, integer, in pixels>, | ||
| Line 192: | Line 194: | ||
{ | { | ||
type: 'touchend', | type: 'command' | ||
action: 'touchend', | |||
detail: { | detail: { | ||
dx: <same as "touchmove">, | dx: <same as "touchmove">, | ||
| Line 209: | Line 212: | ||
{ | { | ||
type: 'keypress', | type: 'command' | ||
action: 'keypress', | |||
detail: <KeyEvent constant, string, sush as "DOM_VK_RETURN"> | detail: <KeyEvent constant, string, sush as "DOM_VK_RETURN"> | ||
} | } | ||
| Line 216: | Line 220: | ||
{ | { | ||
type: 'textinput', | type: 'command' | ||
action: 'textinput', | |||
detail: { | detail: { | ||
clear: <whether to clear the entire string in the current focused input field, boolean>, | clear: <whether to clear the entire string in the current focused input field, boolean>, | ||
| Line 227: | Line 232: | ||
{ | { | ||
type: 'custom', | type: 'command' | ||
action: 'custom', | |||
detail: { | detail: { | ||
action: <custom action name, string>, | action: <custom action name, string>, | ||
edits