ubiq-security 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: cfa206519b2bde1e566a7d55830bee2b5a68a3b6613b92eaaf59fa984f4818ce
4
- data.tar.gz: d08cf519e3d0ec92845e68cd4132e2dc30b31c3a65154c566e6be21604b50b72
3
+ metadata.gz: 35f6376d379fdebaeda8a17d77949217fe2990b01fc31a2cff938abd7297d404
4
+ data.tar.gz: 5a1847bccf50187573ba326848ef713e651ca8b2fa8da2b3430370a2d75e32e0
5
5
  SHA512:
6
- metadata.gz: 74e12caae5793215eb606adc55dd773e172d567b1ae780c95e10601adaa2eb374d7a40557865213e60f58d18d550c88f3913ccda9d3bc355f100128aec747d11
7
- data.tar.gz: 265978ac51da6790983dba2b6f7d6f8ed03c6c49116a7ad18d291a28392370f0c5a5fcd2ec93dbac4976baa1607b74519ef5e6ee097cb97d5cb729478d7c2b49
6
+ metadata.gz: 8676c73c34928dba6bab74ea0f4d58441a43dc1212f2393e19f8ea7a8643eb1ad6067f0caef9f50df0fc676f57dbe5b462f9bece298f109023776757265d9a61
7
+ data.tar.gz: b0b7f399ba98b63f814d5e8efb15361111026146d3e5e521d2d2db663c0f8acecdce082701599c30675c137a9d58570bbd87a7b45d2100a224d238d7319533e1
data/README.md CHANGED
@@ -31,8 +31,11 @@ To build and install directly from a clone of the gitlab repository source:
31
31
  ```sh
32
32
  git clone https://gitlab.com/ubiqsecurity/ubiq-ruby.git
33
33
  cd ubiq-ruby
34
- rake install:local
34
+ bundle install
35
+ gem build ubiq-security.gemspec
36
+ gem install ./ubiq-security*.gem
35
37
  ```
38
+ You may need to run the `gem install` commands above using sudo.
36
39
 
37
40
 
38
41
  ## Usage
@@ -33,10 +33,27 @@ module Ubiq
33
33
  key_length: 32,
34
34
  iv_length: 12,
35
35
  tag_length: 16
36
+ },
37
+ 'aes-128-gcm' => {
38
+ id: 1,
39
+ algorithm: OpenSSL::Cipher::AES128,
40
+ mode: OpenSSL::Cipher::AES128.new(:GCM),
41
+ key_length: 16,
42
+ iv_length: 12,
43
+ tag_length: 16
36
44
  }
37
45
  }
38
46
  end
39
47
 
48
+ def find_alg(id)
49
+ set_algo.each do |k,v|
50
+ if v[:id] == id
51
+ return k
52
+ end
53
+ end
54
+ "unknown"
55
+ end
56
+
40
57
  def get_algo(name)
41
58
  set_algo[name]
42
59
  end
@@ -165,7 +165,8 @@ module Ubiq
165
165
  @key['client_id'] = client_id
166
166
  @key['session'] = response['encryption_session']
167
167
 
168
- @key['algorithm'] = 'aes-256-gcm'
168
+ # Get the algorithm name from the internal algorithm id in the header
169
+ @key['algorithm'] = Algo.new.find_alg(algorithm_id)
169
170
 
170
171
  encrypted_private_key = response['encrypted_private_key']
171
172
  # Decrypt the encryped private key using SRSA
@@ -17,5 +17,5 @@
17
17
  # frozen_string_literal: true
18
18
 
19
19
  module Ubiq
20
- VERSION = '1.0.3'
20
+ VERSION = '1.0.4'
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ubiq-security
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ubiq Security, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-23 00:00:00.000000000 Z
11
+ date: 2020-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb-readline