-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENG-1446: Verify enclave sig in export/import #31
Conversation
export/index.html
Outdated
/** | ||
* Function to verify enclave signature on import bundle received from the server. | ||
*/ | ||
const verifyEnclaveSignature = async (enclaveQuorumPublic, publicSignature, publicKey) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know if it's possible to use JS modules within an iFrame? I'm seeing a lot of duplicate code which will become harder to maintain. It'd be awesome if we could use a module system although it might not be possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep! the HpkeEncrypt and HpkeDecrypt code are actually already JS modules. at some point early on, i tried to DRY up the shared code across the 3 pages but it is a lot of refactoring. as some follow ups, i think we modularize:
- part 1: import/index.html and import/standalone.html
- part 2: import and export
- part 3: import/export and auth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No major concerns here! Small things below but otherwise: 🚀
@@ -12,7 +12,7 @@ jobs: | |||
runs-on: ubuntu-latest | |||
strategy: | |||
matrix: | |||
directory: ["auth", "export"] | |||
directory: ["auth", "export", "import"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woah. Good catch!
…pers and tests to import
be10770
to
86da7fb
Compare
…ns. convert arrow fns to declarative fns to avoid ordering issues.
…ns. convert arrow fns to declarative fns to avoid ordering issues.
@r-n-o Updated the padding function, now called |
@@ -160,4 +161,78 @@ describe("TKHQ", () => { | |||
// TODO: test logMessage / sendMessageUp | |||
expect(true).toBe(true); | |||
}) | |||
|
|||
it("normalizes padding in a byte array", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Based on ToB findings. Pin the signer enclave's quorum public key to import and export sites and verify the signed public keys from the enclave. Once we've deployed a new release that returns the enclave quorum public key in the import and export bundles, we can implement the TODOs I've left for checking that those fields aren't null and can be compared to the pinned quorum public key -- this lets the client know when the pinned quorum public key should be rotated.