-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
A-StorageRelated to key storage infrastructureRelated to key storage infrastructureO-LinuxLinuxLinuxP-LOWLow priority issueLow priority issue
Description
Just noticed while auditing the code
Lines 84 to 104 in 601fd4d
int e4c_getindex(e4storage *store, const char *topic) | |
{ | |
int i; | |
uint8_t hash[E4_TOPICHASH_LEN]; | |
/* hash the topic */ | |
if (e4c_derive_topichash(hash, E4_TOPICHASH_LEN, topic) != 0) { | |
return E4_ERROR_PERSISTENCE_ERROR; | |
} | |
/* look for it */ | |
for (i = 0; i < store->topiccount; i++) | |
{ | |
if (memcmp(store->topics[i].topic, hash, E4_TOPICHASH_LEN) == 0) | |
{ | |
break; | |
} | |
} | |
if (i >= store->topiccount) return E4_ERROR_TOPICKEY_MISSING; | |
return i; | |
} |
but we don't have an explanation on the number of keys that can be stored in e4store. What's going to be the usual size? How often will it be called? Would be nice to have an idea about this and add a comment if the number of keys will be very small but if lots we need to audit this code and profile it as it could definitely become an attack vector to issue worst case algorithmic complexity attacks.
Metadata
Metadata
Assignees
Labels
A-StorageRelated to key storage infrastructureRelated to key storage infrastructureO-LinuxLinuxLinuxP-LOWLow priority issueLow priority issue