Sync pki to chromium d740199e083b70d13506973c6f479f0b01165a05

This also removes fillins/check.h which is no longer needed.

Crbug: 1322914
Change-Id: If5e8355700472bf6703c80809ea276c4c07ddc52
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62485
Auto-Submit: Bob Beck <bbe@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/pki/general_names.cc b/pki/general_names.cc
index eef60d0..818356e 100644
--- a/pki/general_names.cc
+++ b/pki/general_names.cc
@@ -4,6 +4,8 @@
 
 #include "general_names.h"
 
+#include <openssl/base.h>
+
 #include <climits>
 #include <cstring>
 
@@ -67,7 +69,7 @@
 std::unique_ptr<GeneralNames> GeneralNames::Create(
     const der::Input& general_names_tlv,
     CertErrors* errors) {
-  DCHECK(errors);
+  BSSL_CHECK(errors);
 
   // RFC 5280 section 4.2.1.6:
   // GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
@@ -89,7 +91,7 @@
 std::unique_ptr<GeneralNames> GeneralNames::CreateFromValue(
     const der::Input& general_names_value,
     CertErrors* errors) {
-  DCHECK(errors);
+  BSSL_CHECK(errors);
 
   auto general_names = std::make_unique<GeneralNames>();
 
@@ -122,7 +124,7 @@
     GeneralNames::ParseGeneralNameIPAddressType ip_address_type,
     GeneralNames* subtrees,
     CertErrors* errors) {
-  DCHECK(errors);
+  BSSL_CHECK(errors);
   der::Parser parser(input);
   der::Tag tag;
   der::Input value;
@@ -198,7 +200,7 @@
       }
       subtrees->ip_addresses.emplace_back(value.UnsafeData(), value.Length());
     } else {
-      DCHECK_EQ(ip_address_type, GeneralNames::IP_ADDRESS_AND_NETMASK);
+      BSSL_CHECK(ip_address_type == GeneralNames::IP_ADDRESS_AND_NETMASK);
       // RFC 5280 section 4.2.1.10:
       // The syntax of iPAddress MUST be as described in Section 4.2.1.6 with
       // the following additions specifically for name constraints. For IPv4
@@ -234,7 +236,7 @@
                      CreateCertErrorParams1SizeT("tag", tag));
     return false;
   }
-  DCHECK_NE(GENERAL_NAME_NONE, name_type);
+  BSSL_CHECK(GENERAL_NAME_NONE != name_type);
   subtrees->present_name_types |= name_type;
   return true;
 }