openssl-extensions 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDNlZTQzYmJkNmZlMGFmYTBkNDhmMzUyM2JlYjhhM2E3YWVkMTViMQ==
5
+ data.tar.gz: !binary |-
6
+ ZjcyYzRmMDc2NzQ5MmYwOTc3ZWEwMjIyZDFhYTJiMzQzNmQ5MWVkOA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ZTMzNzQ1MzFhNTg0ODI1ZWViMTIyZWFhZDM1NzUyMTZjYTQyMWRlOWViNDJk
10
+ OTE0ZGVmNDA3ZDVjNTQ1NTdmNjE3OTczMzg2YWZkOWE1ZWYzMTAxYThjMWNk
11
+ ZjVjZGFkODJkNmIxNDRjN2Y4Njk5MTJjMDg1NjM1MDYwN2VlODU=
12
+ data.tar.gz: !binary |-
13
+ MWI3Mzg5MjFlNjExNzFkY2VjNTUyMjA4OGU1YmFhOTQyMWEyYjgwYjkyODQ2
14
+ ZmExMDdlZGY0ZmYxNjdmNWYxYWFmMDg5NzQxMzQ5M2IwMTUzY2ZmOWY2MjJk
15
+ MDE0YTY2OGU5ODY3ZTA0ZGY2OGViZGU3OGU1ODc3YjBlYmI3YWU=
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ Gemfile.lock
1
2
  .bundle
2
3
 
3
4
  .DS_Store
@@ -6,3 +7,7 @@ tmp
6
7
  pkg
7
8
  *.gem
8
9
 
10
+ .ruby-version
11
+ .ruby-gemset
12
+ .rbenv-version
13
+ .rvmrc
data/.rspec CHANGED
@@ -1,2 +1 @@
1
- --format Fuubar
2
1
  --color
@@ -3,13 +3,10 @@ rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
5
  - ree
6
- - jruby
7
- - rbx
8
- gemfile:
9
- - Gemfile
10
- script: "bundle exec rspec spec/"
11
- branches:
12
- only:
13
- - master
6
+ - rbx-18mode
7
+ - rbx-19mode
8
+ script: "rake spec"
14
9
  notifications:
15
- email: false
10
+ email:
11
+ on_success: change
12
+ on_failure: always
@@ -1,23 +1,38 @@
1
- ## 1.2.0, released 2011-11-03
1
+ # openssl-extensions changelog
2
2
 
3
- [full changelog](http://github.com/envylabs/openssl-extensions/compare/v1.1.0...v1.2.0)
3
+ ## [HEAD][unreleased] / unreleased
4
4
 
5
- **Enhancements**
5
+ * No significant changes.
6
6
 
7
- * Extended OpenSSL::BN to provide a #to_hex helper, a shortcut for to_s(16) \[[pyrat](https://github.com/pyrat)\]
8
- * Extended OpenSSL::X509::Certificate, adding #authority_info_access and #crl_distribution_points methods \[[pyrat](https://github.com/pyrat)\]
7
+ ## [1.2.1][v1.2.1] / 2013-06-11
9
8
 
10
- ## 1.1.0, released 2011-01-20
9
+ * Fix strength calculation with X509 certificates encrypted with DSA keys.
10
+ * Loosen the RSpec dependency requirements to ~> 2.x.
11
+ * Fix failing specs in CRL distribution points.
11
12
 
12
- [full changelog](http://github.com/envylabs/openssl-extensions/compare/v1.0.0...v1.1.0)
13
+ ## [1.2.0][v1.2.0] / 2011-11-03
13
14
 
14
- **Enhancements**
15
+ * Extended OpenSSL::BN to provide a #to_hex helper, a shortcut for to_s(16)
16
+ \[[pyrat][pyrat]\]
17
+ * Extended OpenSSL::X509::Certificate, adding #authority_info_access and
18
+ #crl_distribution_points methods \[[pyrat][pyrat]\]
19
+
20
+ ## [1.1.0][v1.1.0] / 2011-01-20
15
21
 
16
22
  * Extended OpenSSL::PKey::PKey to add equality methods
17
23
 
18
- ## 1.0.0, released 2011-01-17
24
+ ## 1.0.0 / 2011-01-17
19
25
 
20
26
  * Initial major release.
21
- * Extended OpenSSL::X509::Request, OpenSSL::X509::Certificate, OpenSSL::X509::Name
22
- * Added OpenSSLExtensions::X509::CertificateChain and OpenSSLExtensions::X509::AuthorityKeyIdentifier
27
+ * Extended OpenSSL::X509::Request, OpenSSL::X509::Certificate,
28
+ OpenSSL::X509::Name
29
+ * Added OpenSSLExtensions::X509::CertificateChain and
30
+ OpenSSLExtensions::X509::AuthorityKeyIdentifier
31
+
32
+
33
+ [unreleased]: https://github.com/envylabs/openssl-extensions/compare/v1.2.1...master
34
+ [v1.2.1]: https://github.com/envylabs/openssl-extensions/compare/v1.2.0...v1.2.1
35
+ [v1.2.0]: https://github.com/envylabs/openssl-extensions/compare/v1.1.0...v1.2.0
36
+ [v1.1.0]: https://github.com/envylabs/openssl-extensions/compare/v1.0.0...v1.1.0
23
37
 
38
+ [pyrat]: https://github.com/pyrat
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # OpenSSL Extensions [![Build status][ci-image]][ci]
1
+ # OpenSSL Extensions
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/openssl-extensions.png)](http://badge.fury.io/rb/openssl-extensions)
4
+ [![Build Status](https://secure.travis-ci.org/envylabs/openssl-extensions.png?branch=master)](http://travis-ci.org/envylabs/openssl-extensions)
5
+ [![Code Climate](https://codeclimate.com/github/envylabs/openssl-extensions.png)](https://codeclimate.com/github/envylabs/openssl-extensions)
2
6
 
3
7
  This library generally provides helper methods which makes working with
4
8
  OpenSSL a little more bearable. It does, however, provide some additional
@@ -9,14 +13,20 @@ features of the library.
9
13
 
10
14
  With [Bundler](http://gembundler.com):
11
15
 
12
- gem 'openssl-extensions', :require => 'openssl-extensions/all'
16
+ ```ruby
17
+ gem 'openssl-extensions', :require => 'openssl-extensions/all'
18
+ ```
13
19
 
14
20
  With standard RubyGems:
15
21
 
16
- gem install openssl-extensions
22
+ ```shell
23
+ gem install openssl-extensions
24
+ ```
17
25
 
18
- require 'rubygems'
19
- require 'openssl-extensions/all'
26
+ ```ruby
27
+ require 'rubygems'
28
+ require 'openssl-extensions/all'
29
+ ```
20
30
 
21
31
  Once required, the extensions are automatically applied.
22
32
 
@@ -31,23 +41,42 @@ OpenSSL::X509::NAME).
31
41
  Below is a simple example exercising a few helpers provided by this
32
42
  library:
33
43
 
34
- csr_body = File.read('example.csr') # assuming this is valid and exists
35
- request = OpenSSL::X509::Request.new(csr_body)
44
+ ```ruby
45
+ csr_body = File.read('example.csr') # assuming this is valid and exists
46
+ request = OpenSSL::X509::Request.new(csr_body)
36
47
 
37
- request.subject.common_name # => "example.com"
38
- request.subject.organization # => "Example Corp"
39
- request.subject.locality # => "Orlando"
40
- request.subject.region # => "Florida"
41
- request.subject.country # => "US"
42
- request.subject.location # => "Orlando, Florida, US"
48
+ request.subject.common_name # => "example.com"
49
+ request.subject.organization # => "Example Corp"
50
+ request.subject.locality # => "Orlando"
51
+ request.subject.region # => "Florida"
52
+ request.subject.country # => "US"
53
+ request.subject.location # => "Orlando, Florida, US"
43
54
 
44
- request.strength # => 2048
45
- request.challenge_password? # => false
46
- request.subject_alternative_names # => ['example.com', 'www.example.com']
55
+ request.strength # => 2048
56
+ request.challenge_password? # => false
57
+ request.subject_alternative_names # => ['example.com', 'www.example.com']
58
+ ```
59
+
60
+ ## Supported Ruby Implementations
61
+
62
+ This OpenSSL extension library currently supports (and is continuously tested
63
+ against) the following Ruby implementations:
64
+
65
+ * [MRI 1.8.7][mri]
66
+ * [MRI 1.9.2][mri]
67
+ * [MRI 1.9.3][mri]
68
+ * [Ruby Enterprise Edition][ree]
69
+ * [Rubinius][rubinius]
70
+
71
+ The following implementations are known to be incompatible:
72
+
73
+ * [JRuby][jruby]
47
74
 
48
75
  ## License
49
76
 
50
77
  Released under the MIT License. See the LICENSE file for further details.
51
78
 
52
- [ci]: http://travis-ci.org/nbibler/openssl-extensions
53
- [ci-image]: https://secure.travis-ci.org/nbibler/openssl-extensions.png
79
+ [mri]: http://www.ruby-lang.org/
80
+ [ree]: http://www.rubyenterpriseedition.com/
81
+ [rubinius]: http://rubini.us/
82
+ [jruby]: http://jruby.org/
data/Rakefile CHANGED
@@ -1,9 +1,5 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ require 'bundler/gem_tasks'
3
2
  require 'rspec/core/rake_task'
4
3
 
4
+ RSpec::Core::RakeTask.new(:spec)
5
5
  task :default => :spec
6
-
7
- RSpec::Core::RakeTask.new(:spec) do |t|
8
- t.pattern = 'spec/**/*_spec.rb'
9
- end
@@ -1,5 +1,4 @@
1
1
  module OpenSSLExtensions
2
-
3
2
  ##
4
3
  # Ensures that the current Ruby was compiled with OpenSSL support enabled.
5
4
  #
@@ -11,5 +10,4 @@ module OpenSSLExtensions
11
10
  exit(1)
12
11
  end
13
12
  end
14
-
15
13
  end
@@ -2,6 +2,8 @@ require 'openssl-extensions'
2
2
  OpenSSLExtensions.check_dependencies!
3
3
 
4
4
  require 'openssl-extensions/pkey/pkey'
5
+ require 'openssl-extensions/pkey/dsa'
6
+ require 'openssl-extensions/pkey/rsa'
5
7
  require 'openssl-extensions/x509/certificate'
6
8
  require 'openssl-extensions/x509/certificate_chain'
7
9
  require 'openssl-extensions/x509/request'
@@ -0,0 +1,13 @@
1
+ require 'openssl-extensions'
2
+ require 'openssl-extensions/pkey'
3
+
4
+ ##
5
+ # Extends OpenSSL::PKey::RSA with helper methods.
6
+ #
7
+ module OpenSSLExtensions::PKey::DSA
8
+ def strength
9
+ p.num_bits
10
+ end
11
+ end
12
+
13
+ OpenSSL::PKey::DSA.send(:include, OpenSSLExtensions::PKey::DSA)
@@ -5,6 +5,8 @@ require 'openssl-extensions/pkey'
5
5
  # Extends OpenSSL::PKey::PKey and its submodules with helper methods.
6
6
  #
7
7
  module OpenSSLExtensions::PKey::PKey
8
+ UnknownAlgorithmError = Class.new(RuntimeError)
9
+
8
10
  ##
9
11
  # Equality is tested by comparing the instances' +hash+.
10
12
  #
@@ -21,6 +23,13 @@ module OpenSSLExtensions::PKey::PKey
21
23
  def hash
22
24
  to_pem.hash
23
25
  end
26
+
27
+ ##
28
+ # Returns the strength of the public key in number of bits.
29
+ #
30
+ def strength
31
+ raise UnknownAlgorithmError
32
+ end
24
33
  end
25
34
 
26
35
  OpenSSL::PKey::PKey.send(:include, OpenSSLExtensions::PKey::PKey)
@@ -0,0 +1,13 @@
1
+ require 'openssl-extensions'
2
+ require 'openssl-extensions/pkey'
3
+
4
+ ##
5
+ # Extends OpenSSL::PKey::RSA with helper methods.
6
+ #
7
+ module OpenSSLExtensions::PKey::RSA
8
+ def strength
9
+ n.num_bits
10
+ end
11
+ end
12
+
13
+ OpenSSL::PKey::RSA.send(:include, OpenSSLExtensions::PKey::RSA)
@@ -3,7 +3,6 @@ require 'openssl-extensions/ssl'
3
3
  require 'openssl-extensions/x509/certificate_chain'
4
4
 
5
5
  module OpenSSLExtensions::SSL::SSLSocket
6
-
7
6
  def self.included(base)
8
7
  base.send(:alias_method,
9
8
  :peer_cert_chain_without_openssl_extension,
@@ -22,7 +21,6 @@ module OpenSSLExtensions::SSL::SSLSocket
22
21
  OpenSSLExtensions::X509::CertificateChain.
23
22
  new(peer_cert, peer_cert_chain_without_openssl_extension)
24
23
  end
25
-
26
24
  end
27
25
 
28
26
  OpenSSL::SSL::SSLSocket.send(:include, OpenSSLExtensions::SSL::SSLSocket)
@@ -1,3 +1,3 @@
1
1
  module OpenSSLExtensions
2
- Version = '1.2.0'
2
+ Version = '1.2.1'
3
3
  end
@@ -15,19 +15,9 @@ class OpenSSLExtensions::X509::AuthorityKeyIdentifier
15
15
  parse(extension_string.dup) if extension_string
16
16
  end
17
17
 
18
- def parse(string)
19
- Hash[string.scan(%r{(\w+):([^,\n]+)})].tap do |h|
20
- @issuer_name = common_name(strip(h['DirName']))
21
- @serial_number = strip(h['serial'])
22
- @key_id = strip(h['keyid'])
23
- end
24
- end
25
- private :parse
26
18
 
27
- def strip(input)
28
- input ? input.to_s.strip : nil
29
- end
30
- private :strip
19
+ private
20
+
31
21
 
32
22
  def common_name(input)
33
23
  if input
@@ -37,6 +27,16 @@ class OpenSSLExtensions::X509::AuthorityKeyIdentifier
37
27
  name[1] if name
38
28
  end
39
29
  end
40
- private :common_name
41
30
 
31
+ def parse(string)
32
+ Hash[string.scan(%r{(\w+):([^,\n]+)})].tap do |h|
33
+ @issuer_name = common_name(strip(h['DirName']))
34
+ @serial_number = strip(h['serial'])
35
+ @key_id = strip(h['keyid'])
36
+ end
37
+ end
38
+
39
+ def strip(input)
40
+ input ? input.to_s.strip : nil
41
+ end
42
42
  end
@@ -6,7 +6,6 @@ require 'openssl-extensions/x509/authority_key_identifier'
6
6
  # Extends OpenSSL::X509::Certificate with shortcut methods.
7
7
  #
8
8
  module OpenSSLExtensions::X509::Certificate
9
-
10
9
  ##
11
10
  # Equality is tested by comparing the generated PEM signatures.
12
11
  #
@@ -31,7 +30,7 @@ module OpenSSLExtensions::X509::Certificate
31
30
  ##
32
31
  # Override the default Object#hash to identify uniqueness of the
33
32
  # Certificate. This uses a hash of the certificate PEM.
34
- #
33
+ #
35
34
  def hash
36
35
  to_pem.hash
37
36
  end
@@ -49,11 +48,6 @@ module OpenSSLExtensions::X509::Certificate
49
48
  self.issuer.organization == issuer.subject.organization)
50
49
  end
51
50
 
52
- def read_extension_by_oid(oid)
53
- (extensions.detect { |e| e.to_a.first == oid } || []).to_a[1]
54
- end
55
- protected :read_extension_by_oid
56
-
57
51
  ##
58
52
  # Returns +true+ if this certificate is a root certificate (it is its
59
53
  # own issuer).
@@ -67,7 +61,7 @@ module OpenSSLExtensions::X509::Certificate
67
61
  # Returns the bit strength of the public certificate.
68
62
  #
69
63
  def strength
70
- public_key.n.num_bits
64
+ public_key.strength
71
65
  end
72
66
 
73
67
  ##
@@ -83,13 +77,13 @@ module OpenSSLExtensions::X509::Certificate
83
77
  def subject_key_identifier
84
78
  read_extension_by_oid('subjectKeyIdentifier')
85
79
  end
86
-
80
+
87
81
  ##
88
82
  # This can be used for getting OCSP Urls for revocation checks.
89
83
  def authority_info_access
90
84
  read_extension_by_oid('authorityInfoAccess')
91
85
  end
92
-
86
+
93
87
  def crl_distribution_points
94
88
  read_extension_by_oid('crlDistributionPoints')
95
89
  end
@@ -110,7 +104,14 @@ module OpenSSLExtensions::X509::Certificate
110
104
  $1.to_i
111
105
  end
112
106
  end
113
-
107
+
108
+
109
+ protected
110
+
111
+
112
+ def read_extension_by_oid(oid)
113
+ (extensions.detect { |e| e.to_a.first == oid } || []).to_a[1]
114
+ end
114
115
  end
115
116
 
116
117
  OpenSSL::X509::Certificate.send(:include, OpenSSLExtensions::X509::Certificate)
@@ -21,10 +21,13 @@ class OpenSSLExtensions::X509::CertificateChain
21
21
  reorganize!(peer_certificate, certificates)
22
22
  end
23
23
 
24
+
25
+ private
26
+
27
+
24
28
  def method_missing(method, *args, &block)
25
29
  @certificates.send(method, *args, &block)
26
30
  end
27
- private :method_missing
28
31
 
29
32
  def reorganize!(site_certificate, certificates)
30
33
  return unless site_certificate && !certificates.empty?
@@ -41,5 +44,4 @@ class OpenSSLExtensions::X509::CertificateChain
41
44
  end
42
45
  end
43
46
  end
44
- private :reorganize!
45
47
  end
@@ -25,16 +25,11 @@ module OpenSSLExtensions::X509::Request
25
25
  ##
26
26
  # Override the default Object#hash to identify uniqueness of the
27
27
  # Request. This uses a hash of the PEM.
28
- #
28
+ #
29
29
  def hash
30
30
  to_pem.hash
31
31
  end
32
32
 
33
- def read_attributes_by_oid(*oids)
34
- attributes.detect { |a| oids.include?(a.oid) }
35
- end
36
- protected :read_attributes_by_oid
37
-
38
33
  ##
39
34
  # Returns the bit strength of the public key used for the signing
40
35
  # request.
@@ -64,6 +59,13 @@ module OpenSSLExtensions::X509::Request
64
59
  end
65
60
  alias :sans :subject_alternative_names
66
61
 
62
+
63
+ protected
64
+
65
+
66
+ def read_attributes_by_oid(*oids)
67
+ attributes.detect { |a| oids.include?(a.oid) }
68
+ end
67
69
  end
68
70
 
69
71
  OpenSSL::X509::Request.send(:include, OpenSSLExtensions::X509::Request)
@@ -1,25 +1,22 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  lib = File.expand_path('../lib/', __FILE__)
3
- $:.unshift lib unless $:.include?(lib)
4
-
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
4
  require 'openssl-extensions/version'
6
5
 
7
- Gem::Specification.new do |s|
8
- s.name = 'openssl-extensions'
9
- s.version = OpenSSLExtensions::Version
10
- s.platform = Gem::Platform::RUBY
11
- s.authors = ['Nathaniel Bibler']
12
- s.email = ['nate@envylabs.com']
13
- s.homepage = 'http://github.com/envylabs/openssl-extensions'
14
- s.summary = 'Helper methods and extensions for OpenSSL to make the interface more intuitive.'
15
- s.description = 'This library patches OpenSSL to add helper methods and extensions to OpenSSL objects with the intention of making the interface more intuitive.'
16
- s.required_rubygems_version = '>= 1.3.6'
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'openssl-extensions'
8
+ spec.version = OpenSSLExtensions::Version
9
+ spec.authors = ["Envy Labs"]
10
+ spec.email = [""]
11
+ spec.summary = 'Helper methods and extensions for OpenSSL to make the interface more intuitive.'
12
+ spec.description = 'This library patches OpenSSL to add helper methods and extensions to OpenSSL objects with the intention of making the interface more intuitive.'
13
+ spec.homepage = 'http://github.com/envylabs/openssl-extensions'
14
+ spec.license = 'MIT'
17
15
 
18
- s.add_development_dependency 'rspec', '~> 2.4.0'
19
- s.add_development_dependency 'fuubar', '~> 0.0.1'
16
+ spec.add_development_dependency 'rspec', '~> 2.4'
20
17
 
21
- s.files = `git ls-files`.split("\n")
22
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
23
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
24
- s.require_paths = ["lib"]
18
+ spec.files = `git ls-files`.split($/)
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
25
22
  end
@@ -0,0 +1,19 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDJDCCAuGgAwIBAgIET6p/CDALBgcqhkjOOAQDBQAwdTELMAkGA1UEBhMCVVMx
3
+ CzAJBgNVBAgTAk1EMRcwFQYDVQQHEw5NYXJyaW90dHN2aWxsZTEMMAoGA1UEChMD
4
+ QkdUMQswCQYDVQQLEwJJVDElMCMGA1UEAxMcYmd0aGVscGRlc2suYnJheHRvbmdy
5
+ YW50LmNvbTAeFw0xMjA1MDkxNDI4MjRaFw0xNTA1MDkxNDI4MjRaMHUxCzAJBgNV
6
+ BAYTAlVTMQswCQYDVQQIEwJNRDEXMBUGA1UEBxMOTWFycmlvdHRzdmlsbGUxDDAK
7
+ BgNVBAoTA0JHVDELMAkGA1UECxMCSVQxJTAjBgNVBAMTHGJndGhlbHBkZXNrLmJy
8
+ YXh0b25ncmFudC5jb20wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11EilS
9
+ 30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuA
10
+ HTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVU
11
+ E1oWkTL2dfOuK2HXKu/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKB
12
+ gQD34aCF1ps93su8q1w2uFe5eZSvu/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGA
13
+ tEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64eK7OmdZFuo38L+iE1YvH7YnoB
14
+ JDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAACgYBAQ5zGDMvY
15
+ d0s/pZMeeViCgd4R6GxTpJ6+PmRcZd+Qt9X05XvueffnKtORUmnfCrgr3PyxxEoD
16
+ Nlapvpv9jH3HDfWhVNFIj70PsZdYJ1GMOudg8pfxCxfRjtD1upxfNeJ1d7DH3q0j
17
+ Oxq3lNQle3rhi6nH+7sTAluc8NoRFJ/5YTALBgcqhkjOOAQDBQADMAAwLQIVAInO
18
+ kQcVY0d0SUFKr7GGiF7o+zD2AhRL7oFGOAWewa/KiS+2n6JSlDwrjA==
19
+ -----END CERTIFICATE-----
@@ -16,11 +16,17 @@ describe OpenSSLExtensions::X509::Certificate do
16
16
  it { should == 2048 }
17
17
  end
18
18
 
19
- context 'for a 1024 bit certificate' do
19
+ context 'for a 1024 bit RSA-signed certificate' do
20
20
  let(:certificate) { extended_ssl_certificates('www.twongo.com') }
21
21
 
22
22
  it { should == 1024 }
23
23
  end
24
+
25
+ context 'for a 1024 bit DSA-signed certificate' do
26
+ let(:certificate) { extended_ssl_certificates('bgthelpdesk.braxtongrant.com') }
27
+
28
+ it { should == 1024 }
29
+ end
24
30
  end
25
31
 
26
32
  context 'allows_certificate_signing?' do
@@ -131,12 +137,15 @@ describe OpenSSLExtensions::X509::Certificate do
131
137
  context 'crl_distribution_points' do
132
138
  subject { certificate.crl_distribution_points }
133
139
 
134
- it { should == "URI:http://EVSSL-crl.geotrust.com/crls/gtextvalca.crl\n" }
140
+ it { should be_a String }
141
+ it { should include "URI:http://EVSSL-crl.geotrust.com/crls/gtextvalca.crl" }
135
142
  end
136
143
 
137
144
  context 'authority_info_access' do
138
145
  subject { certificate.authority_info_access }
139
146
 
140
- it { should == "OCSP - URI:http://EVSSL-ocsp.geotrust.com\nCA Issuers - URI:http://EVSSL-aia.geotrust.com/evca.crt\n" }
147
+ it { should be_a String }
148
+ it { should include "OCSP - URI:http://EVSSL-ocsp.geotrust.com" }
149
+ it { should include "CA Issuers - URI:http://EVSSL-aia.geotrust.com/evca.crt" }
141
150
  end
142
151
  end
metadata CHANGED
@@ -1,53 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openssl-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.2.1
6
5
  platform: ruby
7
6
  authors:
8
- - Nathaniel Bibler
7
+ - Envy Labs
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-11-03 00:00:00.000000000Z
11
+ date: 2013-06-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
- requirement: &2152536060 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 2.4.0
19
+ version: '2.4'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *2152536060
25
- - !ruby/object:Gem::Dependency
26
- name: fuubar
27
- requirement: &2152563220 !ruby/object:Gem::Requirement
28
- none: false
22
+ version_requirements: !ruby/object:Gem::Requirement
29
23
  requirements:
30
24
  - - ~>
31
25
  - !ruby/object:Gem::Version
32
- version: 0.0.1
33
- type: :development
34
- prerelease: false
35
- version_requirements: *2152563220
26
+ version: '2.4'
36
27
  description: This library patches OpenSSL to add helper methods and extensions to
37
28
  OpenSSL objects with the intention of making the interface more intuitive.
38
29
  email:
39
- - nate@envylabs.com
30
+ - ''
40
31
  executables: []
41
32
  extensions: []
42
33
  extra_rdoc_files: []
43
34
  files:
44
35
  - .gitignore
45
36
  - .rspec
46
- - .rvmrc
47
37
  - .travis.yml
48
38
  - CHANGELOG.md
49
39
  - Gemfile
50
- - Gemfile.lock
51
40
  - LICENSE
52
41
  - README.md
53
42
  - Rakefile
@@ -56,7 +45,9 @@ files:
56
45
  - lib/openssl-extensions/all.rb
57
46
  - lib/openssl-extensions/bn.rb
58
47
  - lib/openssl-extensions/pkey.rb
48
+ - lib/openssl-extensions/pkey/dsa.rb
59
49
  - lib/openssl-extensions/pkey/pkey.rb
50
+ - lib/openssl-extensions/pkey/rsa.rb
60
51
  - lib/openssl-extensions/ssl.rb
61
52
  - lib/openssl-extensions/ssl/ssl_socket.rb
62
53
  - lib/openssl-extensions/version.rb
@@ -73,6 +64,7 @@ files:
73
64
  - spec/fixtures/certificate_requests/geocerts.csr
74
65
  - spec/fixtures/certificate_requests/sans.csr
75
66
  - spec/fixtures/certificates/app1.hongkongpost.com.pem
67
+ - spec/fixtures/certificates/bgthelpdesk.braxtongrant.com.pem
76
68
  - spec/fixtures/certificates/equifax-secure-ca.pem
77
69
  - spec/fixtures/certificates/geotrust-extended-validation-ssl-ca.pem
78
70
  - spec/fixtures/certificates/geotrust-primary-certification-authority.pem
@@ -104,28 +96,28 @@ files:
104
96
  - spec/support/pkey_fixtures.rb
105
97
  - spec/support/ssl_certificate_fixtures.rb
106
98
  homepage: http://github.com/envylabs/openssl-extensions
107
- licenses: []
99
+ licenses:
100
+ - MIT
101
+ metadata: {}
108
102
  post_install_message:
109
103
  rdoc_options: []
110
104
  require_paths:
111
105
  - lib
112
106
  required_ruby_version: !ruby/object:Gem::Requirement
113
- none: false
114
107
  requirements:
115
108
  - - ! '>='
116
109
  - !ruby/object:Gem::Version
117
110
  version: '0'
118
111
  required_rubygems_version: !ruby/object:Gem::Requirement
119
- none: false
120
112
  requirements:
121
113
  - - ! '>='
122
114
  - !ruby/object:Gem::Version
123
- version: 1.3.6
115
+ version: '0'
124
116
  requirements: []
125
117
  rubyforge_project:
126
- rubygems_version: 1.8.10
118
+ rubygems_version: 2.0.3
127
119
  signing_key:
128
- specification_version: 3
120
+ specification_version: 4
129
121
  summary: Helper methods and extensions for OpenSSL to make the interface more intuitive.
130
122
  test_files:
131
123
  - spec/fixtures/certificate_requests/1024.csr
@@ -134,6 +126,7 @@ test_files:
134
126
  - spec/fixtures/certificate_requests/geocerts.csr
135
127
  - spec/fixtures/certificate_requests/sans.csr
136
128
  - spec/fixtures/certificates/app1.hongkongpost.com.pem
129
+ - spec/fixtures/certificates/bgthelpdesk.braxtongrant.com.pem
137
130
  - spec/fixtures/certificates/equifax-secure-ca.pem
138
131
  - spec/fixtures/certificates/geotrust-extended-validation-ssl-ca.pem
139
132
  - spec/fixtures/certificates/geotrust-primary-certification-authority.pem
data/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm_gemset_create_on_use_flag=1
2
- rvm gemset use openssl-extensions
@@ -1,31 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- openssl-extensions (1.2.0)
5
-
6
- GEM
7
- remote: http://rubygems.org/
8
- specs:
9
- diff-lcs (1.1.2)
10
- fuubar (0.0.3)
11
- rspec (~> 2.0)
12
- rspec-instafail (~> 0.1.4)
13
- ruby-progressbar (~> 0.0.9)
14
- rspec (2.4.0)
15
- rspec-core (~> 2.4.0)
16
- rspec-expectations (~> 2.4.0)
17
- rspec-mocks (~> 2.4.0)
18
- rspec-core (2.4.0)
19
- rspec-expectations (2.4.0)
20
- diff-lcs (~> 1.1.2)
21
- rspec-instafail (0.1.5)
22
- rspec-mocks (2.4.0)
23
- ruby-progressbar (0.0.9)
24
-
25
- PLATFORMS
26
- ruby
27
-
28
- DEPENDENCIES
29
- fuubar (~> 0.0.1)
30
- openssl-extensions!
31
- rspec (~> 2.4.0)