Closed claucece closed 5 years ago
Simple cleanup. I'll take care of it.
This refers to this TODO: // TODO: @refactoring this workaround is not the nicest there is
on the otrng.c file.
Perfect. Easier to find now.
So, I started looking at this, but it got me a bit confused. Specifically, the things that look like they are duplicated are in generate_tmp_key_i and generate_tmp_key_r in otrng.c. However, the thing that seems to be duplicated is in otrng_key_manager_generate_shared_secret. But looking at this, it doesn't actually seem to do the calculation two times. Specifically, generate_tmp_key_i/r are only called in the non-interactive path, while the branch of otrng_key_manager_generate_shared_secret that calculates the ecdh and dh shared values is only in the interactive path.
Unless I'm misunderstanding something here, I don't think there's a problem, Can you please review and tell me if I'm wrong?
Unless I'm misunderstanding something here, I don't think there's a problem, Can you please review and tell me if I'm wrong?
You are right. All is good now.
It is first calculated here:
and here:
This could be refactored.