From 16857b69f990738d17bc5842e3e49a6e82d1428d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 17 Jul 2024 12:28:32 +0100 Subject: gentoo auto-resync : 17:07:2024 - 12:28:31 --- net-dns/hash-slinger/Manifest | 6 ++- ...sh-slinger-3.3-fix-tlsa-record-generation.patch | 35 +++++++++++++ .../files/hash-slinger-3.3-python-3.12.patch | 57 ++++++++++++++++++++++ net-dns/hash-slinger/hash-slinger-3.2-r1.ebuild | 49 ------------------- net-dns/hash-slinger/hash-slinger-3.3.ebuild | 54 ++++++++++++++++++++ 5 files changed, 150 insertions(+), 51 deletions(-) create mode 100644 net-dns/hash-slinger/files/hash-slinger-3.3-fix-tlsa-record-generation.patch create mode 100644 net-dns/hash-slinger/files/hash-slinger-3.3-python-3.12.patch delete mode 100644 net-dns/hash-slinger/hash-slinger-3.2-r1.ebuild create mode 100644 net-dns/hash-slinger/hash-slinger-3.3.ebuild (limited to 'net-dns/hash-slinger') diff --git a/net-dns/hash-slinger/Manifest b/net-dns/hash-slinger/Manifest index 6ef29569e6b6..96dba495f2fd 100644 --- a/net-dns/hash-slinger/Manifest +++ b/net-dns/hash-slinger/Manifest @@ -1,3 +1,5 @@ -DIST hash-slinger-3.2.tar.gz 38376 BLAKE2B 8c89f9a372818166c862d97354a60dddc2795c70f23b39225ad0fc3a2657cc5e048dca228dc004db0240fcf80e74bc799528d3459a65e6de347a493df5abf7b3 SHA512 01a25b3bc00bd9cd86c448f087c48ad04248a5a8755c2f154272b833efdce058a1fc62ea3f5cc6e9ff35180754b3e44db03c4e4888fd9051b749eff5fc8c3110 -EBUILD hash-slinger-3.2-r1.ebuild 1142 BLAKE2B 04c954c1c3fdc2174462864f7d356b7ba6c4941dd4da64e015622212dccb9147c31d6839b17d86c74447054124bc1ba1e956f031dea31abeb47a8121c53f6eb8 SHA512 28e3425334bae01dace3c9cf8f8f50e62899262afc15f6c7945bfe16a3067ff38aa0f7a66983a9cf90864c8d8bdf05e440528bf2a2fc7843d452c019ef9c75dd +AUX hash-slinger-3.3-fix-tlsa-record-generation.patch 1446 BLAKE2B cb0a435b41048aa07ceefe7138590211c36aae4bb5af3aad4e9c2a51246a24a8b404ee8a69eb2ae780ffe8c2b8d2648c4be73353bbc13acbdd7460648a8dfbcc SHA512 81cd9eca58b513ad77d49252c5679fd0543dc0da386cbe930cc65d31876c7b171813dc4b9c2abe3934ed335873246c32782181804a1adcb50df5af18c7506e80 +AUX hash-slinger-3.3-python-3.12.patch 2442 BLAKE2B 2aaadbb02c04901d4071e7627f7090e3a2ade9b7571587ac7a6032a6c4cdc26bad356a9dc70b21a0597ab0c1f19a5c390ea1bf2fd030709dd03e3f1f56a324aa SHA512 5dfd50778a1464bc6a8284efaebd6980f9ab21feed70cdd54bbd932d9c98bc14f45d2941c0a295e9c729a6bd6b1fd8b3e1ff85030f2a115f61027067bd4a88ac +DIST hash-slinger-3.3.tar.gz 38597 BLAKE2B 237affa3f933d3dbd1dca3bc4f927268c15d10eed16c18aae68906f1fe6511eda48283f76da851d70535139bc880074951a1ab4c6be92bd27e32c38e374ce044 SHA512 ba59771d32a93f500b61beab1d44e6edf94965c1a7cb30708e4722fe7e6d97a884ccd0e16c9058c29b174a710c13d562b1b6dfc15edc7440692494744392a52e +EBUILD hash-slinger-3.3.ebuild 1257 BLAKE2B 0f9dbfcf9e22645245bc6c46c97c6538f8f54e388cfd572e670a6750b1370d933b231ab4d667f9ea909bc5ea83e294c5598dc881eeac6d74a86baa8af4305afc SHA512 433096e4863ec701cbeb2d91fdc9aee945ae054fe3872e37a14e7a4e4ab0bd4fee3ce31ef70e541e521b0e5b7c627dc709c014a360e0456e0c95304ab59a4f39 MISC metadata.xml 598 BLAKE2B dfe22fbc9dec4a1bf906a13c184945f42c956ba1f5167a1a3ca744bf7f482c9fb7a85cebfeec71d4376bd0acf89660c6dba13399325d3c123f967c1a21c7848a SHA512 954cd85c0b50c26483dcb000c7eeb8f1fa59f5c4c2e66114ba86a634f48325e273fa01ab7a76e71ba2d4cb9d269f7934429d56aa5eef8e673cea21fc4411f59d diff --git a/net-dns/hash-slinger/files/hash-slinger-3.3-fix-tlsa-record-generation.patch b/net-dns/hash-slinger/files/hash-slinger-3.3-fix-tlsa-record-generation.patch new file mode 100644 index 000000000000..36b8d60d3057 --- /dev/null +++ b/net-dns/hash-slinger/files/hash-slinger-3.3-fix-tlsa-record-generation.patch @@ -0,0 +1,35 @@ +From 0bb0dba91c51d367d9a37297f13e07f33c01bfdc Mon Sep 17 00:00:00 2001 +From: anarcat +Date: Thu, 5 Oct 2023 02:10:32 -0400 +Subject: [PATCH] fix generic TLSA record generation (#46) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It seems like the calculation for the TLSA record never really worked, +as we're doing float division here on the `len()` field. In our case, +that field returned `35.0` which is not valid in our environment. + +Doing an integer division gives the correct result in most cases, I +believe. + +Closes: #45 + +Co-authored-by: Jérôme Charaoui +--- + tlsa | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tlsa b/tlsa +index cea7230..ec97150 100755 +--- a/tlsa ++++ b/tlsa +@@ -513,7 +513,7 @@ class TLSARecord: + def getRecord(self, generic=False): + """Returns the RR string of this TLSARecord, either in rfc (default) or generic format""" + if generic: +- return '%s IN TYPE52 \# %s %s%s%s%s' % (self.name, (len(self.cert)/2)+3 , self._toHex(self.usage), self._toHex(self.selector), self._toHex(self.mtype), self.cert) ++ return '%s IN TYPE52 \# %s %s%s%s%s' % (self.name, (len(self.cert)//2)+3 , self._toHex(self.usage), self._toHex(self.selector), self._toHex(self.mtype), self.cert) + return '%s IN TLSA %s %s %s %s' % (self.name, self.usage, self.selector, self.mtype, self.cert) + + def _toHex(self, val): diff --git a/net-dns/hash-slinger/files/hash-slinger-3.3-python-3.12.patch b/net-dns/hash-slinger/files/hash-slinger-3.3-python-3.12.patch new file mode 100644 index 000000000000..d4b1eacc94e6 --- /dev/null +++ b/net-dns/hash-slinger/files/hash-slinger-3.3-python-3.12.patch @@ -0,0 +1,57 @@ +From e04d8262f1409725afc8f71720b77083fb43c525 Mon Sep 17 00:00:00 2001 +From: Hoggins! +Date: Tue, 16 Jul 2024 23:52:39 +0200 +Subject: [PATCH] Python3.12 compains with a "SyntaxWarning: invalid escape + sequence" when regexes are not used with raw strings + +--- + tlsa | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/tlsa b/tlsa +index ec97150..d06bd49 100755 +--- a/tlsa ++++ b/tlsa +@@ -495,7 +495,7 @@ class TLSARecord: + """When instanciated, this class contains all the fields of a TLSA record. + """ + def __init__(self, name, usage, selector, mtype, cert): +- """name is the name of the RR in the format: /^(_\d{1,5}|\*)\._(tcp|udp|sctp)\.([a-z0-9]*\.){2,}$/ ++ r"""name is the name of the RR in the format: /^(_\d{1,5}|\*)\._(tcp|udp|sctp)\.([a-z0-9]*\.){2,}$/ + usage, selector and mtype should be an integer + cert should be a hexidecimal string representing the certificate to be matched field + """ +@@ -513,7 +513,7 @@ class TLSARecord: + def getRecord(self, generic=False): + """Returns the RR string of this TLSARecord, either in rfc (default) or generic format""" + if generic: +- return '%s IN TYPE52 \# %s %s%s%s%s' % (self.name, (len(self.cert)//2)+3 , self._toHex(self.usage), self._toHex(self.selector), self._toHex(self.mtype), self.cert) ++ return r'%s IN TYPE52 \# %s %s%s%s%s' % (self.name, (len(self.cert)//2)+3 , self._toHex(self.usage), self._toHex(self.selector), self._toHex(self.mtype), self.cert) + return '%s IN TLSA %s %s %s %s' % (self.name, self.usage, self.selector, self.mtype, self.cert) + + def _toHex(self, val): +@@ -554,20 +554,20 @@ class TLSARecord: + + def isNameValid(self): + """Check if the name if in the correct format""" +- if not re.match('^(_\d{1,5}|\*)\._(tcp|udp|sctp)\.([-a-z0-9]*\.){2,}$', self.name): ++ if not re.match(r'^(_\d{1,5}|\*)\._(tcp|udp|sctp)\.([-a-z0-9]*\.){2,}$', self.name): + return False + return True + + def getProtocol(self): + """Returns the protocol based on the name""" +- return re.split('\.', self.name)[1][1:] ++ return re.split(r'\.', self.name)[1][1:] + + def getPort(self): + """Returns the port based on the name""" +- if re.split('\.', self.name)[0][0] == '*': ++ if re.split(r'\.', self.name)[0][0] == '*': + return '*' + else: +- return re.split('\.', self.name)[0][1:] ++ return re.split(r'\.', self.name)[0][1:] + + class ARecord: + """An object representing an A Record (IPv4 address)""" diff --git a/net-dns/hash-slinger/hash-slinger-3.2-r1.ebuild b/net-dns/hash-slinger/hash-slinger-3.2-r1.ebuild deleted file mode 100644 index d4c705076a21..000000000000 --- a/net-dns/hash-slinger/hash-slinger-3.2-r1.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{9..11} ) - -inherit python-single-r1 - -DESCRIPTION="Various tools to generate DNS records like SSHFP, TLSA, OPENPGPKEY, IPSECKEY" -HOMEPAGE="https://github.com/letoams/hash-slinger" -SRC_URI="https://github.com/letoams/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="GPL-2+" -SLOT="0" -KEYWORDS="~amd64 ~arm ~x86" -IUSE="ipsec +openpgp +ssh" - -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -RDEPEND=" - ${PYTHON_DEPS} - $(python_gen_cond_dep ' - dev-python/dnspython[${PYTHON_USEDEP}] - dev-python/ipaddr[${PYTHON_USEDEP}] - dev-python/m2crypto[${PYTHON_USEDEP}] - ') - net-dns/unbound[python,${PYTHON_SINGLE_USEDEP}] - ipsec? ( net-vpn/libreswan[dnssec] ) - openpgp? ( $(python_gen_cond_dep 'dev-python/python-gnupg[${PYTHON_USEDEP}]') ) - ssh? ( virtual/openssh ) -" - -src_install() { - local tools tool - - tools="tlsa" - - use ssh && tools+=" sshfp" - use openpgp && tools+=" openpgpkey" - use ipsec && tools+=" ipseckey" - - for tool in $tools ; do - doman ${tool}.1 - python_doscript ${tool} - done - - dodoc BUGS CHANGES README -} diff --git a/net-dns/hash-slinger/hash-slinger-3.3.ebuild b/net-dns/hash-slinger/hash-slinger-3.3.ebuild new file mode 100644 index 000000000000..da7e8e7310b8 --- /dev/null +++ b/net-dns/hash-slinger/hash-slinger-3.3.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) + +inherit python-single-r1 + +DESCRIPTION="Various tools to generate DNS records like SSHFP, TLSA, OPENPGPKEY, IPSECKEY" +HOMEPAGE="https://github.com/letoams/hash-slinger" +SRC_URI="https://github.com/letoams/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="ipsec +openpgp +ssh" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND=" + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/dnspython[${PYTHON_USEDEP}] + dev-python/ipaddr[${PYTHON_USEDEP}] + dev-python/m2crypto[${PYTHON_USEDEP}] + ') + net-dns/unbound[python,${PYTHON_SINGLE_USEDEP}] + ipsec? ( net-vpn/libreswan[dnssec] ) + openpgp? ( $(python_gen_cond_dep 'dev-python/python-gnupg[${PYTHON_USEDEP}]') ) + ssh? ( virtual/openssh ) +" + +PATCHES=( + "${FILESDIR}/${PN}-3.3-fix-tlsa-record-generation.patch" + "${FILESDIR}/${PN}-3.3-python-3.12.patch" +) + +src_install() { + local tools tool + + tools="tlsa" + + use ssh && tools+=" sshfp" + use openpgp && tools+=" openpgpkey" + use ipsec && tools+=" ipseckey" + + for tool in $tools ; do + doman ${tool}.1 + python_doscript ${tool} + done + + dodoc BUGS CHANGES README +} -- cgit v1.2.3