cerner-oauth1a 2.5.2 → 2.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/cerner/oauth1a/access_token.rb +1 -1
- data/lib/cerner/oauth1a/cache_rails.rb +1 -0
- data/lib/cerner/oauth1a/internal.rb +29 -0
- data/lib/cerner/oauth1a/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a554af1b8a4a44ff14a05c9fb71517046cdb1a5bf677b5a4792eaa7d01423b83
|
4
|
+
data.tar.gz: 3f16a0c5584bae17e6edfcecb277c92d04da581fcc883f687b91719089543b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b501e8559461f9a2a24aa9515403f6ee3d071786005f56eb1e466560b5b53a78f4992fc8c4b8ae9c17a819263c401b7474b732a21b261bb7890902e88a69f05
|
7
|
+
data.tar.gz: 0ee901ddfa558db983229086f6f5e4cd20de2c9575c20a6457e09862b5e2d1eeadd662e856de1851e6528b834a0a5dcfe714f01a8b521d542a2927e14aac4552
|
data/CHANGELOG.md
CHANGED
@@ -474,7 +474,7 @@ module Cerner
|
|
474
474
|
)
|
475
475
|
end
|
476
476
|
|
477
|
-
return if @signature
|
477
|
+
return if Internal.constant_time_compare(@signature, expected_signature)
|
478
478
|
|
479
479
|
raise OAuthError.new('signature is not valid', nil, 'signature_invalid', nil, @realm)
|
480
480
|
end
|
@@ -61,6 +61,35 @@ module Cerner
|
|
61
61
|
def self.generate_timestamp
|
62
62
|
Time.now.to_i
|
63
63
|
end
|
64
|
+
|
65
|
+
# Internal: Compares two Strings using a constant time algorithm to protect against timing
|
66
|
+
# attacks.
|
67
|
+
#
|
68
|
+
# left - The left String
|
69
|
+
# right - The right String
|
70
|
+
#
|
71
|
+
# Return true if left and right match, false otherwise.
|
72
|
+
def self.constant_time_compare(left, right)
|
73
|
+
max_size = [left.bytesize, right.bytesize].max
|
74
|
+
# convert left and right to array of bytes (Integer)
|
75
|
+
left = left.unpack('C*')
|
76
|
+
right = right.unpack('C*')
|
77
|
+
|
78
|
+
# if either array is not the max size, expand it with zeros
|
79
|
+
# having equal arrays keeps the algorithm execution time constant
|
80
|
+
left = left.fill(0, left.size, max_size - left.size) if left.size < max_size
|
81
|
+
right = right.fill(0, right.size, max_size - right.size) if right.size < max_size
|
82
|
+
|
83
|
+
result = 0
|
84
|
+
left.each_with_index do |left_value, i|
|
85
|
+
# XOR the two bytes, if equal, the operation is 0
|
86
|
+
# OR the XOR operation with the previous result
|
87
|
+
result |= left_value ^ right[i]
|
88
|
+
end
|
89
|
+
|
90
|
+
# if every comparison resuled in 0, then left and right are equal
|
91
|
+
result.zero?
|
92
|
+
end
|
64
93
|
end
|
65
94
|
end
|
66
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cerner-oauth1a
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Beyer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
A minimal dependency library for interacting with a Cerner OAuth 1.0a Access
|
@@ -40,7 +40,7 @@ homepage: http://github.com/cerner/cerner-oauth1a
|
|
40
40
|
licenses:
|
41
41
|
- Apache-2.0
|
42
42
|
metadata: {}
|
43
|
-
post_install_message:
|
43
|
+
post_install_message:
|
44
44
|
rdoc_options: []
|
45
45
|
require_paths:
|
46
46
|
- lib
|
@@ -55,8 +55,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
|
-
rubygems_version: 3.0.
|
59
|
-
signing_key:
|
58
|
+
rubygems_version: 3.0.8
|
59
|
+
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Cerner OAuth 1.0a Consumer and Service Provider Library.
|
62
62
|
test_files: []
|