Test RandomKeyId in TestBackEnds could randomly fail
The RandomKeyId test in TestBackEnds tests whether TpmBackEnd::createKey creates a unique random key name. It is only guaranteed to be unique relative to the key names already in the store. But the RandomKeyId test deletes the key on line 256 after is is created:
It is possible (through very unlikely) that TpmBackEnd::createKey could generated the same key again and the test would fail. The purpose of the test is to test that createKey guarantees unique key names in the store. Its purpose is not to test the quality of the random number generator. The test is already checking for unique names by using the keyNames set. Suggestion: Simply remove deleteKey on line 256.