Ignore:
Timestamp:
09/03/09 04:25:41 (15 years ago)
Author:
nanardon
Message:

In SQL base, allow to have a peer of public/private RSA key, then when user set it password it is stored in it clear form but encrypt using public key
The la-encrypt-passwd tools allow to

  • generate or regenerate a new key
  • read password
  • read password to propagate it into another base

Notice the private key is protected by a passwphrase prompt when setting it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm

    r329 r413  
    128128}  
    129129 
     130sub get_global_value { 
     131    my ($self, $varname) = @_; 
     132 
     133    my $sth = $self->db->prepare_cached(q{ 
     134        select val from settings where varname = ? 
     135        }); 
     136    $sth->execute($varname); 
     137    my $res = $sth->fetchrow_hashref; 
     138    $sth->finish; 
     139    $res->{val} 
     140} 
     141 
     142sub set_global_value { 
     143    my ($self, $varname, $value) = @_; 
     144    my $sth = $self->db->prepare(q{ 
     145        update settings set val = ? where varname = ? 
     146        }); 
     147    $sth->execute($value, $varname) == 0 and do { 
     148        my $sth2 = $self->db->prepare(q{ 
     149            insert into settings (val, varname) values (?,?) 
     150            }); 
     151        $sth2->execute($value, $varname); 
     152    }; 
     153} 
     154 
    1301551; 
    131156 
Note: See TracChangeset for help on using the changeset viewer.