wolfssl/examples/server
Tobias Frauenschläger f0b78fb9ba Complete a TLS 1.3 handshake with the ECC PK callbacks
myEccKeyGen() generated the key share straight into the library's key object,
and myEccSharedSecret() is handed only the peer's key, so a TLS 1.3 client had
no private key left to reach and every handshake ended with:

  wolfSSL_connect error -170, ECC input argument wrong type, invalid input

TEST_PK_PRIVKEY already kept the key on the application's side, which is what
a real PK-callback application does anyway; it just was not the default. Keep
it whenever the connection is TLS or DTLS v1.3 as well, and have the shared
secret callback pick the key by the same question its key gen asked, not by a
flag key gen has not set yet. The union holding it stops being
TEST_PK_PRIVKEY-only, and its comment stops naming TLS v1.2 as the version
that needs it.

Neither example zeroed its PkCbInfo, so hasKeyGen started as stack garbage.
Only the TEST_PK_PRIVKEY paths read it before, which hid that; zero it in
both.

scripts/pkcallbacks.test only ever ran the build's default version, and that
is TLS v1.2 wherever it is compiled in, so none of the above was covered. Run
the default and then each version the build has.
2026-09-08 18:56:18 +02:00
..
include.am tests/swdev: add ECC support to wc_swdev 2026-05-13 16:18:51 +02:00
server.c Complete a TLS 1.3 handshake with the ECC PK callbacks 2026-09-08 18:56:18 +02:00
server.h update Copyright year 2026-02-18 09:52:21 -07:00
server.sln
server.vcproj
server.vcxproj ARM66 Windows: Add assembly 2026-07-08 07:53:53 +10:00