Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mike Perry
Tor
Commits
3ce69a58
Commit
3ce69a58
authored
Aug 03, 2017
by
George Kadianakis
Committed by
Nick Mathewson
Aug 08, 2017
Browse files
Rename some free() functions that are actually clear().
parent
3bc52dae
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/or/hs_descriptor.c
View file @
3ce69a58
...
...
@@ -2490,7 +2490,7 @@ hs_desc_link_specifier_new(const extend_info_t *info, uint8_t type)
/* From the given descriptor, remove and free every introduction point. */
void
hs_descriptor_
free
_intro_points
(
hs_descriptor_t
*
desc
)
hs_descriptor_
clear
_intro_points
(
hs_descriptor_t
*
desc
)
{
smartlist_t
*
ips
;
...
...
src/or/hs_descriptor.h
View file @
3ce69a58
...
...
@@ -209,7 +209,7 @@ void hs_desc_encrypted_data_free(hs_desc_encrypted_data_t *desc);
void
hs_desc_link_specifier_free
(
hs_desc_link_specifier_t
*
ls
);
hs_desc_link_specifier_t
*
hs_desc_link_specifier_new
(
const
extend_info_t
*
info
,
uint8_t
type
);
void
hs_descriptor_
free
_intro_points
(
hs_descriptor_t
*
desc
);
void
hs_descriptor_
clear
_intro_points
(
hs_descriptor_t
*
desc
);
int
hs_desc_encode_descriptor
(
const
hs_descriptor_t
*
desc
,
const
ed25519_keypair_t
*
signing_kp
,
...
...
src/or/hs_intropoint.c
View file @
3ce69a58
...
...
@@ -595,9 +595,10 @@ hs_intro_received_introduce1(or_circuit_t *circ, const uint8_t *request,
return
-
1
;
}
/* Free the given intropoint object ip. */
/* Clear memory allocated by the given intropoint object ip (but don't free the
* object itself). */
void
hs_intro
_free_content
(
hs_intropoint_t
*
ip
)
hs_intro
point_clear
(
hs_intropoint_t
*
ip
)
{
if
(
ip
==
NULL
)
{
return
;
...
...
src/or/hs_intropoint.h
View file @
3ce69a58
...
...
@@ -51,7 +51,7 @@ MOCK_DECL(int, hs_intro_send_intro_established_cell,(or_circuit_t *circ));
int
hs_intro_circuit_is_suitable_for_establish_intro
(
const
or_circuit_t
*
circ
);
hs_intropoint_t
*
hs_intro_new
(
void
);
void
hs_intro
_free_content
(
hs_intropoint_t
*
ip
);
void
hs_intro
point_clear
(
hs_intropoint_t
*
ip
);
#ifdef HS_INTROPOINT_PRIVATE
...
...
src/or/hs_service.c
View file @
3ce69a58
...
...
@@ -320,7 +320,7 @@ service_intro_point_free(hs_service_intro_point_t *ip)
memwipe
(
&
ip
->
enc_key_kp
,
0
,
sizeof
(
ip
->
enc_key_kp
));
crypto_pk_free
(
ip
->
legacy_key
);
replaycache_free
(
ip
->
replay_cache
);
hs_intro
_free_content
(
&
ip
->
base
);
hs_intro
point_clear
(
&
ip
->
base
);
tor_free
(
ip
);
}
...
...
@@ -1141,7 +1141,7 @@ build_desc_intro_points(const hs_service_t *service,
/* Ease our life. */
encrypted
=
&
desc
->
desc
->
encrypted_data
;
/* Cleanup intro points, we are about to set them from scratch. */
hs_descriptor_
free
_intro_points
(
desc
->
desc
);
hs_descriptor_
clear
_intro_points
(
desc
->
desc
);
DIGEST256MAP_FOREACH
(
desc
->
intro_points
.
map
,
key
,
const
hs_service_intro_point_t
*
,
ip
)
{
...
...
@@ -2125,7 +2125,7 @@ get_rev_counter_for_service(ed25519_public_key_t *blinded_pubkey)
/** Update the value of the revision counter for <b>hs_desc</b> and save it on
our state file. */
static
void
update
_descriptor_revision_counter
(
hs_descriptor_t
*
hs_desc
)
increment
_descriptor_revision_counter
(
hs_descriptor_t
*
hs_desc
)
{
/* Find stored rev counter if it exists */
uint64_t
rev_counter
=
...
...
@@ -2212,7 +2212,7 @@ upload_descriptor_to_all(const hs_service_t *service,
}
/* Update the revision counter of this descriptor */
update
_descriptor_revision_counter
(
desc
->
desc
);
increment
_descriptor_revision_counter
(
desc
->
desc
);
smartlist_free
(
responsible_dirs
);
return
;
...
...
@@ -2517,8 +2517,8 @@ service_handle_introduce2(origin_circuit_t *circ, const uint8_t *payload,
* information when originally tried to be uploaded. This is called when our
* directory information has changed. */
static
void
consider_hsdir_retry
(
const
hs_service_t
*
service
,
hs_service_descriptor_t
*
desc
)
consider_hsdir_
upload_
retry
(
const
hs_service_t
*
service
,
hs_service_descriptor_t
*
desc
)
{
smartlist_t
*
responsible_dirs
=
NULL
;
smartlist_t
*
still_missing_dirs
=
NULL
;
...
...
@@ -2772,7 +2772,7 @@ hs_service_dir_info_changed(void)
/* This cleans up the descriptor missing hsdir information list if a
* successful upload is made or if any of the directory aren't
* responsible anymore for the service descriptor. */
consider_hsdir_retry
(
service
,
desc
);
consider_hsdir_
upload_
retry
(
service
,
desc
);
}
FOR_EACH_DESCRIPTOR_END
;
}
FOR_EACH_SERVICE_END
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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