}
protected function execute(InputInterface $input, OutputInterface $output): int {
- $skipSignatureCheck = $this->config->getSystemValue('encryption_skip_signature_check', false);
+ $skipSignatureCheck = $this->config->getSystemValueBool('encryption_skip_signature_check', false);
$this->supportLegacy = $this->config->getSystemValueBool('encryption.legacy_format_support', false);
if ($skipSignatureCheck) {
}
// Get cipher either from config.php or the default cipher defined in this class
- $cipher = $this->config->getSystemValue('cipher', self::DEFAULT_CIPHER);
+ $cipher = $this->config->getSystemValueString('cipher', self::DEFAULT_CIPHER);
if (!isset(self::SUPPORTED_CIPHERS_AND_KEY_SIZE[$cipher])) {
$this->logger->warning(
sprintf(
* @throws GenericEncryptionException
*/
private function checkSignature($data, $passPhrase, $expectedSignature) {
- $enforceSignature = !$this->config->getSystemValue('encryption_skip_signature_check', false);
+ $enforceSignature = !$this->config->getSystemValueBool('encryption_skip_signature_check', false);
$signature = $this->createSignature($data, $passPhrase);
$isCorrectHash = hash_equals($expectedSignature, $signature);
* @throws GenericEncryptionException
*/
private function hasSignature($catFile, $cipher) {
- $skipSignatureCheck = $this->config->getSystemValue('encryption_skip_signature_check', false);
+ $skipSignatureCheck = $this->config->getSystemValueBool('encryption_skip_signature_check', false);
$meta = substr($catFile, -93);
$signaturePosition = strpos($meta, '00sig00');
*/
public function testGenerateHeader($keyFormat, $expected) {
$this->config->expects($this->once())
- ->method('getSystemValue')
+ ->method('getSystemValueString')
->with($this->equalTo('cipher'), $this->equalTo('AES-256-CTR'))
->willReturn('AES-128-CFB');
public function testGetCipherWithInvalidCipher() {
$this->config->expects($this->once())
- ->method('getSystemValue')
+ ->method('getSystemValueString')
->with($this->equalTo('cipher'), $this->equalTo('AES-256-CTR'))
->willReturn('Not-Existing-Cipher');
$this->logger
*/
public function testGetCipher($configValue, $expected) {
$this->config->expects($this->once())
- ->method('getSystemValue')
+ ->method('getSystemValueString')
->with($this->equalTo('cipher'), $this->equalTo('AES-256-CTR'))
->willReturn($configValue);
* @dataProvider dataTestSplitMetaData
*/
public function testSplitMetaData($data, $expected) {
- $this->config->method('getSystemValue')
+ $this->config->method('getSystemValueBool')
->with('encryption_skip_signature_check', false)
->willReturn(true);
$result = self::invokePrivate($this->crypt, 'splitMetaData', [$data, 'AES-256-CFB']);
* @dataProvider dataTestHasSignature
*/
public function testHasSignature($data, $expected) {
- $this->config->method('getSystemValue')
+ $this->config->method('getSystemValueBool')
->with('encryption_skip_signature_check', false)
->willReturn(true);
$this->assertSame($expected,