Advertisement
shornby

Goto Fail; Goto Fail;.c

Mar 3rd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* This struct (snippet) in OpenSSL has a bug that caused all kinds of problems! */
  2. static OSStatus
  3. SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
  4.                                  uint8_t *signature, UInt16 signatureLen)
  5. {
  6.     OSStatus        err;
  7.     ...
  8.  
  9.     if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0)
  10.         goto fail;
  11.     if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
  12.         goto fail;
  13.         goto fail;
  14.     if ((err = SSLHashSHA1.final(&hashCtx, &hashOut)) != 0)
  15.         goto fail;
  16.     ...
  17.  
  18. fail:
  19.     SSLFreeBuffer(&signedHashes);
  20.     SSLFreeBuffer(&hashCtx);
  21.     return err;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement