summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjmc <>2015-09-11 14:20:14 +0000
committerjmc <>2015-09-11 14:20:14 +0000
commita265ed602c8178adca9e93782bef7421b5e089bd (patch)
tree82d57b237cf5573c87fa10108d9907468786c060 /src
parent774db32073b8b5964d8bb5940ad2543bee934b66 (diff)
downloadopenbsd-a265ed602c8178adca9e93782bef7421b5e089bd.tar.gz
openbsd-a265ed602c8178adca9e93782bef7421b5e089bd.tar.bz2
openbsd-a265ed602c8178adca9e93782bef7421b5e089bd.zip
more cleanup;
Diffstat (limited to 'src')
-rw-r--r--src/lib/libtls/tls_init.331
1 files changed, 15 insertions, 16 deletions
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3
index 9eb825d463..4e67e26b9b 100644
--- a/src/lib/libtls/tls_init.3
+++ b/src/lib/libtls/tls_init.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: tls_init.3,v 1.40 2015/09/11 14:15:19 jmc Exp $ 1.\" $OpenBSD: tls_init.3,v 1.41 2015/09/11 14:20:14 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4.\" 4.\"
@@ -118,7 +118,7 @@
118.Fn tls_peer_cert_provided "struct tls *ctx" 118.Fn tls_peer_cert_provided "struct tls *ctx"
119.Ft "int" 119.Ft "int"
120.Fn tls_peer_cert_contains_name "struct tls *ctx" "const char *name" 120.Fn tls_peer_cert_contains_name "struct tls *ctx" "const char *name"
121.Ft "int 121.Ft "int"
122.Fn tls_peer_cert_issuer "struct tls *ctx" "char **issuer" 122.Fn tls_peer_cert_issuer "struct tls *ctx" "char **issuer"
123.Ft "int" 123.Ft "int"
124.Fn tls_peer_cert_subject "struct tls *ctx" "char **subject" 124.Fn tls_peer_cert_subject "struct tls *ctx" "char **subject"
@@ -369,7 +369,7 @@ checks if the peer of
369.Ar ctx 369.Ar ctx
370has provided a certificate. 370has provided a certificate.
371.Fn tls_peer_cert_provided 371.Fn tls_peer_cert_provided
372can only succeed after the handshake is complete. 372can only succeed after the handshake is complete.
373.Em (Server and client) 373.Em (Server and client)
374.It 374.It
375.Fn tls_peer_cert_contains_name 375.Fn tls_peer_cert_contains_name
@@ -379,7 +379,7 @@ has povided a certificate that contains a
379SAN or CN that matches 379SAN or CN that matches
380.Ar name . 380.Ar name .
381.Fn tls_peer_cert_contains_name 381.Fn tls_peer_cert_contains_name
382can only succeed after the handshake is complete. 382can only succeed after the handshake is complete.
383.Em (Server and client) 383.Em (Server and client)
384.It 384.It
385.Fn tls_peer_cert_subject 385.Fn tls_peer_cert_subject
@@ -388,19 +388,19 @@ returns a string in
388corresponding to the subject of the peer certificate from 388corresponding to the subject of the peer certificate from
389.Ar ctx . 389.Ar ctx .
390.Fn tls_peer_cert_subject 390.Fn tls_peer_cert_subject
391will only succeed after the handshake is complete. 391will only succeed after the handshake is complete.
392Callers must free the string returned in 392Callers must free the string returned in
393.Ar subject . 393.Ar subject .
394.Em (Server and client) 394.Em (Server and client)
395.It 395.It
396.Fn tls_peer_cert_issuer 396.Fn tls_peer_cert_issuer
397returns a string in 397returns a string in
398.Ar subject 398.Ar subject
399corresponding to the issuer of the peer certificate from 399corresponding to the issuer of the peer certificate from
400.Ar ctx . 400.Ar ctx .
401.Fn tls_peer_cert_issuer 401.Fn tls_peer_cert_issuer
402will only succeed after the handshake is complete. 402will only succeed after the handshake is complete.
403Callers must free the string returned in 403Callers must free the string returned in
404.Ar issuer . 404.Ar issuer .
405.Em (Server and client) 405.Em (Server and client)
406.It 406.It
@@ -410,10 +410,10 @@ in
410.Ar hash 410.Ar hash
411corresponding to a hash of the raw peer certificate from 411corresponding to a hash of the raw peer certificate from
412.Ar ctx 412.Ar ctx
413prefixed by a hash name followed by a colon. 413prefixed by a hash name followed by a colon.
414The hash currently used is SHA256, however this 414The hash currently used is SHA256, though this
415can change in the future. The hash string for a certificate 415could change in the future.
416in file 416The hash string for a certificate in file
417.Ar mycert.crt 417.Ar mycert.crt
418can be generated using the commands: 418can be generated using the commands:
419.Bd -literal -offset indent 419.Bd -literal -offset indent
@@ -422,8 +422,8 @@ printf "SHA256:${h}\\n"
422.Ed 422.Ed
423.Pp 423.Pp
424.Fn tls_peer_cert_subject 424.Fn tls_peer_cert_subject
425will only succeed after the handshake is complete. 425will only succeed after the handshake is complete.
426Callers must free the string returned in 426Callers must free the string returned in
427.Ar hash . 427.Ar hash .
428.Em (Server and client) 428.Em (Server and client)
429.It 429.It
@@ -589,7 +589,6 @@ while (len > 0) {
589} 589}
590\&... 590\&...
591.Ed 591.Ed
592.Bd -literal -offset indent
593.Pp 592.Pp
594The following example demonstrates how to handle TLS writes on a 593The following example demonstrates how to handle TLS writes on a
595non-blocking file descriptor using 594non-blocking file descriptor using