polarssl 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ void Init_ssl();
File without changes
@@ -0,0 +1,6 @@
1
+ require "polarssl/version"
2
+ require "polarssl/polarssl"
3
+
4
+ module PolarSSL
5
+
6
+ end
@@ -0,0 +1,8 @@
1
+ {
2
+ "folders":
3
+ [
4
+ {
5
+ "path": "/Users/michiel/Code/polarssl-ruby"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,21 @@
1
+ lib = File.expand_path("../lib/", __FILE__)
2
+ $:.unshift lib unless $:.include?(lib)
3
+
4
+ require 'polarssl/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'polarssl'
8
+ s.version = PolarSSL::VERSION
9
+ s.date = '2013-08-20'
10
+ s.summary = 'Use the PolarSSL cryptographic and SSL library in Ruby.'
11
+ s.description = 'A gem that lets you use the PolarSSL cryptography library with Ruby.'
12
+ s.authors = ['Michiel Sikkes']
13
+ s.email = 'michiel.sikkes@gmail.com'
14
+ s.files = `git ls-files`.split("\n")
15
+ s.homepage = 'http://github.com/michiels/polarssl-ruby'
16
+ s.license = 'LGPL-3'
17
+ s.test_files = Dir.glob('test/*_test.rb')
18
+ s.requirements = 'libpolarssl'
19
+
20
+ s.extensions = %w[ext/polarssl/extconf.rb]
21
+ end
@@ -0,0 +1,10 @@
1
+ require_relative 'test_helper'
2
+
3
+ class CtrDrbgTest < MiniTest::Unit::TestCase
4
+
5
+ def test_new
6
+ entropy = PolarSSL::Entropy.new
7
+ ctr_drbg = PolarSSL::CtrDrbg.new(entropy)
8
+ end
9
+
10
+ end
@@ -0,0 +1,14 @@
1
+ require_relative 'test_helper'
2
+
3
+ class EntropyTest < MiniTest::Unit::TestCase
4
+
5
+ def test_initialize
6
+ entropy = PolarSSL::Entropy.new
7
+ end
8
+
9
+ def test_gather
10
+ entropy = PolarSSL::Entropy.new
11
+ assert entropy.gather()
12
+ end
13
+
14
+ end
@@ -0,0 +1,41 @@
1
+ require_relative 'test_helper'
2
+ require 'socket'
3
+
4
+ class SSLConnectionTest < MiniTest::Unit::TestCase
5
+
6
+ def test_simple_connection
7
+
8
+ socket = TCPSocket.new('polarssl.org', 443)
9
+
10
+ entropy = PolarSSL::Entropy.new
11
+
12
+ ctr_drbg = PolarSSL::CtrDrbg.new(entropy)
13
+
14
+ ssl = PolarSSL::SSL.new
15
+
16
+ ssl.set_endpoint(PolarSSL::SSL::SSL_IS_CLIENT)
17
+ ssl.set_authmode(PolarSSL::SSL::SSL_VERIFY_NONE)
18
+ ssl.set_rng(ctr_drbg)
19
+
20
+ ssl.set_socket(socket)
21
+
22
+ ssl.handshake
23
+
24
+ ssl.write("GET / HTTP/1.0\r\nHost: polarssl.org\r\n\r\n")
25
+
26
+ response = ""
27
+
28
+ while chunk = ssl.read(1024)
29
+ response << chunk
30
+ end
31
+
32
+ assert response.length > 0
33
+
34
+ ssl.close_notify
35
+
36
+ socket.close
37
+
38
+ ssl.close
39
+ end
40
+
41
+ end
@@ -0,0 +1,2 @@
1
+ require 'minitest/autorun'
2
+ require 'polarssl'
@@ -0,0 +1,9 @@
1
+ require_relative 'test_helper'
2
+
3
+ class TestVerifyMiniTest < MiniTest::Unit::TestCase
4
+
5
+ def test_truth
6
+ assert true
7
+ end
8
+
9
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: polarssl
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Michiel Sikkes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A gem that lets you use the PolarSSL cryptography library with Ruby.
14
+ email: michiel.sikkes@gmail.com
15
+ executables: []
16
+ extensions:
17
+ - ext/polarssl/extconf.rb
18
+ extra_rdoc_files: []
19
+ files:
20
+ - .gitignore
21
+ - .ruby-version
22
+ - .travis.yml
23
+ - COPYING
24
+ - COPYING.LESSER
25
+ - Gemfile
26
+ - Gemfile.lock
27
+ - RDOC_MAIN.rdoc
28
+ - README.md
29
+ - Rakefile
30
+ - ext/polarssl/ctr_drbg.c
31
+ - ext/polarssl/ctr_drbg.h
32
+ - ext/polarssl/entropy.c
33
+ - ext/polarssl/entropy.h
34
+ - ext/polarssl/extconf.rb
35
+ - ext/polarssl/polarssl.c
36
+ - ext/polarssl/polarssl.h
37
+ - ext/polarssl/ssl.c
38
+ - ext/polarssl/ssl.h
39
+ - lib/.gitkeep
40
+ - lib/polarssl.rb
41
+ - polarssl-ruby.sublime-project
42
+ - polarssl.gemspec
43
+ - test/ctr_drbg_test.rb
44
+ - test/entropy_test.rb
45
+ - test/ssl_connection_test.rb
46
+ - test/test_helper.rb
47
+ - test/verify_minitest_test.rb
48
+ homepage: http://github.com/michiels/polarssl-ruby
49
+ licenses:
50
+ - LGPL-3
51
+ metadata: {}
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements:
67
+ - libpolarssl
68
+ rubyforge_project:
69
+ rubygems_version: 2.0.2
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Use the PolarSSL cryptographic and SSL library in Ruby.
73
+ test_files:
74
+ - test/ctr_drbg_test.rb
75
+ - test/entropy_test.rb
76
+ - test/ssl_connection_test.rb
77
+ - test/verify_minitest_test.rb