Skip to content

Commit c50b4b4

Browse files
Merge pull request #449 from cedarcode/bump_tpm_attestation
Upgrade tpm-key_attestation dependency
2 parents 6fa4831 + 1260137 commit c50b4b4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

spec/webauthn/attestation_statement/tpm_spec.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@
175175
t_public.alg_type = ::TPM::ALG_ECC
176176
t_public.name_alg = name_alg
177177
t_public.parameters = pub_area_parameters
178-
t_public.unique.buffer = credential_key.public_key.to_bn.to_s(2)[1..-1]
178+
179+
public_key_bytes = credential_key.public_key.to_bn.to_s(2)[1..-1]
180+
coordinate_length = public_key_bytes.size / 2
181+
t_public.unique.x.buffer = public_key_bytes[0..(coordinate_length - 1)]
182+
t_public.unique.y.buffer = public_key_bytes[coordinate_length..-1]
179183

180184
t_public.to_binary_s
181185
end
@@ -200,7 +204,11 @@
200204
t_public.alg_type = ::TPM::ALG_ECC
201205
t_public.name_alg = name_alg
202206
t_public.parameters = pub_area_parameters
203-
t_public.unique.buffer = create_ec_key.public_key.to_bn.to_s(2)[1..-1]
207+
208+
public_key_bytes = create_ec_key.public_key.to_bn.to_s(2)[1..-1]
209+
coordinate_length = public_key_bytes.size / 2
210+
t_public.unique.x.buffer = public_key_bytes[0..(coordinate_length - 1)]
211+
t_public.unique.y.buffer = public_key_bytes[coordinate_length..-1]
204212

205213
t_public.to_binary_s
206214
end

webauthn.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
3939
spec.add_dependency "cose", "~> 1.1"
4040
spec.add_dependency "openssl", ">= 2.2"
4141
spec.add_dependency "safety_net_attestation", "~> 0.4.0"
42-
spec.add_dependency "tpm-key_attestation", "~> 0.12.0"
42+
spec.add_dependency "tpm-key_attestation", "~> 0.14.0"
4343

4444
spec.add_development_dependency "base64", ">= 0.1.0"
4545
spec.add_development_dependency "bundler", ">= 1.17", "< 3.0"

0 commit comments

Comments
 (0)