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 +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +2 -0
- data/.travis.yml +23 -1
- data/Appraisals +16 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +7 -1
- data/README.md +4 -3
- data/Rakefile +3 -1
- data/SECURITY.md +8 -0
- data/gemfiles/openssl_2_0.gemfile +11 -0
- data/gemfiles/openssl_2_1.gemfile +11 -0
- data/gemfiles/openssl_default.gemfile +10 -0
- data/gemfiles/openssl_head.gemfile +11 -0
- data/lib/tpm/key_attestation.rb +31 -1
- data/lib/tpm/key_attestation/version.rb +2 -2
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a70caca43d540853ceca86581030de8e86925e630510deb34e3af736e314b55
|
4
|
+
data.tar.gz: c7b0ab0e81a6607b9d24b8a8a01aa0447f2b4281f961f0180d27dd4f8fc88e00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: babb217a8144f5fc34ce1f2b8a02485390b1c744beb3ed7f5f80e656415ad70dd674b2a7917b3e4db778aa7e69b20318179609c15d793126028a0699b38932e2
|
7
|
+
data.tar.gz: 16e3f16f0cbe9d9d3032f112416d276532563c1730959cc8c41539e750e7476f3bc4a7074671628524bb051a7be17c792209ff4d931ac1808f56e390225782eb
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
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
|
-
|
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
data/Gemfile.lock
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tpm-key_attestation (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
|
-
#
|
1
|
+
# tpm-key_attestation
|
2
2
|
|
3
|
-
|
3
|
+
TPM Key Attestation utitlies
|
4
4
|
|
5
|
-
|
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
data/SECURITY.md
ADDED
data/lib/tpm/key_attestation.rb
CHANGED
@@ -3,7 +3,37 @@
|
|
3
3
|
require "tpm/key_attestation/version"
|
4
4
|
|
5
5
|
module TPM
|
6
|
-
|
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
|
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.
|
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-
|
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
|