1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 15:23:33 +02:00

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
This commit is contained in:
tb
2026-04-16 07:29:53 +00:00
parent ddea2ef37c
commit e709fac20c
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: tls_keypair.c,v 1.11 2026/04/16 07:28:00 tb Exp $ */
/* $OpenBSD: tls_keypair.c,v 1.12 2026/04/16 07:29:53 tb Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -155,7 +155,7 @@ tls_keypair_load_cert(struct tls_keypair *keypair, struct tls_error *error,
}
if ((cert_bio = BIO_new_mem_buf(keypair->cert_mem,
keypair->cert_len)) == NULL) {
tls_error_set(error, TLS_ERROR_UNKNOWN,
tls_error_setx(error, TLS_ERROR_UNKNOWN,
"failed to create certificate bio");
goto err;
}