Disallow * in SecretId names
This commit is contained in:
parent
a9e5a67876
commit
b6039e1f9e
@ -184,10 +184,6 @@ namespace sscs.verbs
|
||||
{
|
||||
return DoGetKeyList(ssStore, wo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
{
|
||||
wo.SetError(constants.RetCodes.FAILURE, "Verb Not Supported");
|
||||
@ -334,6 +330,9 @@ namespace sscs.verbs
|
||||
string keyID = wo.GetKeyID();
|
||||
string sValue = (String)wo.GetObject();
|
||||
|
||||
if (secretID.IndexOf("*") < 0)
|
||||
{
|
||||
|
||||
KeyChain keyChain = ssStore.GetKeyChain(keychainID);
|
||||
Secret secret;
|
||||
if( keyChain.CheckIfSecretExists(secretID) == false)
|
||||
@ -350,6 +349,9 @@ namespace sscs.verbs
|
||||
ChangeLinkedKeys(keyChain, secret, keyID, sValue);
|
||||
wo.SetError(constants.RetCodes.SUCCESS, null);
|
||||
}
|
||||
else
|
||||
wo.SetError(constants.RetCodes.FAILURE, null);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
wo.SetError(constants.RetCodes.FAILURE, e.ToString());
|
||||
@ -784,5 +786,6 @@ namespace sscs.verbs
|
||||
CSSSLogger.ExecutionTrace(this);
|
||||
return this.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -84,6 +84,8 @@ namespace sscs.verbs
|
||||
Array.Copy(inBuf,(10+keyChainIdLen+4),secretIdArr,0,secretIdLen);
|
||||
secretId = Encoding.UTF8.GetString(secretIdArr);
|
||||
|
||||
if (secretId.IndexOf("*") < 0)
|
||||
{
|
||||
|
||||
keyLen = BitConverter.ToUInt32(inBuf,(14+(int)keyChainIdLen+(int)secretIdLen));
|
||||
byte[] keyArr = new byte[keyLen];
|
||||
@ -208,6 +210,9 @@ namespace sscs.verbs
|
||||
CSSSLogger.ExpLog(e.ToString());
|
||||
retCode = IPCRetCodes.SSCS_E_SYSTEM_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
retCode = IPCRetCodes.SSCS_E_INVALID_SECRETID;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -76,6 +76,10 @@ namespace sscs.verbs
|
||||
Array.Copy(inBuf,(10+keyChainIdLen+4),secretIdArr,0,secretIdLen);
|
||||
secretId = Encoding.UTF8.GetString(secretIdArr);
|
||||
|
||||
if (secretId.IndexOf("*") < 0)
|
||||
{
|
||||
|
||||
|
||||
secretValLen = BitConverter.ToUInt32(inBuf,
|
||||
(14 + ((int)keyChainIdLen)+((int)secretIdLen)));
|
||||
//secretVal = new byte[secretValLen];
|
||||
@ -190,6 +194,9 @@ namespace sscs.verbs
|
||||
CSSSLogger.ExpLog(e.ToString());
|
||||
retCode = IPCRetCodes.SSCS_E_SYSTEM_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
retCode = IPCRetCodes.SSCS_E_INVALID_SECRETID;
|
||||
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user