diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-28 23:13:37 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-28 23:13:37 +0100 |
| commit | ff9a83e4d57c30409162ae1cb94fe471d8f2cf6f (patch) | |
| tree | b48eda076d3d1cc20c032af6bf43d39dc0626bf8 /src/kdm.cc | |
| parent | c272879a8e748be83acbb190257d78a34be3f25f (diff) | |
Throw NotEncryptedError on an attempt to generate KDM for a non-encrypted asset. Tidy exceptions a bit.
Diffstat (limited to 'src/kdm.cc')
| -rw-r--r-- | src/kdm.cc | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -158,6 +158,10 @@ KDM::KDM ( /* XXX: subtitle assets? */ if ((*i)->asset_list->main_picture) { + if ((*i)->asset_list->main_picture->key_id.empty ()) { + throw NotEncryptedError ("MainPicture"); + } + KDMKey kkey ( signer, cpl.id.substr (9), "MDIK", (*i)->asset_list->main_picture->key_id.substr (9), not_valid_before, not_valid_after, key @@ -168,6 +172,10 @@ KDM::KDM ( } if ((*i)->asset_list->main_stereoscopic_picture) { + if ((*i)->asset_list->main_stereoscopic_picture->key_id.empty ()) { + throw NotEncryptedError ("MainStereoscopicPicture"); + } + KDMKey kkey ( signer, cpl.id.substr (9), "MDIK", (*i)->asset_list->main_stereoscopic_picture->key_id.substr (9), not_valid_before, not_valid_after, key @@ -178,6 +186,10 @@ KDM::KDM ( } if ((*i)->asset_list->main_sound) { + if ((*i)->asset_list->main_sound->key_id.empty ()) { + throw NotEncryptedError ("MainSound"); + } + KDMKey kkey ( signer, cpl.id.substr (9), "MDAK", (*i)->asset_list->main_sound->key_id.substr (9), not_valid_before, not_valid_after, key |
