Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
system_vold
Commits
300dae7c
Commit
300dae7c
authored
9 years ago
by
Paul Lawrence
Browse files
Options
Download
Email Patches
Plain Diff
Fix some static analyser issues
Bug: 27099772 Change-Id: Ic96777edf4ea282be2b8f53525226396c01e023c
parent
439034b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
cryptfs.c
cryptfs.c
+15
-7
No files found.
cryptfs.c
View file @
300dae7c
...
...
@@ -164,6 +164,11 @@ static int keymaster_check_compatibility()
goto
out
;
}
if
(
!
keymaster0_dev
||
!
keymaster0_dev
->
common
.
module
)
{
rc
=
-
1
;
goto
out
;
}
// TODO(swillden): Check to see if there's any reason to require v0.3. I think v0.1 and v0.2
// should work.
if
(
keymaster0_dev
->
common
.
module
->
module_api_version
...
...
@@ -889,12 +894,10 @@ static int load_persistent_data(void)
return
-
1
;
}
if
(
persist_data
==
NULL
)
{
pdata
=
malloc
(
crypt_ftr
.
persist_data_size
);
if
(
pdata
==
NULL
)
{
SLOGE
(
"Cannot allocate memory for persistent data"
);
goto
err
;
}
pdata
=
malloc
(
crypt_ftr
.
persist_data_size
);
if
(
pdata
==
NULL
)
{
SLOGE
(
"Cannot allocate memory for persistent data"
);
goto
err
;
}
for
(
i
=
0
;
i
<
2
;
i
++
)
{
...
...
@@ -3830,6 +3833,11 @@ int cryptfs_get_master_key(struct crypt_mnt_ftr* ftr, const char* password,
rc
=
decrypt_master_key
(
password
,
master_key
,
ftr
,
&
intermediate_key
,
&
intermediate_key_size
);
if
(
rc
)
{
SLOGE
(
"Can't calculate intermediate key"
);
return
rc
;
}
int
N
=
1
<<
ftr
->
N_factor
;
int
r
=
1
<<
ftr
->
r_factor
;
int
p
=
1
<<
ftr
->
p_factor
;
...
...
@@ -3844,7 +3852,7 @@ int cryptfs_get_master_key(struct crypt_mnt_ftr* ftr, const char* password,
free
(
intermediate_key
);
if
(
rc
)
{
SLOGE
(
"Can't
calculate
intermediate key"
);
SLOGE
(
"Can't
scrypt
intermediate key"
);
return
rc
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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