rubysl-cgi-session 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d088553a5e245623a542a656a6cb6432660ba64
4
- data.tar.gz: 8529b1a506ff74f4cb91e39d782f748575f87c3c
3
+ metadata.gz: 26ddaaae4f815c0c26d3bc998c30839fe7e8ffca
4
+ data.tar.gz: 66fcf294aae7f3bed56b6def187313004648279c
5
5
  SHA512:
6
- metadata.gz: f047f931c5c0de2b61b71158f18833028b15d25e2b5692b6ad9859b265414f4f5bde68d321f89a9d08e2aec7bc3d718c9d4a137440f8825632ffb3f2db0edfde
7
- data.tar.gz: 5f87fe86e6f4cc8b5e4d22a15c41977c5094cb9fdb00ae8601153ad94b311a4cb732c12b52ad540a15a8c60fb040a017bdf2e83f741b88634f82ac09b4f312b7
6
+ metadata.gz: e6cf43c1c58ca67750542b2a077d6a235aa7f36135c95ca65a04611086864369445916c3805e0c61e806ec55bc0d7e7ae93bbb705c2abe03e6e5c6b4b40c4c09
7
+ data.tar.gz: 2c0ca9519a3080c8d6e7be6e830266b03bd8df1abfc895dfc0553b17bda550daadf27233517f15199b42f447d64b1a794db0d879d672ebbad9615fa70dda2c01
@@ -5,10 +5,10 @@ env:
5
5
  script: mspec spec
6
6
  rvm:
7
7
  - 2.0.0
8
- - rbx-2.1.1
8
+ - rbx-2.2.1
9
9
  matrix:
10
10
  exclude:
11
11
  - rvm: 2.0.0
12
12
  env: RUBYLIB=lib
13
- - rvm: rbx-2.1.1
13
+ - rvm: rbx-2.2.1
14
14
  env: RUBYLIB=
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
@@ -163,24 +163,26 @@ class CGI
163
163
 
164
164
  # Create a new session id.
165
165
  #
166
- # The session id is an MD5 hash based upon the time,
167
- # a random number, and a constant string. This routine
168
- # is used internally for automatically generated
169
- # session ids.
166
+ # The session id is a secure random number by SecureRandom
167
+ # if possible, otherwise an SHA512 hash based upon the time,
168
+ # a random number, and a constant string. This routine is
169
+ # used internally for automatically generated session ids.
170
170
  def create_new_id
171
171
  require 'securerandom'
172
172
  begin
173
+ # by OpenSSL, or system provided entropy pool
173
174
  session_id = SecureRandom.hex(16)
174
175
  rescue NotImplementedError
175
- require 'digest/md5'
176
- md5 = Digest::MD5::new
176
+ # never happens on modern systems
177
+ require 'digest'
178
+ d = Digest('SHA512').new
177
179
  now = Time::now
178
- md5.update(now.to_s)
179
- md5.update(String(now.usec))
180
- md5.update(String(rand(0)))
181
- md5.update(String($$))
182
- md5.update('foobar')
183
- session_id = md5.hexdigest
180
+ d.update(now.to_s)
181
+ d.update(String(now.usec))
182
+ d.update(String(rand(0)))
183
+ d.update(String($$))
184
+ d.update('foobar')
185
+ session_id = d.hexdigest[0, 32]
184
186
  end
185
187
  session_id
186
188
  end
@@ -453,7 +455,7 @@ class CGI
453
455
  #
454
456
  # +session+ is the session this instance is associated with.
455
457
  # +option+ is a list of initialisation options. None are
456
- # currently recognised.
458
+ # currently recognized.
457
459
  def initialize(session, option=nil)
458
460
  @session_id = session.session_id
459
461
  unless GLOBAL_HASH_TABLE.key?(@session_id)
@@ -1,7 +1,7 @@
1
1
  module RubySL
2
2
  module CGI
3
3
  module Session
4
- VERSION = "2.0.1"
4
+ VERSION = "2.1.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,24 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysl-cgi-session
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-09 00:00:00.000000000 Z
11
+ date: 2015-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
+ type: :development
16
+ prerelease: false
15
17
  requirement: !ruby/object:Gem::Requirement
16
18
  requirements:
17
19
  - - "~>"
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.3'
20
- type: :development
21
- prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
@@ -26,13 +26,13 @@ dependencies:
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
+ type: :development
30
+ prerelease: false
29
31
  requirement: !ruby/object:Gem::Requirement
30
32
  requirements:
31
33
  - - "~>"
32
34
  - !ruby/object:Gem::Version
33
35
  version: '10.0'
34
- type: :development
35
- prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
@@ -40,13 +40,13 @@ dependencies:
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mspec
43
+ type: :development
44
+ prerelease: false
43
45
  requirement: !ruby/object:Gem::Requirement
44
46
  requirements:
45
47
  - - "~>"
46
48
  - !ruby/object:Gem::Version
47
49
  version: '1.5'
48
- type: :development
49
- prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
@@ -54,13 +54,13 @@ dependencies:
54
54
  version: '1.5'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubysl-prettyprint
57
+ type: :development
58
+ prerelease: false
57
59
  requirement: !ruby/object:Gem::Requirement
58
60
  requirements:
59
61
  - - "~>"
60
62
  - !ruby/object:Gem::Version
61
63
  version: '2.0'
62
- type: :development
63
- prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
@@ -77,6 +77,7 @@ files:
77
77
  - ".travis.yml"
78
78
  - Gemfile
79
79
  - LICENSE
80
+ - MRI_LICENSE
80
81
  - README.md
81
82
  - Rakefile
82
83
  - lib/cgi/session.rb
@@ -105,9 +106,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  version: '0'
106
107
  requirements: []
107
108
  rubyforge_project:
108
- rubygems_version: 2.0.7
109
+ rubygems_version: 2.4.8
109
110
  signing_key:
110
111
  specification_version: 4
111
112
  summary: Ruby standard library cgi-session.
112
113
  test_files: []
113
- has_rdoc: