mirror of https://github.com/MISP/MISP
fix: [test] Set GnuPG.email variable
parent
8338659396
commit
f84f304254
|
@ -83,6 +83,7 @@ install:
|
|||
# /!\ VERY INSECURE BUT FASTER ON THE BUILD ENV OF TRAVIS
|
||||
- sudo cp -a /dev/urandom /dev/random
|
||||
- sudo gpg --no-tty --no-permission-warning --pinentry-mode=loopback --passphrase "travistest" --homedir `pwd`/.gnupg --gen-key --batch `pwd`/travis/gpg
|
||||
- sudo gpg --list-secret-keys --homedir `pwd`/.gnupg
|
||||
# change perms
|
||||
- sudo chown -R $USER:www-data `pwd`
|
||||
- sudo chmod +x /home/travis/build
|
||||
|
@ -105,6 +106,7 @@ install:
|
|||
- sudo -E su $USER -c 'app/Console/cake Admin setSetting "MISP.redis_port" 6379'
|
||||
- sudo -E su $USER -c 'app/Console/cake Admin setSetting "MISP.redis_database" 13'
|
||||
- sudo -E su $USER -c 'app/Console/cake Admin setSetting "MISP.redis_password" ""'
|
||||
- sudo -E su $USER -c 'app/Console/cake Admin setSetting "GnuPG.email" "info@admin.test"'
|
||||
- sudo -E su $USER -c 'app/Console/cake Admin setSetting "GnuPG.homedir" "`pwd`/.gnupg"'
|
||||
- sudo -E su $USER -c 'app/Console/cake Admin setSetting "GnuPG.password" "travistest"'
|
||||
- sudo -E su $USER -c 'app/Console/cake Admin updateGalaxies'
|
||||
|
|
|
@ -390,11 +390,16 @@ class SendEmail
|
|||
}
|
||||
|
||||
try {
|
||||
$this->gpg->addSignKey(Configure::read('GnuPG.email'), Configure::read('GnuPG.password'));
|
||||
$gnupgEmail = Configure::read('GnuPG.email');
|
||||
if (empty($gnupgEmail)) {
|
||||
throw new Exception("Email signing is enabled but variable 'GnuPG.email' is not set.");
|
||||
}
|
||||
|
||||
$this->gpg->addSignKey($gnupgEmail, Configure::read('GnuPG.password'));
|
||||
$this->signByGpg($email, $replyToUser);
|
||||
$email->addHeaders(array('Autocrypt' => $this->generateAutocrypt($gnupgEmail)));
|
||||
$this->gpg->clearSignKeys();
|
||||
|
||||
$email->addHeaders(array('Autocrypt' => $this->generateAutocrypt(Configure::read('GnuPG.email'))));
|
||||
$signed = true;
|
||||
} catch (Exception $e) {
|
||||
throw new SendEmailException("The message could not be signed.", 0, $e);
|
||||
|
|
|
@ -3,5 +3,5 @@ Key-Length: 1024
|
|||
Subkey-Type: RSA
|
||||
Subkey-Length: 1024
|
||||
Name-Real: MISP travis
|
||||
Name-Email: misp@travis.key
|
||||
Name-Email: info@admin.test
|
||||
Expire-Date: 0
|
||||
|
|
Loading…
Reference in New Issue