Skip to content

Phar::setSignatureAlgorithm: document the SHA256 default - #6038

Merged
jordikroon merged 2 commits into
php:masterfrom
mlocati-forks:phar-default-signature-sha256
Nov 4, 2026
Merged

jordikroon merged 2 commits into
php:masterfrom
mlocati-forks:phar-default-signature-sha256

Conversation

@mlocati

@mlocati mlocati commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Since PHP 8.1.0, executable phar archives are signed with SHA256 by default, instead of SHA1.

The change was introduced by php/php-src@8bb0c74e243 and is listed in the Phar section of the PHP 8.1 migration guide.

I also verified it by building a phar without calling setSignatureAlgorithm(): PHP 5.5 and 7.4 write the signature flag 0x0002 (SHA1), PHP 8.5 writes 0x0003 (SHA256).

@lacatoire lacatoire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

on lint nits & LGTM

@mlocati

mlocati commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

I've made docbook-cs happy with d810fb3

@jordikroon
jordikroon merged commit 6aa0806 into php:master Nov 4, 2026
3 checks passed
@jordikroon

Copy link
Copy Markdown
Member

Thank you @mlocati

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants