From 4d86414dd1e094756d94b5f6b45ed69d514a61e8 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 17 Sep 2018 11:24:47 +0200 Subject: [PATCH] Use a case insenstive method to check that SHA384 is a supported openssl algorithm --- src/Composer/Command/SelfUpdateCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 2641a922b..243755963 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -220,7 +220,7 @@ TAGSPUBKEY $pubkeyid = openssl_pkey_get_public($sigFile); $algo = defined('OPENSSL_ALGO_SHA384') ? OPENSSL_ALGO_SHA384 : 'SHA384'; - if (!in_array('SHA384', openssl_get_md_methods())) { + if (!in_array('sha384', array_map('strtolower', openssl_get_md_methods()))) { throw new \RuntimeException('SHA384 is not supported by your openssl extension, could not verify the phar file integrity'); } $signature = json_decode($signature, true);