Merge pull request #4277 from lealem47/ex-repo-link

Adding README.md to examples dir and links to examples github repo in…
This commit is contained in:
David Garske 2021-08-04 12:43:57 -07:00 committed by GitHub
commit 3e894a9804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 115 additions and 6 deletions

2
README
View File

@ -318,3 +318,5 @@ More info can be found on-line at https://wolfssl.com/wolfSSL/Docs.html
[wolfSSL Vulnerabilities]
(https://www.wolfssl.com/docs/security-vulnerabilities/)
Additional wolfSSL Examples](https://github.com/wolfssl/wolfssl-examples)

89
examples/README.md Normal file
View File

@ -0,0 +1,89 @@
# wolfSSL examples directory
## client and server
These directories contain a client (client.c) and server (server.c) that utilize a variety of the wolfSSL library's capabilities. The manner in which both programs operate can depend on the configure or can be specified at run-time depending on the end goal. Both applications contain testing as well as benchmarking code.
Compile
```
./configure
make
```
Usage
```
./examples/server/server
./examples/client/client
```
Run ```./examples/server/server -h``` and ```./examples/client/client -h``` for usage details.
For simpler wolfSSL TLS server/client examples, visit https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
## echoclient and echoserver
These directories contain a client (echoclient.c) and server (echoserver.c) that establish a connection encrypted by wolfSSL. Like the names indicate, once the connection has been established any messages entered into echoclient are sent to and displayed on the echoserver and are then echoed back to echoclient. The nature of the encryption, as well as additional behavior of the two programs, depends on how wolfSSL was configured ( DTLS enabled/disabled, Filesystem enabled/disabled, etc ... ).
Compile
```
./configure
make
```
Usage
```
./examples/echoserver/echoserver
./examples/echoclient/echoclient
```
## benchmark
The benchmark directory offers an application that can help you grasp just how well wolfSSL's TLS functionality is performing on your local machine.
Compile
```
./configure
make
```
Usage
```
./examples/benchmark/tls_bench
```
The tls_bench executable can also be compiled separately with ``` gcc -lwolfssl -lpthread -o tls_bench tls_bench.c ```.
Run ```./examples/benchmark/tls_bench -?``` for usage details.
## sctp
This directory contains servers and clients that demonstrate wolfSSL's DTLS-SCTP support.
Compile
```
./configure --enable-sctp
make
```
Usage
```
./examples/sctp/sctp-server
./examples/sctp/sctp-client
```
and
```
./examples/sctp/sctp-server-dtls
./examples/sctp/sctp-client-dtls
```
## configs
This directory contains example wolfSSL configuration file templates for use when autoconf is not available, such as building with a custom IDE.
See [examples/configs/README.md](examples/configs/README.md) for more details.

View File

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* For simpler wolfSSL TLS client examples, visit
* https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@ -975,7 +979,7 @@ static int ClientRead(WOLFSSL* ssl, char* reply, int replyLen, int mustRead,
/* 4. add the same message into Japanese section */
/* (will be translated later) */
/* 5. add printf() into suitable position of Usage() */
static const char* client_usage_msg[][69] = {
static const char* client_usage_msg[][70] = {
/* English */
{
" NOTE: All files relative to wolfSSL home dir\n", /* 0 */
@ -1167,8 +1171,10 @@ static const char* client_usage_msg[][69] = {
" SSLv3(0) - TLS1.2(3)\n",
#else
"-7 Set minimum downgrade protocol version [0-4] "
" SSLv3(0) - TLS1.3(4)\n", /* 69 */
" SSLv3(0) - TLS1.3(4)\n\n", /* 69 */
#endif
"For simpler wolfSSL TLS client examples, visit\n"
"https://github.com/wolfSSL/wolfssl-examples/tree/master/tls\n", /* 70 */
NULL,
},
#ifndef NO_MULTIBYTE_PRINT
@ -1365,8 +1371,10 @@ static const char* client_usage_msg[][69] = {
" SSLv3(0) - TLS1.2(3)\n",
#else
"-7 最小ダウングレード可能なプロトコルバージョンを設定します [0-4] "
" SSLv3(0) - TLS1.3(4)\n", /* 69 */
" SSLv3(0) - TLS1.3(4)\n\n", /* 69 */
#endif
"For simpler wolfSSL TLS client examples, visit\n"
"https://github.com/wolfSSL/wolfssl-examples/tree/master/tls\n", /* 70 */
NULL,
},
#endif
@ -1550,6 +1558,7 @@ static void Usage(void)
printf("%s", msg[++msgid]); /* --wolfsentry-config */
#endif
printf("%s", msg[++msgid]); /* -7 */
printf("%s", msg[++msgid]); /* Examples repo link */
}
THREAD_RETURN WOLFSSL_THREAD client_test(void* args)

View File

@ -8,3 +8,4 @@ include examples/echoserver/include.am
include examples/server/include.am
include examples/sctp/include.am
include examples/configs/include.am
EXTRA_DIST += examples/README.md

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
/* For simpler wolfSSL TLS server examples, visit
* https://github.com/wolfSSL/wolfssl-examples/tree/master/tls
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -676,7 +679,7 @@ static void SetKeyShare(WOLFSSL* ssl, int onlyKeyShare, int useX25519,
/* 4. add the same message into Japanese section */
/* (will be translated later) */
/* 5. add printf() into suitable position of Usage() */
static const char* server_usage_msg[][59] = {
static const char* server_usage_msg[][60] = {
/* English */
{
" NOTE: All files relative to wolfSSL home dir\n", /* 0 */
@ -821,8 +824,10 @@ static const char* server_usage_msg[][59] = {
" SSLv3(0) - TLS1.2(3)\n",
#else
"-7 Set minimum downgrade protocol version [0-4] "
" SSLv3(0) - TLS1.3(4)\n", /* 59 */
" SSLv3(0) - TLS1.3(4)\n\n", /* 59 */
#endif
"For simpler wolfSSL TLS server examples, visit\n"
"https://github.com/wolfSSL/wolfssl-examples/tree/master/tls\n", /* 60 */
NULL,
},
#ifndef NO_MULTIBYTE_PRINT
@ -976,8 +981,10 @@ static const char* server_usage_msg[][59] = {
" SSLv3(0) - TLS1.2(3)\n",
#else
"-7 最小ダウングレード可能なプロトコルバージョンを設定します [0-4] "
" SSLv3(0) - TLS1.3(4)\n", /* 59 */
" SSLv3(0) - TLS1.3(4)\n\n", /* 59 */
#endif
"For simpler wolfSSL TLS server examples, visit\n"
"https://github.com/wolfSSL/wolfssl-examples/tree/master/tls\n", /* 60 */
NULL,
},
#endif
@ -1119,6 +1126,7 @@ static void Usage(void)
printf("%s", msg[++msgId]); /* --wolfsentry-config */
#endif
printf("%s", msg[++msgId]); /* -7 */
printf("%s", msg[++msgId]); /* Examples repo link */
}
THREAD_RETURN WOLFSSL_THREAD server_test(void* args)