summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2026-04-16 07:29:53 +0000
committertb <>2026-04-16 07:29:53 +0000
commit03c4722ecfb4116b7f9fd10b6a216287a7ecf24d (patch)
tree472bc058c9c58486cf2eb322e029f561920119ef
parent4ab01251a636fac40d8a39e8cc3ba506580aa79b (diff)
downloadopenbsd-03c4722ecfb4116b7f9fd10b6a216287a7ecf24d.tar.gz
openbsd-03c4722ecfb4116b7f9fd10b6a216287a7ecf24d.tar.bz2
openbsd-03c4722ecfb4116b7f9fd10b6a216287a7ecf24d.zip
libtls: use tls_error_setx() after BIO_new_mem_buf()
This is the only place where tls_error_set() was used. While the new length check now guarantees that the failure is due to ENOMEM, this info does not add value. From Michael Forney ok bcook
-rw-r--r--src/lib/libtls/tls_keypair.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_keypair.c b/src/lib/libtls/tls_keypair.c
index e10d0fdc76..8b1beda116 100644
--- a/src/lib/libtls/tls_keypair.c
+++ b/src/lib/libtls/tls_keypair.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_keypair.c,v 1.11 2026/04/16 07:28:00 tb Exp $ */ 1/* $OpenBSD: tls_keypair.c,v 1.12 2026/04/16 07:29:53 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -155,7 +155,7 @@ tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error,
155 } 155 }
156 if ((cert_bio = BIO_new_mem_buf(keypair->cert_mem, 156 if ((cert_bio = BIO_new_mem_buf(keypair->cert_mem,
157 keypair->cert_len)) == NULL) { 157 keypair->cert_len)) == NULL) {
158 tls_error_set(error, TLS_ERROR_UNKNOWN, 158 tls_error_setx(error, TLS_ERROR_UNKNOWN,
159 "failed to create certificate bio"); 159 "failed to create certificate bio");
160 goto err; 160 goto err;
161 } 161 }