tpm-key_attestation-0.14.1/0000755000004100000410000000000015030703304015625 5ustar www-datawww-datatpm-key_attestation-0.14.1/Gemfile.lock0000644000004100000410000000334615030703303020054 0ustar www-datawww-dataPATH remote: . specs: tpm-key_attestation (0.14.1) bindata (~> 2.4) openssl (> 2.0) openssl-signature_algorithm (~> 1.0) GEM remote: https://rubygems.org/ specs: appraisal (2.5.0) bundler rake thor (>= 0.14.0) ast (2.4.2) bindata (2.5.0) byebug (11.1.3) diff-lcs (1.5.1) json (2.10.1) language_server-protocol (3.17.0.4) lint_roller (1.1.0) openssl (3.2.0) openssl-signature_algorithm (1.3.0) openssl (> 2.0) parallel (1.26.3) parser (3.3.7.1) ast (~> 2.4.1) racc racc (1.8.1) rainbow (3.1.1) rake (13.2.1) regexp_parser (2.10.0) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.2) rspec-support (~> 3.13.0) rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.2) rubocop (1.72.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) rubocop-ast (1.38.0) parser (>= 3.3.1.0) ruby-progressbar (1.13.0) thor (1.3.2) unicode-display_width (3.1.4) unicode-emoji (~> 4.0, >= 4.0.4) unicode-emoji (4.0.4) PLATFORMS ruby DEPENDENCIES appraisal (~> 2.5.0) byebug (~> 11.0) rake (~> 13.0) rspec (~> 3.0) rubocop (~> 1) tpm-key_attestation! BUNDLED WITH 2.5.23 tpm-key_attestation-0.14.1/bin/0000755000004100000410000000000015030703303016374 5ustar www-datawww-datatpm-key_attestation-0.14.1/bin/setup0000755000004100000410000000020315030703303017455 0ustar www-datawww-data#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' set -vx bundle install # Do any other automated setup that you need to do here tpm-key_attestation-0.14.1/bin/console0000755000004100000410000000060015030703303017760 0ustar www-datawww-data#!/usr/bin/env ruby # frozen_string_literal: true require "bundler/setup" require "tpm/key_attestation" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. # (If you use this, don't forget to add pry to your Gemfile!) # require "pry" # Pry.start require "irb" IRB.start(__FILE__) tpm-key_attestation-0.14.1/.gitignore0000644000004100000410000000023315030703303017612 0ustar www-datawww-data/.bundle/ /.yardoc /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ /tmp/ # rspec failure tracking .rspec_status /gemfiles/*.gemfile.lock .byebug_history tpm-key_attestation-0.14.1/SECURITY.md0000644000004100000410000000030315030703303017411 0ustar www-datawww-data# Security Policy ## Reporting a Vulnerability If you have discovered a security bug, please send an email to security@cedarcode.com instead of posting to the GitHub issue tracker. Thank you! tpm-key_attestation-0.14.1/.github/0000755000004100000410000000000015030703303017164 5ustar www-datawww-datatpm-key_attestation-0.14.1/.github/actions/0000755000004100000410000000000015030703303020624 5ustar www-datawww-datatpm-key_attestation-0.14.1/.github/actions/install-ruby/0000755000004100000410000000000015030703303023251 5ustar www-datawww-datatpm-key_attestation-0.14.1/.github/actions/install-ruby/action.yml0000644000004100000410000000416415030703303025256 0ustar www-datawww-dataname: Install Ruby inputs: version: description: 'The version of Ruby to install' required: true os: description: 'The operating system to install Ruby on' required: true runs: using: 'composite' steps: - name: Cache Ruby id: ruby-cache uses: actions/cache@v4 with: path: ~/rubies/ruby-${{ inputs.version }} key: ruby-${{ inputs.version }}-${{ inputs.os }}-openssl-1.1.1w - name: Install Ruby if: steps.ruby-cache.outputs.cache-hit != 'true' shell: bash run: | latest_patch=$(curl -s https://cache.ruby-lang.org/pub/ruby/${{ inputs.version }}/ \ | grep -oP "ruby-${{ inputs.version }}\.\d+\.tar\.xz" \ | grep -oP "\d+(?=\.tar\.xz)" \ | sort -V | tail -n 1) wget https://cache.ruby-lang.org/pub/ruby/${{ inputs.version }}/ruby-${{ inputs.version }}.${latest_patch}.tar.xz tar -xJvf ruby-${{ inputs.version }}.${latest_patch}.tar.xz cd ruby-${{ inputs.version }}.${latest_patch} ./configure --prefix=$HOME/rubies/ruby-${{ inputs.version }} --with-openssl-dir=$HOME/openssl make make install - name: Update PATH shell: bash run: | echo "~/rubies/ruby-${{ inputs.version }}/bin" >> $GITHUB_PATH - name: Install Bundler shell: bash run: | case ${{ inputs.version }} in 2.7* | 3.*) echo "Skipping Bundler installation for Ruby ${{ inputs.version }}" ;; 2.5* | 2.6*) gem install bundler -v '~> 2.3.0' ;; *) echo "Don't know how to install Bundler for Ruby ${{ inputs.version }}" ;; esac - name: Cache Bundler Install id: bundler-cache uses: actions/cache@v4 env: GEMFILE: ${{ env.BUNDLE_GEMFILE || 'Gemfile' }} with: path: ./vendor/bundle key: bundler-ruby-${{ inputs.version }}-${{ inputs.os }}-${{ hashFiles(env.Gemfile, 'tpm-key_attestation.gemspec') }} - name: Install dependencies shell: bash run: | bundle config set --local path ../vendor/bundle bundle install tpm-key_attestation-0.14.1/.github/actions/install-openssl/0000755000004100000410000000000015030703303023753 5ustar www-datawww-datatpm-key_attestation-0.14.1/.github/actions/install-openssl/action.yml0000644000004100000410000000220215030703303025747 0ustar www-datawww-dataname: Install OpenSSL inputs: version: description: 'The version of OpenSSL to install' required: true os: description: 'The operating system to install OpenSSL on' required: true runs: using: 'composite' steps: - name: Cache OpenSSL library id: cache-openssl uses: actions/cache@v4 with: path: ~/openssl key: openssl-${{ inputs.version }}-${{ inputs.os }} - name: Compile OpenSSL library if: steps.cache-openssl.outputs.cache-hit != 'true' shell: bash run: | mkdir -p tmp/build-openssl && cd tmp/build-openssl case ${{ inputs.version }} in 1.1.*) OPENSSL_COMMIT=OpenSSL_ OPENSSL_COMMIT+=$(echo ${{ inputs.version }} | sed -e 's/\./_/g') git clone -b $OPENSSL_COMMIT --depth 1 https://github.com/openssl/openssl.git . echo "Git commit: $(git rev-parse HEAD)" ./Configure --prefix=$HOME/openssl --libdir=lib linux-x86_64 make depend && make -j4 && make install_sw ;; *) echo "Don't know how to build OpenSSL ${{ inputs.version }}" ;; esac tpm-key_attestation-0.14.1/.github/workflows/0000755000004100000410000000000015030703303021221 5ustar www-datawww-datatpm-key_attestation-0.14.1/.github/workflows/build.yml0000644000004100000410000000745515030703303023056 0ustar www-datawww-data# This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby name: build on: push jobs: lint: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: '3.4' bundler-cache: true - name: Lint code for consistent style run: bundle exec rubocop -f github test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: - ubuntu-24.04 - windows-latest - macos-13 ruby: - '3.4' - '3.3' - '3.2' - '3.1' - '3.0' - '2.7' - '2.6' - '2.5' - '2.4' gemfile: - openssl_2_2 - openssl_2_1 - openssl_3_0 - openssl_3_1 - openssl_3_2 - openssl_3_3 exclude: - ruby: '2.4' gemfile: openssl_3_0 - ruby: '2.5' gemfile: openssl_3_0 - ruby: '2.4' gemfile: openssl_3_1 - ruby: '2.5' gemfile: openssl_3_1 - ruby: '2.4' gemfile: openssl_3_2 - ruby: '2.5' gemfile: openssl_3_2 - ruby: '2.6' gemfile: openssl_3_2 - ruby: '2.4' gemfile: openssl_3_3 - ruby: '2.5' gemfile: openssl_3_3 - ruby: '2.6' gemfile: openssl_3_3 - ruby: '3.1' gemfile: openssl_2_2 os: macos-13 - ruby: '3.1' gemfile: openssl_2_1 os: macos-13 - ruby: '3.2' gemfile: openssl_2_2 os: macos-13 - ruby: '3.2' gemfile: openssl_2_1 os: macos-13 - ruby: '3.2' gemfile: openssl_2_2 os: windows-latest - ruby: '3.2' gemfile: openssl_2_1 os: windows-latest - ruby: '3.3' gemfile: openssl_2_2 os: macos-13 - ruby: '3.3' gemfile: openssl_2_1 os: macos-13 - ruby: '3.3' gemfile: openssl_2_2 os: windows-latest - ruby: '3.3' gemfile: openssl_2_1 os: windows-latest - ruby: '3.4' gemfile: openssl_2_2 os: macos-13 - ruby: '3.4' gemfile: openssl_2_1 os: macos-13 - ruby: '3.4' gemfile: openssl_2_2 os: windows-latest - ruby: '3.4' gemfile: openssl_2_1 os: windows-latest - ruby: '3.4' gemfile: openssl_3_0 os: windows-latest - ruby: '2.4' os: ubuntu-24.04 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - uses: actions/checkout@v4 - run: rm Gemfile.lock - name: Install OpenSSL if: matrix.os == 'ubuntu-24.04' uses: ./.github/actions/install-openssl with: version: "1.1.1w" os: ${{ matrix.os }} - uses: ruby/setup-ruby@v1 if: matrix.os != 'ubuntu-24.04' with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Manually set up Ruby if: matrix.os == 'ubuntu-24.04' uses: ./.github/actions/install-ruby with: version: ${{ matrix.ruby }} os: ${{ matrix.os }} - run: bundle exec rspec tpm-key_attestation-0.14.1/lib/0000755000004100000410000000000015030703303016372 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/0000755000004100000410000000000015030703304017173 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certify_validator.rb0000644000004100000410000000425215030703304023235 0ustar www-datawww-data# frozen_string_literal: true require "openssl/signature_algorithm" require "tpm/constants" require "tpm/s_attest" module TPM class CertifyValidator attr_reader :info, :signature, :nonce, :public_area, :signature_algorithm, :hash_algorithm TPM_SIGNATURE_ALG_TO_OPENSSL = { ALG_RSASSA => OpenSSL::SignatureAlgorithm::RSAPKCS1, ALG_RSAPSS => OpenSSL::SignatureAlgorithm::RSAPSS, ALG_ECDSA => OpenSSL::SignatureAlgorithm::ECDSA }.freeze TPM_HASH_ALG_TO_OPENSSL = { ALG_SHA1 => "SHA1", ALG_SHA256 => "SHA256", ALG_SHA384 => "SHA384", ALG_SHA512 => "SHA512" }.freeze def initialize(info, signature, nonce, public_area, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256) @info = info @signature = signature @nonce = nonce @public_area = public_area @signature_algorithm = signature_algorithm @hash_algorithm = hash_algorithm end def valid?(signing_key) valid_info? && valid_signature?(signing_key) end private def valid_info? attest.attested_type == TPM::ST_ATTEST_CERTIFY && attest.extra_data.buffer == nonce && attest.magic == TPM::GENERATED_VALUE && attest.attested.name.valid_for?(public_area.name) end def valid_signature?(verify_key) parameters = { hash_function: openssl_hash_function } if verify_key.is_a?(OpenSSL::PKey::EC) || verify_key.is_a?(OpenSSL::PKey::EC::Point) parameters[:curve] = verify_key.group.curve_name end openssl_signature_algorithm = openssl_signature_algorithm_class.new(**parameters) openssl_signature_algorithm.verify_key = verify_key openssl_signature_algorithm.verify(signature, info) rescue OpenSSL::SignatureAlgorithm::Error false end def attest @attest ||= TPM::SAttest.deserialize(info) end def openssl_hash_function TPM_HASH_ALG_TO_OPENSSL[hash_algorithm] || raise("Unsupported hash algorithm #{hash_algorithm}") end def openssl_signature_algorithm_class TPM_SIGNATURE_ALG_TO_OPENSSL[signature_algorithm] || raise("Unsupported signature algorithm #{signature_algorithm}") end end end tpm-key_attestation-0.14.1/lib/tpm/s_attest.rb0000644000004100000410000000126015030703304021345 0ustar www-datawww-data# frozen_string_literal: true require "bindata" require "tpm/constants" require "tpm/sized_buffer" require "tpm/s_attest/s_certify_info" module TPM # Section 10.12.8 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf class SAttest < BinData::Record class << self alias_method :deserialize, :read end endian :big uint32 :magic uint16 :attested_type sized_buffer :qualified_signer sized_buffer :extra_data # s_clock_info :clock_info # uint64 :firmware_version skip length: 25 choice :attested, selection: :attested_type do s_certify_info TPM::ST_ATTEST_CERTIFY end end end tpm-key_attestation-0.14.1/lib/tpm/key_attestation/0000755000004100000410000000000015030703304022402 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/key_attestation/version.rb0000644000004100000410000000014215030703304024411 0ustar www-datawww-data# frozen_string_literal: true module TPM class KeyAttestation VERSION = "0.14.1" end end tpm-key_attestation-0.14.1/lib/tpm/tpm2b_name.rb0000644000004100000410000000051115030703304021541 0ustar www-datawww-data# frozen_string_literal: true require "bindata" require "tpm/tpmt_ha" module TPM class Tpm2bName < BinData::Record endian :big uint16 :name_size, value: lambda { name.to_binary_s.size } tpmt_ha :name, read_length: :name_size def valid_for?(other_name) name.to_binary_s == other_name end end end tpm-key_attestation-0.14.1/lib/tpm/sized_buffer.rb0000644000004100000410000000052415030703304022170 0ustar www-datawww-data# frozen_string_literal: true require "bindata" module TPM # Section 10.4 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf class SizedBuffer < BinData::Record endian :big uint16 :buffer_size, value: lambda { buffer.size } string :buffer, read_length: :buffer_size end end tpm-key_attestation-0.14.1/lib/tpm/t_public.rb0000644000004100000410000000575615030703304021336 0ustar www-datawww-data# frozen_string_literal: true require "bindata" require "openssl" require "tpm/constants" require "tpm/sized_buffer" require "tpm/tpms_ecc_point" require "tpm/t_public/s_ecc_parms" require "tpm/t_public/s_rsa_parms" module TPM # Section 12.2.4 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf class TPublic < BinData::Record BYTE_LENGTH = 8 CURVE_TPM_TO_OPENSSL = { TPM::ECC_NIST_P256 => "prime256v1", TPM::ECC_NIST_P384 => "secp384r1", TPM::ECC_NIST_P521 => "secp521r1", }.freeze BN_BASE = 2 RSA_KEY_DEFAULT_PUBLIC_EXPONENT = 2**16 + 1 ECC_UNCOMPRESSED_POINT_INDICATOR = "\x04" class << self alias_method :deserialize, :read end endian :big uint16 :alg_type uint16 :name_alg # :object_attributes skip length: 4 sized_buffer :auth_policy choice :parameters, selection: :alg_type do s_ecc_parms TPM::ALG_ECC s_rsa_parms TPM::ALG_RSA end choice :unique, selection: :alg_type do tpms_ecc_point TPM::ALG_ECC sized_buffer TPM::ALG_RSA end def rsa? alg_type == TPM::ALG_RSA end def ecc? alg_type == TPM::ALG_ECC end def key if parameters.symmetric == TPM::ALG_NULL if ecc? ecc_key elsif rsa? rsa_key else raise "Type #{alg_type} not supported" end end end def openssl_curve_name if ecc? CURVE_TPM_TO_OPENSSL[parameters.curve_id] || raise("Unknown curve #{parameters.curve_id}") end end private def ecc_key case parameters.scheme when TPM::ALG_ECDSA, TPM::ALG_NULL group = OpenSSL::PKey::EC::Group.new(openssl_curve_name) point = OpenSSL::PKey::EC::Point.new( group, bn(ECC_UNCOMPRESSED_POINT_INDICATOR + unique.x.buffer.value + unique.y.buffer.value) ) # RFC5480 SubjectPublicKeyInfo asn1 = OpenSSL::ASN1::Sequence( [ OpenSSL::ASN1::Sequence( [ OpenSSL::ASN1::ObjectId("id-ecPublicKey"), OpenSSL::ASN1::ObjectId(group.curve_name), ] ), OpenSSL::ASN1::BitString(point.to_octet_string(:uncompressed)) ] ) OpenSSL::PKey::EC.new(asn1.to_der) end rescue OpenSSL::PKey::EC::Point::Error nil end def rsa_key case parameters.scheme when TPM::ALG_RSASSA, TPM::ALG_RSAPSS, TPM::ALG_NULL n = unique.buffer.value if parameters.key_bits / BYTE_LENGTH == n.size # PKCS#1 RSAPublicKey asn1 = OpenSSL::ASN1::Sequence( [ OpenSSL::ASN1::Integer.new(bn(n)), OpenSSL::ASN1::Integer.new(bn(RSA_KEY_DEFAULT_PUBLIC_EXPONENT)), ] ) OpenSSL::PKey::RSA.new(asn1.to_der) end end end def bn(data) if data OpenSSL::BN.new(data, BN_BASE) end end end end tpm-key_attestation-0.14.1/lib/tpm/t_public/0000755000004100000410000000000015030703304020774 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/t_public/s_rsa_parms.rb0000644000004100000410000000057415030703304023640 0ustar www-datawww-data# frozen_string_literal: true require "bindata" module TPM class TPublic < BinData::Record # Section 12.2.3.5 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf class SRsaParms < BinData::Record endian :big uint16 :symmetric uint16 :scheme uint16 :key_bits uint32 :exponent end end end tpm-key_attestation-0.14.1/lib/tpm/t_public/s_ecc_parms.rb0000644000004100000410000000056715030703304023607 0ustar www-datawww-data# frozen_string_literal: true require "bindata" module TPM class TPublic < BinData::Record # Section 12.2.3.6 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf class SEccParms < BinData::Record endian :big uint16 :symmetric uint16 :scheme uint16 :curve_id uint16 :kdf end end end tpm-key_attestation-0.14.1/lib/tpm/public_area.rb0000644000004100000410000000136515030703304021773 0ustar www-datawww-data# frozen_string_literal: true require "openssl" require "tpm/t_public" module TPM TPM_TO_OPENSSL_HASH_ALG = { TPM::ALG_SHA1 => "SHA1", TPM::ALG_SHA256 => "SHA256" }.freeze class PublicArea attr_reader :object def initialize(object) @object = object end def name [name_alg].pack("n") + name_digest end def key t_public.key end def ecc? t_public.ecc? end def openssl_curve_name t_public.openssl_curve_name end private def name_digest OpenSSL::Digest.digest(TPM_TO_OPENSSL_HASH_ALG[name_alg], object) end def name_alg t_public.name_alg end def t_public @t_public ||= TPM::TPublic.deserialize(object) end end end tpm-key_attestation-0.14.1/lib/tpm/certificates/0000755000004100000410000000000015030703304021640 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/Intel/0000755000004100000410000000000015030703303022712 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/Intel/RootCA/0000755000004100000410000000000015030703303024041 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/Intel/RootCA/EKRootPublicKey.cer0000644000004100000410000000117315030703303027511 0ustar www-datawww-data0w0O#"F;ݷ~(@O0 *H=01 0 U US1 0 U CA10U Santa Clara10U Intel Corporation1!0U TPM EK root cert signing10U www.intel.com0 140115000000Z 491231235959Z01 0 U US1 0 U CA10U Santa Clara10U Intel Corporation1!0U TPM EK root cert signing10U www.intel.com0Y0*H=*H=B}Q,Jo?v]}l)W!CC߶[Oa hV:TŞf0d0U#0ROե!G {[w0UROե!G {[w0U00U0 *H=G0D %tTY=b pd 2 ,o!E%Fx6TN1Hdtpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/0000755000004100000410000000000015030703304023310 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/0000755000004100000410000000000015030703304024437 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 1111.cer0000644000004100000410000000101315030703304030732 0ustar www-datawww-data00 ܽ%0 *H=0U1S0UNuvoton TPM Root CA 11110%U Nuvoton Technology Corporation0 UTW0 170821033253Z 370817033253Z0U1S0UNuvoton TPM Root CA 11110%U Nuvoton Technology Corporation0 UTW0Y0*H=*H=Br q =QLCTUQs 9ƑuFW~G`avRU6r)ҋ<6N >f0d0U0U00U/{_1 ǻUG0U#0/{_1 ǻUG0 *H=H0E!ʄ_!pQdA6`})ufG(H C慕m~);ꦤ /obbDtpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 1014.cer0000644000004100000410000000162615030703304030746 0ustar www-datawww-data00zmtgz0  *H 0U1S0UNuvoton TPM Root CA 10140%U Nuvoton Technology Corporation0 UTW0 170821110336Z 370817110336Z0U1S0UNuvoton TPM Root CA 10140%U Nuvoton Technology Corporation0 UTW0"0  *H 0 wSvoLӵjp0[#xmI|nn>-%\z[T"Nz?:^ID<q.}~ :o'غZYĜh9 K;Dp5a<&9 DHjfWU]UFҼTdiJ4}m?jrr\n8kGu} R ڑf0d0U0U00U#0Gr`|0UGr`|0  *H BT1l C~:]]9#X"{KJ 塥X_f@wĨfN]Ldt]py 9d65jMQw ۋXc,T3nNHTwG>sVӉ~D|$>Ƕϱtpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/NTC TPM EK Root CA 02.cer0000644000004100000410000000151615030703304030034 0ustar www-datawww-data0J02c0  *H 0R1P0UNTC TPM EK Root CA 020%U Nuvoton Technology Corporation0 UTW0 120711163324Z 320711163324Z0R1P0UNTC TPM EK Root CA 020%U Nuvoton Technology Corporation0 UTW0"0  *H 0 jhSՀ6aDʻ3) ϖ8D/Š_+`m[7{C,̘ge _+V4j L8S'fvyTڊj q;q>#Gg9 Ù6j{aMG;5haa6fsqnQvYZt"3EYʫɔ7&0$0U0U00  *H ,+VpR[QaTrATX[ !4Fi#ъOP:Ȳ\'E׸hۈ0>B9/yvy݈ۅ= %&jZ!S%}M޻+*Kٸ:@~g@WV={l: 0{/PJLVI(d}و1+!8U >0XCv|B8A>GE !tJe'8stpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 2011.cer0000644000004100000410000000162615030703304030744 0ustar www-datawww-data00z('y0  *H 0U1S0UNuvoton TPM Root CA 20110%U Nuvoton Technology Corporation0 UTW0 170911071012Z 370907071012Z0U1S0UNuvoton TPM Root CA 20110%U Nuvoton Technology Corporation0 UTW0"0  *H 0 ˲.aYg=mG^>\Ya.MיΰLȍ9a?WC(( xt2E[ʔUH *3XΆ=Y+Ο_W{q"L(Ɩxa\?B`f}npi+|Mst"ٓN 43yj,&zfe 0I ߔ(ZPݦv/-/C@ ED~/w6LJqEXᄞnV%ۅqx.&0$0U0U00  *H {zdn32>r)&BO<Q[7=o>isE0joaKj6/͕X-CQᗯMXe?gϿnY'19-[ؿJuV2|t A 3w\ߑf E`JO91rWD!*j_7izi&Rq%ps[}X{ dTorImOi2[a'-$rIL?${FJ"Щ'tpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/NTC TPM EK Root CA 01.cer0000644000004100000410000000151615030703304030033 0ustar www-datawww-data0J02]0  *H 0R1P0UNTC TPM EK Root CA 010%U Nuvoton Technology Corporation0 UTW0 120711162930Z 320711162930Z0R1P0UNTC TPM EK Root CA 010%U Nuvoton Technology Corporation0 UTW0"0  *H 0 6a>2Rᨤr=Qk6 ȴ<Ξʄ+2EDWX"LJ10}I3#-e A.w~ pȴn99~⹧𴻜ds'q\_*35L}$;;ߋ뇞!'Ag:&0$0U0U00  *H AC9<,/^IJW~mwP<"JRMU(c{ /]2'AZ+m@F9?.DwwpWכ$e6 le]Oڽt[czO ~Kf7͔Oε53;^5G=nh,qU3Vlܟ/u!V\|ڡ l97B*l_S>takie nhnŘ &тtpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 1110.cer0000644000004100000410000000101215030703304030730 0ustar www-datawww-data008dc0 *H=0U1S0UNuvoton TPM Root CA 11100%U Nuvoton Technology Corporation0 UTW0 150511084333Z 350507084333Z0U1S0UNuvoton TPM Root CA 11100%U Nuvoton Technology Corporation0 UTW0Y0*H=*H=B5dn#Wfxw$N u&3ÂOSDboUFp" ߠφcwf0d0U0U00UԶKi`w0U#0ԶKi`w0 *H=H0E!rsy],A*O h*C g"?g'/V7PLީbDtpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 2111.cer0000644000004100000410000000101315030703304030733 0ustar www-datawww-data00 Qk10 *H=0U1S0UNuvoton TPM Root CA 21110%U Nuvoton Technology Corporation0 UTW0 170911070949Z 370907070949Z0U1S0UNuvoton TPM Root CA 21110%U Nuvoton Technology Corporation0 UTW0Y0*H=*H=Bڜܰ>A?Dgc,,;l'Asv n(͍9} od$ƥf0d0U0U00U#*Ӿ7JDrJRW.0U#0#*Ӿ7JDrJRW.0 *H=H0E ^mN, _bQ7g6J̠p.(!,YW+\pխCV]ݯ M2N$tpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 2110.cer0000644000004100000410000000101215030703304030731 0ustar www-datawww-data00?/<0 *H=0U1S0UNuvoton TPM Root CA 21100%U Nuvoton Technology Corporation0 UTW0 151019043200Z 351015043200Z0U1S0UNuvoton TPM Root CA 21100%U Nuvoton Technology Corporation0 UTW0Y0*H=*H=B6o?b266WE{x2"%7WX=Ǯc,ɭ7$$f0d0U0U00UyRbxPqqj50U#0yRbxPqqj50 *H=H0E!8#Rte]ŢHJTn (>zxph6hHtpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 1013.cer0000644000004100000410000000162615030703304030745 0ustar www-datawww-data00zH |M0  *H 0U1S0UNuvoton TPM Root CA 10130%U Nuvoton Technology Corporation0 UTW0 150511084325Z 350507084325Z0U1S0UNuvoton TPM Root CA 10130%U Nuvoton Technology Corporation0 UTW0"0  *H 0 daSgў1zd@ޤHEcI6a TB?PߛΕF'}2ov ͅg {Ia-4WM|d{(*a"ӈ=g?'(87!aVeqDYCQ[ N:V:_cٷ(M'<_s'l?D_+Phngl}5 \AX R%PeM-Չi=f0d0U0U00U#07)* k/C0U7)* k/C0  *H \c=`J!kZZ "H&o]{Lgv93Im 3 Af)דF.!b=!Dd :-򟋭(L]VHri5xy8Ŋj%dW{ .&8e},+` ޴!L0S0g{p=a OE.M8FW*>ݫ9M oU!Z޽:ytpm-key_attestation-0.14.1/lib/tpm/certificates/Nuvoton/RootCA/Nuvoton TPM Root CA 2010.cer0000644000004100000410000000162615030703304030743 0ustar www-datawww-data00zX !0  *H 0U1S0UNuvoton TPM Root CA 20100%U Nuvoton Technology Corporation0 UTW0 150423065919Z 350419065919Z0U1S0UNuvoton TPM Root CA 20100%U Nuvoton Technology Corporation0 UTW0"0  *H 0 ƕQ9it{;gL eֿ=r{ ,7t(m^f0d0U0U00U#00C$ tP0U0C$ tP0  *H ғ'>hKyKB}y5cqQq$;g5 B:;X %(Ez3:ЏX18k1Uޛޗk`d( lu0J}sGP zu1?1+b릉|'cH#z+a:}raE\D(ui9X"RE[Uk^ 6"%Rp|FRg:5 [6fE'"[Z CY+\%Wtpm-key_attestation-0.14.1/lib/tpm/certificates/AMD/0000755000004100000410000000000015030703303022240 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/AMD/RootCA/0000755000004100000410000000000015030703303023367 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/AMD/RootCA/AMD-fTPM-ECC-RootCA.crt0000644000004100000410000000140615030703303027024 0ustar www-datawww-data00#E"Zd+?0 *H=0v10U  Engineering1 0 UUS10U Sunnyvale1 0 UCA10U Advanced Micro Devices10 UAMDTPM0 160101050000Z 410101050000Z0v10U  Engineering1 0 UUS10U Sunnyvale1 0 UCA10U Advanced Micro Devices10 UAMDTPM0Y0*H=*H=B(FAwrZ &T" 4'>RgP \Zo"Qٕ[&=`ҾW00U0# +7+8~rc0U8~rc0U008+,0*0(+0http://ftpm.amd.com/pki/ocsp0,U%0#0!http://ftpm.amd.com/pki/crl0CU <0:08 +xe 0*0(+https://ftpm.amd.com/pki/cps0 *H=H0E!ErX+A1 p 5>ӗ@mm=:4m[t!$zR=!>&tpm-key_attestation-0.14.1/lib/tpm/certificates/AMD/RootCA/AMD-fTPM-RSA-RootCA.crt0000644000004100000410000000221415030703303027055 0ustar www-datawww-data00p&M9<][IN!0  *H  0v10U  Engineering1 0 UUS10U Sunnyvale1 0 UCA10U Advanced Micro Devices10 UAMDTPM0 141023143432Z 391023143432Z0v10U  Engineering1 0 UUS10U Sunnyvale1 0 UCA10U Advanced Micro Devices10 UAMDTPM0"0  *H 0 BMV}x-P @Dw%s+TP ɬ+|p/Ғy:6ON .i7c)Q$ ({=xR@#WRDIzc߾ggaW[U,,2n9OvLfzOK Y7d<-^ Z8+[So)qg0xM`D̛+带A 0 0U0# +7+WT_yiQB!x_h/0UWT_yiQB!x_h/0U008+,0*0(+0http://ftpm.amd.com/pki/ocsp0,U%0#0!http://ftpm.amd.com/pki/crl0=U 60402U 0*0(+https://ftpm.amd.com/pki/cps0  *H  ܀c'i٬1 7pw zT`vXqn{Ȉ`Q҇zFMk4֤.Hi[0̨0՛O7 !/>Geav;/2LMe!E+8[iu߁/9=MZ9>Osb=A;[2%֒-(iPKШ09^+ngd|hJ[.13@Ybi/jctpm-key_attestation-0.14.1/lib/tpm/certificates/Microsoft/0000755000004100000410000000000015030703304023605 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/Microsoft/RootCA/0000755000004100000410000000000015030703304024734 5ustar www-datawww-data././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroottpm-key_attestation-0.14.1/lib/tpm/certificates/Microsoft/RootCA/Microsoft TPM Root Certificate Authority 2014.certpm-key_attestation-0.14.1/lib/tpm/certificates/Microsoft/RootCA/Microsoft TPM Root Certificate Auth0000644000004100000410000000277115030703304033245 0ustar www-datawww-data00ݠ]0N 'IiP]0  *H  01 0 UUS10U Washington10URedmond10U Microsoft Corporation1604U-Microsoft TPM Root Certificate Authority 20140 141210213119Z 391210213928Z01 0 UUS10U Washington10URedmond10U Microsoft Corporation1604U-Microsoft TPM Root Certificate Authority 20140"0  *H 0 ʷG!H,a?H)ۃaFaS*(`pn8 14w8. )*mTh!Ƶ`^#6+EVޗM"e6|N"<` 1LHw :, ^!_N|ו4sWò#* hyPqOkLj:XdHv/r~M\gNoπӄ򠧙NZic2Ʒi1צ傖pR͕wYtn;pj*Sܺ0߉xUPWEwؕ֙@|$#(C olR."DԹu$Uq.+!WTn sXXP\nxHc>5MuUY[XY0ղ}?ykAl/HL=ҵ٥$.zx#y}fTѤݭ4f67Lf9Vt$>dSƢ`Y#aނ?H)GK-SG<ЭcX=!r%z4/km9H˒liE‘JxslCl* fF}yC{!38Q娓M̫ҥZaߏ̇)wp2=tpm-key_attestation-0.14.1/lib/tpm/certificates/NationZ/0000755000004100000410000000000015030703304023222 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/NationZ/RootCA/0000755000004100000410000000000015030703304024351 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/NationZ/RootCA/EkRootCA.crt0000644000004100000410000000153615030703304026477 0ustar www-datawww-data-----BEGIN CERTIFICATE----- MIICRDCCAcqgAwIBAgIBATAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJDTjEhMB8G A1UECgwYTmF0aW9ueiBUZWNobm9sb2dpZXMgSW5jMRswGQYDVQQLDBJOYXRpb256 IFRQTSBEZXZpY2UxHDAaBgNVBAMME05hdGlvbnogVFBNIFJvb3QgQ0EwHhcNMTcw NTEyMDAwMDAwWhcNNDcwNTEzMDAwMDAwWjBrMQswCQYDVQQGEwJDTjEhMB8GA1UE CgwYTmF0aW9ueiBUZWNobm9sb2dpZXMgSW5jMRswGQYDVQQLDBJOYXRpb256IFRQ TSBEZXZpY2UxHDAaBgNVBAMME05hdGlvbnogVFBNIFJvb3QgQ0EwdjAQBgcqhkjO PQIBBgUrgQQAIgNiAATvuDTN8TNvp3A9fSjWpDARLmvz7ItQrDq/mmuzvzInwQfs YKUUJza4MXB3yS0PH1jjv1YMvaIBIalAgc+kahScQUy6W2fy6hd36pazmc/vQfG3 Gdhw56gGwRHx4rn4TuqjQjBAMB0GA1UdDgQWBBQ6vP8I314BDCtkB4vHzpUG9Aj9 5DAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNo ADBlAjApzqSmd4cCMKC7slJ4NE/7zweXZx89JzSEnEWGcq78jbbXCw6yM+R4nCNX phflI9QCMQCeFOAvyR+DQvThfGFINABej+1zeDVIjuZHat3FHVyV0UQVClPgMlZu TntipXwGOVY= -----END CERTIFICATE----- tpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/0000755000004100000410000000000015030703304023160 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/RootCA/0000755000004100000410000000000015030703304024307 5ustar www-datawww-data././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroottpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/RootCA/GlobalSign Trusted Platform Module ECC Root CA.crttpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/RootCA/GlobalSign Trusted Platform Module EC0000644000004100000410000000126715030703304033117 0ustar www-datawww-data00:EܜYFKy0 *H=01;09U 2GlobalSign Trusted Computing Certificate Authority10U  GlobalSign1705U.GlobalSign Trusted Platform Module ECC Root CA0 141126000000Z 380119031407Z01;09U 2GlobalSign Trusted Computing Certificate Authority10U  GlobalSign1705U.GlobalSign Trusted Platform Module ECC Root CA0v0*H=+"b5:lCP?zwU9xk}z-9SVŔ>bk҆-zHf_uKqX2zPYw3!rt;2Wu|2Ǵ~rEc0a0U0U00Ua> [&^)aG00U#0a> [&^)aG00 *H=g0d0wMZ7PgS'E >U. |P߲{04Ǥtt {h"<ʮ L"Bd3a6..Nctpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/RootCA/GlobalSign Trusted Computing CA.crt0000644000004100000410000000173315030703304032653 0ustar www-datawww-data00   0  *H  01;09U 2GlobalSign Trusted Computing Certificate Authority10U  GlobalSign1301U*GlobalSign Trusted Platform Module Root CA0 090318100000Z 490318100000Z01;09U 2GlobalSign Trusted Computing Certificate Authority10U  GlobalSign1301U*GlobalSign Trusted Platform Module Root CA0"0  *H 0 -0$ڶƅqC̈r=ǁU#DZQ_c3drx3ǯ[v= (ghӈ!_b?NséAuR)6Bxؿ8tW/~y1b{宲9]R 1v٨12iS ekndtpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/RootCA/STM TPM ECC Root CA 01.crt0000644000004100000410000000131415030703304030030 0ustar www-datawww-data00OG,˧ 0 *H=01;09U 2GlobalSign Trusted Computing Certificate Authority10U  GlobalSign1705U.GlobalSign Trusted Platform Module ECC Root CA0 151028000000Z 380119031407Z0N1 0 UCH10U STMicroelectronics NV10USTM TPM ECC Root CA 010v0*H=+"bn8̊@| JS骆qKrUfۯ`tz0[m=9GwuR:J܍wڕ:*SDiG00U0U00U V< CrS)0U#0a> [&^)aG00LU E0C0A +2Z0402+&https://www.globalsign.com/repository/0 *H=g0d0Z{<2u!rSз\U6rrt7V0bL-ǕרKV6HVg1c|w GL11tpm-key_attestation-0.14.1/lib/tpm/certificates/STMicro/RootCA/ST TPM Root Certificate.crt0000644000004100000410000000202015030703304031071 0ustar www-datawww-data0 0 "l~0  *H  01;09U 2GlobalSign Trusted Computing Certificate Authority10U  GlobalSign1301U*GlobalSign Trusted Platform Module Root CA0 090728120000Z 391231235959Z0J1 0 UCH10U STMicroelectronics NV10USTM TPM EK Root CA0"0  *H 0 }'C,+zm[vI!<ǠrϤfzyElKmtk5- x jpokx">V²)ʹ5q}hWAtn3@J)MQ ZVEYz ՓjO.!9ep~$ᝥL?˕{;dJd y9HqԦ&=0v/#]7\B]YoOP=-.Dii(ؔķ=,%fwB$=ۏ6eUd/WΩ _EZl d6}qOF99MdE+xn~tpm-key_attestation-0.14.1/lib/tpm/certificates/Infineon/RootCA/IFX TPM EK Root CA.cer0000644000004100000410000000212415030703303027724 0ustar www-datawww-data0P08G$!?} ͇HZ0  *H 01 0 UUS10U VeriSign, Inc.1;09U 2VeriSign Trusted Computing Certification Authority110/U(VeriSign Trusted Platform Module Root CA0 051025000000Z 301024235959Z0m1 0 UDE10UBavaria1!0U Infineon Technologies AG1 0 U AIM10UIFX TPM EK Root CA0"0  *H 0 &jX4Amt+-O/hÿK ԓ= 0Yd:*w<$O+D٭aw XVE*MbrK`ngJ ɋVaE5$9uC-7YVQ"%00U00XU N0L0J `HE/0;09+-http://www.verisign.com/repository/index.html0U0UVDcrE TB0U#0 D&7Eo0  *H X|ٓyoM5GpOϷO|E-7]suw0Fo>v~-WMiJf/B^M?PDłC׿:~õ /)fg-O:r2`IHm$2i,pĀKiQ.V *n "/5㬍kIB0@0UܻVueA0U0U00  *H  aLw2`,R[U/fcJ SJ4!3H2wTއ%7X DD?-W[A`*yqzv$ #:>2DKn)-9e}⓫Z Fce6#4HKL#!fjkatkY(qY$ ;` >KwC)_K/!>؞H([+YY(0K:nsK|Ʉ~p u/ 6 dɯHajêC+J;*!XBFNkՕ%<‹ڸ땮`GkLݫيdL!KsɆ HdFgg2u!EwIq*zql N0)Lw(Lcp2Zlu;(CqɤSӑͫŮRTJ \ļ}0 z;`n(ː(1h&TsuyTwZ>eS2l"TjTr6K LZ iu٬yHtpm-key_attestation-0.14.1/lib/tpm/s_attest/0000755000004100000410000000000015030703304021021 5ustar www-datawww-datatpm-key_attestation-0.14.1/lib/tpm/s_attest/s_certify_info.rb0000644000004100000410000000057615030703304024360 0ustar www-datawww-data# frozen_string_literal: true require "bindata" require "tpm/sized_buffer" require "tpm/tpm2b_name" module TPM class SAttest < BinData::Record # Section 10.12.3 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf class SCertifyInfo < BinData::Record tpm2b_name :name sized_buffer :qualified_name end end end tpm-key_attestation-0.14.1/lib/tpm/aik_certificate.rb0000644000004100000410000000605115030703303022627 0ustar www-datawww-data# frozen_string_literal: true require "delegate" require "openssl" require "tpm/constants" require "tpm/openssl_helper" module TPM # Section 3.2 in https://www.trustedcomputinggroup.org/wp-content/uploads/Credential_Profile_EK_V2.0_R14_published.pdf class AIKCertificate < SimpleDelegator ASN_V3 = 2 EMPTY_NAME = OpenSSL::X509::Name.new([]).freeze SAN_DIRECTORY_NAME = 4 if TPM::OpenSSLHelper.running_openssl_version_35_or_up? OID_TCG_AT_TPM_MANUFACTURER = "tcg-at-tpmManufacturer" OID_TCG_AT_TPM_MODEL = "tcg-at-tpmModel" OID_TCG_AT_TPM_VERSION = "tcg-at-tpmVersion" OID_TCG_KP_AIK_CERTIFICATE = "Attestation Identity Key Certificate" else OID_TCG = "2.23.133" OID_TCG_AT_TPM_MANUFACTURER = "#{OID_TCG}.2.1" OID_TCG_AT_TPM_MODEL = "#{OID_TCG}.2.2" OID_TCG_AT_TPM_VERSION = "#{OID_TCG}.2.3" OID_TCG_KP_AIK_CERTIFICATE = "#{OID_TCG}.8.3" end def self.from_der(certificate_der) new(OpenSSL::X509::Certificate.new(certificate_der)) end def conformant? in_use? && valid_version? && valid_extended_key_usage? && valid_basic_constraints? && empty_subject? && valid_subject_alternative_name? end private def in_use? now = Time.now not_before < now && now < not_after end def valid_version? version == ASN_V3 end def valid_basic_constraints? basic_constraints = extension("basicConstraints") basic_constraints && basic_constraints.value == "CA:FALSE" && basic_constraints.critical? end def valid_extended_key_usage? extended_key_usage = extension("extendedKeyUsage") extended_key_usage && extended_key_usage.value == OID_TCG_KP_AIK_CERTIFICATE && !extended_key_usage.critical? end def empty_subject? subject.eql?(EMPTY_NAME) end def valid_subject_alternative_name? if san_extension san_extension.critical? && !tpm_manufacturer.empty? && TPM::VENDOR_IDS[tpm_manufacturer] && !tpm_model.empty? && !tpm_version.empty? end end def extension(oid) extensions.detect { |ext| ext.oid == oid } end def tpm_manufacturer if san_name san_name.assoc(OID_TCG_AT_TPM_MANUFACTURER).at(1) end end def tpm_model if san_name san_name.assoc(OID_TCG_AT_TPM_MODEL).at(1) end end def tpm_version if san_name san_name.assoc(OID_TCG_AT_TPM_VERSION).at(1) end end def san_name if san_extension san_asn1 = OpenSSL::ASN1.decode(san_extension).find do |val| val.tag_class == :UNIVERSAL && val.tag == OpenSSL::ASN1::OCTET_STRING end directory_name = OpenSSL::ASN1.decode(san_asn1.value).find do |val| val.tag_class == :CONTEXT_SPECIFIC && val.tag == SAN_DIRECTORY_NAME end OpenSSL::X509::Name.new(directory_name.value.first).to_a end end def san_extension extension("subjectAltName") end end end tpm-key_attestation-0.14.1/lib/tpm/key_attestation.rb0000644000004100000410000000512415030703304022731 0ustar www-datawww-data# frozen_string_literal: true require "openssl" require "tpm/key_attestation/version" require "tpm/aik_certificate" require "tpm/certify_validator" require "tpm/constants" require "tpm/public_area" module TPM class KeyAttestation # https://docs.microsoft.com/en-us/windows-server/security/guarded-fabric-shielded-vm/guarded-fabric-install-trusted-tpm-root-certificates TRUSTED_CERTIFICATES = begin pattern = File.expand_path(File.join(__dir__, "certificates", "*", "RootCA", "*.*")) Dir.glob(pattern).map do |filename| file = File.binread(filename) OpenSSL::X509::Certificate.new(file) end end class Error < StandardError; end attr_reader( :certify_info, :signature, :certified_key, :certificates, :signature_algorithm, :hash_algorithm, :qualifying_data, :trusted_certificates ) def initialize( certify_info, signature, certified_key, certificates, qualifying_data, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256, trusted_certificates: TRUSTED_CERTIFICATES ) @certify_info = certify_info @signature = signature @certified_key = certified_key @certificates = certificates @signature_algorithm = signature_algorithm @hash_algorithm = hash_algorithm @qualifying_data = qualifying_data @trusted_certificates = trusted_certificates end def key if valid? public_area.key end end def valid? certify_validator.valid?(aik_certificate.public_key) && aik_certificate.conformant? && trustworthy? end private def certify_validator @certify_validator ||= TPM::CertifyValidator.new( certify_info, signature, qualifying_data, public_area, signature_algorithm: signature_algorithm, hash_algorithm: hash_algorithm ) end def trustworthy? x509_certificates = certificates.map { |c| OpenSSL::X509::Certificate.new(c) } trust_store.verify(x509_certificates[0], x509_certificates[1..-1]) end def trust_store @trust_store ||= OpenSSL::X509::Store.new.tap do |trust_store| trusted_certificates.uniq(&:serial).each { |trusted_certificate| trust_store.add_cert(trusted_certificate) } end end def aik_certificate @aik_certificate ||= TPM::AIKCertificate.from_der(certificates.first) end def public_area @public_area ||= TPM::PublicArea.new(certified_key) end end end tpm-key_attestation-0.14.1/lib/tpm/tpmt_ha.rb0000644000004100000410000000064215030703304021156 0ustar www-datawww-data# frozen_string_literal: true require "bindata" module TPM class TpmtHa < BinData::Record BYTE_LENGTH = 8 DIGEST_LENGTH_SHA1 = 160 DIGEST_LENGTH_SHA256 = 256 endian :big uint16 :hash_alg choice :digest, selection: :hash_alg do string TPM::ALG_SHA1, length: DIGEST_LENGTH_SHA1 / BYTE_LENGTH string TPM::ALG_SHA256, length: DIGEST_LENGTH_SHA256 / BYTE_LENGTH end end end tpm-key_attestation-0.14.1/lib/tpm/constants.rb0000644000004100000410000000242215030703304021534 0ustar www-datawww-data# frozen_string_literal: true module TPM # Section 6 in https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf GENERATED_VALUE = 0xFF544347 ST_ATTEST_CERTIFY = 0x8017 # Algorithms ALG_RSA = 0x0001 ALG_SHA1 = 0x0004 ALG_SHA256 = 0x000B ALG_SHA384 = 0x000C ALG_SHA512 = 0x000D ALG_NULL = 0x0010 ALG_RSASSA = 0x0014 ALG_RSAPSS = 0x0016 ALG_ECDSA = 0x0018 ALG_ECC = 0x0023 # ECC curves ECC_NIST_P256 = 0x0003 ECC_NIST_P384 = 0x0004 ECC_NIST_P521 = 0x0005 # https://trustedcomputinggroup.org/resource/vendor-id-registry/ section 2 "TPM Capabilities Vendor ID (CAP_VID)" VENDOR_IDS = { "id:414D4400" => "AMD", "id:41544D4C" => "Atmel", "id:4252434D" => "Broadcom", "id:49424D00" => "IBM", "id:49465800" => "Infineon", "id:494E5443" => "Intel", "id:4C454E00" => "Lenovo", "id:4E534D20" => "National Semiconductor", "id:4E545A00" => "Nationz", "id:4E544300" => "Nuvoton Technology", "id:51434F4D" => "Qualcomm", "id:534D5343" => "SMSC", "id:53544D20" => "ST Microelectronics", "id:534D534E" => "Samsung", "id:534E5300" => "Sinosun", "id:54584E00" => "Texas Instruments", "id:57454300" => "Winbond", "id:524F4343" => "Fuzhou Rockchip", }.freeze end tpm-key_attestation-0.14.1/lib/tpm/tpms_ecc_point.rb0000644000004100000410000000024715030703304022531 0ustar www-datawww-data# frozen_string_literal: true require "bindata" module TPM class TpmsEccPoint < BinData::Record endian :big sized_buffer :x sized_buffer :y end end tpm-key_attestation-0.14.1/lib/tpm/openssl_helper.rb0000644000004100000410000000032015030703304022535 0ustar www-datawww-data# frozen_string_literal: true module TPM module OpenSSLHelper def self.running_openssl_version_35_or_up? OpenSSL::OPENSSL_LIBRARY_VERSION.match(/\d+\.\d+\.\d+/).to_s >= "3.5.0" end end end tpm-key_attestation-0.14.1/Appraisals0000644000004100000410000000060015030703303017642 0ustar www-datawww-data# frozen_string_literal: true appraise "openssl_2_2" do gem "openssl", "~> 2.2.0" end appraise "openssl_2_1" do gem "openssl", "~> 2.1.0" end appraise "openssl_3_0" do gem "openssl", "~> 3.0.0" end appraise "openssl_3_1" do gem "openssl", "~> 3.1.0" end appraise "openssl_3_2" do gem "openssl", "~> 3.2.0" end appraise "openssl_3_3" do gem "openssl", "~> 3.3.0" end tpm-key_attestation-0.14.1/gemfiles/0000755000004100000410000000000015030703303017417 5ustar www-datawww-datatpm-key_attestation-0.14.1/gemfiles/openssl_2_2.gemfile0000644000004100000410000000035415030703303023100 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" gem "openssl", "~> 2.2.0" gemspec path: "../" tpm-key_attestation-0.14.1/gemfiles/openssl_2_1.gemfile0000644000004100000410000000035415030703303023077 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" gem "openssl", "~> 2.1.0" gemspec path: "../" tpm-key_attestation-0.14.1/gemfiles/openssl_3_3.gemfile0000644000004100000410000000035415030703303023102 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" gem "openssl", "~> 3.3.0" gemspec path: "../" tpm-key_attestation-0.14.1/gemfiles/openssl_3_1.gemfile0000644000004100000410000000035415030703303023100 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" gem "openssl", "~> 3.1.0" gemspec path: "../" tpm-key_attestation-0.14.1/gemfiles/openssl_3_0.gemfile0000644000004100000410000000035415030703303023077 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" gem "openssl", "~> 3.0.0" gemspec path: "../" tpm-key_attestation-0.14.1/gemfiles/openssl_3_2.gemfile0000644000004100000410000000035415030703303023101 0ustar www-datawww-data# This file was generated by Appraisal source "https://rubygems.org" gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" gem "openssl", "~> 3.2.0" gemspec path: "../" tpm-key_attestation-0.14.1/.rspec0000644000004100000410000000005515030703303016741 0ustar www-datawww-data--color --require spec_helper --order random tpm-key_attestation-0.14.1/Rakefile0000644000004100000410000000031715030703303017272 0ustar www-datawww-data# frozen_string_literal: true require "bundler/gem_tasks" require "rspec/core/rake_task" require "rubocop/rake_task" RSpec::Core::RakeTask.new(:spec) RuboCop::RakeTask.new task default: [:rubocop, :spec] tpm-key_attestation-0.14.1/tpm-key_attestation.gemspec0000644000004100000410000000233315030703304023200 0ustar www-datawww-data# frozen_string_literal: true require_relative 'lib/tpm/key_attestation/version' Gem::Specification.new do |spec| spec.name = "tpm-key_attestation" spec.version = TPM::KeyAttestation::VERSION spec.authors = ["Gonzalo"] spec.license = "Apache-2.0" spec.summary = "TPM Key Attestation verifier" spec.homepage = "https://github.com/cedarcode/tpm-key_attestation" spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0") spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md" # Specify which files should be added to the gem when it is released. # The `git ls-files -z` loads the files in the RubyGem that have been added into git. spec.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } end spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.add_dependency "bindata", "~> 2.4" spec.add_dependency "openssl", "> 2.0" spec.add_dependency "openssl-signature_algorithm", "~> 1.0" end tpm-key_attestation-0.14.1/Gemfile0000644000004100000410000000037615030703303017125 0ustar www-datawww-data# frozen_string_literal: true source "https://rubygems.org" # Specify your gem's dependencies in tpm-key_attestation.gemspec gemspec gem "appraisal", "~> 2.5.0" gem "byebug", "~> 11.0" gem "rake", "~> 13.0" gem "rspec", "~> 3.0" gem "rubocop", "~> 1" tpm-key_attestation-0.14.1/LICENSE0000644000004100000410000002613515030703303016640 0ustar www-datawww-data Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. tpm-key_attestation-0.14.1/README.md0000644000004100000410000000331515030703303017105 0ustar www-datawww-data# tpm-key_attestation TPM Key Attestation utitlies [![Gem](https://img.shields.io/gem/v/tpm-key_attestation.svg?style=flat-square&color=informational)](https://rubygems.org/gems/tpm-key_attestation) [![Actions Build](https://github.com/cedarcode/tpm-key_attestation/workflows/build/badge.svg)](https://github.com/cedarcode/tpm-key_attestation/actions) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-informational.svg?style=flat-square)](https://conventionalcommits.org) ## Installation Add this line to your application's Gemfile: ```ruby gem 'tpm-key_attestation' ``` And then execute: $ bundle install Or install it yourself as: $ gem install tpm-key_attestation ## Usage ```ruby key_attestation = TPM::KeyAttestation.new( certify_info, signature, certified_object, signing_key, quilifying_data, signature_algorithm: TPM::ALG_RSAPSS # Supported values: TPM::ALG_RSAPSS, TPM::ALG_RSASSA, TPM::ALG_ECDSA (default TPM::ALG_RSASSA) ) if key_attestation.valid? key_attestation.key end ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/cedarcode/tpm-key_attestation. tpm-key_attestation-0.14.1/.rubocop.yml0000644000004100000410000000471715030703303020107 0ustar www-datawww-dataAllCops: TargetRubyVersion: 2.4 DisabledByDefault: true Exclude: - "gemfiles/**/*" - "vendor/bundle/**/*" Bundler: Enabled: true Gemspec: Enabled: true Layout: Enabled: true Layout/LineLength: Max: 120 Lint: Enabled: true Naming: Enabled: true Security: Enabled: true Style/BlockComments: Enabled: true Style/CaseEquality: Enabled: true Style/ClassAndModuleChildren: Enabled: true Style/ClassMethods: Enabled: true Style/ClassVars: Enabled: true Style/CommentAnnotation: Enabled: true Style/ConditionalAssignment: Enabled: true Style/DefWithParentheses: Enabled: true Style/Dir: Enabled: true Style/EachForSimpleLoop: Enabled: true Style/EachWithObject: Enabled: true Style/EmptyBlockParameter: Enabled: true Style/EmptyCaseCondition: Enabled: true Style/EmptyElse: Enabled: true Style/EmptyLambdaParameter: Enabled: true Style/EmptyLiteral: Enabled: true Style/EvenOdd: Enabled: true Style/ExpandPathArguments: Enabled: true Style/For: Enabled: true Style/FrozenStringLiteralComment: Enabled: true Style/GlobalVars: Enabled: true Style/HashSyntax: Enabled: true Style/IdenticalConditionalBranches: Enabled: true Style/IfInsideElse: Enabled: true Style/InverseMethods: Enabled: true Style/MethodCallWithoutArgsParentheses: Enabled: true Style/MethodDefParentheses: Enabled: true Style/MultilineMemoization: Enabled: true Style/MutableConstant: Enabled: true Style/NestedParenthesizedCalls: Enabled: true Style/OptionalArguments: Enabled: true Style/ParenthesesAroundCondition: Enabled: true Style/RedundantBegin: Enabled: true Style/RedundantConditional: Enabled: true Style/RedundantException: Enabled: true Style/RedundantFreeze: Enabled: true Style/RedundantInterpolation: Enabled: true Style/RedundantParentheses: Enabled: true Style/RedundantPercentQ: Enabled: true Style/RedundantReturn: Enabled: true Style/RedundantSelf: Enabled: true Style/Semicolon: Enabled: true Style/SingleLineMethods: Enabled: true Style/SpecialGlobalVars: Enabled: true Style/SymbolLiteral: Enabled: true Style/TrailingBodyOnClass: Enabled: true Style/TrailingBodyOnMethodDefinition: Enabled: true Style/TrailingBodyOnModule: Enabled: true Style/TrailingMethodEndStatement: Enabled: true Style/TrivialAccessors: Enabled: true Style/UnpackFirst: Enabled: true Style/YodaCondition: Enabled: true Style/ZeroLengthPredicate: Enabled: true tpm-key_attestation-0.14.1/CHANGELOG.md0000644000004100000410000000733615030703303017446 0ustar www-datawww-data# Changelog ## [v0.14.1] - 2025-05-23 ### Fixed - Support for OpenSSL 3.5+ `OID` values returned from the extensions created by `OpenSSL::X509::ExtensionFactory`. [@nicolastemciuc] ## [v0.14.0] - 2025-02-06 - Handle incompatibility between `parameters` and `unique` in `TPublic`. [@nicolastemciuc], [@santiagorodriguez96] ## [v0.13.1] - 2025-01-22 - Fix build [@nicolastemciuc] ## [v0.13.0] - 2025-01-21 - Use public key from AIK cert for signature algorithm initalization [@santiagorodriguez96] - Support algorithm being ECC and pubArea's scheme parameter being TPM_ALG_NULL [@santiagorodriguez96] - Allow TPM:TPublic to handle ECC keys in pubArea correctly [@santiagorodriguez96] ## [v0.12.1] - 2024-08-05 - Fix loading trusted certificates on Windows. #20 & #21 [@johnnyshields], [@salmanasiddiqui] ## [v0.12.0] - 2022-07-05 - Loose OpenSSL dependency to support 3.2 users. Credits to @stanhu <3 ## [v0.11.0] - 2022-07-05 - Support OpenSSL ~>3.0.0. Credits to @ClearlyClaire <3 ## [v0.10.0] - 2020-07-09 ### Added - Support ECDSA with NIST P384 and P521 curves ## [v0.9.0] - 2020-05-31 ### Fixed - Fixed compatibility with OpenSSL-C (libssl) v1.0.2 ([@santiagorodriguez96]) ## [v0.8.0] - 2020-03-29 ### Changed - Update `openssl-signature_algorithm` gem dependency from `v0.3` to `v0.4`. ## [v0.7.0] - 2020-02-25 ### Added - `TPM::KeyAttestation#valid?` performs certificate path validation. In other words, it verifies trust up to an acceptable trusted root certificate. ### Changed - Rename `TPM::EKCertificate` to `TPM::AIKCertificate` to fix semantics ## [v0.6.0] - 2020-01-30 ### Changed - `TPM::KeyAttestation.new` now accepts `signature_algorithm` and `hash_algorithm` in TPM format in replacement of `JOSE` format `algorithm` string ## [v0.5.0] - 2020-01-23 ### Added - `TPM::KeyAttestation#valid?` also checks there's at least a well-formatted key in the attestation ## [v0.4.0] - 2020-01-20 ### Added - Suport verification of RSA-PSS key attestations ## [v0.3.0] - 2020-01-20 ### Added - `TPM::KeyAttestation#key` returns attested key as an instance of `OpenSSL::PKey::PKey` ## [v0.2.0] - 2020-01-16 ### Added - `TPM::KeyAttestation#valid?` ## [v0.1.0] - 2020-01-15 ### Added - `TPM::EKCertificate` wrapper - `TPM::SAttest` wrapper [v0.14.1]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.14.0...v0.14.1/ [v0.14.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.13.1...v0.14.0/ [v0.13.1]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.13.0...v0.13.1/ [v0.13.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.12.1...v0.13.0/ [v0.12.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.11.0...v0.12.0/ [v0.11.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.10.0...v0.11.0/ [v0.10.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.9.0...v0.10.0/ [v0.9.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.8.0...v0.9.0/ [v0.8.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.7.0...v0.8.0/ [v0.7.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.6.0...v0.7.0/ [v0.6.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.5.0...v0.6.0/ [v0.5.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.4.0...v0.5.0/ [v0.4.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.3.0...v0.4.0/ [v0.3.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.2.0...v0.3.0/ [v0.2.0]: https://github.com/cedarcode/tpm-key_attestation/compare/v0.1.0...v0.2.0/ [v0.1.0]: https://github.com/cedarcode/tpm-key_attestation/compare/57c926ef7e83830cee8d111fdc5ccaf99ab2e861...v0.1.0/ [@santiagorodriguez96]: https://github.com/santiagorodriguez96 [@ClearlyClaire]: https://github.com/ClearlyClaire