allow key rotation in updated plugins

This commit is contained in:
antelle 2020-04-02 16:47:50 +02:00
parent 280ed45199
commit 37914d3cb5
No known key found for this signature in database
GPG Key ID: 094A2F2D6136A4EE
1 changed files with 5 additions and 1 deletions

View File

@ -149,7 +149,11 @@ class Plugin extends Model {
return 'Plugin name mismatch';
}
if (manifest.publicKey !== newManifest.publicKey) {
return 'Public key mismatch';
const wasOfficial = SignatureVerifier.getPublicKeys().includes(manifest.publicKey);
const isOfficial = SignatureVerifier.getPublicKeys().includes(newManifest.publicKey);
if (!wasOfficial || !isOfficial) {
return 'Public key mismatch';
}
}
}