diff --git a/IDE/apple-universal/build-wolfssl-framework.sh b/IDE/apple-universal/build-wolfssl-framework.sh index c6174e181..6e932865c 100755 --- a/IDE/apple-universal/build-wolfssl-framework.sh +++ b/IDE/apple-universal/build-wolfssl-framework.sh @@ -1,4 +1,26 @@ #!/bin/bash + +# build-wolfssl-framework.sh +# +# Copyright (C) 2006-2023 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 + + set -euxo pipefail WOLFSSL_DIR=$(pwd)/../../ diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift index 2a2786ad4..6e452c502 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/ContentView.swift @@ -1,15 +1,29 @@ -// -// ContentView.swift -// wolfssl-multiplatform -// -// Created by Brett Nicholas on 7/11/23. -// +/* ContentView.swift + * + * Copyright (C) 2006-2023 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 + */ import SwiftUI struct ContentView: View { - // Call our test function in the initialization of the view + /* Call our test function in the initialization of the view */ init() { wolfssl_test(); } diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c index 8922a9c72..ae3db2ea1 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.c @@ -1,3 +1,24 @@ +/* simple_client_example.c + * + * Copyright (C) 2006-2023 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 "simple_client_example.h" #include @@ -5,7 +26,10 @@ #include #include #include + +#ifndef WOLFSSL_USER_SETTINGS #include +#endif #include #define SERVER_HOST "www.wolfssl.com" @@ -17,7 +41,7 @@ int simple_client_example(void) WOLFSSL* ssl; int sockfd, ret; - // Resolve the server address + /* Resolve the server address */ struct addrinfo hints, *server_addr; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; @@ -29,7 +53,7 @@ int simple_client_example(void) return 1; } - // Create a TCP socket + /* Create a TCP socket */ sockfd = socket(server_addr->ai_family, server_addr->ai_socktype, server_addr->ai_protocol); if (sockfd == -1) { perror("Failed to create socket"); @@ -37,7 +61,7 @@ int simple_client_example(void) return 1; } - // Connect to the server + /* Connect to the server */ ret = connect(sockfd, server_addr->ai_addr, server_addr->ai_addrlen); if (ret == -1) { perror("Failed to connect to server"); @@ -48,10 +72,10 @@ int simple_client_example(void) freeaddrinfo(server_addr); - // Initialize wolfSSL library + /* Initialize wolfSSL library */ wolfSSL_Init(); - // Create a new SSL context + /* Create a new SSL context */ ctx = wolfSSL_CTX_new(wolfTLSv1_3_client_method()); if (ctx == NULL) { printf("Unable to create SSL context.\n"); @@ -59,10 +83,10 @@ int simple_client_example(void) return 1; } - // Load CA certificate into WOLFSSL_CTX - // NOTE: CERT_PATH macro is set relative to Xcode $(PROJECT_DIR) environment variable - // in the preprocessor macros section of the project build settings to avoid hardcoding - // a path in the source code. The CA cert is located at wolfssl/certs/wolfssl-website-ca.pem. + /* Load CA certificate into WOLFSSL_CTX + * NOTE: CERT_PATH macro is set relative to Xcode $(PROJECT_DIR) environment variable + * in the preprocessor macros section of the project build settings to avoid hardcoding + * a path in the source code. The CA cert is located at wolfssl/certs/wolfssl-website-ca.pem. */ if ((ret = wolfSSL_CTX_load_verify_locations(ctx, CERT_PATH, NULL)) != WOLFSSL_SUCCESS) { printf("ERROR: failed to load %s, please check the file.\n", CERT_PATH); wolfSSL_CTX_free(ctx); @@ -70,7 +94,7 @@ int simple_client_example(void) return 1; } - // Create a new SSL object + /* Create a new SSL object */ ssl = wolfSSL_new(ctx); if (ssl == NULL) { printf("Unable to create SSL object.\n"); @@ -79,10 +103,10 @@ int simple_client_example(void) return 1; } - // Attach the SSL object to the socket file descriptor + /* Attach the SSL object to the socket file descriptor */ wolfSSL_set_fd(ssl, sockfd); - // Perform the SSL handshake + /* Perform the SSL handshake */ ret = wolfSSL_connect(ssl); if (ret != SSL_SUCCESS) { printf("SSL connection failed: %d\n", wolfSSL_get_error(ssl, ret)); @@ -92,14 +116,14 @@ int simple_client_example(void) return 1; } - // Send an HTTP request + /* Send an HTTP request */ const char* request = "GET / HTTP/1.1\r\nHost: www.wolfssl.com\r\n\r\n"; ret = wolfSSL_write(ssl, request, (int)strlen(request)); if (ret < 0) { printf("Failed to send HTTP request.\n"); } - // Receive and print the server's response + /* Receive and print the server's response */ char buffer[1024]; ret = wolfSSL_read(ssl, buffer, sizeof(buffer) - 1); if (ret > 0) { @@ -109,7 +133,7 @@ int simple_client_example(void) printf("Failed to receive server response.\n"); } - // Clean up and close the connection + /* Clean up and close the connection */ wolfSSL_shutdown(ssl); wolfSSL_free(ssl); wolfSSL_CTX_free(ctx); diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h index 96b8367ff..ce8895821 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/simple_client_example.h @@ -1,8 +1,23 @@ -// -// simple_client_example.h -// wolfssl-multiplatform -// -// +/* simple_client_example.h + * + * Copyright (C) 2006-2023 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 + */ #ifndef simple_client_example_h #define simple_client_example_h diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h index 9c36b59bf..e3f72df56 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl-multiplatform-Bridging-Header.h @@ -1,4 +1,25 @@ -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// +/* wolfssl-multiplatform-Bridging-Header.h + * + * Copyright (C) 2006-2023 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 + */ + +/* + * Use this file to import your target's public headers that you would like to expose to Swift. + */ #import "wolfssl_test_driver.h" diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift index 52208d6e3..acf2a03aa 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_multiplatformApp.swift @@ -1,9 +1,23 @@ -// -// wolfssl_multiplatformApp.swift -// wolfssl-multiplatform -// -// Created by Brett Nicholas on 7/11/23. -// +/* wolfssl_multiplatformApp.swift + * + * Copyright (C) 2006-2023 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 + */ import SwiftUI diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c index 78916eab7..50655c834 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.c @@ -1,13 +1,29 @@ -// -// wolfssl_test.c -// wolfssl-multiplatform -// -// Created by Brett Nicholas on 7/11/23. -// +/* wolfssl_test_driver.c + * + * Copyright (C) 2006-2023 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_test_driver.h" +#ifndef WOLFSSL_USER_SETTINGS #include +#endif #include #include "test.h" diff --git a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h index 18190ca76..a3104e64e 100644 --- a/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h +++ b/IDE/apple-universal/wolfssl-multiplatform/wolfssl-multiplatform/wolfssl_test_driver.h @@ -1,9 +1,23 @@ -// -// wolfssl_test.h -// wolfssl-multiplatform -// -// Created by Brett Nicholas on 7/11/23. -// +/* wolfssl_test_driver.h + * + * Copyright (C) 2006-2023 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 + */ #ifndef wolfssl_test_driver_h #define wolfssl_test_driver_h