Merge branch 'master' of github.com:cyassl/cyassl

This commit is contained in:
Chris Conlon
2013-12-11 16:20:43 -08:00
7 changed files with 47 additions and 22 deletions

View File

@@ -635,8 +635,10 @@ void InitSuites(Suites* suites, ProtocolVersion pv, byte haveRSA, byte havePSK,
if (suites->setSuites)
return; /* trust user settings, don't override */
if (side == CYASSL_SERVER_END && haveStaticECC)
if (side == CYASSL_SERVER_END && haveStaticECC) {
haveRSA = 0; /* can't do RSA with ECDSA key */
(void)haveRSA; /* some builds won't read */
}
if (side == CYASSL_SERVER_END && haveECDSAsig) {
haveRSAsig = 0; /* can't have RSA sig if signed by ECDSA */
@@ -1636,6 +1638,7 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx)
CYASSL_MSG("Arrays Memory error");
return MEMORY_E;
}
XMEMSET(ssl->arrays, 0, sizeof(Arrays));
#ifndef NO_PSK
ssl->arrays->client_identity[0] = 0;
@@ -8117,7 +8120,7 @@ static void PickHashSigAlgo(CYASSL* ssl,
case ecc_diffie_hellman_kea:
{
ecc_key myKey;
ecc_key* peerKey = &myKey;
ecc_key* peerKey = NULL;
word32 size = sizeof(encSecret);
if (ssl->specs.static_ecdh) {
@@ -8132,6 +8135,9 @@ static void PickHashSigAlgo(CYASSL* ssl,
peerKey = ssl->peerEccKey;
}
if (peerKey == NULL)
return NO_PEER_KEY;
ecc_init(&myKey);
ret = ecc_make_key(ssl->rng, peerKey->dp->size, &myKey);
if (ret != 0)

View File

@@ -417,6 +417,13 @@ void ssl_FreeSniffer(void)
FreeMutex(&SessionMutex);
FreeMutex(&ServerListMutex);
if (TraceFile) {
TraceOn = 0;
fclose(TraceFile);
TraceFile = NULL;
}
CyaSSL_Cleanup();
}

View File

@@ -1730,6 +1730,7 @@ int CyaSSL_Init(void)
der.buffer = 0;
(void)dynamicType;
(void)rsaKey;
if (used)
*used = sz; /* used bytes default to sz, PEM chain may shorten*/
@@ -1980,7 +1981,8 @@ int CyaSSL_Init(void)
}
ecc_free(&key);
eccKey = 1;
ctx->haveStaticECC = 1;
if (ctx)
ctx->haveStaticECC = 1;
if (ssl)
ssl->options.haveStaticECC = 1;
}