sodium 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +7 -0
- data/VERSION +1 -1
- data/lib/sodium/buffer.rb +4 -2
- data/test/sodium/buffer_test.rb +5 -0
- metadata +159 -154
- metadata.gz.sig +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 78e522608067ad41100d667ad325f27b3016bb02
|
4
|
+
data.tar.gz: 3db35e3676ad4a17184ece41461a0b7050eaed00
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a951116717495c9839c57b1a4425de8fae8b24989b2c98c847b0f8e98dd71aa8e8b52898f93e1a0a0e6a007f2a3a4cfc12950966152e91f18bb92a4da14a124a
|
7
|
+
data.tar.gz: b80e67c8931742b074d171174189417ba6a72df46e9fca4b68090a50494a8c3f0ca272941d177bb1253e143c4e2192430f113b115b78bde7d4776b5c836a5148
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.1
|
data/lib/sodium/buffer.rb
CHANGED
@@ -50,6 +50,7 @@ class Sodium::Buffer
|
|
50
50
|
def initialize(bytes)
|
51
51
|
# allocate memory for the incoming bytes and copy them in to our
|
52
52
|
# newly-owned memory
|
53
|
+
bytes = bytes.to_str # unwrap ZeroingDelegator if present
|
53
54
|
pointer = Sodium::FFI::LibC.calloc(1, bytes.bytesize)
|
54
55
|
pointer.write_string(bytes)
|
55
56
|
|
@@ -198,18 +199,19 @@ class Sodium::Buffer::ZeroingDelegator
|
|
198
199
|
:__send__,
|
199
200
|
:object_id,
|
200
201
|
:equal?,
|
202
|
+
:freeze,
|
203
|
+
:frozen?,
|
201
204
|
].include?(method)
|
202
205
|
end
|
203
206
|
|
204
207
|
def initialize(string, &finalizer)
|
205
|
-
self.__setobj__(string)
|
206
|
-
|
207
208
|
# specify class name explicitly, since we're letting the `class`
|
208
209
|
# method delegate to the wrapped object
|
209
210
|
Sodium::Buffer::ZeroingDelegator._mlock! string, string.bytesize
|
210
211
|
Sodium::Buffer::ZeroingDelegator._finalize! self, string, string.bytesize,
|
211
212
|
&finalizer
|
212
213
|
|
214
|
+
self.__setobj__(string)
|
213
215
|
self.__getobj__.freeze
|
214
216
|
self .freeze
|
215
217
|
end
|
data/test/sodium/buffer_test.rb
CHANGED
@@ -90,6 +90,11 @@ describe Sodium::Buffer do
|
|
90
90
|
end.must_equal("\0" * 4)
|
91
91
|
end
|
92
92
|
|
93
|
+
it '#initialize must accept ZeroingDelegator-wrapped strings' do
|
94
|
+
lambda { subject.new subject.new('xyz').to_s }.call.
|
95
|
+
wont_equal TypeError
|
96
|
+
end
|
97
|
+
|
93
98
|
it '#initialize must wipe the buffer during finalization'
|
94
99
|
it '#initialize must prevent the string from being paged to disk'
|
95
100
|
|
metadata
CHANGED
@@ -1,169 +1,174 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sodium
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.7.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.7.1
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
|
6
|
+
authors:
|
7
|
+
- Stephen Touset
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-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R5
|
21
|
+
qDqoQFJK5ZmaEFm9E88HdAIS+sV9zb1OCYlADr3EB/a3Shxedx4SsX7oBPyNfsRb
|
22
|
+
kMdTr+VynH/OEPSo0dW1DuKpUCmNBscrTOwhn6hJUDNpr6f0CTfYG9jGJY3p5JMt
|
23
|
+
AgMBAAGjOTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFIu3aZS82t6UR4Z5eON3t2LI
|
24
|
+
AHPeMAsGA1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAkjXdsFKC9mQfT3tP
|
25
|
+
PNtArZ+Y/MhEfNXgKeTIHuIXMaFe86ekTxYxfIziH5VpGtIzeVxXE4teNNI/tpSX
|
26
|
+
DcBNspVsx4N/PBqVdtD2KqTO+yrHiER7T9XEEctMgmFQB+NGMLNIpde1tGS8hX2p
|
27
|
+
mcWzr4EAsJwbtLa3HHPwNrr3+Xj1YA8SvLffsJ0nUv/DeqkDCr/CG8mfPO65KtvX
|
28
|
+
rp7h6AAaApIXd1JOn/ady0QxBNc9Rcjg0iG3lF4bRozRR2/B3cNC9PlHUhObWLYh
|
29
|
+
/fYRy+X91OOKL0AyBJRoXo4iT7YeerdeYuWB9HZjJZSR13qeIn2vgJOS4qpPgqyu
|
30
|
+
S0VfcA==
|
31
|
+
-----END CERTIFICATE-----
|
32
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
33
|
+
dependencies:
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: ffi
|
36
|
+
requirement: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: minitest
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: version
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1'
|
80
90
|
description: A library for performing cryptography based on modern ciphers and protocols
|
81
91
|
email: stephen@touset.org
|
82
92
|
executables: []
|
83
|
-
|
84
|
-
|
85
|
-
- ext/sodium/memory/extconf.rb
|
93
|
+
extensions:
|
94
|
+
- ext/sodium/memory/extconf.rb
|
86
95
|
extra_rdoc_files: []
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
- test/test_helper.rb
|
96
|
+
files:
|
97
|
+
- .gitignore
|
98
|
+
- .travis.yml
|
99
|
+
- CHANGELOG.md
|
100
|
+
- Gemfile
|
101
|
+
- LICENSE.txt
|
102
|
+
- README.md
|
103
|
+
- Rakefile
|
104
|
+
- VERSION
|
105
|
+
- certs/sodium@touset.org.cert
|
106
|
+
- certs/sodium@touset.org.pub.gpg
|
107
|
+
- config/nacl_ffi.yml
|
108
|
+
- ext/sodium/memory/extconf.rb
|
109
|
+
- ext/sodium/memory/memory.c
|
110
|
+
- lib/sodium.rb
|
111
|
+
- lib/sodium/auth.rb
|
112
|
+
- lib/sodium/box.rb
|
113
|
+
- lib/sodium/buffer.rb
|
114
|
+
- lib/sodium/delegate.rb
|
115
|
+
- lib/sodium/ffi.rb
|
116
|
+
- lib/sodium/ffi/crypto.rb
|
117
|
+
- lib/sodium/ffi/lib_c.rb
|
118
|
+
- lib/sodium/ffi/memory.rb
|
119
|
+
- lib/sodium/ffi/random.rb
|
120
|
+
- lib/sodium/hash.rb
|
121
|
+
- lib/sodium/one_time_auth.rb
|
122
|
+
- lib/sodium/random.rb
|
123
|
+
- lib/sodium/secret_box.rb
|
124
|
+
- lib/sodium/sign.rb
|
125
|
+
- lib/sodium/version.rb
|
126
|
+
- sodium.gemspec
|
127
|
+
- tasks/extensions.rake
|
128
|
+
- tasks/libsodium.rake
|
129
|
+
- tasks/test.rake
|
130
|
+
- tasks/version.rake
|
131
|
+
- test/sodium/auth/hmacsha256_test.rb
|
132
|
+
- test/sodium/auth/hmacsha512256_test.rb
|
133
|
+
- test/sodium/auth_test.rb
|
134
|
+
- test/sodium/box/curve25519xsalsa20poly1305_test.rb
|
135
|
+
- test/sodium/box_test.rb
|
136
|
+
- test/sodium/buffer_test.rb
|
137
|
+
- test/sodium/delegate_test.rb
|
138
|
+
- test/sodium/hash/sha256_test.rb
|
139
|
+
- test/sodium/hash/sha512_test.rb
|
140
|
+
- test/sodium/hash_test.rb
|
141
|
+
- test/sodium/one_time_auth/poly1305_test.rb
|
142
|
+
- test/sodium/one_time_auth_test.rb
|
143
|
+
- test/sodium/random_test.rb
|
144
|
+
- test/sodium/secret_box/xsalsa20poly1305_test.rb
|
145
|
+
- test/sodium/secret_box_test.rb
|
146
|
+
- test/sodium/sign/ed25519_test.rb
|
147
|
+
- test/sodium/sign_test.rb
|
148
|
+
- test/test_helper.rb
|
141
149
|
homepage: https://github.com/stouset/sodium
|
142
|
-
licenses:
|
143
|
-
|
150
|
+
licenses:
|
151
|
+
- MIT
|
152
|
+
metadata: {}
|
144
153
|
post_install_message:
|
145
154
|
rdoc_options: []
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
version: "0"
|
161
|
-
requirements:
|
162
|
-
- libsodium ~> 0.5
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - '>='
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements:
|
168
|
+
- libsodium ~> 0.5
|
163
169
|
rubyforge_project:
|
164
|
-
rubygems_version:
|
170
|
+
rubygems_version: 2.0.3
|
165
171
|
signing_key:
|
166
|
-
specification_version:
|
172
|
+
specification_version: 4
|
167
173
|
summary: A Ruby binding to the easy-to-use high-speed crypto library libsodium
|
168
174
|
test_files: []
|
169
|
-
|
metadata.gz.sig
CHANGED
Binary file
|