net-dns/c-ares: Upgrade from 1.17.2 to 1.19.1

BUG=b/335669278,b/335882061,b/335882245,b/336172269,b/336266417
TEST=presubmit
RELEASE_NOTE=Updated net-dns/c-ares to version VERSION. This fixed CVE-2022-4904, CVE-2023-31124, CVE-2023-31130, CVE-2023-31147, CVE-2023-32067

cos-patch: security-high
Change-Id: I09fa3745b2ea385db6f105753744396fb4557e5c
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/70291
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Reviewed-by: Anil Altinay <aaltinay@google.com>
Main-Branch-Verified: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/net-dns/c-ares/Manifest b/net-dns/c-ares/Manifest
index 38e4437..e3083da 100644
--- a/net-dns/c-ares/Manifest
+++ b/net-dns/c-ares/Manifest
@@ -1 +1,2 @@
-DIST c-ares-1.17.2.tar.gz 1538276 BLAKE2B c6f5ad65ca75f8467b624daf3caaee2f35d6e4714ce46ebe1bbf79447feecf8615915b00fa5e7bd1e97c6232864e06c53a792fbadf36a5399883529769273e24 SHA512 f625e0ef8508af6475d3e83b51ab29be8a4878e2a87e7f518bea046b76a74bfde7043ca6ec2a9e714c898ab9e5d4a5a678c3347a9f9eb68980438f7ca8ae3fc8
+DIST c-ares-1.19.1.tar.gz 1579100 BLAKE2B 4b6c9593edb1a91ab76d54ddacb1cd5d67006d5e628ea1f3289f54e9360be32abeb5d8fc7d23e193feab3e7928e8efde82757eb12fe217dc92ed0d9132bedf5d SHA512 466a94efda626e815a6ef7a890637056339f883d549ea6055e289fd8cd2391130e5682c905c0fb3bd7e955af7f6deb793562c170eb0ee066a4a62085a82ba470
+DIST c-ares-1.19.1.tar.gz.asc 488 BLAKE2B 9c47d7b3e67d9a2bd1e332912d21d20ca591fc34f81707c18a4615ea14ba2da00146d1998250a5f4dd2a0b1c04f9bd2013d4940ac734674c0bdff6815985e19d SHA512 1b204ab1a667af1326be4b7c62c0919aacd447a2e00efea4b8ef2ec9f2b13ffb236a836ff8953b0b3359727faf3fb8cfcd71d0b06a0e533a09f9e9ea66024f4e
diff --git a/net-dns/c-ares/c-ares-1.17.2.ebuild b/net-dns/c-ares/c-ares-1.17.2.ebuild
deleted file mode 100644
index 0dd4656..0000000
--- a/net-dns/c-ares/c-ares-1.17.2.ebuild
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools multilib-minimal
-
-DESCRIPTION="C library that resolves names asynchronously"
-HOMEPAGE="https://c-ares.haxx.se/"
-SRC_URI="https://${PN}.haxx.se/download/${P}.tar.gz"
-
-# Subslot = SONAME of libcares.so.2
-SLOT="0/2"
-LICENSE="MIT"
-KEYWORDS="*"
-IUSE="static-libs test"
-RESTRICT="!test? ( test )"
-
-DOCS=( AUTHORS CHANGES NEWS README.md RELEASE-NOTES TODO )
-
-MULTILIB_WRAPPED_HEADERS=(
-	/usr/include/ares_build.h
-)
-
-multilib_src_configure() {
-	# Needed for running unit tests only
-	# Violates sandbox and tests pass fine without
-	ax_cv_uts_namespace=no \
-	ax_cv_user_namespace=no \
-	ECONF_SOURCE="${S}" \
-	econf \
-		--enable-nonblocking \
-		--enable-symbol-hiding \
-		$(use_enable static-libs static) \
-		$(use_enable test tests)
-}
-
-multilib_src_test() {
-	cd "${BUILD_DIR}"/test || die
-
-	# We're skipping the "real" network tests with the filter
-	# see https://github.com/c-ares/c-ares/tree/main/test
-	./arestest --gtest_filter=-*Live* || die "arestest failed!"
-}
-
-multilib_src_install_all() {
-	einstalldocs
-
-	find "${ED}" -name "*.la" -delete || die
-}
diff --git a/net-dns/c-ares/c-ares-1.19.1.ebuild b/net-dns/c-ares/c-ares-1.19.1.ebuild
new file mode 100644
index 0000000..a358156
--- /dev/null
+++ b/net-dns/c-ares/c-ares-1.19.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/danielstenberg.asc
+inherit multilib-minimal verify-sig
+
+DESCRIPTION="C library that resolves names asynchronously"
+HOMEPAGE="https://c-ares.org/"
+SRC_URI="
+	https://c-ares.org/download/${P}.tar.gz
+	verify-sig? ( https://c-ares.org/download/${P}.tar.gz.asc )
+"
+
+LICENSE="MIT"
+# Subslot = SONAME of libcares.so.2
+SLOT="0/2"
+KEYWORDS="*"
+IUSE="static-libs test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-danielstenberg )"
+
+DOCS=( AUTHORS CHANGES NEWS README.md RELEASE-NOTES TODO )
+
+MULTILIB_WRAPPED_HEADERS=(
+	/usr/include/ares_build.h
+
+)
+multilib_src_configure() {
+	local myeconfargs=(
+		--enable-nonblocking
+		--enable-symbol-hiding
+		$(use_enable static-libs static)
+		$(use_enable test tests)
+	)
+	# Needed for running unit tests only
+	# Violates sandbox and tests pass fine without
+	export ax_cv_uts_namespace=no
+	export ax_cv_user_namespace=no
+	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+	cd "${BUILD_DIR}"/test || die
+	# We're skipping the "real" network tests with the filter
+	# see https://github.com/c-ares/c-ares/tree/main/test
+	local network_tests=(
+		# Most live tests have Live in the name
+		*Live*
+		# These don't but are still in ares-test-live.cc => live
+		*GetTCPSock*
+		*TimeoutValue*
+		*GetSock*
+		*GetSock_virtualized*
+	)
+	# The format for disabling test1, test2, and test3 looks like:
+	# -test1:test2:test3
+	edo ./arestest --gtest_filter=-$(echo $(IFS=:; echo "${network_tests[*]}"))
+}
+
+multilib_src_install_all() {
+	einstalldocs
+	find "${ED}" -name "*.la" -delete || die
+}