Skip to content

Commit 3bd7525

Browse files
committed
added explicit zero out for temporary PBE keys - relates to github #2143
1 parent a1f8179 commit 3bd7525

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/src/main/java/org/bouncycastle/util/Arrays.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,19 @@ public static void clear(long[] data)
12171217
}
12181218
}
12191219

1220+
/**
1221+
* Fill input array by zeros
1222+
*
1223+
* @param data input array
1224+
*/
1225+
public static void clear(char[] data)
1226+
{
1227+
if (null != data)
1228+
{
1229+
java.util.Arrays.fill(data, (char)0x00);
1230+
}
1231+
}
1232+
12201233
public static boolean isNullOrContainsNull(Object[] array)
12211234
{
12221235
if (null == array)

0 commit comments

Comments
 (0)