Check for nil Password

This commit is contained in:
alexmullins 2015-11-26 18:45:48 -06:00
parent 5a264afc2d
commit 4cb6e8e530
1 changed files with 3 additions and 0 deletions

View File

@ -278,6 +278,9 @@ func newDecryptionReader(r *io.SectionReader, f *File) (io.Reader, error) {
salt := saltpwvv[:saltLen] salt := saltpwvv[:saltLen]
pwvv := saltpwvv[saltLen : saltLen+2] pwvv := saltpwvv[saltLen : saltLen+2]
// generate keys // generate keys
if f.Password == nil {
return nil, ErrPassword
}
decKey, authKey, pwv := generateKeys(f.Password(), salt, keyLen) decKey, authKey, pwv := generateKeys(f.Password(), salt, keyLen)
// check password verifier (pwv) // check password verifier (pwv)
// Change to use crypto/subtle for constant time comparison // Change to use crypto/subtle for constant time comparison