Skip to content
Snippets Groups Projects
Unverified Commit 9975b80d authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

SSE enhancement


Do not blind concatenate ints. Lets add a _ between them. So that we can
distrinquis them properly

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent a7875c24
No related branches found
No related tags found
No related merge requests found
......@@ -189,7 +189,7 @@ class Crypt {
$this->getCipher());
// Create a signature based on the key as well as the current version
$sig = $this->createSignature($encryptedContent, $passPhrase.$version.$position);
$sig = $this->createSignature($encryptedContent, $passPhrase.'_'.$version.'_'.$position);
// combine content to encrypt the IV identifier and actual IV
$catFile = $this->concatIV($encryptedContent, $iv);
......@@ -460,7 +460,13 @@ class Crypt {
$catFile = $this->splitMetaData($keyFileContents, $cipher);
if ($catFile['signature'] !== false) {
$this->checkSignature($catFile['encrypted'], $passPhrase.$version.$position, $catFile['signature']);
try {
// First try the new format
$this->checkSignature($catFile['encrypted'], $passPhrase . '_' . $version . '_' . $position, $catFile['signature']);
} catch (GenericEncryptionException $e) {
// For compatibility with old files check the version without _
$this->checkSignature($catFile['encrypted'], $passPhrase . $version . $position, $catFile['signature']);
}
}
return $this->decrypt($catFile['encrypted'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment