Truncate all messages to valid length before sending.

This commit is contained in:
akwizgran
2016-10-19 14:23:24 +01:00
parent 9d2c56e75f
commit 06335c2c30
23 changed files with 279 additions and 163 deletions

View File

@@ -1,5 +1,7 @@
package org.briarproject.api.introduction;
import static org.briarproject.api.sync.SyncConstants.MAX_MESSAGE_BODY_LENGTH;
public interface IntroductionConstants {
/* Protocol roles */
@@ -30,8 +32,18 @@ public interface IntroductionConstants {
String SIGNATURE = "signature";
/* Validation Constants */
/**
* The length of the message authentication code in bytes.
*/
int MAC_LENGTH = 32;
/**
* The maximum length of the introducer's optional message to the
* introducees in UTF-8 bytes.
*/
int MAX_INTRODUCTION_MESSAGE_LENGTH = MAX_MESSAGE_BODY_LENGTH - 1024;
/* Introducer Local State Metadata */
String STATE = "state";
String ROLE = "role";