forked from wolfSSL/wolfssl
enable-md4, enable-hkdf, disable-memory
This commit is contained in:
@ -680,9 +680,8 @@
|
|||||||
#endif /* CYASSL_QL */
|
#endif /* CYASSL_QL */
|
||||||
|
|
||||||
|
|
||||||
#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
|
#if !defined(USE_CYASSL_MEMORY) && defined(USE_WOLFSSL_MEMORY)
|
||||||
!defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
|
#define USE_CYASSL_MEMORY USE_WOLFSSL_MEMORY
|
||||||
#define USE_CYASSL_MEMORY
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1499,9 +1499,9 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
|
|||||||
int ret;
|
int ret;
|
||||||
byte haveRSA = 0;
|
byte haveRSA = 0;
|
||||||
byte havePSK = 0;
|
byte havePSK = 0;
|
||||||
#ifdef HAVE_ANON
|
|
||||||
byte haveAnon = 0;
|
byte haveAnon = 0;
|
||||||
#endif
|
|
||||||
|
(void) haveAnon;
|
||||||
|
|
||||||
ssl->ctx = ctx; /* only for passing to calls, options could change */
|
ssl->ctx = ctx; /* only for passing to calls, options could change */
|
||||||
ssl->version = ctx->method->version;
|
ssl->version = ctx->method->version;
|
||||||
@ -1888,11 +1888,7 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
|
|||||||
#endif
|
#endif
|
||||||
#ifndef NO_CERTS
|
#ifndef NO_CERTS
|
||||||
/* make sure server has cert and key unless using PSK or Anon */
|
/* make sure server has cert and key unless using PSK or Anon */
|
||||||
if (ssl->options.side == WOLFSSL_SERVER_END && !havePSK
|
if (ssl->options.side == WOLFSSL_SERVER_END && !havePSK && !haveAnon)
|
||||||
#ifdef HAVE_ANON
|
|
||||||
&& !haveAnon
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
if (!ssl->buffers.certificate.buffer || !ssl->buffers.key.buffer) {
|
if (!ssl->buffers.certificate.buffer || !ssl->buffers.key.buffer) {
|
||||||
WOLFSSL_MSG("Server missing certificate and/or private key");
|
WOLFSSL_MSG("Server missing certificate and/or private key");
|
||||||
return NO_PRIVATE_KEY;
|
return NO_PRIVATE_KEY;
|
||||||
|
@ -218,8 +218,8 @@ int md4_test(void)
|
|||||||
wc_InitMd4(&md4);
|
wc_InitMd4(&md4);
|
||||||
|
|
||||||
for (i = 0; i < times; ++i) {
|
for (i = 0; i < times; ++i) {
|
||||||
Md4Update(&md4, (byte*)test_md4[i].input, (word32)test_md4[i].inLen);
|
wc_Md4Update(&md4, (byte*)test_md4[i].input, (word32)test_md4[i].inLen);
|
||||||
Md4Final(&md4, hash);
|
wc_Md4Final(&md4, hash);
|
||||||
|
|
||||||
if (memcmp(hash, test_md4[i].output, MD4_DIGEST_SIZE) != 0)
|
if (memcmp(hash, test_md4[i].output, MD4_DIGEST_SIZE) != 0)
|
||||||
return -205 - i;
|
return -205 - i;
|
||||||
|
@ -4409,7 +4409,7 @@ int hkdf_test(void)
|
|||||||
(void)info1;
|
(void)info1;
|
||||||
|
|
||||||
#ifndef NO_SHA
|
#ifndef NO_SHA
|
||||||
ret = HKDF(SHA, ikm1, 22, NULL, 0, NULL, 0, okm1, L);
|
ret = wc_HKDF(SHA, ikm1, 22, NULL, 0, NULL, 0, okm1, L);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return -2001;
|
return -2001;
|
||||||
|
|
||||||
@ -4418,7 +4418,7 @@ int hkdf_test(void)
|
|||||||
|
|
||||||
#ifndef HAVE_FIPS
|
#ifndef HAVE_FIPS
|
||||||
/* fips can't have key size under 14 bytes, salt is key too */
|
/* fips can't have key size under 14 bytes, salt is key too */
|
||||||
ret = HKDF(SHA, ikm1, 11, salt1, 13, info1, 10, okm1, L);
|
ret = wc_HKDF(SHA, ikm1, 11, salt1, 13, info1, 10, okm1, L);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return -2003;
|
return -2003;
|
||||||
|
|
||||||
@ -4428,7 +4428,7 @@ int hkdf_test(void)
|
|||||||
#endif /* NO_SHA */
|
#endif /* NO_SHA */
|
||||||
|
|
||||||
#ifndef NO_SHA256
|
#ifndef NO_SHA256
|
||||||
ret = HKDF(SHA256, ikm1, 22, NULL, 0, NULL, 0, okm1, L);
|
ret = wc_HKDF(SHA256, ikm1, 22, NULL, 0, NULL, 0, okm1, L);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return -2005;
|
return -2005;
|
||||||
|
|
||||||
@ -4437,7 +4437,7 @@ int hkdf_test(void)
|
|||||||
|
|
||||||
#ifndef HAVE_FIPS
|
#ifndef HAVE_FIPS
|
||||||
/* fips can't have key size under 14 bytes, salt is key too */
|
/* fips can't have key size under 14 bytes, salt is key too */
|
||||||
ret = HKDF(SHA256, ikm1, 22, salt1, 13, info1, 10, okm1, L);
|
ret = wc_HKDF(SHA256, ikm1, 22, salt1, 13, info1, 10, okm1, L);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return -2007;
|
return -2007;
|
||||||
|
|
||||||
|
@ -1,57 +1,32 @@
|
|||||||
/* wolfssl options.h
|
/* options.h.in
|
||||||
* generated from configure options
|
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2014 wolfSSL Inc.
|
* Copyright (C) 2006-2014 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
* This file is part of CyaSSL.
|
||||||
*
|
*
|
||||||
|
* CyaSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* CyaSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* default blank options for autoconf */
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef _POSIX_THREADS
|
|
||||||
#define _POSIX_THREADS
|
|
||||||
|
|
||||||
#undef HAVE_THREAD_LS
|
|
||||||
#define HAVE_THREAD_LS
|
|
||||||
|
|
||||||
#undef NDEBUG
|
|
||||||
#define NDEBUG
|
|
||||||
|
|
||||||
#undef _THREAD_SAFE
|
|
||||||
#define _THREAD_SAFE
|
|
||||||
|
|
||||||
#undef NO_DSA
|
|
||||||
#define NO_DSA
|
|
||||||
|
|
||||||
#undef NO_PSK
|
|
||||||
#define NO_PSK
|
|
||||||
|
|
||||||
#undef NO_DH
|
|
||||||
#define NO_DH
|
|
||||||
|
|
||||||
#undef NO_MD4
|
|
||||||
#define NO_MD4
|
|
||||||
|
|
||||||
#undef NO_PWDBASED
|
|
||||||
#define NO_PWDBASED
|
|
||||||
|
|
||||||
#undef NO_HC128
|
|
||||||
#define NO_HC128
|
|
||||||
|
|
||||||
#undef NO_RABBIT
|
|
||||||
#define NO_RABBIT
|
|
||||||
|
|
||||||
#undef HAVE_HASHDRBG
|
|
||||||
#define HAVE_HASHDRBG
|
|
||||||
|
|
||||||
#undef USE_FAST_MATH
|
|
||||||
#define USE_FAST_MATH
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user