From ff4640b789e29387d50e5af17ccf7ce5ee2783d5 Mon Sep 17 00:00:00 2001 From: ameba23 Date: Thu, 25 Feb 2021 11:30:46 +0100 Subject: [PATCH] update SocialBackupValidator --- .../briar/socialbackup/SocialBackupValidator.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/briar-core/src/main/java/org/briarproject/briar/socialbackup/SocialBackupValidator.java b/briar-core/src/main/java/org/briarproject/briar/socialbackup/SocialBackupValidator.java index ea2d232b2..281b94ddd 100644 --- a/briar-core/src/main/java/org/briarproject/briar/socialbackup/SocialBackupValidator.java +++ b/briar-core/src/main/java/org/briarproject/briar/socialbackup/SocialBackupValidator.java @@ -47,16 +47,11 @@ class SocialBackupValidator extends BdfMessageValidator { private BdfMessageContext validateShardMessage(BdfList body) throws FormatException { - // Message type, secret ID, num shards, threshold, shard - checkSize(body, 5); + // Message type, secret ID, shard + checkSize(body, 3); byte[] secretId = body.getRaw(1); checkLength(secretId, SECRET_ID_BYTES); - int numShards = body.getLong(2).intValue(); - if (numShards < 2) throw new FormatException(); - int threshold = body.getLong(3).intValue(); - if (threshold < 2) throw new FormatException(); - if (threshold > numShards) throw new FormatException(); - byte[] shard = body.getRaw(4); + byte[] shard = body.getRaw(2); checkLength(shard, 1, MAX_SHARD_BYTES); BdfDictionary meta = BdfDictionary.of( new BdfEntry(MSG_KEY_MESSAGE_TYPE, SHARD.getValue()),