regression 6013: test transforming transient object to persistent

Extends regression case 6013 to test transforming a transient object
into a persistent object with TEE_CreatePersistentObject(). This is a
new feature in TEE Internal API v1.3 and is done by supplying a NULL
pointer instead of an output object pointer to
TEE_CreatePersistentObject().

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/ta/storage/storage.c b/ta/storage/storage.c
index 4ad8f8c..3db9d41 100644
--- a/ta/storage/storage.c
+++ b/ta/storage/storage.c
@@ -467,6 +467,27 @@
 		goto cleanup2;
 	}
 
+	TEE_CloseAndDeletePersistentObject1(persistent_key);
+
+	/* Transform the transient object into a persistent object */
+	result = TEE_CreatePersistentObject(params[0].value.a,
+					    &objectID, sizeof(objectID),
+					    flags, transient_key, NULL, 0,
+					    NULL);
+	if (result != TEE_SUCCESS) {
+		EMSG("Failed to create a persistent key: 0x%x", result);
+		goto cleanup2;
+	}
+	persistent_key = transient_key;
+	transient_key = TEE_HANDLE_NULL;
+
+	TEE_GetObjectInfo1(persistent_key, &keyInfo2);
+	result = check_obj(&keyInfo, &keyInfo2);
+	if (result != TEE_SUCCESS) {
+		EMSG("keyInfo and keyInfo2 are different");
+		goto cleanup2;
+	}
+
 	TEE_CloseObject(persistent_key);
 
 	result = TEE_OpenPersistentObject(params[0].value.a,