diff options
author | bcook <> | 2016-01-04 02:18:31 +0000 |
---|---|---|
committer | bcook <> | 2016-01-04 02:18:31 +0000 |
commit | f70371cc053f5cae8250db07f381abd0aa64b2a8 (patch) | |
tree | 87dd9d83a6bbf75002815d662325ac928f22d6d3 /src | |
parent | 22d4dbcaf1865fd8350ef5930ed1c8b375cbef42 (diff) | |
download | openbsd-f70371cc053f5cae8250db07f381abd0aa64b2a8.tar.gz openbsd-f70371cc053f5cae8250db07f381abd0aa64b2a8.tar.bz2 openbsd-f70371cc053f5cae8250db07f381abd0aa64b2a8.zip |
Use the correct values for TLS certificate / private key flags.
fix from Andreas Bartelt <obsd at bartula.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/usr.bin/nc/netcat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index 2a097b239b..8bbd183e62 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: netcat.c,v 1.149 2015/12/28 14:17:47 bcook Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.150 2016/01/04 02:18:31 bcook Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
4 | * Copyright (c) 2015 Bob Beck. All rights reserved. | 4 | * Copyright (c) 2015 Bob Beck. All rights reserved. |
@@ -427,11 +427,11 @@ main(int argc, char *argv[]) | |||
427 | } | 427 | } |
428 | 428 | ||
429 | if (usetls) { | 429 | if (usetls) { |
430 | if (Rflag && (cacert=tls_load_file(Rflag, &cacertlen, NULL)) == NULL) | 430 | if (Rflag && (cacert = tls_load_file(Rflag, &cacertlen, NULL)) == NULL) |
431 | errx(1, "unable to load root CA file %s", Rflag); | 431 | errx(1, "unable to load root CA file %s", Rflag); |
432 | if (Cflag && (pubcert=tls_load_file(Rflag, &pubcertlen, NULL)) == NULL) | 432 | if (Cflag && (pubcert = tls_load_file(Cflag, &pubcertlen, NULL)) == NULL) |
433 | errx(1, "unable to load TLS certificate file %s", Cflag); | 433 | errx(1, "unable to load TLS certificate file %s", Cflag); |
434 | if (Kflag && (privkey=tls_load_file(Rflag, &privkeylen, NULL)) == NULL) | 434 | if (Kflag && (privkey = tls_load_file(Kflag, &privkeylen, NULL)) == NULL) |
435 | errx(1, "unable to load TLS key file %s", Kflag); | 435 | errx(1, "unable to load TLS key file %s", Kflag); |
436 | 436 | ||
437 | if (pledge("stdio inet dns", NULL) == -1) | 437 | if (pledge("stdio inet dns", NULL) == -1) |
@@ -443,7 +443,7 @@ main(int argc, char *argv[]) | |||
443 | errx(1, "unable to allocate TLS config"); | 443 | errx(1, "unable to allocate TLS config"); |
444 | if (Rflag && tls_config_set_ca_mem(tls_cfg, cacert, cacertlen) == -1) | 444 | if (Rflag && tls_config_set_ca_mem(tls_cfg, cacert, cacertlen) == -1) |
445 | errx(1, "unable to set root CA file %s", Rflag); | 445 | errx(1, "unable to set root CA file %s", Rflag); |
446 | if (Cflag && tls_config_set_cert_mem(tls_cfg, cacert, cacertlen) == -1) | 446 | if (Cflag && tls_config_set_cert_mem(tls_cfg, pubcert, pubcertlen) == -1) |
447 | errx(1, "unable to set TLS certificate file %s", Cflag); | 447 | errx(1, "unable to set TLS certificate file %s", Cflag); |
448 | if (Kflag && tls_config_set_key_mem(tls_cfg, privkey, privkeylen) == -1) | 448 | if (Kflag && tls_config_set_key_mem(tls_cfg, privkey, privkeylen) == -1) |
449 | errx(1, "unable to set TLS key file %s", Kflag); | 449 | errx(1, "unable to set TLS key file %s", Kflag); |