Commit a00e2c5e authored by John Doe's avatar John Doe Committed by Jean-Baptiste Kempf

Cache MEDIA KEY

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 94a06d2c
Pipeline #18799 failed with stage
in 1 minute and 11 seconds
......@@ -563,6 +563,12 @@ static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl, dk_list *dkl)
return AACS_SUCCESS;
}
/* get cached mk */
if (!aacs->no_cache && keycache_find("mk", aacs->disc_id, mk, 16)) {
BD_DEBUG(DBG_AACS, "Using cached MK\n");
return AACS_SUCCESS;
}
BD_DEBUG(DBG_AACS, "Calculate media key...\n");
mkb = _mkb_open(aacs);
......@@ -589,6 +595,12 @@ static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl, dk_list *dkl)
if (result == AACS_SUCCESS) {
memcpy(aacs->mk, mk, sizeof(aacs->mk));
/* cache mk */
if (!aacs->no_cache) {
if (memcmp(aacs->disc_id, empty_key, sizeof(aacs->disc_id))) {
keycache_save("mk", aacs->disc_id, mk, 16);
}
}
}
mkb_close(mkb);
......
Markdown is supported
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