Imported Upstream version 4.3.2
[platform/upstream/libwebsockets.git] / LICENSE
1 Libwebsockets and included programs are provided under the terms of the
2 MIT license shown below, with the exception that some sources are under
3 a similar permissive license like BSD, or are explicitly CC0 / public
4 domain to remove any obstacles from basing differently-licensed code on
5 them.
6
7 Original liberal license retained:
8
9   - lib/misc/sha-1.c                     - 3-clause BSD license retained, link to original [BSD3]
10   - win32port/zlib                       - ZLIB license (see zlib.h) [ZLIB]
11   - lib/tls/mbedtls/wrapper              - Apache 2.0 (only built if linked against mbedtls) [APACHE2]
12     lib/tls/mbedtls/mbedtls-extensions.c
13   - lib/misc/base64-decode.c             - already MIT
14   - lib/misc/ieeehalfprecision.c         - 2-clause BSD license retained [BSD2]
15
16 Relicensed to MIT:
17
18   - lib/misc/daemonize.c               - relicensed from Public Domain to MIT,
19                                          link to original Public Domain version
20   - lib/plat/windows/windows-resolv.c  - relicensed from "Beerware v42" to MIT
21
22 Public Domain (CC-zero) to simplify reuse:
23
24   - test-apps/*.c
25   - test-apps/*.h
26   - minimal-examples/*
27   - lwsws/*
28
29 Although libwebsockets is available under a permissive license, it does not
30 change the reality of dealing with large lumps of external code... if your
31 copy diverges it is guaranteed to contain security problems after a while
32 and can be very painful to pick backports (especially since historically,
33 we are very hot on cleaning and refactoring the codebase).  The least
34 painful and lowest risk way remains sending your changes and fixes upstream
35 to us so you can easily use later releases and fixes.
36
37 ## MIT License applied to libwebsockets
38
39 https://opensource.org/licenses/MIT 
40
41  Permission is hereby granted, free of charge, to any person obtaining a copy
42  of this software and associated documentation files (the "Software"), to
43  deal in the Software without restriction, including without limitation the
44  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
45  sell copies of the Software, and to permit persons to whom the Software is
46  furnished to do so, subject to the following conditions:
47
48  The above copyright notice and this permission notice shall be included in
49  all copies or substantial portions of the Software.
50
51  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
56  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
57  IN THE SOFTWARE.
58
59 ## BSD2
60
61 ```
62  *  Redistribution and use in source and binary forms, with or without 
63  *  modification, are permitted provided that the following conditions are 
64  *  met:
65  *
66  *     * Redistributions of source code must retain the above copyright 
67  *       notice, this list of conditions and the following disclaimer.
68  *     * Redistributions in binary form must reproduce the above copyright 
69  *       notice, this list of conditions and the following disclaimer in 
70  *       the documentation and/or other materials provided with the distribution
71  *      
72  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
73  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
74  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
75  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
76  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
77  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
78  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
79  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
80  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
81  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
82  *  POSSIBILITY OF SUCH DAMAGE.
83 ```
84
85 ## BSD3
86
87 For convenience, a copy of the license on `./lib/misc/sha-1.c`.  In binary
88 distribution, this applies to builds with ws support enabled, and without
89 `LWS_WITHOUT_BUILTIN_SHA1` at cmake.
90
91 ```
92 /*
93  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
94  * All rights reserved.
95  *
96  * Redistribution and use in source and binary forms, with or without
97  * modification, are permitted provided that the following conditions
98  * are met:
99  * 1. Redistributions of source code must retain the above copyright
100  *    notice, this list of conditions and the following disclaimer.
101  * 2. Redistributions in binary form must reproduce the above copyright
102  *    notice, this list of conditions and the following disclaimer in the
103  *    documentation and/or other materials provided with the distribution.
104  * 3. Neither the name of the project nor the names of its contributors
105  *    may be used to endorse or promote products derived from this software
106  *    without specific prior written permission.
107  *
108  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
109  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
110  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
111  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
112  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
113  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
114  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
115  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
116  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
117  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
118  * SUCH
119 ```
120
121 ## ZLIB
122
123 For convenience, a copy of the license on zlib.  In binary distribution,
124 this applies for win32 builds with internal zlib only.  You can avoid
125 building any zlib usage or copy at all with `-DLWS_WITH_ZLIB=0` (the
126 default), and so avoid needing to observe the license for binary
127 distribution that doesn't include the related code.
128
129 ```
130   This software is provided 'as-is', without any express or implied
131   warranty.  In no event will the authors be held liable for any damages
132   arising from the use of this software.
133
134   Permission is granted to anyone to use this software for any purpose,
135   including commercial applications, and to alter it and redistribute it
136   freely, subject to the following restrictions:
137
138   1. The origin of this software must not be misrepresented; you must not
139      claim that you wrote the original software. If you use this software
140      in a product, an acknowledgment in the product documentation would be
141      appreciated but is not required.
142   2. Altered source versions must be plainly marked as such, and must not be
143      misrepresented as being the original software.
144   3. This notice may not be removed or altered from any source distribution.
145
146   Jean-loup Gailly        Mark Adler
147   jloup@gzip.org          madler@alumni.caltech.edu
148 ```
149
150
151 ## APACHE2
152
153 For convenience, a copy of the license on the mbedtls wrapper part.  In binary
154 distribution, this applies only when building lws against mbedtls.
155
156 The canonical license application to source files uses the URL reference, so the
157 whole is not reproduced here.
158
159 ```
160 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
161 //
162 // Licensed under the Apache License, Version 2.0 (the "License");
163 // you may not use this file except in compliance with the License.
164 // You may obtain a copy of the License at
165
166 //     http://www.apache.org/licenses/LICENSE-2.0
167 //
168 // Unless required by applicable law or agreed to in writing, software
169 // distributed under the License is distributed on an "AS IS" BASIS,
170 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
171 // See the License for the specific language governing permissions and
172 // limitations under the License.
173 ```
174
175 ## CC0
176
177 For convenience,the full text of CC0 dedication found on the lws examples.
178 The intention of this is to dedicate the examples to the public domain, so
179 users can build off and modify them without any constraint.
180
181 ```
182 Statement of Purpose
183
184 The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
185
186 Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
187
188 For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
189
190 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
191
192     the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
193     moral rights retained by the original author(s) and/or performer(s);
194     publicity and privacy rights pertaining to a person's image or likeness depicted in a Work;
195     rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
196     rights protecting the extraction, dissemination, use and reuse of data in a Work;
197     database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
198     other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
199
200 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose.
201
202 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose.
203
204 4. Limitations and Disclaimers.
205
206     No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
207     Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
208     Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
209     Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
210 ```
211