no string response

This commit is contained in:
jusax23 2023-03-13 15:29:08 +01:00
parent 05025d209a
commit 0c8a27a7fe
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41
4 changed files with 10 additions and 10 deletions

View file

@ -32,7 +32,7 @@ export const createSignature = {
const server = selfTag; const server = selfTag;
const tag = `${client.name}@${server.host}:${server.port}-${data.publicKey}`; const tag = `${client.name}@${server.host}:${server.port}-${data.publicKey}`;
var signature = await sign(tag, await getSettings(SETTINGS.privateKey)); var signature = await sign(tag, await getSettings(SETTINGS.privateKey));
aws("ok", signature); aws("ok", { sign: signature });
} }
}; };

View file

@ -179,7 +179,7 @@ export const remote1 = {
client.challenge = get64(64); client.challenge = get64(64);
client.state = STATE.remoteP; client.state = STATE.remoteP;
client.remoteKey = data.publicKey; client.remoteKey = data.publicKey;
aws("ok", client.challenge); aws("ok", { challenge: client.challenge });
} catch (e) { } catch (e) {
client.suspect(); client.suspect();
aws("error", "signature"); aws("error", "signature");

View file

@ -33,10 +33,10 @@ const list = [
accountKey accountKey
}, "error", "config"); }, "error", "config");
}], ["remote", async (req) => { }], ["remote", async (req) => {
let signature = await req({ "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` }, let signature = (await req({ "authorization": `Digest name=${name1} server=localhost:7224 accountKey=${accountKey}` },
"createSignature", { "createSignature", {
publicKey publicKey
}, "ok", null); }, "ok", null)).sign;
let falseSignature = await sign("lol", privateKey); let falseSignature = await sign("lol", privateKey);
let token = (await req({}, "requestTempToken", {}, "ok", { token: null })).token; let token = (await req({}, "requestTempToken", {}, "ok", { token: null })).token;
@ -58,14 +58,14 @@ const list = [
sign: falseSignature sign: falseSignature
}, "error", "signature"); }, "error", "signature");
let challenge = await req({ let challenge = (await req({
"authorization": `Bearer ${token}` "authorization": `Bearer ${token}`
}, "remote1", { }, "remote1", {
name: name1, name: name1,
server: "localhost:7224", server: "localhost:7224",
publicKey, publicKey,
sign: signature sign: signature
}, "ok", null); }, "ok", null)).challenge;
await req({ await req({
"authorization": `Bearer ${token}` "authorization": `Bearer ${token}`

View file

@ -40,9 +40,9 @@ const list = [
server: "localhost:7224", server: "localhost:7224",
accountKey accountKey
}, "ok", ""); }, "ok", "");
let signature = await req(handler, "createSignature", { let signature = (await req(handler, "createSignature", {
publicKey publicKey
}, "ok", null); }, "ok", null)).sign;
let falseSignature = await sign("lol", privateKey); let falseSignature = await sign("lol", privateKey);
let h2 = await newHandler(); let h2 = await newHandler();
await req(h2, "remote1", { await req(h2, "remote1", {
@ -57,12 +57,12 @@ const list = [
publicKey, publicKey,
sign: falseSignature sign: falseSignature
}, "error", "signature"); }, "error", "signature");
let challenge = await req(h2, "remote1", { let challenge = (await req(h2, "remote1", {
name: name1, name: name1,
server: "localhost:7224", server: "localhost:7224",
publicKey, publicKey,
sign: signature sign: signature
}, "ok", null); }, "ok", null)).challenge;
await req(h2, "remote1", { await req(h2, "remote1", {
name: name1, name: name1,
server: "localhost:7224", server: "localhost:7224",