Compare commits

...

181 Commits

Author SHA1 Message Date
kaleb-himes
844e961ff5 Check-in FIPS 140-3 PILOT changes 2023-08-28 15:43:24 -07:00
Daniel Pouzzner
ceae7d56fa Merge pull request #4551 from ejohnstown/aes-ofb
Add AES-OFB to FIPS boundary
2021-11-15 22:56:43 -06:00
Daniel Pouzzner
cae3fcb9ce Merge pull request #4569 from masap/i386-segfault
dsa.c: fix error-path mp_clear()s on uninitialized mp_ints in wc_DsaSign() and wc_DsaVerify().
2021-11-15 22:51:23 -06:00
Masashi Honma
6086728968 Fix possible segfault occurs when mp_clear() is executed for uninitialized mp_int
If NULL is passed as the digest argument of wc_DsaSign(), mp_clear() will be
called before mp_init() is called. This can cause segmentation fault.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-16 09:57:02 +09:00
Masashi Honma
f621defefe Fix the segfault occurs when mp_clear() is executed for uninitialized mp_int on i386
test_wc_DsaSignVerify() passes the tests but causes an error.

free(): invalid pointer

If NULL is passed as the digest argument of wc_DsaVerify(), mp_clear() will be
called before mp_init() is called. On qemu-i386, the dp field of the mp_int
structure is non-null by default, which causes a segmentation fault when calling
mp_clear(). However, if WOLFSSL_SMALL_STACK is enabled, this problem does not
occur.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-16 09:56:56 +09:00
Sean Parkinson
64407bbd7d Merge pull request #4564 from rizlik/unused_ret_value_fix
woflcrypt/src/rsa.c: check memory allocation return value
2021-11-16 08:56:47 +10:00
Daniel Pouzzner
c80e63a822 Merge pull request #4566 from ejohnstown/fips-check
fips-check script update
2021-11-15 13:23:54 -06:00
John Safranek
13871cf547 Set RC10 to be the default v5 FIPS build. 2021-11-15 10:03:50 -08:00
John Safranek
0d465cf42f Add AES-OFB to FIPSv5 build as v5-RC10 (5,2) 2021-11-15 10:03:49 -08:00
David Garske
ab74bbcfee Merge pull request #4567 from SparkiDev/sp_scripts_sync_1
SP sync: Missing update
2021-11-15 07:04:08 -08:00
Sean Parkinson
79f18c7585 SP sync: Missing update 2021-11-15 08:33:14 +10:00
Sean Parkinson
d6219567c1 Merge pull request #4565 from dgarske/spelling
Fixes for spelling errors
2021-11-15 08:20:41 +10:00
John Safranek
3384159cb9 Add WCv5.0-RC10 to fips-check script. Remove some new whitespace from sniffer. 2021-11-12 14:10:58 -08:00
David Garske
25054bd87f Merge pull request #4538 from julek-wolfssl/sk_free-refactor
Refactor sk_*_free functions and stack type
2021-11-12 10:30:14 -08:00
David Garske
a626a4fb02 Fixes for spelling errors. 2021-11-12 10:27:49 -08:00
David Garske
600d562168 Merge pull request #4558 from anhu/falcon_bench
Add Falcon benchmarking.
2021-11-12 09:14:08 -08:00
Juliusz Sosinowicz
4112cd4b99 Make stack type an enum 2021-11-12 14:48:17 +01:00
Juliusz Sosinowicz
361975abbc Refactor sk_*_free functions
Use a single `wolfSSL_sk_pop_free` and `wolfSSL_sk_free` function that free's the stack and optionally free's the node content as well.
2021-11-12 13:55:37 +01:00
John Safranek
2501aef34e Merge pull request #4562 from SparkiDev/cert_suite_check 2021-11-11 15:36:12 -08:00
John Safranek
af67692e4a Merge pull request #4559 from dgarske/sniffer_ht 2021-11-11 14:44:01 -08:00
John Safranek
4e20b93e72 Merge pull request #4556 from douzzer/updateFipsHash 2021-11-11 14:23:01 -08:00
John Safranek
c702dab988 Merge pull request #4561 from haydenroche5/wc_prf_fix 2021-11-11 13:03:58 -08:00
Marco Oliverio
3ea4e35737 woflcrypt/src/rsa.c: check memory allocation return value 2021-11-11 16:25:03 +01:00
Sean Parkinson
b5fd899113 TLS 1.2: check signature algo in ServerKeyExchange 2021-11-11 18:54:30 +10:00
Hayden Roche
2f29ca1092 Make fixes/improvements to TLS PRF code.
Make `wc_PRF` return an error if it doesn't find a corresponding hash for the
passed in hash type. Currently, if `wc_PRF_TLS` is called with `NO_OLD_TLS`
defined, it will do nothing but still return success. Make it return an error
instead. These problems were uncovered when running the wolfEngine unit tests
with wolfSSL 5.0.0 FIPS Ready, which defines `NO_MD5` and `NO_OLD_TLS`.
2021-11-10 15:19:43 -08:00
David Garske
607a3bfaa7 Merge pull request #4554 from SparkiDev/mp_test_32bit
mp_test: when SP_INT_DIGITS is even calc was wrong
2021-11-10 15:07:43 -08:00
David Garske
3c1deff611 Fix falcon bench cleanup case (should not free if init fails). Fix RSA key gen keySz with ./wolfcrypt/benchmark/benchmark -asym. 2021-11-10 15:03:44 -08:00
Anthony Hu
f2465e5688 include.am 2021-11-10 18:01:40 -05:00
Anthony Hu
242847760a More appropriate file names. 2021-11-10 17:55:46 -05:00
Anthony Hu
453404a864 Get the falcon keys into wolfssl/certs_test.h 2021-11-10 17:33:24 -05:00
Anthony Hu
5fe078d7db sig1, sig5 --> sig 2021-11-10 16:52:05 -05:00
Anthony Hu
246d470956 Refactor to do proper memory management. 2021-11-10 16:42:48 -05:00
David Garske
1cadf88f26 Fixes for sniffer and handling of out-of-order situations that can occur with a saturated link. 2021-11-10 13:37:21 -08:00
Anthony Hu
6165323829 Satisfy a jenkins test. 2021-11-10 15:29:09 -05:00
Anthony Hu
237b098ba5 Add Falcon benchmarking. 2021-11-10 14:53:35 -05:00
David Garske
b2ba6f94af Merge pull request #4557 from LinuxJedi/doxygen-fixes
Fix up some Doxygen issues for 1.9
2021-11-10 11:29:47 -08:00
Andrew Hutchings
231546dacc Fix more Doxygen typos 2021-11-10 17:26:33 +00:00
Andrew Hutchings
afe8d74333 Fix up some Doxygen issues for 1.9
Some of the Doxygen content was not processed correctly by Doxygen.
This patch fixes all the issues found.
2021-11-10 16:20:13 +00:00
Daniel Pouzzner
6d55f8e42a ssl.c: fixes for C++ pointer type hygiene. 2021-11-09 22:41:06 -06:00
Daniel Pouzzner
ed0418c2a8 fix whitespace. 2021-11-09 22:17:38 -06:00
Daniel Pouzzner
313d29f752 linuxkm: in module_hooks.c, refactor WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED gates to WOLFSSL_LINUXKM_SIMD_X86, and add updateFipsHash(). 2021-11-09 22:02:17 -06:00
Sean Parkinson
341bd7bbbc mp_test: when SP_INT_DIGITS is even calc was wrong 2021-11-10 09:33:14 +10:00
Sean Parkinson
8e0fdc64be Merge pull request #4522 from dgarske/static_eph
Fixes and refactor for static ephemeral key support
2021-11-10 08:22:51 +10:00
David Garske
9a83842c29 Merge pull request #4536 from luizluca/refactor_nameconstraints-permit
ASN: refactor name constraints checks
2021-11-09 10:44:17 -08:00
David Garske
bd0f6736c5 Merge pull request #4513 from masap/wpa_sup_dpp
Fix X509_PUBKEY_set() to show correct algorithm and parameters
2021-11-09 10:26:59 -08:00
David Garske
fe172ed9c1 Fix for generation of ephemeral key if static ephemeral is not set. 2021-11-09 10:14:23 -08:00
David Garske
eebed0cc1c Fix for possible ret may be used uninitialized. 2021-11-09 08:27:44 -08:00
David Garske
df82b01e68 Added x448 static ephemeral support. 2021-11-09 08:27:42 -08:00
David Garske
e91439f2eb Fixes for static ephemeral key support with threading and possible use after free. 2021-11-09 08:25:47 -08:00
David Garske
4a04e56ac8 Fix to allow calls to get TLS session random even if wolfSSL_KeepArrays has not been called. 2021-11-09 08:23:19 -08:00
David Garske
5dac25f470 Eliminate EIGHTK_BUF use in asn. Cleanup uses of 0 in set_verify for callback. 2021-11-09 08:23:19 -08:00
David Garske
1d9832c0de Merge pull request #4545 from douzzer/misc-fixes-20211105
global typographic and file mode fixes
2021-11-08 20:54:20 -08:00
Daniel Pouzzner
97557ed29b linuxkm: add --enable-benchmark switch (default yes) and BUILD_BENCHMARK conditional to configure.ac to allow build with testwolfcrypt but without benchmark; change gate in wolfcrypt/benchmark/include.am from if !BUILD_LINUXKM to if BUILD_BENCHMARK. 2021-11-08 18:25:15 -06:00
Daniel Pouzzner
03d5c4e6d3 test.c: fix whitespace. 2021-11-08 18:24:42 -06:00
Daniel Pouzzner
18e487069b src/internal.c: fix typo introduced in earlier "typographic cleanup". 2021-11-08 18:24:08 -06:00
Daniel Pouzzner
95bed1cdfd test.c: smallstack refactors for idea_test(), ed448_test(), and verifyBundle() (fixes various error-dependent leaks too). 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
25f74d4967 ssl.c: wolfSSL_UseALPN(): allocate char **token (2kB) on the heap, not the stack. 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
f8565f26e2 fixes for --disable-harden. 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
27d4bb304c test.c add smallstack refactor of pkcs7enveloped_run_vectors(). 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
26cc534dd2 wolfcrypt/test/test.c: fix memory leaks in pkcs7signed_run_[SingleShot]Vectors() added in smallstack refactor. 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
11ffb037ba linuxkm/module_exports.c.template: remove accidentally added MSC clause. 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
beebd1411d linuxkm/module_hooks.c: fix whitespace, and update code around WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE and updateFipsHash(). 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
8b3048a0ea wolfcrypt/test/test.c: smallstack refactors for pkcs7authenveloped_run_vectors(), pkcs7signed_run_vectors(), and pkcs7signed_run_SingleShotVectors(); typographic&whitespace cleanup. 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
59ec9fc285 configure.ac: refactor setup for --enable-reproducible-build; remove mutex between --enable-sp-math and --enable-sp-math-all (they can now coexist); whitespace cleanup. 2021-11-08 17:35:10 -06:00
Daniel Pouzzner
0b4f34d62a typographic cleanup: fix whitespace, remove unneeded UTF-8, convert C++ comment constructs to C. 2021-11-08 17:35:05 -06:00
Luiz Angelo Daros de Luca
01335e2e1c ASN: refactor name constraints checks
Use the same logic for any type of name constraint.

It could be even cleaner if there were a altNamesByType[],
permittedNamesByType[] and excludedNamesByType[] in cert.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-11-08 20:29:18 -03:00
Daniel Pouzzner
8f121e7752 file modes: clear inappropriate executable bits. 2021-11-08 17:28:11 -06:00
Sean Parkinson
dd833807d8 Merge pull request #4523 from dgarske/nxp_se050_fixes
Fixes for NXP SE050 ECC create and key store id
2021-11-09 08:56:03 +10:00
David Garske
5a4577eb6c Merge pull request #4541 from SparkiDev/mp_hexchar_asm
SP, TFM: fixes
2021-11-08 14:49:02 -08:00
Sean Parkinson
49024b131e Merge pull request #4534 from JacobBarthelmeh/fuzzing
check size of values with sp_gcd
2021-11-09 08:40:21 +10:00
Masashi Honma
ee39fd079f Fix X509_PUBKEY_set() to show correct algorithm and parameters
When build with OpenSSL, trailing program outputs these messages.

algorithm: id-ecPublicKey
parameters: prime256v1

But with wolfSSL, X509_PUBKEY_get0_param() fails.
This patch fixes wolfSSL to display the same values as OpenSSL.

This program was extracted from wpa_supplicant in order to reproduce the
issue.

----------------
int main(void)
{
    EVP_PKEY *pkey;
    X509_PUBKEY *pub = NULL;
    ASN1_OBJECT *ppkalg, *poid;
    const ASN1_OBJECT *pa_oid;
    const uint8_t *pk;
    int ppklen, ptype;
    X509_ALGOR *pa;
    void *pval;
    char buf[100];
    const uint8_t data[] = {
        0x30, 0x39, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
        0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x22, 0x00, 0x03, 0x33, 0x6d, 0xb4, 0xe9, 0xab,
        0xf1, 0x1c, 0x96, 0x87, 0x5e, 0x02, 0xcc, 0x92, 0xaf, 0xf6, 0xe1, 0xed, 0x2b, 0xb2, 0xb7, 0xcc,
        0x3f, 0xd2, 0xb5, 0x4e, 0x6f, 0x20, 0xc7, 0xea, 0x2f, 0x3f, 0x42
    };
    size_t data_len = sizeof(data);
    const uint8_t *p;
    int res;

    p = data;
    pkey = d2i_PUBKEY(NULL, &p, data_len);
    if (!pkey) {
        fprintf(stderr, "d2i_PUBKEY() failed\n");
        return -1;
    }

    if (EVP_PKEY_type(EVP_PKEY_id(pkey)) != EVP_PKEY_EC) {
        fprintf(stderr, "invalid type\n");
        EVP_PKEY_free(pkey);
        return -1;
    }

    res = X509_PUBKEY_set(&pub, pkey);
    if (res != 1) {
        fprintf(stderr, "X509_PUBKEY_set() failed\n");
        return -1;
    }

    res = X509_PUBKEY_get0_param(&ppkalg, &pk, &ppklen, &pa, pub);
    if (res != 1) {
        fprintf(stderr, "X509_PUBKEY_get0_param() failed\n");
        return -1;
    }
    res = OBJ_obj2txt(buf, sizeof(buf), ppkalg, 0);
    if (res < 0 || (size_t) res >= sizeof(buf)) {
        fprintf(stderr, "OBJ_obj2txt() failed\n");
        return -1;
    }
    fprintf(stdout, "algorithm: %s\n", buf);

    X509_ALGOR_get0(&pa_oid, &ptype, (void *) &pval, pa);
    if (ptype != V_ASN1_OBJECT) {
        fprintf(stderr, "X509_ALGOR_get0() failed\n");
        return -1;
    }
    poid = pval;
    res = OBJ_obj2txt(buf, sizeof(buf), poid, 0);
    if (res < 0 || (size_t) res >= sizeof(buf)) {
        fprintf(stderr, "OBJ_obj2txt() failed\n");
        return -1;
    }
    fprintf(stdout, "parameters: %s\n", buf);

    X509_PUBKEY_free(pub);
    EVP_PKEY_free(pkey);
    return 0;
}

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
2021-11-09 07:30:58 +09:00
David Garske
4453001fac Merge pull request #4550 from kareem-wolfssl/gh4547
Fix doAsync warning in bench_ecc.
2021-11-08 13:24:18 -08:00
David Garske
478f57b347 Merge pull request #4535 from kareem-wolfssl/zd13165
Fix building with NO_ECC_KEY_EXPORT.
2021-11-08 11:11:53 -08:00
David Garske
67a11df15b Merge pull request #4548 from anhu/TlS
Fix capitalization.
2021-11-08 11:07:00 -08:00
Kareem
2f1a37769e Fix doAsync warning in bench_ecc. 2021-11-08 11:42:05 -07:00
Anthony Hu
a28e44730c Fix capitalization. 2021-11-08 11:45:49 -05:00
David Garske
3a9be7373f Merge pull request #4532 from embhorn/zd13139
Fix mem leak in HandleTlsResumption
2021-11-08 08:39:45 -08:00
John Safranek
d46b140250 Merge pull request #4544 from dgarske/hmachash 2021-11-05 15:11:07 -07:00
David Garske
3941eea626 Fixes for peer review feedback. Improve the ECC key bit calculation. Improve the signature RS unsigned bin creation. 2021-11-05 14:53:20 -07:00
Kaleb Himes
ba291b519d Merge pull request #4543 from julek-wolfssl/server-echo-return
Check correct var for `server.c` echo return.
2021-11-05 11:26:15 -06:00
Eric Blankenhorn
d6264059ac Fix mem leak in HandleTlsResumption 2021-11-05 11:40:40 -05:00
David Garske
e9aa76b34e Merge pull request #4542 from SparkiDev/dh_enc_fix
DH encoding: use correct length for inner sequence
2021-11-05 08:50:43 -07:00
David Garske
4fe17cc143 Merge pull request #4527 from julek-wolfssl/zd13097
Fix a heap buffer overflow with mismatched PEM structure ZD13097
2021-11-05 08:50:28 -07:00
David Garske
7fca031346 Remove duplicate code in wc_HmacFree (looks like past merge error). 2021-11-05 08:20:39 -07:00
Juliusz Sosinowicz
6d89de4f11 Check correct var for server.c echo return. 2021-11-05 16:10:17 +01:00
Sean Parkinson
d01f0d7a4c DH encoding: use correct length for inner sequence
Only affect small DH keys (like 512 bits).
2021-11-05 15:02:14 +10:00
Sean Parkinson
dc911b94e7 SP, TFM: fixes
HexCharToByte must be cast to a signed char as a char is unsigned on
some platforms.
Redefine the __asm__ and __volatile__ for ICC and KEIL in sp_int.c
mp_test: don't use large bit lengths if unsupported.
2021-11-05 11:49:24 +10:00
Chris Conlon
ae84a2a326 Merge pull request #4293 from TakayukiMatsuo/set_min_proto
Add support for value zero as version parameter for SSL_CTX_set_min/max_proto_version
2021-11-04 14:59:34 -06:00
David Garske
74a32e92eb Rename the internal "Hash" structure used by Hmac as it is too generic. 2021-11-04 11:56:00 -07:00
David Garske
d8faa22194 Fix for ecc_def_curve_test test changes. 2021-11-04 11:54:09 -07:00
David Garske
16afe7ff87 Merge pull request #4540 from anhu/forLealem
Changes suggest by Lealem after he tried the instructions.
2021-11-04 11:44:18 -07:00
Anthony Hu
6f9e501f45 Changes suggest by Lealem after he tried the instructions. 2021-11-04 11:00:18 -04:00
Juliusz Sosinowicz
1faa9e66b6 Check wolfSSL_BIO_read return 2021-11-04 15:34:33 +01:00
Kareem
60a86157c7 Fix building with NO_ECC_KEY_EXPORT. 2021-11-03 16:03:26 -07:00
Jacob Barthelmeh
ca72beb688 check size of values with sp_gcd 2021-11-03 16:56:45 -06:00
Sean Parkinson
8f7df68869 Merge pull request #4533 from JacobBarthelmeh/Testing
additional checks on fp montgomery return value
2021-11-04 08:36:27 +10:00
David Garske
b84edb5c67 Fixes for NXP SE050 testing with hardware. 2021-11-03 12:47:07 -07:00
Jacob Barthelmeh
7ca95bfaca additional checks on fp montgomery return value 2021-11-03 11:40:14 -06:00
David Garske
d24bfb6bf7 Merge pull request #4530 from anhu/falcon-pqsig
The NIST round 3 Falcon Signature Scheme integration.
2021-11-03 09:35:01 -07:00
David Garske
e9fbd94150 Fix for _ecc_validate_public_key and unused parameters for partial and priv. 2021-11-03 08:10:37 -07:00
David Garske
495cac8ad7 Fixes for NXP SE050 key sizes and key id use. Related to #4526 2021-11-02 16:34:19 -07:00
Anthony Hu
dbe3e550b0 Correct the directory to pq in reference to wolfssl-examples 2021-11-02 15:35:39 -04:00
David Garske
2abb2eae7d Changed NXP SE050 to not use symmetric offloading by default. If desired use WOLFSSL_SE050_HASH and WOLFSSL_SE050_CRYPT. 2021-11-02 12:00:24 -07:00
Anthony Hu
04f27551aa Some more sensible constants. 2021-11-02 14:59:31 -04:00
David Garske
945e4a0885 Merge pull request #4529 from anhu/disable_dh
Fix for being able to build with LIBOQS but without DH
2021-11-02 08:54:40 -07:00
David Garske
b652d2e631 Merge pull request #4524 from JacobBarthelmeh/Release
bump to dev version and touch up readme
2021-11-02 08:54:14 -07:00
Anthony Hu
81def76b18 The NIST round 3 Falcon Signature Scheme integration. 2021-11-02 11:12:10 -04:00
Anthony Hu
e1cc1e831e Fix for being able to build with LIBOQS but without DH
The following configuration yielded a compile error:
./configure --with-liboqs --disable-dh

This fixes bug reported on ZD13028.
2021-11-02 10:16:38 -04:00
Juliusz Sosinowicz
23487a4532 Fix a heap buffer overflow with mismatched PEM structure ZD13097 2021-11-02 11:31:22 +01:00
Sean Parkinson
2745f394e5 Merge pull request #4525 from cconlon/sslopno
TLS 1.3: check SSL_OP_NO_TLSv1_2 in TLS 1.3 clients
2021-11-02 09:40:59 +10:00
Jacob Barthelmeh
ac5e9e5e7c bump to dev version and touch up readme 2021-11-01 15:50:03 -06:00
David Garske
7e01af0121 Merge pull request #4521 from JacobBarthelmeh/Release
prepare for release v5.0.0
2021-11-01 12:45:22 -07:00
Jacob Barthelmeh
7c3d1c7fbc update rpm spec 2021-11-01 12:24:53 -06:00
Jacob Barthelmeh
44219906e0 add kdf.c to cs+ project 2021-11-01 12:02:53 -06:00
Daniel Pouzzner
6f18ba15b0 linuxkm: accommodate printk()->_printk() renaming in kernel 5.15+. 2021-11-01 11:49:56 -06:00
Daniel Pouzzner
742492cb5e linuxkm/Makefile: fix module sign-file error handling. 2021-11-01 11:49:48 -06:00
Jacob Barthelmeh
d869c60605 prepare for release v5.0.0 2021-11-01 11:43:25 -06:00
David Garske
f63a799f18 Fix for ECC create key public export size and key size bits. Fix for key store ID vs key ID. 2021-11-01 09:52:12 -07:00
David Garske
99f44149eb Merge pull request #4520 from JacobBarthelmeh/Testing
add kdf.c file to IDE projects and cmake, few edge case fuzz reports, remove exe bit and c files
2021-11-01 08:35:11 -07:00
Jacob Barthelmeh
fb7baf28ca fix for xcode build and revert cmake change 2021-10-29 16:55:05 -06:00
Daniel Pouzzner
6ba55edd50 fix async warnings 2021-10-29 14:37:39 -06:00
Jacob Barthelmeh
1d91ccb41b remove exe bit on example.c and server.c 2021-10-29 13:12:43 -06:00
Jacob Barthelmeh
03bc45c5b1 check if private key exists before using with private key check function 2021-10-29 10:51:24 -06:00
David Garske
5ad580b233 Merge pull request #4517 from elms/cmake/kdf
cmake: Add `kdf.c` and `FIPS_V5`
2021-10-29 09:29:23 -07:00
JacobBarthelmeh
fc01723407 Merge pull request #4516 from dgarske/asn_templ_genname
Fix for ASN template general name parsing
2021-10-29 23:14:50 +07:00
David Garske
a6415493eb Merge pull request #4518 from douzzer/nestable-save-vector-registers
linuxkm: fixes for {save,restore}_vector_registers_x86().
2021-10-29 09:14:32 -07:00
David Garske
8a8a6cf17f Merge pull request #4515 from kareem-wolfssl/zd13006
wc_scrypt: Check for underflow in blocksSz calculation.
2021-10-29 08:23:37 -07:00
Daniel Pouzzner
ddf927ae41 linuxkm: fixes for {save,restore}_vector_registers_x86(). 2021-10-29 01:26:48 -05:00
Elms
49389f3074 cmake: Add kdf.c and FIPS_V5 2021-10-28 16:50:15 -07:00
David Garske
e60c2201b2 Fix for general name parsing with WOLFSSL_ASN_TEMPLATE to use right length for general names and properly NULL terminate. 2021-10-28 16:13:58 -07:00
Jacob Barthelmeh
8775823fa0 handling edge cases with ecc import and decrypt functions 2021-10-28 17:11:56 -06:00
Chris Conlon
afad1374a3 check SSL_OP_NO_TLSv1_2 in TLS 1.3 enabled client 2021-10-28 16:30:02 -06:00
Jacob Barthelmeh
e10e3a92b8 add kdf.c to cmake build 2021-10-28 16:27:45 -06:00
Jacob Barthelmeh
9ec9ace7ea adding kdf.c to IDE builds 2021-10-28 16:19:18 -06:00
Kareem
39c9fa96bc wc_scrypt: Code review feedback. 2021-10-28 15:02:53 -07:00
David Garske
6b3ff9bae2 Merge pull request #4459 from julek-wolfssl/missing-ext
Add x509 name attributes and extensions to DER parsing and generation
2021-10-28 14:30:37 -07:00
Kareem
0ecb81e74a wc_scrypt: Check for underflow in blocksSz calculation. 2021-10-28 14:18:22 -07:00
David Garske
0a26335243 Merge pull request #4446 from ejohnstown/dtls-sizing
DTLS Sizing
2021-10-28 14:15:36 -07:00
David Garske
2c42770eea Merge pull request #4508 from elms/cmake/tlsx
cmake: add SNI and TLSx
2021-10-28 14:03:59 -07:00
Juliusz Sosinowicz
9c8e4f558c Explicit cast to int 2021-10-28 21:05:19 +02:00
Juliusz Sosinowicz
adee6a86d1 Return the close notify error when expecting an error. 2021-10-28 20:53:58 +02:00
David Garske
6bb7e3900e Merge pull request #4511 from JacobBarthelmeh/Testing
build fixes and PKCS7 BER encoding fix
2021-10-28 10:52:58 -07:00
David Garske
e4e6242fde Merge pull request #4514 from SparkiDev/zephyr_fix_2
Fixes for Zephyr OS
2021-10-28 07:52:32 -07:00
Juliusz Sosinowicz
8cba5dda17 Need to free x509 in tests 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
a738c16b2f Can't have macros within macros 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
7d6f8ea255 Update wrong email in gen script 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
ef37eeaeaa Code review fixes 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
a6be157628 Gate new AKID functionality on WOLFSSL_AKID_NAME 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
cb79bc5c46 Use same code for DecodeNsCertType with templates 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
842dba7946 Put address and postal code in WOLFSSL_CERT_EXT 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
2531cd961f Code review fixes 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
d9af698aa4 Implement raw AKID with WOLFSSL_ASN_TEMPLATE 2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
c162196b27 Add x509 name attributes and extensions to DER parsing and generation
- Postal Code
- Street Address
- External Key Usage
- Netscape Certificate Type
- CRL Distribution Points
- Storing full Authority Key Identifier information
- Add new certificates to `certs/test` for testing
- Update WOLFSSL_ASN_TEMPLATE to match new features
2021-10-28 14:50:53 +02:00
Juliusz Sosinowicz
894303be59 Make the wolfSSL_GetMaxFragSize parameter meaning consistent
- Add testing for sending as much app data as possible in a single DTLS record
2021-10-28 14:46:15 +02:00
Sean Parkinson
623a84ed7b Fixes for Zephyr OS
time is not available.
Must include clock module
kdf.c missing from file list
2021-10-28 15:57:46 +10:00
Sean Parkinson
7baffd9cf1 Merge pull request #4512 from douzzer/fips-check-linuxv5-uses-tag-WCv5.0-RC9
fips-check.sh update for WCv5.0-RC9 tags
2021-10-28 14:15:55 +10:00
Sean Parkinson
0e18e9c404 Merge pull request #4502 from dgarske/async_test
Fixes for async TLS v1.3
2021-10-28 14:13:32 +10:00
David Garske
55ee5e41db Merge pull request #4510 from SparkiDev/sp_cmp_c64
SP: change to sp_c32.c now in scripts caused changes to sp_c64.c
2021-10-27 18:50:13 -07:00
Daniel Pouzzner
46ecf752b4 fips-check.sh: update wolfSSL remote & tag for linuxv5 aka linuxv5-RC9. 2021-10-27 18:17:57 -05:00
John Safranek
7cbfb27fa0 When adding cipherExtraData(), also account for TLSv1.3. 2021-10-27 15:12:31 -07:00
John Safranek
9f3f9c53fd Remove debugging printfs. Added some guards around DTLS and AEAD only things. 2021-10-27 15:12:31 -07:00
Juliusz Sosinowicz
be3b6b47ef DTLS MTU fixes 2021-10-27 15:12:31 -07:00
John Safranek
77ebd11781 Updating based on MTU. Debugging prints. 2021-10-27 15:12:31 -07:00
John Safranek
be2e7e25ac Change the calculation for the extra data size in a DTLS message when checking to see if it'll fit in an MTU. (ZD12983) 2021-10-27 15:12:31 -07:00
David Garske
c16f0db1b5 Fixes for handling WC_PENDING_E async responses in API unit test and examples. Resolves all issues with --enable-all --enable-asynccrypt --with-intelqa=. 2021-10-27 15:08:39 -07:00
David Garske
a2ad01604f Fix devId, which must be -2 or INVALID_DEVID (not 0). Fix RSA doc typo. 2021-10-27 15:08:38 -07:00
David Garske
eb56b652ca Fix for async TLS v1.3 with multiple WC_PENDING_E on client_hello and server_hello processing. Fix for not aligned NUMA. 2021-10-27 15:08:38 -07:00
Sean Parkinson
34095dfd38 Merge pull request #4509 from dgarske/fix_sesstick
Fix for session ticket handling with error cases
2021-10-28 08:07:10 +10:00
Jacob Barthelmeh
f585dcd5ab adjust inSz with BER PKCS7 parsing 2021-10-27 15:12:04 -06:00
Jacob Barthelmeh
00249b70ae fix for build with WOLFSSL_SGX 2021-10-27 13:22:45 -06:00
Sean Parkinson
4235602c1e SP: change to sp_c32.c now in scripts caused changes to sp_c64.c 2021-10-27 08:46:32 +10:00
Jacob Barthelmeh
3d5eea8f56 fix for disable memory build 2021-10-26 16:17:32 -06:00
elms
fdf2b711f7 cmake: add SNI and TLSx 2021-10-26 15:03:29 -07:00
Jacob Barthelmeh
583a50a3f6 account for case where XTIME returns an unsigned type 2021-10-26 15:50:11 -06:00
David Garske
a08b2db692 Fix for session ticket handling with error cases. Session ticket callback return code failures were still trying to do resumption. Behavior broken in PR #3827. 2021-10-26 11:37:01 -07:00
TakayukiMatsuo
0bf832bd2a fix uninitialized variables 2021-09-24 23:22:04 +09:00
TakayukiMatsuo
5b3dfabc32 Introduce global protoVerTbl for SSL_CTX_set_min/max_proto_version 2021-09-24 16:05:55 +09:00
Jacob Barthelmeh
f1ff3da47c fix for case of long type on 32bit systems 2021-09-19 21:20:58 -06:00
JacobBarthelmeh
989179a94a set value for number of protocols in table 2021-09-17 14:04:42 -07:00
JacobBarthelmeh
f2bce42bbd add function wolfSSL_CTX_get_max_proto_version and handling for edge cases 2021-09-16 01:01:38 -07:00
TakayukiMatsuo
1acf64a782 Add support for value zero as version parameter for SSL_CTX_set_min/max_proto_version 2021-08-14 02:16:34 +09:00
250 changed files with 14853 additions and 7946 deletions

View File

@@ -28,7 +28,7 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
You must delete them, or cmake will refuse to work.")
endif()
project(wolfssl VERSION 4.8.1 LANGUAGES C)
project(wolfssl VERSION 5.0.1 LANGUAGES C)
# shared library versioning
# increment if interfaces have been added, removed or changed
@@ -271,6 +271,19 @@ else()
list(APPEND WOLFSSL_DEFINITIONS "-DWC_NO_HARDEN")
endif()
set(WOLFSSL_OPENSSLEXTRA_HELP_STRING "Enable extra OpenSSL API, size+ (default: disabled)")
add_option(WOLFSSL_OPENSSLEXTRA ${WOLFSSL_OPENSSLEXTRA_HELP_STRING} "no" "yes;no")
if (WOLFSSL_OPENSSLEXTRA AND NOT WOLFSSL_OPENSSLCOEXIST)
list(APPEND WOLFSSL_DEFINITIONS
"-DOPENSSL_EXTRA"
"-DWOLFSSL_ALWAYS_VERIFY_CB"
"-DWOLFSSL_VERIFY_CB_ALL_CERTS"
"-DWOLFSSL_EXTRA_ALERTS"
"-DHAVE_EXT_CACHE"
"-DWOLFSSL_FORCE_CACHE_ON_TICKET")
endif()
# TODO: - IPv6 test apps
set(WOLFSSL_SLOW_MATH "yes")
@@ -1025,6 +1038,31 @@ endif()
# - Secure renegotiation
# - Fallback SCSV
set(WOLFSSL_SNI_HELP_STRING "Enable SNI (default: disabled)")
add_option(WOLFSSL_SNI ${WOLFSSL_SNI_HELP_STRING} "no" "yes;no")
if (WOLFSSL_SNI)
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_TLS_EXTENSIONS" "-DHAVE_SNI")
endif()
set(WOLFSSL_TLSX_HELP_STRING "Enable all TLS Extensions (default: disabled)")
add_option(WOLFSSL_TLSX ${WOLFSSL_TLSX_HELP_STRING} "no" "yes;no")
if (WOLFSSL_TLSX)
list(APPEND WOLFSSL_DEFINITIONS
"-DHAVE_TLS_EXTENSIONS"
"-DHAVE_SNI"
"-DHAVE_MAX_FRAGMENT"
"-DHAVE_TRUNCATED_HMAC"
"-DHAVE_ALPN"
"-DHAVE_TRUSTED_CA")
if (WOLFSSL_ECC OR WOLFSSL_CURVE25519 OR WOLFSSL_CURVE448 OR WOLFSSL_TLS13)
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_SUPPORTED_CURVES")
endif()
endif()
# Supported elliptic curves extensions
set(WOLFSSL_SUPPORTED_CURVES_HELP_STRING "Enable Supported Elliptic Curves (default: enabled)")
add_option("WOLFSSL_SUPPORTED_CURVES" ${WOLFSSL_SUPPORTED_CURVES_HELP_STRING} "yes" "yes;no")
@@ -1410,6 +1448,9 @@ set_target_properties(wolfssl
VERSION ${LIBTOOL_FULL_VERSION}
)
target_compile_options(wolfssl PRIVATE "-DBUILDING_WOLFSSL")
####################################################
# Include Directories
####################################################

View File

@@ -1,3 +1,240 @@
# wolfSSL Release 5.0.0 (Nov 01, 2021)
Release 5.0.0 of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* [\Low\] Hang with DSA signature creation when a specific q value is used in a maliciously crafted key. If a DSA key with an invalid q value of either 1 or 0 was decoded and used for creating a signature, it would result in a hang in wolfSSL. Users that are creating signatures with DSA and are using keys supplied from an outside source are affected.
* [\Low\] Issue with incorrectly validating a certificate that has multiple subject alternative names when given a name constraint. In the case where more than one subject alternative name is used in the certificate, previous versions of wolfSSL could incorrectly validate the certificate. Users verifying certificates with multiple alternative names and name constraints, are recommended to either use the certificate verify callback to check for this case or update the version of wolfSSL used. Thanks to Luiz Angelo Daros de Luca for the report.
### New Feature Additions
###### New Product
* FIPS 140-3 -- currently undergoing laboratory testing, code review and ultimately CMVP validation. Targeting the latest FIPS standard.
###### Ports
* IoT-Safe with TLS demo
* SE050 port with support for RNG, SHA, AES, ECC (sign/verify/shared secret) and ED25519
* Support for Renesas TSIP v1.13 on RX72N
###### Post Quantum
* Support for OQS's (liboqs version 0.7.0) implementation of NIST Round 3 KEMs as TLS 1.3 groups --with-liboqs
* Hybridizing NIST ECC groups with the OQS groups
* Remove legacy NTRU and QSH
* Make quantum-safe groups available to the compatibility layer
###### Linux Kernel Module
* Full support for FIPS 140-3, with in-kernel power on self test (POST) and conditional algorithm self test(s) (CAST)
* --enable-linuxkm-pie -- position-independent in-kernel wolfCrypt container, for FIPS
* Vectorized x86 acceleration in PK algs (RSA, ECC, DH, DSA) and AES/AES-GCM
* Vectorized x86 acceleration in interrupt handlers
* Support for Linux-native module signatures
* Complete SSL/TLS and Crypto API callable from other kernel module(s)
* Support for LTS kernel lines: 3.16, 4.4, 4.9, 5.4, 5.10
###### Compatibility Layer Additions
* Ports
- Add support for libssh2
- Add support for pyOpenSSL
- Add support for libimobiledevice
- Add support for rsyslog
- Add support for OpenSSH 8.5p1
- Add support for Python 3.8.5
* API/Structs Added
- ERR_lib_error_string
- EVP_blake2
- wolfSSL_set_client_CA_list
- wolfSSL_EVP_sha512_224
- wolfSSL_EVP_sha512_256
- wc_Sha512_224/2256Hash
- wc_Sha512_224/256Hash
- wc_InitSha512_224/256
- wc_InitSha512_224/256_ex
- wc_Sha512_224/256Update
- wc_Sha512_224/256FinalRaw
- wc_Sha512_224/256Final
- wc_Sha512_224/256Free
- wc_Sha512_224/256GetHash
- wc_Sha512_224/256Copy
- wc_Sha512_224/256SetFlags
- wc_Sha512_224/256GetFlags
- wc_Sha512_224/256Transform
- EVP_MD_do_all and OBJ_NAME_do_all
- EVP_shake128
- EVP_shake256
- SSL_CTX_set_num_tickets
- SSL_CTX_get_num_tickets
- SSL_CIPHER_get_auth_nid
- SSL_CIPHER_get_cipher_nid
- SSL_CIPHER_get_digest_nid
- SSL_CIPHER_get_kx_nid
- SSL_CIPHER_is_aead
- SSL_CTX_set_msg_callback
- a2i_IPADDRESS
- GENERAL_NAME_print
- X509_VERIFY_PARAM_set1_ip
- EVP_CIPHER_CTX_set_iv_length
- PEM_read_bio_RSA_PUBKEY
- i2t_ASN1_OBJECT
- DH_set_length
- Set_tlsext_max_fragment_length
- AUTHORITY_iNFO_ACCESS_free
- EVP_PBE_scrypt
- ASN1_R_HEADER_TOO_LONG
- ERR_LIB
- X509_get_default_cert_file/file_env/dir/dir_env() stubs
- SSL_get_read_ahead/SSL_set_read_ahead()
- SSL_SESSION_has_ticket()
- SSL_SESSION_get_ticket_lifetime_hint()
- DIST_POINT_new
- DIST_POINT_free
- DIST_POINTS_free
- CRL_DIST_POINTS_free
- sk_DIST_POINT_push
- sk_DIST_POINT_value
- sk_DIST_POINT_num
- sk_DIST_POINT_pop_free
- sk_DIST_POINT_free
- X509_get_extension_flags
- X509_get_key_usage
- X509_get_extended_key_usage
- ASN1_TIME_to_tm
- ASN1_TIME_diff
- PEM_read_X509_REQ
- ERR_load_ERR_strings
- BIO_ssl_shutdown
- BIO_get_ssl
- BIO_new_ssl_connect
- BIO_set_conn_hostname
- NID_pkcs9_contentType
###### Misc.
* KCAPI: add support for using libkcapi for crypto (Linux Kernel)
* Configure option for --with-max-rsa-bits= and --with-max-ecc-bits=
* SP ARM Thumb support for Keil and performance improvements
* Add support for WOLFSSL_VERIFY_POST_HANDSHAKE verify mode
* PKCS #11: support static linking with PKCS #11 library --enable-pkcs11=static LIBS=-l
* Add build option --enable-wolfclu for use with wolfCLU product
* Add support for X9.42 header i.e “BEGIN X9.42 DH PARAMETERS”
* Add --enable-altcertchains for configuring wolfSSL with alternate certificate chains feature enabled
* Add public API wc_RsaKeyToPublicDer_ex to allow getting RSA public key without ASN.1 header (can return only seq + n + e)
* Add SNI and TLSx options to CMake build
### Fixes
###### PORT Fixes
* Add return value checking for FREESCALE_RNGA
* Fix MMCAU_SHA256 type warnings
* Fixes for building with Microchip XC32 and ATECC
###### Math Library Fixes
* TFM check that the modulus length is valid for fixed data array size
* TFM fp_submod_ct fix check for greater
* Check return value of mp_grow in mp_mod_2d
* Fix for ECC point multiply to error out on large multipliers
* SP ECC error on multiplier larger than curve order
###### TLS 1.3
* TLS1.3 sanity check for cases where a private key is larger than the configured maximum
* Fix early data max size handling in TLS v1.3
* Fixes for PK callbacks with TLS v1.3
* Check min downgrade when no extensions are sent with the ServerHello
###### Misc.
* Previously wolfSSL enum values were used as NIDs. Now only the compatibility layer NID enums are the NID values:
- CTC_SHAwDSA -> NID_dsaWithSHA1
- CTC_SHA256wDSA -> NID_dsa_with_SHA256
- CTC_MD2wRSA -> NID_md2WithRSAEncryption
- CTC_MD5wRSA -> NID_md5WithRSAEncryption
- CTC_SHAwRSA -> NID_sha1WithRSAEncryption
- CTC_SHA224wRSA -> NID_sha224WithRSAEncryption
- CTC_SHA256wRSA -> NID_sha256WithRSAEncryption
- CTC_SHA384wRSA -> NID_sha384WithRSAEncryption
- CTC_SHA512wRSA -> NID_sha512WithRSAEncryption
- CTC_SHA3_224wRSA -> NID_RSA_SHA3_224
- CTC_SHA3_256wRSA -> NID_RSA_SHA3_256
- CTC_SHA3_384wRSA -> NID_RSA_SHA3_384
- CTC_SHA3_512wRSA -> NID_RSA_SHA3_512
- CTC_SHAwECDSA -> NID_ecdsa_with_SHA1
- CTC_SHA224wECDSA -> NID_ecdsa_with_SHA224
- CTC_SHA256wECDSA -> NID_ecdsa_with_SHA256
- CTC_SHA384wECDSA -> NID_ecdsa_with_SHA384
- CTC_SHA512wECDSA -> NID_ecdsa_with_SHA512
- CTC_SHA3_224wECDSA -> NID_ecdsa_with_SHA3_224
- CTC_SHA3_256wECDSA -> NID_ecdsa_with_SHA3_256
- CTC_SHA3_384wECDSA -> NID_ecdsa_with_SHA3_384
- CTC_SHA3_512wECDSA -> NID_ecdsa_with_SHA3_512
- DSAk -> NID_dsa
- RSAk -> NID_rsaEncryption
- ECDSAk -> NID_X9_62_id_ecPublicKey
- BASIC_CA_OID -> NID_basic_constraints
- ALT_NAMES_OID -> NID_subject_alt_name
- CRL_DIST_OID -> NID_crl_distribution_points
- AUTH_INFO_OID -> NID_info_access
- AUTH_KEY_OID -> NID_authority_key_identifier
- SUBJ_KEY_OID -> NID_subject_key_identifier
- INHIBIT_ANY_OID -> NID_inhibit_any_policy
* Fix for DES IV size used with FIPSv2
* Fix signed comparison issue with serialSz
* Fix missing CBIOSend and properly guard hmac in DupSSL()
* Fix calculation of length of encoding in ssl.c
* Fix encoding to check proper length in asn.c
* Fix for wc_ecc_ctx_free and heap hint
* Fix for debug messages with AF_ALG build
* Fix for static memory with bucket size matching.
* Fixes for SRP with heap hint.
* Fixes for CAAM build macros and spelling for Keil build
* Sniffer fix for possible math issue around 64-bit pointer and 32-bit unsigned int
* Fix for sniffer TCP sequence rollover
* wolfSSL_PEM_write_bio_PUBKEY to write only the public part
* Fix for sending only supported groups in TLS extension
* Fix for sniffer to better handle spurious retransmission edge case
* SSL_set_alpn_protos and SSL_CTX_set_alpn_protos now returns 0 on successFixes issue with SSL_CTX_set1_curves_list and SSL_set1_curves_list not checking the last character of the names variable provided, non-0 on failure to better match expected return values
* Fixes and improvements for crypto callbacks with TLS (mutual auth)
* Fix for bad memory_mutex lock on static memory cleanup
* Zero terminate name constraints strings when parsing certificates
* Fix for verifying a certificate when multiple permitted name constraints are used
* Fix typo in ifdef for HAVE_ED448
* Fix typos in comments in SHA512
* Add sanity check on buffer size with ED25519 key decode
* Sanity check on PKCS7 stream amount read
* PKCS7 fix for double free on error case and sanity check on set serial number
* Sanity check on PKCS7 input size wc_PKCS7_ParseSignerInfo
* Forgive a DTLS session trying to send too much at once
### Improvements/Optimizations
###### Build Options and Warnings
* Rework of RC4 disable by default and depreciation
* wolfSSL as a Zephyr module (without setup.sh)
* Add include config.h to bio.c
* Support for PKCS7 without AES CBC.
* Fixes for building without AES CBC
* Added WOLFSSL_DH_EXTRA to --enable-all and --enable-sniffer
* Add a CMake option to build wolfcrypt test and bench code as libraries
* GCC makefile: allow overriding and provide more flexibility
###### Math Libraries
* Improve performance of fp_submod_ct() and fp_addmod_ct()
* Improve performance of sp_submod_ct() and sp_addmod_ct()
* SP int, handle even modulus with exponentiation
###### Misc.
* Cleanups for Arduino examples and memory documentation
* Refactor hex char to byte conversions
* Added GCC-ARM TLS server example
* Improvements to session locking to allow per-row
* Improved sniffer statistics and documentation
* EVP key support for heap hint and crypto callbacks
* Reduced stack size for dh_generation_test and Curve ASN functions
* Espressif README Syntax / keyword highlighting / clarifications
* AARCH64 SHA512: implementation using crypto instructions added
* wc_RsaPSS_CheckPadding_ex2 added for use with HEAP hint
* wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex bound checks on input and output sizes
* Add additional error handling to wolfSSL_BIO_get_len
* Add code to use popen and the command 'host', useful with qemu
* Adjustment to subject alt names order with compatibility layer to better match expected order
* Reduce BIO compatibility layer verbosity
* Set a default upper bound on error queue size with compatibility layer
* WOLFSSL_CRL_ALLOW_MISSING_CDP macro for Skip CRL verification in case no CDP in peer cert
* Fixes for scan-build LLVM-13 and expanded coverage
* Increase the default DTLS_MTU_ADDITIONAL_READ_BUFFER and make it adjustable
# wolfSSL Release 4.8.1 (July 16, 2021)
Release 4.8.1 of wolfSSL embedded TLS has an OCSP vulnerability fix:
@@ -79,7 +316,7 @@ Release 4.8.0 of wolfSSL embedded TLS has bug fixes and new features including:
* Added wolfSSL_CTX_get_TicketEncCtx getter function to return the ticket encryption ctx value
* Added wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex APIs to accept an Aes object to use for the AES operations
* Added implementation of AES-GCM streaming (--enable-aesgcm-stream)
* Added deterministic generation of k with ECC following RFC6979 when the macro WOLFSL_ECDSA_DETERMINISTIC_K is defined and wc_ecc_set_deterministic function is called
* Added deterministic generation of k with ECC following RFC6979 when the macro WOLFSSL_ECDSA_DETERMINISTIC_K is defined and wc_ecc_set_deterministic function is called
* Implemented wc_DsaParamsDecode and wc_DsaKeyToParamsDer
* Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
* Added crypto callback support for Ed/Curve25519 and SHA2-512/384
@@ -1875,9 +2112,9 @@ More info can be found on-line at //http://wolfssl.com/yaSSL/Docs.html
- No filesystem build fixes for various configurations
- Certificate generation now supports several extensions including KeyUsage,
SKID, AKID, and Ceritifcate Policies
SKID, AKID, and Certificate Policies
- CRLs can be loaded from buffers as well as files now
- SHA-512 Ceritifcate Signing generation
- SHA-512 Certificate Signing generation
- Fixes for sniffer reassembly processing
See INSTALL file for build instructions.

View File

@@ -67,6 +67,7 @@ cc_library_shared {
"./wolfcrypt/src/ge_low_mem.c",
"./wolfcrypt/src/ge_operations.c",
"./wolfcrypt/src/hash.c",
"./wolfcrypt/src/kdf.c",
"./wolfcrypt/src/hc128.c",
"./wolfcrypt/src/hmac.c",
"./wolfcrypt/src/idea.c",

View File

@@ -414,6 +414,11 @@
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/ge_operations.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/kdf.c</name>
<type>1</type>
<locationURI>WOLFSSL_ROOT/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hash.c</name>
<type>1</type>

View File

@@ -138,6 +138,7 @@ SRC_C += ../../wolfcrypt/src/ge_448.c
SRC_C += ../../wolfcrypt/src/ge_low_mem.c
SRC_C += ../../wolfcrypt/src/ge_operations.c
SRC_C += ../../wolfcrypt/src/hash.c
SRC_C += ../../wolfcrypt/src/kdf.c
SRC_C += ../../wolfcrypt/src/integer.c
SRC_C += ../../wolfcrypt/src/logging.c
SRC_C += ../../wolfcrypt/src/md5.c

View File

@@ -100,7 +100,7 @@ static int tls_client(void)
/*---------------------*/
/* for no peer auth: */
/*---------------------*/
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, 0);
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
/*---------------------*/
/* end peer auth option*/
/*---------------------*/

View File

@@ -99,7 +99,7 @@ static int tls_server(void)
/*---------------------*/
/* for no peer auth: */
/*---------------------*/
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, 0);
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
/*---------------------*/
/* end peer auth option*/
/*---------------------*/

View File

@@ -1975,6 +1975,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\kdf.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\wolfcrypt\src\hc128.c</name>
</file>

View File

@@ -1956,6 +1956,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\kdf.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c</name>
</file>

View File

@@ -2346,6 +2346,9 @@
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\kdf.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\wolfcrypt\src\hmac.c</name>
</file>

View File

@@ -45,6 +45,7 @@ wolfssl (latest version)
# hmac.c tfm.c #
# md4.c wc_encrypt.c #
# md5.c wc_port.c #
# kdf.c #
#---------------------------------------------#
5. Once those are all added go to

View File

@@ -46,6 +46,7 @@
<ClCompile Include="..\..\wolfcrypt\src\ge_low_mem.c" />
<ClCompile Include="..\..\wolfcrypt\src\ge_operations.c" />
<ClCompile Include="..\..\wolfcrypt\src\hash.c" />
<ClCompile Include="..\..\wolfcrypt\src\kdf.c" />
<ClCompile Include="..\..\wolfcrypt\src\hc128.c" />
<ClCompile Include="..\..\wolfcrypt\src\hmac.c" />
<ClCompile Include="..\..\wolfcrypt\src\idea.c" />

0
IDE/INTIME-RTOS/wolfExamples.sln Executable file → Normal file
View File

View File

@@ -165,6 +165,11 @@
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>src/wolfcrypt-src/kdf.c</name>
<type>1</type>
<locationURI>PARENT-2-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>src/wolfcrypt-src/hc128.c</name>
<type>1</type>

View File

@@ -61,6 +61,7 @@ Wolfssl_C_Files :=$(WOLFSSL_ROOT)/wolfcrypt/src/aes.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/ecc.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/error.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/hash.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/kdf.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/hc128.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/hmac.c\
$(WOLFSSL_ROOT)/wolfcrypt/src/integer.c\

View File

@@ -20,6 +20,7 @@ CSRCS := ../../wolfcrypt/src/rsa.c \
../../wolfcrypt/src/memory.c \
../../wolfcrypt/src/coding.c \
../../wolfcrypt/src/hash.c \
../../wolfcrypt/src/kdf.c \
../../wolfcrypt/src/hmac.c \
../../wolfcrypt/src/md5.c \
../../wolfcrypt/src/wc_port.c \

View File

@@ -1181,6 +1181,19 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>48</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\wolfcrypt\src\kdf.c</PathWithFileName>
<FilenameWithoutPath>kdf.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>

View File

@@ -626,6 +626,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\wolfcrypt\src\hash.c</FilePath>
</File>
<File>
<FileName>kdf.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\wolfcrypt\src\kdf.c</FilePath>
</File>
<File>
<FileName>misc.c</FileName>
<FileType>1</FileType>
@@ -1335,6 +1340,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\wolfcrypt\src\hash.c</FilePath>
</File>
<File>
<FileName>kdf.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\wolfcrypt\src\kdf.c</FilePath>
</File>
<File>
<FileName>misc.c</FileName>
<FileType>1</FileType>
@@ -2044,6 +2054,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\wolfcrypt\src\hash.c</FilePath>
</File>
<File>
<FileName>kdf.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\wolfcrypt\src\kdf.c</FilePath>
</File>
<File>
<FileName>misc.c</FileName>
<FileType>1</FileType>

View File

@@ -71,6 +71,7 @@
<file file_name="../../wolfcrypt/src/ge_low_mem.c" />
<file file_name="../../wolfcrypt/src/ge_operations.c" />
<file file_name="../../wolfcrypt/src/hash.c" />
<file file_name="../../wolfcrypt/src/kdf.c" />
<file file_name="../../wolfcrypt/src/hc128.c" />
<file file_name="../../wolfcrypt/src/hmac.c" />
<file file_name="../../wolfcrypt/src/idea.c" />

View File

@@ -73,6 +73,7 @@
<file file_name="../../wolfcrypt/src/ge_low_mem.c" />
<file file_name="../../wolfcrypt/src/ge_operations.c" />
<file file_name="../../wolfcrypt/src/hash.c" />
<file file_name="../../wolfcrypt/src/kdf.c" />
<file file_name="../../wolfcrypt/src/hc128.c" />
<file file_name="../../wolfcrypt/src/hmac.c" />
<file file_name="../../wolfcrypt/src/idea.c" />

View File

@@ -301,6 +301,13 @@
<TreeImageGuid>941832c1-fc3b-4e1b-94e8-01ea17128b42</TreeImageGuid>
<ParentItem>2170607d-803e-45b0-80af-6507d495a8de</ParentItem>
</Instance>
<Instance Guid="3e659978-d6e8-4d27-b8f7-6215eca64a09">
<Name>kdf.c</Name>
<Type>File</Type>
<RelativePath>..\..\..\..\..\wolfcrypt\src\kdf.c</RelativePath>
<ParentItem>2170607d-803e-45b0-80af-6507d495a8de</ParentItem>
<Property>2d70eb4e-e44a-4902-85bd-c2213863b503</Property>
</Instance>
<Instance Guid="83d865e6-46a2-49da-8549-b021d2114a0e">
<Name>logging.c</Name>
<Type>File</Type>

View File

@@ -214,6 +214,11 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/kdf.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hc128.c</name>
<type>1</type>

View File

@@ -214,6 +214,11 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/kdf.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hc128.c</name>
<type>1</type>

View File

@@ -215,6 +215,11 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>wolfcrypt/kdf.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>wolfcrypt/hc128.c</name>
<type>1</type>

View File

@@ -214,6 +214,11 @@
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/kdf.c</name>
<type>1</type>
<locationURI>PARENT-5-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>wolfcrypt/src/hc128.c</name>
<type>1</type>

View File

@@ -63,6 +63,7 @@
<ClCompile Include="..\..\wolfcrypt\src\ge_low_mem.c" />
<ClCompile Include="..\..\wolfcrypt\src\ge_operations.c" />
<ClCompile Include="..\..\wolfcrypt\src\hash.c" />
<ClCompile Include="..\..\wolfcrypt\src\kdf.c" />
<ClCompile Include="..\..\wolfcrypt\src\hc128.c" />
<ClCompile Include="..\..\wolfcrypt\src\hmac.c" />
<ClCompile Include="..\..\wolfcrypt\src\idea.c" />

View File

@@ -45,6 +45,7 @@
<ClCompile Include="..\..\wolfcrypt\src\hash.c" />
<ClCompile Include="..\..\wolfcrypt\src\hc128.c" />
<ClCompile Include="..\..\wolfcrypt\src\hmac.c" />
<ClCompile Include="..\..\wolfcrypt\src\kdf.c" />
<ClCompile Include="..\..\wolfcrypt\src\idea.c" />
<ClCompile Include="..\..\wolfcrypt\src\integer.c" />
<ClCompile Include="..\..\wolfcrypt\src\logging.c" />
@@ -132,4 +133,4 @@
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>

0
IDE/WIN-SGX/ReadMe.txt Executable file → Normal file
View File

0
IDE/WIN-SGX/wolfSSL_SGX.sln Executable file → Normal file
View File

View File

@@ -169,6 +169,8 @@
522DBE131B792A190031F454 /* wc_encrypt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 522DBE121B7929E70031F454 /* wc_encrypt.h */; };
525BE5BA1B38853E0054BBCD /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 525BE5B91B38853E0054BBCD /* hash.c */; };
525BE5BC1B3885750054BBCD /* hash.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 525BE5BB1B3885580054BBCD /* hash.h */; };
6AC85136272CAFEC00F2B32A /* kdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 6AC85135272CAFEC00F2B32A /* kdf.c */; };
6AC85137272CAFEC00F2B32A /* kdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 6AC85135272CAFEC00F2B32A /* kdf.c */; };
A4A54DF71BC5C3E0002866CD /* wolfcrypt_first.c in Sources */ = {isa = PBXBuildFile; fileRef = 5216481B1A8AC2990062516A /* wolfcrypt_first.c */; };
A4A54DF81BC5C3E0002866CD /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 521648141A8AC2990062516A /* hmac.c */; };
A4A54DF91BC5C3E0002866CD /* random.c in Sources */ = {isa = PBXBuildFile; fileRef = 521648161A8AC2990062516A /* random.c */; };
@@ -786,6 +788,8 @@
525BE5B91B38853E0054BBCD /* hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash.c; path = ../../wolfcrypt/src/hash.c; sourceTree = "<group>"; };
525BE5BB1B3885580054BBCD /* hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash.h; path = ../../wolfssl/wolfcrypt/hash.h; sourceTree = "<group>"; };
52B1344D16F3C9E800C07B32 /* libwolfssl_fips_ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libwolfssl_fips_ios.a; sourceTree = BUILT_PRODUCTS_DIR; };
6AC85135272CAFEC00F2B32A /* kdf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = kdf.c; path = ../../wolfcrypt/src/kdf.c; sourceTree = "<group>"; };
6AC8513A272CB01200F2B32A /* kdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = kdf.h; path = ../../wolfssl/wolfcrypt/kdf.h; sourceTree = "<group>"; };
A4A54DF41BC5C380002866CD /* user_settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = user_settings.h; sourceTree = "<group>"; };
A4A54EA11BC5C3E0002866CD /* libwolfssl_fips_osx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libwolfssl_fips_osx.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
@@ -909,6 +913,7 @@
525BE5BB1B3885580054BBCD /* hash.h */,
5216466F1A8993770062516A /* hc128.h */,
521646701A8993770062516A /* hmac.h */,
6AC8513A272CB01200F2B32A /* kdf.h */,
521646721A8993770062516A /* integer.h */,
521646731A8993770062516A /* logging.h */,
521646741A8993770062516A /* md2.h */,
@@ -983,6 +988,7 @@
525BE5B91B38853E0054BBCD /* hash.c */,
5216461D1A8992CC0062516A /* hc128.c */,
5216461E1A8992CC0062516A /* hmac.c */,
6AC85135272CAFEC00F2B32A /* kdf.c */,
5216461F1A8992CC0062516A /* integer.c */,
521646201A8992CC0062516A /* logging.c */,
521646211A8992CC0062516A /* md2.c */,
@@ -1116,6 +1122,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 52B1344416F3C9E800C07B32;
@@ -1177,6 +1184,7 @@
5216464F1A8992CC0062516A /* sha256.c in Sources */,
521646371A8992CC0062516A /* chacha.c in Sources */,
521646471A8992CC0062516A /* pkcs7.c in Sources */,
6AC85136272CAFEC00F2B32A /* kdf.c in Sources */,
5216460E1A89928E0062516A /* sniffer.c in Sources */,
521646421A8992CC0062516A /* md2.c in Sources */,
521646381A8992CC0062516A /* coding.c in Sources */,
@@ -1239,6 +1247,7 @@
A4A54E1F1BC5C3E0002866CD /* sha256.c in Sources */,
A4A54E201BC5C3E0002866CD /* chacha.c in Sources */,
A4A54E211BC5C3E0002866CD /* pkcs7.c in Sources */,
6AC85137272CAFEC00F2B32A /* kdf.c in Sources */,
A4A54E221BC5C3E0002866CD /* sniffer.c in Sources */,
A4A54E231BC5C3E0002866CD /* md2.c in Sources */,
A4A54E241BC5C3E0002866CD /* coding.c in Sources */,

View File

@@ -356,6 +356,9 @@
522DBE0F1B7927A50031F454 /* wc_encrypt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 522DBE0E1B7927290031F454 /* wc_encrypt.h */; };
525BE5341B3869110054BBCD /* hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 525BE5331B3869110054BBCD /* hash.c */; };
525BE5361B3869780054BBCD /* hash.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 525BE5351B3869430054BBCD /* hash.h */; };
6AC85129272CAF2E00F2B32A /* kdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 6AC85128272CAF2E00F2B32A /* kdf.c */; };
6AC8512A272CAF2E00F2B32A /* kdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 6AC85128272CAF2E00F2B32A /* kdf.c */; };
6AC8512B272CAF2E00F2B32A /* kdf.c in Sources */ = {isa = PBXBuildFile; fileRef = 6AC85128272CAF2E00F2B32A /* kdf.c */; };
A4DAE3062493F1C700CEF51F /* tls13.c in Sources */ = {isa = PBXBuildFile; fileRef = A4DAE3052493F1C700CEF51F /* tls13.c */; };
A4DAE3072493F1C700CEF51F /* tls13.c in Sources */ = {isa = PBXBuildFile; fileRef = A4DAE3052493F1C700CEF51F /* tls13.c */; };
A4DAE3082493F1C700CEF51F /* tls13.c in Sources */ = {isa = PBXBuildFile; fileRef = A4DAE3052493F1C700CEF51F /* tls13.c */; };
@@ -1187,6 +1190,8 @@
525BE5331B3869110054BBCD /* hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash.c; path = ../../wolfcrypt/src/hash.c; sourceTree = "<group>"; };
525BE5351B3869430054BBCD /* hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash.h; path = ../../wolfssl/wolfcrypt/hash.h; sourceTree = "<group>"; };
52B1344D16F3C9E800C07B32 /* libwolfssl_ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libwolfssl_ios.a; sourceTree = BUILT_PRODUCTS_DIR; };
6AC85128272CAF2E00F2B32A /* kdf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = kdf.c; path = ../../wolfcrypt/src/kdf.c; sourceTree = "<group>"; };
6AC8513B272CB04F00F2B32A /* kdf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = kdf.h; path = ../../wolfssl/wolfcrypt/kdf.h; sourceTree = "<group>"; };
A45EA7091BC5995E00A8614A /* user_settings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = user_settings.h; sourceTree = "<group>"; };
A4DAE3052493F1C700CEF51F /* tls13.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tls13.c; path = ../../src/tls13.c; sourceTree = "<group>"; };
A4DAE3092493F21700CEF51F /* srp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = srp.c; path = ../../wolfcrypt/src/srp.c; sourceTree = "<group>"; };
@@ -1340,6 +1345,7 @@
525BE5351B3869430054BBCD /* hash.h */,
5216466F1A8993770062516A /* hc128.h */,
521646701A8993770062516A /* hmac.h */,
6AC8513B272CB04F00F2B32A /* kdf.h */,
521646721A8993770062516A /* integer.h */,
521646731A8993770062516A /* logging.h */,
521646741A8993770062516A /* md2.h */,
@@ -1434,6 +1440,7 @@
525BE5331B3869110054BBCD /* hash.c */,
5216461D1A8992CC0062516A /* hc128.c */,
5216461E1A8992CC0062516A /* hmac.c */,
6AC85128272CAF2E00F2B32A /* kdf.c */,
A4DAE3192493F21900CEF51F /* idea.c */,
5216461F1A8992CC0062516A /* integer.c */,
521646201A8992CC0062516A /* logging.c */,
@@ -1656,6 +1663,7 @@
30B060681C6DDB2B00D46008 /* hash.c in Sources */,
A4DAE34C2493F21900CEF51F /* idea.c in Sources */,
30B060691C6DDB2B00D46008 /* hc128.c in Sources */,
6AC8512B272CAF2E00F2B32A /* kdf.c in Sources */,
30B0606A1C6DDB2B00D46008 /* hmac.c in Sources */,
A4DAE3572493F29E00CEF51F /* sp_dsp32.c in Sources */,
A4DAE3282493F21900CEF51F /* fe_448.c in Sources */,
@@ -1742,6 +1750,7 @@
520775AB2239ABBE00087711 /* sp_int.c in Sources */,
521646431A8992CC0062516A /* md4.c in Sources */,
521646321A8992CC0062516A /* aes.c in Sources */,
6AC85129272CAF2E00F2B32A /* kdf.c in Sources */,
521646391A8992CC0062516A /* des3.c in Sources */,
521646351A8992CC0062516A /* blake2b.c in Sources */,
520775AD2239ABCD00087711 /* chacha20_poly1305.c in Sources */,
@@ -1828,6 +1837,7 @@
A4F318701BC58B1700FDF2BB /* md2.c in Sources */,
A4DAE34B2493F21900CEF51F /* idea.c in Sources */,
A4F318651BC58B1700FDF2BB /* md4.c in Sources */,
6AC8512A272CAF2E00F2B32A /* kdf.c in Sources */,
A4F3185E1BC58B1700FDF2BB /* md5.c in Sources */,
A4DAE3562493F29E00CEF51F /* sp_dsp32.c in Sources */,
A4DAE3272493F21900CEF51F /* fe_448.c in Sources */,

View File

@@ -505,6 +505,11 @@
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/wolfcrypt/src/hash.c</locationURI>
</link>
<link>
<name>src/wolfcrypt/src/kdf.c</name>
<type>1</type>
<locationURI>PARENT-4-PROJECT_LOC/wolfcrypt/src/kdf.c</locationURI>
</link>
<link>
<name>src/wolfcrypt/src/hc128.c</name>
<type>1</type>

75
INSTALL
View File

@@ -119,7 +119,7 @@
recommend using the CMake GUI in concert with Visual Studio, as described
in these steps.
2) Open CMake.
3) Where is the soure code: <root directory of wolfssl containing
3) Where is the source code: <root directory of wolfssl containing
CMakeLists.txt>
4) Where to build the binaries: <build directory, e.g. wolfssl/build>
5) Hit Configure. CMake runs the code in CMakeLists.txt and builds up an
@@ -137,11 +137,16 @@
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
3) Follow steps in "Unix-based Platforms" above.
15. Building with liboqs for TLS 1.3 KEM Groups [EXPERIMENTAL]
15. Building with liboqs for TLS 1.3 [EXPERIMENTAL]
In order be able to use liboqs, you must have it built and installed on your
system. For example, on linux, this would be sufficient:
system. We support the 0.7.0 release of liboqs. You can download it from
the following link:
$ cd liboqs
https://github.com/open-quantum-safe/liboqs/archive/refs/tags/0.7.0.tar.gz
Once unpacked, this would be sufficient:
$ cd liboqs-0.7.0
$ mkdir build
$ cd build
$ cmake -DOQS_USE_OPENSSL=0 ..
@@ -155,8 +160,8 @@
$ ./configure --with-liboqs
$ make all
Execute the following to see the liboqs-related options near the end of the
output of these commands:
Execute the following to see the liboqs-related options for KEM groups near
the end of the output of these commands:
$ ./examples/server/server -?
$ ./examples/client/client -?
@@ -172,14 +177,60 @@
Using OQS KEM: P521_KYBER_LEVEL5
```
The following NIST Competition Round 3 Finalist KEMs are supported:
- CRYSTALS-KYBER
- SABER
- NTRU
For authentication, you can generate a certificate chain using the Open
Quantum Safe project's fork of OpenSSL. We support certificates and keys
generated by the 2021-08 snapshot of the OQS-OpenSSL_1_1_1-stable branch
of the fork. You can download it from the following link:
https://github.com/open-quantum-safe/openssl/archive/refs/tags/OQS-OpenSSL_1_1_1-stable-snapshot-2021-08.tar.gz
Once unpacked, this would be sufficient for building it:
$ cd openssl-OQS-OpenSSL_1_1_1-stable-snapshot-2021-08/
$ ./config no-shared
$ make all
Note that installation is NOT required.
There is a script for generating a Falcon NIST Level 1 and NIST Level 5
certificate chain which can be found in the wolfssl-examples github repo at
pq/generate_falcon_chains.sh. Please find detailed instructions on how to
generate and verify the keys and certificates in pq/README.md. As a quick-
start, simply copy generate_falcon_chains.sh into the
openssl-OQS-OpenSSL_1_1_1-stable-snapshot-2021-08 directory and execute the
script.
Once the certificates and keys are generated, copy them from the
openssl-OQS-OpenSSL_1_1_1-stable-snapshot-2021-08/ directory to the certs
directory of wolfssl. Now you can run the server and client like this:
$ examples/server/server -v 4 -l TLS_AES_256_GCM_SHA384 \
-A certs/falcon_level5_root_cert.pem \
-c certs/falcon_level1_entity_cert.pem \
-k certs/falcon_level1_entity_key.pem \
--oqs P521_KYBER_LEVEL5
$ examples/client/client -v 4 -l TLS_AES_256_GCM_SHA384 \
-A certs/falcon_level1_root_cert.pem \
-c certs/falcon_level5_entity_cert.pem \
-k certs/falcon_level5_entity_key.pem \
--oqs P521_KYBER_LEVEL5
Congratulations! You have just achieved a fully quantum-safe TLS 1.3
connection!
The following NIST Competition Round 3 Finalist algorithms are supported:
- CRYSTALS-KYBER (KEM)
- SABER (KEM)
- NTRU (KEM)
- FALCON (signature scheme)
Links to more information about these algorithms can be found here:
https://csrc.nist.gov/projects/post-quantum-cryptography/round-3-submissions
NOTE: The quantum-safe algorithms provided by LIBOQS are unstandardized and
NOTE: The quantum-safe algorithms provided by liboqs are unstandardized and
experimental. It is highly advised that they NOT be used in production
environments.
environments. All OIDs and codepoints are temporary and expected to
change in the future. You should have no expectation of backwards
compatibility.

449
README
View File

@@ -70,220 +70,6 @@ should be used for the enum name.
*** end Notes ***
# wolfSSL Release 4.8.1 (July 16, 2021)
Release 4.8.1 of wolfSSL embedded TLS has an OCSP vulnerability fix:
### Vulnerabilities
* [High] OCSP verification issue when response is for a certificate with no relation to the chain in question BUT that response contains the NoCheck extension which effectively disables ALL verification of that one cert. Users who should upgrade to 4.8.1 are TLS client users doing OCSP, TLS server users doing mutual auth with OCSP, and CertManager users doing OCSP independent of TLS. Thanks to Jan Nauber, Marco Smeets, Werner Rueschenbaum and Alissa Kim of Volkswagen Infotainment for the report.
# wolfSSL Release 4.8.0 (July 09, 2021)
Release 4.8.0 of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* [Low] CVE-2021-37155: OCSP request/response verification issue. In the case that the serial number in the OCSP request differs from the serial number in the OCSP response the error from the comparison was not resulting in a failed verification. We recommend users that have wolfSSL version 4.6.0 and 4.7.0 with OCSP enabled update their version of wolfSSL. Version 4.5.0 and earlier are not affected by this report. Thanks to Rainer Mueller-Amersdorffer, Roee Yankelevsky, Barak Gutman, Hila Cohen and Shoshi Berko (from CYMOTIVE Technologies and CARIAD) for the report.
* [Low] CVE-2021-24116: Side-Channel cache look up vulnerability in base64 PEM decoding for versions of wolfSSL 4.5.0 and earlier. Versions 4.6.0 and up contain a fix and do not need to be updated for this report. If decoding a PEM format private key using version 4.5.0 and older of wolfSSL then we recommend updating the version of wolfSSL used. Thanks to Florian Sieck, Jan Wichelmann, Sebastian Berndt and Thomas Eisenbarth for the report.
### New Feature Additions
###### New Product
* Added wolfSentry build with --enable-wolfsentry and tie-ins to wolfSSL code for use with wolfSentry
###### Ports
* QNX CAAM driver added, supporting ECC black keys, CMAC, BLOBs, and TRNG use
* _WIN32_WCE wolfCrypt port added
* INTIME_RTOS directory support added
* Added support for STM32G0
* Renesas RX: Added intrinsics for rot[rl], revl (thanks @rliebscher)
* Added support for running wolfcrypt/test/testwolfcrypt on Dolphin emulator to test DEVKITPRO port
* Zephyr project port updated to latest version 2.6.X
###### ASN1 and PKCS
* Storing policy constraint extension from certificate added
* Added support for NID_favouriteDrink pilot
* Added the API function wc_EncryptPKCS8Key to handle encrypting a DER, PKCS#8-formatted key
###### Compatibility Layer Additions
* Open Source PORTS Added/Updated
- OpenVPN
- OpenLDAP
- socat-1.7.4.1
- Updated QT port for 5.15.2
* Changes to extend set_cipher_list() compatibility layer API to have set_ciphersuites compatibility layer API capability
* Added more support for SHA3 in the EVP layer
* API Added
- MD5/MD5_Transform
- SHA/SHA_Transform/SHA1_Transform
- SHA224/SHA256_Transform/SHA512_Transform
- SSL_CTX_get0_param/SSL_CTX_set1_param
- X509_load_crl_file
- SSL_CTX_get_min_proto_version
- EVP_ENCODE_CTX_new
- EVP_ENCODE_CTX_free
- EVP_EncodeInit
- EVP_EncodeUpdate
- EVP_EncodeFinal
- EVP_DecodeInit
- EVP_DecodeUpdate
- EVP_DecodeFinal
- EVP_PKEY_print_public
- BIO_tell
- THREADID_current
- THREADID_hash
- SSL_CTX_set_ecdh_auto
- RAND_set_rand_method()
- X509_LOOKUP_ctrl()
- RSA_bits
- EC_curve_nist2nid
- EC_KEY_set_group
- SSL_SESSION_set_cipher
- SSL_set_psk_use_session_callback
- EVP_PKEY_param_check
- DH_get0_pqg
- CRYPTO_get_ex_new_index
- SSL_SESSION_is_resumable
- SSL_CONF_cmd
- SSL_CONF_CTX_finish
- SSL_CTX_keylog_cb_func
- SSL_CTX_set_keylog_callback
- SSL_CTX_get_keylog_callback
###### Misc.
* Added wolfSSL_CTX_get_TicketEncCtx getter function to return the ticket encryption ctx value
* Added wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex APIs to accept an Aes object to use for the AES operations
* Added implementation of AES-GCM streaming (--enable-aesgcm-stream)
* Added deterministic generation of k with ECC following RFC6979 when the macro WOLFSL_ECDSA_DETERMINISTIC_K is defined and wc_ecc_set_deterministic function is called
* Implemented wc_DsaParamsDecode and wc_DsaKeyToParamsDer
* Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
* Added crypto callback support for Ed/Curve25519 and SHA2-512/384
* TLS 1.3 wolfSSL_key_update_response function added to see if a update response is needed
### Fixes
* Fix for detecting extra unused bytes that are in an ASN1 sequence appended to the end of a valid ECC signature
* Fix for keyid with ktri CMS (breaks compatibility with previous keyid ASN1 syntax)
* Fix for failed handshake if a client offers more than 150 cipher suites. Thanks to Marcel Maehren, Philipp Nieting, Robert Merget from Ruhr University Bochum Sven Hebrok, Juraj Somorovsky from Paderborn University
* Fix for default order of deprecated elliptic curves SECP224R1, SECP192R1, SECP160R1. Thanks to Marcel Maehren, Philipp Nieting, Robert Merget from Ruhr University Bochum Sven Hebrok, Juraj Somorovsky from Paderborn University
* Fix for corner TLS downgrade case where a TLS 1.3 setup that allows for downgrades but has TLS 1.3 set as the minimum version would still downgrade to TLS 1.2
###### PKCS7 (Multiple fixes throughout regarding memory leaks with SMIME and heap buffer overflows due to streaming functionality)
* Fix PKCS7 dynamic content save/restore in PKCS7_VerifySignedData
* Fix for heap buffer overflow on compare with wc_PKCS7_DecryptKtri
* Fix for heap buffer overflow with wc_PKCS7_VerifySignedData
* Fix for heap buffer overflow with wc_PKCS7_DecodeEnvelopedData
* Check size of public key used with certificate passed into wc_PKCS7_InitWithCert before XMEMCPY to avoid overflow
* Fix for heap buffer overflow fix for wolfSSL_SMIME_read_PKCS7
* Fix to cleanly free memory in error state with wolfSSL_SMIME_read_PKCS7
* SMIME error checking improvements and canonicalize multi-part messages before hashing
###### DTLS Fixes
* DTLS fix to correctly move the Tx sequence number forward
* DTLS fix for sequence and epoch number with secure renegotiation cookie exchange
* Fix for Chacha-Poly AEAD for DTLS 1.2 with secure renegotiation
###### PORT Fixes
* Fix AES, aligned key for the HW module with DCP port
* Fix ATECC608A TNGTLS certificate size issue (thanks @vppillai)
* Fixes for mingw compile warnings
* Fixes for NXP LTC ECC/RSA
* Fix ESP32 RSA hw accelerator initialization issue
* Fixes for STM32 PKA with ECC
* Fixes for STM32 AES GCM for HAL's that support byte sized headers
* Espressif ESP32 SHA_CTX macro conflict resolved
###### Math Library Fixes
* For platforms that support limits.h or windows make sure both SIZEOF_LONG_LONG and SIZEOF_LONG are set to avoid issues with CTC_SETTINGS
* SP C 32/64: fix corner cases around subtraction affecting RSA PSS use
* Fix to return the error code from sp_cond_swap_ct when malloc fails
* Fix potential memory leak with small stack in the function fp_gcd
* Static Analysis Fixes
* Fixes made from Coverity analysis including:
* Cleanups for some return values,
* Fix for leak with wolfSSL_a2i_ASN1_INTEGER
* Sanity check on length in wolfSSL_BN_rand
* Sanity check size in TLSX_Parse catching a possible integer overflow
* Fixes found with -fsanitize=undefined testing
* Fix null dereferences or undefined memcpy calls
* Fix alignment in myCryptoDevCb
* Fix default DTLS context assignment
* Added align configure option to force data alignment
###### Misc.
* Fix for wolfSSL_ASN1_TIME_adj set length
* Fix for freeing structure on error case in the function AddTrustedPeer
* Return value of SSL_read when called after bidirectional shutdown
* Fix for build options ./configure --enable-dtls --disable-asn
* FIx for detection of a salt length from an RSA PSS signature
* Fix to free up globalRNGMutex mutex when cleaning up global RNG
* Fix leak when multiple hardware names are in SAN
* Fix nonblocking ret value from CRL I/O callbacks
* Fix wolfSSL_BIO_free_all return type to better match for compatibility layer
* Fix for make distcheck, maintainer-clean, to allow distribution builds
* Fix for async with fragmented packets
* Fix for the build or RSA verify or public only
* Fix for return value of wolfSSL_BIO_set_ssl to better match expected compatibility layer return value
* Fix for sanity checks on size of issuer hash and key along with better freeing on error cases with DecodeBasicOcspResponse
* Fix for potential memory leak with wolfSSL_OCSP_cert_to_id
### Improvements/Optimizations
###### DTLS/TLS Code Base
* Improved TLS v1.3 time rollover support
* TLS 1.3 PSK: use the hash algorithm to choose cipher suite
* TLS Extended Master Secret ext: TLS13 - send in second Client Hello if in first
* TLS Encrypt then MAC: check all padding bytes are the same value
* wolfSSL_GetMaxRecordSize updated to now take additional cipher data into account
* Updated session export/import with DTLS to handle a new internal options flag
* Refactored dtls_expected_peer_handshake_number handling
* Added wolfSSL_CTX_get_ephemeral_key and wolfSSL_get_ephemeral_key for loading a constant key in place of an ephemeral one
* Improved checking of XSNPRINTF return value in DecodePolicyOID
###### Build Options and Warnings
* Added wolfSSL_CTX_set_verify to the ABI list
* Adjusted FP_ECC build to not allow SECP160R1, SECP160R2, SECP160K1 and SECP224K1. FP_ECC does not work with scalars that are the length of the order when the order is longer than the prime.
* Added CMake support for CURVE25519, ED25519, CURVE448, and ED448
* cmake addition to test paths when building
* Added support for session tickets in CMake
* Added support for reproducible builds with CMake
* Turn on reproducible-build by default when enable-distro
* Windows Project: Include the X448 and Ed448 files
* GCC-11 compile time warning fixes
* Fix for compiling build of ./configure '--disable-tlsv12' '-enable-pkcallbacks'
* Added build error for insecure build combination of secure renegotiation enabled with extended master secret disabled when session resumption is enabled
* Updated building and running with Apple M1
* Apache httpd build without TLS 1.3 macro guard added
* Enable SHA3 and SHAKE256 requirements automatically when ED448 is enabled
* Added option for AES CBC cipher routines to return BAD_LENGTH_E when called with an input buffer length not a multiple of AES_BLOCK_SIZE
* Macro WOLFSSL_SP_INT_DIGIT_ALIGN added for alignment on buffers with SP build. This was needed for compiler building on a Renesas board.
* Build support with no hashes enabled an no RNG compiled in
* Allow use of FREESCALE hardware RNG without a specific port
* Resolved some warnings with Windows builds and PBKDF disabled
* Updated the version of autoconf and automake along with fixes for some new GCC-10 warnings
###### Math Libraries
* SP: Thumb implementation that works with clang
* SP math all: sp_cmp handling of negative values
* SP C ECC: mont sub - always normalize after sub before check for add
* TFM math library prime checking, added more error checks with small stack build
* Sanity checks on 0 value with GCD math function
* fp_exptmod_ct error checking and small stack variable free on error
* Sanity check on supported digit size when calling mp_add_d in non fastmath builds
* Support for mp_dump with SP Math ALL
* WOLFSSL_SP_NO_MALLOC for both the normal SP build and small SP build now
* WOLFSSL_SP_NO_DYN_STACK added for SP small code that is not small stack build to avoid dynamic stack
###### PKCS 7/8
* wc_PKCS7_DecodeCompressedData to optionally handle a packet without content wrapping
* Added setting of content type parsed with PKCS7 wc_PKCS7_DecodeAuthEnvelopedData and wc_PKCS7_DecodeEnvelopedData
* PKCS8 code improvements and refactoring
###### Misc.
* Sanity checks on null inputs to the functions wolfSSL_X509_get_serialNumber and wolfSSL_X509_NAME_print_ex
* Added ARM CryptoCell support for importing public key with wc_ecc_import_x963_ex()
* Improved checking for possible use of key->dp == NULL cases with ECC functions
* Updated SHAKE256 to compile with NIST FIPS 202 standard and added support for OID values (thanks to strongX509)
* Improved ECC operations when using WOLFSSL_NO_MALLOC
* Added WOLFSSL_SNIFFER_FATAL_ERROR for an return value when sniffer is in a fatal state
* Allow parsing spaces in Base64_SkipNewline
* Issue callback when exceeding depth limit rather than error out with OPENSSL_EXTRA build
* Added NXP LTC RSA key generation acceleration
For additional vulnerability information visit the vulnerability page at
https://www.wolfssl.com/docs/security-vulnerabilities/
@@ -291,7 +77,242 @@ 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
# wolfSSL Release 5.0.0 (Nov 01, 2021)
[Release 5.0.0](https://github.com/wolfSSL/wolfssl/releases/tag/v5.0.0-stable) of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* \[Low\] Hang with DSA signature creation when a specific q value is used in a maliciously crafted key. If a DSA key with an invalid q value of either 1 or 0 was decoded and used for creating a signature, it would result in a hang in wolfSSL. Users that are creating signatures with DSA and are using keys supplied from an outside source are affected.
* \[Low\] Issue with incorrectly validating a certificate that has multiple subject alternative names when given a name constraint. In the case where more than one subject alternative name is used in the certificate, previous versions of wolfSSL could incorrectly validate the certificate. Users verifying certificates with multiple alternative names and name constraints, are recommended to either use the certificate verify callback to check for this case or update the version of wolfSSL used. Thanks to Luiz Angelo Daros de Luca for the report.
### New Feature Additions
###### New Product
* FIPS 140-3 -- currently undergoing laboratory testing, code review and ultimately CMVP validation. Targeting the latest FIPS standard.
###### Ports
* IoT-Safe with TLS demo
* SE050 port with support for RNG, SHA, AES, ECC (sign/verify/shared secret) and ED25519
* Support for Renesas TSIP v1.13 on RX72N
###### Post Quantum
* Support for OQS's (liboqs version 0.7.0) implementation of NIST Round 3 KEMs as TLS 1.3 groups --with-liboqs
* Hybridizing NIST ECC groups with the OQS groups
* Remove legacy NTRU and QSH
* Make quantum-safe groups available to the compatibility layer
###### Linux Kernel Module
* Full support for FIPS 140-3, with in-kernel power on self test (POST) and conditional algorithm self test(s) (CAST)
* --enable-linuxkm-pie -- position-independent in-kernel wolfCrypt container, for FIPS
* Vectorized x86 acceleration in PK algs (RSA, ECC, DH, DSA) and AES/AES-GCM
* Vectorized x86 acceleration in interrupt handlers
* Support for Linux-native module signatures
* Complete SSL/TLS and Crypto API callable from other kernel module(s)
* Support for LTS kernel lines: 3.16, 4.4, 4.9, 5.4, 5.10
###### Compatibility Layer Additions
* Ports
- Add support for libssh2
- Add support for pyOpenSSL
- Add support for libimobiledevice
- Add support for rsyslog
- Add support for OpenSSH 8.5p1
- Add support for Python 3.8.5
* API/Structs Added
- ERR_lib_error_string
- EVP_blake2
- wolfSSL_set_client_CA_list
- wolfSSL_EVP_sha512_224
- wolfSSL_EVP_sha512_256
- wc_Sha512_224/2256Hash
- wc_Sha512_224/256Hash
- wc_InitSha512_224/256
- wc_InitSha512_224/256_ex
- wc_Sha512_224/256Update
- wc_Sha512_224/256FinalRaw
- wc_Sha512_224/256Final
- wc_Sha512_224/256Free
- wc_Sha512_224/256GetHash
- wc_Sha512_224/256Copy
- wc_Sha512_224/256SetFlags
- wc_Sha512_224/256GetFlags
- wc_Sha512_224/256Transform
- EVP_MD_do_all and OBJ_NAME_do_all
- EVP_shake128
- EVP_shake256
- SSL_CTX_set_num_tickets
- SSL_CTX_get_num_tickets
- SSL_CIPHER_get_auth_nid
- SSL_CIPHER_get_cipher_nid
- SSL_CIPHER_get_digest_nid
- SSL_CIPHER_get_kx_nid
- SSL_CIPHER_is_aead
- SSL_CTX_set_msg_callback
- a2i_IPADDRESS
- GENERAL_NAME_print
- X509_VERIFY_PARAM_set1_ip
- EVP_CIPHER_CTX_set_iv_length
- PEM_read_bio_RSA_PUBKEY
- i2t_ASN1_OBJECT
- DH_set_length
- Set_tlsext_max_fragment_length
- AUTHORITY_iNFO_ACCESS_free
- EVP_PBE_scrypt
- ASN1_R_HEADER_TOO_LONG
- ERR_LIB
- X509_get_default_cert_file/file_env/dir/dir_env() stubs
- SSL_get_read_ahead/SSL_set_read_ahead()
- SSL_SESSION_has_ticket()
- SSL_SESSION_get_ticket_lifetime_hint()
- DIST_POINT_new
- DIST_POINT_free
- DIST_POINTS_free
- CRL_DIST_POINTS_free
- sk_DIST_POINT_push
- sk_DIST_POINT_value
- sk_DIST_POINT_num
- sk_DIST_POINT_pop_free
- sk_DIST_POINT_free
- X509_get_extension_flags
- X509_get_key_usage
- X509_get_extended_key_usage
- ASN1_TIME_to_tm
- ASN1_TIME_diff
- PEM_read_X509_REQ
- ERR_load_ERR_strings
- BIO_ssl_shutdown
- BIO_get_ssl
- BIO_new_ssl_connect
- BIO_set_conn_hostname
- NID_pkcs9_contentType
###### Misc.
* KCAPI: add support for using libkcapi for crypto (Linux Kernel)
* Configure option for --with-max-rsa-bits= and --with-max-ecc-bits=
* SP ARM Thumb support for Keil and performance improvements
* Add support for WOLFSSL_VERIFY_POST_HANDSHAKE verify mode
* PKCS #11: support static linking with PKCS #11 library --enable-pkcs11=static LIBS=-l
* Add build option --enable-wolfclu for use with wolfCLU product
* Add support for X9.42 header i.e “BEGIN X9.42 DH PARAMETERS”
* Add --enable-altcertchains for configuring wolfSSL with alternate certificate chains feature enabled
* Add public API wc_RsaKeyToPublicDer_ex to allow getting RSA public key without ASN.1 header (can return only seq + n + e)
* Add SNI and TLSx options to CMake build
### Fixes
###### PORT Fixes
* Add return value checking for FREESCALE_RNGA
* Fix MMCAU_SHA256 type warnings
* Fixes for building with Microchip XC32 and ATECC
###### Math Library Fixes
* TFM check that the modulus length is valid for fixed data array size
* TFM fp_submod_ct fix check for greater
* Check return value of mp_grow in mp_mod_2d
* Fix for ECC point multiply to error out on large multipliers
* SP ECC error on multiplier larger than curve order
###### TLS 1.3
* TLS1.3 sanity check for cases where a private key is larger than the configured maximum
* Fix early data max size handling in TLS v1.3
* Fixes for PK callbacks with TLS v1.3
* Check min downgrade when no extensions are sent with the ServerHello
###### Misc.
* Previously wolfSSL enum values were used as NIDs. Now only the compatibility layer NID enums are the NID values:
- CTC_SHAwDSA -> NID_dsaWithSHA1
- CTC_SHA256wDSA -> NID_dsa_with_SHA256
- CTC_MD2wRSA -> NID_md2WithRSAEncryption
- CTC_MD5wRSA -> NID_md5WithRSAEncryption
- CTC_SHAwRSA -> NID_sha1WithRSAEncryption
- CTC_SHA224wRSA -> NID_sha224WithRSAEncryption
- CTC_SHA256wRSA -> NID_sha256WithRSAEncryption
- CTC_SHA384wRSA -> NID_sha384WithRSAEncryption
- CTC_SHA512wRSA -> NID_sha512WithRSAEncryption
- CTC_SHA3_224wRSA -> NID_RSA_SHA3_224
- CTC_SHA3_256wRSA -> NID_RSA_SHA3_256
- CTC_SHA3_384wRSA -> NID_RSA_SHA3_384
- CTC_SHA3_512wRSA -> NID_RSA_SHA3_512
- CTC_SHAwECDSA -> NID_ecdsa_with_SHA1
- CTC_SHA224wECDSA -> NID_ecdsa_with_SHA224
- CTC_SHA256wECDSA -> NID_ecdsa_with_SHA256
- CTC_SHA384wECDSA -> NID_ecdsa_with_SHA384
- CTC_SHA512wECDSA -> NID_ecdsa_with_SHA512
- CTC_SHA3_224wECDSA -> NID_ecdsa_with_SHA3_224
- CTC_SHA3_256wECDSA -> NID_ecdsa_with_SHA3_256
- CTC_SHA3_384wECDSA -> NID_ecdsa_with_SHA3_384
- CTC_SHA3_512wECDSA -> NID_ecdsa_with_SHA3_512
- DSAk -> NID_dsa
- RSAk -> NID_rsaEncryption
- ECDSAk -> NID_X9_62_id_ecPublicKey
- BASIC_CA_OID -> NID_basic_constraints
- ALT_NAMES_OID -> NID_subject_alt_name
- CRL_DIST_OID -> NID_crl_distribution_points
- AUTH_INFO_OID -> NID_info_access
- AUTH_KEY_OID -> NID_authority_key_identifier
- SUBJ_KEY_OID -> NID_subject_key_identifier
- INHIBIT_ANY_OID -> NID_inhibit_any_policy
* Fix for DES IV size used with FIPSv2
* Fix signed comparison issue with serialSz
* Fix missing CBIOSend and properly guard hmac in DupSSL()
* Fix calculation of length of encoding in ssl.c
* Fix encoding to check proper length in asn.c
* Fix for wc_ecc_ctx_free and heap hint
* Fix for debug messages with AF_ALG build
* Fix for static memory with bucket size matching.
* Fixes for SRP with heap hint.
* Fixes for CAAM build macros and spelling for Keil build
* Sniffer fix for possible math issue around 64-bit pointer and 32-bit unsigned int
* Fix for sniffer TCP sequence rollover
* wolfSSL_PEM_write_bio_PUBKEY to write only the public part
* Fix for sending only supported groups in TLS extension
* Fix for sniffer to better handle spurious retransmission edge case
* SSL_set_alpn_protos and SSL_CTX_set_alpn_protos now returns 0 on successFixes issue with SSL_CTX_set1_curves_list and SSL_set1_curves_list not checking the last character of the names variable provided, non-0 on failure to better match expected return values
* Fixes and improvements for crypto callbacks with TLS (mutual auth)
* Fix for bad memory_mutex lock on static memory cleanup
* Zero terminate name constraints strings when parsing certificates
* Fix for verifying a certificate when multiple permitted name constraints are used
* Fix typo in ifdef for HAVE_ED448
* Fix typos in comments in SHA512
* Add sanity check on buffer size with ED25519 key decode
* Sanity check on PKCS7 stream amount read
* PKCS7 fix for double free on error case and sanity check on set serial number
* Sanity check on PKCS7 input size wc_PKCS7_ParseSignerInfo
* Forgive a DTLS session trying to send too much at once
### Improvements/Optimizations
###### Build Options and Warnings
* Rework of RC4 disable by default and depreciation
* wolfSSL as a Zephyr module (without setup.sh)
* Add include config.h to bio.c
* Support for PKCS7 without AES CBC.
* Fixes for building without AES CBC
* Added WOLFSSL_DH_EXTRA to --enable-all and --enable-sniffer
* Add a CMake option to build wolfcrypt test and bench code as libraries
* GCC makefile: allow overriding and provide more flexibility
###### Math Libraries
* Improve performance of fp_submod_ct() and fp_addmod_ct()
* Improve performance of sp_submod_ct() and sp_addmod_ct()
* SP int, handle even modulus with exponentiation
###### Misc.
* Cleanups for Arduino examples and memory documentation
* Refactor hex char to byte conversions
* Added GCC-ARM TLS server example
* Improvements to session locking to allow per-row
* Improved sniffer statistics and documentation
* EVP key support for heap hint and crypto callbacks
* Reduced stack size for dh_generation_test and Curve ASN functions
* Espressif README Syntax / keyword highlighting / clarifications
* AARCH64 SHA512: implementation using crypto instructions added
* wc_RsaPSS_CheckPadding_ex2 added for use with HEAP hint
* wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex bound checks on input and output sizes
* Add additional error handling to wolfSSL_BIO_get_len
* Add code to use popen and the command 'host', useful with qemu
* Adjustment to subject alt names order with compatibility layer to better match expected order
* Reduce BIO compatibility layer verbosity
* Set a default upper bound on error queue size with compatibility layer
* WOLFSSL_CRL_ALLOW_MISSING_CDP macro for Skip CRL verification in case no CDP in peer cert
* Fixes for scan-build LLVM-13 and expanded coverage
* Increase the default DTLS_MTU_ADDITIONAL_READ_BUFFER and make it adjustable
*** Resources ***

399
README.md
View File

@@ -65,7 +65,7 @@ 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:
```c
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
```
before calling `wolfSSL_new();`. Though it's not recommended.
@@ -77,219 +77,242 @@ 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 4.8.1 (July 16, 2021)
[Release 4.8.1](https://github.com/wolfSSL/wolfssl/releases/tag/v4.8.1-stable) of wolfSSL embedded TLS has an OCSP vulnerability fix:
# wolfSSL Release 5.0.0 (Nov 01, 2021)
[Release 5.0.0](https://github.com/wolfSSL/wolfssl/releases/tag/v5.0.0-stable) of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* [High] OCSP verification issue when response is for a certificate with no relation to the chain in question BUT that response contains the NoCheck extension which effectively disables ALL verification of that one cert. Users who should upgrade to 4.8.1 are TLS client users doing OCSP, TLS server users doing mutual auth with OCSP, and CertManager users doing OCSP independent of TLS. Thanks to Jan Nauber, Marco Smeets, Werner Rueschenbaum and Alissa Kim of Volkswagen Infotainment for the report.
# wolfSSL Release 4.8.0 (July 09, 2021)
[Release 4.8.0](https://github.com/wolfSSL/wolfssl/releases/tag/v4.8.0-stable) of wolfSSL embedded TLS has bug fixes and new features including:
### Vulnerabilities
* \[Low\] [CVE-2021-37155](https://nvd.nist.gov/vuln/detail/CVE-2021-37155): OCSP request/response verification issue. In the case that the serial number in the OCSP request differs from the serial number in the OCSP response the error from the comparison was not resulting in a failed verification. We recommend users that have wolfSSL version 4.6.0 and 4.7.0 with OCSP enabled update their version of wolfSSL. Version 4.5.0 and earlier are not affected by this report. Thanks to Rainer Mueller-Amersdorffer, Roee Yankelevsky, Barak Gutman, Hila Cohen and Shoshi Berko (from CYMOTIVE Technologies and CARIAD) for the report.
* \[Low\] [CVE-2021-24116](https://nvd.nist.gov/vuln/detail/CVE-2021-24116): Side-Channel cache look up vulnerability in base64 PEM decoding for versions of wolfSSL 4.5.0 and earlier. Versions 4.6.0 and up contain a fix and do not need to be updated for this report. If decoding a PEM format private key using version 4.5.0 and older of wolfSSL then we recommend updating the version of wolfSSL used. Thanks to Florian Sieck, Jan Wichelmann, Sebastian Berndt and Thomas Eisenbarth for the report.
* \[Low\] Hang with DSA signature creation when a specific q value is used in a maliciously crafted key. If a DSA key with an invalid q value of either 1 or 0 was decoded and used for creating a signature, it would result in a hang in wolfSSL. Users that are creating signatures with DSA and are using keys supplied from an outside source are affected.
* \[Low\] Issue with incorrectly validating a certificate that has multiple subject alternative names when given a name constraint. In the case where more than one subject alternative name is used in the certificate, previous versions of wolfSSL could incorrectly validate the certificate. Users verifying certificates with multiple alternative names and name constraints, are recommended to either use the certificate verify callback to check for this case or update the version of wolfSSL used. Thanks to Luiz Angelo Daros de Luca for the report.
### New Feature Additions
###### New Product
* Added wolfSentry build with `--enable-wolfsentry` and tie-ins to wolfSSL code for use with wolfSentry
* FIPS 140-3 -- currently undergoing laboratory testing, code review and ultimately CMVP validation. Targeting the latest FIPS standard.
###### Ports
* QNX CAAM driver added, supporting ECC black keys, CMAC, BLOBs, and TRNG use
* `_WIN32_WCE` wolfCrypt port added
* `INTIME_RTOS` directory support added
* Added support for STM32G0
* Renesas RX: Added intrinsics for rot\[rl\], revl (thanks @rliebscher)
* Added support for running wolfcrypt/test/testwolfcrypt on Dolphin emulator to test DEVKITPRO port
* Zephyr project port updated to latest version 2.6.X
* IoT-Safe with TLS demo
* SE050 port with support for RNG, SHA, AES, ECC (sign/verify/shared secret) and ED25519
* Support for Renesas TSIP v1.13 on RX72N
###### ASN1 and PKCS
* Storing policy constraint extension from certificate added
* Added support for `NID_favouriteDrink` pilot
* Added the API function `wc_EncryptPKCS8Key` to handle encrypting a DER, PKCS#8-formatted key
###### Post Quantum
* Support for OQS's (liboqs version 0.7.0) implementation of NIST Round 3 KEMs as TLS 1.3 groups --with-liboqs
* Hybridizing NIST ECC groups with the OQS groups
* Remove legacy NTRU and QSH
* Make quantum-safe groups available to the compatibility layer
###### Linux Kernel Module
* Full support for FIPS 140-3, with in-kernel power on self test (POST) and conditional algorithm self test(s) (CAST)
* --enable-linuxkm-pie -- position-independent in-kernel wolfCrypt container, for FIPS
* Vectorized x86 acceleration in PK algs (RSA, ECC, DH, DSA) and AES/AES-GCM
* Vectorized x86 acceleration in interrupt handlers
* Support for Linux-native module signatures
* Complete SSL/TLS and Crypto API callable from other kernel module(s)
* Support for LTS kernel lines: 3.16, 4.4, 4.9, 5.4, 5.10
###### Compatibility Layer Additions
* Open Source PORTS Added/Updated
- OpenVPN
- OpenLDAP
- socat-1.7.4.1
- Updated QT port for 5.15.2
* Changes to extend `set_cipher_list()` compatibility layer API to have `set_ciphersuites` compatibility layer API capability
* Added more support for SHA3 in the EVP layer
* API Added
- `MD5`/`MD5_Transform`
- `SHA`/`SHA_Transform`/`SHA1_Transform`
- `SHA224`/`SHA256_Transform`/`SHA512_Transform`
- `SSL_CTX_get0_param`/`SSL_CTX_set1_param`
- `X509_load_crl_file`
- `SSL_CTX_get_min_proto_version`
- `EVP_ENCODE_CTX_new`
- `EVP_ENCODE_CTX_free`
- `EVP_EncodeInit`
- `EVP_EncodeUpdate`
- `EVP_EncodeFinal`
- `EVP_DecodeInit`
- `EVP_DecodeUpdate`
- `EVP_DecodeFinal`
- `EVP_PKEY_print_public`
- `BIO_tell`
- `THREADID_current`
- `THREADID_hash`
- `SSL_CTX_set_ecdh_auto`
- `RAND_set_rand_method()`
- `X509_LOOKUP_ctrl()`
- `RSA_bits`
- `EC_curve_nist2nid`
- `EC_KEY_set_group`
- `SSL_SESSION_set_cipher`
- `SSL_set_psk_use_session_callback`
- `EVP_PKEY_param_check`
- `DH_get0_pqg`
- `CRYPTO_get_ex_new_index`
- `SSL_SESSION_is_resumable`
- `SSL_CONF_cmd`
- `SSL_CONF_CTX_finish`
- `SSL_CTX_keylog_cb_func`
- `SSL_CTX_set_keylog_callback`
- `SSL_CTX_get_keylog_callback`
* Ports
- Add support for libssh2
- Add support for pyOpenSSL
- Add support for libimobiledevice
- Add support for rsyslog
- Add support for OpenSSH 8.5p1
- Add support for Python 3.8.5
* API/Structs Added
- ERR_lib_error_string
- EVP_blake2
- wolfSSL_set_client_CA_list
- wolfSSL_EVP_sha512_224
- wolfSSL_EVP_sha512_256
- wc_Sha512_224/2256Hash
- wc_Sha512_224/256Hash
- wc_InitSha512_224/256
- wc_InitSha512_224/256_ex
- wc_Sha512_224/256Update
- wc_Sha512_224/256FinalRaw
- wc_Sha512_224/256Final
- wc_Sha512_224/256Free
- wc_Sha512_224/256GetHash
- wc_Sha512_224/256Copy
- wc_Sha512_224/256SetFlags
- wc_Sha512_224/256GetFlags
- wc_Sha512_224/256Transform
- EVP_MD_do_all and OBJ_NAME_do_all
- EVP_shake128
- EVP_shake256
- SSL_CTX_set_num_tickets
- SSL_CTX_get_num_tickets
- SSL_CIPHER_get_auth_nid
- SSL_CIPHER_get_cipher_nid
- SSL_CIPHER_get_digest_nid
- SSL_CIPHER_get_kx_nid
- SSL_CIPHER_is_aead
- SSL_CTX_set_msg_callback
- a2i_IPADDRESS
- GENERAL_NAME_print
- X509_VERIFY_PARAM_set1_ip
- EVP_CIPHER_CTX_set_iv_length
- PEM_read_bio_RSA_PUBKEY
- i2t_ASN1_OBJECT
- DH_set_length
- Set_tlsext_max_fragment_length
- AUTHORITY_iNFO_ACCESS_free
- EVP_PBE_scrypt
- ASN1_R_HEADER_TOO_LONG
- ERR_LIB
- X509_get_default_cert_file/file_env/dir/dir_env() stubs
- SSL_get_read_ahead/SSL_set_read_ahead()
- SSL_SESSION_has_ticket()
- SSL_SESSION_get_ticket_lifetime_hint()
- DIST_POINT_new
- DIST_POINT_free
- DIST_POINTS_free
- CRL_DIST_POINTS_free
- sk_DIST_POINT_push
- sk_DIST_POINT_value
- sk_DIST_POINT_num
- sk_DIST_POINT_pop_free
- sk_DIST_POINT_free
- X509_get_extension_flags
- X509_get_key_usage
- X509_get_extended_key_usage
- ASN1_TIME_to_tm
- ASN1_TIME_diff
- PEM_read_X509_REQ
- ERR_load_ERR_strings
- BIO_ssl_shutdown
- BIO_get_ssl
- BIO_new_ssl_connect
- BIO_set_conn_hostname
- NID_pkcs9_contentType
###### Misc.
* Added `wolfSSL_CTX_get_TicketEncCtx` getter function to return the ticket encryption ctx value
* Added `wc_AesKeyWrap_ex` and `wc_AesKeyUnWrap_ex` APIs to accept an `Aes` object to use for the AES operations
* Added implementation of AES-GCM streaming (`--enable-aesgcm-stream`)
* Added deterministic generation of k with ECC following RFC6979 when the macro `WOLFSL_ECDSA_DETERMINISTIC_K` is defined and `wc_ecc_set_deterministic` function is called
* Implemented `wc_DsaParamsDecode` and `wc_DsaKeyToParamsDer`
* Asynchronous support for TLS v1.3 TLSX ECC/DH key generation and key agreement
* Added crypto callback support for Ed/Curve25519 and SHA2-512/384
* TLS 1.3 `wolfSSL_key_update_response` function added to see if a update response is needed
* KCAPI: add support for using libkcapi for crypto (Linux Kernel)
* Configure option for --with-max-rsa-bits= and --with-max-ecc-bits=
* SP ARM Thumb support for Keil and performance improvements
* Add support for WOLFSSL_VERIFY_POST_HANDSHAKE verify mode
* PKCS #11: support static linking with PKCS #11 library --enable-pkcs11=static LIBS=-l
* Add build option --enable-wolfclu for use with wolfCLU product
* Add support for X9.42 header i.e “BEGIN X9.42 DH PARAMETERS”
* Add --enable-altcertchains for configuring wolfSSL with alternate certificate chains feature enabled
* Add public API wc_RsaKeyToPublicDer_ex to allow getting RSA public key without ASN.1 header (can return only seq + n + e)
* Add SNI and TLSx options to CMake build
### Fixes
* Fix for detecting extra unused bytes that are in an ASN1 sequence appended to the end of a valid ECC signature
* Fix for keyid with ktri CMS (breaks compatibility with previous keyid ASN1 syntax)
* Fix for failed handshake if a client offers more than 150 cipher suites. Thanks to Marcel Maehren, Philipp Nieting, Robert Merget from Ruhr University Bochum Sven Hebrok, Juraj Somorovsky from Paderborn University
* Fix for default order of deprecated elliptic curves SECP224R1, SECP192R1, SECP160R1. Thanks to Marcel Maehren, Philipp Nieting, Robert Merget from Ruhr University Bochum Sven Hebrok, Juraj Somorovsky from Paderborn University
* Fix for corner TLS downgrade case where a TLS 1.3 setup that allows for downgrades but has TLS 1.3 set as the minimum version would still downgrade to TLS 1.2
###### PKCS7 (Multiple fixes throughout regarding memory leaks with SMIME and heap buffer overflows due to streaming functionality)
* Fix PKCS7 dynamic content save/restore in `PKCS7_VerifySignedData`
* Fix for heap buffer overflow on compare with `wc_PKCS7_DecryptKtri`
* Fix for heap buffer overflow with `wc_PKCS7_VerifySignedData`
* Fix for heap buffer overflow with `wc_PKCS7_DecodeEnvelopedData`
* Check size of public key used with certificate passed into `wc_PKCS7_InitWithCert` before `XMEMCPY` to avoid overflow
* Fix for heap buffer overflow fix for `wolfSSL_SMIME_read_PKCS7`
* Fix to cleanly free memory in error state with `wolfSSL_SMIME_read_PKCS7`
* SMIME error checking improvements and canonicalize multi-part messages before hashing
###### DTLS Fixes
* DTLS fix to correctly move the Tx sequence number forward
* DTLS fix for sequence and epoch number with secure renegotiation cookie exchange
* Fix for Chacha-Poly AEAD for DTLS 1.2 with secure renegotiation
###### PORT Fixes
* Fix AES, aligned key for the HW module with DCP port
* Fix ATECC608A TNGTLS certificate size issue (thanks @vppillai)
* Fixes for mingw compile warnings
* Fixes for NXP LTC ECC/RSA
* Fix ESP32 RSA hw accelerator initialization issue
* Fixes for STM32 PKA with ECC
* Fixes for STM32 AES GCM for HAL's that support byte sized headers
* Espressif ESP32 SHA_CTX macro conflict resolved
* Add return value checking for FREESCALE_RNGA
* Fix MMCAU_SHA256 type warnings
* Fixes for building with Microchip XC32 and ATECC
###### Math Library Fixes
* For platforms that support limits.h or windows make sure both `SIZEOF_LONG_LONG` and `SIZEOF_LONG` are set to avoid issues with `CTC_SETTINGS`
* SP C 32/64: fix corner cases around subtraction affecting RSA PSS use
* Fix to return the error code from `sp_cond_swap_ct` when `malloc` fails
* Fix potential memory leak with small stack in the function `fp_gcd`
* Static Analysis Fixes
* Fixes made from Coverity analysis including:
* Cleanups for some return values,
* Fix for leak with `wolfSSL_a2i_ASN1_INTEGER`
* Sanity check on length in `wolfSSL_BN_rand`
* Sanity check size in `TLSX_Parse` catching a possible integer overflow
* Fixes found with `-fsanitize=undefined` testing
* Fix null dereferences or undefined `memcpy` calls
* Fix alignment in `myCryptoDevCb`
* Fix default DTLS context assignment
* Added align configure option to force data alignment
* TFM check that the modulus length is valid for fixed data array size
* TFM fp_submod_ct fix check for greater
* Check return value of mp_grow in mp_mod_2d
* Fix for ECC point multiply to error out on large multipliers
* SP ECC error on multiplier larger than curve order
###### TLS 1.3
* TLS1.3 sanity check for cases where a private key is larger than the configured maximum
* Fix early data max size handling in TLS v1.3
* Fixes for PK callbacks with TLS v1.3
* Check min downgrade when no extensions are sent with the ServerHello
###### Misc.
* Fix for `wolfSSL_ASN1_TIME_adj` set length
* Fix for freeing structure on error case in the function `AddTrustedPeer`
* Return value of `SSL_read` when called after bidirectional shutdown
* Fix for build options `./configure --enable-dtls --disable-asn`
* FIx for detection of a salt length from an RSA PSS signature
* Fix to free up `globalRNGMutex` mutex when cleaning up global RNG
* Fix leak when multiple hardware names are in SAN
* Fix nonblocking ret value from CRL I/O callbacks
* Fix `wolfSSL_BIO_free_all` return type to better match for compatibility layer
* Fix for `make distcheck`, `maintainer-clean`, to allow distribution builds
* Fix for async with fragmented packets
* Fix for the build or RSA verify or public only
* Fix for return value of `wolfSSL_BIO_set_ssl` to better match expected compatibility layer return value
* Fix for sanity checks on size of issuer hash and key along with better freeing on error cases with `DecodeBasicOcspResponse`
* Fix for potential memory leak with `wolfSSL_OCSP_cert_to_id`
* Previously wolfSSL enum values were used as NIDs. Now only the compatibility layer NID enums are the NID values:
- CTC_SHAwDSA -> NID_dsaWithSHA1
- CTC_SHA256wDSA -> NID_dsa_with_SHA256
- CTC_MD2wRSA -> NID_md2WithRSAEncryption
- CTC_MD5wRSA -> NID_md5WithRSAEncryption
- CTC_SHAwRSA -> NID_sha1WithRSAEncryption
- CTC_SHA224wRSA -> NID_sha224WithRSAEncryption
- CTC_SHA256wRSA -> NID_sha256WithRSAEncryption
- CTC_SHA384wRSA -> NID_sha384WithRSAEncryption
- CTC_SHA512wRSA -> NID_sha512WithRSAEncryption
- CTC_SHA3_224wRSA -> NID_RSA_SHA3_224
- CTC_SHA3_256wRSA -> NID_RSA_SHA3_256
- CTC_SHA3_384wRSA -> NID_RSA_SHA3_384
- CTC_SHA3_512wRSA -> NID_RSA_SHA3_512
- CTC_SHAwECDSA -> NID_ecdsa_with_SHA1
- CTC_SHA224wECDSA -> NID_ecdsa_with_SHA224
- CTC_SHA256wECDSA -> NID_ecdsa_with_SHA256
- CTC_SHA384wECDSA -> NID_ecdsa_with_SHA384
- CTC_SHA512wECDSA -> NID_ecdsa_with_SHA512
- CTC_SHA3_224wECDSA -> NID_ecdsa_with_SHA3_224
- CTC_SHA3_256wECDSA -> NID_ecdsa_with_SHA3_256
- CTC_SHA3_384wECDSA -> NID_ecdsa_with_SHA3_384
- CTC_SHA3_512wECDSA -> NID_ecdsa_with_SHA3_512
- DSAk -> NID_dsa
- RSAk -> NID_rsaEncryption
- ECDSAk -> NID_X9_62_id_ecPublicKey
- BASIC_CA_OID -> NID_basic_constraints
- ALT_NAMES_OID -> NID_subject_alt_name
- CRL_DIST_OID -> NID_crl_distribution_points
- AUTH_INFO_OID -> NID_info_access
- AUTH_KEY_OID -> NID_authority_key_identifier
- SUBJ_KEY_OID -> NID_subject_key_identifier
- INHIBIT_ANY_OID -> NID_inhibit_any_policy
* Fix for DES IV size used with FIPSv2
* Fix signed comparison issue with serialSz
* Fix missing CBIOSend and properly guard hmac in DupSSL()
* Fix calculation of length of encoding in ssl.c
* Fix encoding to check proper length in asn.c
* Fix for wc_ecc_ctx_free and heap hint
* Fix for debug messages with AF_ALG build
* Fix for static memory with bucket size matching.
* Fixes for SRP with heap hint.
* Fixes for CAAM build macros and spelling for Keil build
* Sniffer fix for possible math issue around 64-bit pointer and 32-bit unsigned int
* Fix for sniffer TCP sequence rollover
* wolfSSL_PEM_write_bio_PUBKEY to write only the public part
* Fix for sending only supported groups in TLS extension
* Fix for sniffer to better handle spurious retransmission edge case
* SSL_set_alpn_protos and SSL_CTX_set_alpn_protos now returns 0 on successFixes issue with SSL_CTX_set1_curves_list and SSL_set1_curves_list not checking the last character of the names variable provided, non-0 on failure to better match expected return values
* Fixes and improvements for crypto callbacks with TLS (mutual auth)
* Fix for bad memory_mutex lock on static memory cleanup
* Zero terminate name constraints strings when parsing certificates
* Fix for verifying a certificate when multiple permitted name constraints are used
* Fix typo in ifdef for HAVE_ED448
* Fix typos in comments in SHA512
* Add sanity check on buffer size with ED25519 key decode
* Sanity check on PKCS7 stream amount read
* PKCS7 fix for double free on error case and sanity check on set serial number
* Sanity check on PKCS7 input size wc_PKCS7_ParseSignerInfo
* Forgive a DTLS session trying to send too much at once
### Improvements/Optimizations
###### DTLS/TLS Code Base
* Improved TLS v1.3 time rollover support
* TLS 1.3 PSK: use the hash algorithm to choose cipher suite
* TLS Extended Master Secret ext: TLS13 - send in second Client Hello if in first
* TLS Encrypt then MAC: check all padding bytes are the same value
* `wolfSSL_GetMaxRecordSize` updated to now take additional cipher data into account
* Updated session export/import with DTLS to handle a new internal options flag
* Refactored `dtls_expected_peer_handshake_number` handling
* Added `wolfSSL_CTX_get_ephemeral_key` and `wolfSSL_get_ephemeral_key` for loading a constant key in place of an ephemeral one
* Improved checking of `XSNPRINTF` return value in `DecodePolicyOID`
###### Build Options and Warnings
* Added `wolfSSL_CTX_set_verify` to the ABI list
* Adjusted `FP_ECC` build to not allow SECP160R1, SECP160R2, SECP160K1 and SECP224K1. `FP_ECC` does not work with scalars that are the length of the order when the order is longer than the prime.
* Added CMake support for CURVE25519, ED25519, CURVE448, and ED448
* cmake addition to test paths when building
* Added support for session tickets in CMake
* Added support for reproducible builds with CMake
* Turn on reproducible-build by default when enable-distro
* Windows Project: Include the X448 and Ed448 files
* GCC-11 compile time warning fixes
* Fix for compiling build of `./configure --disable-tlsv12 -enable-pkcallbacks`
* Added build error for insecure build combination of secure renegotiation enabled with extended master secret disabled when session resumption is enabled
* Updated building and running with Apple M1
* Apache httpd build without TLS 1.3 macro guard added
* Enable SHA3 and SHAKE256 requirements automatically when ED448 is enabled
* Added option for AES CBC cipher routines to return `BAD_LENGTH_E` when called with an input buffer length not a multiple of `AES_BLOCK_SIZE`
* Macro `WOLFSSL_SP_INT_DIGIT_ALIGN` added for alignment on buffers with SP build. This was needed for compiler building on a Renesas board.
* Build support with no hashes enabled an no RNG compiled in
* Allow use of FREESCALE hardware RNG without a specific port
* Resolved some warnings with Windows builds and PBKDF disabled
* Updated the version of `autoconf` and `automake` along with fixes for some new GCC-10 warnings
* Rework of RC4 disable by default and depreciation
* wolfSSL as a Zephyr module (without setup.sh)
* Add include config.h to bio.c
* Support for PKCS7 without AES CBC.
* Fixes for building without AES CBC
* Added WOLFSSL_DH_EXTRA to --enable-all and --enable-sniffer
* Add a CMake option to build wolfcrypt test and bench code as libraries
* GCC makefile: allow overriding and provide more flexibility
###### Math Libraries
* SP: Thumb implementation that works with clang
* SP math all: `sp_cmp` handling of negative values
* SP C ECC: mont sub - always normalize after sub before check for add
* TFM math library prime checking, added more error checks with small stack build
* Sanity checks on 0 value with GCD math function
* `fp_exptmod_ct` error checking and small stack variable free on error
* Sanity check on supported digit size when calling `mp_add_d` in non fastmath builds
* Support for `mp_dump` with SP Math ALL
* `WOLFSSL_SP_NO_MALLOC` for both the normal SP build and small SP build now
* `WOLFSSL_SP_NO_DYN_STACK` added for SP small code that is not small stack build to avoid dynamic stack
###### PKCS 7/8
* `wc_PKCS7_DecodeCompressedData` to optionally handle a packet without content wrapping
* Added setting of content type parsed with PKCS7 `wc_PKCS7_DecodeAuthEnvelopedData` and `wc_PKCS7_DecodeEnvelopedData`
* PKCS8 code improvements and refactoring
* Improve performance of fp_submod_ct() and fp_addmod_ct()
* Improve performance of sp_submod_ct() and sp_addmod_ct()
* SP int, handle even modulus with exponentiation
###### Misc.
* Sanity checks on null inputs to the functions `wolfSSL_X509_get_serialNumber` and `wolfSSL_X509_NAME_print_ex`
* Added ARM CryptoCell support for importing public key with `wc_ecc_import_x963_ex()`
* Improved checking for possible use of `key->dp == NULL` cases with ECC functions
* Updated SHAKE256 to compile with NIST FIPS 202 standard and added support for OID values (thanks to strongX509)
* Improved ECC operations when using `WOLFSSL_NO_MALLOC`
* Added `WOLFSSL_SNIFFER_FATAL_ERROR` for an return value when sniffer is in a fatal state
* Allow parsing spaces in `Base64_SkipNewline`
* Issue callback when exceeding depth limit rather than error out with `OPENSSL_EXTRA` build
* Added NXP LTC RSA key generation acceleration
* Cleanups for Arduino examples and memory documentation
* Refactor hex char to byte conversions
* Added GCC-ARM TLS server example
* Improvements to session locking to allow per-row
* Improved sniffer statistics and documentation
* EVP key support for heap hint and crypto callbacks
* Reduced stack size for dh_generation_test and Curve ASN functions
* Espressif README Syntax / keyword highlighting / clarifications
* AARCH64 SHA512: implementation using crypto instructions added
* wc_RsaPSS_CheckPadding_ex2 added for use with HEAP hint
* wc_AesKeyWrap_ex and wc_AesKeyUnWrap_ex bound checks on input and output sizes
* Add additional error handling to wolfSSL_BIO_get_len
* Add code to use popen and the command 'host', useful with qemu
* Adjustment to subject alt names order with compatibility layer to better match expected order
* Reduce BIO compatibility layer verbosity
* Set a default upper bound on error queue size with compatibility layer
* WOLFSSL_CRL_ALLOW_MISSING_CDP macro for Skip CRL verification in case no CDP in peer cert
* Fixes for scan-build LLVM-13 and expanded coverage
* Increase the default DTLS_MTU_ADDITIONAL_READ_BUFFER and make it adjustable
For additional vulnerability information visit the vulnerability page at:

Binary file not shown.

Binary file not shown.

7
certs/falcon/include.am Normal file
View File

@@ -0,0 +1,7 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
certs/falcon/bench_falcon_level1_key.der \
certs/falcon/bench_falcon_level5_key.der

View File

@@ -126,4 +126,5 @@ include certs/statickeys/include.am
include certs/test/include.am
include certs/test-pathlen/include.am
include certs/intermediate/include.am
include certs/falcon/include.am

View File

@@ -278,7 +278,7 @@ keyUsage=critical, digitalSignature, keyEncipherment, keyAgreement
extendedKeyUsage=serverAuth
nsCertType=server
# server-ecc extensions
# client-ecc extensions
[ client_ecc ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always

View File

@@ -10,7 +10,7 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@wolfsssl.com
emailAddress = support@wolfssl.com
[ v3_ca ]
inhibitAnyPolicy = critical,1

Binary file not shown.

View File

@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEAzCCAuugAwIBAgIUSu44/nlA6ddYMKuTWT7jAAObXbwwDQYJKoZIhvcNAQEL
BQAwgZ8xCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApRdWVlbnNsYW5kMREwDwYDVQQH
DAhCcmlzYmFuZTEUMBIGA1UECgwLd29sZlNTTCBJbmMxFDASBgNVBAsMC0VuZ2lu
ZWVyaW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xIjAgBgkqhkiG9w0BCQEW
E3N1cHBvcnRAd29sZnNzbC5jb20wHhcNMjExMDI2MTMzMzAzWhcNMjQwNzIyMTMz
MzAzWjCBnzELMAkGA1UEBhMCQVUxEzARBgNVBAgMClF1ZWVuc2xhbmQxETAPBgNV
BAcMCEJyaXNiYW5lMRQwEgYDVQQKDAt3b2xmU1NMIEluYzEUMBIGA1UECwwLRW5n
aW5lZXJpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEiMCAGCSqGSIb3DQEJ
ARYTc3VwcG9ydEB3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAMCVCOFXQfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hnf/5c
nFF194rKB+c1L4/hvXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/XGQ0l
T+FjY1GLC2Q/rUO4pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bMQLRp
o0YzaYduxLsXpvPo3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq0KGW
Srzh1Bpbx6DAwWN4D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ6dgI
vDMgs1gip6rrxOHmYYPF0pbf2dBPrdcCAwEAAaM1MDMwDQYDVR02AQH/BAMCAQEw
IgYJYIZIAYb4QgENBBUWE1Rlc3RpbmcgaW5oaWJpdCBhbnkwDQYJKoZIhvcNAQEL
BQADggEBAEPJZmwD9Lr+f2zp4AT4Yq7C45EBvEjvYHyHqk+QzIhxVF+aT6+gsMtG
irPW0GLjQEZtydpe9GeKvONvQRMEMovNJib/WuFiEKjRMgVGnRVNuL8Fya5RQgMy
lHLOuufqGyw4zpm/BxItMx/ChTWCdLHS3LDxV8lheKaU4FdzgEhutHTGiVoJKbZX
7lge6KTL8MtQ+A11dO5Eo6Yal5PoME/562AOe/0f0OZJQwW6t4XO1r+X5j7YX6dn
MCfc8skCCpro0YM2xE1OYaBTEFXcRYJaEU7U6lvIbWu09lVlzXb1IRdyCxa5xenI
i8/4jRVl9EDP3TBovy4o9BBhDXX4XZ8=
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFXDCCBESgAwIBAgIUdtjq13Vf1QryOYup6Qniboz466gwDQYJKoZIhvcNAQEL
BQAwgccxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdC
b3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEY
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMSAwHgYJKoZIhvcNAQkBFhFpbmZvQHdv
bGZzc3NsLmNvbTETMBEGCysGAQQBgjc8AgEDEwJVUzEbMBkGCysGAQQBgjc8AgEC
DApDYWxpZm9ybmlhMB4XDTIxMTAyNjEzMzMwM1oXDTI0MDcyMjEzMzMwM1owgccx
CzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFu
MREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UE
AwwPd3d3LndvbGZzc2wuY29tMSAwHgYJKoZIhvcNAQkBFhFpbmZvQHdvbGZzc3Ns
LmNvbTETMBEGCysGAQQBgjc8AgEDEwJVUzEbMBkGCysGAQQBgjc8AgECDApDYWxp
Zm9ybmlhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvwzKLRSyHoRC
W804H0ryTXUQ8bY1n9/KfQOY06zeA2buKvHYsH1uB1QLEJghTYDLEiDnzE/eRX3J
cncy6sqQu2lSEAMvqPOVxfGLYlYb72dvpBBBla0Km+OlwLDScHZQMFuo6AgsfO2n
onqNOCkcrMft8nyVsJWCfUlcOM13Je+9gHVTlDw9ymNbnxW10x0TLxnRPNt2Osy4
fcnlwtfaQG/YIdxzG0ItU5z+Gvx9q3o2P5jehHwFZ85qFDiHqfGMtWjLaH9xICv1
oGP1Vi+jJtK3b7FaF9c4mQj+k1hv/sMTSQgWC6dNZwBSMWcjTpjtUUUduQTZC+zY
KLNLve02eQIDAQABo4IBPDCCATgwHQYDVR0OBBYEFCeOZxF0wyYdP+0zY7Ok2B0w
5ejVMIIBBwYDVR0jBIH/MIH8gBQnjmcRdMMmHT/tM2OzpNgdMOXo1aGBzaSByjCB
xzELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB01vbnRhbmExEDAOBgNVBAcMB0JvemVt
YW4xETAPBgNVBAoMCFNhd3Rvb3RoMRMwEQYDVQQLDApDb25zdWx0aW5nMRgwFgYD
VQQDDA93d3cud29sZnNzbC5jb20xIDAeBgkqhkiG9w0BCQEWEWluZm9Ad29sZnNz
c2wuY29tMRMwEQYLKwYBBAGCNzwCAQMTAlVTMRswGQYLKwYBBAGCNzwCAQIMCkNh
bGlmb3JuaWGCFHbY6td1X9UK8jmLqekJ4m6M+OuoMAwGA1UdEwQFMAMBAf8wDQYJ
KoZIhvcNAQELBQADggEBAKCwAqkAY84wjms5rRzLMdJSDBn3hnXyY+A1TctSMoxc
9mgytzwEaYQnMzCpoyC4Dut1RCL7D5ws1MAfBLd3zeMdc4mpIEtqMy2n7UDEP/Kx
6WCg6IRUTr+2ki0f+4egKrpZRdeJgZHhqn2rHP3MzxaLjWoGLbg5MDrX4xOwH+Kb
/yhoHI4ukiWXjP9hUsg1SD6emlK9ws7QeTC8pw2w7ybzIAR6sz+Zc/edcQlpywu1
FgqqhJ7n1zxrnda1j5Dd3qC5motPGtxigyn+pwEUHmguiwQFsZAePTdTzsdYHrNo
y6g2C3CP8W7IdALiu8vxhMYXCs+6MCo8qkttJg/zoek=
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[ req ]
distinguished_name = req_distinguished_name
prompt = no
x509_extensions = v3_ca
[ req_distinguished_name ]
C = AU
ST = Queensland
L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@wolfssl.com
postalCode = 56-131
street = Main St
[ v3_ca ]
nsCertType = server
crlDistributionPoints = URI:http://www.wolfssl.com/crl.pem
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always

Binary file not shown.

View File

@@ -0,0 +1,32 @@
-----BEGIN CERTIFICATE-----
MIIFmDCCBICgAwIBAgIUIYnKdgsnPTG1eUAZKAmpUcb9N/4wDQYJKoZIhvcNAQEL
BQAwgcIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApRdWVlbnNsYW5kMREwDwYDVQQH
DAhCcmlzYmFuZTEUMBIGA1UECgwLd29sZlNTTCBJbmMxFDASBgNVBAsMC0VuZ2lu
ZWVyaW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xIjAgBgkqhkiG9w0BCQEW
E3N1cHBvcnRAd29sZnNzbC5jb20xDzANBgNVBBEMBjU2LTEzMTEQMA4GA1UECQwH
TWFpbiBTdDAeFw0yMTEwMjYxMzMzMDNaFw0yNDA3MjIxMzMzMDNaMIHCMQswCQYD
VQQGEwJBVTETMBEGA1UECAwKUXVlZW5zbGFuZDERMA8GA1UEBwwIQnJpc2JhbmUx
FDASBgNVBAoMC3dvbGZTU0wgSW5jMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEYMBYG
A1UEAwwPd3d3LndvbGZzc2wuY29tMSIwIAYJKoZIhvcNAQkBFhNzdXBwb3J0QHdv
bGZzc2wuY29tMQ8wDQYDVQQRDAY1Ni0xMzExEDAOBgNVBAkMB01haW4gU3QwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgfSvJNdRDx
tjWf38p9A5jTrN4DZu4q8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLqypC7aVIQ
Ay+o85XF8YtiVhvvZ2+kEEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04KRysx+3y
fJWwlYJ9SVw4zXcl772AdVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC19pAb9gh
3HMbQi1TnP4a/H2rejY/mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VWL6Mm0rdv
sVoX1ziZCP6TWG/+wxNJCBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u97TZ5AgMB
AAGjggGCMIIBfjARBglghkgBhvhCAQEEBAMCBkAwLwYDVR0fBCgwJjAkoCKgIIYe
aHR0cDovL3d3dy53b2xmc3NsLmNvbS9jcmwucGVtMBMGA1UdJQQMMAoGCCsGAQUF
BwMBMB0GA1UdDgQWBBQnjmcRdMMmHT/tM2OzpNgdMOXo1TCCAQIGA1UdIwSB+jCB
94AUJ45nEXTDJh0/7TNjs6TYHTDl6NWhgcikgcUwgcIxCzAJBgNVBAYTAkFVMRMw
EQYDVQQIDApRdWVlbnNsYW5kMREwDwYDVQQHDAhCcmlzYmFuZTEUMBIGA1UECgwL
d29sZlNTTCBJbmMxFDASBgNVBAsMC0VuZ2luZWVyaW5nMRgwFgYDVQQDDA93d3cu
d29sZnNzbC5jb20xIjAgBgkqhkiG9w0BCQEWE3N1cHBvcnRAd29sZnNzbC5jb20x
DzANBgNVBBEMBjU2LTEzMTEQMA4GA1UECQwHTWFpbiBTdIIUIYnKdgsnPTG1eUAZ
KAmpUcb9N/4wDQYJKoZIhvcNAQELBQADggEBABYF8t1yWicD7C0ZktxBMPQ9yJ3I
TBq/PdAJl18OthE33I9lyVmF65AEW4pJS8Xjss+WNs159IJLbKuT3tdiqmBA7V1H
sV03vMnhfdBDF0+zWnsKZF0tw2Gb772P2LiN/YrBc4KktcDqJocEy8D+P4jRVNM6
toMD7KkzBrv+FU3OjzhP8MfaiIlqsvb4u4qOqi+lLyy6jgUQzrDp99uU986SrybW
ulnisYYRQGGZ0vyAKez8PzoKvodfTUg5lLkkqlBfITnCsI3gHcjyk+uT8F9nSDGy
VZGdHNOS++/gbeWwPyJ97gyu65yotc3fL89iM8BrzDSTxADaS18i5afEZFI=
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIENTCCAx2gAwIBAgIUFtCwMsYG2mHNWoLk3+8pf7piWZowDQYJKoZIhvcNAQEL
BQAwezELMAkGA1UEBhMCQVUxEzARBgNVBAgMClF1ZWVuc2xhbmQxETAPBgNVBAcM
CEJyaXNiYW5lMRQwEgYDVQQKDAt3b2xmU1NMIEluYzEUMBIGA1UECwwLRW5naW5l
ZXJpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTAeFw0yMTEwMjYxMzMzMDNa
Fw0yNDA3MjIxMzMzMDNaMHsxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApRdWVlbnNs
YW5kMREwDwYDVQQHDAhCcmlzYmFuZTEUMBIGA1UECgwLd29sZlNTTCBJbmMxFDAS
BgNVBAsMC0VuZ2luZWVyaW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20wggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDAlQjhV0HycW230kVBJwFlxkWu
8rwkMLiVzi9O1vYciLx8n/uoZ3/+XJxRdfeKygfnNS+P4b17wC98q2SoF/zKXXu6
4CHlci5vLobYlXParBtTuV8/1xkNJU/hY2NRiwtkP61DuKUcXDSzrgCgY8X2fwtZ
aHhzpowYqQJtr8MZAS64EOPGzEC0aaNGM2mHbsS7F6bz6N2tc7x7LyG1/WZRDL1U
s+FtXxy8I3PRCQOJFNIQuWTDKtChlkq84dQaW8egwMFjeA9ENzAyloAyI5Whd7oT
0pdz4l0lyWoNwzlgpLSwaUJCCenYCLwzILNYIqeq68Th5mGDxdKW39nQT63XAgMB
AAGjgbAwga0wHQYDVR0OBBYEFLMRMsmSmITiyfjQO24DQsofDo48MB8GA1UdIwQY
MBaAFLMRMsmSmITiyfjQO24DQsofDo48MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD
VR0PAQH/BAQDAgGGMB4GA1UdHgEB/wQUMBKgEDAOgQwud29sZnNzbC5jb20wJwYJ
YIZIAYb4QgENBBoWGFRlc3RpbmcgbmFtZSBjb25zdHJhaW50czANBgkqhkiG9w0B
AQsFAAOCAQEAgD7lONgXq4cY/e/TP3hNok+ANPOTmwexPgQxYGr3p7lmV9veNLBD
xJE9J6kNb3T4Fge1wuSFFamnJyT5FbOdNn6v/RsCxIOm5snTUM8bXuA5Vw/lCB7C
hccGiOPmEhxD8K+IQqZ4a1Zp6HUHZuPrs99PRt+lWA3M5PJbzpCKzHMiFDGRpkib
RzC466/+V76ln7AtBbOh3w1QXAiHdIA2V40d0iX+q5e+L1X8sFGDvlxeTy+KXLwV
/7fNVLgtDfdP2XO+jwhkQJeoOmpNJDxsvwm7xhouK0L5G87QUtsaIwK9SnR07Aj5
5LHpvNCgLQHO5nmJyJ13RlEUDfnnaGXCbA==
-----END CERTIFICATE-----

Binary file not shown.

Binary file not shown.

View File

@@ -10,7 +10,7 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@wolfsssl.com
emailAddress = support@wolfssl.com
[ v3_ca ]
nsCertType = critical,server

Binary file not shown.

View File

@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEGDCCAwCgAwIBAgIUN9zd5Z6FAMRqEkWPoS4D42402XowDQYJKoZIhvcNAQEL
BQAwgZ8xCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApRdWVlbnNsYW5kMREwDwYDVQQH
DAhCcmlzYmFuZTEUMBIGA1UECgwLd29sZlNTTCBJbmMxFDASBgNVBAsMC0VuZ2lu
ZWVyaW5nMRgwFgYDVQQDDA93d3cud29sZnNzbC5jb20xIjAgBgkqhkiG9w0BCQEW
E3N1cHBvcnRAd29sZnNzbC5jb20wHhcNMjExMDI2MTMzMzAzWhcNMjQwNzIyMTMz
MzAzWjCBnzELMAkGA1UEBhMCQVUxEzARBgNVBAgMClF1ZWVuc2xhbmQxETAPBgNV
BAcMCEJyaXNiYW5lMRQwEgYDVQQKDAt3b2xmU1NMIEluYzEUMBIGA1UECwwLRW5n
aW5lZXJpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEiMCAGCSqGSIb3DQEJ
ARYTc3VwcG9ydEB3b2xmc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBAMCVCOFXQfJxbbfSRUEnAWXGRa7yvCQwuJXOL07W9hyIvHyf+6hnf/5c
nFF194rKB+c1L4/hvXvAL3yrZKgX/Mpde7rgIeVyLm8uhtiVc9qsG1O5Xz/XGQ0l
T+FjY1GLC2Q/rUO4pRxcNLOuAKBjxfZ/C1loeHOmjBipAm2vwxkBLrgQ48bMQLRp
o0YzaYduxLsXpvPo3a1zvHsvIbX9ZlEMvVSz4W1fHLwjc9EJA4kU0hC5ZMMq0KGW
Srzh1Bpbx6DAwWN4D0Q3MDKWgDIjlaF3uhPSl3PiXSXJag3DOWCktLBpQkIJ6dgI
vDMgs1gip6rrxOHmYYPF0pbf2dBPrdcCAwEAAaNKMEgwFAYJYIZIAYb4QgEBAQH/
BAQDAgZAMDAGCWCGSAGG+EIBDQQjFiFUZXN0aW5nIE5ldHNjYXBlIENlcnRpZmlj
YXRlIFR5cGUwDQYJKoZIhvcNAQELBQADggEBADvSHYLUd9cwFnqktCMOVggvPEvi
QwiCn0Pfw5niwidHbdHeVqfcoA8hYYoLNFwSwiRpnlxoA6KBPkzmkat5s9ea4ATR
gTMdhicrTpldWldJtrm0ReR8vtxlEg8Ts8ZJrKOoyJ5MP5qPbZj+a0vyS2Qb8rnL
obou6pz2qbMhBrOYVP6gWnhZRHJmLplPNo/WEZMBXDgL62dca6oUiXWBpAO8j2PI
VShex+u2l6DNy/KvDlaUYvW88A5FwI1ThuoeRU76Y8QhB6zaC0wQttVVguzOcf3G
3c9jNLtz1Ydp3sLDmSJfHnI7dO4rRWd8go98GsGLt8O2ZhWZ1D8dkzRZfv0=
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIE/TCCA+WgAwIBAgIUNPy5nImvNHMmLnekTFdBX87LWIcwDQYJKoZIhvcNAQEL
BQAwgZUxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdC
b3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEY
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMSAwHgYJKoZIhvcNAQkBFhFpbmZvQHdv
bGZzc3NsLmNvbTAeFw0yMTEwMjYxMzMzMDNaFw0yNDA3MjIxMzMzMDNaMIGVMQsw
CQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjER
MA8GA1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMM
D3d3dy53b2xmc3NsLmNvbTEgMB4GCSqGSIb3DQEJARYRaW5mb0B3b2xmc3NzbC5j
b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgf
SvJNdRDxtjWf38p9A5jTrN4DZu4q8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLq
ypC7aVIQAy+o85XF8YtiVhvvZ2+kEEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04
KRysx+3yfJWwlYJ9SVw4zXcl772AdVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC
19pAb9gh3HMbQi1TnP4a/H2rejY/mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VW
L6Mm0rdvsVoX1ziZCP6TWG/+wxNJCBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u9
7TZ5AgMBAAGjggFBMIIBPTAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUw
gdUGA1UdIwSBzTCByoAUJ45nEXTDJh0/7TNjs6TYHTDl6NWhgZukgZgwgZUxCzAJ
BgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREw
DwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwP
d3d3LndvbGZzc2wuY29tMSAwHgYJKoZIhvcNAQkBFhFpbmZvQHdvbGZzc3NsLmNv
bYIUNPy5nImvNHMmLnekTFdBX87LWIcwDAYDVR0TBAUwAwEB/zA2BgNVHR4BAf8E
LDAqoSgwJqQkMCIxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMA0G
CSqGSIb3DQEBCwUAA4IBAQCOsVInwF8jwAT/YzOZppX9UfOVKxRkJSaXWLKyskDY
NKsq2nY1bxn4QwZL7G/Blq0dBCpaW7wkpTrkeSOrYCtl+nkdNA+I40ek9W+M889L
WoDTh5gbm1pN4w/Y9Sn5eJG0jzg7eUgQ8dCbAqoEP/6R33TccMJIxG3eT9VeZSag
bra51uVAfZuU5ec1EHomC2QdFAW6ekf7Bk7mejkhkA4EtM0784Srjk7azYR3kc0n
ow2o9qwtA6lQnGmrZO0AArXosFW/MuZzBEIJxRCkATF/ZxMpAVvYb9h26GguiDu2
B+LV1qS/UnQfqE78jojSA5JZ/wIHiDHwBiTaBTBx5Ub4
-----END CERTIFICATE-----

Binary file not shown.

View File

@@ -0,0 +1,29 @@
-----BEGIN CERTIFICATE-----
MIIE6DCCA9CgAwIBAgIUUjnwSvtRITn8DePk5BV3FpOSt/EwDQYJKoZIhvcNAQEL
BQAwgZUxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdC
b3plbWFuMREwDwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEY
MBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMSAwHgYJKoZIhvcNAQkBFhFpbmZvQHdv
bGZzc3NsLmNvbTAeFw0yMTEwMjYxMzMzMDNaFw0yNDA3MjIxMzMzMDNaMIGVMQsw
CQYDVQQGEwJVUzEQMA4GA1UECAwHTW9udGFuYTEQMA4GA1UEBwwHQm96ZW1hbjER
MA8GA1UECgwIU2F3dG9vdGgxEzARBgNVBAsMCkNvbnN1bHRpbmcxGDAWBgNVBAMM
D3d3dy53b2xmc3NsLmNvbTEgMB4GCSqGSIb3DQEJARYRaW5mb0B3b2xmc3NzbC5j
b20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/DMotFLIehEJbzTgf
SvJNdRDxtjWf38p9A5jTrN4DZu4q8diwfW4HVAsQmCFNgMsSIOfMT95FfclydzLq
ypC7aVIQAy+o85XF8YtiVhvvZ2+kEEGVrQqb46XAsNJwdlAwW6joCCx87aeieo04
KRysx+3yfJWwlYJ9SVw4zXcl772AdVOUPD3KY1ufFbXTHRMvGdE823Y6zLh9yeXC
19pAb9gh3HMbQi1TnP4a/H2rejY/mN6EfAVnzmoUOIep8Yy1aMtof3EgK/WgY/VW
L6Mm0rdvsVoX1ziZCP6TWG/+wxNJCBYLp01nAFIxZyNOmO1RRR25BNkL7Ngos0u9
7TZ5AgMBAAGjggEsMIIBKDAdBgNVHQ4EFgQUJ45nEXTDJh0/7TNjs6TYHTDl6NUw
gdUGA1UdIwSBzTCByoAUJ45nEXTDJh0/7TNjs6TYHTDl6NWhgZukgZgwgZUxCzAJ
BgNVBAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMREw
DwYDVQQKDAhTYXd0b290aDETMBEGA1UECwwKQ29uc3VsdGluZzEYMBYGA1UEAwwP
d3d3LndvbGZzc2wuY29tMSAwHgYJKoZIhvcNAQkBFhFpbmZvQHdvbGZzc3NsLmNv
bYIUUjnwSvtRITn8DePk5BV3FpOSt/EwDAYDVR0TBAUwAwEB/zAhBgNVHR4BAf8E
FzAVoBMwEaQPMA0xCzAJBgNVBAYTAlVTMA0GCSqGSIb3DQEBCwUAA4IBAQCftSer
x/DD+8l32zkBpvuVQtRcEpQ6w7Cl1PD8TaiXe0W9eqKeBmxOgJ+a0kyKIcYSJU5R
K8enk17q1FFiqdgU0lEo3tdOdvfxFyLTbdCVz/Q0KRhhELU+9ZQRl0NOj3NSRR+/
QI0tHo9UvsojdlRUW2LTaVdHAz8yBp5dC73KM/7Y3bS4q8MDjVvXD+TiJdfbcbQo
1eBm5eEsmoYQoOqQAt8n9bmEAe6syFi/sBJU5PqBWuNlBVLlySxEzCA8vPXyvL95
3eStUcicaHWFA3dljObenJ8m9UWLlZTf+XPA9BrUwXHSG3945Rb8/gAdPUgsIT67
UQJbTMyGRwalE97X
-----END CERTIFICATE-----

View File

@@ -5,20 +5,22 @@ TMP="/tmp/`basename $0`"
KEY=certs/server-key.der
gen_cert() {
openssl req -x509 -keyform DER -key $KEY \
-days 1000 -new -outform DER -out $OUT -config $CONFIG \
-days 1000 -new -outform DER -out $OUT.der -config $CONFIG \
>$TMP 2>&1
if [ "$?" = "0" -a -f $OUT ]; then
if [ "$?" = "0" -a -f $OUT.der ]; then
echo "Created: $OUT"
else
cat $TMP
echo "Failed: $OUT"
fi
openssl x509 -in $OUT.der -inform DER -outform PEM > $OUT.pem
rm $TMP
}
OUT=certs/test/cert-ext-nc.der
OUT=certs/test/cert-ext-nc
KEYFILE=certs/test/cert-ext-nc-key.der
CONFIG=certs/test/cert-ext-nc.cfg
tee >$CONFIG <<EOF
@@ -47,7 +49,7 @@ EOF
gen_cert
OUT=certs/test/cert-ext-mnc.der
OUT=certs/test/cert-ext-mnc
KEYFILE=certs/test/cert-ext-mnc-key.der
CONFIG=certs/test/cert-ext-mnc.cfg
tee >$CONFIG <<EOF
@@ -76,7 +78,7 @@ EOF
gen_cert
OUT=certs/test/cert-ext-ncdns.der
OUT=certs/test/cert-ext-ncdns
KEYFILE=certs/test/cert-ext-nc-key.der
CONFIG=certs/test/cert-ext-ncdns.cfg
tee >$CONFIG <<EOF
@@ -104,7 +106,7 @@ nsComment = "Testing name constraints"
EOF
gen_cert
OUT=certs/test/cert-ext-ncmixed.der
OUT=certs/test/cert-ext-ncmixed
KEYFILE=certs/test/cert-ext-ncmixed-key.der
CONFIG=certs/test/cert-ext-ncmixed.cfg
tee >$CONFIG <<EOF
@@ -132,7 +134,7 @@ nsComment = "Testing name constraints"
EOF
gen_cert
OUT=certs/test/cert-ext-ia.der
OUT=certs/test/cert-ext-ia
KEYFILE=certs/test/cert-ext-ia-key.der
CONFIG=certs/test/cert-ext-ia.cfg
tee >$CONFIG <<EOF
@@ -148,7 +150,7 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@wolfsssl.com
emailAddress = support@wolfssl.com
[ v3_ca ]
inhibitAnyPolicy = critical,1
@@ -157,7 +159,7 @@ nsComment = "Testing inhibit any"
EOF
gen_cert
OUT=certs/test/cert-ext-nct.der
OUT=certs/test/cert-ext-nct
KEYFILE=certs/test/cert-ext-mct-key.der
CONFIG=certs/test/cert-ext-nct.cfg
tee >$CONFIG <<EOF
@@ -173,7 +175,7 @@ L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@wolfsssl.com
emailAddress = support@wolfssl.com
[ v3_ca ]
nsCertType = critical,server
@@ -183,7 +185,7 @@ EOF
gen_cert
KEY=certs/ca-key.der
OUT=certs/test/cert-ext-ndir.der
OUT=certs/test/cert-ext-ndir
KEYFILE=certs/ca-key.der
CONFIG=certs/test/cert-ext-ndir.cfg
tee >$CONFIG <<EOF
@@ -213,7 +215,7 @@ countryName = US
EOF
gen_cert
OUT=certs/test/cert-ext-ndir-exc.der
OUT=certs/test/cert-ext-ndir-exc
KEYFILE=certs/ca-key.der
CONFIG=certs/test/cert-ext-ndir-exc.cfg
tee >$CONFIG <<EOF
@@ -244,7 +246,7 @@ stateOrProvinceName = California
EOF
gen_cert
OUT=certs/test/cert-ext-joi.der
OUT=certs/test/cert-ext-joi
KEYFILE=certs/ca-key.der
CONFIG=certs/test/cert-ext-joi.cfg
tee >$CONFIG <<EOF
@@ -272,4 +274,34 @@ basicConstraints=CA:TRUE
EOF
gen_cert
OUT=certs/test/cert-ext-multiple
KEYFILE=certs/test/cert-ext-mct-key.der
CONFIG=certs/test/cert-ext-multiple.cfg
tee >$CONFIG <<EOF
[ req ]
distinguished_name = req_distinguished_name
prompt = no
x509_extensions = v3_ca
[ req_distinguished_name ]
C = AU
ST = Queensland
L = Brisbane
O = wolfSSL Inc
OU = Engineering
CN = www.wolfssl.com
emailAddress = support@wolfssl.com
postalCode = 56-131
street = Main St
[ v3_ca ]
nsCertType = server
crlDistributionPoints = URI:http://www.wolfssl.com/crl.pem
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
EOF
gen_cert

View File

@@ -5,22 +5,31 @@
EXTRA_DIST += \
certs/test/cert-ext-ia.cfg \
certs/test/cert-ext-ia.der \
certs/test/cert-ext-ia.pem \
certs/test/cert-ext-nc.cfg \
certs/test/cert-ext-nc.der \
certs/test/cert-ext-nc.pem \
certs/test/cert-ext-ncdns.der \
certs/test/cert-ext-ncmixed.der \
certs/test/cert-ext-mnc.der \
certs/test/cert-ext-nct.cfg \
certs/test/cert-ext-nct.der \
certs/test/cert-ext-nct.pem \
certs/test/cert-ext-ndir.cfg \
certs/test/cert-ext-ndir.der \
certs/test/cert-ext-ndir.pem \
certs/test/cert-ext-ns.der \
certs/test/cert-ext-ndir-exc.cfg \
certs/test/cert-ext-ndir-exc.der \
certs/test/cert-ext-ndir-exc.pem \
certs/test/gen-ext-certs.sh \
certs/test/server-duplicate-policy.pem \
certs/test/cert-ext-joi.der \
certs/test/cert-ext-joi.cfg
certs/test/cert-ext-joi.pem \
certs/test/cert-ext-joi.cfg \
certs/test/cert-ext-multiple.cfg \
certs/test/cert-ext-multiple.der \
certs/test/cert-ext-multiple.pem
# The certs/server-cert with the last byte (signature byte) changed
EXTRA_DIST += \

View File

@@ -303,10 +303,10 @@ function(generate_lib_src_list LIB_SOURCES)
if(BUILD_FIPS_V1)
# fips first file
list(APPEND LIB_SOURCES ctaocrypt/src/wolfcrypt_first.c)
list(APPEND LIB_SOURCES
ctaocrypt/src/hmac.c
ctaocrypt/src/random.c
ctaocrypt/src/random.c
ctaocrypt/src/sha256.c)
if(BUILD_RSA)
@@ -421,6 +421,22 @@ function(generate_lib_src_list LIB_SOURCES)
list(APPEND LIB_SOURCES wolfcrypt/src/wolfcrypt_last.c)
endif()
if(BUILD_FIPS_V5)
list(APPEND LIB_SOURCES wolfcrypt/src/wolfcrypt_first.c)
list(APPEND LIB_SOURCES
wolfcrypt/src/hmac.c
wolfcrypt/src/random.c
wolfcrypt/src/sha256.c)
list(APPEND LIB_SOURCES
wolfcrypt/src/kdf.c)
if(BUILD_RSA)
list(APPEND LIB_SOURCES wolfcrypt/src/rsa.c)
endif()
endif()
if(BUILD_FIPS_RAND)
list(APPEND LIB_SOURCES
wolfcrypt/src/wolfcrypt_first.c
@@ -451,10 +467,14 @@ function(generate_lib_src_list LIB_SOURCES)
endif()
list(APPEND LIB_SOURCES
wolfcrypt/src/hash.c
wolfcrypt/src/hash.c
wolfcrypt/src/cpuid.c)
if(NOT BUILD_FIPS_RAND)
if(NOT BUILD_FIPS_V5)
list(APPEND LIB_SOURCES wolfcrypt/src/kdf.c)
endif()
if(NOT BUILD_FIPS_V2 AND BUILD_RNG)
list(APPEND LIB_SOURCES wolfcrypt/src/random.c)
endif()

View File

@@ -7,7 +7,7 @@
#
AC_COPYRIGHT([Copyright (C) 2006-2020 wolfSSL Inc.])
AC_PREREQ([2.69])
AC_INIT([wolfssl],[4.8.1],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[https://www.wolfssl.com])
AC_INIT([wolfssl],[5.0.1],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[https://www.wolfssl.com])
AC_CONFIG_AUX_DIR([build-aux])
# The following sets CFLAGS to empty if unset on command line. We do not
@@ -38,7 +38,7 @@ LT_INIT([disable-static win32-dll])
AC_ARG_VAR(EXTRA_CFLAGS, [Extra CFLAGS to add to autoconf-computed arg list. Can also supply directly to make.])
#shared library versioning
WOLFSSL_LIBRARY_VERSION=29:1:5
WOLFSSL_LIBRARY_VERSION=30:0:0
# | | |
# +------+ | +---+
# | | |
@@ -248,7 +248,13 @@ AS_CASE([$ENABLED_FIPS],
HAVE_FIPS_VERSION=2
ENABLED_FIPS="yes"
],
[v5|v5-RC9|v5-REL],[
[v5|v5-RC10],[
FIPS_VERSION="v5-RC10"
HAVE_FIPS_VERSION=5
HAVE_FIPS_VERSION_MINOR=2
ENABLED_FIPS="yes"
],
[v5-RC9|v5-REL],[
FIPS_VERSION="v5-RC9"
HAVE_FIPS_VERSION=5
HAVE_FIPS_VERSION_MINOR=1
@@ -313,20 +319,30 @@ AC_ARG_ENABLE([reproducible-build],
[ ENABLED_REPRODUCIBLE_BUILD=$REPRODUCIBLE_BUILD_DEFAULT ]
)
# Test ar for the "U" or "D" options. Should be checked before the libtool macros.
xxx_ar_flags=$(ar --help 2>&1)
xxx_ranlib_flags=$(ranlib --help 2>&1)
if test "$ENABLED_REPRODUCIBLE_BUILD" = "yes"
then
# Test ar for the "D" option. Should be checked before the libtool macros.
if test -z "$AR"; then
AR=ar
fi
xxx_ar_flags=$(${AR} --help 2>&1)
if test -z "$RANLIB"; then
RANLIB=ranlib
fi
xxx_ranlib_flags=$(${RANLIB} --help 2>&1)
AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD"
AS_CASE([$xxx_ar_flags],[*'use zero for timestamps and uids/gids'*],[AR_FLAGS="Dcr"])
AS_CASE([$xxx_ranlib_flags],[*'Use zero for symbol map timestamp'*],[RANLIB="ranlib -D"])
else
AS_CASE([$xxx_ar_flags],[*'use actual timestamps and uids/gids'*],[AR_FLAGS="Ucru"])
AS_CASE([$xxx_ranlib_flags],[*'Use actual symbol map timestamp'*],[RANLIB="ranlib -U"])
AS_CASE([$xxx_ranlib_flags],[*'Use zero for symbol map timestamp'*],[RANLIB="${RANLIB} -D"])
fi
AC_ARG_ENABLE([benchmark],
[AS_HELP_STRING([--enable-benchmark],[Build benchmark when building crypttests (default: enabled)])],
[ENABLED_BENCHMARK=$enableval],
[ENABLED_BENCHMARK=yes]
)
# Linux Kernel Module
AC_ARG_ENABLE([linuxkm],
[AS_HELP_STRING([--enable-linuxkm],[Enable Linux Kernel Module (default: disabled)])],
@@ -374,6 +390,7 @@ if test "x$ENABLED_LINUXKM" = "xyes"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM"
ENABLED_NO_LIBRARY=yes
ENABLED_BENCHMARK=no
output_objdir="$(realpath "$output_objdir")/linuxkm"
if test "$KERNEL_ROOT" = ""; then
@@ -435,11 +452,6 @@ AC_ARG_ENABLE([sp-math],
)
if test "$ENABLED_SP_MATH" != "no" && test "$ENABLED_SP_MATH_ALL" != "no"
then
AC_MSG_ERROR([cannot enable sp-math and sp-math-all simultaneously.])
fi
AC_ARG_ENABLE([sp-asm],
[AS_HELP_STRING([--enable-sp-asm],[Enable Single Precision assembly implementation (default: disabled)])],
[ ENABLED_SP_ASM=$enableval ],
@@ -608,7 +620,7 @@ then
# Enable AES Decrypt, AES ECB
AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB"
# Enable Alt Names, DER Load, Keep Certs, CRL IO with Timeout
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_NAMES -DWOLFSSL_DER_LOAD -DKEEP_OUR_CERT -DKEEP_PEER_CERT"
@@ -1451,6 +1463,9 @@ AC_ARG_WITH([se050],
# Requires AES direct
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
# Does not support SHA2-512 224/256
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([yes])
@@ -2176,7 +2191,7 @@ AC_ARG_ENABLE([keygen],
if test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_OPENRESTY" = "yes"
then
ENABLED_KEYGEN=yes
fi
fi
# CERT GENERATION
@@ -3329,7 +3344,7 @@ AC_ARG_ENABLE([xts],
AS_IF([test "x$ENABLED_XTS" = "xyes"],
[AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_XTS -DWOLFSSL_AES_DIRECT"])
# Web Server Build
AC_ARG_ENABLE([webserver],
[AS_HELP_STRING([--enable-webserver],[Enable Web Server (default: disabled)])],
@@ -3435,6 +3450,11 @@ AS_CASE([$FIPS_VERSION],
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VALIDATE_FFC_IMPORT -DHAVE_FFDHE_Q"
AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192"
DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=8192
if test $HAVE_FIPS_VERSION_MINOR -ge 2; then
if test "x$ENABLED_AESOFB" = "xno"; then
ENABLED_AESOFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB"
fi
fi
],
["v3"],[ # FIPS 140-2 Ready
AM_CFLAGS="$AM_CFLAGS -DHAVE_FIPS -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR -DWOLFSSL_KEY_GEN -DWOLFSSL_SHA224 -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB -DHAVE_ECC_CDH -DWC_RSA_NO_PADDING -DWOLFSSL_VALIDATE_FFC_IMPORT -DHAVE_FFDHE_Q -DWOLFSSL_ECDSA_SET_K"
@@ -6795,6 +6815,7 @@ then
AM_CFLAGS="-DOPENSSL_EXTRA -DWOLFSSL_ALWAYS_VERIFY_CB $AM_CFLAGS"
AM_CFLAGS="-DWOLFSSL_VERIFY_CB_ALL_CERTS -DWOLFSSL_EXTRA_ALERTS $AM_CFLAGS"
AM_CFLAGS="-DHAVE_EXT_CACHE -DWOLFSSL_FORCE_CACHE_ON_TICKET $AM_CFLAGS"
AM_CFLAGS="-DWOLFSSL_AKID_NAME $AM_CFLAGS"
fi
if test "$ENABLED_OPENSSLEXTRA" = "x509small"
@@ -7265,6 +7286,7 @@ AM_CONDITIONAL([BUILD_HASHFLAGS],[test "x$ENABLED_HASHFLAGS" = "xyes"])
AM_CONDITIONAL([BUILD_CAAM],[test "x$ENABLED_CAAM" = "xyes" || test "x$ENABLED_CAAM" = "xqnx"])
AM_CONDITIONAL([BUILD_LINUXKM],[test "$ENABLED_LINUXKM" = "yes"])
AM_CONDITIONAL([BUILD_NO_LIBRARY],[test "$ENABLED_NO_LIBRARY" = "yes"])
AM_CONDITIONAL([BUILD_BENCHMARK],[test "$ENABLED_BENCHMARK" = "yes"])
AM_CONDITIONAL([BUILD_RC2],[test "x$ENABLED_RC2" = "xyes"])
AM_CONDITIONAL([BUILD_QNXCAAM],[test "x$ENABLED_CAAM" = "xqnx"])
AM_CONDITIONAL([BUILD_IOTSAFE],[test "x$ENABLED_IOTSAFE" = "xyes"])

0
ctaocrypt/ctaocrypt.sln Executable file → Normal file
View File

0
ctaocrypt/ctaocrypt.vcproj Executable file → Normal file
View File

View File

@@ -158,7 +158,7 @@ WOLFSSL_API int wc_MakeCertReq(Cert*, byte* derBuffer, word32 derSz,
word32 certSz;
certSz = wc_SignCert(myCert.bodySz, myCert.sigType,derCert,FOURK_BUF,
&key, NULL,
&rng);
&rng);
\endcode
\sa wc_InitCert
@@ -1078,10 +1078,10 @@ WOLFSSL_API int wc_PubKeyPemToDer(const unsigned char*, int,
\code
char * file = “./certs/client-cert.pem”;
int derSz;
byte * der = (byte*)XMALLOC(EIGHTK_BUF, NULL, DYNAMIC_TYPE_CERT);
byte* der = (byte*)XMALLOC((8*1024), NULL, DYNAMIC_TYPE_CERT);
derSz = wc_PemCertToDer(file, der, EIGHTK_BUF);
if(derSz <= 0) {
derSz = wc_PemCertToDer(file, der, (8*1024));
if (derSz <= 0) {
//PemCertToDer error
}
\endcode

View File

@@ -178,7 +178,7 @@ WOLFSSL_API int wc_Des_EcbEncrypt(Des* des, byte* out,
\param sz length of the plaintext to encrypt
_Example_
/code
\code
Des3 enc; // Des3 structure used for encryption
// initialize enc with wc_Des3_SetKey, use mode DES_ENCRYPTION
@@ -188,7 +188,7 @@ WOLFSSL_API int wc_Des_EcbEncrypt(Des* des, byte* out,
if ( wc_Des3_EcbEncrypt(&enc,cipher, plain, sizeof(plain)) != 0) {
// error encrypting message
}
/endcode
\endcode
\sa wc_Des3_SetKey
*/

View File

@@ -240,15 +240,15 @@ WOLFSSL_API int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g
\return BUFFER_E Returned if there is inadequate space in p or g to
store the parsed parameters
\parma input pointer to a buffer containing a DER formatted
\param input pointer to a buffer containing a DER formatted
Diffie-Hellman certificate to parse
\parma inSz size of the input buffer
\parma p pointer to a buffer in which to store the parsed prime
\parma pInOutSz pointer to a word32 object containing the available
\param inSz size of the input buffer
\param p pointer to a buffer in which to store the parsed prime
\param pInOutSz pointer to a word32 object containing the available
size in the p buffer. Will be overwritten with the number of bytes
written to the buffer after completing the function call
\parma g pointer to a buffer in which to store the parsed base
\parma gInOutSz pointer to a word32 object containing the available size
\param g pointer to a buffer in which to store the parsed base
\param gInOutSz pointer to a word32 object containing the available size
in the g buffer. Will be overwritten with the number of bytes written to
the buffer after completing the function call

View File

@@ -505,7 +505,7 @@ int wc_ecc_verify_hash(const byte* sig, word32 siglen, const byte* hash,
\brief Verify an ECC signature. Result is written to stat.
1 is valid, 0 is invalid.
Note: Do not use the return value to test for valid. Only use stat.
Note: Do not use the return value to test for valid. Only use stat.
\return MP_OKAY If successful (even if the signature is not valid)
\return ECC_BAD_ARG_E Returns if arguments are null or if
@@ -1107,7 +1107,7 @@ int wc_ecc_import_x963(const byte* in, word32 inLen, ecc_key* key);
through the HAVE_COMP_KEY option.
\return 0 Returned on successfully importing the ecc_key
NOT_COMPILED_IN Returned if the HAVE_COMP_KEY was not enabled at compile
NOT_COMPILED_IN Returned if the HAVE_COMP_KEY was not enabled at compile
time, but the key is stored in compressed format
\return ECC_BAD_ARG_E Returned if in or key evaluate to NULL, or the
inLen is even (according to the x9.63 standard, the key must be odd)

View File

@@ -205,7 +205,7 @@ WOLFSSL_API int wolfSSL_EVP_EncryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
EVP_aes_128_ cbc(), e, key, iv, 1));
printf("cipher init ex success ret = %d\n", wolfSSL_EVP_DecryptInit_ex(ctx,
EVP_aes_128_c bc(), e, key, iv, 1));
// free resources
// free resources
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_new

View File

@@ -225,8 +225,8 @@ WOLFSSL_API int wc_iotsafe_ecc_sign_hash(byte *in, word32 inlen, byte *out, word
\ingroup IoTSafe
\brief Verify an ECC signature against a pre-computed 256-bit HASH, using a public key previously stored, or pre-provisioned,
in the IoT-Safe applet. Result is written to res. 1 is valid, 0 is invalid.
Note: Do not use the return value to test for valid. Only use res.
Note: Do not use the return value to test for valid. Only use res.
\return 0 upon success (even if the signature is not valid)
\return < 0 in case of failure.
@@ -235,7 +235,7 @@ Note: Do not use the return value to test for valid. Only use res.
\param hashlen The length of the hash (octets)
\param res Result of signature, 1==valid, 0==invalid
\param key_id The id of the slot where the public ECC key is stored in the IoT-Safe applet
\sa wc_iotsafe_ecc_sign_hash
\sa wc_iotsafe_ecc_gen_k

View File

@@ -123,7 +123,7 @@ WOLFSSL_API int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng);
_Example_
\code
RsaKey enc;
wc_RsaInitKey(&enc, NULL); // not using heap hint. No custom memory
wc_InitRsaKey(&enc, NULL); // not using heap hint. No custom memory
... set key, do encryption
wc_FreeRsaKey(&enc);
@@ -422,10 +422,8 @@ WOLFSSL_API int wc_RsaPSS_Sign(const byte* in, word32 inLen, byte* out,
\ingroup RSA
\brief Decrypt input signature to verify that the message was signed by key.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING is enabled.
\return Success Length of text on no error.
\return MEMORY_E memory exception.
@@ -476,11 +474,11 @@ WOLFSSL_API int wc_RsaPSS_Verify(byte* in, word32 inLen, byte* out,
/*!
\ingroup RSA
\brief Decrypt input signature to verify that the message was signed by RSA key.
\brief Decrypt input signature to verify that the message was signed by RSA
key.
The output uses the same byte array as the input.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
is enabled.
\return >0 Length of text.
\return <0 An error occurred.
@@ -538,11 +536,9 @@ WOLFSSL_API int wc_RsaPSS_VerifyInline(byte* in, word32 inLen, byte** out,
\brief Verify the message signed with RSA-PSS.
Salt length is equal to hash length.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING is enabled.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
\return the length of the PSS data on success and negative indicates failure.
\return the length of the PSS data on success and negative indicates failure.
\return MEMORY_E memory exception.
\param in The byte array to be decrypted.
@@ -572,7 +568,7 @@ WOLFSSL_API int wc_RsaPSS_VerifyInline(byte* in, word32 inLen, byte** out,
digestSz = wc_HashGetDigestSize(WC_HASH_TYPE_SHA256);
ret = wc_Hash(WC_HASH_TYPE_SHA256, message, sz, digest, digestSz);
} else return -1;
if (ret == 0) {
ret = wc_RsaPSS_Sign(digest, digestSz, pSignature, pSignatureSz,
WC_HASH_TYPE_SHA256, WC_MGF1SHA256, &key, &rng);
@@ -609,11 +605,9 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheck(byte* in, word32 inLen,
\ingroup RSA
\brief Verify the message signed with RSA-PSS.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING is enabled.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
\return the length of the PSS data on success and negative indicates failure.
\return the length of the PSS data on success and negative indicates failure.
\return MEMORY_E memory exception.
\param in The byte array to be decrypted.
@@ -625,8 +619,8 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheck(byte* in, word32 inLen,
\param hash Hash algorithm.
\param mgf Mask generation function.
\param saltLen Length of salt used. RSA_PSS_SALT_LEN_DEFAULT (-1) indicates salt
length is the same as the hash length. RSA_PSS_SALT_LEN_DISCOVER
indicates salt length is determined from the data.
length is the same as the hash length. RSA_PSS_SALT_LEN_DISCOVER
indicates salt length is determined from the data.
\param key Public RSA key.
@@ -647,7 +641,7 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheck(byte* in, word32 inLen,
digestSz = wc_HashGetDigestSize(WC_HASH_TYPE_SHA256);
ret = wc_Hash(WC_HASH_TYPE_SHA256, message, sz, digest, digestSz);
} else return -1;
if (ret == 0) {
ret = wc_RsaPSS_Sign(digest, digestSz, pSignature, pSignatureSz,
WC_HASH_TYPE_SHA256, WC_MGF1SHA256, &key, &rng);
@@ -684,11 +678,10 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheck_ex(byte* in, word32 inLen,
\ingroup RSA
\brief Verify the message signed with RSA-PSS.
The input buffer is reused for the output buffer.
The input buffer is reused for the output buffer.
Salt length is equal to hash length.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING is enabled.
\return the length of the PSS data on success and negative indicates failure.
@@ -718,7 +711,7 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheck_ex(byte* in, word32 inLen,
digestSz = wc_HashGetDigestSize(WC_HASH_TYPE_SHA256);
ret = wc_Hash(WC_HASH_TYPE_SHA256, message, sz, digest, digestSz);
} else return -1;
if (ret == 0) {
ret = wc_RsaPSS_Sign(digest, digestSz, pSignature, pSignatureSz,
WC_HASH_TYPE_SHA256, WC_MGF1SHA256, &key, &rng);
@@ -753,10 +746,8 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheckInline(byte* in, word32 inLen, byte** out,
\ingroup RSA
\brief Verify the message signed with RSA-PSS.
The input buffer is reused for the output buffer.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
The input buffer is reused for the output buffer.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING is enabled.
\return the length of the PSS data on success and negative indicates failure.
@@ -768,8 +759,8 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheckInline(byte* in, word32 inLen, byte** out,
\param hash The hash type to be in message
\param mgf Mask Generation Function Identifiers
\param saltLen Length of salt used. RSA_PSS_SALT_LEN_DEFAULT (-1) indicates salt
length is the same as the hash length. RSA_PSS_SALT_LEN_DISCOVER
indicates salt length is determined from the data.
length is the same as the hash length. RSA_PSS_SALT_LEN_DISCOVER
indicates salt length is determined from the data.
\param key The key to use for verification.
_Example_
@@ -789,7 +780,7 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheckInline(byte* in, word32 inLen, byte** out,
digestSz = wc_HashGetDigestSize(WC_HASH_TYPE_SHA256);
ret = wc_Hash(WC_HASH_TYPE_SHA256, message, sz, digest, digestSz);
} else return -1;
if (ret == 0) {
ret = wc_RsaPSS_Sign(digest, digestSz, pSignature, pSignatureSz,
WC_HASH_TYPE_SHA256, WC_MGF1SHA256, &key, &rng);
@@ -826,20 +817,18 @@ WOLFSSL_API int wc_RsaPSS_VerifyCheckInline_ex(byte* in, word32 inLen, byte** o
\brief Checks the PSS data to ensure that the signature matches.
Salt length is equal to hash length.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING
    is enabled.
The key has to be associated with RNG by wc_RsaSetRNG when WC_RSA_BLINDING is enabled.
\return BAD_PADDING_E when the PSS data is invalid, BAD_FUNC_ARG when
NULL is passed in to in or sig or inSz is not the same as the hash
algorithm length and 0 on success.
\return MEMORY_E memory exception.
\param in Hash of the data that is being verified.
\param inSz Length of hash.
\param sig Buffer holding PSS data.
\param sigSz Size of PSS data.
\param hashType Hash algorithm.
\param in Hash of the data that is being verified.
\param inSz Length of hash.
\param sig Buffer holding PSS data.
\param sigSz Size of PSS data.
\param hashType Hash algorithm.
_Example_
\code
@@ -1367,7 +1356,7 @@ WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
\code
RsaKey key;
wc_RsaInitKey(&key, NULL);
wc_InitRsaKey(&key, NULL);
// Use key
const int BUFFER_SIZE = 1024; // Some adequate size for the buffer
@@ -1379,7 +1368,7 @@ WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
\sa wc_RsaPublicKeyDerSize
\sa wc_RsaKeyToPublicDer_ex
\sa wc_RsaInitKey
\sa wc_InitRsaKey
*/
WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
@@ -1403,7 +1392,7 @@ WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
\code
RsaKey key;
wc_RsaInitKey(&key, NULL);
wc_InitRsaKey(&key, NULL);
// Use key
const int BUFFER_SIZE = 1024; // Some adequate size for the buffer
@@ -1415,7 +1404,7 @@ WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
\sa wc_RsaPublicKeyDerSize
\sa wc_RsaKeyToPublicDer
\sa wc_RsaInitKey
\sa wc_InitRsaKey
*/
WOLFSSL_API int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
int with_header);
@@ -1511,7 +1500,7 @@ WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng);
RsaKey key;
RsaNb nb;
wc_RsaInitKey(&key, NULL);
wc_InitRsaKey(&key, NULL);
// Enable non-blocking RSA mode - provide context
ret = wc_RsaSetNonBlock(key, &nb);
@@ -1558,7 +1547,7 @@ WOLFSSL_API int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb);
RsaKey key;
RsaNb nb;
wc_RsaInitKey(&key, NULL);
wc_InitRsaKey(&key, NULL);
wc_RsaSetNonBlock(key, &nb);
wc_RsaSetNonBlockTime(&key, 4000, 160); // Block Max = 4 ms, CPU = 160MHz

View File

@@ -97,7 +97,7 @@ WOLFSSL_API int wc_SrpSetUsername(Srp* srp, const byte* username, word32 size);
\return 0 Success
\return BAD_FUNC_ARG Returns if srp, N, g, or salt is null or if nSz < gSz.
\return SRP_CALL_ORDER_E Returns if wc_SrpSetParams is called before
wc_SrpSetUsername.
wc_SrpSetUsername.
\return <0 Error
\param srp the Srp structure.

View File

@@ -2513,8 +2513,8 @@ WOLFSSL_API
\code
WOLFSSL_CTX* ctx = 0;
...
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER |
SSL_VERIFY_FAIL_IF_NO_PEER_CERT, 0);
wolfSSL_CTX_set_verify(ctx, (WOLFSSL_VERIFY_PEER |
WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT), NULL);
\endcode
\sa wolfSSL_set_verify
@@ -4389,7 +4389,7 @@ WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_subject_name(WOLFSSL_X509*);
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
_Example_
/code
\code
WOLFSSL* ssl;
...
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
@@ -5226,7 +5226,7 @@ WOLFSSL_API int wolfSSL_CTX_use_psk_identity_hint(WOLFSSL_CTX*, const char*);
\return SSL_FAILURE returned if the WOLFSSL or Arrays structures are NULL.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\para hint a constant character pointer that holds the hint to be saved
\param hint a constant character pointer that holds the hint to be saved
in memory.
_Example_
@@ -12545,13 +12545,32 @@ WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_get_notBefore(WOLFSSL_X509*);
/*!
\ingroup IO
\brief This function is called on the client side and initiates an SSL/TLS handshake with a server. When this function is called, the underlying communication channel has already been set up.
wolfSSL_connect() works with both blocking and non-blocking I/O. When the underlying I/O is non-blocking, wolfSSL_connect() will return when the underlying I/O could not satisfy the needs of wolfSSL_connect to continue the handshake. In this case, a call to wolfSSL_get_error() will yield either SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. The calling process must then repeat the call to wolfSSL_connect() when the underlying I/O is ready and wolfSSL will pick up where it left off. When using a non-blocking socket, nothing needs to be done, but select() can be used to check for the required condition.
If the underlying I/O is blocking, wolfSSL_connect() will only return once the handshake has been finished or an error occurred.
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, unable to verify (-155). It 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: SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); before calling SSL_new(); Though it's not recommended.
\brief This function is called on the client side and initiates an SSL/TLS
handshake with a server. When this function is called, the underlying
communication channel has already been set up.
wolfSSL_connect() works with both blocking and non-blocking I/O. When the
underlying I/O is non-blocking, wolfSSL_connect() will return when the
underlying I/O could not satisfy the needs of wolfSSL_connect to continue
the handshake. In this case, a call to wolfSSL_get_error() will yield
either SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. The calling process
must then repeat the call to wolfSSL_connect() when the underlying I/O is
ready and wolfSSL will pick up where it left off. When using a non-blocking
socket, nothing needs to be done, but select() can be used to check for the
required condition.
If the underlying I/O is blocking, wolfSSL_connect() will only return once
the handshake has been finished or an error occurred.
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, unable to verify (-155). It 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:
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0); before calling SSL_new();
Though it's not recommended.
\return SSL_SUCCESS If successful.
\return SSL_FATAL_ERROR will be returned if an error occurred. To get a more detailed error code, call wolfSSL_get_error().
\return SSL_FATAL_ERROR will be returned if an error occurred. To get a
more detailed error code, call wolfSSL_get_error().
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().

View File

@@ -141,7 +141,7 @@ WOLFSSL_API int wc_Des_CbcEncryptWithKey(byte* out,
a Des structure.
\return <0 Returned on any error during encryption.
\parma out Final encrypted data
\param out Final encrypted data
\param in Data to be encrypted, must be padded to Des block size.
\param sz Size of input buffer.
\param key Pointer to the key to use for encryption.

View File

@@ -20,7 +20,7 @@
*/
/* For simpler wolfSSL TLS client examples, visit
* https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
* https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
*/
#ifdef HAVE_CONFIG_H
@@ -1708,7 +1708,7 @@ static void Usage(void)
printf("%s", msg[++msgid]); /* --wolfsentry-config */
#endif
printf("%s", msg[++msgid]); /* -7 */
printf("%s", msg[++msgid]); /* Examples repo link */
printf("%s", msg[++msgid]); /* Examples repo link */
#ifdef HAVE_LIBOQS
printf("%s", msg[++msgid]); /* --oqs */
printf("%s", msg[++msgid]); /* --oqs options */
@@ -2987,7 +2987,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
if (useCertFolder) {
WOLFSSL_X509_STORE *store;
WOLFSSL_X509_LOOKUP *lookup;
store = wolfSSL_CTX_get_cert_store(ctx);
if (store == NULL) {
wolfSSL_CTX_free(ctx); ctx = NULL;
@@ -3062,7 +3062,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_PEER, myVerify);
}
else if (!usePsk && !useAnon && doPeerCheck == 0) {
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, 0);
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
}
else if (!usePsk && !useAnon && myVerifyAction == VERIFY_OVERRIDE_DATE_ERR) {
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_PEER, myVerify);
@@ -3184,14 +3184,14 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
useLibOqs, oqsAlg, exitWithRet, version,
onlyKeyShare);
wolfSSL_CTX_free(ctx); ctx = NULL;
if (!exitWithRet)
if (((func_args*)args)->return_code != EXIT_SUCCESS && !exitWithRet)
XEXIT_T(EXIT_SUCCESS);
else
goto exit;
}
#if defined(WOLFSSL_MDK_ARM)
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, 0);
wolfSSL_CTX_set_verify(ctx, WOLFSSL_VERIFY_NONE, NULL);
#endif
#if defined(OPENSSL_EXTRA)
@@ -3710,6 +3710,12 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
}
else {
do {
#ifdef WOLFSSL_ASYNC_CRYPT
if (err == WC_PENDING_E) {
ret = wolfSSL_AsyncPoll(ssl, WOLF_POLL_FLAG_CHECK_HW);
if (ret < 0) break;
}
#endif
if (err == APP_DATA_READY) {
if (wolfSSL_read(ssl, reply,
sizeof(reply)-1) < 0) {
@@ -3727,20 +3733,17 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
} while (ret != WOLFSSL_SUCCESS &&
(err == WOLFSSL_ERROR_WANT_READ ||
err == WOLFSSL_ERROR_WANT_WRITE ||
err == APP_DATA_READY));
err == APP_DATA_READY ||
err == WC_PENDING_E));
}
if (ret != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
printf("wolfSSL_Rehandshake error %d, %s\n", err,
wolfSSL_ERR_error_string(err, buffer));
wolfSSL_free(ssl); ssl = NULL;
wolfSSL_CTX_free(ctx); ctx = NULL;
err_sys("non-blocking wolfSSL_Rehandshake failed");
if (ret == WOLFSSL_SUCCESS) {
printf("NON-BLOCKING RENEGOTIATION SUCCESSFUL\n");
err = 0;
}
printf("NON-BLOCKING RENEGOTIATION SUCCESSFUL\n");
}
else {
if (ret != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
printf("wolfSSL_Rehandshake error %d, %s\n", err,
wolfSSL_ERR_error_string(err, buffer));
wolfSSL_free(ssl); ssl = NULL;

0
examples/client/client.sln Executable file → Normal file
View File

0
examples/client/client.vcproj Executable file → Normal file
View File

View File

@@ -70,7 +70,7 @@ extern "C" {
/* Optional Feature Disables */
#define NO_SIG_WRAPPER
//#define NO_ECC_KEY_EXPORT
//#define NO_ECC_KEY_EXPORT
//#define NO_ECC_DHE
//#define NO_ECC_SIGN
//#define NO_ECC_VERIFY

View File

@@ -19,10 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* STM32 Cube Sample Configuration File
/* STM32 Cube Sample Configuration File
* Generated automatically using `default_conf.ftl` template
*
* Included automatically when USE_HAL_DRIVER is defined
* Included automatically when USE_HAL_DRIVER is defined
* (and not WOLFSSL_USER_SETTINGS or HAVE_CONF_H).
*/
@@ -476,12 +476,12 @@
/* Sha3 */
#undef WOLFSSL_SHA3
#if defined(WOLF_CONF_SHA3) && WOLF_CONF_SHA3 == 1
#define WOLFSSL_SHA3
#define WOLFSSL_SHA3
#endif
/* MD5 */
#if defined(WOLF_CONF_MD5) && WOLF_CONF_MD5 == 1
/* enabled */
/* enabled */
#else
#define NO_MD5
#endif
@@ -504,8 +504,8 @@
#if 0
#define USE_WOLFSSL_MEMORY
#define WOLFSSL_TRACK_MEMORY
#define WOLFSSL_DEBUG_MEMORY
#define WOLFSSL_DEBUG_MEMORY_PRINT
#define WOLFSSL_DEBUG_MEMORY
#define WOLFSSL_DEBUG_MEMORY_PRINT
#endif
#else
//#define NO_WOLFSSL_MEMORY

View File

@@ -52,8 +52,8 @@ extern "C" {
/* reduce stack use. For variables over 100 bytes allocate from heap */
#define WOLFSSL_SMALL_STACK
/* disable the built-in socket support and use the IO callbacks.
* Set with wolfSSL_CTX_SetIORecv/wolfSSL_CTX_SetIOSend
/* disable the built-in socket support and use the IO callbacks.
* Set with wolfSSL_CTX_SetIORecv/wolfSSL_CTX_SetIOSend
*/
#define WOLFSSL_USER_IO
#endif
@@ -78,14 +78,14 @@ extern "C" {
#define WOLFSSL_HAVE_SP_ECC
//#define WOLFSSL_SP_4096 /* Enable RSA/RH 4096-bit support */
//#define WOLFSSL_SP_384 /* Enable ECC 384-bit SECP384R1 support */
//#define WOLFSSL_SP_CACHE_RESISTANT
#define WOLFSSL_SP_MATH /* only SP math - disables integer.c/tfm.c */
#define WOLFSSL_SP_MATH_ALL /* use SP math for all key sizes and curves */
//#define WOLFSSL_SP_NO_MALLOC
//#define WOLFSSL_SP_DIV_32 /* do not use 64-bit divides */
#ifdef TARGET_EMBEDDED
/* use smaller version of code */
#define WOLFSSL_SP_SMALL
@@ -117,7 +117,7 @@ extern "C" {
/* Enables blinding mode, to prevent timing attacks */
#define WC_RSA_BLINDING
/* RSA PSS Support */
#define WC_RSA_PSS
#else
@@ -199,7 +199,7 @@ extern "C" {
/* AES */
#undef NO_AES
#if 1
#define HAVE_AES_CBC
#define HAVE_AES_CBC
/* GCM Method: GCM_TABLE_4BIT, GCM_SMALL, GCM_WORD32 or GCM_TABLE */
#define HAVE_AESGCM

0
examples/echoclient/echoclient.sln Executable file → Normal file
View File

0
examples/echoclient/echoclient.vcproj Executable file → Normal file
View File

0
examples/echoserver/echoserver.sln Executable file → Normal file
View File

0
examples/echoserver/echoserver.vcproj Executable file → Normal file
View File

View File

@@ -20,7 +20,7 @@
*/
/* For simpler wolfSSL TLS server examples, visit
* https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
* https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
*/
#ifdef HAVE_CONFIG_H
@@ -395,7 +395,7 @@ int ServerEchoData(SSL* ssl, int clientfd, int echoData, int block,
/* Read data */
while (rx_pos < len) {
ret = SSL_read(ssl, &buffer[rx_pos], len - rx_pos);
if (ret < 0) {
if (ret <= 0) {
err = SSL_get_error(ssl, 0);
#ifdef WOLFSSL_ASYNC_CRYPT
if (err == WC_PENDING_E) {
@@ -1411,8 +1411,8 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
#endif
#ifdef WOLFSSL_STATIC_MEMORY
/* Note: Actual memory used is much less, this is the entire buffer buckets,
* which is partitioned into pools of common sizes. To adjust the buckets
/* Note: Actual memory used is much less, this is the entire buffer buckets,
* which is partitioned into pools of common sizes. To adjust the buckets
* sizes see WOLFMEM_BUCKETS in memory.h */
#if (defined(HAVE_ECC) && !defined(ALT_ECC_SIZE)) \
|| defined(SESSION_CERTS)
@@ -2181,7 +2181,7 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
#endif /* WOLFSSL_STATIC_MEMORY */
if (ctx == NULL)
err_sys_ex(catastrophic, "unable to get ctx");
if (minVersion != SERVER_INVALID_VERSION) {
wolfSSL_CTX_SetMinVersion(ctx, minVersion);
}
@@ -2221,7 +2221,7 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
#endif
#if defined(WOLFSSL_SNIFFER) && defined(WOLFSSL_STATIC_EPHEMERAL)
/* used for testing only to set a static/fixed ephemeral key
/* used for testing only to set a static/fixed ephemeral key
for use with the sniffer */
#if defined(HAVE_ECC) && !defined(NO_ECC_SECP) && \
(!defined(NO_ECC256) || defined(HAVE_ALL_CURVES))
@@ -2443,7 +2443,7 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
if (useCertFolder) {
WOLFSSL_X509_STORE *store;
WOLFSSL_X509_LOOKUP *lookup;
store = wolfSSL_CTX_get_cert_store(ctx);
if (store == NULL) {
wolfSSL_CTX_free(ctx); ctx = NULL;
@@ -3090,6 +3090,12 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
if (err == WOLFSSL_ERROR_WANT_READ ||
err == WOLFSSL_ERROR_WANT_WRITE) {
do {
#ifdef WOLFSSL_ASYNC_CRYPT
if (err == WC_PENDING_E) {
ret = wolfSSL_AsyncPoll(ssl, WOLF_POLL_FLAG_CHECK_HW);
if (ret < 0) break;
}
#endif
if (err == APP_DATA_READY) {
if (wolfSSL_read(ssl, input, sizeof(input)-1) < 0) {
err_sys("APP DATA should be present but error returned");
@@ -3103,19 +3109,16 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
} while (ret != WOLFSSL_SUCCESS &&
(err == WOLFSSL_ERROR_WANT_READ ||
err == WOLFSSL_ERROR_WANT_WRITE ||
err == APP_DATA_READY));
err == APP_DATA_READY ||
err == WC_PENDING_E));
if (ret != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
printf("wolfSSL_Rehandshake error %d, %s\n", err,
wolfSSL_ERR_error_string(err, buffer));
wolfSSL_free(ssl); ssl = NULL;
wolfSSL_CTX_free(ctx); ctx = NULL;
err_sys("non-blocking wolfSSL_Rehandshake failed");
if (ret == WOLFSSL_SUCCESS) {
printf("NON-BLOCKING RENEGOTIATION SUCCESSFUL\n");
err = 0;
}
printf("NON-BLOCKING RENEGOTIATION SUCCESSFUL\n");
}
else {
if (ret != WOLFSSL_SUCCESS) {
err = wolfSSL_get_error(ssl, 0);
printf("wolfSSL_Rehandshake error %d, %s\n", err,
wolfSSL_ERR_error_string(err, buffer));
wolfSSL_free(ssl); ssl = NULL;
@@ -3180,6 +3183,9 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
}
else if (err == 0 || err == WOLFSSL_ERROR_ZERO_RETURN) {
err = ServerEchoData(ssl, clientfd, echoData, block, throughput);
/* Got close notify. Ignore it if not expecting a failure. */
if (err == WOLFSSL_ERROR_ZERO_RETURN && exitWithRet == 0)
err = 0;
if (err != 0) {
SSL_free(ssl); ssl = NULL;
SSL_CTX_free(ctx); ctx = NULL;
@@ -3196,13 +3202,11 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
Task_yield();
#endif
if (dtlsUDP == 0) {
ret = SSL_shutdown(ssl);
if (wc_shutdown && ret == WOLFSSL_SHUTDOWN_NOT_DONE) {
ret = SSL_shutdown(ssl); /* bidirectional shutdown */
if (ret == WOLFSSL_SUCCESS)
printf("Bidirectional shutdown complete\n");
}
ret = SSL_shutdown(ssl);
if (wc_shutdown && ret == WOLFSSL_SHUTDOWN_NOT_DONE) {
ret = SSL_shutdown(ssl); /* bidirectional shutdown */
if (ret == WOLFSSL_SUCCESS)
printf("Bidirectional shutdown complete\n");
}
/* display collected statistics */

0
examples/server/server.sln Executable file → Normal file
View File

0
examples/server/server.vcproj Executable file → Normal file
View File

View File

@@ -39,6 +39,7 @@ Platform is one of:
linuxv5-RC8 (old FIPS 140-3)
linuxv5 (current FIPS 140-3)
linuxv5-ready (ready FIPS 140-3)
linuxv5-RC10
Keep (default off) retains the XXX-fips-test temp dir for inspection.
Example:
@@ -293,23 +294,36 @@ linuxv5-RC8)
COPY_DIRECT=( wolfcrypt/src/aes_asm.S wolfcrypt/src/aes_asm.asm
wolfcrypt/src/sha256_asm.S wolfcrypt/src/sha512_asm.S )
;;
# temporary values during transition
linuxv5|linuxv5-RC9)
FIPS_REPO="git@github.com:wolfSSL/fips.git"
FIPS_VERSION="master"
CRYPT_REPO="git@github.com:douzzer/wolfssl.git"
CRYPT_VERSION="fipsv3-rebased"
FIPS_VERSION="WCv5.0-RC9"
CRYPT_REPO="git@github.com:wolfSSL/wolfssl.git"
CRYPT_VERSION="WCv5.0-RC9"
CRYPT_INC_PATH="wolfssl/wolfcrypt"
CRYPT_SRC_PATH="wolfcrypt/src"
WC_MODS=( aes sha sha256 sha512 rsa hmac random cmac dh ecc sha3 kdf )
RNG_VERSION="fipsv3-rebased"
RNG_VERSION="WCv5.0-RC9"
FIPS_SRCS=( fips.c fips_test.c wolfcrypt_first.c wolfcrypt_last.c )
FIPS_INCS=( fips.h )
FIPS_OPTION="v5-RC9"
COPY_DIRECT=( wolfcrypt/src/aes_asm.S wolfcrypt/src/aes_asm.asm
wolfcrypt/src/sha256_asm.S wolfcrypt/src/sha512_asm.S )
;;
linuxv5-RC10)
FIPS_REPO="git@github.com:wolfSSL/fips.git"
FIPS_VERSION="WCv5.0-RC10"
CRYPT_REPO="git@github.com:wolfSSL/wolfssl.git"
CRYPT_VERSION="WCv5.0-RC10"
CRYPT_INC_PATH="wolfssl/wolfcrypt"
CRYPT_SRC_PATH="wolfcrypt/src"
WC_MODS=( aes sha sha256 sha512 rsa hmac random cmac dh ecc sha3 kdf )
RNG_VERSION="WCv5.0-RC10"
FIPS_SRCS=( fips.c fips_test.c wolfcrypt_first.c wolfcrypt_last.c )
FIPS_INCS=( fips.h )
FIPS_OPTION="v5-RC10"
COPY_DIRECT=( wolfcrypt/src/aes_asm.S wolfcrypt/src/aes_asm.asm
wolfcrypt/src/sha256_asm.S wolfcrypt/src/sha512_asm.S )
;;
*)
Usage

View File

@@ -98,6 +98,13 @@ my @fileList_4096 = (
[ "./certs/dh4096.der", "dh_key_der_4096" ],
);
#Falcon Post-Quantum Keys
#Used with HAVE_LIBOQS
my @fileList_falcon = (
["certs/falcon/bench_falcon_level1_key.der", "bench_falcon_level1_key" ],
["certs/falcon/bench_falcon_level5_key.der", "bench_falcon_level5_key" ],
);
# ----------------------------------------------------------------------------
my $num_ecc = @fileList_ecc;
@@ -106,6 +113,7 @@ my $num_1024 = @fileList_1024;
my $num_2048 = @fileList_2048;
my $num_3072 = @fileList_3072;
my $num_4096 = @fileList_4096;
my $num_falcon = @fileList_falcon;
# open our output file, "+>" creates and/or truncates
open OUT_FILE, "+>", $outputFile or die $!;
@@ -114,7 +122,6 @@ print OUT_FILE "/* certs_test.h */\n\n";
print OUT_FILE "#ifndef WOLFSSL_CERTS_TEST_H\n";
print OUT_FILE "#define WOLFSSL_CERTS_TEST_H\n\n";
# convert and print 1024-bit cert/keys
print OUT_FILE "#ifdef USE_CERT_BUFFERS_1024\n\n";
for (my $i = 0; $i < $num_1024; $i++) {
@@ -186,6 +193,22 @@ for (my $i = 0; $i < $num_4096; $i++) {
print OUT_FILE "#endif /* USE_CERT_BUFFERS_4096 */\n\n";
# convert and print falcon keys
print OUT_FILE "#ifdef HAVE_LIBOQS\n\n";
for (my $i = 0; $i < $num_falcon; $i++) {
my $fname = $fileList_falcon[$i][0];
my $sname = $fileList_falcon[$i][1];
print OUT_FILE "/* $fname */\n";
print OUT_FILE "static const unsigned char $sname\[] =\n";
print OUT_FILE "{\n";
file_to_hex($fname);
print OUT_FILE "};\n";
print OUT_FILE "static const int sizeof_$sname = sizeof($sname);\n\n";
}
print OUT_FILE "#endif /* HAVE_LIBOQS */\n\n";
# convert and print 256-bit cert/keys
print OUT_FILE "#if defined(HAVE_ECC) && defined(USE_CERT_BUFFERS_256)\n\n";

View File

@@ -87,8 +87,12 @@ libwolfssl.ko.signed: libwolfssl.ko
./scripts/sign-file "$${CONFIG_MODULE_SIG_HASH}" \
"$${CONFIG_MODULE_SIG_KEY}" \
"$${CONFIG_MODULE_SIG_KEY/%.pem/.x509}" \
'$(MODULE_TOP)/$@' || \
$(RM) -f '$(MODULE_TOP)/$@' || exit $$?; \
'$(MODULE_TOP)/$@'; \
sign_file_exitval=$$?; \
if [[ $$sign_file_exitval != 0 ]]; then \
$(RM) -f '$(MODULE_TOP)/$@'; \
exit $$sign_file_exitval; \
fi; \
if [[ "$(quiet)" != "silent_" ]]; then \
echo " Module $@ signed by $${CONFIG_MODULE_SIG_KEY}."; \
fi \

View File

@@ -140,11 +140,6 @@
#include <wolfssl/wolfcrypt/kdf.h>
#endif
#ifdef _MSC_VER
/* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
#pragma warning(disable: 4996)
#endif
#ifdef OPENSSL_EXTRA
#ifndef WOLFCRYPT_ONLY
#include <wolfssl/openssl/evp.h>

View File

@@ -25,6 +25,8 @@
#define FIPS_NO_WRAPPERS
#define WOLFSSL_NEED_LINUX_CURRENT
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -100,9 +102,12 @@ static void lkmFipsCb(int ok, int err, const char* hash)
}
#endif
#if defined(WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE) && !defined(CONFIG_MODULE_SIG)
#ifdef WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE
#ifndef CONFIG_MODULE_SIG
#error WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE requires a CONFIG_MODULE_SIG kernel.
#endif
static int updateFipsHash(void);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
static int __init wolfssl_init(void)
@@ -112,15 +117,14 @@ static int wolfssl_init(void)
{
int ret;
#if defined(CONFIG_MODULE_SIG_FORCE) || defined(WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE)
#ifdef WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE
if (THIS_MODULE->sig_ok == false) {
pr_err("wolfSSL module load aborted -- bad or missing module signature with "
#ifdef CONFIG_MODULE_SIG_FORCE
"CONFIG_MODULE_SIG_FORCE kernel"
#else
"FIPS dynamic hash"
#endif
".\n");
pr_err("wolfSSL module load aborted -- bad or missing module signature with FIPS dynamic hash.\n");
return -ECANCELED;
}
ret = updateFipsHash();
if (ret < 0) {
pr_err("wolfSSL module load aborted -- updateFipsHash: %s\n",wc_GetErrorString(ret));
return -ECANCELED;
}
#endif
@@ -267,7 +271,7 @@ static int wolfssl_init(void)
#else
""
#endif
);
);
#else
pr_info("wolfSSL " LIBWOLFSSL_VERSION_STRING " loaded%s"
".\nSee https://www.wolfssl.com/ for more information.\n"
@@ -315,7 +319,7 @@ static int my_preempt_count(void) {
return preempt_count();
}
#if defined(WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
#if defined(WOLFSSL_LINUXKM_SIMD_X86) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
static int my_copy_fpregs_to_fpstate(struct fpu *fpu) {
return copy_fpregs_to_fpstate(fpu);
}
@@ -362,7 +366,11 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
#endif
wolfssl_linuxkm_pie_redirect_table.kstrtoll = kstrtoll;
wolfssl_linuxkm_pie_redirect_table.printk = printk;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
wolfssl_linuxkm_pie_redirect_table._printk = _printk;
#else
wolfssl_linuxkm_pie_redirect_table.printk = printk;
#endif
wolfssl_linuxkm_pie_redirect_table.snprintf = snprintf;
wolfssl_linuxkm_pie_redirect_table._ctype = _ctype;
@@ -406,18 +414,16 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
kernel_fpu_begin;
#endif
wolfssl_linuxkm_pie_redirect_table.kernel_fpu_end = kernel_fpu_end;
#ifdef WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
wolfssl_linuxkm_pie_redirect_table.copy_fpregs_to_fpstate = my_copy_fpregs_to_fpstate;
wolfssl_linuxkm_pie_redirect_table.copy_kernel_to_fpregs = my_copy_kernel_to_fpregs;
#else
wolfssl_linuxkm_pie_redirect_table.save_fpregs_to_fpstate = save_fpregs_to_fpstate;
wolfssl_linuxkm_pie_redirect_table.__restore_fpregs_from_fpstate = __restore_fpregs_from_fpstate;
wolfssl_linuxkm_pie_redirect_table.xfeatures_mask_all = &xfeatures_mask_all;
#endif
wolfssl_linuxkm_pie_redirect_table.cpu_number = &cpu_number;
wolfssl_linuxkm_pie_redirect_table.nr_cpu_ids = &nr_cpu_ids;
#endif /* WOLFSSL_LINUXKM_SIMD_X86_IRQ_ALLOWED */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
wolfssl_linuxkm_pie_redirect_table.copy_fpregs_to_fpstate = my_copy_fpregs_to_fpstate;
wolfssl_linuxkm_pie_redirect_table.copy_kernel_to_fpregs = my_copy_kernel_to_fpregs;
#else
wolfssl_linuxkm_pie_redirect_table.save_fpregs_to_fpstate = save_fpregs_to_fpstate;
wolfssl_linuxkm_pie_redirect_table.__restore_fpregs_from_fpstate = __restore_fpregs_from_fpstate;
wolfssl_linuxkm_pie_redirect_table.xfeatures_mask_all = &xfeatures_mask_all;
#endif
wolfssl_linuxkm_pie_redirect_table.cpu_number = &cpu_number;
wolfssl_linuxkm_pie_redirect_table.nr_cpu_ids = &nr_cpu_ids;
#endif
wolfssl_linuxkm_pie_redirect_table.__mutex_init = __mutex_init;
@@ -461,3 +467,213 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
}
#endif /* USE_WOLFSSL_LINUXKM_PIE_REDIRECT_TABLE */
#ifdef WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE
#include <wolfssl/wolfcrypt/coding.h>
PRAGMA_GCC_DIAG_PUSH;
PRAGMA_GCC("GCC diagnostic ignored \"-Wnested-externs\"");
PRAGMA_GCC("GCC diagnostic ignored \"-Wpointer-arith\"");
#include <crypto/hash.h>
PRAGMA_GCC_DIAG_POP;
extern char verifyCore[WC_SHA256_DIGEST_SIZE*2 + 1];
extern const char coreKey[WC_SHA256_DIGEST_SIZE*2 + 1];
extern const unsigned int wolfCrypt_FIPS_ro_start[];
extern const unsigned int wolfCrypt_FIPS_ro_end[];
#define FIPS_IN_CORE_KEY_SZ 32
#define FIPS_IN_CORE_VERIFY_SZ FIPS_IN_CORE_KEY_SZ
typedef int (*fips_address_function)(void);
#define MAX_FIPS_DATA_SZ 100000
#define MAX_FIPS_CODE_SZ 1000000
extern int GenBase16_Hash(const byte* in, int length, char* out, int outSz);
static int updateFipsHash(void)
{
struct crypto_shash *tfm = NULL;
struct shash_desc *desc = NULL;
word32 verifySz = FIPS_IN_CORE_VERIFY_SZ;
word32 binCoreSz = FIPS_IN_CORE_KEY_SZ;
int ret;
byte *hash = NULL;
char *base16_hash = NULL;
byte *binCoreKey = NULL;
byte *binVerify = NULL;
fips_address_function first = wolfCrypt_FIPS_first;
fips_address_function last = wolfCrypt_FIPS_last;
char* start = (char*)wolfCrypt_FIPS_ro_start;
char* end = (char*)wolfCrypt_FIPS_ro_end;
unsigned long code_sz = (unsigned long)last - (unsigned long)first;
unsigned long data_sz = (unsigned long)end - (unsigned long)start;
if (data_sz == 0 || data_sz > MAX_FIPS_DATA_SZ)
return BAD_FUNC_ARG; /* bad fips data size */
if (code_sz == 0 || code_sz > MAX_FIPS_CODE_SZ)
return BAD_FUNC_ARG; /* bad fips code size */
hash = XMALLOC(WC_SHA256_DIGEST_SIZE, 0, DYNAMIC_TYPE_TMP_BUFFER);
if (hash == NULL) {
ret = MEMORY_E;
goto out;
}
base16_hash = XMALLOC(WC_SHA256_DIGEST_SIZE*2 + 1, 0, DYNAMIC_TYPE_TMP_BUFFER);
if (base16_hash == NULL) {
ret = MEMORY_E;
goto out;
}
binCoreKey = XMALLOC(binCoreSz, 0, DYNAMIC_TYPE_TMP_BUFFER);
if (binCoreKey == NULL) {
ret = MEMORY_E;
goto out;
}
binVerify = XMALLOC(verifySz, 0, DYNAMIC_TYPE_TMP_BUFFER);
if (binVerify == NULL) {
ret = MEMORY_E;
goto out;
}
{
word32 base16_out_len = binCoreSz;
ret = Base16_Decode((const byte *)coreKey, sizeof coreKey - 1, binCoreKey, &base16_out_len);
if (ret != 0) {
pr_err("Base16_Decode for coreKey: %s\n", wc_GetErrorString(ret));
goto out;
}
if (base16_out_len != binCoreSz) {
pr_err("unexpected output length %u for coreKey from Base16_Decode.\n",base16_out_len);
ret = BAD_STATE_E;
goto out;
}
}
tfm = crypto_alloc_shash("hmac(sha256)", 0, 0);
if (IS_ERR(tfm)) {
if (PTR_ERR(tfm) == -ENOMEM) {
pr_err("crypto_alloc_shash failed: out of memory\n");
ret = MEMORY_E;
} else if (PTR_ERR(tfm) == -ENOENT) {
pr_err("crypto_alloc_shash failed: kernel is missing hmac(sha256) implementation\n");
pr_err("check for CONFIG_CRYPTO_SHA256 and CONFIG_CRYPTO_HMAC.\n");
ret = NOT_COMPILED_IN;
} else {
pr_err("crypto_alloc_shash failed with ret %ld\n",PTR_ERR(tfm));
ret = HASH_TYPE_E;
}
tfm = NULL;
goto out;
}
{
size_t desc_size = crypto_shash_descsize(tfm) + sizeof *desc;
desc = XMALLOC(desc_size, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (desc == NULL) {
pr_err("failed allocating desc.");
ret = MEMORY_E;
goto out;
}
XMEMSET(desc, 0, desc_size);
}
ret = crypto_shash_setkey(tfm, binCoreKey, binCoreSz);
if (ret) {
pr_err("crypto_ahash_setkey failed: err %d\n", ret);
ret = BAD_STATE_E;
goto out;
}
desc->tfm = tfm;
ret = crypto_shash_init(desc);
if (ret) {
pr_err("crypto_shash_init failed: err %d\n", ret);
ret = BAD_STATE_E;
goto out;
}
ret = crypto_shash_update(desc, (byte *)(wc_ptr_t)first, (word32)code_sz);
if (ret) {
pr_err("crypto_shash_update failed: err %d\n", ret);
ret = BAD_STATE_E;
goto out;
}
/* don't hash verifyCore or changing verifyCore will change hash */
if (verifyCore >= start && verifyCore < end) {
data_sz = (unsigned long)verifyCore - (unsigned long)start;
ret = crypto_shash_update(desc, (byte*)start, (word32)data_sz);
if (ret) {
pr_err("crypto_shash_update failed: err %d\n", ret);
ret = BAD_STATE_E;
goto out;
}
start = (char*)verifyCore + sizeof(verifyCore);
data_sz = (unsigned long)end - (unsigned long)start;
}
ret = crypto_shash_update(desc, (byte*)start, (word32)data_sz);
if (ret) {
pr_err("crypto_shash_update failed: err %d\n", ret);
ret = BAD_STATE_E;
goto out;
}
ret = crypto_shash_final(desc, hash);
if (ret) {
pr_err("crypto_shash_final failed: err %d\n", ret);
ret = BAD_STATE_E;
goto out;
}
ret = GenBase16_Hash(hash, WC_SHA256_DIGEST_SIZE, base16_hash, WC_SHA256_DIGEST_SIZE*2 + 1);
if (ret != 0) {
pr_err("GenBase16_Hash failed: %s\n", wc_GetErrorString(ret));
goto out;
}
{
word32 base16_out_len = verifySz;
ret = Base16_Decode((const byte *)verifyCore, sizeof verifyCore - 1, binVerify, &base16_out_len);
if (ret != 0) {
pr_err("Base16_Decode for verifyCore: %s\n", wc_GetErrorString(ret));
goto out;
}
if (base16_out_len != binCoreSz) {
pr_err("unexpected output length %u for verifyCore from Base16_Decode.\n",base16_out_len);
ret = BAD_STATE_E;
goto out;
}
}
if (XMEMCMP(hash, binVerify, WC_SHA256_DIGEST_SIZE) == 0)
pr_info("updateFipsHash: verifyCore already matches.\n");
else {
XMEMCPY(verifyCore, base16_hash, WC_SHA256_DIGEST_SIZE*2 + 1);
pr_info("updateFipsHash: verifyCore updated.\n");
}
ret = 0;
out:
if (tfm != NULL)
crypto_free_shash(tfm);
if (desc != NULL)
XFREE(desc, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (hash != NULL)
XFREE(hash, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (base16_hash != NULL)
XFREE(base16_hash, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (binCoreKey != NULL)
XFREE(binCoreKey, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (binVerify != NULL)
XFREE(binVerify, NULL, DYNAMIC_TYPE_TMP_BUFFER);
return ret;
}
#endif /* WOLFCRYPT_FIPS_CORE_DYNAMIC_HASH_VALUE */

View File

@@ -4,10 +4,10 @@
if BUILD_MCAPI
check_PROGRAMS += mcapi/test
noinst_PROGRAMS += mcapi/test
noinst_PROGRAMS += mcapi/test
mcapi_test_SOURCES = mcapi/crypto.c \
mcapi/mcapi_test.c
mcapi_test_LDADD = src/libwolfssl.la
mcapi_test_LDADD = src/libwolfssl.la
mcapi_test_DEPENDENCIES = src/libwolfssl.la
endif

0
mplabx/wolfcrypt_benchmark.X/Makefile Executable file → Normal file
View File

0
mplabx/wolfcrypt_benchmark.X/nbproject/include.am Executable file → Normal file
View File

0
mplabx/wolfcrypt_test.X/Makefile Executable file → Normal file
View File

0
mplabx/wolfcrypt_test.X/nbproject/include.am Executable file → Normal file
View File

0
mplabx/wolfssl.X/Makefile Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More