mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-03-10 22:43:54 +00:00
Add TODO comments to randomise keyring slot allocation
This commit is contained in:
parent
166a03c7c6
commit
b7ba297e31
@ -1265,6 +1265,7 @@ static void set_slot(keyring_file *k, unsigned slot, int bitvalue)
|
||||
|
||||
/* Find free slot in keyring. Slot 0 in any slab is the BAM and possible keyring salt, so only
|
||||
* search for space in slots 1 and above. TODO: Extend to handle more than one slab!
|
||||
* TODO: random search to avoid predictability of used slots!
|
||||
*/
|
||||
static unsigned find_free_slot(const keyring_file *k)
|
||||
{
|
||||
|
@ -85,6 +85,10 @@ test_keyringList() {
|
||||
tfw_cat http.headers list.json
|
||||
tfw_preserve list.json
|
||||
assert [ "$(jq '.rows | length' list.json)" = $IDENTITY_COUNT ]
|
||||
# TODO: these tests only work because the listed order of identities is the
|
||||
# order of creation, which makes locked identities easy to attack. When the
|
||||
# random search TODO in keyring.c:find_free_slot() is done, then these tests
|
||||
# should fail.
|
||||
assert [ "$(jq -r '.rows[0][0]' list.json)" = $SIDA1 ]
|
||||
assert [ "$(jq -r '.rows[4][0]' list.json)" = $SIDA5 ]
|
||||
assert [ "$(jq -r '.rows[9][0]' list.json)" = $SIDA10 ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user