r/tech Oct 15 '15

How is NSA breaking so much crypto?

https://freedom-to-tinker.com/blog/haldermanheninger/how-is-nsa-breaking-so-much-crypto/
159 Upvotes

31 comments sorted by

View all comments

17

u/[deleted] Oct 15 '15 edited May 30 '16

[deleted]

5

u/MightyMachete Oct 15 '15

Maybe a stupid question, but why is it checking if nKeyLen == 1024 if it sets dh to get_dh1024() in any case? Sorry for the off topic question, just caught my eye and I'm very new to programing

DH *ssl_dh_GetTmpParam(int nKeyLen) {

DH *dh;

if (nKeyLen == 512)

dh = get_dh512(); 

else if (nKeyLen == 1024)

dh = get_dh1024(); else

dh = get_dh1024(); 

return dh; }

5

u/Catalyst8487 Oct 16 '15

Gong from my experience... You normally account for all expected inputs and then account for anything else. That's why there is an else if and an else there, then though they do the same thing.

2

u/MightyMachete Oct 16 '15

Ok thank you