Skip to content

Commit

Permalink
Spelling fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Jun 9, 2021
1 parent 099ec3b commit 5ba15f1
Show file tree
Hide file tree
Showing 36 changed files with 268 additions and 98 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ make

This directory contains examples for securing a Bluetooth Low Energy Link (BTLE).
BTLE packets are small and throughput is low, so these examples demonstrate a way
to exchange data securley without BTLE pariing.
to exchange data securely without BTLE pairing.


## Notes
Expand Down
25 changes: 23 additions & 2 deletions SGX_Linux/trusted/Wolfssl_Enclave.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* Wolfssl_Enclave.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

#include <stdarg.h>
#include <stdio.h> /* vsnprintf */

Expand All @@ -7,7 +28,7 @@


#if defined(XMALLOC_USER) || defined(XMALLOC_OVERRIDE)
#warning verfication of heap hint pointers needed when overriding default malloc/free
#warning verification of heap hint pointers needed when overriding default malloc/free
#endif


Expand Down Expand Up @@ -158,7 +179,7 @@ long enc_wolfTLSv1_2_server_method(void)
}


/* returns method releated to id */
/* returns method related to id */
static WOLFSSL_METHOD* GetMethod(long id)
{
switch (id) {
Expand Down
21 changes: 21 additions & 0 deletions SGX_Linux/trusted/Wolfssl_Enclave.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* Wolfssl_Enclave.h
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

#ifndef _BENCHMARK_ENCLAVE_H_
#define _BENCHMARK_ENCLAVE_H_

Expand Down
5 changes: 3 additions & 2 deletions SGX_Linux/untrusted/client-tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/

#include "client-tls.h"

#include <stdio.h>
Expand All @@ -44,7 +45,7 @@ int client_connect(sgx_enclave_id_t id)
long ssl;


/* data to send to the server, data recieved from the server */
/* data to send to the server, data received from the server */
char sendBuff[] = "Hello WolfSSL!";
char rcvBuff[MAXDATASIZE] = {0};

Expand Down Expand Up @@ -155,7 +156,7 @@ int client_connect(sgx_enclave_id_t id)
printf("Read error. Error: %i\n", ret);
return EXIT_FAILURE;
}
printf("Recieved: \t%s\n", rcvBuff);
printf("Received: \t%s\n", rcvBuff);

/* frees all data before client termination */
enc_wolfSSL_free(id, ssl);
Expand Down
2 changes: 1 addition & 1 deletion SGX_Linux/untrusted/server-tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int server_connect(sgx_enclave_id_t id)

/* Initialize the server address struct with zeros */
memset(&servAddr, 0, sizeof(servAddr));
/* Fill in the server address */
/* Fill in the server address */
servAddr.sin_family = AF_INET; /* using IPv4 */
servAddr.sin_port = htons(DEFAULT_PORT); /* on DEFAULT_PORT */
servAddr.sin_addr.s_addr = INADDR_ANY; /* from anywhere */
Expand Down
2 changes: 1 addition & 1 deletion btle/ecc-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int main(int argc, char** argv)
printf("wc_ecc_export_x963 failed %d\n", ret);
goto cleanup;
}
/* TODO: Server should hash and sign this public key with a trust ceritifcate (already exchanged) */
/* TODO: Server should hash and sign this public key with a trust certificate (already exchanged) */
/* ECC signature is about 65 bytes */


Expand Down
2 changes: 1 addition & 1 deletion certfields/extract-pubkey-from-certfile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public key and subject name information.

## Compiling and Running the Example

To compile, first build wolfSSL with the OpenSSL compatibilty layer enabled:
To compile, first build wolfSSL with the OpenSSL compatibility layer enabled:

```
$ cd wolfssl-X.X.X
Expand Down
2 changes: 1 addition & 1 deletion certfields/extract-pubkey-from-certfile/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main(void)
printf("Failed to decode public key from pubKeyTmp, abort!\n");
return ret;
}
printf("Succesfully decoded public key\n");
printf("Successfully decoded public key\n");

printf("PUBLIC KEY:\n");
for (i = 0; i < pubKeyTmp->pkey_sz; i++) {
Expand Down
21 changes: 21 additions & 0 deletions certgen/certgen_example.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* certgen_example.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#include <stdio.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
Expand Down
23 changes: 22 additions & 1 deletion certgen/certgen_with_altnames.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* certgen_with_altnames.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#include <stdio.h>
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
Expand Down Expand Up @@ -144,7 +165,7 @@ int main(void) {

/* Add some alt names to our cert: */
char myAltNames[] = {
/* SEQUENCE (1 element with 3 segements. Entire length is 41
/* SEQUENCE (1 element with 3 segments. Entire length is 41
* (0x29 in hex))
*/
0x30, 0x29,
Expand Down
21 changes: 21 additions & 0 deletions certgen/csr_w_ed25519_example.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* csr_w_ed25519_example.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
* This file is part of wolfSSL.
*
* wolfSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* wolfSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/

#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/ed25519.h>
Expand Down
2 changes: 1 addition & 1 deletion crypto/camellia/camellia-encrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define SALT_SIZE 8

/*
* Makes a cryptographically secure key by stretMDMching a user entered key
* Makes a cryptographically secure key by stretching a user entered key
*/
int GenerateKey(RNG* rng, byte* key, int size, byte* salt, int pad)
{
Expand Down
106 changes: 54 additions & 52 deletions custom-io-callbacks/README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
This is an example to demonstrate how the custom IO callbacks can be used to</br>
facilitate a TLS connection using any medium. Here we chose the medium: "File System".</br>

Other mediums might be: </br>
USB Serial connection </br>
Bluetooth </br>
RFID </br>
Wifi </br>
Ethernet </br>
</br>
Just to name a few.</br>
</br>
These examples use the wolfSSL Custom IO Callbacks to read and write to the file</br>
system and perform a successful handshake.</br>
</br>
The configuration used for these examples was:</br>
./configure --enable-debug</br>
</br>
Debug was enabled in case a user wishes to use the verbose flag to see what is</br>
happening in real time:</br>
</br>
Usage examples:</br>
</br>
From the file-server directory:</br>
./start-server</br>
./start-server -v</br>
./start-server -verbose</br>
</br>
From the file-client directory:</br>
./start-client</br>
./start-client -v</br>
./start-client -verbose</br>
</br>
(-v and -verbose accomplish the same thing)</br>
</br>
</br>
SCRIPTS: The scripts provided attempt to make testing easier.</br>
</br>
file-server/check.sh</br>
- starts the server in a background shell and runs the client </br>
</br>
USAGE:</br>
./check.sh</br>
./check.sh -v</br>
./check.sh -verbose</br>
</br>
file-client/clean-io-files.sh</br>
- If something happens and there is leftover junk in the io files run this</br>
script to quickly cleanup before next round of testing.</br>
USAGE:</br>
./clean-io-files.sh</br>
</br>
# Custom IO Callback Example

This is an example to demonstrate how the custom IO callbacks can be used to
facilitate a TLS connection using any medium. Here we chose the medium: "File System".

Other transports might be:
* USB Serial connection
* Bluetooth
* RFID
* Wifi
* Ethernet

These examples use the wolfSSL Custom IO Callbacks to read and write to the file
system and perform a successful handshake.

The configuration used for these examples:

`./configure --enable-debug`

Debug was enabled in case a user wishes to use the verbose flag to see what is
happening in real time:

Usage examples:

From the file-server directory:
./start-server
./start-server -v
./start-server -verbose

From the file-client directory:
./start-client
./start-client -v
./start-client -verbose

(-v and -verbose accomplish the same thing)

## SCRIPTS

The scripts provided attempt to make testing easier.

* file-server/check.sh
- starts the server in a background shell and runs the client

USAGE:
./check.sh
./check.sh -v
./check.sh -verbose

* file-client/clean-io-files.sh
- If something happens and there is leftover junk in the io files run this
script to quickly cleanup before next round of testing.

USAGE:
./clean-io-files.sh
2 changes: 1 addition & 1 deletion custom-io-callbacks/file-client/file-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*
* EXAMPLE DEFINIITON:
* EXAMPLE DEFINITION:
*
* Instead of using sockets we will show how it is possible
* to deliver TLS handshake and packet exchange through the use of
Expand Down
4 changes: 2 additions & 2 deletions custom-io-callbacks/file-server/file-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*
* EXAMPLE DEFINIITON:
* EXAMPLE DEFINITION:
*
* Instead of using sockets we will show how it is possible
* to deliver TLS handshake and packet exchange through the use of
Expand Down Expand Up @@ -241,7 +241,7 @@ int main(int argc, char** argv)
printf("Server send successful\n");
break;
} else {
printf("Unkown error occured, shutting down\n");
printf("Unkown error occurred, shutting down\n");
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion dtls/client-dtls-ipv6.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* client-dtls.c
* client-dtls-ipv6.c
*
* Copyright (C) 2006-2020 wolfSSL Inc.
*
Expand Down
2 changes: 1 addition & 1 deletion dtls/client-dtls-nonblocking.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ int main (int argc, char** argv)
}

if (ret != SSL_SUCCESS) {
printf("SSL_connectrfailed with");
printf("SSL_connect failed with");
}
/* */
/*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion dtls/server-dtls-ipv6.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* server-dtls.c
/* server-dtls-ipv6.c
*
* Copyright (C) 2006-2015 wolfSSL Inc.
*
Expand Down
2 changes: 1 addition & 1 deletion dtls/server-udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
int main (void)
{
int sockfd; /* Initialize our socket */
int recvLen; /* number of bytes recieved */
int recvLen; /* number of bytes received */
int msgNum = 0; /* number of msg received */
unsigned char buf[MSGLEN]; /* the incoming message */
struct sockaddr_in servAddr; /* our server's address */
Expand Down
Loading

0 comments on commit 5ba15f1

Please sign in to comment.