Minor fix for linux build.

This commit is contained in:
Jim Norman 2007-01-05 11:07:19 +00:00
parent d81e894996
commit 503da7f739

View File

@ -234,15 +234,15 @@ namespace sscs.verbs
case MiCasaRequestReply.VERB_CREATE_POLICY_DIR: case MiCasaRequestReply.VERB_CREATE_POLICY_DIR:
{ {
return DoCreatePolicyDir(ssStore, wo); return DoCreatePolicyDir(ssStore, wo);
} }
case MiCasaRequestReply.VERB_GET_CREATE_TIME: case MiCasaRequestReply.VERB_GET_CREATE_TIME:
{ {
return DoGetCreateTime(ssStore, wo); return DoGetCreateTime(ssStore, wo);
} }
case MiCasaRequestReply.VERB_GET_MODIFIED_TIME: case MiCasaRequestReply.VERB_GET_MODIFIED_TIME:
{ {
return DoGetModifiedTime(ssStore, wo); return DoGetModifiedTime(ssStore, wo);
} }
default: default:
@ -262,80 +262,80 @@ namespace sscs.verbs
} }
return wo; return wo;
} }
private WrappedObject DoGetModifiedTime(SecretStore ssStore, WrappedObject wo) private WrappedObject DoGetModifiedTime(SecretStore ssStore, WrappedObject wo)
{ {
return DoGetTimeStamp(ssStore, wo, false); return DoGetTimeStamp(ssStore, wo, false);
} }
private WrappedObject DoGetCreateTime(SecretStore ssStore, WrappedObject wo) private WrappedObject DoGetCreateTime(SecretStore ssStore, WrappedObject wo)
{ {
return DoGetTimeStamp(ssStore, wo, true); return DoGetTimeStamp(ssStore, wo, true);
} }
private WrappedObject DoGetTimeStamp(SecretStore ssStore, WrappedObject wo, bool bGetCreateTime) private WrappedObject DoGetTimeStamp(SecretStore ssStore, WrappedObject wo, bool bGetCreateTime)
{ {
string keychainID = wo.GetKeychainID(); string keychainID = wo.GetKeychainID();
string secretID = wo.GetSecretID(); string secretID = wo.GetSecretID();
string keyID = wo.GetKeyID(); string keyID = wo.GetKeyID();
KeyChain keyChain; KeyChain keyChain;
if (keychainID != null) if (keychainID != null)
keyChain = ssStore.GetKeyChain(keychainID); keyChain = ssStore.GetKeyChain(keychainID);
else else
keyChain = ssStore.GetKeyChainDefault(); keyChain = ssStore.GetKeyChainDefault();
Secret secret = null; Secret secret = null;
DateTime dt = new DateTime(0); DateTime dt = new DateTime(0);
if (keyChain.CheckIfSecretExists(secretID) == false) if (keyChain.CheckIfSecretExists(secretID) == false)
{ {
wo.SetError(constants.RetCodes.FAILURE, "Secret does not exist"); wo.SetError(constants.RetCodes.FAILURE, "Secret does not exist");
} }
else else
{ {
secret = keyChain.GetSecret(secretID); secret = keyChain.GetSecret(secretID);
if (keyID != null) if (keyID != null)
{ {
KeyValue kv = secret.GetKeyValue(keyID); KeyValue kv = secret.GetKeyValue(keyID);
if (kv != null) if (kv != null)
{ {
if (bGetCreateTime) if (bGetCreateTime)
{ {
dt = kv.CreatedTime; dt = kv.CreatedTime;
} }
else else
{ {
dt = kv.ModifiedTime; dt = kv.ModifiedTime;
} }
} }
else else
{ {
wo.SetError(constants.RetCodes.FAILURE, "Secret does not exist"); wo.SetError(constants.RetCodes.FAILURE, "Secret does not exist");
} }
} }
else else
{ {
if (bGetCreateTime) if (bGetCreateTime)
{ {
dt = secret.CreatedTime; dt = secret.CreatedTime;
} }
else else
{ {
dt = secret.ModifiedTime; dt = secret.ModifiedTime;
} }
} }
} }
if (dt != null) if (dt.Ticks > 0)
{ {
wo.SetObject(dt); wo.SetObject(dt);
wo.SetError(constants.RetCodes.SUCCESS, null); wo.SetError(constants.RetCodes.SUCCESS, null);
} }
return wo; return wo;
} }
private WrappedObject DoCreatePolicyDir(SecretStore ssStore, WrappedObject wo) private WrappedObject DoCreatePolicyDir(SecretStore ssStore, WrappedObject wo)