mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-01-12 15:44:07 +01:00
Miglioramento controlli
This commit is contained in:
parent
b6bc747425
commit
268501b45d
@ -41,7 +41,7 @@ class FatturaElettronica
|
|||||||
if (ends_with($file, '.p7m')) {
|
if (ends_with($file, '.p7m')) {
|
||||||
$file = XML::decodeP7M($this->file);
|
$file = XML::decodeP7M($this->file);
|
||||||
|
|
||||||
if ($file !== false) {
|
if (!empty($file)) {
|
||||||
delete($this->file);
|
delete($this->file);
|
||||||
|
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
|
@ -70,12 +70,12 @@ class XML
|
|||||||
$final_file = $directory.'/'.basename($file, '.p7m');
|
$final_file = $directory.'/'.basename($file, '.p7m');
|
||||||
|
|
||||||
exec('openssl smime -verify -noverify -in "'.$file.'" -inform DER -out "'.$final_file.'"', $output, $cmd);
|
exec('openssl smime -verify -noverify -in "'.$file.'" -inform DER -out "'.$final_file.'"', $output, $cmd);
|
||||||
if ($cmd != 0) {
|
if (!file_exists($final_file)) {
|
||||||
self::der2smime($file);
|
self::der2smime($file);
|
||||||
|
|
||||||
$result = openssl_pkcs7_verify($file, PKCS7_NOVERIFY, '', [], '', $final_file);
|
$result = openssl_pkcs7_verify($file, PKCS7_NOVERIFY, '', [], '', $final_file);
|
||||||
|
|
||||||
if ($result == -1) {
|
if ($result == -1 || $result === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user