securer_randomer 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 854b1544af898e35b7bc9cae20b768b0054708e6
4
+ data.tar.gz: d6c6b44ec2575e3c866d5f684cbfd0535106aa56
5
+ SHA512:
6
+ metadata.gz: 1fbaf1b158092bca1317fe50741767f3320e492e7708012f45ab637b7b8e58d275e08b58c2876bb3baa1ca275ab89227237a27d365ceac3241534b033e2b18e8
7
+ data.tar.gz: b191142d798a5fb0584949866427727798bfc7046d56969eb572fc01a49e615fadc269a3e69abefe6925cd70b4f042bb65198207fffad6952bbdf47907f49f63
@@ -18,5 +18,5 @@ before_install:
18
18
  - sudo apt-get install -y libsodium-dev
19
19
  env:
20
20
  - WITH_MONKEYPATCH=false
21
- - WITH_MONKEYPATCH=true
22
- - WITH_MONKEYPATCH=kinda
21
+ - WITH_MONKEYPATCH=true WITH_RAND=custom
22
+ - WITH_MONKEYPATCH=true WITH_RAND=kernel
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # SecurerRandomer
2
2
 
3
+ ## This gem is deprecated. Please use [sysrandom](https://github.com/cryptosphere/sysrandom) instead.
4
+
3
5
  [![Build Status](https://travis-ci.org/mwpastore/securer_randomer.svg?branch=master)](https://travis-ci.org/mwpastore/securer_randomer)
4
6
  [![Gem Version](https://badge.fury.io/rb/securer_randomer.svg)](https://badge.fury.io/rb/securer_randomer)
5
7
 
@@ -7,11 +9,10 @@ Ruby's SecureRandom prefers OpenSSL over other mechanisms (such as
7
9
  `/dev/urandom` and `getrandom(2)`). This has recently garnered [some][1]
8
10
  [criticism][2].
9
11
 
10
- [RbNaCl][3] provides Ruby bindings to [libsodium][4], a portable crypto
11
- library—which is a fork of [NaCl][6] by Daniel J. Bernstein—that
12
- includes hooks to alternative, OpenSSL-free pseudo-random number generators
13
- (PRNGs) such as `getrandom(2)` on modern Linux kernels and `RtlGenRandom()` on
14
- Windows.
12
+ [RbNaCl][3] provides Ruby bindings to [libsodium][4]—a portable crypto
13
+ library and fork of [NaCl][6] by Daniel J. Bernstein that includes hooks to
14
+ alternative, OpenSSL-free pseudo-random number generators (PRNGs) such as
15
+ `getrandom(2)` on modern Linux kernels and `RtlGenRandom()` on Windows.
15
16
 
16
17
  This gem monkeypatches RbNaCl into SecureRandom and aims to be "bug-for-bug"
17
18
  compatible with the "stock" implementation of SecureRandom across Ruby
@@ -25,9 +26,10 @@ SecureRandom`.random_bytes` and grew as I dug deeper. In newer rubies, for
25
26
  example, you need to patch `.gen_random` instead of `.random_bytes`, and it has
26
27
  a different calling signature.
27
28
 
28
- Generating random numbers proved to be rather tricky due to inconsistencies of
29
- of Kernel`.rand` and SecureRandom`.random_number` between Ruby implementations
30
- and versions. For example:
29
+ Some rubies use OpenSSL for SecureRandom`.random_number` as well, while others
30
+ appear to rely on Kernel`.rand`. Addressing this proved to be tricky due to
31
+ inconsistencies of these two methods between Ruby implementations and versions.
32
+ For example:
31
33
 
32
34
  * `Kernel.rand(nil)` and `SecureRandom.random_number(nil)` both return a float
33
35
  `n` such that `0.0 <= n < 1.0` in Ruby 2.3; but
@@ -36,8 +38,8 @@ and versions. For example:
36
38
  2.2+, but SecureRandom`.random_number` throws an ArgumentError in Ruby 2.2
37
39
  and returns a float `n` such that `0.0 <= n < 1.0` in Ruby 2.3
38
40
 
39
- Branching logic and tests started to accumulate so I decided it was probably a
40
- good idea to gemify this!
41
+ Branching logic, edge cases, and tests started to accumulate so I decided it
42
+ was probably a good idea to gemify this!
41
43
 
42
44
  ### Why a monkeypatch?
43
45
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SecurerRandomer
4
- VERSION = '0.1.6' # rubocop:disable Style/MutableConstant
4
+ VERSION = '0.1.8' # rubocop:disable Style/MutableConstant
5
5
  end
@@ -9,7 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Mike Pastore']
10
10
  spec.email = ['mike@oobak.org']
11
11
 
12
- spec.summary = 'Monkeypatch SecureRandom with RbNaCl'
12
+ spec.summary = '[DEPRECATED] Monkeypatch Ruby\'s SecureRandom with RbNaCl'
13
+ spec.summary = 'This gem is deprecated. Please use sysrandom instead.'
13
14
  spec.homepage = 'https://github.com/mwpastore/securer_randomer'
14
15
  spec.license = 'MIT'
15
16
 
metadata CHANGED
@@ -1,110 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: securer_randomer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Mike Pastore
9
8
  autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2016-05-12 00:00:00.000000000 Z
11
+ date: 2016-09-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.11'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.11'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: 11.1.1
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: 11.1.1
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: '3.0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: '3.0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec-given
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
61
  version: 3.8.0
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
68
  version: 3.8.0
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rubocop
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ~>
73
+ - - "~>"
84
74
  - !ruby/object:Gem::Version
85
75
  version: 0.39.0
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ~>
80
+ - - "~>"
92
81
  - !ruby/object:Gem::Version
93
82
  version: 0.39.0
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rbnacl
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ~>
87
+ - - "~>"
100
88
  - !ruby/object:Gem::Version
101
89
  version: '3.3'
102
90
  type: :runtime
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ~>
94
+ - - "~>"
108
95
  - !ruby/object:Gem::Version
109
96
  version: '3.3'
110
97
  description:
@@ -114,10 +101,10 @@ executables: []
114
101
  extensions: []
115
102
  extra_rdoc_files: []
116
103
  files:
117
- - .gitignore
118
- - .rspec
119
- - .rubocop.yml
120
- - .travis.yml
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".rubocop.yml"
107
+ - ".travis.yml"
121
108
  - Gemfile
122
109
  - LICENSE.txt
123
110
  - README.md
@@ -132,29 +119,25 @@ files:
132
119
  homepage: https://github.com/mwpastore/securer_randomer
133
120
  licenses:
134
121
  - MIT
122
+ metadata: {}
135
123
  post_install_message:
136
124
  rdoc_options: []
137
125
  require_paths:
138
126
  - lib
139
127
  required_ruby_version: !ruby/object:Gem::Requirement
140
- none: false
141
128
  requirements:
142
- - - ! '>='
129
+ - - ">="
143
130
  - !ruby/object:Gem::Version
144
131
  version: 1.9.3
145
132
  required_rubygems_version: !ruby/object:Gem::Requirement
146
- none: false
147
133
  requirements:
148
- - - ! '>='
134
+ - - ">="
149
135
  - !ruby/object:Gem::Version
150
136
  version: '0'
151
- segments:
152
- - 0
153
- hash: 1367148123343509472
154
137
  requirements: []
155
138
  rubyforge_project:
156
- rubygems_version: 1.8.23.2
139
+ rubygems_version: 2.5.1
157
140
  signing_key:
158
- specification_version: 3
159
- summary: Monkeypatch SecureRandom with RbNaCl
141
+ specification_version: 4
142
+ summary: This gem is deprecated. Please use sysrandom instead.
160
143
  test_files: []