mirror of
https://github.com/kairos-io/kcrypt-challenger.git
synced 2025-09-25 06:12:12 +00:00
Implement test that checks invalid cert case
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
)
|
||||
|
||||
var errPartNotFound error = fmt.Errorf("pass for partition not found")
|
||||
var errBadCertificate error = fmt.Errorf("unknown certificate")
|
||||
|
||||
func NewClient() (*Client, error) {
|
||||
conf, err := unmarshalConfig()
|
||||
@@ -103,10 +104,15 @@ func (c *Client) waitPass(p *block.Partition, attempts int) (pass string, err er
|
||||
tries = 0
|
||||
continue
|
||||
}
|
||||
|
||||
if generated { // passphrase is encrypted
|
||||
return c.decryptPassphrase(pass)
|
||||
}
|
||||
|
||||
if err == errBadCertificate { // No need to retry, won't succeed.
|
||||
return
|
||||
}
|
||||
|
||||
if err == nil { // passphrase available, no errors
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user