View | Details | Raw Unified | Return to bug 47652
Collapse All | Expand All

(-)src/java/org/apache/poi/hssf/record/RecordFactoryInputStream.java (-1 / +2 lines)
Lines 23-28 Link Here
23
import org.apache.poi.hssf.eventusermodel.HSSFEventFactory;
23
import org.apache.poi.hssf.eventusermodel.HSSFEventFactory;
24
import org.apache.poi.hssf.eventusermodel.HSSFListener;
24
import org.apache.poi.hssf.eventusermodel.HSSFListener;
25
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
25
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey;
26
import org.apache.poi.EncryptedDocumentException;
26
27
27
/**
28
/**
28
 * A stream based way to get at complete records, with
29
 * A stream based way to get at complete records, with
Lines 97-103 Link Here
97
				key = Biff8EncryptionKey.create(userPassword, fpr.getDocId());
98
				key = Biff8EncryptionKey.create(userPassword, fpr.getDocId());
98
			}
99
			}
99
			if (!key.validate(fpr.getSaltData(), fpr.getSaltHash())) {
100
			if (!key.validate(fpr.getSaltData(), fpr.getSaltHash())) {
100
				throw new RecordFormatException("Password/docId do not correspond to saltData/saltHash");
101
				throw new EncryptedDocumentException("Password/docId do not correspond to saltData/saltHash");
101
			}
102
			}
102
			return new RecordInputStream(original, key, _initialRecordsSize);
103
			return new RecordInputStream(original, key, _initialRecordsSize);
103
		}
104
		}

Return to bug 47652