Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Benjamin J. Thompson
Tor
Commits
edd93f9d
Commit
edd93f9d
authored
9 years ago
by
Hassan Alsibyani
Browse files
Options
Downloads
Patches
Plain Diff
changing output of crypto_cipher_crypt_inplace from int to void
parent
1f5cdf2b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/crypto.c
+2
-3
2 additions, 3 deletions
src/common/crypto.c
src/common/crypto.h
+1
-1
1 addition, 1 deletion
src/common/crypto.h
src/or/relay.c
+2
-7
2 additions, 7 deletions
src/or/relay.c
with
5 additions
and
11 deletions
src/common/crypto.c
+
2
−
3
View file @
edd93f9d
...
...
@@ -1531,14 +1531,13 @@ crypto_cipher_decrypt(crypto_cipher_t *env, char *to,
}
/** Encrypt <b>len</b> bytes on <b>from</b> using the cipher in <b>env</b>;
* on success
, return 0
. Does not check for failure.
* on success. Does not check for failure.
*/
int
void
crypto_cipher_crypt_inplace
(
crypto_cipher_t
*
env
,
char
*
buf
,
size_t
len
)
{
tor_assert
(
len
<
SIZE_T_CEILING
);
aes_crypt_inplace
(
env
->
cipher
,
buf
,
len
);
return
0
;
}
/** Encrypt <b>fromlen</b> bytes (at least 1) from <b>from</b> with the key in
...
...
This diff is collapsed.
Click to expand it.
src/common/crypto.h
+
1
−
1
View file @
edd93f9d
...
...
@@ -205,7 +205,7 @@ int crypto_cipher_encrypt(crypto_cipher_t *env, char *to,
const
char
*
from
,
size_t
fromlen
);
int
crypto_cipher_decrypt
(
crypto_cipher_t
*
env
,
char
*
to
,
const
char
*
from
,
size_t
fromlen
);
int
crypto_cipher_crypt_inplace
(
crypto_cipher_t
*
env
,
char
*
d
,
size_t
len
);
void
crypto_cipher_crypt_inplace
(
crypto_cipher_t
*
env
,
char
*
d
,
size_t
len
);
int
crypto_cipher_encrypt_with_iv
(
const
char
*
key
,
char
*
to
,
size_t
tolen
,
...
...
This diff is collapsed.
Click to expand it.
src/or/relay.c
+
2
−
7
View file @
edd93f9d
...
...
@@ -148,20 +148,15 @@ relay_digest_matches(crypto_digest_t *digest, cell_t *cell)
*
* If <b>encrypt_mode</b> is 1 then encrypt, else decrypt.
*
* Return
-1 if the crypto fails, else return
0.
* Return
s
0.
*/
static
int
relay_crypt_one_payload
(
crypto_cipher_t
*
cipher
,
uint8_t
*
in
,
int
encrypt_mode
)
{
int
r
;
(
void
)
encrypt_mode
;
r
=
crypto_cipher_crypt_inplace
(
cipher
,
(
char
*
)
in
,
CELL_PAYLOAD_SIZE
);
crypto_cipher_crypt_inplace
(
cipher
,
(
char
*
)
in
,
CELL_PAYLOAD_SIZE
);
if
(
r
)
{
log_warn
(
LD_BUG
,
"Error during relay encryption"
);
return
-
1
;
}
return
0
;
}
...
...
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