ruby-tls 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/spec/verify_spec.rb CHANGED
@@ -1,118 +1,118 @@
1
- require 'ruby-tls'
2
-
3
-
4
- describe RubyTls do
5
- describe RubyTls::Connection do
6
- before :each do
7
- @client = RubyTls::Connection.new
8
- @server = RubyTls::Connection.new
9
-
10
- @server_started = false
11
- @server_stop = false
12
- @client_stop = false
13
-
14
- @dir = File.dirname(File.expand_path(__FILE__)) + '/'
15
- @cert_from_file = File.read(@dir + 'client.crt')
16
- end
17
-
18
- it "should verify the peer" do
19
- @server_data = []
20
- @client_data = []
21
-
22
- @client.close_cb do
23
- @client_data << 'close'
24
- @client_stop = true
25
- end
26
- @client.dispatch_cb do |data|
27
- @client_data << data
28
- end
29
- @client.transmit_cb do |data|
30
- if not @server_started
31
- @server_started = true
32
- @server.start(:server => true, :verify_peer => true)
33
- end
34
- @server.decrypt(data) unless @client_stop
35
- end
36
- @client.handshake_cb do
37
- @client_data << 'ready'
38
- end
39
-
40
- @server.close_cb do
41
- @server_data << 'close'
42
- @server_stop = true
43
- end
44
- @server.dispatch_cb do |data|
45
- @server_data << data
46
- end
47
- @server.transmit_cb do |data|
48
- @client.decrypt(data) unless @server_stop
49
- end
50
- @server.handshake_cb do
51
- @server_data << 'ready'
52
- end
53
- @server.verify_cb do |cert|
54
- @server_data << 'verify'
55
- @cert_from_server = cert
56
- true
57
- end
58
-
59
- @client.start(:private_key_file => @dir + 'client.key', :cert_chain_file => @dir + 'client.crt')
60
-
61
-
62
- @client_data.should == ['ready']
63
- @server_data.should == ['verify', 'verify', 'verify', 'ready']
64
- @cert_from_server.should == @cert_from_file
65
- end
66
-
67
-
68
- it "should deny the connection" do
69
- @server_data = []
70
- @client_data = []
71
-
72
- @client.close_cb do
73
- @client_data << 'close'
74
- @client_stop = true
75
- end
76
- @client.dispatch_cb do |data|
77
- @client_data << data
78
- end
79
- @client.transmit_cb do |data|
80
- if not @server_started
81
- @server_started = true
82
- @server.start(:server => true, :verify_peer => true)
83
- end
84
- @server.decrypt(data) unless @client_stop
85
- end
86
- @client.handshake_cb do
87
- @client_data << 'ready'
88
- end
89
-
90
- @server.close_cb do
91
- @server_data << 'close'
92
- @server_stop = true
93
- end
94
- @server.dispatch_cb do |data|
95
- @server_data << data
96
- end
97
- @server.transmit_cb do |data|
98
- @client.decrypt(data) unless @server_stop
99
- end
100
- @server.handshake_cb do
101
- @server_data << 'ready'
102
- end
103
- @server.verify_cb do |cert|
104
- @server_data << 'verify'
105
- @cert_from_server = cert
106
- false
107
- end
108
-
109
- @client.start(:private_key_file => @dir + 'client.key', :cert_chain_file => @dir + 'client.crt')
110
-
111
-
112
- @client_data.should == []
113
- @server_data.should == ['verify', 'close', 'verify', 'close']
114
- @cert_from_server.should == @cert_from_file
115
- end
116
- end
117
- end
118
-
1
+ require 'ruby-tls'
2
+
3
+
4
+ describe RubyTls do
5
+ describe RubyTls::Connection do
6
+ before :each do
7
+ @client = RubyTls::Connection.new
8
+ @server = RubyTls::Connection.new
9
+
10
+ @server_started = false
11
+ @server_stop = false
12
+ @client_stop = false
13
+
14
+ @dir = File.dirname(File.expand_path(__FILE__)) + '/'
15
+ @cert_from_file = File.read(@dir + 'client.crt')
16
+ end
17
+
18
+ it "should verify the peer" do
19
+ @server_data = []
20
+ @client_data = []
21
+
22
+ @client.close_cb do
23
+ @client_data << 'close'
24
+ @client_stop = true
25
+ end
26
+ @client.dispatch_cb do |data|
27
+ @client_data << data
28
+ end
29
+ @client.transmit_cb do |data|
30
+ if not @server_started
31
+ @server_started = true
32
+ @server.start(:server => true, :verify_peer => true)
33
+ end
34
+ @server.decrypt(data) unless @client_stop
35
+ end
36
+ @client.handshake_cb do
37
+ @client_data << 'ready'
38
+ end
39
+
40
+ @server.close_cb do
41
+ @server_data << 'close'
42
+ @server_stop = true
43
+ end
44
+ @server.dispatch_cb do |data|
45
+ @server_data << data
46
+ end
47
+ @server.transmit_cb do |data|
48
+ @client.decrypt(data) unless @server_stop
49
+ end
50
+ @server.handshake_cb do
51
+ @server_data << 'ready'
52
+ end
53
+ @server.verify_cb do |cert|
54
+ @server_data << 'verify'
55
+ @cert_from_server = cert
56
+ true
57
+ end
58
+
59
+ @client.start(:private_key_file => @dir + 'client.key', :cert_chain_file => @dir + 'client.crt')
60
+
61
+
62
+ @client_data.should == ['ready']
63
+ @server_data.should == ['verify', 'verify', 'verify', 'ready']
64
+ @cert_from_server.should == @cert_from_file
65
+ end
66
+
67
+
68
+ it "should deny the connection" do
69
+ @server_data = []
70
+ @client_data = []
71
+
72
+ @client.close_cb do
73
+ @client_data << 'close'
74
+ @client_stop = true
75
+ end
76
+ @client.dispatch_cb do |data|
77
+ @client_data << data
78
+ end
79
+ @client.transmit_cb do |data|
80
+ if not @server_started
81
+ @server_started = true
82
+ @server.start(:server => true, :verify_peer => true)
83
+ end
84
+ @server.decrypt(data) unless @client_stop
85
+ end
86
+ @client.handshake_cb do
87
+ @client_data << 'ready'
88
+ end
89
+
90
+ @server.close_cb do
91
+ @server_data << 'close'
92
+ @server_stop = true
93
+ end
94
+ @server.dispatch_cb do |data|
95
+ @server_data << data
96
+ end
97
+ @server.transmit_cb do |data|
98
+ @client.decrypt(data) unless @server_stop
99
+ end
100
+ @server.handshake_cb do
101
+ @server_data << 'ready'
102
+ end
103
+ @server.verify_cb do |cert|
104
+ @server_data << 'verify'
105
+ @cert_from_server = cert
106
+ false
107
+ end
108
+
109
+ @client.start(:private_key_file => @dir + 'client.key', :cert_chain_file => @dir + 'client.crt')
110
+
111
+
112
+ @client_data.should == []
113
+ @server_data.should == ['verify', 'close', 'verify', 'close']
114
+ @cert_from_server.should == @cert_from_file
115
+ end
116
+ end
117
+ end
118
+
metadata CHANGED
@@ -1,73 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-tls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen von Takach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-23 00:00:00.000000000 Z
11
+ date: 2013-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi-compiler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: yard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: |2
70
- Allows transport layers outside Ruby TCP be secured.
69
+ description: ! ' Allows transport layers outside Ruby TCP be secured.
70
+
71
+ '
71
72
  email:
72
73
  - steve@cotag.me
73
74
  executables: []
@@ -95,7 +96,8 @@ files:
95
96
  - ext/Rakefile
96
97
  homepage: https://github.com/cotag/ruby-tls
97
98
  licenses:
98
- - MIT
99
+ - Ruby
100
+ - GPL
99
101
  metadata: {}
100
102
  post_install_message:
101
103
  rdoc_options: []
@@ -103,17 +105,17 @@ require_paths:
103
105
  - lib
104
106
  required_ruby_version: !ruby/object:Gem::Requirement
105
107
  requirements:
106
- - - ">="
108
+ - - ! '>='
107
109
  - !ruby/object:Gem::Version
108
110
  version: '0'
109
111
  required_rubygems_version: !ruby/object:Gem::Requirement
110
112
  requirements:
111
- - - ">="
113
+ - - ! '>='
112
114
  - !ruby/object:Gem::Version
113
115
  version: '0'
114
116
  requirements: []
115
117
  rubyforge_project:
116
- rubygems_version: 2.0.3
118
+ rubygems_version: 2.0.7
117
119
  signing_key:
118
120
  specification_version: 4
119
121
  summary: Abstract TLS for Ruby