forked from wolfSSL/wolfssl
don't use SSL Master Secret stack space in TLS mode
This commit is contained in:
17
src/keys.c
17
src/keys.c
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user