Earlier quoted context omitted.
A quick test shows neither -Wall nor -Wextra report anything on either gcc or clang. However, clang's -Weverything does complain (it implies -Wunreachable-code). Confusingly, gcc accepts -Wunreachable-code as a valid option, but then proceeds not to warn anything. (edit): Which is a known bug apparently, http://gcc.gnu.org/ml/gcc-help/2011-05/msg00360.html
The real WTF is those Warn flags, then. In what sane world does "extra" mean more than "all", and "all" and "everything" mean different things?
Apple's SSL/TLS bug
111–120 of 295 posts
Re: Apple's SSL/TLS bug
#112I just made this - it'll tell you if you're vulnerable. https://gotofail.com/ Not very well tested, please let me know if it works for you. If you're on OS X Mavericks or on iOS 7 and haven't patched you should get big scary red text. Edit: posted here https://news.ycombinator.com/item?id=7282164
Re: Apple's SSL/TLS bug
#113Earlier quoted context omitted.
I would probably flag the code above in a security review because it hides the key part at the end of a complex line. Unless you're coding on VT100 terminal it's worth the extra line to make the test logic incredibly obvious: err = SSLHashSHA1.update(&hashCtx, &serverRandom); if (err != nil) { return err; }
In actual code things would not be named as they were above and it would be shorter, I was just trying to make it look reasonably like the C for HN.
Re: Apple's SSL/TLS bug
#114Earlier quoted context omitted.
Apple introduced -Weverything because suddenly changing the scope of gcc's -Wall (which indeed does not include everything) would break a lot of builds.
Is "-Weverything" inclusive of new warnings? Because they're just kicking the can if not. What's next, "-Wreallyeverything"?
We have it turned on, and about 10 warnings specifically disabled because they were too noisy or not useful for us. It's always interesting upgrading Xcode and seeing what new warnings we get to fix.
Re: Apple's SSL/TLS bug
#115This could not have happened with C++ exceptions and RAII instead of manual error checking and goto for cleanup ;)
Any language that lets you omit braces for single statements is prone to this bug, which includes C++.
Re: Apple's SSL/TLS bug
#116Earlier quoted context omitted.
Linux is only secure if you secure it.
Sure, but at least you have a say there.
Security is not a Boolean. A better question is, which OS is more secure OOTB for a given user.
Re: Apple's SSL/TLS bug
#117Earlier quoted context omitted.
MITM of any SSL connection in Safari and other system apps, and they couldn't even bother to have an OS X patch ready at the same time as the disclosure for iOS? I think anyone relying on the security of OS X is going to have to seriously rethink their OS choice after this.
Indeed the only secure OS nowadays is Linux. Everything else should be considered compromised by default a priori.
Tell that to the people who generated keys on Debian.
Programmers are simply not good enough at writing secure code. Full stop. If you say anything else, you're just flaunting your own unreliability as a source of security advice.
Re: Apple's SSL/TLS bug
#118Earlier quoted context omitted.
MITM of any SSL connection in Safari and other system apps, and they couldn't even bother to have an OS X patch ready at the same time as the disclosure for iOS? I think anyone relying on the security of OS X is going to have to seriously rethink their OS choice after this.
Indeed the only secure OS nowadays is Linux. Everything else should be considered compromised by default a priori.
Re: Apple's SSL/TLS bug
#119Earlier quoted context omitted.
I don't see the possibility for catching the wrong type (or not catching it) if you get one character wrong. Unless of course you have two valid type names that just differ in one character, but that is a general pitfall and not exception specific. If you always throw by value (and not by pointer) then it does not matter if you catch by value or by reference, the catch block will be activated either way. The only iss…
Ok for example: int e; int update() { throw &e; } the & is the one character - it's a typo - only catch(...) will catch it.
I guess you mean there will only be a catch(int) in addition to catch(...) so in that aspect you're right of course.
Still, I would think taking the address of something you throw should ring quite a few warning bells as opposed to merely a missing ref (&) in the catch handler. Similarly to "return &e" which would also be suspicious and require an extra look or two.
Re: Apple's SSL/TLS bug
#120Does anybody know the .dylib or binary file where this function resides on OSX? I can't find libsecurity_ssl on my system. It should relatively simple to NOP out the 2nd goto, if the rest of the function hasn't been optimised away.
I believe you can dump the assembly of the entire function like this:
otool -t -p _SSLProcessServerKeyExchange \
-V /System/Library/Frameworks/Security.framework/Versions/A/Security | less
edit: I believe this could be the offending instruction: 0000000000086df6 jmp 0x86e0d
edit2: That is actually in SSLVerifySignedServerKeyExchangeTls12(). Trying to track down the real one..edit3: Looks like the compiler did optimize it out if I'm reading it correctly now. The code is around 0x86c97. It does the last if() call and then immediately calls SSLFreeBuffer() and jumps to the end. :(