Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
The SSL bug in Apple's code
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
uint8_t *signature, UInt16 signatureLen)
{
OSStatus err;
...
if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
goto fail;
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
goto fail;
...
fail:
SSLFreeBuffer(&signedHashes);
SSLFreeBuffer(&hashCtx);
return err;
}
@briandk
Copy link
Author

briandk commented Feb 24, 2014

Lines 17 through 21 look like they just free the buffer and return an error. How, if at all, does that buffer freeing end up being the security hole? Like, I get that it will always go to the fail condition, but what's happening in that fail block that makes it a huge hole?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment