Skip to content

Commit

Permalink
Merge branch 'nuumio-KeyMaterialSanitation'
Browse files Browse the repository at this point in the history
  • Loading branch information
developernotes committed Oct 17, 2018
2 parents f2fd709 + 4c6f41c commit cc31191
Showing 1 changed file with 4 additions and 9 deletions.
Expand Up @@ -37,6 +37,7 @@
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
Expand Down Expand Up @@ -118,9 +119,7 @@ public void changePassword(String password) throws SQLiteException {
if (password != null) {
byte[] keyMaterial = getBytes(password.toCharArray());
rekey(keyMaterial);
for(byte data : keyMaterial) {
data = 0;
}
Arrays.fill(keyMaterial, (byte) 0);
}
}

Expand All @@ -143,9 +142,7 @@ public void changePassword(char[] password) throws SQLiteException {
if (password != null) {
byte[] keyMaterial = getBytes(password);
rekey(keyMaterial);
for(byte data : keyMaterial) {
data = 0;
}
Arrays.fill(keyMaterial, (byte) 0);
}
}

Expand Down Expand Up @@ -2537,9 +2534,7 @@ public void run() {
}
}
if(keyMaterial != null && keyMaterial.length > 0) {
for(byte data : keyMaterial) {
data = 0;
}
Arrays.fill(keyMaterial, (byte) 0);
}
}

Expand Down

0 comments on commit cc31191

Please sign in to comment.