Skip to content

Commit 06a9430

Browse files
Fix various 7.0-porting issues in the deploy-sign implementation
1 parent 50469ad commit 06a9430

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

engine/src/deploy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,11 @@ void MCIdeSign::exec_ctxt(MCExecContext &ctxt)
742742
ctxt . Throw();
743743

744744
if (!ctxt . HasError())
745-
if (t_params . certstore != NULL && (t_params . certificate != NULL || t_params . privatekey != NULL))
745+
if (!MCValueIsEmpty(t_params . certstore) && (!MCValueIsEmpty(t_params . certificate) || !MCValueIsEmpty(t_params . privatekey)))
746746
ctxt . Throw();
747747

748748
if (!ctxt . HasError())
749-
if (t_params . certstore == NULL && (t_params . certificate == NULL || t_params . privatekey == NULL))
749+
if (MCValueIsEmpty(t_params . certstore) && (MCValueIsEmpty(t_params . certificate) || MCValueIsEmpty(t_params . privatekey)))
750750
ctxt . Throw();
751751

752752
bool t_can_sign;

engine/src/deploy_sign.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -937,10 +937,8 @@ static bool MCDeploySignWindowsAddTimeStamp(const MCDeploySignParameters& p_para
937937
t_data . setnext(&t_url);
938938
t_url . setvalueref_argument(p_params . timestamper);
939939
extern MCExecContext *MCECptr;
940-
// SN-2014-05-09 [[ ClearResult ]]
941-
// isempty is different from isclear - 'isempty' returns false for a cleared result
942940
if (MCECptr->GetObject() -> message(MCM_post_url, &t_data, False, True) == ES_NORMAL &&
943-
MCresult -> isclear())
941+
MCresult -> isempty())
944942
{
945943
t_failed = false;
946944
break;
@@ -1072,7 +1070,7 @@ bool MCDeploySignWindows(const MCDeploySignParameters& p_params)
10721070
EVP_PKEY* t_privatekey;
10731071
t_cert_chain = nil;
10741072
t_privatekey = nil;
1075-
if (t_success && p_params . certstore != nil)
1073+
if (t_success && !MCValueIsEmpty(p_params . certstore))
10761074
t_success = MCDeployCertStoreLoad(p_params . passphrase,
10771075
p_params . certstore,
10781076
t_cert_chain, t_privatekey);
@@ -1250,7 +1248,7 @@ bool MCDeploySignWindows(const MCDeploySignParameters& p_params)
12501248

12511249
// Now we have our signature, we timestamp it - but only if we were
12521250
// given a timestamp authority url.
1253-
if (t_success && p_params . timestamper != nil)
1251+
if (t_success && !MCValueIsEmpty(p_params . timestamper))
12541252
t_success = MCDeploySignWindowsAddTimeStamp(p_params, t_signature);
12551253

12561254
// We now have a complete PKCS7 SignedData object which is now serialized.

0 commit comments

Comments
 (0)