Skip to content

Instantly share code, notes, and snippets.

@briandk
Created February 24, 2014 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briandk/9198716 to your computer and use it in GitHub Desktop.
Save briandk/9198716 to your computer and use it in GitHub Desktop.
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