sdk-reforge 1.11.1 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/reforge/encryption.rb +15 -6
- data/sdk-reforge.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de9767c4803726a6881d27e59b026d4a1e23d5592effae2f72908f44aed56e23
|
4
|
+
data.tar.gz: 16ab3c79d14b20136bb15cafd76b641f3dcced86c160a16681cf7666a564ec41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5e8a05f5f01014d9605c68648de26784d9190fdb3ab61d2c3ea55687a35feea851c5f50fbe86a3d21dfd8a0795df4644a656db04098988f8f3e7e030b117ae8
|
7
|
+
data.tar.gz: fe44f02ea0fffa0982732a4c581b50440ce174e2cd3798208820ca96b4ee2cfebe90e866d8566588c2d795b39bd505234bbd56340a2155869f740cdc60b8b15f
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.11.
|
1
|
+
1.11.2
|
data/lib/reforge/encryption.rb
CHANGED
@@ -4,6 +4,7 @@ module Reforge
|
|
4
4
|
class Encryption
|
5
5
|
CIPHER_TYPE = "aes-256-gcm" # 32/12
|
6
6
|
SEPARATOR = "--"
|
7
|
+
AUTH_TAG_LENGTH = 16
|
7
8
|
|
8
9
|
# Hexadecimal format ensures that generated keys are representable with
|
9
10
|
# plain text
|
@@ -32,22 +33,30 @@ module Reforge
|
|
32
33
|
encrypted = cipher.update(clear_text)
|
33
34
|
encrypted << cipher.final
|
34
35
|
tag = cipher.auth_tag
|
35
|
-
|
36
|
+
|
36
37
|
# pack and join
|
37
38
|
[encrypted, iv, tag].map { |p| p.unpack("H*")[0] }.join(SEPARATOR)
|
38
39
|
end
|
39
40
|
|
40
41
|
def decrypt(encrypted_string)
|
41
|
-
|
42
|
+
encrypted_data, iv, auth_tag = encrypted_string.split(SEPARATOR).map { |p| [p].pack("H*") }
|
43
|
+
|
44
|
+
# Currently the OpenSSL bindings do not raise an error if auth_tag is
|
45
|
+
# truncated, which would allow an attacker to easily forge it. See
|
46
|
+
# https://github.com/ruby/openssl/issues/63
|
47
|
+
if auth_tag.bytesize != AUTH_TAG_LENGTH
|
48
|
+
raise "truncated auth_tag"
|
49
|
+
end
|
42
50
|
|
43
51
|
cipher = OpenSSL::Cipher.new(CIPHER_TYPE)
|
44
52
|
cipher.decrypt
|
45
53
|
cipher.key = @key
|
46
|
-
cipher.iv =
|
47
|
-
|
48
|
-
|
54
|
+
cipher.iv = iv
|
55
|
+
|
56
|
+
cipher.auth_tag = auth_tag
|
57
|
+
|
49
58
|
# and decrypt it
|
50
|
-
decrypted = cipher.update(
|
59
|
+
decrypted = cipher.update(encrypted_data)
|
51
60
|
decrypted << cipher.final
|
52
61
|
decrypted
|
53
62
|
end
|
data/sdk-reforge.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: sdk-reforge 1.11.
|
5
|
+
# stub: sdk-reforge 1.11.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "sdk-reforge".freeze
|
9
|
-
s.version = "1.11.
|
9
|
+
s.version = "1.11.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Jeff Dwyer".freeze]
|
14
|
-
s.date = "2025-10-
|
14
|
+
s.date = "2025-10-07"
|
15
15
|
s.description = "Feature Flags, Live Config as a service".freeze
|
16
16
|
s.email = "jeff.dwyer@reforge.com.cloud".freeze
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdk-reforge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dwyer
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-10-
|
10
|
+
date: 2025-10-07 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: concurrent-ruby
|