Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
a4e70960
Commit
a4e70960
authored
Sep 03, 1998
by
Niels Möller
Browse files
Handle sequence numbers.
Rev: src/encrypt.c:1.8 Rev: src/encrypt.h:1.6
parent
4167debe
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/encrypt.c
View file @
a4e70960
...
...
@@ -19,9 +19,14 @@ static int do_encrypt(struct abstract_write **w,
if
(
closure
->
mac
->
mac_size
)
{
/* FIXME: Sequence number */
UPDATE
(
closure
->
mac
,
packet
->
length
,
packet
->
data
);
DIGEST
(
closure
->
mac
,
new
->
data
+
packet
->
length
);
UINT8
s
[
4
];
WRITE_UINT32
(
s
,
closure
->
sequence_number
);
closure
->
sequence_number
++
;
HASH_UPDATE
(
closure
->
mac
,
4
,
s
);
HASH_UPDATE
(
closure
->
mac
,
packet
->
length
,
packet
->
data
);
HASH_DIGEST
(
closure
->
mac
,
new
->
data
+
packet
->
length
);
}
lsh_string_free
(
packet
);
...
...
@@ -37,6 +42,7 @@ make_packet_encrypt(struct abstract_write *continuation,
closure
->
super
.
super
.
write
=
do_encrypt
;
closure
->
super
.
next
=
continuation
;
closure
->
sequence_number
=
0
;
closure
->
mac
=
mac
;
closure
->
crypto
=
crypto
;
...
...
src/encrypt.h
View file @
a4e70960
...
...
@@ -13,6 +13,7 @@ struct packet_encrypt
{
struct
abstract_write_pipe
super
;
UINT32
sequence_number
;
struct
mac_instance
*
mac
;
struct
crypto_instance
*
crypto
;
};
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment