add comments about temporary fix with mobile group pubkeys regex

pull/1246/head
Audric Ackermann 5 years ago
parent f491158b3f
commit 20a286d288
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1,5 +1,8 @@
export class PubKey {
public static readonly PUBKEY_LEN = 66;
// This is a temporary fix to allow groupPubkeys created from mobile to be handled correctly
// They have a different regex to match
// FIXME move this to a new class which validates group ids and use it in all places where we have group ids (message sending included)
public static readonly MOBILE_GROUP_PUBKEY_LEN = 32;
private static readonly regexForMobileGroupID = `__textsecure_group__![0-9a-fA-F]{${PubKey.MOBILE_GROUP_PUBKEY_LEN}}`;

@ -52,10 +52,9 @@ describe('MessageEncrypter', () => {
it('should return a MEDIUM_GROUP_CIPHERTEXT envelope type', async () => {
const data = crypto.randomBytes(10);
sandbox.stub(
Ratchet,
'encryptWithSenderKey'
).resolves({ ciphertext: '' });
sandbox
.stub(Ratchet, 'encryptWithSenderKey')
.resolves({ ciphertext: '' });
const result = await MessageEncrypter.encrypt(
TestUtils.generateFakePubKey(),

Loading…
Cancel
Save