don't use SSL Master Secret stack space in TLS mode

This commit is contained in:
toddouska
2012-09-04 16:03:45 -07:00
parent 6943229f87
commit 0ee22d8f94

View File

@ -1132,7 +1132,7 @@ static void CleanPreMaster(CYASSL* ssl)
/* Create and store the master secret see page 32, 6.1 */ /* Create and store the master secret see page 32, 6.1 */
int MakeMasterSecret(CYASSL* ssl) static int MakeSslMasterSecret(CYASSL* ssl)
{ {
byte shaOutput[SHA_DIGEST_SIZE]; byte shaOutput[SHA_DIGEST_SIZE];
byte md5Input[ENCRYPT_LEN + SHA_DIGEST_SIZE]; byte md5Input[ENCRYPT_LEN + SHA_DIGEST_SIZE];
@ -1154,10 +1154,6 @@ int MakeMasterSecret(CYASSL* ssl)
} }
#endif #endif
#ifndef NO_TLS
if (ssl->options.tls) return MakeTlsMasterSecret(ssl);
#endif
InitMd5(&md5); InitMd5(&md5);
InitSha(&sha); InitSha(&sha);
@ -1205,3 +1201,14 @@ int MakeMasterSecret(CYASSL* ssl)
return ret; return ret;
} }
/* Master wrapper, doesn't use SSL stack space in TLS mode */
int MakeMasterSecret(CYASSL* ssl)
{
#ifndef NO_TLS
if (ssl->options.tls) return MakeTlsMasterSecret(ssl);
#endif
return MakeSslMasterSecret(ssl);
}