Skip to content

Commit

Permalink
Upload secure-sockets 1.0.0.426
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlab-runner committed Apr 30, 2020
1 parent 1173357 commit 697301f
Show file tree
Hide file tree
Showing 159 changed files with 15,026 additions and 2 deletions.
210 changes: 210 additions & 0 deletions EULA.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
CYPRESS END USER LICENSE AGREEMENT

PLEASE READ THIS END USER LICENSE AGREEMENT ("Agreement") CAREFULLY BEFORE
DOWNLOADING, INSTALLING, COPYING, OR USING THIS SOFTWARE AND ACCOMPANYING
DOCUMENTATION. BY DOWNLOADING, INSTALLING, COPYING OR USING THE SOFTWARE,
YOU ARE AGREEING TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL
OF THE TERMS OF THIS AGREEMENT, PROMPTLY RETURN AND DO NOT USE THE SOFTWARE.
IF YOU HAVE PURCHASED THIS LICENSE TO THE SOFTWARE, YOUR RIGHT TO RETURN THE
SOFTWARE EXPIRES 30 DAYS AFTER YOUR PURCHASE AND APPLIES ONLY TO THE ORIGINAL
PURCHASER.

1. Definitions.

"Software" means this software and any accompanying documentation,
including any upgrades, updates, bug fixes or modified versions provided
to you by Cypress.

"Source Code" means software in human-readable form.

"Binary Code" means the software in binary code form such as object code or
an executable.

"Development Tools" means software that is intended to be installed on a
personal computer and used to create programming code for Firmware,
Drivers, or Host Applications. Examples of Development Tools are
Cypress's PSoC Creator software, Cypress's WICED SDKs, and Cypress's
ModusToolbox software.

"Firmware" means software that executes on a Cypress hardware product.

"Driver" means software that enables the use of a Cypress hardware product
on a particular host operating system such as GNU/Linux, Windows, MacOS,
Android, and iOS.

"Host Application" means software that executes on a device other than a
Cypress hardware product in order to program, control, or communicate
with a Cypress hardware product.

"inf File" means a hardware setup information file (.inf file) created by
the Software to allow a Microsoft Windows operating system to install
the driver for a Cypress hardware product.

2. License. Subject to the terms and conditions of this Agreement, Cypress
Semiconductor Corporation ("Cypress") and its suppliers grant to you a
non-exclusive, non-transferable license under their copyright rights:

a. to use the Development Tools in object code form solely for the purpose
of creating Firmware, Drivers, Host Applications, and inf Files for
Cypress hardware products; and

b. (i) if provided in Source Code form, to copy, modify, and compile the
Firmware Source Code to create Firmware for execution on a Cypress
hardware product, and
(ii) to distribute Firmware in binary code form only, only when
installed onto a Cypress hardware product; and

c. (i) if provided in Source Code form, to copy, modify, and compile the
Driver Source Code to create one or more Drivers to enable the use
of a Cypress hardware product on a particular host operating
system, and
(ii) to distribute the Driver, in binary code form only, only when
installed on a device that includes the Cypress hardware product
that the Driver is intended to enable; and

d. (i) if provided in Source Code form, to copy, modify, and compile the
Host Application Source Code to create one or more Host
Applications to program, control, or communicate with a Cypress
hardware product, and
(ii) to distribute Host Applications, in binary code form only, only
when installed on a device that includes a Cypress hardware product
that the Host Application is intended to program, control, or
communicate with; and

e. to freely distribute any inf File.

Any distribution of Software permitted under this Agreement must be made
pursuant to your standard end user license agreement used for your proprietary
(closed source) software products, such end user license agreement to include,
at a minimum, provisions limiting your licensors' liability and prohibiting
reverse engineering of the Software, consistent with such provisions in this
Agreement.

3. Free and Open Source Software. Portions of the Software may be licensed
under free and/or open source licenses such as the GNU General Public License
or other licenses from third parties ("Third Party Software"). Third Party
Software is subject to the applicable license agreement and not this
Agreement. If you are entitled to receive the source code from Cypress for
any Third Party Software included with the Software, either the source code
will be included with the Software or you may obtain the source code at no
charge from <http://www.cypress.com/go/opensource>. The applicable license
terms will accompany each source code package. To review the license terms
applicable to any Third Party Software for which Cypress is not required to
provide you with source code, please see the Software's installation directory
on your computer.

4. Proprietary Rights; Ownership. The Software, including all intellectual
property rights therein, is and will remain the sole and exclusive property of
Cypress or its suppliers. Cypress retains ownership of the Source Code and
any compiled version thereof. Subject to Cypress' ownership of the underlying
Software (including Source Code), you retain ownership of any modifications
you make to the Source Code. You agree not to remove any Cypress copyright or
other notices from the Source Code and any modifications thereof. You agree
to keep the Source Code confidential. Any reproduction, modification,
translation, compilation, or representation of the Source Code except as
permitted in Section 2 ("License") is prohibited without the express written
permission of Cypress. Except as otherwise expressly provided in this
Agreement, you may not:
(i) modify, adapt, or create derivative works based upon the Software;
(ii) copy the Software;
(iii) except and only to the extent explicitly permitted by applicable
law despite this limitation, decompile, translate, reverse engineer,
disassemble or otherwise reduce the Software to human-readable form;
or
(iv) use the Software or any sample code other than for the Purpose.
You hereby covenant that you will not assert any claim that the Software, or
derivative works thereof created by or for Cypress, infringe any intellectual
property right owned or controlled by you

5. No Support. Cypress may, but is not required to, provide technical support
for the Software.

6. Term and Termination. This Agreement is effective until terminated, and
either party may terminate this Agreement at any time with or without cause.
This Agreement and your license rights under this Agreement will terminate
immediately without notice from Cypress if you fail to comply with any
provision of this Agreement. Upon termination, you must destroy all copies of
Software in your possession or control. The following paragraphs shall
survive any termination of this Agreement: "Free and Open Source Software,"
"Proprietary Rights; Ownership," "Compliance With Law," "Disclaimer,"
"Limitation of Liability," and "General."

7. Compliance With Law. Each party agrees to comply with all applicable laws,
rules and regulations in connection with its activities under this Agreement.
Without limiting the foregoing, the Software may be subject to export control
laws and regulations of the United States and other countries. You agree to
comply strictly with all such laws and regulations and acknowledge that you
have the responsibility to obtain licenses to export, re-export, or import the
Software.

8. Disclaimer. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS
MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THE
SOFTWARE, INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress
reserves the right to make changes to the Software without notice. Cypress
does not assume any liability arising out of the application or use of
Software or any product or circuit described in the Software. It is the
responsibility of the user of the Software to properly design, program, and
test the functionality and safety of any application made of the Software and
any resulting product. Cypress does not authorize its Software or products
for use in any products where a malfunction or failure of the Software or
Cypress product may reasonably be expected to result in significant property
damage, injury or death ("High Risk Product"). If you include any Software or
Cypress product in a High Risk Product, you assume all risk of such use and
agree to indemnify Cypress and its suppliers against all liability. No
computing device can be absolutely secure. Therefore, despite security
measures implemented in Cypress hardware or software products, Cypress does
not assume any liability arising out of any security breach, such as
unauthorized access to or use of a Cypress product.

9. Limitation of Liability. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE
LAW, IN NO EVENT WILL CYPRESS OR ITS SUPPLIERS, RESELLERS, OR DISTRIBUTORS BE
LIABLE FOR ANY LOST REVENUE, PROFIT, OR DATA, OR FOR SPECIAL, INDIRECT,
CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS
OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR
INABILITY TO USE THE SOFTWARE EVEN IF CYPRESS OR ITS SUPPLIERS, RESELLERS, OR
DISTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO
EVENT SHALL CYPRESS' OR ITS SUPPLIERS', RESELLERS', OR DISTRIBUTORS' TOTAL
LIABILITY TO YOU, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), OR
OTHERWISE, EXCEED THE GREATER OF US$500 OR THE PRICE PAID BY YOU FOR THE
SOFTWARE. THE FOREGOING LIMITATIONS SHALL APPLY EVEN IF THE ABOVE-STATED
WARRANTY FAILS OF ITS ESSENTIAL PURPOSE. BECAUSE SOME STATES OR JURISDICTIONS
DO NOT ALLOW LIMITATION OR EXCLUSION OF CONSEQUENTIAL OR INCIDENTAL DAMAGES,
ALL OR PORTIONS OF THE ABOVE LIMITATION MAY NOT APPLY TO YOU.

10. Restricted Rights. The Software is commercial computer software as that
term is described in 48 C.F.R. 252.227-7014(a)(1). If the Software is being
acquired by or on behalf of the U.S. Government or by a U.S. Government prime
contractor or subcontractor (at any tier), then the Government's rights in
Software shall be only those set forth in this Agreement.

11. Personal Information. You agree that information you provide through your
registration on Cypress IoT Community Forum or other Cypress websites,
including contact information or other personal information, may be collected
and used by Cypress consistent with its Data Privacy Policy
(www.cypress.com/privacy-policy), as updated or revised from time to time, and
may be provided to its third party sales representatives, distributors and
other entities conducting sales activities for Cypress for sales-related and
other business purposes.

12. General. This Agreement will bind and inure to the benefit of each
party's successors and assigns, provided that you may not assign or transfer
this Agreement, in whole or in part, without Cypress' written consent. This
Agreement shall be governed by and construed in accordance with the laws of
the State of California, United States of America, as if performed wholly
within the state and without giving effect to the principles of conflict of
law. The parties consent to personal and exclusive jurisdiction of and venue
in, the state and federal courts within Santa Clara County, California;
provided however, that nothing in this Agreement will limit Cypress' right to
bring legal action in any venue in order to protect or enforce its
intellectual property rights. No failure of either party to exercise or
enforce any of its rights under this Agreement will act as a waiver of such
rights. If any portion of this Agreement is found to be void or
unenforceable, the remaining provisions of this Agreement shall remain in full
force and effect. This Agreement is the complete and exclusive agreement
between the parties with respect to the subject matter hereof, superseding and
replacing any and all prior agreements, communications, and understandings
(both written and oral) regarding such subject matter. Any notice to Cypress
will be deemed effective when actually received and must be sent to Cypress
Semiconductor Corporation, ATTN: Chief Legal Officer, 198 Champion Court, San
Jose, CA 95134 USA.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# secure-sockets
secure-sockets
# Cypress Secure Sockets library
Secure Sockets library eases application development by exposing a socket like interface for both secure and non-secure socket communication. This library provides abstraction API for underlying network and security libraries.

## Features and Functionality
Current implementation supports the following:

* Non-secure TCP communication using lwIP network stack.
* Secure (TLS) communication using MbedTLS library.
* Supports TCP/IPv4 connections. UDP and IPv6 will be supported in future.
* Provides thread-safe API.
* Provides API to support both client and server mode operations.
* Supports both synchronous and asynchronous API for data receive operation. Asynchronous mode support for server, to accept client connections.
* Provides a socket-option API to configure send/receive timeout, callback for asynchronous mode, TCP keep-alive parameters, certificate/key and TLS extensions.

## Supported Platforms
This library and its features are supported on the following Cypress platforms:
* [PSoC 6 Wi-Fi BT Prototyping Kit (CY8CPROTO-062-4343W)](https://www.cypress.com/documentation/development-kitsboards/psoc-6-wi-fi-bt-prototyping-kit-cy8cproto-062-4343w)
* [PSoC 62S2 Wi-Fi BT Pioneer Kit (CY8CKIT-062S2-43012)](https://www.cypress.com/documentation/development-kitsboards/psoc-62s2-wi-fi-bt-pioneer-kit-cy8ckit-062s2-43012)

## Quick Start
* Cypress secure sockets library configures the default send and receive timeout values to 10 seconds for a newly created socket. These can be changed using `cy_socket_setsockopt` API function. To change the send timeout, the `CY_SOCKET_SO_SNDTIMEO` socket option needs to be used; similarly for receive timeout `CY_SOCKET_SO_RCVTIMEO` socket option needs to be used. Adjust the default timeout values based on the network speed or use case.
* Cypress secure sockets library has been built on top of lwIP network stack and MbedTLS security stack libraries.
* Therefore, any application that uses secure sockets, needs to ensure that the following COMPONENTS are defined in the code example project's Makefile - *LWIP* and *MBEDTLS*
* Cypress secure sockets and TLS libraries enable only error prints by default. For debugging purposes, the application may additionally enable debug and info log messages. To enable these messages, add `SECURE_SOCKETS_ENABLE_PRINT_LIBRARY_INFO`, `SECURE_SOCKETS_ENABLE_PRINT_LIBRARY_DEBUG`, `TLS_ENABLE_PRINT_LIBRARY_INFO` and `TLS_ENABLE_PRINT_LIBRARY_DEBUG` macros to the *DEFINES* in the code example's Makefile. The Makefile entry would look like as follows:
```
DEFINES+=SECURE_SOCKETS_ENABLE_PRINT_LIBRARY_INFO SECURE_SOCKETS_ENABLE_PRINT_LIBRARY_DEBUG
DEFINES+=TLS_ENABLE_PRINT_LIBRARY_INFO TLS_ENABLE_PRINT_LIBRARY_DEBUG
```
* In order to ease the integration of Wi-Fi connectivity components, this secure socket library has been bundled into the (https://github.com/cypresssemiconductorco/wifi-mw-core)

## Additional Information
* [Secure Sockets RELEASE.md](./RELEASE.md)
* [Secure Sockets API Documentation](https://cypresssemiconductorco.github.io/secure-sockets/api_reference_manual/html/index.html)
* [ModusToolbox™ Software Environment, Quick Start Guide, Documentation, and Videos](https://www.cypress.com/products/modustoolbox-software-environment)
* [Secure Sockets Version](./version.txt)
* [ModusToolbox AnyCloud code examples](https://github.com/cypresssemiconductorco?q=mtb-example-anycloud%20NOT%20Deprecated)
30 changes: 30 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Cypress Secure Sockets

## What's Included?
Refer to the [README.md](./README.md) for a complete description of the secure sockets library

## Known Issues
| Problem | Workaround |
| ------- | ---------- |
| UDP, IPv6 and DTLS are not supported in the secure sockets library | No workaround. Support will be added in a future release |

## Changelog
### v1.0.0
* Initial release for secure sockets library
* Provides network abstraction APIs for underlying lwIP stack and mbedTLS library
* Secure sockets library eases application development by exposing a socket like interface for both secure and non-secure connections
* Currently, supports TCP/IPv4 connections. UDP and IPv6 support will be added in a future release.
* Only blocking mode is supported in this release. Non-blocking mode will be added in future release.

### Supported Software and Tools
This version of the library was validated for compatibility with the following Software and Tools:

| Software and Tools | Version |
| :--- | :----: |
| ModusToolbox Software Environment | 2.1 |
| - ModusToolbox Device Configurator | 2.1 |
| - ModusToolbox CSD Personality in Device Configurator | 2.0 |
| - ModusToolbox CapSense Configurator / Tuner tools | 3.0 |
| PSoC6 Peripheral Driver Library (PDL) | 1.5.1 |
| GCC Compiler | 9.2.1 |
| IAR Compiler | 8.32 |
15 changes: 15 additions & 0 deletions docs/api_reference_manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Redirect to API Reference Manual main page after 0 seconds</title>
<noscript>
<meta http-equiv="refresh" content="0; URL=api_reference_manual/html/index.html">
</noscript>
<meta name="keywords" content="automatic redirection">
</head>
<body onLoad="window.location='api_reference_manual/html/index.html' " >
<h2>
If the automatic redirection is failing, click the following link to open <a href="api_reference_manual/html/index.html">API Reference Manual</a>.
</h2>
</body>
</html>
Binary file added docs/api_reference_manual/html/bc_s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api_reference_manual/html/bdwn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api_reference_manual/html/closed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api_reference_manual/html/cypress_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api_reference_manual/html/doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/api_reference_manual/html/doxygen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 697301f

Please sign in to comment.