summary refs log tree commit diff
path: root/tls_config.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-27 10:28:40 -0500
committerJune McEnroe <june@causal.agency>2022-02-27 11:12:26 -0500
commit9c718c5df514e2a20c7d04e1db1716fdbab45a04 (patch)
tree0645cd11cf0382906afde12e54fff66725506b69 /tls_config.c
parenttls: Revert accidentally(?) reverted upstream (diff)
parentImport LibreSSL 3.5.0 (diff)
downloadlibretls-9c718c5df514e2a20c7d04e1db1716fdbab45a04.tar.gz
libretls-9c718c5df514e2a20c7d04e1db1716fdbab45a04.zip
Merge LibreSSL 3.5.0
Diffstat (limited to '')
-rw-r--r--tls_config.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tls_config.c b/tls_config.c
index 3b1f4ff..38ed1bb 100644
--- a/tls_config.c
+++ b/tls_config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_config.c,v 1.63 2021/01/21 22:03:25 eric Exp $ */
+/* $OpenBSD: tls_config.c,v 1.65 2022/01/25 21:51:24 eric Exp $ */
 /*
  * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
  *
@@ -723,7 +723,7 @@ tls_config_set_session_fd(struct tls_config *config, int session_fd)
 
 	if (sb.st_uid != getuid()) {
 		tls_config_set_errorx(config, "session file has incorrect "
-		    "owner (uid %i != %i)", sb.st_uid, getuid());
+		    "owner (uid %u != %u)", sb.st_uid, getuid());
 		return (-1);
 	}
 	mugo = sb.st_mode & (S_IRWXU|S_IRWXG|S_IRWXO);
@@ -739,6 +739,17 @@ tls_config_set_session_fd(struct tls_config *config, int session_fd)
 }
 
 int
+tls_config_set_sign_cb(struct tls_config *config, tls_sign_cb cb, void *cb_arg)
+{
+	config->use_fake_private_key = 1;
+	config->skip_private_key_check = 1;
+	config->sign_cb = cb;
+	config->sign_cb_arg = cb_arg;
+
+	return (0);
+}
+
+int
 tls_config_set_verify_depth(struct tls_config *config, int verify_depth)
 {
 	config->verify_depth = verify_depth;