chantra / rpms / tpm2-tools

Forked from rpms/tpm2-tools 2 years ago
Clone

Blame SOURCES/0001-tpm2_getekcertificate-add-default-web-address.patch

4ac4b9
From 8c72f7402d8977807f531b08976760d62676cf8a Mon Sep 17 00:00:00 2001
4ac4b9
From: Imran Desai <imran.desai@intel.com>
4ac4b9
Date: Thu, 23 Jan 2020 11:21:58 -0700
4ac4b9
Subject: [PATCH] tpm2_getekcertificate: add default web address
4ac4b9
4ac4b9
Currently only Intel (R) PTT certificates are hosted online.
4ac4b9
A default web address pointing to the endorsement key certificate
4ac4b9
hosting will help reduce user input.
4ac4b9
4ac4b9
Signed-off-by: Imran Desai <imran.desai@intel.com>
4ac4b9
---
4ac4b9
 test/integration/tests/getekcertificate.sh | 6 ++----
4ac4b9
 tools/tpm2_getekcertificate.c              | 1 +
4ac4b9
 2 files changed, 3 insertions(+), 4 deletions(-)
4ac4b9
4ac4b9
diff --git a/test/integration/tests/getekcertificate.sh b/test/integration/tests/getekcertificate.sh
4ac4b9
index 33f4f8b2e4c0..e8c521756d2a 100755
4ac4b9
--- a/test/integration/tests/getekcertificate.sh
4ac4b9
+++ b/test/integration/tests/getekcertificate.sh
4ac4b9
@@ -38,12 +38,10 @@ else
4ac4b9
     fi
4ac4b9
 fi
4ac4b9
 
4ac4b9
-tpm2_getekcertificate -u test_ek.pub -x -X -o ECcert.bin \
4ac4b9
-https://ekop.intel.com/ekcertservice/
4ac4b9
+tpm2_getekcertificate -u test_ek.pub -x -X -o ECcert.bin
4ac4b9
 
4ac4b9
 # Test that stdoutput is the same
4ac4b9
-tpm2_getekcertificate -u test_ek.pub -x https://ekop.intel.com/ekcertservice/ \
4ac4b9
--X > ECcert2.bin
4ac4b9
+tpm2_getekcertificate -u test_ek.pub -x -X > ECcert2.bin
4ac4b9
 
4ac4b9
 # stdout file should match -E file.
4ac4b9
 cmp ECcert.bin ECcert2.bin
4ac4b9
diff --git a/tools/tpm2_getekcertificate.c b/tools/tpm2_getekcertificate.c
4ac4b9
index 233d04d8b3d7..6a8fe894bb1c 100644
4ac4b9
--- a/tools/tpm2_getekcertificate.c
4ac4b9
+++ b/tools/tpm2_getekcertificate.c
4ac4b9
@@ -32,6 +32,7 @@ struct tpm_getekcertificate_ctx {
4ac4b9
 
4ac4b9
 static tpm_getekcertificate_ctx ctx = {
4ac4b9
     .is_tpm2_device_active = true,
4ac4b9
+    .ek_server_addr = "https://ekop.intel.com/ekcertservice/",
4ac4b9
 };
4ac4b9
 
4ac4b9
 static unsigned char *hash_ek_public(void) {
4ac4b9
-- 
4ac4b9
2.31.0
4ac4b9