fix merge properly!

This commit is contained in:
Peter Robinson 2019-03-16 16:52:00 +00:00
parent f146054881
commit ace1973e7e
5 changed files with 1 additions and 192 deletions

View File

@ -1,42 +0,0 @@
From 2565cf6c5cc7a0af7f426b7c9b03ac2f7c76005a Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javierm@redhat.com>
Date: Mon, 7 Jan 2019 11:31:50 +0100
Subject: [PATCH] options: fix broken -T option when passing additional
arguments
The commit 175e47711c7 ("lib/tpm2_options: restore TCTI configuration
environment variables") restored how the TCTI configuration was setup
for the 3.X releases, but this broke the -T,--tcti option since was
ignored.
Commit 554a13f45c0 ("options: fix broken -T option") partially fixed
this, but only when additional TCTI arguments were not used.
For example when specifying the -T device:/dev/tpmrm0 TCTI option:
$ tpm2_pcrlist -T device:/dev/tpmrm0
...
ERROR: Could not dlopen library: "device:/dev/tpmrm0"
ERROR: Could not load tcti, got: "device:/dev/tpmrm0"
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
lib/tpm2_options.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tpm2_options.c b/lib/tpm2_options.c
index 006c46e4944..1d1093aa74d 100644
--- a/lib/tpm2_options.c
+++ b/lib/tpm2_options.c
@@ -291,7 +291,7 @@ static tcti_conf tcti_get_config(const char *optstr) {
}
}
} else {
- conf.name = strdup(optstr);
+ parse_env_tcti(optstr, &conf);
}
if (!conf.name) {
--
2.19.2

View File

@ -1,32 +0,0 @@
From 554a13f45c05faa388e028369492e9cc7dee5f13 Mon Sep 17 00:00:00 2001
From: William Roberts <william.c.roberts@intel.com>
Date: Mon, 5 Nov 2018 11:39:02 -0800
Subject: [PATCH] options: fix broken -T option
commit:
- 175e47711c72 lib/tpm2_options: restore TCTI configuration environment variables
Broke the option handling, effectively ignoring the -T/--tcti input. Honor that input
if specified and don't just run the default TCTI search unless it's not specified.
Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
lib/tpm2_options.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/tpm2_options.c b/lib/tpm2_options.c
index 2531948ecf7..006c46e4944 100644
--- a/lib/tpm2_options.c
+++ b/lib/tpm2_options.c
@@ -290,6 +290,8 @@ static tcti_conf tcti_get_config(const char *optstr) {
parse_env_tcti(optstr, &conf);
}
}
+ } else {
+ conf.name = strdup(optstr);
}
if (!conf.name) {
--
2.19.2

View File

@ -1,6 +1,6 @@
Name: tpm2-tools
Version: 3.1.4
Release: 1%{?dist
Release: 1%{?dist}
Summary: A TPM2.0 testing tool build upon TPM2.0-TSS
License: BSD

View File

@ -1,89 +0,0 @@
From e43831512dad43ec5537d30911dba5f4c36fef59 Mon Sep 17 00:00:00 2001
From: William Roberts <william.c.roberts@intel.com>
Date: Wed, 17 Oct 2018 08:27:11 -0700
Subject: [PATCH] tpm2_getmanufc: fix OSSL build warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix the following reported error:
In file included from tools/tpm2_getmanufec.c:42:0:
tools/tpm2_getmanufec.c: In function Base64Encode:
/home/travis/build/AndreasFuchsSIT/tpm2-tss-engine/tpm2-tools/../installdir/usr/local/include/openssl/bio.h:596:34: error: value computed is not used [-Werror=unused-value]
# define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)
^
tools/tpm2_getmanufec.c:290:5: note: in expansion of macro BIO_flush
BIO_flush(bio);
^
/home/travis/build/AndreasFuchsSIT/tpm2-tss-engine/tpm2-tools/../installdir/usr/local/include/openssl/bio.h:589:34: error: value computed is not used [-Werror=unused-value]
# define BIO_set_close(b,c) (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)
^
tools/tpm2_getmanufec.c:292:5: note: in expansion of macro BIO_set_close
BIO_set_close(bio, BIO_NOCLOSE);
^
cc1: all warnings being treated as errors
make: *** [tools/tpm2_getmanufec.o] Error 1
make: *** Waiting for unfinished jobs....
Fixes: #1200
Signed-off-by: William Roberts <william.c.roberts@intel.com>
---
tools/tpm2_getmanufec.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tools/tpm2_getmanufec.c b/tools/tpm2_getmanufec.c
index 6ddf31eee5d..89702f9c78a 100644
--- a/tools/tpm2_getmanufec.c
+++ b/tools/tpm2_getmanufec.c
@@ -274,6 +274,7 @@ char *Base64Encode(const unsigned char* buffer)
{
BIO *bio, *b64;
BUF_MEM *bufferPtr;
+ char *final_string = NULL;
LOG_INFO("Calculating the Base64Encode of the hash of the Endorsement Public Key:");
@@ -287,9 +288,19 @@ char *Base64Encode(const unsigned char* buffer)
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
BIO_write(bio, buffer, SHA256_DIGEST_LENGTH);
- BIO_flush(bio);
+ int rc = BIO_flush(bio);
+ if (rc < 0) {
+ LOG_ERR("BIO_flush() failed");
+ goto bio_out;
+ }
+
BIO_get_mem_ptr(bio, &bufferPtr);
- BIO_set_close(bio, BIO_NOCLOSE);
+
+ rc = BIO_set_close(bio, BIO_NOCLOSE);
+ if (rc < 0) {
+ LOG_ERR("BIO_set_close() failed");
+ goto bio_out;
+ }
/* these are not NULL terminated */
char *b64text = bufferPtr->data;
@@ -305,8 +316,6 @@ char *Base64Encode(const unsigned char* buffer)
}
}
- char *final_string = NULL;
-
CURL *curl = curl_easy_init();
if (curl) {
char *output = curl_easy_escape(curl, b64text, len);
@@ -317,6 +326,7 @@ char *Base64Encode(const unsigned char* buffer)
}
curl_easy_cleanup(curl);
curl_global_cleanup();
+bio_out:
BIO_free_all(bio);
/* format to a proper NULL terminated string */
--
2.19.2

View File

@ -1,28 +0,0 @@
From d9a30001c702d2e18378166ed6a13802fdf40b84 Mon Sep 17 00:00:00 2001
From: Joshua Lock <joshua.g.lock@intel.com>
Date: Fri, 19 Oct 2018 11:36:31 +0100
Subject: [PATCH] tpm2_rsaencrypt: fix example in man page
The -I option was removed and became an argument
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
---
man/tpm2_rsaencrypt.1.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/tpm2_rsaencrypt.1.md b/man/tpm2_rsaencrypt.1.md
index e213180ab52..638e533471b 100644
--- a/man/tpm2_rsaencrypt.1.md
+++ b/man/tpm2_rsaencrypt.1.md
@@ -55,7 +55,7 @@ The key referenced by keyHandle is **required** to be:
# EXAMPLES
```
-tpm2_rsaencrypt -k 0x81010001 -I plain.in -o encrypted.out
+tpm2_rsaencrypt -k 0x81010001 -o encrypted.out plain.in
```
# RETURNS
--
2.19.2