Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
23452a0acd
!29 [sync] PR-28: revert version to 2.3.2
From: @openeuler-sync-bot 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
2023-11-16 03:46:34 +00:00
zhoupengcheng
c4284af606 revert version to 2.3.2
(cherry picked from commit bf243488570d1ef89c84023049c25318c901bda2)
2023-11-16 09:16:00 +08:00
openeuler-ci-bot
533a196448
!27 【22.03-LTS-Next】Upgrade to latest release 2.3.3
From: @zhangruifang2020 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
2023-10-24 06:42:55 +00:00
zhangruifang2020
8dfe1e7687 update to 2.3.3 2023-10-17 16:40:10 +08:00
openeuler-ci-bot
a82506789f
!23 fix obsoletes in spec
From: @panxh_purple 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-09-09 01:00:44 +00:00
panxiaohe
759b462fa1 fix obsoletes in spec 2022-09-08 14:24:03 +08:00
openeuler-ci-bot
f4be88c9bd
!16 Fix build failure
Merge pull request !16 from 邹林/openEuler-22.03-LTS-Next
2022-01-08 09:07:29 +00:00
zou_lin77
0922c575ff Fix build failure 2022-01-08 16:47:30 +08:00
openeuler-ci-bot
7dd6f501a7 !13 Update to 2.3.2
From: @wangchen2020
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
2021-12-10 08:12:03 +00:00
wangchen2020
e1da7e7de9 Update to 2.3.2 2021-12-01 17:16:29 +08:00
6 changed files with 38 additions and 128 deletions

View File

@ -1,122 +0,0 @@
From c7b33a418d9426ee311db45473cb20bad94df26a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Mon, 10 Feb 2020 15:10:54 +0100
Subject: [PATCH] Implement full roundtrip for lookup functionality
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With TR64 enabled (default), '☺i' was converted to 'xn-- o-oia59s'.
The output contains an illegal space and thus could not be decoded any more.
References:
https://gitlab.com/libidn/libidn2/issues/78
https://gitlab.isc.org/isc-projects/bind9/issues/1610
Reported-by: Chris Malton
---
lib/lookup.c | 33 +++++++++++++++++++++++----------
tests/test-lookup.c | 5 +++++
3 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/lib/lookup.c b/lib/lookup.c
index a55f82b..5e5ff12 100644
--- a/lib/lookup.c
+++ b/lib/lookup.c
@@ -1,5 +1,6 @@
/* lookup.c - implementation of IDNA2008 lookup functions
Copyright (C) 2011-2017 Simon Josefsson
+ Copyright (C) 2017-2020 Tim Ruehsen
Libidn2 is free software: you can redistribute it and/or modify it
under the terms of either:
@@ -123,7 +124,7 @@ label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen,
int flags)
{
size_t plen;
- uint32_t *p;
+ uint32_t *p = NULL;
const uint8_t *src_org = NULL;
uint8_t *src_allocated = NULL;
int rc, check_roundtrip = 0;
@@ -187,10 +188,7 @@ label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen,
p, plen);
if (rc != IDN2_OK)
- {
- free (p);
- goto out;
- }
+ goto out;
}
dst[0] = 'x';
@@ -200,7 +198,6 @@ label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen,
tmpl = *dstlen - 4;
rc = _idn2_punycode_encode_internal (plen, p, &tmpl, (char *) dst + 4);
- free (p);
if (rc != IDN2_OK)
goto out;
@@ -210,15 +207,31 @@ label (const uint8_t * src, size_t srclen, uint8_t * dst, size_t * dstlen,
if (check_roundtrip)
{
if (srclen_org != *dstlen || c_strncasecmp ((char *) src_org, (char *) dst, srclen_org))
- {
- rc = IDN2_ALABEL_ROUNDTRIP_FAILED;
- goto out;
- }
+ {
+ rc = IDN2_ALABEL_ROUNDTRIP_FAILED;
+ goto out;
+ }
+ }
+ else if (!(flags & IDN2_NO_ALABEL_ROUNDTRIP))
+ {
+ rc = _idn2_punycode_decode_internal (*dstlen - 4, (char *) dst + 4, &label32_len, label_u32);
+ if (rc)
+ {
+ rc = IDN2_ALABEL_ROUNDTRIP_FAILED;
+ goto out;
+ }
+
+ if (plen != label32_len || u32_cmp (p, label_u32, label32_len))
+ {
+ rc = IDN2_ALABEL_ROUNDTRIP_FAILED;
+ goto out;
+ }
}
rc = IDN2_OK;
out:
+ free (p);
free (src_allocated);
return rc;
}
diff --git a/tests/test-lookup.c b/tests/test-lookup.c
index aa75e18..2b49cb1 100644
--- a/tests/test-lookup.c
+++ b/tests/test-lookup.c
@@ -1,5 +1,6 @@
/* test-lookup.c --- Self tests for IDNA processing
Copyright (C) 2011-2017 Simon Josefsson
+ Copyright (C) 2017-2020 Tim Ruehsen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -838,6 +839,10 @@ static const struct idna idna[] = {
{"\xc3\xa4_x", "xn--_x-uia", IDN2_OK, IDN2_TRANSITIONAL},
/* failing lookup round-trip */
{"xn--te_", "", IDN2_ALABEL_ROUNDTRIP_FAILED},
+ /* failing lookup round-trip: ☺ -> xn-- o-oia59s (illegal space in output, see https://gitlab.com/libidn/libidn2/issues/78) */
+ {"\xc3\xa2\xcb\x9c\xc2\xba", "", IDN2_DISALLOWED, IDN2_NO_TR46},
+ {"\xc3\xa2\xcb\x9c\xc2\xba", "", IDN2_ALABEL_ROUNDTRIP_FAILED, IDN2_TRANSITIONAL},
+ {"\xc3\xa2\xcb\x9c\xc2\xba", "", IDN2_ALABEL_ROUNDTRIP_FAILED, IDN2_NONTRANSITIONAL},
};
static int ok = 0, failed = 0;
--
1.8.3.1

Binary file not shown.

Binary file not shown.

BIN
libidn2-2.3.2.tar.gz Normal file

Binary file not shown.

11
libidn2-2.3.2.tar.gz.sig Normal file
View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCgAdFiEEmUFc4ZBdDlWp+IAmhgt/uzL4EZ0FAmD2beoACgkQhgt/uzL4
EZ3SoQgAjHr7DKeZVqc/l6B2Hko8gIRhmdxmw91NAg1FYHMoRFXQDh0sKXctrD8p
7Is+5cBRUFmBcHgsnauriuKZ67/73O+xLq6LOPh/Xe+ndknD9WlYhEI2CE8T1d6k
V+c/GY/JOMqFB7f1p6ihmN2lvdaACKNTZq7AjzAiP6JieM3A9zNPkYd+HuBU43wu
cTDRE/GulAl1u32mxiBLL/ZOFBcpuf5wAZilr4C2mUdyINjPPPgwiKd0Y64VH/6f
HFLwXBb8Tfy1ByBaHkzrpxij1uqiMbDP3Puv75uFeR1sAUhFqptv71UhBvTx4Pzs
1aLMsJe7VTxWsR/gz98FtXMTimKn7A==
=r+l8
-----END PGP SIGNATURE-----

View File

@ -1,19 +1,18 @@
Name: libidn2
Version: 2.3.0
Release: 1
Version: 2.3.2
Release: 3
Summary: GNU IDN Library
License: (GPLv2+ or LGPLv3+) and GPLv3+
URL: https://www.gnu.org/software/libidn/#libidn2
Source0: https://ftp.gnu.org/gnu/libidn/%{name}-%{version}.tar.gz
Patch0: bugfix-libidn2-change-rpath.patch
Patch1: Implement-full-roundtrip-for-lookup-functionality.patch
#Dependency
BuildRequires: gcc gettext libunistring-devel autoconf texinfo automake
BuildRequires: gcc gettext-devel libunistring-devel autoconf texinfo automake libtool gtk-doc
Provides: bundled(gnulib)
Provides: idn2
Obsoletes: idn2
Obsoletes: idn2 < %{version}-%{release}
%description
Libidn2 is a free software implementation of IDNA2008, Punycode and TR46.
@ -34,9 +33,10 @@ Files for %{name} development
%autosetup -n %{name}-%{version} -p1
%build
autoreconf
autoreconf -fi
%configure --disable-static
%make_build
%make_build -C doc html
%install
%make_install
@ -75,6 +75,27 @@ make %{?_smp_mflags} -C tests check
%{_datadir}/gtk-doc/
%changelog
* Wed Nov 15 2023 zhoupengcheng <zhoupengcheng11@huawei.com> - 2.3.2-3
- revert version to 2.3.2
* Tue Oct 17 2023 zhangruifang <zhangruifang1@h-partners.com> -2.3.3-1
- update to 2.3.3
* Thu Sep 8 2022 panxiaohe <panxh.life@foxmail.com> - 2.3.2-3
- fix obsoletes in spec
* Sat Jan 8 2022 zoulin <zoulin13@huawei.com> - 2.3.2-2
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:Fix build failure
* Wed Dec 1 2021 wangchen <wangchen137@huawei.com> - 2.3.2-1
- Type:enhancement
- ID:NA
- SUG:NA
- DESC:update to 2.3.2
* Thu Jul 23 2020 zhangxingliang <zhangxingliang3@huawei.com> - 2.3.0-1
- Type:update
- ID:NA