ring-native 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/lib/ring/native/version.rb +1 -1
- metadata +1 -6
- data/vendor/ring-ffi/Cargo.lock +0 -26
- data/vendor/ring-ffi/Cargo.toml +0 -45
- data/vendor/ring-ffi/LICENSE +0 -16
- data/vendor/ring-ffi/README.md +0 -59
- data/vendor/ring-ffi/src/lib.rs +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6ea3a89e74d9cf6d5bf325b70eef6c5cede25b8
|
4
|
+
data.tar.gz: 007a446b32f1a224d8ae2548c53dd4377b1d00de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be24feb1d7c63b69a7bac91f769068417fbe1b1774247a3f2dc2cadd1045bc0effefd55ac89465f160a34ba714211ab561e05e152b8eea14b6b62471525ef137
|
7
|
+
data.tar.gz: 61bfc3f33e967ccc041163e60a66e1fb2d6ef99c5d8650cec3a06a2f060611f161276c501224b4242e83aeb07755405278f5853aa831bc1b002a4f1f670be9d7
|
data/CHANGES.md
CHANGED
data/lib/ring/native/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ring-native
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
@@ -56,11 +56,6 @@ files:
|
|
56
56
|
- lib/ring/native.rb
|
57
57
|
- lib/ring/native/version.rb
|
58
58
|
- ring-native.gemspec
|
59
|
-
- vendor/ring-ffi/Cargo.lock
|
60
|
-
- vendor/ring-ffi/Cargo.toml
|
61
|
-
- vendor/ring-ffi/LICENSE
|
62
|
-
- vendor/ring-ffi/README.md
|
63
|
-
- vendor/ring-ffi/src/lib.rs
|
64
59
|
homepage: https://github.com/cryptosphere/ruby-ring
|
65
60
|
licenses:
|
66
61
|
- OpenSSL
|
data/vendor/ring-ffi/Cargo.lock
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
[root]
|
2
|
-
name = "ring-ffi"
|
3
|
-
version = "0.1.0"
|
4
|
-
dependencies = [
|
5
|
-
"ring 0.1.0 (git+https://github.com/briansmith/ring)",
|
6
|
-
]
|
7
|
-
|
8
|
-
[[package]]
|
9
|
-
name = "num"
|
10
|
-
version = "0.1.30"
|
11
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
12
|
-
|
13
|
-
[[package]]
|
14
|
-
name = "ring"
|
15
|
-
version = "0.1.0"
|
16
|
-
source = "git+https://github.com/briansmith/ring#c882c2c3ec837f14267991122dc20e6aba5700bc"
|
17
|
-
dependencies = [
|
18
|
-
"num 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
19
|
-
"rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
|
20
|
-
]
|
21
|
-
|
22
|
-
[[package]]
|
23
|
-
name = "rustc-serialize"
|
24
|
-
version = "0.3.16"
|
25
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
26
|
-
|
data/vendor/ring-ffi/Cargo.toml
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# Copyright 2015 Brian Smith.
|
2
|
-
#
|
3
|
-
# Permission to use, copy, modify, and/or distribute this software for any
|
4
|
-
# purpose with or without fee is hereby granted, provided that the above
|
5
|
-
# copyright notice and this permission notice appear in all copies.
|
6
|
-
#
|
7
|
-
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
|
8
|
-
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
9
|
-
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
10
|
-
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
11
|
-
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
12
|
-
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13
|
-
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14
|
-
|
15
|
-
[package]
|
16
|
-
authors = ["Brian Smith <brian@briansmith.org>"]
|
17
|
-
description = "FFI wrapper for *ring* to be used by non-Rust code."
|
18
|
-
license-file = "LICENSE"
|
19
|
-
name = "ring-ffi"
|
20
|
-
readme = "README.md"
|
21
|
-
repository = "https://github.com/briansmith/ring-ffi"
|
22
|
-
version = "0.1.0"
|
23
|
-
|
24
|
-
[lib]
|
25
|
-
name = "ringffi"
|
26
|
-
crate-type = ["dylib"]
|
27
|
-
|
28
|
-
[dependencies.ring]
|
29
|
-
git = "https://github.com/briansmith/ring"
|
30
|
-
|
31
|
-
[profile.bench]
|
32
|
-
opt-level = 3
|
33
|
-
debug = false
|
34
|
-
rpath = false
|
35
|
-
lto = true
|
36
|
-
debug-assertions = false
|
37
|
-
codegen-units = 1
|
38
|
-
|
39
|
-
[profile.release]
|
40
|
-
opt-level = 3
|
41
|
-
debug = false
|
42
|
-
rpath = false
|
43
|
-
lto = true
|
44
|
-
debug-assertions = false
|
45
|
-
codegen-units = 1
|
data/vendor/ring-ffi/LICENSE
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
Except as otherwise noted, this project is licensed under the following
|
2
|
-
(ISC-style) terms:
|
3
|
-
|
4
|
-
Copyright 2016 Brian Smith.
|
5
|
-
|
6
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
7
|
-
purpose with or without fee is hereby granted, provided that the above
|
8
|
-
copyright notice and this permission notice appear in all copies.
|
9
|
-
|
10
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
|
11
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
12
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
13
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
14
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
15
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
16
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
data/vendor/ring-ffi/README.md
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND BRIAN SMITH AND THE AUTHORS DISCLAIM
|
2
|
-
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
3
|
-
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL BRIAN SMITH OR THE AUTHORS
|
4
|
-
BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
|
5
|
-
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
6
|
-
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
7
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
ring-ffi
|
12
|
-
========
|
13
|
-
|
14
|
-
[*ring*](https://github.com/briansmith/ring) is a crypto library in Rust based
|
15
|
-
on BoringSSL's crypto primitive implementations.
|
16
|
-
|
17
|
-
ring-ffi is a wrapper around *ring* that packages it in a shared library with a
|
18
|
-
libffi-compatible API. The goal is to use ring-ffi as the foundation for
|
19
|
-
*ring* bindings to Ruby, Python, Node.js, etc.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Language Bindings Being Developed
|
24
|
-
---------------------------------
|
25
|
-
|
26
|
-
Language | Bindings
|
27
|
-
------------ | --------
|
28
|
-
Ruby | [ruby-ring](https://github.com/cryptosphere/ruby-ring)
|
29
|
-
Rust | Just use the native [*ring*](https://github.com/briansmith/ring) API.
|
30
|
-
Python | [cryptography-ring](https://github.com/reaperhulk/cryptography-ring)
|
31
|
-
|
32
|
-
|
33
|
-
Contributing
|
34
|
-
------------
|
35
|
-
|
36
|
-
Patches Welcome! Suggestions:
|
37
|
-
|
38
|
-
* Map more *ring* functionality to the libffi-compatible API.
|
39
|
-
* Improve the bindings for existing languages.
|
40
|
-
* Create bindings for new languages. (If you do so, please send a PR here to
|
41
|
-
add your binding to the table above.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
License
|
46
|
-
-------
|
47
|
-
|
48
|
-
See [LICENSE](LICENSE).
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
Bug Reporting
|
53
|
-
-------------
|
54
|
-
|
55
|
-
Please file bugs in the
|
56
|
-
[issue tracker](https://github.com/briansmith/ring-ffi/issues). Yes, even
|
57
|
-
security vulnerabilities should be reported in the public issue tracker. **Do
|
58
|
-
NOT report any security vulnerability privately to
|
59
|
-
the *ring-ffi* developers.**
|
data/vendor/ring-ffi/src/lib.rs
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
extern crate ring;
|
2
|
-
|
3
|
-
/// Moves `x` onto the heap and returns a mutable pointer to it.
|
4
|
-
fn heap_mut_ptr<T>(x: T) -> *mut T {
|
5
|
-
Box::into_raw(Box::new(x))
|
6
|
-
}
|
7
|
-
|
8
|
-
/// Clones `*x` onto the heap and returns a mutable pointer to it.
|
9
|
-
unsafe fn clone_heap_mut_ptr<T: Clone>(x: *const T) -> *mut T {
|
10
|
-
heap_mut_ptr((*x).clone())
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
macro_rules! wrap_algorithm {
|
15
|
-
( $wrapper_name:ident, $t:ty, $alg:expr ) => {
|
16
|
-
/// Do NOT free the resulting pointer.
|
17
|
-
#[no_mangle]
|
18
|
-
pub unsafe fn $wrapper_name() -> *const $t {
|
19
|
-
$alg as *const $t
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
wrap_algorithm!(ring_digest_algorithm_sha1, ring::digest::Algorithm,
|
25
|
-
&ring::digest::SHA1);
|
26
|
-
wrap_algorithm!(ring_digest_algorithm_sha256, ring::digest::Algorithm,
|
27
|
-
&ring::digest::SHA256);
|
28
|
-
wrap_algorithm!(ring_digest_algorithm_sha384, ring::digest::Algorithm,
|
29
|
-
&ring::digest::SHA384);
|
30
|
-
wrap_algorithm!(ring_digest_algorithm_sha512, ring::digest::Algorithm,
|
31
|
-
&ring::digest::SHA512);
|
32
|
-
|
33
|
-
/// Returns a pointer to a heap-allocated `ring::digest::Context`. You must
|
34
|
-
/// call `ring_digest_context_finish` to free the returned context.
|
35
|
-
#[no_mangle]
|
36
|
-
pub unsafe fn ring_digest_context_new(algorithm: *const ring::digest::Algorithm)
|
37
|
-
-> *mut ring::digest::Context {
|
38
|
-
if algorithm.is_null() {
|
39
|
-
return std::ptr::null_mut();
|
40
|
-
}
|
41
|
-
heap_mut_ptr(ring::digest::Context::new(&*algorithm))
|
42
|
-
}
|
43
|
-
|
44
|
-
/// Calls `ctx.update()` with the given data.
|
45
|
-
#[no_mangle]
|
46
|
-
pub unsafe fn ring_digest_context_update(ctx: *mut ring::digest::Context,
|
47
|
-
p: *const u8, len: usize) {
|
48
|
-
(*ctx).update(std::slice::from_raw_parts(p, len))
|
49
|
-
}
|
50
|
-
|
51
|
-
/// Frees a context created by `ring_digest_context_new`.
|
52
|
-
#[no_mangle]
|
53
|
-
pub unsafe fn ring_digest_context_finish(ctx: *mut ring::digest::Context,
|
54
|
-
out: *mut u8, out_capacity: usize)
|
55
|
-
-> usize {
|
56
|
-
// We can't call `finish` on (*ctx). `x.finish()` consumes `x` but in the
|
57
|
-
// FFI interface we can't rely on the caller honoring Rust's move semantics.
|
58
|
-
let copy = (*ctx).clone();
|
59
|
-
let digest = copy.finish();
|
60
|
-
let digest = digest.as_ref();
|
61
|
-
let len = digest.len();
|
62
|
-
if len > out_capacity {
|
63
|
-
return 0;
|
64
|
-
}
|
65
|
-
std::ptr::copy_nonoverlapping(digest.as_ptr(), out, len);
|
66
|
-
len
|
67
|
-
}
|
68
|
-
|
69
|
-
#[no_mangle]
|
70
|
-
pub unsafe fn ring_digest_context_delete(ctx: *mut ring::digest::Context) {
|
71
|
-
let _ = Box::from_raw(ctx);
|
72
|
-
}
|
73
|
-
|
74
|
-
/// Clones a digest context, returning a pointer to the clone.
|
75
|
-
#[no_mangle]
|
76
|
-
pub unsafe fn ring_digest_context_clone(ctx: *mut ring::digest::Context)
|
77
|
-
-> *mut ring::digest::Context {
|
78
|
-
clone_heap_mut_ptr(ctx)
|
79
|
-
}
|