[TASK] Throw LogicException in HashService when required parameter is empty
The `hmac` function in the `HashService` class should not throw a custom `EmptyAdditionalSecretException` when the `$additionalSecret` parameter is an empty string. Instead, a top level exception should be used, as the issue is caused from incorrect parameter usage by the developer. This change replaces the `EmptyAdditionalSecretException` with a `LogicException` to better indicate the misuse of the method's parameters. Resolves: #103277 Releases: main Change-Id: Ib6b049ee9c233868684af58ebd0e018bc97ef167 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83206 Tested-by:core-ci <typo3@b13.com> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/core/Classes/Crypto/HashService.php 1 addition, 2 deletionstypo3/sysext/core/Classes/Crypto/HashService.php
- typo3/sysext/core/Classes/Exception/Crypto/EmptyAdditionalSecretException.php 0 additions, 25 deletions...asses/Exception/Crypto/EmptyAdditionalSecretException.php
- typo3/sysext/core/Tests/Unit/Crypto/HashServiceTest.php 1 addition, 2 deletionstypo3/sysext/core/Tests/Unit/Crypto/HashServiceTest.php
Please register or sign in to comment