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
d02a4723
Commit
d02a4723
authored
13 years ago
by
Ken Sumrall
Committed by
Android (Google) Code Review
13 years ago
Browse files
Options
Download
Plain Diff
Merge "Fix to not return a bogus decryption error when a device is not encrypted."
parents
c7ad3263
e1a45857
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
cryptfs.c
cryptfs.c
+16
-2
No files found.
cryptfs.c
View file @
d02a4723
...
...
@@ -731,6 +731,7 @@ static int do_crypto_complete(char *mount_point)
char
fs_options
[
PROPERTY_VALUE_MAX
];
unsigned
long
mnt_flags
;
char
encrypted_state
[
PROPERTY_VALUE_MAX
];
char
key_loc
[
PROPERTY_VALUE_MAX
];
property_get
(
"ro.crypto.state"
,
encrypted_state
,
""
);
if
(
strcmp
(
encrypted_state
,
"encrypted"
)
)
{
...
...
@@ -744,8 +745,21 @@ static int do_crypto_complete(char *mount_point)
}
if
(
get_crypt_ftr_and_key
(
real_blkdev
,
&
crypt_ftr
,
encrypted_master_key
,
salt
))
{
SLOGE
(
"Error getting crypt footer and key
\n
"
);
return
-
1
;
property_get
(
KEY_LOC_PROP
,
key_loc
,
KEY_IN_FOOTER
);
/*
* Only report this error if key_loc is a file and it exists.
* If the device was never encrypted, and /data is not mountable for
* some reason, returning 1 should prevent the UI from presenting the
* a "enter password" screen, or worse, a "press button to wipe the
* device" screen.
*/
if
((
key_loc
[
0
]
==
'/'
)
&&
(
access
(
"key_loc"
,
F_OK
)
==
-
1
))
{
SLOGE
(
"master key file does not exist, aborting"
);
return
1
;
}
else
{
SLOGE
(
"Error getting crypt footer and key
\n
"
);
return
-
1
;
}
}
if
(
crypt_ftr
.
flags
&
CRYPT_ENCRYPTION_IN_PROGRESS
)
{
...
...
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