rubyntlm 0.6.5 → 0.6.7

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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +48 -48
  4. data/lib/net/ntlm/blob.rb +11 -10
  5. data/lib/net/ntlm/channel_binding.rb +13 -9
  6. data/lib/net/ntlm/client/session.rb +34 -141
  7. data/lib/net/ntlm/client/session_crypto.rb +126 -0
  8. data/lib/net/ntlm/client.rb +8 -9
  9. data/lib/net/ntlm/encode_util.rb +39 -38
  10. data/lib/net/ntlm/exceptions.rb +3 -0
  11. data/lib/net/ntlm/field.rb +29 -31
  12. data/lib/net/ntlm/field_set.rb +39 -18
  13. data/lib/net/ntlm/int16_le.rb +8 -8
  14. data/lib/net/ntlm/int32_le.rb +8 -7
  15. data/lib/net/ntlm/int64_le.rb +8 -7
  16. data/lib/net/ntlm/md4.rb +102 -63
  17. data/lib/net/ntlm/message/type0.rb +4 -7
  18. data/lib/net/ntlm/message/type1.rb +8 -9
  19. data/lib/net/ntlm/message/type2.rb +87 -67
  20. data/lib/net/ntlm/message/type3.rb +49 -59
  21. data/lib/net/ntlm/message.rb +116 -111
  22. data/lib/net/ntlm/rc4.rb +51 -44
  23. data/lib/net/ntlm/response.rb +112 -0
  24. data/lib/net/ntlm/security_buffer.rb +13 -15
  25. data/lib/net/ntlm/string.rb +8 -7
  26. data/lib/net/ntlm/target_info.rb +52 -44
  27. data/lib/net/ntlm/version.rb +3 -1
  28. data/lib/net/ntlm.rb +37 -125
  29. data/lib/rubyntlm.rb +3 -1
  30. metadata +10 -141
  31. data/.devcontainer/devcontainer.json +0 -22
  32. data/.github/dependabot.yml +0 -10
  33. data/.github/workflows/build.yml +0 -24
  34. data/.gitignore +0 -5
  35. data/.rspec +0 -2
  36. data/Gemfile +0 -3
  37. data/Rakefile +0 -25
  38. data/examples/http.rb +0 -86
  39. data/examples/imap.rb +0 -73
  40. data/examples/smtp.rb +0 -94
  41. data/rubyntlm.gemspec +0 -31
  42. data/spec/lib/net/ntlm/blob_spec.rb +0 -16
  43. data/spec/lib/net/ntlm/channel_binding_spec.rb +0 -17
  44. data/spec/lib/net/ntlm/client/session_spec.rb +0 -87
  45. data/spec/lib/net/ntlm/client_spec.rb +0 -64
  46. data/spec/lib/net/ntlm/encode_util_spec.rb +0 -16
  47. data/spec/lib/net/ntlm/field_set_spec.rb +0 -33
  48. data/spec/lib/net/ntlm/field_spec.rb +0 -34
  49. data/spec/lib/net/ntlm/int16_le_spec.rb +0 -18
  50. data/spec/lib/net/ntlm/int32_le_spec.rb +0 -19
  51. data/spec/lib/net/ntlm/int64_le_spec.rb +0 -19
  52. data/spec/lib/net/ntlm/message/type0_spec.rb +0 -21
  53. data/spec/lib/net/ntlm/message/type1_spec.rb +0 -131
  54. data/spec/lib/net/ntlm/message/type2_spec.rb +0 -132
  55. data/spec/lib/net/ntlm/message/type3_spec.rb +0 -267
  56. data/spec/lib/net/ntlm/message_spec.rb +0 -17
  57. data/spec/lib/net/ntlm/security_buffer_spec.rb +0 -64
  58. data/spec/lib/net/ntlm/string_spec.rb +0 -72
  59. data/spec/lib/net/ntlm/target_info_spec.rb +0 -76
  60. data/spec/lib/net/ntlm/version_spec.rb +0 -27
  61. data/spec/lib/net/ntlm_spec.rb +0 -135
  62. data/spec/spec_helper.rb +0 -22
  63. data/spec/support/certificates/sha_256_hash.pem +0 -19
  64. data/spec/support/shared/examples/net/ntlm/field_shared.rb +0 -25
  65. data/spec/support/shared/examples/net/ntlm/fieldset_shared.rb +0 -239
  66. data/spec/support/shared/examples/net/ntlm/int_shared.rb +0 -43
  67. data/spec/support/shared/examples/net/ntlm/message_shared.rb +0 -35
@@ -1,135 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Net::NTLM do
4
- let(:passwd) {"SecREt01"}
5
- let(:user) {"user"}
6
- let(:domain) {"DOMAIN"}
7
- let(:challenge) {["0123456789abcdef"].pack("H*")}
8
- let(:client_ch) {["ffffff0011223344"].pack("H*")}
9
- let(:timestamp) {1055844000}
10
- let(:trgt_info) {[
11
- "02000c0044004f004d00410049004e00" +
12
- "01000c00530045005200560045005200" +
13
- "0400140064006f006d00610069006e00" +
14
- "2e0063006f006d000300220073006500" +
15
- "72007600650072002e0064006f006d00" +
16
- "610069006e002e0063006f006d000000" +
17
- "0000"
18
- ].pack("H*")}
19
- let(:padded_pwd) { passwd.upcase.ljust(14, "\0")}
20
- let(:keys) { Net::NTLM.gen_keys(padded_pwd)}
21
-
22
- it 'should convert a value to 64-bit LE Integer' do
23
- expect(Net::NTLM.pack_int64le(42)).to eq("\x2A\x00\x00\x00\x00\x00\x00\x00")
24
- end
25
-
26
- it 'should split a string into an array of slices, 7 chars or less' do
27
- expect(Net::NTLM.split7("HelloWorld!")).to eq([ 'HelloWo', 'rld!'])
28
- end
29
-
30
- it 'should generate DES keys from the supplied string' do
31
- first_key = ["52a2516b252a5161"].pack('H*')
32
- second_key = ["3180010101010101"].pack('H*')
33
- expect(Net::NTLM.gen_keys(padded_pwd)).to eq([first_key, second_key])
34
- end
35
-
36
- it 'should encrypt the string with DES for each key supplied' do
37
- first_crypt = ["ff3750bcc2b22412"].pack('H*')
38
- second_crypt = ["c2265b23734e0dac"].pack('H*')
39
- expect(Net::NTLM::apply_des(Net::NTLM::LM_MAGIC, keys)).to eq([first_crypt, second_crypt])
40
- end
41
-
42
- it 'should generate an lm_hash' do
43
- expect(Net::NTLM::lm_hash(passwd)).to eq(["ff3750bcc2b22412c2265b23734e0dac"].pack("H*"))
44
- end
45
-
46
- it 'should generate an ntlm_hash' do
47
- expect(Net::NTLM::ntlm_hash(passwd)).to eq(["cd06ca7c7e10c99b1d33b7485a2ed808"].pack("H*"))
48
- end
49
-
50
- it 'should generate an ntlmv2_hash' do
51
- expect(Net::NTLM::ntlmv2_hash(user, passwd, domain)).to eq(["04b8e0ba74289cc540826bab1dee63ae"].pack("H*"))
52
- end
53
-
54
- context 'when a user passes an NTLM hash for pass-the-hash' do
55
- let(:passwd) { Net::NTLM::EncodeUtil.encode_utf16le('ff3750bcc2b22412c2265b23734e0dac:cd06ca7c7e10c99b1d33b7485a2ed808') }
56
-
57
- it 'should return the correct ntlmv2 hash' do
58
- expect(Net::NTLM::ntlmv2_hash(user, passwd, domain)).to eq(["04b8e0ba74289cc540826bab1dee63ae"].pack("H*"))
59
- end
60
- end
61
-
62
- context 'when the username contains non-ASCI characters' do
63
- let(:user) { 'юзер' }
64
-
65
- it 'should return the correct ntlmv2 hash' do
66
- expect(Net::NTLM::ntlmv2_hash(user, passwd, domain, { unicode: true })).to eq(["a0f4b914a37faeaee884b6b04a20faf0"].pack("H*"))
67
- end
68
- end
69
-
70
- it 'should generate an lm_response' do
71
- expect(Net::NTLM::lm_response(
72
- {
73
- :lm_hash => Net::NTLM::lm_hash(passwd),
74
- :challenge => challenge
75
- }
76
- )).to eq(["c337cd5cbd44fc9782a667af6d427c6de67c20c2d3e77c56"].pack("H*"))
77
- end
78
-
79
- it 'should generate an ntlm_response' do
80
- ntlm_hash = Net::NTLM::ntlm_hash(passwd)
81
- expect(Net::NTLM::ntlm_response(
82
- {
83
- :ntlm_hash => ntlm_hash,
84
- :challenge => challenge
85
- }
86
- )).to eq(["25a98c1c31e81847466b29b2df4680f39958fb8c213a9cc6"].pack("H*"))
87
- end
88
-
89
- it 'should generate a lvm2_response' do
90
- expect(Net::NTLM::lmv2_response(
91
- {
92
- :ntlmv2_hash => Net::NTLM::ntlmv2_hash(user, passwd, domain),
93
- :challenge => challenge
94
- },
95
- { :client_challenge => client_ch }
96
- )).to eq(["d6e6152ea25d03b7c6ba6629c2d6aaf0ffffff0011223344"].pack("H*"))
97
- end
98
-
99
- it 'should generate a ntlmv2_response' do
100
- expect(Net::NTLM::ntlmv2_response(
101
- {
102
- :ntlmv2_hash => Net::NTLM::ntlmv2_hash(user, passwd, domain),
103
- :challenge => challenge,
104
- :target_info => trgt_info
105
- },
106
- {
107
- :timestamp => timestamp,
108
- :client_challenge => client_ch
109
- }
110
- )).to eq([
111
- "cbabbca713eb795d04c97abc01ee4983" +
112
- "01010000000000000090d336b734c301" +
113
- "ffffff00112233440000000002000c00" +
114
- "44004f004d00410049004e0001000c00" +
115
- "53004500520056004500520004001400" +
116
- "64006f006d00610069006e002e006300" +
117
- "6f006d00030022007300650072007600" +
118
- "650072002e0064006f006d0061006900" +
119
- "6e002e0063006f006d00000000000000" +
120
- "0000"
121
- ].pack("H*"))
122
- end
123
-
124
- it 'should generate a ntlm2_session' do
125
- session = Net::NTLM::ntlm2_session(
126
- {
127
- :ntlm_hash => Net::NTLM::ntlm_hash(passwd),
128
- :challenge => challenge
129
- },
130
- { :client_challenge => client_ch }
131
- )
132
- expect(session[0]).to eq(["ffffff001122334400000000000000000000000000000000"].pack("H*"))
133
- expect(session[1]).to eq(["10d550832d12b2ccb79d5ad1f4eed3df82aca4c3681dd455"].pack("H*"))
134
- end
135
- end
data/spec/spec_helper.rb DELETED
@@ -1,22 +0,0 @@
1
- require 'simplecov'
2
- require 'pathname'
3
-
4
- SimpleCov.start do
5
- add_filter '/spec/'
6
- add_filter '/config/'
7
- add_filter '/vendor/'
8
- end if ENV["COVERAGE"]
9
-
10
- require 'rspec'
11
- require 'net/ntlm'
12
-
13
- # add project lib directory to load path
14
- spec_pathname = Pathname.new(__FILE__).dirname
15
- root_pathname = spec_pathname.join('..').expand_path
16
- # Requires supporting ruby files with custom matchers and macros, etc,
17
- # in spec/support/ and its subdirectories.
18
- support_glob = root_pathname.join('spec', 'support', '**', '*.rb')
19
-
20
- Dir.glob(support_glob) do |path|
21
- require path
22
- end
@@ -1,19 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDKjCCAhKgAwIBAgIQV0qwsk2MCoxI2Do7IQ6eQzANBgkqhkiG9w0BAQsFADAa
3
- MRgwFgYDVQQDDA8xOTIuMTY4LjEzNy4xNjEwHhcNMTYwMTI3MjIyMzA5WhcNMTcw
4
- MTI3MjI0MzA5WjAaMRgwFgYDVQQDDA8xOTIuMTY4LjEzNy4xNjEwggEiMA0GCSqG
5
- SIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+bGWZQFYjF+bV1WJ1L/MGVNmJR89aJ44Z
6
- rKI/IXKFdbn5wjQPWng/DcaHR6xtMXQkc22boe58GK/uzl84ofbRa6qtboa5djdZ
7
- 9CGsd4Yf6CnVz4mhKSi+BnLi80ydhIRByxoX5bGcCSW6dixR5XiNMaMKzhCjQ+of
8
- TU+PBNt7doXB7p0mO4AZz42v4rorRiPNasETj6wlKhFKCMvPLePTwphCgCQsLvgG
9
- NQKtFD7TXvrZwplPSeCPhnzd1vHoZMisMn8ZVQ5dAfSEGGkPkOLO0htbUbdaNMoU
10
- DPyo7Bu62Q/dqqo1MNbMYM5Ilw8mxe4drOs9UupH0eMovFhVMO0LAgMBAAGjbDBq
11
- MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEw
12
- GgYDVR0RBBMwEYIPMTkyLjE2OC4xMzcuMTYxMB0GA1UdDgQWBBSLuqyHonSmdm8m
13
- 9R+z2obO/X3/+TANBgkqhkiG9w0BAQsFAAOCAQEAH4pDGBclTHrwF+Bkbfj81ibK
14
- E2SJSHbdhSx6YCsR28jXUOESfaik5ZPPMXscJqVc1FPpsU9clPFnGiAf0Kt48gsR
15
- twfrRSGgJRv1ZgQyJ4dEQkXbQf2+8uY25Rv4kkFDSvPrE6E9o9Jf9bjqefUYski1
16
- YoYdWzgrh/2qoNhnM34wizZgE1bWYbWA9MlUuWH9q/OBEx9uP/K53SXOR7DRzYcY
17
- Kg1Z7hV86nvc0WutjEadgdtvJ7eUlg8vAWZqWo5SIdp69l0OEWUlHiaRsPImS5Hd
18
- pX3W8n0wHCxBSntDww7U3SHg6DrYf72taBIQW7xFf63S37yLP4CNss68GqPdyQ==
19
- -----END CERTIFICATE-----
@@ -1,25 +0,0 @@
1
- shared_examples_for 'a field' do | value, active|
2
-
3
- subject do
4
- described_class.new({
5
- :value => value,
6
- :active => active
7
- })
8
- end
9
-
10
- it { should respond_to :active }
11
- it { should respond_to :value }
12
- it { should respond_to :size }
13
- it { should respond_to :parse }
14
- it { should respond_to :serialize }
15
-
16
-
17
- it 'should set the value from initialize options' do
18
- expect(subject.value).to eq(value)
19
- end
20
-
21
- it 'should set active from initialize options' do
22
- expect(subject.active).to eq(active)
23
- end
24
-
25
- end
@@ -1,239 +0,0 @@
1
- shared_examples_for 'a fieldset' do |fields|
2
-
3
- subject(:fieldset_class) do
4
- Class.new(described_class)
5
- end
6
-
7
- context 'the class' do
8
- it { should respond_to :string }
9
- it { should respond_to :int16LE }
10
- it { should respond_to :int32LE }
11
- it { should respond_to :int64LE }
12
- it { should respond_to :security_buffer }
13
- it { should respond_to :prototypes }
14
- it { should respond_to :names }
15
- it { should respond_to :types }
16
- it { should respond_to :opts }
17
-
18
- context 'adding a String Field' do
19
- before(:each) do
20
- fieldset_class.string(:test_string, { :value => 'Test'})
21
- end
22
-
23
- it 'should set the prototypes correctly' do
24
- expect(fieldset_class.prototypes).to include([:test_string, Net::NTLM::String, {:value=>"Test"}])
25
- end
26
-
27
- it 'should set the names correctly' do
28
- expect(fieldset_class.names).to include(:test_string)
29
- end
30
-
31
- it 'should set the types correctly' do
32
- expect(fieldset_class.types).to include(Net::NTLM::String)
33
- end
34
-
35
- it 'should set the opts correctly' do
36
- expect(fieldset_class.opts).to include({:value => 'Test'})
37
- end
38
-
39
- context 'when creating an instance' do
40
- let(:fieldset_object) do
41
- fieldset_class.new
42
- end
43
-
44
- it 'should have the new accessor' do
45
- expect(fieldset_object).to respond_to(:test_string)
46
- end
47
-
48
- it 'should have the correct default value' do
49
- expect(fieldset_object.test_string).to eq('Test')
50
- end
51
- end
52
- end
53
-
54
- context 'adding a Int16LE Field' do
55
- before(:each) do
56
- fieldset_class.int16LE(:test_int, { :value => 15})
57
- end
58
-
59
- it 'should set the prototypes correctly' do
60
- expect(fieldset_class.prototypes).to include([:test_int, Net::NTLM::Int16LE, {:value=>15}])
61
- end
62
-
63
- it 'should set the names correctly' do
64
- expect(fieldset_class.names).to include(:test_int)
65
- end
66
-
67
- it 'should set the types correctly' do
68
- expect(fieldset_class.types).to include(Net::NTLM::Int16LE)
69
- end
70
-
71
- it 'should set the opts correctly' do
72
- expect(fieldset_class.opts).to include({:value => 15})
73
- end
74
-
75
- context 'when creating an instance' do
76
- let(:fieldset_object) do
77
- fieldset_class.new
78
- end
79
-
80
- it 'should have the new accessor' do
81
- expect(fieldset_object).to respond_to(:test_int)
82
- end
83
-
84
- it 'should have the correct default value' do
85
- expect(fieldset_object.test_int).to eq(15)
86
- end
87
- end
88
- end
89
-
90
- context 'adding a Int32LE Field' do
91
- before(:each) do
92
- fieldset_class.int32LE(:test_int, { :value => 15})
93
- end
94
-
95
- it 'should set the prototypes correctly' do
96
- expect(fieldset_class.prototypes).to include([:test_int, Net::NTLM::Int32LE, {:value=>15}])
97
- end
98
-
99
- it 'should set the names correctly' do
100
- expect(fieldset_class.names).to include(:test_int)
101
- end
102
-
103
- it 'should set the types correctly' do
104
- expect(fieldset_class.types).to include(Net::NTLM::Int32LE)
105
- end
106
-
107
- it 'should set the opts correctly' do
108
- expect(fieldset_class.opts).to include({:value => 15})
109
- end
110
-
111
- context 'when creating an instance' do
112
- let(:fieldset_object) do
113
- fieldset_class.new
114
- end
115
-
116
- it 'should have the new accessor' do
117
- expect(fieldset_object).to respond_to(:test_int)
118
- end
119
-
120
- it 'should have the correct default value' do
121
- expect(fieldset_object.test_int).to eq(15)
122
- end
123
- end
124
- end
125
-
126
- context 'adding a Int64LE Field' do
127
- before(:each) do
128
- fieldset_class.int64LE(:test_int, { :value => 15})
129
- end
130
-
131
- it 'should set the prototypes correctly' do
132
- expect(fieldset_class.prototypes).to include([:test_int, Net::NTLM::Int64LE, {:value=>15}])
133
- end
134
-
135
- it 'should set the names correctly' do
136
- expect(fieldset_class.names).to include(:test_int)
137
- end
138
-
139
- it 'should set the types correctly' do
140
- expect(fieldset_class.types).to include(Net::NTLM::Int64LE)
141
- end
142
-
143
- it 'should set the opts correctly' do
144
- expect(fieldset_class.opts).to include({:value => 15})
145
- end
146
-
147
- context 'when creating an instance' do
148
- let(:fieldset_object) do
149
- fieldset_class.new
150
- end
151
-
152
- it 'should have the new accessor' do
153
- expect(fieldset_object).to respond_to(:test_int)
154
- end
155
-
156
- it 'should have the correct default value' do
157
- expect(fieldset_object.test_int).to eq(15)
158
- end
159
- end
160
- end
161
-
162
- context 'adding a SecurityBuffer Field' do
163
- before(:each) do
164
- fieldset_class.security_buffer(:test_buffer, { :value => 15})
165
- end
166
-
167
- it 'should set the prototypes correctly' do
168
- expect(fieldset_class.prototypes).to include([:test_buffer, Net::NTLM::SecurityBuffer, {:value=>15}])
169
- end
170
-
171
- it 'should set the names correctly' do
172
- expect(fieldset_class.names).to include(:test_buffer)
173
- end
174
-
175
- it 'should set the types correctly' do
176
- expect(fieldset_class.types).to include(Net::NTLM::SecurityBuffer)
177
- end
178
-
179
- it 'should set the opts correctly' do
180
- expect(fieldset_class.opts).to include({:value => 15})
181
- end
182
-
183
- context 'when creating an instance' do
184
- let(:fieldset_object) do
185
- fieldset_class.new
186
- end
187
-
188
- it 'should have the new accessor' do
189
- expect(fieldset_object).to respond_to :test_buffer
190
- end
191
-
192
- it 'should have the correct default value' do
193
- expect(fieldset_object.test_buffer).to eq(15)
194
- end
195
- end
196
- end
197
-
198
- end
199
-
200
- context 'an instance' do
201
-
202
- subject(:fieldset_object) do
203
- # FieldSet Base Class and Message Base Class
204
- # have no fields by default and thus cannot be initialized
205
- # currently. Clumsy workaround for now.
206
- if described_class.names.empty?
207
- described_class.string(:test_string, { :value => 'Test', :active => true, :size => 4})
208
- end
209
- described_class.new
210
- end
211
-
212
- it { should respond_to :serialize }
213
- it { should respond_to :parse }
214
- it { should respond_to :size }
215
- it { should respond_to :enable }
216
- it { should respond_to :disable }
217
-
218
- context 'fields' do
219
- fields.each do |field|
220
- it { should respond_to field[:name] }
221
-
222
- context "#{field[:name]}" do
223
- it "should be a #{field[:class].to_s}" do
224
- expect(fieldset_object[field[:name]].class).to eq(field[:class])
225
- end
226
-
227
- it "should have a default value of #{field[:value]}" do
228
- expect(fieldset_object[field[:name]].value).to eq(field[:value])
229
- end
230
-
231
- it "should have active set to #{field[:active]}" do
232
- expect(fieldset_object[field[:name]].active).to eq(field[:active])
233
- end
234
- end
235
- end
236
- end
237
-
238
- end
239
- end
@@ -1,43 +0,0 @@
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 +0,0 @@
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