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
cea76cce
Commit
cea76cce
authored
12 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Use consistent wording.
parent
067af18a
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
components/net/sf/briar/transport/FrameEncoder.java
+3
-3
3 additions, 3 deletions
components/net/sf/briar/transport/FrameEncoder.java
components/net/sf/briar/transport/IncomingEncryptionLayer.java
+6
-6
6 additions, 6 deletions
...nents/net/sf/briar/transport/IncomingEncryptionLayer.java
with
9 additions
and
9 deletions
components/net/sf/briar/transport/FrameEncoder.java
+
3
−
3
View file @
cea76cce
...
...
@@ -30,7 +30,7 @@ class FrameEncoder {
ByteUtils
.
writeUint16
(
plaintextLength
,
aad
,
4
);
}
static
void
encodeHeader
(
byte
[]
header
,
boolean
last
Frame
,
static
void
encodeHeader
(
byte
[]
header
,
boolean
final
Frame
,
int
payloadLength
)
{
if
(
header
.
length
<
HEADER_LENGTH
)
throw
new
IllegalArgumentException
();
if
(
payloadLength
<
0
)
...
...
@@ -38,10 +38,10 @@ class FrameEncoder {
if
(
payloadLength
>
MAX_FRAME_LENGTH
-
HEADER_LENGTH
-
MAC_LENGTH
)
throw
new
IllegalArgumentException
();
ByteUtils
.
writeUint16
(
payloadLength
,
header
,
0
);
if
(
last
Frame
)
header
[
0
]
|=
0x80
;
if
(
final
Frame
)
header
[
0
]
|=
0x80
;
}
static
boolean
is
Last
Frame
(
byte
[]
header
)
{
static
boolean
is
Final
Frame
(
byte
[]
header
)
{
if
(
header
.
length
<
HEADER_LENGTH
)
throw
new
IllegalArgumentException
();
return
(
header
[
0
]
&
0x80
)
==
0x80
;
}
...
...
This diff is collapsed.
Click to expand it.
components/net/sf/briar/transport/IncomingEncryptionLayer.java
+
6
−
6
View file @
cea76cce
...
...
@@ -28,7 +28,7 @@ class IncomingEncryptionLayer implements FrameReader {
private
final
int
frameLength
;
private
long
frameNumber
;
private
boolean
readTag
,
last
Frame
;
private
boolean
readTag
,
final
Frame
;
/** Constructor for the initiator's side of a connection. */
IncomingEncryptionLayer
(
InputStream
in
,
Cipher
tagCipher
,
...
...
@@ -45,7 +45,7 @@ class IncomingEncryptionLayer implements FrameReader {
ciphertext
=
new
byte
[
frameLength
];
frameNumber
=
0L
;
readTag
=
true
;
last
Frame
=
false
;
final
Frame
=
false
;
}
/** Constructor for the responder's side of a connection. */
...
...
@@ -62,11 +62,11 @@ class IncomingEncryptionLayer implements FrameReader {
ciphertext
=
new
byte
[
frameLength
];
frameNumber
=
0L
;
readTag
=
false
;
last
Frame
=
false
;
final
Frame
=
false
;
}
public
int
readFrame
(
byte
[]
frame
)
throws
IOException
{
if
(
last
Frame
)
return
-
1
;
if
(
final
Frame
)
return
-
1
;
// Read the tag if required
if
(
readTag
)
{
int
offset
=
0
;
...
...
@@ -113,8 +113,8 @@ class IncomingEncryptionLayer implements FrameReader {
throw
new
RuntimeException
(
badCipher
);
}
// Decode and validate the header
last
Frame
=
FrameEncoder
.
is
Last
Frame
(
frame
);
if
(!
last
Frame
&&
ciphertextLength
<
frameLength
)
final
Frame
=
FrameEncoder
.
is
Final
Frame
(
frame
);
if
(!
final
Frame
&&
ciphertextLength
<
frameLength
)
throw
new
EOFException
();
int
payloadLength
=
FrameEncoder
.
getPayloadLength
(
frame
);
if
(
payloadLength
>
plaintextLength
-
HEADER_LENGTH
)
...
...
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