diff options
author | joshua <> | 2024-03-27 07:35:30 +0000 |
---|---|---|
committer | joshua <> | 2024-03-27 07:35:30 +0000 |
commit | 2f91b3106eca7de0d2c1cd49842ac4b5e027fc63 (patch) | |
tree | 396900e0e4e29e8b79d17e1b19353e11b386a6e7 /src/lib/libtls/tls_config.c | |
parent | f19ac0e6dc03f04cd86110a56e1c46cc6f2cd010 (diff) | |
download | openbsd-2f91b3106eca7de0d2c1cd49842ac4b5e027fc63.tar.gz openbsd-2f91b3106eca7de0d2c1cd49842ac4b5e027fc63.tar.bz2 openbsd-2f91b3106eca7de0d2c1cd49842ac4b5e027fc63.zip |
Add TLS_ERROR_INVALID_ARGUMENT error code to libtls
This is an initial pass, defining the error code and using it for
"too long"/length-related errors.
ok beck jsing
Diffstat (limited to 'src/lib/libtls/tls_config.c')
-rw-r--r-- | src/lib/libtls/tls_config.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c index 449071641b..645562e838 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.68 2024/03/26 06:24:52 joshua Exp $ */ | 1 | /* $OpenBSD: tls_config.c,v 1.69 2024/03/27 07:35:30 joshua Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -321,12 +321,12 @@ tls_config_parse_alpn(struct tls_config *config, const char *alpn, | |||
321 | q = s; | 321 | q = s; |
322 | while ((p = strsep(&q, ",")) != NULL) { | 322 | while ((p = strsep(&q, ",")) != NULL) { |
323 | if ((len = strlen(p)) == 0) { | 323 | if ((len = strlen(p)) == 0) { |
324 | tls_config_set_errorx(config, TLS_ERROR_UNKNOWN, | 324 | tls_config_set_errorx(config, TLS_ERROR_INVALID_ARGUMENT, |
325 | "alpn protocol with zero length"); | 325 | "alpn protocol with zero length"); |
326 | goto err; | 326 | goto err; |
327 | } | 327 | } |
328 | if (len > 255) { | 328 | if (len > 255) { |
329 | tls_config_set_errorx(config, TLS_ERROR_UNKNOWN, | 329 | tls_config_set_errorx(config, TLS_ERROR_INVALID_ARGUMENT, |
330 | "alpn protocol too long"); | 330 | "alpn protocol too long"); |
331 | goto err; | 331 | goto err; |
332 | } | 332 | } |