Skip to content

Commit

Permalink
Attempt to find a difference between Linux/Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 17, 2022
1 parent 8f536ce commit 083dc10
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest, windows-latest]
php-versions: ['8.0', '8.1']
php-versions: ['8.0', '8.1', '8.2']

steps:
- name: Setup PHP, with composer and extensions
Expand Down
40 changes: 22 additions & 18 deletions tests/Alg/Signature/RSASignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ public function testSign(): void
bin2hex($rsa->sign($this->plaintext)),
);

// test RSA-RIPEMD160
$rsa = $this->factory->getAlgorithm(C::SIG_RSA_RIPEMD160, $this->privateKey);
$this->assertEquals(
'a1ea231e886d4d53e3939f1b8d604db0b74547827a2cd552bbfbd9a07e3f997446606bcb3da052865ed4c7e225ce4c7a02c1141' .
'ce3ce7079a8f08dd6af07bff9979cb4998e76e36ee5508149c9487b38e7c88056ecad6f16d71eab25173e2d924b7165789d738e' .
'88cc0371c63da53182365757e29ae48f6330c6fcaa1011812f',
bin2hex($rsa->sign($this->plaintext)),
);
if (boolval(OPENSSL_VERSION_NUMBER >= hexdec('0x30000000')) === false) { // OpenSSL 3.0 disabled RIPEMD160 support
// test RSA-RIPEMD160
$rsa = $this->factory->getAlgorithm(C::SIG_RSA_RIPEMD160, $this->privateKey);
$this->assertEquals(
'a1ea231e886d4d53e3939f1b8d604db0b74547827a2cd552bbfbd9a07e3f997446606bcb3da052865ed4c7e225ce4c7a02c1141' .
'ce3ce7079a8f08dd6af07bff9979cb4998e76e36ee5508149c9487b38e7c88056ecad6f16d71eab25173e2d924b7165789d738e' .
'88cc0371c63da53182365757e29ae48f6330c6fcaa1011812f',
bin2hex($rsa->sign($this->plaintext)),
);
}
}


Expand Down Expand Up @@ -167,16 +169,18 @@ public function testVerify(): void
),
));

// test RSA-RIPEMD160
$rsa = $this->factory->getAlgorithm(C::SIG_RSA_RIPEMD160, $this->publicKey);
$this->assertTrue($rsa->verify(
$this->plaintext,
hex2bin(
'a1ea231e886d4d53e3939f1b8d604db0b74547827a2cd552bbfbd9a07e3f997446606bcb3da052865ed4c7e225ce4c7a02c' .
'1141ce3ce7079a8f08dd6af07bff9979cb4998e76e36ee5508149c9487b38e7c88056ecad6f16d71eab25173e2d924b7165'.
'789d738e88cc0371c63da53182365757e29ae48f6330c6fcaa1011812f',
),
));
if (boolval(OPENSSL_VERSION_NUMBER >= hexdec('0x30000000')) === false) { // OpenSSL 3.0 disabled RIPEMD160 support
// test RSA-RIPEMD160
$rsa = $this->factory->getAlgorithm(C::SIG_RSA_RIPEMD160, $this->publicKey);
$this->assertTrue($rsa->verify(
$this->plaintext,
hex2bin(
'a1ea231e886d4d53e3939f1b8d604db0b74547827a2cd552bbfbd9a07e3f997446606bcb3da052865ed4c7e225ce4c7a02c' .
'1141ce3ce7079a8f08dd6af07bff9979cb4998e76e36ee5508149c9487b38e7c88056ecad6f16d71eab25173e2d924b7165'.
'789d738e88cc0371c63da53182365757e29ae48f6330c6fcaa1011812f',
),
));
}
}


Expand Down

0 comments on commit 083dc10

Please sign in to comment.