From d16babf351e11c9bbfce57a7e92ae06194d9dab0 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 22 Oct 2018 16:37:09 +0200 Subject: Update sha3's brg_endian.h, document provenance and version The existing copyright notice gave me a name; github found me a file; but it doesn't match what we had before. Made some guesses at which parts of the change relative to upstream to keep, documented the diff as a patch and recorded details in qt_attribution.json Task-number: QTBUG-70008 Change-Id: I423724435eaeeda7237f8b3df8691b436fed8652 Reviewed-by: Lars Knoll --- src/3rdparty/sha3/BRG_ENDIAN_LICENSE | 21 ++++++---------- src/3rdparty/sha3/brg_endian.h | 47 ++++++++++++++++------------------- src/3rdparty/sha3/brg_endian.h.patch | 34 +++++++++++++++++++++++++ src/3rdparty/sha3/qt_attribution.json | 8 +++--- 4 files changed, 68 insertions(+), 42 deletions(-) create mode 100644 src/3rdparty/sha3/brg_endian.h.patch (limited to 'src/3rdparty') diff --git a/src/3rdparty/sha3/BRG_ENDIAN_LICENSE b/src/3rdparty/sha3/BRG_ENDIAN_LICENSE index 0a4fdcbc3b..175347c263 100644 --- a/src/3rdparty/sha3/BRG_ENDIAN_LICENSE +++ b/src/3rdparty/sha3/BRG_ENDIAN_LICENSE @@ -1,21 +1,14 @@ -Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved. - -LICENSE TERMS +Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. The redistribution and use of this software (with or without changes) is allowed without the payment of fees or royalties provided that: - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; - - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. + source code distributions include the above copyright notice, this + list of conditions and the following disclaimer; -DISCLAIMER + binary distributions include the above copyright notice, this list + of conditions and the following disclaimer in their documentation. This software is provided 'as is' with no explicit or implied warranties -in respect of its properties, including, but not limited to, correctness -and/or fitness for purpose. +in respect of its operation, including, but not limited to, correctness +and fitness for purpose. diff --git a/src/3rdparty/sha3/brg_endian.h b/src/3rdparty/sha3/brg_endian.h index 7226eb3bec..09d2a8b6a9 100644 --- a/src/3rdparty/sha3/brg_endian.h +++ b/src/3rdparty/sha3/brg_endian.h @@ -1,29 +1,22 @@ /* - --------------------------------------------------------------------------- - Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved. +--------------------------------------------------------------------------- +Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved. - LICENSE TERMS +The redistribution and use of this software (with or without changes) +is allowed without the payment of fees or royalties provided that: - The redistribution and use of this software (with or without changes) - is allowed without the payment of fees or royalties provided that: + source code distributions include the above copyright notice, this + list of conditions and the following disclaimer; - 1. source code distributions include the above copyright notice, this - list of conditions and the following disclaimer; + binary distributions include the above copyright notice, this list + of conditions and the following disclaimer in their documentation. - 2. binary distributions include the above copyright notice, this list - of conditions and the following disclaimer in their documentation; - - 3. the name of the copyright holder is not used to endorse products - built using this software without specific written permission. - - DISCLAIMER - - This software is provided 'as is' with no explicit or implied warranties - in respect of its properties, including, but not limited to, correctness - and/or fitness for purpose. - --------------------------------------------------------------------------- - Issue Date: 20/12/2007 - Changes for ARM 9/9/2010 +This software is provided 'as is' with no explicit or implied warranties +in respect of its operation, including, but not limited to, correctness +and fitness for purpose. +--------------------------------------------------------------------------- +Issue Date: 20/12/2007 +Changes for ARM 9/9/2010 [Downstream relative to Gladman's GitHub, upstream to Qt] */ #ifndef _BRG_ENDIAN_H @@ -32,7 +25,12 @@ #define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */ #define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */ -#if 0 +/* This is needed when using clang with MSVC to avoid including */ +/* endian.h and byteswap.h which are not present on Windows */ +#if defined( _MSC_VER ) && defined( __clang__ ) +# undef __GNUC__ +#endif + /* Include files where endian defines and byteswap functions may reside */ #if defined( __sun ) # include @@ -42,14 +40,13 @@ defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ ) # include #elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ ) -# if !defined( __MINGW32__ ) && !defined( _AIX ) +# if !defined( __MINGW32__ ) && !defined( _AIX ) && !defined(Q_OS_QNX) # include # if !defined( __BEOS__ ) # include # endif # endif #endif -#endif /* Now attempt to set the define for platform byte order using any */ /* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */ @@ -134,7 +131,7 @@ #elif 0 /* **** EDIT HERE IF NECESSARY **** */ # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN #else -# error Please edit lines 132 or 134 in brg_endian.h to set the platform byte order +# error Please edit lines 129 or 131 in brg_endian.h to set the platform byte order #endif #endif diff --git a/src/3rdparty/sha3/brg_endian.h.patch b/src/3rdparty/sha3/brg_endian.h.patch new file mode 100644 index 0000000000..395133ad2a --- /dev/null +++ b/src/3rdparty/sha3/brg_endian.h.patch @@ -0,0 +1,34 @@ +diff -ub /home/eddy/.sys/tmp/sha/brg_endian.h /home/eddy/work/Qt-5.12/qtbase/src/3rdparty/sha3/brg_endian.h +--- upstream/sha/brg_endian.h 2018-10-22 16:27:04.106128670 +0200 ++++ qtbase/src/3rdparty/sha3/brg_endian.h 2018-10-22 16:30:35.098891562 +0200 +@@ -16,6 +16,7 @@ + and fitness for purpose. + --------------------------------------------------------------------------- + Issue Date: 20/12/2007 ++Changes for ARM 9/9/2010 [Downstream relative to Gladman's GitHub, upstream to Qt] + */ + + #ifndef _BRG_ENDIAN_H +@@ -119,12 +120,18 @@ + defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX ) + # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN + +-#elif 0 /* **** EDIT HERE IF NECESSARY **** */ ++#elif defined(__arm__) ++# ifdef __BIG_ENDIAN ++# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN ++# else ++# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN ++# endif ++#elif 1 /* **** EDIT HERE IF NECESSARY **** */ + # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN + #elif 0 /* **** EDIT HERE IF NECESSARY **** */ + # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN + #else +-# error Please edit lines 126 or 128 in brg_endian.h to set the platform byte order ++# error Please edit lines 129 or 131 in brg_endian.h to set the platform byte order + #endif + + #endif + +Diff finished. Mon Oct 22 16:31:46 2018 diff --git a/src/3rdparty/sha3/qt_attribution.json b/src/3rdparty/sha3/qt_attribution.json index 4866be32ea..a3122b4e7b 100644 --- a/src/3rdparty/sha3/qt_attribution.json +++ b/src/3rdparty/sha3/qt_attribution.json @@ -4,13 +4,15 @@ "Name": "Secure Hash Algorithm SHA-3 - brg_endian", "QDocModule": "qtcore", "QtUsage": "Used in Qt Core (QCryptographicHash).", + "Files": "apply brg_endian.h.patch to upstream from https://github.com/BrianGladman/sha/", "Files": "brg_endian.h", "Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.", - "License": "BSD 3-clause \"New\" or \"Revised\" License", + "Version": "https://github.com/BrianGladman/sha/ commit 4b9e13ead2c5b5e41ca27c65de4dd69ae0bac228", + "License": "BSD 2-clause \"Simplified\" License", "LicenseFile": "BRG_ENDIAN_LICENSE", - "LicenseId": "BSD-3-Clause", - "Copyright": "Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved." + "LicenseId": "BSD-2-Clause", + "Copyright": "Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved." }, { "Id": "sha3_keccak", -- cgit v1.2.3