Merge branch 'master' into rip

This commit is contained in:
Edouard Oger 2020-04-21 12:48:44 -04:00 коммит произвёл GitHub
Родитель 145a74ba59 92f0736797
Коммит 7a44610972
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
104 изменённых файлов: 2986 добавлений и 2257 удалений

Просмотреть файл

@ -1,5 +1,7 @@
version: 2.1
# ⚠️ If you add, rename or delete a job here, please also update .mergify.yml! ⚠️
commands:
setup-sccache:
steps:
@ -130,8 +132,6 @@ commands:
- setup-rust-toolchain:
rust-version: <<parameters.rust-version>>
- setup-sccache
# nss_sys's bindgen needs clang.
- run: sudo apt-get install clang
# clipboard crate depends on some x11 libs.
- run: sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev
- run: |
@ -509,7 +509,7 @@ workflows:
carthage-framework:
jobs:
- iOS build and test:
filters: # required since `Release` has tag filters AND requires `Build`
filters: # required since `Release` has tag filters AND requires `Build`
tags:
only: /.*/
- Carthage release:

2
.gitignore поставляемый
Просмотреть файл

@ -4,6 +4,7 @@ credentials.json
*-engine.json
.cargo
*.db
.*.swp
# Android stuff.
*.iml
@ -14,6 +15,7 @@ build
.DS_Store
captures
.externalNativeBuild
.lastAutoPublishContentsHash
# iOS stuff.
xcuserdata

69
.mergify.yml Normal file
Просмотреть файл

@ -0,0 +1,69 @@
pull_request_rules:
- name: remove outdated reviews for non-core authors
conditions:
- base=master
- author!=@mozilla/application-services
actions:
dismiss_reviews:
message: The pull request has been modified, dismissing previous reviews.
label:
remove:
- checkin-needed
- name: automatic merge for master
conditions:
- "#approved-reviews-by>=1"
- base=master
- label=checkin-needed
- "status-success=android-build-pr"
- "status-success=lint-detekt"
- "status-success=lint-ktlint"
- "status-success=ci/circleci: Check Protobuf files are up-to-date"
- "status-success=ci/circleci: Check Rust dependencies"
- "status-success=ci/circleci: Check Rust formatting"
- "status-success=ci/circleci: Check Swift formatting"
- "status-success=ci/circleci: Lint Bash scripts"
- "status-success=ci/circleci: Lint Rust with clippy"
- "status-success=ci/circleci: Rust benchmarks"
- "status-success=ci/circleci: Rust tests"
- "status-success=ci/circleci: Sync integration tests"
- "status-success=ci/circleci: iOS build and test"
actions:
merge:
method: merge
strict: smart
strict_method: rebase
# Copy pasta of above, with different checks.
- name: automatic merge for master (CI FULL)
conditions:
- "#approved-reviews-by>=1"
- base=master
- label=checkin-needed
- "status-success=module-build-logins"
- "status-success=module-build-httpconfig"
- "status-success=module-build-full-megazord"
- "status-success=module-build-tabs"
- "status-success=module-build-lockbox-megazord"
- "status-success=module-build-rustlog"
- "status-success=module-build-places"
- "status-success=module-build-sync15"
- "status-success=module-build-syncmanager"
- "status-success=module-build-fxaclient"
- "status-success=module-build-push"
- "status-success=module-build-native-support"
- "status-success=lint-detekt"
- "status-success=lint-ktlint"
- "status-success=ci/circleci: Check Protobuf files are up-to-date"
- "status-success=ci/circleci: Check Rust dependencies"
- "status-success=ci/circleci: Check Rust formatting"
- "status-success=ci/circleci: Check Swift formatting"
- "status-success=ci/circleci: Lint Bash scripts"
- "status-success=ci/circleci: Lint Rust with clippy"
- "status-success=ci/circleci: Rust benchmarks"
- "status-success=ci/circleci: Rust tests"
- "status-success=ci/circleci: Sync integration tests"
- "status-success=ci/circleci: iOS build and test"
actions:
merge:
method: merge
strict: smart
strict_method: rebase

Просмотреть файл

@ -147,7 +147,7 @@ tasks:
scopes:
- queue:scheduler-id:taskcluster-github
routes:
- statuses
- checks
metadata:
owner: &task_owner ${user}@users.noreply.github.com
source: &task_source ${repository}/raw/${head_rev}/.taskcluster.yml

12
.vscode/extensions.json поставляемый
Просмотреть файл

@ -2,9 +2,19 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format.
"recommendations": [
// Trim only touched lines.
"nathanridley.autotrim",
// Bash scripts linting.
"timonwong.shellcheck",
// Rust language support.
"rust-lang.rust",
"matklad.rust-analyzer",
// Protobuf files support.
"peterj.proto",
// TOML language support.
"bungcip.better-toml",
// YAML language support.
"redhat.vscode-yaml",
// Cargo.toml versions helper.
"serayuzgur.crates"
]
}

Просмотреть файл

@ -7,6 +7,7 @@
## General
- Android: Gradle wrapper version upgraded to `6.3`, Android Gradle Plugin version upgraded to `3.6.0`. ([#2917](https://github.com/mozilla/application-services/pull/2917))
- Upgraded Android NDK from r20 to r21. ([#2985](https://github.com/mozilla/application-services/pull/2985))
## FxA Client

619
Cargo.lock сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -18,6 +18,7 @@ members = [
"components/support/rc_crypto/nss",
"components/support/rc_crypto/nss/nss_build_common",
"components/support/rc_crypto/nss/nss_sys",
"components/support/rc_crypto/nss/systest",
"components/support/sql",
"components/support/sync15-traits",
"components/support/viaduct-reqwest",
@ -27,6 +28,7 @@ members = [
"components/tabs",
"components/tabs/ffi",
"components/viaduct",
"components/webext-storage",
"megazords/full",
"megazords/ios/rust",
"megazords/lockbox",

Просмотреть файл

@ -7,39 +7,31 @@ the details of which are reproduced below.
* [Mozilla Public License 2.0](#mozilla-public-license-20)
* [Apache License 2.0](#apache-license-20)
* [MIT License: SwiftKeychainWrapper](#mit-license-swiftkeychainwrapper)
* [MIT License: aho-corasick, byteorder, memchr, termcolor](#mit-license-aho-corasick-byteorder-memchr-termcolor)
* [MIT License: ansi_term](#mit-license-ansi_term)
* [MIT License: atty](#mit-license-atty)
* [MIT License: aho-corasick, byteorder, memchr](#mit-license-aho-corasick-byteorder-memchr)
* [MIT License: bincode](#mit-license-bincode)
* [MIT License: bytes](#mit-license-bytes)
* [MIT License: caseless](#mit-license-caseless)
* [MIT License: clap](#mit-license-clap)
* [MIT License: h2](#mit-license-h2)
* [MIT License: http-body](#mit-license-http-body)
* [MIT License: hyper](#mit-license-hyper)
* [MIT License: kernel32-sys, winapi-build, ws2_32-sys](#mit-license-kernel32-sys-winapi-build-ws2_32-sys)
* [MIT License: libsqlite3-sys, rusqlite](#mit-license-libsqlite3-sys-rusqlite)
* [MIT License: libsqlite3-sys](#mit-license-libsqlite3-sys)
* [MIT License: matches](#mit-license-matches)
* [MIT License: mime_guess](#mit-license-mime_guess)
* [MIT License: mio](#mit-license-mio)
* [MIT License: nom](#mit-license-nom)
* [MIT License: openssl-sys](#mit-license-openssl-sys)
* [MIT License: rusqlite](#mit-license-rusqlite)
* [MIT License: schannel](#mit-license-schannel)
* [MIT License: slab](#mit-license-slab)
* [MIT License: strsim](#mit-license-strsim)
* [MIT License: synstructure](#mit-license-synstructure)
* [MIT License: textwrap](#mit-license-textwrap)
* [MIT License: tokio, tokio-tls, tokio-util](#mit-license-tokio-tokio-tls-tokio-util)
* [MIT License: tower-service](#mit-license-tower-service)
* [MIT License: try-lock](#mit-license-try-lock)
* [MIT License: want](#mit-license-want)
* [MIT License: which](#mit-license-which)
* [MIT License: winapi](#mit-license-winapi)
* [MIT License: winreg](#mit-license-winreg)
* [CC0-1.0 License: base16](#cc0-10-license-base16)
* [ISC License: libloading](#isc-license-libloading)
* [ISC License: ring](#isc-license-ring)
* [BSD-3-Clause License: bindgen](#bsd-3-clause-license-bindgen)
* [BSD-3-Clause License: protobuf](#bsd-3-clause-license-protobuf)
* [BSD-3-Clause License: sqlcipher](#bsd-3-clause-license-sqlcipher)
* [OpenSSL License](#openssl-license)
@ -437,20 +429,16 @@ The following text applies to code linked from these dependencies:
[autocfg](https://github.com/cuviper/autocfg),
[backtrace-sys](https://github.com/alexcrichton/backtrace-rs),
[backtrace](https://github.com/rust-lang/backtrace-rs),
[base64](https://github.com/alicemaz/rust-base64),
[base64](https://github.com/marshallpierce/rust-base64),
[bitflags](https://github.com/bitflags/bitflags),
[cc](https://github.com/alexcrichton/cc-rs),
[cexpr](https://github.com/jethrogb/rust-cexpr),
[cfg-if](https://github.com/alexcrichton/cfg-if),
[clang-sys](https://github.com/KyleMayes/clang-sys),
[core-foundation-sys](https://github.com/servo/core-foundation-rs),
[core-foundation](https://github.com/servo/core-foundation-rs),
[dogear](https://github.com/mozilla/dogear),
[dtoa](https://github.com/dtolnay/dtoa),
[either](https://github.com/bluss/either),
[encoding_rs](https://github.com/hsivonen/encoding_rs),
[env_logger](https://github.com/sebasmagri/env_logger/),
[failure](https://github.com/rust-lang-nursery/failure),
[failure_derive](https://github.com/rust-lang-nursery/failure),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
@ -466,11 +454,9 @@ The following text applies to code linked from these dependencies:
[futures-task](https://github.com/rust-lang/futures-rs),
[futures-util](https://github.com/rust-lang/futures-rs),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[hex](https://github.com/KokaKiwi/rust-hex),
[http](https://github.com/hyperium/http),
[httparse](https://github.com/seanmonstar/httparse),
[humantime](https://github.com/tailhook/humantime),
[hyper-tls](https://github.com/hyperium/hyper-tls),
[idna](https://github.com/servo/rust-url/),
[indexmap](https://github.com/bluss/indexmap),
@ -479,7 +465,6 @@ The following text applies to code linked from these dependencies:
[itoa](https://github.com/dtolnay/itoa),
[jna](https://github.com/java-native-access/jna),
[lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs),
[lazycell](https://github.com/indiv0/lazycell),
[libc](https://github.com/rust-lang/libc),
[linked-hash-map](https://github.com/contain-rs/linked-hash-map),
[log](https://github.com/rust-lang/log),
@ -493,7 +478,6 @@ The following text applies to code linked from these dependencies:
[openssl-probe](https://github.com/alexcrichton/openssl-probe),
[openssl-src](https://github.com/alexcrichton/openssl-src-rs),
[openssl](https://github.com/sfackler/rust-openssl),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[pin-project-internal](https://github.com/taiki-e/pin-project),
[pin-project-lite](https://github.com/taiki-e/pin-project-lite),
@ -504,7 +488,6 @@ The following text applies to code linked from these dependencies:
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-derive](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
[rand](https://github.com/rust-random/rand),
[rand_chacha](https://github.com/rust-random/rand),
@ -514,7 +497,6 @@ The following text applies to code linked from these dependencies:
[remove_dir_all](https://github.com/XAMPPRocky/remove_dir_all.git),
[reqwest](https://github.com/seanmonstar/reqwest),
[rustc-demangle](https://github.com/alexcrichton/rustc-demangle),
[rustc-hash](https://github.com/rust-lang-nursery/rustc-hash),
[ryu](https://github.com/dtolnay/ryu),
[security-framework-sys](https://github.com/kornelski/rust-security-framework),
[security-framework](https://github.com/kornelski/rust-security-framework),
@ -522,7 +504,6 @@ The following text applies to code linked from these dependencies:
[serde_derive](https://github.com/serde-rs/serde),
[serde_json](https://github.com/serde-rs/json),
[serde_urlencoded](https://github.com/nox/serde_urlencoded),
[shlex](https://github.com/comex/rust-shlex),
[smallbitvec](https://github.com/servo/smallbitvec),
[smallvec](https://github.com/servo/rust-smallvec),
[swift-protobuf](https://github.com/apple/swift-protobuf),
@ -530,14 +511,11 @@ The following text applies to code linked from these dependencies:
[tempfile](https://github.com/Stebalien/tempfile),
[thread_local](https://github.com/Amanieu/thread_local-rs),
[time](https://github.com/rust-lang/time),
[toml](https://github.com/alexcrichton/toml-rs),
[unicase](https://github.com/seanmonstar/unicase),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),
[vec_map](https://github.com/contain-rs/vec-map),
[version_check](https://github.com/SergioBenitez/version_check),
[winapi-x86_64-pc-windows-gnu](https://github.com/retep998/winapi-rs),
[winapi](https://github.com/retep998/winapi-rs)
@ -778,13 +756,12 @@ SOFTWARE.
```
-------------
## MIT License: aho-corasick, byteorder, memchr, termcolor
## MIT License: aho-corasick, byteorder, memchr
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr),
[termcolor](https://github.com/BurntSushi/termcolor)
[memchr](https://github.com/BurntSushi/rust-memchr)
```
The MIT License (MIT)
@ -809,65 +786,6 @@ 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.
```
-------------
## MIT License: ansi_term
The following text applies to code linked from these dependencies:
[ansi_term](https://github.com/ogham/rust-ansi-term)
```
The MIT License (MIT)
Copyright (c) 2014 Benjamin Sago
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:
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.
```
-------------
## MIT License: atty
The following text applies to code linked from these dependencies:
[atty](https://github.com/softprops/atty)
```
Copyright (c) 2015-2019 Doug Tangren
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:
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.
```
-------------
## MIT License: bincode
@ -963,36 +881,6 @@ 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.
```
-------------
## MIT License: clap
The following text applies to code linked from these dependencies:
[clap](https://github.com/clap-rs/clap)
```
The MIT License (MIT)
Copyright (c) 2015-2016 Kevin B. Knapp
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:
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.
```
-------------
## MIT License: h2
@ -1122,14 +1010,13 @@ SOFTWARE.
```
-------------
## MIT License: libsqlite3-sys, rusqlite
## MIT License: libsqlite3-sys
The following text applies to code linked from these dependencies:
[libsqlite3-sys](https://github.com/jgallagher/rusqlite),
[rusqlite](https://github.com/jgallagher/rusqlite)
[libsqlite3-sys](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
Copyright (c) 2014-2020 The rusqlite developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -1242,35 +1129,6 @@ 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.
```
-------------
## MIT License: nom
The following text applies to code linked from these dependencies:
[nom](https://github.com/Geal/nom)
```
Copyright (c) 2014-2019 Geoffroy Couprie
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:
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.
```
-------------
## MIT License: openssl-sys
@ -1305,6 +1163,34 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: rusqlite
The following text applies to code linked from these dependencies:
[rusqlite](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
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:
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.
```
-------------
## MIT License: schannel
@ -1355,38 +1241,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: strsim
The following text applies to code linked from these dependencies:
[strsim](https://github.com/dguo/strsim-rs)
```
The MIT License (MIT)
Copyright (c) 2015 Danny Guo
Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
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:
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.
```
-------------
## MIT License: synstructure
@ -1403,36 +1257,6 @@ The above copyright notice and this permission notice shall be included in all c
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.
```
-------------
## MIT License: textwrap
The following text applies to code linked from these dependencies:
[textwrap](https://github.com/mgeisler/textwrap)
```
MIT License
Copyright (c) 2016 Martin Geisler
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:
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.
```
-------------
## MIT License: tokio, tokio-tls, tokio-util
@ -1562,34 +1386,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
-------------
## MIT License: which
The following text applies to code linked from these dependencies:
[which](https://github.com/harryfei/which-rs.git)
```
Copyright (c) 2015 fangyuanziti
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:
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.
```
-------------
## MIT License: winapi
@ -1778,27 +1574,6 @@ express Statement of Purpose.
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
```
-------------
## ISC License: libloading
The following text applies to code linked from these dependencies:
[libloading](https://github.com/nagisa/rust_libloading/)
```
Copyright © 2015, Simonas Kazlauskas
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
```
-------------
## ISC License: ring
@ -1822,44 +1597,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
-------------
## BSD-3-Clause License: bindgen
The following text applies to code linked from these dependencies:
[bindgen](https://github.com/rust-lang/rust-bindgen)
```
BSD 3-Clause License
Copyright (c) 2013, Jyun-Yan You
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
-------------
## BSD-3-Clause License: protobuf

Просмотреть файл

@ -33,3 +33,6 @@ for manifest in $(cargo metadata --format-version 1 --no-deps | tr -s '"' '\n' |
echo "## no-default-features test for package $package (manifest @ $manifest)"
cargo test --manifest-path "$manifest" --no-default-features ${EXTRA_ARGS[@]:+"${EXTRA_ARGS[@]}"}
done
# Test NSS bindings
cargo run -p systest

Просмотреть файл

@ -36,7 +36,18 @@ BUILDCONFIG_VERSION_FIELD = "libraryVersion"
UNRELEASED_CHANGES_FILE = "CHANGES_UNRELEASED.md"
CHANGELOG_FILE = "CHANGELOG.md"
# 1. Calculate new version number.
# 1. Create a new branch based on the branch we want to release from.
ensure_working_tree_clean()
step_msg(f"Updating remote {remote}")
run_cmd_checked(["git", "remote", "update", remote])
temp_branch = f"prepare-release-from-{base_branch}"
step_msg(f"Checking out candidate release branch from {base_branch}")
run_cmd_checked(["git", "checkout", "-b", temp_branch, "--no-track", f"{remote}/{base_branch}"])
# 2. Calculate new version number based on what's in the base branch.
with open(BUILDCONFIG_FILE, "r") as stream:
buildConfig = yaml.safe_load(stream)
@ -58,18 +69,9 @@ elif release_type == "patch":
next_version = f"{major}.{minor}.{patch}"
next_version_full = f"v{next_version}"
step_msg(f"Preparing release {next_version_full}")
# 2. Create a new branch based on the branch we want to release from.
ensure_working_tree_clean()
step_msg(f"Updating remote {remote}")
run_cmd_checked(["git", "remote", "update", remote])
release_branch = f"cut-{next_version_full}"
step_msg(f"Creating release branch {release_branch} from {base_branch}")
run_cmd_checked(["git", "checkout", "-b", release_branch, "--no-track", f"{remote}/{base_branch}"])
step_msg(f"Preparing release branch {release_branch} for {next_version_full}")
run_cmd_checked(["git", "branch", "-M", temp_branch, release_branch])
# 3. Bump YML version

Просмотреть файл

@ -0,0 +1,76 @@
#!/usr/bin/env python3
# Purpose: Publish android packages to local maven repo, but only if changed since last publish.
# Dependencies: None
# Usage: ./automation/publish_to_maven_local_if_modified.py
import os
import time
import hashlib
import argparse
from shared import run_cmd_checked, find_app_services_root, fatal_err
import re
LAST_CONTENTS_HASH_FILE = ".lastAutoPublishContentsHash"
parser = argparse.ArgumentParser(description="Publish android packages to local maven repo, but only if changed since last publish")
parser.parse_args()
root_dir = find_app_services_root()
if str(root_dir) != os.path.abspath(os.curdir):
fatal_err(f"This only works if run from the repo root ({root_dir!r} != {os.path.abspath(os.curdir)!r})")
# Calculate a hash reflecting the current state of the repo.
contents_hash = hashlib.sha256()
contents_hash.update(
run_cmd_checked(["git", "rev-parse", "HEAD"], capture_output=True).stdout
)
contents_hash.update(b"\x00")
# Git can efficiently tell us about changes to tracked files, including
# the diff of their contents, if you give it enough "-v"s.
changes = run_cmd_checked(["git", "status", "-v", "-v"], capture_output=True).stdout
contents_hash.update(changes)
contents_hash.update(b"\x00")
# But unfortunately it can only tell us the names of untracked
# files, so we need to slurp their contents in for ourselves.
changes_lines = iter(ln.strip() for ln in changes.split(b"\n"))
try:
ln = next(changes_lines)
while not ln.startswith(b"Untracked files:"):
ln = next(changes_lines)
ln = next(changes_lines) # skip instruction about using `git add`
ln = next(changes_lines)
while ln:
with open(ln, "rb") as f:
contents_hash.update(f.read())
contents_hash.update(b"\x00")
ln = next(changes_lines)
except StopIteration:
pass
contents_hash.update(b"\x00")
contents_hash = contents_hash.hexdigest()
# If the contents hash has changed since last publish, re-publish.
last_contents_hash = ""
try:
with open(LAST_CONTENTS_HASH_FILE) as f:
last_contents_hash = f.read().strip()
except FileNotFoundError:
pass
if contents_hash == last_contents_hash:
print("Contents have not changed, no need to publish")
else:
print("Contents have changed, publishing")
run_cmd_checked(["./gradlew", "publishToMavenLocal", f"-Plocal={time.time_ns()}"])
with open(LAST_CONTENTS_HASH_FILE, "w") as f:
f.write(contents_hash)
f.write("\n")

Просмотреть файл

@ -1,7 +1,7 @@
#!/usr/bin/env python3
# Purpose: Run android-components tests against this application-services working tree.
# Dependencies: yaml
# Dependencies: PyYAML
# Usage: ./automation/smoke-test-android-components.py
import argparse

Просмотреть файл

@ -79,8 +79,11 @@ if ac_repo_path is not None:
if action == "do-nothing":
exit(0)
elif action == "run-tests" or action is None:
# Fenix has unittest targets for a wide variety of different configurations.
# It's not useful to us to run them all, so just pick the one that sounds like it's
# least likely to be broken for unrelated reasons.
step_msg("Running fenix tests")
run_cmd_checked(["./gradlew", "app:test"], cwd=repo_path)
run_cmd_checked(["./gradlew", "app:testGeckoBetaDebugUnitTest"], cwd=repo_path)
# XXX TODO: I would also like to run the sync integration tests described here:
# https://docs.google.com/document/d/1dhxlbGQBA6aJi2Xz-CsJZuGJPRReoL7nfm9cYu4HcZI/
# However they do not currently pass reliably on my machine.

Просмотреть файл

@ -151,7 +151,7 @@ class Task:
self.index_and_artifacts_expire_in = self.expires_in
self.dependencies = []
self.scopes = []
self.routes = []
self.routes = ['checks']
self.extra = {}
# All `with_*` methods return `self`, so multiple method calls can be chained.

Просмотреть файл

@ -49,8 +49,6 @@ RUN apt-get update -qq \
# For `cc` crates; see https://github.com/jwilm/alacritty/issues/1440.
# <TODO: Is this still true?>.
g++ \
# <TODO: Explain why we have this dependency>.
clang \
python3 \
python3-pip \
# taskcluster > mohawk > setuptools.
@ -107,7 +105,7 @@ RUN curl -sfSL --retry 5 --retry-delay 10 https://dl.google.com/android/reposito
# Android NDK
ENV ANDROID_NDK_VERSION "r20"
ENV ANDROID_NDK_VERSION "r21"
# $ANDROID_NDK_ROOT is the preferred name, but the android gradle plugin uses $ANDROID_NDK_HOME.
ENV ANDROID_NDK_ROOT /build/android-ndk

Просмотреть файл

@ -1,5 +1,14 @@
#!/usr/bin/env bash
set -euvx
set -eEuvx
function error_help()
{
ERROR_MSG="It looks like something went wrong building the Application Services framework."
ERROR_MSG="${ERROR_MSG} This is most likely related to some missing system dependencies."
ERROR_MSG="${ERROR_MSG} See https://github.com/mozilla/application-services/blob/master/docs/building.md#ios-development for instructions."
echo "error: ${ERROR_MSG}"
}
trap error_help ERR
# XCode tries to be helpful and overwrites the PATH. Reset that.
PATH="$(bash -l -c 'echo $PATH')"

Просмотреть файл

@ -283,12 +283,13 @@ task ktlintFormat(type: JavaExec, group: "formatting") {
// Extremely unsophisticated way to publish a local development version while hiding implementation details.
//
// For now we just run `publishToMavenLocal` while setting the special property `local`, and have some logic
// in our gradle scripts to construct an auto-incrementing version number when this property is set.
// This shells out to a python script that tries to detect whether the working directory has changed since the last
// time it was run, and it so then it shells out to `./gradlew publishToMavenLocal -Plocal=<timestamp>` to publish
// a new version of of the code with an auto-incrementing version number.
//
// I hope to grow this into something more sophisticated over time (e.g. to avoid re-publishing when nothing
// has changed, perhaps cleanup old versions, etc) while keeping a stable `./gradlew autoPublishForLocalDevelopment`
// It would be nice to implement this natively in gradle using gradle's own change-detection facilities, but I don't know
// enough about gradle to take that on. At least this approach gives a nice stable `./gradlew autoPublishForLocalDevelopment`
// interface for consumers.
task autoPublishForLocalDevelopment(type: Exec) {
commandLine "./gradlew", "publishToMavenLocal", "-Plocal=true"
commandLine "./automation/publish_to_maven_local_if_modified.py"
}

Просмотреть файл

@ -4,6 +4,7 @@ edition = "2018"
version = "0.1.0"
authors = ["Edouard Oger <eoger@fastmail.com>"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[dependencies]
base64 = "0.12.0"

Просмотреть файл

@ -38,7 +38,7 @@ impl EncryptedSendTabPayload {
}
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct SendTabPayload {
pub entries: Vec<TabHistoryEntry>,
}
@ -69,7 +69,7 @@ impl SendTabPayload {
}
}
#[derive(Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize)]
pub struct TabHistoryEntry {
pub title: String,
pub url: String,

Просмотреть файл

@ -507,7 +507,7 @@ pub struct CommandData {
pub sender: Option<String>,
}
#[derive(Clone, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct PushSubscription {
#[serde(rename = "pushCallback")]
pub endpoint: String,
@ -540,7 +540,7 @@ pub struct DeviceUpdateRequest<'a> {
available_commands: Option<Option<&'a HashMap<String, String>>>,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum DeviceType {
#[serde(rename = "desktop")]
Desktop,
@ -616,7 +616,7 @@ impl<'a> DeviceUpdateRequestBuilder<'a> {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct DeviceLocation {
pub city: Option<String>,
pub country: Option<String>,
@ -625,7 +625,7 @@ pub struct DeviceLocation {
pub state_code: Option<String>,
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct GetDeviceResponse {
#[serde(flatten)]
pub common: DeviceResponseCommon,
@ -645,7 +645,7 @@ impl std::ops::Deref for GetDeviceResponse {
pub type UpdateDeviceResponse = DeviceResponseCommon;
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct DeviceResponseCommon {
pub id: String,
#[serde(rename = "name")]

Просмотреть файл

@ -239,20 +239,29 @@ impl FirefoxAccount {
}
}
#[derive(Debug, Serialize)]
#[serde(tag = "eventType", content = "data")]
#[serde(rename_all = "camelCase")]
pub enum AccountEvent {
IncomingDeviceCommand(Box<IncomingDeviceCommand>),
ProfileUpdated,
AccountAuthStateChanged,
AccountDestroyed,
// Can be removed when https://github.com/serde-rs/serde/pull/1695 lands.
#[serde(rename_all = "camelCase")]
DeviceConnected {
device_name: String,
},
#[serde(rename_all = "camelCase")]
DeviceDisconnected {
device_id: String,
is_local_device: bool,
},
}
#[derive(Debug, Serialize)]
#[serde(tag = "commandType", content = "data")]
#[serde(rename_all = "camelCase")]
pub enum IncomingDeviceCommand {
TabReceived {
sender: Option<Device>,

Просмотреть файл

@ -4,6 +4,7 @@ edition = "2018"
version = "0.1.0"
authors = ["Thom Chiovoloni <tchiovoloni@mozilla.com>"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[features]
log_query_plans = ["sql-support/log_query_plans"]

Просмотреть файл

@ -1411,8 +1411,9 @@ mod tests {
})
.unwrap();
let unique_login_guid = Guid::empty();
let unique_login = Login {
guid: Guid::empty(),
guid: unique_login_guid.clone(),
form_submit_url: None,
hostname: "https://www.example.com".into(),
http_realm: Some("https://www.example.com".into()),
@ -1431,6 +1432,16 @@ mod tests {
..Login::default()
};
let updated_login = Login {
guid: unique_login_guid,
form_submit_url: None,
hostname: "https://www.example.com".into(),
http_realm: Some("https://www.example.com".into()),
username: "test".into(),
password: "test4".into(),
..Login::default()
};
struct TestCase {
login: Login,
should_err: bool,
@ -1439,15 +1450,29 @@ mod tests {
let test_cases = [
TestCase {
// unique_login should not error because it does not share the same hostname,
// username, and formSubmitURL or httpRealm with the pre-existing login
// (login with guid "dummy_000001").
login: unique_login,
should_err: false,
expected_err: "",
},
TestCase {
// duplicate_login has the same hostname, username, and formSubmitURL as a pre-existing
// login (guid "dummy_000001") and duplicate_login has no guid value, i.e. its guid
// doesn't match with that of a pre-existing record so it can't be considered update,
// so it should error.
login: duplicate_login,
should_err: true,
expected_err: "Invalid login: Login already exists",
},
TestCase {
// updated_login is an update to unique_login (has the same guid) so it is not a dupe
// and should not error.
login: updated_login,
should_err: false,
expected_err: "",
},
];
for tc in &test_cases {

Просмотреть файл

@ -4,6 +4,7 @@ edition = "2018"
version = "0.1.0"
authors = ["application-services@mozilla.com"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[features]
log_query_plans = ["sql-support/log_query_plans"]
@ -32,7 +33,6 @@ interrupt = { path = "../support/interrupt" }
error-support = { path = "../support/error" }
sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"]}
[dependencies.rusqlite]
version = "0.22.0"
features = ["functions", "bundled"]

Просмотреть файл

@ -162,7 +162,7 @@ lazy_static::lazy_static! {
// Count Fennec history visits
static ref COUNT_FENNEC_HISTORY_VISITS: &'static str =
"SELECT COUNT(*) FROM fennec.history"
"SELECT COUNT(*) FROM fennec.visits"
;
// Count Fenix history visits

Просмотреть файл

@ -4,6 +4,7 @@ edition = "2018"
version = "0.1.0"
authors = ["jrconlin <me+crypt@jrconlin.com>", "Phil Jenvey <pjenvey@underboss.org>"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[features]
default = []

Просмотреть файл

@ -4,6 +4,7 @@ version = "0.1.0"
edition = "2018"
authors = ["Thom Chiovoloni <tchiovoloni@mozilla.com>"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[lib]
name = "rc_log_ffi"

Просмотреть файл

@ -16,7 +16,7 @@ error-support = { path = "../error" }
nss = { path = "nss" }
libsqlite3-sys = { version = "0.17.2", features = ["bundled"] }
hawk = { version = "3.1.0", default-features = false, optional = true }
ece = { version = "1.1.0", default-features = false, features = ["serializable-keys"], optional = true }
ece = { version = "1.1.2", default-features = false, features = ["serializable-keys"], optional = true }
[dev-dependencies]
hex = "0.4.0"

Просмотреть файл

@ -6,8 +6,6 @@
//! against `nss` but has an `nss`-enabled `sqlcipher` turned on (for example,
//! by a `cargo` feature activated by something else in the workspace).
//! it might need to issue link commands for NSS.
//!
//! It essentially contains the non-bindgen part of nss_sys's build.rs.
use std::{
env,
@ -24,16 +22,30 @@ pub enum LinkingKind {
#[derive(Debug, PartialEq, Clone)]
pub struct NoNssDir;
pub fn link_nss() -> Result<(PathBuf, PathBuf), NoNssDir> {
let (lib_dir, include_dir) = get_nss()?;
println!(
"cargo:rustc-link-search=native={}",
lib_dir.to_string_lossy()
);
println!("cargo:include={}", include_dir.to_string_lossy());
let kind = determine_kind();
link_nss_libs(kind);
Ok((lib_dir, include_dir))
pub fn link_nss() -> Result<(), NoNssDir> {
let is_gecko = env::var_os("MOZ_TOPOBJDIR").is_some();
if !is_gecko {
let (lib_dir, include_dir) = get_nss()?;
println!(
"cargo:rustc-link-search=native={}",
lib_dir.to_string_lossy()
);
println!("cargo:include={}", include_dir.to_string_lossy());
let kind = determine_kind();
link_nss_libs(kind);
} else {
let libs = match env::var("CARGO_CFG_TARGET_OS")
.as_ref()
.map(std::string::String::as_str)
{
Ok("android") | Ok("macos") => vec!["nss3"],
_ => vec!["nssutil3", "nss3", "plds4", "plc4", "nspr4"],
};
for lib in &libs {
println!("cargo:rustc-link-lib=dylib={}", lib);
}
}
Ok(())
}
fn get_nss() -> Result<(PathBuf, PathBuf), NoNssDir> {

Просмотреть файл

@ -9,8 +9,4 @@ license = "MPL-2.0"
crate-type = ["lib"]
[build-dependencies]
bindgen = "0.53.1"
serde = "1.0.104"
serde_derive = "1.0.104"
toml = "0.5.3"
nss_build_common = {path = "../nss_build_common"}

Просмотреть файл

@ -1,6 +1,3 @@
## nss_sys
Low-level NSS bindings for Rust.
Much of the mechanics of the binding definitions are auto-generated from NSS header files using
[bindgen](https://docs.rs/bindgen/); see [bindings.toml](./bindings.toml) and [build.rs](./build.rs) for details.
Low-level NSS bindings for Rust. They are verified using the `systest` crate in the parent directory.

Просмотреть файл

@ -1,138 +0,0 @@
# In this file, every section corresponds to a header file.
# A corresponding binding file will be created in $OUT_DIR.
# We use an indirection for the headers because it's easier
# than figuring out where they are on the gecko worktree
# when generating bindings.
headers = [
"nss_blapit.h",
"nss_keyhi.h",
"nss_keythi.h",
"nss_nss.h",
"nss_pk11pub.h",
"nss_pkcs11t.h",
"nss_prerror.h",
"nss_prtypes.h",
"nss_secasn1t.h",
"nss_seccomon.h",
"nss_secoidt.h",
]
enums = [
"KeyType",
"PK11ObjectType",
"PK11Origin",
"SECItemType",
"SECOidTag",
"SECStatus",
]
functions = [
"NSS_GetVersion",
"NSS_InitContext",
"NSS_SecureMemcmp",
"NSS_VersionCheck",
"PK11_CreateContextBySymKey",
"PK11_CreateGenericObject",
"PK11_Decrypt",
"PK11_Derive",
"PK11_DestroyContext",
"PK11_DestroyGenericObject",
"PK11_DigestBegin",
"PK11_DigestFinal",
"PK11_DigestOp",
"PK11_Encrypt",
"PK11_ExtractKeyValue",
"PK11_FindKeyByKeyID",
"PK11_FreeSlot",
"PK11_FreeSymKey",
"PK11_GenerateKeyPair",
"PK11_GenerateRandom",
"PK11_GetInternalSlot",
"PK11_GetKeyData",
"PK11_HashBuf",
"PK11_ImportSymKey",
"PK11_PubDeriveWithKDF",
"PK11_ReadRawAttribute",
"PORT_FreeArena",
"PR_GetError",
"PR_GetErrorText",
"PR_GetErrorTextLength",
"SECITEM_FreeItem",
"SECKEY_ConvertToPublicKey",
"SECKEY_CopyPublicKey",
"SECKEY_DestroyPrivateKey",
"SECKEY_DestroyPublicKey",
"SECOID_FindOIDByTag",
]
types = [
"CK_ATTRIBUTE",
"CK_ATTRIBUTE_TYPE",
"CK_BBOOL",
"CK_GCM_PARAMS",
"CK_KEY_TYPE",
"CK_MECHANISM_TYPE",
"CK_NSS_HKDFParams",
"CK_OBJECT_CLASS",
"KeyType",
"NSSInitContext",
"NSSInitParameters",
"PK11Context",
"PK11GenericObject",
"PK11ObjectType",
"PK11Origin",
"PK11SlotInfo",
"PK11SymKey",
"PLArenaPool",
"PRBool",
"PRErrorCode",
"PRInt32",
"PRUint32",
"SECItem",
"SECKEYPrivateKey",
"SECKEYPublicKey",
"SECOidData",
"SECOidTag",
"SECStatus",
]
opaque = [
"NSSInitContext",
"NSSInitParameters",
"PK11Context",
"PK11SlotInfo",
"PK11SymKey",
]
variables = [
"AES_BLOCK_SIZE",
"CKA_CLASS",
"CKA_EC_PARAMS",
"CKA_EC_POINT",
"CKA_ENCRYPT",
"CKA_ID",
"CKA_KEY_TYPE",
"CKA_PRIVATE",
"CKA_SENSITIVE",
"CKA_SIGN",
"CKA_TOKEN",
"CKA_VALUE",
"CKA_WRAP",
"CKD_NULL",
"CKK_EC",
"CKM_AES_CBC_PAD",
"CKM_AES_GCM",
"CKM_ECDH1_DERIVE",
"CKM_EC_KEY_PAIR_GEN",
"CKM_NSS_HKDF_SHA256",
"CKM_SHA256_HMAC",
"CKM_SHA512_HMAC",
"CKO_PRIVATE_KEY",
"CK_INVALID_HANDLE",
"EC_POINT_FORM_UNCOMPRESSED",
"HASH_LENGTH_MAX",
"KU_ALL",
"NSS_INIT_FORCEOPEN",
"NSS_INIT_NOCERTDB",
"NSS_INIT_NOMODDB",
"NSS_INIT_OPTIMIZESPACE",
"NSS_INIT_READONLY",
"SEC_ASN1_OBJECT_ID",
"SHA256_LENGTH",
]

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "pk11pub.h"

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "pkcs11t.h"

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "prerror.h"

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "prtypes.h"

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "secasn1t.h"

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "seccomon.h"

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "secoidt.h"

Просмотреть файл

@ -2,268 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bindgen::Builder;
use serde_derive::Deserialize;
use std::{env, fs, path::PathBuf, process::Command};
use toml;
use nss_build_common::*;
const BINDINGS_DIR: &str = "bindings";
const BINDINGS_CONFIG: &str = "bindings.toml";
// This is the format of a single section of the configuration file.
#[derive(Deserialize)]
struct Bindings {
// The .h header files to generate from.
headers: Vec<String>,
// functions that are explicitly included
functions: Option<Vec<String>>,
// types that are explicitly included
types: Option<Vec<String>>,
// (un-used) functions that are explicitly included
// functions: Option<Vec<String>>,
// variables (and `#define`s) that are explicitly included
variables: Option<Vec<String>>,
// types that should be explicitly marked as opaque
opaque: Option<Vec<String>>,
// enumerations that are turned into a module (without this, the enum is
// mapped using the default, which means that the individual values are
// formed with an underscore as <enum_type>_<enum_value_name>).
enums: Option<Vec<String>>,
// Any item that is specifically excluded; if none of the types, functions,
// or variables fields are specified, everything defined will be mapped,
// so this can be used to limit that.
exclude: Option<Vec<String>>,
}
const DEFAULT_ANDROID_NDK_API_VERSION: &str = "21";
// Set the CLANG_PATH env variable to point to the right clang for the NDK in question.
// Note that this basically needs to be done first thing in main.
fn maybe_setup_ndk_clang_path() {
let target_os = env::var("CARGO_CFG_TARGET_OS").ok();
if target_os.as_ref().map_or(false, |x| x == "android") {
let mut buf = PathBuf::from(env("ANDROID_NDK_ROOT").unwrap());
let ndk_api = env_str("ANDROID_NDK_API_VERSION")
.unwrap_or_else(|| DEFAULT_ANDROID_NDK_API_VERSION.to_owned());
if ndk_api.is_empty() {
println!("cargo:warning=ANDROID_NDK_API_VERSION is unset. Trying unprefixed");
}
let mut target = env::var("TARGET").unwrap();
if target == "armv7-linux-androideabi" {
// See https://developer.android.com/ndk/guides/other_build_systems
// for information on why this is weird and different (or at least,
// confirmation that it's supposed to be that way...)
target = "armv7a-linux-androideabi".to_owned();
}
for &path in &["toolchains", "llvm", "prebuilt", android_host_tag(), "bin"] {
buf.push(path);
}
buf.push(format!("{}{}-clang", target, ndk_api));
env::set_var("CLANG_PATH", buf);
}
}
fn main() {
let is_gecko = env::var_os("MOZ_TOPOBJDIR").is_some();
if is_gecko {
main_gecko();
} else {
main_regular();
}
}
fn main_regular() {
// Note: this has to be first!
maybe_setup_ndk_clang_path();
// 1. NSS linking.
let (_, include_dir) = link_nss().expect("To build nss_sys, NSS_DIR must be set!");
// 2. Bindings.
let config_file = PathBuf::from(BINDINGS_DIR).join(BINDINGS_CONFIG);
println!("cargo:rerun-if-changed={}", config_file.to_str().unwrap());
let config = fs::read_to_string(config_file).expect("unable to read binding configuration");
let bindings: Bindings = toml::from_str(&config).unwrap();
println!(
"cargo:include={}",
include_dir.join("nss").to_str().unwrap()
);
let mut flags: Vec<String> = Vec::new();
flags.push(String::from("-I") + include_dir.join("nss").to_str().unwrap());
build_bindings(&bindings, &flags[..], false);
}
pub fn main_gecko() {
// 1. NSS linking.
let libs = match env::var("CARGO_CFG_TARGET_OS")
.as_ref()
.map(std::string::String::as_str)
{
Ok("android") | Ok("macos") => vec!["nss3"],
_ => vec!["nssutil3", "nss3", "plds4", "plc4", "nspr4"],
};
for lib in &libs {
println!("cargo:rustc-link-lib=dylib={}", lib);
}
let mut flags: Vec<String> = Vec::new();
if let Some(path) = env::var_os("MOZ_TOPOBJDIR").map(PathBuf::from) {
println!(
"cargo:rustc-link-search=native={}",
path.join("dist").join("bin").to_str().unwrap()
);
let nsslib_path = path.clone().join("security").join("nss").join("lib");
println!(
"cargo:rustc-link-search=native={}",
nsslib_path.join("nss").join("nss_nss3").to_str().unwrap()
);
println!(
"cargo:rustc-link-search=native={}",
path.join("config")
.join("external")
.join("nspr")
.join("pr")
.to_str()
.unwrap()
);
let flags_path = path.join("netwerk/socket/neqo/extra-bindgen-flags");
println!("cargo:rerun-if-changed={}", flags_path.to_str().unwrap());
flags = fs::read_to_string(flags_path)
.expect("Failed to read extra-bindgen-flags file")
.split_whitespace()
.map(std::borrow::ToOwned::to_owned)
.collect();
flags.push(String::from("-include"));
flags.push(
path.join("dist")
.join("include")
.join("mozilla-config.h")
.to_str()
.unwrap()
.to_string(),
);
} else {
println!("cargo:warning=MOZ_TOPOBJDIR should be set by default, otherwise the build is not guaranteed to finish.");
}
// 2. Bindings.
let config_file = PathBuf::from(BINDINGS_DIR).join(BINDINGS_CONFIG);
println!("cargo:rerun-if-changed={}", config_file.to_str().unwrap());
let config = fs::read_to_string(config_file).expect("unable to read binding configuration");
let bindings: Bindings = toml::from_str(&config).unwrap();
build_bindings(&bindings, &flags[..], true);
}
fn build_bindings(bindings: &Bindings, flags: &[String], is_gecko: bool) {
let out = PathBuf::from(env::var("OUT_DIR").unwrap()).join("nss_bindings.rs");
let mut builder = Builder::default().generate_comments(false);
for h in bindings.headers.iter().cloned() {
let header = PathBuf::from(BINDINGS_DIR).join(h);
let header = header.to_str().unwrap();
println!("cargo:rerun-if-changed={}", header);
builder = builder.header(header);
}
// Fix our cross-compilation include directories.
if !is_gecko {
builder = fix_include_dirs(builder);
}
builder = builder.clang_args(flags);
// Apply the configuration.
let empty: Vec<String> = vec![];
for v in bindings.types.as_ref().unwrap_or_else(|| &empty).iter() {
builder = builder.whitelist_type(v);
}
for v in bindings.functions.as_ref().unwrap_or_else(|| &empty).iter() {
builder = builder.whitelist_function(v);
}
for v in bindings.variables.as_ref().unwrap_or_else(|| &empty).iter() {
builder = builder.whitelist_var(v);
}
for v in bindings.exclude.as_ref().unwrap_or_else(|| &empty).iter() {
builder = builder.blacklist_item(v);
}
for v in bindings.opaque.as_ref().unwrap_or_else(|| &empty).iter() {
builder = builder.opaque_type(v);
}
for v in bindings.enums.as_ref().unwrap_or_else(|| &empty).iter() {
builder = builder.constified_enum_module(v);
}
let bindings = builder.generate().expect("unable to generate bindings");
bindings
.write_to_file(out)
.expect("couldn't write bindings");
}
fn fix_include_dirs(mut builder: Builder) -> Builder {
let target_os = env::var("CARGO_CFG_TARGET_OS");
let target_arch = env::var("CARGO_CFG_TARGET_ARCH");
match target_os.as_ref().map(|x| &**x) {
Ok("macos") => {
// Cheap and dirty way to detect that we are cross-compiling.
if env::var_os("CI").is_some() {
builder = builder
.detect_include_paths(false)
.clang_arg("-isysroot/tmp/MacOSX10.11.sdk");
}
}
Ok("windows") => {
if env::var_os("CI").is_some() {
builder = builder.clang_arg("-D_M_X64");
}
}
Ok("ios") => {
let sdk_root;
match target_arch.as_ref().map(|x| &**x).unwrap() {
"aarch64" => {
sdk_root = get_ios_sdk_root("iphoneos");
builder = builder.clang_arg("--target=arm64-apple-ios") // See https://github.com/rust-lang/rust-bindgen/issues/1211
}
"x86_64" => {
sdk_root = get_ios_sdk_root("iphonesimulator");
}
_ => panic!("Unknown iOS architecture."),
}
builder = builder
.detect_include_paths(false)
.clang_arg(format!("-isysroot{}", &sdk_root));
}
_ => {}
}
builder
}
fn android_host_tag() -> &'static str {
// cfg! target_os actually refers to the host environment in this case (build script).
#[cfg(target_os = "macos")]
return "darwin-x86_64";
#[cfg(target_os = "linux")]
return "linux-x86_64";
#[cfg(target_os = "windows")]
return "windows-x86_64";
}
fn get_ios_sdk_root(sdk_name: &str) -> String {
let output = Command::new("xcrun")
.arg("--show-sdk-path")
.arg("-sdk")
.arg(sdk_name)
.output()
.unwrap();
if output.status.success() {
String::from_utf8(output.stdout).unwrap().trim().to_string()
} else {
panic!("Could not get iOS SDK root!")
}
nss_build_common::link_nss().unwrap();
}

Просмотреть файл

@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
include!(concat!(env!("OUT_DIR"), "/nss_bindings.rs"));

Просмотреть файл

@ -0,0 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub const EC_POINT_FORM_UNCOMPRESSED: u32 = 4;
pub const SHA256_LENGTH: u32 = 32;
pub const HASH_LENGTH_MAX: u32 = 64;
pub const AES_BLOCK_SIZE: u32 = 16;

Просмотреть файл

@ -0,0 +1,12 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::*;
extern "C" {
pub fn SECKEY_CopyPublicKey(pubKey: *const SECKEYPublicKey) -> *mut SECKEYPublicKey;
pub fn SECKEY_ConvertToPublicKey(privateKey: *mut SECKEYPrivateKey) -> *mut SECKEYPublicKey;
pub fn SECKEY_DestroyPrivateKey(key: *mut SECKEYPrivateKey);
pub fn SECKEY_DestroyPublicKey(key: *mut SECKEYPublicKey);
}

Просмотреть файл

@ -0,0 +1,140 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::*;
use std::os::raw::{c_int, c_uchar, c_void};
pub type SECKEYPublicKey = SECKEYPublicKeyStr;
#[repr(C)]
pub struct SECKEYPublicKeyStr {
pub arena: *mut PLArenaPool,
pub keyType: u32, /* KeyType */
pub pkcs11Slot: *mut PK11SlotInfo,
pub pkcs11ID: CK_OBJECT_HANDLE,
pub u: SECKEYPublicKeyStr_u,
}
#[repr(C)]
pub union SECKEYPublicKeyStr_u {
pub rsa: SECKEYRSAPublicKey,
pub dsa: SECKEYDSAPublicKey,
pub dh: SECKEYDHPublicKey,
pub kea: SECKEYKEAPublicKey,
pub fortezza: SECKEYFortezzaPublicKey,
pub ec: SECKEYECPublicKey,
}
pub type SECKEYPrivateKey = SECKEYPrivateKeyStr;
#[repr(C)]
pub struct SECKEYPrivateKeyStr {
pub arena: *mut PLArenaPool,
pub keyType: u32, /* KeyType */
pub pkcs11Slot: *mut PK11SlotInfo,
pub pkcs11ID: CK_OBJECT_HANDLE,
pub pkcs11IsTemp: PRBool,
pub wincx: *mut c_void,
pub staticflags: PRUint32,
}
#[repr(u32)]
pub enum KeyType {
nullKey = 0,
rsaKey = 1,
dsaKey = 2,
fortezzaKey = 3,
dhKey = 4,
keaKey = 5,
ecKey = 6,
rsaPssKey = 7,
rsaOaepKey = 8,
}
pub type SECKEYRSAPublicKey = SECKEYRSAPublicKeyStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYRSAPublicKeyStr {
pub arena: *mut PLArenaPool,
pub modulus: SECItem,
pub publicExponent: SECItem,
}
pub type SECKEYDSAPublicKey = SECKEYDSAPublicKeyStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYDSAPublicKeyStr {
pub params: SECKEYPQGParams,
pub publicValue: SECItem,
}
pub type SECKEYPQGParams = SECKEYPQGParamsStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYPQGParamsStr {
pub arena: *mut PLArenaPool,
pub prime: SECItem,
pub subPrime: SECItem,
pub base: SECItem,
}
pub type SECKEYDHPublicKey = SECKEYDHPublicKeyStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYDHPublicKeyStr {
pub arena: *mut PLArenaPool,
pub prime: SECItem,
pub base: SECItem,
pub publicValue: SECItem,
}
pub type SECKEYKEAPublicKey = SECKEYKEAPublicKeyStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYKEAPublicKeyStr {
pub params: SECKEYKEAParams,
pub publicValue: SECItem,
}
pub type SECKEYKEAParams = SECKEYKEAParamsStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYKEAParamsStr {
pub arena: *mut PLArenaPool,
pub hash: SECItem,
}
pub type SECKEYFortezzaPublicKey = SECKEYFortezzaPublicKeyStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYFortezzaPublicKeyStr {
pub KEAversion: c_int,
pub DSSversion: c_int,
pub KMID: [c_uchar; 8usize],
pub clearance: SECItem,
pub KEApriviledge: SECItem,
pub DSSpriviledge: SECItem,
pub KEAKey: SECItem,
pub DSSKey: SECItem,
pub params: SECKEYPQGParams,
pub keaParams: SECKEYPQGParams,
}
pub type SECKEYECPublicKey = SECKEYECPublicKeyStr;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECKEYECPublicKeyStr {
pub DEREncodedParams: SECKEYECParams,
pub size: c_int,
pub publicValue: SECItem,
pub encoding: u32, /* ECPointEncoding */
}
pub type SECKEYECParams = SECItem;
#[repr(u32)]
#[derive(Copy, Clone)]
pub enum ECPointEncoding {
ECPoint_Uncompressed = 0,
ECPoint_XOnly = 1,
ECPoint_Undefined = 2,
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
mod blapit;
pub use blapit::*;
mod keyhi;
pub use keyhi::*;
mod keythi;
pub use keythi::*;
mod nss;
pub use nss::*;
mod pk11pub;
pub use pk11pub::*;
mod pkcs11n;
pub use pkcs11n::*;
mod pkcs11t;
pub use pkcs11t::*;
mod plarena;
pub use plarena::*;
mod prerror;
pub use prerror::*;
mod prtypes;
pub use prtypes::*;
mod secasn1t;
pub use secasn1t::*;
mod seccomon;
pub use seccomon::*;
mod secitem;
pub use secitem::*;
mod secmodt;
pub use secmodt::*;
mod secoid;
pub use secoid::*;
mod secoidt;
pub use secoidt::*;
mod secport;
pub use secport::*;

Просмотреть файл

@ -0,0 +1,28 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::*;
use std::os::raw::c_char;
extern "C" {
pub fn NSS_VersionCheck(importedVersion: *const c_char) -> PRBool;
pub fn NSS_InitContext(
configdir: *const c_char,
certPrefix: *const c_char,
keyPrefix: *const c_char,
secmodName: *const c_char,
initParams: *mut NSSInitParameters,
flags: PRUint32,
) -> *mut NSSInitContext;
}
pub const NSS_INIT_READONLY: u32 = 1;
pub const NSS_INIT_NOCERTDB: u32 = 2;
pub const NSS_INIT_NOMODDB: u32 = 4;
pub const NSS_INIT_FORCEOPEN: u32 = 8;
pub const NSS_INIT_OPTIMIZESPACE: u32 = 32;
// Opaque types
pub type NSSInitContext = u8;
pub type NSSInitParameters = [u64; 10usize];

Просмотреть файл

@ -0,0 +1,113 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub use crate::*;
use std::os::raw::{c_int, c_uchar, c_uint, c_void};
extern "C" {
pub fn PK11_FreeSlot(slot: *mut PK11SlotInfo);
pub fn PK11_GetInternalSlot() -> *mut PK11SlotInfo;
pub fn PK11_GenerateRandom(data: *mut c_uchar, len: c_int) -> SECStatus;
pub fn PK11_FreeSymKey(key: *mut PK11SymKey);
pub fn PK11_ImportSymKey(
slot: *mut PK11SlotInfo,
type_: CK_MECHANISM_TYPE,
origin: u32, /* PK11Origin */
operation: CK_ATTRIBUTE_TYPE,
key: *mut SECItem,
wincx: *mut c_void,
) -> *mut PK11SymKey;
pub fn PK11_Derive(
baseKey: *mut PK11SymKey,
mechanism: CK_MECHANISM_TYPE,
param: *mut SECItem,
target: CK_MECHANISM_TYPE,
operation: CK_ATTRIBUTE_TYPE,
keySize: c_int,
) -> *mut PK11SymKey;
pub fn PK11_PubDeriveWithKDF(
privKey: *mut SECKEYPrivateKey,
pubKey: *mut SECKEYPublicKey,
isSender: PRBool,
randomA: *mut SECItem,
randomB: *mut SECItem,
derive: CK_MECHANISM_TYPE,
target: CK_MECHANISM_TYPE,
operation: CK_ATTRIBUTE_TYPE,
keySize: c_int,
kdf: CK_ULONG,
sharedData: *mut SECItem,
wincx: *mut c_void,
) -> *mut PK11SymKey;
pub fn PK11_ExtractKeyValue(symKey: *mut PK11SymKey) -> SECStatus;
pub fn PK11_GetKeyData(symKey: *mut PK11SymKey) -> *mut SECItem;
pub fn PK11_GenerateKeyPair(
slot: *mut PK11SlotInfo,
type_: CK_MECHANISM_TYPE,
param: *mut c_void,
pubk: *mut *mut SECKEYPublicKey,
isPerm: PRBool,
isSensitive: PRBool,
wincx: *mut c_void,
) -> *mut SECKEYPrivateKey;
pub fn PK11_FindKeyByKeyID(
slot: *mut PK11SlotInfo,
keyID: *mut SECItem,
wincx: *mut c_void,
) -> *mut SECKEYPrivateKey;
pub fn PK11_Decrypt(
symkey: *mut PK11SymKey,
mechanism: CK_MECHANISM_TYPE,
param: *mut SECItem,
out: *mut c_uchar,
outLen: *mut c_uint,
maxLen: c_uint,
enc: *const c_uchar,
encLen: c_uint,
) -> SECStatus;
pub fn PK11_Encrypt(
symKey: *mut PK11SymKey,
mechanism: CK_MECHANISM_TYPE,
param: *mut SECItem,
out: *mut c_uchar,
outLen: *mut c_uint,
maxLen: c_uint,
data: *const c_uchar,
dataLen: c_uint,
) -> SECStatus;
pub fn PK11_DestroyContext(context: *mut PK11Context, freeit: PRBool);
pub fn PK11_CreateContextBySymKey(
type_: CK_MECHANISM_TYPE,
operation: CK_ATTRIBUTE_TYPE,
symKey: *mut PK11SymKey,
param: *mut SECItem,
) -> *mut PK11Context;
pub fn PK11_DigestBegin(cx: *mut PK11Context) -> SECStatus;
pub fn PK11_HashBuf(
hashAlg: u32, /* SECOidTag */
out: *mut c_uchar,
in_: *const c_uchar,
len: PRInt32,
) -> SECStatus;
pub fn PK11_DigestOp(context: *mut PK11Context, in_: *const c_uchar, len: c_uint) -> SECStatus;
pub fn PK11_DigestFinal(
context: *mut PK11Context,
data: *mut c_uchar,
outLen: *mut c_uint,
length: c_uint,
) -> SECStatus;
pub fn PK11_DestroyGenericObject(object: *mut PK11GenericObject) -> SECStatus;
pub fn PK11_CreateGenericObject(
slot: *mut PK11SlotInfo,
pTemplate: *const CK_ATTRIBUTE,
count: c_int,
token: PRBool,
) -> *mut PK11GenericObject;
pub fn PK11_ReadRawAttribute(
type_: u32, /* PK11ObjectType */
object: *mut c_void,
attr: CK_ATTRIBUTE_TYPE,
item: *mut SECItem,
) -> SECStatus;
}

Просмотреть файл

@ -0,0 +1,25 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub use crate::*;
pub const CKM_NSS_HKDF_SHA256: u32 = 3_461_563_220; // (CKM_NSS + 4)
#[repr(C)]
pub struct CK_GCM_PARAMS {
pub pIv: CK_BYTE_PTR,
pub ulIvLen: CK_ULONG,
pub pAAD: CK_BYTE_PTR,
pub ulAADLen: CK_ULONG,
pub ulTagBits: CK_ULONG,
}
#[repr(C)]
pub struct CK_NSS_HKDFParams {
pub bExtract: CK_BBOOL,
pub pSalt: CK_BYTE_PTR,
pub ulSaltLen: CK_ULONG,
pub bExpand: CK_BBOOL,
pub pInfo: CK_BYTE_PTR,
pub ulInfoLen: CK_ULONG,
}

Просмотреть файл

@ -0,0 +1,48 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::os::raw::{c_uchar, c_ulong, c_void};
pub const CK_TRUE: CK_BBOOL = 1;
pub const CK_FALSE: CK_BBOOL = 0;
pub type CK_BYTE = c_uchar;
pub type CK_BBOOL = CK_BYTE;
pub type CK_ULONG = c_ulong;
pub type CK_BYTE_PTR = *mut CK_BYTE;
pub type CK_VOID_PTR = *mut c_void;
pub type CK_OBJECT_HANDLE = CK_ULONG;
pub type CK_OBJECT_CLASS = CK_ULONG;
pub type CK_KEY_TYPE = CK_ULONG;
pub type CK_ATTRIBUTE_TYPE = CK_ULONG;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CK_ATTRIBUTE {
pub type_: CK_ATTRIBUTE_TYPE,
pub pValue: CK_VOID_PTR,
pub ulValueLen: CK_ULONG,
}
pub type CK_MECHANISM_TYPE = CK_ULONG;
pub const CK_INVALID_HANDLE: u32 = 0;
pub const CKO_PRIVATE_KEY: u32 = 3;
pub const CKK_EC: u32 = 3;
pub const CKA_CLASS: u32 = 0;
pub const CKA_TOKEN: u32 = 1;
pub const CKA_PRIVATE: u32 = 2;
pub const CKA_VALUE: u32 = 17;
pub const CKA_KEY_TYPE: u32 = 256;
pub const CKA_ID: u32 = 258;
pub const CKA_SENSITIVE: u32 = 259;
pub const CKA_ENCRYPT: u32 = 260;
pub const CKA_WRAP: u32 = 262;
pub const CKA_SIGN: u32 = 264;
pub const CKA_EC_PARAMS: u32 = 384;
pub const CKA_EC_POINT: u32 = 385;
pub const CKM_SHA256_HMAC: u32 = 593;
pub const CKM_SHA512_HMAC: u32 = 625;
pub const CKM_EC_KEY_PAIR_GEN: u32 = 4160;
pub const CKM_ECDH1_DERIVE: u32 = 4176;
pub const CKM_AES_CBC_PAD: u32 = 4229;
pub const CKM_AES_GCM: u32 = 4231;
pub const CKD_NULL: u32 = 1;

Просмотреть файл

@ -0,0 +1,22 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub use crate::*;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PLArena {
pub next: *mut PLArena,
pub base: PRUword,
pub limit: PRUword,
pub avail: PRUword,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct PLArenaPool {
pub first: PLArena,
pub current: *mut PLArena,
pub arenasize: PRUint32,
pub mask: PRUword,
}

Просмотреть файл

@ -0,0 +1,14 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub use crate::*;
use std::os::raw::c_char;
extern "C" {
pub fn PR_GetError() -> PRErrorCode;
pub fn PR_GetErrorTextLength() -> PRInt32;
pub fn PR_GetErrorText(text: *mut c_char) -> PRInt32;
}
pub type PRErrorCode = PRInt32;

Просмотреть файл

@ -0,0 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::os::raw::{c_int, c_uint, c_ulong};
pub type PRIntn = c_int;
pub type PRBool = PRIntn;
pub type PRUword = c_ulong;
pub type PRInt32 = c_int;
pub type PRUint32 = c_uint;
pub const PR_FALSE: PRBool = 0;
pub const PR_TRUE: PRBool = 1;

Просмотреть файл

@ -2,4 +2,4 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nss.h"
pub const SEC_ASN1_OBJECT_ID: u32 = 6;

Просмотреть файл

@ -0,0 +1,43 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::os::raw::{c_uchar, c_uint};
#[repr(u32)]
pub enum SECItemType {
siBuffer = 0,
siClearDataBuffer = 1,
siCipherDataBuffer = 2,
siDERCertBuffer = 3,
siEncodedCertBuffer = 4,
siDERNameBuffer = 5,
siEncodedNameBuffer = 6,
siAsciiNameString = 7,
siAsciiString = 8,
siDEROID = 9,
siUnsignedInteger = 10,
siUTCTime = 11,
siGeneralizedTime = 12,
siVisibleString = 13,
siUTF8String = 14,
siBMPString = 15,
}
pub type SECItem = SECItemStr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SECItemStr {
pub type_: u32, /* SECItemType */
pub data: *mut c_uchar,
pub len: c_uint,
}
#[repr(i32)]
#[derive(PartialEq)]
pub enum _SECStatus {
SECWouldBlock = -2,
SECFailure = -1,
SECSuccess = 0,
}
pub use _SECStatus as SECStatus;

Просмотреть файл

@ -2,4 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "blapit.h"
pub use crate::*;
extern "C" {
pub fn SECITEM_FreeItem(zap: *mut SECItem, freeit: PRBool);
}

Просмотреть файл

@ -0,0 +1,33 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Opaque pointers as these types are giant.
pub type PK11SlotInfo = u8;
pub type PK11SymKey = u8;
pub type PK11Context = u8;
#[repr(u32)]
pub enum PK11Origin {
PK11_OriginNULL = 0,
PK11_OriginDerive = 1,
PK11_OriginGenerated = 2,
PK11_OriginFortezzaHack = 3,
PK11_OriginUnwrap = 4,
}
#[repr(u32)]
pub enum PK11ObjectType {
PK11_TypeGeneric = 0,
PK11_TypePrivKey = 1,
PK11_TypePubKey = 2,
PK11_TypeCert = 3,
PK11_TypeSymKey = 4,
}
// #[repr(C)]
// #[derive(Copy, Clone)]
// pub struct PK11GenericObjectStr {
// _unused: [u8; 0],
// }
pub type PK11GenericObject = u8;

Просмотреть файл

@ -2,4 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "keyhi.h"
pub use crate::*;
extern "C" {
pub fn SECOID_FindOIDByTag(tagnum: u32 /* SECOidTag */) -> *mut SECOidData;
}

Просмотреть файл

@ -0,0 +1,392 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub use crate::*;
use std::os::raw::{c_char, c_ulong};
#[repr(C)]
#[derive(Copy, Clone)]
pub struct SECOidDataStr {
pub oid: SECItem,
pub offset: u32, /* SECOidTag */
pub desc: *const c_char,
pub mechanism: c_ulong,
pub supportedExtension: u32, /* SECSupportExtenTag */
}
pub type SECOidData = SECOidDataStr;
pub enum SECSupportExtenTag {
INVALID_CERT_EXTENSION = 0,
UNSUPPORTED_CERT_EXTENSION = 1,
SUPPORTED_CERT_EXTENSION = 2,
}
#[repr(u32)]
pub enum SECOidTag {
SEC_OID_UNKNOWN = 0,
SEC_OID_MD2 = 1,
SEC_OID_MD4 = 2,
SEC_OID_MD5 = 3,
SEC_OID_SHA1 = 4,
SEC_OID_RC2_CBC = 5,
SEC_OID_RC4 = 6,
SEC_OID_DES_EDE3_CBC = 7,
SEC_OID_RC5_CBC_PAD = 8,
SEC_OID_DES_ECB = 9,
SEC_OID_DES_CBC = 10,
SEC_OID_DES_OFB = 11,
SEC_OID_DES_CFB = 12,
SEC_OID_DES_MAC = 13,
SEC_OID_DES_EDE = 14,
SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE = 15,
SEC_OID_PKCS1_RSA_ENCRYPTION = 16,
SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION = 17,
SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION = 18,
SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION = 19,
SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION = 20,
SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC = 21,
SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC = 22,
SEC_OID_PKCS5_PBE_WITH_SHA1_AND_DES_CBC = 23,
SEC_OID_PKCS7 = 24,
SEC_OID_PKCS7_DATA = 25,
SEC_OID_PKCS7_SIGNED_DATA = 26,
SEC_OID_PKCS7_ENVELOPED_DATA = 27,
SEC_OID_PKCS7_SIGNED_ENVELOPED_DATA = 28,
SEC_OID_PKCS7_DIGESTED_DATA = 29,
SEC_OID_PKCS7_ENCRYPTED_DATA = 30,
SEC_OID_PKCS9_EMAIL_ADDRESS = 31,
SEC_OID_PKCS9_UNSTRUCTURED_NAME = 32,
SEC_OID_PKCS9_CONTENT_TYPE = 33,
SEC_OID_PKCS9_MESSAGE_DIGEST = 34,
SEC_OID_PKCS9_SIGNING_TIME = 35,
SEC_OID_PKCS9_COUNTER_SIGNATURE = 36,
SEC_OID_PKCS9_CHALLENGE_PASSWORD = 37,
SEC_OID_PKCS9_UNSTRUCTURED_ADDRESS = 38,
SEC_OID_PKCS9_EXTENDED_CERTIFICATE_ATTRIBUTES = 39,
SEC_OID_PKCS9_SMIME_CAPABILITIES = 40,
SEC_OID_AVA_COMMON_NAME = 41,
SEC_OID_AVA_COUNTRY_NAME = 42,
SEC_OID_AVA_LOCALITY = 43,
SEC_OID_AVA_STATE_OR_PROVINCE = 44,
SEC_OID_AVA_ORGANIZATION_NAME = 45,
SEC_OID_AVA_ORGANIZATIONAL_UNIT_NAME = 46,
SEC_OID_AVA_DN_QUALIFIER = 47,
SEC_OID_AVA_DC = 48,
SEC_OID_NS_TYPE_GIF = 49,
SEC_OID_NS_TYPE_JPEG = 50,
SEC_OID_NS_TYPE_URL = 51,
SEC_OID_NS_TYPE_HTML = 52,
SEC_OID_NS_TYPE_CERT_SEQUENCE = 53,
SEC_OID_MISSI_KEA_DSS_OLD = 54,
SEC_OID_MISSI_DSS_OLD = 55,
SEC_OID_MISSI_KEA_DSS = 56,
SEC_OID_MISSI_DSS = 57,
SEC_OID_MISSI_KEA = 58,
SEC_OID_MISSI_ALT_KEA = 59,
SEC_OID_NS_CERT_EXT_NETSCAPE_OK = 60,
SEC_OID_NS_CERT_EXT_ISSUER_LOGO = 61,
SEC_OID_NS_CERT_EXT_SUBJECT_LOGO = 62,
SEC_OID_NS_CERT_EXT_CERT_TYPE = 63,
SEC_OID_NS_CERT_EXT_BASE_URL = 64,
SEC_OID_NS_CERT_EXT_REVOCATION_URL = 65,
SEC_OID_NS_CERT_EXT_CA_REVOCATION_URL = 66,
SEC_OID_NS_CERT_EXT_CA_CRL_URL = 67,
SEC_OID_NS_CERT_EXT_CA_CERT_URL = 68,
SEC_OID_NS_CERT_EXT_CERT_RENEWAL_URL = 69,
SEC_OID_NS_CERT_EXT_CA_POLICY_URL = 70,
SEC_OID_NS_CERT_EXT_HOMEPAGE_URL = 71,
SEC_OID_NS_CERT_EXT_ENTITY_LOGO = 72,
SEC_OID_NS_CERT_EXT_USER_PICTURE = 73,
SEC_OID_NS_CERT_EXT_SSL_SERVER_NAME = 74,
SEC_OID_NS_CERT_EXT_COMMENT = 75,
SEC_OID_NS_CERT_EXT_LOST_PASSWORD_URL = 76,
SEC_OID_NS_CERT_EXT_CERT_RENEWAL_TIME = 77,
SEC_OID_NS_KEY_USAGE_GOVT_APPROVED = 78,
SEC_OID_X509_SUBJECT_DIRECTORY_ATTR = 79,
SEC_OID_X509_SUBJECT_KEY_ID = 80,
SEC_OID_X509_KEY_USAGE = 81,
SEC_OID_X509_PRIVATE_KEY_USAGE_PERIOD = 82,
SEC_OID_X509_SUBJECT_ALT_NAME = 83,
SEC_OID_X509_ISSUER_ALT_NAME = 84,
SEC_OID_X509_BASIC_CONSTRAINTS = 85,
SEC_OID_X509_NAME_CONSTRAINTS = 86,
SEC_OID_X509_CRL_DIST_POINTS = 87,
SEC_OID_X509_CERTIFICATE_POLICIES = 88,
SEC_OID_X509_POLICY_MAPPINGS = 89,
SEC_OID_X509_POLICY_CONSTRAINTS = 90,
SEC_OID_X509_AUTH_KEY_ID = 91,
SEC_OID_X509_EXT_KEY_USAGE = 92,
SEC_OID_X509_AUTH_INFO_ACCESS = 93,
SEC_OID_X509_CRL_NUMBER = 94,
SEC_OID_X509_REASON_CODE = 95,
SEC_OID_X509_INVALID_DATE = 96,
SEC_OID_X500_RSA_ENCRYPTION = 97,
SEC_OID_RFC1274_UID = 98,
SEC_OID_RFC1274_MAIL = 99,
SEC_OID_PKCS12 = 100,
SEC_OID_PKCS12_MODE_IDS = 101,
SEC_OID_PKCS12_ESPVK_IDS = 102,
SEC_OID_PKCS12_BAG_IDS = 103,
SEC_OID_PKCS12_CERT_BAG_IDS = 104,
SEC_OID_PKCS12_OIDS = 105,
SEC_OID_PKCS12_PBE_IDS = 106,
SEC_OID_PKCS12_SIGNATURE_IDS = 107,
SEC_OID_PKCS12_ENVELOPING_IDS = 108,
SEC_OID_PKCS12_PKCS8_KEY_SHROUDING = 109,
SEC_OID_PKCS12_KEY_BAG_ID = 110,
SEC_OID_PKCS12_CERT_AND_CRL_BAG_ID = 111,
SEC_OID_PKCS12_SECRET_BAG_ID = 112,
SEC_OID_PKCS12_X509_CERT_CRL_BAG = 113,
SEC_OID_PKCS12_SDSI_CERT_BAG = 114,
SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC4 = 115,
SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC4 = 116,
SEC_OID_PKCS12_PBE_WITH_SHA1_AND_TRIPLE_DES_CBC = 117,
SEC_OID_PKCS12_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC = 118,
SEC_OID_PKCS12_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC = 119,
SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_128_BIT_RC4 = 120,
SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_40_BIT_RC4 = 121,
SEC_OID_PKCS12_RSA_ENCRYPTION_WITH_TRIPLE_DES = 122,
SEC_OID_PKCS12_RSA_SIGNATURE_WITH_SHA1_DIGEST = 123,
SEC_OID_ANSIX9_DSA_SIGNATURE = 124,
SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST = 125,
SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST = 126,
SEC_OID_VERISIGN_USER_NOTICES = 127,
SEC_OID_PKIX_CPS_POINTER_QUALIFIER = 128,
SEC_OID_PKIX_USER_NOTICE_QUALIFIER = 129,
SEC_OID_PKIX_OCSP = 130,
SEC_OID_PKIX_OCSP_BASIC_RESPONSE = 131,
SEC_OID_PKIX_OCSP_NONCE = 132,
SEC_OID_PKIX_OCSP_CRL = 133,
SEC_OID_PKIX_OCSP_RESPONSE = 134,
SEC_OID_PKIX_OCSP_NO_CHECK = 135,
SEC_OID_PKIX_OCSP_ARCHIVE_CUTOFF = 136,
SEC_OID_PKIX_OCSP_SERVICE_LOCATOR = 137,
SEC_OID_PKIX_REGCTRL_REGTOKEN = 138,
SEC_OID_PKIX_REGCTRL_AUTHENTICATOR = 139,
SEC_OID_PKIX_REGCTRL_PKIPUBINFO = 140,
SEC_OID_PKIX_REGCTRL_PKI_ARCH_OPTIONS = 141,
SEC_OID_PKIX_REGCTRL_OLD_CERT_ID = 142,
SEC_OID_PKIX_REGCTRL_PROTOCOL_ENC_KEY = 143,
SEC_OID_PKIX_REGINFO_UTF8_PAIRS = 144,
SEC_OID_PKIX_REGINFO_CERT_REQUEST = 145,
SEC_OID_EXT_KEY_USAGE_SERVER_AUTH = 146,
SEC_OID_EXT_KEY_USAGE_CLIENT_AUTH = 147,
SEC_OID_EXT_KEY_USAGE_CODE_SIGN = 148,
SEC_OID_EXT_KEY_USAGE_EMAIL_PROTECT = 149,
SEC_OID_EXT_KEY_USAGE_TIME_STAMP = 150,
SEC_OID_OCSP_RESPONDER = 151,
SEC_OID_NETSCAPE_SMIME_KEA = 152,
SEC_OID_FORTEZZA_SKIPJACK = 153,
SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC4 = 154,
SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC4 = 155,
SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_3KEY_TRIPLE_DES_CBC = 156,
SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_2KEY_TRIPLE_DES_CBC = 157,
SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_128_BIT_RC2_CBC = 158,
SEC_OID_PKCS12_V2_PBE_WITH_SHA1_AND_40_BIT_RC2_CBC = 159,
SEC_OID_PKCS12_SAFE_CONTENTS_ID = 160,
SEC_OID_PKCS12_PKCS8_SHROUDED_KEY_BAG_ID = 161,
SEC_OID_PKCS12_V1_KEY_BAG_ID = 162,
SEC_OID_PKCS12_V1_PKCS8_SHROUDED_KEY_BAG_ID = 163,
SEC_OID_PKCS12_V1_CERT_BAG_ID = 164,
SEC_OID_PKCS12_V1_CRL_BAG_ID = 165,
SEC_OID_PKCS12_V1_SECRET_BAG_ID = 166,
SEC_OID_PKCS12_V1_SAFE_CONTENTS_BAG_ID = 167,
SEC_OID_PKCS9_X509_CERT = 168,
SEC_OID_PKCS9_SDSI_CERT = 169,
SEC_OID_PKCS9_X509_CRL = 170,
SEC_OID_PKCS9_FRIENDLY_NAME = 171,
SEC_OID_PKCS9_LOCAL_KEY_ID = 172,
SEC_OID_BOGUS_KEY_USAGE = 173,
SEC_OID_X942_DIFFIE_HELMAN_KEY = 174,
SEC_OID_NETSCAPE_NICKNAME = 175,
SEC_OID_NETSCAPE_RECOVERY_REQUEST = 176,
SEC_OID_CERT_RENEWAL_LOCATOR = 177,
SEC_OID_NS_CERT_EXT_SCOPE_OF_USE = 178,
SEC_OID_CMS_EPHEMERAL_STATIC_DIFFIE_HELLMAN = 179,
SEC_OID_CMS_3DES_KEY_WRAP = 180,
SEC_OID_CMS_RC2_KEY_WRAP = 181,
SEC_OID_SMIME_ENCRYPTION_KEY_PREFERENCE = 182,
SEC_OID_AES_128_ECB = 183,
SEC_OID_AES_128_CBC = 184,
SEC_OID_AES_192_ECB = 185,
SEC_OID_AES_192_CBC = 186,
SEC_OID_AES_256_ECB = 187,
SEC_OID_AES_256_CBC = 188,
SEC_OID_SDN702_DSA_SIGNATURE = 189,
SEC_OID_MS_SMIME_ENCRYPTION_KEY_PREFERENCE = 190,
SEC_OID_SHA256 = 191,
SEC_OID_SHA384 = 192,
SEC_OID_SHA512 = 193,
SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION = 194,
SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION = 195,
SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION = 196,
SEC_OID_AES_128_KEY_WRAP = 197,
SEC_OID_AES_192_KEY_WRAP = 198,
SEC_OID_AES_256_KEY_WRAP = 199,
SEC_OID_ANSIX962_EC_PUBLIC_KEY = 200,
SEC_OID_ANSIX962_ECDSA_SHA1_SIGNATURE = 201,
SEC_OID_ANSIX962_EC_PRIME192V1 = 202,
SEC_OID_ANSIX962_EC_PRIME192V2 = 203,
SEC_OID_ANSIX962_EC_PRIME192V3 = 204,
SEC_OID_ANSIX962_EC_PRIME239V1 = 205,
SEC_OID_ANSIX962_EC_PRIME239V2 = 206,
SEC_OID_ANSIX962_EC_PRIME239V3 = 207,
SEC_OID_ANSIX962_EC_PRIME256V1 = 208,
SEC_OID_SECG_EC_SECP112R1 = 209,
SEC_OID_SECG_EC_SECP112R2 = 210,
SEC_OID_SECG_EC_SECP128R1 = 211,
SEC_OID_SECG_EC_SECP128R2 = 212,
SEC_OID_SECG_EC_SECP160K1 = 213,
SEC_OID_SECG_EC_SECP160R1 = 214,
SEC_OID_SECG_EC_SECP160R2 = 215,
SEC_OID_SECG_EC_SECP192K1 = 216,
SEC_OID_SECG_EC_SECP224K1 = 217,
SEC_OID_SECG_EC_SECP224R1 = 218,
SEC_OID_SECG_EC_SECP256K1 = 219,
SEC_OID_SECG_EC_SECP384R1 = 220,
SEC_OID_SECG_EC_SECP521R1 = 221,
SEC_OID_ANSIX962_EC_C2PNB163V1 = 222,
SEC_OID_ANSIX962_EC_C2PNB163V2 = 223,
SEC_OID_ANSIX962_EC_C2PNB163V3 = 224,
SEC_OID_ANSIX962_EC_C2PNB176V1 = 225,
SEC_OID_ANSIX962_EC_C2TNB191V1 = 226,
SEC_OID_ANSIX962_EC_C2TNB191V2 = 227,
SEC_OID_ANSIX962_EC_C2TNB191V3 = 228,
SEC_OID_ANSIX962_EC_C2ONB191V4 = 229,
SEC_OID_ANSIX962_EC_C2ONB191V5 = 230,
SEC_OID_ANSIX962_EC_C2PNB208W1 = 231,
SEC_OID_ANSIX962_EC_C2TNB239V1 = 232,
SEC_OID_ANSIX962_EC_C2TNB239V2 = 233,
SEC_OID_ANSIX962_EC_C2TNB239V3 = 234,
SEC_OID_ANSIX962_EC_C2ONB239V4 = 235,
SEC_OID_ANSIX962_EC_C2ONB239V5 = 236,
SEC_OID_ANSIX962_EC_C2PNB272W1 = 237,
SEC_OID_ANSIX962_EC_C2PNB304W1 = 238,
SEC_OID_ANSIX962_EC_C2TNB359V1 = 239,
SEC_OID_ANSIX962_EC_C2PNB368W1 = 240,
SEC_OID_ANSIX962_EC_C2TNB431R1 = 241,
SEC_OID_SECG_EC_SECT113R1 = 242,
SEC_OID_SECG_EC_SECT113R2 = 243,
SEC_OID_SECG_EC_SECT131R1 = 244,
SEC_OID_SECG_EC_SECT131R2 = 245,
SEC_OID_SECG_EC_SECT163K1 = 246,
SEC_OID_SECG_EC_SECT163R1 = 247,
SEC_OID_SECG_EC_SECT163R2 = 248,
SEC_OID_SECG_EC_SECT193R1 = 249,
SEC_OID_SECG_EC_SECT193R2 = 250,
SEC_OID_SECG_EC_SECT233K1 = 251,
SEC_OID_SECG_EC_SECT233R1 = 252,
SEC_OID_SECG_EC_SECT239K1 = 253,
SEC_OID_SECG_EC_SECT283K1 = 254,
SEC_OID_SECG_EC_SECT283R1 = 255,
SEC_OID_SECG_EC_SECT409K1 = 256,
SEC_OID_SECG_EC_SECT409R1 = 257,
SEC_OID_SECG_EC_SECT571K1 = 258,
SEC_OID_SECG_EC_SECT571R1 = 259,
SEC_OID_NETSCAPE_AOLSCREENNAME = 260,
SEC_OID_AVA_SURNAME = 261,
SEC_OID_AVA_SERIAL_NUMBER = 262,
SEC_OID_AVA_STREET_ADDRESS = 263,
SEC_OID_AVA_TITLE = 264,
SEC_OID_AVA_POSTAL_ADDRESS = 265,
SEC_OID_AVA_POSTAL_CODE = 266,
SEC_OID_AVA_POST_OFFICE_BOX = 267,
SEC_OID_AVA_GIVEN_NAME = 268,
SEC_OID_AVA_INITIALS = 269,
SEC_OID_AVA_GENERATION_QUALIFIER = 270,
SEC_OID_AVA_HOUSE_IDENTIFIER = 271,
SEC_OID_AVA_PSEUDONYM = 272,
SEC_OID_PKIX_CA_ISSUERS = 273,
SEC_OID_PKCS9_EXTENSION_REQUEST = 274,
SEC_OID_ANSIX962_ECDSA_SIGNATURE_RECOMMENDED_DIGEST = 275,
SEC_OID_ANSIX962_ECDSA_SIGNATURE_SPECIFIED_DIGEST = 276,
SEC_OID_ANSIX962_ECDSA_SHA224_SIGNATURE = 277,
SEC_OID_ANSIX962_ECDSA_SHA256_SIGNATURE = 278,
SEC_OID_ANSIX962_ECDSA_SHA384_SIGNATURE = 279,
SEC_OID_ANSIX962_ECDSA_SHA512_SIGNATURE = 280,
SEC_OID_X509_HOLD_INSTRUCTION_CODE = 281,
SEC_OID_X509_DELTA_CRL_INDICATOR = 282,
SEC_OID_X509_ISSUING_DISTRIBUTION_POINT = 283,
SEC_OID_X509_CERT_ISSUER = 284,
SEC_OID_X509_FRESHEST_CRL = 285,
SEC_OID_X509_INHIBIT_ANY_POLICY = 286,
SEC_OID_X509_SUBJECT_INFO_ACCESS = 287,
SEC_OID_CAMELLIA_128_CBC = 288,
SEC_OID_CAMELLIA_192_CBC = 289,
SEC_OID_CAMELLIA_256_CBC = 290,
SEC_OID_PKCS5_PBKDF2 = 291,
SEC_OID_PKCS5_PBES2 = 292,
SEC_OID_PKCS5_PBMAC1 = 293,
SEC_OID_HMAC_SHA1 = 294,
SEC_OID_HMAC_SHA224 = 295,
SEC_OID_HMAC_SHA256 = 296,
SEC_OID_HMAC_SHA384 = 297,
SEC_OID_HMAC_SHA512 = 298,
SEC_OID_PKIX_TIMESTAMPING = 299,
SEC_OID_PKIX_CA_REPOSITORY = 300,
SEC_OID_ISO_SHA1_WITH_RSA_SIGNATURE = 301,
SEC_OID_SEED_CBC = 302,
SEC_OID_X509_ANY_POLICY = 303,
SEC_OID_PKCS1_RSA_OAEP_ENCRYPTION = 304,
SEC_OID_PKCS1_MGF1 = 305,
SEC_OID_PKCS1_PSPECIFIED = 306,
SEC_OID_PKCS1_RSA_PSS_SIGNATURE = 307,
SEC_OID_PKCS1_SHA224_WITH_RSA_ENCRYPTION = 308,
SEC_OID_SHA224 = 309,
SEC_OID_EV_INCORPORATION_LOCALITY = 310,
SEC_OID_EV_INCORPORATION_STATE = 311,
SEC_OID_EV_INCORPORATION_COUNTRY = 312,
SEC_OID_BUSINESS_CATEGORY = 313,
SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA224_DIGEST = 314,
SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA256_DIGEST = 315,
SEC_OID_MS_EXT_KEY_USAGE_CTL_SIGNING = 316,
SEC_OID_AVA_NAME = 317,
SEC_OID_AES_128_GCM = 318,
SEC_OID_AES_192_GCM = 319,
SEC_OID_AES_256_GCM = 320,
SEC_OID_IDEA_CBC = 321,
SEC_OID_RC2_40_CBC = 322,
SEC_OID_DES_40_CBC = 323,
SEC_OID_RC4_40 = 324,
SEC_OID_RC4_56 = 325,
SEC_OID_NULL_CIPHER = 326,
SEC_OID_HMAC_MD5 = 327,
SEC_OID_TLS_RSA = 328,
SEC_OID_TLS_DHE_RSA = 329,
SEC_OID_TLS_DHE_DSS = 330,
SEC_OID_TLS_DH_RSA = 331,
SEC_OID_TLS_DH_DSS = 332,
SEC_OID_TLS_DH_ANON = 333,
SEC_OID_TLS_ECDHE_ECDSA = 334,
SEC_OID_TLS_ECDHE_RSA = 335,
SEC_OID_TLS_ECDH_ECDSA = 336,
SEC_OID_TLS_ECDH_RSA = 337,
SEC_OID_TLS_ECDH_ANON = 338,
SEC_OID_TLS_RSA_EXPORT = 339,
SEC_OID_TLS_DHE_RSA_EXPORT = 340,
SEC_OID_TLS_DHE_DSS_EXPORT = 341,
SEC_OID_TLS_DH_RSA_EXPORT = 342,
SEC_OID_TLS_DH_DSS_EXPORT = 343,
SEC_OID_TLS_DH_ANON_EXPORT = 344,
SEC_OID_APPLY_SSL_POLICY = 345,
SEC_OID_CHACHA20_POLY1305 = 346,
SEC_OID_TLS_ECDHE_PSK = 347,
SEC_OID_TLS_DHE_PSK = 348,
SEC_OID_TLS_FFDHE_2048 = 349,
SEC_OID_TLS_FFDHE_3072 = 350,
SEC_OID_TLS_FFDHE_4096 = 351,
SEC_OID_TLS_FFDHE_6144 = 352,
SEC_OID_TLS_FFDHE_8192 = 353,
SEC_OID_TLS_DHE_CUSTOM = 354,
SEC_OID_CURVE25519 = 355,
SEC_OID_TLS13_KEA_ANY = 356,
SEC_OID_X509_ANY_EXT_KEY_USAGE = 357,
SEC_OID_EXT_KEY_USAGE_IPSEC_IKE = 358,
SEC_OID_IPSEC_IKE_END = 359,
SEC_OID_IPSEC_IKE_INTERMEDIATE = 360,
SEC_OID_EXT_KEY_USAGE_IPSEC_END = 361,
SEC_OID_EXT_KEY_USAGE_IPSEC_TUNNEL = 362,
SEC_OID_EXT_KEY_USAGE_IPSEC_USER = 363,
SEC_OID_TOTAL = 364,
}

Просмотреть файл

@ -0,0 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::*;
use std::os::raw::{c_int, c_ulong, c_void};
extern "C" {
pub fn PORT_FreeArena(arena: *mut PLArenaPool, zero: PRBool);
pub fn NSS_SecureMemcmp(a: *const c_void, b: *const c_void, n: size_t) -> c_int;
}
pub type size_t = c_ulong;

Просмотреть файл

@ -6,19 +6,5 @@
#![warn(rust_2018_idioms)]
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
mod bindings;
pub use bindings::*;
// Remap some constants.
pub const SECSuccess: SECStatus = _SECStatus_SECSuccess;
pub const SECFailure: SECStatus = _SECStatus_SECFailure;
pub const PR_FALSE: PRBool = 0;
pub const PR_TRUE: PRBool = 1;
pub const CK_FALSE: CK_BBOOL = 0;
pub const CK_TRUE: CK_BBOOL = 1;
// This is the NSS version that this crate is claiming to be compatible with.
// We check it at runtime using `NSS_VersionCheck`.
pub const COMPATIBLE_NSS_VERSION: &str = "3.26";

Просмотреть файл

@ -36,7 +36,7 @@ pub fn aes_gcm_crypt(
ulTagBits: nss_sys::CK_ULONG::try_from(AES_GCM_TAG_LENGTH * 8)?,
};
let mut params = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: &mut gcm_params as *mut _ as *mut c_uchar,
len: c_uint::try_from(mem::size_of::<nss_sys::CK_GCM_PARAMS>())?,
};
@ -57,7 +57,7 @@ pub fn aes_cbc_crypt(
operation: Operation,
) -> Result<Vec<u8>> {
let mut params = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: nonce.as_ptr() as *mut c_uchar,
len: c_uint::try_from(nonce.len())?,
};

Просмотреть файл

@ -86,7 +86,7 @@ pub fn generate_keypair(curve: Curve) -> Result<(PrivateKey, PublicKey)> {
// 1. Create EC params
let params_buf = create_ec_params_for_curve(curve)?;
let mut params = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: params_buf.as_ptr() as *mut c_uchar,
len: c_uint::try_from(params_buf.len())?,
};
@ -308,27 +308,27 @@ impl PublicKey {
// https://searchfox.org/mozilla-central/rev/ec489aa170b6486891cf3625717d6fa12bcd11c1/dom/crypto/CryptoKey.cpp#1078
check_pub_key_bytes(bytes, curve)?;
let key_data = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: bytes.as_ptr() as *mut c_uchar,
len: c_uint::try_from(bytes.len())?,
};
let params_buf = create_ec_params_for_curve(curve)?;
let params = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: params_buf.as_ptr() as *mut c_uchar,
len: c_uint::try_from(params_buf.len())?,
};
let pub_key = nss_sys::SECKEYPublicKey {
arena: ptr::null_mut(),
keyType: nss_sys::KeyType::ecKey,
keyType: nss_sys::KeyType::ecKey as u32,
pkcs11Slot: ptr::null_mut(),
pkcs11ID: nss_sys::CK_INVALID_HANDLE.into(),
u: nss_sys::SECKEYPublicKeyStr__bindgen_ty_1 {
u: nss_sys::SECKEYPublicKeyStr_u {
ec: nss_sys::SECKEYECPublicKey {
DEREncodedParams: params,
publicValue: key_data,
encoding: nss_sys::ECPointEncoding_ECPoint_Uncompressed,
encoding: nss_sys::ECPointEncoding::ECPoint_Uncompressed as u32,
size: 0,
},
},
@ -362,7 +362,7 @@ fn create_ec_params_for_curve(curve: Curve) -> Result<Vec<u8>> {
Curve::P256 => nss_sys::SECOidTag::SEC_OID_ANSIX962_EC_PRIME256V1,
};
// Retrieve curve data by OID tag.
let oid_data = unsafe { nss_sys::SECOID_FindOIDByTag(curve_oid_tag) };
let oid_data = unsafe { nss_sys::SECOID_FindOIDByTag(curve_oid_tag as u32) };
if oid_data.is_null() {
return Err(ErrorKind::InternalError.into());
}

Просмотреть файл

@ -38,7 +38,7 @@ impl HashAlgorithm {
}
}
impl From<&HashAlgorithm> for nss_sys::SECOidTag::Type {
impl From<&HashAlgorithm> for nss_sys::SECOidTag {
fn from(alg: &HashAlgorithm) -> Self {
match alg {
HashAlgorithm::SHA256 => nss_sys::SECOidTag::SEC_OID_SHA256,
@ -52,7 +52,12 @@ pub fn hash_buf(algorithm: &HashAlgorithm, data: &[u8]) -> Result<Vec<u8>> {
let mut out = vec![0u8; result_len];
let data_len = i32::try_from(data.len())?;
map_nss_secstatus(|| unsafe {
nss_sys::PK11_HashBuf(algorithm.into(), out.as_mut_ptr(), data.as_ptr(), data_len)
nss_sys::PK11_HashBuf(
Into::<nss_sys::SECOidTag>::into(algorithm) as u32,
out.as_mut_ptr(),
data.as_ptr(),
data_len,
)
})?;
Ok(out)
}
@ -98,7 +103,7 @@ pub fn create_context_by_sym_key(
) -> Result<Context> {
ensure_nss_initialized();
let mut param = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: ptr::null_mut(),
len: 0,
};

Просмотреть файл

@ -34,7 +34,7 @@ pub fn hkdf_expand(
ulInfoLen: c_ulong::try_from(info.len())?,
};
let mut params = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: &mut hkdf_params as *mut _ as *mut c_uchar,
len: u32::try_from(mem::size_of::<nss_sys::CK_NSS_HKDFParams>())?,
};
@ -75,7 +75,7 @@ pub(crate) fn import_sym_key(
) -> Result<SymKey> {
ensure_nss_initialized();
let mut item = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: buf.as_ptr() as *mut c_uchar,
len: c_uint::try_from(buf.len())?,
};
@ -84,7 +84,7 @@ pub(crate) fn import_sym_key(
SymKey::from_ptr(nss_sys::PK11_ImportSymKey(
slot.as_mut_ptr(),
mechanism,
nss_sys::PK11Origin::PK11_OriginUnwrap,
nss_sys::PK11Origin::PK11_OriginUnwrap as u32,
operation,
&mut item,
ptr::null_mut(),

Просмотреть файл

@ -41,7 +41,7 @@ unsafe fn pk11_destroy_context_true(context: *mut nss_sys::PK11Context) {
// Trait for types that have PCKS#11 attributes that are readable. See
// https://searchfox.org/mozilla-central/rev/8ed8474757695cdae047150a0eaf94a5f1c96dbe/security/nss/lib/pk11wrap/pk11pub.h#842-864
pub(crate) unsafe trait Pkcs11Object: ScopedPtr {
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType::Type;
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType;
fn read_raw_attribute(
&self,
attribute_type: nss_sys::CK_ATTRIBUTE_TYPE,
@ -49,7 +49,7 @@ pub(crate) unsafe trait Pkcs11Object: ScopedPtr {
let mut out_sec = ScopedSECItem::empty(nss_sys::SECItemType::siBuffer);
map_nss_secstatus(|| unsafe {
nss_sys::PK11_ReadRawAttribute(
Self::PK11_OBJECT_TYPE,
Self::PK11_OBJECT_TYPE as u32,
self.as_mut_ptr() as *mut c_void,
attribute_type,
out_sec.as_mut_ref(),
@ -60,20 +60,16 @@ pub(crate) unsafe trait Pkcs11Object: ScopedPtr {
}
unsafe impl Pkcs11Object for GenericObject {
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType::Type =
nss_sys::PK11ObjectType::PK11_TypeGeneric;
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType = nss_sys::PK11ObjectType::PK11_TypeGeneric;
}
unsafe impl Pkcs11Object for PrivateKey {
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType::Type =
nss_sys::PK11ObjectType::PK11_TypePrivKey;
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType = nss_sys::PK11ObjectType::PK11_TypePrivKey;
}
unsafe impl Pkcs11Object for PublicKey {
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType::Type =
nss_sys::PK11ObjectType::PK11_TypePubKey;
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType = nss_sys::PK11ObjectType::PK11_TypePubKey;
}
unsafe impl Pkcs11Object for SymKey {
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType::Type =
nss_sys::PK11ObjectType::PK11_TypeSymKey;
const PK11_OBJECT_TYPE: nss_sys::PK11ObjectType = nss_sys::PK11ObjectType::PK11_TypeSymKey;
}
// From https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_API_Guidelines#Thread_Safety:
@ -97,7 +93,7 @@ impl PrivateKey {
let mut obj_id_buf = vec![0u8; 160 / 8];
generate_random(&mut obj_id_buf)?;
let mut obj_id = nss_sys::SECItem {
type_: nss_sys::SECItemType::siBuffer,
type_: nss_sys::SECItemType::siBuffer as u32,
data: obj_id_buf.as_ptr() as *mut c_uchar,
len: c_uint::try_from(obj_id_buf.len())?,
};
@ -166,10 +162,10 @@ pub(crate) struct ScopedSECItem {
}
impl ScopedSECItem {
pub(crate) fn empty(r#type: nss_sys::SECItemType::Type) -> Self {
pub(crate) fn empty(r#type: nss_sys::SECItemType) -> Self {
ScopedSECItem {
wrapped: nss_sys::SECItem {
type_: r#type,
type_: r#type as u32,
data: ptr::null_mut(),
len: 0,
},

Просмотреть файл

@ -6,11 +6,15 @@ use crate::error::*;
use nss_sys::*;
use std::{convert::TryFrom, ffi::CString, os::raw::c_char, sync::Once};
// This is the NSS version that this crate is claiming to be compatible with.
// We check it at runtime using `NSS_VersionCheck`.
pub const COMPATIBLE_NSS_VERSION: &str = "3.26";
static NSS_INIT: Once = Once::new();
pub fn ensure_nss_initialized() {
NSS_INIT.call_once(|| {
let version_ptr = CString::new(nss_sys::COMPATIBLE_NSS_VERSION).unwrap();
let version_ptr = CString::new(COMPATIBLE_NSS_VERSION).unwrap();
if unsafe { NSS_VersionCheck(version_ptr.as_ptr()) == PR_FALSE } {
panic!("Incompatible NSS version!")
}
@ -41,7 +45,7 @@ pub fn map_nss_secstatus<F>(callback: F) -> Result<()>
where
F: FnOnce() -> SECStatus,
{
if callback() == SECSuccess {
if callback() == SECStatus::SECSuccess {
return Ok(());
}
Err(get_last_error())

Просмотреть файл

@ -0,0 +1,12 @@
[package]
name = "systest"
version = "0.1.0"
authors = ["Edouard Oger <eoger@fastmail.com>"]
edition = "2018"
[dependencies]
nss_sys = { path = "../nss_sys" }
libc = "0.2"
[build-dependencies]
ctest = "0.2"

Просмотреть файл

@ -0,0 +1,65 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::{env, ffi::OsString, path::Path};
fn main() {
// NSS links against SQLite3, so...
println!("cargo:rustc-link-lib=static=sqlcipher");
println!("cargo:rerun-if-env-changed=SQLCIPHER_LIB_DIR");
let sqlcipher_lib_dir: OsString = env::var_os("SQLCIPHER_LIB_DIR").unwrap();
println!(
"cargo:rustc-link-search=native={}",
sqlcipher_lib_dir.to_string_lossy()
);
let mut cfg = ctest::TestGenerator::new();
cfg.header("blapit.h")
.header("keyhi.h")
.header("keythi.h")
.header("nss.h")
.header("pk11pub.h")
.header("pkcs11n.h")
.header("pkcs11t.h")
.header("plarena.h")
.header("prerror.h")
.header("prtypes.h")
.header("secasn1t.h")
.header("seccomon.h")
.header("secitem.h")
.header("secmodt.h")
.header("secoid.h")
.header("secoidt.h")
.header("secport.h");
println!("cargo:rerun-if-env-changed=NSS_DIR");
let nss_dir: OsString = env::var_os("NSS_DIR").unwrap();
let nss_dir = Path::new(&nss_dir);
let include_dir = nss_dir.join("include").join("nss");
// Include the directory where the header files are defined
cfg.include(include_dir);
cfg.field_name(|_s, field| field.replace("type_", "type"));
cfg.skip_type(|s| {
// Opaque types.
s == "PK11SlotInfo"
|| s == "PK11SymKey"
|| s == "PK11Context"
|| s == "NSSInitContext"
|| s == "NSSInitParameters"
|| s == "PK11GenericObject"
});
cfg.skip_field_type(|s, field| {
s == "SECKEYPublicKeyStr" && field == "u" // inline union
});
cfg.skip_struct(|s| {
s == "SECKEYPublicKeyStr_u" // inline union
});
// Generate the tests, passing the path to the `*-sys` library as well as
// the module to generate.
cfg.generate("../nss_sys/src/lib.rs", "all.rs");
}

Просмотреть файл

@ -2,4 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "keythi.h"
#![allow(bad_style)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::all))]
use nss_sys::*;
include!(concat!(env!("OUT_DIR"), "/all.rs"));

Просмотреть файл

@ -51,16 +51,19 @@ pub(crate) fn open(
let (aes_key, hmac_key_bytes) = extract_keys(&key);
// 1. Tag (HMAC signature) check.
let hmac_key = hmac::VerificationKey::new(&digest::SHA256, &hmac_key_bytes);
let hmac_res = hmac::verify(
hmac::verify(
&hmac_key,
base64::encode(ciphertext).as_bytes(),
hmac_signature,
);
)?;
// 2. Decryption.
let cbc_res = aes_cbc(aes_key, nonce, aad, ciphertext, aead::Direction::Opening);
// To make this function as constant-time as possible, we always try to run both
// the hmac and the decryption operation.
hmac_res.and(cbc_res)
Ok(aes_cbc(
aes_key,
nonce,
aad,
ciphertext,
aead::Direction::Opening,
)?)
}
pub(crate) fn seal(

Просмотреть файл

@ -4,6 +4,7 @@ edition = "2018"
version = "0.1.0"
authors = ["Thom Chiovoloni <tchiovoloni@mozilla.com>"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[features]
default = []

Просмотреть файл

@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["application-services <application-services@mozilla.com>"]
edition = "2018"
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[dependencies]
sync15 = { path = "../sync15" }

Просмотреть файл

@ -4,6 +4,7 @@ edition = "2018"
version = "0.1.0"
authors = ["application-services@mozilla.com"]
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[features]
default = []

Просмотреть файл

@ -4,6 +4,7 @@ version = "0.1.0"
authors = ["Thom Chiovoloni <tchiovoloni@mozilla.com>"]
edition = "2018"
license = "MPL-2.0"
exclude = ["/android", "/ios"]
[lib]
crate-type = ["lib"]

Просмотреть файл

@ -0,0 +1,38 @@
[package]
name = "webext-storage"
edition = "2018"
version = "0.1.0"
authors = ["sync-team@mozilla.com"]
license = "MPL-2.0"
[features]
log_query_plans = ["sql-support/log_query_plans"]
default = []
[dependencies]
error-support = { path = "../support/error" }
failure = "0.1.6"
interrupt = { path = "../support/interrupt" }
lazy_static = "1.4.0"
log = "0.4"
serde = "1"
serde_json = "1"
serde_derive = "1"
sql-support = { path = "../support/sql" }
sync-guid = { path = "../support/guid", features = ["rusqlite_support", "random"] }
url = { version = "2.1.1", features = ["serde"] }
[dependencies.rusqlite]
version = "0.22.0"
features = ["functions", "bundled"]
[dev-dependencies]
env_logger = "0.7.0"
# A *direct* dep on the -sys crate is required for our build.rs
# to see the DEP_SQLITE3_LINK_TARGET env var that cargo sets
# on its behalf.
libsqlite3-sys = "0.17.1"
[build-dependencies]
nss_build_common = { path = "../support/rc_crypto/nss/nss_build_common" }

Просмотреть файл

@ -0,0 +1,16 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Work around the fact that `sqlcipher` might get enabled by a cargo feature
//! another crate in the workspace needs, without setting up nss. (This is a
//! gross hack).
fn main() {
println!("cargo:rerun-if-changed=build.rs");
// Ugh. This is really really dumb. We don't care about sqlcipher at all. really
if nss_build_common::env_str("DEP_SQLITE3_LINK_TARGET") == Some("sqlcipher".into()) {
// If NSS_DIR isn't set, we don't really care, ignore the Err case.
let _ = nss_build_common::link_nss();
}
}

Просмотреть файл

@ -0,0 +1,49 @@
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-- This is a very simple schema for a chrome.storage.* implementation. At time
-- of writing, only chrome.storage.sync is supported, but this can be trivially
-- enhanced to support chrome.storage.local (the api is identical, it's just a
-- different "bucket" and doesn't sync).
--
-- Even though the spec allows for a single extension to have any number of
-- "keys", we've made the decision to store all keys for a given extension in a
-- single row as a JSON representation of all keys and values.
-- We've done this primarily due to:
-- * The shape of the API is very JSON, and it almost encourages multiple keys
-- to be fetched at one time.
-- * The defined max sizes that extensions are allowed to store using this API
-- is sufficiently small that we don't have many concerns around record sizes.
-- * We'd strongly prefer to keep one record per extension when syncing this
-- data, so having the local store in this shape makes syncing easier.
CREATE TABLE IF NOT EXISTS storage_sync_data (
ext_id TEXT NOT NULL PRIMARY KEY,
/* The JSON payload. NULL means it's a tombstone */
data TEXT,
/* Same "sync change counter" strategy used by other components. */
sync_change_counter INTEGER NOT NULL DEFAULT 1
);
CREATE TABLE IF NOT EXISTS storage_sync_mirror (
guid TEXT NOT NULL PRIMARY KEY,
/* The extension_id is explicitly not the GUID used on the server.
We may end up making this a regular foreign-key relationship back to
storage_sync_data, although maybe not - the ext_id may not exist in
storage_sync_data at the time we populate this table.
We can iterate here as we ramp up sync support.
*/
ext_id TEXT NOT NULL UNIQUE,
/* The JSON payload. We *do* allow NULL here - it means "deleted" */
data TEXT
);
-- This table holds key-value metadata - primarily for sync.
CREATE TABLE IF NOT EXISTS meta (
key TEXT PRIMARY KEY,
value NOT NULL
) WITHOUT ROWID;

Просмотреть файл

@ -0,0 +1,480 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::error::*;
use rusqlite::{Connection, Transaction};
use serde::{ser::SerializeMap, Serialize, Serializer};
use serde_json::{Map, Value as JsonValue};
use sql_support::{self, ConnExt};
// These constants are defined by the chrome.storage.sync spec.
const QUOTA_BYTES: usize = 102_400;
const QUOTA_BYTES_PER_ITEM: usize = 8_192;
const MAX_ITEMS: usize = 512;
// Note there are also constants for "operations per minute" etc, which aren't
// enforced here.
type JsonMap = Map<String, JsonValue>;
fn get_from_db(conn: &Connection, ext_id: &str) -> Result<Option<JsonMap>> {
Ok(
match conn.try_query_one::<String>(
"SELECT data FROM storage_sync_data
WHERE ext_id = :ext_id",
&[(":ext_id", &ext_id)],
true,
)? {
Some(s) => match serde_json::from_str(&s)? {
JsonValue::Object(m) => Some(m),
// we could panic here as it's theoretically impossible, but we
// might as well treat it as not existing...
_ => None,
},
None => None,
},
)
}
fn save_to_db(tx: &Transaction<'_>, ext_id: &str, val: &JsonValue) -> Result<()> {
// The quota is enforced on the byte count, which is what .len() returns.
let sval = val.to_string();
if sval.len() > QUOTA_BYTES {
return Err(ErrorKind::QuotaError(QuotaReason::TotalBytes).into());
}
// XXX - sync support will need to do the change_counter thing here.
tx.execute_named(
"INSERT OR REPLACE INTO storage_sync_data(ext_id, data)
VALUES (:ext_id, :data)",
&[(":ext_id", &ext_id), (":data", &sval)],
)?;
Ok(())
}
fn remove_from_db(tx: &Transaction<'_>, ext_id: &str) -> Result<()> {
// XXX - sync support will need to do the tombstone thing here.
tx.execute_named(
"DELETE FROM storage_sync_data
WHERE ext_id = :ext_id",
&[(":ext_id", &ext_id)],
)?;
Ok(())
}
// This is a "helper struct" for the callback part of the chrome.storage spec,
// but shaped in a way to make it more convenient from the rust side of the
// world. The strings are all json, we keeping them as strings here makes
// various things easier and avoid a round-trip to/from json/string.
#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StorageValueChange {
#[serde(skip_serializing)]
key: String,
#[serde(skip_serializing_if = "Option::is_none")]
old_value: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
new_value: Option<String>,
}
// This is, largely, a helper so that this serializes correctly as per the
// chrome.storage.sync spec. If not for custom serialization it should just
// be a plain vec
#[derive(Debug, Clone, PartialEq)]
pub struct StorageChanges {
changes: Vec<StorageValueChange>,
}
impl StorageChanges {
fn new() -> Self {
Self {
changes: Vec::new(),
}
}
fn with_capacity(n: usize) -> Self {
Self {
changes: Vec::with_capacity(n),
}
}
fn is_empty(&self) -> bool {
self.changes.is_empty()
}
fn push(&mut self, change: StorageValueChange) {
self.changes.push(change)
}
}
// and it serializes as a map.
impl Serialize for StorageChanges {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let mut map = serializer.serialize_map(Some(self.changes.len()))?;
for change in &self.changes {
map.serialize_entry(&change.key, change)?;
}
map.end()
}
}
/// The implementation of `storage[.sync].set()`. On success this returns the
/// StorageChanges defined by the chrome API - it's assumed the caller will
/// arrange to deliver this to observers as defined in that API.
pub fn set(tx: &Transaction<'_>, ext_id: &str, val: JsonValue) -> Result<StorageChanges> {
let val_map = match val {
JsonValue::Object(m) => m,
// Not clear what the error semantics should be yet. For now, pretend an empty map.
_ => Map::new(),
};
let mut current = get_from_db(tx, ext_id)?.unwrap_or_default();
let mut changes = StorageChanges::with_capacity(val_map.len());
// iterate over the value we are adding/updating.
for (k, v) in val_map.into_iter() {
let old_value = current.remove(&k);
if current.len() >= MAX_ITEMS {
return Err(ErrorKind::QuotaError(QuotaReason::MaxItems).into());
}
// Setup the change entry for this key, and we can leverage it to check
// for the quota.
let new_value_s = v.to_string();
// Reading the chrome docs literally re the quota, the length of the key
// is just the string len, but the value is the json val, as bytes
if k.len() + new_value_s.len() >= QUOTA_BYTES_PER_ITEM {
return Err(ErrorKind::QuotaError(QuotaReason::ItemBytes).into());
}
let change = StorageValueChange {
key: k.clone(),
old_value: old_value.map(|ov| ov.to_string()),
new_value: Some(new_value_s),
};
changes.push(change);
current.insert(k, v);
}
save_to_db(tx, ext_id, &JsonValue::Object(current))?;
Ok(changes)
}
// A helper which takes a param indicating what keys should be returned and
// converts that to a vec of real strings. Also returns "default" values to
// be used if no item exists for that key.
fn get_keys(keys: JsonValue) -> Vec<(String, Option<JsonValue>)> {
match keys {
JsonValue::String(s) => vec![(s, None)],
JsonValue::Array(keys) => {
// because nothing with json is ever simple, each key may not be
// a string. We ignore any which aren't.
keys.iter()
.filter_map(|v| v.as_str().map(|s| (s.to_string(), None)))
.collect()
}
JsonValue::Object(m) => m.into_iter().map(|(k, d)| (k, Some(d))).collect(),
_ => vec![],
}
}
/// The implementation of `storage[.sync].get()` - on success this always
/// returns a Json object.
pub fn get(conn: &Connection, ext_id: &str, keys: JsonValue) -> Result<JsonValue> {
// key is optional, or string or array of string or object keys
let maybe_existing = get_from_db(conn, ext_id)?;
let mut existing = match maybe_existing {
None => return Ok(JsonValue::Object(Map::new())),
Some(v) => v,
};
// take the quick path for null, where we just return the entire object.
if keys.is_null() {
return Ok(JsonValue::Object(existing));
}
// OK, so we need to build a list of keys to get.
let keys_and_defaults = get_keys(keys);
let mut result = Map::with_capacity(keys_and_defaults.len());
for (key, maybe_default) in keys_and_defaults {
// XXX - If a key is requested that doesn't exist, we have 2 options:
// (1) have the key in the result with the value null, or (2) the key
// simply doesn't exist in the result. We assume (2), but should verify
// that's what chrome does.
if let Some(v) = existing.remove(&key) {
result.insert(key, v);
} else if let Some(def) = maybe_default {
result.insert(key, def);
}
}
Ok(JsonValue::Object(result))
}
/// The implementation of `storage[.sync].remove()`. On success this returns the
/// StorageChanges defined by the chrome API - it's assumed the caller will
/// arrange to deliver this to observers as defined in that API.
pub fn remove(tx: &Transaction<'_>, ext_id: &str, keys: JsonValue) -> Result<StorageChanges> {
let mut existing = match get_from_db(tx, ext_id)? {
None => return Ok(StorageChanges::new()),
Some(v) => v,
};
let keys_and_defs = get_keys(keys);
let mut result = StorageChanges::with_capacity(keys_and_defs.len());
for (key, _) in keys_and_defs {
if let Some(v) = existing.remove(&key) {
result.push(StorageValueChange {
key,
old_value: Some(v.to_string()),
new_value: None,
});
}
}
if !result.is_empty() {
save_to_db(tx, ext_id, &JsonValue::Object(existing))?;
}
Ok(result)
}
/// The implementation of `storage[.sync].clear()`. On success this returns the
/// StorageChanges defined by the chrome API - it's assumed the caller will
/// arrange to deliver this to observers as defined in that API.
pub fn clear(tx: &Transaction<'_>, ext_id: &str) -> Result<StorageChanges> {
let existing = match get_from_db(tx, ext_id)? {
None => return Ok(StorageChanges::new()),
Some(v) => v,
};
let mut result = StorageChanges::with_capacity(existing.len());
for (key, val) in existing.into_iter() {
result.push(StorageValueChange {
key: key.to_string(),
new_value: None,
old_value: Some(val.to_string()),
});
}
remove_from_db(tx, ext_id)?;
Ok(result)
}
// TODO - get_bytes_in_use()
#[cfg(test)]
mod tests {
use super::*;
use crate::db::test::new_mem_db;
use serde_json::json;
#[test]
fn test_serialize_storage_changes() -> Result<()> {
let c = StorageChanges {
changes: vec![StorageValueChange {
key: "key".to_string(),
old_value: Some("old".to_string()),
new_value: None,
}],
};
assert_eq!(serde_json::to_string(&c)?, r#"{"key":{"oldValue":"old"}}"#);
Ok(())
}
fn make_changes(changes: &[(&str, Option<JsonValue>, Option<JsonValue>)]) -> StorageChanges {
let mut r = StorageChanges::with_capacity(changes.len());
for (name, old_value, new_value) in changes {
r.push(StorageValueChange {
key: (*name).to_string(),
old_value: old_value.as_ref().map(|v| v.to_string()),
new_value: new_value.as_ref().map(|v| v.to_string()),
});
}
r
}
#[test]
fn test_simple() -> Result<()> {
let ext_id = "x";
let db = new_mem_db();
let mut conn = db.writer.lock().unwrap();
let tx = conn.transaction()?;
// an empty store.
for q in vec![
JsonValue::Null,
json!("foo"),
json!(["foo"]),
json!({ "foo": null }),
json!({"foo": "default"}),
]
.into_iter()
{
assert_eq!(get(&tx, &ext_id, q)?, json!({}));
}
// Single item in the store.
set(&tx, &ext_id, json!({"foo": "bar" }))?;
for q in vec![
JsonValue::Null,
json!("foo"),
json!(["foo"]),
json!({ "foo": null }),
json!({"foo": "default"}),
]
.into_iter()
{
assert_eq!(get(&tx, &ext_id, q)?, json!({"foo": "bar" }));
}
// more complex stuff, including changes checking.
assert_eq!(
set(&tx, &ext_id, json!({"foo": "new", "other": "also new" }))?,
make_changes(&[
("foo", Some(json!("bar")), Some(json!("new"))),
("other", None, Some(json!("also new")))
])
);
assert_eq!(
get(&tx, &ext_id, JsonValue::Null)?,
json!({"foo": "new", "other": "also new"})
);
assert_eq!(get(&tx, &ext_id, json!("foo"))?, json!({"foo": "new"}));
assert_eq!(
get(&tx, &ext_id, json!(["foo", "other"]))?,
json!({"foo": "new", "other": "also new"})
);
assert_eq!(
get(&tx, &ext_id, json!({"foo": null, "default": "yo"}))?,
json!({"foo": "new", "default": "yo"})
);
assert_eq!(
remove(&tx, &ext_id, json!("foo"))?,
make_changes(&[("foo", Some(json!("new")), None)]),
);
// XXX - other variants.
assert_eq!(
clear(&tx, &ext_id)?,
make_changes(&[("other", Some(json!("also new")), None)]),
);
assert_eq!(get(&tx, &ext_id, JsonValue::Null)?, json!({}));
Ok(())
}
#[test]
fn test_check_get_impl() -> Result<()> {
// This is a port of checkGetImpl in test_ext_storage.js in Desktop.
let ext_id = "x";
let db = new_mem_db();
let mut conn = db.writer.lock().unwrap();
let tx = conn.transaction()?;
let prop = "test-prop";
let value = "test-value";
set(&tx, ext_id, json!({ prop: value }))?;
// this is the checkGetImpl part!
let mut data = get(&tx, &ext_id, json!(null))?;
assert_eq!(value, json!(data[prop]), "null getter worked for {}", prop);
data = get(&tx, &ext_id, json!(prop))?;
assert_eq!(
value,
json!(data[prop]),
"string getter worked for {}",
prop
);
assert_eq!(
data.as_object().unwrap().len(),
1,
"string getter should return an object with a single property"
);
data = get(&tx, &ext_id, json!([prop]))?;
assert_eq!(value, json!(data[prop]), "array getter worked for {}", prop);
assert_eq!(
data.as_object().unwrap().len(),
1,
"array getter with a single key should return an object with a single property"
);
// checkGetImpl() uses `{ [prop]: undefined }` - but json!() can't do that :(
// Hopefully it's just testing a simple object, so we use `{ prop: null }`
data = get(&tx, &ext_id, json!({ prop: null }))?;
assert_eq!(
value,
json!(data[prop]),
"object getter worked for {}",
prop
);
assert_eq!(
data.as_object().unwrap().len(),
1,
"object getter with a single key should return an object with a single property"
);
Ok(())
}
#[test]
fn test_bug_1621162() -> Result<()> {
// apparently Firefox, unlike Chrome, will not optimize the changes.
// See bug 1621162 for more!
let db = new_mem_db();
let mut conn = db.writer.lock().unwrap();
let tx = conn.transaction()?;
let ext_id = "xyz";
set(&tx, &ext_id, json!({"foo": "bar" }))?;
assert_eq!(
set(&tx, &ext_id, json!({"foo": "bar" }))?,
make_changes(&[("foo", Some(json!("bar")), Some(json!("bar")))]),
);
Ok(())
}
#[test]
fn test_quota_maxitems() -> Result<()> {
let db = new_mem_db();
let mut conn = db.writer.lock().unwrap();
let tx = conn.transaction()?;
let ext_id = "xyz";
for i in 1..MAX_ITEMS + 1 {
set(
&tx,
&ext_id,
json!({ format!("key-{}", i): format!("value-{}", i) }),
)?;
}
let e = set(&tx, &ext_id, json!({"another": "another"})).unwrap_err();
match e.kind() {
ErrorKind::QuotaError(QuotaReason::MaxItems) => {}
_ => panic!("unexpected error type"),
};
Ok(())
}
#[test]
fn test_quota_bytesperitem() -> Result<()> {
let db = new_mem_db();
let mut conn = db.writer.lock().unwrap();
let tx = conn.transaction()?;
let ext_id = "xyz";
// A string 5 bytes less than the max. This should be counted as being
// 3 bytes less than the max as the quotes are counted.
let val = "x".repeat(QUOTA_BYTES_PER_ITEM - 5);
// Key length doesn't push it over.
set(&tx, &ext_id, json!({ "x": val }))?;
// Key length does push it over.
let e = set(&tx, &ext_id, json!({ "xxxx": val })).unwrap_err();
match e.kind() {
ErrorKind::QuotaError(QuotaReason::ItemBytes) => {}
_ => panic!("unexpected error type"),
};
Ok(())
}
}

Просмотреть файл

@ -0,0 +1,230 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::error::*;
use crate::schema;
use rusqlite::types::{FromSql, ToSql};
use rusqlite::Connection;
use rusqlite::OpenFlags;
use sql_support::ConnExt;
use std::fs;
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
use url::Url;
/// The entry-point to getting a database connection. No enforcement of this
/// as a singleton is made - that's up to the caller. If you make multiple
/// StorageDbs pointing at the same physical database, you are going to have a
/// bad time. We only support a single writer connection - so that's the only
/// thing we store. It's still a bit overkill, but there's only so many yaks
/// in a day.
pub struct StorageDb {
pub writer: Arc<Mutex<Connection>>,
}
impl StorageDb {
/// Create a new, or fetch an already open, StorageDb backed by a file on disk.
pub fn new(db_path: impl AsRef<Path>) -> Result<Self> {
let db_path = normalize_path(db_path)?;
Self::new_named(db_path)
}
/// Create a new, or fetch an already open, memory-based StorageDb. You must
/// provide a name, but you are still able to have a single writer and many
/// reader connections to the same memory DB open.
#[cfg(test)]
pub fn new_memory(db_path: &str) -> Result<Self> {
let name = PathBuf::from(format!("file:{}?mode=memory&cache=shared", db_path));
Self::new_named(name)
}
fn new_named(db_path: PathBuf) -> Result<Self> {
// We always create the read-write connection for an initial open so
// we can create the schema and/or do version upgrades.
let flags = OpenFlags::SQLITE_OPEN_NO_MUTEX
| OpenFlags::SQLITE_OPEN_URI
| OpenFlags::SQLITE_OPEN_CREATE
| OpenFlags::SQLITE_OPEN_READ_WRITE;
let conn = Connection::open_with_flags(db_path.clone(), flags)?;
match init_sql_connection(&conn, true) {
Ok(()) => Ok(Self {
writer: Arc::new(Mutex::new(conn)),
}),
Err(e) => {
// like with places, failure to upgrade means "you lose your data"
if let ErrorKind::DatabaseUpgradeError = e.kind() {
fs::remove_file(&db_path)?;
Self::new_named(db_path)
} else {
Err(e)
}
}
}
}
}
fn init_sql_connection(conn: &Connection, is_writable: bool) -> Result<()> {
let initial_pragmas = "
-- We don't care about temp tables being persisted to disk.
PRAGMA temp_store = 2;
-- we unconditionally want write-ahead-logging mode
PRAGMA journal_mode=WAL;
-- foreign keys seem worth enforcing!
PRAGMA foreign_keys = ON;
";
conn.execute_batch(initial_pragmas)?;
define_functions(&conn)?;
conn.set_prepared_statement_cache_capacity(128);
if is_writable {
let tx = conn.unchecked_transaction()?;
schema::init(&conn)?;
tx.commit()?;
};
Ok(())
}
fn define_functions(_c: &Connection) -> Result<()> {
Ok(())
}
// These should be somewhere else...
pub fn put_meta(db: &Connection, key: &str, value: &dyn ToSql) -> Result<()> {
db.conn().execute_named_cached(
"REPLACE INTO meta (key, value) VALUES (:key, :value)",
&[(":key", &key), (":value", value)],
)?;
Ok(())
}
pub fn get_meta<T: FromSql>(db: &Connection, key: &str) -> Result<Option<T>> {
let res = db.conn().try_query_one(
"SELECT value FROM meta WHERE key = :key",
&[(":key", &key)],
true,
)?;
Ok(res)
}
pub fn delete_meta(db: &Connection, key: &str) -> Result<()> {
db.conn()
.execute_named_cached("DELETE FROM meta WHERE key = :key", &[(":key", &key)])?;
Ok(())
}
// Utilities for working with paths.
// (From places_utils - ideally these would be shared, but the use of
// ErrorKind values makes that non-trivial.
/// `Path` is basically just a `str` with no validation, and so in practice it
/// could contain a file URL. Rusqlite takes advantage of this a bit, and says
/// `AsRef<Path>` but really means "anything sqlite can take as an argument".
///
/// Swift loves using file urls (the only support it has for file manipulation
/// is through file urls), so it's handy to support them if possible.
fn unurl_path(p: impl AsRef<Path>) -> PathBuf {
p.as_ref()
.to_str()
.and_then(|s| Url::parse(s).ok())
.and_then(|u| {
if u.scheme() == "file" {
u.to_file_path().ok()
} else {
None
}
})
.unwrap_or_else(|| p.as_ref().to_owned())
}
/// If `p` is a file URL, return it, otherwise try and make it one.
///
/// Errors if `p` is a relative non-url path, or if it's a URL path
/// that's isn't a `file:` URL.
pub fn ensure_url_path(p: impl AsRef<Path>) -> Result<Url> {
if let Some(u) = p.as_ref().to_str().and_then(|s| Url::parse(s).ok()) {
if u.scheme() == "file" {
Ok(u)
} else {
Err(ErrorKind::IllegalDatabasePath(p.as_ref().to_owned()).into())
}
} else {
let p = p.as_ref();
let u = Url::from_file_path(p).map_err(|_| ErrorKind::IllegalDatabasePath(p.to_owned()))?;
Ok(u)
}
}
/// As best as possible, convert `p` into an absolute path, resolving
/// all symlinks along the way.
///
/// If `p` is a file url, it's converted to a path before this.
fn normalize_path(p: impl AsRef<Path>) -> Result<PathBuf> {
let path = unurl_path(p);
if let Ok(canonical) = path.canonicalize() {
return Ok(canonical);
}
// It probably doesn't exist yet. This is an error, although it seems to
// work on some systems.
//
// We resolve this by trying to canonicalize the parent directory, and
// appending the requested file name onto that. If we can't canonicalize
// the parent, we return an error.
//
// Also, we return errors if the path ends in "..", if there is no
// parent directory, etc.
let file_name = path
.file_name()
.ok_or_else(|| ErrorKind::IllegalDatabasePath(path.clone()))?;
let parent = path
.parent()
.ok_or_else(|| ErrorKind::IllegalDatabasePath(path.clone()))?;
let mut canonical = parent.canonicalize()?;
canonical.push(file_name);
Ok(canonical)
}
// Helpers for tests
#[cfg(test)]
pub mod test {
use super::*;
use std::sync::atomic::{AtomicUsize, Ordering};
// A helper for our tests to get their own memory Api.
static ATOMIC_COUNTER: AtomicUsize = AtomicUsize::new(0);
pub fn new_mem_db() -> StorageDb {
let _ = env_logger::try_init();
let counter = ATOMIC_COUNTER.fetch_add(1, Ordering::Relaxed);
StorageDb::new_memory(&format!("test-api-{}", counter)).expect("should get an API")
}
}
#[cfg(test)]
mod tests {
use super::test::*;
use super::*;
// Sanity check that we can create a database.
#[test]
fn test_open() {
new_mem_db();
// XXX - should we check anything else? Seems a bit pointless, but if
// we move the meta functions away from here then it's better than
// nothing.
}
#[test]
fn test_meta() -> Result<()> {
let db = new_mem_db();
let writer = db.writer.lock().unwrap();
assert_eq!(get_meta::<String>(&writer, "foo")?, None);
put_meta(&writer, "foo", &"bar".to_string())?;
assert_eq!(get_meta(&writer, "foo")?, Some("bar".to_string()));
delete_meta(&writer, "foo")?;
assert_eq!(get_meta::<String>(&writer, "foo")?, None);
Ok(())
}
}

Просмотреть файл

@ -0,0 +1,65 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use failure::Fail;
use interrupt::Interrupted;
#[derive(Debug)]
pub enum QuotaReason {
TotalBytes,
ItemBytes,
MaxItems,
}
#[derive(Debug, Fail)]
pub enum ErrorKind {
#[fail(display = "Quota exceeded: {:?}", _0)]
QuotaError(QuotaReason),
#[fail(display = "Error parsing JSON data: {}", _0)]
JsonError(#[fail(cause)] serde_json::Error),
#[fail(display = "Error executing SQL: {}", _0)]
SqlError(#[fail(cause)] rusqlite::Error),
#[fail(display = "A connection of this type is already open")]
ConnectionAlreadyOpen,
#[fail(display = "An invalid connection type was specified")]
InvalidConnectionType,
#[fail(display = "IO error: {}", _0)]
IoError(#[fail(cause)] std::io::Error),
#[fail(display = "Operation interrupted")]
InterruptedError(#[fail(cause)] Interrupted),
#[fail(display = "Tried to close connection on wrong StorageApi instance")]
WrongApiForClose,
// This will happen if you provide something absurd like
// "/" or "" as your database path. For more subtley broken paths,
// we'll likely return an IoError.
#[fail(display = "Illegal database path: {:?}", _0)]
IllegalDatabasePath(std::path::PathBuf),
#[fail(display = "UTF8 Error: {}", _0)]
Utf8Error(#[fail(cause)] std::str::Utf8Error),
#[fail(display = "Database cannot be upgraded")]
DatabaseUpgradeError,
#[fail(display = "Database version {} is not supported", _0)]
UnsupportedDatabaseVersion(i64),
}
error_support::define_error! {
ErrorKind {
(JsonError, serde_json::Error),
(SqlError, rusqlite::Error),
(IoError, std::io::Error),
(InterruptedError, Interrupted),
(Utf8Error, std::str::Utf8Error),
}
}

Просмотреть файл

@ -0,0 +1,26 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![allow(unknown_lints)]
#![warn(rust_2018_idioms)]
mod api;
pub mod db;
pub mod error;
mod schema;
pub mod store;
// This is what we roughly expect the "bridge" used by desktop to do.
// It's primarily here to avoid dead-code warnings (but I don't want to disable
// those warning, as stuff that remains after this is suspect!)
pub fn delme_demo_usage() -> error::Result<()> {
use serde_json::json;
let store = store::Store::new("webext-storage.db")?;
store.set("ext-id", json!({}))?;
store.get("ext-id", json!({}))?;
store.remove("ext-id", json!({}))?;
store.clear("ext-id")?;
Ok(())
}

Просмотреть файл

@ -0,0 +1,72 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// XXXXXX - This has been cloned from places/src/schema.rs, which has the
// comment:
// // This has been cloned from logins/src/schema.rs, on Thom's
// // wip-sync-sql-store branch.
// // We should work out how to turn this into something that can use a shared
// // db.rs.
//
// And we really should :) But not now.
use crate::error::Result;
use rusqlite::{Connection, NO_PARAMS};
use sql_support::ConnExt;
const VERSION: i64 = 1; // let's avoid bumping this and migrating for now!
const CREATE_SCHEMA_SQL: &str = include_str!("../sql/create_schema.sql");
fn get_current_schema_version(db: &Connection) -> Result<i64> {
Ok(db.query_one::<i64>("PRAGMA user_version")?)
}
pub fn init(db: &Connection) -> Result<()> {
let user_version = get_current_schema_version(db)?;
if user_version == 0 {
create(db)?;
} else if user_version != VERSION {
if user_version < VERSION {
panic!("no migrations yet!");
} else {
log::warn!(
"Loaded future schema version {} (we only understand version {}). \
Optimistically ",
user_version,
VERSION
);
// Downgrade the schema version, so that anything added with our
// schema is migrated forward when the newer library reads our
// database.
db.execute_batch(&format!("PRAGMA user_version = {};", VERSION))?;
}
}
Ok(())
}
fn create(db: &Connection) -> Result<()> {
log::debug!("Creating schema");
db.execute_batch(CREATE_SCHEMA_SQL)?;
db.execute(
&format!("PRAGMA user_version = {version}", version = VERSION),
NO_PARAMS,
)?;
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use crate::db::test::new_mem_db;
#[test]
fn test_create_schema_twice() {
let db = new_mem_db();
let conn = db.writer.lock().unwrap();
conn.execute_batch(CREATE_SCHEMA_SQL)
.expect("should allow running twice");
}
}

Просмотреть файл

@ -0,0 +1,73 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::api::{self, StorageChanges};
use crate::db::StorageDb;
use crate::error::*;
use serde_json;
use std::path::Path;
use serde_json::Value as JsonValue;
pub struct Store {
db: StorageDb,
}
impl Store {
// functions to create instances.
pub fn new(db_path: impl AsRef<Path>) -> Result<Self> {
Ok(Self {
db: StorageDb::new(db_path)?,
})
}
#[cfg(test)]
pub fn new_memory(db_path: &str) -> Result<Self> {
Ok(Self {
db: StorageDb::new_memory(db_path)?,
})
}
// The "public API".
pub fn set(&self, ext_id: &str, val: JsonValue) -> Result<StorageChanges> {
let mut conn = self.db.writer.lock().unwrap();
let tx = conn.transaction()?;
let result = api::set(&tx, ext_id, val)?;
tx.commit()?;
Ok(result)
}
pub fn get(&self, ext_id: &str, keys: JsonValue) -> Result<JsonValue> {
// Don't care about transactions here.
let conn = self.db.writer.lock().unwrap();
api::get(&conn, ext_id, keys)
}
pub fn remove(&self, ext_id: &str, keys: JsonValue) -> Result<StorageChanges> {
let mut conn = self.db.writer.lock().unwrap();
let tx = conn.transaction()?;
let result = api::remove(&tx, ext_id, keys)?;
tx.commit()?;
Ok(result)
}
pub fn clear(&self, ext_id: &str) -> Result<StorageChanges> {
let mut conn = self.db.writer.lock().unwrap();
let tx = conn.transaction()?;
let result = api::clear(&tx, ext_id)?;
tx.commit()?;
Ok(result)
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_send() {
fn ensure_send<T: Send>() {}
// Compile will fail if not send.
ensure_send::<Store>();
}
}

Просмотреть файл

@ -37,14 +37,20 @@ For Android consumers these are the steps by which Application Services code bec
and the integrity-protection mechanisms that apply at each step:
1. Code is developed in branches and lands on `master` via pull request.
* GitHub branch protection prevents code being pushed to `master` without review,
and requires signed tags (but doesn't check *who* they're signed by).
* GitHub branch protection prevents code being pushed to `master` without review.
* CircleCI and TaskCluster run automated tests against the code, but do not have
the ability to push modified code back to GitHub thanks to the above branch protection.
* TaskCluster jobs do not run against PRs opened by the general public,
only for PRs from repo collaborators.
* Contra the [github org security guidelines](https://wiki.mozilla.org/GitHub/Repository_Security),
signing of individual commits is encouraged but is **not required**. Our experience in practice
has been that this adds friction for contributors without sufficient tangible benefit.
2. Developers manually create a release from latest `master`.
* The ability to create new releases is managed entirely via github's permission model.
* TODO: the [github org security guidelines](https://wiki.mozilla.org/GitHub/Repository_Security)
recommend signing tags, and auditing all included commits as part of the release process.
We should conider some tooling to support this. I don't think there's any way to force
githib to only accept signed releases in the same way it can enforce signed commits.
3. TaskCluster checks out the release tag, builds it for all target platforms, and runs automated tests.
* These tasks run in a pre-built docker image, helping assure integrity of the build environment.
* TODO: could this step check for signed tags as an additional integrity measure?

Просмотреть файл

@ -53,7 +53,7 @@ When submitting a PR:
- Base your branch off the current `master` (see below for an example workflow).
- Add both your code and new tests if relevant.
- Please do not include merge commits in pull requests; include only commits with the new relevant code.
- Your patch must be [GPG signed](https://help.github.com/articles/managing-commit-signature-verification) to ensure the commits come from a trusted source.
- We encourage you to [GPG sign your commits](https://help.github.com/articles/managing-commit-signature-verification).
## Code Review ##

Просмотреть файл

@ -51,6 +51,10 @@
git push -u origin fixes-for-v0.31.3
```
3. Follow the above steps for cuting a new release from master, except that:
* When running the `./automation/prepare-release.py` script, use the `--base-branch` argument to point it at your release branch, and specify `patch` as the release type. Example:
```
./automation/prepare-release.py --base-branch=release-v0.31 patch
```
* When opening a PR to land the commits, target the `release-v0.XX` branch rather than master.
* When cutting the new release via github's UI, target the `release-v0.XX` branch rather than master.
4. Merge the new release back to master.

Просмотреть файл

@ -30,8 +30,8 @@ At the end of this process you should have the following environment variables s
These variables are required every time you build, so you should add them to
a rc file or similar so they persist between reboots etc.
1. Install NDK r20 from https://developer.android.com/ndk/downloads
- Extract it, put it somewhere (`$HOME/.android-ndk-r20` is a reasonable
1. Install NDK r21 from https://developer.android.com/ndk/downloads
- Extract it, put it somewhere (`$HOME/.android-ndk-r21` is a reasonable
choice, but it doesn't matter), and set `ANDROID_NDK_ROOT` to this location.
- Set `ANDROID_NDK_HOME` to match `ANDROID_NDK_ROOT`, for compatibility with
some android grandle plugins.

Просмотреть файл

@ -7,7 +7,7 @@
set -e
NDK_VERSION=20
NDK_VERSION=21
RUST_TARGETS=("aarch64-linux-android" "armv7-linux-androideabi" "i686-linux-android" "x86_64-linux-android")
if [[ ! -f "$(pwd)/libs/build-all.sh" ]]; then
@ -27,7 +27,7 @@ fi
if [[ -z "${ANDROID_NDK_ROOT}" ]]; then
echo "Could not find Android NDK:"
echo 'Please install Android NDK r20 and then set ANDROID_NDK_ROOT.'
echo 'Please install Android NDK r21 and then set ANDROID_NDK_ROOT.'
exit 1
fi

Просмотреть файл

@ -6,24 +6,16 @@ the details of which are reproduced below.
* [Mozilla Public License 2.0](#mozilla-public-license-20)
* [Apache License 2.0](#apache-license-20)
* [MIT License: aho-corasick, byteorder, memchr, termcolor](#mit-license-aho-corasick-byteorder-memchr-termcolor)
* [MIT License: ansi_term](#mit-license-ansi_term)
* [MIT License: atty](#mit-license-atty)
* [MIT License: aho-corasick, byteorder, memchr](#mit-license-aho-corasick-byteorder-memchr)
* [MIT License: bincode](#mit-license-bincode)
* [MIT License: bytes](#mit-license-bytes)
* [MIT License: caseless](#mit-license-caseless)
* [MIT License: clap](#mit-license-clap)
* [MIT License: libsqlite3-sys, rusqlite](#mit-license-libsqlite3-sys-rusqlite)
* [MIT License: libsqlite3-sys](#mit-license-libsqlite3-sys)
* [MIT License: matches](#mit-license-matches)
* [MIT License: nom](#mit-license-nom)
* [MIT License: strsim](#mit-license-strsim)
* [MIT License: rusqlite](#mit-license-rusqlite)
* [MIT License: synstructure](#mit-license-synstructure)
* [MIT License: textwrap](#mit-license-textwrap)
* [MIT License: which](#mit-license-which)
* [CC0-1.0 License: base16](#cc0-10-license-base16)
* [ISC License: libloading](#isc-license-libloading)
* [ISC License: ring](#isc-license-ring)
* [BSD-3-Clause License: bindgen](#bsd-3-clause-license-bindgen)
* [BSD-3-Clause License: protobuf](#bsd-3-clause-license-protobuf)
* [BSD-3-Clause License: sqlcipher](#bsd-3-clause-license-sqlcipher)
* [Optional Notice: SQLite](#optional-notice-sqlite)
@ -419,44 +411,35 @@ The following text applies to code linked from these dependencies:
[anyhow](https://github.com/dtolnay/anyhow),
[backtrace-sys](https://github.com/alexcrichton/backtrace-rs),
[backtrace](https://github.com/rust-lang/backtrace-rs),
[base64](https://github.com/alicemaz/rust-base64),
[base64](https://github.com/marshallpierce/rust-base64),
[bitflags](https://github.com/bitflags/bitflags),
[cc](https://github.com/alexcrichton/cc-rs),
[cexpr](https://github.com/jethrogb/rust-cexpr),
[cfg-if](https://github.com/alexcrichton/cfg-if),
[clang-sys](https://github.com/KyleMayes/clang-sys),
[dogear](https://github.com/mozilla/dogear),
[either](https://github.com/bluss/either),
[env_logger](https://github.com/sebasmagri/env_logger/),
[failure](https://github.com/rust-lang-nursery/failure),
[failure_derive](https://github.com/rust-lang-nursery/failure),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[hex](https://github.com/KokaKiwi/rust-hex),
[humantime](https://github.com/tailhook/humantime),
[idna](https://github.com/servo/rust-url/),
[itertools](https://github.com/bluss/rust-itertools),
[itoa](https://github.com/dtolnay/itoa),
[jna](https://github.com/java-native-access/jna),
[lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs),
[lazycell](https://github.com/indiv0/lazycell),
[libc](https://github.com/rust-lang/libc),
[linked-hash-map](https://github.com/contain-rs/linked-hash-map),
[log](https://github.com/rust-lang/log),
[lru-cache](https://github.com/contain-rs/lru-cache),
[once_cell](https://github.com/matklad/once_cell),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[pkg-config](https://github.com/rust-lang/pkg-config-rs),
[ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion),
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-derive](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
[rand](https://github.com/rust-random/rand),
[rand_chacha](https://github.com/rust-random/rand),
@ -464,25 +447,19 @@ The following text applies to code linked from these dependencies:
[regex-syntax](https://github.com/rust-lang/regex),
[regex](https://github.com/rust-lang/regex),
[rustc-demangle](https://github.com/alexcrichton/rustc-demangle),
[rustc-hash](https://github.com/rust-lang-nursery/rustc-hash),
[ryu](https://github.com/dtolnay/ryu),
[serde](https://github.com/serde-rs/serde),
[serde_derive](https://github.com/serde-rs/serde),
[serde_json](https://github.com/serde-rs/json),
[shlex](https://github.com/comex/rust-shlex),
[smallbitvec](https://github.com/servo/smallbitvec),
[smallvec](https://github.com/servo/rust-smallvec),
[syn](https://github.com/dtolnay/syn),
[thread_local](https://github.com/Amanieu/thread_local-rs),
[time](https://github.com/rust-lang/time),
[toml](https://github.com/alexcrichton/toml-rs),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),
[vec_map](https://github.com/contain-rs/vec-map),
[version_check](https://github.com/SergioBenitez/version_check),
[winapi-x86_64-pc-windows-gnu](https://github.com/retep998/winapi-rs),
[winapi](https://github.com/retep998/winapi-rs)
@ -691,13 +668,12 @@ limitations under the License.
```
-------------
## MIT License: aho-corasick, byteorder, memchr, termcolor
## MIT License: aho-corasick, byteorder, memchr
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr),
[termcolor](https://github.com/BurntSushi/termcolor)
[memchr](https://github.com/BurntSushi/rust-memchr)
```
The MIT License (MIT)
@ -722,65 +698,6 @@ 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.
```
-------------
## MIT License: ansi_term
The following text applies to code linked from these dependencies:
[ansi_term](https://github.com/ogham/rust-ansi-term)
```
The MIT License (MIT)
Copyright (c) 2014 Benjamin Sago
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:
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.
```
-------------
## MIT License: atty
The following text applies to code linked from these dependencies:
[atty](https://github.com/softprops/atty)
```
Copyright (c) 2015-2019 Doug Tangren
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:
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.
```
-------------
## MIT License: bincode
@ -878,44 +795,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: clap
## MIT License: libsqlite3-sys
The following text applies to code linked from these dependencies:
[clap](https://github.com/clap-rs/clap)
[libsqlite3-sys](https://github.com/jgallagher/rusqlite)
```
The MIT License (MIT)
Copyright (c) 2015-2016 Kevin B. Knapp
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:
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.
```
-------------
## MIT License: libsqlite3-sys, rusqlite
The following text applies to code linked from these dependencies:
[libsqlite3-sys](https://github.com/jgallagher/rusqlite),
[rusqlite](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
Copyright (c) 2014-2020 The rusqlite developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -971,120 +857,13 @@ DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: nom
## MIT License: rusqlite
The following text applies to code linked from these dependencies:
[nom](https://github.com/Geal/nom)
[rusqlite](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014-2019 Geoffroy Couprie
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:
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.
```
-------------
## MIT License: strsim
The following text applies to code linked from these dependencies:
[strsim](https://github.com/dguo/strsim-rs)
```
The MIT License (MIT)
Copyright (c) 2015 Danny Guo
Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
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:
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.
```
-------------
## MIT License: synstructure
The following text applies to code linked from these dependencies:
[synstructure](https://github.com/mystor/synstructure)
```
Copyright 2016 Nika Layzell
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:
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.
```
-------------
## MIT License: textwrap
The following text applies to code linked from these dependencies:
[textwrap](https://github.com/mgeisler/textwrap)
```
MIT License
Copyright (c) 2016 Martin Geisler
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:
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.
```
-------------
## MIT License: which
The following text applies to code linked from these dependencies:
[which](https://github.com/harryfei/which-rs.git)
```
Copyright (c) 2015 fangyuanziti
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -1104,6 +883,22 @@ 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.
```
-------------
## MIT License: synstructure
The following text applies to code linked from these dependencies:
[synstructure](https://github.com/mystor/synstructure)
```
Copyright 2016 Nika Layzell
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:
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.
```
-------------
## CC0-1.0 License: base16
@ -1234,27 +1029,6 @@ express Statement of Purpose.
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
```
-------------
## ISC License: libloading
The following text applies to code linked from these dependencies:
[libloading](https://github.com/nagisa/rust_libloading/)
```
Copyright © 2015, Simonas Kazlauskas
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
```
-------------
## ISC License: ring
@ -1278,44 +1052,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
-------------
## BSD-3-Clause License: bindgen
The following text applies to code linked from these dependencies:
[bindgen](https://github.com/rust-lang/rust-bindgen)
```
BSD 3-Clause License
Copyright (c) 2013, Jyun-Yan You
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
-------------
## BSD-3-Clause License: protobuf

Просмотреть файл

@ -32,14 +32,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: backtrace-sys</name>
<url>https://github.com/rust-lang/backtrace-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: base64</name>
<url>https://github.com/alicemaz/rust-base64/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: base64</name>
<url>https://github.com/marshallpierce/rust-base64/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: base64</name>
<url>https://github.com/marshallpierce/rust-base64/blob/master/LICENSE-APACHE</url>
@ -52,18 +44,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: cc</name>
<url>https://github.com/alexcrichton/cc-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: cexpr</name>
<url>https://github.com/jethrogb/rust-cexpr/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: cfg-if</name>
<url>https://github.com/alexcrichton/cfg-if/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: clang-sys</name>
<url>https://github.com/KyleMayes/clang-sys/blob/master/LICENSE.txt</url>
</license>
<license>
<name>Apache License 2.0: dogear</name>
<url>https://github.com/mozilla/dogear/blob/master/LICENSE</url>
@ -72,10 +56,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: either</name>
<url>https://github.com/bluss/either/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: env_logger</name>
<url>https://github.com/sebasmagri/env_logger/blob//master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: failure</name>
<url>https://github.com/rust-lang-nursery/failure/blob/master/LICENSE-APACHE</url>
@ -100,18 +80,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: getrandom</name>
<url>https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: glob</name>
<url>https://github.com/rust-lang/glob/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: hex</name>
<url>https://github.com/KokaKiwi/rust-hex/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: humantime</name>
<url>https://github.com/tailhook/humantime/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: idna</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
@ -132,10 +104,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: lazy_static</name>
<url>https://github.com/rust-lang-nursery/lazy-static.rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: lazycell</name>
<url>https://github.com/indiv0/lazycell/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: libc</name>
<url>https://github.com/rust-lang/libc/blob/master/LICENSE-APACHE</url>
@ -156,10 +124,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: once_cell</name>
<url>https://github.com/matklad/once_cell/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: peeking_take_while</name>
<url>https://github.com/fitzgen/peeking_take_while/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: percent-encoding</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
@ -184,10 +148,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: prost-derive</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: quick-error</name>
<url>https://github.com/tailhook/quick-error/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: quote</name>
<url>https://github.com/dtolnay/quote/blob/master/LICENSE-APACHE</url>
@ -216,10 +176,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: rustc-demangle</name>
<url>https://github.com/alexcrichton/rustc-demangle/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: rustc-hash</name>
<url>https://github.com/rust-lang-nursery/rustc-hash/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: ryu</name>
<url>https://github.com/dtolnay/ryu/blob/master/LICENSE-APACHE</url>
@ -236,10 +192,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: serde_json</name>
<url>https://github.com/serde-rs/json/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: shlex</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
<license>
<name>Apache License 2.0: smallbitvec</name>
<url>https://github.com/servo/smallbitvec/blob/master/LICENSE-APACHE</url>
@ -260,10 +212,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: time</name>
<url>https://github.com/time-rs/time/blob/master/LICENSE-Apache</url>
</license>
<license>
<name>Apache License 2.0: toml</name>
<url>https://github.com/alexcrichton/toml-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-bidi</name>
<url>https://github.com/servo/unicode-bidi/blob/master/LICENSE-APACHE</url>
@ -272,10 +220,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: unicode-normalization</name>
<url>https://github.com/unicode-rs/unicode-normalization/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-width</name>
<url>https://github.com/unicode-rs/unicode-width/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-xid</name>
<url>https://github.com/unicode-rs/unicode-xid/blob/master/LICENSE-APACHE</url>
@ -284,14 +228,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: url</name>
<url>https://github.com/servo/rust-url/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: vec_map</name>
<url>https://github.com/contain-rs/vec-map/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: version_check</name>
<url>https://github.com/SergioBenitez/version_check/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: winapi</name>
<url>https://github.com/retep998/winapi-rs/blob/master/LICENSE-MIT</url>
@ -312,18 +248,6 @@ the details of which are reproduced below.
<name>MIT License: memchr</name>
<url>https://github.com/BurntSushi/rust-memchr/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: termcolor</name>
<url>https://github.com/BurntSushi/termcolor/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: ansi_term</name>
<url>https://github.com/ogham/rust-ansi-term/blob/master/LICENCE</url>
</license>
<license>
<name>MIT License: atty</name>
<url>https://github.com/softprops/atty/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: bincode</name>
<url>https://github.com/servo/bincode/blob/master/LICENSE.md</url>
@ -336,58 +260,30 @@ the details of which are reproduced below.
<name>MIT License: caseless</name>
<url>https://github.com/SimonSapin/rust-caseless/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: clap</name>
<url>https://github.com/clap-rs/clap/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: libsqlite3-sys</name>
<url>https://github.com/jgallagher/rusqlite/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: rusqlite</name>
<url>https://github.com/jgallagher/rusqlite/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: matches</name>
<url>https://github.com/SimonSapin/rust-std-candidates/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: nom</name>
<url>https://github.com/Geal/nom/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: strsim</name>
<url>https://github.com/dguo/strsim-rs/blob/master/LICENSE</url>
<name>MIT License: rusqlite</name>
<url>https://github.com/jgallagher/rusqlite/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: synstructure</name>
<url>https://github.com/mystor/synstructure/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: textwrap</name>
<url>https://github.com/mgeisler/textwrap/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: which</name>
<url>https://github.com/harryfei/which-rs/blob/master/LICENSE.txt</url>
</license>
<license>
<name>CC0-1.0 License: base16</name>
<url>https://github.com/thomcc/rust-base16/blob/master/LICENSE-CC0</url>
</license>
<license>
<name>ISC License: libloading</name>
<url>https://github.com/nagisa/rust_libloading/blob//master/LICENSE</url>
</license>
<license>
<name>ISC License: ring</name>
<url>https://github.com/briansmith/ring/blob/master/LICENSE</url>
</license>
<license>
<name>BSD-3-Clause License: bindgen</name>
<url>https://github.com/rust-lang/rust-bindgen/blob/master/LICENSE</url>
</license>
<license>
<name>BSD-3-Clause License: protobuf</name>
<url>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</url>

Просмотреть файл

@ -7,33 +7,25 @@ the details of which are reproduced below.
* [Mozilla Public License 2.0](#mozilla-public-license-20)
* [Apache License 2.0](#apache-license-20)
* [MIT License: SwiftKeychainWrapper](#mit-license-swiftkeychainwrapper)
* [MIT License: aho-corasick, byteorder, memchr, termcolor](#mit-license-aho-corasick-byteorder-memchr-termcolor)
* [MIT License: ansi_term](#mit-license-ansi_term)
* [MIT License: atty](#mit-license-atty)
* [MIT License: aho-corasick, byteorder, memchr](#mit-license-aho-corasick-byteorder-memchr)
* [MIT License: bytes](#mit-license-bytes)
* [MIT License: caseless](#mit-license-caseless)
* [MIT License: clap](#mit-license-clap)
* [MIT License: h2](#mit-license-h2)
* [MIT License: http-body](#mit-license-http-body)
* [MIT License: hyper](#mit-license-hyper)
* [MIT License: libsqlite3-sys, rusqlite](#mit-license-libsqlite3-sys-rusqlite)
* [MIT License: libsqlite3-sys](#mit-license-libsqlite3-sys)
* [MIT License: matches](#mit-license-matches)
* [MIT License: mime_guess](#mit-license-mime_guess)
* [MIT License: mio](#mit-license-mio)
* [MIT License: nom](#mit-license-nom)
* [MIT License: rusqlite](#mit-license-rusqlite)
* [MIT License: slab](#mit-license-slab)
* [MIT License: strsim](#mit-license-strsim)
* [MIT License: synstructure](#mit-license-synstructure)
* [MIT License: textwrap](#mit-license-textwrap)
* [MIT License: tokio, tokio-tls, tokio-util](#mit-license-tokio-tokio-tls-tokio-util)
* [MIT License: tower-service](#mit-license-tower-service)
* [MIT License: try-lock](#mit-license-try-lock)
* [MIT License: want](#mit-license-want)
* [MIT License: which](#mit-license-which)
* [CC0-1.0 License: base16](#cc0-10-license-base16)
* [ISC License: libloading](#isc-license-libloading)
* [ISC License: ring](#isc-license-ring)
* [BSD-3-Clause License: bindgen](#bsd-3-clause-license-bindgen)
* [BSD-3-Clause License: sqlcipher](#bsd-3-clause-license-sqlcipher)
* [Optional Notice: SQLite](#optional-notice-sqlite)
-------------
@ -429,20 +421,16 @@ The following text applies to code linked from these dependencies:
[autocfg](https://github.com/cuviper/autocfg),
[backtrace-sys](https://github.com/alexcrichton/backtrace-rs),
[backtrace](https://github.com/rust-lang/backtrace-rs),
[base64](https://github.com/alicemaz/rust-base64),
[base64](https://github.com/marshallpierce/rust-base64),
[bitflags](https://github.com/bitflags/bitflags),
[cc](https://github.com/alexcrichton/cc-rs),
[cexpr](https://github.com/jethrogb/rust-cexpr),
[cfg-if](https://github.com/alexcrichton/cfg-if),
[clang-sys](https://github.com/KyleMayes/clang-sys),
[core-foundation-sys](https://github.com/servo/core-foundation-rs),
[core-foundation](https://github.com/servo/core-foundation-rs),
[dogear](https://github.com/mozilla/dogear),
[dtoa](https://github.com/dtolnay/dtoa),
[either](https://github.com/bluss/either),
[encoding_rs](https://github.com/hsivonen/encoding_rs),
[env_logger](https://github.com/sebasmagri/env_logger/),
[failure](https://github.com/rust-lang-nursery/failure),
[failure_derive](https://github.com/rust-lang-nursery/failure),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
@ -456,11 +444,9 @@ The following text applies to code linked from these dependencies:
[futures-task](https://github.com/rust-lang/futures-rs),
[futures-util](https://github.com/rust-lang/futures-rs),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[hex](https://github.com/KokaKiwi/rust-hex),
[http](https://github.com/hyperium/http),
[httparse](https://github.com/seanmonstar/httparse),
[humantime](https://github.com/tailhook/humantime),
[hyper-tls](https://github.com/hyperium/hyper-tls),
[idna](https://github.com/servo/rust-url/),
[indexmap](https://github.com/bluss/indexmap),
@ -468,7 +454,6 @@ The following text applies to code linked from these dependencies:
[itertools](https://github.com/bluss/rust-itertools),
[itoa](https://github.com/dtolnay/itoa),
[lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs),
[lazycell](https://github.com/indiv0/lazycell),
[libc](https://github.com/rust-lang/libc),
[linked-hash-map](https://github.com/contain-rs/linked-hash-map),
[log](https://github.com/rust-lang/log),
@ -478,7 +463,6 @@ The following text applies to code linked from these dependencies:
[net2](https://github.com/rust-lang-nursery/net2-rs),
[num_cpus](https://github.com/seanmonstar/num_cpus),
[once_cell](https://github.com/matklad/once_cell),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[pin-project-internal](https://github.com/taiki-e/pin-project),
[pin-project-lite](https://github.com/taiki-e/pin-project-lite),
@ -489,7 +473,6 @@ The following text applies to code linked from these dependencies:
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-derive](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
[rand](https://github.com/rust-random/rand),
[rand_chacha](https://github.com/rust-random/rand),
@ -499,7 +482,6 @@ The following text applies to code linked from these dependencies:
[remove_dir_all](https://github.com/XAMPPRocky/remove_dir_all.git),
[reqwest](https://github.com/seanmonstar/reqwest),
[rustc-demangle](https://github.com/alexcrichton/rustc-demangle),
[rustc-hash](https://github.com/rust-lang-nursery/rustc-hash),
[ryu](https://github.com/dtolnay/ryu),
[security-framework-sys](https://github.com/kornelski/rust-security-framework),
[security-framework](https://github.com/kornelski/rust-security-framework),
@ -507,7 +489,6 @@ The following text applies to code linked from these dependencies:
[serde_derive](https://github.com/serde-rs/serde),
[serde_json](https://github.com/serde-rs/json),
[serde_urlencoded](https://github.com/nox/serde_urlencoded),
[shlex](https://github.com/comex/rust-shlex),
[smallbitvec](https://github.com/servo/smallbitvec),
[smallvec](https://github.com/servo/rust-smallvec),
[swift-protobuf](https://github.com/apple/swift-protobuf),
@ -515,14 +496,11 @@ The following text applies to code linked from these dependencies:
[tempfile](https://github.com/Stebalien/tempfile),
[thread_local](https://github.com/Amanieu/thread_local-rs),
[time](https://github.com/rust-lang/time),
[toml](https://github.com/alexcrichton/toml-rs),
[unicase](https://github.com/seanmonstar/unicase),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),
[vec_map](https://github.com/contain-rs/vec-map),
[version_check](https://github.com/SergioBenitez/version_check)
```
@ -761,13 +739,12 @@ SOFTWARE.
```
-------------
## MIT License: aho-corasick, byteorder, memchr, termcolor
## MIT License: aho-corasick, byteorder, memchr
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr),
[termcolor](https://github.com/BurntSushi/termcolor)
[memchr](https://github.com/BurntSushi/rust-memchr)
```
The MIT License (MIT)
@ -792,65 +769,6 @@ 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.
```
-------------
## MIT License: ansi_term
The following text applies to code linked from these dependencies:
[ansi_term](https://github.com/ogham/rust-ansi-term)
```
The MIT License (MIT)
Copyright (c) 2014 Benjamin Sago
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:
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.
```
-------------
## MIT License: atty
The following text applies to code linked from these dependencies:
[atty](https://github.com/softprops/atty)
```
Copyright (c) 2015-2019 Doug Tangren
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:
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.
```
-------------
## MIT License: bytes
@ -916,36 +834,6 @@ 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.
```
-------------
## MIT License: clap
The following text applies to code linked from these dependencies:
[clap](https://github.com/clap-rs/clap)
```
The MIT License (MIT)
Copyright (c) 2015-2016 Kevin B. Knapp
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:
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.
```
-------------
## MIT License: h2
@ -1045,14 +933,13 @@ THE SOFTWARE.
```
-------------
## MIT License: libsqlite3-sys, rusqlite
## MIT License: libsqlite3-sys
The following text applies to code linked from these dependencies:
[libsqlite3-sys](https://github.com/jgallagher/rusqlite),
[rusqlite](https://github.com/jgallagher/rusqlite)
[libsqlite3-sys](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
Copyright (c) 2014-2020 The rusqlite developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -1167,32 +1054,31 @@ THE SOFTWARE.
```
-------------
## MIT License: nom
## MIT License: rusqlite
The following text applies to code linked from these dependencies:
[nom](https://github.com/Geal/nom)
[rusqlite](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014-2019 Geoffroy Couprie
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
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:
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:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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.
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.
```
-------------
@ -1228,38 +1114,6 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: strsim
The following text applies to code linked from these dependencies:
[strsim](https://github.com/dguo/strsim-rs)
```
The MIT License (MIT)
Copyright (c) 2015 Danny Guo
Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
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:
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.
```
-------------
## MIT License: synstructure
@ -1276,36 +1130,6 @@ The above copyright notice and this permission notice shall be included in all c
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.
```
-------------
## MIT License: textwrap
The following text applies to code linked from these dependencies:
[textwrap](https://github.com/mgeisler/textwrap)
```
MIT License
Copyright (c) 2016 Martin Geisler
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:
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.
```
-------------
## MIT License: tokio, tokio-tls, tokio-util
@ -1435,34 +1259,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```
-------------
## MIT License: which
The following text applies to code linked from these dependencies:
[which](https://github.com/harryfei/which-rs.git)
```
Copyright (c) 2015 fangyuanziti
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:
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.
```
-------------
## CC0-1.0 License: base16
@ -1593,27 +1389,6 @@ express Statement of Purpose.
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
```
-------------
## ISC License: libloading
The following text applies to code linked from these dependencies:
[libloading](https://github.com/nagisa/rust_libloading/)
```
Copyright © 2015, Simonas Kazlauskas
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
```
-------------
## ISC License: ring
@ -1637,44 +1412,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
-------------
## BSD-3-Clause License: bindgen
The following text applies to code linked from these dependencies:
[bindgen](https://github.com/rust-lang/rust-bindgen)
```
BSD 3-Clause License
Copyright (c) 2013, Jyun-Yan You
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
-------------
## BSD-3-Clause License: sqlcipher

Просмотреть файл

@ -130,11 +130,11 @@ class FxAccountManagerTests: XCTestCase {
func testAccountNotFound() {
let mgr = mockFxAManager()
let initDone = XCTestExpectation(description: "Initialization done")
let initDone = expectation(description: "Initialization done")
mgr.initialize { _ in
initDone.fulfill()
}
wait(for: [initDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
let account = mgr.account as! MockFxAccount
let constellation = mgr.constellation as! MockDeviceConstellation
@ -151,11 +151,10 @@ class FxAccountManagerTests: XCTestCase {
expectation(forNotification: .accountAuthenticated, object: nil, handler: nil)
expectation(forNotification: .accountProfileUpdate, object: nil, handler: nil)
let initDone = XCTestExpectation(description: "Initialization done")
let initDone = expectation(description: "Initialization done")
mgr.initialize { _ in
initDone.fulfill()
}
wait(for: [initDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
// Fetch devices is run async, so it could happen after getProfile, hence we don't do a strict
@ -184,11 +183,10 @@ class FxAccountManagerTests: XCTestCase {
expectation(forNotification: .accountAuthenticated, object: nil, handler: nil)
expectation(forNotification: .accountProfileUpdate, object: nil, handler: nil)
let initDone = XCTestExpectation(description: "Initialization done")
let initDone = expectation(description: "Initialization done")
mgr.initialize { _ in
initDone.fulfill()
}
wait(for: [initDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
XCTAssertTrue(account.invocations.contains(MockFxAccount.MethodInvocation.registerPersistCallback))
@ -221,11 +219,10 @@ class FxAccountManagerTests: XCTestCase {
expectation(forNotification: .accountProfileUpdate, object: nil, handler: nil)
expectation(forNotification: .accountAuthProblems, object: nil, handler: nil)
let initDone = XCTestExpectation(description: "Initialization done")
let initDone = expectation(description: "Initialization done")
mgr.initialize { _ in
initDone.fulfill()
}
wait(for: [initDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
XCTAssertTrue(mgr.accountNeedsReauth())
@ -243,7 +240,7 @@ class FxAccountManagerTests: XCTestCase {
func testNewAccountLogIn() {
let mgr = mockFxAManager()
let beginAuthDone = XCTestExpectation(description: "beginAuthDone")
let beginAuthDone = expectation(description: "beginAuthDone")
var authURL: String?
mgr.initialize { _ in
mgr.beginAuthentication { url in
@ -251,16 +248,16 @@ class FxAccountManagerTests: XCTestCase {
beginAuthDone.fulfill()
}
}
wait(for: [beginAuthDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
XCTAssertEqual(authURL, "https://foo.bar/oauth?state=bobo")
let finishAuthDone = XCTestExpectation(description: "finishAuthDone")
let finishAuthDone = expectation(description: "finishAuthDone")
mgr.finishAuthentication(authData: FxaAuthData(code: "bobo", state: "bobo", actionQueryParam: "email")) { result in
if case .success = result {
finishAuthDone.fulfill()
}
}
wait(for: [finishAuthDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
let account = mgr.account! as! MockFxAccount
XCTAssertTrue(account.invocations.contains(MockFxAccount.MethodInvocation.registerPersistCallback))
@ -276,7 +273,7 @@ class FxAccountManagerTests: XCTestCase {
func testAuthStateVerification() {
let mgr = mockFxAManager()
let beginAuthDone = XCTestExpectation(description: "beginAuthDone")
let beginAuthDone = expectation(description: "beginAuthDone")
var authURL: String?
mgr.initialize { _ in
mgr.beginAuthentication { url in
@ -284,16 +281,16 @@ class FxAccountManagerTests: XCTestCase {
beginAuthDone.fulfill()
}
}
wait(for: [beginAuthDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
XCTAssertEqual(authURL, "https://foo.bar/oauth?state=bobo")
let finishAuthDone = XCTestExpectation(description: "finishAuthDone")
let finishAuthDone = expectation(description: "finishAuthDone")
mgr.finishAuthentication(authData: FxaAuthData(code: "bobo", state: "NOTBOBO", actionQueryParam: "email")) { result in
if case .failure = result {
finishAuthDone.fulfill()
}
}
wait(for: [finishAuthDone], timeout: 5)
waitForExpectations(timeout: 5, handler: nil)
}
func testProfileRecoverableAuthError() {
@ -317,12 +314,11 @@ class FxAccountManagerTests: XCTestCase {
expectation(forNotification: .accountAuthenticated, object: nil, handler: nil)
expectation(forNotification: .accountProfileUpdate, object: nil, handler: nil)
let initDone = XCTestExpectation(description: "Initialization done")
let initDone = expectation(description: "Initialization done")
mgr.initialize { _ in
initDone.fulfill()
}
wait(for: [initDone], timeout: 5)
waitForExpectations(timeout: 10, handler: nil)
waitForExpectations(timeout: 5, handler: nil)
XCTAssertFalse(mgr.accountNeedsReauth())
@ -339,13 +335,13 @@ class FxAccountManagerTests: XCTestCase {
let account = MockAccount()
mgr.storedAccount = account
let initDone = XCTestExpectation(description: "Initialization done")
let initDone = expectation(description: "Initialization done")
mgr.initialize { _ in
initDone.fulfill()
}
wait(for: [initDone], timeout: 10)
waitForExpectations(timeout: 5, handler: nil)
let tokenServerURLCorrect = XCTestExpectation(description: "Server URL is correct")
let tokenServerURLCorrect = expectation(description: "Server URL is correct")
mgr.getTokenServerEndpointURL { url in
XCTAssertEqual(
try! url.get().absoluteString,
@ -353,6 +349,6 @@ class FxAccountManagerTests: XCTestCase {
)
tokenServerURLCorrect.fulfill()
}
wait(for: [tokenServerURLCorrect], timeout: 10)
waitForExpectations(timeout: 5, handler: nil)
}
}

Просмотреть файл

@ -30,6 +30,10 @@ class MockFxAccount: FxAccount {
fatalError("init(config:) has not been implemented")
}
override func isInMigrationState() -> Bool {
return false
}
override func initializeDevice(name _: String, deviceType _: DeviceType, supportedCapabilities _: [DeviceCapability]) throws {
invocations.append(.initializeDevice)
}

Просмотреть файл

@ -6,22 +6,14 @@ the details of which are reproduced below.
* [Mozilla Public License 2.0](#mozilla-public-license-20)
* [Apache License 2.0](#apache-license-20)
* [MIT License: aho-corasick, byteorder, memchr, termcolor](#mit-license-aho-corasick-byteorder-memchr-termcolor)
* [MIT License: ansi_term](#mit-license-ansi_term)
* [MIT License: atty](#mit-license-atty)
* [MIT License: byteorder, memchr](#mit-license-byteorder-memchr)
* [MIT License: bytes](#mit-license-bytes)
* [MIT License: clap](#mit-license-clap)
* [MIT License: libsqlite3-sys, rusqlite](#mit-license-libsqlite3-sys-rusqlite)
* [MIT License: libsqlite3-sys](#mit-license-libsqlite3-sys)
* [MIT License: matches](#mit-license-matches)
* [MIT License: nom](#mit-license-nom)
* [MIT License: strsim](#mit-license-strsim)
* [MIT License: rusqlite](#mit-license-rusqlite)
* [MIT License: synstructure](#mit-license-synstructure)
* [MIT License: textwrap](#mit-license-textwrap)
* [MIT License: which](#mit-license-which)
* [CC0-1.0 License: base16](#cc0-10-license-base16)
* [ISC License: libloading](#isc-license-libloading)
* [ISC License: ring](#isc-license-ring)
* [BSD-3-Clause License: bindgen](#bsd-3-clause-license-bindgen)
* [BSD-3-Clause License: protobuf](#bsd-3-clause-license-protobuf)
* [BSD-3-Clause License: sqlcipher](#bsd-3-clause-license-sqlcipher)
* [Optional Notice: SQLite](#optional-notice-sqlite)
@ -417,68 +409,50 @@ The following text applies to code linked from these dependencies:
[anyhow](https://github.com/dtolnay/anyhow),
[backtrace-sys](https://github.com/alexcrichton/backtrace-rs),
[backtrace](https://github.com/rust-lang/backtrace-rs),
[base64](https://github.com/alicemaz/rust-base64),
[base64](https://github.com/marshallpierce/rust-base64),
[bitflags](https://github.com/bitflags/bitflags),
[cc](https://github.com/alexcrichton/cc-rs),
[cexpr](https://github.com/jethrogb/rust-cexpr),
[cfg-if](https://github.com/alexcrichton/cfg-if),
[clang-sys](https://github.com/KyleMayes/clang-sys),
[either](https://github.com/bluss/either),
[env_logger](https://github.com/sebasmagri/env_logger/),
[failure](https://github.com/rust-lang-nursery/failure),
[failure_derive](https://github.com/rust-lang-nursery/failure),
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[hex](https://github.com/KokaKiwi/rust-hex),
[humantime](https://github.com/tailhook/humantime),
[idna](https://github.com/servo/rust-url/),
[itertools](https://github.com/bluss/rust-itertools),
[itoa](https://github.com/dtolnay/itoa),
[jna](https://github.com/java-native-access/jna),
[lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs),
[lazycell](https://github.com/indiv0/lazycell),
[libc](https://github.com/rust-lang/libc),
[linked-hash-map](https://github.com/contain-rs/linked-hash-map),
[log](https://github.com/rust-lang/log),
[lru-cache](https://github.com/contain-rs/lru-cache),
[once_cell](https://github.com/matklad/once_cell),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[pkg-config](https://github.com/rust-lang/pkg-config-rs),
[ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion),
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-derive](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
[rand](https://github.com/rust-random/rand),
[rand_chacha](https://github.com/rust-random/rand),
[rand_core](https://github.com/rust-random/rand),
[regex-syntax](https://github.com/rust-lang/regex),
[regex](https://github.com/rust-lang/regex),
[rustc-demangle](https://github.com/alexcrichton/rustc-demangle),
[rustc-hash](https://github.com/rust-lang-nursery/rustc-hash),
[ryu](https://github.com/dtolnay/ryu),
[serde](https://github.com/serde-rs/serde),
[serde_derive](https://github.com/serde-rs/serde),
[serde_json](https://github.com/serde-rs/json),
[shlex](https://github.com/comex/rust-shlex),
[smallvec](https://github.com/servo/rust-smallvec),
[syn](https://github.com/dtolnay/syn),
[thread_local](https://github.com/Amanieu/thread_local-rs),
[time](https://github.com/rust-lang/time),
[toml](https://github.com/alexcrichton/toml-rs),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),
[vec_map](https://github.com/contain-rs/vec-map),
[version_check](https://github.com/SergioBenitez/version_check),
[winapi-x86_64-pc-windows-gnu](https://github.com/retep998/winapi-rs),
[winapi](https://github.com/retep998/winapi-rs)
@ -687,13 +661,11 @@ limitations under the License.
```
-------------
## MIT License: aho-corasick, byteorder, memchr, termcolor
## MIT License: byteorder, memchr
The following text applies to code linked from these dependencies:
[aho-corasick](https://github.com/BurntSushi/aho-corasick),
[byteorder](https://github.com/BurntSushi/byteorder),
[memchr](https://github.com/BurntSushi/rust-memchr),
[termcolor](https://github.com/BurntSushi/termcolor)
[memchr](https://github.com/BurntSushi/rust-memchr)
```
The MIT License (MIT)
@ -718,65 +690,6 @@ 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.
```
-------------
## MIT License: ansi_term
The following text applies to code linked from these dependencies:
[ansi_term](https://github.com/ogham/rust-ansi-term)
```
The MIT License (MIT)
Copyright (c) 2014 Benjamin Sago
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:
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.
```
-------------
## MIT License: atty
The following text applies to code linked from these dependencies:
[atty](https://github.com/softprops/atty)
```
Copyright (c) 2015-2019 Doug Tangren
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:
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.
```
-------------
## MIT License: bytes
@ -813,44 +726,13 @@ DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: clap
## MIT License: libsqlite3-sys
The following text applies to code linked from these dependencies:
[clap](https://github.com/clap-rs/clap)
[libsqlite3-sys](https://github.com/jgallagher/rusqlite)
```
The MIT License (MIT)
Copyright (c) 2015-2016 Kevin B. Knapp
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:
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.
```
-------------
## MIT License: libsqlite3-sys, rusqlite
The following text applies to code linked from these dependencies:
[libsqlite3-sys](https://github.com/jgallagher/rusqlite),
[rusqlite](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
Copyright (c) 2014-2020 The rusqlite developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -906,120 +788,13 @@ DEALINGS IN THE SOFTWARE.
```
-------------
## MIT License: nom
## MIT License: rusqlite
The following text applies to code linked from these dependencies:
[nom](https://github.com/Geal/nom)
[rusqlite](https://github.com/jgallagher/rusqlite)
```
Copyright (c) 2014-2019 Geoffroy Couprie
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:
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.
```
-------------
## MIT License: strsim
The following text applies to code linked from these dependencies:
[strsim](https://github.com/dguo/strsim-rs)
```
The MIT License (MIT)
Copyright (c) 2015 Danny Guo
Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>
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:
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.
```
-------------
## MIT License: synstructure
The following text applies to code linked from these dependencies:
[synstructure](https://github.com/mystor/synstructure)
```
Copyright 2016 Nika Layzell
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:
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.
```
-------------
## MIT License: textwrap
The following text applies to code linked from these dependencies:
[textwrap](https://github.com/mgeisler/textwrap)
```
MIT License
Copyright (c) 2016 Martin Geisler
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:
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.
```
-------------
## MIT License: which
The following text applies to code linked from these dependencies:
[which](https://github.com/harryfei/which-rs.git)
```
Copyright (c) 2015 fangyuanziti
Copyright (c) 2014 John Gallagher <johnkgallagher@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -1039,6 +814,22 @@ 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.
```
-------------
## MIT License: synstructure
The following text applies to code linked from these dependencies:
[synstructure](https://github.com/mystor/synstructure)
```
Copyright 2016 Nika Layzell
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:
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.
```
-------------
## CC0-1.0 License: base16
@ -1169,27 +960,6 @@ express Statement of Purpose.
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
```
-------------
## ISC License: libloading
The following text applies to code linked from these dependencies:
[libloading](https://github.com/nagisa/rust_libloading/)
```
Copyright © 2015, Simonas Kazlauskas
Permission to use, copy, modify, and/or distribute this software for any purpose with or without
fee is hereby granted, provided that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
```
-------------
## ISC License: ring
@ -1213,44 +983,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
-------------
## BSD-3-Clause License: bindgen
The following text applies to code linked from these dependencies:
[bindgen](https://github.com/rust-lang/rust-bindgen)
```
BSD 3-Clause License
Copyright (c) 2013, Jyun-Yan You
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
-------------
## BSD-3-Clause License: protobuf

Просмотреть файл

@ -32,14 +32,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: backtrace-sys</name>
<url>https://github.com/rust-lang/backtrace-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: base64</name>
<url>https://github.com/alicemaz/rust-base64/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: base64</name>
<url>https://github.com/marshallpierce/rust-base64/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: base64</name>
<url>https://github.com/marshallpierce/rust-base64/blob/master/LICENSE-APACHE</url>
@ -52,26 +44,14 @@ the details of which are reproduced below.
<name>Apache License 2.0: cc</name>
<url>https://github.com/alexcrichton/cc-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: cexpr</name>
<url>https://github.com/jethrogb/rust-cexpr/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: cfg-if</name>
<url>https://github.com/alexcrichton/cfg-if/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: clang-sys</name>
<url>https://github.com/KyleMayes/clang-sys/blob/master/LICENSE.txt</url>
</license>
<license>
<name>Apache License 2.0: either</name>
<url>https://github.com/bluss/either/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: env_logger</name>
<url>https://github.com/sebasmagri/env_logger/blob//master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: failure</name>
<url>https://github.com/rust-lang-nursery/failure/blob/master/LICENSE-APACHE</url>
@ -96,18 +76,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: getrandom</name>
<url>https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: glob</name>
<url>https://github.com/rust-lang/glob/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: hex</name>
<url>https://github.com/KokaKiwi/rust-hex/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: humantime</name>
<url>https://github.com/tailhook/humantime/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: idna</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
@ -128,10 +100,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: lazy_static</name>
<url>https://github.com/rust-lang-nursery/lazy-static.rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: lazycell</name>
<url>https://github.com/indiv0/lazycell/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: libc</name>
<url>https://github.com/rust-lang/libc/blob/master/LICENSE-APACHE</url>
@ -152,10 +120,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: once_cell</name>
<url>https://github.com/matklad/once_cell/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: peeking_take_while</name>
<url>https://github.com/fitzgen/peeking_take_while/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: percent-encoding</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
@ -180,10 +144,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: prost-derive</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: quick-error</name>
<url>https://github.com/tailhook/quick-error/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: quote</name>
<url>https://github.com/dtolnay/quote/blob/master/LICENSE-APACHE</url>
@ -200,22 +160,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: rand_core</name>
<url>https://github.com/rust-random/rand/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: regex</name>
<url>https://github.com/rust-lang/regex/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: regex-syntax</name>
<url>https://github.com/rust-lang/regex/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: rustc-demangle</name>
<url>https://github.com/alexcrichton/rustc-demangle/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: rustc-hash</name>
<url>https://github.com/rust-lang-nursery/rustc-hash/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: ryu</name>
<url>https://github.com/dtolnay/ryu/blob/master/LICENSE-APACHE</url>
@ -232,10 +180,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: serde_json</name>
<url>https://github.com/serde-rs/json/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: shlex</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
<license>
<name>Apache License 2.0: smallvec</name>
<url>https://github.com/servo/rust-smallvec/blob/master/LICENSE-APACHE</url>
@ -244,18 +188,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: syn</name>
<url>https://github.com/dtolnay/syn/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: thread_local</name>
<url>https://github.com/Amanieu/thread_local-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: time</name>
<url>https://github.com/time-rs/time/blob/master/LICENSE-Apache</url>
</license>
<license>
<name>Apache License 2.0: toml</name>
<url>https://github.com/alexcrichton/toml-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-bidi</name>
<url>https://github.com/servo/unicode-bidi/blob/master/LICENSE-APACHE</url>
@ -264,10 +200,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: unicode-normalization</name>
<url>https://github.com/unicode-rs/unicode-normalization/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-width</name>
<url>https://github.com/unicode-rs/unicode-width/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-xid</name>
<url>https://github.com/unicode-rs/unicode-xid/blob/master/LICENSE-APACHE</url>
@ -276,14 +208,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: url</name>
<url>https://github.com/servo/rust-url/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: vec_map</name>
<url>https://github.com/contain-rs/vec-map/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: version_check</name>
<url>https://github.com/SergioBenitez/version_check/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: winapi</name>
<url>https://github.com/retep998/winapi-rs/blob/master/LICENSE-MIT</url>
@ -292,10 +216,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: winapi-x86_64-pc-windows-gnu</name>
<url>https://github.com/retep998/winapi-rs/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>MIT License: aho-corasick</name>
<url>https://github.com/BurntSushi/aho-corasick/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: byteorder</name>
<url>https://github.com/BurntSushi/byteorder/blob/master/LICENSE-MIT</url>
@ -304,74 +224,34 @@ the details of which are reproduced below.
<name>MIT License: memchr</name>
<url>https://github.com/BurntSushi/rust-memchr/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: termcolor</name>
<url>https://github.com/BurntSushi/termcolor/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: ansi_term</name>
<url>https://github.com/ogham/rust-ansi-term/blob/master/LICENCE</url>
</license>
<license>
<name>MIT License: atty</name>
<url>https://github.com/softprops/atty/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: bytes</name>
<url>https://github.com/tokio-rs/bytes/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: clap</name>
<url>https://github.com/clap-rs/clap/blob/master/LICENSE-MIT</url>
</license>
<license>
<name>MIT License: libsqlite3-sys</name>
<url>https://github.com/jgallagher/rusqlite/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: rusqlite</name>
<url>https://github.com/jgallagher/rusqlite/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: matches</name>
<url>https://github.com/SimonSapin/rust-std-candidates/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: nom</name>
<url>https://github.com/Geal/nom/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: strsim</name>
<url>https://github.com/dguo/strsim-rs/blob/master/LICENSE</url>
<name>MIT License: rusqlite</name>
<url>https://github.com/jgallagher/rusqlite/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: synstructure</name>
<url>https://github.com/mystor/synstructure/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: textwrap</name>
<url>https://github.com/mgeisler/textwrap/blob/master/LICENSE</url>
</license>
<license>
<name>MIT License: which</name>
<url>https://github.com/harryfei/which-rs/blob/master/LICENSE.txt</url>
</license>
<license>
<name>CC0-1.0 License: base16</name>
<url>https://github.com/thomcc/rust-base16/blob/master/LICENSE-CC0</url>
</license>
<license>
<name>ISC License: libloading</name>
<url>https://github.com/nagisa/rust_libloading/blob//master/LICENSE</url>
</license>
<license>
<name>ISC License: ring</name>
<url>https://github.com/briansmith/ring/blob/master/LICENSE</url>
</license>
<license>
<name>BSD-3-Clause License: bindgen</name>
<url>https://github.com/rust-lang/rust-bindgen/blob/master/LICENSE</url>
</license>
<license>
<name>BSD-3-Clause License: protobuf</name>
<url>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</url>

Просмотреть файл

@ -9,11 +9,6 @@ def libProjectName = properties.libProjectName
def libUrl = properties.libUrl
def libVcsUrl = properties.libVcsUrl
static def getLocalPublicationTimestamp() {
def date = new Date()
return date.format('yyyyMMddHHmmss')
}
// `jnaForTestConfiguration` is a hacky way to say yes, I'm using JNA and want
// to pack the JNA dispatch libraries and my Rust libraries into a single JAR
// for use in unit tests that run on a development host (and not an Android
@ -117,7 +112,7 @@ ext.configurePublish = { jnaForTestConfiguration = null ->
// For mavenLocal publishing workflow, increment the version number every publish.
// We only do this to the .pom file and not in $MEGAZORD_VERSION, because otherwise we
// would need to rebuild the megazord .so on every publish, even if nothing else had changed.
version = rootProject.ext.library.version + (rootProject.hasProperty('local') ? '-' + getLocalPublicationTimestamp() : '')
version = rootProject.ext.library.version + (rootProject.hasProperty('local') ? '-' + rootProject.property('local') : '')
packaging = "aar"
license {
@ -164,7 +159,7 @@ ext.configurePublish = { jnaForTestConfiguration = null ->
artifactId = "${theArtifactId}-forUnitTests"
description = theDescription
// For mavenLocal publishing workflow, increment the version number every publish.
version = rootProject.ext.library.version + (rootProject.hasProperty('local') ? '-' + getLocalPublicationTimestamp() : '')
version = rootProject.ext.library.version + (rootProject.hasProperty('local') ? '-' + rootProject.property('local') : '')
packaging = "jar"
licenses {

Просмотреть файл

@ -50,11 +50,11 @@ export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_APPLE_DARWIN_AR=/tmp
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_APPLE_DARWIN_RANLIB=/tmp/cctools/bin/x86_64-darwin11-ranlib
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_APPLE_DARWIN_LD_LIBRARY_PATH=/tmp/clang/lib
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS="-C linker=/tmp/clang/bin/clang -C link-arg=-B -C link-arg=/tmp/cctools/bin -C link-arg=-target -C link-arg=x86_64-darwin11 -C link-arg=-isysroot -C link-arg=/tmp/MacOSX10.11.sdk -C link-arg=-Wl,-syslibroot,/tmp/MacOSX10.11.sdk -C link-arg=-Wl,-dead_strip"
# For ring's use of `cc`.
# For ring's use of `cc`.
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_APPLE_DARWIN_CFLAGS_x86_64_apple_darwin="-B /tmp/cctools/bin -target x86_64-darwin11 -isysroot /tmp/MacOSX10.11.sdk -Wl,-syslibroot,/tmp/MacOSX10.11.sdk -Wl,-dead_strip"
# The wrong linker gets used otherwise: https://github.com/rust-lang/rust/issues/33465.
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS="-C linker=x86_64-w64-mingw32-gcc"
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_PC_WINDOWS_GNU_AR=x86_64-w64-mingw32-ar
export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_X86_64_PC_WINDOWS_GNU_CC=x86_64-w64-mingw32-gcc
# Install clang, a port of cctools, and the macOS SDK into /tmp. This
# is all cribbed from mozilla-central; start at

Просмотреть файл

@ -1,6 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# ⚠️ If you add, rename or delete a job here, please also update .mergify.yml! ⚠️
---
loader: taskgraph.loader.transform:loader
@ -26,7 +28,7 @@ jobs:
- project:releng:services/tooltool/api/download/internal
worker-type: b-linux
worker:
docker-image: {in-tree: linux}
docker-image: { in-tree: linux }
max-run-time: 1800
script: |
rsync -a /builds/worker/fetches/libs/ /builds/worker/checkouts/src/libs/
@ -36,7 +38,7 @@ jobs:
./gradlew --no-daemon testDebug
run:
using: run-task
cwd: '{checkout}'
cwd: "{checkout}"
fetches:
toolchain:
- android-libs

Просмотреть файл

@ -1,6 +1,8 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# ⚠️ If you add, rename or delete a job here, please also update .mergify.yml! ⚠️
---
loader: taskgraph.loader.transform:loader
@ -11,18 +13,18 @@ transforms:
job-defaults:
worker-type: b-linux
worker:
docker-image: {in-tree: linux}
docker-image: { in-tree: linux }
max-run-time: 1800
run:
using: run-task
cwd: '{checkout}'
cwd: "{checkout}"
jobs:
detekt:
description: 'detekt'
description: "detekt"
run:
command: ./gradlew --no-daemon clean detekt
ktlint:
description: 'ktlint'
description: "ktlint"
run:
command: ./gradlew --no-daemon clean ktlint

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше