Skip to content

Commit

Permalink
Fix prop name in shl payload ('key', not 'decrypt')
Browse files Browse the repository at this point in the history
  • Loading branch information
jmandel committed Oct 6, 2022
1 parent 09b6c70 commit c2a1918
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export interface SHLinkConnectResponse {

export interface SHLClientStateDecoded {
url: string;
decrypt: string;
key: string;
recipient: string;
passcode?: string;
}

export interface SHLDecoded {
url: string;
decrypt: string;
key: string;
flag?: string;
label?: string;
}
Expand Down Expand Up @@ -97,7 +97,7 @@ async function retrieve(configIncoming: SHLinkConnectRequest | {state: string})
}
});

const decryptionKey = base64url.toBuffer(parsedShl.decrypt);
const decryptionKey = base64url.toBuffer(parsedShl.key);
const allFilesDecrypted = allFiles.map(async (f) => {
const decrypted = await jose.compactDecrypt(await f, decryptionKey);
const decoded = new TextDecoder().decode(decrypted.plaintext);
Expand Down
2 changes: 1 addition & 1 deletion server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface SHLinkAddFileRequest {
export interface SHLDecoded {
url: string;
flag: string;
decrypt: string & { length: 43 };
key: string & { length: 43 };
exp?: number;
label?: string;
}
2 changes: 1 addition & 1 deletion ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function generateLinkUrl(shl: SHLink) {
url: realServerBaseUrl + '/shl/' + shl.serverStatus!.id,
exp: shl.serverConfig.exp,
flag: shl.serverConfig.passcode ? 'P' : '',
decrypt: shl.encryptionKey,
key: shl.encryptionKey,
};

const qrJson = JSON.stringify(qrPayload);
Expand Down

0 comments on commit c2a1918

Please sign in to comment.