Skip to content

Commit

Permalink
Définition de l'env gpg
Browse files Browse the repository at this point in the history
  • Loading branch information
wincelau committed Jul 30, 2024
1 parent f261344 commit 693ef9a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cryptography.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private function getFiles($isGpg) {
}

public function encrypt() {
putenv('HOME='.sys_get_temp_dir());
foreach ($this->getFiles(false) as $file) {
$outputFile = $file.".gpg";
$command = "gpg --no-options --batch --passphrase $this->symmetricKey --symmetric --cipher-algo AES256 -o $outputFile $file";
Expand All @@ -47,7 +48,7 @@ public function decrypt() {
return false;
}
$decryptFolder = sys_get_temp_dir()."/".uniqid('pdfsignature.decrypted.'.getmypid(), true);
echo $decryptFolder."\n";
putenv('HOME='.$decryptFolder);
mkdir($decryptFolder);
foreach ($this->getFiles(true) as $file) {
$outputFile = $decryptFolder."/".str_replace(".gpg", "", basename($file));
Expand Down

0 comments on commit 693ef9a

Please sign in to comment.