Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
48a25022
Commit
48a25022
authored
Jul 09, 2020
by
npzacs
Committed by
hpi1
Jul 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert unit keys in parser
parent
ed63fc91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
9 deletions
+18
-9
src/devtools/parser_test.c
src/devtools/parser_test.c
+6
-3
src/file/keydbcfg-parser.y
src/file/keydbcfg-parser.y
+8
-2
src/file/keydbcfg.h
src/file/keydbcfg.h
+1
-1
src/libaacs/aacs.c
src/libaacs/aacs.c
+3
-3
No files found.
src/devtools/parser_test.c
View file @
48a25022
...
...
@@ -27,9 +27,13 @@
static
int
print_digit_key_pair_enties
(
digit_key_pair_list
*
list
);
static
int
print_title_entries
(
title_entry_list
*
list
);
static
const
uint8_t
empty_key
[
16
]
=
{
0
};
/* Function to print the entres in a digit key pair list */
static
int
print_digit_key_pair_enties
(
digit_key_pair_list
*
list
)
{
char
tmp
[
256
];
if
(
!
list
)
{
printf
(
"Error: No digit key pair list passed as parameter.
\n
"
);
...
...
@@ -39,10 +43,10 @@ static int print_digit_key_pair_enties(digit_key_pair_list *list)
digit_key_pair_list
*
cursor
=
list
;
while
(
cursor
)
{
if
(
!
cursor
->
key_pair
.
key
)
if
(
!
memcmp
(
cursor
->
key_pair
.
key
,
empty_key
,
16
)
)
break
;
printf
(
" %u - %s
\n
"
,
cursor
->
key_pair
.
digit
,
cursor
->
key_pair
.
key
);
printf
(
" %u - %s
\n
"
,
cursor
->
key_pair
.
digit
,
str_print_hex
(
tmp
,
cursor
->
key_pair
.
key
,
16
)
);
cursor
=
cursor
->
next
;
}
...
...
@@ -53,7 +57,6 @@ 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
)
...
...
src/file/keydbcfg-parser.y
View file @
48a25022
...
...
@@ -48,7 +48,6 @@
while (X) \
{ \
digit_key_pair_list *pnext = X->next;\
X_FREE(X->key_pair.key); \
X_FREE(X); \
X = pnext; \
} \
...
...
@@ -772,8 +771,15 @@ static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list,
return NULL;
}
if (!key || strlen(key) != 32) {
fprintf(stderr, "Ignoring bad UK entry %s\n", key ? key : "<null>");
X_FREE(key);
return list;
}
list->key_pair.digit = digit;
list->key_pair.key = key;
hexstring_to_hex_array(list->key_pair.key, 16, key);
X_FREE(key);
list->next = new_digit_key_pair_list();
...
...
src/file/keydbcfg.h
View file @
48a25022
...
...
@@ -30,7 +30,7 @@ typedef struct digit_key_pair_t digit_key_pair;
struct
digit_key_pair_t
{
unsigned
int
digit
;
char
*
key
;
uint8_t
key
[
16
]
;
};
/* list of digit_key_pair struct used in title entry */
...
...
src/libaacs/aacs.c
View file @
48a25022
...
...
@@ -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
&&
ukcursor
->
key_pair
.
key
)
{
while
(
ukcursor
&&
memcmp
(
ukcursor
->
key_pair
.
key
,
empty_key
,
16
)
)
{
num_uks
++
;
ukcursor
=
ukcursor
->
next
;
}
...
...
@@ -897,8 +897,8 @@ static void _find_config_entry(AACS *aacs, title_entry_list *ce,
num_uks
=
0
;
ukcursor
=
ce
->
entry
.
uk
;
while
(
ukcursor
&&
ukcursor
->
key_pair
.
key
)
{
hexstring_to_hex_arra
y
(
aacs
->
uk
->
uk
[
num_uks
].
key
,
16
,
ukcursor
->
key_pair
.
key
);
while
(
ukcursor
&&
memcmp
(
ukcursor
->
key_pair
.
key
,
empty_key
,
16
)
)
{
memcp
y
(
aacs
->
uk
->
uk
[
num_uks
].
key
,
ukcursor
->
key_pair
.
key
,
16
);
BD_DEBUG
(
DBG_AACS
,
"Unit key %u from keydb entry: %s
\n
"
,
num_uks
,
...
...
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