Compare commits

..

294 Commits

Author SHA1 Message Date
David Garske
72d168028e Fixes to better handle PKCS7 error cases. 2018-05-23 15:29:33 -07:00
David Garske
9a75e5cf68 Fixes in PKCS7 for handling hardware based devId and no private key. Fix to handle scenario where kari->decoded is allocated, but not initalized (was causing use of unitliaized in FreeDecodedCert). Fix to handle hardware base RSA key size. 2018-05-23 14:48:10 -07:00
David Garske
85511067e4 Added crypto device framework to handle PK RSA/ECC operations using callbacks. Adds new build option ./configure --enable-cryptodev or #define WOLF_CRYPTO_DEV. Added devId support to PKCS7. 2018-05-21 14:31:08 -07:00
toddouska
2021bcb188 Merge pull request #1560 from dgarske/ciphernamecleanup
Refactor of the cipher suite names to use single array
2018-05-21 14:24:53 -06:00
toddouska
e7de654b61 Merge pull request #1558 from dgarske/fsanitize
Fixes for fsanitize reports
2018-05-21 14:18:07 -06:00
toddouska
2d88e2efe7 Merge pull request #1567 from SparkiDev/intel_64_align
ForceZero - align 64-bit access on Intel 64-bit
2018-05-21 14:16:36 -06:00
Chris Conlon
6e13bfcfce Merge pull request #1571 from aaronjense/unit-test-curve25519
Added unit-test for wc_curve25519_init and wc_curve25519_free
2018-05-21 13:42:11 -06:00
Aaron Jense
f214dbc3dd Removed unneeded call on test_wc_curve25519_init 2018-05-21 11:50:52 -06:00
Aaron Jense
8197d9ec36 Added unit-test for wc_curve25519_init and wc_curve25519_free in tests/api.c 2018-05-21 10:59:02 -06:00
Sean Parkinson
3a27d85c4e Use sizeof instead of constant value 2018-05-21 21:26:25 +10:00
David Garske
cf70b1a013 Revert ForceZero changes in favor of PR #1567. 2018-05-18 05:29:09 -07:00
Sean Parkinson
d63da10c96 ForceZero - align 64-bit access on Intel 64-bit
Test added to ensure ForceZero works.
2018-05-18 10:38:21 +10:00
David Garske
096456f466 Merge pull request #1565 from embhorn/zd3883
wolfSSL_HMAC_Final parameter len should be optional
2018-05-17 13:19:19 -07:00
David Garske
b973d6e8b1 Fix to handle NO_ERROR_STRINGS case in unit test. The IANA names are disabled when NO_ERROR_STRINGS is defined. 2018-05-17 10:24:02 -07:00
Eric Blankenhorn
5cbb9e8341 wolfSSL_HMAC_Final parameter len should be optional 2018-05-17 08:53:21 -05:00
David Garske
8163225180 Refactor of the cipher suite names to use single array, which contains internal name, IANA name and cipher suite bytes. 2018-05-16 15:29:27 -07:00
David Garske
dad574edb8 Fix to use proper type (size_t) for alignment check. 2018-05-16 14:34:16 -07:00
David Garske
52b66edf72 Fixes for a few more fsanitize issues. Added alignment for ForceZero. Added word32 aligned acceleration for ForceZeero. Added 'NO_ALIGNED_FORCEZERO' define to allow disabling aligned ForceZero acceleration. We cast the 24 left-shifts to word32 because compiler assumes signed int type, and a runtime value with MSB set results into runtime fsanitize error. 2018-05-16 13:27:13 -07:00
toddouska
8ff328cb39 Merge pull request #1551 from dgarske/asynccheck
Added new `async-check.sh` script
2018-05-16 08:02:11 -07:00
toddouska
b5e0499022 Merge pull request #1550 from dgarske/rsaverify
Check returned size matches signature size for RSA verify in openssl compatibility
2018-05-16 08:00:31 -07:00
toddouska
bbc178a704 Merge pull request #1548 from JacobBarthelmeh/Testing
fix ecc public key print with X509 print function
2018-05-16 07:59:19 -07:00
toddouska
8619062ae7 Merge pull request #1522 from dgarske/mbedtls_compat
Port for using AWS FreeRTOS
2018-05-16 07:57:55 -07:00
toddouska
1be8a6e4ef Merge pull request #1502 from ejohnstown/update-m4
Update M4 Autoconf Files
2018-05-16 07:57:13 -07:00
David Garske
f021375c4b Fixes for fsanitize reports. 2018-05-15 17:23:35 -07:00
John Safranek
9c33244158 Update ax_pthread.m4
The AX_PTHREAD macro has a check for side-effects of the pthread flag beyond the functions being available. It also checks for a particular macro being set when compiling the test file. When running the build through the scan-build static analysis, for some reason, the check value isn't set. The build fails. I commented the check out for now.
2018-05-11 17:39:51 -07:00
John Safranek
2a4d386a50 Update ax_pthread.m4
1. Updated to the most recent copy of ax_pthread.m4.
2. Removed the darwin-clang check m4.
3. Added a check to see if AX_PTHREAD added the flag `-Qunused-arguments` for clang and if so prepend `-Xcompiler` so libtool will use it. Otherwise when building on Sierra's clang you get "soft" warnings on the build of the dylib.
2018-05-11 10:21:47 -07:00
David Garske
83257d662a Also check returned size matches for RSA verfiy in openssl compatability layer. 2018-05-11 17:09:07 +02:00
David Garske
af9507391a Fixes and improvements for FreeRTOS AWS. Fixes for building openssl compatibility with FreeRTOS. Fixes for TLS 1.3 possibly uninitialized vars. 2018-05-11 16:40:32 +02:00
David Garske
cb2f1d6d7d Added new async-check.sh script for setting up the async simulator for internal testing. 2018-05-11 16:38:24 +02:00
toddouska
7a4da340d4 Merge pull request #1547 from JacobBarthelmeh/Docs
add aes init function to docs
2018-05-09 16:40:36 -07:00
Jacob Barthelmeh
110c41613f cast on return of malloc 2018-05-09 14:50:26 -06:00
Chris Conlon
c910d84507 Merge pull request #1527 from kojo1/RenesasCSPlus
Renesas CS+ projects
2018-05-09 10:07:16 -06:00
Takashi Kojo
66e59e4a6a Rollback #if condition 2018-05-09 10:58:10 +09:00
Jacob Barthelmeh
4f0893bda5 fix ecc public key print with X509 print function 2018-05-07 14:16:27 -06:00
Jacob Barthelmeh
fd691a5795 add aes init function to docs 2018-05-07 10:24:44 -06:00
toddouska
08165d5a16 Merge pull request #1540 from SparkiDev/tls13_ticket_fix
NewSessionTicket parsing error fix
2018-05-04 10:54:23 -07:00
toddouska
0fec651338 Merge pull request #1539 from cconlon/toradix
expose mp_toradix() when WOLFSSL_PUBLIC_MP is defined
2018-05-04 10:49:21 -07:00
toddouska
6e5258b56e Merge pull request #1538 from dgarske/fixmatchdomainnull
Fix for handling match on domain name that may have a null terminator inside
2018-05-04 10:25:28 -07:00
Takashi Kojo
ecd2e75564 #ifndef FREESCALE_LTC_ECC with fe_init 2018-05-04 07:34:47 +09:00
Sean Parkinson
69ce10f292 NewSessionTicket parsing error fix 2018-05-04 08:18:54 +10:00
David Garske
3fd47bdff3 Fix for example client/server with -H exitWithRet option to make sure all cleanup is performed. Resolves valgrind report due to TicketCleanup() not being called. 2018-05-03 13:39:37 -07:00
Chris Conlon
bb7bcfd877 expose mp_toradix() when WOLFSSL_PUBLIC_MP is defined 2018-05-03 13:41:23 -06:00
toddouska
a2fa61cd3d Merge pull request #1534 from SparkiDev/tls13_static_rsa
Fix TLS 1.3, change Client Hello version to work with static RSA (TLS 1.0 - TLS 1.2)
2018-05-03 12:38:55 -07:00
toddouska
1c09c06349 Merge pull request #1533 from SparkiDev/tls13_draft26
Allow building TLS 1.3 at draft 26
2018-05-03 12:37:39 -07:00
toddouska
74618d0e3c Merge pull request #1532 from SparkiDev/test_fix
Fixes for tests
2018-05-03 11:44:01 -07:00
toddouska
73d85774df Merge pull request #1525 from dgarske/sockclose
Cleanup of the socket close code
2018-05-03 11:42:30 -07:00
David Garske
325402cf5a Minor fix for the expected failure case use of ssl after free. Renamed skipExit to exitWithRet. 2018-05-03 10:02:59 -07:00
David Garske
89a4c98670 * Added support for expected fail test cases with example client/server and suites unit test.
* Added test for certificate with bad alt name containing a null character mid byte stream.
* Fix for issue with suites unit test where last arg in file doesn't conain data for a param, causing it to skip test.
* Fix for last test in tests/test.conf not being run for `TLSv1.2 RSA 3072-bit DH 3072-bit`.
* Moved the `tls-cert-fail.test` tests into the new expected failure suite test (`./tests/test-fails.conf`). Now it explicilty checks RSA and ECC for the no signer and no sig tests.
2018-05-03 09:40:51 -07:00
David Garske
d43aa37041 Fix for handling match on domain name that may have a null terminator inside. The check should match on len from ASN.1 reguardless of a null character. 2018-05-03 09:33:05 -07:00
Sean Parkinson
996ee78d50 Fix Client Hello version to work with static RSA 2018-05-02 10:20:55 +10:00
Chris Conlon
d60b16c5b8 Merge pull request #1531 from kaleb-himes/FIPS-CHECK-SCRIPT
revert to default but exclude for sgx/netos
2018-05-01 15:14:00 -06:00
Sean Parkinson
27c3a70e13 Allow building TLS 1.3 at draft 26 2018-05-01 15:19:18 +10:00
Sean Parkinson
5845482fc0 Fixes for tests
Fix the benchmark client to set all groups supported.
Fix TLS 1.3 test script to work on PPC - check counter in separate test.
2018-05-01 14:27:38 +10:00
kaleb-himes
c5a39b9048 rever to default but exclude for sgx/netos projects 2018-04-30 15:17:58 -06:00
toddouska
65eb79e5cd Merge pull request #1519 from dgarske/buildfixes
Build fixes for a few configurations
2018-04-30 11:49:16 -07:00
toddouska
d53716496a Merge pull request #1521 from dgarske/tlsx_returncodes
Refactor of the TLSX code to support returning error codes
2018-04-30 11:46:41 -07:00
toddouska
3ad708fb20 Merge pull request #1514 from dgarske/certdates
Enhancements and cleanup to ASN date/time
2018-04-30 11:14:38 -07:00
toddouska
8311628f93 Merge pull request #1508 from kaleb-himes/FIPS-CHECK-SCRIPT
Fips check script
2018-04-30 10:50:03 -07:00
Takashi Kojo
4c5982949e minor fix 2018-04-28 13:25:41 +09:00
toddouska
7de23d65ce Merge pull request #1517 from dgarske/sighash
Added new signature wrapper functions to allow use of hash directly
2018-04-27 16:07:56 -07:00
Takashi Kojo
6e96318785 Readme.txt 2018-04-28 06:36:56 +09:00
toddouska
8ef777315a Merge pull request #1516 from dgarske/gccarm
GCC-ARM IDE example improvements
2018-04-27 14:13:45 -07:00
Takashi Kojo
e69af98a7e fix warnings 2018-04-28 06:06:45 +09:00
Takashi Kojo
3e9028387f test project 2018-04-28 05:46:42 +09:00
Takashi Kojo
c5df9d56ad wolfssl_lib project 2018-04-28 05:39:42 +09:00
Takashi Kojo
ac791610dd USE_WOLF_TIMEVAL_T 2018-04-28 05:28:49 +09:00
Takashi Kojo
22a2b45108 duplicated fe_init for non-configure based IDE 2018-04-28 05:07:00 +09:00
Takashi Kojo
a91ac55e24 define valiable before exec statements 2018-04-28 05:05:45 +09:00
Takashi Kojo
2cc2f224f8 XTIME in LowResTimer 2018-04-28 05:03:51 +09:00
David Garske
e9dd44a667 Merge pull request #1524 from abrahamsonn/master
Doxygen landing page update
2018-04-27 11:44:00 -07:00
David Garske
3200040d1a Cleanup of the socket close code used for examples, CRL/OCSP and BIO. Now only a single macro is responsible for closing a socket CloseSocket and all duplicate code is eliminated. 2018-04-27 10:29:19 -07:00
abrahamsonn
9424a96289 Doxygen landing page update 2018-04-27 10:56:13 -06:00
connerWolfSSL
e45f0efc3f Documentation Fixes (#1520)
* Fixed documentation errors found by check_api script
* Formatting changes so that comments/API pairs are more obvious
2018-04-27 09:50:34 -07:00
David Garske
5c97374156 Fix for RSA RSS check to make sure RSA is enabled. Added TLS 1.3 DH check for key sizes. 2018-04-26 14:04:54 -07:00
David Garske
ef7b40dcab Refactor of the TLSX code to support returning error codes.
* The `SANITY_MSG_E` responses in `TLSX_SupportedVersions_GetSize`, `TLSX_SupportedVersions_Write`, `TLSX_Cookie_GetSize` and `TLSX_Cookie_Write` would incorrectly be handled.
* Added build-time checks in `tls13.c` for dependencies on `HAVE_HKDF` and `WC_RSA_PSS`.
2018-04-26 11:30:57 -07:00
David Garske
fe4cbb2a03 Fix for Jenkins report Expected Configurations Test - NIGHTLY BUILD #267, building ./configure --disable-asn --disable-ecc --disable-rsa --enable-psk --enable-sni. Reported unused variables, parameters and function. 2018-04-26 05:47:48 -07:00
David Garske
04626c6a1f Fixes build issue using wrong DES define for WC_MAX_SYM_KEY_SIZE macro. Reproduced using ./configure --enable-leanpsk --enable-des3. Fixes issue #1518. 2018-04-26 05:35:04 -07:00
David Garske
fc02003f76 Added new signature wrapper functions to allow direct use of hash wc_SignatureVerifyHash and wc_SignatureGenerateHash. These new function abstract existing signature wrapper code, so minimal code size increase. Added test cases for new functions for RSA (with and without DER encoding) and ECC. 2018-04-25 13:10:53 -07:00
toddouska
c1d4f659ad Merge pull request #1511 from ejohnstown/dist-tweak
Make Dist Automation Tweak
2018-04-25 10:56:40 -07:00
toddouska
107290b552 Merge pull request #1515 from dgarske/buildfixes
Fixes for various build configurations
2018-04-25 10:23:27 -07:00
toddouska
5c61810d4d Merge pull request #1497 from SparkiDev/tls13_draft28
Tls13 draft28
2018-04-25 10:17:37 -07:00
David Garske
a9f32c30da Fix for SGX build after C99 changes strings.h: No such file or directory. 2018-04-25 07:56:54 -07:00
David Garske
3c684886ad Fixes to resolve building --enable-tls13 --disable-ecc --enable-curve25519 --enable-ed25519. 2018-04-25 07:54:53 -07:00
David Garske
089e1b6b9b Fix for expected Configurations Test - NIGHTLY BUILD #265 and ifdef cleanup. 2018-04-25 07:54:53 -07:00
David Garske
2e6c195b43 GCC-ARM IDE improvements:
* Added documentation for `ECC_USER_CURVES`.
* Added option for RSA PSS padding support.
2018-04-24 15:26:53 -07:00
David Garske
65c9277213 More fixes from Jenkins testing. 2018-04-24 14:01:33 -07:00
toddouska
ff1559275d Merge pull request #1512 from dgarske/c99
Fixes to resolve issues with c99 compliance
2018-04-24 13:36:41 -07:00
toddouska
1ddccf63dc Merge pull request #1496 from JacobBarthelmeh/Compatibility-Layer
Compatibility layer
2018-04-24 13:33:33 -07:00
David Garske
e63afa08bd Fix a couple of minor Jenkins issues. 2018-04-24 13:25:28 -07:00
David Garske
56025f38b9 Enhancements and cleanup to ASN date/time:
* Refactor the ASN get date logic to combine shared code.
* Added new API `wc_GetDateInfo` to get raw date, format and length.
* Added new API `wc_GetCertDates` to extract certificate before/after dates as `struct tm` type.
* Added new API `wc_GetDateAsCalendarTime` which parses the raw date string and convers to `struct tm`.
* Added tests for new API's.
* Added missing tests for `wc_SetAltNames`, `wc_SetAltNamesBuffer` and `wc_SetDatesBuffer`.
* Fixed build for older `NO_TIME_H` macro.
2018-04-24 13:04:36 -07:00
David Garske
b48a9ded15 Fix to allow user to force build using WOLF_C99 option. 2018-04-23 13:52:58 -07:00
David Garske
289a282183 Fixes to resolve issues with c99 compliance (building with ./configure CFLAGS="-std=c99").
* Fix for ReadDir checking for file flag to use `S_ISREG(ctx->s.st_mode)` syntax.
* Added macro for strsep `XSTRSEP`. Added wolf implementation as `wc_strsep` enabled as C99 or `USE_WOLF_STRSEP`.
* Fix to use `gethostbyname` for c99 instead of `getaddrinfo`.
* For c99 use wolf strtok `wc_strtok`.
* Exposed API's for `wc_strtok` and `wc_strsep` when available.
* Include `sys/time.h` when available from autocon `HAVE_SYS_TIME_H` or c99.
* include `<strings.h>` when `HAVE_STRINGS_H` or c99.
2018-04-23 13:47:22 -07:00
Eric Blankenhorn
568d24c63c Coverity fixes (#1509)
* Coverity fixes 3
2018-04-23 09:20:28 -07:00
John Safranek
9831a8ac94 Added a dist-hook target to the Makefile to copy the default options.h.in over options.h. 2018-04-20 11:07:57 -07:00
thivyaashok
7d425a5ce6 Added support for an anonymous cipher suite (#1267)
* Added support for cipher suite TLS_DH_anon_WITH_AES256_GCM_SHA384
* Added test cases for verification of anonymous cipher suite
2018-04-20 10:35:37 -07:00
thivyaashok
853756a73c Added a TLS alert message 115 (#1391)
Added a new TLS alert message `unknown_psk_identity` (115) from RFC 4279,  section 2.
2018-04-20 10:23:57 -07:00
Sean Parkinson
94157634e1 TLS 1.3 fixes/improvements
Support Draft 28: able to compile code to return BAD_BINDER if no PSKs
match and certificates not to be used.
Change key share implementation to use server preference - server now
checks each client key share's group is in supported_groups extension.
Client and server examples modified to support server preference.
Application can set client's and server's supported groups by rank.
Server's supported groups is sent back in encrypted_extensions if
preferred group is not in client's list - able to be turned off at
compile time.
Application can query server's preferred group from client.
Able to compile using 0x0304 as version instead of draft version.
Fix state machine in TLS 1.3 to support unexpected hello_retry_request.
Also fixes non-blocking.
Fix resumption to use the named group from session.
Fix named group in session structure to be a 2-byte field.
Better detection of errors in message flow.
Fix DoTls13ClientHello when downgrading - don't do TLS 1.3 things.
Not downgrading on client fixed.
Downgrade protocol version from TLS 1.3 when not TLS 1.3 ciphersuite.
Get downgrading from TLS 1.3 and resumption working.
Change earlyData value to an enum.
Support no extensions data (as opposed to zero length extension data) in
TLS 1.3 ClientHello.
Check PSK cipher suite is available to both client and server before
using.
Check first PSK identity chosen when server says it is using early data
at client.
Check PSK extension is last in client_hello on server.
Check the PSK cipher suite to use is supported on client.
Check the returned cipher suite for pre-shared keys is the same as
client expects.
Send alert decrypt_error when verification fails in certificate_verify
or finished message doesn't match calculated value.
Fail when certificate messages recieved in handshake when using PSK.
Validate on the server that EndOfEarlyData message has been recieved
before finished message when server sent EarlyData extension.
2018-04-20 09:44:02 +10:00
kaleb-himes
3476a9b55a versions for Baxter updated, new tag in fips v3.12.6 2018-04-19 15:24:22 -06:00
David Garske
9e4bb3fee1 Merge pull request #1504 from SparkiDev/nginx-pemenc
Key derivation for encrypted PEM uses salt length of 8 in OpenSSL
2018-04-19 11:23:39 -07:00
David Garske
f7cb5c5c15 Merge pull request #1507 from kaleb-himes/README-update
Bring special notes inline with commit 8edbca1b21b6fcd6d09910c66bbf35…
2018-04-19 11:17:25 -07:00
JacobBarthelmeh
b7c61a72c8 Merge pull request #1503 from kojo1/Ticket3793
HMAC with SHA2
2018-04-19 09:38:55 -06:00
kaleb-himes
23615dd15f Bring special notes inline with commit 8edbca1b21 2018-04-18 09:58:03 -06:00
Takashi Kojo
bf950198f2 api.c: option conditions 2018-04-18 13:02:40 +09:00
Sean Parkinson
6689ee965a Key derivation for encrypted PEM uses salt length of 8 in OpenSSL 2018-04-18 12:37:06 +10:00
Takashi Kojo
7c7913264b remove printf 2018-04-18 09:25:24 +09:00
Takashi Kojo
56af3a5b36 add HMAC SHA2 2018-04-18 08:47:39 +09:00
Jacob Barthelmeh
57d40bc6d1 remove internal data types in ssl.h 2018-04-17 15:57:23 -06:00
John Safranek
11065f9222 added the missing macro file ax_require_defined.m4. 2018-04-17 13:23:17 -07:00
brian@tangent.org
48b3aa90d3 Update autoconf m4 files, except pthreads which should be its own commit 2018-04-17 13:20:33 -07:00
John Safranek
a116b5ba83 Merge pull request #1500 from BrianAker/patch-1
Adding Copyright notice to autoconf files.
2018-04-17 11:15:36 -07:00
toddouska
09706a4ed2 Merge pull request #1488 from SparkiDev/tls13_perf
Changes for interop and performance
2018-04-16 09:16:13 -07:00
Brian Aker
3179d6ce2b Adding Copyright notice to autoconf files. 2018-04-14 22:30:02 -10:00
toddouska
942c720dc4 Merge pull request #1499 from ejohnstown/aes-asm
AES assembly file name change
2018-04-13 11:23:03 -07:00
Jacob Barthelmeh
f9eda5d790 free test certificate after use 2018-04-13 09:16:22 -06:00
Eric Blankenhorn
a0d8327320 Coverity fixes 2 (#1493)
* Coverity fixes for wolfcrypt folder
* Fixes for remaining issues
* Fixes for test files
2018-04-13 05:35:18 -07:00
Sean Parkinson
9600266483 WOLFSSL_FUNC_TIME changes
Warning in code about using this define.
Remove usage of WOLFSSL_FUNC_TIME from server.c.
2018-04-13 12:13:31 +10:00
Sean Parkinson
0b47811c46 Changes for interop and performance
Changes made to test.h to allow interop of PSK with OpenSSL.
Changes to allow server to pre-generate key share and perform other
operations at later time.
Fix ChaCha20 code header to have bigger state to support assembly code
for AVX1.
Fix Curve25519 code to use define instead.
Change Curve25519 to memset all object data on init.
Change Poly1305 to put both sizes into one buffer to avoid a second call
to wc_Poly1305Update().
Added WOLFSSL_START and WOLFSSL_END API and calls to show time of
protocol message function enter and leave to analyse performance
differences.
Moved Curve25519 code in KeyShare extension out of general ECC code.
2018-04-13 12:01:20 +10:00
John Safranek
425cee64a7 AES assembly file name change
Some versions of GCC on the Mac will not run the file aes_asm.s through the preprocessor. There are some ifdefs in the file that are included when they shouldn't be. This is not a problem on Linux. Renaming the file to have a capital S extension forces the assembler to run with the preprocessor.
2018-04-12 16:47:58 -07:00
toddouska
84f7bd8cde Merge pull request #1494 from dgarske/wpas
Fix for building wpa_supplicant
2018-04-12 13:49:31 -07:00
toddouska
eacd98fe4e Merge pull request #1491 from dgarske/config
Configure improvements and new options
2018-04-12 13:48:20 -07:00
toddouska
8f1e8be2d0 Merge pull request #1490 from dgarske/hashoid_cleanup
Hash OID cleanup
2018-04-12 13:46:47 -07:00
Jacob Barthelmeh
cfaed48f90 adjust GetInt call with ASN1 integer to big number 2018-04-12 14:40:20 -06:00
Jacob Barthelmeh
df06707496 Handle larger values with ASN1 INTEGER structure 2018-04-12 14:07:29 -06:00
David Garske
cf1230d232 Fix for building wpa_supplicant (./configure --enable-wpas) after PemToDer refactor in PR #1467. 2018-04-12 06:53:44 -07:00
David Garske
1f7b954d47 Fix for wc_GetCTC_HashOID in FIPS mode. Uses the new wc_HashTypeConvert to handle conversion from unique WC_ALGO (int) to WC_HASH_TYPE_ALGO (enum wc_HashType). 2018-04-12 06:51:23 -07:00
David Garske
ce6728951f Added a new --enable-opensslall option, which ensures all openssl features are enabled. Documented and tested building the various open source defines we support in our build. 2018-04-11 13:54:07 -07:00
David Garske
689203d310 Added some more features to the --enable-all. Added new --enable-webclient option. 2018-04-11 13:54:07 -07:00
David Garske
ee5d78f84f Added new wc_OidGetHash API for getting the hash type from a hash OID. Refactor PKCS7 and PKCS12 to use new API and reduce duplicate ocde. Updated wc_GetCTC_HashOID to use wc_HashGetOID and maintain back compat. 2018-04-11 13:53:30 -07:00
toddouska
d85580691b Merge pull request #1492 from dgarske/fix_noasn_pwdbased
Fixes for ASN disabled and PWDBASED enabled / Win FIPS
2018-04-11 12:09:30 -07:00
David Garske
83bfdb1594 Fix for issue with unique hash types on ctoacrypt FIPS using different values than WC_HASH_TYPE_*. Add new API wc_HashTypeConvert to handle the conversion between enum wc_HashType and int. For FIPS it uses a switch() to convert and for non-FIPS it uses a simple cast. Changed the pwdbased_test to return actual ret instead of adding values (made it difficult to track down error location). 2018-04-11 09:30:30 -07:00
David Garske
3f3e332a3a Fix for evp.c statement will never be executed in wolfSSL_EVP_CIPHER_CTX_block_size. 2018-04-11 08:18:39 -07:00
David Garske
38aa56cc40 Fix for Windows FIPS build in current master. Resolves issue with missing DES/AES key size enums. 2018-04-10 20:07:14 -07:00
David Garske
565f394972 Fix for building without ASN and PWDBASED enabled (./configure --disable-asn --enable-pwdbased). 2018-04-10 16:36:11 -07:00
toddouska
e25da80766 Merge pull request #1467 from dgarske/asnpemtoder
PEM Encrypted Keys cleanup and PemToDer move to wolfCrypt asn.c
2018-04-09 16:33:30 -07:00
David Garske
a38576146e * Added support for disabling PEM to DER functionality using WOLFSSL_PEM_TO_DER. This allows way to use with DER (ASN.1) certificates only in an embedded environment. This option builds, but internal make check requires PEM support for tests.
* More cleanup to move PEM functions from ssl.c to asn.c (`wolfSSL_CertPemToDer`, `wolfSSL_KeyPemToDer`, `wolfSSL_PubKeyPemToDer`). Renamed these API's to `wc_` and added backwards compatability macro for old function names.
2018-04-09 13:28:15 -07:00
David Garske
5a46bdf6f6 Added unit test for using encrypted keys with TLS. Only works with --enable-des3, since the keys are all encrypted with DES3 (also requires either --enable-opensslextra or --enable-enckeys). 2018-04-09 13:28:15 -07:00
David Garske
d68a6fb4c7 Make sure wc_encrypt.h includes the ciphers. 2018-04-09 13:28:15 -07:00
David Garske
98c186017a Fixes for build failures. Added new WC_MAX_SYM_KEY_SIZE macro for helping determine max key size. Added enum for unique cipher types. Added CHACHA_MAX_KEY_SZ for ChaCha. 2018-04-09 13:28:15 -07:00
David Garske
2c72f72752 Fixes for FIPS, sniffer (w/o enc keys), scan-build issues and backwards compatability. 2018-04-09 13:28:15 -07:00
David Garske
9be11bf62c Fix to correct missing wolfSSL_EVP_BytesToKey header int he NO_MD5 case. 2018-04-09 13:28:15 -07:00
David Garske
1f00ea2115 Fixes for various build issues with type casting and unused functions. Moved mystrnstr to wc_port.c. Added some additional argument checks on pwdbased. 2018-04-09 13:28:15 -07:00
David Garske
e60032b961 Fix for duplicate API defs. 2018-04-09 13:28:15 -07:00
David Garske
b01535b483 Fix for stray character. 2018-04-09 13:28:15 -07:00
David Garske
8a31f13cb6 Remove obsolete WOLFSSL_PEMPUBKEY_TODER_DEFINED header logic. 2018-04-09 13:28:15 -07:00
David Garske
6de8348918 Fixes for various build configurations. Added --enable-enckeys option to enable support for encrypted PEM private keys using password callback without having to use opensslextra. Moved ASN CryptKey function to wc_encrypt.c as wc_CryptKey. Fixup some missing heap args on XMALLOC/XFREE in asn.c. 2018-04-09 13:28:15 -07:00
David Garske
1315fad7dc Added ForceZero on the password buffer after done using it. 2018-04-09 13:28:15 -07:00
David Garske
3a8b08cdbf Fix to move the hashType out of EncryptedInfo. Fix for parsing "DEC-Info: ". Fix for determining when to set and get ivSz. 2018-04-09 13:28:15 -07:00
David Garske
c83e63853d Refactor unqiue hash types to use same internal values (ex WC_MD5 == WC_HASH_TYPE_MD5). Refactor the Sha3 types to use wc_ naming. 2018-04-09 13:28:15 -07:00
David Garske
264496567a Improvements to EncryptedInfo. Added build option WOLFSSL_ENCRYPTED_KEYS to indicate support for EncryptedInfo. Improvements to wc_PBKDF1 to support more hash types and the non-standard extra data option. 2018-04-09 13:28:15 -07:00
David Garske
f9e830bce7 First pass at changes to move PemToDer into asn.c. 2018-04-09 13:28:14 -07:00
toddouska
2ded38ec2b Merge pull request #1485 from dgarske/tlskeygeneccorcurve
Fix TLS 1.3 with ED25519/CURVE25519 enabled and ECC disabled
2018-04-09 12:12:31 -07:00
David Garske
21833e245f Fix TLS 1.3 with ECC disabled and CURVE25519 enabled. Resolves issue with using ./configure --disable-ecc --enable-curve25519 --enable-ed25519 --enable-tls13. Refactor TLSX_KeyShare_GenEccKey to support either ECC or CURVE25519. Fix for PemToDer to handle ED25519 without ECC enabled. 2018-04-09 10:10:08 -07:00
David Garske
2a460d3d05 Merge pull request #1484 from embhorn/coverity
Coverity fixes
2018-04-06 18:18:38 -07:00
Eric Blankenhorn
36b9b0b558 Updates from code review 2018-04-06 17:29:27 -05:00
Eric Blankenhorn
86767e727c Fixes for CID 185033 185028 185142 185064 185068 185079 185147 2018-04-06 13:15:16 -05:00
Eric Blankenhorn
d2c1a1906d Fixes for CID 184980 185017 185047 185167 2018-04-06 11:10:37 -05:00
toddouska
6090fb9020 Merge pull request #1483 from dgarske/winvs
Fixes for unused `heap` warnings
2018-04-06 09:01:49 -07:00
toddouska
e56209cee4 Merge pull request #1482 from dgarske/nourand
Added new define `NO_DEV_URANDOM` to disable the use of `/dev/urandom`
2018-04-06 09:00:37 -07:00
Eric Blankenhorn
920e6ed911 Fix warning in ssl.c 2018-04-06 09:30:54 -05:00
Eric Blankenhorn
c6ad885459 Coverity fixes for tls.c/n CID 184996 185112 185122 2018-04-06 09:08:00 -05:00
Eric Blankenhorn
ec429e50b1 Fixes for ssl.c 2018-04-06 07:45:12 -05:00
David Garske
426335b68f Found additional VS unused heap warnings. Replace tabs with 4-spaces. 2018-04-05 12:28:32 -07:00
toddouska
2b48a074eb Merge pull request #1480 from dgarske/extcache
Fix for HAVE_EXT_CACHE callbacks not being available without OPENSSL_EXTRA
2018-04-05 10:52:44 -07:00
David Garske
bab62cc435 Added new define NO_DEV_URANDOM to disable the use of /dev/urandom. Added better named define WC_RNG_BLOCKING to indicate block w/sleep(0) is okay. 2018-04-05 09:34:43 -07:00
David Garske
ede006b3e1 Merge pull request #1479 from JacobBarthelmeh/HardwareAcc
Fix PIC32 AES-CBC and add test case
2018-04-05 09:15:08 -07:00
Eric Blankenhorn
5439402c1d Refactor for max record size (#1475)
* Added new internal function `wolfSSL_GetMaxRecordSize`.
* Modified tls_bench to use dynamic buffer based on max record size.
* Added comment for DTLS maxFragment calculation.
2018-04-05 09:11:58 -07:00
David Garske
412d4d76ee Fix for HAVE_EXT_CACHE callbacks not being available without OPENSSL_EXTRA defined. Added tests for external cache callbacks. 2018-04-05 07:10:04 -07:00
toddouska
a1d6bc68de Merge pull request #1478 from dgarske/fixeccmaxsize
Fix for ECC max bits
2018-04-04 16:27:15 -07:00
Jacob Barthelmeh
815219b589 fix pic32 AES-CBC and add test case 2018-04-04 16:09:11 -06:00
David Garske
bc76f57959 Fix for ECC max bits ( MAX_ECC_BITS). 2018-04-04 13:39:14 -07:00
David Garske
a78c6ba4ea Fix for unused heap warnings. 2018-04-04 12:51:45 -07:00
toddouska
aa660bc9b8 Merge pull request #1477 from dgarske/fix_strtok
Fix for issue with `wc_strtok` function declaration
2018-04-04 12:35:38 -07:00
David Garske
2189827287 Fix for issue with wc_strtok function declaration not being available because of include order. Fixes issue #1469. 2018-04-04 10:41:14 -07:00
toddouska
0da4a8f1fe Merge pull request #1476 from dgarske/fix_haveextcache
Fix building with `HAVE_EXT_CACHE` when `OPENSSL_EXTRA` is not defined
2018-04-04 10:34:07 -07:00
toddouska
2deb977ecf Merge pull request #1473 from dgarske/pkcs7_norsa
Enabled PKCS7 support without RSA
2018-04-04 10:33:11 -07:00
toddouska
960d2ec031 Merge pull request #1471 from JacobBarthelmeh/Fuzzer
sanity check on buffer read
2018-04-04 10:31:55 -07:00
toddouska
1196a3b64d Merge pull request #1455 from dgarske/nitroxv
Nitrox V fixes and additions
2018-04-04 10:27:53 -07:00
David Garske
5702e8ee48 Fix building with HAVE_EXT_CACHE when OPENSSL_EXTRA is not defined. Fixes issue #1474. 2018-04-04 09:02:52 -07:00
David Garske
c288d0815d Added support for building and using PKCS7 without RSA (assuming ECC is enabled). 2018-04-03 09:26:57 -07:00
David Garske
0c898f513d Nitrox V fixes and additions:
* Added support for ECC, AES-GCM and HMAC (SHA-224 and SHA3).
* Fixes for Nitrox V with TLS.
* ECC refactor for so key based `r` and `s` apply only when building with `WOLFSSL_ASYNC_CRYPT`.
* ECC refactor for `e` and `signK` to use key based pointer for Nitrox V.
* Improved the Nitrox V HMAC to use start, update and final API's instead of caching updates.
* Fix for Intel QuickAssist with unsupported HMAC hash algos using `IntelQaHmacGetType` (such as SHA3).
* Added new API `wc_mp_to_bigint_sz` to zero pad unsigned bin.
* Fix for AES GCM to gate HW use based on IV len in aes.c and remove the gate in test.c.
* Implemented workaround to use software for AES GCM Nitrox V hardware and 13 byte AAD length for TLS.
* New debug option `WOLFSSL_NITROX_DEBUG` to add pending count.
2018-04-03 09:14:20 -07:00
Eric Blankenhorn
adb817e8d2 Feature update for tls_bench test that will allow passing in arguments (#1466)
* Feature update for tls_bench test that will allow passing in command line arguments that enable test features.
* Fix type conversion errors.
* Fixed use of uninitialized data. Declare DH arrays as const.
2018-04-02 14:00:34 -07:00
Jacob Barthelmeh
6a1013888f sanity check on buffer read 2018-04-02 14:30:58 -06:00
JacobBarthelmeh
b33feb9dbf Merge pull request #1470 from kojo1/EVP
EVP_CipherUpdate return value for inlen == 0
2018-04-02 14:03:48 -06:00
Takashi Kojo
c60d9ff983 if(ret != 1) error 2018-04-01 13:27:08 +09:00
Takashi Kojo
1c0b84d47d openSSL compatibility, EVP_CipherUpdate, if(inlen == 0)return 1; 2018-04-01 12:13:18 +09:00
kaleb-himes
effaa18b32 Fixing some kinks 2018-03-30 12:46:59 -06:00
Chris Conlon
87c1658ab8 Merge pull request #1464 from jrblixt/unitTest_api_addPkcs7-nightlyBuildFix2
Nightly build fix for PKCS#7 errors.
2018-03-29 15:26:11 -06:00
toddouska
86a5330b31 Merge pull request #1462 from ejohnstown/cxxflags
Configure Update
2018-03-28 16:41:15 -07:00
John Safranek
e59bb43878 Configure Update
Revise default compiler optimization flags enable name to something more descriptive.
2018-03-28 13:19:46 -07:00
toddouska
3a8a7b8a55 Merge pull request #1458 from dgarske/cleanupthreaded
wolfCrypt ECC FP cleanup for thread local storage cases
2018-03-28 12:25:20 -07:00
John Safranek
e6a19bb1e8 Configure Update
Add a disable option to turn off the default optimization options so the user may set their own in a CFLAGS.
2018-03-27 16:41:39 -07:00
jrblixt
1cd6075b9d Nightly build fix. 2018-03-27 16:54:14 -06:00
David Garske
c9d840ed8d Fix for the HAVE_THEAD_LS case with FP_ECC where starting a new thead and doing ECC operations and not calling wc_ecc_fp_free. Added missing wolfCrypt_Init to API docs. 2018-03-27 14:29:39 -07:00
toddouska
f62d372bbe Merge pull request #1461 from cconlon/netbsd-update
update NetBSD fips-check version to include selftest ECDSA fix
2018-03-27 13:28:49 -07:00
toddouska
9de2bdce24 Merge pull request #1460 from dgarske/winecc
Enable ECC, AES-GCM and SHA-512/384 by default in VS
2018-03-27 13:28:23 -07:00
toddouska
504b13530e Merge pull request #1459 from cconlon/selftest_fixes
Fix for wolfCrypt test and CAVP selftest build
2018-03-27 13:27:28 -07:00
John Safranek
477d2413cd Configure Update
1. Initialize CXXFLAGS (C++ compiler flags) the same way we do CFLAGS.
2. Add CPPFLAGS (C preprocessor flags) to the options.h file with the other CFLAGS.
2018-03-27 10:23:44 -07:00
toddouska
9f231e0020 Merge pull request #1453 from dgarske/ecc508a_linux
Support for building with `WOLFSSL_ATECC508A` on other targets
2018-03-27 09:57:39 -07:00
David Garske
42e6ea8685 Added ECC_TIMING_RESISTANT to eliminate harden warnings. 2018-03-26 15:54:29 -07:00
David Garske
8fbc765dba Enable ECC, AES-GCM and SHA-512/384 by default in Windows Visual Studio projects. 2018-03-26 15:09:51 -07:00
Chris Conlon
9edaac8e1c update NetBSD fips-check version to include selftest ECDSA fix 2018-03-26 14:37:39 -06:00
Chris Conlon
021560035b fix unused var warning for extNameConsOid with IGNORE_NAME_CONSTRAINTS 2018-03-26 09:43:37 -06:00
Chris Conlon
d2aa7d0a37 exclude ecc_import_unsigned test when building for CAVP selftest 2018-03-23 16:31:17 -06:00
Chris Conlon
c08f5b86cf Merge pull request #1444 from jrblixt/unitTest_api_addPkcs-PR03162018
Unit test functions for PKCS#7.
2018-03-23 10:00:33 -06:00
toddouska
aee6f4d0ca Merge pull request #1457 from dgarske/base16
Base16/64 improvements
2018-03-22 15:14:57 -07:00
jrblixt
316a2b9fb4 Review changes: Chris. 2018-03-22 15:35:25 -06:00
toddouska
a92696edec Merge pull request #1454 from dgarske/noprivkey
Support for not loading a private key when using `HAVE_PK_CALLBACKS`
2018-03-22 12:47:22 -07:00
toddouska
040e0ab752 Merge pull request #1456 from dgarske/iocbname
Refactor IO callback function names to use `_CTX_`
2018-03-22 12:40:48 -07:00
toddouska
43f4faa7be Merge pull request #1452 from cconlon/mcapifix
fix unused param warning with NO_ERROR_STRINGS
2018-03-22 12:39:19 -07:00
David Garske
3bf325290d Base16/64 improvements:
* Add define `WOLFSSL_BASE16` to explicitly expose base16 support.
* Add `./configure --enable-base16` option (disabled by default in configure, but enabled in coding.h when required internally).
* Added base16 tests in test.c `base16_test`.
* Enabled base64 decode tests when `WOLFSSL_BASE64_ENCODE` is not defined.
2018-03-22 10:36:56 -07:00
David Garske
0cff2f8b10 Replace use of PUB_KEY_SIZE (from CryptoAuthLib) with new ECC_MAX_CRYPTO_HW_PUBKEY_SIZE. 2018-03-22 09:45:27 -07:00
David Garske
8c4bfd825a Support for building the ATECC508A without WOLFSSL_ATMEL defined, which enables features specific to Atmel Studio Framework (ASF) and an embedded target. This allows for building with WOLFSSL_ATECC508A defined on other targets such as Linux. 2018-03-22 09:39:21 -07:00
Chris Conlon
2989c73411 Merge pull request #1447 from JacobBarthelmeh/PKCS7
remove pkcs7 requirement of x963kdf when ecc is disabled
2018-03-22 10:01:55 -06:00
David Garske
e564c973b6 Refactor IO callback function names to use _CTX_ to eliminate confusion about the first parameter. 2018-03-21 16:08:55 -07:00
David Garske
4b51431546 Fix for possible unused ctx in wolfSSL_CTX_IsPrivatePkSet when no ECC, RSA or ED25519. 2018-03-21 15:46:08 -07:00
toddouska
104f7a0170 Merge pull request #1451 from JacobBarthelmeh/Optimizations
Adjust X509 small build and add more macro guards
2018-03-21 15:15:27 -07:00
toddouska
f3d0879ed7 Merge pull request #1449 from dgarske/asn_nullterm
ASN improvements for building header/footer in `wc_DerToPemEx`
2018-03-21 15:13:46 -07:00
toddouska
2a356228be Merge pull request #1445 from SparkiDev/wpas_fix
Fixes for wpa_supplicant
2018-03-21 15:11:43 -07:00
David Garske
dbb34126f6 * Added support for not loading a private key for server or client when HAVE_PK_CALLBACK is defined and the private PK callback is set. Tested with all cipher suites, TLS 1.2/1.3, client/server certs, RSA/ECC/ED25519.
* Added PK callback context tests for client/server examples (`SetupPkCallbackContexts`).
* Added new test define for `TEST_PK_PRIVKEY` to allows simulating hardware based private key.
* Added new test.h function for loading PEM key file and converting to DER (`load_key_file`).
* Added way to get private key signature size (`GetPrivateKeySigSize`).
* Added new ECC API `wc_ecc_sig_size_calc` to return max signature size for a key size.
* Added inline comments to help track down handshake message types.
* Cleanup of RSS PSS terminating byte (0xbc) to use enum value.
* Fixed bug with PK callback for `myEccVerify` public key format.
* Fixed bug with PK callback for ED25519 verify key buffer in DoServerKeyExchange.
2018-03-21 11:27:08 -07:00
Jacob Barthelmeh
26bb86690a fix for unused parameter warning 2018-03-21 10:06:06 -06:00
Chris Conlon
14bb14c6ab fix unused param warning with NO_ERROR_STRINGS 2018-03-21 09:56:08 -06:00
Jacob Barthelmeh
90f97f4a5a fix for unused variable 2018-03-21 09:16:43 -06:00
Jacob Barthelmeh
0aa3b5fa0e macros for conditionally compiling code 2018-03-21 00:09:29 -06:00
Jacob Barthelmeh
d9917049c4 use bit fields with WOLFSSL_CTX structure 2018-03-20 22:07:42 -06:00
Jacob Barthelmeh
087df8f1cd more macro guards to reduce size 2018-03-20 17:15:16 -06:00
Sean Parkinson
c9c2e1a8a7 Don't base signature algorithm support on certificate
The signature algorithm support is what you can do with another key, not
what you can do with your key.
2018-03-21 08:33:54 +10:00
Jacob Barthelmeh
4d65e4cc1e add WOLFSSL_NO_DH186 macro to optionally compile out DH186 function 2018-03-20 15:31:20 -06:00
Jacob Barthelmeh
df6ea54cd5 add support for PKCS8 decryption to OPENSSL_EXTRA_X509_SMALL build 2018-03-20 15:06:35 -06:00
jrblixt
2788183e79 Known config. tests fix. 2018-03-20 14:35:26 -06:00
toddouska
bba0a3e88c Merge pull request #1448 from dgarske/ecc_cleanup
ECC import/export cleanups and additions
2018-03-20 11:05:15 -07:00
toddouska
38d1eea8cd Merge pull request #1446 from SparkiDev/tls13_draft27
TLS v1.3 support for Draft 23 and Draft 27
2018-03-20 09:13:03 -07:00
toddouska
18879ce271 Merge pull request #1440 from dgarske/VerifyRsaSign_PKCallback
Added VerifyRsaSign PK callback
2018-03-20 09:02:18 -07:00
David Garske
764aec071c Further improvement to the null termination and newline logic in wc_DerToPemEx. 2018-03-19 22:58:18 -07:00
David Garske
59aa893260 Cleanup ECC point import/export code. Added new API wc_ecc_import_unsigned to allow importing public x/y and optional private as unsigned char. Cleanup wc_ecc_sign_hash to move the hardware crypto code into a separate function. Added missing tests for wc_ecc_export_public_raw, wc_ecc_export_private_raw and new test for wc_ecc_import_unsigned. 2018-03-19 13:28:57 -07:00
toddouska
87c70e76a9 Merge pull request #1441 from dgarske/ocsp_nb
Fix for handling OCSP with non-blocking
2018-03-19 12:05:59 -07:00
David Garske
2cc1a1c5bf Renamed callbacks for VerifySign to SignCheck. Switched the new callback context to use the one for the sign. Fix for callback pointer check on VerifyRsaSign. Added inline comments about the new RsaSignCheckCb and RsaPssSignCheckCb. 2018-03-19 10:19:24 -07:00
toddouska
cb8f8a953b Merge pull request #1438 from SparkiDev/nginx_pem_write
Fix PEM_write_bio_X509 to work with new BIO code
2018-03-19 09:13:51 -07:00
toddouska
1040cf9caa Merge pull request #1437 from dgarske/eccrsrawtosig
Added new ECC API `wc_ecc_rs_raw_to_sig`
2018-03-19 09:12:39 -07:00
Jacob Barthelmeh
467608b6c9 remove pkcs7 requirement of x963kdf when ecc is disabled 2018-03-19 10:08:46 -06:00
toddouska
7ce2efd572 Merge pull request #1431 from JacobBarthelmeh/Optimizations
more aes macro key size guards
2018-03-19 09:07:05 -07:00
toddouska
b28c6a394f Merge pull request #1428 from JacobBarthelmeh/Certs
Update to certificate renew scripts
2018-03-19 09:05:15 -07:00
Sean Parkinson
bd53d7ba59 TLS v1.3 support for Draft 23 and Draft 27
Draft 24: Second ClientHello usees version 0x0303 - no change.
Draft 25: The record layer header is now additional authentication data to
encryption.
Draft 26: Disallow SupportedVersion being used in ServerHello for
negotiating below TLS v1.3.
Draft 27: Older versions can be negotiated (by exclusion of 0x0304) in
SupportedVersion - no change.
2018-03-19 16:15:02 +10:00
Sean Parkinson
b325e0ff91 Fixes for wpa_supplicant 2018-03-19 11:46:38 +10:00
John Safranek
465f1d491f Merge pull request #1443 from cconlon/dhagree
check z against 1 in wc_DhAgree()
2018-03-17 20:15:31 -07:00
David Garske
250cd3b7eb Merge pull request #1433 from SparkiDev/sp_size
Fix size on Intel and improve 32-bit C code performance
2018-03-16 17:05:46 -07:00
jrblixt
1aba6e9b44 Prepare for PR. 2018-03-16 17:07:28 -06:00
Chris Conlon
3118c8826b check z against 1 in wc_DhAgree() 2018-03-16 15:59:48 -06:00
kaleb-himes
323abafc1c backup updates for SGX and DB jobs 2018-03-16 15:34:30 -06:00
David Garske
fa73f7bc55 Fix for handling OCSP with non-blocking. The HashInput function was being called on the re-entry, which produced a bad mac response from server. Also cleanup for some of the WC_PENDING_E logic for the non-async cases to reduce code size. 2018-03-16 12:05:07 -07:00
David Garske
e858ec11ac Fix unused arg when building with pk callbacks disabled. 2018-03-16 09:37:07 -07:00
David Garske
ed7774e94a Added new callbacks for the VerifyRsaSign, which uses a private key to verify a created signature. The new callbacks API's are wolfSSL_CTX_SetRsaVerifySignCb and wolfSSL_CTX_SetRsaPssVerifySignCb. These use the same callback prototype as the CallbackRsaVerify and use the same context. 2018-03-15 14:43:41 -07:00
JacobBarthelmeh
f70351242b Merge pull request #1432 from kojo1/mdk5
3.14.0 update on mdk5 pack
2018-03-15 14:47:14 -06:00
Sean Parkinson
3f99a2a391 Fix PEM_write_bio_X509 to work with new BIO code 2018-03-15 10:45:49 +10:00
Jacob Barthelmeh
a207cae0f4 add some more macro guards to reduce size 2018-03-14 17:24:23 -06:00
Jacob Barthelmeh
607bd96317 add ocsp cert renew and test-pathlen to script 2018-03-14 16:35:16 -06:00
Sean Parkinson
4d1986fc21 Improve speed of 32-bit C code 2018-03-15 08:33:04 +10:00
David Garske
9ccf876a21 Added new ECC API wc_ecc_rs_raw_to_sig to take raw unsigned R and S and encodes them into ECDSA signature format. 2018-03-14 10:59:25 -07:00
David Garske
d8fe341998 First pass at added PK_CALLBACK support for VerifyRsaSign. 2018-03-14 09:54:18 -07:00
toddouska
717ba83deb Merge pull request #1434 from SparkiDev/tls13_multi_recs
Fix multiple handshake messages in last record of certs
2018-03-14 09:46:32 -07:00
toddouska
262aa7c9a4 Merge pull request #1429 from JacobBarthelmeh/Testing
fix for build with NTRU and certgen
2018-03-14 09:42:39 -07:00
Sean Parkinson
afe300acc0 Fix multiple handshake messages in last record of certs 2018-03-14 16:37:58 +10:00
Takashi Kojo
8d750a22b1 Update project files 2018-03-14 08:15:18 +09:00
Takashi Kojo
1de291be8d macro INLINE 2018-03-14 07:14:07 +09:00
Sean Parkinson
c4dfa41088 SP improvements
Tag functions to not be inlined so llvm doesn't make huge builds.
Add sp_mod to support new DH key generation function.
2018-03-13 14:16:48 +10:00
Jacob Barthelmeh
8fb3ccacb7 opensslextra fixs and warning for unused variable 2018-03-12 18:05:24 -06:00
Jacob Barthelmeh
c41bc8205c account for build with no aes and no des3 2018-03-12 16:41:26 -06:00
Jacob Barthelmeh
6b04ebe3a4 fix for compiling with different build settings 2018-03-12 16:12:10 -06:00
Jacob Barthelmeh
fa21fb4a27 more aes macro key size guards 2018-03-12 15:44:48 -06:00
toddouska
15805d626d Merge pull request #1430 from SparkiDev/srp_test_fix
Fix SRP test to have 2048 bit test data
2018-03-12 11:33:50 -07:00
toddouska
b297d9dce0 Merge pull request #1427 from JacobBarthelmeh/Compatibility-Layer
return value on bad mutex with error nodes and add x509 host check to OPENSSL_EXTRA
2018-03-12 11:33:20 -07:00
Sean Parkinson
00203d66d5 Fix SRP test to have 2048 bit test data 2018-03-12 17:32:27 +10:00
Jacob Barthelmeh
8fdb99443a fix for build with NTRU and certgen 2018-03-09 14:21:43 -07:00
David Garske
72f390a102 Merge pull request #1361 from connerWolfSSL/doxygen_project
wolfSSL with Doxygen Documentation
2018-03-09 13:17:54 -08:00
Jacob Barthelmeh
e41f5de556 default generate ed25519 cert with renew and add ecc crls to script 2018-03-09 14:09:34 -07:00
Jacob Barthelmeh
d9738563af add ed25519 certificate generation to renewcerts.sh 2018-03-09 10:43:36 -07:00
Jacob Barthelmeh
f6b5427f2b bad sig certificate renew script 2018-03-09 09:50:52 -07:00
Jacob Barthelmeh
849e1eb10d updating renewcerts script 2018-03-09 00:35:14 -07:00
Jacob Barthelmeh
e0afec0600 fix RSA macro, tickets without server, and add test case 2018-03-08 14:36:43 -07:00
Jacob Barthelmeh
e960e0544a try to clear out error queue with failing mutex 2018-03-08 11:49:16 -07:00
Jacob Barthelmeh
2a0ef55a66 fix for check on return value with mutex error case 2018-03-08 11:26:22 -07:00
Jacob Barthelmeh
74475a26ba compile more functions in with OPENSSL_EXTRA 2018-03-08 11:06:40 -07:00
connerwolfssl
0535a8a68a Added isntall flag, improved pathing for using doxygen to generate documentation 2018-03-08 10:53:44 -07:00
connerwolfssl
9e6b9a3793 Merge https://github.com/wolfssl/wolfssl into doxygen_project 2018-03-08 08:10:10 -07:00
connerwolfssl
fcae6d46be Merge https://github.com/wolfssl/wolfssl into doxygen_project 2018-03-06 10:16:21 -07:00
connerwolfssl
5a1bdff0bd Added wolfssl vs doxygen api checking, removed storing warnings and errors in files 2018-03-06 10:13:13 -07:00
connerwolfssl
ba40a71a3c added script so ensure doxygen api documentation matches wolfssl api 2018-03-01 10:27:30 -07:00
connerwolfssl
fab99f9f44 Merge https://github.com/wolfssl/wolfssl into doxygen_project 2018-02-08 10:13:43 -07:00
connerwolfssl
17e88b47f6 Migrated documentation directory to doc. README updated. Error fixes. Moved make options to doc/include.am 2018-02-08 10:05:30 -07:00
connerwolfssl
f5c33a9362 added force flag to not through warning if no file present to remove 2018-02-01 10:23:10 -07:00
connerwolfssl
841e75afcf Merge branch 'master' of https://github.com/wolfssl/wolfssl 2018-02-01 09:47:13 -07:00
connerwolfssl
a6bab49f8a fixed bn.h header 2018-02-01 09:43:11 -07:00
connerwolfssl
fc754ba88e Merge https://github.com/wolfssl/wolfssl 2018-01-09 14:15:39 -07:00
connerwolfssl
e6cef73658 html and pdf documentation for wolfssl, generated by doxygen 2018-01-09 14:12:06 -07:00
connerwolfssl
ad4cf69993 Moved doxygen API comments in to a seperate directory 2017-12-29 10:57:14 -07:00
273 changed files with 56787 additions and 10590 deletions

View File

@@ -87,6 +87,11 @@ extern "C" {
#undef WC_NO_HARDEN
#define WC_NO_HARDEN
#endif
/* RSA PSS Support */
#if 0
#define WC_RSA_PSS
#endif
#else
#define NO_RSA
#endif
@@ -378,6 +383,9 @@ extern unsigned int custom_rand_generate(void);
#undef NO_CRYPT_BENCHMARK
//#define NO_CRYPT_BENCHMARK
#undef WOLFCRYPT_ONLY
//#define WOLFCRYPT_ONLY
/* In-lining of misc.c functions */
/* If defined, must include wolfcrypt/src/misc.c in build */
/* Slower, but about 1k smaller */

View File

@@ -64,3 +64,4 @@ AES GCM: `GCM_SMALL`, `GCM_WORD32` or `GCM_TABLE`: Tunes performance and flash/m
* `USE_SLOW_SHA512`: Over twice as small, but 50% slower
* `USE_CERT_BUFFERS_1024` or `USE_CERT_BUFFERS_2048`: Size of RSA certs / keys to test with.
* `BENCH_EMBEDDED`: Define this if using the wolfCrypt test/benchmark and using a low memory target.
* `ECC_USER_CURVES`: Allows user to defines curve sizes to enable. Default is 256-bit on. To enable others use `HAVE_ECC192`, `HAVE_ECC224`, etc....

View File

@@ -108,8 +108,8 @@ static int tls_client(void)
/*------------------------------------------------------------------------*/
/* END CIPHER SUITE OPTIONS */
/*------------------------------------------------------------------------*/
wolfSSL_SetIORecv(ctx, CbIORecv);
wolfSSL_SetIOSend(ctx, CbIOSend);
wolfSSL_CTX_SetIORecv(ctx, CbIORecv);
wolfSSL_CTX_SetIOSend(ctx, CbIOSend);
if ((ssl = wolfSSL_new(ctx)) == NULL) {
error = wolfSSL_get_error(ssl, 0);

View File

@@ -29,8 +29,8 @@
#define DWT ((DWT_Type *) (0xE0001000UL) )
typedef struct
{
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
uint32_t CTRL; /*< Offset: 0x000 (R/W) Control Register */
uint32_t CYCCNT; /*< Offset: 0x004 (R/W) Cycle Count Register */
} DWT_Type;
extern uint32_t SystemCoreClock ;

View File

@@ -10,7 +10,8 @@
<TargetName>wolfSSL-Benchmark</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F756NGHx</Device>
@@ -48,7 +49,7 @@
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\Output\</OutputDirectory>
<OutputName>wolfCryptTest</OutputName>
<OutputName>wolfCryptBenchmark</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile>
@@ -433,12 +434,6 @@
<RTE>
<apis>
<api Capiversion="2.1.0" Cclass="CMSIS Driver" Cgroup="Flash" exclusive="0">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</api>
<api Capiversion="2.3.0" Cclass="CMSIS Driver" Cgroup="MCI" exclusive="0">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<targetInfos>
@@ -459,8 +454,8 @@
</api>
</apis>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
@@ -471,32 +466,32 @@
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="Breakpoint" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="Breakpoint" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
@@ -513,12 +508,6 @@
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="NOR" Cvendor="Keil" Cversion="6.10.0" condition="File System and Flash Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="STM32756G-EVAL" Cclass="Board Support" Cgroup="Drivers" Csub="Basic I/O" Cvendor="Keil" Cversion="1.1.0" condition="STM32756G-EVAL BSP">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -543,12 +532,6 @@
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="Keil" Cversion="1.3.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Capiversion="2.2.0" Cclass="CMSIS Driver" Cgroup="MCI" Cvendor="Keil" Cversion="1.4.0" condition="STM32F7 CMSIS_Driver MCI">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -657,20 +640,20 @@
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Benchmark" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Benchmark" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.12.2"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Dummy" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.12.2"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Dummy" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
@@ -679,8 +662,8 @@
<files>
<file attr="config" category="source" name="CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c" version="4.70.1">
<instance index="0">RTE\CMSIS\RTX_Conf_CM.c</instance>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX" isDefaultVariant="1"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
@@ -720,7 +703,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
@@ -728,18 +711,16 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config_NOR.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_NOR_0.h</instance>
<instance index="0" removed="1">RTE\File_System\FS_Config_NOR_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="NOR" Cvendor="Keil" Cversion="6.10.0" condition="File System and Flash Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos/>
</file>
<file attr="config" category="source" name="Network\Config\Net_Config.c" version="0.0.0">
<instance index="0" removed="1">RTE\Network\Net_Config.c</instance>
@@ -783,10 +764,10 @@
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.12.2"/>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h" version="3.14.0">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="wolfSSL-Benchmark"/>
</targetInfos>

View File

@@ -10,7 +10,8 @@
<TargetName>CryptTest</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F756NGHx</Device>
@@ -443,12 +444,6 @@
<RTE>
<apis>
<api Capiversion="2.1.0" Cclass="CMSIS Driver" Cgroup="Flash" exclusive="0">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</api>
<api Capiversion="2.02" Cclass="CMSIS Driver" Cgroup="MCI" exclusive="0">
<package name="CMSIS" schemaVersion="1.2" url="http://www.keil.com/pack/" vendor="ARM" version="4.1.0"/>
<targetInfos>
@@ -469,8 +464,8 @@
</api>
</apis>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -487,32 +482,32 @@
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -547,12 +542,6 @@
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="Keil" Cversion="1.3.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Capiversion="2.2.0" Cclass="CMSIS Driver" Cgroup="MCI" Cvendor="Keil" Cversion="1.4.0" condition="STM32F7 CMSIS_Driver MCI">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -655,20 +644,20 @@
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.12.2"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Dummy" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.12.2"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Dummy" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Test" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.12.2"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="Test" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -677,8 +666,8 @@
<files>
<file attr="config" category="source" name="CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c" version="4.70.1">
<instance index="0">RTE\CMSIS\RTX_Conf_CM.c</instance>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX" isDefaultVariant="1"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -686,7 +675,7 @@
<file attr="config" category="header" name="Config\EventRecorderConf.h" version="1.0.0">
<instance index="0">RTE\Compiler\EventRecorderConf.h</instance>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="Event Recorder" Cvariant="DAP" Cvendor="Keil" Cversion="1.2.1" condition="Cortex-M Device"/>
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -726,7 +715,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN Debug" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O and Event Recorder"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -734,7 +723,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>
@@ -751,10 +740,10 @@
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h" version="3.14.0">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="CryptTest"/>
</targetInfos>

View File

@@ -10,7 +10,8 @@
<TargetName>echoClient</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F756NGHx</Device>
@@ -496,8 +497,20 @@
</api>
</apis>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="ARM" Cversion="6.2.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="ARM" Cversion="1.3.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -508,32 +521,32 @@
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -574,14 +587,14 @@
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -622,18 +635,6 @@
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="Keil" Cversion="6.2.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="Keil" Cversion="1.3.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Capiversion="2.2.0" Cclass="CMSIS Driver" Cgroup="MCI" Cvendor="Keil" Cversion="1.4.0" condition="STM32F7 CMSIS_Driver MCI">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -742,20 +743,20 @@
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="echoClient" Cvendor="wolfSSL" Cversion="" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="echoClient" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -764,8 +765,8 @@
<files>
<file attr="config" category="source" name="CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c" version="4.74.0">
<instance index="0">RTE\CMSIS\RTX_Conf_CM.c</instance>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX" isDefaultVariant="1"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -804,16 +805,16 @@
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -821,7 +822,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config.c" version="5.0.0">
<instance index="0">RTE\Network\Net_Config.c</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="CORE" Cvariant="Release" Cvendor="Keil" Cversion="6.7.5" condition="CMSIS Core with RTOS"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -829,7 +830,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_BSD.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_BSD.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="BSD" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP/TCP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -837,7 +838,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_DNS_Client.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_DNS_Client.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Service" Csub="DNS Client" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -845,7 +846,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_ETH.h" version="5.1.0">
<instance index="0">RTE\Network\Net_Config_ETH_0.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Interface" Csub="ETH" Cvendor="Keil" Cversion="6.7.5" condition="Network Driver ETH" maxInstances="1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -853,7 +854,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_TCP.h" version="5.0.1">
<instance index="0">RTE\Network\Net_Config_TCP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="TCP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
@@ -861,31 +862,27 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_UDP.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_UDP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="UDP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-Crypt.h">
<instance index="0">RTE\wolfSSL\config-Crypt.h</instance>
<instance index="0" removed="1">RTE\wolfSSL\config-Crypt.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-wolfSSL.h">
<instance index="0">RTE\wolfSSL\config-wolfSSL.h</instance>
<instance index="0" removed="1">RTE\wolfSSL\config-wolfSSL.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h" version="3.14.0">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoClient"/>
</targetInfos>

View File

@@ -11,6 +11,7 @@
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F756NGHx</Device>
@@ -496,8 +497,20 @@
</api>
</apis>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="ARM" Cversion="6.2.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="ARM" Cversion="1.3.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -508,32 +521,32 @@
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -574,14 +587,14 @@
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -622,18 +635,6 @@
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="Keil" Cversion="6.2.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="Keil" Cversion="1.3.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Capiversion="2.2.0" Cclass="CMSIS Driver" Cgroup="MCI" Cvendor="Keil" Cversion="1.4.0" condition="STM32F7 CMSIS_Driver MCI">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -742,20 +743,20 @@
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="echoServer" Cvendor="wolfSSL" Cversion="" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="echoServer" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -764,8 +765,8 @@
<files>
<file attr="config" category="source" name="CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c" version="4.74.0">
<instance index="0">RTE\CMSIS\RTX_Conf_CM.c</instance>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX" isDefaultVariant="1"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -805,7 +806,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -813,7 +814,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -821,7 +822,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config.c" version="5.0.0">
<instance index="0">RTE\Network\Net_Config.c</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="CORE" Cvariant="Release" Cvendor="Keil" Cversion="6.7.5" condition="CMSIS Core with RTOS"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -829,7 +830,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_BSD.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_BSD.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="BSD" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP/TCP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -837,7 +838,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_DNS_Client.h" version="0.0.0">
<instance index="0">RTE\Network\Net_Config_DNS_Client.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Service" Csub="DNS Client" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -851,7 +852,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_ETH.h" version="5.1.0">
<instance index="0">RTE\Network\Net_Config_ETH_0.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Interface" Csub="ETH" Cvendor="Keil" Cversion="6.7.5" condition="Network Driver ETH" maxInstances="1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -859,7 +860,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_TCP.h" version="5.0.1">
<instance index="0">RTE\Network\Net_Config_TCP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="TCP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -867,7 +868,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_UDP.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_UDP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="UDP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>
@@ -884,10 +885,10 @@
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h" version="3.14.0">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="echoServer"/>
</targetInfos>

View File

@@ -10,7 +10,8 @@
<TargetName>SimpleClient</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F756NGHx</Device>
@@ -496,8 +497,20 @@
</api>
</apis>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="ARM" Cversion="6.2.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="ARM" Cversion="1.3.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -508,32 +521,32 @@
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -574,14 +587,14 @@
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -622,18 +635,6 @@
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="Keil" Cversion="6.2.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="Keil" Cversion="1.3.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Capiversion="2.2.0" Cclass="CMSIS Driver" Cgroup="MCI" Cvendor="Keil" Cversion="1.4.0" condition="STM32F7 CMSIS_Driver MCI">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -742,20 +743,20 @@
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="SimpleClient" Cvendor="wolfSSL" Cversion="" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="SimpleClient" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -764,8 +765,8 @@
<files>
<file attr="config" category="source" name="CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c" version="4.74.0">
<instance index="0">RTE\CMSIS\RTX_Conf_CM.c</instance>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX" isDefaultVariant="1"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -804,16 +805,16 @@
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</file>
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -821,7 +822,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config.c" version="5.0.0">
<instance index="0">RTE\Network\Net_Config.c</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="CORE" Cvariant="Release" Cvendor="Keil" Cversion="6.7.5" condition="CMSIS Core with RTOS"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -829,7 +830,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_BSD.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_BSD.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="BSD" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP/TCP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -837,7 +838,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_DNS_Client.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_DNS_Client.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Service" Csub="DNS Client" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -845,7 +846,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_ETH.h" version="5.1.0">
<instance index="0">RTE\Network\Net_Config_ETH_0.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Interface" Csub="ETH" Cvendor="Keil" Cversion="6.7.5" condition="Network Driver ETH" maxInstances="1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -853,7 +854,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_TCP.h" version="5.0.1">
<instance index="0">RTE\Network\Net_Config_TCP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="TCP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
@@ -861,31 +862,27 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_UDP.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_UDP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="UDP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-Crypt.h">
<instance index="0">RTE\wolfSSL\config-Crypt.h</instance>
<instance index="0" removed="1">RTE\wolfSSL\config-Crypt.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\config-wolfSSL.h">
<instance index="0">RTE\wolfSSL\config-wolfSSL.h</instance>
<instance index="0" removed="1">RTE\wolfSSL\config-wolfSSL.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h" version="3.14.0">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleClient"/>
</targetInfos>

View File

@@ -10,7 +10,8 @@
<TargetName>SimpleServer</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060422::V5.06 update 4 (build 422)::ARMCC</pCCUsed>
<pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
<uAC6>0</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>STM32F756NGHx</Device>
@@ -496,8 +497,20 @@
</api>
</apis>
<components>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.0.2" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="ARM" Cversion="6.2.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="ARM" Cversion="1.3.0" condition="CMSIS Core">
<package name="CMSIS-Driver" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="ARM" version="2.1.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.1.1" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -508,32 +521,32 @@
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="File" Cvariant="File System" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with File System">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDERR" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDIN" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="STDOUT" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.0" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.2"/>
<component Cbundle="ARM Compiler" Cclass="Compiler" Cgroup="I/O" Csub="TTY" Cvariant="ITM" Cvendor="Keil" Cversion="1.2.1" condition="ARMCC Cortex-M with ITM">
<package name="ARM_Compiler" schemaVersion="1.4.9" url="http://www.keil.com/pack/" vendor="Keil" version="1.3.3"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -574,14 +587,14 @@
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.9.8" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.9.8" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -622,18 +635,6 @@
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Ethernet PHY" Csub="DP83848C" Cvendor="Keil" Cversion="6.2.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Capiversion="2.0.0" Cclass="CMSIS Driver" Cgroup="Flash" Csub="M29EW28F128" Cvendor="Keil" Cversion="1.3.0" condition="CMSIS Core">
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.4.1"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Capiversion="2.2.0" Cclass="CMSIS Driver" Cgroup="MCI" Cvendor="Keil" Cversion="1.4.0" condition="STM32F7 CMSIS_Driver MCI">
<package name="STM32F7xx_DFP" schemaVersion="1.3" url="http://www.keil.com/pack" vendor="Keil" version="2.9.0"/>
<targetInfos>
@@ -742,20 +743,20 @@
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
</component>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="SimpleServer" Cvendor="wolfSSL" Cversion="" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="SimpleServer" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfSSL-Core">
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -764,8 +765,8 @@
<files>
<file attr="config" category="source" name="CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c" version="4.74.0">
<instance index="0">RTE\CMSIS\RTX_Conf_CM.c</instance>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.1.1"/>
<component Capiversion="1.0.0" Cclass="CMSIS" Cgroup="RTOS" Csub="Keil RTX" Cvendor="ARM" Cversion="4.81.1" condition="RTOS RTX" isDefaultVariant="1"/>
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.3.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -805,7 +806,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config.c" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config.c</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="CORE" Cvariant="LFN" Cvendor="Keil" Cversion="6.10.0" condition="CMSIS Core with RTOS and File System I/O"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -813,7 +814,7 @@
<file attr="config" category="source" name="FileSystem\Config\FS_Config_MC.h" version="6.2.0">
<instance index="0">RTE\File_System\FS_Config_MC_0.h</instance>
<component Cbundle="MDK-Pro" Cclass="File System" Cgroup="Drive" Csub="Memory Card" Cvendor="Keil" Cversion="6.10.0" condition="File System and SD/MMC Driver" maxInstances="2"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -821,7 +822,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config.c" version="5.0.0">
<instance index="0">RTE\Network\Net_Config.c</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="CORE" Cvariant="Release" Cvendor="Keil" Cversion="6.7.5" condition="CMSIS Core with RTOS"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -829,7 +830,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_BSD.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_BSD.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="BSD" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP/TCP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -837,7 +838,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_DNS_Client.h" version="0.0.0">
<instance index="0">RTE\Network\Net_Config_DNS_Client.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Service" Csub="DNS Client" Cvendor="Keil" Cversion="6.7.5" condition="Network UDP"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -851,7 +852,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_ETH.h" version="5.1.0">
<instance index="0">RTE\Network\Net_Config_ETH_0.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Interface" Csub="ETH" Cvendor="Keil" Cversion="6.7.5" condition="Network Driver ETH" maxInstances="1"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -859,7 +860,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_TCP.h" version="5.0.1">
<instance index="0">RTE\Network\Net_Config_TCP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="TCP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -867,7 +868,7 @@
<file attr="config" category="source" name="Network_v6\Config\Net_Config_UDP.h" version="5.0.0">
<instance index="0">RTE\Network\Net_Config_UDP.h</instance>
<component Cbundle="MDK-Pro Net_v6" Cclass="Network" Cgroup="Socket" Csub="UDP" Cvendor="Keil" Cversion="6.7.5" condition="Network Interface"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.5.0"/>
<package name="MDK-Middleware" schemaVersion="1.4" url="http://www.keil.com/pack/" vendor="Keil" version="7.6.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>
@@ -884,10 +885,10 @@
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<targetInfos/>
</file>
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h">
<file attr="config" category="header" name="wolfssl\IDE\MDK5-ARM\Conf\user_settings.h" version="3.14.0">
<instance index="0">RTE\wolfSSL\user_settings.h</instance>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfCrypt" Csub="CORE" Cvendor="wolfSSL" Cversion="" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.13.0"/>
<component Cbundle="wolfSSL" Cclass="wolfSSL" Cgroup="wolfSSL" Csub="Core" Cvendor="wolfSSL" Cversion="3.14.0" condition="wolfCrypt-Core"/>
<package license="wolfssl\IDE\MDK5-ARM\Docs\wolfSSL-License.txt" name="wolfSSL" schemaVersion="1.4" url="http://www.wolfSSL.com/files/ide" vendor="wolfSSL" version="3.14.0"/>
<targetInfos>
<targetInfo name="SimpleServer"/>
</targetInfos>

View File

@@ -0,0 +1,13 @@
wolfssl_lib:
Build wolfssl_lib.lib
test:
Get missing files
- create DUMMY project
- copy all files under DUMMY project except DUMMY.*
- uncomment "Use SIM I/O" lines in resetprg.c
- set heap size in sbrk.h
- set stack size in stacksct.h
Build test wolfCrypt

View File

@@ -0,0 +1,2 @@
int strncasecmp(const char *s1, const char * s2, unsigned int sz);

View File

@@ -0,0 +1 @@
/* DUMMY Header */

View File

@@ -0,0 +1,46 @@
#define NO_MAIN_DRIVER
#define BENCH_EMBEDDED
#define NO_WRITEV
#define WOLFSSL_USER_IO
#define NO_DEV_RANDOM
#define USE_CERT_BUFFERS_2048
#define WOLFSSL_USER_CURRTIME
#define SIZEOF_LONG_LONG 8
#define NO_WOLFSSL_DIR
#define WOLFSSL_NO_CURRDIR
#define NO_FILESYSTEM
#define WOLFSSL_LOG_PRINTF
/* #define DEBUG_WOLFSSL */
#define OPENSSL_EXTRA
#define WOLFSSL_SMALL_STACK
#define WOLFSSL_DH_CONST
#define HAVE_TLS_EXTENSIONS
#define HAVE_SUPPORTED_CURVES
#define USER_TIME
#define XTIME time
#define USE_WOLF_SUSECONDS_T
#define USE_WOLF_TIMEVAL_T
#define WOLFSSL_USER_CURRTIME /* for benchmark */
#define WOLFSSL_GENSEED_FORTEST /* Wardning: define your own seed gen */
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define WC_RSA_BLINDING
#define SINGLE_THREADED /* or define RTOS option */
/* #define WOLFSSL_CMSIS_RTOS */
/* #define NO_DH */
#define HAVE_AESGCM
#define WOLFSSL_SHA512
#define HAVE_ECC
#define HAVE_CURVE25519
#define CURVE25519_SMALL
#define HAVE_ED25519

View File

@@ -0,0 +1,41 @@
/* wolfssl_dummy.c
*
* Copyright (C) 2006-2017 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
typedef unsigned long time_t;
#define YEAR 2018
#define MON 5
static int tick = 0;
time_t time(time_t *t)
{
return ((YEAR-1970)*365+30*MON)*24*60*60 + tick++;
}
#include <ctype.h>
int strncasecmp(const char *s1, const char * s2, unsigned int sz)
{
for( ; sz>0; sz--)
if(toupper(s1++) != toupper(s2++))
return 1;
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
/***********************************************************************/
/* */
/* FILE :Main.c or Main.cpp */
/* DATE :Tue, Oct 31, 2006 */
/* DESCRIPTION :Main Program */
/* CPU TYPE : */
/* */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/* */
/***********************************************************************/
#include "typedefine.h"
#ifdef __cplusplus
#include <ios> // Remove the comment when you use ios
_SINT ios_base::Init::init_cnt; // Remove the comment when you use ios
#endif
#include "stdio.h"
void main(void);
#ifdef __cplusplus
extern "C" {
void abort(void);
}
#endif
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
void wolfcrypt_test(func_args args);
void main(void)
{
func_args args = { 1 };
printf("Start wolfCrypt Test\n");
wolfcrypt_test(args);
printf("End wolfCrypt Test\n");
}
#ifdef __cplusplus
void abort(void)
{
}
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -36,6 +36,17 @@
#define WOLFSSL_SNIFFER
#define HAVE_TLS_EXTENSIONS
#define HAVE_SECURE_RENEGOTIATION
#define HAVE_AESGCM
#define WOLFSSL_SHA384
#define WOLFSSL_SHA512
#define HAVE_SUPPORTED_CURVES
#define HAVE_TLS_EXTENSIONS
#define HAVE_ECC
#define ECC_SHAMIR
#define ECC_TIMING_RESISTANT
#else
/* The servers and clients */
#define OPENSSL_EXTRA

View File

@@ -207,3 +207,7 @@ merge-clean:
@find ./ | $(GREP) \.OTHER | xargs rm -f
@find ./ | $(GREP) \.BASE | xargs rm -f
@find ./ | $(GREP) \~$$ | xargs rm -f
dist-hook:
cp $(distdir)/wolfssl/options.h.in $(distdir)/wolfssl/options.h

2
README
View File

@@ -44,7 +44,7 @@ Note 1)
wolfSSL as of 3.6.6 no longer enables SSLv3 by default. wolfSSL also no
longer supports static key cipher suites with PSK, RSA, or ECDH. This means
if you plan to use TLS cipher suites you must enable DH (DH is on by default),
or enable ECC (ECC is on by default on 64bit systems), or you must enable static
or enable ECC (ECC is on by default), or you must enable static
key cipher suites with
WOLFSSL_STATIC_DH
WOLFSSL_STATIC_RSA

View File

@@ -33,7 +33,7 @@ There are many reasons to choose wolfSSL as your embedded SSL solution. Some of
wolfSSL as of 3.6.6 no longer enables SSLv3 by default. wolfSSL also no
longer supports static key cipher suites with PSK, RSA, or ECDH. This means
if you plan to use TLS cipher suites you must enable DH (DH is on by default),
or enable ECC (ECC is on by default on 64bit systems), or you must enable static
or enable ECC (ECC is on by default), or you must enable static
key cipher suites with
WOLFSSL_STATIC_DH
WOLFSSL_STATIC_RSA

View File

@@ -10,6 +10,8 @@ commit-tests.sh - our commit tests, must pass before a commit is accepted, use
fips-check.sh - checks if current wolfSSL version works against FIPS wolfCrypt
comment out last line to leave working directory
async-check.sh - internal script for validating wolfSSL Async using the simulator.
gencertbuf.pl - creates certs_test.h, our certs / keys C array for easy non
filesystem testing

80
async-check.sh Executable file
View File

@@ -0,0 +1,80 @@
#!/bin/bash
# async-check.sh
# This script creates symbolic links to the required asynchronous
# file for using the asynchronous simulator and make check
#
# $ ./async-check [keep]
#
# - keep: (default off) ./async and links kept around for inspection
#
function Usage() {
printf '\n%s\n' "Usage: $0 [keep]"
printf '\n%s\n\n' "Where \"keep\" means keep (default off) async files around for inspection"
printf '%s\n' "EXAMPLE:"
printf '%s\n' "---------------------------------"
printf '%s\n' "./async-check.sh keep"
printf '%s\n\n' "---------------------------------"
}
ASYNC_REPO=git@github.com:wolfSSL/wolfAsyncCrypt.git
#ASYNC_REPO=../wolfAsyncCrypt
# Optionally keep async files
if [ "x$1" == "xkeep" ]; then KEEP="yes"; else KEEP="no"; fi
if [ -d ./async ];
then
echo "\n\nUsing existing async repo\n\n"
else
# make a clone of the wolfAsyncCrypt repository
git clone $ASYNC_REPO async
[ $? -ne 0 ] && echo "\n\nCouldn't checkout the wolfAsyncCrypt repository\n\n" && exit 1
fi
# setup auto-conf
./autogen.sh
# link files
ln -s -F ../../async/wolfcrypt/src/async.c ./wolfcrypt/src/async.c
ln -s -F ../../async/wolfssl/wolfcrypt/async.h ./wolfssl/wolfcrypt/async.h
ln -s -F ../../../../async/wolfcrypt/src/port/intel/quickassist.c ./wolfcrypt/src/port/intel/quickassist.c
ln -s -F ../../../../async/wolfcrypt/src/port/intel/quickassist_mem.c ./wolfcrypt/src/port/intel/quickassist_mem.c
ln -s -F ../../../../async/wolfcrypt/src/port/intel/README.md ./wolfcrypt/src/port/intel/README.md
ln -s -F ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist.h ./wolfssl/wolfcrypt/port/intel/quickassist.h
ln -s -F ../../../../async/wolfssl/wolfcrypt/port/intel/quickassist_mem.h ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h
ln -s -F ../../../../async/wolfcrypt/src/port/cavium/cavium_nitrox.c ./wolfcrypt/src/port/cavium/cavium_nitrox.c
ln -s -F ../../../../async/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
ln -s -F ../../../../async/wolfcrypt/src/port/cavium/README.md ./wolfcrypt/src/port/cavium/README.md
./configure --enable-asynccrypt --enable-all
make check
[ $? -ne 0 ] && echo "\n\nMake check failed. Debris left for analysis." && exit 1
# Clean up
popd
if [ "x$KEEP" == "xno" ];
then
unlink ./wolfcrypt/src/async.c
unlink ./wolfssl/wolfcrypt/async.h
unlink ./wolfcrypt/src/port/intel/quickassist.c
unlink ./wolfcrypt/src/port/intel/quickassist_mem.c
unlink ./wolfcrypt/src/port/intel/README.md
unlink ./wolfssl/wolfcrypt/port/intel/quickassist.h
unlink ./wolfssl/wolfcrypt/port/intel/quickassist_mem.h
unlink ./wolfcrypt/src/port/cavium/cavium_nitrox.c
unlink ./wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h
unlink ./wolfcrypt/src/port/cavium/README.md
rm -rf ./async
# restore original README.md files
git checkout -- wolfcrypt/src/port/cavium/README.md
git checkout -- wolfcrypt/src/port/intel/README.md
fi

View File

@@ -104,4 +104,10 @@ mv tmp eccSrvCRL.pem
# install (only needed if working outside wolfssl)
#cp eccSrvCRL.pem ~/wolfssl/certs/crl/eccSrvCRL.pem
# caEccCrl
openssl ca -config ../ecc/wolfssl.cnf -gencrl -crldays 1000 -out caEccCrl.pem -keyfile ../ca-ecc-key.pem -cert ../ca-ecc-cert.pem
# ca-ecc384-cert
openssl ca -config ../ecc/wolfssl.cnf -gencrl -crldays 1000 -out caEcc384Crl.pem -keyfile ../ca-ecc384-key.pem -cert ../ca-ecc384-cert.pem
exit 0

18
certs/ed25519/gen-ed25519.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
EXAMPLE=$1
echo "This uses ed25519 certificate generator from wolfssl-examples github"
echo "The script takes in the directory to wolfssl-examples"
pushd ${EXAMPLE}
make
if [ $? -ne 0 ]; then
echo "Unable to build example"
exit 1
fi
./tls.sh
popd
mv ${EXAMPLE}/*.pem .
mv ${EXAMPLE}/*.der .

View File

@@ -8,6 +8,10 @@
# client-ecc-cert.der
# ca-cert.pem
# ca-cert.der
# ca-ecc-cert.pem
# ca-ecc-cert.der
# ca-ecc384-cert.pem
# ca-ecc384-cert.der
# server-cert.pem
# server-cert.der
# server-ecc-rsa.pem
@@ -17,6 +21,7 @@
# server-ecc-comp.pem
# client-ca.pem
# test/digsigku.pem
# ecc-privOnlyCert.pem
# updates the following crls:
# crl/cliCrl.pem
# crl/crl.pem
@@ -100,12 +105,38 @@ function run_renewcerts(){
openssl x509 -in ca-cert.pem -text > tmp.pem
mv tmp.pem ca-cert.pem
############################################################
########## update the self-signed ca-ecc-cert.pem ##########
############################################################
echo "Updating ca-ecc-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL\nDevelopment\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ca-ecc-key.pem -nodes -out ca-ecc-cert.csr
openssl x509 -req -in ca-ecc-cert.csr -days 1000 -extfile wolfssl.cnf -extensions ca_ecc_cert -signkey ca-ecc-key.pem -out ca-ecc-cert.pem
rm ca-ecc-cert.csr
openssl x509 -in ca-ecc-cert.pem -text > tmp.pem
mv tmp.pem ca-ecc-cert.pem
############################################################
########## update the self-signed ca-ecc384-cert.pem #######
############################################################
echo "Updating ca-ecc384-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL\nDevelopment\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ca-ecc384-key.pem -nodes -sha384 -out ca-ecc384-cert.csr
openssl x509 -req -in ca-ecc384-cert.csr -days 1000 -extfile wolfssl.cnf -extensions ca_ecc_cert -signkey ca-ecc384-key.pem -sha384 -out ca-ecc384-cert.pem
rm ca-ecc384-cert.csr
openssl x509 -in ca-ecc384-cert.pem -text > tmp.pem
mv tmp.pem ca-ecc384-cert.pem
############################################################
##### update the self-signed (1024-bit) ca-cert.pem ########
############################################################
echo "Updating 1024-bit ca-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nMontana\nBozeman\nSawtooth\nConsulting_1024\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key \1024/ca-key.pem -nodes -out \1024/ca-cert.csr
echo -e "US\nMontana\nBozeman\nSawtooth\nConsulting_1024\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key \1024/ca-key.pem -nodes -sha1 -out \1024/ca-cert.csr
openssl x509 -req -in \1024/ca-cert.csr -days 1000 -extfile wolfssl.cnf -extensions wolfssl_opts -signkey \1024/ca-key.pem -out \1024/ca-cert.pem
rm \1024/ca-cert.csr
@@ -169,7 +200,7 @@ function run_renewcerts(){
echo "Updating 1024-bit server-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nMontana\nBozeman\nwolfSSL\nSupport_1024\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key \1024/server-key.pem -nodes > \1024/server-req.pem
echo -e "US\nMontana\nBozeman\nwolfSSL\nSupport_1024\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key \1024/server-key.pem -nodes -sha1 > \1024/server-req.pem
openssl x509 -req -in \1024/server-req.pem -extfile wolfssl.cnf -extensions wolfssl_opts -days 1000 -CA \1024/ca-cert.pem -CAkey \1024/ca-key.pem -set_serial 01 > \1024/server-cert.pem
@@ -209,7 +240,7 @@ function run_renewcerts(){
mv tmp.pem client-ecc-cert.pem
############################################################
########## update the self-signed server-ecc.pem ###########
########## update the server-ecc.pem #######################
############################################################
echo "Updating server-ecc.pem"
echo ""
@@ -217,7 +248,7 @@ function run_renewcerts(){
echo -e "US\nWashington\nSeattle\nEliptic\nECC\nwww.wolfssl.com\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ecc-key.pem -nodes -out server-ecc.csr
openssl x509 -req -in server-ecc.csr -days 1000 -extfile wolfssl.cnf -extensions wolfssl_opts -signkey ecc-key.pem -out server-ecc.pem
openssl x509 -req -in server-ecc.csr -days 1000 -extfile wolfssl.cnf -extensions server_ecc -CAfile ca-ecc-cert.pem -CAkey ca-ecc-key.pem -out server-ecc.pem
rm server-ecc.csr
openssl x509 -in server-ecc.pem -text > tmp.pem
@@ -244,6 +275,18 @@ function run_renewcerts(){
echo ""
cat client-cert.pem client-ecc-cert.pem > client-ca.pem
############################################################
###### update the self-signed ecc-privOnlyCert.pem #########
############################################################
echo "Updating ecc-privOnlyCert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e ".\n.\n.\nWR\n.\nDE\n.\n.\n.\n" | openssl req -new -key ecc-privOnlyKey.pem -nodes -out ecc-privOnly.csr
openssl x509 -req -in ecc-privOnly.csr -days 1000 -signkey ecc-privOnlyKey.pem -out ecc-privOnlyCert.pem
rm ecc-privOnly.csr
############################################################
###### update the self-signed test/digsigku.pem ##########
############################################################
@@ -263,10 +306,15 @@ function run_renewcerts(){
############################################################
########## make .der files from .pem files #################
############################################################
openssl x509 -inform PEM -in \1024/client-cert.pem -outform DER -out \1024/client-cert.der
echo "Creating der formatted certs..."
echo ""
openssl x509 -inform PEM -in \1024/client-cert.pem -outform DER -out \1024/client-cert.der
openssl x509 -inform PEM -in \1024/server-cert.pem -outform DER -out \1024/server-cert.der
openssl x509 -inform PEM -in \1024/ca-cert.pem -outform DER -out \1024/ca-cert.der
openssl x509 -inform PEM -in ca-cert.pem -outform DER -out ca-cert.der
openssl x509 -inform PEM -in ca-ecc-cert.pem -outform DER -out ca-ecc-cert.der
openssl x509 -inform PEM -in ca-ecc384-cert.pem -outform DER -out ca-ecc384-cert.der
openssl x509 -inform PEM -in client-cert.pem -outform DER -out client-cert.der
openssl x509 -inform PEM -in server-cert.pem -outform DER -out server-cert.der
openssl x509 -inform PEM -in client-ecc-cert.pem -outform DER -out client-ecc-cert.der
@@ -281,6 +329,57 @@ function run_renewcerts(){
echo ""
echo "" | openssl pkcs12 -des3 -descert -export -in server-ecc-rsa.pem -inkey ecc-key.pem -certfile server-ecc.pem -out ecc-rsa-server.p12 -password stdin
############################################################
###### update the test-servercert.p12 file #################
############################################################
echo "Updating test-servercert.p12 (password is \"wolfSSL test\")"
echo ""
echo "wolfSSL test" | openssl pkcs12 -des3 -descert -export -in server-cert.pem -inkey server-key.pem -certfile ca-cert.pem -out test-servercert.p12 -password stdin
############################################################
###### calling gen-ext-certs.sh ##################
############################################################
echo "Calling gen-ext-certs.sh"
echo ""
cd ..
./certs/test/gen-ext-certs.sh
cd ./certs
############################################################
###### calling gen-badsig.sh ##################
############################################################
echo "Calling gen-badsig.sh"
echo ""
cd ./test
./gen-badsig.sh
cd ../
############################################################
########## generate ocsp certs ######################
############################################################
echo "Changing directory to ocsp..."
echo ""
# guard against recursive calls to renewcerts.sh
if [ -d ocsp ]; then
cd ./ocsp
echo "Execute ./renewcerts.sh..."
./renewcerts.sh
cd ../
else
echo "Error could not find ocsp directory"
exit 1
fi
############################################################
###### calling assemble-chains.sh ##################
############################################################
echo "Calling assemble-chains.sh"
echo ""
cd ./test-pathlen
./assemble-chains.sh
cd ../
############################################################
########## store DER files as buffers ######################
############################################################
@@ -350,6 +449,19 @@ then
echo "changed directory to wolfssl root directory."
echo ""
echo ""
echo "Enter directory to ed25519 certificate generation example."
echo "Can be found at https://github.com/wolfSSL/wolfssl-examples"
read ED25519_DIR
if [ -d "${ED25519_DIR}" ]; then
pushd ./certs/ed25519
./gen-ed25519.sh ${ED25519_DIR}
popd
else
echo "Unable to find directory ${ED25519_DIR}"
exit 1
fi
############################################################
########## update ntru if already installed ################
############################################################
@@ -367,11 +479,21 @@ elif [ ! -z "$1" ]; then
if [ "$1" == "--override-ntru" ]; then
echo "overriding ntru, update all certs except ntru."
run_renewcerts
#valid argument create ed25519 certificates
elif [ "$1" == "--ed25519" ] || [ "$2" == "--ed25519" ]; then
echo ""
echo "Enter directory to ed25519 certificate generation example."
echo "Can be found at https://github.com/wolfSSL/wolfssl-examples"
read ED25519_DIR
pushd ./certs/ed25519
./gen-ed25519.sh ${ED25519_DIR}
popd
#valid argument print out other valid arguments
elif [ "$1" == "-h" ] || [ "$1" == "-help" ]; then
echo ""
echo "\"no argument\" will attempt to update all certificates"
echo "--override-ntru updates all certificates except ntru"
echo "--ed25519 updates all ed25519 certificates"
echo "-h or -help display this menu"
echo ""
echo ""
@@ -441,3 +563,4 @@ else
fi #END now defined
fi #END already defined
exit 0

View File

@@ -125,6 +125,40 @@ subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=CA:true
# CA with pathlen 0
[ pathlen_0 ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=CA:true,pathlen:0
keyUsage=keyCertSign, cRLSign
# CA with pathlen 1
[ pathlen_1 ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=CA:true,pathlen:1
keyUsage=keyCertSign, cRLSign
# CA with pathlen 127
[ pathlen_127 ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=CA:true,pathlen:127
keyUsage=keyCertSign, cRLSign
# CA with pathlen 128
[ pathlen_128 ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=CA:true,pathlen:128
keyUsage=keyCertSign, cRLSign
# test pathlen server cert
[ test_pathlen ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=CA:false
# Extensions to add to a certificate request
[ v3_req ]
basicConstraints = CA:FALSE
@@ -170,6 +204,22 @@ authorityKeyIdentifier=keyid:always,issuer:always
basicConstraints=critical, CA:TRUE
keyUsage=critical, nonRepudiation, keyEncipherment
# ca-ecc-cert extensions
[ ca_ecc_cert ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always
basicConstraints=critical, CA:TRUE
keyUsage=critical, digitalSignature, keyCertSign, cRLSign
# server-ecc extensions
[ server_ecc ]
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid:always
basicConstraints=critical, CA:FALSE
keyUsage=critical, digitalSignature, keyEncipherment, keyAgreement
extendedKeyUsage=serverAuth
nsCertType=server
#tsa default
[ tsa ]
default_tsa = tsa_config1

View File

@@ -1,8 +1,192 @@
#!/bin/bash
#
# assemble-chains.sh
# Assemble all the certificate CA path test cert chains.
# Create certs and assemble all the certificate CA path test cert chains.
###########################################################
########## update server-0-ca.pem ################
###########################################################
echo "Updating server-0-ca.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 0 CA\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-0-ca-req.pem
openssl x509 -req -in server-0-ca-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions pathlen_0 -days 1000 -CA ../ca-cert.pem -CAkey ../ca-key.pem -set_serial 100 -sha1 > server-0-ca.pem
rm server-0-ca-req.pem
openssl x509 -in server-0-ca.pem -text > ca_tmp.pem
mv ca_tmp.pem server-0-ca.pem
###########################################################
########## update server-0-cert.pem ################
###########################################################
echo "Updating server-0-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 0\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-0-cert-req.pem
openssl x509 -req -in server-0-cert-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions test_pathlen -days 1000 -CA server-0-ca.pem -CAkey ../server-key.pem -set_serial 101 -sha1 > server-0-cert.pem
rm server-0-cert-req.pem
openssl x509 -in server-0-cert.pem -text > cert_tmp.pem
mv cert_tmp.pem server-0-cert.pem
###########################################################
########## update server-1-ca.pem ################
###########################################################
echo "Updating server-1-ca.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 1 CA\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-1-ca-req.pem
openssl x509 -req -in server-1-ca-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions pathlen_1 -days 1000 -CA ../ca-cert.pem -CAkey ../ca-key.pem -set_serial 102 -sha1 > server-1-ca.pem
rm server-1-ca-req.pem
openssl x509 -in server-1-ca.pem -text > ca_tmp.pem
mv ca_tmp.pem server-1-ca.pem
###########################################################
########## update server-1-cert.pem ################
###########################################################
echo "Updating server-1-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 1\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-1-cert-req.pem
openssl x509 -req -in server-1-cert-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions test_pathlen -days 1000 -CA server-1-ca.pem -CAkey ../server-key.pem -set_serial 105 -sha1 > server-1-cert.pem
rm server-1-cert-req.pem
openssl x509 -in server-1-cert.pem -text > cert_tmp.pem
mv cert_tmp.pem server-1-cert.pem
###########################################################
########## update server-0-1-ca.pem ################
###########################################################
echo "Updating server-0-1-ca.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 0-1 CA\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-0-1-ca-req.pem
openssl x509 -req -in server-0-1-ca-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions pathlen_1 -days 1000 -CA server-0-ca.pem -CAkey ../server-key.pem -set_serial 110 -sha1 > server-0-1-ca.pem
rm server-0-1-ca-req.pem
openssl x509 -in server-0-1-ca.pem -text > ca_tmp.pem
mv ca_tmp.pem server-0-1-ca.pem
###########################################################
########## update server-0-1-cert.pem ################
###########################################################
echo "Updating server-0-1-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 0-1\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-0-1-cert-req.pem
openssl x509 -req -in server-0-1-cert-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions test_pathlen -days 1000 -CA server-0-1-ca.pem -CAkey ../server-key.pem -set_serial 111 -sha1 > server-0-1-cert.pem
rm server-0-1-cert-req.pem
openssl x509 -in server-0-1-cert.pem -text > cert_tmp.pem
mv cert_tmp.pem server-0-1-cert.pem
###########################################################
########## update server-1-0-ca.pem ################
###########################################################
echo "Updating server-1-0-ca.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 1-0 CA\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-1-0-ca-req.pem
openssl x509 -req -in server-1-0-ca-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions pathlen_0 -days 1000 -CA server-1-ca.pem -CAkey ../server-key.pem -set_serial 103 -sha1 > server-1-0-ca.pem
rm server-1-0-ca-req.pem
openssl x509 -in server-1-0-ca.pem -text > ca_tmp.pem
mv ca_tmp.pem server-1-0-ca.pem
###########################################################
########## update server-1-0-cert.pem ################
###########################################################
echo "Updating server-1-0-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 1-0\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-1-0-cert-req.pem
openssl x509 -req -in server-1-0-cert-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions test_pathlen -days 1000 -CA server-1-0-ca.pem -CAkey ../server-key.pem -set_serial 104 -sha1 > server-1-0-cert.pem
rm server-1-0-cert-req.pem
openssl x509 -in server-1-0-cert.pem -text > cert_tmp.pem
mv cert_tmp.pem server-1-0-cert.pem
###########################################################
########## update server-127-ca.pem ################
###########################################################
echo "Updating server-127-ca.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 127 CA\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-127-ca-req.pem
openssl x509 -req -in server-127-ca-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions pathlen_127 -days 1000 -CA ../ca-cert.pem -CAkey ../ca-key.pem -set_serial 106 -sha1 > server-127-ca.pem
rm server-127-ca-req.pem
openssl x509 -in server-127-ca.pem -text > ca_tmp.pem
mv ca_tmp.pem server-127-ca.pem
###########################################################
########## update server-127-cert.pem ################
###########################################################
echo "Updating server-127-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 127\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-127-cert-req.pem
openssl x509 -req -in server-127-cert-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions test_pathlen -days 1000 -CA server-127-ca.pem -CAkey ../server-key.pem -set_serial 107 -sha1 > server-127-cert.pem
rm server-127-cert-req.pem
openssl x509 -in server-127-cert.pem -text > cert_tmp.pem
mv cert_tmp.pem server-127-cert.pem
###########################################################
########## update server-128-ca.pem ################
###########################################################
echo "Updating server-128-ca.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 128 CA\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-128-ca-req.pem
openssl x509 -req -in server-128-ca-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions pathlen_128 -days 1000 -CA ../ca-cert.pem -CAkey ../ca-key.pem -set_serial 106 -sha1 > server-128-ca.pem
rm server-128-ca-req.pem
openssl x509 -in server-128-ca.pem -text > ca_tmp.pem
mv ca_tmp.pem server-128-ca.pem
###########################################################
########## update server-128-cert.pem ################
###########################################################
echo "Updating server-128-cert.pem"
echo ""
#pipe the following arguments to openssl req...
echo -e "US\nWashington\nSeattle\nwolfSSL Inc.\nEngineering\nServer 128\ninfo@wolfssl.com\n.\n.\n" | openssl req -new -key ../server-key.pem -nodes -sha1 > server-128-cert-req.pem
openssl x509 -req -in server-128-cert-req.pem -extfile ../renewcerts/wolfssl.cnf -extensions test_pathlen -days 1000 -CA server-128-ca.pem -CAkey ../server-key.pem -set_serial 107 -sha1 > server-128-cert.pem
rm server-128-cert-req.pem
openssl x509 -in server-128-cert.pem -text > cert_tmp.pem
mv cert_tmp.pem server-128-cert.pem
###########################################################
########## Assemble Chains ################
###########################################################
# Success: PathLen of 0
## server-0-ca.pem: signed by ca-cert.pem
## server-0-cert.pem: signed by server-0-ca.pem

View File

@@ -0,0 +1,20 @@
#!/bin/sh
echo "step 1 create key"
openssl genrsa -out server-badaltnamenull.key 2048
echo "step 2 create csr"
echo "US\nMontana\nBozeman\nEngineering\nlocalhost\n.\n" | openssl req -new -sha256 -out server-badaltnamenull.csr -key server-badaltnamenull.key -config server-badaltnamenull.conf
echo "step 3 check csr"
openssl req -text -noout -in server-badaltnamenull.csr
echo "step 4 create cert"
openssl x509 -req -days 1000 -in server-badaltnamenull.csr -signkey server-badaltnamenull.key \
-out server-badaltnamenull.pem -extensions req_ext -extfile server-badaltnamenull.conf
echo "step 5 make human reviewable"
openssl x509 -inform pem -in server-badaltnamenull.pem -text > tmp.pem
mv tmp.pem server-badaltnamenull.pem
openssl x509 -inform pem -in server-badaltnamenull.pem -outform der -out server-badaltnamenull.der

42
certs/test/gen-badsig.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
generate() {
# read in certificate and alter the last part of the signature
num_lines=$(wc -l < $cert)
i=1
rm -f $pem_out
touch $pem_out
while IFS= read -r line
do
if [[ $((i+1)) -eq ${num_lines} ]]; then
# last line before END tag. Alter the sig here
idx=`expr ${#line} - 4`
chr=${line:idx:1}
if [ "$chr" == "x" ] || [ "$chr" == "X" ]; then
echo "${line:0:${idx}}a${line:$((idx+1)):$((idx+4))}" >> $pem_out
else
echo "${line:0:${idx}}x${line:$((idx+1)):$((idx+4))}" >> $pem_out
fi
else
echo "$line" >> $pem_out
fi
let i++
done < "$cert"
# output to DER format also
openssl x509 -in $pem_out -out $der_out -outform DER
}
# create server RSA certificate with bad signature
cert="../server-cert.pem"
pem_out=server-cert-rsa-badsig.pem
der_out=server-cert-rsa-badsig.der
generate
# create server ECC certificate with bad signature
cert="../server-ecc.pem"
pem_out=server-cert-ecc-badsig.pem
der_out=server-cert-ecc-badsig.der
generate

View File

@@ -17,3 +17,12 @@ EXTRA_DIST += \
certs/test/server-cert-rsa-badsig.pem \
certs/test/server-cert-ecc-badsig.der \
certs/test/server-cert-ecc-badsig.pem
EXTRA_DIST += \
certs/test/gen-badaltnamenull.sh \
certs/test/server-badaltnamenull.conf \
certs/test/server-badaltnamenull.csr \
certs/test/server-badaltnamenull.key \
certs/test/server-badaltnamenull.pem \
certs/test/server-badaltnamenull.der

View File

@@ -0,0 +1,17 @@
[ req ]
default_bits = 2048
distinguished_name = req_distinguished_name
req_extensions = req_ext
[ req_distinguished_name ]
countryName = US
stateOrProvinceName = Montana
localityName = Bozeman
organizationName = Engineering
commonName = www.wolfssl.com
commonName_max = 64
commonName_default = localhost
[ req_ext ]
#subjectAltName = localhost\0h
subjectAltName = DER:30:0d:82:0b:6c:6f:63:61:6c:68:6f:73:74:00:68

View File

@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICyTCCAbECAQAwWzELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB01vbnRhbmExEDAO
BgNVBAcMB0JvemVtYW4xFDASBgNVBAoMC0VuZ2luZWVyaW5nMRIwEAYDVQQDDAls
b2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBWOI9sH7D
UouzlAgOLJgVQEyrHw9nwxeIEqmxfU2kZZcD95DWBzExpT0mbluER8yoj6E3//LY
58aDdASC+x/gxTLWuCNIgF9GWIOfP2TaWj9AHT6mIeklP2z9qJm3Md7UT52xOLkz
0wblZzSjcqEY61c1MGH6xAtfYfWZgmkxej4aAKd7jR1LAXCSIx+EO2WvvA8c5fiS
ozQgftXSM/5437VVSwu4dH4ptRNou/6nXi74cYzO4+/Unh7j/4ggwuvegNdEqeRg
CtASpQalRN+xrqghQaj786t/kBkqH6L0KKzzcsfLi4oE6dJXn4e7SFWgzbRayp5y
a7jal5x/6U+5AgMBAAGgKTAnBgkqhkiG9w0BCQ4xGjAYMBYGA1UdEQQPMA2CC2xv
Y2FsaG9zdABoMA0GCSqGSIb3DQEBCwUAA4IBAQCHfMbbmvXJGKjO6Z6UOkF3f7sa
cB8gEyjm9+Aa8gMQnaWOH8Sw6nGhGNSOVTQUIqt8EohqNCd/jrjZF34mecaJ3ycw
ryt7AGQzQX5uutBLVr55jszVVC8EDKuPzO3jXH6h6ptvSebG/0KL0P+JHL5JvzZ1
wAsTBtnnnrnxCQO3a2SFC4zVyH+LCP+EWehH7Sjt9FtrCIoP+xoM6AJ2tCxb4CHH
A8WGuw36lG78DH6rs4kbh0iCP/pKYrYeG9EBOj6+Bw7WF4ee6QhL0VzHXUcIFjkp
YlVLGBTL6KVjPW4uim1az5F1+HxZTvbAbnPU7f81M2ePmqbFfODYO1KPXycg
-----END CERTIFICATE REQUEST-----

Binary file not shown.

View File

@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAwVjiPbB+w1KLs5QIDiyYFUBMqx8PZ8MXiBKpsX1NpGWXA/eQ
1gcxMaU9Jm5bhEfMqI+hN//y2OfGg3QEgvsf4MUy1rgjSIBfRliDnz9k2lo/QB0+
piHpJT9s/aiZtzHe1E+dsTi5M9MG5Wc0o3KhGOtXNTBh+sQLX2H1mYJpMXo+GgCn
e40dSwFwkiMfhDtlr7wPHOX4kqM0IH7V0jP+eN+1VUsLuHR+KbUTaLv+p14u+HGM
zuPv1J4e4/+IIMLr3oDXRKnkYArQEqUGpUTfsa6oIUGo+/Orf5AZKh+i9Cis83LH
y4uKBOnSV5+Hu0hVoM20Wsqecmu42pecf+lPuQIDAQABAoIBAEL0a8xfHVa4dCZo
4e0+ph/d127+34/YMILvq5IKSWPfxk8aYS6s6O0/QpDXcJu7XXUV4AeLe+Z/RPBq
sdFF84Eb6QIQXC+UPOoYZuQzyNIQpIyoU/SmE53RfAXPaAPXokm1lG81rHT05BN3
DPR5Eq6VeOqzaYq0bxfFzY4uag02pITGuYMIxuBkJ+q9mu9XTaBWY1mGlD0zqxUZ
LC0dgrWklJFNHNWddrsMl0LDXFRfuxdFmoZT5NBLh+DWgKq/IW+TAqe3lZGVCPFs
cctR3WevykigH5TZmK3gsT98kqe5y9xO+pOpAvNAKeiXVYEREzE+PbsdiLiXbaEy
X1pUB70CgYEA7BSSQqa5duNNwOFp9DcNmMj1VKE2ixhRZi+R7jxHquiyh6IQv7tf
865f8ZA55mPwy5h/Gqin6YdswvkwHUqbEstnQ+BXmcXaI0EY6iZAkSSKbC0ygr3o
yVuRSCJmkCdmb8KIz0yguEjOmbNcavaH9ivE7KS6DhYb65PwyGuCxqsCgYEA0alC
a84cpN59zFTaW85gpq1zeWMbXmkBees8xnygJ4kZw2MkqQSZw+zUFdb9WbltSAsU
Y8eF0SAaShoXfa7BwB2Bnrs7NZMQzZfVmSG5QLF45v+087guN7pgWnmkUQ0G9ijc
oLI5Mn3oMy9UrJ48JUVwYysaacgRa73tMsGZ0ysCgYALrbDWjzzZfsEX6468QATy
K+7G8vqpwtgz/+JuMJkzATPjtcayVWiXu2aPopzaotMEn1SaUwGLceGVe5I/wLMP
KPTAzNZIixsRZ2T+IEpNY8tdMpcvFInxfBAhy2Hbe7d7i9oMtzO0KhXeUJsfx3ZO
XTfupO93Ruy2qKjeoULk5QKBgCDD9O9oHK3fX4WJVT63t/8UaFF2HZbZjjOBgdP7
MgQ7tt0EJ3yKjYVDA7oOCTX2do+lu6AEVHNkMveVsEoh/4GImvM1i4FJ5Hxc2DLA
RHVJxv1CxQK5q+9lnx1EmVtZT9c0d5Zdg/bSGnG1WeRILlocyf2VhOE3NRHDcshV
3TZVAoGAXP0SDgRcA544d0zdw07f9/KgHlYcsJuPGt2F7UzjIZiBivr3yh+EXBw2
xMqRwFnsBeOgvW/i3Je01RjeWZL6M9Lq1ywk2HZtDPnN6dP15LwSS33OBRca5Fk+
CyKDfZHd+8c2wj8hNsxd/D4N7ZVDrU3UNvMslHwGh0PbIaQxcQM=
-----END RSA PRIVATE KEY-----

View File

@@ -0,0 +1,72 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 15650401360786530715 (0xd931651e45f8a19b)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Montana, L=Bozeman, O=Engineering, CN=localhost
Validity
Not Before: May 3 16:02:13 2018 GMT
Not After : Jan 27 16:02:13 2021 GMT
Subject: C=US, ST=Montana, L=Bozeman, O=Engineering, CN=localhost
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
00:c1:58:e2:3d:b0:7e:c3:52:8b:b3:94:08:0e:2c:
98:15:40:4c:ab:1f:0f:67:c3:17:88:12:a9:b1:7d:
4d:a4:65:97:03:f7:90:d6:07:31:31:a5:3d:26:6e:
5b:84:47:cc:a8:8f:a1:37:ff:f2:d8:e7:c6:83:74:
04:82:fb:1f:e0:c5:32:d6:b8:23:48:80:5f:46:58:
83:9f:3f:64:da:5a:3f:40:1d:3e:a6:21:e9:25:3f:
6c:fd:a8:99:b7:31:de:d4:4f:9d:b1:38:b9:33:d3:
06:e5:67:34:a3:72:a1:18:eb:57:35:30:61:fa:c4:
0b:5f:61:f5:99:82:69:31:7a:3e:1a:00:a7:7b:8d:
1d:4b:01:70:92:23:1f:84:3b:65:af:bc:0f:1c:e5:
f8:92:a3:34:20:7e:d5:d2:33:fe:78:df:b5:55:4b:
0b:b8:74:7e:29:b5:13:68:bb:fe:a7:5e:2e:f8:71:
8c:ce:e3:ef:d4:9e:1e:e3:ff:88:20:c2:eb:de:80:
d7:44:a9:e4:60:0a:d0:12:a5:06:a5:44:df:b1:ae:
a8:21:41:a8:fb:f3:ab:7f:90:19:2a:1f:a2:f4:28:
ac:f3:72:c7:cb:8b:8a:04:e9:d2:57:9f:87:bb:48:
55:a0:cd:b4:5a:ca:9e:72:6b:b8:da:97:9c:7f:e9:
4f:b9
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Alternative Name:
DNS:localhost
Signature Algorithm: sha1WithRSAEncryption
ae:76:ea:5e:33:2c:cf:16:c8:ec:a2:27:2a:19:b9:22:bb:69:
b4:96:35:f7:25:1c:dd:8b:fb:c4:a8:32:17:89:73:a0:bc:23:
a3:49:d4:fd:1a:d7:fc:bf:87:5d:42:12:4b:20:20:74:47:7e:
7c:97:89:c1:f1:a3:82:3a:58:0b:b4:05:0b:c1:02:da:a6:dc:
ca:6c:60:58:fe:83:1c:fc:ed:c7:bc:96:df:b2:af:31:f5:28:
45:2d:d5:c0:5a:42:95:c3:64:c5:46:5c:cd:8e:d6:7b:fd:9c:
f5:75:44:cc:d6:7e:d8:96:55:5c:00:9f:1f:ac:f1:0a:07:29:
0c:ba:ab:7d:1f:ac:8d:40:55:86:e4:35:1d:11:89:10:8b:c2:
67:ff:99:32:66:f3:5d:4a:c3:37:5e:37:32:40:7b:29:50:25:
e5:c1:d8:df:7b:64:3e:f7:c4:1e:01:88:fe:24:f6:0c:ea:f7:
72:df:1e:72:0c:9b:64:c3:6b:ec:ce:99:b1:75:61:f2:ac:d5:
6f:7b:7d:06:7b:6c:a8:6c:ac:46:37:dd:af:e6:cb:8f:70:d7:
57:e2:38:d9:e6:9a:93:da:53:06:e6:39:c5:79:6a:0a:ac:49:
da:04:a1:60:2f:5f:96:ef:ca:6c:34:62:6c:ac:25:1c:d5:e0:
f7:8e:7c:df
-----BEGIN CERTIFICATE-----
MIIDUzCCAjugAwIBAgIJANkxZR5F+KGbMA0GCSqGSIb3DQEBBQUAMFsxCzAJBgNV
BAYTAlVTMRAwDgYDVQQIDAdNb250YW5hMRAwDgYDVQQHDAdCb3plbWFuMRQwEgYD
VQQKDAtFbmdpbmVlcmluZzESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDUwMzE2
MDIxM1oXDTIxMDEyNzE2MDIxM1owWzELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB01v
bnRhbmExEDAOBgNVBAcMB0JvemVtYW4xFDASBgNVBAoMC0VuZ2luZWVyaW5nMRIw
EAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQDBWOI9sH7DUouzlAgOLJgVQEyrHw9nwxeIEqmxfU2kZZcD95DWBzExpT0mbluE
R8yoj6E3//LY58aDdASC+x/gxTLWuCNIgF9GWIOfP2TaWj9AHT6mIeklP2z9qJm3
Md7UT52xOLkz0wblZzSjcqEY61c1MGH6xAtfYfWZgmkxej4aAKd7jR1LAXCSIx+E
O2WvvA8c5fiSozQgftXSM/5437VVSwu4dH4ptRNou/6nXi74cYzO4+/Unh7j/4gg
wuvegNdEqeRgCtASpQalRN+xrqghQaj786t/kBkqH6L0KKzzcsfLi4oE6dJXn4e7
SFWgzbRayp5ya7jal5x/6U+5AgMBAAGjGjAYMBYGA1UdEQQPMA2CC2xvY2FsaG9z
dABoMA0GCSqGSIb3DQEBBQUAA4IBAQCudupeMyzPFsjsoicqGbkiu2m0ljX3JRzd
i/vEqDIXiXOgvCOjSdT9Gtf8v4ddQhJLICB0R358l4nB8aOCOlgLtAULwQLaptzK
bGBY/oMc/O3HvJbfsq8x9ShFLdXAWkKVw2TFRlzNjtZ7/Zz1dUTM1n7YllVcAJ8f
rPEKBykMuqt9H6yNQFWG5DUdEYkQi8Jn/5kyZvNdSsM3XjcyQHspUCXlwdjfe2Q+
98QeAYj+JPYM6vdy3x5yDJtkw2vszpmxdWHyrNVve30Ge2yobKxGN92v5suPcNdX
4jjZ5pqT2lMG5jnFeWoKrEnaBKFgL1+W78psNGJsrCUc1eD3jnzf
-----END CERTIFICATE-----

View File

@@ -5,14 +5,16 @@
# This file is part of wolfSSL. (formerly known as CyaSSL)
#
#
AC_COPYRIGHT([Copyright (C) 2006-2018 wolfSSL Inc.])
AC_INIT([wolfssl],[3.14.0],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com])
AC_CONFIG_AUX_DIR([build-aux])
# The following sets CFLAGS to empty if unset on command line. We do not want
# the default "-g -O2" that AC_PROG_CC sets automatically.
# The following sets CFLAGS and CXXFLAGS to empty if unset on command line.
# We do not want the default "-g -O2" that AC_PROG_CC AC_PROG_CXX sets
# automatically.
: ${CFLAGS=""}
: ${CXXFLAGS=""}
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
@@ -157,6 +159,7 @@ then
enable_tls13=yes
enable_openssh=yes
enable_opensslextra=yes
enable_opensslall=yes
enable_savesession=yes
enable_savecert=yes
enable_atomicuser=yes
@@ -218,9 +221,13 @@ then
enable_x963kdf=yes
enable_scrypt=yes
enable_indef=yes
enable_enckeys=yes
AM_CFLAGS="-DHAVE_AES_DECRYPT $AM_CFLAGS"
AM_CFLAGS="-DHAVE_AES_ECB $AM_CFLAGS"
# Enable AES Decrypt, AES ECB, Alt Names, DER Load, Keep Certs, CRL IO with Timeout
AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB -DWOLFSSL_ALT_NAMES -DWOLFSSL_DER_LOAD -DKEEP_OUR_CERT -DKEEP_PEER_CERT -DHAVE_CRL_IO -DHAVE_IO_TIMEOUT"
# Enable DH const table speedups (eliminates `-lm` math lib dependency)
AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072 -DHAVE_FFDHE_4096 -DHAVE_FFDHE_6144 -DHAVE_FFDHE_8192"
fi
AM_CONDITIONAL([BUILD_ALL], [test "x$ENABLED_ALL" = "xyes"])
@@ -261,6 +268,9 @@ AC_ARG_ENABLE([singlethreaded],
AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xno" ],[
AX_PTHREAD([
AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
# If AX_PTHREAD is adding -Qunused-arguments, need to prepend with -Xcompiler libtool will use it. Newer
# versions of clang don't need the -Q flag when using pthreads.
AS_CASE([$PTHREAD_CFLAGS],[-Qunused-arguments*],[PTHREAD_CFLAGS="-Xcompiler $PTHREAD_CFLAGS"])
AM_CFLAGS="-D_POSIX_THREADS $AM_CFLAGS $PTHREAD_CFLAGS"
LIBS="$LIBS $PTHREAD_LIBS"
],[
@@ -307,6 +317,30 @@ then
fi
# TLS v1.3 Draft 23
AC_ARG_ENABLE([tls13-draft23],
[AS_HELP_STRING([--enable-tls13-draft23],[Enable wolfSSL TLS v1.3 Draft 23 (default: disabled)])],
[ ENABLED_TLS13_DRAFT23=$enableval ],
[ ENABLED_TLS13_DRAFT23=no ]
)
if test "$ENABLED_TLS13_DRAFT23" = "yes"
then
AM_CFLAGS="-DWOLFSSL_TLS13_DRAFT_23 $AM_CFLAGS"
fi
# TLS v1.3 Draft 26
AC_ARG_ENABLE([tls13-draft26],
[AS_HELP_STRING([--enable-tls13-draft26],[Enable wolfSSL TLS v1.3 Draft 26 (default: disabled)])],
[ ENABLED_TLS13_DRAFT26=$enableval ],
[ ENABLED_TLS13_DRAFT26=no ]
)
if test "$ENABLED_TLS13_DRAFT26" = "yes"
then
AM_CFLAGS="-DWOLFSSL_TLS13_DRAFT_26 $AM_CFLAGS"
fi
# TLS v1.3
AC_ARG_ENABLE([tls13],
[AS_HELP_STRING([--enable-tls13],[Enable wolfSSL TLS v1.3 (default: disabled)])],
@@ -314,7 +348,7 @@ AC_ARG_ENABLE([tls13],
[ ENABLED_TLS13=no ]
)
if test "$ENABLED_TLS13_DRAFT18" = "yes" || test "$ENABLED_TLS13_DRAFT22" = "yes"
if test "$ENABLED_TLS13_DRAFT18" = "yes" || test "$ENABLED_TLS13_DRAFT22" = "yes" || test "$ENABLED_TLS13_DRAFT23" = "yes" || test "$ENABLED_TLS13_DRAFT26" = "yes"
then
ENABLED_TLS13="yes"
fi
@@ -419,6 +453,22 @@ fi
AM_CONDITIONAL([BUILD_RNG], [test "x$ENABLED_RNG" = "xyes"])
# List of open source project defines using our openssl compatibility layer:
# openssh (--enable-openssh)
# nginix (--enable-nginx) WOLFSSL_NGINX
# haproxy (--enable-haproxy) WOLFSSL_HAPROXY
# wpa_supplicant (--enable-wpas) WOLFSSL_WPAS
# ssl fortress (--enable-fortress) FORTRESS
# ssl bump (--enable-bump)
# signal (--enable-signal)
# lighty (--enable-lighty) HAVE_LIGHTY
# stunnel (--enable-stunnel) HAVE_STUNNEL
# HAVE_POCO_LIB
# WOLFSSL_MYSQL_COMPATIBLE
# web server (--enable-webserver) HAVE_WEBSERVER
# OpenSSH compatibility Build
AC_ARG_ENABLE([openssh],
[AS_HELP_STRING([--enable-openssh],[Enable OpenSSH compatibility build (default: disabled)])],
@@ -494,13 +544,25 @@ then
fi
# OPENSSL Compatibility ALL
AC_ARG_ENABLE([opensslall],
[AS_HELP_STRING([--enable-opensslall],[Enable all OpenSSL API, size++ (default: disabled)])],
[ ENABLED_OPENSSLALL=$enableval ],
[ ENABLED_OPENSSLALL=no ]
)
if test "$ENABLED_OPENSSLALL" = "yes"
then
AM_CFLAGS="-DOPENSSL_ALL $AM_CFLAGS"
fi
# OPENSSL Extra Compatibility
AC_ARG_ENABLE([opensslextra],
[AS_HELP_STRING([--enable-opensslextra],[Enable extra OpenSSL API, size+ (default: disabled)])],
[ ENABLED_OPENSSLEXTRA=$enableval ],
[ ENABLED_OPENSSLEXTRA=no ]
)
if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_SIGNAL" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_FORTRESS" = "yes" || test "$ENABLED_BUMP" = "yes" || test "$ENABLED_SNIFFER" = "yes"
if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_SIGNAL" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_FORTRESS" = "yes" || test "$ENABLED_BUMP" = "yes" || test "$ENABLED_SNIFFER" = "yes" || test "$ENABLED_OPENSSLALL" = "yes"
then
ENABLED_OPENSSLEXTRA="yes"
fi
@@ -525,7 +587,7 @@ fi
# High Strength Build
AC_ARG_ENABLE([maxstrength],
[AS_HELP_STRING([--enable-maxstrength],[Enable Max Strengh build, allows TLSv1.2-AEAD-PFS ciphers only (default: disabled)])],
[AS_HELP_STRING([--enable-maxstrength],[Enable Max Strength build, allows TLSv1.2-AEAD-PFS ciphers only (default: disabled)])],
[ENABLED_MAXSTRENGTH=$enableval],
[ENABLED_MAXSTRENGTH=no])
@@ -567,7 +629,7 @@ then
AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_VERIFY_CB"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DWOLFSSL_DER_LOAD"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN -DWOLFSSL_DES_ECB"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WPAS"
fi
@@ -1747,6 +1809,18 @@ then
fi
# Base16
AC_ARG_ENABLE([base16],
[AS_HELP_STRING([--enable-base16],[Enable Base16 encoding/decoding (default: disabled)])],
[ ENABLED_BASE16=$enableval ],
[ ENABLED_BASE16=no ]
)
if test "$ENABLED_BASE16" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BASE16"
fi
# DES3
AC_ARG_ENABLE([des3],
[AS_HELP_STRING([--enable-des3],[Enable DES3 (default: disabled)])],
@@ -1883,6 +1957,17 @@ then
AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
fi
# Web Client Build (HTTP Client)
AC_ARG_ENABLE([webclient],
[AS_HELP_STRING([--enable-webclient],[Enable Web Client (HTTP) (default: disabled)])],
[ ENABLED_WEBCLIENT=$enableval ],
[ ENABLED_WEBCLIENT=no ]
)
if test "$ENABLED_WEBCLIENT" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DHAVE_HTTP_CLIENT"
fi
# HC128
@@ -2176,7 +2261,7 @@ AC_ARG_ENABLE([ocsp],
[ ENABLED_OCSP=no ],
)
if test "x$ENABLED_NGINX" = "xyes"
if test "x$ENABLED_OPENSSLALL" = "xyes" || test "x$ENABLED_NGINX" = "xyes"
then
ENABLED_OCSP=yes
fi
@@ -3031,6 +3116,24 @@ fi
AM_CONDITIONAL([BUILD_MD4], [test "x$ENABLED_MD4" = "xyes"])
# Encrypted keys
AC_ARG_ENABLE([enckeys],
[AS_HELP_STRING([--enable-enckeys],[Enable PEM encrypted private key support (default: disabled)])],
[ ENABLED_ENCKEYS=$enableval ],
[ ENABLED_ENCKEYS=no ]
)
if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes"
then
ENABLED_ENCKEYS=yes
fi
if test "$ENABLED_ENCKEYS" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ENCRYPTED_KEYS"
fi
# PWDBASED has to come after certservice since we want it on w/o explicit on
# PWDBASED
AC_ARG_ENABLE([pwdbased],
@@ -3041,9 +3144,9 @@ AC_ARG_ENABLE([pwdbased],
if test "$ENABLED_PWDBASED" = "no"
then
if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes"
if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes" || test "$ENABLED_ENCKEYS" = "yes"
then
# opensslextra and webserver needs pwdbased
# opensslextra, webserver and enckeys needs pwdbased
ENABLED_PWDBASED=yes
else
AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
@@ -3264,8 +3367,8 @@ AC_ARG_WITH([cavium-v],
[ --with-cavium-v=PATH PATH to Cavium V/software dir ],
[
AC_MSG_CHECKING([for cavium])
CPPFLAGS="$CPPFLAGS -DHAVE_CAVIUM -DHAVE_CAVIUM_V"
LIB_ADD="-lrt $LIB_ADD"
AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM -DHAVE_CAVIUM_V"
LIB_ADD="-lrt -lcrypto $LIB_ADD"
if test "x$withval" == "xyes" ; then
AC_MSG_ERROR([need a PATH for --with-cavium])
@@ -3274,21 +3377,17 @@ AC_ARG_WITH([cavium-v],
trycaviumdir=$withval
fi
LDFLAGS="$AM_LDFLAGS $trycaviumdir/api/obj/cavium_common.o $trycaviumdir/api/obj/cavium_sym_crypto.o $trycaviumdir/api/obj/cavium_asym_crypto.o"
CPPFLAGS="$CPPFLAGS -I$trycaviumdir/include"
AC_CHECK_FILES([$trycaviumdir/lib/libnitrox.a], [AM_CPPFLAGS="-I$trycaviumdir/include $AM_CPPFLAGS"], [ENABLED_CAVIUM_V=no])
LIB_STATIC_ADD="$trycaviumdir/lib/libnitrox.a $LIB_STATIC_ADD"
#AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cavium_common.h"]], [[ CspShutdown(0); ]])],[ cavium_linked=yes ],[ cavium_linked=no ])
if test "x$cavium_linked" == "xno" ; then
AC_MSG_ERROR([cavium isn't found.
If it's already installed, specify its path using --with-cavium-v=/dir/])
else
AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM -DHAVE_CAVIUM_V"
if test "$ENABLED_CAVIUM_V" = "no"; then
AC_MSG_ERROR([Could not find Nitrox library])
fi
AC_MSG_RESULT([yes])
enable_shared=no
enable_static=yes
enable_opensslextra=yes
ENABLED_CAVIUM=yes
ENABLED_CAVIUM_V=yes
],
@@ -3299,6 +3398,7 @@ AC_ARG_WITH([cavium-v],
)
AM_CONDITIONAL([BUILD_CAVIUM], [test "x$ENABLED_CAVIUM" = "xyes"])
AM_CONDITIONAL([BUILD_CAVIUM_V], [test "x$ENABLED_CAVIUM_V" = "xyes"])
# Intel Quick Assist
@@ -3768,6 +3868,20 @@ else
fi
# Support for crypto device hardware
AC_ARG_ENABLE([cryptodev],
[AS_HELP_STRING([--enable-cryptodev],[Enable crypto hardware support (default: disabled)])],
[ ENABLED_CRYPTODEV=$enableval ],
[ ENABLED_CRYPTODEV=no ]
)
if test "$ENABLED_CRYPTODEV" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DWOLF_CRYPTO_DEV"
fi
AM_CONDITIONAL([BUILD_CRYPTODEV], [test "x$ENABLED_CRYPTODEV" = "xyes"])
# Session Export
AC_ARG_ENABLE([sessionexport],
[AS_HELP_STRING([--enable-sessionexport],[Enable export and import of sessions (default: disabled)])],
@@ -3817,6 +3931,14 @@ then
fi
# Default optimization CFLAGS enable
AC_ARG_ENABLE([optflags],
[AS_HELP_STRING([--enable-optflags],[Enable default optimization CFLAGS for the compiler (default: enabled)])],
[ ENABLED_OPTFLAGS=$enableval ],
[ ENABLED_OPTFLAGS=yes ]
)
# check if PSK was enabled for conditionally running psk.test script
AM_CONDITIONAL([BUILD_PSK], [test "x$ENABLED_PSK" = "xyes"])
@@ -3873,8 +3995,9 @@ AS_IF([test "x$ENABLED_OCSP" = "xyes" && \
# checks for pkcs7 needed enables
AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
test "x$ENABLED_RSA" = "xno"],
[AC_MSG_ERROR([please enable rsa if enabling pkcs7.])])
test "x$ENABLED_RSA" = "xno" && \
test "x$ENABLED_ECC" = "xno"],
[AC_MSG_ERROR([please enable ecc or rsa if enabling pkcs7.])])
AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
test "x$ENABLED_SHA" = "xno"],
@@ -3957,7 +4080,7 @@ then
ENABLED_AESKEYWRAP="yes"
AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP -DWOLFSSL_AES_DIRECT"
fi
if test "x$ENABLED_X963KDF" = "xno"
if test "x$ENABLED_X963KDF" = "xno" && test "$ENABLED_ECC" = "yes"
then
ENABLED_X963KDF="yes"
AM_CFLAGS="$AM_CFLAGS -DHAVE_X963_KDF"
@@ -4030,6 +4153,7 @@ then
AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
if test "$ax_enable_debug" = "no"
then
AS_IF([test "x$ENABLED_OPTFLAGS" = "xyes"], [
if test "$ENABLED_FASTMATH" = "yes"
then
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
@@ -4040,6 +4164,7 @@ then
else
AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
fi
])
fi
fi
@@ -4080,7 +4205,7 @@ if test "$ENABLED_DISTRO" = "no"
then
CFLAGS="$CFLAGS $USER_C_EXTRA_FLAGS"
fi
OPTION_FLAGS="$USER_CFLAGS $USER_C_EXTRA_FLAGS $AM_CFLAGS"
OPTION_FLAGS="$USER_CFLAGS $USER_C_EXTRA_FLAGS $CPPFLAGS $AM_CFLAGS"
@@ -4311,6 +4436,9 @@ echo " * SSL version 3.0: $ENABLED_SSLV3"
echo " * TLS v1.0: $ENABLED_TLSV10"
echo " * TLS v1.3: $ENABLED_TLS13"
echo " * TLS v1.3 Draft 18: $ENABLED_TLS13_DRAFT18"
echo " * TLS v1.3 Draft 22: $ENABLED_TLS13_DRAFT22"
echo " * TLS v1.3 Draft 23: $ENABLED_TLS13_DRAFT23"
echo " * TLS v1.3 Draft 26: $ENABLED_TLS13_DRAFT26"
echo " * Post-handshake Auth: $ENABLED_TLS13_POST_AUTH"
echo " * Early Data: $ENABLED_TLS13_EARLY_DATA"
echo " * Send State in HRR Cookie: $ENABLED_SEND_HRR_COOKIE"

View File

@@ -38,10 +38,8 @@
#include <wolfssl/wolfcrypt/asn.h>
#ifndef WOLFSSL_PEMCERT_TODER_DEFINED
#ifndef NO_FILESYSTEM
#define CyaSSL_PemCertToDer wolfSSL_PemCertToDer
#endif
#define CyaSSL_PemCertToDer wc_PemCertToDer
#endif
#endif /* CTAO_CRYPT_ASN_H */

View File

@@ -498,8 +498,8 @@
*/
#define CyaSSL_accept_ex wolfSSL_accept_ex
#define CyaSSL_SetIORecv wolfSSL_SetIORecv
#define CyaSSL_SetIOSend wolfSSL_SetIOSend
#define CyaSSL_SetIORecv wolfSSL_CTX_SetIORecv
#define CyaSSL_SetIOSend wolfSSL_CTX_SetIOSend
#define CyaSSL_connect_ex wolfSSL_connect_ex
#define CyaSSL_CTX_SetCACb wolfSSL_CTX_SetCACb
#define CyaSSL_SetIOReadCtx wolfSSL_SetIOReadCtx
@@ -657,7 +657,6 @@
/* OpenSSL Compatibility Layer */
#define CyaSSL_PemCertToDer wolfSSL_PemCertToDer
#define CyaSSL_get_sessionID wolfSSL_get_sessionID
#define CyaSSL_get_peer_count wolfSSL_get_peer_count
#define CyaSSL_get_chain_cert wolfSSL_get_chain_cert

178
doc/README_DOXYGEN Normal file
View File

@@ -0,0 +1,178 @@
wolfSSL with Doxygen 1.8.13
---- Dependencies ----
cmake
make
git
latex-see below (With pdflatex included. However the pdflatex dependency can be removed by
setting USE_PDFLATEX to NO in the file "Doxyfile" located at
doc/formats/pdf/Doxyfile )
The following texlive packages were installed when creating this
documentation on Linux Mint:
sudo apt install texlive
sudo apt install texlive-latex-extra
For Mac users Basic Tex from TUG is recommended. After installing BasicTex
additional dependencies will need to be met:
% sudo tlmgr update --self
% sudo tlmgr install tabu varwidth multirow adjustbox collectbox sectsty tocloft collection-fontsextra
---- Generating the Documentation ----
If you are looking to just generate the html documentation and not interested in
how to add your own just run one of the following commands from the main wolfssl
directory:
make dox (this option will make both html and pdf documentation)
make dox-html (only html documentation)
make dox-pdf (only pdf documentation)
If it is the first time running one of the above commands the command will take
some time to run. This is because the doxygen repository must be clones and then
built along with the time taken to make the documentation.
Once documentation generation has completed to open the html use a browser to
open doc/html/index.html. To open the generated pdf looking for
refman.pdf located and doc/refman.pdf.
---- Configure ----
Doxygen uses a file called "Doxyfile" to hold all its values for configuration.
If needed, to generate a fresh Doxfile run the command
doxygen -g
Once a Doxyfile is generate there are a few options to keep in mind.
Below are some the the settings that are currently used:
EXTRACT_ALL
- this option determines if all API are extracted or just API that is documented.
OPTIMIZE_OUTPUT_FOR_C
- changes the look and naming schemes used in generated documentation.
RECURSIVE
- allows doxygen to search subdirectories in a library for documenting.
GENERATE_LATEX
- tells doxygen whether or not to generate LATEX documentation. The Latex
that is generated is used to generate a PDF as well.
ENABLE_PREPROCESSING
- tells doxygen whether or not to ignore C/C++ preprocessors directives i.e #ifdef, #ifndef
EXCLUDE
- allows the user to specify files or directories to ignore when documenting.
HTML_EXTRA_STYLESHEET
-allows the user to specify their own css style sheet to use for the doxygen html.
SHOW_USED_FILES and SHOW_FILES
- when using groups it is important to keep these options set to yes otherwise
functions with documentation that are not part of a group may fail to be included
in the generated documentation.
---- Embedding Documentation ----
Doxygen API documentation should be placed in the doc/dox_comments/
directory. The documentation should be stored in a file in this directory with the
same name of the file in which the API resides in the wolfssl repository. C code
header files (*.h) should be used when writing the API documentation. If API in a
file is being documented for the first time be sure to add the to the top of the
original file:
/*!
\file wolfssl/PATH_TO_FILE/FILE_NAME
*/
This ensures that the file will be linked to in the doxygen generated html.
When specifying a specific file with the \file command be sure to include part of
the file's path so that it is a unique name. This allows for linking to files even
when multiple files share the same name.
To ensure that doxygen documents a specific API in to a desired module be sure
to include that module's name in the \ingroup. The current modules to choose from
are as follows but new group can be made:
\ingroup 3DES
\ingroup AES
\ingroup ARC4
\ingroup BLAKE2
\ingroup Camellia
\ingroup ChaCha
\ingroup ChaCha20Poly1305
\ingroup Curve25519
\ingroup DSA Algorithms
\ingroup Diffie-Hellman
\ingroup ECC
\ingroup ED25519
\ingroup HC128
\ingroup HMAC
\ingroup IDEA
\ingroup MD2
\ingroup MD4
\ingroup MD5
\ingroup PKCS7
\ingroup Password
\ingroup Poly1305
\ingroup RIPEMD
\ingroup RSA
\ingroup Rabbit
\ingroup SHA
\ingroup SRP
\ingroup wolfCrypt
\ingroup openSSL
\ingroup CertManager
\ingroup TLS
\ingroup CertsKeys
\ingroup Setup
\ingroup IO
\ingroup Debug
If one of the above modules/ groups does not fit a desired function then a new
group will need to be created. To do this include add a new group definition
to the doxygen_groups.h file located at documentation/formats/pdf/doxygen_groups.h
/*!
\defgroup <group name> <description>
*/
The general outline when documenting within the wolfssl library in doxygen should
look like as follows:
/*!
\ingroup //if API should be in a separate module
\brief <description of API>
\return <name of return> <description> // each return will need \return.
\param <name of param> <description> // stands for parameter, each parameter will need \param.
_Example_
\code
// any example code here
\endcode
\sa // stands for see also. Each API reference here should begin with \sa
\sa <Function>
\sa <Function>
*/
When adding new documentation be sure to keep the sections, \ingroup, \brief,
\param, \return, Etc. separated with at least 1 newline. This insures that when
doxygen attempts to generate documentation the sections do not overlap each other
and produce errors (this is especially important when the latex is being generated).
Once finished creating new documentation it is highly recommended to generate new
html and pdf to ensure no errors were introduced that prevent documentation
generation and that the documentation shows up correctly.

43
doc/check_api.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/sh
ls ./dox_comments/header_files/ |
while read h_file; do
grep -P -h -z -o 'WOLFSSL_API(\n|\s|[^;])*;' ./dox_comments/header_files/$h_file |
tr '\n' ' ' |
sed 's/\\n//g' |
sed 's/ \+/ /g' |
sed 's/\x00/\n/g' > dox_api.txt
find ../ -not -path '../doc/*' -name $h_file |
while read -r h_file_path; do
echo "Checking: $h_file_path"
grep -P -h -z -o 'WOLFSSL_API(\n|\s|[^;])*;' "$h_file_path" |
sed 's/#.*/ /g' |
tr '\n' ' ' |
sed 's/\\n//g' |
sed 's/ \+/ /g' |
sed 's/\x00/\n/g' > wolf_api.txt
api_count="$(wc -l < dox_api.txt)"
match_count="$(grep -Ff dox_api.txt wolf_api.txt | wc -l)"
if [ "$api_count" != "$match_count" ]; then
echo "Mistmatch"
echo "Dox_api: $api_count"
echo "Matched_api: $match_count"
echo "Header file: $h_file"
echo "Check API: "
sort dox_api.txt -o dox_api.txt
sort wolf_api.txt -o wolf_api.txt
comm -23 dox_api.txt wolf_api.txt
exit 1
else
echo "$h_file is all good"
break
fi
done || exit 1
echo 'Next...\n'
done || exit 1
rm dox_api.txt
rm wolf_api.txt

View File

@@ -0,0 +1,839 @@
/*!
\ingroup AES
\brief This function initializes an AES structure by setting the key and
then setting the initialization vector.
\return 0 On successfully setting key and initialization vector.
\return BAD_FUNC_ARG Returned if key length is invalid.
\param aes pointer to the AES structure to modify
\param key 16, 24, or 32 byte secret key for encryption and decryption
\param len length of the key passed in
\param iv pointer to the initialization vector used to initialize the key
\param dir Cipher direction. Set AES_ENCRYPTION to encrypt, or
AES_DECRYPTION to decrypt.
_Example_
\code
Aes enc;
int ret = 0;
byte key[] = { some 16, 24 or 32 byte key };
byte iv[] = { some 16 byte iv };
if (ret = wc_AesSetKey(&enc, key, AES_BLOCK_SIZE, iv,
AES_ENCRYPTION) != 0) {
// failed to set aes key
}
\endcode
\sa wc_AesSetKeyDirect
\sa wc_AesSetIV
*/
WOLFSSL_API int wc_AesSetKey(Aes* aes, const byte* key, word32 len,
const byte* iv, int dir);
/*!
\ingroup AES
\brief This function sets the initialization vector for a
particular AES object. The AES object should be initialized before
calling this function.
\return 0 On successfully setting initialization vector.
\return BAD_FUNC_ARG Returned if AES pointer is NULL.
\param aes pointer to the AES structure on which to set the
initialization vector
\param iv initialization vector used to initialize the AES structure.
If the value is NULL, the default action initializes the iv to 0.
_Example_
\code
Aes enc;
// set enc key
byte iv[] = { some 16 byte iv };
if (ret = wc_AesSetIV(&enc, iv) != 0) {
// failed to set aes iv
}
\endcode
\sa wc_AesSetKeyDirect
\sa wc_AesSetKey
*/
WOLFSSL_API int wc_AesSetIV(Aes* aes, const byte* iv);
/*!
\ingroup AES
\brief Encrypts a plaintext message from the input buffer in, and places
the resulting cipher text in the output buffer out using cipher block
chaining with AES. This function requires that the AES object has been
initialized by calling AesSetKey before a message is able to be encrypted.
This function assumes that the input message is AES block length aligned.
PKCS#7 style padding should be added beforehand. This differs from the
OpenSSL AES-CBC methods which add the padding for you. To make the wolfSSL
function and equivalent OpenSSL functions interoperate, one should specify
the -nopad option in the OpenSSL command line function so that it behaves
like the wolfSSL AesCbcEncrypt method and does not add extra padding
during encryption.
\return 0 On successfully encrypting message.
\return BAD_ALIGN_E: Returned on block align error
\param aes pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the ciphertext
of the encrypted message
\param in pointer to the input buffer containing message to be encrypted
\param sz size of input message
_Example_
\code
Aes enc;
int ret = 0;
// initialize enc with AesSetKey, using direction AES_ENCRYPTION
byte msg[AES_BLOCK_SIZE * n]; // multiple of 16 bytes
// fill msg with data
byte cipher[AES_BLOCK_SIZE * n]; // Some multiple of 16 bytes
if ((ret = wc_AesCbcEncrypt(&enc, cipher, message, sizeof(msg))) != 0 ) {
// block align error
}
\endcode
\sa wc_AesSetKey
\sa wc_AesSetIV
\sa wc_AesCbcDecrypt
*/
WOLFSSL_API int wc_AesCbcEncrypt(Aes* aes, byte* out,
const byte* in, word32 sz);
/*!
\ingroup AES
\brief Decrypts a cipher from the input buffer in, and places the
resulting plain text in the output buffer out using cipher block chaining
with AES. This function requires that the AES structure has been
initialized by calling AesSetKey before a message is able to be decrypted.
This function assumes that the original message was AES block length
aligned. This differs from the OpenSSL AES-CBC methods which do not
require alignment as it adds PKCS#7 padding automatically. To make the
wolfSSL function and equivalent OpenSSL functions interoperate, one
should specify the -nopad option in the OpenSSL command line function
so that it behaves like the wolfSSL AesCbcEncrypt method and does not
create errors during decryption.
\return 0 On successfully decrypting message.
\return BAD_ALIGN_E Returned on block align error.
\param aes pointer to the AES object used to decrypt data.
\param out pointer to the output buffer in which to store the plain text
of the decrypted message.
\param in pointer to the input buffer containing cipher text to be
decrypted.
\param sz size of input message.
_Example_
\code
Aes dec;
int ret = 0;
// initialize dec with AesSetKey, using direction AES_DECRYPTION
byte cipher[AES_BLOCK_SIZE * n]; // some multiple of 16 bytes
// fill cipher with cipher text
byte plain [AES_BLOCK_SIZE * n];
if ((ret = wc_AesCbcDecrypt(&dec, plain, cipher, sizeof(cipher))) != 0 ) {
// block align error
}
\endcode
\sa wc_AesSetKey
\sa wc_AesCbcEncrypt
*/
WOLFSSL_API int wc_AesCbcDecrypt(Aes* aes, byte* out,
const byte* in, word32 sz);
/*!
\ingroup AES
\brief Encrypts/Decrypts a message from the input buffer in, and places
the resulting cipher text in the output buffer out using CTR mode with
AES. This function is only enabled if WOLFSSL_AES_COUNTER is enabled at
compile time. The AES structure should be initialized through AesSetKey
before calling this function. Note that this function is used for both
decryption and encryption. _NOTE:_ Regarding using same API for encryption
and decryption. User should differentiate between Aes structures
for encrypt/decrypt.
\return int integer values corresponding to wolfSSL error or success
status
\param aes pointer to the AES object used to decrypt data
\param out pointer to the output buffer in which to store the cipher
text of the encrypted message
\param in pointer to the input buffer containing plain text to be encrypted
\param sz size of the input plain text
_Example_
\code
Aes enc;
Aes dec;
// initialize enc and dec with AesSetKeyDirect, using direction
AES_ENCRYPTION
// since the underlying API only calls Encrypt and by default calling
encrypt on
// a cipher results in a decryption of the cipher
byte msg[AES_BLOCK_SIZE * n]; //n being a positive integer making msg
some multiple of 16 bytes
// fill plain with message text
byte cipher[AES_BLOCK_SIZE * n];
byte decrypted[AES_BLOCK_SIZE * n];
wc_AesCtrEncrypt(&enc, cipher, msg, sizeof(msg)); // encrypt plain
wc_AesCtrEncrypt(&dec, decrypted, cipher, sizeof(cipher));
// decrypt cipher text
\endcode
\sa wc_AesSetKey
*/
WOLFSSL_API int wc_AesCtrEncrypt(Aes* aes, byte* out,
const byte* in, word32 sz);
/*!
\ingroup AES
\brief This function is a one-block encrypt of the input block, in, into
the output block, out. It uses the key and iv (initialization vector)
of the provided AES structure, which should be initialized with
wc_AesSetKey before calling this function. It is only enabled if the
configure option WOLFSSL_AES_DIRECT is enabled. __Warning:__ In nearly all
use cases ECB mode is considered to be less secure. Please avoid using ECB
APIs directly whenever possible
\param aes pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the cipher
text of the encrypted message
\param in pointer to the input buffer containing plain text to be encrypted
_Example_
\code
Aes enc;
// initialize enc with AesSetKey, using direction AES_ENCRYPTION
byte msg [AES_BLOCK_SIZE]; // 16 bytes
// initialize msg with plain text to encrypt
byte cipher[AES_BLOCK_SIZE];
wc_AesEncryptDirect(&enc, cipher, msg);
\endcode
\sa wc_AesDecryptDirect
\sa wc_AesSetKeyDirect
*/
WOLFSSL_API void wc_AesEncryptDirect(Aes* aes, byte* out, const byte* in);
/*!
\ingroup AES
\brief This function is a one-block decrypt of the input block, in, into
the output block, out. It uses the key and iv (initialization vector) of
the provided AES structure, which should be initialized with wc_AesSetKey
before calling this function. It is only enabled if the configure option
WOLFSSL_AES_DIRECT is enabled, and there is support for direct AES
encryption on the system in question. __Warning:__ In nearly all use cases
ECB mode is considered to be less secure. Please avoid using ECB APIs
directly whenever possible
\return none
\param aes pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the plain
text of the decrypted cipher text
\param in pointer to the input buffer containing cipher text to be
decrypted
_Example_
\code
Aes dec;
// initialize enc with AesSetKey, using direction AES_DECRYPTION
byte cipher [AES_BLOCK_SIZE]; // 16 bytes
// initialize cipher with cipher text to decrypt
byte msg[AES_BLOCK_SIZE];
wc_AesDecryptDirect(&dec, msg, cipher);
\endcode
\sa wc_AesEncryptDirect
\sa wc_AesSetKeyDirect
*/
WOLFSSL_API void wc_AesDecryptDirect(Aes* aes, byte* out, const byte* in);
/*!
\ingroup AES
\brief This function is used to set the AES keys for CTR mode with AES.
It initializes an AES object with the given key, iv
(initialization vector), and encryption dir (direction). It is only
enabled if the configure option WOLFSSL_AES_DIRECT is enabled.
Currently wc_AesSetKeyDirect uses wc_AesSetKey internally. __Warning:__ In
nearly all use cases ECB mode is considered to be less secure. Please avoid
using ECB APIs directly whenever possible
\return 0 On successfully setting the key.
\return BAD_FUNC_ARG Returned if the given key is an invalid length.
\param aes pointer to the AES object used to encrypt data
\param key 16, 24, or 32 byte secret key for encryption and decryption
\param len length of the key passed in
\param iv initialization vector used to initialize the key
\param dir Cipher direction. Set AES_ENCRYPTION to encrypt, or
AES_DECRYPTION to decrypt. (See enum in wolfssl/wolfcrypt/aes.h)
(NOTE: If using wc_AesSetKeyDirect with Aes Counter mode (Stream cipher)
only use AES_ENCRYPTION for both encrypting and decrypting)
_Example_
\code
Aes enc;
int ret = 0;
byte key[] = { some 16, 24, or 32 byte key };
byte iv[] = { some 16 byte iv };
if (ret = wc_AesSetKeyDirect(&enc, key, sizeof(key), iv,
AES_ENCRYPTION) != 0) {
// failed to set aes key
}
\endcode
\sa wc_AesEncryptDirect
\sa wc_AesDecryptDirect
\sa wc_AesSetKey
*/
WOLFSSL_API int wc_AesSetKeyDirect(Aes* aes, const byte* key, word32 len,
const byte* iv, int dir);
/*!
\ingroup AES
\brief This function is used to set the key for AES GCM
(Galois/Counter Mode). It initializes an AES object with the
given key. It is only enabled if the configure option
HAVE_AESGCM is enabled at compile time.
\return 0 On successfully setting the key.
\return BAD_FUNC_ARG Returned if the given key is an invalid length.
\param aes pointer to the AES object used to encrypt data
\param key 16, 24, or 32 byte secret key for encryption and decryption
\param len length of the key passed in
_Example_
\code
Aes enc;
int ret = 0;
byte key[] = { some 16, 24,32 byte key };
if (ret = wc_AesGcmSetKey(&enc, key, sizeof(key)) != 0) {
// failed to set aes key
}
\endcode
\sa wc_AesGcmEncrypt
\sa wc_AesGcmDecrypt
*/
WOLFSSL_API int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len);
/*!
\ingroup AES
\brief This function encrypts the input message, held in the buffer in,
and stores the resulting cipher text in the output buffer out. It
requires a new iv (initialization vector) for each call to encrypt.
It also encodes the input authentication vector, authIn, into the
authentication tag, authTag.
\return 0 On successfully encrypting the input message
\param aes - pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the cipher text
\param in pointer to the input buffer holding the message to encrypt
\param sz length of the input message to encrypt
\param iv pointer to the buffer containing the initialization vector
\param ivSz length of the initialization vector
\param authTag pointer to the buffer in which to store the
authentication tag
\param authTagSz length of the desired authentication tag
\param authIn pointer to the buffer containing the input
authentication vector
\param authInSz length of the input authentication vector
_Example_
\code
Aes enc;
// initialize aes structure by calling wc_AesGcmSetKey
byte plain[AES_BLOCK_LENGTH * n]; //n being a positive integer
making plain some multiple of 16 bytes
// initialize plain with msg to encrypt
byte cipher[sizeof(plain)];
byte iv[] = // some 16 byte iv
byte authTag[AUTH_TAG_LENGTH];
byte authIn[] = // Authentication Vector
wc_AesGcmEncrypt(&enc, cipher, plain, sizeof(cipher), iv, sizeof(iv),
authTag, sizeof(authTag), authIn, sizeof(authIn));
\endcode
\sa wc_AesGcmSetKey
\sa wc_AesGcmDecrypt
*/
WOLFSSL_API int wc_AesGcmEncrypt(Aes* aes, byte* out,
const byte* in, word32 sz,
const byte* iv, word32 ivSz,
byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
/*!
\ingroup AES
\brief This function decrypts the input cipher text, held in the buffer
in, and stores the resulting message text in the output buffer out.
It also checks the input authentication vector, authIn, against the
supplied authentication tag, authTag.
\return 0 On successfully decrypting the input message
\return AES_GCM_AUTH_E If the authentication tag does not match the
supplied authentication code vector, authTag.
\param aes pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the message text
\param in pointer to the input buffer holding the cipher text to decrypt
\param sz length of the cipher text to decrypt
\param iv pointer to the buffer containing the initialization vector
\param ivSz length of the initialization vector
\param authTag pointer to the buffer containing the authentication tag
\param authTagSz length of the desired authentication tag
\param authIn pointer to the buffer containing the input
authentication vector
\param authInSz length of the input authentication vector
_Example_
\code
Aes enc; //can use the same struct as was passed to wc_AesGcmEncrypt
// initialize aes structure by calling wc_AesGcmSetKey if not already done
byte cipher[AES_BLOCK_LENGTH * n]; //n being a positive integer
making cipher some multiple of 16 bytes
// initialize cipher with cipher text to decrypt
byte output[sizeof(cipher)];
byte iv[] = // some 16 byte iv
byte authTag[AUTH_TAG_LENGTH];
byte authIn[] = // Authentication Vector
wc_AesGcmDecrypt(&enc, output, cipher, sizeof(cipher), iv, sizeof(iv),
authTag, sizeof(authTag), authIn, sizeof(authIn));
\endcode
\sa wc_AesGcmSetKey
\sa wc_AesGcmEncrypt
*/
WOLFSSL_API int wc_AesGcmDecrypt(Aes* aes, byte* out,
const byte* in, word32 sz,
const byte* iv, word32 ivSz,
const byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
/*!
\ingroup AES
\brief This function initializes and sets the key for a GMAC object
to be used for Galois Message Authentication.
\return 0 On successfully setting the key
\return BAD_FUNC_ARG Returned if key length is invalid.
\param gmac pointer to the gmac object used for authentication
\param key 16, 24, or 32 byte secret key for authentication
\param len length of the key
_Example_
\code
Gmac gmac;
key[] = { some 16, 24, or 32 byte length key };
wc_GmacSetKey(&gmac, key, sizeof(key));
\endcode
\sa wc_GmacUpdate
*/
WOLFSSL_API int wc_GmacSetKey(Gmac* gmac, const byte* key, word32 len);
/*!
\ingroup AES
\brief This function generates the Gmac hash of the authIn input and
stores the result in the authTag buffer. After running wc_GmacUpdate,
one should compare the generated authTag to a known authentication tag
to verify the authenticity of a message.
\return 0 On successfully computing the Gmac hash.
\param gmac pointer to the gmac object used for authentication
\param iv initialization vector used for the hash
\param ivSz size of the initialization vector used
\param authIn pointer to the buffer containing the authentication
vector to verify
\param authInSz size of the authentication vector
\param authTag pointer to the output buffer in which to store the Gmac hash
\param authTagSz the size of the output buffer used to store the Gmac hash
_Example_
\code
Gmac gmac;
key[] = { some 16, 24, or 32 byte length key };
iv[] = { some 16 byte length iv };
wc_GmacSetKey(&gmac, key, sizeof(key));
authIn[] = { some 16 byte authentication input };
tag[AES_BLOCK_SIZE]; // will store authentication code
wc_GmacUpdate(&gmac, iv, sizeof(iv), authIn, sizeof(authIn), tag,
sizeof(tag));
\endcode
\sa wc_GmacSetKey
*/
WOLFSSL_API int wc_GmacUpdate(Gmac* gmac, const byte* iv, word32 ivSz,
const byte* authIn, word32 authInSz,
byte* authTag, word32 authTagSz);
/*!
\ingroup AES
\brief This function sets the key for an AES object using CCM
(Counter with CBC-MAC). It takes a pointer to an AES structure and
initializes it with supplied key.
\return none
\param aes aes structure in which to store the supplied key
\param key 16, 24, or 32 byte secret key for encryption and decryption
\param keySz size of the supplied key
_Example_
\code
Aes enc;
key[] = { some 16, 24, or 32 byte length key };
wc_AesCcmSetKey(&aes, key, sizeof(key));
\endcode
\sa wc_AesCcmEncrypt
\sa wc_AesCcmDecrypt
*/
WOLFSSL_API int wc_AesCcmSetKey(Aes* aes, const byte* key, word32 keySz);
/*!
\ingroup AES
\brief This function encrypts the input message, in, into the output
buffer, out, using CCM (Counter with CBC-MAC). It subsequently
calculates and stores the authorization tag, authTag, from the
authIn input.
\return none
\param aes pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the cipher text
\param in pointer to the input buffer holding the message to encrypt
\param sz length of the input message to encrypt
\param nonce pointer to the buffer containing the nonce
(number only used once)
\param nonceSz length of the nonce
\param authTag pointer to the buffer in which to store the
authentication tag
\param authTagSz length of the desired authentication tag
\param authIn pointer to the buffer containing the input
authentication vector
\param authInSz length of the input authentication vector
_Example_
\code
Aes enc;
// initialize enc with wc_AesCcmSetKey
nonce[] = { initialize nonce };
plain[] = { some plain text message };
cipher[sizeof(plain)];
authIn[] = { some 16 byte authentication input };
tag[AES_BLOCK_SIZE]; // will store authentication code
wc_AesCcmEncrypt(&enc, cipher, plain, sizeof(plain), nonce, sizeof(nonce),
tag, sizeof(tag), authIn, sizeof(authIn));
\endcode
\sa wc_AesCcmSetKey
\sa wc_AesCcmDecrypt
*/
WOLFSSL_API int wc_AesCcmEncrypt(Aes* aes, byte* out,
const byte* in, word32 inSz,
const byte* nonce, word32 nonceSz,
byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
/*!
\ingroup AES
\brief This function decrypts the input cipher text, in, into
the output buffer, out, using CCM (Counter with CBC-MAC). It
subsequently calculates the authorization tag, authTag, from the
authIn input. If the authorization tag is invalid, it sets the
output buffer to zero and returns the error: AES_CCM_AUTH_E.
\return 0 On successfully decrypting the input message
\return AES_CCM_AUTH_E If the authentication tag does not match the
supplied authentication code vector, authTag.
\param aes pointer to the AES object used to encrypt data
\param out pointer to the output buffer in which to store the cipher text
\param in pointer to the input buffer holding the message to encrypt
\param sz length of the input cipher text to decrypt
\param nonce pointer to the buffer containing the nonce
(number only used once)
\param nonceSz length of the nonce
\param authTag pointer to the buffer in which to store the
authentication tag
\param authTagSz length of the desired authentication tag
\param authIn pointer to the buffer containing the input
authentication vector
\param authInSz length of the input authentication vector
_Example_
\code
Aes dec;
// initialize dec with wc_AesCcmSetKey
nonce[] = { initialize nonce };
cipher[] = { encrypted message };
plain[sizeof(cipher)];
authIn[] = { some 16 byte authentication input };
tag[AES_BLOCK_SIZE] = { authentication tag received for verification };
int return = wc_AesCcmDecrypt(&dec, plain, cipher, sizeof(cipher),
nonce, sizeof(nonce),tag, sizeof(tag), authIn, sizeof(authIn));
if(return != 0) {
// decrypt error, invalid authentication code
}
\endcode
\sa wc_AesCcmSetKey
\sa wc_AesCcmEncrypt
*/
WOLFSSL_API int wc_AesCcmDecrypt(Aes* aes, byte* out,
const byte* in, word32 inSz,
const byte* nonce, word32 nonceSz,
const byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
/*!
\ingroup AES
\brief This is to help with setting keys to correct encrypt or
decrypt type. It is up to user to call wc_AesXtsFree on aes key when done.
\return 0 Success
\param aes AES keys for encrypt/decrypt process
\param key buffer holding aes key | tweak key
\param len length of key buffer in bytes. Should be twice that of
key size.
i.e. 32 for a 16 byte key.
\param dir direction, either AES_ENCRYPTION or AES_DECRYPTION
\param heap heap hint to use for memory. Can be NULL
\param devId id to use with async crypto. Can be 0
_Example_
\code
XtsAes aes;
if(wc_AesXtsSetKey(&aes, key, sizeof(key), AES_ENCRYPTION, NULL, 0) != 0)
{
// Handle error
}
wc_AesXtsFree(&aes);
\endcode
\sa wc_AesXtsEncrypt
\sa wc_AesXtsDecrypt
\sa wc_AesXtsFree
*/
WOLFSSL_API int wc_AesXtsSetKey(XtsAes* aes, const byte* key,
word32 len, int dir, void* heap, int devId);
/*!
\ingroup AES
\brief Same process as wc_AesXtsEncrypt but uses a word64 type as the tweak
value instead of a byte array. This just converts the word64 to a
byte array and calls wc_AesXtsEncrypt.
\return 0 Success
\param aes AES keys to use for block encrypt/decrypt
\param out output buffer to hold cipher text
\param in input plain text buffer to encrypt
\param sz size of both out and in buffers
\param sector value to use for tweak
_Example_
\code
XtsAes aes;
unsigned char plain[SIZE];
unsigned char cipher[SIZE];
word64 s = VALUE;
//set up keys with AES_ENCRYPTION as dir
if(wc_AesXtsEncryptSector(&aes, cipher, plain, SIZE, s) != 0)
{
// Handle error
}
wc_AesXtsFree(&aes);
\endcode
\sa wc_AesXtsEncrypt
\sa wc_AesXtsDecrypt
\sa wc_AesXtsSetKey
\sa wc_AesXtsFree
*/
WOLFSSL_API int wc_AesXtsEncryptSector(XtsAes* aes, byte* out,
const byte* in, word32 sz, word64 sector);
/*!
\ingroup AES
\brief Same process as wc_AesXtsDecrypt but uses a word64 type as the tweak
value instead of a byte array. This just converts the word64 to a
byte array.
\return 0 Success
\param aes AES keys to use for block encrypt/decrypt
\param out output buffer to hold plain text
\param in input cipher text buffer to decrypt
\param sz size of both out and in buffers
\param sector value to use for tweak
_Example_
\code
XtsAes aes;
unsigned char plain[SIZE];
unsigned char cipher[SIZE];
word64 s = VALUE;
//set up aes key with AES_DECRYPTION as dir and tweak with AES_ENCRYPTION
if(wc_AesXtsDecryptSector(&aes, plain, cipher, SIZE, s) != 0)
{
// Handle error
}
wc_AesXtsFree(&aes);
\endcode
\sa wc_AesXtsEncrypt
\sa wc_AesXtsDecrypt
\sa wc_AesXtsSetKey
\sa wc_AesXtsFree
*/
WOLFSSL_API int wc_AesXtsDecryptSector(XtsAes* aes, byte* out,
const byte* in, word32 sz, word64 sector);
/*!
\ingroup AES
\brief AES with XTS mode. (XTS) XEX encryption with Tweak and cipher text
Stealing.
\return 0 Success
\param aes AES keys to use for block encrypt/decrypt
\param out output buffer to hold cipher text
\param in input plain text buffer to encrypt
\param sz size of both out and in buffers
\param i value to use for tweak
\param iSz size of i buffer, should always be AES_BLOCK_SIZE but having
this input adds a sanity check on how the user calls the
function.
_Example_
\code
XtsAes aes;
unsigned char plain[SIZE];
unsigned char cipher[SIZE];
unsigned char i[AES_BLOCK_SIZE];
//set up key with AES_ENCRYPTION as dir
if(wc_AesXtsEncrypt(&aes, cipher, plain, SIZE, i, sizeof(i)) != 0)
{
// Handle error
}
wc_AesXtsFree(&aes);
\endcode
\sa wc_AesXtsDecrypt
\sa wc_AesXtsSetKey
\sa wc_AesXtsFree
*/
WOLFSSL_API int wc_AesXtsEncrypt(XtsAes* aes, byte* out,
const byte* in, word32 sz, const byte* i, word32 iSz);
/*!
\ingroup AES
\brief Same process as encryption but Aes key is AES_DECRYPTION type.
\return 0 Success
\param aes AES keys to use for block encrypt/decrypt
\param out output buffer to hold plain text
\param in input cipher text buffer to decrypt
\param sz size of both out and in buffers
\param i value to use for tweak
\param iSz size of i buffer, should always be AES_BLOCK_SIZE but having
this input adds a sanity check on how the user calls the
function.
_Example_
\code
XtsAes aes;
unsigned char plain[SIZE];
unsigned char cipher[SIZE];
unsigned char i[AES_BLOCK_SIZE];
//set up key with AES_DECRYPTION as dir and tweak with AES_ENCRYPTION
if(wc_AesXtsDecrypt(&aes, plain, cipher, SIZE, i, sizeof(i)) != 0)
{
// Handle error
}
wc_AesXtsFree(&aes);
\endcode
\sa wc_AesXtsEncrypt
\sa wc_AesXtsSetKey
\sa wc_AesXtsFree
*/
WOLFSSL_API int wc_AesXtsDecrypt(XtsAes* aes, byte* out,
const byte* in, word32 sz, const byte* i, word32 iSz);
/*!
\ingroup AES
\brief This is to free up any resources used by the XtsAes structure
\return 0 Success
\param aes AES keys to free
_Example_
\code
XtsAes aes;
if(wc_AesXtsSetKey(&aes, key, sizeof(key), AES_ENCRYPTION, NULL, 0) != 0)
{
// Handle error
}
wc_AesXtsFree(&aes);
\endcode
\sa wc_AesXtsEncrypt
\sa wc_AesXtsDecrypt
\sa wc_AesXtsSetKey
*/
WOLFSSL_API int wc_AesXtsFree(XtsAes* aes);
/*!
\ingroup AES
\brief Initialize Aes structure. Sets heap hint to be used and ID for use
with async hardware
\return 0 Success
\param aes aes structure in to initialize
\param heap heap hint to use for malloc / free if needed
\param devId ID to use with async hardware
_Example_
\code
Aes enc;
void* hint = NULL;
int devId = INVALID_DEVID; //if not using async INVALID_DEVID is default
//heap hint could be set here if used
wc_AesInit(&aes, hint, devId);
\endcode
\sa wc_AesSetKey
\sa wc_AesSetIV
*/
WOLFSSL_API int wc_AesInit(Aes* aes, void* heap, int devId);

View File

@@ -0,0 +1,58 @@
/*!
\ingroup ARC4
\brief This function encrypts an input message from the buffer in, placing
the ciphertext in the output buffer out, or decrypts a ciphertext from the
buffer in, placing the plaintext in the output buffer out, using ARC4
encryption. This function is used for both encryption and decryption.
Before this method may be called, one must first initialize the ARC4
structure using wc_Arc4SetKey.
\return none
\param arc4 pointer to the ARC4 structure used to process the message
\param out pointer to the output buffer in which to store the
processed message
\param in pointer to the input buffer containing the message to process
\param length length of the message to process
_Example_
\code
Arc4 enc;
byte key[] = { key to use for encryption };
wc_Arc4SetKey(&enc, key, sizeof(key));
byte plain[] = { plain text to encode };
byte cipher[sizeof(plain)];
byte decrypted[sizeof(plain)];
// encrypt the plain into cipher
wc_Arc4Process(&enc, cipher, plain, sizeof(plain));
// decrypt the cipher
wc_Arc4Process(&enc, decrypted, cipher, sizeof(cipher));
\endcode
\sa wc_Arc4SetKey
*/
WOLFSSL_API int wc_Arc4Process(Arc4*, byte*, const byte*, word32);
/*!
\ingroup ARC4
\brief This function sets the key for a ARC4 object, initializing it for
use as a cipher. It should be called before using it for encryption
with wc_Arc4Process.
\return none
\param arc4 pointer to an arc4 structure to be used for encryption
\param key key with which to initialize the arc4 structure
\param length length of the key used to initialize the arc4 structure
_Example_
\code
Arc4 enc;
byte key[] = { initialize with key to use for encryption };
wc_Arc4SetKey(&enc, key, sizeof(key));
\endcode
\sa wc_Arc4Process
*/
WOLFSSL_API int wc_Arc4SetKey(Arc4*, const byte*, word32);

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,93 @@
/*!
\ingroup BLAKE2
\brief This function initializes a Blake2b structure for use with the
Blake2 hash function.
\return 0 Returned upon successfully initializing the Blake2b structure and
setting the digest size.
\param b2b pointer to the Blake2b structure to initialize
\param digestSz length of the blake 2 digest to implement
_Example_
\code
Blake2b b2b;
// initialize Blake2b structure with 64 byte digest
wc_InitBlake2b(&b2b, 64);
\endcode
\sa wc_Blake2bUpdate
*/
WOLFSSL_API int wc_InitBlake2b(Blake2b*, word32);
/*!
\ingroup BLAKE2
\brief This function updates the Blake2b hash with the given input data.
This function should be called after wc_InitBlake2b, and repeated until
one is ready for the final hash: wc_Blake2bFinal.
\return 0 Returned upon successfully update the Blake2b structure with
the given data
\return -1 Returned if there is a failure while compressing the input data
\param b2b pointer to the Blake2b structure to update
\param data pointer to a buffer containing the data to append
\param sz length of the input data to append
_Example_
\code
int ret;
Blake2b b2b;
// initialize Blake2b structure with 64 byte digest
wc_InitBlake2b(&b2b, 64);
byte plain[] = { // initialize input };
ret = wc_Blake2bUpdate(&b2b, plain, sizeof(plain));
if( ret != 0) {
// error updating blake2b
}
\endcode
\sa wc_InitBlake2b
\sa wc_Blake2bFinal
*/
WOLFSSL_API int wc_Blake2bUpdate(Blake2b*, const byte*, word32);
/*!
\ingroup BLAKE2
\brief This function computes the Blake2b hash of the previously supplied
input data. The output hash will be of length requestSz, or, if
requestSz==0, the digestSz of the b2b structure. This function should be
called after wc_InitBlake2b and wc_Blake2bUpdate has been processed for
each piece of input data desired.
\return 0 Returned upon successfully computing the Blake2b hash
\return -1 Returned if there is a failure while parsing the Blake2b hash
\param b2b pointer to the Blake2b structure to update
\param final pointer to a buffer in which to store the blake2b hash.
Should be of length requestSz
\param requestSz length of the digest to compute. When this is zero,
b2b->digestSz will be used instead
_Example_
\code
int ret;
Blake2b b2b;
byte hash[64];
// initialize Blake2b structure with 64 byte digest
wc_InitBlake2b(&b2b, 64);
... // call wc_Blake2bUpdate to add data to hash
ret = wc_Blake2bFinal(&b2b, hash, 64);
if( ret != 0) {
// error generating blake2b hash
}
\endcode
\sa wc_InitBlake2b
\sa wc_Blake2bUpdate
*/
WOLFSSL_API int wc_Blake2bFinal(Blake2b*, byte*, word32);

View File

@@ -0,0 +1,28 @@
/*!
\ingroup openSSL
\brief This function performs the following math “r = (a^p) % m”.
\return SSL_SUCCESS On successfully performing math operation.
\return SSL_FAILURE If an error case was encountered.
\param r structure to hold result.
\param a value to be raised by a power.
\param p power to raise a by.
\param m modulus to use.
\param ctx currently not used with wolfSSL can be NULL.
_Example_
\code
WOLFSSL_BIGNUM r,a,p,m;
int ret;
// set big number values
ret = wolfSSL_BN_mod_exp(r, a, p, m, NULL);
// check ret value
\endcode
\sa wolfSSL_BN_new
\sa wolfSSL_BN_free
*/
WOLFSSL_API int wolfSSL_BN_mod_exp(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *a,
const WOLFSSL_BIGNUM *p, const WOLFSSL_BIGNUM *m, WOLFSSL_BN_CTX *ctx);

View File

@@ -0,0 +1,179 @@
/*!
\ingroup Camellia
\brief This function sets the key and initialization vector for a
camellia object, initializing it for use as a cipher.
\return 0 Returned upon successfully setting the key and initialization
vector
\return BAD_FUNC_ARG returned if there is an error processing one of
the input arguments
\return MEMORY_E returned if there is an error allocating memory with
XMALLOC
\param cam pointer to the camellia structure on which to set the key and iv
\param key pointer to the buffer containing the 16, 24, or 32 byte key
to use for encryption and decryption
\param len length of the key passed in
\param iv pointer to the buffer containing the 16 byte initialization
vector for use with this camellia structure
_Example_
\code
Camellia cam;
byte key[32];
// initialize key
byte iv[16];
// initialize iv
if( wc_CamelliaSetKey(&cam, key, sizeof(key), iv) != 0) {
// error initializing camellia structure
}
\endcode
\sa wc_CamelliaEncryptDirect
\sa wc_CamelliaDecryptDirect
\sa wc_CamelliaCbcEncrypt
\sa wc_CamelliaCbcDecrypt
*/
WOLFSSL_API int wc_CamelliaSetKey(Camellia* cam,
const byte* key, word32 len, const byte* iv);
/*!
\ingroup Camellia
\brief This function sets the initialization vector for a camellia object.
\return 0 Returned upon successfully setting the key and initialization
vector
\return BAD_FUNC_ARG returned if there is an error processing one of the
input arguments
\param cam pointer to the camellia structure on which to set the iv
\param iv pointer to the buffer containing the 16 byte initialization
vector for use with this camellia structure
_Example_
\code
Camellia cam;
byte iv[16];
// initialize iv
if( wc_CamelliaSetIV(&cam, iv) != 0) {
// error initializing camellia structure
}
\endcode
\sa wc_CamelliaSetKey
*/
WOLFSSL_API int wc_CamelliaSetIV(Camellia* cam, const byte* iv);
/*!
\ingroup Camellia
\brief This function does a one-block encrypt using the provided camellia
object. It parses the first 16 byte block from the buffer in and stores
the encrypted result in the buffer out. Before using this function, one
should initialize the camellia object using wc_CamelliaSetKey.
\return none No returns.
\param cam pointer to the camellia structure to use for encryption
\param out pointer to the buffer in which to store the encrypted block
\param in pointer to the buffer containing the plaintext block to encrypt
_Example_
\code
Camellia cam;
// initialize cam structure with key and iv
byte plain[] = { // initialize with message to encrypt };
byte cipher[16];
wc_CamelliaEncryptDirect(&ca, cipher, plain);
\endcode
\sa wc_CamelliaDecryptDirect
*/
WOLFSSL_API int wc_CamelliaEncryptDirect(Camellia* cam, byte* out,
const byte* in);
/*!
\ingroup Camellia
\brief This function does a one-block decrypt using the provided camellia
object. It parses the first 16 byte block from the buffer in, decrypts it,
and stores the result in the buffer out. Before using this function, one
should initialize the camellia object using wc_CamelliaSetKey.
\return none No returns.
\param cam pointer to the camellia structure to use for encryption
\param out pointer to the buffer in which to store the decrypted
plaintext block
\param in pointer to the buffer containing the ciphertext block to decrypt
_Example_
\code
Camellia cam;
// initialize cam structure with key and iv
byte cipher[] = { // initialize with encrypted message to decrypt };
byte decrypted[16];
wc_CamelliaDecryptDirect(&cam, decrypted, cipher);
\endcode
\sa wc_CamelliaEncryptDirect
*/
WOLFSSL_API int wc_CamelliaDecryptDirect(Camellia* cam, byte* out,
const byte* in);
/*!
\ingroup Camellia
\brief This function encrypts the plaintext from the buffer in and
stores the output in the buffer out. It performs this encryption
using Camellia with Cipher Block Chaining (CBC).
\return none No returns.
\param cam pointer to the camellia structure to use for encryption
\param out pointer to the buffer in which to store the encrypted ciphertext
\param in pointer to the buffer containing the plaintext to encrypt
\param sz the size of the message to encrypt
_Example_
\code
Camellia cam;
// initialize cam structure with key and iv
byte plain[] = { // initialize with encrypted message to decrypt };
byte cipher[sizeof(plain)];
wc_CamelliaCbcEncrypt(&cam, cipher, plain, sizeof(plain));
\endcode
\sa wc_CamelliaCbcDecrypt
*/
WOLFSSL_API int wc_CamelliaCbcEncrypt(Camellia* cam,
byte* out, const byte* in, word32 sz);
/*!
\ingroup Camellia
\brief This function decrypts the ciphertext from the buffer in and
stores the output in the buffer out. It performs this decryption using
Camellia with Cipher Block Chaining (CBC).
\return none No returns.
\param cam pointer to the camellia structure to use for encryption
\param out pointer to the buffer in which to store the decrypted message
\param in pointer to the buffer containing the encrypted ciphertext
\param sz the size of the message to encrypt
_Example_
\code
Camellia cam;
// initialize cam structure with key and iv
byte cipher[] = { // initialize with encrypted message to decrypt };
byte decrypted[sizeof(cipher)];
wc_CamelliaCbcDecrypt(&cam, decrypted, cipher, sizeof(cipher));
\endcode
\sa wc_CamelliaCbcEncrypt
*/
WOLFSSL_API int wc_CamelliaCbcDecrypt(Camellia* cam,
byte* out, const byte* in, word32 sz);

View File

@@ -0,0 +1,97 @@
/*!
\ingroup ChaCha
\brief This function sets the initialization vector (nonce) for a ChaCha
object, initializing it for use as a cipher. It should be called after the
key has been set, using wc_Chacha_SetKey. A difference nonce should be
used for each round of encryption.
\return 0 Returned upon successfully setting the initialization vector
\return BAD_FUNC_ARG returned if there is an error processing the ctx
input argument
\param ctx pointer to the ChaCha structure on which to set the iv
\param inIv pointer to a buffer containing the 12 byte initialization
vector with which to initialize the ChaCha structure
\param counter the value at which the block counter should start--usually
zero.
_Example_
\code
ChaCha enc;
// initialize enc with wc_Chacha_SetKey
byte iv[12];
// initialize iv
if( wc_Chacha_SetIV(&enc, iv, 0) != 0) {
// error initializing ChaCha structure
}
\endcode
\sa wc_Chacha_SetKey
\sa wc_Chacha_Process
*/
WOLFSSL_API int wc_Chacha_SetIV(ChaCha* ctx, const byte* inIv, word32 counter);
/*!
\ingroup ChaCha
\brief This function processes the text from the buffer input, encrypts
or decrypts it, and stores the result in the buffer output.
\return 0 Returned upon successfully encrypting or decrypting the input
\return BAD_FUNC_ARG returned if there is an error processing the ctx
input argument
\param ctx pointer to the ChaCha structure on which to set the iv
\param output pointer to a buffer in which to store the output ciphertext
or decrypted plaintext
\param input pointer to the buffer containing the input plaintext to
encrypt or the input ciphertext to decrypt
\param msglen length of the message to encrypt or the ciphertext to decrypt
_Example_
\code
ChaCha enc;
// initialize enc with wc_Chacha_SetKey and wc_Chacha_SetIV
byte plain[] = { // initialize plaintext };
byte cipher[sizeof(plain)];
if( wc_Chacha_Process(&enc, cipher, plain, sizeof(plain)) != 0) {
// error processing ChaCha cipher
}
\endcode
\sa wc_Chacha_SetKey
\sa wc_Chacha_Process
*/
WOLFSSL_API int wc_Chacha_Process(ChaCha* ctx, byte* cipher, const byte* plain,
word32 msglen);
/*!
\ingroup ChaCha
\brief This function sets the key for a ChaCha object, initializing it for
use as a cipher. It should be called before setting the nonce with
wc_Chacha_SetIV, and before using it for encryption with wc_Chacha_Process.
\return 0 Returned upon successfully setting the key
\return BAD_FUNC_ARG returned if there is an error processing the ctx
input argument or if the key is not 16 or 32 bytes long
\param ctx pointer to the ChaCha structure in which to set the key
\param key pointer to a buffer containing the 16 or 32 byte key with
which to initialize the ChaCha structure
\param keySz the length of the key passed in
_Example_
\code
ChaCha enc;
byte key[] = { // initialize key };
if( wc_Chacha_SetKey(&enc, key, sizeof(key)) != 0) {
// error initializing ChaCha structure
}
\endcode
\sa wc_Chacha_SetIV
\sa wc_Chacha_Process
*/
WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz);

View File

@@ -0,0 +1,119 @@
/*!
\ingroup ChaCha20Poly1305
\brief This function encrypts an input message, inPlaintext, using the
ChaCha20 stream cipher, into the output buffer, outCiphertext. It
also performs Poly-1305 authentication (on the cipher text), and
stores the generated authentication tag in the output buffer, outAuthTag.
\return 0 Returned upon successfully encrypting the message
\return BAD_FUNC_ARG returned if there is an error during the encryption
process
\param inKey pointer to a buffer containing the 32 byte key to use
for encryption
\param inIv pointer to a buffer containing the 12 byte iv to use for
encryption
\param inAAD pointer to the buffer containing arbitrary length additional
authenticated data (AAD)
\param inAADLen length of the input AAD
\param inPlaintext pointer to the buffer containing the plaintext to
encrypt
\param inPlaintextLen the length of the plain text to encrypt
\param outCiphertext pointer to the buffer in which to store the ciphertext
\param outAuthTag pointer to a 16 byte wide buffer in which to store the
authentication tag
_Example_
\code
byte key[] = { // initialize 32 byte key };
byte iv[] = { // initialize 12 byte key };
byte inAAD[] = { // initialize AAD };
byte plain[] = { // initialize message to encrypt };
byte cipher[sizeof(plain)];
byte authTag[16];
int ret = wc_ChaCha20Poly1305_Encrypt(key, iv, inAAD, sizeof(inAAD),
plain, sizeof(plain), cipher, authTag);
if(ret != 0) {
// error running encrypt
}
\endcode
\sa wc_ChaCha20Poly1305_Decrypt
\sa wc_ChaCha_*
\sa wc_Poly1305*
*/
WOLFSSL_API
int wc_ChaCha20Poly1305_Encrypt(
const byte inKey[CHACHA20_POLY1305_AEAD_KEYSIZE],
const byte inIV[CHACHA20_POLY1305_AEAD_IV_SIZE],
const byte* inAAD, const word32 inAADLen,
const byte* inPlaintext, const word32 inPlaintextLen,
byte* outCiphertext,
byte outAuthTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE]);
/*!
\ingroup ChaCha20Poly1305
\brief This function decrypts input ciphertext, inCiphertext, using the
ChaCha20 stream cipher, into the output buffer, outPlaintext. It also
performs Poly-1305 authentication, comparing the given inAuthTag to an
authentication generated with the inAAD (arbitrary length additional
authentication data). Note: If the generated authentication tag does
not match the supplied authentication tag, the text is not decrypted.
\return 0 Returned upon successfully decrypting the message
\return BAD_FUNC_ARG Returned if any of the function arguments do not
match what is expected
\return MAC_CMP_FAILED_E Returned if the generated authentication tag
does not match the supplied inAuthTag.
\param inKey pointer to a buffer containing the 32 byte key to use for
decryption
\param inIv pointer to a buffer containing the 12 byte iv to use for
decryption
\param inAAD pointer to the buffer containing arbitrary length additional
authenticated data (AAD)
\param inAADLen length of the input AAD
\param inCiphertext pointer to the buffer containing the ciphertext to
decrypt
\param outCiphertextLen the length of the ciphertext to decrypt
\param inAuthTag pointer to the buffer containing the 16 byte digest
for authentication
\param outPlaintext pointer to the buffer in which to store the plaintext
_Example_
\code
byte key[] = { // initialize 32 byte key };
byte iv[] = { // initialize 12 byte key };
byte inAAD[] = { // initialize AAD };
byte cipher[] = { // initialize with received ciphertext };
byte authTag[16] = { // initialize with received authentication tag };
byte plain[sizeof(cipher)];
int ret = wc_ChaCha20Poly1305_Decrypt(key, iv, inAAD, sizeof(inAAD),
cipher, sizeof(cipher), plain, authTag);
if(ret == MAC_CMP_FAILED_E) {
// error during authentication
} else if( ret != 0) {
// error with function arguments
}
\endcode
\sa wc_ChaCha20Poly1305_Encrypt
\sa wc_ChaCha_*
\sa wc_Poly1305*
*/
WOLFSSL_API
int wc_ChaCha20Poly1305_Decrypt(
const byte inKey[CHACHA20_POLY1305_AEAD_KEYSIZE],
const byte inIV[CHACHA20_POLY1305_AEAD_IV_SIZE],
const byte* inAAD, const word32 inAADLen,
const byte* inCiphertext, const word32 inCiphertextLen,
const byte inAuthTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE],
byte* outPlaintext);

View File

@@ -0,0 +1,228 @@
/*!
\ingroup Base_Encoding
\brief This function decodes the given Base64 encoded input, in, and
stores the result in the output buffer out. It also sets the size
written to the output buffer in the variable outLen.
\return 0 Returned upon successfully decoding the Base64 encoded input
\return BAD_FUNC_ARG Returned if the output buffer is too small to
store the decoded input
\return ASN_INPUT_E Returned if a character in the input buffer falls
outside of the Base64 range ([A-Za-z0-9+/=]) or if there is an invalid
line ending in the Base64 encoded input
\param in pointer to the input buffer to decode
\param inLen length of the input buffer to decode
\param out pointer to the output buffer in which to store the decoded
message
\param outLen pointer to the length of the output buffer. Updated with
the bytes written at the end of the function call
_Example_
\code
byte encoded[] = { // initialize text to decode };
byte decoded[sizeof(encoded)];
// requires at least (sizeof(encoded) * 3 + 3) / 4 room
int outLen = sizeof(decoded);
if( Base64_Decode(encoded,sizeof(encoded), decoded, &outLen) != 0 ) {
// error decoding input buffer
}
\endcode
\sa Base64_Encode
\sa Base16_Decode
*/
WOLFSSL_API int Base64_Decode(const byte* in, word32 inLen, byte* out,
word32* outLen);
/*!
\ingroup Base_Encoding
\brief This function encodes the given input, in, and stores the Base64
encoded result in the output buffer out. It writes the data with the
traditional \n line endings, instead of escaped %0A line endings. Upon
successfully completing, this function also sets outLen to the number
of bytes written to the output buffer.
\return 0 Returned upon successfully decoding the Base64 encoded input
\return BAD_FUNC_ARG Returned if the output buffer is too small to
store the encoded input
\return BUFFER_E Returned if the output buffer runs out of room
while encoding
\param in pointer to the input buffer to encode
\param inLen length of the input buffer to encode
\param out pointer to the output buffer in which to store the
encoded message
\param outLen pointer to the length of the output buffer in
which to store the encoded message
_Example_
\code
byte plain[] = { // initialize text to encode };
byte encoded[MAX_BUFFER_SIZE];
int outLen = sizeof(encoded);
if( Base64_Encode(plain, sizeof(plain), encoded, &outLen) != 0 ) {
// error encoding input buffer
}
\endcode
\sa Base64_EncodeEsc
\sa Base64_Decode
*/
WOLFSSL_API
int Base64_Encode(const byte* in, word32 inLen, byte* out,
word32* outLen);
/*!
\ingroup Base_Encoding
\brief This function encodes the given input, in, and stores the
Base64 encoded result in the output buffer out. It writes the data
with %0A escaped line endings instead of \n line endings.
Upon successfully completing, this function also sets outLen
to the number of bytes written to the output buffer.
\return 0 Returned upon successfully decoding the Base64 encoded input
\return BAD_FUNC_ARG Returned if the output buffer is too small
to store the encoded input
\return BUFFER_E Returned if the output buffer runs out of
room while encoding
\return ASN_INPUT_E Returned if there is an error processing
the decode on the input message
\param in pointer to the input buffer to encode
\param inLen length of the input buffer to encode
\param out pointer to the output buffer in which to store
the encoded message
\param outLen pointer to the length of the output buffer in
which to store the encoded message
_Example_
\code
byte plain[] = { // initialize text to encode };
byte encoded[MAX_BUFFER_SIZE];
int outLen = sizeof(encoded);
if( Base64_EncodeEsc(plain, sizeof(plain), encoded, &outLen) != 0 ) {
// error encoding input buffer
}
\endcode
\sa Base64_Encode
\sa Base64_Decode
*/
int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out,
word32* outLen);
/*!
\ingroup Base_Encoding
\brief This function encodes the given input, in, and stores the
Base64 encoded result in the output buffer out. It writes the data
with no new lines. Upon successfully completing, this function
also sets outLen to the number of bytes written to the output buffer
\return 0 Returned upon successfully decoding the Base64 encoded input
\return BAD_FUNC_ARG Returned if the output buffer is too small
to store the encoded input
\return BUFFER_E Returned if the output buffer runs out of room
while encoding
\return ASN_INPUT_E Returned if there is an error processing the
decode on the input message
\param in pointer to the input buffer to encode
\param inLen length of the input buffer to encode
\param out pointer to the output buffer in which to store the
encoded message
\param outLen pointer to the length of the output buffer in which to
store the encoded message
_Example_
\code
byte plain[] = { // initialize text to encode };
byte encoded[MAX_BUFFER_SIZE];
int outLen = sizeof(encoded);
if( Base64_Encode_NoNl(plain, sizeof(plain), encoded, &outLen) != 0 ) {
// error encoding input buffer
}
\endcode
\sa Base64_Encode
\sa Base64_Decode
*/
WOLFSSL_API
int Base64_Encode_NoNl(const byte* in, word32 inLen, byte* out,
word32* outLen);
/*!
\ingroup Base_Encoding
\brief This function decodes the given Base16 encoded input, in, and
stores the result in the output buffer out. It also sets the size written
to the output buffer in the variable outLen.
\return 0 Returned upon successfully decoding the Base16 encoded input
\return BAD_FUNC_ARG Returned if the output buffer is too small to store
the decoded input or if the input length is not a multiple of two
\return ASN_INPUT_E Returned if a character in the input buffer falls
outside of the Base16 range ([0-9A-F])
\param in pointer to the input buffer to decode
\param inLen length of the input buffer to decode
\param out pointer to the output buffer in which to store the decoded
message
\param outLen pointer to the length of the output buffer. Updated with the
bytes written at the end of the function call
_Example_
\code
byte encoded[] = { // initialize text to decode };
byte decoded[sizeof(encoded)];
int outLen = sizeof(decoded);
if( Base16_Decode(encoded,sizeof(encoded), decoded, &outLen) != 0 ) {
// error decoding input buffer
}
\endcode
\sa Base64_Encode
\sa Base64_Decode
\sa Base16_Encode
*/
WOLFSSL_API
int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
/*!
\ingroup Base_Encoding
\brief Encode input to base16 output.
\return 0 Success
\return BAD_FUNC_ARG Returns if in, out, or outLen is null or if outLen is
less than 2 times inLen plus 1.
\param in Pointer to input buffer to be encoded.
\param inLen Length of input buffer.
\param out Pointer to output buffer.
\param outLen Length of output buffer. Is set to len of encoded output.
_Example_
\code
byte in[] = { // Contents of something to be encoded };
byte out[NECESSARY_OUTPUT_SIZE];
word32 outSz = sizeof(out);
if(Base16_Encode(in, sizeof(in), out, &outSz) != 0)
{
// Handle encode error
}
\endcode
\sa Base64_Encode
\sa Base64_Decode
\sa Base16_Decode
*/
WOLFSSL_API
int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen);

View File

@@ -0,0 +1,71 @@
/*!
\ingroup Compression
\brief This function compresses the given input data using Huffman coding
and stores the output in out. Note that the output buffer should still be
larger than the input buffer because there exists a certain input for
which there will be no compression possible, which will still require a
lookup table. It is recommended that one allocate srcSz + 0.1% + 12 for
the output buffer.
\return On successfully compressing the input data, returns the number
of bytes stored in the output buffer
\return COMPRESS_INIT_E Returned if there is an error initializing the
stream for compression
\return COMPRESS_E Returned if an error occurs during compression
\param out pointer to the output buffer in which to store the compressed
data
\param outSz size available in the output buffer for storage
\param in pointer to the buffer containing the message to compress
\param inSz size of the input message to compress
\param flags flags to control how compression operates. Use 0 for normal
decompression
_Example_
\code
byte message[] = { // initialize text to compress };
byte compressed[(sizeof(message) + sizeof(message) * .001 + 12 )];
// Recommends at least srcSz + .1% + 12
if( wc_Compress(compressed, sizeof(compressed), message, sizeof(message),
0) != 0){
// error compressing data
}
\endcode
\sa wc_DeCompress
*/
WOLFSSL_API int wc_Compress(byte*, word32, const byte*, word32, word32);
/*!
\ingroup Compression
\brief This function decompresses the given compressed data using Huffman
coding and stores the output in out.
\return Succes On successfully decompressing the input data, returns the
number of bytes stored in the output buffer
\return COMPRESS_INIT_E: Returned if there is an error initializing the
stream for compression
\return COMPRESS_E: Returned if an error occurs during compression
\param out pointer to the output buffer in which to store the decompressed
data
\param outSz size available in the output buffer for storage
\param in pointer to the buffer containing the message to decompress
\param inSz size of the input message to decompress
_Example_
\code
byte compressed[] = { // initialize compressed message };
byte decompressed[MAX_MESSAGE_SIZE];
if( wc_DeCompress(decompressed, sizeof(decompressed),
compressed, sizeof(compressed)) != 0 ) {
// error decompressing data
}
\endcode
\sa wc_Compress
*/
WOLFSSL_API int wc_DeCompress(byte*, word32, const byte*, word32);

View File

@@ -0,0 +1,678 @@
/*!
\ingroup Curve25519
\brief This function generates a curve25519 key using the given random
number generator, rng, of the size given (keysize), and stores it in
the given curve25519_key structure. It should be called after the key
structure has been initialized through wc_curve25519_init.
\return 0 Returned on successfully generating the key and and storing
it in the given curve25519_key structure
\return ECC_BAD_ARG_E Returned if rng or key evaluate to NULL, or
the input keysize does not correspond to the keysize for a
curve25519 key ( 32 bytes)
\return RNG_FAILURE_E Returned if the rng internal status is not
DRBG_OK or if there is in generating the next random block with rng
\param rng pointer to the RNG object used to generate the ecc key
\param keysize size of the key to generate. Must be 32 bytes for curve25519
\param key pointer to the curve25519_key structure in which to
store the generated key
_Example_
\code
curve25519_key key;
wc_curve25519_init(&key); // initialize key
WC_RNG rng;
wc_InitRng(&rng); // initialize random number generator
if( wc_curve25519_make_key(&rng, 32, &key) != 0) {
// making 25519 key
}
\endcode
\sa wc_curve25519_init
*/
WOLFSSL_API
int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key);
/*!
\ingroup Curve25519
\brief This function computes a shared secret key given a secret private
key and a received public key. It stores the generated secret key in the
buffer out and assigns the variable of the secret key to outlen. Only
supports big endian.
\return 0 Returned on successfully computing a shared secret key
\return BAD_FUNC_ARG Returned if any of the input parameters passed in
are NULL
\return ECC_BAD_ARG_E Returned if the first bit of the public key is
set, to avoid implementation fingerprinting
\param private_key pointer to the curve25519_key structure initialized
with the users private key
\param public_key pointer to the curve25519_key structure containing
the received public key
\param out pointer to a buffer in which to store the 32 byte computed
secret key
\param outlen pointer in which to store the length written to the
output buffer
_Example_
\code
byte sharedKey[32];
word32 keySz;
curve25519_key privKey, pubKey;
// initialize both keys
if ( wc_curve25519_shared_secret(&privKey, &pubKey, sharedKey,
&keySz) != 0 ) {
// error generating shared key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
\sa wc_curve25519_shared_secret_ex
*/
WOLFSSL_API
int wc_curve25519_shared_secret(curve25519_key* private_key,
curve25519_key* public_key,
byte* out, word32* outlen);
/*!
\ingroup Curve25519
\brief This function computes a shared secret key given a secret private
key and a received public key. It stores the generated secret key in the
buffer out and assigns the variable of the secret key to outlen. Supports
both big and little endian.
\return 0 Returned on successfully computing a shared secret key
\return BAD_FUNC_ARG Returned if any of the input parameters passed in
are NULL
\return ECC_BAD_ARG_E Returned if the first bit of the public key is set,
to avoid implementation fingerprinting
\param private_key pointer to the curve25519_key structure initialized
with the users private key
\param public_key pointer to the curve25519_key structure containing
the received public key
\param out pointer to a buffer in which to store the 32 byte computed
secret key
\param outlen pointer in which to store the length written to the output
buffer
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to set which
form to use.
_Example_
\code
byte sharedKey[32];
word32 keySz;
curve25519_key privKey, pubKey;
// initialize both keys
if ( wc_curve25519_shared_secret_ex(&privKey, &pubKey, sharedKey, &keySz,
EC25519_BIG_ENDIAN) != 0 ) {
// error generating shared key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
\sa wc_curve25519_shared_secret
*/
WOLFSSL_API
int wc_curve25519_shared_secret_ex(curve25519_key* private_key,
curve25519_key* public_key,
byte* out, word32* outlen, int endian);
/*!
\ingroup Curve25519
\brief This function initializes a curve25519 key. It should be called
before generating a key for the structure with wc_curve25519_init and
before using the key to encrypt data.
\return 0 Returned on successfully initializing the curve25519_key
structure
\param key pointer to the curve25519_key structure to initialize
_Example_
\code
curve25519_key key;
wc_curve25519_init(&key); // initialize key
// make key and proceed to encryption
\endcode
\sa wc_curve25519_make_key
*/
WOLFSSL_API
int wc_curve25519_init(curve25519_key* key);
/*!
\ingroup Curve25519
\brief This function frees a curve 25519 object.
\return none No returns.
\param key pointer to the key object to free
_Example_
\code
curve25519_key privKey;
// initialize key, use it to generate shared secret key
wc_curve25519_free(&privKey);
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
*/
WOLFSSL_API
void wc_curve25519_free(curve25519_key* key);
/*!
\ingroup Curve25519
\brief This function imports a curve25519 private key only. (Big endian).
\return 0 Success
\return BAD_FUNC_ARG Returns if key or priv is null.
\return ECC_BAD_ARG_E Returns if privSz is not equal to
wc_curve25519_size(key).
\param priv Private key buffer
\param privSz Size of private key buffer.
\param key The curve25519_key structure to store the private key.
_Example_
\code
byte priv[] = { Contents of private key };
curve25519_key key;
wc_curve25519_init(&key);
if(wc_curve25519_import_private(priv, sizeof(priv), &key) != 0)
{
// Some error was thrown
}
\endcode
\sa wc_curve25519_import_private_ex
\sa wc_curve25519_size
*/
WOLFSSL_API
int wc_curve25519_import_private(const byte* priv, word32 privSz,
curve25519_key* key);
/*!
\ingroup Curve25519
\brief curve25519 private key import only. (Big or Little endian).
\return 0 Success
\return Returns if key or priv is null.
\return ECC_BAD_ARG_E Returns if privSz is not equal to
wc_curve25519_size(key).
\param priv Buffer for private key.
\param privSz Size of private key buffer.
\param key The curve25519_key structure to store the private key.
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to
set which form to use.
_Example_
\code
byte priv[] = { // Contents of private key };
curve25519_key key;
wc_curve25519_init(&key);
if(wc_curve25519_import_private_ex(priv, sizeof(priv), &key,
EC25519_BIG_ENDIAN) != 0)
{
// Some error was thrown
}
\endcode
\sa wc_curve25519_import_private
\sa wc_curbe25519_size
*/
WOLFSSL_API
int wc_curve25519_import_private_ex(const byte* priv, word32 privSz,
curve25519_key* key, int endian);
/*!
\ingroup Curve25519
\brief This function imports a public-private key pair into a
curve25519_key structure. Big endian only.
\return 0 Returned on importing into the curve25519_key structure
\return ECC_BAD_ARG_E Returned if any of the input parameters
are NULL, or the input keys key size does not match the public
or private key sizes
\param priv pointer to a buffer containing the private key to import
\param privSz length of the private key to import
\param pub pointer to a buffer containing the public key to import
\param pubSz length of the public key to import
\param key pointer to the structure in which to store the imported keys
_Example_
\code
int ret;
byte priv[32];
byte pub[32];
// initialize with public and private keys
curve25519_key key;
wc_curve25519_init(&key);
// initialize key
ret = wc_curve25519_import_private_raw(&priv, sizeof(priv), pub,
sizeof(pub),&key);
if (ret != 0) {
// error importing keys
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
\sa wc_curve25519_import_public
\sa wc_curve25519_export_private_raw
*/
WOLFSSL_API
int wc_curve25519_import_private_raw(const byte* priv, word32 privSz,
const byte* pub, word32 pubSz, curve25519_key* key);
/*!
\ingroup Curve25519
\brief This function imports a public-private key pair into a curve25519_key structure. Supports both big and little endian.
\return 0 Returned on importing into the curve25519_key structure
\return ECC_BAD_ARG_E Returned if any of the input parameters are NULL,
or the input keys key size does not match the public or private key sizes
\param priv pointer to a buffer containing the private key to import
\param privSz length of the private key to import
\param pub pointer to a buffer containing the public key to import
\param pubSz length of the public key to import
\param key pointer to the structure in which to store the imported keys
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to set
which form to use.
_Example_
\code
int ret;
byte priv[32];
byte pub[32];
// initialize with public and private keys
curve25519_key key;
wc_curve25519_init(&key);
// initialize key
ret = wc_curve25519_import_private_raw_ex(&priv, sizeof(priv), pub,
sizeof(pub),&key, EC25519_BIG_ENDIAN);
if (ret != 0) {
// error importing keys
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
\sa wc_curve25519_import_public
\sa wc_curve25519_export_private_rawm
\sa wc_curve25519_import_private_raw
*/
WOLFSSL_API
int wc_curve25519_import_private_raw_ex(const byte* priv, word32 privSz,
const byte* pub, word32 pubSz,
curve25519_key* key, int endian);
/*!
\ingroup Curve25519
\brief This function exports a private key from a curve25519_key structure
and stores it in the given out buffer. It also sets outLen to be the size
of the exported key. Big Endian only.
\return 0 Returned on successfully exporting the private key from the
curve25519_key structure
\return BAD_FUNC_ARG Returned if any input parameters are NULL.
\return ECC_BAD_ARG_E Returned if wc_curve25519_size() is not equal to key.
\param key pointer to the structure from which to export the key
\param out pointer to the buffer in which to store the exported key
\param outLen will store the bytes written to the output buffer
_Example_
\code
int ret;
byte priv[32];
int privSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_private_raw(&key, priv, &privSz);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
\sa wc_curve25519_import_private_raw
\sa wc_curve25519_export_private_raw_ex
*/
WOLFSSL_API
int wc_curve25519_export_private_raw(curve25519_key* key, byte* out,
word32* outLen);
/*!
\ingroup Curve25519
\brief This function exports a private key from a curve25519_key structure
and stores it in the given out buffer. It also sets outLen to be the size
of the exported key. Can specify whether it's big or little endian.
\return 0 Returned on successfully exporting the private key from the
curve25519_key structure
\return BAD_FUNC_ARG Returned if any input parameters are NULL.
\return ECC_BAD_ARG_E Returned if wc_curve25519_size() is not equal to key.
\param key pointer to the structure from which to export the key
\param out pointer to the buffer in which to store the exported key
\param outLen will store the bytes written to the output buffer
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to set which
form to use.
_Example_
\code
int ret;
byte priv[32];
int privSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_private_raw_ex(&key, priv, &privSz,
EC25519_BIG_ENDIAN);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
\sa wc_curve25519_import_private_raw
\sa wc_curve25519_export_private_raw
\sa wc_curve25519_size
*/
WOLFSSL_API
int wc_curve25519_export_private_raw_ex(curve25519_key* key, byte* out,
word32* outLen, int endian);
/*!
\ingroup Curve25519
\brief This function imports a public key from the given in buffer and
stores it in the curve25519_key structure.
\return 0 Returned on successfully importing the public key into the
curve25519_key structure
\return ECC_BAD_ARG_E Returned if any of the input parameters are NULL,
or if the inLen
parameter does not match the key size of the key structure.
\return BAD_FUNC_ARG Returned if any of the input parameters are NULL.
\param in pointer to the buffer containing the public key to import
\param inLen length of the public key to import
\param key pointer to the curve25519_key structure in which to store
the key
_Example_
\code
int ret;
byte pub[32];
// initialize pub with public key
curve25519_key key;
// initialize key
ret = wc_curve25519_import_public(pub,sizeof(pub), &key);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_export_public
\sa wc_curve25519_import_private_raw
\sa wc_curve25519_public_ex
*/
WOLFSSL_API
int wc_curve25519_import_public(const byte* in, word32 inLen,
curve25519_key* key);
/*!
\ingroup Curve25519
\brief This function imports a public key from the given in buffer and
stores it in the curve25519_key structure.
\brief 0 Returned on successfully importing the public key into the
curve25519_key structure
\brief ECC_BAD_ARG_E Returned if the inLen parameter does not match the
key size of the key structure
\brief BAD_FUNC_ARG Returned if any of the input parameters are NULL.
\param in pointer to the buffer containing the public key to import
\param inLen length of the public key to import
\param key pointer to the curve25519_key structure in which to store
the key
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to set which
form to use.
_Example_
\code
int ret;
byte pub[32];
// initialize pub with public key
curve25519_key key;
// initialize key
ret = wc_curve25519_import_public_ex(pub,sizeof(pub), &key,
EC25519_BIG_ENDIAN);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_export_public
\sa wc_curve25519_import_private_raw
\sa wc_curve25519_import_public
\sa wc_25519_size
*/
WOLFSSL_API
int wc_curve25519_import_public_ex(const byte* in, word32 inLen,
curve25519_key* key, int endian);
/*!
\ingroup Curve25519
\brief This function exports a public key from the given key structure and
stores the result in the out buffer. Big endian only.
\return 0 Returned on successfully exporting the public key from the
curve25519_key structure
\return ECC_BAD_ARG_E Returned if any of the input parameters are NULL
\param key pointer to the curve25519_key structure in from which to
export the key
\param out pointer to the buffer in which to store the public key
\param outLen will store the bytes written to the output buffer
_Example_
\code
int ret;
byte pub[32];
int pubSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_public(&key,pub, &pubSz);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_export_private_raw
\sa wc_curve25519_import_public
*/
WOLFSSL_API
int wc_curve25519_export_public(curve25519_key* key, byte* out, word32* outLen);
/*!
\ingroup Curve25519
\brief This function exports a public key from the given key structure and
stores the result in the out buffer. Supports both big and little endian.
\return 0 Returned on successfully exporting the public key from the
curve25519_key structure
\return ECC_BAD_ARG_E Returned if any of the input parameters are NULL
\param key pointer to the curve25519_key structure in from which to
export the key
\param out pointer to the buffer in which to store the public key
\param outLen will store the bytes written to the output buffer
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to set which
form to use.
_Example_
\code
int ret;
byte pub[32];
int pubSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_public_ex(&key,pub, &pubSz, EC25519_BIG_ENDIAN);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_export_private_raw
\sa wc_curve25519_import_public
*/
WOLFSSL_API
int wc_curve25519_export_public_ex(curve25519_key* key, byte* out,
word32* outLen, int endian);
/*!
\ingroup Curve25519
\brief Export curve25519 key pair. Big endian only.
\return 0 Success
\return BAD_FUNC_ARG Returned if any input parameters are NULL.
\return ECC_BAD_ARG_E Returned if wc_curve25519_size() is not equal to key.
\param key Description
\param priv Private key buffer.
\param privSz Size of private key buffer.
\param pub Public key buffer.
\param pubSz Size of public key buffer.
_Example_
\code
int ret;
byte pub[32];
byte priv[32];
int pubSz;
int privSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_key_raw(&key, priv, &privSz, pub, &pubSz);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_export_key_raw_ex
\sa wc_curve25519_export_private_raw
\sa wc_curve25519_export_public_raw
*/
WOLFSSL_API
int wc_curve25519_export_key_raw(curve25519_key* key,
byte* priv, word32 *privSz,
byte* pub, word32 *pubSz);
/*!
\ingroup Curve25519
\brief Export curve25519 key pair. Big or little endian.
\return 0 Success
\return BAD_FUNC_ARG Returned if any input parameters are NULL.
\return ECC_BAD_ARG_E Returned if wc_curve25519_size() is not equal to key.
\param key Description
\param priv Private key buffer.
\param privSz Size of private key buffer.
\param pub Public key buffer.
\param pubSz Size of public key buffer.
\param endian EC25519_BIG_ENDIAN or EC25519_LITTLE_ENDIAN to set which
form to use.
_Example_
\code
int ret;
byte pub[32];
byte priv[32];
int pubSz;
int privSz;
curve25519_key key;
// initialize and make key
ret = wc_curve25519_export_key_raw_ex(&key,priv, &privSz, pub, &pubSz,
EC25519_BIG_ENDIAN);
if (ret != 0) {
// error exporting key
}
\endcode
\sa wc_curve25519_export_key_raw
\sa wc_curve25519_export_private_raw_ex
\sa wc_curve25519_export_public_ex
*/
WOLFSSL_API
int wc_curve25519_export_key_raw_ex(curve25519_key* key,
byte* priv, word32 *privSz,
byte* pub, word32 *pubSz,
int endian);
/*!
\ingroup Curve25519
\brief This function returns the key size of the given key structure.
\return Success Given a valid, initialized curve25519_key structure,
returns the size of the key.
\return 0 Returned if key is NULL
\param key pointer to the curve25519_key structure in for which to
determine the key size
_Example_
\code
curve25519_key key;
// initialize and make key
int keySz;
keySz = wc_curve25519_size(&key);
\endcode
\sa wc_curve25519_init
\sa wc_curve25519_make_key
*/
WOLFSSL_API
int wc_curve25519_size(curve25519_key* key);

View File

@@ -0,0 +1,323 @@
/*!
\ingroup 3DES
\brief This function sets the key and initialization vector (iv) for the
Des structure given as argument. It also initializes and allocates space
for the buffers needed for encryption and decryption, if these have not
yet been initialized. Note: If no iv is provided (i.e. iv == NULL)
the initialization vector defaults to an iv of 0.
\return 0 On successfully setting the key and initialization vector for
the Des structure
\param des pointer to the Des structure to initialize
\param key pointer to the buffer containing the 8 byte key with which to
initialize the Des structure
\param iv pointer to the buffer containing the 8 byte iv with which to
initialize the Des structure. If this is not provided, the iv defaults to 0
\param dir direction of encryption. Valid options are: DES_ENCRYPTION,
and DES_DECRYPTION
_Example_
\code
Des enc; // Des structure used for encryption
int ret;
byte key[] = { // initialize with 8 byte key };
byte iv[] = { // initialize with 8 byte iv };
ret = wc_Des_SetKey(&des, key, iv, DES_ENCRYPTION);
if (ret != 0) {
// error initializing des structure
}
\endcode
\sa wc_Des_SetIV
\sa wc_Des3_SetKey
*/
WOLFSSL_API int wc_Des_SetKey(Des* des, const byte* key,
const byte* iv, int dir);
/*!
\ingroup 3DES
\brief This function sets the initialization vector (iv) for the Des
structure given as argument. When passed a NULL iv, it sets the
initialization vector to 0.
\return none No returns.
\param des pointer to the Des structure for which to set the iv
\param iv pointer to the buffer containing the 8 byte iv with which to
initialize the Des structure. If this is not provided, the iv defaults to 0
_Example_
\code
Des enc; // Des structure used for encryption
// initialize enc with wc_Des_SetKey
byte iv[] = { // initialize with 8 byte iv };
wc_Des_SetIV(&enc, iv);
}
\endcode
\sa wc_Des_SetKey
*/
WOLFSSL_API void wc_Des_SetIV(Des* des, const byte* iv);
/*!
\ingroup 3DES
\brief This function encrypts the input message, in, and stores the result
in the output buffer, out. It uses DES encryption with cipher block
chaining (CBC) mode.
\return 0 Returned upon successfully encrypting the given input message
\param des pointer to the Des structure to use for encryption
\param out pointer to the buffer in which to store the encrypted ciphertext
\param in pointer to the input buffer containing the message to encrypt
\param sz length of the message to encrypt
_Example_
\code
Des enc; // Des structure used for encryption
// initialize enc with wc_Des_SetKey, use mode DES_ENCRYPTION
byte plain[] = { // initialize with message };
byte cipher[sizeof(plain)];
if ( wc_Des_CbcEncrypt(&enc, cipher, plain, sizeof(plain)) != 0) {
// error encrypting message
}
\endcode
\sa wc_Des_SetKey
\sa wc_Des_CbcDecrypt
*/
WOLFSSL_API int wc_Des_CbcEncrypt(Des* des, byte* out,
const byte* in, word32 sz);
/*!
\ingroup 3DES
\brief This function decrypts the input ciphertext, in, and stores the
resulting plaintext in the output buffer, out. It uses DES encryption
with cipher block chaining (CBC) mode.
\return 0 Returned upon successfully decrypting the given ciphertext
\param des pointer to the Des structure to use for decryption
\param out pointer to the buffer in which to store the decrypted plaintext
\param in pointer to the input buffer containing the encrypted ciphertext
\param sz length of the ciphertext to decrypt
_Example_
\code
Des dec; // Des structure used for decryption
// initialize dec with wc_Des_SetKey, use mode DES_DECRYPTION
byte cipher[] = { // initialize with ciphertext };
byte decoded[sizeof(cipher)];
if ( wc_Des_CbcDecrypt(&dec, decoded, cipher, sizeof(cipher)) != 0) {
// error decrypting message
}
\endcode
\sa wc_Des_SetKey
\sa wc_Des_CbcEncrypt
*/
WOLFSSL_API int wc_Des_CbcDecrypt(Des* des, byte* out,
const byte* in, word32 sz);
/*!
\ingroup 3DES
\brief This function encrypts the input message, in, and stores the result
in the output buffer, out. It uses Des encryption with Electronic
Codebook (ECB) mode.
\return 0: Returned upon successfully encrypting the given plaintext.
\param des pointer to the Des structure to use for encryption
\param out pointer to the buffer in which to store the encrypted message
\param in pointer to the input buffer containing the plaintext to encrypt
\param sz length of the plaintext to encrypt
_Example_
\code
Des enc; // Des structure used for encryption
// initialize enc with wc_Des_SetKey, use mode DES_ENCRYPTION
byte plain[] = { // initialize with message to encrypt };
byte cipher[sizeof(plain)];
if ( wc_Des_EcbEncrypt(&enc,cipher, plain, sizeof(plain)) != 0) {
// error encrypting message
}
\endcode
\sa wc_Des_SetKe
*/
WOLFSSL_API int wc_Des_EcbEncrypt(Des* des, byte* out,
const byte* in, word32 sz);
/*!
\ingroup 3DES
\brief This function encrypts the input message, in, and stores the
result in the output buffer, out. It uses Des3 encryption with
Electronic Codebook (ECB) mode. Warning: In nearly all use cases ECB
mode is considered to be less secure. Please avoid using ECB APIs
directly whenever possible.
\return 0 Returned upon successfully encrypting the given plaintext
\param des3 pointer to the Des3 structure to use for encryption
\param out pointer to the buffer in which to store the encrypted message
\param in pointer to the input buffer containing the plaintext to encrypt
\param sz length of the plaintext to encrypt
_Example_
/code
Des3 enc; // Des3 structure used for encryption
// initialize enc with wc_Des3_SetKey, use mode DES_ENCRYPTION
byte plain[] = { // initialize with message to encrypt };
byte cipher[sizeof(plain)];
if ( wc_Des3_EcbEncrypt(&enc,cipher, plain, sizeof(plain)) != 0) {
// error encrypting message
}
/endcode
\sa wc_Des3_SetKey
*/
WOLFSSL_API int wc_Des3_EcbEncrypt(Des3* des, byte* out,
const byte* in, word32 sz);
/*!
\ingroup 3DES
\brief This function sets the key and initialization vector (iv) for
the Des3 structure given as argument. It also initializes and allocates
space for the buffers needed for encryption and decryption, if these
have not yet been initialized. Note: If no iv is provided (i.e. iv ==
NULL) the initialization vector defaults to an iv of 0.
\return 0 On successfully setting the key and initialization vector
for the Des structure
\param des3 pointer to the Des3 structure to initialize
\param key pointer to the buffer containing the 24 byte key with which
to initialize the Des3 structure
\param iv pointer to the buffer containing the 8 byte iv with which to
initialize the Des3 structure. If this is not provided, the iv defaults
to 0
\param dir direction of encryption. Valid options are: DES_ENCRYPTION,
and DES_DECRYPTION
_Example_
\code
Des3 enc; // Des3 structure used for encryption
int ret;
byte key[] = { // initialize with 24 byte key };
byte iv[] = { // initialize with 8 byte iv };
ret = wc_Des3_SetKey(&des, key, iv, DES_ENCRYPTION);
if (ret != 0) {
// error initializing des structure
}
\endcode
\sa wc_Des3_SetIV
\sa wc_Des3_CbcEncrypt
\sa wc_Des3_CbcDecrypt
*/
WOLFSSL_API int wc_Des3_SetKey(Des3* des, const byte* key,
const byte* iv,int dir);
/*!
\ingroup 3DES
\brief This function sets the initialization vector (iv) for the Des3
structure given as argument. When passed a NULL iv, it sets the
initialization vector to 0.
\return none No returns.
\param des pointer to the Des3 structure for which to set the iv
\param iv pointer to the buffer containing the 8 byte iv with which to
initialize the Des3 structure. If this is not provided, the iv
defaults to 0
_Example_
\code
Des3 enc; // Des3 structure used for encryption
// initialize enc with wc_Des3_SetKey
byte iv[] = { // initialize with 8 byte iv };
wc_Des3_SetIV(&enc, iv);
}
\endcode
\sa wc_Des3_SetKey
*/
WOLFSSL_API int wc_Des3_SetIV(Des3* des, const byte* iv);
/*!
\ingroup 3DES
\brief This function encrypts the input message, in, and stores the
result in the output buffer, out. It uses Triple Des (3DES) encryption
with cipher block chaining (CBC) mode.
\return 0 Returned upon successfully encrypting the given input message
\param des pointer to the Des3 structure to use for encryption
\param out pointer to the buffer in which to store the encrypted ciphertext
\param in pointer to the input buffer containing the message to encrypt
\param sz length of the message to encrypt
_Example_
\code
Des3 enc; // Des3 structure used for encryption
// initialize enc with wc_Des3_SetKey, use mode DES_ENCRYPTION
byte plain[] = { // initialize with message };
byte cipher[sizeof(plain)];
if ( wc_Des3_CbcEncrypt(&enc, cipher, plain, sizeof(plain)) != 0) {
// error encrypting message
}
\endcode
\sa wc_Des3_SetKey
\sa wc_Des3_CbcDecrypt
*/
WOLFSSL_API int wc_Des3_CbcEncrypt(Des3* des, byte* out,
const byte* in,word32 sz);
/*!
\ingroup 3DES
\brief This function decrypts the input ciphertext, in, and stores the
resulting plaintext in the output buffer, out. It uses Triple Des (3DES)
encryption with cipher block chaining (CBC) mode.
\return 0 Returned upon successfully decrypting the given ciphertext
\param des pointer to the Des3 structure to use for decryption
\param out pointer to the buffer in which to store the decrypted plaintext
\param in pointer to the input buffer containing the encrypted ciphertext
\param sz length of the ciphertext to decrypt
_Example_
\code
Des3 dec; // Des structure used for decryption
// initialize dec with wc_Des3_SetKey, use mode DES_DECRYPTION
byte cipher[] = { // initialize with ciphertext };
byte decoded[sizeof(cipher)];
if ( wc_Des3_CbcDecrypt(&dec, decoded, cipher, sizeof(cipher)) != 0) {
// error decrypting message
}
\endcode
\sa wc_Des3_SetKey
\sa wc_Des3_CbcEncrypt
*/
WOLFSSL_API int wc_Des3_CbcDecrypt(Des3* des, byte* out,
const byte* in,word32 sz);

View File

@@ -0,0 +1,267 @@
/*!
\ingroup Diffie-Hellman
\brief This function initializes a Diffie-Hellman key for use in
negotiating a secure secret key with the Diffie-Hellman exchange protocol.
\return none No returns.
\param key pointer to the DhKey structure to initialize for use with
secure key exchanges
_Example_
\code
DhKey key;
wc_InitDhKey(&key); // initialize DH key
\endcode
\sa wc_FreeDhKey
\sa wc_DhGenerateKeyPair
*/
WOLFSSL_API int wc_InitDhKey(DhKey* key);
/*!
\ingroup Diffie-Hellman
\brief This function frees a Diffie-Hellman key after it has been used to
negotiate a secure secret key with the Diffie-Hellman exchange protocol.
\return none No returns.
\param key pointer to the DhKey structure to free
_Example_
\code
DhKey key;
// initialize key, perform key exchange
wc_FreeDhKey(&key); // free DH key to avoid memory leaks
\endcode
\sa wc_InitDhKey
*/
WOLFSSL_API void wc_FreeDhKey(DhKey* key);
/*!
\ingroup Diffie-Hellman
\brief This function generates a public/private key pair based on the
Diffie-Hellman public parameters, storing the private key in priv and the
public key in pub. It takes an initialized Diffie-Hellman key and an
initialized rng structure.
\return BAD_FUNC_ARG Returned if there is an error parsing one of the
inputs to this function
\return RNG_FAILURE_E Returned if there is an error generating a random
number using rng
\return MP_INIT_E May be returned if there is an error in the math library
while generating the public key
\return MP_READ_E May be returned if there is an error in the math library
while generating the public key
\return MP_EXPTMOD_E May be returned if there is an error in the math
library while generating the public key
\return MP_TO_E May be returned if there is an error in the math library
while generating the public key
\param key pointer to the DhKey structure from which to generate
the key pair
\param rng pointer to an initialized random number generator (rng) with
which to generate the keys
\param priv pointer to a buffer in which to store the private key
\param privSz will store the size of the private key written to priv
\param pub pointer to a buffer in which to store the public key
\param pubSz will store the size of the private key written to pub
_Example_
\code
DhKey key;
int ret;
byte priv[256];
byte pub[256];
word32 privSz, pubSz;
wc_InitDhKey(&key); // initialize key
// Set DH parameters using wc_DhSetKey or wc_DhKeyDecode
WC_RNG rng;
wc_InitRng(&rng); // initialize rng
ret = wc_DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz);
\endcode
\sa wc_InitDhKey
\sa wc_DhSetKey
\sa wc_DhKeyDecode
*/
WOLFSSL_API int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, byte* priv,
word32* privSz, byte* pub, word32* pubSz);
/*!
\ingroup Diffie-Hellman
\brief This function generates an agreed upon secret key based on a local
private key and a received public key. If completed on both sides of an
exchange, this function generates an agreed upon secret key for symmetric
communication. On successfully generating a shared secret key, the size of
the secret key written will be stored in agreeSz.
\return 0 Returned on successfully generating an agreed upon secret key
\return MP_INIT_E May be returned if there is an error while generating
the shared secret key
\return MP_READ_E May be returned if there is an error while generating
the shared secret key
\return MP_EXPTMOD_E May be returned if there is an error while generating
the shared secret key
\return MP_TO_E May be returned if there is an error while generating the
shared secret key
\param key pointer to the DhKey structure to use to compute the shared key
\param agree pointer to the buffer in which to store the secret key
\param agreeSz will hold the size of the secret key after
successful generation
\param priv pointer to the buffer containing the local secret key
\param privSz size of the local secret key
\param otherPub pointer to a buffer containing the received public key
\param pubSz size of the received public key
_Example_
\code
DhKey key;
int ret;
byte priv[256];
byte agree[256];
word32 agreeSz;
// initialize key, set key prime and base
// wc_DhGenerateKeyPair -- store private key in priv
byte pub[] = { // initialized with the received public key };
ret = wc_DhAgree(&key, agree, &agreeSz, priv, sizeof(priv), pub,
sizeof(pub));
if ( ret != 0 ) {
// error generating shared key
}
\endcode
\sa wc_DhGenerateKeyPair
*/
WOLFSSL_API int wc_DhAgree(DhKey* key, byte* agree, word32* agreeSz,
const byte* priv, word32 privSz, const byte* otherPub,
word32 pubSz);
/*!
\ingroup Diffie-Hellman
\brief This function decodes a Diffie-Hellman key from the given input
buffer containing the key in DER format. It stores the result in the
DhKey structure.
\return 0 Returned on successfully decoding the input key
\return ASN_PARSE_E Returned if there is an error parsing the sequence
of the input
\return ASN_DH_KEY_E Returned if there is an error reading the private
key parameters from the parsed input
\param input pointer to the buffer containing the DER formatted
Diffie-Hellman key
\param inOutIdx pointer to an integer in which to store the index parsed
to while decoding the key
\param key pointer to the DhKey structure to initialize with the input key
\param inSz length of the input buffer. Gives the max length that may
be read
_Example_
\code
DhKey key;
word32 idx = 0;
byte keyBuff[1024];
// initialize with DER formatted key
wc_DhKeyInit(&key);
ret = wc_DhKeyDecode(keyBuff, &idx, &key, sizeof(keyBuff));
if ( ret != 0 ) {
// error decoding key
}
\endcode
\sa wc_DhSetKey
*/
WOLFSSL_API int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key,
word32);
/*!
\ingroup Diffie-Hellman
\brief This function sets the key for a DhKey structure using the input
private key parameters. Unlike wc_DhKeyDecode, this function does not
require that the input key be formatted in DER format, and instead simply
accepts the parsed input parameters p (prime) and g (base).
\return 0 Returned on successfully setting the key
\return BAD_FUNC_ARG Returned if any of the input parameters
evaluate to NULL
\return MP_INIT_E Returned if there is an error initializing the key
parameters for storage
\return ASN_DH_KEY_E Returned if there is an error reading in the
DH key parameters p and g
\param key pointer to the DhKey structure on which to set the key
\param p pointer to the buffer containing the prime for use with the key
\param pSz length of the input prime
\param g pointer to the buffer containing the base for use with the key
\param gSz length of the input base
_Example_
\code
DhKey key;
byte p[] = { // initialize with prime };
byte g[] = { // initialize with base };
wc_DhKeyInit(&key);
ret = wc_DhSetKey(key, p, sizeof(p), g, sizeof(g));
if ( ret != 0 ) {
// error setting key
}
\endcode
\sa wc_DhKeyDecode
*/
WOLFSSL_API int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
word32 gSz);
/*!
\ingroup Diffie-Hellman
\brief This function loads the Diffie-Hellman parameters, p (prime)
and g (base) out of the given input buffer, DER formatted.
\return 0 Returned on successfully extracting the DH parameters
\return ASN_PARSE_E Returned if an error occurs while parsing the DER
formatted DH certificate
\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
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
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
in the g buffer. Will be overwritten with the number of bytes written to
the buffer after completing the function call
_Example_
\code
byte dhCert[] = { initialize with DER formatted certificate };
byte p[MAX_DH_SIZE];
byte g[MAX_DH_SIZE];
word32 pSz = MAX_DH_SIZE;
word32 gSz = MAX_DH_SIZE;
ret = wc_DhParamsLoad(dhCert, sizeof(dhCert), p, &pSz, g, &gSz);
if ( ret != 0 ) {
// error parsing inputs
}
\endcode
\sa wc_DhSetKey
\sa wc_DhKeyDecode
*/
WOLFSSL_API int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p,
word32* pInOutSz, byte* g, word32* gInOutSz);

View File

@@ -0,0 +1,47 @@
/*!
\defgroup 3DES Algorithms - 3DES
\defgroup AES Algorithms - AES
\defgroup ARC4 Algorithms - ARC4
\defgroup BLAKE2 Algorithms - BLAKE2
\defgroup Camellia Algorithms - Camellia
\defgroup ChaCha Algorithms - ChaCha
\defgroup ChaCha20Poly1305 Algorithms - ChaCha20_Poly1305
\defgroup Curve25519 Algorithms - Curve25519
\defgroup DSA Algorithms - DSA
\defgroup Diffie-Hellman Algorithms - Diffie-Hellman
\defgroup ECC Algorithms - ECC
\defgroup ED25519 Algorithms - ED25519
\defgroup HC128 Algorithms - HC-128
\defgroup HMAC Algorithms - HMAC
\defgroup IDEA Algorithms - IDEA
\defgroup MD2 Algorithms - MD2
\defgroup MD4 Algorithms - MD4
\defgroup MD5 Algorithms - MD5
\defgroup PKCS7 Algorithms - PKCS7
\defgroup Password Algorithms - Password Based
\defgroup Poly1305 Algorithms - Poly1305
\defgroup RIPEMD Algorithms - RIPEMD
\defgroup RSA Algorithms - RSA
\defgroup Rabbit Algorithms - Rabbit
\defgroup SHA Algorithms - SHA 128/224/256/384/512
\defgroup SRP Algorithms - SRP
\defgroup ASN ASN.1
\defgroup Base_Encoding Base Encoding
\defgroup CertManager CertManager API
\defgroup Compression Compression
\defgroup Error Error Reporting
\defgroup Keys Key and Cert Conversion
\defgroup Logging Logging
\defgroup Math Math API
\defgroup Memory Memory Handling
\defgroup Random Random Number Generation
\defgroup Signature Signature API
\defgroup openSSL OpenSSL API
\defgroup wolfCrypt wolfCrypt Init and Cleanup
\defgroup TLS wolfSSL Initialization/Shutdown
\defgroup CertsKeys wolfSSL Certificates and Keys
\defgroup Setup wolfSSL Context and Session Set Up
\defgroup IO wolfSSL Connection, Session, and I/O
\defgroup Debug wolfSSL Error Handling and Reporting
*/

View File

@@ -0,0 +1,334 @@
/*!
\ingroup DSA
\brief This function initializes a DsaKey object in order to use it for
authentication via the Digital Signature Algorithm (DSA).
\return 0 Returned on success.
\return BAD_FUNC_ARG Returned if a NULL key is passed in.
\param key pointer to the DsaKey structure to initialize
_Example_
\code
DsaKey key;
int ret;
ret = wc_InitDsaKey(&key); // initialize DSA key
\endcode
\sa wc_FreeDsaKey
*/
WOLFSSL_API int wc_InitDsaKey(DsaKey* key);
/*!
\ingroup DSA
\brief This function frees a DsaKey object after it has been used.
\return none No returns.
\param key pointer to the DsaKey structure to free
_Example_
\code
DsaKey key;
// initialize key, use for authentication
...
wc_FreeDsaKey(&key); // free DSA key
\endcode
\sa wc_FreeDsaKey
*/
WOLFSSL_API void wc_FreeDsaKey(DsaKey* key);
/*!
\ingroup DSA
\brief This function signs the input digest and stores the result in the
output buffer, out.
\return 0 Returned on successfully signing the input digest
\return MP_INIT_E may be returned if there is an error in processing the
DSA signature.
\return MP_READ_E may be returned if there is an error in processing the
DSA signature.
\return MP_CMP_E may be returned if there is an error in processing the
DSA signature.
\return MP_INVMOD_E may be returned if there is an error in processing the
DSA signature.
\return MP_EXPTMOD_E may be returned if there is an error in processing
the DSA signature.
\return MP_MOD_E may be returned if there is an error in processing the
DSA signature.
\return MP_MUL_E may be returned if there is an error in processing the
DSA signature.
\return MP_ADD_E may be returned if there is an error in processing the
DSA signature.
\return MP_MULMOD_E may be returned if there is an error in processing
the DSA signature.
\return MP_TO_E may be returned if there is an error in processing the
DSA signature.
\return MP_MEM may be returned if there is an error in processing the
DSA signature.
\param digest pointer to the hash to sign
\param out pointer to the buffer in which to store the signature
\param key pointer to the initialized DsaKey structure with which to
generate the signature
\param rng pointer to an initialized RNG to use with the signature
generation
_Example_
\code
DsaKey key;
// initialize DSA key, load private Key
int ret;
WC_RNG rng;
wc_InitRng(&rng);
byte hash[] = { // initialize with hash digest };
byte signature[40]; // signature will be 40 bytes (320 bits)
ret = wc_DsaSign(hash, signature, &key, &rng);
if (ret != 0) {
// error generating DSA signature
}
\endcode
\sa wc_DsaVerify
*/
WOLFSSL_API int wc_DsaSign(const byte* digest, byte* out,
DsaKey* key, WC_RNG* rng);
/*!
\ingroup DSA
\brief This function verifies the signature of a digest, given a private
key. It stores whether the key properly verifies in the answer parameter,
with 1 corresponding to a successful verification, and 0 corresponding to
failed verification.
\return 0 Returned on successfully processing the verify request. Note:
this does not mean that the signature is verified, only that the function
succeeded
\return MP_INIT_E may be returned if there is an error in processing the
DSA signature.
\return MP_READ_E may be returned if there is an error in processing the
DSA signature.
\return MP_CMP_E may be returned if there is an error in processing the
DSA signature.
\return MP_INVMOD_E may be returned if there is an error in processing
the DSA signature.
\return MP_EXPTMOD_E may be returned if there is an error in processing
the DSA signature.
\return MP_MOD_E may be returned if there is an error in processing the
DSA signature.
\return MP_MUL_E may be returned if there is an error in processing the
DSA signature.
\return MP_ADD_E may be returned if there is an error in processing the
DSA signature.
\return MP_MULMOD_E may be returned if there is an error in processing
the DSA signature.
\return MP_TO_E may be returned if there is an error in processing the
DSA signature.
\return MP_MEM may be returned if there is an error in processing the
DSA signature.
\param digest pointer to the digest containing the subject of the signature
\param sig pointer to the buffer containing the signature to verify
\param key pointer to the initialized DsaKey structure with which to
verify the signature
\param answer pointer to an integer which will store whether the
verification was successful
_Example_
\code
DsaKey key;
// initialize DSA key, load public Key
int ret;
int verified;
byte hash[] = { // initialize with hash digest };
byte signature[] = { // initialize with signature to verify };
ret = wc_DsaVerify(hash, signature, &key, &verified);
if (ret != 0) {
// error processing verify request
} else if (answer == 0) {
// invalid signature
}
\endcode
\sa wc_DsaSign
*/
WOLFSSL_API int wc_DsaVerify(const byte* digest, const byte* sig,
DsaKey* key, int* answer);
/*!
\ingroup DSA
\brief This function decodes a DER formatted certificate buffer containing
a DSA public key, and stores the key in the given DsaKey structure. It
also sets the inOutIdx parameter according to the length of the input read.
\return 0 Returned on successfully setting the public key for the DsaKey
object
\return ASN_PARSE_E Returned if there is an error in the encoding while
reading the certificate buffer
\return ASN_DH_KEY_E Returned if one of the DSA parameters is incorrectly
formatted
\param input pointer to the buffer containing the DER formatted DSA
public key
\param inOutIdx pointer to an integer in which to store the final index
of the certificate read
\param key pointer to the DsaKey structure in which to store the public key
\param inSz size of the input buffer
_Example_
\code
int ret, idx=0;
DsaKey key;
wc_InitDsaKey(&key);
byte derBuff[] = { // DSA public key};
ret = wc_DsaPublicKeyDecode(derBuff, &idx, &key, inSz);
if (ret != 0) {
// error reading public key
}
\endcode
\sa wc_InitDsaKey
\sa wc_DsaPrivateKeyDecode
*/
WOLFSSL_API int wc_DsaPublicKeyDecode(const byte* input, word32* inOutIdx,
DsaKey*, word32);
/*!
\ingroup DSA
\brief This function decodes a DER formatted certificate buffer containing
a DSA private key, and stores the key in the given DsaKey structure. It
also sets the inOutIdx parameter according to the length of the input read.
\return 0 Returned on successfully setting the private key for the DsaKey
object
\return ASN_PARSE_E Returned if there is an error in the encoding while
reading the certificate buffer
\return ASN_DH_KEY_E Returned if one of the DSA parameters is incorrectly
formatted
\param input pointer to the buffer containing the DER formatted DSA
private key
\param inOutIdx pointer to an integer in which to store the final index
of the certificate read
\param key pointer to the DsaKey structure in which to store the private
key
\param inSz size of the input buffer
_Example_
\code
int ret, idx=0;
DsaKey key;
wc_InitDsaKey(&key);
byte derBuff[] = { // DSA private key };
ret = wc_DsaPrivateKeyDecode(derBuff, &idx, &key, inSz);
if (ret != 0) {
// error reading private key
}
\endcode
\sa wc_InitDsaKey
\sa wc_DsaPublicKeyDecode
*/
WOLFSSL_API int wc_DsaPrivateKeyDecode(const byte* input, word32* inOutIdx,
DsaKey*, word32);
/*!
\ingroup DSA
\brief Convert DsaKey key to DER format, write to output (inLen),
return bytes written.
\return outLen Success, number of bytes written
\return BAD_FUNC_ARG key or output are null or key->type is not
DSA_PRIVATE.
\return MEMORY_E Error allocating memory.
\param key Pointer to DsaKey structure to convert.
\param output Pointer to output buffer for converted key.
\param inLen Length of key input.
_Example_
\code
DsaKey key;
WC_WC_RNG rng;
int derSz;
int bufferSize = // Sufficient buffer size;
byte der[bufferSize];
wc_InitDsaKey(&key);
wc_InitRng(&rng);
wc_MakeDsaKey(&rng, &key);
derSz = wc_DsaKeyToDer(&key, der, bufferSize);
\endcode
\sa wc_InitDsaKey
\sa wc_FreeDsaKey
\sa wc_MakeDsaKey
*/
WOLFSSL_API int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen);
/*!
\ingroup DSA
\brief Create a DSA key.
\return MP_OKAY Success
\return BAD_FUNC_ARG Either rng or dsa is null.
\return MEMORY_E Couldn't allocate memory for buffer.
\return MP_INIT_E Error initializing mp_int
\param rng Pointer to WC_RNG structure.
\param dsa Pointer to DsaKey structure.
_Example_
\code
WC_WC_RNG rng;
DsaKey dsa;
wc_InitRng(&rng);
wc_InitDsa(&dsa);
if(wc_MakeDsaKey(&rng, &dsa) != 0)
{
// Error creating key
}
\endcode
\sa wc_InitDsaKey
\sa wc_FreeDsaKey
\sa wc_DsaSign
*/
WOLFSSL_API int wc_MakeDsaKey(WC_RNG *rng, DsaKey *dsa);
/*!
\ingroup DSA
\brief FIPS 186-4 defines valid for modulus_size values as
(1024, 160) (2048, 256) (3072, 256)
\return 0 Success
\return BAD_FUNC_ARG rng or dsa is null or modulus_size is invalid.
\return MEMORY_E Error attempting to allocate memory.
\param rng pointer to wolfCrypt rng.
\param modulus_size 1024, 2048, or 3072 are valid values.
\param dsa Pointer to a DsaKey structure.
_Example_
\code
DsaKey key;
WC_WC_RNG rng;
wc_InitDsaKey(&key);
wc_InitRng(&rng);
if(wc_MakeDsaParameters(&rng, 1024, &genKey) != 0)
{
// Handle error
}
\endcode
\sa wc_MakeDsaKey
\sa wc_DsaKeyToDer
\sa wc_InitDsaKey
*/
WOLFSSL_API int wc_MakeDsaParameters(WC_RNG *rng, int modulus_size, DsaKey *dsa);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,497 @@
/*!
\ingroup ED25519
\brief This function generates a new ed25519_key and stores it in key.
\retrun 0 Returned upon successfully making an ed25519_key
\retrun BAD_FUNC_ARG Returned if rng or key evaluate to NULL, or if the
specified key size is not 32 bytes (ed25519 has 32 byte keys)
\retrun MEMORY_E Returned if there is an error allocating memory
during function execution
\param rng pointer to an initialized RNG object with which to
generate the key
\param keysize length of key to generate. Should always be 32 for ed25519
\param key pointer to the ed25519_key for which to generate a key
_Example_
\code
ed25519_key key;
wc_ed25519_init(&key);
WC_RNG rng;
wc_InitRng(&rng);
wc_ed25519_make_key(&rng, 32, &key); // initialize 32 byte ed25519 key
\endcode
\sa wc_ed25519_init
*/
WOLFSSL_API
int wc_ed25519_make_key(WC_RNG* rng, int keysize, ed25519_key* key);
/*!
\ingroup ED25519
\brief This function signs a message digest using an ed25519_key object
to guarantee authenticity.
\return 0 Returned upon successfully generating a signature for the
message digest
\return BAD_FUNC_ARG Returned any of the input parameters evaluate to
NULL, or if the output buffer is too small to store the generated signature
\return MEMORY_E Returned if there is an error allocating memory during
function execution
\param in pointer to the buffer containing the message to sign
\param inlen length of the message to sign
\param out buffer in which to store the generated signature
\param outlen max length of the output buffer. Will store the bytes
written to out upon successfully generating a message signature
\param key pointer to a private ed25519_key with which to generate the
signature
_Example_
\code
ed25519_key key;
WC_RNG rng;
int ret, sigSz;
byte sig[64]; // will hold generated signature
sigSz = sizeof(sig);
byte message[] = { // initialize with message };
wc_InitRng(&rng); // initialize rng
wc_ed25519_init(&key); // initialize key
wc_ed25519_make_key(&rng, 32, &key); // make public/private key pair
ret = wc_ed25519_sign_msg(message, sizeof(message), sig, &sigSz, &key);
if ( ret != 0 ) {
// error generating message signature
}
\endcode
\sa wc_ed25519_verify_msg
*/
WOLFSSL_API
int wc_ed25519_sign_msg(const byte* in, word32 inlen, byte* out,
word32 *outlen, ed25519_key* key);
/*!
\ingroup ED25519
\brief This function verifies the ed25519 signature of a message to ensure
authenticity. It returns the answer through stat, with 1 corresponding to
a valid signature, and 0 corresponding to an invalid signature.
\return 0 Returned upon successfully performing the signature
verification. Note: This does not mean that the signature is verified.
The authenticity information is stored instead in stat
\return BAD_FUNC_ARG Returned if any of the input parameters evaluate to
NULL, or if the siglen does not match the actual length of a signature
\return 1 Returned if verification completes, but the signature generated
does not match the signature provided
\param sig pointer to the buffer containing the signature to verify
\param siglen length of the signature to verify
\param msg pointer to the buffer containing the message to verify
\param msglen length of the message to verify
\param stat pointer to the result of the verification. 1 indicates the
message was successfully verified
\param key pointer to a public ed25519 key with which to verify the
signature
_Example_
\code
ed25519_key key;
int ret, verified = 0;
byte sig[] { // initialize with received signature };
byte msg[] = { // initialize with message };
// initialize key with received public key
ret = wc_ed25519_verify_msg(sig, sizeof(sig), msg, sizeof(msg),
&verified, &key);
if ( return < 0 ) {
// error performing verification
} else if ( verified == 0 )
// the signature is invalid
}
\endcode
\sa wc_ed25519_sign_msg
*/
WOLFSSL_API
int wc_ed25519_verify_msg(const byte* sig, word32 siglen, const byte* msg,
word32 msglen, int* stat, ed25519_key* key);
/*!
\ingroup ED25519
\brief This function initializes an ed25519_key object for future use
with message verification.
\return 0 Returned upon successfully initializing the ed25519_key object
\return BAD_FUNC_ARG Returned if key is NULL
\param key pointer to the ed25519_key object to initialize
_Example_
\code
ed25519_key key;
wc_ed25519_init(&key);
\endcode
\sa wc_ed25519_make_key
\sa wc_ed25519_free
*/
WOLFSSL_API
int wc_ed25519_init(ed25519_key* key);
/*!
\ingroup ED25519
\brief This function frees an ed25519 object after it has been used.
\return none No returns.
\param key pointer to the ed25519_key object to free
_Example_
\code
ed25519_key key;
// initialize key and perform secure exchanges
...
wc_ed25519_free(&key);
\endcode
\sa wc_ed25519_init
*/
WOLFSSL_API
void wc_ed25519_free(ed25519_key* key);
/*!
\ingroup ED25519
\brief This function imports a public ed25519_key pair from a buffer
containing the public key. This function will handle both compressed and
uncompressed keys.
\return 0 Returned on successfully importing the ed25519_key
\return BAD_FUNC_ARG Returned if in or key evaluate to NULL, or inLen is
less than the size of an ed25519 key
\param in pointer to the buffer containing the public key
\param inLen length of the buffer containing the public key
\param key pointer to the ed25519_key object in which to store the
public key
_Example_
\code
int ret;
byte pub[] = { // initialize ed25519 public key };
ed_25519 key;
wc_ed25519_init_key(&key);
ret = wc_ed25519_import_public(pub, sizeof(pub), &key);
if ( ret != 0) {
// error importing key
}
\endcode
\sa wc_ed25519_import_private_key
\sa wc_ed25519_export_public
*/
WOLFSSL_API
int wc_ed25519_import_public(const byte* in, word32 inLen, ed25519_key* key);
/*!
\ingroup ED25519
\brief This function imports a public/private ed25519 key pair from a
pair of buffers. This function will handle both compressed and
uncompressed keys.
\return 0 Returned on successfully importing the ed25519_key
\return BAD_FUNC_ARG Returned if in or key evaluate to NULL, or if
either privSz or pubSz are less than the size of an ed25519 key
\param priv pointer to the buffer containing the private key
\param privSz size of the private key
\param pub pointer to the buffer containing the public key
\param pubSz length of the public key
\param key pointer to the ed25519_key object in which to store the
imported private/public key pair
_Example_
\code
int ret;
byte priv[] = { // initialize with 32 byte private key };
byte pub[] = { // initialize with the corresponding public key };
ed25519_key key;
wc_ed25519_init_key(&key);
ret = wc_ed25519_import_private_key(priv, sizeof(priv), pub,
sizeof(pub), &key);
if ( ret != 0) {
// error importing key
}
\endcode
\sa wc_ed25519_import_public_key
\sa wc_ed25519_export_private_only
*/
WOLFSSL_API
int wc_ed25519_import_private_key(const byte* priv, word32 privSz,
const byte* pub, word32 pubSz, ed25519_key* key);
/*!
\ingroup ED25519
\brief This function exports the private key from an ed25519_key
structure. It stores the public key in the buffer out, and sets the bytes
written to this buffer in outLen.
\return 0 Returned upon successfully exporting the public key
\return BAD_FUNC_ARG Returned if any of the input values evaluate to NULL
\return BUFFER_E Returned if the buffer provided is not large enough to
store the private key. Upon returning this error, the function sets the
size required in outLen
\param key pointer to an ed25519_key structure from which to export the
public key
\param out pointer to the buffer in which to store the public key
\param outLen pointer to a word32 object with the size available in out.
Set with the number of bytes written to out after successfully exporting
the private key
_Example_
\code
int ret;
ed25519_key key;
// initialize key, make key
char pub[32];
word32 pubSz = sizeof(pub);
ret = wc_ed25519_export_public(&key, pub, &pubSz);
if ( ret != 0) {
// error exporting public key
}
\endcode
\sa wc_ed25519_import_public_key
\sa wc_ed25519_export_private_only
*/
WOLFSSL_API
int wc_ed25519_export_public(ed25519_key*, byte* out, word32* outLen);
/*!
\ingroup ED25519
\brief This function exports only the private key from an ed25519_key
structure. It stores the private key in the buffer out, and sets
the bytes written to this buffer in outLen.
\return 0 Returned upon successfully exporting the private key
\return ECC_BAD_ARG_E Returned if any of the input values evaluate to NULL
\return BUFFER_E Returned if the buffer provided is not large enough
to store the private key
\param key pointer to an ed25519_key structure from which to export
the private key
\param out pointer to the buffer in which to store the private key
\param outLen pointer to a word32 object with the size available in
out. Set with the number of bytes written to out after successfully
exporting the private key
_Example_
\code
int ret;
ed25519_key key;
// initialize key, make key
char priv[32]; // 32 bytes because only private key
word32 privSz = sizeof(priv);
ret = wc_ed25519_export_private_only(&key, priv, &privSz);
if ( ret != 0) {
// error exporting private key
}
\endcode
\sa wc_ed25519_export_public
\sa wc_ed25519_import_private_key
*/
WOLFSSL_API
int wc_ed25519_export_private_only(ed25519_key* key, byte* out, word32* outLen);
/*!
\ingroup ED25519
\brief Export the private key, including public part.
\return 0 Success
\return BAD_FUNC_ARG Returns if any argument is null.
\return BUFFER_E Returns if outLen is less than ED25519_PRV_KEY_SIZE
\param key ed25519_key struct to export from.
\param out Destination for private key.
\param outLen Max length of output, set to the length of the exported
private key.
_Example_
\code
ed25519_key key;
wc_ed25519_init(&key);
WC_RNG rng;
wc_InitRng(&rng);
wc_ed25519_make_key(&rng, 32, &key); // initialize 32 byte ed25519 key
byte out[32]; // out needs to be a sufficient buffer size
word32 outLen = sizeof(out);
int key_size = wc_ed25519_export_private(&key, out, &outLen);
if(key_size == BUFFER_E)
{
// Check size of out compared to outLen to see if function reset outLen
}
\endcode
\sa none
*/
WOLFSSL_API
int wc_ed25519_export_private(ed25519_key* key, byte* out, word32* outLen);
/*!
\ingroup ED25519
\brief Export full private key and public key.
\return 0 Success
\return BAD_FUNC_ARG: Returns if any argument is null.
\return BUFFER_E: Returns if outLen is less than ED25519_PRV_KEY_SIZE
or ED25519_PUB_KEY_SIZE
\param key The ed25519_key structure to export to.
\param priv Byte array to store private key.
\param privSz Size of priv buffer.
\param pub Byte array to store public key.
\param pubSz Size of pub buffer.
_Example_
\code
int ret;
ed25519_key key;
// initialize key, make key
char pub[32];
word32 pubSz = sizeof(pub);
char priv[32];
word32 privSz = sizeof(priv);
ret = wc_ed25519_export_key(&key, priv, &pubSz, pub, &pubSz);
if ( ret != 0) {
// error exporting public key
}
\endcode
\sa wc_ed25519_export_private
\sa wc_ed25519_export_public
*/
WOLFSSL_API
int wc_ed25519_export_key(ed25519_key* key,
byte* priv, word32 *privSz,
byte* pub, word32 *pubSz);
/*!
\ingroup ED25519
\brief This function returns the key size of an ed25519_key structure,
or 32 bytes.
\return Success Given a valid key, returns ED25519_KEY_SIZE (32 bytes)
\return BAD_FUNC_ARGS Returned if the given key is NULL
\param key pointer to an ed25519_key structure for which to get the
key size
_Example_
\code
int keySz;
ed25519_key key;
// initialize key, make key
keySz = wc_ed25519_size(&key);
if ( keySz == 0) {
// error determining key size
}
\endcode
\sa wc_ed25519_make_key
*/
WOLFSSL_API
int wc_ed25519_size(ed25519_key* key);
/*!
\ingroup ED25519
\brief Returns the private key size (secret + public) in bytes.
\return BAD_FUNC_ARG Returns if key argument is null.
\return ED25519_PRV_KEY_SIZE The size of the private key.
\param key The ed25119_key struct
_Example_
\code
ed25519_key key;
wc_ed25519_init(&key);
WC_RNG rng;
wc_InitRng(&rng);
wc_ed25519_make_key(&rng, 32, &key); // initialize 32 byte ed25519 key
int key_size = wc_ed25519_priv_size(&key);
\endcode
\sa wc_ed25119_pub_size
*/
WOLFSSL_API
int wc_ed25519_priv_size(ed25519_key* key);
/*!
\ingroup ED25519
\brief Returns the compressed key size in bytes (public key).
\return BAD_FUNC_ARG returns if key is null.
\return ED25519_PUB_KEY_SIZE Size of key.
\param key Pointer to the ed25519_key struct.
_Example_
\code
ed25519_key key;
wc_ed25519_init(&key);
WC_RNG rng;
wc_InitRng(&rng);
wc_ed25519_make_key(&rng, 32, &key); // initialize 32 byte ed25519 key
int key_size = wc_ed25519_pub_size(&key);
\endcode
\sa wc_ed25519_priv_size
*/
WOLFSSL_API
int wc_ed25519_pub_size(ed25519_key* key);
/*!
\ingroup ED25519
\brief This function returns the size of an ed25519 signature (64 in bytes).
\return Success Given a valid key, returns ED25519_SIG_SIZE (64 in bytes)
\return 0 Returned if the given key is NULL
\param key pointer to an ed25519_key structure for which to get the
signature size
_Example_
\code
int sigSz;
ed25519_key key;
// initialize key, make key
sigSz = wc_ed25519_sig_size(&key);
if ( sigSz == 0) {
// error determining sig size
}
\endcode
\sa wc_ed25519_sign_msg
*/
WOLFSSL_API
int wc_ed25519_sig_size(ed25519_key* key);

View File

@@ -0,0 +1,48 @@
/*!
\ingroup Error
\brief This function stores the error string for a particular error code
in the given buffer.
\return none No returns.
\param error error code for which to get the string
\param buffer buffer in which to store the error string. Buffer should be
at least WOLFSSL_MAX_ERROR_SZ (80 bytes) long
_Example_
\code
char errorMsg[WOLFSSL_MAX_ERROR_SZ];
int err = wc_some_function();
if( err != 0) { // error occurred
wc_ErrorString(err, errorMsg);
}
\endcode
\sa wc_GetErrorString
*/
WOLFSSL_API void wc_ErrorString(int err, char* buff);
/*!
\ingroup Error
\brief This function returns the error string for a particular error code.
\return string Returns the error string for an error code as a
string literal.
\param error error code for which to get the string
_Example_
\code
char * errorMsg;
int err = wc_some_function();
if( err != 0) { // error occurred
errorMsg = wc_GetErrorString(err);
}
\endcode
\sa wc_ErrorString
*/
WOLFSSL_API const char* wc_GetErrorString(int error);

View File

@@ -0,0 +1,385 @@
/*!
\ingroup openSSL
\brief Getter functions for the respective WOLFSSL_EVP_CIPHER pointers.
wolfSSL_EVP_init() must be called once in the program first to populate
these cipher strings. WOLFSSL_DES_ECB macro must be defined for
wolfSSL_EVP_des_ede3_ecb().
\return pointer Returns a WOLFSSL_EVP_CIPHER pointer for DES EDE3 operations.
\param none No parameters.
_Example_
\code
printf("block size des ede3 cbc = %d\n",
wolfSSL_EVP_CIPHER_block_size(wolfSSL_EVP_des_ede3_cbc()));
printf("block size des ede3 ecb = %d\n",
wolfSSL_EVP_CIPHER_block_size(wolfSSL_EVP_des_ede3_ecb()));
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_init
*/
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_ecb(void);
/*!
\ingroup openSSL
\brief Getter functions for the respective WOLFSSL_EVP_CIPHER pointers.
wolfSSL_EVP_init() must be called once in the program first to populate
these cipher strings. WOLFSSL_DES_ECB macro must be defined for
wolfSSL_EVP_des_ecb().
\return pointer Returns a WOLFSSL_EVP_CIPHER pointer for DES operations.
\param none No parameters.
_Example_
\code
WOLFSSL_EVP_CIPHER* cipher;
cipher = wolfSSL_EVP_des_cbc();
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_init
*/
WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_cbc(void);
/*!
\ingroup openSSL
\brief Function for initializing WOLFSSL_EVP_MD_CTX. This function is a
wrapper for wolfSSL_EVP_DigestInit() because wolfSSL does not
use WOLFSSL_ENGINE.
\return SSL_SUCCESS If successfully set.
\return SSL_FAILURE If not successful.
\param ctx structure to initialize.
\param type type of hash to do, for example SHA.
\param impl engine to use. N/A for wolfSSL, can be NULL.
_Example_
\code
WOLFSSL_EVP_MD_CTX* md = NULL;
wolfCrypt_Init();
md = wolfSSL_EVP_MD_CTX_new();
if (md == NULL) {
printf("error setting md\n");
return -1;
}
printf("cipher md init ret = %d\n", wolfSSL_EVP_DigestInit_ex(md,
wolfSSL_EVP_sha1(), e));
//free resources
\endcode
\sa wolfSSL_EVP_MD_CTX_new
\sa wolfCrypt_Init
\sa wolfSSL_EVP_MD_CTX_free
*/
WOLFSSL_API int wolfSSL_EVP_DigestInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
const WOLFSSL_EVP_MD* type,
WOLFSSL_ENGINE *impl);
/*!
\ingroup openSSL
\brief Function for initializing WOLFSSL_EVP_CIPHER_CTX. This function is a
wrapper for wolfSSL_CipherInit() because wolfSSL does not
use WOLFSSL_ENGINE.
\return SSL_SUCCESS If successfully set.
\return SSL_FAILURE If not successful.
\param ctx structure to initialize.
\param type type of encryption/decryption to do, for example AES.
\param impl engine to use. N/A for wolfSSL, can be NULL.
\param key key to set .
\param iv iv if needed by algorithm.
\param enc encryption (1) or decryption (0) flag.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx = NULL;
WOLFSSL_ENGINE* e = NULL;
unsigned char key[16];
unsigned char iv[12];
wolfCrypt_Init();
ctx = wolfSSL_EVP_CIPHER_CTX_new();
if (ctx == NULL) {
printf("issue creating ctx\n");
return -1;
}
printf("cipher init ex error ret = %d\n", wolfSSL_EVP_CipherInit_ex(NULL,
EVP_aes_128_ cbc(), e, key, iv, 1));
printf("cipher init ex success ret = %d\n", wolfSSL_EVP_CipherInit_ex(ctx,
EVP_aes_128_c bc(), e, key, iv, 1));
// free resources
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_new
\sa wolfCrypt_Init
\sa wolfSSL_EVP_CIPHER_CTX_free
*/
WOLFSSL_API int wolfSSL_EVP_CipherInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
const WOLFSSL_EVP_CIPHER* type,
WOLFSSL_ENGINE *impl,
const unsigned char* key,
const unsigned char* iv,
int enc);
/*!
\ingroup openSSL
\brief Function for initializing WOLFSSL_EVP_CIPHER_CTX. This function is a
wrapper for wolfSSL_EVP_CipherInit() because wolfSSL does not use
WOLFSSL_ENGINE. Sets encrypt flag to be encrypt.
\return SSL_SUCCESS If successfully set.
\return SSL_FAILURE If not successful.
\param ctx structure to initialize.
\param type type of encryption to do, for example AES.
\param impl engine to use. N/A for wolfSSL, can be NULL.
\param key key to use.
\param iv iv to use.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx = NULL;
wolfCrypt_Init();
ctx = wolfSSL_EVP_CIPHER_CTX_new();
if (ctx == NULL) {
printf("error setting ctx\n");
return -1;
}
printf("cipher ctx init ret = %d\n", wolfSSL_EVP_EncryptInit_ex(ctx,
wolfSSL_EVP_aes_128_cbc(), e, key, iv));
//free resources
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_new
\sa wolfCrypt_Init
\sa wolfSSL_EVP_CIPHER_CTX_free
*/
WOLFSSL_API int wolfSSL_EVP_EncryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
const WOLFSSL_EVP_CIPHER* type,
WOLFSSL_ENGINE *impl,
const unsigned char* key,
const unsigned char* iv);
/*!
\ingroup openSSL
\brief Function for initializing WOLFSSL_EVP_CIPHER_CTX. This function is a
wrapper for wolfSSL_EVP_CipherInit() because wolfSSL does not use
WOLFSSL_ENGINE. Sets encrypt flag to be decrypt.
\return SSL_SUCCESS If successfully set.
\return SSL_FAILURE If not successful.
\param ctx structure to initialize.
\param type type of encryption/decryption to do, for example AES.
\param impl engine to use. N/A for wolfSSL, can be NULL.
\param key key to set .
\param iv iv if needed by algorithm.
\param enc encryption (1) or decryption (0) flag.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx = NULL;
WOLFSSL_ENGINE* e = NULL;
unsigned char key[16];
unsigned char iv[12];
wolfCrypt_Init();
ctx = wolfSSL_EVP_CIPHER_CTX_new();
if (ctx == NULL) {
printf("issue creating ctx\n");
return -1;
}
printf("cipher init ex error ret = %d\n", wolfSSL_EVP_DecryptInit_ex(NULL,
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
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_new
\sa wolfCrypt_Init
\sa wolfSSL_EVP_CIPHER_CTX_free
*/
WOLFSSL_API int wolfSSL_EVP_DecryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
const WOLFSSL_EVP_CIPHER* type,
WOLFSSL_ENGINE *impl,
const unsigned char* key,
const unsigned char* iv);
/*!
\ingroup openSSL
\brief Function for encrypting/decrypting data. In buffer is added to be
encrypted or decrypted and out buffer holds the results. outl will be the
length of encrypted/decrypted information.
\return SSL_SUCCESS If successfull.
\return SSL_FAILURE If not successful.
\param ctx structure to get cipher type from.
\param out buffer to hold output.
\param outl adjusted to be size of output.
\param in buffer to perform operation on.
\param inl length of input buffer.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx = NULL;
unsigned char out[100];
int outl;
unsigned char in[100];
int inl = 100;
ctx = wolfSSL_EVP_CIPHER_CTX_new();
// set up ctx
ret = wolfSSL_EVP_CipherUpdate(ctx, out, outl, in, inl);
// check ret value
// buffer out holds outl bytes of data
// free resources
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_new
\sa wolfCrypt_Init
\sa wolfSSL_EVP_CIPHER_CTX_free
*/
WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx,
unsigned char *out, int *outl,
const unsigned char *in, int inl);
/*!
\ingroup openSSL
\brief This function performs the final cipher operations adding in
padding. If WOLFSSL_EVP_CIPH_NO_PADDING flag is set in
WOLFSSL_EVP_CIPHER_CTX structure then 1 is returned and no
encryption/decryption is done. If padding flag is seti padding is added and
encrypted when ctx is set to encrypt, padding values are checked when set
to decrypt.
\return 1 Returned on success.
\return 0 If encountering a failure.
\param ctx structure to decrypt/encrypt with.
\param out buffer for final decrypt/encrypt.
\param out1 size of out buffer when data has been added by function.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx;
int out1;
unsigned char out[64];
// create ctx
wolfSSL_EVP_CipherFinal(ctx, out, &out1);
\endcode
\sa wolfSSL_EVP_CIPHER_CTX_new
*/
WOLFSSL_API int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
unsigned char *out, int *outl);
/*!
\ingroup openSSL
\brief Setter function for WOLFSSL_EVP_CIPHER_CTX structure key length.
\return SSL_SUCCESS If successfully set.
\return SSL_FAILURE If failed to set key length.
\param ctx structure to set key length.
\param keylen key length.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx;
int keylen;
// create ctx
wolfSSL_EVP_CIPHER_CTX_set_key_length(ctx, keylen);
\endcode
\sa wolfSSL_EVP_CIPHER_flags
*/
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx,
int keylen);
/*!
\ingroup openSSL
\brief This is a getter function for the ctx block size.
\return size Returns ctx->block_size.
\param ctx the cipher ctx to get block size of.
_Example_
\code
const WOLFSSL_CVP_CIPHER_CTX* ctx;
//set up ctx
printf(“block size = %d\n”, wolfSSL_EVP_CIPHER_CTX_block_size(ctx));
\endcode
\sa wolfSSL_EVP_CIPHER_block_size
*/
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_block_size(const WOLFSSL_EVP_CIPHER_CTX *ctx);
/*!
\ingroup openSSL
\brief This is a getter function for the block size of cipher.
\return size returns the block size.
\param cipher cipher to get block size of.
_Example_
\code
printf(“block size = %d\n”,
wolfSSL_EVP_CIPHER_block_size(wolfSSL_EVP_aes_256_ecb()));
\endcode
\sa wolfSSL_EVP_aes_256_ctr
*/
WOLFSSL_API int wolfSSL_EVP_CIPHER_block_size(const WOLFSSL_EVP_CIPHER *cipher);
/*!
\ingroup openSSL
\brief Setter function for WOLFSSL_EVP_CIPHER_CTX structure.
\return none No returns.
\param ctx structure to set flag.
\param flag flag to set in structure.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx;
int flag;
// create ctx
wolfSSL_EVP_CIPHER_CTX_set_flags(ctx, flag);
\endcode
\sa wolfSSL_EVP_CIPHER_flags
*/
WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_set_flags(WOLFSSL_EVP_CIPHER_CTX *ctx, int flags);
/*!
\ingroup openSSL
\brief Setter function for WOLFSSL_EVP_CIPHER_CTX structure to use padding.
\return SSL_SUCCESS If successfully set.
\return BAD_FUNC_ARG If null argument passed in.
\param ctx structure to set padding flag.
\param padding 0 for not setting padding, 1 for setting padding.
_Example_
\code
WOLFSSL_EVP_CIPHER_CTX* ctx;
// create ctx
wolfSSL_EVP_CIPHER_CTX_set_padding(ctx, 1);
\endcode
\sa wolfSSL_EVP_CIPHER_flags
*/
WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_padding(WOLFSSL_EVP_CIPHER_CTX *c, int pad);

View File

@@ -0,0 +1,235 @@
/*!
\ingroup wolfCrypt
\brief This function will return the OID for the wc_HashType provided.
\return OID returns value greater than 0
\return HASH_TYPE_E hash type not supported.
\return BAD_FUNC_ARG one of the provided arguments is incorrect.
\param hash_type A hash type from the “enum wc_HashType” such
as “WC_HASH_TYPE_SHA256”.
_Example_
\code
enum wc_HashType hash_type = WC_HASH_TYPE_SHA256;
int oid = wc_HashGetOID(hash_type);
if (oid > 0) {
// Success
}
\endcode
\sa wc_HashGetDigestSize
\sa wc_Hash
*/
WOLFSSL_API int wc_HashGetOID(enum wc_HashType hash_type);
/*!
\ingroup wolfCrypt
\brief This function returns the size of the digest (output) for a
hash_type. The returns size is used to make sure the output buffer
provided to wc_Hash is large enough.
\return Success A positive return value indicates the digest size
for the hash.
\return Error Returns HASH_TYPE_E if hash_type is not supported.
\return Failure Returns BAD_FUNC_ARG if an invalid hash_type was used.
\param hash_type A hash type from the “enum wc_HashType” such as
“WC_HASH_TYPE_SHA256”.
_Example_
\code
int hash_len = wc_HashGetDigestSize(hash_type);
if (hash_len <= 0) {
WOLFSSL_MSG("Invalid hash type/len");
return BAD_FUNC_ARG;
}
\endcode
\sa wc_Hash
*/
WOLFSSL_API int wc_HashGetDigestSize(enum wc_HashType hash_type);
/*!
\ingroup wolfCrypt
\brief This function performs a hash on the provided data buffer
and returns it in the hash buffer provided.
\return 0 Success, else error (such as BAD_FUNC_ARG or BUFFER_E).
\param hash_type A hash type from the “enum wc_HashType”
such as “WC_HASH_TYPE_SHA256”.
\param data Pointer to buffer containing the data to hash.
\param data_len Length of the data buffer.
\param hash Pointer to buffer used to output the final hash to.
\param hash_len Length of the hash buffer.
_Example_
\code
enum wc_HashType hash_type = WC_HASH_TYPE_SHA256;
int hash_len = wc_HashGetDigestSize(hash_type);
if (hash_len > 0) {
int ret = wc_Hash(hash_type, data, data_len, hash_data, hash_len);
if(ret == 0) {
// Success
}
}
\endcode
\sa wc_HashGetDigestSize
*/
WOLFSSL_API int wc_Hash(enum wc_HashType hash_type,
const byte* data, word32 data_len,
byte* hash, word32 hash_len);
/*!
\ingroup MD5
\brief Convenience function, handles all the hashing and places the
result into hash.
\return 0 Returned upon successfully hashing the data.
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
const byte* data;
word32 data_len;
byte* hash;
int ret;
...
ret = wc_Md5Hash(data, data_len, hash);
if (ret != 0) {
// Md5 Hash Failure Case.
}
\endcode
\sa wc_Md5Hash
\sa wc_Md5Final
\sa wc_InitMd5
*/
WOLFSSL_API int wc_Md5Hash(const byte* data, word32 len, byte* hash);
/*!
\ingroup SHA
\brief Convenience function, handles all the hashing and places the
result into hash.
\return 0 Returned upon successfully ….
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
\sa wc_ShaHash
\sa wc_ShaFinal
\sa wc_InitSha
*/
WOLFSSL_API int wc_ShaHash(const byte*, word32, byte*);
/*!
\ingroup SHA
\brief Convenience function, handles all the hashing and places the
result into hash.
\return 0 Returned upon successfully …
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
\sa wc_Sha256Hash
\sa wc_Sha256Final
\sa wc_InitSha256
*/
WOLFSSL_API int wc_Sha256Hash(const byte*, word32, byte*);
/*!
\ingroup SHA
\brief Convenience function, handles all the hashing and places the
result into hash.
\return 0 Success
\return <0 Error
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
\sa wc_InitSha224
\sa wc_Sha224Update
\sa wc_Sha224Final
*/
WOLFSSL_API int wc_Sha224Hash(const byte*, word32, byte*);
/*!
\ingroup SHA
\brief Convenience function, handles all the hashing and places the
result into hash.
\return 0 Returned upon successfully hashing the inputted data
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
\sa wc_Sha512Hash
\sa wc_Sha512Final
\sa wc_InitSha512
*/
WOLFSSL_API int wc_Sha512Hash(const byte*, word32, byte*);
/*!
\ingroup SHA
\brief Convenience function, handles all the hashing and places the
result into hash.
\return 0 Returned upon successfully hashing the data
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
\sa wc_Sha384Hash
\sa wc_Sha384Final
\sa wc_InitSha384
*/
WOLFSSL_API int wc_Sha384Hash(const byte*, word32, byte*);

View File

@@ -0,0 +1,65 @@
/*!
\ingroup HC128
\brief This function encrypts or decrypts a message of any size from the
input buffer input, and stores the resulting plaintext/ciphertext in
the output buffer output.
\return 0 Returned upon successfully encrypting/decrypting the given input
\return MEMORY_E Returned if the input and output buffers are not aligned
along a 4-byte boundary, and there is an error allocating memory
\return BAD_ALIGN_E Returned if the input or output buffers are not
aligned along a 4-byte boundary, and NO_WOLFSSL_ALLOC_ALIGN is defined
\param ctx pointer to a HC-128 context object with an initialized key
to use for encryption or decryption
\param output buffer in which to store the processed input
\param input buffer containing the plaintext to encrypt or the
ciphertext to decrypt
\param msglen length of the plaintext to encrypt or the ciphertext
to decrypt
_Example_
\code
HC128 enc;
byte key[] = { // initialize with key };
byte iv[] = { // initialize with iv };
wc_Hc128_SetKey(&enc, key, iv);
byte msg[] = { // initialize with message };
byte cipher[sizeof(msg)];
if (wc_Hc128_Process(*enc, cipher, plain, sizeof(plain)) != 0) {
// error encrypting msg
}
\endcode
\sa wc_Hc128_SetKey
*/
WOLFSSL_API int wc_Hc128_Process(HC128*, byte*, const byte*, word32);
/*!
\ingroup HC128
\brief This function initializes an HC128 context object by
setting its key and iv.
\return 0 Returned upon successfully setting the key and iv
for the HC128 context object
\param ctx pointer to an HC-128 context object to initialize
\param key pointer to the buffer containing the 16 byte key to
use with encryption/decryption
\param iv pointer to the buffer containing the 16 byte iv (nonce)
with which to initialize the HC128 object
_Example_
\code
HC128 enc;
byte key[] = { // initialize with key };
byte iv[] = { // initialize with iv };
wc_Hc128_SetKey(&enc, key, iv);
\endcode
\sa wc_Hc128_Process
*/
WOLFSSL_API int wc_Hc128_SetKey(HC128*, const byte* key, const byte* iv);

View File

@@ -0,0 +1,168 @@
/*!
\ingroup HMAC
\brief This function initializes an Hmac object, setting its
encryption type, key and HMAC length.
\return 0 Returned on successfully initializing the Hmac object
\return BAD_FUNC_ARG Returned if the input type is invalid. Valid options
are: MD5, SHA, SHA256, SHA384, SHA512, BLAKE2B_ID
\return MEMORY_E Returned if there is an error allocating memory for the
structure to use for hashing
\return HMAC_MIN_KEYLEN_E May be returned when using a FIPS implementation
and the key length specified is shorter than the minimum acceptable
FIPS standard
\param hmac pointer to the Hmac object to initialize
\param type type specifying which encryption method the Hmac object
should use. Valid options are: MD5, SHA, SHA256, SHA384, SHA512, BLAKE2B_ID
\param key pointer to a buffer containing the key with which to
initialize the Hmac object
\param length length of the key
_Example_
\code
Hmac hmac;
byte key[] = { // initialize with key to use for encryption };
if (wc_HmacSetKey(&hmac, MD5, key, sizeof(key)) != 0) {
// error initializing Hmac object
}
\endcode
\sa wc_HmacUpdate
\sa wc_HmacFinal
*/
WOLFSSL_API int wc_HmacSetKey(Hmac*, int type, const byte* key, word32 keySz);
/*!
\ingroup HMAC
\brief This function updates the message to authenticate using HMAC.
It should be called after the Hmac object has been initialized with
wc_HmacSetKey. This function may be called multiple times to update
the message to hash. After calling wc_HmacUpdate as desired, one should
call wc_HmacFinal to obtain the final authenticated message tag.
\return 0 Returned on successfully updating the message to authenticate
\return MEMORY_E Returned if there is an error allocating memory for
use with a hashing algorithm
\param hmac pointer to the Hmac object for which to update the message
\param msg pointer to the buffer containing the message to append
\param length length of the message to append
_Example_
\code
Hmac hmac;
byte msg[] = { // initialize with message to authenticate };
byte msg2[] = { // initialize with second half of message };
// initialize hmac
if( wc_HmacUpdate(&hmac, msg, sizeof(msg)) != 0) {
// error updating message
}
if( wc_HmacUpdate(&hmac, msg2, sizeof(msg)) != 0) {
// error updating with second message
}
\endcode
\sa wc_HmacSetKey
\sa wc_HmacFinal
*/
WOLFSSL_API int wc_HmacUpdate(Hmac*, const byte*, word32);
/*!
\ingroup HMAC
\brief This function computes the final hash of an Hmac object's message.
\return 0 Returned on successfully computing the final hash
\return MEMORY_E Returned if there is an error allocating memory for
use with a hashing algorithm
\param hmac pointer to the Hmac object for which to calculate the
final hash
\param hash pointer to the buffer in which to store the final hash.
Should have room available as required by the hashing algorithm chosen
_Example_
\code
Hmac hmac;
byte hash[MD5_DIGEST_SIZE];
// initialize hmac with MD5 as type
// wc_HmacUpdate() with messages
if (wc_HmacFinal(&hmac, hash) != 0) {
// error computing hash
}
\endcode
\sa wc_HmacSetKey
\sa wc_HmacUpdate
*/
WOLFSSL_API int wc_HmacFinal(Hmac*, byte*);
/*!
\ingroup HMAC
\brief This function returns the largest HMAC digest size available
based on the configured cipher suites.
\return Success Returns the largest HMAC digest size available based
on the configured cipher suites
\param none No parameters.
_Example_
\code
int maxDigestSz = wolfSSL_GetHmacMaxSize();
\endcode
\sa none
*/
WOLFSSL_API int wolfSSL_GetHmacMaxSize(void);
/*!
\ingroup HMAC
\brief This function provides access to a HMAC Key Derivation Function
(HKDF). It utilizes HMAC to convert inKey, with an optional salt and
optional info into a derived key, which it stores in out. The hash type
defaults to MD5 if 0 or NULL is given.
\return 0 Returned upon successfully generating a key with the given inputs
\return BAD_FUNC_ARG Returned if an invalid hash type is given as
argument. Valid types are: MD5, SHA, SHA256, SHA384, SHA512, BLAKE2B_ID
\return MEMORY_E Returned if there is an error allocating memory
\return HMAC_MIN_KEYLEN_E May be returned when using a FIPS implementation
and the key length specified is shorter than the minimum acceptable FIPS
standard
\param type hash type to use for the HKDF. Valid types are: MD5, SHA,
SHA256, SHA384, SHA512, BLAKE2B_ID
\param inKey pointer to the buffer containing the key to use for KDF
\param inKeySz length of the input key
\param salt pointer to a buffer containing an optional salt. Use NULL
instead if not using a salt
\param saltSz length of the salt. Use 0 if not using a salt
\param info pointer to a buffer containing optional additional info.
Use NULL if not appending extra info
\param infoSz length of additional info. Use 0 if not using additional info
\param out pointer to the buffer in which to store the derived key
\param outSz space available in the output buffer to store the
generated key
_Example_
\code
byte key[] = { // initialize with key };
byte salt[] = { // initialize with salt };
byte derivedKey[MAX_DIGEST_SIZE];
int ret = wc_HKDF(SHA512, key, sizeof(key), salt, sizeof(salt),
NULL, 0, derivedKey, sizeof(derivedKey));
if ( ret != 0 ) {
// error generating derived key
}
\endcode
\sa wc_HmacSetKey
*/
WOLFSSL_API int wc_HKDF(int type, const byte* inKey, word32 inKeySz,
const byte* salt, word32 saltSz,
const byte* info, word32 infoSz,
byte* out, word32 outSz);

View File

@@ -0,0 +1,159 @@
/*!
\ingroup IDEA
\brief Generate the 52, 16-bit key sub-blocks from the 128 key.
\return 0 Success
\return BAD_FUNC_ARG Returns if idea or key is null, keySz is not equal to
IDEA_KEY_SIZE, or dir is not IDEA_ENCRYPTION or IDEA_DECRYPTION.
\param idea Pointer to Idea structure.
\param key Pointer to key in memory.
\param keySz Size of key.
\param iv Value for IV in Idea structure. Can be null.
\param dir Direction, either IDEA_ENCRYPTION or IDEA_DECRYPTION
_Example_
\code
byte v_key[IDEA_KEY_SIZE] = { }; // Some Key
Idea idea;
int ret = wc_IdeaSetKey(&idea v_key, IDEA_KEY_SIZE, NULL, IDEA_ENCRYPTION);
if (ret != 0)
{
// There was an error
}
\endcode
\sa wc_IdeaSetIV
*/
WOLFSSL_API int wc_IdeaSetKey(Idea *idea, const byte* key, word16 keySz,
const byte *iv, int dir);
/*!
\ingroup IDEA
\brief Sets the IV in an Idea key structure.
\return 0 Success
\return BAD_FUNC_ARG Returns if idea is null.
\param idea Pointer to idea key structure.
\param iv The IV value to set, can be null.
_Example_
\code
Idea idea;
// Initialize idea
byte iv[] = { }; // Some IV
int ret = wc_IdeaSetIV(&idea, iv);
if(ret != 0)
{
// Some error occured
}
\endcode
\sa wc_IdeaSetKey
*/
WOLFSSL_API int wc_IdeaSetIV(Idea *idea, const byte* iv);
/*!
\ingroup IDEA
\brief Encryption or decryption for a block (64 bits).
\return 0 upon success.
\return <0 an error occured
\param idea Pointer to idea key structure.
\param out Pointer to destination.
\param in Pointer to input data to encrypt or decrypt.
_Example_
\code
byte v_key[IDEA_KEY_SIZE] = { }; // Some Key
byte data[IDEA_BLOCK_SIZE] = { }; // Some encrypted data
Idea idea;
wc_IdeaSetKey(&idea, v_key, IDEA_KEY_SIZE, NULL, IDEA_DECRYPTION);
int ret = wc_IdeaCipher(&idea, data, data);
if (ret != 0)
{
// There was an error
}
\endcode
\sa wc_IdeaSetKey
\sa wc_IdeaSetIV
\sa wc_IdeaCbcEncrypt
\sa wc_IdeaCbcDecrypt
*/
WOLFSSL_API int wc_IdeaCipher(Idea *idea, byte* out, const byte* in);
/*!
\ingroup IDEA
\brief Encrypt data using IDEA CBC mode.
\return 0 Success
\return BAD_FUNC_ARG Returns if any arguments are null.
\param idea Pointer to Idea key structure.
\param out Pointer to destination for encryption.
\param in Pointer to input for encryption.
\param len length of input.
_Example_
\code
Idea idea;
// Initialize idea structure for encryption
const char *message = "International Data Encryption Algorithm";
byte msg_enc[40], msg_dec[40];
memset(msg_enc, 0, sizeof(msg_enc));
ret = wc_IdeaCbcEncrypt(&idea, msg_enc, (byte *)message,
(word32)strlen(message)+1);
if(ret != 0)
{
// Some error occured
}
\endcode
\sa wc_IdeaCbcDecrypt
\sa wc_IdeaCipher
\sa wc_IdeaSetKey
*/
WOLFSSL_API int wc_IdeaCbcEncrypt(Idea *idea, byte* out,
const byte* in, word32 len);
/*!
\ingroup IDEA
\brief Decrypt data using IDEA CBC mode.
\return 0 Success
\return BAD_FUNC_ARG Returns if any arguments are null.
\param idea Pointer to Idea key structure.
\param out Pointer to destination for encryption.
\param in Pointer to input for encryption.
\param len length of input.
_Example_
\code
Idea idea;
// Initialize idea structure for decryption
const char *message = "International Data Encryption Algorithm";
byte msg_enc[40], msg_dec[40];
memset(msg_dec, 0, sizeof(msg_dec));
ret = wc_IdeaCbcDecrypt(&idea, msg_dec, msg_enc,
(word32)strlen(message)+1);
if(ret != 0)
{
// Some error occured
}
\endcode
\sa wc_IdeaCbcEncrypt
\sa wc_IdeaCipher
\sa wc_IdeaSetKey
*/
WOLFSSL_API int wc_IdeaCbcDecrypt(Idea *idea, byte* out,
const byte* in, word32 len);

View File

@@ -0,0 +1,76 @@
/*!
\ingroup Logging
\brief This function registers a logging callback that will be used to
handle the wolfSSL log message. By default, if the system supports it
fprintf() to stderr is used but by using this function anything
can be done by the user.
\return Success If successful this function will return 0.
\return BAD_FUNC_ARG is the error that will be returned if a function
pointer is not provided.
\param log_function function to register as a logging callback.
Function signature must follow the above prototype.
_Example_
\code
int ret = 0;
// Logging callback prototype
void MyLoggingCallback(const int logLevel, const char* const logMessage);
// Register the custom logging callback with wolfSSL
ret = wolfSSL_SetLoggingCb(MyLoggingCallback);
if (ret != 0) {
// failed to set logging callback
}
void MyLoggingCallback(const int logLevel, const char* const logMessage)
{
// custom logging function
}
\endcode
\sa wolfSSL_Debugging_ON
\sa wolfSSL_Debugging_OFF
*/
WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
/*!
\ingroup Debug
\brief If logging has been enabled at build time this function turns on
logging at runtime. To enable logging at build time use --enable-debug
or define DEBUG_WOLFSSL.
\return 0 upon success.
\return NOT_COMPILED_IN is the error that will be returned if logging
isnt enabled for this build.
\param none No parameters.
_Example_
\code
wolfSSL_Debugging_ON();
\endcode
\sa wolfSSL_Debugging_OFF
\sa wolfSSL_SetLoggingCb
*/
WOLFSSL_API int wolfSSL_Debugging_ON(void);
/*!
\ingroup Debug
\brief This function turns off runtime logging messages. If theyre
already off, no action is taken.
\return none No returns.
\param none No parameters.
_Example_
\code
wolfSSL_Debugging_OFF();
\endcode
\sa wolfSSL_Debugging_ON
\sa wolfSSL_SetLoggingCb
*/
WOLFSSL_API void wolfSSL_Debugging_OFF(void);

View File

@@ -0,0 +1,113 @@
/*!
\ingroup MD2
\brief This function initializes md2. This is automatically
called by wc_Md2Hash.
\return 0 Returned upon successfully initializing
\param md2 pointer to the md2 structure to use for encryption
_Example_
\code
md2 md2[1];
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
\endcode
\sa wc_Md2Hash
\sa wc_Md2Update
\sa wc_Md2Final
*/
WOLFSSL_API void wc_InitMd2(Md2*);
/*!
\ingroup MD2
\brief Can be called to continually hash the provided byte
array of length len.
\return 0 Returned upon successfully adding the data to the digest.
\param md2 pointer to the md2 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
md2 md2[1];
byte data[] = { }; // Data to be hashed
word32 len = sizeof(data);
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
\endcode
\sa wc_Md2Hash
\sa wc_Md2Final
\sa wc_InitMd2
*/
WOLFSSL_API void wc_Md2Update(Md2*, const byte*, word32);
/*!
\ingroup MD2
\brief Finalizes hashing of data. Result is placed into hash.
\return 0 Returned upon successfully finalizing.
\param md2 pointer to the md2 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
md2 md2[1];
byte data[] = { }; // Data to be hashed
word32 len = sizeof(data);
if ((ret = wc_InitMd2(md2)) != 0) {
WOLFSSL_MSG("wc_Initmd2 failed");
}
else {
wc_Md2Update(md2, data, len);
wc_Md2Final(md2, hash);
}
\endcode
\sa wc_Md2Hash
\sa wc_Md2Final
\sa wc_InitMd2
*/
WOLFSSL_API void wc_Md2Final(Md2*, byte*);
/*!
\ingroup MD2
\brief Convenience function, handles all the hashing and places
the result into hash.
\return 0 Returned upon successfully hashing the data.
\return Memory_E memory error, unable to allocate memory. This is only
possible with the small stack option enabled.
\param data the data to hash
\param len the length of data
\param hash Byte array to hold hash value.
_Example_
\code
none
\endcode
\sa wc_Md2Hash
\sa wc_Md2Final
\sa wc_InitMd2
*/
WOLFSSL_API int wc_Md2Hash(const byte*, word32, byte*);

View File

@@ -0,0 +1,86 @@
/*!
\ingroup MD4
\brief This function initializes md4. This is automatically
called by wc_Md4Hash.
\return 0 Returned upon successfully initializing
\param md4 pointer to the md4 structure to use for encryption
_Example_
\code
md4 md4[1];
if ((ret = wc_InitMd4(md4)) != 0) {
WOLFSSL_MSG("wc_Initmd4 failed");
}
else {
wc_Md4Update(md4, data, len);
wc_Md4Final(md4, hash);
}
\endcode
\sa wc_Md4Hash
\sa wc_Md4Update
\sa wc_Md4Final
*/
WOLFSSL_API void wc_InitMd4(Md4*);
/*!
\ingroup MD4
\brief Can be called to continually hash the provided byte array
of length len.
\return 0 Returned upon successfully adding the data to the digest.
\param md4 pointer to the md4 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
md4 md4[1];
byte data[] = { }; // Data to be hashed
word32 len = sizeof(data);
if ((ret = wc_InitMd4(md4)) != 0) {
WOLFSSL_MSG("wc_Initmd4 failed");
}
else {
wc_Md4Update(md4, data, len);
wc_Md4Final(md4, hash);
}
\endcode
\sa wc_Md4Hash
\sa wc_Md4Final
\sa wc_InitMd4
*/
WOLFSSL_API void wc_Md4Update(Md4*, const byte*, word32);
/*!
\ingroup MD4
\brief Finalizes hashing of data. Result is placed into hash.
\return 0 Returned upon successfully finalizing.
\param md4 pointer to the md4 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
md4 md4[1];
if ((ret = wc_InitMd4(md4)) != 0) {
WOLFSSL_MSG("wc_Initmd4 failed");
}
else {
wc_Md4Update(md4, data, len);
wc_Md4Final(md4, hash);
}
\endcode
\sa wc_Md4Hash
\sa wc_Md4Final
\sa wc_InitMd4
*/
WOLFSSL_API void wc_Md4Final(Md4*, byte*);

View File

@@ -0,0 +1,176 @@
/*!
\ingroup MD5
\brief This function initializes md5. This is automatically
called by wc_Md5Hash.
\return 0 Returned upon successfully initializing.
\return BAD_FUNC_ARG Returned if the Md5 structure is passed
as a NULL value.
\param md5 pointer to the md5 structure to use for encryption
_Example_
\code
Md5 md5;
byte* hash;
if ((ret = wc_InitMd5(&md5)) != 0) {
WOLFSSL_MSG("wc_Initmd5 failed");
}
else {
ret = wc_Md5Update(&md5, data, len);
if (ret != 0) {
// Md5 Update Failure Case.
}
ret = wc_Md5Final(&md5, hash);
if (ret != 0) {
// Md5 Final Failure Case.
}
}
\endcode
\sa wc_Md5Hash
\sa wc_Md5Update
\sa wc_Md5Final
*/
WOLFSSL_API int wc_InitMd5(wc_Md5*);
/*!
\ingroup MD5
\brief Can be called to continually hash the provided byte array of
length len.
\return 0 Returned upon successfully adding the data to the digest.
\return BAD_FUNC_ARG Returned if the Md5 structure is NULL or if
data is NULL and len is greater than zero. The function should
not return an error if the data parameter is NULL and len is zero.
\param md5 pointer to the md5 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
Md5 md5;
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitMd5(&md5)) != 0) {
WOLFSSL_MSG("wc_Initmd5 failed");
}
else {
ret = wc_Md5Update(&md5, data, len);
if (ret != 0) {
// Md5 Update Error Case.
}
ret = wc_Md5Final(&md5, hash);
if (ret != 0) {
// Md5 Final Error Case.
}
}
\endcode
\sa wc_Md5Hash
\sa wc_Md5Final
\sa wc_InitMd5
*/
WOLFSSL_API int wc_Md5Update(wc_Md5*, const byte*, word32);
/*!
\ingroup MD5
\brief Finalizes hashing of data. Result is placed into hash. Md5
Struct is reset. Note: This function will also return the result
of calling IntelQaSymMd5() in the case that HAVE_INTEL_QA is defined.
\return 0 Returned upon successfully finalizing.
\return BAD_FUNC_ARG Returned if the Md5 structure or hash pointer
is passed in NULL.
\param md5 pointer to the md5 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
md5 md5[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitMd5(md5)) != 0) {
WOLFSSL_MSG("wc_Initmd5 failed");
}
else {
ret = wc_Md5Update(md5, data, len);
if (ret != 0) {
// Md5 Update Failure Case.
}
ret = wc_Md5Final(md5, hash);
if (ret != 0) {
// Md5 Final Failure Case.
}
}
\endcode
\sa wc_Md5Hash
\sa wc_InitMd5
\sa wc_Md5GetHash
*/
WOLFSSL_API int wc_Md5Final(wc_Md5*, byte*);
/*!
\ingroup MD5
\brief Resets the Md5 structure. Note: this is only supported if
you have WOLFSSL_TI_HASH defined.
\return none No returns.
\param md5 Pointer to the Md5 structure to be reset.
_Example_
\code
Md5 md5;
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitMd5(&md5)) != 0) {
WOLFSSL_MSG("wc_InitMd5 failed");
}
else {
wc_Md5Update(&md5, data, len);
wc_Md5Final(&md5, hash);
wc_Md5Free(&md5);
}
\endcode
\sa wc_InitMd5
\sa wc_Md5Update
\sa wc_Md5Final
*/
WOLFSSL_API void wc_Md5Free(wc_Md5*);
/*!
\ingroup MD5
\brief Gets hash data. Result is placed into hash. Md5 struct
is not reset.
\return none No returns
\param md5 pointer to the md5 structure to use for encryption.
\param hash Byte array to hold hash value.
_Example_
\code
md5 md5[1];
if ((ret = wc_InitMd5(md5)) != 0) {
WOLFSSL_MSG("wc_Initmd5 failed");
}
else {
wc_Md5Update(md5, data, len);
wc_Md5GetHash(md5, hash);
}
\endcode
\sa wc_Md5Hash
\sa wc_Md5Final
\sa wc_InitMd5
*/
WOLFSSL_API int wc_Md5GetHash(wc_Md5*, byte*);

View File

@@ -0,0 +1,292 @@
/*!
\ingroup Memory
\brief This function calls the custom malloc function, if one has been
defined, or simply calls the default C malloc function if no custom
function exists. It is not called directly by wolfSSL, but instead
generally called by using XMALLOC, which may be replaced by
wolfSSL_Malloc during preprocessing.
\return Success On successfully allocating the desired memory,
returns a void* to that location
\return NULL Returned when there is a failure to allocate memory
\param size size, in bytes, of the memory to allocate
_Example_
\code
int* tenInts = (int*)wolfSSL_Malloc(sizeof(int)*10);
\endcode
\sa wolfSSL_Free
\sa wolfSSL_Realloc
\sa XMALLOC
\sa XFREE
\sa XREALLOC
*/
WOLFSSL_API void* wolfSSL_Malloc(size_t size, void* heap, int type, const char* func, unsigned int line);
/*!
\ingroup Memory
\brief This function calls a custom free function, if one has been
defined, or simply calls the default C free function if no custom
function exists. It is not called directly by wolfSSL, but instead
generally called by using XFREE, which may be replaced by wolfSSL_Free
during preprocessing.
\return none No returns.
\param ptr pointer to the memory to free
_Example_
\code
int* tenInts = (int*)wolfSSL_Malloc(sizeof(int)*10);
// process data as desired
...
if(tenInts) {
wolfSSL_Free(tenInts);
}
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Realloc
\sa XMALLOC
\sa XFREE
\sa XREALLOC
*/
WOLFSSL_API void wolfSSL_Free(void *ptr, void* heap, int type, const char* func, unsigned int line);
/*!
\ingroup Memory
\brief This function calls a custom realloc function, if one has been
defined, or simply calls the default C realloc function if no custom
function exists. It is not called directly by wolfSSL, but instead
generally called by using XREALLOC, which may be replaced by
wolfSSL_Realloc during preprocessing.
\return Success On successfully reallocating the desired memory,
returns a void* to that location
\return NULL Returned when there is a failure to reallocate memory
\param ptr pointer to the memory to the memory to reallocate
\param size desired size after reallocation
_Example_
\code
int* tenInts = (int*)wolfSSL_Malloc(sizeof(int)*10);
int* twentyInts = (int*)realloc(tenInts, sizeof(tenInts)*2);
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Free
\sa XMALLOC
\sa XFREE
\sa XREALLOC
*/
WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size, void* heap, int type, const char* func, unsigned int line);
/*!
\ingroup Memory
\brief This function is similar to malloc(), but calls the memory
allocation function which wolfSSL has been configured to use. By default,
wolfSSL uses malloc(). This can be changed using the wolfSSL memory
abstraction layer - see wolfSSL_SetAllocators().
\return pointer If successful, this function returns a pointer to
allocated memory.
\return error If there is an error, NULL will be returned.
\return other Specific return values may be dependent on the underlying
memory allocation function being used (if not using the default malloc()).
\param size number of bytes to allocate.
_Example_
\code
char* buffer;
buffer = (char*) wolfSSL_Malloc(20);
if (buffer == NULL) {
// failed to allocate memory
}
\endcode
\sa wolfSSL_Free
\sa wolfSSL_Realloc
\sa wolfSSL_SetAllocators
*/
WOLFSSL_API void* wolfSSL_Malloc(size_t size, void* heap, int type);
/*!
\ingroup Memory
\brief This function is similar to realloc(), but calls the memory
re-allocation function which wolfSSL has been configured to use.
By default, wolfSSL uses realloc(). This can be changed using the
wolfSSL memory abstraction layer - see wolfSSL_SetAllocators().
\return pointer If successful, this function returns a pointer to
re-allocated memory. This may be the same pointer as ptr, or a
new pointer location.
\return Null If there is an error, NULL will be returned.
\return other Specific return values may be dependent on the
underlying memory re-allocation function being used
(if not using the default realloc()).
\param ptr pointer to the previously-allocated memory, to be reallocated.
\param size number of bytes to allocate.
_Example_
\code
char* buffer;
buffer = (char*) wolfSSL_Realloc(30);
if (buffer == NULL) {
// failed to re-allocate memory
}
\endcode
\sa wolfSSL_Free
\sa wolfSSL_Malloc
\sa wolfSSL_SetAllocators
*/
WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size, void* heap, int type);
/*!
\ingroup Memory
\brief This function is similar to free(), but calls the memory free
function which wolfSSL has been configured to use. By default, wolfSSL
uses free(). This can be changed using the wolfSSL memory abstraction
layer - see wolfSSL_SetAllocators().
\return none No returns.
\param ptr pointer to the memory to be freed.
_Example_
\code
char* buffer;
...
wolfSSL_Free(buffer);
\endcode
\sa wolfSSL_Alloc
\sa wolfSSL_Realloc
\sa wolfSSL_SetAllocators
*/
WOLFSSL_API void wolfSSL_Free(void *ptr, const char* func, unsigned int line);
/*!
\ingroup Memory
\brief This function registers the allocation functions used by wolfSSL.
By default, if the system supports it, malloc/free and realloc are used.
Using this function allows the user at runtime to install their own
memory handlers.
\return Success If successful this function will return 0.
\return BAD_FUNC_ARG is the error that will be returned if a
function pointer is not provided.
\param malloc_function memory allocation function for wolfSSL to use.
Function signature must match wolfSSL_Malloc_cb prototype, above.
\param free_function memory free function for wolfSSL to use. Function
signature must match wolfSSL_Free_cb prototype, above.
\param realloc_function memory re-allocation function for wolfSSL to use.
Function signature must match wolfSSL_Realloc_cb prototype, above.
_Example_
\code
int ret = 0;
// Memory function prototypes
void* MyMalloc(size_t size);
void MyFree(void* ptr);
void* MyRealloc(void* ptr, size_t size);
// Register custom memory functions with wolfSSL
ret = wolfSSL_SetAllocators(MyMalloc, MyFree, MyRealloc);
if (ret != 0) {
// failed to set memory functions
}
void* MyMalloc(size_t size)
{
// custom malloc function
}
void MyFree(void* ptr)
{
// custom free function
}
void* MyRealloc(void* ptr, size_t size)
{
// custom realloc function
}
\endcode
\sa none
*/
WOLFSSL_API int wolfSSL_SetAllocators(wolfSSL_Malloc_cb,
wolfSSL_Free_cb,
wolfSSL_Realloc_cb);
/*!
\ingroup Memory
\brief This function is available when static memory feature is used
(--enable-staticmemory). It gives the optimum buffer size for memory
“buckets”. This allows for a way to compute buffer size so that no
extra unused memory is left at the end after it has been partitioned.
The returned value, if positive, is the computed buffer size to use.
\return Success On successfully completing buffer size calculations a
positive value is returned. This returned value is for optimum buffer size.
\return Failure All negative values are considered to be error cases.
\param buffer pointer to buffer
\param size size of buffer
\param type desired type of memory ie WOLFMEM_GENERAL or WOLFMEM_IO_POOL
_Example_
\code
byte buffer[1000];
word32 size = sizeof(buffer);
int optimum;
optimum = wolfSSL_StaticBufferSz(buffer, size, WOLFMEM_GENERAL);
if (optimum < 0) { //handle error case }
printf(“The optimum buffer size to make use of all memory is %d\n”,
optimum);
...
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Free
*/
WOLFSSL_API int wolfSSL_StaticBufferSz(byte* buffer, word32 sz, int flag);
/*!
\ingroup Memory
\brief This function is available when static memory feature is used
(--enable-staticmemory). It gives the size of padding needed for each
partition of memory. This padding size will be the size needed to
contain a memory management structure along with any extra for
memory alignment.
\return On successfully memory padding calculation the return value will
be a positive value
\return All negative values are considered error cases.
\param none No parameters.
_Example_
\code
int padding;
padding = wolfSSL_MemoryPaddingSz();
if (padding < 0) { //handle error case }
printf(“The padding size needed for each \”bucket\” of memory is %d\n”,
padding);
// calculation of buffer for IO POOL size is number of buckets
// times (padding + WOLFMEM_IO_SZ)
...
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Free
*/
WOLFSSL_API int wolfSSL_MemoryPaddingSz(void);

View File

@@ -0,0 +1,34 @@
/*!
\ingroup openSSL
\brief This function writes a key into a WOLFSSL_BIO structure
in PEM format.
\return SSL_SUCCESS upon success.
\return SSL_FAILURE upon failure.
\param bio WOLFSSL_BIO structure to get PEM buffer from.
\param key key to convert to PEM format.
\param cipher EVP cipher structure.
\param passwd password.
\param len length of password.
\param cb password callback.
\param arg optional argument.
_Example_
\code
WOLFSSL_BIO* bio;
WOLFSSL_EVP_PKEY* key;
int ret;
// create bio and setup key
ret = wolfSSL_PEM_write_bio_PrivateKey(bio, key, NULL, NULL, 0, NULL, NULL);
//check ret value
\endcode
\sa wolfSSL_PEM_read_bio_X509_AUX
*/
WOLFSSL_API
int wolfSSL_PEM_write_bio_PrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY* key,
const WOLFSSL_EVP_CIPHER* cipher,
unsigned char* passwd, int len,
pem_password_cb* cb, void* arg);

View File

@@ -0,0 +1,402 @@
/*!
\ingroup PKCS7
\brief This function initializes a PKCS7 structure with a DER-formatted
certificate. To initialize an empty PKCS7 structure, one can pass in a NULL
cert and 0 for certSz.
\return 0 Returned on successfully initializing the PKCS7 structure
\return MEMORY_E Returned if there is an error allocating memory
with XMALLOC
\return ASN_PARSE_E Returned if there is an error parsing the cert header
\return ASN_OBJECT_ID_E Returned if there is an error parsing the
encryption type from the cert
\return ASN_EXPECT_0_E Returned if there is a formatting error in the
encryption specification of the cert file
\return ASN_BEFORE_DATE_E Returned if the date is before the certificate
start date
\return ASN_AFTER_DATE_E Returned if the date is after the certificate
expiration date
\return ASN_BITSTR_E Returned if there is an error parsing a bit string
from the certificate
\return ASN_NTRU_KEY_E Returned if there is an error parsing the NTRU
key from the certificate
\return ECC_CURVE_OID_E Returned if there is an error parsing the ECC
key from the certificate
\return ASN_UNKNOWN_OID_E Returned if the certificate is using an unknown
key object id
\return ASN_VERSION_E Returned if the ALLOW_V1_EXTENSIONS option is not
defined and the certificate is a V1 or V2 certificate
\return BAD_FUNC_ARG Returned if there is an error processing the
certificate extension
\return ASN_CRIT_EXT_E Returned if an unfamiliar critical extension is
encountered in processing the certificate
\return ASN_SIG_OID_E Returned if the signature encryption type is not
the same as the encryption type of the certificate in the provided file
\return ASN_SIG_CONFIRM_E Returned if confirming the certification
signature fails
\return ASN_NAME_INVALID_E Returned if the certificates name is not
permitted by the CA name constraints
\return ASN_NO_SIGNER_E Returned if there is no CA signer to verify
the certificates authenticity
\param pkcs7 pointer to the PKCS7 structure in which to
store the decoded cert
\param cert pointer to a buffer containing a DER formatted ASN.1
certificate with which to initialize the PKCS7 structure
\param certSz size of the certificate buffer
_Example_
\code
PKCS7 pkcs7;
byte derBuff[] = { }; // initialize with DER-encoded certificate
if ( wc_PKCS7_InitWithCert(&pkcs7, derBuff, sizeof(derBuff)) != 0 ) {
// error parsing certificate into pkcs7 format
}
\endcode
\sa wc_PKCS7_Free
*/
WOLFSSL_API int wc_PKCS7_InitWithCert(PKCS7* pkcs7, byte* cert, word32 certSz);
/*!
\ingroup PKCS7
\brief This function releases any memory allocated by a PKCS7 initializer.
\return none No returns.
\param pkcs7 pointer to the PKCS7 structure to free
_Example_
\code
PKCS7 pkcs7;
// initialize and use PKCS7 object
wc_PKCS7_Free(pkcs7);
\endcode
\sa wc_PKCS7_InitWithCert
*/
WOLFSSL_API void wc_PKCS7_Free(PKCS7* pkcs7);
/*!
\ingroup PKCS7
\brief This function builds the PKCS7 data content type, encoding the
PKCS7 structure into a buffer containing a parsable PKCS7 data packet.
\return Success On successfully encoding the PKCS7 data into the buffer,
returns the index parsed up to in the PKCS7 structure. This index also
corresponds to the bytes written to the output buffer.
\return BUFFER_E Returned if the given buffer is not large enough to hold
the encoded certificate
\param pkcs7 pointer to the PKCS7 structure to encode
\param output pointer to the buffer in which to store the encoded
certificate
\param outputSz size available in the output buffer
_Example_
\code
PKCS7 pkcs7;
int ret;
byte derBuff[] = { }; // initialize with DER-encoded certificate
byte pkcs7Buff[FOURK_BUF];
wc_PKCS7_InitWithCert(&pkcs7, derBuff, sizeof(derBuff));
// update message and data to encode
pkcs7.privateKey = key;
pkcs7.privateKeySz = keySz;
pkcs7.content = data;
pkcs7.contentSz = dataSz;
... etc.
ret = wc_PKCS7_EncodeData(&pkcs7, pkcs7Buff, sizeof(pkcs7Buff));
if ( ret != 0 ) {
// error encoding into output buffer
}
\endcode
\sa wc_PKCS7_InitWithCert
*/
WOLFSSL_API int wc_PKCS7_EncodeData(PKCS7* pkcs7, byte* output,
word32 outputSz);
/*!
\ingroup PKCS7
\brief This function builds the PKCS7 signed data content type, encoding
the PKCS7 structure into a buffer containing a parsable PKCS7
signed data packet.
\return Success On successfully encoding the PKCS7 data into the buffer,
returns the index parsed up to in the PKCS7 structure. This index also
corresponds to the bytes written to the output buffer.
\return BAD_FUNC_ARG Returned if the PKCS7 structure is missing one or
more required elements to generate a signed data packet
\return MEMORY_E Returned if there is an error allocating memory
\return PUBLIC_KEY_E Returned if there is an error parsing the public key
\return RSA_BUFFER_E Returned if buffer error, output too small or input
too large
\return BUFFER_E Returned if the given buffer is not large enough to hold
the encoded certificate
\return MP_INIT_E may be returned if there is an error generating
the signature
\return MP_READ_E may be returned if there is an error generating
the signature
\return MP_CMP_E may be returned if there is an error generating
the signature
\return MP_INVMOD_E may be returned if there is an error generating
the signature
\return MP_EXPTMOD_E may be returned if there is an error generating
the signature
\return MP_MOD_E may be returned if there is an error generating
the signature
\return MP_MUL_E may be returned if there is an error generating
the signature
\return MP_ADD_E may be returned if there is an error generating
the signature
\return MP_MULMOD_E may be returned if there is an error generating
the signature
\return MP_TO_E may be returned if there is an error generating
the signature
\return MP_MEM may be returned if there is an error generating the signature
\param pkcs7 pointer to the PKCS7 structure to encode
\param output pointer to the buffer in which to store the
encoded certificate
\param outputSz size available in the output buffer
_Example_
\code
PKCS7 pkcs7;
int ret;
byte derBuff[] = { }; // initialize with DER-encoded certificate
byte pkcs7Buff[FOURK_BUF];
wc_PKCS7_InitWithCert(&pkcs7, derBuff, sizeof(derBuff));
// update message and data to encode
pkcs7.privateKey = key;
pkcs7.privateKeySz = keySz;
pkcs7.content = data;
pkcs7.contentSz = dataSz;
... etc.
ret = wc_PKCS7_EncodeSignedData(&pkcs7, pkcs7Buff, sizeof(pkcs7Buff));
if ( ret != 0 ) {
// error encoding into output buffer
}
\endcode
\sa wc_PKCS7_InitWithCert
\sa wc_PKCS7_VerifySignedData
*/
WOLFSSL_API int wc_PKCS7_EncodeSignedData(PKCS7* pkcs7,
byte* output, word32 outputSz);
/*!
\ingroup PKCS7
\brief This function takes in a transmitted PKCS7 signed data message,
extracts the certificate list and certificate revocation list, and then
verifies the signature. It stores the extracted content in the given
PKCS7 structure.
\return 0 Returned on successfully extracting the information
from the message
\return BAD_FUNC_ARG Returned if one of the input parameters is invalid
\return ASN_PARSE_E Returned if there is an error parsing from the
given pkiMsg
\return PKCS7_OID_E Returned if the given pkiMsg is not a signed data type
\return ASN_VERSION_E Returned if the PKCS7 signer info is not version 1
\return MEMORY_E Returned if there is an error allocating memory
\return PUBLIC_KEY_E Returned if there is an error parsing the public key
\return RSA_BUFFER_E Returned if buffer error, output too small or
input too large
\return BUFFER_E Returned if the given buffer is not large enough to
hold the encoded certificate
\return MP_INIT_E may be returned if there is an error generating
the signature
\return MP_READ_E may be returned if there is an error generating
the signature
\return MP_CMP_E may be returned if there is an error generating
the signature
\return MP_INVMOD_E may be returned if there is an error generating
the signature
\return MP_EXPTMOD_E may be returned if there is an error generating
the signature
\return MP_MOD_E may be returned if there is an error generating
the signature
\return MP_MUL_E may be returned if there is an error generating
the signature
\return MP_ADD_E may be returned if there is an error generating
the signature
\return MP_MULMOD_E may be returned if there is an error generating
the signature
\return MP_TO_E may be returned if there is an error generating
the signature
\return MP_MEM may be returned if there is an error generating the signature
\param pkcs7 pointer to the PKCS7 structure in which to store the parsed
certificates
\param pkiMsg pointer to the buffer containing the signed message to verify
and decode
\param pkiMsgSz size of the signed message
_Example_
\code
PKCS7 pkcs7;
int ret;
byte derBuff[] = { }; // initialize with DER-encoded certificate
byte pkcs7Buff[FOURK_BUF];
wc_PKCS7_InitWithCert(&pkcs7, derBuff, sizeof(derBuff));
// update message and data to encode
pkcs7.privateKey = key;
pkcs7.privateKeySz = keySz;
pkcs7.content = data;
pkcs7.contentSz = dataSz;
... etc.
ret = wc_PKCS7_EncodeSignedData(&pkcs7, pkcs7Buff, sizeof(pkcs7Buff));
if ( ret != 0 ) {
// error encoding into output buffer
}
\endcode
\sa wc_PKCS7_InitWithCert
\sa wc_PKCS7_EncodeSignedData
*/
WOLFSSL_API int wc_PKCS7_VerifySignedData(PKCS7* pkcs7,
byte* pkiMsg, word32 pkiMsgSz);
/*!
\ingroup PKCS7
\brief This function builds the PKCS7 enveloped data content type, encoding
the PKCS7 structure into a buffer containing a parsable PKCS7 enveloped
data packet.
\return Success Returned on successfully encoding the message in enveloped
data format, returns the size written to the output buffer
\return BAD_FUNC_ARG: Returned if one of the input parameters is invalid,
or if the PKCS7 structure is missing required elements
\return ALGO_ID_E Returned if the PKCS7 structure is using an unsupported
algorithm type. Currently, only DESb and DES3b are supported
\return BUFFER_E Returned if the given output buffer is too small to store
the output data
\return MEMORY_E Returned if there is an error allocating memory
\return RNG_FAILURE_E Returned if there is an error initializing the random
number generator for encryption
\return DRBG_FAILED Returned if there is an error generating numbers with
the random number generator used for encryption
\param pkcs7 pointer to the PKCS7 structure to encode
\param output pointer to the buffer in which to store the encoded
certificate
\param outputSz size available in the output buffer
_Example_
\code
PKCS7 pkcs7;
int ret;
byte derBuff[] = { }; // initialize with DER-encoded certificate
byte pkcs7Buff[FOURK_BUF];
wc_PKCS7_InitWithCert(&pkcs7, derBuff, sizeof(derBuff));
// update message and data to encode
pkcs7.privateKey = key;
pkcs7.privateKeySz = keySz;
pkcs7.content = data;
pkcs7.contentSz = dataSz;
... etc.
ret = wc_PKCS7_EncodeEnvelopedData(&pkcs7, pkcs7Buff, sizeof(pkcs7Buff));
if ( ret != 0 ) {
// error encoding into output buffer
}
\endcode
\sa wc_PKCS7_InitWithCert
\sa wc_PKCS7_DecodeEnvelopedData
*/
WOLFSSL_API int wc_PKCS7_EncodeEnvelopedData(PKCS7* pkcs7,
byte* output, word32 outputSz);
/*!
\ingroup PKCS7
\brief This function unwraps and decrypts a PKCS7 enveloped data content
type, decoding the message into output. It uses the private key of the
PKCS7 object passed in to decrypt the message.
\return On successfully extracting the information from the message,
returns the bytes written to output
\return BAD_FUNC_ARG Returned if one of the input parameters is invalid
\return ASN_PARSE_E Returned if there is an error parsing from the
given pkiMsg
\return PKCS7_OID_E Returned if the given pkiMsg is not an enveloped
data type
\return ASN_VERSION_E Returned if the PKCS7 signer info is not version 0
\return MEMORY_E Returned if there is an error allocating memory
\return ALGO_ID_E Returned if the PKCS7 structure is using an unsupported
algorithm type. Currently, only DESb and DES3b are supported for
encryption, with RSAk for signature generation
\return PKCS7_RECIP_E Returned if there is no recipient found in the
enveloped data that matches the recipient provided
\return RSA_BUFFER_E Returned if there is an error during RSA signature
verification due to buffer error, output too small or input too large.
\return MP_INIT_E may be returned if there is an error during signature
verification
\return MP_READ_E may be returned if there is an error during signature
verification
\return MP_CMP_E may be returned if there is an error during signature
verification
\return MP_INVMOD_E may be returned if there is an error during signature
verification
\return MP_EXPTMOD_E may be returned if there is an error during signature
verification
\return MP_MOD_E may be returned if there is an error during signature
verification
\return MP_MUL_E may be returned if there is an error during signature
verification
\return MP_ADD_E may be returned if there is an error during signature
verification
\return MP_MULMOD_E may be returned if there is an error during signature
verification
\return MP_TO_E may be returned if there is an error during signature
verification
\return MP_MEM may be returned if there is an error during signature
verification
\param pkcs7 pointer to the PKCS7 structure containing the private key with
which to decode the enveloped data package
\param pkiMsg pointer to the buffer containing the enveloped data package
\param pkiMsgSz size of the enveloped data package
\param output pointer to the buffer in which to store the decoded message
\param outputSz size available in the output buffer
_Example_
\code
PKCS7 pkcs7;
byte received[] = { }; // initialize with received enveloped message
byte decoded[FOURK_BUF];
int decodedSz;
// initialize pkcs7 with certificate
// update key
pkcs7.privateKey = key;
pkcs7.privateKeySz = keySz;
decodedSz = wc_PKCS7_DecodeEnvelopedData(&pkcs7, received,
sizeof(received),decoded, sizeof(decoded));
if ( decodedSz != 0 ) {
// error decoding message
}
\endcode
\sa wc_PKCS7_InitWithCert
\sa wc_PKCS7_EncodeEnvelopedData
*/
WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* pkiMsg,
word32 pkiMsgSz, byte* output,
word32 outputSz);

View File

@@ -0,0 +1,136 @@
/*!
\ingroup Poly1305
\brief This function sets the key for a Poly1305 context structure,
initializing it for hashing. Note: A new key should be set after
generating a message hash with wc_Poly1305Final to ensure security.
\return 0 Returned on successfully setting the key and initializing
the Poly1305 structure
\return BAD_FUNC_ARG Returned if the given key is not 32 bytes long,
or the Poly1305 context is NULL
\param ctx pointer to a Poly1305 structure to initialize
\param key pointer to the buffer containing the key to use for hashing
\param keySz size of the key in the buffer. Should be 32 bytes
_Example_
\code
Poly1305 enc;
byte key[] = { initialize with 32 byte key to use for hashing };
wc_Poly1305SetKey(&enc, key, sizeof(key));
\endcode
\sa wc_Poly1305Update
\sa wc_Poly1305Final
*/
WOLFSSL_API int wc_Poly1305SetKey(Poly1305* poly1305, const byte* key,
word32 kySz);
/*!
\ingroup Poly1305
\brief This function updates the message to hash with the
Poly1305 structure.
\return 0 Returned on successfully updating the message to hash
\return BAD_FUNC_ARG Returned if the Poly1305 structure is NULL
\param ctx pointer to a Poly1305 structure for which to update
the message to hash
\param m pointer to the buffer containing the message which should
be added to the hash
\param bytes size of the message to hash
_Example_
\code
Poly1305 enc;
byte key[] = { }; // initialize with 32 byte key to use for encryption
byte msg[] = { }; // initialize with message to hash
wc_Poly1305SetKey(&enc, key, sizeof(key));
if( wc_Poly1305Update(key, msg, sizeof(msg)) != 0 ) {
// error updating message to hash
}
\endcode
\sa wc_Poly1305SetKey
\sa wc_Poly1305Final
*/
WOLFSSL_API int wc_Poly1305Update(Poly1305* poly1305, const byte*, word32);
/*!
\ingroup Poly1305
\brief This function calculates the hash of the input messages
and stores the result in mac. After this is called, the key
should be reset.
\return 0 Returned on successfully computing the final MAC
\return BAD_FUNC_ARG Returned if the Poly1305 structure is NULL
\param ctx pointer to a Poly1305 structure with which to generate the MAC
\param mac pointer to the buffer in which to store the MAC.
Should be POLY1305_DIGEST_SIZE (16 bytes) wide
_Example_
\code
Poly1305 enc;
byte mac[POLY1305_DIGEST_SIZE]; // space for a 16 byte mac
byte key[] = { }; // initialize with 32 byte key to use for encryption
byte msg[] = { }; // initialize with message to hash
wc_Poly1305SetKey(&enc, key, sizeof(key));
wc_Poly1305Update(key, msg, sizeof(msg));
if ( wc_Poly1305Final(&enc, mac) != 0 ) {
// error computing final MAC
}
\endcode
\sa wc_Poly1305SetKey
\sa wc_Poly1305Update
*/
WOLFSSL_API int wc_Poly1305Final(Poly1305* poly1305, byte* tag);
/*!
\ingroup Poly1305
\brief Takes in an initialized Poly1305 struct that has a key
loaded and creates a MAC (tag) using recent TLS AEAD padding scheme.
\return 0 Success
\return BAD_FUNC_ARG Returned if ctx, input, or tag is null or if
additional is null and addSz is greater than 0 or if tagSz is less
than WC_POLY1305_MAC_SZ.
\param ctx Initialized Poly1305 struct to use
\param additional Additional data to use
\param addSz Size of additional buffer
\param input Input buffer to create tag from
\param sz Size of input buffer
\param tag Buffer to hold created tag
\param tagSz Size of input tag buffer (must be at least
WC_POLY1305_MAC_SZ(16))
_Example_
\code
Poly1305 ctx;
byte key[] = { }; // initialize with 32 byte key to use for hashing
byte additional[] = { }; // initialize with additional data
byte msg[] = { }; // initialize with message
byte tag[16];
wc_Poly1305SetKey(&ctx, key, sizeof(key));
if(wc_Poly1305_MAC(&ctx, additional, sizeof(additional), (byte*)msg,
sizeof(msg), tag, sizeof(tag)) != 0)
{
// Handle the error
}
\endcode
\sa wc_Poly1305SetKey
\sa wc_Poly1305Update
\sa wcPoly1305Final
*/
WOLFSSL_API int wc_Poly1305_MAC(Poly1305* ctx, byte* additional, word32 addSz,
byte* input, word32 sz, byte* tag, word32 tagSz);

View File

@@ -0,0 +1,164 @@
/*!
\ingroup Password
\brief This function implements the Password Based Key Derivation
Function 1 (PBKDF1), converting an input password with a concatenated salt
into a more secure key, which it stores in output. It allows the user to
select between SHA and MD5 as hash functions.
\return 0 Returned on successfully deriving a key from the input password
\return BAD_FUNC_ARG Returned if there is an invalid hash type given
(valid type are: MD5 and SHA), iterations is less than 1, or the key
length (kLen) requested is greater than the hash length of the provided hash
\return MEMORY_E Returned if there is an error allocating memory for a
SHA or MD5 object
\param output pointer to the buffer in which to store the generated key.
Should be at least kLen long
\param passwd pointer to the buffer containing the password to use for
the key derivation
\param pLen length of the password to use for key derivation
\param salt pointer to the buffer containing the salt to use for
key derivation
\param sLen length of the salt
\param iterations number of times to process the hash
\param kLen desired length of the derived key. Should not be longer
than the digest size of the hash chosen
\param hashType the hashing algorithm to use. Valid choices are MD5 and SHA
_Example_
\code
int ret;
byte key[MD5_DIGEST_SIZE];
byte pass[] = { }; // initialize with password
byte salt[] = { }; // initialize with salt
ret = wc_PBKDF1(key, pass, sizeof(pass), salt, sizeof(salt), 1000,
sizeof(key), MD5);
if ( ret != 0 ) {
// error deriving key from password
}
\endcode
\sa wc_PBKDF2
\sa wc_PKCS12_PBKDF
*/
WOLFSSL_API int wc_PBKDF1(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen,
int typeH);
/*!
\ingroup Password
\brief This function implements the Password Based Key Derivation
Function 2 (PBKDF2), converting an input password with a concatenated
salt into a more secure key, which it stores in output. It allows the user
to select any of the supported HMAC hash functions, including: MD5, SHA,
SHA256, SHA384, SHA512, and BLAKE2B
\return 0 Returned on successfully deriving a key from the input password
\return BAD_FUNC_ARG Returned if there is an invalid hash type given or
iterations is less than 1
\return MEMORY_E Returned if there is an allocating memory for
the HMAC object
\param output pointer to the buffer in which to store the generated key.
Should be kLen long
\param passwd pointer to the buffer containing the password to use for
the key derivation
\param pLen length of the password to use for key derivation
\param salt pointer to the buffer containing the salt to use for
key derivation
\param sLen length of the salt
\param iterations number of times to process the hash
\param kLen desired length of the derived key
\param hashType the hashing algorithm to use. Valid choices are: MD5,
SHA, SHA256, SHA384, SHA512, and BLAKE2B
_Example_
\code
int ret;
byte key[64];
byte pass[] = { }; // initialize with password
byte salt[] = { }; // initialize with salt
ret = wc_PBKDF2(key, pass, sizeof(pass), salt, sizeof(salt), 2048, sizeof(key),
SHA512);
if ( ret != 0 ) {
// error deriving key from password
}
\endcode
\sa wc_PBKDF1
\sa wc_PKCS12_PBKDF
*/
WOLFSSL_API int wc_PBKDF2(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations, int kLen,
int typeH);
/*!
\ingroup Password
\brief This function implements the Password Based Key Derivation Function
(PBKDF) described in RFC 7292 Appendix B. This function converts an input
password with a concatenated salt into a more secure key, which it stores
in output. It allows the user to select any of the supported HMAC hash
functions, including: MD5, SHA, SHA256, SHA384, SHA512, and BLAKE2B.
\return 0 Returned on successfully deriving a key from the input password
\return BAD_FUNC_ARG Returned if there is an invalid hash type given,
iterations is less than 1, or the key length (kLen) requested is greater
than the hash length of the provided hash
\return MEMORY_E Returned if there is an allocating memory
\return MP_INIT_E may be returned if there is an error during key generation
\return MP_READ_E may be returned if there is an error during key generation
\return MP_CMP_E may be returned if there is an error during key generation
\return MP_INVMOD_E may be returned if there is an error during
key generation
\return MP_EXPTMOD_E may be returned if there is an error during
key generation
\return MP_MOD_E may be returned if there is an error during key generation
\return MP_MUL_E may be returned if there is an error during key generation
\return MP_ADD_E may be returned if there is an error during key generation
\return MP_MULMOD_E may be returned if there is an error during
key generation
\return MP_TO_E may be returned if there is an error during key generation
\return MP_MEM may be returned if there is an error during key generation
\param output pointer to the buffer in which to store the generated key.
Should be kLen long
\param passwd pointer to the buffer containing the password to use for
the key derivation
\param pLen length of the password to use for key derivation
\param salt pointer to the buffer containing the salt to use
for key derivation
\param sLen length of the salt
\param iterations number of times to process the hash
\param kLen desired length of the derived key
\param hashType the hashing algorithm to use. Valid choices are: MD5,
SHA, SHA256, SHA384, SHA512, and BLAKE2B
\param id this is a byte indetifier indicating the purpose of key
generation. It is used to diversify the key output, and should be
assigned as follows: ID=1: pseudorandom bits are to be used as key
material for performing encryption or decryption. ID=2: pseudorandom
bits are to be used an IV (Initial Value) for encryption or decryption.
ID=3: pseudorandom bits are to be used as an integrity key for MACing.
_Example_
\code
int ret;
byte key[64];
byte pass[] = { }; // initialize with password
byte salt[] = { }; // initialize with salt
ret = wc_PKCS512_PBKDF(key, pass, sizeof(pass), salt, sizeof(salt), 2048,
sizeof(key), SHA512, 1);
if ( ret != 0 ) {
// error deriving key from password
}
\endcode
\sa wc_PBKDF1
\sa wc_PBKDF2
*/
WOLFSSL_API int wc_PKCS12_PBKDF(byte* output, const byte* passwd, int pLen,
const byte* salt, int sLen, int iterations,
int kLen, int typeH, int purpose);

View File

@@ -0,0 +1,65 @@
/*!
\ingroup Rabbit
\brief This function encrypts or decrypts a message of any size, storing
the result in output. It requires that the Rabbit ctx structure be
initialized with a key and an iv before encryption.
\return 0 Returned on successfully encrypting/decrypting input
\return BAD_ALIGN_E Returned if the input message is not 4-byte aligned
but is required to be by XSTREAM_ALIGN, but NO_WOLFSSL_ALLOC_ALIGN is
defined
\return MEMORY_E Returned if there is an error allocating memory to
align the message, if NO_WOLFSSL_ALLOC_ALIGN is not defined
\param ctx pointer to the Rabbit structure to use for encryption/decryption
\param output pointer to the buffer in which to store the processed
message. Should be at least msglen long
\param input pointer to the buffer containing the message to process
\param msglen the length of the message to process
_Example_
\code
int ret;
Rabbit enc;
byte key[] = { }; // initialize with 16 byte key
byte iv[] = { }; // initialize with 8 byte iv
wc_RabbitSetKey(&enc, key, iv);
byte message[] = { }; // initialize with plaintext message
byte ciphertext[sizeof(message)];
wc_RabbitProcess(enc, ciphertext, message, sizeof(message));
\endcode
\sa wc_RabbitSetKey
*/
WOLFSSL_API int wc_RabbitProcess(Rabbit*, byte*, const byte*, word32);
/*!
\ingroup Rabbit
\brief This function initializes a Rabbit context for use with
encryption or decryption by setting its iv and key.
\return 0 Returned on successfully setting the key and iv
\param ctx pointer to the Rabbit structure to initialize
\param key pointer to the buffer containing the 16 byte key to
use for encryption/decryption
\param iv pointer to the buffer containing the 8 byte iv with
which to initialize the Rabbit structure
_Example_
\code
int ret;
Rabbit enc;
byte key[] = { }; // initialize with 16 byte key
byte iv[] = { }; // initialize with 8 byte iv
wc_RabbitSetKey(&enc, key, iv)
\endcode
\sa wc_RabbitProcess
*/
WOLFSSL_API int wc_RabbitSetKey(Rabbit*, const byte* key, const byte* iv);

View File

@@ -0,0 +1,260 @@
/*!
\ingroup Random
\brief Init global Whitewood netRandom context
\return 0 Success
\return BAD_FUNC_ARG Either configFile is null or timeout is negative.
\return RNG_FAILURE_E There was a failure initializing the rng.
\param configFile Path to configuration file
\param hmac_cb Optional to create HMAC callback.
\param timeout A timeout duration.
_Example_
\code
char* config = "path/to/config/example.conf";
int time = // Some sufficient timeout value;
if (wc_InitNetRandom(config, NULL, time) != 0)
{
// Some error occured
}
\endcode
\sa wc_FreeNetRandom
*/
WOLFSSL_API int wc_InitNetRandom(const char*, wnr_hmac_key, int);
/*!
\ingroup Random
\brief Free global Whitewood netRandom context.
\return 0 Success
\return BAD_MUTEX_E Error locking mutex on wnr_mutex
\param none No returns.
_Example_
\code
int ret = wc_FreeNetRandom();
if(ret != 0)
{
// Handle the error
}
\endcode
\sa wc_InitNetRandom
*/
WOLFSSL_API int wc_FreeNetRandom(void);
/*!
\ingroup Random
\brief Gets the seed (from OS) and key cipher for rng. rng->drbg
(deterministic random bit generator) allocated (should be deallocated
with wc_FreeRng). This is a blocking operation.
\return 0 on success.
\return MEMORY_E XMALLOC failed
\return WINCRYPT_E wc_GenerateSeed: failed to acquire context
\return CRYPTGEN_E wc_GenerateSeed: failed to get random
\return BAD_FUNC_ARG wc_RNG_GenerateBlock input is null or sz exceeds
MAX_REQUEST_LEN
\return DRBG_CONT_FIPS_E wc_RNG_GenerateBlock: Hash_gen returned
DRBG_CONT_FAILURE
\return RNG_FAILURE_E wc_RNG_GenerateBlock: Default error. rngs
status originally not ok, or set to DRBG_FAILED
\param rng random number generator to be initialized for use
with a seed and key cipher
_Example_
\code
RNG rng;
int ret;
#ifdef HAVE_CAVIUM
ret = wc_InitRngCavium(&rng, CAVIUM_DEV_ID);
if (ret != 0){
printf(“RNG Nitrox init for device: %d failed”, CAVIUM_DEV_ID);
return -1;
}
#endif
ret = wc_InitRng(&rng);
if (ret != 0){
printf(“RNG init failed”);
return -1;
}
\endcode
\sa wc_InitRngCavium
\sa wc_RNG_GenerateBlock
\sa wc_RNG_GenerateByte
\sa wc_FreeRng
\sa wc_RNG_HealthTest
*/
WOLFSSL_API int wc_InitRng(WC_RNG*);
/*!
\ingroup Random
\brief Copies a sz bytes of pseudorandom data to output. Will
reseed rng if needed (blocking).
\return 0 on success
\return BAD_FUNC_ARG an input is null or sz exceeds MAX_REQUEST_LEN
\return DRBG_CONT_FIPS_E Hash_gen returned DRBG_CONT_FAILURE
\return RNG_FAILURE_E Default error. rngs status originally not
ok, or set to DRBG_FAILED
\param rng random number generator initialized with wc_InitRng
\param output buffer to which the block is copied
\param sz size of output in bytes
_Example_
\code
RNG rng;
int sz = 32;
byte block[sz];
int ret = wc_InitRng(&rng);
if (ret != 0) {
return -1; //init of rng failed!
}
ret = wc_RNG_GenerateBlock(&rng, block, sz);
if (ret != 0) {
return -1; //generating block failed!
}
\endcode
\sa wc_InitRngCavium, wc_InitRng
\sa wc_RNG_GenerateByte
\sa wc_FreeRng
\sa wc_RNG_HealthTest
*/
WOLFSSL_API int wc_RNG_GenerateBlock(WC_RNG*, byte*, word32 sz);
/*!
\ingroup Random
\brief Calls wc_RNG_GenerateBlock to copy a byte of pseudorandom
data to b. Will reseed rng if needed.
\return 0 on success
\return BAD_FUNC_ARG an input is null or sz exceeds MAX_REQUEST_LEN
\return DRBG_CONT_FIPS_E Hash_gen returned DRBG_CONT_FAILURE
\return RNG_FAILURE_E Default error. rngs status originally not
ok, or set to DRBG_FAILED
\param rng: random number generator initialized with wc_InitRng
\param b one byte buffer to which the block is copied
_Example_
\code
RNG rng;
int sz = 32;
byte b[1];
int ret = wc_InitRng(&rng);
if (ret != 0) {
return -1; //init of rng failed!
}
ret = wc_RNG_GenerateByte(&rng, b);
if (ret != 0) {
return -1; //generating block failed!
}
\endcode
\sa wc_InitRngCavium
\sa wc_InitRng
\sa wc_RNG_GenerateBlock
\sa wc_FreeRng
\sa wc_RNG_HealthTest
*/
WOLFSSL_API int wc_RNG_GenerateByte(WC_RNG*, byte*);
/*!
\ingroup Random
\brief Should be called when RNG no longer needed in order to securely
free drgb. Zeros and XFREEs rng-drbg.
\return 0 on success
\return BAD_FUNC_ARG rng or rng->drgb null
\return RNG_FAILURE_E Failed to deallocated drbg
\param rng random number generator initialized with wc_InitRng
_Example_
\code
RNG rng;
int ret = wc_InitRng(&rng);
if (ret != 0) {
return -1; //init of rng failed!
}
int ret = wc_FreeRng(&rng);
if (ret != 0) {
return -1; //free of rng failed!
}
\endcode
\sa wc_InitRngCavium
\sa wc_InitRng
\sa wc_RNG_GenerateBlock
\sa wc_RNG_GenerateByte,
\sa wc_RNG_HealthTest
*/
WOLFSSL_API int wc_FreeRng(WC_RNG*);
/*!
\ingroup Random
\brief Creates and tests functionality of drbg.
\return 0 on success
\return BAD_FUNC_ARG entropyA and output must not be null. If reseed
set entropyB must not be null
\return -1 test failed
\param int reseed: if set, will test reseed functionality
\param entropyA: entropy to instantiate drgb with
\param entropyASz: size of entropyA in bytes
\param entropyB: If reseed set, drbg will be reseeded with entropyB
\param entropyBSz: size of entropyB in bytes
\param output: initialized to random data seeded with entropyB if
seedrandom is set, and entropyA otherwise
\param outputSz: length of output in bytes
_Example_
\code
byte output[SHA256_DIGEST_SIZE * 4];
const byte test1EntropyB[] = ....; // test input for reseed false
const byte test1Output[] = ....; // testvector: expected output of
// reseed false
ret = wc_RNG_HealthTest(0, test1Entropy, sizeof(test1Entropy), NULL, 0,
output, sizeof(output));
if (ret != 0)
return -1;//healthtest without reseed failed
if (XMEMCMP(test1Output, output, sizeof(output)) != 0)
return -1; //compare to testvector failed: unexpected output
const byte test2EntropyB[] = ....; // test input for reseed
const byte test2Output[] = ....; // testvector expected output of reseed
ret = wc_RNG_HealthTest(1, test2EntropyA, sizeof(test2EntropyA),
test2EntropyB, sizeof(test2EntropyB),
output, sizeof(output));
if (XMEMCMP(test2Output, output, sizeof(output)) != 0)
return -1; //compare to testvector failed
\endcode
\sa wc_InitRngCavium
\sa wc_InitRng
\sa wc_RNG_GenerateBlock
\sa wc_RNG_GenerateByte
\sa wc_FreeRng
*/
WOLFSSL_API int wc_RNG_HealthTest(int reseed,
const byte* entropyA, word32 entropyASz,
const byte* entropyB, word32 entropyBSz,
byte* output, word32 outputSz);

View File

@@ -0,0 +1,101 @@
/*!
\ingroup RIPEMD
\brief This function initializes a ripemd structure by initializing
ripemds digest, buffer, loLen and hiLen.
\return 0 returned on successful execution of the function. The RipeMd
structure is initialized.
\return BAD_FUNC_ARG returned if the RipeMd structure is NULL.
\param ripemd pointer to the ripemd structure to initialize
_Example_
\code
RipeMd md;
int ret;
ret = wc_InitRipeMd(&md);
if (ret != 0) {
// Failure case.
}
\endcode
\sa wc_RipeMdUpdate
\sa wc_RipeMdFinal
*/
WOLFSSL_API int wc_InitRipeMd(RipeMd*);
/*!
\ingroup RIPEMD
\brief This function generates the RipeMd digest of the data input and
stores the result in the ripemd->digest buffer. After running
wc_RipeMdUpdate, one should compare the generated ripemd->digest to a
known authentication tag to verify the authenticity of a message.
\return 0 Returned on successful execution of the function.
\return BAD_FUNC_ARG Returned if the RipeMd structure is NULL or if data
is NULL and len is not zero. This function should execute if data is NULL
and len is 0.
\param ripemd: pointer to the ripemd structure to be initialized with
wc_InitRipeMd
\param data data to be hashed
\param len sizeof data in bytes
_Example_
\code
const byte* data; // The data to be hashed
....
RipeMd md;
int ret;
ret = wc_InitRipeMd(&md);
if (ret == 0) {
ret = wc_RipeMdUpdate(&md, plain, sizeof(plain));
if (ret != 0) {
// Failure case …
\endcode
\sa wc_InitRipeMd
\sa wc_RipeMdFinal
*/
WOLFSSL_API int wc_RipeMdUpdate(RipeMd*, const byte*, word32);
/*!
\ingroup RIPEMD
\brief This function copies the computed digest into hash. If there is a
partial unhashed block, this method will pad the block with 0s, and
include that blocks round in the digest before copying to hash. State
of ripemd is reset.
\return 0 Returned on successful execution of the function. The state of
the RipeMd structure has been reset.
\return BAD_FUNC_ARG Returned if the RipeMd structure or hash parameters
are NULL.
\param ripemd pointer to the ripemd structure to be initialized with
wc_InitRipeMd, and containing hashes from wc_RipeMdUpdate. State will
be reset
\param hash buffer to copy digest to. Should be RIPEMD_DIGEST_SIZE bytes
_Example_
\code
RipeMd md;
int ret;
byte digest[RIPEMD_DIGEST_SIZE];
const byte* data; // The data to be hashed
...
ret = wc_InitRipeMd(&md);
if (ret == 0) {
ret = wc_RipeMdUpdate(&md, plain, sizeof(plain));
if (ret != 0) {
// RipeMd Update Failure Case.
}
ret = wc_RipeMdFinal(&md, digest);
if (ret != 0) {
// RipeMd Final Failure Case.
}...
\endcode
\sa none
*/
WOLFSSL_API int wc_RipeMdFinal(RipeMd*, byte*);

View File

@@ -0,0 +1,793 @@
/*!
\ingroup RSA
\brief This function initializes a provided RsaKey struct. It also takes
in a heap identifier, for use with user defined memory overrides
(see XMALLOC, XFREE, XREALLOC).
\return 0 Returned upon successfully initializing the RSA structure for
use with encryption and decryption
\return BAD_FUNC_ARGS Returned if the RSA key pointer evaluates to NULL
\param key pointer to the RsaKey structure to initialize
\param heap pointer to a heap identifier, for use with memory overrides,
allowing custom handling of memory allocation. This heap will be the
default used when allocating memory for use with this RSA object
_Example_
\code
RsaKey enc;
int ret;
ret = wc_InitRsaKey(&enc, NULL); // not using heap hint. No custom memory
if ( ret != 0 ) {
// error initializing RSA key
}
\endcode
\sa wc_RsaInitCavium
\sa wc_FreeRsaKey
*/
WOLFSSL_API int wc_InitRsaKey(RsaKey* key, void* heap);
/*!
\ingroup RSA
\brief This function frees a provided RsaKey struct using mp_clear.
\return 0 Returned upon successfully freeing the key
\param key pointer to the RsaKey structure to free
_Example_
\code
RsaKey enc;
wc_RsaInitKey(&enc, NULL); // not using heap hint. No custom memory
... set key, do encryption
wc_FreeRsaKey(&enc);
\endcode
\sa wc_InitRsaKey
*/
WOLFSSL_API int wc_FreeRsaKey(RsaKey* key);
/*!
\ingroup RSA
\brief This function encrypts a message from in and stores the result
in out. It requires an initialized public key and a random number
generator. As a side effect, this function will return the bytes written
to out in outLen.
\return Success Upon successfully encrypting the input message, returns
the number bytes written to out
\return -1 Returned if there is an error during RSA encryption and
hardware acceleration via Cavium is enabled
\return BAD_FUNC_ARG Returned if any of the input parameters are invalid
\return RSA_BUFFER_E Returned if the output buffer is too small to store
the ciphertext
\return RNG_FAILURE_E Returned if there is an error generating a random
block using the provided RNG structure
\return MP_INIT_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_READ_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_CMP_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_INVMOD_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_EXPTMOD_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_MOD_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_MUL_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_ADD_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_MULMOD_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_TO_E May be returned if there is an error in the math
library used while encrypting the message
\return MP_MEM May be returned if there is an error in the math
library used while encrypting the message
\return MP_ZERO_E May be returned if there is an error in the math
library used while encrypting the message
\param in pointer to a buffer containing the input message to encrypt
\param inLen the length of the message to encrypt
\param out pointer to the buffer in which to store the output ciphertext
\param outLen the length of the output buffer
\param key pointer to the RsaKey structure containing the public
key to use for encryption
\param rng The RNG structure with which to generate random block padding
_Example_
\code
RsaKey pub;
int ret = 0;
byte n[] = { // initialize with received n component of public key };
byte e[] = { // initialize with received e component of public key };
byte msg[] = { // initialize with plaintext of message to encrypt };
byte cipher[256]; // 256 bytes is large enough to store 2048 bit RSA
ciphertext
wc_InitRsaKey(&pub, NULL); // not using heap hint. No custom memory
wc_RsaPublicKeyDecodeRaw(n, sizeof(n), e, sizeof(e), &pub);
// initialize with received public key parameters
ret = wc_RsaPublicEncrypt(msg, sizeof(msg), out, sizeof(out), &pub, &rng);
if ( ret != 0 ) {
// error encrypting message
}
\endcode
\sa wc_RsaPrivateDecrypt
*/
WOLFSSL_API int wc_RsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
word32 outLen, RsaKey* key, WC_RNG* rng);
/*!
\ingroup RSA
\brief This functions is utilized by the wc_RsaPrivateDecrypt function
for decrypting.
\return Success Length of decrypted data.
\return RSA_PAD_E RsaUnPad error, bad formatting
\param in The byte array to be decrypted.
\param inLen The length of in.
\param out The byte array for the decrypted data to be stored.
\param key The key to use for decryption.
_Example_
\code
none
\endcode
\sa wc_RsaPrivateDecrypt
*/
WOLFSSL_API int wc_RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out,
RsaKey* key);
/*!
\ingroup RSA
\brief This functions provides private RSA decryption.
\return Success length of decrypted data.
\return MEMORY_E -125, out of memory error
\return BAD_FUNC_ARG -173, Bad function argument provided
\param in The byte array to be decrypted.
\param inLen The length of in.
\param out The byte array for the decrypted data to be stored.
\param outLen The length of out.
\param key The key to use for decryption.
_Example_
\code
ret = wc_RsaPublicEncrypt(in, inLen, out, sizeof(out), &key, &rng);
if (ret < 0) {
return -1;
}
ret = wc_RsaPrivateDecrypt(out, ret, plain, sizeof(plain), &key);
if (ret < 0) {
return -1;
}
\endcode
\sa RsaUnPad
\sa wc_RsaFunction
\sa wc_RsaPrivateDecryptInline
*/
WOLFSSL_API int wc_RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
word32 outLen, RsaKey* key);
/*!
\ingroup RSA
\brief Signs the provided array with the private key.
\return RSA_BUFFER_E: -131, RSA buffer error, output too small or
input too large
\param in The byte array to be encrypted.
\param inLen The length of in.
\param out The byte array for the encrypted data to be stored.
\param outLen The length of out.
\param key The key to use for encryption.
\param RNG The RNG struct to use for random number purposes.
_Example_
\code
ret = wc_RsaSSL_Sign(in, inLen, out, sizeof(out), &key, &rng);
if (ret < 0) {
return -1;
}
memset(plain, 0, sizeof(plain));
ret = wc_RsaSSL_Verify(out, ret, plain, sizeof(plain), &key);
if (ret < 0) {
return -1;
}
\endcode
\sa wc_RsaPad
*/
WOLFSSL_API int wc_RsaSSL_Sign(const byte* in, word32 inLen, byte* out,
word32 outLen, RsaKey* key, WC_RNG* rng);
/*!
\ingroup RSA
\brief Used to verify that the message was signed by RSA key. The output
uses the same byte array as the input.
\return >0 Length of text.
\return <0 An error occurred.
\param in Byte array to be decrypted.
\param inLen Length of the buffer input.
\param out Pointer to a pointer for decrypted information.
\param key RsaKey to use.
_Example_
\code
RsaKey key;
WC_WC_RNG rng;
int ret = 0;
long e = 65537; // standard value to use for exponent
wc_InitRsaKey(&key, NULL); // not using heap hint. No custom memory
wc_InitRng(&rng);
wc_MakeRsaKey(&key, 2048, e, &rng);
byte in[] = { // Initialize with some RSA encrypted information }
byte* out;
if(wc_RsaSSL_VerifyInline(in, sizeof(in), &out, &key) < 0)
{
// handle error
}
\endcode
\sa wc_RsaSSL_Verify
\sa wc_RsaSSL_Sign
*/
WOLFSSL_API int wc_RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out,
RsaKey* key);
/*!
\ingroup RSA
\brief Used to verify that the message was signed by key.
\return Success Length of text on no error.
\return MEMORY_E memory exception.
\param in The byte array to be decrypted.
\param inLen The length of in.
\param out The byte array for the decrypted data to be stored.
\param outLen The length of out.
\param key The key to use for verification.
_Example_
\code
ret = wc_RsaSSL_Sign(in, inLen, out, sizeof(out), &key, &rng);
if (ret < 0) {
return -1;
}
memset(plain, 0, sizeof(plain));
ret = wc_RsaSSL_Verify(out, ret, plain, sizeof(plain), &key);
if (ret < 0) {
return -1;
}
\endcode
\sa wc_RsaSSL_Sign
*/
WOLFSSL_API int wc_RsaSSL_Verify(const byte* in, word32 inLen, byte* out,
word32 outLen, RsaKey* key);
/*!
\ingroup RSA
\brief Returns the encryption size for the provided key structure.
\return Success Encryption size for the provided key structure.
\param key The key to use for verification.
_Example_
\code
int sz = wc_RsaEncryptSize(&key);
\endcode
\sa wc_InitRsaKey
\sa wc_InitRsaKey_ex
\sa wc_MakeRsaKey
\sa XMEMSET
*/
WOLFSSL_API int wc_RsaEncryptSize(RsaKey* key);
/*!
\ingroup RSA
\brief This function parses a DER-formatted RSA private key, extracts the
private key and stores it in the given RsaKey structure. It also sets the
distance parsed in idx.
\return 0 Returned upon successfully parsing the private key from the DER
encoded input
\return ASN_PARSE_E Returned if there is an error parsing the private key
from the input buffer. This may happen if the input private key is not
properly formatted according to ASN.1 standards
\return ASN_RSA_KEY_E Returned if there is an error reading the private
key elements of the RSA key input
\param input pointer to the buffer containing the DER formatted private
key to decode
\param inOutIdx pointer to the index in the buffer at which the key begins
(usually 0). As a side effect of this function, inOutIdx will store the
distance parsed through the input buffer
\param key pointer to the RsaKey structure in which to store the decoded
private key
\param inSz size of the input buffer
_Example_
\code
RsaKey enc;
word32 idx = 0;
int ret = 0;
byte der[] = { // initialize with DER-encoded RSA private key };
wc_InitRsaKey(&enc, NULL); // not using heap hint. No custom memory
ret = wc_RsaPrivateKeyDecode(der, &idx, &enc, sizeof(der));
if( ret != 0 ) {
// error parsing private key
}
\endcode
\sa wc_RsaPublicKeyDecode
\sa wc_MakeRsaKey
*/
WOLFSSL_API int wc_RsaPrivateKeyDecode(const byte* input, word32* inOutIdx,
RsaKey*, word32);
/*!
\ingroup RSA
\brief This function parses a DER-formatted RSA public key, extracts the
public key and stores it in the given RsaKey structure. It also sets the
distance parsed in idx.
\return 0 Returned upon successfully parsing the public key from the DER
encoded input
\return ASN_PARSE_E Returned if there is an error parsing the public key
from the input buffer. This may happen if the input public key is not
properly formatted according to ASN.1 standards
\return ASN_OBJECT_ID_E Returned if the ASN.1 Object ID does not match
that of a RSA public key
\return ASN_EXPECT_0_E Returned if the input key is not correctly
formatted according to ASN.1 standards
\return ASN_BITSTR_E Returned if the input key is not correctly formatted
according to ASN.1 standards
\return ASN_RSA_KEY_E Returned if there is an error reading the public key
elements of the RSA key input
\param input pointer to the buffer containing the input DER-encoded RSA
public key to decode
\param inOutIdx pointer to the index in the buffer at which the key
begins (usually 0). As a side effect of this function, inOutIdx will
store the distance parsed through the input buffer
\param key pointer to the RsaKey structure in which to store the decoded
public key
\param inSz size of the input buffer
_Example_
\code
RsaKey pub;
word32 idx = 0;
int ret = 0;
byte der[] = { // initialize with DER-encoded RSA public key };
wc_InitRsaKey(&pub, NULL); // not using heap hint. No custom memory
ret = wc_RsaPublicKeyDecode(der, &idx, &pub, sizeof(der));
if( ret != 0 ) {
// error parsing public key
}
\endcode
\sa wc_RsaPublicKeyDecodeRaw
*/
WOLFSSL_API int wc_RsaPublicKeyDecode(const byte* input, word32* inOutIdx,
RsaKey*, word32);
/*!
\ingroup RSA
\brief This function decodes the raw elements of an RSA public key, taking
in the public modulus (n) and exponent (e). It stores these raw elements
in the provided RsaKey structure, allowing one to use them in the
encryption/decryption process.
\return 0 Returned upon successfully decoding the raw elements of the
public key into the RsaKey structure
\return BAD_FUNC_ARG Returned if any of the input arguments evaluates to
NULL
\return MP_INIT_E Returned if there is an error initializing an integer
for use with the multiple precision integer (mp_int) library
\return ASN_GETINT_E Returned if there is an error reading one of the
provided RSA key elements, n or e
\param n pointer to a buffer containing the raw modulus parameter of the
public RSA key
\param nSz size of the buffer containing n
\param e pointer to a buffer containing the raw exponent parameter of
the public RSA key
\param eSz size of the buffer containing e
\param key pointer to the RsaKey struct to initialize with the provided
public key elements
_Example_
\code
RsaKey pub;
int ret = 0;
byte n[] = { // initialize with received n component of public key };
byte e[] = { // initialize with received e component of public key };
wc_InitRsaKey(&pub, NULL); // not using heap hint. No custom memory
ret = wc_RsaPublicKeyDecodeRaw(n, sizeof(n), e, sizeof(e), &pub);
if( ret != 0 ) {
// error parsing public key elements
}
\endcode
\sa wc_RsaPublicKeyDecode
*/
WOLFSSL_API int wc_RsaPublicKeyDecodeRaw(const byte* n, word32 nSz,
const byte* e, word32 eSz, RsaKey* key);
/*!
\ingroup RSA
\brief This function converts an RsaKey key to DER format. The result is
written to output and it returns the number of bytes written.
\return 0 Success
\return BAD_FUNC_ARG Returned if key or output is null, or if key->type
is not RSA_PRIVATE, or if inLen isn't large enough for output buffer.
\return MEMORY_E Returned if there is an error allocating memory.
\param key Initialized RsaKey structure.
\param output Pointer to output buffer.
\param inLen Size of output buffer.
_Example_
\code
byte* der;
// Allocate memory for der
int derSz = // Amount of memory allocated for der;
RsaKey key;
WC_WC_RNG rng;
long e = 65537; // standard value to use for exponent
ret = wc_MakeRsaKey(&key, 2048, e, &rng); // generate 2048 bit long
private key
wc_InitRsaKey(&key, NULL);
wc_InitRng(&rng);
if(wc_RsaKeyToDer(&key, der, derSz) != 0)
{
// Handle the error thrown
}
\endcode
\sa wc_RsaKeyToPublicDer
\sa wc_InitRsaKey
\sa wc_MakeRsaKey
\sa wc_InitRng
*/
WOLFSSL_API int wc_RsaKeyToDer(RsaKey*, byte* output, word32 inLen);
/*!
\ingroup RSA
\brief This function performs RSA encrypt while allowing the choice of
which padding to use.
\return size On successfully encryption the size of the encrypted buffer
is returned
\return RSA_BUFFER_E RSA buffer error, output too small or input too large
\param in pointer to the buffer for encryption
\param inLen length of the buffer to encrypt
\param out encrypted msg created
\param outLen length of buffer available to hold encrypted msg
\param key initialized RSA key struct
\param rng initialized WC_RNG struct
\param type type of padding to use (WC_RSA_OAEP_PAD or WC_RSA_PKCSV15_PAD)
\param hash type of hash to use (choices can be found in hash.h)
\param mgf type of mask generation function to use
\param label an optional label to associate with encrypted message
\param labelSz size of the optional label used
_Example_
\code
WC_WC_WC_RNG rng;
RsaKey key;
byte in[] = “I use Turing Machines to ask questions”
byte out[256];
int ret;
ret = wc_RsaPublicEncrypt_ex(in, sizeof(in), out, sizeof(out), &key, &rng,
WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA, WC_MGF1SHA1, NULL, 0);
if (ret < 0) {
//handle error
}
\endcode
\sa wc_RsaPublicEncrypt
\sa wc_RsaPrivateDecrypt_ex
*/
WOLFSSL_API int wc_RsaPublicEncrypt_ex(const byte* in, word32 inLen, byte* out,
word32 outLen, RsaKey* key, WC_RNG* rng, int type,
enum wc_HashType hash, int mgf, byte* label, word32 lableSz);
/*!
\ingroup RSA
\brief This function uses RSA to decrypt a message and gives the
option of what padding type.
\return size On successful decryption, the size of the decrypted message
is returned.
\return MEMORY_E Returned if not enough memory on system to malloc a
needed array.
\return BAD_FUNC_ARG Returned if a bad argument was passed into the
function.
\param in pointer to the buffer for decryption
\param inLen length of the buffer to decrypt
\param out decrypted msg created
\param outLen length of buffer available to hold decrypted msg
\param key initialized RSA key struct
\param type type of padding to use (WC_RSA_OAEP_PAD or WC_RSA_PKCSV15_PAD)
\param hash type of hash to use (choices can be found in hash.h)
\param mgf type of mask generation function to use
\param label an optional label to associate with encrypted message
\param labelSz size of the optional label used
_Example_
\code
WC_WC_WC_RNG rng;
RsaKey key;
byte in[] = “I use Turing Machines to ask questions”
byte out[256];
byte plain[256];
int ret;
ret = wc_RsaPublicEncrypt_ex(in, sizeof(in), out, sizeof(out), &key,
&rng, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA, WC_MGF1SHA1, NULL, 0);
if (ret < 0) {
//handle error
}
ret = wc_RsaPrivateDecrypt_ex(out, ret, plain, sizeof(plain), &key,
WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA, WC_MGF1SHA1, NULL, 0);
if (ret < 0) {
//handle error
}
\endcode
\sa none
*/
WOLFSSL_API int wc_RsaPrivateDecrypt_ex(const byte* in, word32 inLen,
byte* out, word32 outLen, RsaKey* key, int type,
enum wc_HashType hash, int mgf, byte* label, word32 lableSz);
/*!
\ingroup RSA
\brief This function uses RSA to decrypt a message inline and gives the
option of what padding type. The in buffer will contain the decrypted
message after being called and the out byte pointer will point to the
location in the “in” buffer where the plain text is.
\return size On successful decryption, the size of the decrypted message
is returned.
\return MEMORY_E: Returned if not enough memory on system to malloc a
needed array.
\return RSA_PAD_E: Returned if an error in the padding was encountered.
\return BAD_PADDING_E: Returned if an error happened during parsing past
padding.
\return BAD_FUNC_ARG: Returned if a bad argument was passed into the
function.
\param in pointer to the buffer for decryption
\param inLen length of the buffer to decrypt
\param out pointer to location of decrypted message in “in” buffer
\param key initialized RSA key struct
\param type type of padding to use (WC_RSA_OAEP_PAD or WC_RSA_PKCSV15_PAD)
\param hash type of hash to use (choices can be found in hash.h)
\param mgf type of mask generation function to use
\param label an optional label to associate with encrypted message
\param labelSz size of the optional label used
_Example_
\code
WC_WC_WC_RNG rng;
RsaKey key;
byte in[] = “I use Turing Machines to ask questions”
byte out[256];
byte* plain;
int ret;
ret = wc_RsaPublicEncrypt_ex(in, sizeof(in), out, sizeof(out), &key,
&rng, WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA, WC_MGF1SHA1, NULL, 0);
if (ret < 0) {
//handle error
}
ret = wc_RsaPrivateDecryptInline_ex(out, ret, &plain, &key,
WC_RSA_OAEP_PAD, WC_HASH_TYPE_SHA, WC_MGF1SHA1, NULL, 0);
if (ret < 0) {
//handle error
}
\endcode
\sa none
*/
WOLFSSL_API int wc_RsaPrivateDecryptInline_ex(byte* in, word32 inLen,
byte** out, RsaKey* key, int type, enum wc_HashType hash,
int mgf, byte* label, word32 lableSz);
/*!
\ingroup RSA
\brief Flattens the RsaKey structure into individual elements (e, n)
used for the RSA algorithm.
\return 0 Returned if the function executed normally, without error.
\return BAD_FUNC_ARG: Returned if any of the parameters are passed in
with a null value.
\return RSA_BUFFER_E: Returned if the e or n buffers passed in are not
the correct size.
\return MP_MEM: Returned if an internal function has memory errors.
\return MP_VAL: Returned if an internal function argument is not valid.
\param key The key to use for verification.
\param e a buffer for the value of e. e is a large positive integer in
the RSA modular arithmetic operation.
\param eSz the size of the e buffer.
\param n a buffer for the value of n. n is a large positive integer in
the RSA modular arithmetic operation.
\param nSz the size of the n buffer.
_Example_
\code
Rsa key; // A valid RSA key.
byte e[ buffer sz E.g. 256 ];
byte n[256];
int ret;
word32 eSz = sizeof(e);
word32 nSz = sizeof(n);
...
ret = wc_RsaFlattenPublicKey(&key, e, &eSz, n, &nSz);
if (ret != 0) {
// Failure case.
}
\endcode
\sa wc_InitRsaKey
\sa wc_InitRsaKey_ex
\sa wc_MakeRsaKey
\sa XMEMSET
*/
WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
word32*);
/*!
\ingroup RSA
\brief Convert Rsa Public key to DER format. Writes to output, and
returns count of bytes written.
\return >0 Success, number of bytes written.
\return BAD_FUNC_ARG Returned if key or output is null.
\return MEMORY_E Returned when an error allocating memory occurs.
\return <0 Error
\param key The RSA key structure to convert.
\param output Output buffer to hold DER.
\param inLen Length of buffer.
_Example_
\code
RsaKey key;
wc_RsaInitKey(&key, NULL);
// Use key
int BUFFER_SIZE = // Some adequate size for the buffer
byte output[BUFFER_SIZE];
if(wc_RsaKeyToPublicDer(&key, output, sizeof(output)) != 0)
{
// Handle Error
}
\endcode
\sa wc_RsaKeyToPublicDer
\sa wc_RsaInitKey
*/
WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey*, byte* output, word32 inLen);
/*!
\ingroup RSA
\brief This function generates a RSA private key of length size (in bits)
and given exponent (e). It then stores this key in the provided RsaKey
structure, so that it may be used for encryption/decryption. A secure
number to use for e is 65537. size is required to be greater than
RSA_MIN_SIZE and less than RSA_MAX_SIZE. For this function to be
available, the option WOLFSSL_KEY_GEN must be enabled at compile time.
This can be accomplished with --enable-keygen if using ./configure.
\return 0 Returned upon successfully generating a RSA private key
\return BAD_FUNC_ARG Returned if any of the input arguments are NULL,
the size parameter falls outside of the necessary bounds, or e is
incorrectly chosen
\return RNG_FAILURE_E Returned if there is an error generating a random
block using the provided RNG structure
\return MP_INIT_E
\return MP_READ_E May be May be returned if there is an error in the math
library used while generating the RSA key returned if there is an error
in the math library used while generating the RSA key
\return MP_CMP_E May be returned if there is an error in the math library
used while generating the RSA key
\return MP_INVMOD_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_EXPTMOD_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_MOD_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_MUL_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_ADD_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_MULMOD_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_TO_E May be returned if there is an error in the math
library used while generating the RSA key
\return MP_MEM May be returned if there is an error in the math
library used while generating the RSA key
\return MP_ZERO_E May be returned if there is an error in the math
library used while generating the RSA key
\param key pointer to the RsaKey structure in which to store the
generated private key
\param size desired keylenth, in bits. Required to be greater than
RSA_MIN_SIZE and less than RSA_MAX_SIZE
\param e exponent parameter to use for generating the key. A secure
choice is 65537
\param rng pointer to an RNG structure to use for random number generation
while making the ke
_Example_
\code
RsaKey priv;
WC_WC_RNG rng;
int ret = 0;
long e = 65537; // standard value to use for exponent
wc_InitRsaKey(&priv, NULL); // not using heap hint. No custom memory
wc_InitRng(&rng);
// generate 2048 bit long private key
ret = wc_MakeRsaKey(&priv, 2048, e, &rng);
if( ret != 0 ) {
// error generating private key
}
\endcode
\sa none
*/
WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng);

View File

@@ -0,0 +1,141 @@
/*!
\ingroup SHA
\brief This function initializes SHA. This is automatically called
by wc_ShaHash.
\return 0 Returned upon successfully initializing
\param sha pointer to the sha structure to use for encryption
_Example_
\code
Sha sha[1];
if ((ret = wc_InitSha(sha)) != 0) {
WOLFSSL_MSG("wc_InitSha failed");
}
else {
wc_ShaUpdate(sha, data, len);
wc_ShaFinal(sha, hash);
}
\endcode
\sa wc_ShaHash
\sa wc_ShaUpdate
\sa wc_ShaFinal
*/
WOLFSSL_API int wc_InitSha(wc_Sha*);
/*!
\ingroup SHA
\brief Can be called to continually hash the provided byte array of
length len.
\return 0 Returned upon successfully adding the data to the digest.
\param sha pointer to the sha structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
Sha sha[1];
byte data[] = { // Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha(sha)) != 0) {
WOLFSSL_MSG("wc_InitSha failed");
}
else {
wc_ShaUpdate(sha, data, len);
wc_ShaFinal(sha, hash);
}
\endcode
\sa wc_ShaHash
\sa wc_ShaFinal
\sa wc_InitSha
*/
WOLFSSL_API int wc_ShaUpdate(wc_Sha*, const byte*, word32);
/*!
\ingroup SHA
\brief Finalizes hashing of data. Result is placed into hash.
Resets state of sha struct.
\return 0 Returned upon successfully finalizing.
\param sha pointer to the sha structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha sha[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha(sha)) != 0) {
WOLFSSL_MSG("wc_InitSha failed");
}
else {
wc_ShaUpdate(sha, data, len);
wc_ShaFinal(sha, hash);
}
\endcode
\sa wc_ShaHash
\sa wc_InitSha
\sa wc_ShaGetHash
*/
WOLFSSL_API int wc_ShaFinal(wc_Sha*, byte*);
/*!
\ingroup SHA
\brief Used to clean up memory used by an initialized Sha struct.
Note: this is only supported if you have WOLFSSL_TI_HASH defined.
\return No returns.
\param sha Pointer to the Sha struct to free.
_Example_
\code
Sha sha;
wc_InitSha(&sha);
// Use sha
wc_ShaFree(&sha);
\endcode
\sa wc_InitSha
\sa wc_ShaUpdate
\sa wc_ShaFinal
*/
WOLFSSL_API void wc_ShaFree(wc_Sha*);
/*!
\ingroup SHA
\brief Gets hash data. Result is placed into hash. Does not reset state
of sha struct.
\return 0 Returned upon successfully finalizing.
\param sha pointer to the sha structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha sha[1];
if ((ret = wc_InitSha(sha)) != 0) {
WOLFSSL_MSG("wc_InitSha failed");
}
else {
wc_ShaUpdate(sha, data, len);
wc_ShaGetHash(sha, hash);
}
\endcode
\sa wc_ShaHash
\sa wc_ShaFinal
\sa wc_InitSha
*/
WOLFSSL_API int wc_ShaGetHash(wc_Sha*, byte*);

View File

@@ -0,0 +1,239 @@
/*!
\ingroup SHA
\brief This function initializes SHA256. This is automatically
called by wc_Sha256Hash.
\return 0 Returned upon successfully initializing
\param sha256 pointer to the sha256 structure to use for encryption
_Example_
\code
Sha256 sha256[1];
if ((ret = wc_InitSha356(sha256)) != 0) {
WOLFSSL_MSG("wc_InitSha256 failed");
}
else {
wc_Sha256Update(sha256, data, len);
wc_Sha256Final(sha256, hash);
}
\endcode
\sa wc_Sha256Hash
\sa wc_Sha256Update
\sa wc_Sha256Final
*/
WOLFSSL_API int wc_InitSha256(wc_Sha256*);
/*!
\ingroup SHA
\brief Can be called to continually hash the provided byte
array of length len.
\return 0 Returned upon successfully adding the data to the digest.
\param sha256 pointer to the sha256 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
Sha256 sha256[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha256(sha256)) != 0) {
WOLFSSL_MSG("wc_InitSha256 failed");
}
else {
wc_Sha256Update(sha256, data, len);
wc_Sha256Final(sha256, hash);
}
\endcode
\sa wc_Sha256Hash
\sa wc_Sha256Final
\sa wc_InitSha256
*/
WOLFSSL_API int wc_Sha256Update(wc_Sha256*, const byte*, word32);
/*!
\ingroup SHA
\brief Finalizes hashing of data. Result is placed into hash.
Resets state of sha256 struct.
\return 0 Returned upon successfully finalizing.
\param sha256 pointer to the sha256 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha256 sha256[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha356(sha256)) != 0) {
WOLFSSL_MSG("wc_InitSha256 failed");
}
else {
wc_Sha256Update(sha256, data, len);
wc_Sha256Final(sha256, hash);
}
\endcode
\sa wc_Sha256Hash
\sa wc_Sha256GetHash
\sa wc_InitSha256
*/
WOLFSSL_API int wc_Sha256Final(wc_Sha256*, byte*);
/*!
\ingroup SHA
\brief Resets the Sha256 structure. Note: this is only supported
if you have WOLFSSL_TI_HASH defined.
\return none No returns.
\param sha256 Pointer to the sha256 structure to be freed.
_Example_
\code
Sha256 sha256;
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha256(&sha256)) != 0) {
WOLFSSL_MSG("wc_InitSha256 failed");
}
else {
wc_Sha256Update(&sha256, data, len);
wc_Sha256Final(&sha256, hash);
wc_Sha256Free(&sha256);
}
\endcode
\sa wc_InitSha256
\sa wc_Sha256Update
\sa wc_Sha256Final
*/
WOLFSSL_API void wc_Sha256Free(wc_Sha256*);
/*!
\ingroup SHA
\brief Gets hash data. Result is placed into hash. Does not
reset state of sha256 struct.
\return 0 Returned upon successfully finalizing.
\param sha256 pointer to the sha256 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha256 sha256[1];
if ((ret = wc_InitSha356(sha256)) != 0) {
WOLFSSL_MSG("wc_InitSha256 failed");
}
else {
wc_Sha256Update(sha256, data, len);
wc_Sha256GetHash(sha256, hash);
}
\endcode
\sa wc_Sha256Hash
\sa wc_Sha256Final
\sa wc_InitSha256
*/
WOLFSSL_API int wc_Sha256GetHash(wc_Sha256*, byte*);
/*!
\ingroup SHA
\brief Used to initialize a Sha224 struct.
\return 0 Success
\return 1 Error returned because sha224 is null.
\param sha224 Pointer to a Sha224 struct to initialize.
_Example_
\code
Sha224 sha224;
if(wc_InitSha224(&sha224) != 0)
{
// Handle error
}
\endcode
\sa wc_Sha224Hash
\sa wc_Sha224Update
\sa wc_Sha224Final
*/
WOLFSSL_API int wc_InitSha224(wc_Sha224*);
/*!
\ingroup SHA
\brief Can be called to continually hash the provided byte array
of length len.
\return 0 Success
\return 1 Error returned if function fails.
\return BAD_FUNC_ARG Error returned if sha224 or data is null.
\param sha224 Pointer to the Sha224 structure to use for encryption.
\param data Data to be hashed.
\param len Length of data to be hashed.
_Example_
\code
Sha224 sha224;
byte data[] = { /* Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha224(&sha224)) != 0) {
WOLFSSL_MSG("wc_InitSha224 failed");
}
else {
wc_Sha224Update(&sha224, data, len);
wc_Sha224Final(&sha224, hash);
}
\endcode
\sa wc_InitSha224
\sa wc_Sha224Final
\sa wc_Sha224Hash
*/
WOLFSSL_API int wc_Sha224Update(wc_Sha224*, const byte*, word32);
/*!
\ingroup SHA
\brief Finalizes hashing of data. Result is placed into hash.
Resets state of sha224 struct.
\return 0 Success
\return <0 Error
\param sha224 pointer to the sha224 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha224 sha224;
byte data[] = { /* Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha224(&sha224)) != 0) {
WOLFSSL_MSG("wc_InitSha224 failed");
}
else {
wc_Sha224Update(&sha224, data, len);
wc_Sha224Final(&sha224, hash);
}
\endcode
\sa wc_InitSha224
\sa wc_Sha224Hash
\sa wc_Sha224Update
*/
WOLFSSL_API int wc_Sha224Final(wc_Sha224*, byte*);

View File

@@ -0,0 +1,178 @@
/*!
\ingroup SHA
\brief This function initializes SHA512. This is automatically called
by wc_Sha512Hash.
\return 0 Returned upon successfully initializing
\param sha512 pointer to the sha512 structure to use for encryption
_Example_
\code
Sha512 sha512[1];
if ((ret = wc_InitSha512(sha512)) != 0) {
WOLFSSL_MSG("wc_InitSha512 failed");
}
else {
wc_Sha512Update(sha512, data, len);
wc_Sha512Final(sha512, hash);
}
\endcode
\sa wc_Sha512Hash
\sa wc_Sha512Update
\sa wc_Sha512Final
*/
WOLFSSL_API int wc_InitSha512(wc_Sha512*);
/*!
\ingroup SHA
\brief Can be called to continually hash the provided byte array
of length len.
\return 0 Returned upon successfully adding the data to the digest.
\param sha512 pointer to the sha512 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
Sha512 sha512[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha512(sha512)) != 0) {
WOLFSSL_MSG("wc_InitSha512 failed");
}
else {
wc_Sha512Update(sha512, data, len);
wc_Sha512Final(sha512, hash);
}
\endcode
\sa wc_Sha512Hash
\sa wc_Sha512Final
\sa wc_InitSha512
*/
WOLFSSL_API int wc_Sha512Update(wc_Sha512*, const byte*, word32);
/*!
\ingroup SHA
\brief Finalizes hashing of data. Result is placed into hash.
\return 0 Returned upon successfully finalizing the hash.
\param sha512 pointer to the sha512 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha512 sha512[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha512(sha512)) != 0) {
WOLFSSL_MSG("wc_InitSha512 failed");
}
else {
wc_Sha512Update(sha512, data, len);
wc_Sha512Final(sha512, hash);
}
\endcode
\sa wc_Sha512Hash
\sa wc_Sha512Final
\sa wc_InitSha512
*/
WOLFSSL_API int wc_Sha512Final(wc_Sha512*, byte*);
/*!
\ingroup SHA
\brief This function initializes SHA384. This is automatically called
by wc_Sha384Hash.
\return 0 Returned upon successfully initializing
\param sha384 pointer to the sha384 structure to use for encryption
_Example_
\code
Sha384 sha384[1];
if ((ret = wc_InitSha384(sha384)) != 0) {
WOLFSSL_MSG("wc_InitSha384 failed");
}
else {
wc_Sha384Update(sha384, data, len);
wc_Sha384Final(sha384, hash);
}
\endcode
\sa wc_Sha384Hash
\sa wc_Sha384Update
\sa wc_Sha384Final
*/
WOLFSSL_API int wc_InitSha384(wc_Sha384*);
/*!
\ingroup SHA
\brief Can be called to continually hash the provided byte array
of length len.
\return 0 Returned upon successfully adding the data to the digest.
\param sha384 pointer to the sha384 structure to use for encryption
\param data the data to be hashed
\param len length of data to be hashed
_Example_
\code
Sha384 sha384[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha384(sha384)) != 0) {
WOLFSSL_MSG("wc_InitSha384 failed");
}
else {
wc_Sha384Update(sha384, data, len);
wc_Sha384Final(sha384, hash);
}
\endcode
\sa wc_Sha384Hash
\sa wc_Sha384Final
\sa wc_InitSha384
*/
WOLFSSL_API int wc_Sha384Update(wc_Sha384*, const byte*, word32);
/*!
\ingroup SHA
\brief Finalizes hashing of data. Result is placed into hash.
\return 0 Returned upon successfully finalizing.
\param sha384 pointer to the sha384 structure to use for encryption
\param hash Byte array to hold hash value.
_Example_
\code
Sha384 sha384[1];
byte data[] = { Data to be hashed };
word32 len = sizeof(data);
if ((ret = wc_InitSha384(sha384)) != 0) {
WOLFSSL_MSG("wc_InitSha384 failed");
}
else {
wc_Sha384Update(sha384, data, len);
wc_Sha384Final(sha384, hash);
}
\endcode
\sa wc_Sha384Hash
\sa wc_Sha384Final
\sa wc_InitSha384
*/
WOLFSSL_API int wc_Sha384Final(wc_Sha384*, byte*);

View File

@@ -0,0 +1,145 @@
/*!
\ingroup Signature
\brief This function returns the maximum size of the resulting signature.
\return Returns SIG_TYPE_E if sig_type is not supported. Returns
BAD_FUNC_ARG if sig_type was invalid. A positive return value indicates
the maximum size of a signature.
\param sig_type A signature type enum value such as
WC_SIGNATURE_TYPE_ECC or WC_SIGNATURE_TYPE_RSA.
\param key Pointer to a key structure such as ecc_key or RsaKey.
\param key_len Size of the key structure.
_Example_
\code
// Get signature length
enum wc_SignatureType sig_type = WC_SIGNATURE_TYPE_ECC;
ecc_key eccKey;
word32 sigLen;
wc_ecc_init(&eccKey);
sigLen = wc_SignatureGetSize(sig_type, &eccKey, sizeof(eccKey));
if (sigLen > 0) {
// Success
}
\endcode
\sa wc_HashGetDigestSize
\sa wc_SignatureGenerate
\sa wc_SignatureVerify
*/
WOLFSSL_API int wc_SignatureGetSize(enum wc_SignatureType sig_type,
const void* key, word32 key_len);
/*!
\ingroup Signature
\brief This function validates a signature by hashing the data and
using the resulting hash and key to verify the signature.
\return 0 Success
\return SIG_TYPE_E -231, signature type not enabled/ available
\return BAD_FUNC_ARG -173, bad function argument provided
\return BUFFER_E -132, output buffer too small or input too large.
\param hash_type A hash type from the “enum wc_HashType” such as
“WC_HASH_TYPE_SHA256”.
\param sig_type A signature type enum value such as
WC_SIGNATURE_TYPE_ECC or WC_SIGNATURE_TYPE_RSA.
\param data Pointer to buffer containing the data to hash.
\param data_len Length of the data buffer.
\param sig Pointer to buffer to output signature.
\param sig_len Length of the signature output buffer.
\param key Pointer to a key structure such as ecc_key or RsaKey.
\param key_len Size of the key structure.
_Example_
\code
int ret;
ecc_key eccKey;
// Import the public key
wc_ecc_init(&eccKey);
ret = wc_ecc_import_x963(eccPubKeyBuf, eccPubKeyLen, &eccKey);
// Perform signature verification using public key
ret = wc_SignatureVerify(
WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_ECC,
fileBuf, fileLen,
sigBuf, sigLen,
&eccKey, sizeof(eccKey));
printf("Signature Verification: %s
(%d)\n", (ret == 0) ? "Pass" : "Fail", ret);
wc_ecc_free(&eccKey);
\endcode
\sa wc_SignatureGetSize
\sa wc_SignatureGenerate
*/
WOLFSSL_API int wc_SignatureVerify(
enum wc_HashType hash_type, enum wc_SignatureType sig_type,
const byte* data, word32 data_len,
const byte* sig, word32 sig_len,
const void* key, word32 key_len);
/*!
\ingroup Signature
\brief This function generates a signature from the data using a
key. It first creates a hash of the data then signs the hash using the key.
\return 0 Success
\return SIG_TYPE_E -231, signature type not enabled/ available
\return BAD_FUNC_ARG -173, bad function argument provided
\return BUFFER_E -132, output buffer too small or input too large.
\param hash_type A hash type from the “enum wc_HashType”
such as “WC_HASH_TYPE_SHA256”.
\param sig_type A signature type enum value such as
WC_SIGNATURE_TYPE_ECC or WC_SIGNATURE_TYPE_RSA.
\param data Pointer to buffer containing the data to hash.
\param data_len Length of the data buffer.
\param sig Pointer to buffer to output signature.
\param sig_len Length of the signature output buffer.
\param key Pointer to a key structure such as ecc_key or RsaKey.
\param key_len Size of the key structure.
\param rng Pointer to an initialized RNG structure.
_Example_
\code
int ret;
WC_RNG rng;
ecc_key eccKey;
wc_InitRng(&rng);
wc_ecc_init(&eccKey);
// Generate key
ret = wc_ecc_make_key(&rng, 32, &eccKey);
// Get signature length and allocate buffer
sigLen = wc_SignatureGetSize(sig_type, &eccKey, sizeof(eccKey));
sigBuf = malloc(sigLen);
// Perform signature verification using public key
ret = wc_SignatureGenerate(
WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_ECC,
fileBuf, fileLen,
sigBuf, &sigLen,
&eccKey, sizeof(eccKey),
&rng);
printf("Signature Generation: %s
(%d)\n", (ret == 0) ? "Pass" : "Fail", ret);
free(sigBuf);
wc_ecc_free(&eccKey);
wc_FreeRng(&rng);
\endcode
\sa wc_SignatureGetSize
\sa wc_SignatureVerify
*/
WOLFSSL_API int wc_SignatureGenerate(
enum wc_HashType hash_type, enum wc_SignatureType sig_type,
const byte* data, word32 data_len,
byte* sig, word32 *sig_len,
const void* key, word32 key_len,
WC_RNG* rng);

View File

@@ -0,0 +1,496 @@
/*!
\ingroup SRP
\brief Initializes the Srp struct for usage.
\return 0 on success.
\return BAD_FUNC_ARG Returns when there's an issue with the arguments such
as srp being null or SrpSide not being SRP_CLIENT_SIDE or SRP_SERVER_SIDE.
\return NOT_COMPILED_IN Returns when a type is passed as an argument but
hasn't been configured in the wolfCrypt build.
\return <0 on error.
\param srp the Srp structure to be initialized.
\param type the hash type to be used.
\param side the side of the communication.
_Example_
\code
Srp srp;
if (wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE) != 0)
{
// Initialization error
}
else
{
wc_SrpTerm(&srp);
}
\endcode
\sa wc_SrpTerm
\sa wc_SrpSetUsername
*/
WOLFSSL_API int wc_SrpInit(Srp* srp, SrpType type, SrpSide side);
/*!
\ingroup SRP
\brief Releases the Srp struct resources after usage.
\return none No returns.
\param srp Pointer to the Srp structure to be terminated.
_Example_
\code
Srp srp;
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE);
// Use srp
wc_SrpTerm(&srp)
\endcode
\sa wc_SrpInit
*/
WOLFSSL_API void wc_SrpTerm(Srp* srp);
/*!
\ingroup SRP
\brief Sets the username. This function MUST be called after wc_SrpInit.
\return 0 Username set successfully.
\return BAD_FUNC_ARG: Return if srp or username is null.
\return MEMORY_E: Returns if there is an issue allocating memory
for srp->user
\return < 0: Error.
\param srp the Srp structure.
\param username the buffer containing the username.
\param size the username size in bytes
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE);
if(wc_SrpSetUsername(&srp, username, usernameSize) != 0)
{
// Error occurred setting username.
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpInit
\sa wc_SrpSetParams
\sa wc_SrpTerm
*/
WOLFSSL_API int wc_SrpSetUsername(Srp* srp, const byte* username, word32 size);
/*!
\ingroup SRP
\brief Sets the srp parameters based on the username.. Must be called
after wc_SrpSetUsername.
\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.
\return <0 Error
\param srp the Srp structure.
\param N the Modulus. N = 2q+1, [q, N] are primes.
\param nSz the N size in bytes.
\param g the Generator modulo N.
\param gSz the g size in bytes
\param salt a small random salt. Specific for each username.
\param saltSz the salt size in bytes
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE);
wc_SrpSetUsername(&srp, username, usernameSize);
if(wc_SrpSetParams(&srp, N, sizeof(N), g, sizeof(g), salt,
sizeof(salt)) != 0)
{
// Error setting params
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpInit
\sa wc_SrpSetUsername
\sa wc_SrpTerm
*/
WOLFSSL_API int wc_SrpSetParams(Srp* srp, const byte* N, word32 nSz,
const byte* g, word32 gSz,
const byte* salt, word32 saltSz);
/*!
\ingroup SRP
\brief Sets the password. Setting the password does not persists the
clear password data in the srp structure. The client calculates
x = H(salt + H(user:pswd)) and stores it in the auth field. This function
MUST be called after wc_SrpSetParams and is CLIENT SIDE ONLY.
\return 0 Success
\return BAD_FUNC_ARG Returns if srp or password is null or if srp->side
is not set to SRP_CLIENT_SIDE.
\return SRP_CALL_ORDER_E Returns when wc_SrpSetPassword is called out
of order.
\return <0 Error
\param srp The Srp structure.
\param password The buffer containing the password.
\param size The size of the password in bytes.
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
byte password[] = "password";
word32 passwordSize = 8;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE);
wc_SrpSetUsername(&srp, username, usernameSize);
wc_SrpSetParams(&srp, N, sizeof(N), g, sizeof(g), salt, sizeof(salt));
if(wc_SrpSetPassword(&srp, password, passwordSize) != 0)
{
// Error setting password
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpInit
\sa wc_SrpSetUsername
\sa wc_SrpSetParams
*/
WOLFSSL_API int wc_SrpSetPassword(Srp* srp, const byte* password, word32 size);
/*!
\ingroup SRP
\brief Sets the verifier. This function MUST be called after
wc_SrpSetParams and is SERVER SIDE ONLY.
\return 0 Success
\return BAD_FUNC_ARG Returned if srp or verifier is null or
srp->side is not SRP_SERVER_SIDE.
\return <0 Error
\param srp The Srp structure.
\param verifier The structure containing the verifier.
\param size The verifier size in bytes.
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_SERVER_SIDE);
wc_SrpSetUsername(&srp, username, usernameSize);
wc_SrpSetParams(&srp, N, sizeof(N), g, sizeof(g), salt, sizeof(salt))
byte verifier[] = { }; // Contents of some verifier
if(wc_SrpSetVerifier(&srp, verifier, sizeof(verifier)) != 0)
{
// Error setting verifier
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpInit
\sa wc_SrpSetParams
\sa wc_SrpGetVerifier
*/
WOLFSSL_API int wc_SrpSetVerifier(Srp* srp, const byte* verifier, word32 size);
/*!
\ingroup SRP
\brief Gets the verifier. The client calculates the verifier
with v = g ^ x % N.
This function MAY be called after wc_SrpSetPassword and
is CLIENT SIDE ONLY.
\return 0 Success
\return BAD_FUNC_ARG Returned if srp, verifier or size is null
or if srp->side is not SRP_CLIENT_SIDE.
\return SRP_CALL_ORDER_E Returned if wc_SrpGetVerifier is called
out of order.
\return <0 Error
\param srp The Srp structure.
\param verifier The buffer to write the verifier.
\param size Buffer size in bytes. Updated with the verifier size.
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
byte password[] = "password";
word32 passwordSize = 8;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
byte v[64];
word32 vSz = 0;
vSz = sizeof(v);
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE);
wc_SrpSetUsername(&srp, username, usernameSize);
wc_SrpSetParams(&srp, N, sizeof(N), g, sizeof(g), salt, sizeof(salt))
wc_SrpSetPassword(&srp, password, passwordSize)
if( wc_SrpGetVerifier(&srp, v, &vSz ) != 0)
{
// Error getting verifier
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpSetVerifier
\sa wc_SrpSetPassword
*/
WOLFSSL_API int wc_SrpGetVerifier(Srp* srp, byte* verifier, word32* size);
/*!
\ingroup SRP
\brief Sets the private ephemeral value. The private ephemeral value
is known as:
a at the client side. a = random()
b at the server side. b = random()
This function is handy for unit test cases or if the developer wants
to use an external
random source to set the ephemeral value. This function MAY be called
before wc_SrpGetPublic.
\return 0 Success
\return BAD_FUNC_ARG Returned if srp, private, or size is null.
\return SRP_CALL_ORDER_E Returned if wc_SrpSetPrivate is called out
of order.
\return <0 Error
\param srp the Srp structure.
\param priv the ephemeral value.
\param size the private size in bytes.
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
byte verifier = { }; // Contents of some verifier
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_SERVER_SIDE);
wc_SrpSetUsername(&srp, username, usernameSize);
wc_SrpSetParams(&srp, N, sizeof(N), g, sizeof(g), salt, sizeof(salt))
wc_SrpSetVerifier(&srp, verifier, sizeof(verifier))
byte b[] = { }; // Some ephemeral value
if( wc_SrpSetPrivate(&srp, b, sizeof(b)) != 0)
{
// Error setting private ephemeral
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpGetPublic
*/
WOLFSSL_API int wc_SrpSetPrivate(Srp* srp, const byte* priv, word32 size);
/*!
\ingroup SRP
\brief Gets the public ephemeral value. The public ephemeral value
is known as:
A at the client side. A = g ^ a % N
B at the server side. B = (k * v + (g ˆ b % N)) % N
This function MUST be called after wc_SrpSetPassword or wc_SrpSetVerifier.
The function wc_SrpSetPrivate may be called before wc_SrpGetPublic.
\return 0 Success
\return BAD_FUNC_ARG Returned if srp, pub, or size is null.
\return SRP_CALL_ORDER_E Returned if wc_SrpGetPublic is called out
of order.
\return BUFFER_E Returned if size < srp.N.
\return <0 Error
\param srp the Srp structure.
\param pub the buffer to write the public ephemeral value.
\param size the the buffer size in bytes. Will be updated with
the ephemeral value size.
_Example_
\code
Srp srp;
byte username[] = "user";
word32 usernameSize = 4;
byte password[] = "password";
word32 passwordSize = 8;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
wc_SrpInit(&srp, SRP_TYPE_SHA, SRP_CLIENT_SIDE);
wc_SrpSetUsername(&srp, username, usernameSize);
wc_SrpSetParams(&srp, N, sizeof(N), g, sizeof(g), salt, sizeof(salt));
wc_SrpSetPassword(&srp, password, passwordSize)
byte public[64];
word32 publicSz = 0;
if( wc_SrpGetPublic(&srp, public, &publicSz) != 0)
{
// Error getting public ephemeral
}
wc_SrpTerm(&srp);
\endcode
\sa wc_SrpSetPrivate
\sa wc_SrpSetPassword
\sa wc_SrpSetVerifier
*/
WOLFSSL_API int wc_SrpGetPublic(Srp* srp, byte* pub, word32* size);
/*!
\ingroup SRP
\brief Computes the session key. The key can be accessed at
srp->key after success.
\return 0 Success
\return BAD_FUNC_ARG Returned if srp, clientPubKey, or serverPubKey
or if clientPubKeySz or serverPubKeySz is 0.
\return SRP_CALL_ORDER_E Returned if wc_SrpComputeKey is called out
of order.
\return <0 Error
\param srp the Srp structure.
\param clientPubKey the client's public ephemeral value.
\param clientPubKeySz the client's public ephemeral value size.
\param serverPubKey the server's public ephemeral value.
\param serverPubKeySz the server's public ephemeral value size.
_Example_
\code
Srp server;
byte username[] = "user";
word32 usernameSize = 4;
byte password[] = "password";
word32 passwordSize = 8;
byte N[] = { }; // Contents of byte array N
byte g[] = { }; // Contents of byte array g
byte salt[] = { }; // Contents of byte array salt
byte verifier[] = { }; // Contents of some verifier
byte serverPubKey[] = { }; // Contents of server pub key
word32 serverPubKeySize = sizeof(serverPubKey);
byte clientPubKey[64];
word32 clientPubKeySize = 64;
wc_SrpInit(&server, SRP_TYPE_SHA, SRP_SERVER_SIDE);
wc_SrpSetUsername(&server, username, usernameSize);
wc_SrpSetParams(&server, N, sizeof(N), g, sizeof(g), salt, sizeof(salt));
wc_SrpSetVerifier(&server, verifier, sizeof(verifier));
wc_SrpGetPublic(&server, serverPubKey, &serverPubKeySize);
wc_SrpComputeKey(&server, clientPubKey, clientPubKeySz,
serverPubKey, serverPubKeySize)
wc_SrpTerm(&server);
\endcode
\sa wc_SrpGetPublic
*/
WOLFSSL_API int wc_SrpComputeKey(Srp* srp,
byte* clientPubKey, word32 clientPubKeySz,
byte* serverPubKey, word32 serverPubKeySz);
/*!
\ingroup SRP
\brief Gets the proof. This function MUST be called after wc_SrpComputeKey.
\return 0 Success
\return BAD_FUNC_ARG Returns if srp, proof, or size is null.
\return BUFFER_E Returns if size is less than the hash size of srp->type.
\return <0 Error
\param srp the Srp structure.
\param proof the peers proof.
\param size the proof size in bytes.
_Example_
\code
Srp cli;
byte clientProof[SRP_MAX_DIGEST_SIZE];
word32 clientProofSz = SRP_MAX_DIGEST_SIZE;
// Initialize Srp following steps from previous examples
if (wc_SrpGetProof(&cli, clientProof, &clientProofSz) != 0)
{
// Error getting proof
}
\endcode
\sa wc_SrpComputeKey
*/
WOLFSSL_API int wc_SrpGetProof(Srp* srp, byte* proof, word32* size);
/*!
\ingroup SRP
\brief Verifies the peers proof. This function MUST be called before
wc_SrpGetSessionKey.
\return 0 Success
\return <0 Error
\param srp the Srp structure.
\param proof the peers proof.
\param size the proof size in bytes.
_Example_
\code
Srp cli;
Srp srv;
byte clientProof[SRP_MAX_DIGEST_SIZE];
word32 clientProofSz = SRP_MAX_DIGEST_SIZE;
// Initialize Srp following steps from previous examples
// First get the proof
wc_SrpGetProof(&cli, clientProof, &clientProofSz)
if (wc_SrpVerifyPeersProof(&srv, clientProof, clientProofSz) != 0)
{
// Error verifying proof
}
\endcode
\sa wc_SrpGetSessionKey
\sa wc_SrpGetProof
\sa wc_SrpTerm
*/
WOLFSSL_API int wc_SrpVerifyPeersProof(Srp* srp, byte* proof, word32 size);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
/*!
\ingroup Math
\brief This function checks the runtime fastmath settings for the maximum
size of an integer. It is important when a user is using a wolfCrypt
library independently, as the FP_SIZE must match for each library in order
for math to work correctly. This check is defined as
CheckFastMathSettings(), which simply compares CheckRunTimeFastMath
and FP_SIZE, returning 0 if there is a mismatch, or 1 if they match.
\return FP_SIZE Returns FP_SIZE, corresponding to the max size
available for the math library.
\param none No parameters.
_Example_
\code
if (CheckFastMathSettings() != 1) {
return err_sys("Build vs. runtime fastmath FP_MAX_BITS mismatch\n");
}
// This is converted by the preprocessor to:
// if ( (CheckRunTimeFastMath() == FP_SIZE) != 1) {
// and confirms that the fast math settings match
// the compile time settings
\endcode
\sa CheckRunTimeSettings
*/
WOLFSSL_API word32 CheckRunTimeFastMath(void);

View File

@@ -0,0 +1,169 @@
/*!
\ingroup Memory
\brief This is not actually a function, but rather a preprocessor macro,
which allows the user to substitute in their own malloc, realloc, and free
functions in place of the standard C memory functions.
To use external memory functions, define XMALLOC_USER. This will cause the
memory functions to be replaced by external functions of the form:
extern void *XMALLOC(size_t n, void* heap, int type);
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
extern void XFREE(void *p, void* heap, int type);
To use the basic C memory functions in place of wolfSSL_Malloc,
wolfSSL_Realloc, wolfSSL_Free, define NO_WOLFSSL_MEMORY. This
will replace the memory functions with:
#define XMALLOC(s, h, t) ((void)h, (void)t, malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) free((xp));}
#define XREALLOC(p, n, h, t) realloc((p), (n))
If none of these options are selected, the system will default to use
the wolfSSL memory functions. A user can set custom memory functions
through callback hooks, (see wolfSSL_Malloc,
wolfSSL_Realloc, wolfSSL_Free). This option will replace the
memory functions with:
#define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));}
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n))
\return pointer Return a pointer to allocated memory on success
\return NULL on failure
\param s size of memory to allocate
\param h (used by custom XMALLOC function) pointer to the heap to use
\param t memory allocation types for user hints. See enum in types.h
_Example_
\code
int* 10 ints = XMALLOC(10 * sizeof(int), NULL, DYNAMIC_TYPE_TMP_BUFFER);
if ( ints == NULL) {
// error allocating space
return MEMORY_E;
}
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Realloc
\sa wolfSSL_Free
\sa wolfSSL_SetAllocators
*/
WOLFSSL_API void* XMALLOC(size_t n, void* heap, int type);
/*!
\ingroup Memory
\brief This is not actually a function, but rather a preprocessor macro,
which allows the user to substitute in their own malloc, realloc, and
free functions in place of the standard C memory functions.
To use external memory functions, define XMALLOC_USER. This will cause the
memory functions to be replaced by external functions of the form:
extern void *XMALLOC(size_t n, void* heap, int type);
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
extern void XFREE(void *p, void* heap, int type);
To use the basic C memory functions in place of wolfSSL_Malloc,
wolfSSL_Realloc, wolfSSL_Free, define NO_WOLFSSL_MEMORY. This will
replace the memory functions with:
#define XMALLOC(s, h, t) ((void)h, (void)t, malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) free((xp));}
#define XREALLOC(p, n, h, t) realloc((p), (n))
If none of these options are selected, the system will default to
use the wolfSSL memory functions. A user can set custom memory
functions through callback hooks, (see wolfSSL_Malloc,
wolfSSL_Realloc, wolfSSL_Free). This option will replace
the memory functions with:
#define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));}
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n))
\return Return a pointer to allocated memory on success
\return NULL on failure
\param p pointer to the address to reallocate
\param n size of memory to allocate
\param h (used by custom XREALLOC function) pointer to the heap to use
\param t memory allocation types for user hints. See enum in types.h
_Example_
\code
none
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Realloc
\sa wolfSSL_Free
\sa wolfSSL_SetAllocators
*/
WOLFSSL_API void* XREALLOC(void *p, size_t n, void* heap, int type);
/*!
\ingroup Memory
\brief This is not actually a function, but rather a preprocessor macro,
which allows the user to substitute in their own malloc, realloc, and
free functions in place of the standard C memory functions.
To use external memory functions, define XMALLOC_USER. This will cause
the memory functions to be replaced by external functions of the form:
extern void *XMALLOC(size_t n, void* heap, int type);
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
extern void XFREE(void *p, void* heap, int type);
To use the basic C memory functions in place of wolfSSL_Malloc,
wolfSSL_Realloc, wolfSSL_Free, define NO_WOLFSSL_MEMORY. This
will replace the memory functions with:
#define XMALLOC(s, h, t) ((void)h, (void)t, malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) free((xp));}
#define XREALLOC(p, n, h, t) realloc((p), (n))
If none of these options are selected, the system will default to use
the wolfSSL memory functions. A user can set custom memory functions
through callback hooks, (see wolfSSL_Malloc, wolfSSL_Realloc,
wolfSSL_Free). This option will replace the memory functions with:
#define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s)))
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));}
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n))
\return none No returns.
\param p pointer to the address to free
\param h (used by custom XFREE function) pointer to the heap to use
\param t memory allocation types for user hints. See enum in types.h
_Example_
\code
int* 10 ints = XMALLOC(10 * sizeof(int), NULL, DYNAMIC_TYPE_TMP_BUFFER);
if ( ints == NULL) {
// error allocating space
return MEMORY_E;
}
\endcode
\sa wolfSSL_Malloc
\sa wolfSSL_Realloc
\sa wolfSSL_Free
\sa wolfSSL_SetAllocators
*/
WOLFSSL_API void XFREE(void *p, void* heap, int type);
/*!
\ingroup Math
\brief This function checks the compile time class settings. It is
important when a user is using a wolfCrypt library independently, as
the settings must match between libraries for math to work correctly.
This check is defined as CheckCtcSettings(), which simply compares
CheckRunTimeSettings and CTC_SETTINGS, returning 0 if there is a
mismatch, or 1 if they match.
\return settings Returns the runtime CTC_SETTINGS (Compile Time Settings)
\param none No Parameters.
_Example_
\code
if (CheckCtcSettings() != 1) {
return err_sys("Build vs. runtime math mismatch\n");
}
// This is converted by the preprocessor to:
// if ( (CheckCtcSettings() == CTC_SETTINGS) != 1) {
// and will compare whether the compile time class settings
// match the current settings
\endcode
\sa CheckRunTimeFastMath
*/
WOLFSSL_API word32 CheckRunTimeSettings(void);

View File

@@ -0,0 +1,208 @@
/*!
\ingroup AES
\brief Decrypts a cipher from the input buffer in, and places the
resulting plain text in the output buffer out using cipher block
chaining with AES. This function does not require an AES structure
to be initialized. Instead, it takes in a key and an iv
(initialization vector) and uses these to initialize an
AES object and then decrypt the cipher text.
\return 0 On successfully decrypting message
\return BAD_ALIGN_E Returned on block align error
\return BAD_FUNC_ARG Returned if key length is invalid or AES object
is null during AesSetIV
\return MEMORY_E Returned if WOLFSSL_SMALL_STACK is enabled and
XMALLOC fails to instantiate an AES object.
\param out pointer to the output buffer in which to store the plain
text of the decrypted message
\param in pointer to the input buffer containing cipher text to be
decrypted
\param inSz size of input message
\param key 16, 24, or 32 byte secret key for decryption
\param keySz size of key used for decryption
_Example_
\code
int ret = 0;
byte key[] = { some 16, 24, or 32 byte key };
byte iv[] = { some 16 byte iv };
byte cipher[AES_BLOCK_SIZE * n]; //n being a positive integer making
cipher some multiple of 16 bytes
// fill cipher with cipher text
byte plain [AES_BLOCK_SIZE * n];
if ((ret = wc_AesCbcDecryptWithKey(plain, cipher, AES_BLOCK_SIZE, key,
AES_BLOCK_SIZE, iv)) != 0 ) {
// Decrypt Error
}
\endcode
\sa wc_AesSetKey
\sa wc_AesSetIV
\sa wc_AesCbcEncrypt
\sa wc_AesCbcDecrypt
*/
WOLFSSL_API int wc_AesCbcDecryptWithKey(byte* out, const byte* in, word32 inSz,
const byte* key, word32 keySz,
const byte* iv);
/*!
\ingroup 3DES
\brief This function decrypts the input ciphertext, in, and stores the
resulting plaintext in the output buffer, out. It uses DES encryption
with cipher block chaining (CBC) mode. This function is a substitute
for wc_Des_CbcDecrypt, allowing the user to decrypt a message without
directly instantiating a Des structure.
\return 0 Returned upon successfully decrypting the given ciphertext
\return MEMORY_E Returned if there is an error allocating space for a
Des structure
\param out pointer to the buffer in which to store the decrypted plaintext
\param in pointer to the input buffer containing the encrypted ciphertext
\param sz length of the ciphertext to decrypt
\param key pointer to the buffer containing the 8 byte key to use for
decryption
\param iv pointer to the buffer containing the 8 byte iv to use for
decryption. If no iv is provided, the iv defaults to 0
_Example_
\code
int ret;
byte key[] = { // initialize with 8 byte key };
byte iv[] = { // initialize with 8 byte iv };
byte cipher[] = { // initialize with ciphertext };
byte decoded[sizeof(cipher)];
if ( wc_Des_CbcDecryptWithKey(decoded, cipher, sizeof(cipher), key,
iv) != 0) {
// error decrypting message
}
\endcode
\sa wc_Des_CbcDecrypt
*/
WOLFSSL_API int wc_Des_CbcDecryptWithKey(byte* out,
const byte* in, word32 sz,
const byte* key, const byte* iv);
/*!
\ingroup 3DES
\brief This function encrypts the input plaintext, in, and stores the
resulting ciphertext in the output buffer, out. It uses DES encryption
with cipher block chaining (CBC) mode. This function is a substitute
for wc_Des_CbcEncrypt, allowing the user to encrypt a message without
directly instantiating a Des structure.
\return 0 Returned after successfully encrypting data.
\return MEMORY_E Returned if there's an error allocating memory for a
Des structure.
\return <0 Returned on any error during encryption.
\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.
\param iv Initialization vector
_Example_
\code
byte key[] = { // initialize with 8 byte key };
byte iv[] = { // initialize with 8 byte iv };
byte in[] = { // Initialize with plaintext };
byte out[sizeof(in)];
if ( wc_Des_CbcEncryptWithKey(&out, in, sizeof(in), key, iv) != 0)
{
// error encrypting message
}
\endcode
\sa wc_Des_CbcDecryptWithKey
\sa wc_Des_CbcEncrypt
*/
WOLFSSL_API int wc_Des_CbcEncryptWithKey(byte* out,
const byte* in, word32 sz,
const byte* key, const byte* iv);
/*!
\ingroup 3DES
\brief This function encrypts the input plaintext, in, and stores
the resulting ciphertext in the output buffer, out. It uses Triple
DES (3DES) encryption with cipher block chaining (CBC) mode. This
function is a substitute for wc_Des3_CbcEncrypt, allowing the user
to encrypt a message without directly instantiating a Des3 structure.
\return 0 Returned after successfully encrypting data.
\return MEMORY_E Returned if there's an error allocating memory for
a Des structure.
\return <0 Returned on any error during encryption.
\parma 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.
\param iv Initialization vector
_Example_
\code
byte key[] = { // initialize with 8 byte key };
byte iv[] = { // initialize with 8 byte iv };
byte in[] = { // Initialize with plaintext };
byte out[sizeof(in)];
if ( wc_Des3_CbcEncryptWithKey(&out, in, sizeof(in), key, iv) != 0)
{
// error encrypting message
}
\endcode
\sa wc_Des3_CbcDecryptWithKey
\sa wc_Des_CbcEncryptWithKey
\sa wc_Des_CbcDecryptWithKey
*/
WOLFSSL_API int wc_Des3_CbcEncryptWithKey(byte* out,
const byte* in, word32 sz,
const byte* key, const byte* iv);
/*!
\ingroup 3DES
\brief This function decrypts the input ciphertext, in, and stores
the resulting plaintext in the output buffer, out. It uses Triple
Des (3DES) encryption with cipher block chaining (CBC) mode. This
function is a substitute for wc_Des3_CbcDecrypt, allowing the user
to decrypt a message without directly instantiating a Des3 structure.
\return 0 Returned upon successfully decrypting the given ciphertext
\return MEMORY_E Returned if there is an error allocating space for
a Des structure
\param out pointer to the buffer in which to store the decrypted plaintext
\param in pointer to the input buffer containing the encrypted ciphertext
\param sz length of the ciphertext to decrypt
\param key pointer to the buffer containing the 24 byte key to use
for decryption
\param iv pointer to the buffer containing the 8 byte iv to use for
decryption. If no iv is provided, the iv defaults to 0
_Example_
\code
int ret;
byte key[] = { // initialize with 24 byte key };
byte iv[] = { // initialize with 8 byte iv };
byte cipher[] = { // initialize with ciphertext };
byte decoded[sizeof(cipher)];
if ( wc_Des3_CbcDecryptWithKey(decoded, cipher, sizeof(cipher),
key, iv) != 0) {
// error decrypting message
}
\endcode
\sa wc_Des3_CbcDecrypt
*/
WOLFSSL_API int wc_Des3_CbcDecryptWithKey(byte* out,
const byte* in, word32 sz,
const byte* key, const byte* iv);

View File

@@ -0,0 +1,43 @@
/*!
\ingroup wolfCrypt
\brief Used to initialize resources used by wolfCrypt.
\return 0 upon success.
\return <0 upon failure of init resources.
\param none No parameters.
_Example_
\code
...
if (wolfCrypt_Init() != 0) {
WOLFSSL_MSG("Error with wolfCrypt_Init call");
}
\endcode
\sa wolfCrypt_Cleanup
*/
WOLFSSL_API int wolfCrypt_Init(void);
/*!
\ingroup wolfCrypt
\brief Used to clean up resources used by wolfCrypt.
\return 0 upon success.
\return <0 upon failure of cleaning up resources.
\param none No parameters.
_Example_
\code
...
if (wolfCrypt_Cleanup() != 0) {
WOLFSSL_MSG("Error with wolfCrypt_Cleanup call");
}
\endcode
\sa wolfCrypt_Init
*/
WOLFSSL_API int wolfCrypt_Cleanup(void);

View File

@@ -0,0 +1,526 @@
/*!
\brief This function is the receive embedded callback.
\return Success This function returns the number of bytes read.
\return WOLFSSL_CBIO_ERR_WANT_READ returned with a “Would block” message
if the last error was SOCKET_EWOULDBLCOK or SOCKET_EAGAIN.
\return WOLFSSL_CBIO_ERR_TIMEOUT returned with a “Socket timeout” message.
\return WOLFSSL_CBIO_ERR_CONN_RST returned with a “Connection reset”
message if the last error was SOCKET_ECONNRESET.
\return WOLFSSL_CBIO_ERR_ISR returned with a “Socket interrupted” message
if the last error was SOCKET_EINTR.
\return WOLFSSL_CBIO_ERR_WANT_READ returned with a “Connection refused”
messag if the last error was SOCKET_ECONNREFUSED.
\return WOLFSSL_CBIO_ERR_CONN_CLOSE returned with a “Connection aborted”
message if the last error was SOCKET_ECONNABORTED.
\return WOLFSSL_CBIO_ERR_GENERAL returned with a “General error” message
if the last error was not specified.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param buf a char pointer representation of the buffer.
\param sz the size of the buffer.
\param ctx a void pointer to user registered context. In the default case
the ctx is a socket descriptor pointer.
_Example_
\code
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
WOLFSSL* ssl = wolfSSL_new(ctx);
char* buf;
int sz;
void* ctx;
int bytesRead = EmbedReceive(ssl, buf, sz, ctx);
if(bytesRead <= 0){
// There were no bytes read. Failure case.
}
\endcode
\sa wolfSSL_dtls_get_current_timeout
\sa TranslateReturnCode
\sa RECV_FUNCTION
*/
WOLFSSL_API int EmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
/*!
\brief This function is the send embedded callback.
\return Success This function returns the number of bytes sent.
\return WOLFSSL_CBIO_ERR_WANT_WRITE returned with a “Would block” message
if the last error was SOCKET_EWOULDBLOCK or SOCKET_EAGAIN.
\return WOLFSSL_CBIO_ERR_CONN_RST returned with a “Connection reset”
message if the last error was SOCKET_ECONNRESET.
\return WOLFSSL_CBIO_ERR_ISR returned with a “Socket interrupted” message
if the last error was SOCKET_EINTR.
\return WOLFSSL_CBIO_ERR_CONN_CLOSE returned with a “Socket EPIPE” message
if the last error was SOCKET_EPIPE.
\return WOLFSSL_CBIO_ERR_GENERAL returned with a “General error” message
if the last error was not specified.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param buf a char pointer representing the buffer.
\param sz the size of the buffer.
\param ctx a void pointer to user registered context.
_Example_
\code
WOLFSSL* ssl = wolfSSL_new(ctx);
char* buf;
int sz;
void* ctx;
int dSent = EmbedSend(ssl, buf, sz, ctx);
if(dSent <= 0){
// No byes sent. Failure case.
}
\endcode
\sa TranslateReturnCode
\sa SEND_FUNCTION
\sa LastError
\sa InitSSL_Ctx
\sa LastError
*/
WOLFSSL_API int EmbedSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
/*!
\brief This function is the receive embedded callback.
\return Success This function returns the nb bytes read if the execution
was successful.
\return WOLFSSL_CBIO_ERR_WANT_READ if the connection refused or if a
would block error was thrown in the function.
\return WOLFSSL_CBIO_ERR_TIMEOUT returned if the socket timed out.
\return WOLFSSL_CBIO_ERR_CONN_RST returned if the connection reset.
\return WOLFSSL_CBIO_ERR_ISR returned if the socket was interrupted.
\return WOLFSSL_CBIO_ERR_GENERAL returned if there was a general error.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param buf a constant char pointer to the buffer.
\param sz an int type representing the size of the buffer.
\param ctx a void pointer to the WOLFSSL_CTX context.
_Example_
\code
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( protocol method );
WOLFSSL* ssl = WOLFSSL_new(ctx);
char* buf;
int sz = sizeof(buf)/sizeof(char);
(void*)ctx;
int nb = EmbedReceiveFrom(ssl, buf, sz, ctx);
if(nb > 0){
// nb is the number of bytes written and is positive
}
\endcode
\sa TranslateReturnCode
\sa RECVFROM_FUNCTION
\sa Setsockopt
*/
WOLFSSL_API int EmbedReceiveFrom(WOLFSSL* ssl, char* buf, int sz, void*);
/*!
\brief This function is the send embedded callback.
\return Success This function returns the number of bytes sent.
\return WOLFSSL_CBIO_ERR_WANT_WRITE returned with a “Would Block” message
if the last error was either SOCKET_EWOULDBLOCK or SOCKET_EAGAIN error.
\return WOLFSSL_CBIO_ERR_CONN_RST returned with a “Connection reset”
message if the last error was SOCKET_ECONNRESET.
\return WOLFSSL_CBIO_ERR_ISR returned with a “Socket interrupted” message
if the last error was SOCKET_EINTR.
\return WOLFSSL_CBIO_ERR_CONN_CLOSE returned with a “Socket EPIPE” message
if the last error was WOLFSSL_CBIO_ERR_CONN_CLOSE.
\return WOLFSSL_CBIO_ERR_GENERAL returned with a “General error” message
if the last error was not specified.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param buf a char pointer representing the buffer.
\param sz the size of the buffer.
\param ctx a void pointer to the user registered context. The default case
is a WOLFSSL_DTLS_CTX sructure.
_Example_
\code
WOLFSSL* ssl;
char* buf;
int sz;
void* ctx;
int sEmbed = EmbedSendto(ssl, buf, sz, ctx);
if(sEmbed <= 0){
// No bytes sent. Failure case.
}
\endcode
\sa LastError
\sa EmbedSend
\sa EmbedReceive
*/
WOLFSSL_API int EmbedSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
/*!
\brief This function is the DTLS Generate Cookie callback.
\return Success This function returns the number of bytes copied
into the buffer.
\return GEN_COOKIE_E returned if the getpeername failed in
EmbedGenerateCookie.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param buf byte pointer representing the buffer. It is the destination
from XMEMCPY().
\param sz the size of the buffer.
\param ctx a void pointer to user registered context.
_Example_
\code
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
WOLFSSL* ssl = wolfSSL_new(ctx);
byte buffer[BUFFER_SIZE];
int sz = sizeof(buffer)/sizeof(byte);
void* ctx;
int ret = EmbedGenerateCookie(ssl, buffer, sz, ctx);
if(ret > 0){
// EmbedGenerateCookie code block for success
}
\endcode
\sa wc_ShaHash
\sa EmbedGenerateCookie
\sa XMEMCPY
\sa XMEMSET
*/
WOLFSSL_API int EmbedGenerateCookie(WOLFSSL* ssl, unsigned char* buf,
int sz, void*);
/*!
\brief This function frees the response buffer.
\return none No returns.
\param ctx a void pointer to heap hint.
\param resp a byte pointer representing the response.
_Example_
\code
void* ctx;
byte* resp; // Response buffer.
EmbedOcspRespFree(ctx, resp);
\endcode
\sa XFREE
*/
WOLFSSL_API void EmbedOcspRespFree(void*, unsigned char*);
/*!
\brief This function registers a receive callback for wolfSSL to get input
data. By default, wolfSSL uses EmbedReceive() as the callback which uses
the systems TCP recv() function. The user can register a function to get
input from memory, some other network module, or from anywhere. Please see
the EmbedReceive() function in src/io.c as a guide for how the function
should work and for error codes. In particular, IO_ERR_WANT_READ should
be returned for non blocking receive when no data is ready.
\return none no Returns.
\param ctx pointer to the SSL context, created with wolfSSL_CTX_new().
\param callback function to be registered as the receive callback for the
wolfSSL context, ctx. The signature of this function must follow that as
shown above in the Synopsis section.
_Example_
\code
WOLFSSL_CTX* ctx = 0;
// Receive callback prototype
int MyEmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
// Register the custom receive callback with wolfSSL
wolfSSL_CTX_SetIORecv(ctx, MyEmbedReceive);
int MyEmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx)
{
// custom EmbedReceive function
}
\endcode
\sa wolfSSL_CTX_SetIOSend
\sa wolfSSL_SetIOReadCtx
\sa wolfSSL_SetIOWriteCtx
*/
WOLFSSL_API void wolfSSL_CTX_SetIORecv(WOLFSSL_CTX*, CallbackIORecv);
/*!
\brief This function registers a context for the SSL sessions receive
callback function. By default, wolfSSL sets the file descriptor passed to
wolfSSL_set_fd() as the context when wolfSSL is using the systems TCP
library. If youve registered your own receive callback you may want to set
a specific context for the session. For example, if youre using memory
buffers the context may be a pointer to a structure describing where and
how to access the memory buffers.
\return none No returns.
\param ssl pointer to the SSL session, created with wolfSSL_new().
\param rctx pointer to the context to be registered with the SSL sessions
(ssl) receive callback function.
_Example_
\code
int sockfd;
WOLFSSL* ssl = 0;
...
// Manually setting the socket fd as the receive CTX, for example
wolfSSL_SetIOReadCtx(ssl, &sockfd);
...
\endcode
\sa wolfSSL_CTX_SetIORecv
\sa wolfSSL_CTX_SetIOSend
\sa wolfSSL_SetIOWriteCtx
*/
WOLFSSL_API void wolfSSL_SetIOReadCtx( WOLFSSL* ssl, void *ctx);
/*!
\brief This function registers a context for the SSL sessions send
callback function. By default, wolfSSL sets the file descriptor passed to
wolfSSL_set_fd() as the context when wolfSSL is using the systems TCP
library. If youve registered your own send callback you may want to set a
specific context for the session. For example, if youre using memory
buffers the context may be a pointer to a structure describing where and
how to access the memory buffers.
\return none No returns.
\param ssl pointer to the SSL session, created with wolfSSL_new().
\param wctx pointer to the context to be registered with the SSL sessions
(ssl) send callback function.
_Example_
\code
int sockfd;
WOLFSSL* ssl = 0;
...
// Manually setting the socket fd as the send CTX, for example
wolfSSL_SetIOWriteCtx(ssl, &sockfd);
...
\endcode
\sa wolfSSL_CTX_SetIORecv
\sa wolfSSL_CTX_SetIOSend
\sa wolfSSL_SetIOReadCtx
*/
WOLFSSL_API void wolfSSL_SetIOWriteCtx(WOLFSSL* ssl, void *ctx);
/*!
\ingroup IO
\brief This function returns the IOCB_ReadCtx member of the WOLFSSL struct.
\return pointer This function returns a void pointer to the IOCB_ReadCtx
member of the WOLFSSL structure.
\return NULL returned if the WOLFSSL struct is NULL.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
_Example_
\code
WOLFSSL* ssl = wolfSSL_new(ctx);
void* ioRead;
...
ioRead = wolfSSL_GetIOReadCtx(ssl);
if(ioRead == NULL){
// Failure case. The ssl object was NULL.
}
\endcode
\sa wolfSSL_GetIOWriteCtx
\sa wolfSSL_SetIOReadFlags
\sa wolfSSL_SetIOWriteCtx
\sa wolfSSL_SetIOReadCtx
\sa wolfSSL_CTX_SetIOSend
*/
WOLFSSL_API void* wolfSSL_GetIOReadCtx( WOLFSSL* ssl);
/*!
\ingroup IO
\brief This function returns the IOCB_WriteCtx member of the WOLFSSL structure.
\return pointer This function returns a void pointer to the IOCB_WriteCtx
member of the WOLFSSL structure.
\return NULL returned if the WOLFSSL struct is NULL.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
_Example_
\code
WOLFSSL* ssl;
void* ioWrite;
...
ioWrite = wolfSSL_GetIOWriteCtx(ssl);
if(ioWrite == NULL){
// The funciton returned NULL.
}
\endcode
\sa wolfSSL_GetIOReadCtx
\sa wolfSSL_SetIOWriteCtx
\sa wolfSSL_SetIOReadCtx
\sa wolfSSL_CTX_SetIOSend
*/
WOLFSSL_API void* wolfSSL_GetIOWriteCtx(WOLFSSL* ssl);
/*!
\brief This function sets the flags for the receive callback to use for
the given SSL session. The receive callback could be either the default
wolfSSL EmbedReceive callback, or a custom callback specified by the user
(see wolfSSL_CTX_SetIORecv). The default flag value is set internally by
wolfSSL to the value of 0. The default wolfSSL receive callback uses the
recv() function to receive data from the socket. From the recv() man page:
“The flags argument to a recv() function is formed by or'ing one or more
of the values: MSG_OOB process out-of-band data, MSG_PEEK peek at incoming
message, MSG_WAITALL wait for full request or error. The MSG_OOB flag
requests receipt of out-of-band data that would not be received in the
normal data stream. Some protocols place expedited data at the head of
the normal data queue, and thus this flag cannot be used with such
protocols. The MSG_PEEK flag causes the receive operation to return
data from the beginning of the receive queue without removing that data
from the queue. Thus, a subsequent receive call will return the same data.
The MSG_WAITALL flag requests that the operation block until the full
request is satisfied. However, the call may still return less data than
requested if a signal is caught, an error or disconnect occurs, or the next
data to be received is of a different type than that returned.”
\return none No returns.
\param ssl pointer to the SSL session, created with wolfSSL_new().
\param flags value of the I/O read flags for the specified SSL
session (ssl).
_Example_
\code
WOLFSSL* ssl = 0;
...
// Manually setting recv flags to 0
wolfSSL_SetIOReadFlags(ssl, 0);
...
\endcode
\sa wolfSSL_CTX_SetIORecv
\sa wolfSSL_CTX_SetIOSend
\sa wolfSSL_SetIOReadCtx
*/
WOLFSSL_API void wolfSSL_SetIOReadFlags( WOLFSSL* ssl, int flags);
/*!
\brief This function sets the flags for the send callback to use for the
given SSL session. The send callback could be either the default wolfSSL
EmbedSend callback, or a custom callback specified by the user (see
wolfSSL_CTX_SetIOSend). The default flag value is set internally by wolfSSL
to the value of 0. The default wolfSSL send callback uses the send()
function to send data from the socket. From the send() man page: “The
flags parameter may include one or more of the following:
#define MSG_OOB 0x1 // process out-of-band data,
#define MSG_DONTROUTE 0x4 // bypass routing, use direct interface.
The flag MSG_OOB is used to send ``out-of-band'' data on sockets that
support this notion (e.g. SOCK_STREAM); the underlying protocol must also
support ``out-of-band'' data. MSG_DONTROUTE is usually used only by
diagnostic or routing programs.”
\return none No returns.
\param ssl pointer to the SSL session, created with wolfSSL_new().
\param flags value of the I/O send flags for the specified SSL session (ssl).
_Example_
\code
WOLFSSL* ssl = 0;
...
// Manually setting send flags to 0
wolfSSL_SetIOWriteFlags(ssl, 0);
...
\endcode
\sa wolfSSL_CTX_SetIORecv
\sa wolfSSL_CTX_SetIOSend
\sa wolfSSL_SetIOReadCtx
*/
WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags);
/*!
\ingroup IO
\brief This function sets the nxSocket and nxWait members of the nxCtx
struct within the WOLFSSL structure.
\return none No returns.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param nxSocket a pointer to type NX_TCP_SOCKET that is set to the
nxSocket member of the nxCTX structure.
\param waitOption a ULONG type that is set to the nxWait member of
the nxCtx structure.
_Example_
\code
WOLFSSL* ssl = wolfSSL_new(ctx);
NX_TCP_SOCKET* nxSocket;
ULONG waitOption;
if(ssl != NULL || nxSocket != NULL || waitOption <= 0){
wolfSSL_SetIO_NetX(ssl, nxSocket, waitOption);
} else {
// You need to pass in good parameters.
}
\endcode
\sa set_fd
\sa NetX_Send
\sa NetX_Receive
*/
WOLFSSL_API void wolfSSL_SetIO_NetX(WOLFSSL* ssl, NX_TCP_SOCKET* nxsocket,
ULONG waitoption);
/*!
\brief This function sets the callback for the CBIOCookie member of the
WOLFSSL_CTX structure. The CallbackGenCookie type is a function pointer
and has the signature: int (*CallbackGenCookie)(WOLFSSL* ssl, unsigned
char* buf, int sz, void* ctx);
\return none No returns.
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
\param cb a CallbackGenCookie type function pointer with the signature
of CallbackGenCookie.
_Example_
\code
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
WOLFSSL* ssl = wolfSSL_new(ctx);
int SetGenCookieCB(WOLFSSL* ssl, unsigned char* buf, int sz, void* ctx){
// Callback function body.
}
wolfSSL_CTX_SetGenCookie(ssl->ctx, SetGenCookieCB);
\endcode
\sa CallbackGenCookie
*/
WOLFSSL_API void wolfSSL_CTX_SetGenCookie(WOLFSSL_CTX*, CallbackGenCookie);
/*!
\ingroup Setup
\brief This function returns the IOCB_CookieCtx member of the
WOLFSSL structure.
\return pointer The function returns a void pointer value stored in
the IOCB_CookieCtx.
\return NULL if the WOLFSSL struct is NULL
\param ssl a pointer to a WOLFSSL structure, created using wolfSSL_new().
_Example_
\code
WOLFSSL_CTX* ctx = wolfSSL_CTX_new( method );
WOLFSSL* ssl = wolfSSL_new(ctx);
void* cookie;
...
cookie = wolfSSL_GetCookieCtx(ssl);
if(cookie != NULL){
// You have the cookie
}
\endcode
\sa wolfSSL_SetCookieCtx
\sa wolfSSL_CTX_SetGenCookie
*/
WOLFSSL_API void* wolfSSL_GetCookieCtx(WOLFSSL* ssl);

2471
doc/formats/html/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,57 @@
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<div id="footer">
<div class="lowNav">
<p class="footText">Product Information</p>
<ul class="lowNavList">
<a href="https://www.wolfssl.com/products/wolfssl/"><li>wolfSSL TLS Library</li></a>
<a href="https://www.wolfssl.com/products/wolfcrypt/"><li>wolfCrypt Crypto Engine</li></a>
<a href="https://www.wolfssl.com/products/wolfmqtt/"><li>wolfMQTT Client Library</li></a>
<a href="https://www.wolfssl.com/products/wolfssh/"><li>wolfSSH SSH Library</li></a>
<a href="https://www.wolfssl.com/license/"><li>License Information</li></a>
</ul>
</div>
<div class="lowNav">
<p class="footText">Documentation</p>
<ul class="lowNavList">
<a href="https://www.wolfssl.com/docs/wolfssl-manual/"><li>wolfSSL Manual</li></a>
<a href="https://www.wolfssl.com/docs/wolfssl-manual/ch17/"><li>wolfSSL API Reference</li></a>
<a href="https://www.wolfssl.com/docs/wolfssl-manual/ch2/"><li>Building wolfSSL</li></a>
<a href="https://www.wolfssl.com/docs/wolfssl-manual/ch11/"><li>SSL Tutorial</li></a>
<a href="https://www.wolfssl.com/docs/"><li>Additional Documentation</li></a>
</ul>
</div>
<div id="lowCenter">
<p class="footText" id="center">Copyright &#169 2017 wolfSSL Inc.<br>All rights reserved.</p>
<div class="lowNav">
<p class="footText">Help and Support</p>
<ul class="lowNavList">
<a href="https://www.wolfssl.com/forums/"><li>Support Forum</li></a>
<a href="https://www.wolfssl.com/download/support-packages/"><li>Support Packages</li></a>
<a href="https://www.wolfssl.com/docs/consulting/"><li>Consulting Services</li></a>
<a href="https://www.wolfssl.com/docs/security-vulnerabilities/"><li>Vulnerability Info</li></a>
<a href="https://www.wolfssl.com/contact/"><li>Contact Us</li></a>
</ul>
</div>
<div class="lowNav" id="lastLowNav">
<p class="footText">Reference</p>
<ul class="lowNavList">
<a href="https://www.wolfssl.com/docs/wolfssl-manual/appendix-b/"><li>Algorithm/Protocol Reference</li></a>
<a href="https://www.wolfssl.com/docs/media/"><li>Presentations</li></a>
<a href="https://www.wolfssl.com/directory/"><li>Site Directory</li></a>
</ul>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,55 @@
<!-- HTML header for doxygen 1.8.11-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="wolfssl_logo" style="width: 150px; height: 100px; display: inline-block;"><img alt="Logo" src="../images/wolfssl_logo.png" style="width: 150px; height: 100px;"/></div>
<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="wolfssl_logo"><img alt="Logo" src="../images/wolfssl_logo.png"/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">$projectname
<!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber">$projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td style="padding-left: 0.5em;">
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<td>$searchbox</td>
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
function makeTree(data,relPath) {
var result='';
if ('children' in data) {
result+='<ul>';
if (searchEnabled) {
if (serverSide) {
result+='<li id="wolfssl_search"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>';
} else {
result+='<li id="wolfssl_search"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>';
}
}
for (var i in data.children) {
if (relPath+data.children[i].style) {
result+='<li style="'+relPath+data.children[i].style+'"><a href="'+relPath+data.children[i].url+'">'+
data.children[i].text+'</a>'+
makeTree(data.children[i],relPath)+'</li>';
} else {
result+='<li><a href="'+relPath+data.children[i].url+'">'+
data.children[i].text+'</a>'+
makeTree(data.children[i],relPath)+'</li>';
}
}
result+='</ul>';
}
return result;
}
$('#main-nav').append(makeTree(menudata,relPath));
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
$('#main-menu').smartmenus();
}

View File

@@ -0,0 +1,7 @@
var menudata={children:[
{text:"wolfSSL Home",url:"https://www.wolfssl.com/",style:"clear:right;"},
{text:"Doc Home",url:"index.html"},
{text:"Related Pages",url:"pages.html"},
{text:"Modules",url:"modules.html"},
{text:"Data Structures",url:"annotated.html"},
{text:"Files",url:"files.html"}]}

View File

@@ -0,0 +1,277 @@
/*---------------- Search Box */
#FSearchBox {
float: left;
}
#MSearchBox {
white-space : nowrap;
float: left;
margin-top: 8px;
right: 0px;
width: 170px;
height: 24px;
z-index: 102;
}
#MSearchBox .left
{
display:block;
position:absolute;
left:10px;
width:20px;
height:19px;
background:url('search_l.png') no-repeat;
background-position:right;
}
#MSearchSelect {
display:block;
position:absolute;
width:20px;
height:19px;
}
.left #MSearchSelect {
left:4px;
}
.right #MSearchSelect {
right:5px;
}
#MSearchField {
display:block;
position:absolute;
height:19px;
background:url('search_m.png') repeat-x;
border:none;
width:115px;
margin-left:20px;
padding-left:4px;
color: #909090;
outline: none;
font: 9pt Arial, Verdana, sans-serif;
-webkit-border-radius: 0px;
}
#FSearchBox #MSearchField {
margin-left:15px;
}
#MSearchBox .right {
display:block;
position:absolute;
right:10px;
top:8px;
width:20px;
height:19px;
background:url('search_r.png') no-repeat;
background-position:left;
}
#MSearchClose {
display: none;
position: absolute;
top: 4px;
background : none;
border: none;
margin: 0px 4px 0px 0px;
padding: 0px 0px;
outline: none;
}
.left #MSearchClose {
left: 6px;
}
.right #MSearchClose {
right: 2px;
}
.MSearchBoxActive #MSearchField {
color: #000000;
}
/*---------------- Search filter selection */
#MSearchSelectWindow {
display: none;
position: absolute;
left: 0; top: 0;
border: 1px solid #90A5CE;
background-color: #F9FAFC;
z-index: 10001;
padding-top: 4px;
padding-bottom: 4px;
-moz-border-radius: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
}
.SelectItem {
font: 8pt Arial, Verdana, sans-serif;
padding-left: 2px;
padding-right: 12px;
border: 0px;
}
span.SelectionMark {
margin-right: 4px;
font-family: monospace;
outline-style: none;
text-decoration: none;
}
a.SelectItem {
display: block;
outline-style: none;
color: #000000;
text-decoration: none;
padding-left: 6px;
padding-right: 12px;
}
a.SelectItem:focus,
a.SelectItem:active {
color: #000000;
outline-style: none;
text-decoration: none;
}
a.SelectItem:hover {
color: #FFFFFF;
background-color: #3D578C;
outline-style: none;
text-decoration: none;
cursor: pointer;
display: block;
}
/*---------------- Search results window */
iframe#MSearchResults {
width: 60ex;
height: 15em;
}
#MSearchResultsWindow {
display: none;
position: absolute;
left: 0; top: 0;
border: 1px solid #000;
background-color: #EEF1F7;
z-index:10000;
}
/* ----------------------------------- */
#SRIndex {
clear:both;
padding-bottom: 15px;
}
.SREntry {
font-size: 10pt;
padding-left: 1ex;
}
.SRPage .SREntry {
font-size: 8pt;
padding: 1px 5px;
}
body.SRPage {
margin: 5px 2px;
}
.SRChildren {
padding-left: 3ex; padding-bottom: .5em
}
.SRPage .SRChildren {
display: none;
}
.SRSymbol {
font-weight: bold;
color: #425E97;
font-family: Arial, Verdana, sans-serif;
text-decoration: none;
outline: none;
}
a.SRScope {
display: block;
color: #425E97;
font-family: Arial, Verdana, sans-serif;
text-decoration: none;
outline: none;
}
a.SRSymbol:focus, a.SRSymbol:active,
a.SRScope:focus, a.SRScope:active {
text-decoration: underline;
}
span.SRScope {
padding-left: 4px;
}
.SRPage .SRStatus {
padding: 2px 5px;
font-size: 8pt;
font-style: italic;
}
.SRResult {
display: none;
}
DIV.searchresults {
margin-left: 10px;
margin-right: 10px;
}
/*---------------- External search page results */
.searchresult {
background-color: #F0F3F8;
}
.pages b {
color: white;
padding: 5px 5px 3px 5px;
background-image: url("../tab_a.png");
background-repeat: repeat-x;
text-shadow: 0 1px 1px #000000;
}
.pages {
line-height: 17px;
margin-left: 4px;
text-decoration: none;
}
.hl {
font-weight: bold;
}
#searchresults {
margin-bottom: 20px;
}
.searchpages {
margin-top: 10px;
}
@media (max-width: 874px) {
#MSearchBox {
float: right;
position: sticky;
}
}

View File

@@ -0,0 +1,791 @@
function convertToId(search)
{
var result = '';
for (i=0;i<search.length;i++)
{
var c = search.charAt(i);
var cn = c.charCodeAt(0);
if (c.match(/[a-z0-9\u0080-\uFFFF]/))
{
result+=c;
}
else if (cn<16)
{
result+="_0"+cn.toString(16);
}
else
{
result+="_"+cn.toString(16);
}
}
return result;
}
function getXPos(item)
{
var x = 0;
if (item.offsetWidth)
{
while (item && item!=document.body)
{
x += item.offsetLeft;
item = item.offsetParent;
}
}
return x;
}
function getYPos(item)
{
var y = 0;
if (item.offsetWidth)
{
while (item && item!=document.body)
{
y += item.offsetTop;
item = item.offsetParent;
}
}
return y;
}
/* A class handling everything associated with the search panel.
Parameters:
name - The name of the global variable that will be
storing this instance. Is needed to be able to set timeouts.
resultPath - path to use for external files
*/
function SearchBox(name, resultsPath, inFrame, label)
{
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
// ---------- Instance variables
this.name = name;
this.resultsPath = resultsPath;
this.keyTimeout = 0;
this.keyTimeoutLength = 500;
this.closeSelectionTimeout = 300;
this.lastSearchValue = "";
this.lastResultsPage = "";
this.hideTimeout = 0;
this.searchIndex = 0;
this.searchActive = false;
this.insideFrame = inFrame;
this.searchLabel = label;
// ----------- DOM Elements
this.DOMSearchField = function()
{ return document.getElementById("MSearchField"); }
this.DOMSearchSelect = function()
{ return document.getElementById("MSearchSelect"); }
this.DOMSearchSelectWindow = function()
{ return document.getElementById("MSearchSelectWindow"); }
this.DOMPopupSearchResults = function()
{ return document.getElementById("MSearchResults"); }
this.DOMPopupSearchResultsWindow = function()
{ return document.getElementById("MSearchResultsWindow"); }
this.DOMSearchClose = function()
{ return document.getElementById("MSearchClose"); }
this.DOMSearchBox = function()
{ return document.getElementById("MSearchBox"); }
// ------------ Event Handlers
// Called when focus is added or removed from the search field.
this.OnSearchFieldFocus = function(isActive)
{
this.Activate(isActive);
}
this.OnSearchSelectShow = function()
{
var searchSelectWindow = this.DOMSearchSelectWindow();
var searchField = this.DOMSearchSelect();
if (this.insideFrame)
{
var left = getXPos(searchField);
var top = getYPos(searchField);
left += searchField.offsetWidth + 6;
top += searchField.offsetHeight;
// show search selection popup
searchSelectWindow.style.display='block';
left -= searchSelectWindow.offsetWidth;
searchSelectWindow.style.left = left + 'px';
searchSelectWindow.style.top = top + 'px';
}
else
{
var left = getXPos(searchField);
var top = getYPos(searchField);
top += searchField.offsetHeight;
// show search selection popup
searchSelectWindow.style.display='block';
searchSelectWindow.style.left = left + 'px';
searchSelectWindow.style.top = top + 'px';
}
// stop selection hide timer
if (this.hideTimeout)
{
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
return false; // to avoid "image drag" default event
}
this.OnSearchSelectHide = function()
{
this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()",
this.closeSelectionTimeout);
}
// Called when the content of the search field is changed.
this.OnSearchFieldChange = function(evt)
{
if (this.keyTimeout) // kill running timer
{
clearTimeout(this.keyTimeout);
this.keyTimeout = 0;
}
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==40 || e.keyCode==13)
{
if (e.shiftKey==1)
{
this.OnSearchSelectShow();
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
child.focus();
return;
}
}
return;
}
else if (window.frames.MSearchResults.searchResults)
{
var elem = window.frames.MSearchResults.searchResults.NavNext(0);
if (elem) elem.focus();
}
}
else if (e.keyCode==27) // Escape out of the search field
{
this.DOMSearchField().blur();
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.lastSearchValue = '';
this.Activate(false);
return;
}
// strip whitespaces
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
if (searchValue != this.lastSearchValue) // search value has changed
{
if (searchValue != "") // non-empty search
{
// set timer for search update
this.keyTimeout = setTimeout(this.name + '.Search()',
this.keyTimeoutLength);
}
else // empty search field
{
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.lastSearchValue = '';
}
}
}
this.SelectItemCount = function(id)
{
var count=0;
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
count++;
}
}
return count;
}
this.SelectItemSet = function(id)
{
var i,j=0;
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
var node = child.firstChild;
if (j==id)
{
node.innerHTML='&#8226;';
}
else
{
node.innerHTML='&#160;';
}
j++;
}
}
}
// Called when an search filter selection is made.
// set item with index id as the active item
this.OnSelectItem = function(id)
{
this.searchIndex = id;
this.SelectItemSet(id);
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
if (searchValue!="" && this.searchActive) // something was found -> do a search
{
this.Search();
}
}
this.OnSearchSelectKey = function(evt)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
{
this.searchIndex++;
this.OnSelectItem(this.searchIndex);
}
else if (e.keyCode==38 && this.searchIndex>0) // Up
{
this.searchIndex--;
this.OnSelectItem(this.searchIndex);
}
else if (e.keyCode==13 || e.keyCode==27)
{
this.OnSelectItem(this.searchIndex);
this.CloseSelectionWindow();
this.DOMSearchField().focus();
}
return false;
}
// --------- Actions
// Closes the results window.
this.CloseResultsWindow = function()
{
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.Activate(false);
}
this.CloseSelectionWindow = function()
{
this.DOMSearchSelectWindow().style.display = 'none';
}
// Performs a search.
this.Search = function()
{
this.keyTimeout = 0;
// strip leading whitespace
var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
var code = searchValue.toLowerCase().charCodeAt(0);
var idxChar = searchValue.substr(0, 1).toLowerCase();
if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair
{
idxChar = searchValue.substr(0, 2);
}
var resultsPage;
var resultsPageWithSearch;
var hasResultsPage;
var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);
if (idx!=-1)
{
var hexCode=idx.toString(16);
resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
hasResultsPage = true;
}
else // nothing available for this search term
{
resultsPage = this.resultsPath + '/nomatches.html';
resultsPageWithSearch = resultsPage;
hasResultsPage = false;
}
window.frames.MSearchResults.location = resultsPageWithSearch;
var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
if (domPopupSearchResultsWindow.style.display!='block')
{
var domSearchBox = this.DOMSearchBox();
this.DOMSearchClose().style.display = 'inline';
if (this.insideFrame)
{
var domPopupSearchResults = this.DOMPopupSearchResults();
domPopupSearchResultsWindow.style.position = 'relative';
domPopupSearchResultsWindow.style.display = 'block';
var width = document.body.clientWidth - 8; // the -8 is for IE :-(
domPopupSearchResultsWindow.style.width = width + 'px';
domPopupSearchResults.style.width = width + 'px';
}
else
{
var domPopupSearchResults = this.DOMPopupSearchResults();
var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
domPopupSearchResultsWindow.style.display = 'block';
left -= domPopupSearchResults.offsetWidth;
domPopupSearchResultsWindow.style.top = top + 'px';
domPopupSearchResultsWindow.style.left = left + 'px';
}
}
this.lastSearchValue = searchValue;
this.lastResultsPage = resultsPage;
}
// -------- Activation Functions
// Activates or deactivates the search panel, resetting things to
// their default values if necessary.
this.Activate = function(isActive)
{
if (isActive || // open it
this.DOMPopupSearchResultsWindow().style.display == 'block'
)
{
this.DOMSearchBox().className = 'MSearchBoxActive';
var searchField = this.DOMSearchField();
if (searchField.value == this.searchLabel) // clear "Search" term upon entry
{
searchField.value = '';
this.searchActive = true;
}
}
else if (!isActive) // directly remove the panel
{
this.DOMSearchBox().className = 'MSearchBoxInactive';
this.DOMSearchField().value = this.searchLabel;
this.searchActive = false;
this.lastSearchValue = ''
this.lastResultsPage = '';
}
}
}
// -----------------------------------------------------------------------
// The class that handles everything on the search results page.
function SearchResults(name)
{
// The number of matches from the last run of <Search()>.
this.lastMatchCount = 0;
this.lastKey = 0;
this.repeatOn = false;
// Toggles the visibility of the passed element ID.
this.FindChildElement = function(id)
{
var parentElement = document.getElementById(id);
var element = parentElement.firstChild;
while (element && element!=parentElement)
{
if (element.nodeName == 'DIV' && element.className == 'SRChildren')
{
return element;
}
if (element.nodeName == 'DIV' && element.hasChildNodes())
{
element = element.firstChild;
}
else if (element.nextSibling)
{
element = element.nextSibling;
}
else
{
do
{
element = element.parentNode;
}
while (element && element!=parentElement && !element.nextSibling);
if (element && element!=parentElement)
{
element = element.nextSibling;
}
}
}
}
this.Toggle = function(id)
{
var element = this.FindChildElement(id);
if (element)
{
if (element.style.display == 'block')
{
element.style.display = 'none';
}
else
{
element.style.display = 'block';
}
}
}
// Searches for the passed string. If there is no parameter,
// it takes it from the URL query.
//
// Always returns true, since other documents may try to call it
// and that may or may not be possible.
this.Search = function(search)
{
if (!search) // get search word from URL
{
search = window.location.search;
search = search.substring(1); // Remove the leading '?'
search = unescape(search);
}
search = search.replace(/^ +/, ""); // strip leading spaces
search = search.replace(/ +$/, ""); // strip trailing spaces
search = search.toLowerCase();
search = convertToId(search);
var resultRows = document.getElementsByTagName("div");
var matches = 0;
var i = 0;
while (i < resultRows.length)
{
var row = resultRows.item(i);
if (row.className == "SRResult")
{
var rowMatchName = row.id.toLowerCase();
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
if (search.length<=rowMatchName.length &&
rowMatchName.substr(0, search.length)==search)
{
row.style.display = 'block';
matches++;
}
else
{
row.style.display = 'none';
}
}
i++;
}
document.getElementById("Searching").style.display='none';
if (matches == 0) // no results
{
document.getElementById("NoMatches").style.display='block';
}
else // at least one result
{
document.getElementById("NoMatches").style.display='none';
}
this.lastMatchCount = matches;
return true;
}
// return the first item with index index or higher that is visible
this.NavNext = function(index)
{
var focusItem;
while (1)
{
var focusName = 'Item'+index;
focusItem = document.getElementById(focusName);
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
{
break;
}
else if (!focusItem) // last element
{
break;
}
focusItem=null;
index++;
}
return focusItem;
}
this.NavPrev = function(index)
{
var focusItem;
while (1)
{
var focusName = 'Item'+index;
focusItem = document.getElementById(focusName);
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
{
break;
}
else if (!focusItem) // last element
{
break;
}
focusItem=null;
index--;
}
return focusItem;
}
this.ProcessKeys = function(e)
{
if (e.type == "keydown")
{
this.repeatOn = false;
this.lastKey = e.keyCode;
}
else if (e.type == "keypress")
{
if (!this.repeatOn)
{
if (this.lastKey) this.repeatOn = true;
return false; // ignore first keypress after keydown
}
}
else if (e.type == "keyup")
{
this.lastKey = 0;
this.repeatOn = false;
}
return this.lastKey!=0;
}
this.Nav = function(evt,itemIndex)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==13) return true;
if (!this.ProcessKeys(e)) return false;
if (this.lastKey==38) // Up
{
var newIndex = itemIndex-1;
var focusItem = this.NavPrev(newIndex);
if (focusItem)
{
var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
if (child && child.style.display == 'block') // children visible
{
var n=0;
var tmpElem;
while (1) // search for last child
{
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
if (tmpElem)
{
focusItem = tmpElem;
}
else // found it!
{
break;
}
n++;
}
}
}
if (focusItem)
{
focusItem.focus();
}
else // return focus to search field
{
parent.document.getElementById("MSearchField").focus();
}
}
else if (this.lastKey==40) // Down
{
var newIndex = itemIndex+1;
var focusItem;
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem && elem.style.display == 'block') // children visible
{
focusItem = document.getElementById('Item'+itemIndex+'_c0');
}
if (!focusItem) focusItem = this.NavNext(newIndex);
if (focusItem) focusItem.focus();
}
else if (this.lastKey==39) // Right
{
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem) elem.style.display = 'block';
}
else if (this.lastKey==37) // Left
{
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem) elem.style.display = 'none';
}
else if (this.lastKey==27) // Escape
{
parent.searchBox.CloseResultsWindow();
parent.document.getElementById("MSearchField").focus();
}
else if (this.lastKey==13) // Enter
{
return true;
}
return false;
}
this.NavChild = function(evt,itemIndex,childIndex)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==13) return true;
if (!this.ProcessKeys(e)) return false;
if (this.lastKey==38) // Up
{
if (childIndex>0)
{
var newIndex = childIndex-1;
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
}
else // already at first child, jump to parent
{
document.getElementById('Item'+itemIndex).focus();
}
}
else if (this.lastKey==40) // Down
{
var newIndex = childIndex+1;
var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
if (!elem) // last child, jump to parent next parent
{
elem = this.NavNext(itemIndex+1);
}
if (elem)
{
elem.focus();
}
}
else if (this.lastKey==27) // Escape
{
parent.searchBox.CloseResultsWindow();
parent.document.getElementById("MSearchField").focus();
}
else if (this.lastKey==13) // Enter
{
return true;
}
return false;
}
}
function setKeyActions(elem,action)
{
elem.setAttribute('onkeydown',action);
elem.setAttribute('onkeypress',action);
elem.setAttribute('onkeyup',action);
}
function setClassAttr(elem,attr)
{
elem.setAttribute('class',attr);
elem.setAttribute('className',attr);
}
function createResults()
{
var results = document.getElementById("SRResults");
for (var e=0; e<searchData.length; e++)
{
var id = searchData[e][0];
var srResult = document.createElement('div');
srResult.setAttribute('id','SR_'+id);
setClassAttr(srResult,'SRResult');
var srEntry = document.createElement('div');
setClassAttr(srEntry,'SREntry');
var srLink = document.createElement('a');
srLink.setAttribute('id','Item'+e);
setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
setClassAttr(srLink,'SRSymbol');
srLink.innerHTML = searchData[e][1][0];
srEntry.appendChild(srLink);
if (searchData[e][1].length==2) // single result
{
srLink.setAttribute('href',searchData[e][1][1][0]);
if (searchData[e][1][1][1])
{
srLink.setAttribute('target','_parent');
}
var srScope = document.createElement('span');
setClassAttr(srScope,'SRScope');
srScope.innerHTML = searchData[e][1][1][2];
srEntry.appendChild(srScope);
}
else // multiple results
{
srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
var srChildren = document.createElement('div');
setClassAttr(srChildren,'SRChildren');
for (var c=0; c<searchData[e][1].length-1; c++)
{
var srChild = document.createElement('a');
srChild.setAttribute('id','Item'+e+'_c'+c);
setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
setClassAttr(srChild,'SRScope');
srChild.setAttribute('href',searchData[e][1][c+1][0]);
if (searchData[e][1][c+1][1])
{
srChild.setAttribute('target','_parent');
}
srChild.innerHTML = searchData[e][1][c+1][2];
srChildren.appendChild(srChild);
}
srEntry.appendChild(srChildren);
}
srResult.appendChild(srEntry);
results.appendChild(srResult);
}
}
function init_search()
{
var results = document.getElementById("MSearchSelectWindow");
for (var key in indexSectionLabels)
{
var link = document.createElement('a');
link.setAttribute('class','SelectItem');
link.setAttribute('onclick','searchBox.OnSelectItem('+key+')');
link.href='javascript:void(0)';
link.innerHTML='<span class="SelectionMark">&#160;</span>'+indexSectionLabels[key];
results.appendChild(link);
}
searchBox.OnSelectItem(0);
}

File diff suppressed because one or more lines are too long

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