Commit 32cccee4 authored by npzacs's avatar npzacs Committed by Ano Nymous
Browse files

Added aacs_get_disc_id()

parent c2340fad
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
struct aacs { struct aacs {
uint8_t pk[16], mk[16], vuk[16], vid[16], *uks; uint8_t pk[16], mk[16], vuk[16], vid[16], disc_id[20], *uks;
uint32_t num_uks; uint32_t num_uks;
struct config_file_t *cf; struct config_file_t *cf;
struct title_entry_list_t *ce; struct title_entry_list_t *ce;
...@@ -441,13 +441,13 @@ static int _verify_ts(uint8_t *buf, size_t size) ...@@ -441,13 +441,13 @@ static int _verify_ts(uint8_t *buf, size_t size)
/* Function that collects keys from keydb config entry */ /* Function that collects keys from keydb config entry */
static uint32_t _find_config_entry(AACS *aacs, const char *path) static uint32_t _find_config_entry(AACS *aacs, const char *path)
{ {
uint8_t hash[20], discid[20]; uint8_t discid[20];
char str[48]; char str[48];
uint32_t retval = 0; uint32_t retval = 0;
aacs->uks = NULL; aacs->uks = NULL;
aacs->num_uks = 0; aacs->num_uks = 0;
if (!_calc_title_hash(path, hash)) { if (!_calc_title_hash(path, aacs->disc_id)) {
return 0; return 0;
} }
...@@ -457,7 +457,7 @@ static uint32_t _find_config_entry(AACS *aacs, const char *path) ...@@ -457,7 +457,7 @@ static uint32_t _find_config_entry(AACS *aacs, const char *path)
memset(discid, 0, sizeof(discid)); memset(discid, 0, sizeof(discid));
hexstring_to_hex_array(discid, sizeof(discid), hexstring_to_hex_array(discid, sizeof(discid),
aacs->ce->entry.discid); aacs->ce->entry.discid);
if (!memcmp(hash, discid, 20)) { if (!memcmp(aacs->disc_id, discid, 20)) {
DEBUG(DBG_AACS, "Found config entry for discid %s\n", DEBUG(DBG_AACS, "Found config entry for discid %s\n",
aacs->ce->entry.discid); aacs->ce->entry.discid);
break; break;
...@@ -674,6 +674,11 @@ int aacs_decrypt_unit(AACS *aacs, uint8_t *buf) ...@@ -674,6 +674,11 @@ int aacs_decrypt_unit(AACS *aacs, uint8_t *buf)
return 0; return 0;
} }
const uint8_t *aacs_get_disc_id(AACS *aacs)
{
return aacs->disc_id;
}
const uint8_t *aacs_get_vid(AACS *aacs) const uint8_t *aacs_get_vid(AACS *aacs)
{ {
return aacs->vid; return aacs->vid;
......
...@@ -32,6 +32,8 @@ AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path); ...@@ -32,6 +32,8 @@ AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path);
AACS_PUBLIC void aacs_close(AACS *aacs); AACS_PUBLIC void aacs_close(AACS *aacs);
AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */ AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */
AACS_PUBLIC int aacs_decrypt_unit(AACS *aacs, uint8_t *buf); AACS_PUBLIC int aacs_decrypt_unit(AACS *aacs, uint8_t *buf);
AACS_PUBLIC const uint8_t *aacs_get_disc_id(AACS *aacs);
AACS_PUBLIC const uint8_t *aacs_get_vid(AACS *aacs); AACS_PUBLIC const uint8_t *aacs_get_vid(AACS *aacs);
#endif /* AACS_H_ */ #endif /* AACS_H_ */
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