tpm-key_attestation 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: 37839aaec1d1cf608d9251208a7aa890ec07eb41fa1823d82dc7f471357c0715
4
- data.tar.gz: '058ec854deb4c35056592debcf82d0c647674c4ae26dc1b9ec73f9be87be744e'
3
+ metadata.gz: 7a70caca43d540853ceca86581030de8e86925e630510deb34e3af736e314b55
4
+ data.tar.gz: c7b0ab0e81a6607b9d24b8a8a01aa0447f2b4281f961f0180d27dd4f8fc88e00
5
5
  SHA512:
6
- metadata.gz: 12d051a82ab6c9b2d989376b327223c3d5fed3da23a5d8d1199dbb7137f9770b8e6799078fe7c80230d64469394eaf13288610f8a638eeeea6da1feb916b7cf6
7
- data.tar.gz: be6d90f4e699bc03ac08ce393cf77bc4e19df94e88b062a47473d173c3a2ace645ca01daee79135ebb1f05bff9be97c87ed03bfe8fbcf0fa865f173a0f6aa4e9
6
+ metadata.gz: babb217a8144f5fc34ce1f2b8a02485390b1c744beb3ed7f5f80e656415ad70dd674b2a7917b3e4db778aa7e69b20318179609c15d793126028a0699b38932e2
7
+ data.tar.gz: 16e3f16f0cbe9d9d3032f112416d276532563c1730959cc8c41539e750e7476f3bc4a7074671628524bb051a7be17c792209ff4d931ac1808f56e390225782eb
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ /gemfiles/*.gemfile.lock
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.3
3
3
  DisabledByDefault: true
4
+ Exclude:
5
+ - "gemfiles/**/*"
4
6
 
5
7
  Bundler:
6
8
  Enabled: true
data/.travis.yml CHANGED
@@ -1,6 +1,28 @@
1
1
  ---
2
+ dist: bionic
2
3
  language: ruby
3
4
  cache: bundler
5
+
4
6
  rvm:
7
+ - ruby-head
5
8
  - 2.7.0
6
- before_install: gem install bundler -v 2.1.4
9
+ - 2.6.5
10
+ - 2.5.7
11
+ - 2.4.9
12
+ - 2.3.8
13
+
14
+ gemfile:
15
+ - gemfiles/openssl_head.gemfile
16
+ - gemfiles/openssl_2_1.gemfile
17
+ - gemfiles/openssl_2_0.gemfile
18
+ - gemfiles/openssl_default.gemfile
19
+
20
+ matrix:
21
+ fast_finish: true
22
+ allow_failures:
23
+ - rvm: ruby-head
24
+ - gemfile: gemfiles/openssl_head.gemfile
25
+
26
+ before_install:
27
+ - gem install bundler -v "~> 2.0"
28
+ - rm Gemfile.lock
data/Appraisals ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise "openssl_head" do
4
+ gem "openssl", git: "https://github.com/ruby/openssl"
5
+ end
6
+
7
+ appraise "openssl_2_1" do
8
+ gem "openssl", "~> 2.1.0"
9
+ end
10
+
11
+ appraise "openssl_2_0" do
12
+ gem "openssl", "~> 2.0.0"
13
+ end
14
+
15
+ appraise "openssl_default" do
16
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## [v0.2.0] - 2020-01-16
4
+
5
+ ### Added
6
+
7
+ - `TPM::KeyAttestation#valid?`
8
+
9
+ ## [v0.1.0] - 2020-01-15
10
+
11
+ ### Added
12
+
13
+ - `TPM::EKCertificate` wrapper
14
+ - `TPM::SAttest` wrapper
15
+
16
+ [v0.2.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.1.0...v0.2.0/
17
+ [v0.1.0]: https://github.com/cedarcode/tpm-key_attestation/compare/57c926ef7e83830cee8d111fdc5ccaf99ab2e861...v0.1.0/
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in tpm-key_attestation.gemspec
6
6
  gemspec
7
7
 
8
+ gem "appraisal", "~> 2.2.0"
8
9
  gem "rake", "~> 12.0"
9
10
  gem "rspec", "~> 3.0"
10
11
 
data/Gemfile.lock CHANGED
@@ -1,12 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tpm-key_attestation (0.1.0)
4
+ tpm-key_attestation (0.2.0)
5
5
  bindata (~> 2.4)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ appraisal (2.2.0)
11
+ bundler
12
+ rake
13
+ thor (>= 0.14.0)
10
14
  ast (2.4.0)
11
15
  bindata (2.4.4)
12
16
  diff-lcs (1.3)
@@ -37,12 +41,14 @@ GEM
37
41
  ruby-progressbar (~> 1.7)
38
42
  unicode-display_width (>= 1.4.0, < 1.7)
39
43
  ruby-progressbar (1.10.1)
44
+ thor (1.0.1)
40
45
  unicode-display_width (1.6.0)
41
46
 
42
47
  PLATFORMS
43
48
  ruby
44
49
 
45
50
  DEPENDENCIES
51
+ appraisal (~> 2.2.0)
46
52
  rake (~> 12.0)
47
53
  rspec (~> 3.0)
48
54
  rubocop
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
- # TPM::KeyAttestation
1
+ # tpm-key_attestation
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tpm/key_attestation`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ TPM Key Attestation utitlies
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ [![Gem](https://img.shields.io/gem/v/tpm-key_attestation.svg?style=flat-square)](https://rubygems.org/gems/tpm-key_attestation)
6
+ [![Travis](https://img.shields.io/travis/cedarcode/tpm-key_attestation.svg?style=flat-square)](https://travis-ci.org/cedarcode/tpm-key_attestation)
6
7
 
7
8
  ## Installation
8
9
 
data/Rakefile CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new
7
9
 
8
- task default: :spec
10
+ task default: [:rubocop, :spec]
data/SECURITY.md ADDED
@@ -0,0 +1,8 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ If you have discovered a security bug, please send an email to security@cedarcode.com
6
+ instead of posting to the GitHub issue tracker.
7
+
8
+ Thank you!
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.2.0"
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "rubocop"
9
+ gem "openssl", "~> 2.0.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.2.0"
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "rubocop"
9
+ gem "openssl", "~> 2.1.0"
10
+
11
+ gemspec path: "../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.2.0"
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "rubocop"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.2.0"
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "rubocop"
9
+ gem "openssl", git: "https://github.com/ruby/openssl"
10
+
11
+ gemspec path: "../"
@@ -3,7 +3,37 @@
3
3
  require "tpm/key_attestation/version"
4
4
 
5
5
  module TPM
6
- module KeyAttestation
6
+ class KeyAttestation
7
7
  class Error < StandardError; end
8
+
9
+ attr_reader :certify_info, :signature, :certified_object, :signing_key, :hash_function, :qualifying_data
10
+
11
+ def initialize(certify_info, signature, certified_object, signing_key, hash_function, qualifying_data)
12
+ @certify_info = certify_info
13
+ @signature = signature
14
+
15
+ @certified_object = certified_object
16
+ @signing_key = signing_key
17
+ @hash_function = hash_function
18
+ @qualifying_data = qualifying_data
19
+ end
20
+
21
+ def valid?
22
+ valid_signature? && valid_certify_info?
23
+ end
24
+
25
+ private
26
+
27
+ def valid_signature?
28
+ signing_key.verify(hash_function, signature, certify_info)
29
+ end
30
+
31
+ def valid_certify_info?
32
+ s_attest.valid?(certified_object, qualifying_data)
33
+ end
34
+
35
+ def s_attest
36
+ @s_attest ||= ::TPM::SAttest.read(certify_info)
37
+ end
8
38
  end
9
39
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TPM
4
- module KeyAttestation
5
- VERSION = "0.1.0"
4
+ class KeyAttestation
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tpm-key_attestation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2020-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -34,13 +34,20 @@ files:
34
34
  - ".rspec"
35
35
  - ".rubocop.yml"
36
36
  - ".travis.yml"
37
+ - Appraisals
38
+ - CHANGELOG.md
37
39
  - Gemfile
38
40
  - Gemfile.lock
39
41
  - LICENSE
40
42
  - README.md
41
43
  - Rakefile
44
+ - SECURITY.md
42
45
  - bin/console
43
46
  - bin/setup
47
+ - gemfiles/openssl_2_0.gemfile
48
+ - gemfiles/openssl_2_1.gemfile
49
+ - gemfiles/openssl_default.gemfile
50
+ - gemfiles/openssl_head.gemfile
44
51
  - lib/tpm/constants.rb
45
52
  - lib/tpm/ek_certificate.rb
46
53
  - lib/tpm/key_attestation.rb