$self->loadDataFile($path,$e)
}
-
+###
+# Perform a macro replacement on tagged strings in a property value.
+##
+sub template { my ($self, $property, %macros) = @_;
+ my $val = $self->anon($property);
+ if($val){
+ foreach my $m(keys %macros){
+ my $v = $macros{$m};
+ $m ="\\\$\\\$\\\$".$m."\\\$\\\$\\\$";
+ $val =~ s/$m/$v/gs;
+ }
+ my $prev;
+ foreach my $m(split(/\$\$\$/,$val)){
+ if(!$prev){
+ $prev = $m;
+ next;
+ }
+ undef $prev;
+ my $pv = $self->anon($m);
+ if(!$pv && exists $self->{$m}){
+ $pv = $self->{$m}#constant($self, '$'.$m);
+ }
+ if($pv){
+ $m = "\\\$\\\$\\\$".$m."\\\$\\\$\\\$";
+ $val =~ s/$m/$pv/gs;
+ }
+ }
+ return $val;
+ }
+}
###
# CNF Instruction tag covered reserved words.
}return;
}
-###
-# Perform a macro replacement on tagged strings in a property value.
-##
-sub template { my ($self, $property, %macros) = @_;
- my $val = $self->anon($property);
- if($val){
- foreach my $m(keys %macros){
- my $v = $macros{$m};
- $m ="\\\$\\\$\\\$".$m."\\\$\\\$\\\$";
- $val =~ s/$m/$v/gs;
- }
- my $prev;
- foreach my $m(split(/\$\$\$/,$val)){
- if(!$prev){
- $prev = $m;
- next;
- }
- undef $prev;
- my $pv = $self->anon($m);
- if(!$pv && exists $self->{$m}){
- $pv = $self->{$m}#constant($self, '$'.$m);
- }
- if($pv){
- $m = "\\\$\\\$\\\$".$m."\\\$\\\$\\\$";
- $val =~ s/$m/$pv/gs;
- }
- }
- return $val;
- }
-}
+
#
#private to parser sub.
sub doProcessCollection{ my($self,$e,$t,$v) = @_;
use warnings;
use feature qw(signatures say);
use Crypt::CBC;
-use Crypt::Blowfish;
+use Crypt::Blowfish;#blow bubba
+use IO::Compress::Xz qw(xz $XzError) ;
+use IO::Uncompress::UnXz qw(unxz $UnXzError) ;
our @DIGITS = "1234567890ABCDEFGHIJKLMWENCARCHIVE" =~ m/./g;
our $cocoon_config = $ENV{HOME}."/.config/PerlCNF/cocoon.cnf";
-header => 'none',
-padding => 'none',
-nodeprecate=>1,
- -pbkdf=>'pbkdf2'
+ -pbkdf=>'randomiv'
)
}, $class;
my $dref;
my $date = CNFDateTime -> now() -> toDateTimeFormat();
if( _passCodeCheck($pass_code) ){
- if(!$config){
- my $encrypted = $self->encrypt($notes);
+ if(!$config){
+ my $compressed;
+ my $status = xz \$notes => \$compressed or die "xz failed: $XzError\n";
+ my $encrypted = $self->encrypt($compressed);
if(-f $cocoon_config){
$config = CNFParser ->new($cocoon_config);
my %dhash = %{$config ->data()};
if($alias eq $row[$idx->{alias}]){
if($pass_code eq $row[$idx->{pass}]){
my $encrypted = $row[$idx->{notes}];
- $row[$idx->{notes}] = $self->decrypt($encrypted);
+ my $decrypted = $self->decrypt($encrypted);
+ my $unzipped;
+ my $status = unxz \$decrypted => \$unzipped or die "xz failed: $XzError\n";
+ $row[$idx->{notes}] = $unzipped;
return @row;
}else{
warn "Error pass_code:$pass_code not is matching with alias:$alias";