Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ All notable changes to `securemessage` will be documented in this file.
Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## Unreleased
[Compare v0.1.1 - Unreleased](https://github.com/exonet/securemessage/compare/v0.1.1...develop)
[Compare v0.1.2 - Unreleased](https://github.com/exonet/securemessage/compare/v0.1.2...develop)

## [v0.1.2](https://github.com/exonet/securemessage/releases/tag/v0.1.2) - 2018-10-03
[Compare v0.1.1 - v0.1.2](https://github.com/exonet/securemessage/compare/v0.1.1...v0.1.2)

### Fixed
- When using the 'getMeta' function of the Laravel adapter the keys are now set correctly.

## [v0.1.1](https://github.com/exonet/securemessage/releases/tag/v0.1.1) - 2018-07-25
[Compare v0.1.0 - v0.1.1](https://github.com/exonet/securemessage/compare/v0.1.0...v0.1.1)
Expand Down
9 changes: 9 additions & 0 deletions src/Laravel/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,17 @@ public function getMeta(string $secureMessageId) : SecureMessage
// Build the SecureMessage as required by the Crypto utility, but only with the data for decrypting the meta.
$secureMessage = new SecureMessage();
$secureMessage->setId($record->id);
$secureMessage->setDatabaseKey($this->laravelEncryption->decrypt($record->key));
$secureMessage->setEncryptedMeta($this->laravelEncryption->decrypt($record->meta));

// Check if the storage key file exists.
if (!$this->storage->exists($record->id)) {
throw new DecryptException('Can not find key file.');
}

// Read and set the storage key.
$secureMessage->setStorageKey($this->laravelEncryption->decrypt($this->storage->get($record->id)));

// Decrypt the meta data.
$meta = $this->secureMessageFactory->decryptMeta($secureMessage);

Expand Down