static size_t findNonZeroInt(DerData *it) {
while (it->size) {
const uint8_t tag = *it->data;
+ ssize_t len;
scroll(it, 1);
- ssize_t len = getLen(it);
+ len = getLen(it);
if (len < 0)
goto fail;
switch (tag) {
}
TEE_Result derParseAsymKey(const uint8_t *inp, size_t inpSize, DerData out[], size_t outSize) {
+ DerData in;
+ size_t len0;
assert(inp);
assert(inpSize);
assert(out);
assert(outSize);
- DerData in = { .data = (uint8_t *)inp, .size = inpSize };
- const size_t len0 = findNonZeroInt(&in);
+ in.data = (uint8_t *)inp;
+ in.size = inpSize;
+ len0 = findNonZeroInt(&in);
switch (len0) {
case 1+512/8:
case 1+1024/8:
uint32_t attr_size,
TEE_ObjectHandle *hndl)
{
+ TEE_Result ret;
assert(attr);
assert(attr_size);
assert(hndl);
- TEE_Result ret = TEE_AllocateTransientObject(object_type, max_object_size, hndl);
+ ret = TEE_AllocateTransientObject(object_type, max_object_size, hndl);
if (TEE_SUCCESS != ret) {
LOG("TEE_AllocateTransientObject has failed with=%x. Arguments=(object_type=%X, "
"max_object_size=%u.", ret, object_type, max_object_size);
TEE_Attribute attr[MAX_ATTRIBUTES_SIZE];
const uint32_t *attrId;
uint32_t attrCount, keyType;
+ TEE_Result ret;
switch (type) {
case TYPE_AKEY_PUBLIC_DSA:
return TEE_ERROR_BAD_PARAMETERS;
}
- TEE_Result ret = derParseAsymKey(der.data, der.data_size, derAttr, attrCount);
+ ret = derParseAsymKey(der.data, der.data_size, derAttr, attrCount);
if (TEE_SUCCESS != ret) {
LOG("Unable to parse der for key type %u", type);
return ret;