[OE-core] [PATCH] nss: Fix SHA_HTONL bug for arm 32be.

Burton, Ross ross.burton at intel.com
Tue Dec 4 11:14:00 UTC 2018


As this isn't a little detail, can you file this upstream?

Ross
On Tue, 4 Dec 2018 at 09:24, Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com> wrote:
>
> Rpm use nss as digest crypto library and which will cause an error as follows:
>
> error: test-manual-1.2.3-20181012.noarch.rpm: Header SHA1 digest: BAD (Expected
> f1deb7dc4a10742d88ccd1e967dbc62ae45095a5 !=4ad9d7dad6d70d6086eefec62612ad5d77f2fe81)  => this value is wrong
> error: test-manual-1.2.3-20181012.noarch.rpm: not an rpm package (or package manifest)
>
> The error is caused by SHA_HTONL in nss, for there is no need to reverse the host value for arm 32be, so fix it.
>
> Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
> ---
>  .../nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch   | 34 ++++++++++++++++++++++
>  meta/recipes-support/nss/nss_3.40.bb               |  1 +
>  2 files changed, 35 insertions(+)
>  create mode 100644 meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch
>
> diff --git a/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch b/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch
> new file mode 100644
> index 0000000..7ba8d16
> --- /dev/null
> +++ b/meta/recipes-support/nss/nss/nss-fix-SHA_HTONL-bug-for-arm-32be.patch
> @@ -0,0 +1,34 @@
> +Subject: [PATCH] Fix SHA_HTONL bug for arm 32be.
> +
> +In arm 32be, there is no need to reverse the host value.
> +
> +Upstream Status: Pending
> +
> +Signed-off-by: Zheng Ruoqin <zhengrq.fnst at cn.fujitsu.com>
> +---
> + lib/freebl/sha_fast.h | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/nss/lib/freebl/sha_fast.h b/nss/lib/freebl/sha_fast.h
> +index 4f37d13..8072eda 100644
> +--- a/nss/lib/freebl/sha_fast.h
> ++++ b/nss/lib/freebl/sha_fast.h
> +@@ -99,6 +99,7 @@ swap4b(PRUint32 value)
> +       defined(__ARM_ARCH_7__) ||   \
> +       defined(__ARM_ARCH_7A__) ||  \
> +       defined(__ARM_ARCH_7R__)))
> ++#if defined(IS_LITTLE_ENDIAN)
> + static __inline__ PRUint32
> + swap4b(PRUint32 value)
> + {
> +@@ -109,6 +110,7 @@ swap4b(PRUint32 value)
> +     return ret;
> + }
> + #define SHA_HTONL(x) swap4b(x)
> ++#endif
> +
> + #endif /* x86 family */
> +
> +--
> +2.7.4
> +
> diff --git a/meta/recipes-support/nss/nss_3.40.bb b/meta/recipes-support/nss/nss_3.40.bb
> index 23c95dd..afc5081 100644
> --- a/meta/recipes-support/nss/nss_3.40.bb
> +++ b/meta/recipes-support/nss/nss_3.40.bb
> @@ -28,6 +28,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSIO
>             file://blank-cert9.db \
>             file://blank-key4.db \
>             file://system-pkcs11.txt \
> +           file://nss-fix-SHA_HTONL-bug-for-arm-32be.patch \
>             "
>
>  SRC_URI[md5sum] = "f7aec858d192ae03d0e9a35a730c70fa"
> --
> 2.7.4
>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


More information about the Openembedded-core mailing list