rubyntlm 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -3
  3. data/.rspec +2 -2
  4. data/.travis.yml +13 -12
  5. data/CHANGELOG.md +118 -6
  6. data/Gemfile +3 -3
  7. data/LICENSE +19 -19
  8. data/Rakefile +25 -22
  9. data/lib/net/ntlm.rb +266 -266
  10. data/lib/net/ntlm/blob.rb +28 -28
  11. data/lib/net/ntlm/channel_binding.rb +65 -65
  12. data/lib/net/ntlm/client.rb +65 -65
  13. data/lib/net/ntlm/client/session.rb +237 -237
  14. data/lib/net/ntlm/encode_util.rb +48 -48
  15. data/lib/net/ntlm/exceptions.rb +14 -14
  16. data/lib/net/ntlm/field.rb +34 -34
  17. data/lib/net/ntlm/field_set.rb +129 -129
  18. data/lib/net/ntlm/int16_le.rb +25 -25
  19. data/lib/net/ntlm/int32_le.rb +24 -24
  20. data/lib/net/ntlm/int64_le.rb +25 -25
  21. data/lib/net/ntlm/message.rb +129 -129
  22. data/lib/net/ntlm/message/type0.rb +16 -16
  23. data/lib/net/ntlm/message/type1.rb +18 -18
  24. data/lib/net/ntlm/message/type2.rb +102 -102
  25. data/lib/net/ntlm/message/type3.rb +131 -131
  26. data/lib/net/ntlm/security_buffer.rb +47 -47
  27. data/lib/net/ntlm/string.rb +34 -34
  28. data/lib/net/ntlm/target_info.rb +89 -89
  29. data/lib/net/ntlm/version.rb +11 -11
  30. data/rubyntlm.gemspec +29 -28
  31. data/spec/lib/net/ntlm/blob_spec.rb +16 -16
  32. data/spec/lib/net/ntlm/channel_binding_spec.rb +17 -17
  33. data/spec/lib/net/ntlm/client/session_spec.rb +68 -68
  34. data/spec/lib/net/ntlm/client_spec.rb +64 -64
  35. data/spec/lib/net/ntlm/encode_util_spec.rb +16 -16
  36. data/spec/lib/net/ntlm/field_set_spec.rb +33 -33
  37. data/spec/lib/net/ntlm/field_spec.rb +34 -34
  38. data/spec/lib/net/ntlm/int16_le_spec.rb +17 -17
  39. data/spec/lib/net/ntlm/int32_le_spec.rb +18 -18
  40. data/spec/lib/net/ntlm/int64_le_spec.rb +18 -18
  41. data/spec/lib/net/ntlm/message/type0_spec.rb +20 -20
  42. data/spec/lib/net/ntlm/message/type1_spec.rb +131 -131
  43. data/spec/lib/net/ntlm/message/type2_spec.rb +132 -132
  44. data/spec/lib/net/ntlm/message/type3_spec.rb +225 -225
  45. data/spec/lib/net/ntlm/message_spec.rb +16 -16
  46. data/spec/lib/net/ntlm/security_buffer_spec.rb +64 -64
  47. data/spec/lib/net/ntlm/string_spec.rb +72 -72
  48. data/spec/lib/net/ntlm/target_info_spec.rb +76 -76
  49. data/spec/lib/net/ntlm/version_spec.rb +27 -27
  50. data/spec/lib/net/ntlm_spec.rb +127 -127
  51. data/spec/spec_helper.rb +22 -22
  52. data/spec/support/certificates/sha_256_hash.pem +19 -19
  53. data/spec/support/shared/examples/net/ntlm/field_shared.rb +25 -25
  54. data/spec/support/shared/examples/net/ntlm/fieldset_shared.rb +239 -239
  55. data/spec/support/shared/examples/net/ntlm/int_shared.rb +43 -43
  56. data/spec/support/shared/examples/net/ntlm/message_shared.rb +35 -35
  57. metadata +17 -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.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Kajimoto
@@ -9,8 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-15 00:00:00.000000000 Z
12
+ date: 2017-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: github_changelog_generator
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 1.14.3
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.14.3
14
28
  - !ruby/object:Gem::Dependency
15
29
  name: pry
16
30
  requirement: !ruby/object:Gem::Requirement
@@ -155,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
169
  version: '0'
156
170
  requirements: []
157
171
  rubyforge_project:
158
- rubygems_version: 2.6.6
172
+ rubygems_version: 2.6.11
159
173
  signing_key:
160
174
  specification_version: 4
161
175
  summary: Ruby/NTLM library.