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]
pwvv := saltpwvv[saltLen : saltLen+2]
// generate keys
if f.Password == nil {
return nil, ErrPassword
}
decKey, authKey, pwv := generateKeys(f.Password(), salt, keyLen)
// check password verifier (pwv)
// Change to use crypto/subtle for constant time comparison