summaryrefslogtreecommitdiff
path: root/backport-fix-CVE-2023-38408-upstream-terminate-process.patch
blob: f78551c3546e03120dd1ec0475e91ac588de7ac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 892506b13654301f69f9545f48213fc210e5c5cc Mon Sep 17 00:00:00 2001
From: "djm@openbsd.org" <djm@openbsd.org>
Date: Wed, 19 Jul 2023 13:55:53 +0000
Subject: [PATCH] upstream: terminate process if requested to load a
PKCS#11
 provider

that isn't a PKCS#11 provider; from / ok markus@

OpenBSD-Commit-ID: 39532cf18b115881bb4cfaee32084497aadfa05c

Reference:https://anongit.mindrot.org/openssh.git/patch/?id=892506b1365
Conflict:pkcs11_initialize_provider
---
 ssh-pkcs11.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/ssh-pkcs11.c b/ssh-pkcs11.c
index 995841f..b96021f 100644
--- a/ssh-pkcs11.c
+++ b/ssh-pkcs11.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11.c,v 1.54 2021/08/11 05:20:17 djm Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.57 2023/07/19 13:55:53 djm Exp $ */
 /*
  * Copyright (c) 2010 Markus Friedl.  All rights reserved.
  * Copyright (c) 2014 Pedro Martelletto. All rights reserved.
@@ -1743,10 +1743,8 @@ pkcs11_initialize_provider(struct pkcs11_uri *uri, struct pkcs11_provider **prov
 		error("dlopen %s failed: %s", provider_module, dlerror());
 		goto fail;
 	}
-	if ((getfunctionlist = dlsym(handle, "C_GetFunctionList")) == NULL) {
-		error("dlsym(C_GetFunctionList) failed: %s", dlerror());
-		goto fail;
-	}
+	if ((getfunctionlist = dlsym(handle, "C_GetFunctionList")) == NULL)
+		fatal("dlsym(C_GetFunctionList) failed: %s", dlerror());
 
 	p->module->handle = handle;
 	/* setup the pkcs11 callbacks */
-- 
2.23.0