Implement the mechanics of fxa login on android, but don't show ui fo… (#1000)
* Implement the mechanics of fxa login on android, but don't show ui for it yet. Also, scopedKeys are not yet implemented. * Hopefully fix the package-lock conflict? * WIP on android scoped keys * Finish implementing login. * created android/user.js to handle android logins
This commit is contained in:
parent
ffac4ae5b1
commit
cab6f1bafb
17 changed files with 592 additions and 304 deletions
12
app/fxa.js
12
app/fxa.js
|
@ -146,12 +146,10 @@ export async function preparePkce(storage) {
|
|||
return arrayToB64(new Uint8Array(challenge));
|
||||
}
|
||||
|
||||
export async function getFileListKey(storage, bundle) {
|
||||
const jwks = await decryptBundle(storage, bundle);
|
||||
const jwk = jwks['https://identity.mozilla.com/apps/send'];
|
||||
export async function deriveFileListKey(ikm) {
|
||||
const baseKey = await crypto.subtle.importKey(
|
||||
'raw',
|
||||
b64ToArray(jwk.k),
|
||||
b64ToArray(ikm),
|
||||
{ name: 'HKDF' },
|
||||
false,
|
||||
['deriveKey']
|
||||
|
@ -174,3 +172,9 @@ export async function getFileListKey(storage, bundle) {
|
|||
const rawFileListKey = await crypto.subtle.exportKey('raw', fileListKey);
|
||||
return arrayToB64(new Uint8Array(rawFileListKey));
|
||||
}
|
||||
|
||||
export async function getFileListKey(storage, bundle) {
|
||||
const jwks = await decryptBundle(storage, bundle);
|
||||
const jwk = jwks['https://identity.mozilla.com/apps/send'];
|
||||
return deriveFileListKey(jwk.k);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue