2 Commits

Author SHA1 Message Date
Luc Didry
e62cb50ab1 Fix bug in cache system 2018-05-07 18:27:07 +02:00
Luc Didry
cf9504bb30 Fix another bug on zip file creation (missing IV on decryption) 2018-04-26 21:10:02 +02:00
3 changed files with 12 additions and 4 deletions

View File

@@ -1,7 +1,13 @@
Revision history for Lutim
0.10.4 2018-05-07
- Fix bug in cache system that would allow someone to view an image with an incorrect decryption key
0.10.3 2018-04-26
- Fix another bug on zip file creation
0.10.2 2018-04-24
- Fix bug on zip file creation
- Fix bug on zip file creation
0.10.1 2018-04-15
- Fix bug on theme creation (#73)

View File

@@ -584,7 +584,7 @@ sub short {
if (defined($image->width) && defined($image->height)) {
($width, $height) = ($image->width, $image->height);
} elsif ($im_loaded) {
my $upload = $c->decrypt($key, $image->path);
my $upload = $c->decrypt($key, $image->path, $image->iv);
my $im = Image::Magick->new;
$im->BlobToImage($upload->slurp);
$width = $im->Get('width');
@@ -724,7 +724,7 @@ sub zip {
}
if ($key) {
$zip->addString($c->decrypt($key, $path), "images/$filename");
$zip->addString($c->decrypt($key, $path, $image->iv), "images/$filename");
} else {
$zip->addFile($path, "images/$filename");
}

View File

@@ -111,10 +111,12 @@ sub _render_file {
}
});
if ($key && $key ne $cache->{key}) {
my $tmp = $c->decrypt($key, $path, $iv);
$cache->{asset} = $tmp;
$c->app->{images_cache}->replace(
$img->short,
{
asset => $c->decrypt($key, $path, $iv),
asset => $tmp,
key => $key
},
);