no string response
This commit is contained in:
parent
05025d209a
commit
0c8a27a7fe
4 changed files with 10 additions and 10 deletions
|
@ -32,7 +32,7 @@ export const createSignature = {
|
|||
const server = selfTag;
|
||||
const tag = `${client.name}@${server.host}:${server.port}-${data.publicKey}`;
|
||||
var signature = await sign(tag, await getSettings(SETTINGS.privateKey));
|
||||
aws("ok", signature);
|
||||
aws("ok", { sign: signature });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ export const remote1 = {
|
|||
client.challenge = get64(64);
|
||||
client.state = STATE.remoteP;
|
||||
client.remoteKey = data.publicKey;
|
||||
aws("ok", client.challenge);
|
||||
aws("ok", { challenge: client.challenge });
|
||||
} catch (e) {
|
||||
client.suspect();
|
||||
aws("error", "signature");
|
||||
|
|
|
@ -33,10 +33,10 @@ const list = [
|
|||
accountKey
|
||||
}, "error", "config");
|
||||
}], ["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", {
|
||||
publicKey
|
||||
}, "ok", null);
|
||||
}, "ok", null)).sign;
|
||||
let falseSignature = await sign("lol", privateKey);
|
||||
let token = (await req({}, "requestTempToken", {}, "ok", { token: null })).token;
|
||||
|
||||
|
@ -58,14 +58,14 @@ const list = [
|
|||
sign: falseSignature
|
||||
}, "error", "signature");
|
||||
|
||||
let challenge = await req({
|
||||
let challenge = (await req({
|
||||
"authorization": `Bearer ${token}`
|
||||
}, "remote1", {
|
||||
name: name1,
|
||||
server: "localhost:7224",
|
||||
publicKey,
|
||||
sign: signature
|
||||
}, "ok", null);
|
||||
}, "ok", null)).challenge;
|
||||
|
||||
await req({
|
||||
"authorization": `Bearer ${token}`
|
||||
|
|
|
@ -40,9 +40,9 @@ const list = [
|
|||
server: "localhost:7224",
|
||||
accountKey
|
||||
}, "ok", "");
|
||||
let signature = await req(handler, "createSignature", {
|
||||
let signature = (await req(handler, "createSignature", {
|
||||
publicKey
|
||||
}, "ok", null);
|
||||
}, "ok", null)).sign;
|
||||
let falseSignature = await sign("lol", privateKey);
|
||||
let h2 = await newHandler();
|
||||
await req(h2, "remote1", {
|
||||
|
@ -57,12 +57,12 @@ const list = [
|
|||
publicKey,
|
||||
sign: falseSignature
|
||||
}, "error", "signature");
|
||||
let challenge = await req(h2, "remote1", {
|
||||
let challenge = (await req(h2, "remote1", {
|
||||
name: name1,
|
||||
server: "localhost:7224",
|
||||
publicKey,
|
||||
sign: signature
|
||||
}, "ok", null);
|
||||
}, "ok", null)).challenge;
|
||||
await req(h2, "remote1", {
|
||||
name: name1,
|
||||
server: "localhost:7224",
|
||||
|
|
Loading…
Reference in a new issue