Dominique Leuenberger 2020-08-20 20:33:15 +00:00 committed by Git OBS Bridge
commit 19bac518fa
9 changed files with 74 additions and 52 deletions

View File

@ -0,0 +1,13 @@
diff -ur ibmswtpm2-1637.orig/src/NVDynamic.c ibmswtpm2-1637/src/NVDynamic.c
--- ibmswtpm2-1637.orig/src/NVDynamic.c 2020-03-26 23:15:48.000000000 +0100
+++ ibmswtpm2-1637/src/NVDynamic.c 2020-08-20 16:37:09.481920068 +0200
@@ -122,7 +122,7 @@
if(HandleGetType(nvHandle) == type)
break;
}
- if(handle != NULL)
+ if(addr && (handle != NULL))
*handle = nvHandle;
return addr;
}
Only in ibmswtpm2-1637/src: NVDynamic.c~

View File

@ -0,0 +1,30 @@
From 03efa66788ca4828392664c4f6123ad4f190c865 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 17 Aug 2020 19:28:51 +0200
Subject: [PATCH] TcpServerPosix: Fix use of uninitialized value.
ReadUINT32 does not modify the output when it fails. Do not use the
output in that case.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
src/TcpServerPosix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/TcpServerPosix.c b/src/TcpServerPosix.c
index 20fcb29352a2..5bcc47aaeac7 100644
--- a/src/TcpServerPosix.c
+++ b/src/TcpServerPosix.c
@@ -278,7 +278,8 @@ PlatformServer(
{
UINT32 actHandle;
ok = ReadUINT32(s, &actHandle);
- WriteUINT32(s, _rpc__ACT_GetSignaled(actHandle));
+ if(ok)
+ WriteUINT32(s, _rpc__ACT_GetSignaled(actHandle));
break;
}
default:
--
2.26.2

View File

@ -1,13 +0,0 @@
Index: ibmswtpm2-1119/src/CryptRsa.c
===================================================================
--- ibmswtpm2-1119.orig/src/CryptRsa.c
+++ ibmswtpm2-1119/src/CryptRsa.c
@@ -469,7 +469,7 @@ RSAES_Decode(
pSize++;
// Make sure that pSize has not gone over the end and that there are at least 8
// bytes of pad data.
- fail = (pSize >= coded->size) | fail;
+ fail = (pSize > coded->size) | fail;
fail = ((pSize - 2) < 8) | fail;
if((message->size < (UINT16)(coded->size - pSize)) || fail)
return TPM_RC_VALUE;

View File

@ -1,20 +0,0 @@
--- ibmswtpm2-1332/src/TcpServerPosix.c~ 2018-09-07 16:20:51.000000000 +0200
+++ ibmswtpm2-1332/src/TcpServerPosix.c 2019-07-04 19:58:14.736607559 +0200
@@ -292,7 +292,7 @@
int res, i;
int nSock = 0;
socklen_t length[2];
- BOOL continueServing;
+ BOOL continueServing = 0;
if (CreateSocket(PortNumber, &listenSocket[nSock], &length[nSock],
AF_INET) == 0) {
@@ -424,7 +424,7 @@
int res, i;
int nSock = 0;
socklen_t length[2];
- BOOL continueServing;
+ BOOL continueServing = 0;
if (CreateSocket(*PortNumber, &listenSocket[nSock], &length[nSock],
AF_INET) == 0) {

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Mon Aug 17 16:59:04 UTC 2020 - Michal Suchanek <msuchanek@suse.de>
- Update to upstream version 1637
* fixes build of ibmtss 1.5.0
* Refresh makefile.patch
* Drop upstreamed patches
- ibmswtpm2-fix-uninitialized.patch
- ibmswtpm2-fix-empty-decrypt.patch
* Fix use of uninitialized value:
+ ibmswtpm2-TcpServerPosix-Fix-use-of-uninitialized-value.patch
+ ibmswtpm2-NVDynamic-Fix-use-of-uninitialized-value.patch
-------------------------------------------------------------------
Mon Dec 23 12:06:22 UTC 2019 - mgerstner <matthias.gerstner@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package ibmswtpm2
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -25,16 +25,16 @@
%endif
Name: ibmswtpm2
Version: 1332
Version: 1637
Release: 0
Summary: IBM's Software TPM 2.0
License: BSD-3-Clause
Group: Development/Tools/Other
URL: https://sourceforge.net/projects/ibmswtpm2
Source: https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm%{version}.tar.gz
Patch1: makefile.patch
Patch2: ibmswtpm2-fix-uninitialized.patch
Patch3: ibmswtpm2-fix-empty-decrypt.patch
Patch: makefile.patch
Patch1: ibmswtpm2-TcpServerPosix-Fix-use-of-uninitialized-value.patch
Patch2: ibmswtpm2-NVDynamic-Fix-use-of-uninitialized-value.patch
BuildRequires: libopenssl-devel >= 1.0
%description

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e8193af3d11d9ff6a951dda8cd1f4693cb01934a8ad7876b84e92c6148ab0fd
size 590005

3
ibmtpm1637.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dd3a4c3f7724243bc9ebcd5c39bbf87b82c696d1c1241cb8e5883534f6e2e327
size 665378

View File

@ -1,8 +1,6 @@
Index: ibmswtpm2-1119/src/makefile
===================================================================
--- ibmswtpm2-1119.orig/src/makefile 2018-01-16 12:46:54.412486803 +0100
+++ ibmswtpm2-1119/src/makefile 2018-01-16 12:48:38.498125716 +0100
@@ -41,17 +41,17 @@
--- ibmswtpm2-1637.orig/src/makefile 2019-12-19 23:35:43.000000000 +0100
+++ ibmswtpm2-1637/src/makefile 2020-08-17 18:56:34.607550789 +0200
@@ -40,10 +40,10 @@
CC = /usr/bin/gcc
@ -12,15 +10,16 @@ Index: ibmswtpm2-1119/src/makefile
- -Werror -Wsign-compare \
- -c -ggdb -O0 \
+ -Werror -Wsign-compare -Wno-unused-value -Wno-aggressive-loop-optimizations \
+ -c -ggdb -O \
+ -c -ggdb \
-DTPM_POSIX \
-D_POSIX_ \
-DTPM_NUVOTON \
-I../utils \
-I.
-DTPM_NUVOTON
@@ -54,7 +54,7 @@
# --coverage \
# -fprofile-arcs -ftest-coverage
-LNFLAGS = -ggdb \
+LNFLAGS += -ggdb \
-DTPM_POSIX \
-DTPM_NUVOTON \
-lcrypto \
-lpthread \
-lrt \