Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
920c8119
Commit
920c8119
authored
10 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Forgot to update some constants to reflect the new crypto primitives.
parent
73d4f397
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
briar-api/src/org/briarproject/api/invitation/InvitationConstants.java
+1
-4
1 addition, 4 deletions
.../org/briarproject/api/invitation/InvitationConstants.java
briar-core/src/org/briarproject/invitation/Connector.java
+6
-7
6 additions, 7 deletions
briar-core/src/org/briarproject/invitation/Connector.java
with
7 additions
and
11 deletions
briar-api/src/org/briarproject/api/invitation/InvitationConstants.java
+
1
−
4
View file @
920c8119
package
org.briarproject.api.invitation
;
public
interface
InvitationConstants
{
long
CONNECTION_TIMEOUT
=
30
*
1000
;
// Milliseconds
...
...
@@ -7,8 +8,4 @@ public interface InvitationConstants {
long
CONFIRMATION_TIMEOUT
=
60
*
1000
;
// Milliseconds
int
CODE_BITS
=
19
;
// Codes must fit into six decimal digits
int
HASH_LENGTH
=
48
;
// Bytes
int
MAX_PUBLIC_KEY_LENGTH
=
97
;
// Bytes
}
This diff is collapsed.
Click to expand it.
briar-core/src/org/briarproject/invitation/Connector.java
+
6
−
7
View file @
920c8119
...
...
@@ -3,12 +3,12 @@ package org.briarproject.invitation;
import
static
java
.
util
.
logging
.
Level
.
INFO
;
import
static
java
.
util
.
logging
.
Level
.
WARNING
;
import
static
org
.
briarproject
.
api
.
AuthorConstants
.
MAX_AUTHOR_NAME_LENGTH
;
import
static
org
.
briarproject
.
api
.
AuthorConstants
.
MAX_PUBLIC_KEY_LENGTH
;
import
static
org
.
briarproject
.
api
.
AuthorConstants
.
MAX_SIGNATURE_LENGTH
;
import
static
org
.
briarproject
.
api
.
TransportPropertyConstants
.
MAX_PROPERTIES_PER_TRANSPORT
;
import
static
org
.
briarproject
.
api
.
TransportPropertyConstants
.
MAX_PROPERTY_LENGTH
;
import
static
org
.
briarproject
.
api
.
TransportPropertyConstants
.
MAX_TRANSPORT_ID_LENGTH
;
import
static
org
.
briarproject
.
api
.
invitation
.
InvitationConstants
.
CONNECTION_TIMEOUT
;
import
static
org
.
briarproject
.
api
.
invitation
.
InvitationConstants
.
HASH_LENGTH
;
import
java.io.IOException
;
import
java.security.GeneralSecurityException
;
...
...
@@ -23,13 +23,13 @@ import java.util.Map.Entry;
import
java.util.logging.Logger
;
import
org.briarproject.api.Author
;
import
org.briarproject.api.AuthorConstants
;
import
org.briarproject.api.AuthorFactory
;
import
org.briarproject.api.ContactId
;
import
org.briarproject.api.FormatException
;
import
org.briarproject.api.LocalAuthor
;
import
org.briarproject.api.TransportId
;
import
org.briarproject.api.TransportProperties
;
import
org.briarproject.api.UniqueId
;
import
org.briarproject.api.crypto.CryptoComponent
;
import
org.briarproject.api.crypto.KeyManager
;
import
org.briarproject.api.crypto.KeyPair
;
...
...
@@ -40,7 +40,6 @@ import org.briarproject.api.crypto.Signature;
import
org.briarproject.api.db.DatabaseComponent
;
import
org.briarproject.api.db.DbException
;
import
org.briarproject.api.db.NoSuchTransportException
;
import
org.briarproject.api.invitation.InvitationConstants
;
import
org.briarproject.api.messaging.Group
;
import
org.briarproject.api.messaging.GroupFactory
;
import
org.briarproject.api.plugins.ConnectionManager
;
...
...
@@ -132,8 +131,8 @@ abstract class Connector extends Thread {
}
protected
byte
[]
receivePublicKeyHash
(
Reader
r
)
throws
IOException
{
byte
[]
b
=
r
.
readBytes
(
HASH_
LENGTH
);
if
(
b
.
length
<
HASH_
LENGTH
)
throw
new
FormatException
();
byte
[]
b
=
r
.
readBytes
(
UniqueId
.
LENGTH
);
if
(
b
.
length
<
UniqueId
.
LENGTH
)
throw
new
FormatException
();
if
(
LOG
.
isLoggable
(
INFO
))
LOG
.
info
(
pluginName
+
" received hash"
);
return
b
;
}
...
...
@@ -147,7 +146,7 @@ abstract class Connector extends Thread {
protected
byte
[]
receivePublicKey
(
Reader
r
)
throws
GeneralSecurityException
,
IOException
{
byte
[]
b
=
r
.
readBytes
(
InvitationConstants
.
MAX_PUBLIC_KEY_LENGTH
);
byte
[]
b
=
r
.
readBytes
(
MAX_PUBLIC_KEY_LENGTH
);
keyParser
.
parsePublicKey
(
b
);
if
(
LOG
.
isLoggable
(
INFO
))
LOG
.
info
(
pluginName
+
" received key"
);
return
b
;
...
...
@@ -203,7 +202,7 @@ abstract class Connector extends Thread {
throws
GeneralSecurityException
,
IOException
{
// Read the name, public key and signature
String
name
=
r
.
readString
(
MAX_AUTHOR_NAME_LENGTH
);
byte
[]
publicKey
=
r
.
readBytes
(
AuthorConstants
.
MAX_PUBLIC_KEY_LENGTH
);
byte
[]
publicKey
=
r
.
readBytes
(
MAX_PUBLIC_KEY_LENGTH
);
byte
[]
sig
=
r
.
readBytes
(
MAX_SIGNATURE_LENGTH
);
if
(
LOG
.
isLoggable
(
INFO
))
LOG
.
info
(
pluginName
+
" received pseudonym"
);
// Verify the signature
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment