2 ms·
> C++ is the better C Oh no it isn't. It does have more features, and for some fields, sure it is better (user interfaces, simulations). However, this is secu
by outworlder 9y ago
> C++ is the better C
Oh no it isn't. It does have more features, and for some fields, sure it is better (user interfaces, simulations).
However, this is security software we are talking about. C++ introduces more complexity as the spec is an order of magnitude bigger than, say, C99. More complex language spec, more complex tooling, lots of places for bugs to hide. It can help with classic buffer overflows and the like, sure. But it introduces its own set of issues.
>Many of these issues are well-known or can be easily researched. They have been documented many times, and can be avoided.
Right. The issues can be avoided. You just need to not make mistakes, right?
Also, this is worrying:
> Converting the legacy code base (490,000 lines of code) to C++ was a straightforward, mechanical task that took only a couple of hours
So we are good? The fact that it compiles (and maybe even works) doesn't automatically validates it as a secure rewrite (and it is a rewrite, no matter how similar the common language set is). The stakes are just much higher for something like GPG.
I do wish this project good luck, though.
- beojan 9y ago> Converting the legacy code base (490,000 lines of code) to C++ was a straightforward, mechanical task that took only a couple of hours That sounds like they haven't actually converted it to C++ so much as compiled it as C++. That means they're probably still using raw owning pointers and no RAII, which means you get none of the safety benefits of C++ (which do exist, so long as you use modern C++ practices like smart pointers, and containers instead of C-style arrays).
- lambdafu 9y agoThis is true. But it is a necessary first step and some refactoring has already been done. It's a long way. Many comments here are missing the main inspiration of using C++, which is the Botan crypto library.