Compare commits
10 Commits
9cdb98cbce
...
6663888889
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6663888889 | ||
|
|
863ff56523 | ||
|
|
395b1e20a0 | ||
|
|
4c48b7dc4d | ||
|
|
316fd09853 | ||
|
|
aab69dd72e | ||
|
|
b9d222c814 | ||
|
|
ede6d55ccf | ||
|
|
4e8ff73fe7 | ||
|
|
3d2c2bdade |
28
apr-util-Add-sw64-architecture.patch
Normal file
28
apr-util-Add-sw64-architecture.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From a84e910ee8c0991ee23da668f9e849da3b03ebed Mon Sep 17 00:00:00 2001
|
||||
From: wzx <wuzx1226@qq.com>
|
||||
Date: Thu, 24 Nov 2022 15:11:53 +0800
|
||||
Subject: [PATCH] Add sw64 architecture
|
||||
|
||||
Add sw64 architecture in file crypto/crypt_blowfish.c according to alpha architecture to support sw64 architecture.
|
||||
|
||||
Signed-off-by: wzx <wuzx1226@qq.com>
|
||||
---
|
||||
crypto/crypt_blowfish.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/crypto/crypt_blowfish.c b/crypto/crypt_blowfish.c
|
||||
index 3d306cf..c22b06b 100644
|
||||
--- a/crypto/crypt_blowfish.c
|
||||
+++ b/crypto/crypt_blowfish.c
|
||||
@@ -56,7 +56,7 @@
|
||||
#ifdef __i386__
|
||||
#define BF_ASM 0
|
||||
#define BF_SCALE 1
|
||||
-#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__)
|
||||
+#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__) || defined(__sw_64__)
|
||||
#define BF_ASM 0
|
||||
#define BF_SCALE 1
|
||||
#else
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Name: apr-util
|
||||
Version: 1.6.1
|
||||
Release: 11
|
||||
Release: 14
|
||||
Summary: apr-util provides a number of helpful abstractions on top of APR.
|
||||
License: ASL 2.0
|
||||
URL: http://apr.apache.org
|
||||
@ -13,8 +13,10 @@ Patch6001: Merge-r1822315-from-trunk.patch
|
||||
Patch6002: Fix-error-handling-in-gdbm.patch
|
||||
Patch6003: Merge-r1834022-r1834023-r1834024-from-trunk.patch
|
||||
Patch6004: Remove-dereference-of-null-pointer.patch
|
||||
Patch6005: apr-util-Add-sw64-architecture.patch
|
||||
Patch6006: backport-CVE-2022-25147-apr_base64-Make-sure-encoding-decoding-lengths-fit-i.patch
|
||||
|
||||
BuildRequires: gcc autoconf apr-devel >= 1.6.0 libdb-devel expat-devel libuuid-devel
|
||||
BuildRequires: gcc autoconf apr-devel >= 1.6.0 gdbm-devel expat-devel libuuid-devel
|
||||
BuildRequires: mariadb-connector-c-devel sqlite-devel >= 3.1.0 openldap-devel openssl-devel
|
||||
|
||||
Requires: apr-util%{?_isa} = %{version}-%{release}
|
||||
@ -40,7 +42,7 @@ work around or take advantage of platform-specific deficiencies or features.
|
||||
%package devel
|
||||
Summary: The development kit of apr-util.
|
||||
Requires: expat-devel%{?_isa} apr-util%{?_isa} = %{version}-%{release}
|
||||
Requires: libdb-devel%{?_isa} openldap-devel%{?_isa} apr-devel%{?_isa} pkgconfig
|
||||
Requires: gdbm-devel%{?_isa} openldap-devel%{?_isa} apr-devel%{?_isa} pkgconfig
|
||||
|
||||
%description devel
|
||||
The development kit of apr-util.
|
||||
@ -68,8 +70,8 @@ The ODBC DBD driver of apr-util.
|
||||
autoheader && autoconf
|
||||
export ac_cv_ldap_set_rebind_proc_style=three
|
||||
%configure --with-apr=%{_prefix} --includedir=%{_includedir}/apr-%{apuver} \
|
||||
--with-ldap=ldap_r --without-gdbm --with-sqlite3 --with-pgsql --with-mysql --with-odbc \
|
||||
--with-dbm=db5 --with-berkeley-db --without-sqlite2 --with-crypto --with-openssl
|
||||
--with-ldap=ldap_r --with-gdbm --with-sqlite3 --with-pgsql --with-mysql --with-odbc \
|
||||
--with-dbm=gdbm --without-berkeley-db --without-sqlite2 --with-crypto --with-openssl
|
||||
%make_build
|
||||
|
||||
%install
|
||||
@ -102,7 +104,7 @@ make test
|
||||
%license LICENSE
|
||||
%{_libdir}/libaprutil-%{apuver}.so.*
|
||||
%dir %{_libdir}/%{name}-%{apuver}
|
||||
%{_libdir}/%{name}-%{apuver}/apr_dbm_db*
|
||||
%{_libdir}/%{name}-%{apuver}/apr_dbm_gdbm*
|
||||
%{_libdir}/%{name}-%{apuver}/apr_dbd_mysql*
|
||||
%{_libdir}/%{name}-%{apuver}/apr_dbd_sqlite*
|
||||
%{_libdir}/%{name}-%{apuver}/apr_ldap*
|
||||
@ -123,6 +125,16 @@ make test
|
||||
%{_libdir}/%{name}-%{apuver}/apr_dbd_odbc*
|
||||
|
||||
%changelog
|
||||
* Tue Feb 14 2023 fuanan <fuanan3@h-partners.com> - 1.6.1-14
|
||||
- Fix CVE-2022-25147
|
||||
|
||||
* Thu Jul 28 2022 wuzx<wuzx1226@qq.com> - 1.6.1-13
|
||||
- add sw64 patch
|
||||
|
||||
* Sat Jun 19 2021 panxiaohe <panxiaohe@huawei.com> - 1.6.1-12
|
||||
- BuildRequires: replace libdb with gdbm
|
||||
- Add requires gdbm-devel
|
||||
|
||||
* Mon Jan 13 2020 openEuler Buildteam <buildteam@openeuler.org> - 1.6.1-11
|
||||
- Delete useless files.
|
||||
|
||||
|
||||
4
apr-util.yaml
Normal file
4
apr-util.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: svn
|
||||
src_repo: https://svn.apache.org/repos/asf/apr/apr-util
|
||||
tag_prefix: ""
|
||||
seperator: "."
|
||||
@ -0,0 +1,159 @@
|
||||
From 850cc4f69639ac9f1c1c9767efaf4883ee3217ce Mon Sep 17 00:00:00 2001
|
||||
From: Yann Ylavic <ylavic@apache.org>
|
||||
Date: Thu, 23 Jun 2022 15:12:47 +0000
|
||||
Subject: [PATCH] apr_base64: Make sure encoding/decoding lengths fit in an int
|
||||
>= 0.
|
||||
|
||||
The (old) API of apr_base64 functions has always used int for representing
|
||||
lengths and it does not return errors. Make sure to abort() if the provided
|
||||
data don't fit.
|
||||
|
||||
* encoding/apr_base64.c():
|
||||
#define APR_BASE64_ENCODE_MAX and APR_BASE64_DECODE_MAX as the hard length
|
||||
limits for encoding and decoding respectively.
|
||||
|
||||
* encoding/apr_base64.c(apr_base64_encode_len, apr_base64_encode,
|
||||
apr_base64_encode_binary, apr_pbase64_encode):
|
||||
abort() if the given length is above APR_BASE64_ENCODE_MAX.
|
||||
|
||||
* encoding/apr_base64.c(apr_base64_decode_len, apr_base64_decode,
|
||||
apr_base64_decode_binary, apr_pbase64_decode):
|
||||
abort() if the given plain buffer length is above APR_BASE64_DECODE_MAX.
|
||||
|
||||
|
||||
|
||||
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902206 13f79535-47bb-0310-9956-ffa450edef68
|
||||
---
|
||||
encoding/apr_base64.c | 46 ++++++++++++++++++++++++++-----------------
|
||||
1 file changed, 28 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/encoding/apr_base64.c b/encoding/apr_base64.c
|
||||
index b4b28cf75..f5c2786ad 100644
|
||||
--- a/encoding/apr_base64.c
|
||||
+++ b/encoding/apr_base64.c
|
||||
@@ -20,11 +20,20 @@
|
||||
* ugly 'len' functions, which is quite a nasty cost.
|
||||
*/
|
||||
|
||||
+#undef NDEBUG /* always abort() on assert()ion failure */
|
||||
+#include <assert.h>
|
||||
+
|
||||
#include "apr_base64.h"
|
||||
#if APR_CHARSET_EBCDIC
|
||||
#include "apr_xlate.h"
|
||||
#endif /* APR_CHARSET_EBCDIC */
|
||||
|
||||
+/* Above APR_BASE64_ENCODE_MAX length the encoding can't fit in an int >= 0 */
|
||||
+#define APR_BASE64_ENCODE_MAX 1610612733
|
||||
+
|
||||
+/* Above APR_BASE64_DECODE_MAX length the decoding can't fit in an int >= 0 */
|
||||
+#define APR_BASE64_DECODE_MAX 2863311524u
|
||||
+
|
||||
/* aaaack but it's fast and const should make it shared text page. */
|
||||
static const unsigned char pr2six[256] =
|
||||
{
|
||||
@@ -109,24 +118,22 @@ APU_DECLARE(apr_status_t) apr_base64init_ebcdic(apr_xlate_t *to_ascii,
|
||||
|
||||
APU_DECLARE(int) apr_base64_decode_len(const char *bufcoded)
|
||||
{
|
||||
- int nbytesdecoded;
|
||||
register const unsigned char *bufin;
|
||||
register apr_size_t nprbytes;
|
||||
|
||||
bufin = (const unsigned char *) bufcoded;
|
||||
while (pr2six[*(bufin++)] <= 63);
|
||||
-
|
||||
nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
|
||||
- nbytesdecoded = (((int)nprbytes + 3) / 4) * 3;
|
||||
+ assert(nprbytes <= APR_BASE64_DECODE_MAX);
|
||||
|
||||
- return nbytesdecoded + 1;
|
||||
+ return (int)(((nprbytes + 3u) / 4u) * 3u + 1u);
|
||||
}
|
||||
|
||||
APU_DECLARE(int) apr_base64_decode(char *bufplain, const char *bufcoded)
|
||||
{
|
||||
#if APR_CHARSET_EBCDIC
|
||||
apr_size_t inbytes_left, outbytes_left;
|
||||
-#endif /* APR_CHARSET_EBCDIC */
|
||||
+#endif /* APR_CHARSET_EBCDIC */
|
||||
int len;
|
||||
|
||||
len = apr_base64_decode_binary((unsigned char *) bufplain, bufcoded);
|
||||
@@ -154,12 +161,13 @@ APU_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain,
|
||||
bufin = (const unsigned char *) bufcoded;
|
||||
while (pr2six[*(bufin++)] <= 63);
|
||||
nprbytes = (bufin - (const unsigned char *) bufcoded) - 1;
|
||||
- nbytesdecoded = (((int)nprbytes + 3) / 4) * 3;
|
||||
+ assert(nprbytes <= APR_BASE64_DECODE_MAX);
|
||||
+ nbytesdecoded = (int)(((nprbytes + 3u) / 4u) * 3u);
|
||||
|
||||
bufout = (unsigned char *) bufplain;
|
||||
bufin = (const unsigned char *) bufcoded;
|
||||
|
||||
- while (nprbytes > 4) {
|
||||
+ while (nprbytes >= 4) {
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
|
||||
*(bufout++) =
|
||||
@@ -179,13 +187,8 @@ APU_DECLARE(int) apr_base64_decode_binary(unsigned char *bufplain,
|
||||
*(bufout++) =
|
||||
(unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
|
||||
}
|
||||
- if (nprbytes > 3) {
|
||||
- *(bufout++) =
|
||||
- (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
|
||||
- }
|
||||
|
||||
- nbytesdecoded -= (4 - (int)nprbytes) & 3;
|
||||
- return nbytesdecoded;
|
||||
+ return nbytesdecoded - (int)((4u - nprbytes) & 3u);
|
||||
}
|
||||
|
||||
static const char basis_64[] =
|
||||
@@ -203,6 +206,8 @@ static const char basis_64[] =
|
||||
|
||||
APU_DECLARE(int) apr_base64_encode_len(int len)
|
||||
{
|
||||
+ assert(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
|
||||
+
|
||||
return ((len + 2) / 3 * 4) + 1;
|
||||
}
|
||||
|
||||
@@ -214,6 +219,8 @@ APU_DECLARE(int) apr_base64_encode(char *encoded, const char *string, int len)
|
||||
int i;
|
||||
char *p;
|
||||
|
||||
+ assert(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
|
||||
+
|
||||
p = encoded;
|
||||
for (i = 0; i < len - 2; i += 3) {
|
||||
*p++ = basis_64[(os_toascii[string[i]] >> 2) & 0x3F];
|
||||
@@ -238,7 +245,7 @@ APU_DECLARE(int) apr_base64_encode(char *encoded, const char *string, int len)
|
||||
}
|
||||
|
||||
*p++ = '\0';
|
||||
- return p - encoded;
|
||||
+ return (unsigned int)(p - encoded);
|
||||
#endif /* APR_CHARSET_EBCDIC */
|
||||
}
|
||||
|
||||
@@ -251,6 +258,8 @@ APU_DECLARE(int) apr_base64_encode_binary(char *encoded,
|
||||
int i;
|
||||
char *p;
|
||||
|
||||
+ assert(len >= 0 && len <= APR_BASE64_ENCODE_MAX);
|
||||
+
|
||||
p = encoded;
|
||||
for (i = 0; i < len - 2; i += 3) {
|
||||
*p++ = basis_64[(string[i] >> 2) & 0x3F];
|
||||
@@ -275,5 +284,5 @@ APU_DECLARE(int) apr_base64_encode_binary(char *encoded,
|
||||
}
|
||||
|
||||
*p++ = '\0';
|
||||
- return (int)(p - encoded);
|
||||
+ return (unsigned int)(p - encoded);
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user