}
}
+RUNNER_TEST(T3031_manager_test_decrypt_from_another_label)
+{
+ int temp;
+ CharPtr top_label = get_label();
+ ScopedSaveData ssd(TEST_ALIAS);
+
+ allow_access(TEST_ALIAS, TEST_LABEL2, CKMC_AR_READ);
+ {
+ ScopedLabel sl(TEST_LABEL2);
+
+ check_read_allowed(aliasWithLabel(top_label.get(), TEST_ALIAS).c_str());
+
+ // remove the DKEK key - so that on read it must be added again
+ RUNNER_ASSERT_MSG_BT(CKMC_ERROR_NONE == (temp = ckmc_lock_user_key(0)),
+ "Error=" << temp);
+
+ // on this read, DKEK key will be added again
+ check_read_allowed(aliasWithLabel(top_label.get(), TEST_ALIAS).c_str());
+ }
+}
+
+
/////////////////////////////////////////////////////////////////////////////
// Control