summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
diff options
context:
space:
mode:
authorbeck <>2018-04-06 07:08:20 +0000
committerbeck <>2018-04-06 07:08:20 +0000
commitcbd1d6a8808038e6f357e956a343f70ecaf110f4 (patch)
tree3f536dd9c6701ce8c8c9a5fa0d5c883caa5222e2 /src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
parenta0522cf10ae4b806e95c44e85e22fae53f9228d6 (diff)
downloadopenbsd-cbd1d6a8808038e6f357e956a343f70ecaf110f4.tar.gz
openbsd-cbd1d6a8808038e6f357e956a343f70ecaf110f4.tar.bz2
openbsd-cbd1d6a8808038e6f357e956a343f70ecaf110f4.zip
poison for X509_VERIFY_PARAM's
Tighten up checks for various X509_VERIFY_PARAM functions, and allow for the verify param to be poisoned (preculding future successful cert validation) if the setting of host, ip, or email for certificate validation fails. (since many callers do not check the return code in the wild and blunder along anyway) Inspired by some discussions with Adam Langley. ok jsing@
Diffstat (limited to 'src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3')
-rw-r--r--src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.367
1 files changed, 53 insertions, 14 deletions
diff --git a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 b/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
index 4f3261c975..9c0150700d 100644
--- a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ b/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.12 2018/03/23 14:26:40 schwarze Exp $ 1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.13 2018/04/06 07:08:20 beck Exp $
2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500 2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500
3.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 3.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100
4.\" 4.\"
@@ -68,7 +68,7 @@
68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
69.\" OF THE POSSIBILITY OF SUCH DAMAGE. 69.\" OF THE POSSIBILITY OF SUCH DAMAGE.
70.\" 70.\"
71.Dd $Mdocdate: March 23 2018 $ 71.Dd $Mdocdate: April 6 2018 $
72.Dt X509_VERIFY_PARAM_SET_FLAGS 3 72.Dt X509_VERIFY_PARAM_SET_FLAGS 3
73.Os 73.Os
74.Sh NAME 74.Sh NAME
@@ -344,14 +344,14 @@ is
344.Dv NULL 344.Dv NULL
345or empty, the list of hostnames is cleared, and name checks are not 345or empty, the list of hostnames is cleared, and name checks are not
346performed on the peer certificate. 346performed on the peer certificate.
347If 347.Fa namelen
348should be set to the length of
349.Fa name .
350For historical compatibility, if
348.Fa name 351.Fa name
349is NUL-terminated, 352is NUL-terminated,
350.Fa namelen 353.Fa namelen
351may be zero, otherwise 354may be specified as zero.
352.Fa namelen
353must be set to the length of
354.Fa name .
355When a hostname is specified, certificate verification automatically 355When a hostname is specified, certificate verification automatically
356invokes 356invokes
357.Xr X509_check_host 3 357.Xr X509_check_host 3
@@ -360,6 +360,10 @@ with flags equal to the
360argument given to 360argument given to
361.Fn X509_VERIFY_PARAM_set_hostflags 361.Fn X509_VERIFY_PARAM_set_hostflags
362(default zero). 362(default zero).
363.Fn X509_VERIFY_PARAM_set1_host
364will fail if
365.Fa name
366contains any embedded 0 bytes.
363.Pp 367.Pp
364.Fn X509_VERIFY_PARAM_add1_host 368.Fn X509_VERIFY_PARAM_add1_host
365adds 369adds
@@ -376,6 +380,18 @@ No change is made if
376is 380is
377.Dv NULL 381.Dv NULL
378or empty. 382or empty.
383.Fa namelen
384should be set to the length of
385.Fa name .
386For historical compatibility, if
387.Fa name
388is NUL-terminated,
389.Fa namelen
390may be specified as zero.
391.Fn X509_VERIFY_PARAM_add1_host
392will fail if
393.Fa name
394contains any embedded 0 bytes.
379When multiple names are configured, the peer is considered verified when 395When multiple names are configured, the peer is considered verified when
380any name matches. 396any name matches.
381.Pp 397.Pp
@@ -390,14 +406,18 @@ identifier respectively.
390.Fn X509_VERIFY_PARAM_set1_email 406.Fn X509_VERIFY_PARAM_set1_email
391sets the expected RFC822 email address to 407sets the expected RFC822 email address to
392.Fa email . 408.Fa email .
393If 409.Fa emaillen
410should be set to the length of
411.Fa email .
412For historical compatibility, if
394.Fa email 413.Fa email
395is NUL-terminated, 414is NUL-terminated,
396.Fa emaillen 415.Fa emaillen
397may be zero, otherwise 416may be specified as zero,
398.Fa emaillen 417.Fn X509_VERIFY_PARAM_set1_email
399must be set to the length of 418will fail if
400.Fa email . 419.Fa email
420is NULL, an empty string, or contains embedded 0 bytes.
401When an email address is specified, certificate verification 421When an email address is specified, certificate verification
402automatically invokes 422automatically invokes
403.Xr X509_check_email 3 . 423.Xr X509_check_email 3 .
@@ -410,6 +430,12 @@ The
410argument is in binary format, in network byte-order, and 430argument is in binary format, in network byte-order, and
411.Fa iplen 431.Fa iplen
412must be set to 4 for IPv4 and 16 for IPv6. 432must be set to 4 for IPv4 and 16 for IPv6.
433.Fn X509_VERIFY_PARAM_set1_ip
434will fail if
435.Fa ip
436is NULL or if
437.Fa iplen
438is not 4 or 16.
413When an IP address is specified, 439When an IP address is specified,
414certificate verification automatically invokes 440certificate verification automatically invokes
415.Xr X509_check_ip 3 . 441.Xr X509_check_ip 3 .
@@ -422,6 +448,10 @@ The
422argument is a NUL-terminal ASCII string: 448argument is a NUL-terminal ASCII string:
423dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6. 449dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6.
424The condensed "::" notation is supported for IPv6 addresses. 450The condensed "::" notation is supported for IPv6 addresses.
451.Fn X509_VERIFY_PARAM_set1_ip_asc
452will fail if
453.Fa ipasc
454is unparsable.
425.Pp 455.Pp
426.Fn X509_VERIFY_PARAM_add0_table 456.Fn X509_VERIFY_PARAM_add0_table
427adds 457adds
@@ -476,14 +506,23 @@ on allocation failure.
476.Fn X509_VERIFY_PARAM_set_trust , 506.Fn X509_VERIFY_PARAM_set_trust ,
477.Fn X509_VERIFY_PARAM_add0_policy , 507.Fn X509_VERIFY_PARAM_add0_policy ,
478.Fn X509_VERIFY_PARAM_set1_policies , 508.Fn X509_VERIFY_PARAM_set1_policies ,
509and
510.Fn X509_VERIFY_PARAM_add0_table
511return 1 for success or 0 for failure.
512.Pp
479.Fn X509_VERIFY_PARAM_set1_host , 513.Fn X509_VERIFY_PARAM_set1_host ,
480.Fn X509_VERIFY_PARAM_add1_host , 514.Fn X509_VERIFY_PARAM_add1_host ,
481.Fn X509_VERIFY_PARAM_set1_email , 515.Fn X509_VERIFY_PARAM_set1_email ,
482.Fn X509_VERIFY_PARAM_set1_ip , 516.Fn X509_VERIFY_PARAM_set1_ip ,
483.Fn X509_VERIFY_PARAM_set1_ip_asc ,
484and 517and
485.Fn X509_VERIFY_PARAM_add0_table 518.Fn X509_VERIFY_PARAM_set1_ip_asc ,
486return 1 for success or 0 for failure. 519return 1 for success or 0 for failure.
520A failure from these routines will poison
521the
522.Vt X509_VERIFY_PARAM
523object so that future calls to
524.Xr X509_verify_cert
525using the poisoned object will fail.
487.Pp 526.Pp
488.Fn X509_VERIFY_PARAM_get_flags 527.Fn X509_VERIFY_PARAM_get_flags
489returns the current verification flags. 528returns the current verification flags.