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.
@@ -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
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ ### 0.7.1 (2013-07-19)
2
+
3
+ - Bug Fixes
4
+ * Sodium::Buffer#initialize accepts ZeroingDelegators
5
+ * ZeroingDelegator no longer delegates #freeze and #frozen? to its
6
+ delegate
7
+
1
8
  ### 0.7.0 (2013-07-18)
2
9
 
3
10
  - Additions
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -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
@@ -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
- prerelease:
5
- version: 0.7.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.1
6
5
  platform: ruby
7
- authors:
8
- - Stephen Touset
6
+ authors:
7
+ - Stephen Touset
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MQ8wDQYDVQQDDAZzb2Rp
15
- dW0xFjAUBgoJkiaJk/IsZAEZFgZ0b3VzZXQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
16
- HhcNMTMwNjI4MDEzMzQ4WhcNMTQwNjI4MDEzMzQ4WjA+MQ8wDQYDVQQDDAZzb2Rp
17
- dW0xFjAUBgoJkiaJk/IsZAEZFgZ0b3VzZXQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
18
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCh3C2P1jW4MvcpXioNkqW/
19
- HiD9ZpTew1tHTolQclBBmOmOApLUPc9PIsfbohph83Z82x+BWbjEdL5NAfEQjRVu
20
- O8JUBJh0YRDF9P7fDtd9w0b3mmhumujbEsmDYs1ru5VvjgCh+Hfxgddlpha0KmxQ
21
- 0j3h/Uj27tFbE33dIRqb5dBBBnnIM5CqRMu5/gDeXN5GrjYK3JfZlzZRECjnfuR5
22
- qDqoQFJK5ZmaEFm9E88HdAIS+sV9zb1OCYlADr3EB/a3Shxedx4SsX7oBPyNfsRb
23
- kMdTr+VynH/OEPSo0dW1DuKpUCmNBscrTOwhn6hJUDNpr6f0CTfYG9jGJY3p5JMt
24
- AgMBAAGjOTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFIu3aZS82t6UR4Z5eON3t2LI
25
- AHPeMAsGA1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAkjXdsFKC9mQfT3tP
26
- PNtArZ+Y/MhEfNXgKeTIHuIXMaFe86ekTxYxfIziH5VpGtIzeVxXE4teNNI/tpSX
27
- DcBNspVsx4N/PBqVdtD2KqTO+yrHiER7T9XEEctMgmFQB+NGMLNIpde1tGS8hX2p
28
- mcWzr4EAsJwbtLa3HHPwNrr3+Xj1YA8SvLffsJ0nUv/DeqkDCr/CG8mfPO65KtvX
29
- rp7h6AAaApIXd1JOn/ady0QxBNc9Rcjg0iG3lF4bRozRR2/B3cNC9PlHUhObWLYh
30
- /fYRy+X91OOKL0AyBJRoXo4iT7YeerdeYuWB9HZjJZSR13qeIn2vgJOS4qpPgqyu
31
- S0VfcA==
32
- -----END CERTIFICATE-----
33
-
34
- date: 2013-07-18 00:00:00 Z
35
- dependencies:
36
- - !ruby/object:Gem::Dependency
37
- name: ffi
38
- prerelease: false
39
- requirement: &id001 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ~>
43
- - !ruby/object:Gem::Version
44
- version: "1"
45
- type: :runtime
46
- version_requirements: *id001
47
- - !ruby/object:Gem::Dependency
48
- name: rake
49
- prerelease: false
50
- requirement: &id002 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ~>
54
- - !ruby/object:Gem::Version
55
- version: "10"
56
- type: :development
57
- version_requirements: *id002
58
- - !ruby/object:Gem::Dependency
59
- name: minitest
60
- prerelease: false
61
- requirement: &id003 !ruby/object:Gem::Requirement
62
- none: false
63
- requirements:
64
- - - ~>
65
- - !ruby/object:Gem::Version
66
- version: "5"
67
- type: :development
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: version
71
- prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: "1"
78
- type: :development
79
- version_requirements: *id004
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MQ8wDQYDVQQDDAZzb2Rp
14
+ dW0xFjAUBgoJkiaJk/IsZAEZFgZ0b3VzZXQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
15
+ HhcNMTMwNjI4MDEzMzQ4WhcNMTQwNjI4MDEzMzQ4WjA+MQ8wDQYDVQQDDAZzb2Rp
16
+ dW0xFjAUBgoJkiaJk/IsZAEZFgZ0b3VzZXQxEzARBgoJkiaJk/IsZAEZFgNvcmcw
17
+ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCh3C2P1jW4MvcpXioNkqW/
18
+ HiD9ZpTew1tHTolQclBBmOmOApLUPc9PIsfbohph83Z82x+BWbjEdL5NAfEQjRVu
19
+ O8JUBJh0YRDF9P7fDtd9w0b3mmhumujbEsmDYs1ru5VvjgCh+Hfxgddlpha0KmxQ
20
+ 0j3h/Uj27tFbE33dIRqb5dBBBnnIM5CqRMu5/gDeXN5GrjYK3JfZlzZRECjnfuR5
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
- extensions:
85
- - ext/sodium/memory/extconf.rb
93
+ extensions:
94
+ - ext/sodium/memory/extconf.rb
86
95
  extra_rdoc_files: []
87
-
88
- files:
89
- - .gitignore
90
- - .travis.yml
91
- - CHANGELOG.md
92
- - Gemfile
93
- - LICENSE.txt
94
- - README.md
95
- - Rakefile
96
- - VERSION
97
- - certs/sodium@touset.org.cert
98
- - certs/sodium@touset.org.pub.gpg
99
- - config/nacl_ffi.yml
100
- - ext/sodium/memory/extconf.rb
101
- - ext/sodium/memory/memory.c
102
- - lib/sodium.rb
103
- - lib/sodium/auth.rb
104
- - lib/sodium/box.rb
105
- - lib/sodium/buffer.rb
106
- - lib/sodium/delegate.rb
107
- - lib/sodium/ffi.rb
108
- - lib/sodium/ffi/crypto.rb
109
- - lib/sodium/ffi/lib_c.rb
110
- - lib/sodium/ffi/memory.rb
111
- - lib/sodium/ffi/random.rb
112
- - lib/sodium/hash.rb
113
- - lib/sodium/one_time_auth.rb
114
- - lib/sodium/random.rb
115
- - lib/sodium/secret_box.rb
116
- - lib/sodium/sign.rb
117
- - lib/sodium/version.rb
118
- - sodium.gemspec
119
- - tasks/extensions.rake
120
- - tasks/libsodium.rake
121
- - tasks/test.rake
122
- - tasks/version.rake
123
- - test/sodium/auth/hmacsha256_test.rb
124
- - test/sodium/auth/hmacsha512256_test.rb
125
- - test/sodium/auth_test.rb
126
- - test/sodium/box/curve25519xsalsa20poly1305_test.rb
127
- - test/sodium/box_test.rb
128
- - test/sodium/buffer_test.rb
129
- - test/sodium/delegate_test.rb
130
- - test/sodium/hash/sha256_test.rb
131
- - test/sodium/hash/sha512_test.rb
132
- - test/sodium/hash_test.rb
133
- - test/sodium/one_time_auth/poly1305_test.rb
134
- - test/sodium/one_time_auth_test.rb
135
- - test/sodium/random_test.rb
136
- - test/sodium/secret_box/xsalsa20poly1305_test.rb
137
- - test/sodium/secret_box_test.rb
138
- - test/sodium/sign/ed25519_test.rb
139
- - test/sodium/sign_test.rb
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
- - MIT
150
+ licenses:
151
+ - MIT
152
+ metadata: {}
144
153
  post_install_message:
145
154
  rdoc_options: []
146
-
147
- require_paths:
148
- - lib
149
- required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- version: "0"
155
- required_rubygems_version: !ruby/object:Gem::Requirement
156
- none: false
157
- requirements:
158
- - - ">="
159
- - !ruby/object:Gem::Version
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: 1.8.24
170
+ rubygems_version: 2.0.3
165
171
  signing_key:
166
- specification_version: 3
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