Commit e336b989 authored by npzacs's avatar npzacs
Browse files

config: store vuk in binary

parent 69e289a6
......@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int print_digit_key_pair_enties(digit_key_pair_list *list);
static int print_title_entries(title_entry_list *list);
......@@ -52,6 +53,7 @@ static int print_digit_key_pair_enties(digit_key_pair_list *list)
/* Function that prints all entries parsed from a config file */
static int print_title_entries(title_entry_list *list)
{
static const uint8_t empty_key[16] = {0};
char tmp[256];
if (!list)
......@@ -83,8 +85,8 @@ static int print_title_entries(title_entry_list *list)
print_digit_key_pair_enties(cursor->entry.bn);
}
#endif
if (cursor->entry.vuk)
printf(" VUK: %s\n", cursor->entry.vuk);
if (memcmp(cursor->entry.vuk, empty_key, 16))
printf(" VUK: %s\n", str_print_hex(tmp, cursor->entry.vuk, 16));
#if 0
if (cursor->entry.pak)
{
......
......@@ -534,7 +534,6 @@ int keydbcfg_config_file_close(config_file *cfgfile)
X_FREE(cfgfile->list->entry.mek);
X_FREE(cfgfile->list->entry.vid);
/*DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.bn);*/
X_FREE(cfgfile->list->entry.vuk);
/*DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.pak);*/
/*DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.tk);*/
DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.uk);
......@@ -725,8 +724,8 @@ static int add_entry(title_entry_list *list, int type, char *entry)
case ENTRY_TYPE_VUK:
CHECK_KEY_LENGTH("vuk", 32)
X_FREE(list->entry.vuk);
list->entry.vuk = entry;
hexstring_to_hex_array(list->entry.vuk, 16, entry);
X_FREE(entry);
break;
default:
......
......@@ -92,7 +92,7 @@ struct title_entry_t
char *mek;
char *vid;
//digit_key_pair_list *bn;
char *vuk;
uint8_t vuk[16];
//digit_key_pair_list *pak;
//digit_key_pair_list *tk;
digit_key_pair_list *uk;
......
......@@ -767,8 +767,8 @@ static void _find_config_entry(AACS *aacs, title_entry_list *ce,
str_print_hex(str2, ce->entry.discid, 20), str_print_hex(str, aacs->vid, 16));
}
if (ce->entry.vuk) {
hexstring_to_hex_array(vuk, 16, ce->entry.vuk);
if (memcmp(ce->entry.vuk, empty_key, 16)) {
memcpy(vuk, ce->entry.vuk, 16);
BD_DEBUG(DBG_AACS, "Found volume unique key for %s: %s\n",
str_print_hex(str2, ce->entry.discid, 20), str_print_hex(str, vuk, 16));
......
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