This issue is a code review in progress. I see no suitable issue label for that, so am leaving it with none.
While reviewing #201, I looked into other places where we may zeroize the data struct, and found this:
|
struct crypt_internal *cint = get_internal (data); |
struct crypt_internal *cint = get_internal (data);
h->crypt (phrase, phr_size, setting, set_size,
(unsigned char *)data->output, sizeof data->output,
cint->alg_specific, sizeof cint->alg_specific);
explicit_bzero (data->internal, sizeof data->internal);
This zeroizes internal, but leaves the initialized field as-is. For hash implementations that compute and cache constants in internal, like I think descrypt does, doesn't this result in incorrect computation on the next call?
How does this even pass tests? Maybe I'm misinformed and our descrypt doesn't cache anything anymore?
Let's at least figure this out.
This issue is a code review in progress. I see no suitable issue label for that, so am leaving it with none.
While reviewing #201, I looked into other places where we may zeroize the data struct, and found this:
libxcrypt/lib/crypt.c
Line 178 in 88ecfa5
This zeroizes
internal, but leaves theinitializedfield as-is. For hash implementations that compute and cache constants ininternal, like I thinkdescryptdoes, doesn't this result in incorrect computation on the next call?How does this even pass tests? Maybe I'm misinformed and our
descryptdoesn't cache anything anymore?Let's at least figure this out.