libaacs | branch: master | npzacs <npz...@gmail.com> | Tue Feb 9 14:38:02 2016 +0200| [e336b9899bc631c1fc91bf4557a352f6e4845a22] | committer: npzacs
config: store vuk in binary > http://git.videolan.org/gitweb.cgi/libaacs.git/?a=commit;h=e336b9899bc631c1fc91bf4557a352f6e4845a22 --- src/examples/parser_test.c | 6 ++++-- src/file/keydbcfg-parser.y | 5 ++--- src/file/keydbcfg.h | 2 +- src/libaacs/aacs.c | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/examples/parser_test.c b/src/examples/parser_test.c index 41a8607..26f4d6a 100644 --- a/src/examples/parser_test.c +++ b/src/examples/parser_test.c @@ -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) { diff --git a/src/file/keydbcfg-parser.y b/src/file/keydbcfg-parser.y index d573eb4..a91527e 100644 --- a/src/file/keydbcfg-parser.y +++ b/src/file/keydbcfg-parser.y @@ -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: diff --git a/src/file/keydbcfg.h b/src/file/keydbcfg.h index 31ff198..cf1a385 100644 --- a/src/file/keydbcfg.h +++ b/src/file/keydbcfg.h @@ -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; diff --git a/src/libaacs/aacs.c b/src/libaacs/aacs.c index 76fa6f6..24af404 100644 --- a/src/libaacs/aacs.c +++ b/src/libaacs/aacs.c @@ -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)); _______________________________________________ libaacs-devel mailing list libaacs-devel@videolan.org https://mailman.videolan.org/listinfo/libaacs-devel