@@ -320,13 +320,13 @@ public function testApiSignRequestWithGlobalConfig()
320320
321321 $ params = $ initialParams ;
322322 Configuration::instance ()->cloud ->apiSecret = self ::API_SIGN_REQUEST_TEST_SECRET ;
323- Configuration::instance ()->cloud ->signatureAlgorithm = Utils:: ALGO_SHA256 ;
323+ Configuration::instance ()->cloud ->signatureAlgorithm = null ;
324324 ApiUtils::signRequest ($ params , Configuration::instance ()->cloud );
325325 $ expected = '45ddaa4fa01f0c2826f32f669d2e4514faf275fe6df053f1a150e7beae58a3bd ' ;
326326 self ::assertEquals ($ expected , $ params ['signature ' ]);
327327
328328 $ params = $ initialParams ;
329- Configuration::instance ()->cloud ->signatureAlgorithm = null ;
329+ Configuration::instance ()->cloud ->signatureAlgorithm = Utils:: ALGO_SHA1 ;
330330 ApiUtils::signRequest ($ params , Configuration::instance ()->cloud );
331331 $ expectedSha1 = '14c00ba6d0dfdedbc86b316847d95b9e6cd46d94 ' ;
332332 self ::assertEquals ($ expectedSha1 , $ params ['signature ' ]);
@@ -382,11 +382,11 @@ public function testApiSignRequestPreventsParameterSmuggling()
382382 'Signatures should be different to prevent parameter smuggling ' );
383383
384384 // Verify the expected signature for the properly encoded case
385- $ expectedSignature = '4fdf465dd89451cc1ed8ec5b3e314e8a51695704 ' ;
385+ $ expectedSignature = '6c3d31a5b591c5afb8a37e31764171324de3f57421301e87503e5ceeabad0bbd ' ;
386386 self ::assertEquals ($ expectedSignature , $ signatureWithAmpersand );
387387
388388 // Verify the expected signature for the smuggled parameters case
389- $ expectedSmuggledSignature = '7b4e3a539ff1fa6e6700c41b3a2ee77586a025f9 ' ;
389+ $ expectedSmuggledSignature = 'a764c945d130e8c894342711d373606cd39df91fe91dbc4559e778e0b47e7730 ' ;
390390 self ::assertEquals ($ expectedSmuggledSignature , $ signatureSmugggled );
391391 }
392392
@@ -420,7 +420,7 @@ public function testConfiguredSignatureVersionIsApplied()
420420 'Signature versions should produce different results ' );
421421
422422 // Version 2 should match the expected encoded signature
423- $ expectedV2Signature = '4fdf465dd89451cc1ed8ec5b3e314e8a51695704 ' ;
423+ $ expectedV2Signature = '6c3d31a5b591c5afb8a37e31764171324de3f57421301e87503e5ceeabad0bbd ' ;
424424 self ::assertEquals ($ expectedV2Signature , $ signatureV2 ,
425425 'Version 2 should match expected encoded signature ' );
426426 }
0 commit comments