From 9642902c075e8a6507af51363c0725e99d08dbfc Mon Sep 17 00:00:00 2001 From: toddouska Date: Thu, 19 Jun 2014 15:59:24 -0700 Subject: [PATCH] fix disable rsa w/ opensslextra --- src/internal.c | 3 ++- src/ssl.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index 5e8cc182b..f84225940 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9850,7 +9850,7 @@ static void PickHashSigAlgo(CYASSL* ssl, } #endif /* HAVE_ECC */ - #ifdef OPENSSL_EXTRA + #if defined(OPENSSL_EXTRA) && !defined(NO_RSA) if (ssl->specs.kea == diffie_hellman_kea) { byte *output; word32 length = 0, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; @@ -11447,6 +11447,7 @@ static void PickHashSigAlgo(CYASSL* ssl, (void)out; (void)input; (void)size; + (void)begin; if (ssl->options.side != CYASSL_SERVER_END) { CYASSL_MSG("Client received client keyexchange, attack?"); diff --git a/src/ssl.c b/src/ssl.c index 8c4cd4a7f..494f8c5ac 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -10388,6 +10388,7 @@ static int initGlobalRNG = 0; } #endif /* NO_DSA */ +#ifndef NO_RSA static void InitCyaSSL_Rsa(CYASSL_RSA* rsa) { if (rsa) { @@ -10463,8 +10464,10 @@ static int initGlobalRNG = 0; XFREE(rsa, NULL, DYNAMIC_TYPE_RSA); } } +#endif /* NO_RSA */ +#if !defined(NO_RSA) || !defined(NO_DSA) static int SetIndividualExternal(CYASSL_BIGNUM** bn, mp_int* mpi) { CYASSL_MSG("Entering SetIndividualExternal"); @@ -10489,6 +10492,7 @@ static int initGlobalRNG = 0; return 0; } +#endif /* !NO_RSA && !NO_DSA */ #ifndef NO_DSA @@ -10536,6 +10540,7 @@ static int initGlobalRNG = 0; #endif /* NO_DSA */ +#ifndef NO_RSA static int SetRsaExternal(CYASSL_RSA* rsa) { RsaKey* key; @@ -10685,6 +10690,7 @@ static int initGlobalRNG = 0; return CyaSSL_BN_num_bytes(rsa->n); } +#endif /* NO_RSA */ #ifndef NO_DSA @@ -10726,6 +10732,7 @@ static int initGlobalRNG = 0; #endif /* NO_DSA */ +#ifndef NO_RSA /* return SSL_SUCCES on ok, 0 otherwise */ int CyaSSL_RSA_sign(int type, const unsigned char* m, unsigned int mLen, unsigned char* sigRet, @@ -10857,6 +10864,7 @@ static int initGlobalRNG = 0; else return SSL_FATAL_ERROR; } +#endif /* NO_RSA */ void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key, int keylen, @@ -11217,7 +11225,7 @@ static int initGlobalRNG = 0; - +#ifndef NO_RSA /* Load RSA from Der, SSL_SUCCESS on success < 0 on error */ int CyaSSL_RSA_LoadDer(CYASSL_RSA* rsa, const unsigned char* der, int derSz) { @@ -11246,6 +11254,7 @@ int CyaSSL_RSA_LoadDer(CYASSL_RSA* rsa, const unsigned char* der, int derSz) return SSL_SUCCESS; } +#endif /* NO_RSA */ #ifndef NO_DSA