Skip to content

Commit

Permalink
#314 simplify using 'encryption' namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 2, 2024
1 parent f7f92bd commit 8224918
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2484,27 +2484,7 @@ class XpraClient {

// check for server encryption caps update
if (this.encryption) {
this.cipher_out_caps = {};
const CIPHER_CAPS = [
"",
".mode",
".iv",
".key_salt",
".key_size",
".key_hash",
".key_stretch_iterations",
".padding",
".padding.options",
".always-pad",
];
for (const CIPHER_CAP of CIPHER_CAPS) {
const cipher_key = `cipher${CIPHER_CAP}`;
let value = hello[cipher_key];
if (typeof value === "object" && value.constructor === Uint8Array) {
value = String.fromCharCode.apply(null, value);
}
this.cipher_out_caps[cipher_key] = value;
}
this.cipher_out_caps = hello["encryption"];
console.info("cipher out caps=", JSON.stringify(this.cipher_out_caps));
this.protocol.set_cipher_out(this.cipher_out_caps, this.encryption_key);
}
Expand Down

0 comments on commit 8224918

Please sign in to comment.