From bb705efb53ddfc34a9b1bb24667f1c4d17a52adf Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 5 Apr 2019 15:31:38 +0200 Subject: store password encrypted --- emails.lps | 120 ++++++++++++++++++++++++++++++------------------------------- unit1.pas | 16 ++++++--- 2 files changed, 72 insertions(+), 64 deletions(-) diff --git a/emails.lps b/emails.lps index aeced4f..c97bed6 100644 --- a/emails.lps +++ b/emails.lps @@ -19,8 +19,9 @@ - - + + + @@ -28,76 +29,75 @@ - - - + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - @@ -116,123 +116,123 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + diff --git a/unit1.pas b/unit1.pas index b2a0833..04f0f52 100644 --- a/unit1.pas +++ b/unit1.pas @@ -36,7 +36,8 @@ type lb: tMouseButton; public { public declarations } - pc: tPopImapClient; + pc: tPopImapClient; + encryptionUser: string; procedure neueNachrichten(sender: tObject); end; @@ -45,7 +46,7 @@ var implementation -uses myStringListUnit, lowLevelUnit, process; +uses myStringListUnit, lowLevelUnit, process, deencrypt; {$R *.lfm} @@ -83,6 +84,12 @@ begin else if s<>'' then raise exception.create(''''+s+''' ist kein gültiger Wert für ''Ton geben'' (ja|nein)!'); + s:=sl.grepFirst('^Encryption-User\s*='); + if erstesArgument(s,'=')<>'' then + encryptionUser:=s + else + raise exception.create('Kein Encryption-User in '''+extractfilepath(application.exename)+'optionen.konf'' angegeben!'); + pc:=tPopImapClient.create; s:=sl.grepFirst('^Timeout\s*='); if erstesArgument(s,'=')<>'' then @@ -103,7 +110,7 @@ begin raise exception.create('Kein User in '''+extractfilepath(application.exename)+'optionen.konf'' angegeben!'); s:=sl.grepFirst('^Pass\s*='); if erstesArgument(s,'=')<>'' then - pc.pass:=s + pc.pass:=decrypt(s) else raise exception.create('Kein Pass in '''+extractfilepath(application.exename)+'optionen.konf'' angegeben!'); found:=false; @@ -179,12 +186,13 @@ begin sl.addWithLineBreaks('gültiger Adressat = '+umbrechen(copy(pc.gueltigerAdressat,2,length(pc.gueltigerAdressat)-2),'|',true,'gültiger Adressat = ')); + sl.add('Encryption-User = ' + encryptionUser); sl.add('Timeout = ' + floatToStr(pc.timeOut)); if pc.sshUser<>'' then sl.add('ssh-User = ' + pc.sshUser); sl.add('Host = ' + pc.host); sl.add('User = ' + pc.user); - sl.add('Pass = ' + pc.pass); + sl.add('Pass = ' + encrypt(pc.pass, encryptionUser)); sl.add('Port = ' + intToStr(pc.port)); case pc.mailProtocol of mpPop: -- cgit v1.2.3-70-g09d2