133
edits
(→Request handshake: Put id to detail) |
(→Architecture Designs: add disconnect and reconnection description) |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 22: | Line 22: | ||
# Peer authentication | # Peer authentication | ||
# Control event processing | # Control event processing | ||
Any error occurs will close connection between server and client, reconnection is required. Server side error will sends message back to client to let user know what happen on Fennec. | |||
=== Peer authentication === | === Peer authentication === | ||
| Line 33: | Line 35: | ||
# Client computes J-PAKE round 1 and sends the result to server. | # Client computes J-PAKE round 1 and sends the result to server. | ||
# Server generates PIN code and show on screen, computes J-PAKE round 1 and sends the result to client. | # Server generates PIN code and show on screen, computes J-PAKE round 1 and sends the result to client. | ||
# User enter PIN code, client computs J-PAKE round 2 with PIN code attached first 12 characters of server's TLS certificate fingerprint as weak secret. | # User enter PIN code, client computs J-PAKE round 2 with PIN code attached first 12 characters of server's TLS certificate fingerprint as weak secret. | ||
# Client sends round 2 result to server. | # Client sends round 2 result to server. | ||
# Server computes J-PAKE round 2 with PIN code attached first 12 characters of server's TLS certificate fingerprint as weak secret. | |||
# Server dismisses PIN code notification on screen, sends round 2 result to client. | # Server dismisses PIN code notification on screen, sends round 2 result to client. | ||
# Both client and server compute J-PAKE final round, gets AES and HMAC key. | # Both client and server compute J-PAKE final round, gets AES and HMAC key. | ||
| Line 54: | Line 56: | ||
# Client computes J-PAKE round 1 and sends the result to server. | # Client computes J-PAKE round 1 and sends the result to server. | ||
# Server computes J-PAKE round 1 and sends the result to client. | # Server computes J-PAKE round 1 and sends the result to client. | ||
# Client and server computes J-PAKE round 2 with previous AES key value attached first 12 characters of server's TLS certificate fingerprint as weak secret. | # Client and server computes J-PAKE round 2 with first 4 characters of previous AES key value attached first 12 characters of server's TLS certificate fingerprint as weak secret. | ||
# Client sends round 2 result to server. | # Client sends round 2 result to server. | ||
# Server sends round 2 result to client. | # Server sends round 2 result to client. | ||
| Line 76: | Line 78: | ||
# Client.sjs parses event and dispatch to Gecko or Gaia system app. | # Client.sjs parses event and dispatch to Gecko or Gaia system app. | ||
=== Data | === Data used in JPAKE authentication === | ||
==== Singer ID for JPAKE round 1 & 2: ==== | |||
* TV: server | |||
* Fennec addon: client | |||
==== Weak secret: ==== | |||
* TV: concatenate PIN and first 12 characters of TLS server cert SHA 256 fingerprint | |||
* Fennec addon: concatenate user input PIN and first 12 characters connected TLS server cert SHA 256 fingerprint | |||
==== HMAC Input for JAPKE final: ==== | |||
We use "AES_256_CBC-HMAC256", as aHkdfInfo, includes the full crypto spec, should be the same in both TV and fennec addon | |||
==== Key confirmation: ==== | |||
Double hash of AES key: | |||
# AES | ## TV converts AES key to array buffer | ||
# | ## Sign AES key array buffer, get signature 1 (array buffer) | ||
# | ## Sign signature 1, get signature 2 | ||
## Convert signature 2 to base 64, send to Fennec addon | |||
## Fennec addon do the same as TV from step 1 to 4 | |||
## Compare received base 64 string of self and TV's signature 2 | |||
Single hash of AES key: | |||
## Fennec addon converts AES key to array buffer | |||
## Sign AES key array buffer, get signature 1 (array buffer) | |||
## Convert signature 1 to base 64, send to TV | |||
## TV use HMAC key, received signature, AES key array buffer to verify if the signature is valid. | |||
=== Authentication and Event Protocol === | === Authentication and Event Protocol === | ||
| Line 112: | Line 131: | ||
gx1: gx1.value, | gx1: gx1.value, | ||
gx2: gx2.value, | gx2: gx2.value, | ||
zkp_x1: { gr: gv1.value, b: r1.value, id: 'client' }, | |||
zkp_x2: { gr: gv2.value, b: r2.value, id: 'client' } | |||
} | } | ||
} | } | ||
| Line 123: | Line 142: | ||
gx1: gx1.value, | gx1: gx1.value, | ||
gx2: gx2.value, | gx2: gx2.value, | ||
zkp_x1: { gr: gv1.value, b: r1.value, id: 'server' }, | |||
zkp_x2: { gr: gv2.value, b: r2.value, id: 'server' } | |||
} | } | ||
} | } | ||
| Line 231: | Line 250: | ||
} | } | ||
==== | ==== Server reply error ==== | ||
{ | { | ||
type: | type: common, or the event type sent from client | ||
error: <error message of exception or root cause> | |||
} | } | ||
edits