diff options
| author | jhurst <jhurst@cinecert.com> | 2014-09-21 13:27:43 +0000 |
|---|---|---|
| committer | jhurst <> | 2014-09-21 13:27:43 +0000 |
| commit | ab3e3df49a9d4a44a3bf11211e31bdeac3ef7bcf (patch) | |
| tree | 52023c92807dde6cb56835e957349327f1b9df0b /src/as-02-wrap.cpp | |
| parent | 8d24b6effb0377fc3041c2e024e7c5593caecc52 (diff) | |
imf bugs
date parse bug
timed-text transform removed
Diffstat (limited to 'src/as-02-wrap.cpp')
| -rwxr-xr-x | src/as-02-wrap.cpp | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/src/as-02-wrap.cpp b/src/as-02-wrap.cpp index 5a51ead..66aacd0 100755 --- a/src/as-02-wrap.cpp +++ b/src/as-02-wrap.cpp @@ -91,6 +91,16 @@ public: return; \ } + +// +static void +create_random_uuid(byte_t* uuidbuf) +{ + Kumu::UUID tmp_id; + GenRandomValue(tmp_id); + memcpy(uuidbuf, tmp_id.Value(), tmp_id.Size()); +} + // void banner(FILE* stream = stdout) @@ -558,9 +568,13 @@ write_JP2K_file(CommandOptions& Options) Info.EncryptedEssence = true; if ( Options.key_id_flag ) - memcpy(Info.CryptographicKeyID, Options.key_id_value, UUIDlen); + { + memcpy(Info.CryptographicKeyID, Options.key_id_value, UUIDlen); + } else - RNG.FillRandom(Info.CryptographicKeyID, UUIDlen); + { + create_random_uuid(Info.CryptographicKeyID); + } Context = new AESEncContext; result = Context->InitKey(Options.key_value); @@ -705,9 +719,13 @@ write_PCM_file(CommandOptions& Options) Info.EncryptedEssence = true; if ( Options.key_id_flag ) - memcpy(Info.CryptographicKeyID, Options.key_id_value, UUIDlen); + { + memcpy(Info.CryptographicKeyID, Options.key_id_value, UUIDlen); + } else - RNG.FillRandom(Info.CryptographicKeyID, UUIDlen); + { + create_random_uuid(Info.CryptographicKeyID); + } Context = new AESEncContext; result = Context->InitKey(Options.key_value); @@ -778,9 +796,6 @@ write_PCM_file(CommandOptions& Options) -#if 0 -// NOT YET, unfinished business with ST 2052-1 - //------------------------------------------------------------------------------------------ // TimedText essence @@ -832,9 +847,13 @@ write_timed_text_file(CommandOptions& Options) Info.EncryptedEssence = true; if ( Options.key_id_flag ) - memcpy(Info.CryptographicKeyID, Options.key_id_value, UUIDlen); + { + memcpy(Info.CryptographicKeyID, Options.key_id_value, UUIDlen); + } else - RNG.FillRandom(Info.CryptographicKeyID, UUIDlen); + { + create_random_uuid(Info.CryptographicKeyID); + } Context = new AESEncContext; result = Context->InitKey(Options.key_value); @@ -897,8 +916,6 @@ write_timed_text_file(CommandOptions& Options) return result; } -#endif - // int main(int argc, const char** argv) |
