Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Baptiste Kempf
libaacs
Commits
7d4d26a5
Commit
7d4d26a5
authored
Apr 26, 2015
by
npzacs
Browse files
Add aacs_get_bdj_root_cert_hash() and aacs_get_content_cert_id()
parent
b56e1db8
Changes
6
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
7d4d26a5
- Add aacs_get_bdj_root_cert_hash().
- Add aacs_get_content_cert_id().
- Verify content certificate signature.
- Fix build with gcrypt < 1.6.0.
...
...
src/examples/aacs_info.c
View file @
7d4d26a5
...
...
@@ -114,6 +114,9 @@ int main (int argc, char **argv)
const
uint8_t
*
pmsn
=
aacs_get_pmsn
(
aacs
);
const
int
bec
=
aacs_get_bus_encryption
(
aacs
);
const
uint8_t
*
binding_id
=
aacs_get_device_binding_id
(
aacs
);
const
uint8_t
*
bdj_hash
=
aacs_get_bdj_root_cert_hash
(
aacs
);
const
uint8_t
*
cc_id
=
aacs_get_content_cert_id
(
aacs
);
printf
(
"Disc ID: %s
\n
"
,
id
?
_hex2str
(
id
,
20
)
:
"???"
);
printf
(
"VID : %s
\n
"
,
vid
?
_hex2str
(
vid
,
16
)
:
"???"
);
printf
(
"MKBv : %d
\n
"
,
aacs_get_mkb_version
(
aacs
));
...
...
@@ -121,7 +124,10 @@ int main (int argc, char **argv)
printf
(
"Bus encryption:
\n
"
);
printf
(
" Device support: %s
\n
"
,
(
bec
&
AACS_BUS_ENCRYPTION_CAPABLE
)
?
"yes"
:
"no"
);
printf
(
" Enabled in media: %s
\n
"
,
(
bec
&
AACS_BUS_ENCRYPTION_ENABLED
)
?
"yes"
:
"no"
);
printf
(
"Device binding ID: %s
\n
"
,
binding_id
?
_hex2str
(
binding_id
,
16
)
:
"???"
);
printf
(
"Content Certificate ID: %s
\n
"
,
cc_id
?
_hex2str
(
cc_id
,
6
)
:
"???"
);
printf
(
"BD-J Root Cert hash: %s
\n
"
,
bdj_hash
?
_hex2str
(
bdj_hash
,
20
)
:
"???"
);
printf
(
"Device binding ID: %s
\n
"
,
binding_id
?
_hex2str
(
binding_id
,
16
)
:
"???"
);
aacs_close
(
aacs
);
...
...
src/libaacs/aacs.c
View file @
7d4d26a5
...
...
@@ -1179,6 +1179,22 @@ const uint8_t *aacs_get_disc_id(AACS *aacs)
return
aacs
->
disc_id
;
}
const
uint8_t
*
aacs_get_content_cert_id
(
AACS
*
aacs
)
{
if
(
aacs
&&
aacs
->
cc
)
{
return
aacs
->
cc
->
cc_id
;
}
return
NULL
;
}
const
uint8_t
*
aacs_get_bdj_root_cert_hash
(
AACS
*
aacs
)
{
if
(
aacs
&&
aacs
->
cc
)
{
return
aacs
->
cc
->
bdj_root_cert_hash
;
}
return
NULL
;
}
const
uint8_t
*
aacs_get_mk
(
AACS
*
aacs
)
{
if
(
!
memcmp
(
aacs
->
mk
,
empty_key
,
16
))
{
...
...
src/libaacs/aacs.h
View file @
7d4d26a5
...
...
@@ -58,6 +58,8 @@ AACS_PUBLIC const uint8_t *aacs_get_disc_id(AACS *aacs);
AACS_PUBLIC
const
uint8_t
*
aacs_get_vid
(
AACS
*
aacs
);
/* may fail even if disc can be decrypted */
AACS_PUBLIC
const
uint8_t
*
aacs_get_pmsn
(
AACS
*
aacs
);
/* may fail even if disc can be decrypted */
AACS_PUBLIC
const
uint8_t
*
aacs_get_mk
(
AACS
*
aacs
);
/* may fail even if disc can be decrypted */
AACS_PUBLIC
const
uint8_t
*
aacs_get_content_cert_id
(
AACS
*
aacs
);
AACS_PUBLIC
const
uint8_t
*
aacs_get_bdj_root_cert_hash
(
AACS
*
aacs
);
/* AACS Online */
AACS_PUBLIC
const
uint8_t
*
aacs_get_device_binding_id
(
AACS
*
aacs
);
...
...
src/libaacs/content_cert.c
View file @
7d4d26a5
...
...
@@ -66,6 +66,8 @@ CONTENT_CERT *cc_parse(const void *data, size_t len)
CONTENT_CERT
*
c
=
calloc
(
1
,
sizeof
(
CONTENT_CERT
));
c
->
bus_encryption_enabled_flag
=
p
[
1
]
>>
7
;
memcpy
(
c
->
cc_id
,
p
+
14
,
6
);
memcpy
(
c
->
bdj_root_cert_hash
,
p
+
46
,
20
);
return
c
;
}
...
...
src/libaacs/content_cert.h
View file @
7d4d26a5
...
...
@@ -29,6 +29,9 @@ typedef struct content_cert CONTENT_CERT;
struct
content_cert
{
uint8_t
bus_encryption_enabled_flag
;
uint8_t
cc_id
[
6
];
uint8_t
bdj_root_cert_hash
[
20
];
};
...
...
Write
Preview
Supports
Markdown
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