if(IOTVTICAL_VALID_ACCESS != IsRequestWithinValidTime(cred->period, NULL))
{
OIC_LOG (INFO, TAG, "Credentials are expired.");
- ret = -1;
return ret;
}
}
uint32_t outKeySize;
if(NULL == outKey)
{
- result_length = -1;
OIC_LOG (ERROR, TAG, "Failed to memoray allocation.");
return ret;
}
if(B64_OK == b64Decode((char*)cred->privateData.data, cred->privateData.len, outKey, outBufSize, &outKeySize))
{
memcpy(result, outKey, outKeySize);
- result_length = outKeySize;
+ ret = outKeySize;
}
else
{
- result_length = -1;
OIC_LOG (ERROR, TAG, "Failed to base64 decoding.");
}
OICFree(outKey);
}
- return result_length;
+ return ret;
}
}
}
default:
{
OIC_LOG (ERROR, TAG, "Wrong value passed for CADtlsPskCredType_t.");
- ret = -1;
}
break;
}