Oh the joy of mixing two different languages. Because yeah, even though C and C++ have a common root, it’s two different language with each their own set of functionnality. But why would I mix those two languages? Because I had to use a C library. Openssl to be exact. And god do I hate it right now. Not only because Openssl is quite frankly a mess, but also because the way C++ is made make it hard to have a clean code. And the person I am refuse to work with disgusting code. Knowing that C++ can throw, and how it handles the memory, I am making a wrapper around Openssl to be RAII compatible. Now that’s great, isn’t it? Well not really. Because of the very way Openssl is made, writing a nice and proper wrapper is much harder than expected. And once that is done, of course nothing works. Because Openssl is so complicated. Rant over.
Moral of the story: Kids. Don’t play with Openssl.