File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
android-database-sqlcipher/src/main/java/net/sqlcipher/database Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 3737import java .nio .charset .Charset ;
3838import java .text .SimpleDateFormat ;
3939import java .util .ArrayList ;
40+ import java .util .Arrays ;
4041import java .util .HashMap ;
4142import java .util .HashSet ;
4243import java .util .Iterator ;
@@ -118,9 +119,7 @@ public void changePassword(String password) throws SQLiteException {
118119 if (password != null ) {
119120 byte [] keyMaterial = getBytes (password .toCharArray ());
120121 rekey (keyMaterial );
121- for (byte data : keyMaterial ) {
122- data = 0 ;
123- }
122+ Arrays .fill (keyMaterial , (byte ) 0 );
124123 }
125124 }
126125
@@ -143,9 +142,7 @@ public void changePassword(char[] password) throws SQLiteException {
143142 if (password != null ) {
144143 byte [] keyMaterial = getBytes (password );
145144 rekey (keyMaterial );
146- for (byte data : keyMaterial ) {
147- data = 0 ;
148- }
145+ Arrays .fill (keyMaterial , (byte ) 0 );
149146 }
150147 }
151148
@@ -2537,9 +2534,7 @@ public void run() {
25372534 }
25382535 }
25392536 if (keyMaterial != null && keyMaterial .length > 0 ) {
2540- for (byte data : keyMaterial ) {
2541- data = 0 ;
2542- }
2537+ Arrays .fill (keyMaterial , (byte ) 0 );
25432538 }
25442539 }
25452540
You can’t perform that action at this time.
0 commit comments