From adbd50f5239b2e23716c4280c2383f7dcaa1045c Mon Sep 17 00:00:00 2001 From: Kevin Lewi Date: Fri, 3 Dec 2021 14:38:11 -0800 Subject: [PATCH] Updating to dual-license (#252) --- Cargo.toml | 2 +- LICENSE | 27 +++++++++----------------- README.md | 3 +-- benches/opaque.rs | 6 ++++-- examples/digital_locker.rs | 6 ++++-- examples/simple_login.rs | 6 ++++-- src/ciphersuite.rs | 6 ++++-- src/envelope.rs | 6 ++++-- src/errors.rs | 6 ++++-- src/hash.rs | 6 ++++-- src/impls.rs | 6 ++++-- src/key_exchange/group/mod.rs | 6 ++++-- src/key_exchange/group/p256.rs | 6 ++++-- src/key_exchange/group/ristretto255.rs | 6 ++++-- src/key_exchange/group/x25519.rs | 6 ++++-- src/key_exchange/mod.rs | 6 ++++-- src/key_exchange/traits.rs | 6 ++++-- src/key_exchange/tripledh.rs | 6 ++++-- src/keypair.rs | 6 ++++-- src/lib.rs | 6 ++++-- src/messages.rs | 6 ++++-- src/opaque.rs | 6 ++++-- src/serialization/mod.rs | 6 ++++-- src/serialization/tests.rs | 6 ++++-- src/slow_hash.rs | 6 ++++-- src/tests/full_test.rs | 6 ++++-- src/tests/mock_rng.rs | 6 ++++-- src/tests/mod.rs | 6 ++++-- src/tests/opaque_vectors.rs | 6 ++++-- src/tests/parser.rs | 6 ++++-- src/tests/test_opaque_vectors.rs | 6 ++++-- 31 files changed, 123 insertions(+), 77 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2a7334e..90db53c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ keywords = ["cryptography", "crypto", "opaque", "passwords", "authentication"] categories = ["no-std"] description = "An implementation of the OPAQUE password-authenticated key exchange protocol" authors = ["Kevin Lewi ", "François Garillot "] -license = "MIT" +license = "Apache-2.0 OR MIT" edition = "2018" readme = "README.md" resolver = "2" diff --git a/LICENSE b/LICENSE index b96dcb0..09250ca 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,12 @@ -MIT License +## License -Copyright (c) Facebook, Inc. and its affiliates. +Licensed under either of + * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) +at your option. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +### Contribution -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall +be dual licensed as above, without any additional terms or conditions. diff --git a/README.md b/README.md index b537776..cd2aab3 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,7 @@ Special thanks go to Hugo Krawczyk and Chris Wood for helping to clarify discrep this implementation. Additional credit goes to @daxpedda for adding no_std support, p256 support, and making other general improvements to the library. - License ------- -This project is [MIT licensed](./LICENSE). +This project is [licensed](./LICENSE) under either Apache 2.0 or MIT, at your option. diff --git a/benches/opaque.rs b/benches/opaque.rs index 1b81af5..0c64bb7 100644 --- a/benches/opaque.rs +++ b/benches/opaque.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. #[macro_use] extern crate criterion; diff --git a/examples/digital_locker.rs b/examples/digital_locker.rs index 85856dc..76b98ba 100644 --- a/examples/digital_locker.rs +++ b/examples/digital_locker.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Demonstrates an implementation of a server-side secured digital locker using //! the client's OPAQUE export key, over a command-line interface diff --git a/examples/simple_login.rs b/examples/simple_login.rs index 365f29f..bd06604 100644 --- a/examples/simple_login.rs +++ b/examples/simple_login.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Demonstrates a simple client-server password-based login protocol //! using OPAQUE, over a command-line interface diff --git a/src/ciphersuite.rs b/src/ciphersuite.rs index 520d290..e0cece9 100644 --- a/src/ciphersuite.rs +++ b/src/ciphersuite.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Defines the CipherSuite trait to specify the underlying primitives for OPAQUE diff --git a/src/envelope.rs b/src/envelope.rs index 6812ee5..94f1066 100644 --- a/src/envelope.rs +++ b/src/envelope.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use crate::{ ciphersuite::CipherSuite, diff --git a/src/errors.rs b/src/errors.rs index d979294..18bfeee 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! A list of error types which are produced during an execution of the protocol use core::convert::Infallible; diff --git a/src/hash.rs b/src/hash.rs index 94b74a3..87161f2 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! A convenience trait for digest bounds used throughout the library diff --git a/src/impls.rs b/src/impls.rs index 585bd76..d54ac5a 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. macro_rules! impl_debug_eq_hash_for { (struct $name:ident$(<$($gen:ident$(: $bound:tt)?),+$(,)?>)?, [$field1:ident$(, $field2:ident)*$(,)?]$(, )?$([$($type:ty),+$(,)?]$(,)?)?) => { diff --git a/src/key_exchange/group/mod.rs b/src/key_exchange/group/mod.rs index 383597e..e7d7c22 100644 --- a/src/key_exchange/group/mod.rs +++ b/src/key_exchange/group/mod.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Includes the KeGroup trait and definitions for the //! key exchange groups diff --git a/src/key_exchange/group/p256.rs b/src/key_exchange/group/p256.rs index 57c260b..d46dcad 100644 --- a/src/key_exchange/group/p256.rs +++ b/src/key_exchange/group/p256.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Key Exchange group implementation for p256 diff --git a/src/key_exchange/group/ristretto255.rs b/src/key_exchange/group/ristretto255.rs index 5ee55d4..dcb4820 100644 --- a/src/key_exchange/group/ristretto255.rs +++ b/src/key_exchange/group/ristretto255.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Key Exchange group implementation for ristretto255 diff --git a/src/key_exchange/group/x25519.rs b/src/key_exchange/group/x25519.rs index b97851c..fc4f67e 100644 --- a/src/key_exchange/group/x25519.rs +++ b/src/key_exchange/group/x25519.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Key Exchange group implementation for x25519 diff --git a/src/key_exchange/mod.rs b/src/key_exchange/mod.rs index 1dae6a8..47fcb30 100644 --- a/src/key_exchange/mod.rs +++ b/src/key_exchange/mod.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Includes instantiations of key exchange protocols used in the //! login step for OPAQUE diff --git a/src/key_exchange/traits.rs b/src/key_exchange/traits.rs index b6a3c9d..239567f 100644 --- a/src/key_exchange/traits.rs +++ b/src/key_exchange/traits.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use crate::key_exchange::group::KeGroup; use crate::{ diff --git a/src/key_exchange/tripledh.rs b/src/key_exchange/tripledh.rs index 85afbf4..f15801b 100644 --- a/src/key_exchange/tripledh.rs +++ b/src/key_exchange/tripledh.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! An implementation of the Triple Diffie-Hellman key exchange protocol use crate::{ diff --git a/src/keypair.rs b/src/keypair.rs index 88aeb60..3b3633e 100644 --- a/src/keypair.rs +++ b/src/keypair.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Contains the keypair types that must be supplied for the OPAQUE API diff --git a/src/lib.rs b/src/lib.rs index 20db38a..cbf68f1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! An implementation of the OPAQUE asymmetric password authentication key exchange protocol //! diff --git a/src/messages.rs b/src/messages.rs index 600ae2a..0deeb05 100644 --- a/src/messages.rs +++ b/src/messages.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Contains the messages used for OPAQUE diff --git a/src/opaque.rs b/src/opaque.rs index 1f8e91f..af8fa69 100644 --- a/src/opaque.rs +++ b/src/opaque.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Provides the main OPAQUE API diff --git a/src/serialization/mod.rs b/src/serialization/mod.rs index 076a4ad..be5d288 100644 --- a/src/serialization/mod.rs +++ b/src/serialization/mod.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use crate::errors::ProtocolError; use alloc::vec::Vec; diff --git a/src/serialization/tests.rs b/src/serialization/tests.rs index 5a444f1..cce4808 100644 --- a/src/serialization/tests.rs +++ b/src/serialization/tests.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use crate::{ ciphersuite::CipherSuite, diff --git a/src/slow_hash.rs b/src/slow_hash.rs index 281dce7..dccc05c 100644 --- a/src/slow_hash.rs +++ b/src/slow_hash.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! Trait specifying a slow hashing function diff --git a/src/tests/full_test.rs b/src/tests/full_test.rs index 9989bb7..c418158 100644 --- a/src/tests/full_test.rs +++ b/src/tests/full_test.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. #![allow(unsafe_code)] diff --git a/src/tests/mock_rng.rs b/src/tests/mock_rng.rs index 1d10828..9f58b37 100644 --- a/src/tests/mock_rng.rs +++ b/src/tests/mock_rng.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use alloc::vec::Vec; use core::cmp::min; diff --git a/src/tests/mod.rs b/src/tests/mod.rs index da2aaa0..94863d5 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. mod full_test; pub mod mock_rng; diff --git a/src/tests/opaque_vectors.rs b/src/tests/opaque_vectors.rs index cc2341b..c97920e 100644 --- a/src/tests/opaque_vectors.rs +++ b/src/tests/opaque_vectors.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. //! The OPAQUE test vectors taken from: //! https://github.com/cfrg/draft-irtf-cfrg-opaque/blob/master/draft-irtf-cfrg-opaque.md diff --git a/src/tests/parser.rs b/src/tests/parser.rs index aed783f..bbfaf9c 100644 --- a/src/tests/parser.rs +++ b/src/tests/parser.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use alloc::string::String; diff --git a/src/tests/test_opaque_vectors.rs b/src/tests/test_opaque_vectors.rs index a653358..113f248 100644 --- a/src/tests/test_opaque_vectors.rs +++ b/src/tests/test_opaque_vectors.rs @@ -1,7 +1,9 @@ // Copyright (c) Facebook, Inc. and its affiliates. // -// This source code is licensed under the MIT license found in the -// LICENSE file in the root directory of this source tree. +// This source code is licensed under both the MIT license found in the +// LICENSE-MIT file in the root directory of this source tree and the Apache +// License, Version 2.0 found in the LICENSE-APACHE file in the root directory +// of this source tree. use crate::{ ciphersuite::CipherSuite, errors::*, key_exchange::tripledh::TripleDH, opaque::*,