FS#60158 - [composer] Claims php's openssl extension does not support sha384

Attached to Project: Arch Linux
Opened by Mikael (artturi) - Saturday, 22 September 2018, 09:05 GMT
Last edited by Pierre Schmitz (Pierre) - Wednesday, 18 December 2019, 14:16 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

cannot install composer programmatically because php's openssl extension does not support sha384

Additional info:
* package version : php 7.2.10 (openssl extension seems compiled into php binary)

Steps to reproduce:

run script provided by https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md

=========
#!/bin/sh

EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")"

if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
=========

Result :

./testinstcomposer.sh
SHA384 is not supported by your openssl extension

(culprit line being "php composer-setup.php --quiet")
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Wednesday, 18 December 2019, 14:16 GMT
Reason for closing:  Fixed
Comment by loqs (loqs) - Saturday, 22 September 2018, 18:05 GMT
line 649 of installer if (!in_array('SHA384', openssl_get_md_methods())) {
the entry is sha384 not SHA384 see

<?php
$digests = openssl_get_md_methods();
$digests_and_aliases = openssl_get_md_methods(true);
$digest_aliases = array_diff($digests_and_aliases, $digests);

print_r($digests);

print_r($digest_aliases);

if (!in_array('sha384', openssl_get_md_methods())) {
throw new RuntimeException('SHA384 is not supported by your openssl extension');
}

?>

arch also supplies composer in the repositories.
Comment by Mikael (artturi) - Monday, 24 September 2018, 05:57 GMT

Loading...