John Safranek
af89458af0
GCC-8 string fixes
...
1. strncpy needs to include the source string's NULL.
2. Deleted a few redundant string modifications.
2018-07-31 14:02:44 -07:00
John Safranek
ed208efc4d
GCC-8 string fixes
...
1. Modify wolfSSL_get_ciphers() to limit the XSTRNCPY based on the dst buf length, not the src string.
2018-07-31 14:02:44 -07:00
John Safranek
2e1a1681ec
GCC-8 string fixes
...
1. strncat() does not like to copy single byte strings with "n = 1", as it won't null-terminate.
2. strncpy()'s len parameter is the size of the dst not the src.
3. Replaced the echoserver HTTP response composition of const strings with a copy of a single string.
2018-07-31 14:02:44 -07:00
John Safranek
50372b7033
Memory Callback
...
1. Allow SetAllocators to use NULL as a callback. Memory wrappers will use default with NULL.
2. Remove the ResetAllocators function. Use SetAllocators with NULL.
3. Modify memory tracker to save the old allocators on init and restore them on cleanup.
2018-07-31 09:30:03 -07:00
David Garske
0e1588f4ad
Documented memory build options. Added logging for normal wolf malloc/free opterations when using WOLFSSL_DEBUG_MEMORY
and WOLFSSL_DEBUG_MEMORY_PRINT
(previously only worked with WOLFSSL_STATIC_MEMORY
and WOLFSSL_TRACK_MEMORY
). Changed WOLFSSL_MALLOC_CHECK
option to use WOLFSSL_MSG
.
2018-07-31 09:03:40 -07:00
kaleb-himes
fe08b98117
Adjust guards following peer review
2018-07-31 09:50:44 -06:00
David Garske
2b3f94944d
Merge pull request #1723 from kaleb-himes/overhead-avoidance
...
avoid overhead call to alloc and free when sigSz invalid
2018-07-31 08:14:49 -07:00
toddouska
f18351fef5
Merge pull request #1718 from dgarske/memtest
...
New memory testing feature and fixes for null checks
2018-07-31 07:56:29 -07:00
toddouska
f5bd376450
Merge pull request #1720 from dgarske/stsafe_wolf
...
Added STM32L4/ST-Safe support. Fixes for AES CBC Decrypt w/CubeMX
2018-07-31 07:41:49 -07:00
David Garske
0f86494161
* Added support for STM32L4 AES hardware crypto.
...
* Added reference PK callbacks functions for ECC sign, verify and shared secret used by TLS in `wolfcrypt/src/port/st/stsafe.c`.
* Fix for wolfcrypt_test to not require args to be provided.
* Fix for wolfCrypt `ecc_test_buffers` to poperly init ecc_key (resolves devId issue).
* Fix for STM32 AES CBC Decrypt with CubeMX, which was not capturing the first input block for next IV.
* Refactor to combine STM32 hardware init code.
2018-07-30 13:58:19 -07:00
David Garske
656c0453a2
Fix for unit test abort().
2018-07-30 13:53:54 -07:00
David Garske
6a91fbcfdd
Fixes for warnings from Jenkins reports.
2018-07-30 13:53:54 -07:00
David Garske
4eff7b641b
First pass at bugs found with ./scripts/memtest.sh
. Fixes for NULL pointer checks, making sure free'd pointers are reset, making sure pointers are initialized and making sure memory is always free'd. Fix for TicketInit() which was using non-thread safe RNG and key_ctx. Fix for possible double free case in wolfSSL_PEM_read_X509_CRL
.
2018-07-30 13:53:54 -07:00
David Garske
6ed6876b1f
Enhanced the --enable-memtrack
option to keep list of pointers allocated and reports leaked memory at end. Cleanup of the wolfCrypt_Init and wolfCrypt_Cleanup calls in unit.test and SrpTest memory tracking feature.
2018-07-30 13:53:54 -07:00
David Garske
2c3475c1d6
Added new build option --enable-memtest
or WOLFSSL_FORCE_MALLOC_FAIL_TEST
which enables random malloc failures for testing. This test supresses the abort()
calls to detect seg faults. A new script ./scripts/memtest.sh
starts the test. If an issue is found it can be reviewed with the ./scripts/memtest.txt
log and reproduced using the seed printed at top of unit test as --- RNG MALLOC FAIL AT 295---
and rerun using ./tests/unit.test 295
.
2018-07-30 13:53:35 -07:00
toddouska
62cb69ded6
Merge pull request #1724 from dgarske/pemtoder
...
Added API's to expose alloc/free of DerBuffer and new unit tests
2018-07-30 13:50:19 -07:00
toddouska
335f467b8c
Merge pull request #1714 from dgarske/pic32hashleak
...
Fixes for PIC32MZ hash memory leak
2018-07-30 13:48:59 -07:00
David Garske
50115e55b3
Merge pull request #1725 from kaleb-himes/USER_CONF_SIZES
...
Allow users to adjust upper bounds
2018-07-30 13:44:58 -07:00
kaleb-himes
ec238c0553
Allow users to adjust upper bounds
2018-07-30 13:44:40 -06:00
Chris Conlon
c71d8eb6ba
Merge pull request #1653 from Naruto/feature/mynewt
...
port apache mynewt
2018-07-30 13:33:25 -06:00
Chris Conlon
1079b0e3b3
Merge pull request #1716 from cariepointer/osp/haproxy
...
Define functions required by HAProxy and enable SSLV3 dependency
2018-07-30 13:26:38 -06:00
David Garske
0ef63048a0
Fix for new report in wc_BerToDer
with uninitialized derSz
.
2018-07-30 11:51:26 -07:00
David Garske
309d7a9d0d
Added API's to expose alloc/free of DerBuffer using wc_AllocDer
and wc_FreeDer
. Added unit tests for new API's and missing ones for wc_PemToDer
and wc_CertPemToDer
. ZD 4185.
2018-07-30 11:19:59 -07:00
Kaleb Himes
d19b78d81a
Fix typo in comment
2018-07-30 12:17:55 -06:00
kaleb-himes
166330030c
Handle case where external unassigned
2018-07-29 06:46:07 -06:00
Naruto TAKAHASHI
861fec1dc6
porting mynewt
2018-07-28 18:03:20 +09:00
kaleb-himes
0ee4b88e74
avoid overhead call to alloc and free when sigSz invalid
2018-07-27 16:25:10 -06:00
John Safranek
4b8507813e
Prime Number Testing
...
1. Also disable the new prime test from TLS while using SELFTEST.
2018-07-27 13:34:38 -07:00
kaleb-himes
afb2180e80
Cleanup debug errors
2018-07-27 14:00:19 -06:00
Kaleb Himes
04e16b8df8
Merge pull request #1717 from JacobBarthelmeh/Testing
...
sanity check on pkcs8 variable
2018-07-27 13:33:55 -06:00
MJSPollard
543cac65d8
Added boost define and openssl bug fix with WOLFSSL_KEY_GEN
2018-07-27 12:42:09 -06:00
Jacob Barthelmeh
74c4d31c07
sanity check on pkcs8 variable
2018-07-27 11:16:41 -06:00
John Safranek
31f1692cbf
Prime Number Testing
...
1. Disable the new prime test from TLS while using FIPS or setting the flag WOLFSSL_OLD_PRIME_CHECK.
2018-07-26 16:01:08 -07:00
John Safranek
4b2a591a93
Prime Number Testing
...
1. Added calls to wc_DhSetCheckKey() on the client side of TLS.
2. Added an API test to the wolfCrypt test.
3. Fixed a bug in the prime test found with the API test. Misuse of tertiary operator.
2018-07-26 14:43:04 -07:00
David Garske
efbabbfb29
Further improvements to hashing code to make sure wc_*Free is always called including wc_HashFree. Added new defines to disable PIC32MZ hardware features using NO_PIC32MZ_HASH
, NO_PIC32MZ_RNG
and NO_PIC32MZ_CRYPT
.
2018-07-26 14:41:30 -07:00
Carie Pointer
a1f69f0d64
Define functions required by HAProxy and enable SSLV3 dependency
2018-07-26 12:53:21 -07:00
toddouska
90367df13c
Merge pull request #1710 from SparkiDev/ed25519_only
...
Changes to build with X25519 and Ed25519 only
2018-07-25 14:24:03 -07:00
toddouska
84c1b633fb
Merge pull request #1713 from JacobBarthelmeh/UnitTests
...
fix buffer types for ARC4 test
2018-07-25 14:17:10 -07:00
David Garske
92cb8f06ea
Fixes to make sure hash free is always called (resolves memory leaks with PIC32MZ hashing hardware). Only print Alloc/Free messages with track memory when WOLFSSL_DEBUG_MEMORY_PRINT
is defined. Added test for ForceZero with 0 length.
2018-07-25 11:22:03 -07:00
David Garske
beceab2734
Fix for leak with WOLFSSL_PIC32MZ_HASH
and TLS. The PIC32 update cache buffer was not always being free'd.
2018-07-25 11:22:03 -07:00
JacobBarthelmeh
74fbd06817
Merge pull request #1686 from cconlon/nucleus-update
...
Nucleus port and PB changes
2018-07-25 09:17:40 -06:00
Jacob Barthelmeh
003b7b28f4
fix buffer types for ARC4 test
2018-07-24 17:37:39 -06:00
toddouska
fe2aee11d8
Merge pull request #1712 from JacobBarthelmeh/Testing
...
check if internal of WOLFSSL_RSA struct is already set
2018-07-24 11:55:15 -07:00
toddouska
17c7ecb2bc
Merge pull request #1711 from dgarske/memtrack
...
Fix for memory tracking cleanup
2018-07-24 11:53:08 -07:00
toddouska
169cca355f
Merge pull request #1705 from cconlon/truestudio-project
...
Add wolfSSL library project for Atollic TrueSTUDIO
2018-07-24 11:52:11 -07:00
toddouska
018573bcf3
Merge pull request #1695 from JacobBarthelmeh/Optimizations
...
add some macro guards for CipherRequires function
2018-07-24 11:51:03 -07:00
Chris Conlon
0175447eb3
tie TRUESTUDIO files into include.am
2018-07-24 09:36:49 -06:00
Jacob Barthelmeh
f69c6e382c
check if internal of WOLFSSL_RSA struct is already set
2018-07-23 17:17:27 -06:00
toddouska
92bc891713
Merge pull request #1709 from SparkiDev/rsa_low_mem_fix
...
Fix for RSA_LOW_MEM and other configurations
2018-07-23 16:15:28 -07:00
toddouska
e618f34c2f
Merge pull request #1707 from kaleb-himes/ARM_GCC_EX_FIXES
...
Fixes for building without DRBG and ForceZero test
2018-07-23 16:14:43 -07:00