Skip to content

Commit

Permalink
Clean up some code.
Browse files Browse the repository at this point in the history
  • Loading branch information
vldr committed May 20, 2024
1 parent 714e478 commit b68ec2a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/network/NetworkReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ export class NetworkReceiver {
return this.error("Failed to derive shared secret bits", error);
}

let HKDFKey;
let keyMaterial;
try {
HKDFKey = await window.crypto.subtle.importKey(
keyMaterial = await window.crypto.subtle.importKey(
"raw",
sharedSecret,
{ name: "HKDF" },
Expand All @@ -227,10 +227,10 @@ export class NetworkReceiver {
{
name: "HKDF",
hash: "SHA-256",
salt: salt,
info: new Uint8Array(),
salt,
},
HKDFKey,
keyMaterial,
{ name: "AES-GCM", length: 256 },
false,
["encrypt", "decrypt"]
Expand Down
8 changes: 4 additions & 4 deletions src/network/NetworkSender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ export class NetworkSender {
return this.error("Failed to derive shared secret bits", error);
}

let HKDFKey;
let keyMaterial;
try {
HKDFKey = await window.crypto.subtle.importKey(
keyMaterial = await window.crypto.subtle.importKey(
"raw",
sharedSecret,
{ name: "HKDF" },
Expand All @@ -255,10 +255,10 @@ export class NetworkSender {
{
name: "HKDF",
hash: "SHA-256",
salt: salt,
info: new Uint8Array(),
salt,
},
HKDFKey,
keyMaterial,
{ name: "AES-GCM", length: 256 },
false,
["encrypt", "decrypt"]
Expand Down

0 comments on commit b68ec2a

Please sign in to comment.