Repository: logging-log4j2 Updated Branches: refs/heads/master fb6f73d48 -> e0d7a551e
[LOG4J2-1896] Update classes in org.apache.logging.log4j.core.net.ssl in APIs from String to char[] for passwords. Add clear secrets API but don't use 'em yet. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e0d7a551 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e0d7a551 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e0d7a551 Branch: refs/heads/master Commit: e0d7a551efaa37fb6094ce268472973040d0cd02 Parents: fb6f73d Author: Gary Gregory <garydgreg...@gmail.com> Authored: Thu Aug 17 15:59:12 2017 -0600 Committer: Gary Gregory <garydgreg...@gmail.com> Committed: Thu Aug 17 15:59:12 2017 -0600 ---------------------------------------------------------------------- .../logging/log4j/core/net/ssl/SslConfiguration.java | 13 +++++++++++++ .../logging/log4j/core/net/ssl/StoreConfiguration.java | 8 ++++++++ 2 files changed, 21 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e0d7a551/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java index 857aa5b..b129184 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/SslConfiguration.java @@ -55,6 +55,18 @@ public class SslConfiguration { this.sslContext = this.createSslContext(); } + /** + * Clears the secret fields in this object but still allow it to operate normally. + */ + public void clearSecrets() { + if (this.keyStoreConfig != null) { + this.keyStoreConfig.clearSecrets(); + } + if (this.trustStoreConfig != null) { + this.trustStoreConfig.clearSecrets(); + } + } + public SSLSocketFactory getSslSocketFactory() { return sslContext.getSocketFactory(); } @@ -207,6 +219,7 @@ public class SslConfiguration { /** * Creates an SslConfiguration from a KeyStoreConfiguration and a TrustStoreConfiguration. + * * @param protocol The protocol, see http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SSLContext * @param keyStoreConfig The KeyStoreConfiguration. * @param trustStoreConfig The TrustStoreConfiguration. http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e0d7a551/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java index f2cb17e..863209e 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/StoreConfiguration.java @@ -35,6 +35,14 @@ public class StoreConfiguration<T> { } /** + * Clears the secret fields in this object. + */ + public void clearSecrets() { + this.location = null; + this.password = null; + } + + /** * @deprecated Use StoreConfiguration(String, char[]) */ @Deprecated