projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix DKDM generation by moving the validity period a day inside the certificate validity.
[dcpomatic.git]
/
src
/
tools
/
dcpomatic_kdm.cc
diff --git
a/src/tools/dcpomatic_kdm.cc
b/src/tools/dcpomatic_kdm.cc
index bda944d83c485590904cd4e5c1daa46282175a85..117e756c72e93df587b325817fd181e9ec03f2f7 100644
(file)
--- a/
src/tools/dcpomatic_kdm.cc
+++ b/
src/tools/dcpomatic_kdm.cc
@@
-40,7
+40,6
@@
#include "lib/job_manager.h"
#include "lib/kdm_with_metadata.h"
#include "lib/exceptions.h"
#include "lib/job_manager.h"
#include "lib/kdm_with_metadata.h"
#include "lib/exceptions.h"
-#include "lib/cinema_kdms.h"
#include "lib/send_kdm_email_job.h"
#include "lib/compose.hpp"
#include "lib/cinema.h"
#include "lib/send_kdm_email_job.h"
#include "lib/compose.hpp"
#include "lib/cinema.h"
@@
-303,7
+302,7
@@
private:
return;
}
return;
}
- list<KDMWithMetadataPtr>
screen_
kdms;
+ list<KDMWithMetadataPtr> kdms;
string title;
#ifdef DCPOMATIC_VARIANT_SWAROOP
string title;
#ifdef DCPOMATIC_VARIANT_SWAROOP
@@
-318,20
+317,27
@@
private:
continue;
}
continue;
}
+ dcp::LocalTime begin(_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute());
+ dcp::LocalTime end(_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute());
+
DecryptedECinemaKDM kdm (
decrypted.id(),
decrypted.name(),
decrypted.key(),
DecryptedECinemaKDM kdm (
decrypted.id(),
decrypted.name(),
decrypted.key(),
-
dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute())
,
- dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute())
+
begin
,
+ end
);
dcp::NameFormat::Map name_values;
name_values['c'] = i->cinema->name;
name_values['s'] = i->name;
);
dcp::NameFormat::Map name_values;
name_values['c'] = i->cinema->name;
name_values['s'] = i->name;
+ name_values['f'] = title;
+ name_values['b'] = begin.date() + " " + begin.time_of_day(true, false);
+ name_values['e'] = end.date() + " " + end.time_of_day(true, false);
+ name_values['i'] = kdm.id();
/* Encrypt */
/* Encrypt */
-
screen_
kdms.push_back (
+ kdms.push_back (
KDMWithMetadataPtr(
new ECinemaKDMWithMetadata(name_values, i->cinema, kdm.encrypt(i->recipient.get()))
)
KDMWithMetadataPtr(
new ECinemaKDMWithMetadata(name_values, i->cinema, kdm.encrypt(i->recipient.get()))
)
@@
-359,10
+365,13
@@
private:
continue;
}
continue;
}
+ dcp::LocalTime begin(_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute());
+ dcp::LocalTime end(_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute());
+
/* Make an empty KDM */
dcp::DecryptedKDM kdm (
/* Make an empty KDM */
dcp::DecryptedKDM kdm (
-
dcp::LocalTime (_timing->from(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute())
,
-
dcp::LocalTime (_timing->until(), i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute())
,
+
begin
,
+
end
,
decrypted.annotation_text().get_value_or (""),
decrypted.content_title_text(),
dcp::LocalTime().as_string()
decrypted.annotation_text().get_value_or (""),
decrypted.content_title_text(),
dcp::LocalTime().as_string()
@@
-373,32
+382,34
@@
private:
kdm.add_key (j);
}
kdm.add_key (j);
}
+ dcp::EncryptedKDM const encrypted = kdm.encrypt(
+ signer, i->recipient.get(), i->trusted_device_thumbprints(), _output->formulation(),
+ !_output->forensic_mark_video(), _output->forensic_mark_audio() ? boost::optional<int>() : 0
+ );
+
dcp::NameFormat::Map name_values;
name_values['c'] = i->cinema->name;
name_values['s'] = i->name;
dcp::NameFormat::Map name_values;
name_values['c'] = i->cinema->name;
name_values['s'] = i->name;
+ name_values['f'] = title;
+ name_values['b'] = begin.date() + " " + begin.time_of_day(true, false);
+ name_values['e'] = end.date() + " " + end.time_of_day(true, false);
+ name_values['i'] = encrypted.cpl_id ();
/* Encrypt */
/* Encrypt */
-
screen_
kdms.push_back (
+ kdms.push_back (
KDMWithMetadataPtr(
KDMWithMetadataPtr(
- new DCPKDMWithMetadata(
- name_values,
- i->cinema,
- kdm.encrypt(
- signer, i->recipient.get(), i->trusted_device_thumbprints(), _output->formulation(),
- !_output->forensic_mark_video(), _output->forensic_mark_audio() ? boost::optional<int>() : 0
- )
- )
+ new DCPKDMWithMetadata(name_values, i->cinema.get(), i->cinema->emails, encrypted)
)
);
}
}
)
);
}
}
- if (
screen_
kdms.empty()) {
+ if (kdms.empty()) {
return;
}
pair<shared_ptr<Job>, int> result = _output->make (
return;
}
pair<shared_ptr<Job>, int> result = _output->make (
-
screen_kdms, title, _timing
, bind (&DOMFrame::confirm_overwrite, this, _1)
+
kdms, title
, bind (&DOMFrame::confirm_overwrite, this, _1)
);
if (result.first) {
);
if (result.first) {