diff options
author | Markus Krogh <markus@nordu.net> | 2018-11-02 13:38:20 +0100 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2018-11-02 13:38:20 +0100 |
commit | b0864b66daa7e25df42f9b33e999ecfac70faa21 (patch) | |
tree | f10dea57fd508e333b11dfd98c22e179b3eea2cd /pwned.go | |
parent | 2fa87628ed738f6bf4be2bf0e3285402b32ebd0f (diff) |
Bump go version + ubuntu. Fix pwned length
Diffstat (limited to 'pwned.go')
-rw-r--r-- | pwned.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -29,11 +29,11 @@ func NewPWDB(fn string) (*pwdb, error) { return nil, err } - const rs = 63 // V2 has fixed width of 63 bytes + const hash_length = 40 // sha1 is 40 chars + const rs = hash_length + 1 // sha1 + newline if stat.Size()%rs != 0 { - return nil, fmt.Errorf("Unexpected password file format (must be a text file with 63 char width starting with sha1)") + return nil, fmt.Errorf("Unexpected password file format (must be a text file with only sha1 + newline)") } - const hash_length = 40 // sha1 is 40 chars return &pwdb{f, int(stat.Size() / rs), rs, hash_length}, nil } |