summaryrefslogtreecommitdiff
path: root/src/lib/libtls
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libtls')
-rw-r--r--src/lib/libtls/tls_config.c4
-rw-r--r--src/lib/libtls/tls_util.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c
index 22fa8455a1..848117a91a 100644
--- a/src/lib/libtls/tls_config.c
+++ b/src/lib/libtls/tls_config.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_config.c,v 1.71 2024/08/02 15:00:01 tb Exp $ */ 1/* $OpenBSD: tls_config.c,v 1.72 2026/03/10 05:26:04 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -49,7 +49,7 @@ tls_config_load_file(struct tls_error *error, const char *filetype,
49 *buf = NULL; 49 *buf = NULL;
50 *len = 0; 50 *len = 0;
51 51
52 if ((fd = open(filename, O_RDONLY)) == -1) { 52 if ((fd = open(filename, O_RDONLY|O_CLOEXEC)) == -1) {
53 tls_error_set(error, TLS_ERROR_UNKNOWN, 53 tls_error_set(error, TLS_ERROR_UNKNOWN,
54 "failed to open %s file '%s'", 54 "failed to open %s file '%s'",
55 filetype, filename); 55 filetype, filename);
diff --git a/src/lib/libtls/tls_util.c b/src/lib/libtls/tls_util.c
index b276d2cfa7..d93efb830d 100644
--- a/src/lib/libtls/tls_util.c
+++ b/src/lib/libtls/tls_util.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_util.c,v 1.16 2023/05/14 07:26:25 op Exp $ */ 1/* $OpenBSD: tls_util.c,v 1.17 2026/03/10 05:26:04 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 4 * Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
@@ -162,7 +162,7 @@ tls_load_file(const char *name, size_t *len, char *password)
162 162
163 *len = 0; 163 *len = 0;
164 164
165 if ((fd = open(name, O_RDONLY)) == -1) 165 if ((fd = open(name, O_RDONLY|O_CLOEXEC)) == -1)
166 return (NULL); 166 return (NULL);
167 167
168 /* Just load the file into memory without decryption */ 168 /* Just load the file into memory without decryption */