diff options
| author | beck <> | 2016-11-05 15:13:26 +0000 |
|---|---|---|
| committer | beck <> | 2016-11-05 15:13:26 +0000 |
| commit | e11dddc2de1dbf045d34adf894146594aded7e8d (patch) | |
| tree | 539491edf35461b59c4b7f94d33635fed5473983 /src/usr.bin | |
| parent | 464dd6c7ce174b2e5a477e2359d33ac3740c1482 (diff) | |
| download | openbsd-e11dddc2de1dbf045d34adf894146594aded7e8d.tar.gz openbsd-e11dddc2de1dbf045d34adf894146594aded7e8d.tar.bz2 openbsd-e11dddc2de1dbf045d34adf894146594aded7e8d.zip | |
Add support for server side OCSP stapling to libtls.
Add support for server side OCSP stapling to netcat.
Diffstat (limited to 'src/usr.bin')
| -rw-r--r-- | src/usr.bin/nc/nc.1 | 11 | ||||
| -rw-r--r-- | src/usr.bin/nc/netcat.c | 12 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/usr.bin/nc/nc.1 b/src/usr.bin/nc/nc.1 index 8c7790f72a..2dda57af92 100644 --- a/src/usr.bin/nc/nc.1 +++ b/src/usr.bin/nc/nc.1 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: nc.1,v 1.76 2016/11/04 07:34:17 jmc Exp $ | 1 | .\" $OpenBSD: nc.1,v 1.77 2016/11/05 15:13:26 beck Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 1996 David Sacerdote | 3 | .\" Copyright (c) 1996 David Sacerdote |
| 4 | .\" All rights reserved. | 4 | .\" All rights reserved. |
| @@ -25,7 +25,7 @@ | |||
| 25 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | .\" | 27 | .\" |
| 28 | .Dd $Mdocdate: November 4 2016 $ | 28 | .Dd $Mdocdate: November 5 2016 $ |
| 29 | .Dt NC 1 | 29 | .Dt NC 1 |
| 30 | .Os | 30 | .Os |
| 31 | .Sh NAME | 31 | .Sh NAME |
| @@ -43,6 +43,7 @@ | |||
| 43 | .Op Fl M Ar ttl | 43 | .Op Fl M Ar ttl |
| 44 | .Op Fl m Ar minttl | 44 | .Op Fl m Ar minttl |
| 45 | .Op Fl O Ar length | 45 | .Op Fl O Ar length |
| 46 | .Op Fl o Ar staplefile | ||
| 46 | .Op Fl P Ar proxy_username | 47 | .Op Fl P Ar proxy_username |
| 47 | .Op Fl p Ar source_port | 48 | .Op Fl p Ar source_port |
| 48 | .Op Fl R Ar CAfile | 49 | .Op Fl R Ar CAfile |
| @@ -187,6 +188,12 @@ Do not do any DNS or service lookups on any specified addresses, | |||
| 187 | hostnames or ports. | 188 | hostnames or ports. |
| 188 | .It Fl O Ar length | 189 | .It Fl O Ar length |
| 189 | Specifies the size of the TCP send buffer. | 190 | Specifies the size of the TCP send buffer. |
| 191 | .It Fl o Ar staplefile | ||
| 192 | Specifies the filename from which to load data to be stapled | ||
| 193 | during the TLS handshake. | ||
| 194 | The file is expected to contain an OSCP response from an OCSP server in | ||
| 195 | DER format. | ||
| 196 | May only be used with TLS and when a certificate is being used. | ||
| 190 | .It Fl P Ar proxy_username | 197 | .It Fl P Ar proxy_username |
| 191 | Specifies a username to present to a proxy server that requires authentication. | 198 | Specifies a username to present to a proxy server that requires authentication. |
| 192 | If no username is specified then authentication will not be attempted. | 199 | If no username is specified then authentication will not be attempted. |
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index b71c0426dc..4a841fb96d 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.167 2016/11/04 05:13:13 beck Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.168 2016/11/05 15:13:26 beck 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. |
| @@ -100,6 +100,7 @@ int rtableid = -1; | |||
| 100 | int usetls; /* use TLS */ | 100 | int usetls; /* use TLS */ |
| 101 | char *Cflag; /* Public cert file */ | 101 | char *Cflag; /* Public cert file */ |
| 102 | char *Kflag; /* Private key file */ | 102 | char *Kflag; /* Private key file */ |
| 103 | char *oflag; /* OCSP stapling file */ | ||
| 103 | char *Rflag = DEFAULT_CA_FILE; /* Root CA file */ | 104 | char *Rflag = DEFAULT_CA_FILE; /* Root CA file */ |
| 104 | int tls_cachanged; /* Using non-default CA file */ | 105 | int tls_cachanged; /* Using non-default CA file */ |
| 105 | int TLSopt; /* TLS options */ | 106 | int TLSopt; /* TLS options */ |
| @@ -163,7 +164,7 @@ main(int argc, char *argv[]) | |||
| 163 | signal(SIGPIPE, SIG_IGN); | 164 | signal(SIGPIPE, SIG_IGN); |
| 164 | 165 | ||
| 165 | while ((ch = getopt(argc, argv, | 166 | while ((ch = getopt(argc, argv, |
| 166 | "46C:cDde:FH:hI:i:K:klM:m:NnO:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { | 167 | "46C:cDde:FH:hI:i:K:klM:m:NnO:o:P:p:R:rSs:T:tUuV:vw:X:x:z")) != -1) { |
| 167 | switch (ch) { | 168 | switch (ch) { |
| 168 | case '4': | 169 | case '4': |
| 169 | family = AF_INET; | 170 | family = AF_INET; |
| @@ -295,6 +296,9 @@ main(int argc, char *argv[]) | |||
| 295 | errx(1, "TCP send window %s: %s", | 296 | errx(1, "TCP send window %s: %s", |
| 296 | errstr, optarg); | 297 | errstr, optarg); |
| 297 | break; | 298 | break; |
| 299 | case 'o': | ||
| 300 | oflag = optarg; | ||
| 301 | break; | ||
| 298 | case 'S': | 302 | case 'S': |
| 299 | Sflag = 1; | 303 | Sflag = 1; |
| 300 | break; | 304 | break; |
| @@ -380,6 +384,8 @@ main(int argc, char *argv[]) | |||
| 380 | errx(1, "you must specify -c to use -C"); | 384 | errx(1, "you must specify -c to use -C"); |
| 381 | if (Kflag && !usetls) | 385 | if (Kflag && !usetls) |
| 382 | errx(1, "you must specify -c to use -K"); | 386 | errx(1, "you must specify -c to use -K"); |
| 387 | if (oflag && !Cflag) | ||
| 388 | errx(1, "you must specify -C to use -o"); | ||
| 383 | if (tls_cachanged && !usetls) | 389 | if (tls_cachanged && !usetls) |
| 384 | errx(1, "you must specify -c to use -R"); | 390 | errx(1, "you must specify -c to use -R"); |
| 385 | if (tls_expecthash && !usetls) | 391 | if (tls_expecthash && !usetls) |
| @@ -455,6 +461,8 @@ main(int argc, char *argv[]) | |||
| 455 | errx(1, "%s", tls_config_error(tls_cfg)); | 461 | errx(1, "%s", tls_config_error(tls_cfg)); |
| 456 | if (Kflag && tls_config_set_key_file(tls_cfg, Kflag) == -1) | 462 | if (Kflag && tls_config_set_key_file(tls_cfg, Kflag) == -1) |
| 457 | errx(1, "%s", tls_config_error(tls_cfg)); | 463 | errx(1, "%s", tls_config_error(tls_cfg)); |
| 464 | if (oflag && tls_config_set_ocsp_staple_file(tls_cfg, oflag) == -1) | ||
| 465 | errx(1, "%s", tls_config_error(tls_cfg)); | ||
| 458 | if (TLSopt & TLS_LEGACY) { | 466 | if (TLSopt & TLS_LEGACY) { |
| 459 | tls_config_set_protocols(tls_cfg, TLS_PROTOCOLS_ALL); | 467 | tls_config_set_protocols(tls_cfg, TLS_PROTOCOLS_ALL); |
| 460 | tls_config_set_ciphers(tls_cfg, "all"); | 468 | tls_config_set_ciphers(tls_cfg, "all"); |
