DecryptedKDM::get_uuid (unsigned char ** p)
{
char buffer[37];
+#ifdef LIBDCP_WINDOWS
+ __mingw_snprintf (
+#else
snprintf (
+#endif
buffer, sizeof(buffer), "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
(*p)[0], (*p)[1], (*p)[2], (*p)[3], (*p)[4], (*p)[5], (*p)[6], (*p)[7],
(*p)[8], (*p)[9], (*p)[10], (*p)[11], (*p)[12], (*p)[13], (*p)[14], (*p)[15]
int const decrypted_len = RSA_private_decrypt (cipher_value_len, cipher_value, decrypted, rsa, RSA_PKCS1_OAEP_PADDING);
if (decrypted_len == -1) {
delete[] decrypted;
- throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0));
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
+ throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0), cipher_value_len, RSA_bits(rsa));
+#else
+ throw KDMDecryptionError (ERR_error_string (ERR_get_error(), 0), cipher_value_len, rsa->n->dmax);
+#endif
}
unsigned char* p = decrypted;
EncryptedKDM
DecryptedKDM::encrypt (
- shared_ptr<const CertificateChain> signer, Certificate recipient, vector<Certificate> trusted_devices, Formulation formulation
+ shared_ptr<const CertificateChain> signer,
+ Certificate recipient,
+ vector<Certificate> trusted_devices,
+ Formulation formulation,
+ bool disable_forensic_marking_picture,
+ optional<int> disable_forensic_marking_audio
) const
{
+ DCP_ASSERT (!_keys.empty ());
+
list<pair<string, string> > key_ids;
list<string> keys;
BOOST_FOREACH (DecryptedKDMKey const & i, _keys) {
_not_valid_before,
_not_valid_after,
formulation,
+ disable_forensic_marking_picture,
+ disable_forensic_marking_audio,
key_ids,
keys
);