bpo-30694: Upgrade Modules/expat/ to libexpat 2.2.1 by vstinner · Pull Request #2300 · python/cpython (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation14 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

vstinner

New file: Modules/expat/siphash.h.

@vstinner

New file: Modules/expat/siphash.h.

marco-buttu

* --------------------------------------------------------------------------
* Derived by William Ahern from the reference implementation[1] published[2]
* by Jean-Philippe Aumasson and Daniel J. Berstein. Licensed in kind.
* by Jean-Philippe Aumasson and Daniel J. Berstein.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line a duplicate of the previous one?

* USAGE:
*
* SipHash-2-4 takes as input two 64-bit words as the key, some number of
* message bytes, and outputs a 64-bit word as the message digest. This

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing whitespace after period?

* state.
*
* For converting a 16-byte unsigned char array to a key, use either the
* macro sip_keyof or the routine sip_tokey. The former instantiates a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing whitespace after period?

*
* To convert the 64-bit hash value to a canonical 8-byte little-endian
* binary representation, use either the macro sip_binof or the routine
* sip_tobin. The former instantiates and returns a compound literal array,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing whitespace after period?

* NOTES:
*
* o Neither sip_keyof, sip_binof, nor siphash24 will work with compilers
* lacking compound literal support. Instead, you must use the lower-level

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing whitespace after period?

* lacking compound literal support. Instead, you must use the lower-level
* interfaces which take as parameters the temporary state objects.
*
* o Uppercase macros may evaluate parameters more than once. Lowercase

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing whitespace after period?

@vstinner

@vstinner

I generated this PR using the rebuild_expat_dir.sh script attached to http://bugs.python.org/issue30694

I only reverted a single change, to get the #include "pyexpatns.h" line.

My main contribution was the Misc/NEWS entry :-)

@vstinner

I would have prefer to wait for a review before merging, but IMHO we have too many open security issues, so I would like to move fast. For this specific PR, I just copied code from libexpat 2.2.1, I only wrote the Misc/NEWS entry. So it's not like I can do a lot of mistakes :-)

@bedevere-bot

@bedevere-bot

@bedevere-bot

vstinner added a commit that referenced this pull request

Jun 21, 2017

@vstinner

New file: Modules/expat/siphash.h. (cherry picked from commit 5ff7132)

vstinner added a commit that referenced this pull request

Jun 21, 2017

@vstinner

New file: Modules/expat/siphash.h. (cherry picked from commit 5ff7132)

vstinner added a commit that referenced this pull request

Jun 21, 2017

@vstinner

)

New file: Modules/expat/siphash.h. (cherry picked from commit 5ff7132)

(cherry picked from libexpat commit c74d380b8f0b5215153d840d2af9455d9c53b960)

@gpshead

@marco-buttu

ned-deily pushed a commit to ned-deily/cpython that referenced this pull request

Jul 7, 2017

@vstinner @ned-deily

larryhastings pushed a commit that referenced this pull request

Jul 12, 2017

@vstinner @larryhastings

…2164) (#2203)

Remove the configuration (Modules/expat/*config.h) of unsupported platforms:

The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became useless since our local expat copy was upgrade to expat 2.1 (it's now expat 2.2.0).

(cherry picked from commit 23ec4b5)

New file: Modules/expat/siphash.h. (cherry picked from commit 5ff7132)

bpo-30726, bpo-29591: libexpat 2.2.1 of Modules/expat/ now uses a winconfig.h configuration file which already defines:

Remove these defines from PCbuild/_elementtree.vcxproj to prevent compiler warnings.

Co-Authored-By: Jeremy Kloth jeremy.kloth@gmail.com (cherry picked from commit c8fb58b)

Caused by usage of getenv which should be safe. And a few integer truncations which should also be ok.

(cherry picked from commit 87c6555)

ned-deily pushed a commit that referenced this pull request

Jul 16, 2017

@vstinner @ned-deily

…2164) (#2204)

Remove the configuration (Modules/expat/*config.h) of unsupported platforms:

The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became useless since our local expat copy was upgrade to expat 2.1 (it's now expat 2.2.0).

(cherry picked from commit 23ec4b5)

New file: Modules/expat/siphash.h. (cherry picked from commit 5ff7132)

bpo-30726, bpo-29591: libexpat 2.2.1 of Modules/expat/ now uses a winconfig.h configuration file which already defines:

Remove these defines from PCbuild/_elementtree.vcxproj to prevent compiler warnings.

Co-Authored-By: Jeremy Kloth jeremy.kloth@gmail.com (cherry picked from commit c8fb58b)

Caused by usage of getenv which should be safe. And a few integer truncations which should also be ok.

(cherry picked from commit 87c6555)