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
0965bbd5
Commit
0965bbd5
authored
10 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/maint-0.2.5'
parents
03d2df62
6d728ba8
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
src/common/crypto.c
+6
-0
6 additions, 0 deletions
src/common/crypto.c
src/common/util.c
+3
-0
3 additions, 0 deletions
src/common/util.c
with
9 additions
and
0 deletions
src/common/crypto.c
+
6
−
0
View file @
0965bbd5
...
...
@@ -2752,6 +2752,8 @@ base64_decode(char *dest, size_t destlen, const char *src, size_t srclen)
if
(
destlen
>
SIZE_T_CEILING
)
return
-
1
;
memset
(
dest
,
0
,
destlen
);
EVP_DecodeInit
(
&
ctx
);
EVP_DecodeUpdate
(
&
ctx
,
(
unsigned
char
*
)
dest
,
&
len
,
(
unsigned
char
*
)
src
,
srclen
);
...
...
@@ -2773,6 +2775,8 @@ base64_decode(char *dest, size_t destlen, const char *src, size_t srclen)
if
(
destlen
>
SIZE_T_CEILING
)
return
-
1
;
memset
(
dest
,
0
,
destlen
);
/* Iterate over all the bytes in src. Each one will add 0 or 6 bits to the
* value we're decoding. Accumulate bits in <b>n</b>, and whenever we have
* 24 bits, batch them into 3 bytes and flush those bytes to dest.
...
...
@@ -2952,6 +2956,8 @@ base32_decode(char *dest, size_t destlen, const char *src, size_t srclen)
tor_assert
((
nbits
/
8
)
<=
destlen
);
/* We need enough space. */
tor_assert
(
destlen
<
SIZE_T_CEILING
);
memset
(
dest
,
0
,
destlen
);
/* Convert base32 encoded chars to the 5-bit values that they represent. */
tmp
=
tor_malloc_zero
(
srclen
);
for
(
j
=
0
;
j
<
srclen
;
++
j
)
{
...
...
This diff is collapsed.
Click to expand it.
src/common/util.c
+
3
−
0
View file @
0965bbd5
...
...
@@ -1268,6 +1268,9 @@ base16_decode(char *dest, size_t destlen, const char *src, size_t srclen)
return
-
1
;
if
(
destlen
<
srclen
/
2
||
destlen
>
SIZE_T_CEILING
)
return
-
1
;
memset
(
dest
,
0
,
destlen
);
end
=
src
+
srclen
;
while
(
src
<
end
)
{
v1
=
hex_decode_digit_
(
*
src
);
...
...
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