diff --git a/app/settings-dev.json b/app/settings-dev.json index f61d26eb..efbdd313 100644 --- a/app/settings-dev.json +++ b/app/settings-dev.json @@ -224,7 +224,8 @@ "identifier": "", "iss": "", "keyid": "", - "sub": "" + "sub": "", + "salt": "" }, "s3": {}, diff --git a/core/modules/meet/server/meet.js b/core/modules/meet/server/meet.js index 72f2b32a..a5e81c53 100644 --- a/core/modules/meet/server/meet.js +++ b/core/modules/meet/server/meet.js @@ -1,9 +1,8 @@ import * as jwt from 'jsonwebtoken' +import crypto from 'crypto' import { canAccessZone } from '../../../lib/misc' -const { randomUUID } = require('crypto') - const computeRoomName = (zone) => { check(zone._id, Match.Id) @@ -11,7 +10,7 @@ const computeRoomName = (zone) => { let { uuid } = zone if (!uuid) { - uuid = randomUUID() + uuid = crypto.randomUUID() Zones.update(zone._id, { $set: { uuid } }) } @@ -104,15 +103,22 @@ Meteor.methods({ log('computeMeetLowLevelRoomName: start', { usersIds }) + const salt = Meteor.settings.meet.salt const meetRoomName = usersIds .sort((a, b) => a.localeCompare(b)) .join('-') .toLowerCase() - updateUserRoomName(meetRoomName) - log('computeMeetLowLevelRoomName: end', { meetRoomName }) + const hmac = crypto.createHmac('sha1', salt) + hmac.setEncoding('base64') + hmac.write(meetRoomName) + hmac.end() + hashedMeetRoomName = hmac.read().toLowerCase() + + updateUserRoomName(hashedMeetRoomName) + log('computeMeetLowLevelRoomName: end', { meetRoomName: hashedMeetRoomName }) - return meetRoomName + return hashedMeetRoomName }, })