Skip to content

Commit 2dd4a8b

Browse files
Merge pull request #39 from nicolastemciuc/nt--fix-tests
Fix tests
2 parents e471b1b + 2f7a7f1 commit 2dd4a8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/tpm/key_attestation_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,11 @@
375375
t_public.parameters.scheme = TPM::ALG_NULL
376376
t_public.parameters.curve_id = curve_id
377377
t_public.parameters.kdf = TPM::ALG_NULL
378-
t_public.unique.buffer = attested_key.public_key.to_bn.to_s(2)[1..-1]
378+
379+
public_key_bytes = attested_key.public_key.to_bn.to_s(2)[1..-1]
380+
coordinate_length = public_key_bytes.size / 2
381+
t_public.unique.x.buffer = public_key_bytes[0..(coordinate_length - 1)]
382+
t_public.unique.y.buffer = public_key_bytes[coordinate_length..-1]
379383

380384
t_public.to_binary_s
381385
end

0 commit comments

Comments
 (0)