reduce client key exchange stack use in non NTRU mode

This commit is contained in:
toddouska
2012-09-04 15:56:52 -07:00
parent b1e603ae6b
commit 6943229f87
2 changed files with 9 additions and 1 deletions

View File

@@ -474,6 +474,14 @@ enum Misc {
}; };
/* don't use extra 3/4k stack space unless need to */
#ifdef HAVE_NTRU
#define MAX_ENCRYPT_SZ MAX_NTRU_ENCRYPT_SZ
#else
#define MAX_ENCRYPT_SZ ENCRYPT_LEN
#endif
/* states */ /* states */
enum states { enum states {
NULL_STATE = 0, NULL_STATE = 0,

View File

@@ -5088,7 +5088,7 @@ int SetCipherList(Suites* s, const char* list)
int SendClientKeyExchange(CYASSL* ssl) int SendClientKeyExchange(CYASSL* ssl)
{ {
byte encSecret[MAX_NTRU_ENCRYPT_SZ]; byte encSecret[MAX_ENCRYPT_SZ];
word32 encSz = 0; word32 encSz = 0;
word32 idx = 0; word32 idx = 0;
int ret = 0; int ret = 0;