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
5ceca4fd
Commit
5ceca4fd
authored
Jul 14, 2020
by
npzacs
Committed by
hpi1
Jul 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keydbcfg: Add missing error checks (invalid hexstring)
parent
58fb6beb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
src/file/keydbcfg.c
src/file/keydbcfg.c
+9
-7
No files found.
src/file/keydbcfg.c
View file @
5ceca4fd
...
...
@@ -168,9 +168,10 @@ static int _parse_pk_file(config_file *cf, AACS_FILE_H *fp)
pk_list
*
e
=
calloc
(
1
,
sizeof
(
pk_list
));
if
(
e
)
{
hexstring_to_hex_array
(
e
->
key
,
16
,
str
);
if
(
_is_duplicate_pk
(
cf
->
pkl
,
e
->
key
))
{
if
(
!
hexstring_to_hex_array
(
e
->
key
,
16
,
str
))
{
BD_DEBUG
(
DBG_FILE
,
"Skipping invalid processing key %s
\n
"
,
str
);
X_FREE
(
e
);
}
else
if
(
_is_duplicate_pk
(
cf
->
pkl
,
e
->
key
))
{
BD_DEBUG
(
DBG_FILE
,
"Skipping duplicate processing key %s
\n
"
,
str
);
X_FREE
(
e
);
}
else
{
...
...
@@ -229,10 +230,11 @@ static int _parse_cert_file(config_file *cf, AACS_FILE_H *fp)
cert_list
*
e
=
calloc
(
1
,
sizeof
(
cert_list
));
if
(
e
)
{
hexstring_to_hex_array
(
e
->
host_priv_key
,
20
,
host_priv_key
);
hexstring_to_hex_array
(
e
->
host_cert
,
92
,
host_cert
);
if
(
_is_duplicate_cert
(
cf
->
host_cert_list
,
e
))
{
if
(
!
hexstring_to_hex_array
(
e
->
host_priv_key
,
20
,
host_priv_key
)
||
!
hexstring_to_hex_array
(
e
->
host_cert
,
92
,
host_cert
))
{
BD_DEBUG
(
DBG_FILE
,
"Skipping invalid certificate entry %s %s
\n
"
,
host_priv_key
,
host_cert
);
X_FREE
(
e
);
}
else
if
(
_is_duplicate_cert
(
cf
->
host_cert_list
,
e
))
{
BD_DEBUG
(
DBG_FILE
,
"Skipping duplicate certificate entry %s %s
\n
"
,
host_priv_key
,
host_cert
);
X_FREE
(
e
);
}
else
{
...
...
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