Skip to content

Commit

Permalink
Disable deleting/renaming master (close #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdrop committed Sep 23, 2016
1 parent 3f88264 commit 6eca27e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/me/xdrop/passlock/core/PasswordManagerAES.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public byte[] getPassword(String reference, char[] masterKey)
@Override
public void rename(String reference, String newReference) throws RefNotFoundException {

if(reference.equalsIgnoreCase("master")) throw new RefNotFoundException();

LOG.debug("Renaming " + reference + " to " + newReference + "...");
PasswordEntry<AESEncryptionData> passwordEntry = datasource.getPass(reference);

Expand Down Expand Up @@ -158,6 +160,8 @@ public void updatePassword(String reference, char[] masterKey, char[] newPasswor
@Override
public void deletePassword(String reference) throws RefNotFoundException {

if(reference.equalsIgnoreCase("master")) throw new RefNotFoundException();

datasource.delPass(reference);

}
Expand Down

0 comments on commit 6eca27e

Please sign in to comment.