Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
7f63a556
Commit
7f63a556
authored
Jul 09, 2020
by
npzacs
Committed by
hpi1
Jul 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless terminator entry from unit key list
parent
48a25022
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
34 deletions
+19
-34
src/devtools/parser_test.c
src/devtools/parser_test.c
+0
-3
src/file/keydbcfg-parser.y
src/file/keydbcfg-parser.y
+17
-29
src/libaacs/aacs.c
src/libaacs/aacs.c
+2
-2
No files found.
src/devtools/parser_test.c
View file @
7f63a556
...
...
@@ -43,9 +43,6 @@ static int print_digit_key_pair_enties(digit_key_pair_list *list)
digit_key_pair_list
*
cursor
=
list
;
while
(
cursor
)
{
if
(
!
memcmp
(
cursor
->
key_pair
.
key
,
empty_key
,
16
))
break
;
printf
(
" %u - %s
\n
"
,
cursor
->
key_pair
.
digit
,
str_print_hex
(
tmp
,
cursor
->
key_pair
.
key
,
16
));
cursor
=
cursor
->
next
;
...
...
src/file/keydbcfg-parser.y
View file @
7f63a556
...
...
@@ -78,9 +78,7 @@ static void add_cert_entry(config_file *cf, char *host_priv_key, char *host_cert
static title_entry_list *new_title_entry_list(void);
static int add_entry(title_entry_list *list, int type, char *entry);
static digit_key_pair_list *new_digit_key_pair_list(void);
static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
int type, unsigned int digit, char *key);
static digit_key_pair_list *new_digit_key_pair_entry(int type, unsigned int digit, char *key);
/*
static int add_date_entry(title_entry_list *list, unsigned int year,
unsigned int month, unsigned int day);
...
...
@@ -443,10 +441,14 @@ uk_data
{
if (!dkplist)
{
dkplist = new_digit_key_pair_
list(
);
dkplist = new_digit_key_pair_
entry(ENTRY_TYPE_UK, $1, $3
);
celist->entry.uk = dkplist;
} else {
dkplist->next = new_digit_key_pair_entry(ENTRY_TYPE_UK, $1, $3);
if (dkplist->next)
dkplist = dkplist->next;
}
dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_UK, $1,
$3);
X_FREE(
$3);
}
;
...
...
@@ -751,39 +753,25 @@ static int add_entry(title_entry_list *list, int type, char *entry)
return 1;
}
/* Function that returns pointer to new digit key pair list */
static digit_key_pair_list *new_digit_key_pair_list(void)
{
digit_key_pair_list *list = (digit_key_pair_list *)calloc(1, sizeof(*list));
if (!list) {
fprintf(stderr, "Error allocating memory for new digit key pair entry list!\n");
}
return list;
}
/* Function used to add a digit/key pair to a list of digit key pair entries */
static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
int type, unsigned int digit, char *key)
static digit_key_pair_list *new_digit_key_pair_entry(int type, unsigned int digit, char *key)
{
if (!list)
{
fprintf(stderr, "Error: No digit key pair list passed as parameter.\n");
return NULL;
}
digit_key_pair_list *list;
if (!key || strlen(key) != 32) {
fprintf(stderr, "Ignoring bad UK entry %s\n", key ? key : "<null>");
X_FREE(key);
return list;
return NULL;
}
list = (digit_key_pair_list *)calloc(1, sizeof(*list));
if (!list) {
fprintf(stderr, "Error allocating memory for new digit key pair entry list!\n");
return NULL;
}
list->key_pair.digit = digit;
hexstring_to_hex_array(list->key_pair.key, 16, key);
X_FREE(key);
list->next = new_digit_key_pair_list();
return list->next;
return list;
}
/* Function to add a date entry */
...
...
src/libaacs/aacs.c
View file @
7f63a556
...
...
@@ -876,7 +876,7 @@ static void _find_config_entry(AACS *aacs, title_entry_list *ce,
/* count keys */
unsigned
num_uks
=
0
;
digit_key_pair_list
*
ukcursor
=
ce
->
entry
.
uk
;
while
(
ukcursor
&&
memcmp
(
ukcursor
->
key_pair
.
key
,
empty_key
,
16
)
)
{
while
(
ukcursor
)
{
num_uks
++
;
ukcursor
=
ukcursor
->
next
;
}
...
...
@@ -897,7 +897,7 @@ static void _find_config_entry(AACS *aacs, title_entry_list *ce,
num_uks
=
0
;
ukcursor
=
ce
->
entry
.
uk
;
while
(
ukcursor
&&
memcmp
(
ukcursor
->
key_pair
.
key
,
empty_key
,
16
)
)
{
while
(
ukcursor
)
{
memcpy
(
aacs
->
uk
->
uk
[
num_uks
].
key
,
ukcursor
->
key_pair
.
key
,
16
);
BD_DEBUG
(
DBG_AACS
,
"Unit key %u from keydb entry: %s
\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment