SSE enhancement
Do not blind concatenate ints. Lets add a _ between them. So that we can distrinquis them properly Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
659fb3cf06
commit
8c753f87fc
|
@ -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,8 +460,14 @@ class Crypt {
|
|||
$catFile = $this->splitMetaData($keyFileContents, $cipher);
|
||||
|
||||
if ($catFile['signature'] !== false) {
|
||||
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'],
|
||||
$catFile['iv'],
|
||||
|
|
Loading…
Reference in New Issue