Merged
Conversation
9382923 to
b6ad99f
Compare
b6ad99f to
ca95c3d
Compare
9b867d2 to
83bcbb1
Compare
richvdh
requested changes
Sep 27, 2024
Member
richvdh
left a comment
There was a problem hiding this comment.
looks like the right direction! A few suggestions for improvements.
src/utils/calculateKeyCheck.ts
Outdated
| // string of zeroes, for calculating the key check | ||
| const ZERO_STR = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; | ||
|
|
||
| /** Calculate the MAC for checking the key. |
Member
There was a problem hiding this comment.
Suggested change
| /** Calculate the MAC for checking the key. | |
| /** | |
| * Calculate the MAC for checking a secret storage key. | |
| * | |
| * See https://spec.matrix.org/v1.11/client-server-api/#msecret_storagev1aes-hmac-sha2, steps 3 and 4. |
- Move into `src/@types`
4 tasks
richvdh
approved these changes
Sep 30, 2024
Member
richvdh
left a comment
There was a problem hiding this comment.
#4431 (comment) seems to have got lost.
LGTM otherwise
github-merge-queue bot
pushed a commit
that referenced
this pull request
Oct 1, 2024
* Move `SecretEncryptedPayload` in `src/utils/@types` * Move `encryptAES` to a dedicated file. Moved in a utils folder. * Move `deriveKeys` to a dedicated file in order to share it * Move `decryptAES` to a dedicated file. Moved in a utils folder. * Move `calculateKeyCheck` to a dedicated file. Moved in a utils folder. * Remove AES functions in `aes.ts` and export new ones for backward compatibility * Update import to use new functions * Add `src/utils` entrypoint in `README.md` * - Rename `SecretEncryptedPayload` to `AESEncryptedSecretStoragePayload`. - Move into `src/@types` * Move `calculateKeyCheck` into `secret-storage.ts`. * Move `deriveKeys` into `src/utils/internal` folder. * - Rename `encryptAES` on `encryptAESSecretStorageItem` - Change named export by default export * - Rename `decryptAES` on `decryptAESSecretStorageItem` - Change named export by default export * Update documentation * Update `decryptAESSecretStorageItem` doc * Add lnk to spec for `calculateKeyCheck` * Fix downstream tests
182a802 to
25a34c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
public/exportedsymbols have accurate TSDoc documentation.Task element-hq/element-web#26922
The goal of the new
src/utilsfolder is to share utility functions without to have to import all the js-sdk content (ie:src/matrix.ts). See #4339Changes:
decryptAESandencryptAESare moved intosrc/utils.deriveKeysis used only bydecryptAESandencryptAES. Moved intosrc/to keep it internal.IEncryptedPayloadtoAESEncryptedSecretStoragePayload. Move it intosrc/@types/The PR can be reviewed by commit.