mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Reduced maximum public key lengths to reasonable lengths for ECDSA.
This commit is contained in:
@@ -9,7 +9,7 @@ public interface Author extends Writable {
|
|||||||
static final int MAX_NAME_LENGTH = 50;
|
static final int MAX_NAME_LENGTH = 50;
|
||||||
|
|
||||||
/** The maximum length of an author's public key, in bytes. */
|
/** The maximum length of an author's public key, in bytes. */
|
||||||
static final int MAX_PUBLIC_KEY_LENGTH = 1000;
|
static final int MAX_PUBLIC_KEY_LENGTH = 100;
|
||||||
|
|
||||||
/** Returns the author's unique identifier. */
|
/** Returns the author's unique identifier. */
|
||||||
AuthorId getId();
|
AuthorId getId();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public interface Group extends Writable {
|
|||||||
static final int MAX_NAME_LENGTH = 50;
|
static final int MAX_NAME_LENGTH = 50;
|
||||||
|
|
||||||
/** The maximum length of a group's public key, in bytes. */
|
/** The maximum length of a group's public key, in bytes. */
|
||||||
static final int MAX_PUBLIC_KEY_LENGTH = 1000;
|
static final int MAX_PUBLIC_KEY_LENGTH = 100;
|
||||||
|
|
||||||
/** Returns the group's unique identifier. */
|
/** Returns the group's unique identifier. */
|
||||||
GroupId getId();
|
GroupId getId();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ public interface Message {
|
|||||||
static final int MAX_SIZE = (1024 * 1024) - 200;
|
static final int MAX_SIZE = (1024 * 1024) - 200;
|
||||||
|
|
||||||
/** The maximum size of a signature, in bytes. */
|
/** The maximum size of a signature, in bytes. */
|
||||||
static final int MAX_SIGNATURE_SIZE = 100;
|
static final int MAX_SIGNATURE_LENGTH = 100;
|
||||||
|
|
||||||
/** Returns the message's unique identifier. */
|
/** Returns the message's unique identifier. */
|
||||||
MessageId getId();
|
MessageId getId();
|
||||||
|
|||||||
@@ -73,13 +73,13 @@ class MessageReader implements ObjectReader<Message> {
|
|||||||
// Read the author's signature, if there is one
|
// Read the author's signature, if there is one
|
||||||
byte[] authorSig = null;
|
byte[] authorSig = null;
|
||||||
if(author == null) r.readNull();
|
if(author == null) r.readNull();
|
||||||
else authorSig = r.readBytes(Message.MAX_SIGNATURE_SIZE);
|
else authorSig = r.readBytes(Message.MAX_SIGNATURE_LENGTH);
|
||||||
// Record the length of the data covered by the group's signature
|
// Record the length of the data covered by the group's signature
|
||||||
int signedByGroup = (int) counting.getCount();
|
int signedByGroup = (int) counting.getCount();
|
||||||
// Read the group's signature, if there is one
|
// Read the group's signature, if there is one
|
||||||
byte[] groupSig = null;
|
byte[] groupSig = null;
|
||||||
if(group.getPublicKey() == null) r.readNull();
|
if(group.getPublicKey() == null) r.readNull();
|
||||||
else groupSig = r.readBytes(Message.MAX_SIGNATURE_SIZE);
|
else groupSig = r.readBytes(Message.MAX_SIGNATURE_LENGTH);
|
||||||
// That's all, folks
|
// That's all, folks
|
||||||
r.removeConsumer(counting);
|
r.removeConsumer(counting);
|
||||||
r.removeConsumer(copying);
|
r.removeConsumer(copying);
|
||||||
|
|||||||
Reference in New Issue
Block a user