Commit Graph

116 Commits

Author SHA1 Message Date
JacobBarthelmeh
629c5b4cf6 updating license from GPLv2 to GPLv3 2025-07-10 16:11:36 -06:00
JacobBarthelmeh
2c24291ed5 update copyright date 2025-01-21 09:55:03 -07:00
Eric Blankenhorn
3d0cc250b9 Add sanity check for configuration method 2024-12-09 12:03:25 -06:00
Andras Fekete
2cdecd85a2 If we have a capture on device 'any', then we need to handle the offset
Detect reading of packet errors

--enable-all and --enable-sniffer exposed this issue

Don't need variable

Rework argument parsing

Need a way to allow arguments to be supplied more granularly. Partucilarly, I needed a "-tracefile" argument without requiring the use of a PCAP file

Fix error prints to STDERR

Fix setting of port filtering

Fix 80 char limit

Not actually a bad packet when there are no more packets

Fix strcat size

Allow the sniffer to print the trace to STDOUT

Fix indexing

Take out superfluous error which is handled later

Set default port to 11111

Single return point

Combine chain to one contiguous memory block

Fix return

Add in error handling for XMALLOC

Add in debugging output when --enable-debug

It makes no sense to allocate a ton of small buffers to process chains

Ultimately, the code is slower because of the several small memcpy instead of a single large contiguous memcpy

Pass in a device name

Fix unused variable

Fix cast

Addressing PR comments

Add new flags to --help
2024-10-29 16:55:20 -04:00
res0nance
665fd89c55 win: add arm64 to sslsnifftest.vcxproj 2024-09-24 18:18:10 +08:00
Daniel Pouzzner
a3fb5029f8 clean up trailing whitespace and misplaced CRLFs, add missing final newlines, remove stray UTF8 nonprintables (BOMs) and ASCIIfy stray homoglyphs (spaces and apostrophes), guided by expanded coverage in wolfssl-multi-test check-source-text. 2024-09-05 14:52:18 -05:00
Andras Fekete
208f2d6781 One more occurrence 2024-08-06 10:32:50 -04:00
JacobBarthelmeh
31a6a2bf59 update copyright to 2024 2024-07-19 13:15:05 -06:00
JacobBarthelmeh
3033371abc Merge pull request #6717 from bigbrett/sniffer-keylogfile
sniffer keylog file support
2023-08-22 14:06:27 -06:00
Brett Nicholas
66c53b0996 Decoupled keylogfile registration and sniffer server creation APIs
fixed (very old) use-after-free found by ASAN

Updated documentation

review comments (spelling and housekeeping)
2023-08-22 11:29:58 -06:00
Brett Nicholas
2ee6a01d91 Initial sniffer keylog file support for TLS 1.2 2023-08-22 11:23:46 -06:00
Andras Fekete
44b634a597 More cleanup 2023-08-01 10:29:03 -04:00
lealem47
a10526d5f9 Async sniffer: don't retry if seeing non-pending error (#6220)
* Async sniffer: don't retry if seeing non-pending error

* Print error messages when decrypting from queue

* Zeroize the SessionTable in ssl_FreeSniffer()

---------

Co-authored-by: Lealem Amedie <lealem47@github.com>
2023-04-24 13:51:55 -07:00
Jacob Barthelmeh
9dcc48c8f7 update copyright to 2023 2022-12-30 17:12:11 -07:00
Chris Conlon
9a7ff8773b add --with-libsuffix support, append suffix to library artifact name 2022-12-21 13:31:07 -07:00
David Garske
6be0512728 Peer review cleanups. 2022-12-14 09:25:04 -08:00
David Garske
e33d59cd76 Review cleanups. 2022-12-13 10:55:22 -08:00
David Garske
de22dbe61d Support for multi-threaded sniffer. Add support for atomic operations instead of mutex in wc_port.h. 2022-12-12 08:39:42 -08:00
Lealem Amedie
c506812cf0 Improvement for some sniffer error messages 2022-12-02 13:27:29 -08:00
David Garske
20913a4201 Fix for sniffer with async to not terminate processing until all pending items have been processed. 2022-11-07 15:45:50 -08:00
David Garske
fe28702891 Fixes for async sniffer handling of packets with multiple TLS messages. Other minor cleanups for spelling and CheckPreRecord SnifferSession deference. 2022-10-26 15:28:02 -07:00
Lealem Amedie
b91e48d770 Add snifftest vcxproj file and documentation 2022-10-03 10:22:53 -07:00
David Garske
9d2ed67a5c Fix for sniffer to ensure the session was polled before trying to reprocess it. 2022-08-02 08:11:21 -07:00
David Garske
1c7f64cce9 Fixes for sniffer session ticket resumption with TLS v1.2. ZD14531. 2022-07-20 11:18:19 -07:00
Jacob Barthelmeh
8eaa85e412 update copyright year to 2022 2022-07-19 10:44:31 -06:00
David Garske
d76c46a96f Fix for sniffer async issue with TLS v1.3. 2022-06-28 16:01:06 -07:00
David Garske
5ade360d9e Fix to avoid using WC_HW_WAIT_E for sniffer. ZD14398 2022-06-28 12:38:57 -07:00
Daniel Pouzzner
ccc9b1535d fix whitespace. 2022-05-06 13:34:32 -05:00
David Garske
5f539b3921 Improve the sniffer asynchronous test case to support multiple concurrent streams. 2022-05-03 16:43:15 -07:00
David Garske
f9acaab6fe Fix memory leak with pcap bpf_program not calling pcap_freecode. 2022-04-19 16:45:49 -07:00
David Garske
70a0983bbc Fix for minor warning with chain input enabled and async disabled. 2022-04-18 16:17:37 -07:00
David Garske
659d33fdaf Fixes for minor sniffer and async issues:
* Sniffer: Remove old restrictions for max strength, encrypt-then-mac and forcing openssl-extra.
* Fix bound warning with strncpy in sniffer.c.
* Fix for async DH issue.
* Fix for SP math all not initializing raw big int.
* Fix for array bounds warning with "-O3" on SetEccPublicKey.
* Fix a sniffer async edge case with TLS v1.2 static RSA and extended master.
* Improved the sniffer test script detection of features.
* Disable ECC custom curve test with Intel QuickAssist.
2022-04-18 11:46:40 -07:00
David Garske
f129c32273 Fixes for whitespace, script bug and bit-field type. 2022-03-23 09:31:04 -07:00
David Garske
29c120356e Sniffer asynchronous support.
* Adds stateful handling of DH shared secret computation in `SetupKeys`.
* Improved the decrypt handling to use internal functions and avoid generating alerts on failures.
* Fix for sniffer resume due to missing `sessionIDSz` broken in #4807.
* Fix sniffer test cases to split resume (session_ticket) tests.
* Add `snifftest` list of build features so test script can gate running resume test.
2022-03-21 12:05:08 -07:00
Daniel Pouzzner
0b4f34d62a typographic cleanup: fix whitespace, remove unneeded UTF-8, convert C++ comment constructs to C. 2021-11-08 17:35:05 -06:00
Daniel Pouzzner
8f121e7752 file modes: clear inappropriate executable bits. 2021-11-08 17:28:11 -06:00
David Garske
e4da9c6f48 Fix for sniffer key callback. Fix for building sniffer without RSA. Fix for wolfCrypt test cert ext without RSA. 2021-10-22 14:29:06 -07:00
David Garske
9b6cf56a6e Expanded support for Curve25519/Curve448 and TLS v1.3 sniffer (#4335)
* Fixes for building with Ed/Curve25519 only. Fix for IoT safe demo to exit after running once. Added `WOLFSSL_DH_EXTRA` to `--enable-all` and `--enable-sniffer`. Cleanup uses of `==` in configure.ac. Various spelling fixes.

* Fix for sniffer with TLS v1.3 session tickets.

* Fix for ASN Template Ed25519 key export (missing version / not setting OID correctly).

* Add key import/export support for Curve25519/Curve448. Refactor of the 25519/448 ASN code to combine duplicate code.

* Refactor of Curve25519 code. Improved public key export to handle generation when only private is set. Improved private scalar buffer sizing.

* Fix for static ephemeral loading of file buffer.

* Added sniffer Curve25519 support and test case.

* Fix for sniffer to not use ECC for X25519 if both are set.

* Fix Curve448 public export when only private is set.

* Fix for `dh_generate_test` for small stack size.

* Reduce stack size use on new asymmetric DER import/export functions. Cleanup pub length calc.

* Fix invalid comment.
2021-09-01 09:28:24 +10:00
David Garske
4f055653c7 Restore TLS v1.3 hello_retry behavior with session id. Fix for SNI with default (no name) putting newline due to fgets. 2021-07-08 13:50:08 -07:00
David Garske
4cb076f22b Cleanup to remove duplicate stat sslResumptionValid. Add print of sslResumptionInserts. 2021-07-08 09:49:13 -07:00
Jacob Barthelmeh
c729318ddd update copyright date 2021-03-11 13:42:46 +07:00
John Safranek
3e8bad7ae9 Sniffer Test Filename Fix
1. When using multiple filenames, keep the original entered string
   around so it may be reused for each IP address.
2. Strip the trailing newline from the entered filename list.
2020-12-08 17:16:34 -08:00
David Garske
a6f2081af1 Fixes for key loading errors in snifftest application. 2020-11-12 08:59:11 -08:00
David Garske
5cda549d00 Allow passing multiple keys (comma separated) with the sniffer test tool. This allows setting both DH and ECC static ephemeral keys. Do not fail on resume not found. 2020-11-12 08:59:11 -08:00
David Garske
71d9f1e9bd Static ephemeral refactor to support loading both DHE and ECDHE keys. Added ability to specify key using snifftest input at run-time. Improved snifftest key loading for named keys and static ephemeral. 2020-11-12 08:59:11 -08:00
Hayden Roche
3b1c536418 Fix a couple of issues related to the sniffer.
- Fix an issue in sniffer.c where some pointer math was giving a warning.
- Fix an issue in snifftest.c where a local variable was never read.
- Ignore non-TCP/IP packets in snifftest.c. Fixes some tests with pcaps with
  other types of packets.
2020-11-04 10:46:11 -06:00
David Garske
adedde7d16 Fix to not treat cert/key not found as error in myWatchCb and WOLFSSL_SNIFFER_WATCH. The key can be pased as argument to ./snifftest and if built with sniffer watch let's keep trying to parse instead of throwing an error. 2020-09-24 13:05:01 -07:00
David Garske
e6017de19d Fix in snifftest to try loading private key into static ephemeral and private key. Updated pcap files (were missing TCP packets). 2020-07-20 11:10:46 -07:00
David Garske
23a3ead758 Framework for new TLS v1.3 sniffer tests. 2020-07-17 15:56:56 -07:00
David Garske
1b051d9c5b TLS v1.3 sniffer support:
* Added TLS v1.3 sniffer support using static ephemeral key.
* Add support for using a static ephemeral DH and ECC keys with TLS v1.3 using `WOLFSSL_STATIC_EPHEMERAL`.
* Adds new API's `wolfSSL_CTX_set_ephemeral_key` and `wolfSSL_set_ephemeral_key`.
* Expanded TLS extension support in sniffer.
* Refactor of the handshake hashing code.
* Added parameter checking to the TLS v1.3 key derivations (protects use of "DoTls13Finished" if handshake resources have been free'd).
* Added support for loading DH keys via `wc_DhImportKeyPair` and `wc_DhExportKeyPair`, enabled with `WOLFSSL_DH_EXTRA`.
* Added sniffer documentation `sslSniffer/README.md`.
2020-07-17 15:22:35 -07:00