(
input_: (typeof finishProcedureStep1)['_def']['_output_out'],
)
| 30 | } |
| 31 | |
| 32 | async function step2( |
| 33 | input_: (typeof finishProcedureStep1)['_def']['_output_out'], |
| 34 | ): Promise<(typeof finishProcedureStep2)['_def']['_input_in']> { |
| 35 | const newDerivedUserValues = await deriveUserValues({ |
| 36 | email: input.newEmail, |
| 37 | password: input.password, |
| 38 | }); |
| 39 | |
| 40 | const newEncryptedPrivateKeyring = createPrivateKeyring( |
| 41 | input_.encryptedPrivateKeyring, |
| 42 | ) |
| 43 | .unwrapSymmetric(input.oldDerivedUserValues.masterKey, { |
| 44 | associatedData: { |
| 45 | context: 'UserPrivateKeyring', |
| 46 | userId: authStore().userId, |
| 47 | }, |
| 48 | }) |
| 49 | .wrapSymmetric(newDerivedUserValues.masterKey, { |
| 50 | associatedData: { |
| 51 | context: 'UserPrivateKeyring', |
| 52 | userId: authStore().userId, |
| 53 | }, |
| 54 | }).wrappedValue; |
| 55 | const newEncryptedSymmetricKeyring = createSymmetricKeyring( |
| 56 | input_.encryptedSymmetricKeyring, |
| 57 | ) |
| 58 | .unwrapSymmetric(input.oldDerivedUserValues.masterKey, { |
| 59 | associatedData: { |
| 60 | context: 'UserSymmetricKeyring', |
| 61 | userId: authStore().userId, |
| 62 | }, |
| 63 | }) |
| 64 | .wrapSymmetric(newDerivedUserValues.masterKey, { |
| 65 | associatedData: { |
| 66 | context: 'UserSymmetricKeyring', |
| 67 | userId: authStore().userId, |
| 68 | }, |
| 69 | }).wrappedValue; |
| 70 | |
| 71 | return { |
| 72 | newLoginHash: newDerivedUserValues.loginHash, |
| 73 | |
| 74 | newEncryptedSymmetricKeyring, |
| 75 | newEncryptedPrivateKeyring, |
| 76 | }; |
| 77 | } |
| 78 | |
| 79 | async function step3( |
| 80 | _input: (typeof finishProcedureStep2)['_def']['_output_out'], |
nothing calls this directly
no test coverage detected