File CVE-2022-3500.patch of Package keylime

From 522ff1050a196d55cc214258593613d65d6701bd Mon Sep 17 00:00:00 2001
From: George Almasi <gheorghe@us.ibm.com>
Date: Sat, 8 Oct 2022 14:10:00 +0000
Subject: [PATCH 1/3] Proper exception handling in tornado_requests

Signed-off-by: George Almasi <gheorghe@us.ibm.com>
---
 keylime/tornado_requests.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: keylime-v6.3.2/keylime/tornado_requests.py
===================================================================
--- keylime-v6.3.2.orig/keylime/tornado_requests.py
+++ keylime-v6.3.2/keylime/tornado_requests.py
@@ -43,14 +43,17 @@ async def request(method, url, params=No
     except httpclient.HTTPError as e:
         if e.response is None:
             return TornadoResponse(500, str(e))
-
         return TornadoResponse(e.response.code, e.response.body)
     except ConnectionError as e:
         return TornadoResponse(599, f"Connection error: {str(e)}")
     except ssl.SSLError as e:
         return TornadoResponse(599, f"SSL connection error: {str(e)}")
+    except OSError as e:
+        return TornadoResponse(599, f"TCP/IP Connection error: {str(e)}")
+    except Exception as e:
+        return TornadoResponse(599, f"General communication failure: {str(e)}")
     if response is None:
-        return None
+        return TornadoResponse(599, "Unspecified failure in tornado (empty http response)")
     return TornadoResponse(response.code, response.body)
 
 
openSUSE Build Service is sponsored by