Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Monitor
Incidents
Service Desk
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
The Tor Project
Core
Tor
Commits
1d76d389
Commit
1d76d389
authored
8 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Re-run trunnel.
parent
0fa67184
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/trunnel/hs/cell_introduce1.c
+15
-3
15 additions, 3 deletions
src/trunnel/hs/cell_introduce1.c
with
15 additions
and
3 deletions
src/trunnel/hs/cell_introduce1.c
+
15
−
3
View file @
1d76d389
...
...
@@ -733,6 +733,7 @@ hs_cell_introduce_encrypted_new(void)
hs_cell_introduce_encrypted_t
*
val
=
trunnel_calloc
(
1
,
sizeof
(
hs_cell_introduce_encrypted_t
));
if
(
NULL
==
val
)
return
NULL
;
val
->
onion_key_type
=
1
;
return
val
;
}
...
...
@@ -836,6 +837,10 @@ hs_cell_introduce_encrypted_get_onion_key_type(hs_cell_introduce_encrypted_t *in
int
hs_cell_introduce_encrypted_set_onion_key_type
(
hs_cell_introduce_encrypted_t
*
inp
,
uint8_t
val
)
{
if
(
!
((
val
==
1
)))
{
TRUNNEL_SET_ERROR_CODE
(
inp
);
return
-
1
;
}
inp
->
onion_key_type
=
val
;
return
0
;
}
...
...
@@ -1074,6 +1079,8 @@ hs_cell_introduce_encrypted_check(const hs_cell_introduce_encrypted_t *obj)
if
(
NULL
!=
(
msg
=
cell_extension_check
(
obj
->
extensions
)))
return
msg
;
}
if
(
!
(
obj
->
onion_key_type
==
1
))
return
"Integer out of bounds"
;
if
(
TRUNNEL_DYNARRAY_LEN
(
&
obj
->
onion_key
)
!=
obj
->
onion_key_len
)
return
"Length mismatch for onion_key"
;
{
...
...
@@ -1105,7 +1112,7 @@ hs_cell_introduce_encrypted_encoded_len(const hs_cell_introduce_encrypted_t *obj
/* Length of struct cell_extension extensions */
result
+=
cell_extension_encoded_len
(
obj
->
extensions
);
/* Length of u8 onion_key_type */
/* Length of u8 onion_key_type
IN [1]
*/
result
+=
1
;
/* Length of u16 onion_key_len */
...
...
@@ -1169,7 +1176,7 @@ hs_cell_introduce_encrypted_encode(uint8_t *output, const size_t avail, const hs
goto
fail
;
/* XXXXXXX !*/
written
+=
result
;
ptr
+=
result
;
/* Encode u8 onion_key_type */
/* Encode u8 onion_key_type
IN [1]
*/
trunnel_assert
(
written
<=
avail
);
if
(
avail
-
written
<
1
)
goto
truncated
;
...
...
@@ -1273,10 +1280,12 @@ hs_cell_introduce_encrypted_parse_into(hs_cell_introduce_encrypted_t *obj, const
trunnel_assert
((
size_t
)
result
<=
remaining
);
remaining
-=
result
;
ptr
+=
result
;
/* Parse u8 onion_key_type */
/* Parse u8 onion_key_type
IN [1]
*/
CHECK_REMAINING
(
1
,
truncated
);
obj
->
onion_key_type
=
(
trunnel_get_uint8
(
ptr
));
remaining
-=
1
;
ptr
+=
1
;
if
(
!
(
obj
->
onion_key_type
==
1
))
goto
fail
;
/* Parse u16 onion_key_len */
CHECK_REMAINING
(
2
,
truncated
);
...
...
@@ -1327,6 +1336,9 @@ hs_cell_introduce_encrypted_parse_into(hs_cell_introduce_encrypted_t *obj, const
return
result
;
trunnel_alloc_failed:
return
-
1
;
fail:
result
=
-
1
;
return
result
;
}
ssize_t
...
...
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