Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging
This commit is contained in:
commit
08c38e757e
@ -999,8 +999,20 @@ module.exports.create = function (cfg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// unauthenticated RPC calls have a different message format
|
// unauthenticated RPC calls have a different message format
|
||||||
if (msg[0] === "WRITE_PRIVATE_MESSAGE" && output) {
|
if (msg[0] === "WRITE_PRIVATE_MESSAGE" && output && output.channel) {
|
||||||
historyKeeperBroadcast(ctx, output.channel, output.message);
|
// this is an inline reimplementation of historyKeeperBroadcast
|
||||||
|
// because if we use that directly it will bypass signature validation
|
||||||
|
// which opens up the user to malicious behaviour
|
||||||
|
let chan = ctx.channels[output.channel];
|
||||||
|
if (chan && chan.length) {
|
||||||
|
chan.forEach(function (user) {
|
||||||
|
sendMsg(ctx, user, output.message);
|
||||||
|
//[0, null, 'MSG', user.id, JSON.stringify(output.message)]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// rpc and anonRpc expect their responses to be of a certain length
|
||||||
|
// and we've already used the output of the rpc call, so overwrite it
|
||||||
|
output = [null, null, null];
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally, send a response to the client that sent the RPC
|
// finally, send a response to the client that sent the RPC
|
||||||
|
|||||||
@ -85,6 +85,9 @@ proxy.mailboxes = {
|
|||||||
if (!keys) { return void cb({error: "missing asymmetric encryption keys"}); }
|
if (!keys) { return void cb({error: "missing asymmetric encryption keys"}); }
|
||||||
if (!user || !user.channel || !user.curvePublic) { return void cb({error: "no notification channel"}); }
|
if (!user || !user.channel || !user.curvePublic) { return void cb({error: "no notification channel"}); }
|
||||||
|
|
||||||
|
var anonRpc = Util.find(ctx, [ 'store', 'anon_rpc', ]);
|
||||||
|
if (!anonRpc) { return void cb({error: "anonymous rpc session not ready"}); }
|
||||||
|
|
||||||
var crypto = Crypto.Mailbox.createEncryptor(keys);
|
var crypto = Crypto.Mailbox.createEncryptor(keys);
|
||||||
var network = ctx.store.network;
|
var network = ctx.store.network;
|
||||||
|
|
||||||
@ -94,29 +97,16 @@ proxy.mailboxes = {
|
|||||||
});
|
});
|
||||||
var ciphertext = crypto.encrypt(text, user.curvePublic);
|
var ciphertext = crypto.encrypt(text, user.curvePublic);
|
||||||
|
|
||||||
network.join(user.channel).then(function (wc) {
|
anonRpc.send("WRITE_PRIVATE_MESSAGE", [
|
||||||
wc.bcast(ciphertext).then(function () {
|
user.channel,
|
||||||
cb();
|
ciphertext
|
||||||
|
], function (err, response) {
|
||||||
// If we've just sent a message to one of our mailboxes, we have to trigger the handler manually
|
if (err) {
|
||||||
// (the server won't send back our message to us)
|
return void cb({
|
||||||
// If it isn't one of our mailboxes, we can close it now
|
error: err,
|
||||||
var box;
|
|
||||||
if (Object.keys(ctx.boxes).some(function (t) {
|
|
||||||
var _box = ctx.boxes[t];
|
|
||||||
if (_box.channel === user.channel) {
|
|
||||||
box = _box;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
})) {
|
|
||||||
var hash = ciphertext.slice(0, 64);
|
|
||||||
box.onMessage(text, null, null, null, hash, user.curvePublic);
|
|
||||||
} else {
|
|
||||||
wc.leave();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, function (err) {
|
}
|
||||||
cb({error: err});
|
return void cb();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1143,5 +1143,11 @@
|
|||||||
"register_emailWarning0": "Anscheinend hast du deine E-Mail-Adresse als Benutzername angegeben.",
|
"register_emailWarning0": "Anscheinend hast du deine E-Mail-Adresse als Benutzername angegeben.",
|
||||||
"register_emailWarning1": "Wenn du möchtest, kannst du dies tun. Allerdings wird sie nicht an unseren Server gesendet.",
|
"register_emailWarning1": "Wenn du möchtest, kannst du dies tun. Allerdings wird sie nicht an unseren Server gesendet.",
|
||||||
"register_emailWarning2": "Du kannst dein Passwort nicht wie bei vielen anderen Diensten mit der E-Mail-Adresse zurücksetzen.",
|
"register_emailWarning2": "Du kannst dein Passwort nicht wie bei vielen anderen Diensten mit der E-Mail-Adresse zurücksetzen.",
|
||||||
"register_emailWarning3": "Wenn du dies verstanden hast und die E-Mail-Adresse dennoch als Benutzername verwenden möchtest, klicke auf OK."
|
"register_emailWarning3": "Wenn du dies verstanden hast und die E-Mail-Adresse dennoch als Benutzername verwenden möchtest, klicke auf OK.",
|
||||||
|
"owner_unknownUser": "Unbekannter Benutzer",
|
||||||
|
"owner_removeButton": "Ausgewählte Eigentümer entfernen",
|
||||||
|
"owner_removeConfirm": "Bist du sicher, dass die Eigentümerschaft der ausgewählten Benutzer entfernen möchtest? Sie werden über diese Aktion informiert.",
|
||||||
|
"owner_removeMeConfirm": "Du bist dabei, deine Rechte als Eigentümer aufzugeben. Diese Aktion kannst du nicht rückgängig machen. Bist du sicher?",
|
||||||
|
"owner_openModalButton": "Eigentümer verwalten",
|
||||||
|
"owner_add": "{0} möchte ein Eigentümer des Pads <b>{1}</b> sein. Bist du damit einverstanden?"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1141,8 +1141,8 @@
|
|||||||
"features_emailRequired": "Adresse email requise",
|
"features_emailRequired": "Adresse email requise",
|
||||||
"register_emailWarning0": "Il semble que vous ayez entré votre adresse email à la place du nom d'utilisateur.",
|
"register_emailWarning0": "Il semble que vous ayez entré votre adresse email à la place du nom d'utilisateur.",
|
||||||
"register_emailWarning1": "Vous pouvez continuer, mais ces données ne sont pas nécessaires et ne seront pas envoyées à notre serveur.",
|
"register_emailWarning1": "Vous pouvez continuer, mais ces données ne sont pas nécessaires et ne seront pas envoyées à notre serveur.",
|
||||||
"register_emailWarning2": "Vous ne pourrez pas réinitialiser votre mot de passe en utilisant votre adresse email comme sur beaucoup d'autres services",
|
"register_emailWarning2": "Vous ne pourrez pas réinitialiser votre mot de passe en utilisant votre adresse email comme sur beaucoup d'autres services.",
|
||||||
"register_emailWarning3": "Si vous souhaitez tout de même utiliser votre adresse email comme nom d'utilisateur, appuyez sur OK",
|
"register_emailWarning3": "Si vous souhaitez tout de même utiliser votre adresse email comme nom d'utilisateur, appuyez sur OK.",
|
||||||
"owner_removeText": "Supprimer un propriétaire existant",
|
"owner_removeText": "Supprimer un propriétaire existant",
|
||||||
"owner_removePendingText": "Annuler une offre en attente",
|
"owner_removePendingText": "Annuler une offre en attente",
|
||||||
"owner_addText": "Proposer à un ami d'être co-propriétaire de ce document",
|
"owner_addText": "Proposer à un ami d'être co-propriétaire de ce document",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user