Changes

Jump to: navigation, search

Identity/AttachedServices/KeyServerProtocol

18 bytes removed, 00:14, 28 June 2013
m
change header structure
NOTE: This specification is under active development (27-Jun-2013). Several pieces are not yet complete. If you write any code based on this design, keep a close eye on this page and/or contact me (warner) on the #picl IRC channel to learn about changes. Eventually this will be nailed down and should serve as a stable spec for the PICL keyserver/IdP protocol.
== Email+Password -> SignToken/ResetToken ==
The current stub just submits plaintext email+password and receives back (signToken, kA, wrap(kB)). It uses no key-stretching, nor SRP.
The protocol is optimized to minimize round-trips and to enable parallelism. As a result, the two messages it sends (getToken1 and getToken2) each perform multiple jobs.
=== getToken1 ===
As soon as the user finishes typing in the email address, the client should send it in the "getToken1" message to the keyserver. The response will include a set of parameters that are needed for key-stretching (described below), and the common parameters used by both sides of the SRP protocol to follow. These are simply looked up in a database entry for the client, along with an account-id. It must also include an allocated session-id that is used to associate this request with the subsequent getToken2 request. Finally, the response also includes the server's contribution to the SRP protocol ("srpB"), which is calculated on the server based upon a random value that it remembers in the session.
=== Proof-Of-Work ===
To protect the server's session table memory and CPU usage for the initial SRP calculation, the server might require clients to perform busy-work before calling getToken1(). The server can control how much work is required.
TBD: Is this worth it? Should the PoW string go into an HTTP header? (I want it to be cheap to extract, and not clutter logs). Should the error response be a distinctive HTTP error code so our monitoring tools can easily count them? We can also use this feature to slow down online guessing attacks (i.e. trigger it either when getToken1 is called too much or when getToken2 produces too many errors). Since getToken1() includes an email address, we could also requires PoWs for some addresses (e.g. those we know to be under attack) but not others.
=== Client-Side Key Stretching ===
The current stub does no stretching. It just performs a single HKDF operation, combining the user's email address, their password, and a "stretchSalt" retrieved from the server's getToken1() response.
[[File:PICL-IdPAuth-main-KDF.png|masterKey KDF]]
=== Client-Side SRP Calculation ===
(TBD) This.. is kind of crazy so far. The picture is incomplete and needs more detail.
The server receives "A", computes the shared secret "S", computes M1, checks that the client's M1 is correct, then derives the shared session key K. It then allocates a token (of the requested type) and encrypts kA+wrap(kB)+token as described below, returning the encrypted/MACed bundle in the response to getToken2.
=== getToken2 ===
This method has two flavors, one for obtaining "signing tokens", the other for getting "reset tokens". TBD: either we'll have two different method names / API endpoints (getToken2Sign and getToken2Reset), or we'll pass an argument to a single "getToken2" method that indicates either "sign" or "reset". (using different endpoints would make it easier to monitor server load).
Future variants (e.g. to fetch a third kind of token) might put additional values in the response to getToken2.
=== Decrypting the getToken2 Response ===
The SRP session key ("srpK") is used to derive two other keys: respHMACkey and respXORkey.
Since the kA/wrap(kB)/signToken response is so similar to the kA/wrap(kB)/resetToken response, the same code can be used to check+decrypt both. However remember that the respXORkey/respHMACkey is derived differently for each (using different "context" values).
== Signing Certificates ==
The current stub just submits (cert, signToken), and gets back a signed certificate. This will be replaced soon.
[[File:PICL-IdPAuth-decryptResponse.png|Decrypting the Response]]
== Resetting the Account ==
The current stub just submits (newPassword, wrap(kB), resetToken). This will be replaced soon.
Confirm
471
edits

Navigation menu