mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-15 16:15:08 -05:00
Update wolfSSL to the latest version(v.4.4.0) (#186)
* deleted old version wolfSSL before updating * updated wolfSSL to the latest version(v4.4.0) * updated wolfSSL to the latest version(v4.4.0) * added macros for timing resistance Co-authored-by: RichardBarry <3073890+RichardBarry@users.noreply.github.com> Co-authored-by: Ming Yue <mingyue86010@gmail.com>
This commit is contained in:
parent
68518f5866
commit
94aa31c3cb
1185 changed files with 837519 additions and 72138 deletions
115
FreeRTOS-Plus/Source/WolfSSL/scripts/benchmark.test
Normal file
115
FreeRTOS-Plus/Source/WolfSSL/scripts/benchmark.test
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
#!/bin/sh
|
||||
|
||||
#benchmark.test
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
echo "Usage: $0 [mode] [num] [clientargs] [serverargs]" >&2
|
||||
echo " [mode]: 1=Connection Rate (TPS), 2=Throughput Bytes" >&2
|
||||
echo " [num]: Mode 1=Connection Count, Mode 2=Bytes to TX/RX" >&2
|
||||
echo " [clientargs]: Passed to client (see \"./example/client/client -?\" for help)" >&2
|
||||
echo " Example: Use different cipher suite: \"-l DHE-RSA-AES256-SHA\"" >&2
|
||||
echo " [serverargs]: Passed to server (see \"./example/server/server -?\" for help)" >&2
|
||||
echo " Example: Disable client certificate check: \"-d\"" >&2
|
||||
echo "Note: If additional client or server args contains spaces wrap with double quotes" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use unique benchmark port so it won't conflict with any other tests
|
||||
bench_port=11113
|
||||
no_pid=-1
|
||||
server_pid=$no_pid
|
||||
counter=0
|
||||
client_result=-1
|
||||
|
||||
remove_ready_file() {
|
||||
if test -e /tmp/wolfssl_server_ready; then
|
||||
echo "removing existing server_ready file"
|
||||
rm /tmp/wolfssl_server_ready
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
do_cleanup() {
|
||||
echo "in cleanup"
|
||||
|
||||
if [ $server_pid != $no_pid ]
|
||||
then
|
||||
echo "killing server"
|
||||
kill -9 $server_pid
|
||||
fi
|
||||
remove_ready_file
|
||||
}
|
||||
|
||||
do_trap() {
|
||||
echo "got trap"
|
||||
do_cleanup
|
||||
exit -1
|
||||
}
|
||||
|
||||
trap do_trap INT TERM
|
||||
|
||||
# Start server in loop continuous mode (-L) with echo data (-e) enabled and non-blocking (-N)
|
||||
echo "\nStarting example server for benchmark test"
|
||||
remove_ready_file
|
||||
# benchmark connections
|
||||
if [ $1 -eq 1 ]
|
||||
then
|
||||
# start server in loop mode with port
|
||||
./examples/server/server -i -p $bench_port $4 &
|
||||
server_pid=$!
|
||||
fi
|
||||
|
||||
# benchmark throughput
|
||||
if [ $1 -eq 2 ]
|
||||
then
|
||||
# start server in loop mode, non-blocking, benchmark throughput with port
|
||||
./examples/server/server -i -N -B $2 -p $bench_port $4 &
|
||||
server_pid=$!
|
||||
fi
|
||||
|
||||
|
||||
echo "Waiting for server_ready file..."
|
||||
while [ ! -s /tmp/wolfssl_server_ready -a "$counter" -lt 20 ]; do
|
||||
sleep 0.1
|
||||
counter=$((counter+ 1))
|
||||
done
|
||||
|
||||
# benchmark connections
|
||||
if [ $1 -eq 1 ]
|
||||
then
|
||||
echo "Starting example client to benchmark connection average time"
|
||||
# start client to benchmark average time for each connection using port
|
||||
./examples/client/client -b $2 -p $bench_port $3
|
||||
client_result=$?
|
||||
fi
|
||||
|
||||
# benchmark throughput
|
||||
if [ $1 -eq 2 ]
|
||||
then
|
||||
echo "Starting example client to benchmark throughput"
|
||||
# start client in non-blocking mode, benchmark throughput using port
|
||||
./examples/client/client -N -B $2 -p $bench_port $3
|
||||
client_result=$?
|
||||
fi
|
||||
|
||||
if [ $client_result != 0 ]
|
||||
then
|
||||
echo "Client failed!"
|
||||
do_cleanup
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# End server
|
||||
kill -6 $server_pid
|
||||
server_result=$?
|
||||
remove_ready_file
|
||||
|
||||
if [ $server_result != 0 ]
|
||||
then
|
||||
echo "Server failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "\nSuccess!\n"
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue