rbthemis 0.13.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbthemis.rb +46 -3
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 737ccca2cb74d04c18abe43c4aa5ee65def9cef6c0d3bcd89410c76abf12e7fa
|
4
|
+
data.tar.gz: ce08155c7d83bbda14acc0a79185b7943b1ee6d39c28a28c99b92082accf216e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a60a03fbd1947834c2cce2399f1c58ef71c1714feed534bd4cfe9f6445036eb1824bed92e60900249f89e785532d1d6233625c64b95309e19b16c27bfddb85d5
|
7
|
+
data.tar.gz: ffd1759217dab678e0554aa30566feaec18bbcc6e7b172072f1d77b101d1e95bac0d502db9d6fe971d41bd2770bf27eaddae7fb773c39265fedaf39020c7d4ff
|
data/lib/rbthemis.rb
CHANGED
@@ -32,7 +32,50 @@ end
|
|
32
32
|
|
33
33
|
module ThemisImport
|
34
34
|
extend FFI::Library
|
35
|
-
|
35
|
+
|
36
|
+
def self.canonical_themis_paths
|
37
|
+
host_os = RbConfig::CONFIG['host_os']
|
38
|
+
paths = []
|
39
|
+
if host_os.start_with? 'linux'
|
40
|
+
# Default library installation path for "make install"
|
41
|
+
paths.append '/usr/local/lib/libthemis.so.0'
|
42
|
+
# Don't bother figuring out the "right" absolute path, since
|
43
|
+
# that depends on the distro and non-distro-provided Rubies
|
44
|
+
# don't know about the right paths at all. The ones installed
|
45
|
+
# via RVM certainly don't. Use soname and let ld figure it out.
|
46
|
+
paths.append 'libthemis.so.0'
|
47
|
+
end
|
48
|
+
if host_os.start_with? 'darwin'
|
49
|
+
# Default library installation path for "make install"
|
50
|
+
paths.append '/usr/local/lib/libthemis.0.dylib'
|
51
|
+
# These are install names of libraries installed via Homebrew
|
52
|
+
# Add both M1 and Intel paths so that x86 Ruby works on M1
|
53
|
+
paths.append '/opt/homebrew/opt/libthemis/lib/libthemis.0.dylib'
|
54
|
+
paths.append '/usr/local/opt/libthemis/lib/libthemis.0.dylib'
|
55
|
+
# Last try, look for ABI-qualified name
|
56
|
+
paths.append 'libthemis.0.dylib'
|
57
|
+
end
|
58
|
+
return paths
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.load_themis
|
62
|
+
for path in canonical_themis_paths
|
63
|
+
begin
|
64
|
+
return ffi_lib path
|
65
|
+
rescue LoadError
|
66
|
+
next
|
67
|
+
end
|
68
|
+
end
|
69
|
+
warn <<~EOF
|
70
|
+
WARN: failed to load the canonical Themis Core library
|
71
|
+
|
72
|
+
Proceeding to find 'themis' library in standard paths.
|
73
|
+
This might cause ABI mismatch and crash the process.
|
74
|
+
EOF
|
75
|
+
return ffi_lib 'themis'
|
76
|
+
end
|
77
|
+
|
78
|
+
load_themis
|
36
79
|
|
37
80
|
callback :get_pub_key_by_id_type,
|
38
81
|
[:pointer, :int, :pointer, :int, :pointer], :int
|
@@ -274,7 +317,7 @@ module Themis
|
|
274
317
|
@session = secure_session_create(
|
275
318
|
id_buf, id_length, private_key_buf, private_key_length, @callbacks)
|
276
319
|
|
277
|
-
raise ThemisError, 'Secure Session failed creating'
|
320
|
+
raise ThemisError, 'Secure Session failed creating' if @session.null?
|
278
321
|
end
|
279
322
|
|
280
323
|
def is_established
|
@@ -925,7 +968,7 @@ module Themis
|
|
925
968
|
shared_secret_buf, shared_secret_length =
|
926
969
|
string_to_pointer_size(shared_secret)
|
927
970
|
@comparator = secure_comparator_create
|
928
|
-
raise ThemisError, 'Secure Comparator failed creating'
|
971
|
+
raise ThemisError, 'Secure Comparator failed creating' if @comparator.null?
|
929
972
|
res = secure_comparator_append_secret(
|
930
973
|
@comparator, shared_secret_buf, shared_secret_length)
|
931
974
|
if res != SUCCESS
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbthemis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CossackLabs
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -44,7 +44,7 @@ homepage: http://cossacklabs.com/
|
|
44
44
|
licenses:
|
45
45
|
- Apache-2.0
|
46
46
|
metadata: {}
|
47
|
-
post_install_message:
|
47
|
+
post_install_message:
|
48
48
|
rdoc_options: []
|
49
49
|
require_paths:
|
50
50
|
- lib
|
@@ -59,9 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
requirements:
|
62
|
-
- libthemis, v0.
|
63
|
-
rubygems_version: 3.
|
64
|
-
signing_key:
|
62
|
+
- libthemis, v0.15.0
|
63
|
+
rubygems_version: 3.3.25
|
64
|
+
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: Data security library for network communication and data storage for Ruby
|
67
67
|
test_files: []
|