System / Trust / Revocation - only use withPadding() for RSA based public keys. regression in 9606957ef8

This commit is contained in:
Ad Schellevis 2022-09-16 10:34:35 +02:00
parent 24aa099509
commit 67e4a1dd99

View File

@ -663,7 +663,9 @@ function crl_update(&$crl)
/* get the private key to sign the new (updated) CRL */
try {
$ca_key = PublicKeyLoader::loadPrivateKey($ca_str_key);
$ca_key = $ca_key->withPadding(RSA::ENCRYPTION_PKCS1 | RSA::SIGNATURE_PKCS1);
if (method_exists($ca_key, 'withPadding')) {
$ca_key = $ca_key->withPadding(RSA::ENCRYPTION_PKCS1 | RSA::SIGNATURE_PKCS1);
}
$ca_cert->setPrivateKey($ca_key);
} catch (NoKeyLoadedException $e) {
syslog(LOG_ERR, 'Cert revocation error: Unable to load CA private key');