Commit 69e289a6 authored by npzacs's avatar npzacs
Browse files

aacs_get_mk(): do not return garbage if calculation failed

parent 9560a66e
...@@ -1317,7 +1317,10 @@ const uint8_t *aacs_get_mk(AACS *aacs) ...@@ -1317,7 +1317,10 @@ const uint8_t *aacs_get_mk(AACS *aacs)
if (!memcmp(aacs->mk, empty_key, sizeof(aacs->mk))) { if (!memcmp(aacs->mk, empty_key, sizeof(aacs->mk))) {
config_file *cf = keydbcfg_config_load(NULL); config_file *cf = keydbcfg_config_load(NULL);
if (cf) { if (cf) {
_calc_mk(aacs, aacs->mk, cf->pkl, cf->dkl); uint8_t mk[16] = {0};
if (_calc_mk(aacs, mk, cf->pkl, cf->dkl) == AACS_SUCCESS) {
memcpy(aacs->mk, mk, 16);
}
keydbcfg_config_file_close(cf); keydbcfg_config_file_close(cf);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment