From 20c8fab779036a70416693983ba7d2ea5216524e Mon Sep 17 00:00:00 2001 From: toddouska Date: Mon, 13 Feb 2012 11:36:07 -0800 Subject: [PATCH] fix ecc cleanup bug with opensslExtra no fastmath --- src/internal.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/internal.c b/src/internal.c index 0d0058353..d83bba98d 100644 --- a/src/internal.c +++ b/src/internal.c @@ -695,6 +695,17 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx) ssl->peerCert.derCert.buffer = 0; #endif +#ifdef HAVE_ECC + ssl->peerEccKeyPresent = 0; + ecc_init(&ssl->peerEccKey); + ssl->peerEccDsaKeyPresent = 0; + ecc_init(&ssl->peerEccDsaKey); + ssl->eccDsaKeyPresent = 0; + ecc_init(&ssl->eccDsaKey); + ssl->eccTempKeyPresent = 0; + ecc_init(&ssl->eccTempKey); +#endif + ssl->rfd = -1; /* set to invalid descriptor */ ssl->wfd = -1; ssl->biord = 0; @@ -819,15 +830,6 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx) #endif #ifdef HAVE_ECC - ssl->peerEccKeyPresent = 0; - ecc_init(&ssl->peerEccKey); - ssl->peerEccDsaKeyPresent = 0; - ecc_init(&ssl->peerEccDsaKey); - ssl->eccDsaKeyPresent = 0; - ecc_init(&ssl->eccDsaKey); - ssl->eccTempKeyPresent = 0; - ecc_init(&ssl->eccTempKey); - /* make ECDHE for server side */ if (ssl->options.side == SERVER_END) { if (ecc_make_key(&ssl->rng, ECDHE_SIZE, &ssl->eccTempKey) != 0)