fix: [mail] S/MIME certificate validation, fixes #6424

pull/6425/head
Jakub Onderka 2020-10-12 11:37:22 +02:00
parent 84141da24a
commit 80a416a7b5
1 changed files with 1 additions and 2 deletions

View File

@ -481,8 +481,7 @@ class SendEmail
throw new Exception('Could not parse certificate');
}
// Purpose '5' should be 'smimeencrypt'
if (!($parsed['purposes'][5][0] === 1 && $parsed['purposes'][5][2] === 'smimeencrypt')) {
if ($parsed['purposes'][X509_PURPOSE_SMIME_ENCRYPT][0] !== true) {
throw new Exception('This certificate cannot be used to encrypt email.');
}