Correct check for SNMPv3 SHA-192/256 compability (#12494)

* Correct check for SNMPv3 SHA-192/256 compability

* fixup

* fixup
This commit is contained in:
Jellyfrog
2021-02-10 14:57:12 +01:00
committed by GitHub
parent 7b55863fad
commit 38de49ca30
4 changed files with 40 additions and 34 deletions

View File

@@ -799,15 +799,20 @@ function version_info($remote = false)
}//end version_info()
/**
* checks if System is SNMPv3 SHA2 Capable for Auth Algorithms (SHA-224,SHA-256,SHA-384,SHA-512)
* @return bool
* Checks SNMPv3 capabilities
*
* SHA2 for Auth Algorithms (SHA-224,SHA-256,SHA-384,SHA-512)
* AES-192, AES-256 for Privacy Algorithms
*/
function snmpv3_sha2_capable()
function snmpv3_capabilities(): array
{
$process = new Process([Config::get('snmpget', 'snmpget'), '--help']);
$process->run();
return Str::contains($process->getErrorOutput(), 'SHA-512');
$ret['sha2'] = Str::contains($process->getErrorOutput(), 'SHA-512');
$ret['aes256'] = Str::contains($process->getErrorOutput(), 'AES-256');
return $ret;
}
/**