mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Avoid a NPE if no password was given - use the default office one instead
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1494571 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b1e02dea83
commit
0591f0edbe
@ -96,6 +96,11 @@ public abstract class Decryptor {
|
||||
|
||||
protected byte[] hashPassword(EncryptionInfo info,
|
||||
String password) throws NoSuchAlgorithmException {
|
||||
// If no password was given, use the default
|
||||
if (password == null) {
|
||||
password = DEFAULT_PASSWORD;
|
||||
}
|
||||
|
||||
MessageDigest sha1 = MessageDigest.getInstance("SHA-1");
|
||||
byte[] bytes;
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user