Don't loop forever when passed an incorrect password
This commit is contained in:
parent
1f0d0c98f6
commit
b1e3bd78d1
1 changed files with 6 additions and 1 deletions
|
|
@ -230,8 +230,13 @@ func (pm *PmCrypto) DecryptMessageWithPassword(encrypted string, password string
|
|||
return "", err
|
||||
}
|
||||
|
||||
firstTimeCalled := true
|
||||
var prompt = func(keys []openpgp.Key, symmetric bool) ([]byte, error) {
|
||||
return []byte(password), nil
|
||||
if firstTimeCalled {
|
||||
firstTimeCalled = false
|
||||
return []byte(password), nil
|
||||
}
|
||||
return nil, errors.New("password incorrect")
|
||||
}
|
||||
|
||||
config := &packet.Config{Time: pm.getTimeGenerator()}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue