mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-18 15:22:16 +00:00
Prevent rogue users from requesting multiple roomKeys
This commit is contained in:
1
index.js
1
index.js
@@ -231,6 +231,7 @@ class PairDropServer {
|
|||||||
_onPairDeviceInitiate(sender) {
|
_onPairDeviceInitiate(sender) {
|
||||||
let roomSecret = this.getRandomString(64);
|
let roomSecret = this.getRandomString(64);
|
||||||
let roomKey = this._createRoomKey(sender, roomSecret);
|
let roomKey = this._createRoomKey(sender, roomSecret);
|
||||||
|
if (sender.roomKey) this._removeRoomKey(sender.roomKey);
|
||||||
sender.roomKey = roomKey;
|
sender.roomKey = roomKey;
|
||||||
this._send(sender, {
|
this._send(sender, {
|
||||||
type: 'pair-device-initiated',
|
type: 'pair-device-initiated',
|
||||||
|
|||||||
Reference in New Issue
Block a user