jselbie / stunserver

Version 1.2. This is the source code to STUNTMAN - an open source STUN server and client code by john selbie. Compliant with the latest RFCs including 5389, 5769, and 5780. Also includes backwards compatibility for RFC 3489. Compiles on Linux, MacOS, BSD, Solaris, and Win32 with Cygwin. Windows binaries avaialble from www.stunprotocol.org.
http://www.stunprotocol.org
Apache License 2.0
1.44k stars 349 forks source link

made it possible to compile with openssl 1.0.2 #21

Closed mkm85 closed 7 years ago

mkm85 commented 7 years ago

fixed that compilation fails with newer openssl versions while retaining compatibility for older versions. If older versions are not a priority this code could be cleaner.

jselbie commented 7 years ago

looking...

jselbie commented 7 years ago

Scratch that. I looked at the code for HMAC_CTX_reset(). It reallocated everything from the heap, so the allocation can't be avoided.

jselbie commented 7 years ago

I iterated through different ways to do this, but what you have is fine. Just initialize all structs with ={}; and all pointers as NULL or to something valid.

mkm85 commented 7 years ago

It could be nicer with the hmac abstracted away with three different implementations available

jselbie commented 7 years ago

Definitely could use a better abstraction. Go for it. I'll likely pull in what you have done this weekend.

Thanks for doing this!

jselbie commented 7 years ago

merged and done. Thanks again.