mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
/api/mek/register, /api/mek/share Endpoint 삭제 및 MEK 서명 매커니즘 구현
2025년 첫 커밋! Happy New Year~
This commit is contained in:
@@ -29,7 +29,10 @@
|
||||
|
||||
// TODO: Multi-user support
|
||||
|
||||
if ($masterKeyStore || (await requestMasterKeyDownload($clientKeyStore.decryptKey))) {
|
||||
if (
|
||||
$masterKeyStore ||
|
||||
(await requestMasterKeyDownload($clientKeyStore.decryptKey, $clientKeyStore.verifyKey))
|
||||
) {
|
||||
await goto(data.redirectPath);
|
||||
} else {
|
||||
await redirect("/client/pending");
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
if ($masterKeyStore) {
|
||||
goto(data.redirectPath);
|
||||
} else if ($clientKeyStore) {
|
||||
requestMasterKeyDownload($clientKeyStore.decryptKey).then(async (ok) => {
|
||||
if (ok) {
|
||||
return await goto(data.redirectPath);
|
||||
}
|
||||
});
|
||||
requestMasterKeyDownload($clientKeyStore.decryptKey, $clientKeyStore.verifyKey).then(
|
||||
async (ok) => {
|
||||
if (ok) {
|
||||
return await goto(data.redirectPath);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { callAPI } from "$lib/hooks";
|
||||
import { storeClientKey } from "$lib/indexedDB";
|
||||
import { encodeToBase64, signRequest } from "$lib/modules/crypto";
|
||||
import { encodeToBase64, signRequest, signMasterKeyWrapped } from "$lib/modules/crypto";
|
||||
import type { ClientKeys } from "$lib/stores";
|
||||
|
||||
export { requestTokenUpgrade } from "$lib/services/auth";
|
||||
@@ -53,6 +53,7 @@ export const requestInitialMasterKeyRegistration = async (
|
||||
body: await signRequest(
|
||||
{
|
||||
mek: encodeToBase64(masterKeyWrapped),
|
||||
mekSig: await signMasterKeyWrapped(1, masterKeyWrapped, signKey),
|
||||
},
|
||||
signKey,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user