summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-19 15:20:58 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-19 15:20:58 +0000
commit999a6a861d9d3b97c2176a5fad353a9ea842d994 (patch)
tree87adb39146ff1f909900fc21c0e976d127cc628f /src
parenta4e6ac6c6a6fd1d57b70bffa28ace4343e8a09d6 (diff)
A few fixes to signer chain generation on Windows.
Diffstat (limited to 'src')
-rw-r--r--src/signer_chain.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/signer_chain.cc b/src/signer_chain.cc
index 61b0271a..d407286e 100644
--- a/src/signer_chain.cc
+++ b/src/signer_chain.cc
@@ -54,13 +54,18 @@ static void command (string cmd)
memset (&startup_info, 0, sizeof (startup_info));
startup_info.cb = sizeof (startup_info);
PROCESS_INFORMATION process_info;
+
+ /* XXX: this doesn't actually seem to work; failing commands end up with
+ a return code of 0
+ */
if (CreateProcessW (0, buffer, 0, 0, FALSE, CREATE_NO_WINDOW, 0, 0, &startup_info, &process_info)) {
WaitForSingleObject (process_info.hProcess, INFINITE);
+ DWORD c;
+ if (GetExitCodeProcess (process_info.hProcess, &c)) {
+ code = c;
+ }
CloseHandle (process_info.hProcess);
CloseHandle (process_info.hThread);
- DWORD c;
- GetExitCodeProcess (process_info.hProcess, &c);
- code = c;
}
delete[] buffer;
@@ -85,7 +90,7 @@ static string
public_key_digest (boost::filesystem::path private_key, boost::filesystem::path openssl)
{
boost::filesystem::path public_name = private_key.string() + ".public";
-
+
/* Create the public key from the private key */
stringstream s;
s << "\"" << openssl.string() << "\" rsa -outform PEM -pubout -in " << private_key.string() << " -out " << public_name.string ();
@@ -95,6 +100,9 @@ public_key_digest (boost::filesystem::path private_key, boost::filesystem::path
string pub;
ifstream f (public_name.string().c_str ());
+ if (!f.good ()) {
+ throw libdcp::MiscError ("public key not found");
+ }
bool read = false;
while (f.good ()) {