rubyntlm 0.5.3 → 0.6.0
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 +4 -4
- data/.gitignore +3 -3
- data/.rspec +2 -2
- data/.travis.yml +10 -11
- data/CHANGELOG.md +5 -5
- data/Gemfile +3 -3
- data/LICENSE +19 -19
- data/Rakefile +22 -22
- data/lib/net/ntlm.rb +266 -263
- data/lib/net/ntlm/blob.rb +28 -28
- data/lib/net/ntlm/channel_binding.rb +65 -0
- data/lib/net/ntlm/client.rb +65 -65
- data/lib/net/ntlm/client/session.rb +237 -223
- data/lib/net/ntlm/encode_util.rb +49 -49
- data/lib/net/ntlm/exceptions.rb +14 -0
- data/lib/net/ntlm/field.rb +34 -34
- data/lib/net/ntlm/field_set.rb +129 -129
- data/lib/net/ntlm/int16_le.rb +25 -25
- data/lib/net/ntlm/int32_le.rb +24 -24
- data/lib/net/ntlm/int64_le.rb +25 -25
- data/lib/net/ntlm/message.rb +129 -129
- data/lib/net/ntlm/message/type0.rb +16 -16
- data/lib/net/ntlm/message/type1.rb +18 -18
- data/lib/net/ntlm/message/type2.rb +102 -102
- data/lib/net/ntlm/message/type3.rb +131 -131
- data/lib/net/ntlm/security_buffer.rb +47 -47
- data/lib/net/ntlm/string.rb +34 -34
- data/lib/net/ntlm/target_info.rb +89 -0
- data/lib/net/ntlm/version.rb +11 -11
- data/rubyntlm.gemspec +28 -28
- data/spec/lib/net/ntlm/blob_spec.rb +16 -16
- data/spec/lib/net/ntlm/channel_binding_spec.rb +17 -0
- data/spec/lib/net/ntlm/client/session_spec.rb +68 -68
- data/spec/lib/net/ntlm/client_spec.rb +64 -64
- data/spec/lib/net/ntlm/encode_util_spec.rb +16 -16
- data/spec/lib/net/ntlm/field_set_spec.rb +33 -33
- data/spec/lib/net/ntlm/field_spec.rb +34 -34
- data/spec/lib/net/ntlm/int16_le_spec.rb +17 -17
- data/spec/lib/net/ntlm/int32_le_spec.rb +18 -18
- data/spec/lib/net/ntlm/int64_le_spec.rb +18 -18
- data/spec/lib/net/ntlm/message/type0_spec.rb +20 -20
- data/spec/lib/net/ntlm/message/type1_spec.rb +131 -131
- data/spec/lib/net/ntlm/message/type2_spec.rb +132 -132
- data/spec/lib/net/ntlm/message/type3_spec.rb +225 -225
- data/spec/lib/net/ntlm/message_spec.rb +16 -16
- data/spec/lib/net/ntlm/security_buffer_spec.rb +64 -64
- data/spec/lib/net/ntlm/string_spec.rb +72 -72
- data/spec/lib/net/ntlm/target_info_spec.rb +76 -0
- data/spec/lib/net/ntlm/version_spec.rb +27 -27
- data/spec/lib/net/ntlm_spec.rb +127 -127
- data/spec/spec_helper.rb +22 -22
- data/spec/support/certificates/sha_256_hash.pem +19 -0
- data/spec/support/shared/examples/net/ntlm/field_shared.rb +25 -25
- data/spec/support/shared/examples/net/ntlm/fieldset_shared.rb +239 -239
- data/spec/support/shared/examples/net/ntlm/int_shared.rb +43 -43
- data/spec/support/shared/examples/net/ntlm/message_shared.rb +35 -35
- metadata +12 -3
@@ -1,43 +1,43 @@
|
|
1
|
-
shared_examples_for 'an integer field' do |values|
|
2
|
-
|
3
|
-
subject do
|
4
|
-
described_class.new({
|
5
|
-
:value => values[:default],
|
6
|
-
:active => true
|
7
|
-
})
|
8
|
-
end
|
9
|
-
|
10
|
-
context '#serialize' do
|
11
|
-
it 'should serialize properly with an integer value' do
|
12
|
-
expect(subject.serialize).to eq(values[:default_hex])
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should raise an Exception for a String' do
|
16
|
-
subject.value = 'A'
|
17
|
-
expect {subject.serialize}.to raise_error
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should raise an Exception for Nil' do
|
21
|
-
subject.value = nil
|
22
|
-
expect {subject.serialize}.to raise_error
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
context '#parse' do
|
27
|
-
it "should parse a raw #{values[:bits].to_s}-bit integer from a string" do
|
28
|
-
expect(subject.parse(values[:alt_hex])).to eq(values[:size])
|
29
|
-
expect(subject.value).to eq(values[:alt])
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should use an offset to find the #{values[:bits].to_s}-bit integer in the string" do
|
33
|
-
expect(subject.parse("Value:#{values[:alt_hex]}",6)).to eq(values[:size])
|
34
|
-
expect(subject.value).to eq(values[:alt])
|
35
|
-
end
|
36
|
-
|
37
|
-
it 'should return 0 and not change the value if the string is not big enough' do
|
38
|
-
expect(subject.parse(values[:small])).to eq(0)
|
39
|
-
expect(subject.value).to eq(values[:default])
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
1
|
+
shared_examples_for 'an integer field' do |values|
|
2
|
+
|
3
|
+
subject do
|
4
|
+
described_class.new({
|
5
|
+
:value => values[:default],
|
6
|
+
:active => true
|
7
|
+
})
|
8
|
+
end
|
9
|
+
|
10
|
+
context '#serialize' do
|
11
|
+
it 'should serialize properly with an integer value' do
|
12
|
+
expect(subject.serialize).to eq(values[:default_hex])
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should raise an Exception for a String' do
|
16
|
+
subject.value = 'A'
|
17
|
+
expect {subject.serialize}.to raise_error
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should raise an Exception for Nil' do
|
21
|
+
subject.value = nil
|
22
|
+
expect {subject.serialize}.to raise_error
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context '#parse' do
|
27
|
+
it "should parse a raw #{values[:bits].to_s}-bit integer from a string" do
|
28
|
+
expect(subject.parse(values[:alt_hex])).to eq(values[:size])
|
29
|
+
expect(subject.value).to eq(values[:alt])
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should use an offset to find the #{values[:bits].to_s}-bit integer in the string" do
|
33
|
+
expect(subject.parse("Value:#{values[:alt_hex]}",6)).to eq(values[:size])
|
34
|
+
expect(subject.value).to eq(values[:alt])
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should return 0 and not change the value if the string is not big enough' do
|
38
|
+
expect(subject.parse(values[:small])).to eq(0)
|
39
|
+
expect(subject.value).to eq(values[:default])
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -1,35 +1,35 @@
|
|
1
|
-
shared_examples_for 'a message' do |flags|
|
2
|
-
|
3
|
-
subject(:test_message) do
|
4
|
-
unless described_class.names.include?(:flag)
|
5
|
-
described_class.int32LE(:flag, {:value => Net::NTLM::DEFAULT_FLAGS[:TYPE1] })
|
6
|
-
end
|
7
|
-
described_class.new
|
8
|
-
end
|
9
|
-
|
10
|
-
it { should respond_to :has_flag? }
|
11
|
-
it { should respond_to :set_flag }
|
12
|
-
it { should respond_to :dump_flags }
|
13
|
-
it { should respond_to :encode64 }
|
14
|
-
it { should respond_to :decode64 }
|
15
|
-
it { should respond_to :head_size }
|
16
|
-
it { should respond_to :data_size }
|
17
|
-
it { should respond_to :size }
|
18
|
-
it { should respond_to :security_buffers }
|
19
|
-
it { should respond_to :deflag }
|
20
|
-
it { should respond_to :data_edge }
|
21
|
-
|
22
|
-
flags.each do |flag|
|
23
|
-
it "should be able to check if the #{flag} flag is set" do
|
24
|
-
expect(test_message.has_flag?(flag)).to be(true)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
it 'should be able to set a new flag' do
|
30
|
-
test_message.set_flag(:DOMAIN_SUPPLIED)
|
31
|
-
expect(test_message.has_flag?(:DOMAIN_SUPPLIED)).to be(true)
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
end
|
1
|
+
shared_examples_for 'a message' do |flags|
|
2
|
+
|
3
|
+
subject(:test_message) do
|
4
|
+
unless described_class.names.include?(:flag)
|
5
|
+
described_class.int32LE(:flag, {:value => Net::NTLM::DEFAULT_FLAGS[:TYPE1] })
|
6
|
+
end
|
7
|
+
described_class.new
|
8
|
+
end
|
9
|
+
|
10
|
+
it { should respond_to :has_flag? }
|
11
|
+
it { should respond_to :set_flag }
|
12
|
+
it { should respond_to :dump_flags }
|
13
|
+
it { should respond_to :encode64 }
|
14
|
+
it { should respond_to :decode64 }
|
15
|
+
it { should respond_to :head_size }
|
16
|
+
it { should respond_to :data_size }
|
17
|
+
it { should respond_to :size }
|
18
|
+
it { should respond_to :security_buffers }
|
19
|
+
it { should respond_to :deflag }
|
20
|
+
it { should respond_to :data_edge }
|
21
|
+
|
22
|
+
flags.each do |flag|
|
23
|
+
it "should be able to check if the #{flag} flag is set" do
|
24
|
+
expect(test_message.has_flag?(flag)).to be(true)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
it 'should be able to set a new flag' do
|
30
|
+
test_message.set_flag(:DOMAIN_SUPPLIED)
|
31
|
+
expect(test_message.has_flag?(:DOMAIN_SUPPLIED)).to be(true)
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyntlm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Kajimoto
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|
@@ -88,9 +88,11 @@ files:
|
|
88
88
|
- examples/smtp.rb
|
89
89
|
- lib/net/ntlm.rb
|
90
90
|
- lib/net/ntlm/blob.rb
|
91
|
+
- lib/net/ntlm/channel_binding.rb
|
91
92
|
- lib/net/ntlm/client.rb
|
92
93
|
- lib/net/ntlm/client/session.rb
|
93
94
|
- lib/net/ntlm/encode_util.rb
|
95
|
+
- lib/net/ntlm/exceptions.rb
|
94
96
|
- lib/net/ntlm/field.rb
|
95
97
|
- lib/net/ntlm/field_set.rb
|
96
98
|
- lib/net/ntlm/int16_le.rb
|
@@ -103,10 +105,12 @@ files:
|
|
103
105
|
- lib/net/ntlm/message/type3.rb
|
104
106
|
- lib/net/ntlm/security_buffer.rb
|
105
107
|
- lib/net/ntlm/string.rb
|
108
|
+
- lib/net/ntlm/target_info.rb
|
106
109
|
- lib/net/ntlm/version.rb
|
107
110
|
- lib/rubyntlm.rb
|
108
111
|
- rubyntlm.gemspec
|
109
112
|
- spec/lib/net/ntlm/blob_spec.rb
|
113
|
+
- spec/lib/net/ntlm/channel_binding_spec.rb
|
110
114
|
- spec/lib/net/ntlm/client/session_spec.rb
|
111
115
|
- spec/lib/net/ntlm/client_spec.rb
|
112
116
|
- spec/lib/net/ntlm/encode_util_spec.rb
|
@@ -122,9 +126,11 @@ files:
|
|
122
126
|
- spec/lib/net/ntlm/message_spec.rb
|
123
127
|
- spec/lib/net/ntlm/security_buffer_spec.rb
|
124
128
|
- spec/lib/net/ntlm/string_spec.rb
|
129
|
+
- spec/lib/net/ntlm/target_info_spec.rb
|
125
130
|
- spec/lib/net/ntlm/version_spec.rb
|
126
131
|
- spec/lib/net/ntlm_spec.rb
|
127
132
|
- spec/spec_helper.rb
|
133
|
+
- spec/support/certificates/sha_256_hash.pem
|
128
134
|
- spec/support/shared/examples/net/ntlm/field_shared.rb
|
129
135
|
- spec/support/shared/examples/net/ntlm/fieldset_shared.rb
|
130
136
|
- spec/support/shared/examples/net/ntlm/int_shared.rb
|
@@ -149,12 +155,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
155
|
version: '0'
|
150
156
|
requirements: []
|
151
157
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.4.
|
158
|
+
rubygems_version: 2.4.8
|
153
159
|
signing_key:
|
154
160
|
specification_version: 4
|
155
161
|
summary: Ruby/NTLM library.
|
156
162
|
test_files:
|
157
163
|
- spec/lib/net/ntlm/blob_spec.rb
|
164
|
+
- spec/lib/net/ntlm/channel_binding_spec.rb
|
158
165
|
- spec/lib/net/ntlm/client/session_spec.rb
|
159
166
|
- spec/lib/net/ntlm/client_spec.rb
|
160
167
|
- spec/lib/net/ntlm/encode_util_spec.rb
|
@@ -170,9 +177,11 @@ test_files:
|
|
170
177
|
- spec/lib/net/ntlm/message_spec.rb
|
171
178
|
- spec/lib/net/ntlm/security_buffer_spec.rb
|
172
179
|
- spec/lib/net/ntlm/string_spec.rb
|
180
|
+
- spec/lib/net/ntlm/target_info_spec.rb
|
173
181
|
- spec/lib/net/ntlm/version_spec.rb
|
174
182
|
- spec/lib/net/ntlm_spec.rb
|
175
183
|
- spec/spec_helper.rb
|
184
|
+
- spec/support/certificates/sha_256_hash.pem
|
176
185
|
- spec/support/shared/examples/net/ntlm/field_shared.rb
|
177
186
|
- spec/support/shared/examples/net/ntlm/fieldset_shared.rb
|
178
187
|
- spec/support/shared/examples/net/ntlm/int_shared.rb
|