diff options
| author | tb <> | 2026-04-16 07:28:00 +0000 |
|---|---|---|
| committer | tb <> | 2026-04-16 07:28:00 +0000 |
| commit | 4ab01251a636fac40d8a39e8cc3ba506580aa79b (patch) | |
| tree | 1507d9367c9990c48298039dc67d8d5ce9062f11 /src/lib/libtls/tls_client.c | |
| parent | d680a6fb78c5f1a30a0d45de7b989cee9631652a (diff) | |
| download | openbsd-4ab01251a636fac40d8a39e8cc3ba506580aa79b.tar.gz openbsd-4ab01251a636fac40d8a39e8cc3ba506580aa79b.tar.bz2 openbsd-4ab01251a636fac40d8a39e8cc3ba506580aa79b.zip | |
libtls: prefer x version of error setting
If a check fails and errno is not necessarily set by the previous API call
use tls_set_errorx() or tls_error_setx() since turning an unrelated errno
into an error string is unhelpful.
From Michael Forney
ok bcook
Diffstat (limited to 'src/lib/libtls/tls_client.c')
| -rw-r--r-- | src/lib/libtls/tls_client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_client.c b/src/lib/libtls/tls_client.c index 97e1d40210..7de9927b94 100644 --- a/src/lib/libtls/tls_client.c +++ b/src/lib/libtls/tls_client.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_client.c,v 1.51 2024/03/26 08:54:48 joshua Exp $ */ | 1 | /* $OpenBSD: tls_client.c,v 1.52 2026/04/16 07:28:00 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -115,7 +115,7 @@ tls_connect_servername(struct tls *ctx, const char *host, const char *port, | |||
| 115 | hints.ai_family = AF_UNSPEC; | 115 | hints.ai_family = AF_UNSPEC; |
| 116 | hints.ai_flags = AI_ADDRCONFIG; | 116 | hints.ai_flags = AI_ADDRCONFIG; |
| 117 | if ((s = getaddrinfo(h, p, &hints, &res0)) != 0) { | 117 | if ((s = getaddrinfo(h, p, &hints, &res0)) != 0) { |
| 118 | tls_set_error(ctx, TLS_ERROR_UNKNOWN, | 118 | tls_set_errorx(ctx, TLS_ERROR_UNKNOWN, |
| 119 | "%s", gai_strerror(s)); | 119 | "%s", gai_strerror(s)); |
| 120 | goto err; | 120 | goto err; |
| 121 | } | 121 | } |
