Skip to content

Commit

Permalink
Improve typing as suggested by review
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Aug 3, 2023
1 parent 5edd9b6 commit f973936
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions apps/encryption/lib/Crypto/Crypt.php
Expand Up @@ -153,9 +153,6 @@ public function getOpenSSLPKey() {
return openssl_pkey_new($config);
}

/**
* get openSSL Config
*/
private function getOpenSSLConfig(): array {
$config = ['private_key_bits' => 4096];
$config = array_merge(
Expand Down Expand Up @@ -532,11 +529,8 @@ private function removePadding($padded, $hasSignature = false): string|false {
* split meta data from encrypted file
* Note: for now, we assume that the meta data always start with the iv
* followed by the signature, if available
*
* @param string $catFile
* @param string $cipher
*/
private function splitMetaData($catFile, $cipher): array {
private function splitMetaData(string $catFile, string $cipher): array {
if ($this->hasSignature($catFile, $cipher)) {
$catFile = $this->removePadding($catFile, true);
$meta = substr($catFile, -93);
Expand All @@ -561,11 +555,9 @@ private function splitMetaData($catFile, $cipher): array {
/**
* check if encrypted block is signed
*
* @param string $catFile
* @param string $cipher
* @throws GenericEncryptionException
*/
private function hasSignature($catFile, $cipher): bool {
private function hasSignature(string $catFile, string $cipher): bool {
$skipSignatureCheck = $this->config->getSystemValueBool('encryption_skip_signature_check', false);

$meta = substr($catFile, -93);
Expand Down

0 comments on commit f973936

Please sign in to comment.