Merge pull request #143 from dgarske/embedded_examples

Embedded example fix-ups
pull/146/head
Sean Parkinson 2019-04-09 08:09:23 +10:00 committed by GitHub
commit 5fd77f9571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 120 additions and 13 deletions

1
.gitignore vendored
View File

@ -60,6 +60,7 @@ android/wolfssljni-ndk-sample/proguard-project.txt
/tls/client-tcp
/tls/client-tls
/tls/client-tls-cacb
/tls/client-tls-callback
/tls/client-tls-ecdhe
/tls/client-tls-nonblocking

View File

@ -19,11 +19,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include "certs.h"
#if !defined(NO_WOLFSSL_CLIENT) && !defined(NO_WOLFSSL_SERVER)
/* I/O buffer size - wolfSSL buffers messages internally as well. */
#define BUFFER_SIZE 2048
@ -478,3 +482,14 @@ int main(int argc, char* argv[])
return (ret == 0) ? 0 : 1;
}
#else
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
printf("Must build wolfSSL with client and server enabled for this example\n");
return 0;
}
#endif

View File

@ -21,11 +21,16 @@
#include <stdio.h>
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include "certs.h"
#if !defined(NO_WOLFSSL_SERVER) && !defined(WOLFSSL_NO_TLS12)
/* I/O buffer size - wolfSSL buffers messages internally as well. */
#define BUFFER_SIZE 2048
/* Size of static buffer for dynamic memory allocation. */
@ -296,3 +301,15 @@ int main(int argc, char* argv[])
return (ret == 0) ? 0 : 1;
}
#else
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
printf("Must build wolfSSL with TLS v1.2 and server enabled for this example\n");
return 0;
}
#endif

View File

@ -19,7 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/error-ssl.h>
@ -27,6 +30,8 @@
#include "tls-info.h"
#include "certs.h"
#if !defined(NO_WOLFSSL_CLIENT)
/* Application data to send. */
static const char msgHTTPGet[] = "GET /index.html HTTP/1.0\r\n\r\n";
@ -264,3 +269,15 @@ int main(int argc, char* argv[])
return (ret == 0) ? 0 : 1;
}
#else
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
printf("Must build wolfSSL with client enabled for this example\n");
return 0;
}
#endif

View File

@ -19,7 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include <wolfssl/error-ssl.h>
@ -27,6 +30,8 @@
#include "tls-info.h"
#include "certs.h"
#if !defined(NO_WOLFSSL_CLIENT)
/* Application data to send. */
static const char msgHTTPGet[] = "GET /index.html HTTP/1.0\r\n\r\n";
@ -244,3 +249,14 @@ int main(int argc, char* argv[])
return (ret == 0) ? 0 : 1;
}
#else
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
printf("Must build wolfSSL with client enabled for this example\n");
return 0;
}
#endif

View File

@ -19,13 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include "sockets.h"
#include "tls-info.h"
#include "certs.h"
#if !defined(NO_WOLFSSL_SERVER)
/* Application data to send. */
static const char msgHTTPIndex[] =
"HTTP/1.1 200 OK\n"
@ -296,3 +301,14 @@ int main(int argc, char* argv[])
return (ret == 0) ? 0 : 1;
}
#else
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
printf("Must build wolfSSL with server enabled for this example\n");
return 0;
}
#endif

View File

@ -19,13 +19,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#include "sockets.h"
#include "tls-info.h"
#include "certs.h"
#if !defined(NO_WOLFSSL_SERVER)
/* Application data to send. */
static const char msgHTTPIndex[] =
"HTTP/1.1 200 OK\n"
@ -282,3 +287,14 @@ int main(int argc, char* argv[])
return (ret == 0) ? 0 : 1;
}
#else
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
printf("Must build wolfSSL with server enabled for this example\n");
return 0;
}
#endif

View File

@ -19,10 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#ifndef SINGLE_THREADED
#if !defined(SINGLE_THREADED) && !defined(NO_WOLFSSL_CLIENT) && \
!defined(NO_WOLFSSL_SERVER)
#include "sockets.h"
#include "threading.h"
@ -460,9 +464,8 @@ int main(int argc, char* argv[])
int main(int argc, char* argv[])
{
printf("Threading required - compile wolfSSL without SINGLE_THREAED\n");
printf("Threading and TLS client and server required - compile wolfSSL without SINGLE_THREAED\n");
return 0;
}
#endif

View File

@ -19,10 +19,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wolfssl/options.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
#ifndef SINGLE_THREADED
#if !defined(SINGLE_THREADED) && !defined(NO_WOLFSSL_CLIENT) && \
!defined(NO_WOLFSSL_SERVER)
#include "threading.h"
#include "certs.h"
@ -487,7 +491,9 @@ int main(int argc, char* argv[])
int main(int argc, char* argv[])
{
printf("Requires threading - compile wolfssl without SINGLE_THREADED\n");
(void)argc;
(void)argv;
printf("Threading and TLS client and server required - compile wolfSSL without SINGLE_THREAED\n");
return 0;
}

BIN
tls/client-tls-cacb 100755

Binary file not shown.