Code Monkey home page Code Monkey logo

wolfssl / wolfssl Goto Github PK

View Code? Open in Web Editor NEW
2.2K 109.0 776.0 612.51 MB

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3!

Home Page: https://www.wolfssl.com

License: GNU General Public License v2.0

C 82.17% Shell 0.62% Makefile 0.18% Tcl 0.02% Assembly 14.55% C++ 0.19% XS 0.01% Perl 0.03% C# 0.22% M4 0.65% Objective-C 0.01% CMake 0.44% SWIG 0.70% Batchfile 0.02% FreeMarker 0.03% Dockerfile 0.01% Euphoria 0.01% Swift 0.01% Ada 0.14% BitBake 0.01%
ssl tls cryptography security openssl tls13 dtls https fips cryptography-api

wolfssl's Introduction

wolfSSL Embedded SSL/TLS Library

The wolfSSL embedded SSL library (formerly CyaSSL) is a lightweight SSL/TLS library written in ANSI C and targeted for embedded, RTOS, and resource-constrained environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating environments as well because of its royalty-free pricing and excellent cross platform support. wolfSSL supports industry standards up to the current TLS 1.3 and DTLS 1.3, is up to 20 times smaller than OpenSSL, and offers progressive ciphers such as ChaCha20, Curve25519, Blake2b and Post-Quantum TLS 1.3 groups. User benchmarking and feedback reports dramatically better performance when using wolfSSL over OpenSSL.

wolfSSL is powered by the wolfCrypt cryptography library. Two versions of wolfCrypt have been FIPS 140-2 validated (Certificate #2425 and certificate #3389). FIPS 140-3 validation is in progress. For additional information, visit the wolfCrypt FIPS FAQ or contact [email protected].

Why Choose wolfSSL?

There are many reasons to choose wolfSSL as your embedded, desktop, mobile, or enterprise SSL/TLS solution. Some of the top reasons include size (typical footprint sizes range from 20-100 kB), support for the newest standards (SSL 3.0, TLS 1.0, TLS 1.1, TLS 1.2, TLS 1.3, DTLS 1.0, DTLS 1.2, and DTLS 1.3), current and progressive cipher support (including stream ciphers), multi-platform, royalty free, and an OpenSSL compatibility API to ease porting into existing applications which have previously used the OpenSSL package. For a complete feature list, see Chapter 4 of the wolfSSL manual.

Notes, Please Read

Note 1

wolfSSL as of 3.6.6 no longer enables SSLv3 by default. wolfSSL also no longer supports static key cipher suites with PSK, RSA, or ECDH. This means if you plan to use TLS cipher suites you must enable DH (DH is on by default), or enable ECC (ECC is on by default), or you must enable static key cipher suites with one or more of the following defines:

WOLFSSL_STATIC_DH
WOLFSSL_STATIC_RSA
WOLFSSL_STATIC_PSK

Though static key cipher suites are deprecated and will be removed from future versions of TLS. They also lower your security by removing PFS.

When compiling ssl.c, wolfSSL will now issue a compiler error if no cipher suites are available. You can remove this error by defining WOLFSSL_ALLOW_NO_SUITES in the event that you desire that, i.e., you're not using TLS cipher suites.

Note 2

wolfSSL takes a different approach to certificate verification than OpenSSL does. The default policy for the client is to verify the server, this means that if you don't load CAs to verify the server you'll get a connect error, no signer error to confirm failure (-188).

If you want to mimic OpenSSL behavior of having SSL_connect succeed even if verifying the server fails and reducing security you can do this by calling:

wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);

before calling wolfSSL_new();. Though it's not recommended.

Note 3

The enum values SHA, SHA256, SHA384, SHA512 are no longer available when wolfSSL is built with --enable-opensslextra (OPENSSL_EXTRA) or with the macro NO_OLD_SHA_NAMES. These names get mapped to the OpenSSL API for a single call hash function. Instead the name WC_SHA, WC_SHA256, WC_SHA384 and WC_SHA512 should be used for the enum name.

wolfSSL Release 5.7.0 (Mar 20, 2024)

Release 5.7.0 has been developed according to wolfSSL's development and QA process (see link below) and successfully passed the quality criteria. https://www.wolfssl.com/about/wolfssl-software-development-process-quality-assurance

NOTE: * --enable-heapmath is being deprecated and will be removed by end of 2024

NOTE: In future releases, --enable-des3 (which is disabled by default) will be insufficient in itself to enable DES3 in TLS cipher suites. A new option, --enable-des3-tls-suites, will need to be supplied in addition. This option should only be used in backward compatibility scenarios, as it is inherently insecure.

NOTE: This release switches the default ASN.1 parser to the new ASN template code. If the original ASN.1 code is preferred define WOLFSSL_ASN_ORIGINAL to use it. See PR #7199.

Vulnerabilities

  • [High] CVE-2024-0901 Potential denial of service and out of bounds read. Affects TLS 1.3 on the server side when accepting a connection from a malicious TLS 1.3 client. If using TLS 1.3 on the server side it is recommended to update the version of wolfSSL used. Fixed in this GitHub pull request #7099

  • [Med] CVE-2024-1545 Fault Injection vulnerability in RsaPrivateDecryption function that potentially allows an attacker that has access to the same system with a victims process to perform a Rowhammer fault injection. Thanks to Junkai Liang, Zhi Zhang, Xin Zhang, Qingni Shen for the report (Peking University, The University of Western Australia)." Fixed in this GitHub pull request #7167

  • [Med] Fault injection attack with EdDSA signature operations. This affects ed25519 sign operations where the system could be susceptible to Rowhammer attacks. Thanks to Junkai Liang, Zhi Zhang, Xin Zhang, Qingni Shen for the report (Peking University, The University of Western Australia). Fixed in this GitHub pull request #7212

New Feature Additions

  • Added --enable-experimental configure flag to gate out features that are currently experimental. Now liboqs, kyber, lms, xmss, and dual-alg-certs require the --enable-experimental flag.

POST QUANTUM SUPPORT ADDITIONS

  • Experimental framework for using wolfSSL’s XMSS implementation (PR 7161)
  • Experimental framework for using wolfSSL’s LMS implementation (PR 7283)
  • Experimental wolfSSL Kyber implementation and assembly optimizations, enabled with --enable-experimental --enable-kyber (PR 7318)
  • Experimental support for post quantum dual key/signature certificates. A few known issues and sanitizer checks are in progress with this feature. Enabled with the configure flags --enable-experimental --enable-dual-alg-certs (PR 7112)
  • CryptoCb support for PQC algorithms (PR 7110)

OTHER FEATURE ADDITIONS

  • The Linux kernel module now supports registration of AES-GCM, AES-XTS, AES-CBC, and AES-CFB with the kernel cryptosystem through the new --enable-linuxkm-lkcapi-register option, enabling automatic use of wolfCrypt implementations by the dm-crypt/luks and ESP subsystems. In particular, wolfCrypt AES-XTS with –enable-aesni is faster than the native kernel implementation.
  • CryptoCb hook to one-shot CMAC functions (PR 7059)
  • BER content streaming support for PKCS7_VerifySignedData and sign/encrypt operations (PR 6961 & 7184)
  • IoT-Safe SHA-384 and SHA-512 support (PR 7176)
  • I/O callbacks for content and output with PKCS7 bundle sign/encrypt to reduce peak memory usage (PR 7272)
  • Microchip PIC24 support and example project (PR 7151)
  • AutoSAR shim layer for RNG, SHA256, and AES (PR 7296)
  • wolfSSL_CertManagerUnloadIntermediateCerts API to clear intermediate certs added to certificate store (PR 7245)
  • Implement SSL_get_peer_signature_nid and SSL_get_peer_signature_type_nid (PR 7236)

Enhancements and Optimizations

  • Remove obsolete user-crypto functionality and Intel IPP support (PR 7097)
  • Support for RSA-PSS signatures with CRL use (PR 7119)
  • Enhancement for AES-GCM use with Xilsecure on Microblaze (PR 7051)
  • Support for crypto cb only build with ECC and NXP CAAM (PR 7269)
  • Improve liboqs integration adding locking and init/cleanup functions (PR 7026)
  • Prevent memory access before clientSession->serverRow and clientSession->serverIdx are sanitized (PR 7096)
  • Enhancements to reproducible build (PR 7267)
  • Update Arduino example TLS Client/Server and improve support for ESP32 (PR 7304 & 7177)
  • XC32 compiler version 4.x compatibility (PR 7128)
  • Porting for build on PlayStation 3 and 4 (PR 7072)
  • Improvements for Espressif use; SHA HW/SW selection and use on ESP32-C2/ESP8684, wolfSSL_NewThread() type, component cmake fix, and update TLS client example for ESP8266 (PR 7081, 7173, 7077, 7148, 7240)
  • Allow crypto callbacks with SHA-1 HW (PR 7087)
  • Update OpenSSH port to version 9.6p1(PR 7203)
  • ARM Thumb2 enhancements, AES-GCM support for GCM_SMALL, alignment fix on key, fix for ASM clobber list (PR 7291,7301,7221)
  • Expand heap hint support for static memory build with more x509 functions (PR 7136)
  • Improving ARMv8 ChaCha20 ASM (alignment) (PR 7182)
  • Unknown extension callback wolfSSL_CertManagerSetUnknownExtCallback added to CertManager (PR 7194)
  • Implement wc_rng_new_ex for use with devID’s with crypto callback (PR 7271)
  • Allow reading 0-RTT data after writing 0.5-RTT data (PR 7102)
  • Send alert on bad PSK binder error (PR 7235)
  • Enhancements to CMake build files for use with cross compiling (PR 7188)

Fixes

  • Fix for checking result of MAC verify when no AAD is used with AES-GCM and Xilinx Xilsecure (PR 7051)
  • Fix for Aria sign use (PR 7082)
  • Fix for invalid dh_ffdhe_test test case using Intel QuickAssist (PR 7085)
  • Fixes for TI AES and SHA on TM4C with HW acceleration and add full AES GCM and CCM support with TLS (PR 7018)
  • Fixes for STM32 PKA use with ECC (PR 7098)
  • Fixes for TLS 1.3 with crypto callbacks to offload KDF / HMAC operation (PR 7070)
  • Fix include path for FSP 3.5 on Renesas RA6M4 (PR 7101)
  • Siphash x64 asm fix for use with older compilers (PR 7299)
  • Fix for SGX build with SP (PR 7308)
  • Fix to Make it mandatory that the cookie is sent back in new ClientHello when seen in a HelloRetryRequest with (PR 7190)
  • Fix for wrap around behavior with BIO pairs (PR 7169)
  • OCSP fixes for parsing of response correctly when there was a revocation reason and returning correct error value with date checks (PR 7241 & 7255)
  • Fix build with NO_STDIO_FILESYSTEM and improve checks for XGETENV (PR 7150)
  • Fix for DTLS sequence number and cookie when downgrading DTLS version (PR 7214)
  • Fix for write_dup use with chacha-poly cipher suites (PR 7206)
  • Fix for multiple handshake messages in one record failing with OUT_OF_ORDER_E when downgrading from TLS 1.3 to TLS 1.2 (PR 7141)
  • Fix for AES ECB build with Thumb and alignment (PR 7094)
  • Fix for negotiate handshake until the end in wolfSSL_read/wolfSSL_write if hitting an edge case with want read/write (PR 7237)

For additional vulnerability information visit the vulnerability page at: https://www.wolfssl.com/docs/security-vulnerabilities/

See INSTALL file for build instructions. More info can be found on-line at: https://wolfssl.com/wolfSSL/Docs.html

Resources

wolfSSL Website

wolfSSL Wiki

FIPS 140-2/140-3 FAQ

wolfSSL Documentation

wolfSSL Manual

wolfSSL API Reference

wolfCrypt API Reference

TLS 1.3

wolfSSL Vulnerabilities

Additional wolfSSL Examples

Directory structure

<wolfssl_root>
├── certs   [Certificates used in tests and examples]
├── cmake   [Cmake build utilities]
├── debian  [Debian packaging files]
├── doc     [Documentation for wolfSSL (Doxygen)]
├── Docker  [Prebuilt Docker environments]
├── examples    [wolfSSL examples]
│   ├── asn1    [ASN.1 printing example]
│   ├── async   [Asynchronous Cryptography example]
│   ├── benchmark   [TLS benchmark example]
│   ├── client  [Client example]
│   ├── configs [Example build configurations]
│   ├── echoclient  [Echoclient example]
│   ├── echoserver  [Echoserver example]
│   ├── pem [Example for convert between PEM and DER]
│   ├── sctp    [Servers and clients that demonstrate wolfSSL's DTLS-SCTP support]
│   └── server  [Server example]
├── IDE     [Contains example projects for various development environments]
├── linuxkm [Linux Kernel Module implementation]
├── m4      [Autotools utilities]
├── mcapi   [wolfSSL MPLAB X Project Files]
├── mplabx  [wolfSSL MPLAB X Project Files]
├── mqx     [wolfSSL Freescale CodeWarrior Project Files]
├── rpm     [RPM packaging metadata]
├── RTOS
│   └── nuttx   [Port of wolfSSL for NuttX]
├── scripts [Testing scripts]
├── src     [wolfSSL source code]
├── sslSniffer  [wolfSSL sniffer can be used to passively sniff SSL traffic]
├── support [Contains the pkg-config file]
├── tests   [Unit and configuration testing]
├── testsuite   [Test application that orchestrates tests]
├── tirtos  [Port of wolfSSL for TI RTOS]
├── wolfcrypt   [The wolfCrypt component]
│   ├── benchmark   [Cryptography benchmarking application]
│   ├── src         [wolfCrypt source code]
│   │   └── port    [Supported hardware acceleration ports]
│   └── test        [Cryptography testing application]
├── wolfssl [Header files]
│   ├── openssl [Compatibility layer headers]
│   └── wolfcrypt   [Header files]
├── wrapper [wolfSSL language wrappers]
└── zephyr  [Port of wolfSSL for Zephyr RTOS]

wolfssl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wolfssl's Issues

DTLS problems on El Capitan

Some DTLS functions don't seem to be working after upgrading to El Capitan (OS X). For example, wolfDTLSv1_2_client_method is not found in the library, although it was configured, built, and installed with DTLS enabled. Can anyone else reproduce this issue?

llc-dtls-client-test.c:165:33: warning: implicit declaration of function 'wolfDTLSv1_2_client_method' is invalid in C99
[-Wimplicit-function-declaration]
if ( (ctx = wolfSSL_CTX_new(wolfDTLSv1_2_client_method())) == NULL) {

ER: Support for 32-bit version of Curve25519

It'd be great if there was a 32-bit native version of Curve25519 that was enabled using ECC25519_WORD32. There is an optimized version of Ed25519 available here, which includes some optimized Curve25519 code that reuses the Ed25519 base.

Clang warnings in ecc25519

I'm seeing these warnings from Xcode 6.3:

/.../wolfssl/wolfcrypt/src/ecc25519.c:153:24: warning: comparison of array 'private_key->k.point' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (private_key->k.point == NULL || public_key->p.point == NULL)
~~~~~~~~~~~~~~~^~~~~ ~~~~
/.../wolfssl/wolfcrypt/src/ecc25519.c:153:55: warning: comparison of array 'public_key->p.point' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (private_key->k.point == NULL || public_key->p.point == NULL)
~~~~~~~~~~~~~~^~~~~ ~~~~

Missing strnlen() on MingW

MingW doesn't have strnlen() which is needed in sniffer.c + snifftest.c. To solve it, I added this to my config.h:

    extern __inline__ size_t strnlen (const char *str, size_t maxsize)
    {
      size_t n;
      for (n = 0; n < maxsize && *str; n++, str++)
        ;
      return (n);
    }

Maybe the missing functions (strnlen, strsep) could be added to a more suitable place?

DTLS handshake regression

Commit 7e6b3a8 "Added more bounds checking when saving a DTLS message fragment" seems to have introduced a regression. It makes CyaSSL behave differently (worse) when running in the DTLS client role and handshake packets are dropped.

I think that the condition "fragOffset < msg->sz" should be removed so that messages without payload are allowed. The server_hello_done message is such a message.

I've tested running with the change below, and the handshake seems to be much happier.

--- cyassl.orig/src/internal.c
+++ cyassl/src/internal.c
@@ -2266,7 +2266,7 @@ void DtlsMsgSet(DtlsMsg* msg, word32 seq
                                               word32 fragOffset, word32 fragSz)
 {
     if (msg != NULL && data != NULL && msg->fragSz <= msg->sz &&
-                     fragOffset < msg->sz && (fragOffset + fragSz) <= msg->sz) {
+                     (fragOffset + fragSz) <= msg->sz) {

         msg->seq = seq;
         msg->type = type;

options.h defines DEBUG or NDEBUG

Your configure outputs an options.h for the user that defines either DEBUG or NDEBUG which may conflict in the user's code if they or their build system already use those defines. I notice that for debug mode DEBUG_WOLFSSL is also defined in options.h. I wonder if it would be sufficient to keep that but filter out NDEBUG, DEBUG, and any other setting (_POSIX_THREADS maybe?) that could possibly cause a conflict for the user, since their program or library may not use the same settings as wolfSSL.

I recently included options.h in libcurl cyassl.c so the SNI functions in wolfSSL would be enabled and I could test against HAVE_SNI. I came up with some kludge to workaround NDEBUG/DEBUG but I don't know if that's the right way to go. Even if you were to filter DEBUG/NDEBUG from options.h I will need to have a workaround for earlier versions. If you have a better suggestion please let me know. Off the top of my head all I can think of is an ac_check_funcs for the SNI functions in our configure, and no longer include options.h.

Crash in wc_ecc_verify_hash with empty signature

If wc_ecc_verify_hash is called with a signature of the correct length but all zeros will crash in integer.c at line 135.
I would expect to get an error for bad inputs.

Here is a sample that will crash
ecc_key pubKey;
wc_ecc_init(&pubKey);
RNG rng = [SSCryptoKeyStorage createRNG];
wc_ecc_make_key(&rng, KEY_LENGTH, &pubKey);

UInt8 *hash = calloc(512, 1);
UInt8 *bytes = calloc(24, 1);
int verify = 0;
wc_ecc_verify_hash(bytes, 24, hash, 512, &verify, &pubKey);

Defining USER_TIME should be all or nothing

My expectation if I am defining USER_TIME is that I provide XTIME and XGMTIME, but there is no ability for me to override the XGMTIME macro. It doesn't seem like USER is providing the time functions, if WOLFSSL is volunteering a gmtime function that can't be overridden. USER_TIME should allow for definition of XGMTIME()

#define FREERTOS implies NO_DH

We'd like to use TLS_DHE* cipher suites, but since we are using FREERTOS settings.h inside WolfSSL sees FREERTOS and then defines NO_DH.

ecc_test() fails with -1024

Running ecc_test() fails with error code -1024 because validating the ECC key with wc_ecc_check_key() returns FP_VAL. This is the call stack that returns FP_VAL:

ecc_test(), test.c:5216
    wc_ecc_check_key(), ecc.c:2900
        ecc_check_pubkey_order(), ecc.c:2860
            ecc_check_pubkey_order(), ecc.c:1204
                ecc_map(), ecc.c:965
                    mp_invmod(), tfm.c:2092

We can reproduce this 100% of the time on our Kinetis K64 MCU.

This is on version 3.6.8.

Can base64 encode / decode be public?

From coding.h:

/* decode needed by wolfSSL /
WOLFSSL_LOCAL int Base64_Decode(const byte
in, word32 inLen, byte* out,
word32* outLen);

Instead of pulling in a 3rd party base64 lib, would be excellent if wolf ssl users can use the base64 methods.

Using Python with DTLS

Hi,

Is there a python swig component for DTLS. Could find only a TLS one. If there is one for DTLS, kindly let know.

Thanks.
Ajay

ER: wolfcrypt API for SRP6a

It'd be awesome if wolfcrypt had support for Stanford's Secure Remote Password (SRP) protocol version 6a. Several protocols, including Apple's HomeKit Accessory Protocol, use SRP 6a. As part of the implementation the API client must have the ability to specify the hash function, e.g. SHA-512, and SRP Group Parameters, e.g. the 3072-bit group defined in Appendix A of RFC 5054. This enhancement request does not include TLS support, it is a request for the crypto-level APIs.

Compile crashes and burns on OS X :)

Version tarball: v3.4.0

Configure opts:

--disable-silent-rules --disable-dependency-tracking --infodir=/usr/local/Cellar/cyassl/3.4.0/share/info --mandir=/usr/local/Cellar/cyassl/3.4.0/share/man --prefix=/usr/local/Cellar/cyassl/3.4.0 --sysconfdir=/usr/local/etc --disable-bump --disable-examples --disable-fortress --disable-md5 --disable-sniffer --disable-webserver --enable-aesccm --enable-aesgcm --enable-blake2 --enable-camellia --enable-certgen --enable-certreq --enable-chacha --enable-crl --enable-crl-monitor --enable-dtls --enable-dh --enable-ecc --enable-eccencrypt --enable-ecc25519 --enable-filesystem --enable-hc128 --enable-hkdf --enable-inline --enable-keygen --enable-ocsp --enable-opensslextra --enable-poly1305 --enable-psk --enable-rabbit --enable-ripemd --enable-savesession --enable-savecert --enable-sessioncerts --enable-sha512 --enable-sni --enable-supportedcurves --enable-fastmath --enable-fasthugemath --enable-aesni

Compiler: Clang 6.0, Build 600

Failure:

strings -fwrapv -c src/tls.c  -fno-common -DPIC -o src/.libs/src_libwolfssl_la-tls.o
src/ssl.c:6973:9: error: use of undeclared identifier 'Md5'; did you mean 'MD5'?
        Md5  md5[1];
        ^~~
        MD5
./wolfssl/wolfcrypt/hmac.h:75:5: note: 'MD5' declared here
    MD5     = 0,
    ^
src/ssl.c:6973:12: error: expected ';' after expression
        Md5  md5[1];
           ^
           ;
src/ssl.c:6973:14: error: use of undeclared identifier 'md5'; did you mean 'md'?
        Md5  md5[1];
             ^~~
             md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:6983:20: error: use of undeclared identifier 'md5'; did you mean 'md'?
        wc_InitMd5(md5);
                   ^~~
                   md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7023:30: error: use of undeclared identifier 'md5'; did you mean 'md'?
                wc_Md5Update(md5, digest, MD5_DIGEST_SIZE);
                             ^~~
                             md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7025:26: error: use of undeclared identifier 'md5'; did you mean 'md'?
            wc_Md5Update(md5, data, sz);
                         ^~~
                         md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7028:30: error: use of undeclared identifier 'md5'; did you mean 'md'?
                wc_Md5Update(md5, salt, EVP_SALT_SIZE);
                             ^~~
                             md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7029:25: error: use of undeclared identifier 'md5'; did you mean 'md'?
            wc_Md5Final(md5, digest);
                        ^~~
                        md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7032:30: error: use of undeclared identifier 'md5'; did you mean 'md'?
                wc_Md5Update(md5, digest, MD5_DIGEST_SIZE);
                             ^~~
                             md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7033:29: error: use of undeclared identifier 'md5'; did you mean 'md'?
                wc_Md5Final(md5, digest);
                            ^~~
                            md
src/ssl.c:6960:46: note: 'md' declared here
                       const WOLFSSL_EVP_MD* md, const byte* salt,
                                             ^
src/ssl.c:7082:57: error: use of undeclared identifier 'Md5'
        typedef char md5_test[sizeof(MD5_CTX) >= sizeof(Md5) ? 1 : -1];
                                                        ^
src/ssl.c:7086:21: error: use of undeclared identifier 'Md5'
        wc_InitMd5((Md5*)md5);
                    ^
src/ssl.c:7086:25: error: expected expression
        wc_InitMd5((Md5*)md5);
                        ^
src/ssl.c:7094:23: error: use of undeclared identifier 'Md5'
        wc_Md5Update((Md5*)md5, (const byte*)input, (word32)sz);
                      ^
src/ssl.c:7094:27: error: expected expression
        wc_Md5Update((Md5*)md5, (const byte*)input, (word32)sz);
                          ^
src/ssl.c:7101:22: error: use of undeclared identifier 'Md5'
        wc_Md5Final((Md5*)md5, input);
                     ^
src/ssl.c:7101:26: error: expected expression
        wc_Md5Final((Md5*)md5, input);
                         ^
/bin/sh ./libtool  --tag=CC   --mode=compile clang -DHAVE_CONFIG_H -I.  -DBUILDING_WOLFSSL -fvisibility=hidden -fvisibility=hidden -DBUILDING_WOLFSSL -DOPENSSL_EXTRA -DWOLFSSL_DTLS -D_POSIX_THREADS  -DHAVE_THREAD_LS -DNDEBUG -D_THREAD_SAFE  -DPERSIST_SESSION_CACHE -DPERSIST_CERT_CACHE -DWOLFSSL_SNIFFER -DOPENSSL_EXTRA -DHAVE_AESGCM -DHAVE_AESCCM -DWOLFSSL_AESNI -maes -msse4 -DHAVE_POLY1305 -DHAVE_ONE_TIME_AUTH -DHAVE_CAMELLIA -DWOLFSSL_RIPEMD -DHAVE_BLAKE2 -DWOLFSSL_SHA512 -DWOLFSSL_SHA384 -DSESSION_CERTS -DWOLFSSL_KEY_GEN -DWOLFSSL_CERT_GEN -DWOLFSSL_CERT_REQ -DHAVE_HKDF -DNO_DSA -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR -DHAVE_ECC25519 -DHAVE_ECC_ENCRYPT -DNO_MD5 -DNO_OLD_TLS -DNO_MD4 -DHAVE_HC128 -DHAVE_RABBIT -DHAVE_CHACHA -DHAVE_HASHDRBG -DHAVE_OCSP -DHAVE_OPENSSL_CMD -DHAVE_CRL -DHAVE_CRL_MONITOR -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES -DUSE_FAST_MATH -DUSE_FAST_MATH -Wall -Wno-unused -O2 -fomit-frame-pointer -funroll-loops -DTFM_SMALL_SET -DTFM_HUGE_SET -Wall -Wno-strict-aliasing -Wextra -Wunknown-pragmas -Waddress -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wstrict-overflow=1 -Wstrict-prototypes -Wswitch-enum -Wundef -Wunused -Wunused-result -Wunused-variable -Wwrite-strings -fwrapv -fPIE  -c -o src/src_libwolfssl_la-ocsp.lo `test -f 'src/ocsp.c' || echo './'`src/ocsp.c
17 errors generated.
make[1]: *** [src/src_libwolfssl_la-ssl.lo] Error 1
make[1]: *** Waiting for unfinished jobs....

ER: Support for compiling out unused ECC curves

It'd be awesome to have clear #define options to remove unused ECC curves. For example, in our solution the smallest curve we're using is P-256 so we don't need P-112, P-128, P-160, P-192, and P-224, which saves us 1.5K of flash usage. Additionally, if we only needed P-256 we can save a total of 3K of flash usage! These calculations were based on removing the defines in ecc.c: https://github.com/wolfSSL/wolfssl/blob/master/wolfcrypt/src/ecc.c#L53-L60

Compile crashes and burns on OS X --with-fips

Different report from the one I just filed, apologies 😸.

Version v3.4.0.
Compiler: Clang 6.0, Build 600.

Configure opts:

./configure --disable-silent-rules --disable-dependency-tracking --infodir=/usr/local/Cellar/cyassl/3.4.0/share/info --mandir=/usr/local/Cellar/cyassl/3.4.0/share/man --prefix=/usr/local/Cellar/cyassl/3.4.0 --sysconfdir=/usr/local/etc --disable-bump --disable-examples --disable-fortress --disable-md5 --disable-sniffer --disable-webserver --enable-aesccm --enable-aesgcm --enable-blake2 --enable-camellia --enable-certgen --enable-certreq --enable-chacha --enable-crl --enable-crl-monitor --enable-dtls --enable-dh --enable-ecc --enable-eccencrypt --enable-ecc25519 --enable-filesystem --enable-hc128 --enable-hkdf --enable-inline --enable-keygen --enable-ocsp --enable-opensslextra --enable-poly1305 --enable-psk --enable-rabbit --enable-ripemd --enable-savesession --enable-savecert --enable-sessioncerts --enable-sha512 --enable-sni --enable-supportedcurves --enable-fastmath --enable-fasthugemath --enable-aesni --enable-fips

Failure:

In file included from ./cyassl/ctaocrypt/random.h:27:
./wolfssl/wolfcrypt/random.h:114:21: error: unknown type name 'OS_Seed'
int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
                    ^
./wolfssl/wolfcrypt/random.h:125:29: error: unknown type name 'RNG'
WOLFSSL_API int  wc_InitRng(RNG*);
                            ^
./wolfssl/wolfcrypt/random.h:126:39: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateBlock(RNG*, byte*, word32 sz);
                                      ^
./wolfssl/wolfcrypt/random.h:127:38: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateByte(RNG*, byte*);
                                     ^
In file included from src/io.c:34:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
In file included from ./wolfssl/wolfcrypt/rsa.h:31:
In file included from ./cyassl/ctaocrypt/rsa.h:30:
In file included from ./cyassl/ctaocrypt/random.h:27:
./wolfssl/wolfcrypt/random.h:114:21: error: unknown type name 'OS_Seed'
int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
                    ^./wolfssl/wolfcrypt/random.h:131:32: error: unknown type name 'RNG'
    WOLFSSL_API int wc_FreeRng(RNG*);
                               ^

In file included from src/ssl.c:32:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
In file included from ./wolfssl/wolfcrypt/rsa.h:31:
In file included from ./cyassl/ctaocrypt/rsa.h:30:
In file included from ./cyassl/ctaocrypt/random.h:27:
./wolfssl/wolfcrypt/random.h:114:21: error: unknown type name 'OS_Seed'
int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
                    ^
./wolfssl/wolfcrypt/random.h:125:29: error: unknown type name 'RNG'
WOLFSSL_API int  wc_InitRng(RNG*);
                            ^
./wolfssl/wolfcrypt/random.h:126:39: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateBlock(RNG*, byte*, word32 sz);
                                      ^
./wolfssl/wolfcrypt/random.h:127:38: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateByte(RNG*, byte*);
                                     ^
In file included from src/internal.c:29:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
In file included from ./wolfssl/wolfcrypt/rsa.h:31:
In file included from ./cyassl/ctaocrypt/rsa.h:30:
In file included from ./cyassl/ctaocrypt/random.h:27:
./wolfssl/wolfcrypt/random.h:114:21: error: unknown type name 'OS_Seed'
./wolfssl/wolfcrypt/random.h:131:32: error: unknown type name 'RNG'
int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
                    ^
    WOLFSSL_API int wc_FreeRng(RNG*);
                               ^
./wolfssl/wolfcrypt/random.h:125:29: error: unknown type name 'RNG'
WOLFSSL_API int  wc_InitRng(RNG*);
                            ^
./wolfssl/wolfcrypt/random.h:125:29: error: unknown type name 'RNG'
WOLFSSL_API int  wc_InitRng(RNG*);
                            ^
./wolfssl/wolfcrypt/random.h:126:39: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateBlock(RNG*, byte*, word32 sz);
                                      ^
./wolfssl/wolfcrypt/random.h:126:39: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateBlock(RNG*, byte*, word32 sz);
                                      ^
./wolfssl/wolfcrypt/random.h:127:38: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateByte(RNG*, byte*);
                                     ^
./wolfssl/wolfcrypt/random.h:127:38: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateByte(RNG*, byte*);
                                     ^
./wolfssl/wolfcrypt/random.h:131:32: error: unknown type name 'RNG'
    WOLFSSL_API int wc_FreeRng(RNG*);
                               ^
./wolfssl/wolfcrypt/random.h:131:32: error: unknown type name 'RNG'
    WOLFSSL_API int wc_FreeRng(RNG*);
                               ^
In file included from src/keys.c:30:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.hIn file included from src/internal.c:29:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
./wolfssl/wolfcrypt/rsa.h:75:32: error: unknown type name 'RsaKey'
In file included from src/io.cWOLFSSL_API int  wc_InitRsaKey(RsaKey* key, void*);
                               ^
:29:
./wolfssl/wolfcrypt/rsa.h:75:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_InitRsaKey(RsaKey* key, void*);
                               ^
In file included from src/ssl.c:32:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
./wolfssl/wolfcrypt/rsa.h:75:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_InitRsaKey(RsaKey* key, void*);
                               ^
./wolfssl/wolfcrypt/rsa.h:76:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_FreeRsaKey(RsaKey* key);
                               ^
./wolfssl/wolfcrypt/rsa.h:76:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_FreeRsaKey(RsaKey* key);
                               ^
./wolfssl/wolfcrypt/rsa.h:79:49: error: unknown type name 'RsaKey'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                ^
./wolfssl/wolfcrypt/rsa.h:79:49: error: unknown type name 'RsaKey'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                ^
./wolfssl/wolfcrypt/rsa.h:79:62: error: unknown type name 'RNG'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                             ^
./wolfssl/wolfcrypt/rsa.h:76:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_FreeRsaKey(RsaKey* key);
                               ^
:34:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
./wolfssl/wolfcrypt/rsa.h:75:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_InitRsaKey(RsaKey* key, void*);
                               ^
./wolfssl/wolfcrypt/rsa.h:79:62: error: unknown type name 'RNG'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                             ^
./wolfssl/wolfcrypt/rsa.h:81:41: error: unknown type name 'RsaKey'
                                        RsaKey* key);
                                        ^
./wolfssl/wolfcrypt/rsa.h:79:49: error: unknown type name 'RsaKey'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                ^
./wolfssl/wolfcrypt/rsa.h:81:41: error: unknown type name 'RsaKey'
                                        RsaKey* key);
                                        ^
./wolfssl/wolfcrypt/rsa.h:83:50: error: unknown type name 'RsaKey'
                                  word32 outLen, RsaKey* key);
                                                 ^
./wolfssl/wolfcrypt/rsa.h:83:50: error: unknown type name 'RsaKey'
                                  word32 outLen, RsaKey* key);
                                                 ^
./wolfssl/wolfcrypt/rsa.h:79:62: error: unknown type name 'RNG'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                             ^
./wolfssl/wolfcrypt/rsa.h:76:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_FreeRsaKey(RsaKey* key);
                               ^
./wolfssl/wolfcrypt/rsa.h:85:44: error: unknown type name 'RsaKey'
                            word32 outLen, RsaKey* key, RNG* rng);
                                           ^
./wolfssl/wolfcrypt/rsa.h:81:41: error: unknown type name 'RsaKey'
                                        RsaKey* key);
                                        ^
./wolfssl/wolfcrypt/rsa.h:85:57: error: unknown type name 'RNG'
                            word32 outLen, RsaKey* key, RNG* rng);
                                                        ^
./wolfssl/wolfcrypt/rsa.h:79:49: error: unknown type name 'RsaKey'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                ^
./wolfssl/wolfcrypt/rsa.h:85:44: error: unknown type name 'RsaKey'
                            word32 outLen, RsaKey* key, RNG* rng);
                                           ^
./wolfssl/wolfcrypt/rsa.h:83:50: error: unknown type name 'RsaKey'
                                  word32 outLen, RsaKey* key);
                                                 ^
./wolfssl/wolfcrypt/rsa.h:85:57: error: unknown type name 'RNG'
                            word32 outLen, RsaKey* key, RNG* rng);
                                                        ^
./wolfssl/wolfcrypt/rsa.h:87:37: error: unknown type name 'RsaKey'
                                    RsaKey* key);
                                    ^
./wolfssl/wolfcrypt/rsa.h:85:44: error: unknown type name 'RsaKey'
                            word32 outLen, RsaKey* key, RNG* rng);
                                           ^
./wolfssl/wolfcrypt/rsa.h:79:62: error: unknown type name 'RNG'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                             ^
./wolfssl/wolfcrypt/rsa.h:85:57: error: unknown type name 'RNG'
                            word32 outLen, RsaKey* key, RNG* rng);
                                                        ^
./wolfssl/wolfcrypt/rsa.h:87:37: error: unknown type name 'RsaKey'
                                    RsaKey* key);
                                    ^
./wolfssl/wolfcrypt/rsa.h:87:37: error: unknown type name 'RsaKey'
                                    RsaKey* key);
                                    ^
./wolfssl/wolfcrypt/rsa.h:89:46: error: unknown type name 'RsaKey'
                              word32 outLen, RsaKey* key);
                                             ^
./wolfssl/wolfcrypt/rsa.h:81:41: error: unknown type name 'RsaKey'
                                        RsaKey* key);
                                        ^
./wolfssl/wolfcrypt/rsa.h:89:46: error: unknown type name 'RsaKey'
                              word32 outLen, RsaKey* key);
                                             ^
./wolfssl/wolfcrypt/rsa.h:89:46: error: unknown type name 'RsaKey'
                              word32 outLen, RsaKey* key);
                                             ^
./wolfssl/wolfcrypt/rsa.h:90:36: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaEncryptSize(RsaKey* key);
                                   ^
./wolfssl/wolfcrypt/rsa.h:90:36: error: unknown type name 'RsaKey'
./wolfssl/wolfcrypt/rsa.h:83:50: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaEncryptSize(RsaKey* key);
                                   ^
                                  word32 outLen, RsaKey* key);
                                                 ^
./wolfssl/wolfcrypt/rsa.h:90:36: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaEncryptSize(RsaKey* key);
                                   ^
./wolfssl/wolfcrypt/rsa.h:100:41: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
                                        ^
./wolfssl/wolfcrypt/rsa.h:100:41: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
                                        ^
./wolfssl/wolfcrypt/rsa.h:85:44: error: unknown type name 'RsaKey'
                            word32 outLen, RsaKey* key, RNG* rng);
                                           ^
./wolfssl/wolfcrypt/rsa.h:85:57: error: unknown type name 'RNG'
                            word32 outLen, RsaKey* key, RNG* rng);
                                                        ^
./wolfssl/wolfcrypt/rsa.h:104:35: error: unknown type name 'RsaKey'
./wolfssl/wolfcrypt/rsa.h:100:41: error: unknown type name 'RsaKey'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                  ^
WOLFSSL_API int  wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
                                        ^
./wolfssl/wolfcrypt/rsa.h:104:35: error: unknown type name 'RsaKey'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                  ^
./wolfssl/wolfcrypt/rsa.h:104:66: error: unknown type name 'RNG'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                                                 ^
./wolfssl/wolfcrypt/rsa.h:./wolfssl/wolfcrypt/rsa.h:104:66: error: unknown type name 'RNG'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                                                 ^
./wolfssl/wolfcrypt/rsa.h:104:35: error: unknown type name 'RsaKey'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
fatal error: too many errors emitted, stopping now [-ferror-limit=]
./wolfssl/wolfcrypt/rsa.h:104:66: error: unknown type name 'RNG'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                                                 ^
87:37: error: unknown type name 'RsaKey'
                                    RsaKey* key);
                                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
./wolfssl/wolfcrypt/rsa.h:89:46: error: unknown type name 'RsaKey'
                              word32 outLen, RsaKey* key);
                                             ^
./wolfssl/wolfcrypt/rsa.h:90:36: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaEncryptSize(RsaKey* key);
                                   ^
./wolfssl/wolfcrypt/rsa.h:100:41: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
                                        ^
./wolfssl/wolfcrypt/rsa.h:104:35: error: unknown type name 'RsaKey'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                  ^
./wolfssl/wolfcrypt/rsa.h:104:66: error: unknown type name 'RNG'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [src/src_libwolfssl_la-io.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
20 errors generated.
make[1]: *** [src/src_libwolfssl_la-keys.lo] Error 1
In file included from src/tls.c:30:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
In file included from ./wolfssl/wolfcrypt/rsa.h:31:
In file included from ./cyassl/ctaocrypt/rsa.h:30:
In file included from ./cyassl/ctaocrypt/random.h:27:
./wolfssl/wolfcrypt/random.h:114:21: error: unknown type name 'OS_Seed'
int wc_GenerateSeed(OS_Seed* os, byte* seed, word32 sz);
                    ^
./wolfssl/wolfcrypt/random.h:125:29: error: unknown type name 'RNG'
WOLFSSL_API int  wc_InitRng(RNG*);
                            ^
./wolfssl/wolfcrypt/random.h:126:39: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateBlock(RNG*, byte*, word32 sz);
                                      ^
./wolfssl/wolfcrypt/random.h:127:38: error: unknown type name 'RNG'
WOLFSSL_API int  wc_RNG_GenerateByte(RNG*, byte*);
                                     ^
./wolfssl/wolfcrypt/random.h:131:32: error: unknown type name 'RNG'
    WOLFSSL_API int wc_FreeRng(RNG*);
                               ^
In file included from src/tls.c:30:
In file included from ./wolfssl/internal.h:30:
In file included from ./wolfssl/crl.h:30:
In file included from ./wolfssl/wolfcrypt/asn.h:29:
./wolfssl/wolfcrypt/rsa.h:75:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_InitRsaKey(RsaKey* key, void*);
                               ^
./wolfssl/wolfcrypt/rsa.h:76:32: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_FreeRsaKey(RsaKey* key);
                               ^
./wolfssl/wolfcrypt/rsa.h:79:49: error: unknown type name 'RsaKey'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                ^
./wolfssl/wolfcrypt/rsa.h:79:62: error: unknown type name 'RNG'
                                 word32 outLen, RsaKey* key, RNG* rng);
                                                             ^
./wolfssl/wolfcrypt/rsa.h:81:41: error: unknown type name 'RsaKey'
                                        RsaKey* key);
                                        ^
./wolfssl/wolfcrypt/rsa.h:83:50: error: unknown type name 'RsaKey'
                                  word32 outLen, RsaKey* key);
                                                 ^
./wolfssl/wolfcrypt/rsa.h:85:44: error: unknown type name 'RsaKey'
                            word32 outLen, RsaKey* key, RNG* rng);
                                           ^
./wolfssl/wolfcrypt/rsa.h:85:57: error: unknown type name 'RNG'
                            word32 outLen, RsaKey* key, RNG* rng);
                                                        ^
./wolfssl/wolfcrypt/rsa.h:87:37: error: unknown type name 'RsaKey'
                                    RsaKey* key);
                                    ^
./wolfssl/wolfcrypt/rsa.h:89:46: error: unknown type name 'RsaKey'
                              word32 outLen, RsaKey* key);
                                             ^
./wolfssl/wolfcrypt/rsa.h:90:36: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaEncryptSize(RsaKey* key);
                                   ^
./wolfssl/wolfcrypt/rsa.h:100:41: error: unknown type name 'RsaKey'
WOLFSSL_API int  wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
                                        ^
./wolfssl/wolfcrypt/rsa.h:104:35: error: unknown type name 'RsaKey'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                  ^
./wolfssl/wolfcrypt/rsa.h:104:66: error: unknown type name 'RNG'
    WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
                                                                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[1]: *** [src/src_libwolfssl_la-internal.lo] Error 1
20 errors generated.
make[1]: *** [src/src_libwolfssl_la-tls.lo] Error 1
20 errors generated.
make[1]: *** [src/src_libwolfssl_la-ssl.lo] Error 1
make: *** [all] Error 2

DTLS 1.2 server implementation rejects valid ClientHello packets after HelloVerifySent

Quoting from 4.2.1 of RFC 6347 (describing client_version and server_version in ClientHello resp. HelloVerifySent):

DTLS 1.2 and 1.0 clients MUST use the version solely to indicate packet formatting (which is the same in both DTLS 1.2 and 1.0) and not as part of version negotiation.
...
When responding to a HelloVerifyRequest, the client MUST use the same parameter values (version, random, session_id, cipher_suites, compression_method) as it did in the original ClientHello.

So when a client sends ClientHello with version set to 1.0 it needs to send 1.0 again in the ClientHello after HelloVerifyRequest regardless of what version the server sent. However, when using wolfSSL_DTLSv1_2_server_method for running a DTLS server, the second ClientHello is not accepted by the server and wolfSSL_accept fails with VERSION_ERROR.

I think this is caused by the check starting at https://github.com/wolfSSL/wolfssl/blob/master/src/internal.c#L3014. Changing https://github.com/wolfSSL/wolfssl/blob/master/src/internal.c#L3016 to (ssl->options.acceptState == ACCEPT_BEGIN || ssl->options.acceptState == HELLO_VERIFY_SENT) fixed that issue for me locally, but I'm not sure if there are checks elsewhere that need to be changed.

This issue was observed when trying to connect DTLS client using GnuTLS 3.3.8 to an DTLS server using wolfSSL 3.6.0.

Initialization of the Crypto HW protection may be unsafe

Thanks a lot for adding support for the Crypto HW protection! Looking at the diff it seems like there may be a race condition when initializing the mutex: https://github.com/wolfSSL/wolfssl/blob/master/wolfcrypt/src/wc_port.c#L56-L57.

Here's the scenario that concerns me:

  1. Thread A calls wolfSSL_CryptHwMutexLock(), which starts the init process
  2. Thread A gets preempted by Thread B, which also calls wolfSSL_CryptHwMutexLock() and starts the init process
  3. Thread B finishes creating the mutex and Thread A leaks the mutex it created

ER: Set memory for ecc.c to be DYNAMIC_TYPE_ECC instead of DYNAMIC_TYPE_BIGINT

It'd be great if the memory allocated by XMALLOC in ecc.c was set to the type DYNAMIC_TYPE_ECC rather than DYNAMIC_TYPE_BIGINT because it would help a lot in tracking down memory issues related to ECC. Here are the specific lines:

https://github.com/wolfSSL/wolfssl/blob/master/wolfcrypt/src/ecc.c#L1382
https://github.com/wolfSSL/wolfssl/blob/master/wolfcrypt/src/ecc.c#L1396
https://github.com/wolfSSL/wolfssl/blob/master/wolfcrypt/src/ecc.c#L1421

internal.c does not obey TIME_OVERRIDES define

internal.c does not obey the TIME_OVERRIDES definition: it includes <time.h> and defines its own method for LowResTimer. It seems like USER_TICKS is the best way to override this but it should coexist peacefully with the TIME_OVERRIDES define.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.