diff options
| author | jsing <> | 2016-11-11 14:02:24 +0000 |
|---|---|---|
| committer | jsing <> | 2016-11-11 14:02:24 +0000 |
| commit | 649a0a6662a20285ecc9abb6ad4df3f56f4b0726 (patch) | |
| tree | 504fc58fe886a67b537ee2b43b1a736f9a752c98 /src/lib/libtls/tls_config.c | |
| parent | 264fe0b9bed327a70d7f6d57cf795074b93bae92 (diff) | |
| download | openbsd-649a0a6662a20285ecc9abb6ad4df3f56f4b0726.tar.gz openbsd-649a0a6662a20285ecc9abb6ad4df3f56f4b0726.tar.bz2 openbsd-649a0a6662a20285ecc9abb6ad4df3f56f4b0726.zip | |
Change the return value of tls_config_set_protocols() and
tls_config_set_verify_depth() from void to int. This makes them consistent
with all other tls_config_set_* functions and will allow for call time
validation to be implemented.
Rides libtls major bump.
ok beck@
Diffstat (limited to 'src/lib/libtls/tls_config.c')
| -rw-r--r-- | src/lib/libtls/tls_config.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c index 3ac674e597..5bc671fc99 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.32 2016/11/05 15:13:26 beck Exp $ */ | 1 | /* $OpenBSD: tls_config.c,v 1.33 2016/11/11 14:02:24 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -194,8 +194,10 @@ tls_config_new(void) | |||
| 194 | if (tls_config_set_ciphers(config, "secure") != 0) | 194 | if (tls_config_set_ciphers(config, "secure") != 0) |
| 195 | goto err; | 195 | goto err; |
| 196 | 196 | ||
| 197 | tls_config_set_protocols(config, TLS_PROTOCOLS_DEFAULT); | 197 | if (tls_config_set_protocols(config, TLS_PROTOCOLS_DEFAULT) != 0) |
| 198 | tls_config_set_verify_depth(config, 6); | 198 | goto err; |
| 199 | if (tls_config_set_verify_depth(config, 6) != 0) | ||
| 200 | goto err; | ||
| 199 | 201 | ||
| 200 | tls_config_prefer_ciphers_server(config); | 202 | tls_config_prefer_ciphers_server(config); |
| 201 | 203 | ||
| @@ -575,16 +577,20 @@ tls_config_set_keypair_mem(struct tls_config *config, const uint8_t *cert, | |||
| 575 | return (0); | 577 | return (0); |
| 576 | } | 578 | } |
| 577 | 579 | ||
| 578 | void | 580 | int |
| 579 | tls_config_set_protocols(struct tls_config *config, uint32_t protocols) | 581 | tls_config_set_protocols(struct tls_config *config, uint32_t protocols) |
| 580 | { | 582 | { |
| 581 | config->protocols = protocols; | 583 | config->protocols = protocols; |
| 584 | |||
| 585 | return (0); | ||
| 582 | } | 586 | } |
| 583 | 587 | ||
| 584 | void | 588 | int |
| 585 | tls_config_set_verify_depth(struct tls_config *config, int verify_depth) | 589 | tls_config_set_verify_depth(struct tls_config *config, int verify_depth) |
| 586 | { | 590 | { |
| 587 | config->verify_depth = verify_depth; | 591 | config->verify_depth = verify_depth; |
| 592 | |||
| 593 | return (0); | ||
| 588 | } | 594 | } |
| 589 | 595 | ||
| 590 | void | 596 | void |
